@objectstack/console 14.6.0 → 14.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/dist/.objectui-sha +1 -1
  2. package/dist/assets/{AdapterProvider-cnK1q1oP.js → AdapterProvider-CmeZULrO.js} +1 -1
  3. package/dist/assets/{AiPendingActionsPage-mX_Izb42.js → AiPendingActionsPage-C4Iq12It.js} +1 -1
  4. package/dist/assets/{ApiConsolePage-fUV9bmEg.js → ApiConsolePage-CVxWz2Fc.js} +1 -1
  5. package/dist/assets/AppDocsIndex-_Nk6Vrm0.js +1 -0
  6. package/dist/assets/{AppManagementPage-BRmzB5eR.js → AppManagementPage-Ds4z81em.js} +1 -1
  7. package/dist/assets/ApprovalsInboxPage-BYmqtmb8.js +1 -0
  8. package/dist/assets/{AuditLogPage-REsiCTKG.js → AuditLogPage-BY42e7b1.js} +1 -1
  9. package/dist/assets/{ComponentNavView-B4EBSM-o.js → ComponentNavView-CPizP2rl.js} +1 -1
  10. package/dist/assets/ConsoleFloatingChatbot-vRAPnn56.js +1 -0
  11. package/dist/assets/{CreateViewDialog-BhCe1ZPc.js → CreateViewDialog-C6DeiGi1.js} +1 -1
  12. package/dist/assets/DashboardView-CZ3rnuQw.js +1 -0
  13. package/dist/assets/{DeveloperHubPage-B6pD0HUk.js → DeveloperHubPage-cynqEJzi.js} +1 -1
  14. package/dist/assets/DocShell-DowMXJqg.js +1 -0
  15. package/dist/assets/{ExpressionProvider-D94jBDAc.js → ExpressionProvider-jYh8yBEi.js} +1 -1
  16. package/dist/assets/{FlowRunsPage-C4Setjuz.js → FlowRunsPage-BsxDtVro.js} +1 -1
  17. package/dist/assets/{IntegrationsPage-EOVS24Ho.js → IntegrationsPage-Dt3JjnPR.js} +1 -1
  18. package/dist/assets/{InterfaceListPage-BFlwb0U7.js → InterfaceListPage-8ZC2DL6l.js} +1 -1
  19. package/dist/assets/{ManagedByBadge-Dpgfl255.js → ManagedByBadge-DySgRsRf.js} +1 -1
  20. package/dist/assets/{MarketplaceAccessDenied-DuO_FDoh.js → MarketplaceAccessDenied-CQo3oKUv.js} +1 -1
  21. package/dist/assets/{MarketplaceInstalledPage-4MFyBXDW.js → MarketplaceInstalledPage-COPjvdZD.js} +1 -1
  22. package/dist/assets/{MarketplacePackagePage-BDeaeKiT.js → MarketplacePackagePage-BL5_Fzlm.js} +1 -1
  23. package/dist/assets/{MarketplacePage-DXMWpCHb.js → MarketplacePage-BnHkiwG_.js} +1 -1
  24. package/dist/assets/MetadataInspector-mHEFcIlV.js +1 -0
  25. package/dist/assets/{MetadataProvider-C8ABa_gQ.js → MetadataProvider-DRMpRtkE.js} +1 -1
  26. package/dist/assets/{MonacoImpl-nyLaER8_.js → MonacoImpl-_--K1JSa.js} +1 -1
  27. package/dist/assets/ObjectDataPage-D9wwntH8.js +1 -0
  28. package/dist/assets/PageView-Bvw39DGp.js +1 -0
  29. package/dist/assets/{ProfilePage-2H6e2j4o.js → ProfilePage-CkS1AQDC.js} +1 -1
  30. package/dist/assets/{PublicFormsPage-DXYBK10A.js → PublicFormsPage-onVYVDnz.js} +1 -1
  31. package/dist/assets/RecordDetailView-DsaGwX7Z.js +2 -0
  32. package/dist/assets/RecordFormPage-B8hs2UT_.js +1 -0
  33. package/dist/assets/ReportDefaultInspector-DacLe5p0.js +3 -0
  34. package/dist/assets/ReportView-C5EokVMt.js +2 -0
  35. package/dist/assets/{SearchResultsPage-B3ShD29d.js → SearchResultsPage-zgmMi_LJ.js} +1 -1
  36. package/dist/assets/{SettingsHub-DgLunUQU.js → SettingsHub-D73rzMbT.js} +1 -1
  37. package/dist/assets/{SettingsView-DFfL8vn4.js → SettingsView-BHmgUtG_.js} +1 -1
  38. package/dist/assets/{SystemHubPage-A9Z1FplZ.js → SystemHubPage-HiWUvHtN.js} +1 -1
  39. package/dist/assets/abnfDiagram-VRR7QNED-BM2gIA2H.js +1 -0
  40. package/dist/assets/appRoute-C7XNGt8B.js +1 -0
  41. package/dist/assets/architecture-TIHT7OUA-X9gN3Z_J.js +1 -0
  42. package/dist/assets/architectureDiagram-ZJ3FMSHR-wyeItulr.js +36 -0
  43. package/dist/assets/assistantBus-cGcVZa3R.js +1 -0
  44. package/dist/assets/{blockDiagram-677ZJIJ3-BmONypzo.js → blockDiagram-677ZJIJ3-BybRqe6u.js} +2 -2
  45. package/dist/assets/{c4Diagram-LMCZKHZV-DqIiaVjm.js → c4Diagram-LMCZKHZV-CZhtNS_4.js} +2 -2
  46. package/dist/assets/channel-BAx__6e1.js +1 -0
  47. package/dist/assets/{chunk-32BRIVSS-BbTX8O4m.js → chunk-32BRIVSS-CjQ2uFsO.js} +1 -1
  48. package/dist/assets/{chunk-52WLFC77-DkgICN4F.js → chunk-52WLFC77-BBx3j8yk.js} +1 -1
  49. package/dist/assets/chunk-5FCAYU7R-w3UK8d6o.js +1 -0
  50. package/dist/assets/chunk-5HE753X5-Cg3JdNF3.js +1 -0
  51. package/dist/assets/chunk-5JV3BV7I-Dm-WSvPI.js +1 -0
  52. package/dist/assets/chunk-5TONJI2A-CQhZ6bam.js +2 -0
  53. package/dist/assets/chunk-BIQX33UG-_A6SWMTr.js +1 -0
  54. package/dist/assets/{chunk-C7G6YPKG-UMP_bNDd.js → chunk-C7G6YPKG-CrZlt4pv.js} +1 -1
  55. package/dist/assets/chunk-CQNSW5MT-DaOzt4Yv.js +1 -0
  56. package/dist/assets/chunk-CYSBUYHQ-Dr63T7GU.js +1 -0
  57. package/dist/assets/chunk-EMLP6XTP-BYfeYg3o.js +1 -0
  58. package/dist/assets/{chunk-EX3LRPZG-B0dJ64Ff.js → chunk-EX3LRPZG-x9nXH4xc.js} +2 -2
  59. package/dist/assets/{chunk-FWX5IMBZ-B8cCL4T7.js → chunk-FWX5IMBZ-cqzp-iMz.js} +1 -1
  60. package/dist/assets/{chunk-HOUHSVGY-B5nScni0.js → chunk-HOUHSVGY-Bfkm0El3.js} +1 -1
  61. package/dist/assets/{chunk-ICXQ74PX-zJg8KmvA.js → chunk-ICXQ74PX-WsDRuBhL.js} +1 -1
  62. package/dist/assets/chunk-JG7HCLWE-Dj9pjBYh.js +2 -0
  63. package/dist/assets/{chunk-KEIR6QF5-CxDrFr0l.js → chunk-KEIR6QF5-DtEGfq38.js} +4 -4
  64. package/dist/assets/{chunk-MOJQB5TN-DBKCpvOi.js → chunk-MOJQB5TN-K_QM_tTs.js} +1 -1
  65. package/dist/assets/chunk-MOZMSUNE-DxgOd8pF.js +1 -0
  66. package/dist/assets/{chunk-OGEWGWER-bKk51Nxt.js → chunk-OGEWGWER-CSkoB3Mi.js} +1 -1
  67. package/dist/assets/chunk-OSBZ3O6U-BSRxNamX.js +1 -0
  68. package/dist/assets/{chunk-PUDLZKDR-CKn_9iXM.js → chunk-PUDLZKDR-BUt9iFAU.js} +3 -3
  69. package/dist/assets/{chunk-Q4XR5HBZ-BP9atbVx.js → chunk-Q4XR5HBZ-B99LraLe.js} +1 -1
  70. package/dist/assets/chunk-QBLGF6JB-Xeo4xx7q.js +1 -0
  71. package/dist/assets/chunk-R7FJI6CG-D2Ok5kyf.js +1 -0
  72. package/dist/assets/{chunk-RYQCIY6F-B5RR1tIz.js → chunk-RYQCIY6F-CdJb5y8u.js} +1 -1
  73. package/dist/assets/chunk-U6XO7XAA-Cwwl_Wmn.js +2 -0
  74. package/dist/assets/{chunk-V7JOEXUC-DTerDTcg.js → chunk-V7JOEXUC-CzVnJgzj.js} +2 -2
  75. package/dist/assets/chunk-VAUOI2AC-HYDQgaka.js +1 -0
  76. package/dist/assets/{chunk-VR4S4FIN-jB_W-MHs.js → chunk-VR4S4FIN-B2IyRlJ4.js} +1 -1
  77. package/dist/assets/{chunk-WYO6CB5R-Cndg0Yo5.js → chunk-WYO6CB5R-C0_XZtpj.js} +2 -2
  78. package/dist/assets/chunk-XXDRQBXY-CtU5D9C8.js +1 -0
  79. package/dist/assets/chunk-YOTPTUD7-7OTU2RwK.js +1 -0
  80. package/dist/assets/{chunk-ZGVPDNZ5-BUUSzPje.js → chunk-ZGVPDNZ5-Bq7O6ELQ.js} +1 -1
  81. package/dist/assets/classDiagram-OUVF2IWQ-DiVkGMIZ.js +1 -0
  82. package/dist/assets/classDiagram-v2-EOCWNBFH-DiVkGMIZ.js +1 -0
  83. package/dist/assets/cose-bilkent-JH36ORCC-DqKYLwMN.js +1 -0
  84. package/dist/assets/cynefin-VYW2F7L2-C94HS-Ni.js +1 -0
  85. package/dist/assets/cynefinDiagram-TSTJHNR4-CFApUIdk.js +62 -0
  86. package/dist/assets/cytoscape.esm-CQFVGiJu.js +321 -0
  87. package/dist/assets/{dagre-VKFMJZFB-Crs38V5P.js → dagre-VKFMJZFB-D4HlgjaA.js} +1 -1
  88. package/dist/assets/{dagre-CXRCoUWR.js → dagre-dpRSp0QF.js} +1 -1
  89. package/dist/assets/data-adapter-BaIWVzG-.js +7 -0
  90. package/dist/assets/diagram-FQU43EPY-BcnxfyH-.js +3 -0
  91. package/dist/assets/{diagram-G47NLZAW-CSNJrWDK.js → diagram-G47NLZAW-CJxJUVu9.js} +1 -1
  92. package/dist/assets/diagram-NH7WQ7WH-DmBVlyYR.js +24 -0
  93. package/dist/assets/{diagram-OA4YK3LP-C2A07yOA.js → diagram-OA4YK3LP-CkaF9SQg.js} +3 -3
  94. package/dist/assets/diagram-WEI45ONY-8cpfjoG3.js +41 -0
  95. package/dist/assets/{dist-YwlXXOlT.js → dist-B4b49_J4.js} +1 -1
  96. package/dist/assets/ebnfDiagram-CCIWWBDH-kX04JbNj.js +1 -0
  97. package/dist/assets/{erDiagram-Q63AITRT-DjK6P1sf.js → erDiagram-Q63AITRT-GjnOtXoL.js} +2 -2
  98. package/dist/assets/eventmodeling-45OFAUF4-BuchSCe8.js +1 -0
  99. package/dist/assets/{exceljs.min-Dpb6mnud.js → exceljs.min-BSnPgFSx.js} +1 -1
  100. package/dist/assets/flowDiagram-23GEKE2U-CpcHvuan.js +1 -0
  101. package/dist/assets/{framework-CWU64Lvg.js → framework-DNWcCoBP.js} +8 -8
  102. package/dist/assets/{ganttDiagram-NO4QXBWP-UPhpWlEd.js → ganttDiagram-NO4QXBWP-7HpPOGwX.js} +2 -2
  103. package/dist/assets/{getIcon-p-vXfFiY.js → getIcon-DGciRPQd.js} +1 -1
  104. package/dist/assets/gitGraph-TEB2WS4Q-B2hHXR-t.js +1 -0
  105. package/dist/assets/gitGraphDiagram-IHSO6WYX-BgBKFUwZ.js +106 -0
  106. package/dist/assets/{graphlib-B8gBHxth.js → graphlib-DS17s2tU.js} +1 -1
  107. package/dist/assets/{highlighted-body-OFNGDK62-CcYD5yKj.js → highlighted-body-OFNGDK62-obGa3VW9.js} +1 -1
  108. package/dist/assets/{i18n-DGsfMUMn.js → i18n-DzI3zFKr.js} +3 -3
  109. package/dist/assets/index-CETzvR9k.js +2 -0
  110. package/dist/assets/index-DZuzAri6.css +2 -0
  111. package/dist/assets/info-DKCQHKI2-B_PilpBz.js +1 -0
  112. package/dist/assets/infoDiagram-FWYZ7A6U-CTsG_9Mj.js +2 -0
  113. package/dist/assets/infrastructure-Bc4DRENl.js +3 -0
  114. package/dist/assets/{ishikawaDiagram-FXEZZL3T-DvmRhm8H.js → ishikawaDiagram-FXEZZL3T-DgMu6-jd.js} +2 -2
  115. package/dist/assets/{journeyDiagram-5HDEW3XC-DFf6bjOX.js → journeyDiagram-5HDEW3XC-CKI4PBJp.js} +2 -2
  116. package/dist/assets/{kanban-definition-HUTT4EX6-DLK5X8Ol.js → kanban-definition-HUTT4EX6-ChvGKWDx.js} +2 -2
  117. package/dist/assets/{katex-CddkPoXu.js → katex-B7rAX3Vi.js} +1 -1
  118. package/dist/assets/{map-DsCK-0Cs.js → map-BaFkSB1l.js} +1 -1
  119. package/dist/assets/marketplaceApi-BZG2zqqI.js +1 -0
  120. package/dist/assets/mermaid-GHXKKRXX-zDa01SPQ.js +1 -0
  121. package/dist/assets/mermaid-parser.core-B2-C9kB8.js +3 -0
  122. package/dist/assets/{mermaid.core-D3axazyv.js → mermaid.core-CskcjgHM.js} +2 -2
  123. package/dist/assets/{metadata-admin-R79BWSDJ.js → metadata-admin-B3pnFq3D.js} +10 -10
  124. package/dist/assets/{mindmap-definition-LN4V7U3C-DwbonLR_.js → mindmap-definition-LN4V7U3C-BSAiSefe.js} +2 -2
  125. package/dist/assets/packet-7NZHBO7P-qOo2g-vE.js +1 -0
  126. package/dist/assets/pegDiagram-2B236MQR-BUG9TR1Z.js +1 -0
  127. package/dist/assets/pie-RZYD4A2V-U1Vrb5_c.js +1 -0
  128. package/dist/assets/{pieDiagram-ENE6RG2P-D8jBhNXT.js → pieDiagram-ENE6RG2P-CqKv9PBi.js} +3 -3
  129. package/dist/assets/{plugin-calendar-GOvhSPjZ.js → plugin-calendar-DI8_y72D.js} +1 -1
  130. package/dist/assets/plugin-charts-8kHRsJ26.js +7 -0
  131. package/dist/assets/plugin-chatbot-5rciOKdr.js +120 -0
  132. package/dist/assets/{plugin-dashboard-N2kUovsm.js → plugin-dashboard-g6z_zZXP.js} +3 -3
  133. package/dist/assets/plugin-form-DWcrPPUr.js +1 -0
  134. package/dist/assets/plugin-gantt-BmusZEIw.js +100 -0
  135. package/dist/assets/plugin-grid-DdzrFURM.js +8 -0
  136. package/dist/assets/plugin-kanban-DtXDjkdV.js +1 -0
  137. package/dist/assets/{plugin-map-CXsqUoPv.js → plugin-map-B7RVCjPN.js} +1 -1
  138. package/dist/assets/{plugin-markdown-CFO9Lenx.js → plugin-markdown-hWqBbKBQ.js} +1 -1
  139. package/dist/assets/plugin-report-Fk8OwuMv.js +59 -0
  140. package/dist/assets/{plugin-timeline-3MSv2v9S.js → plugin-timeline-BLradJ31.js} +1 -1
  141. package/dist/assets/{plugin-tree-_3HdWuAy.js → plugin-tree-Dd-qjC-G.js} +1 -1
  142. package/dist/assets/plugin-view-Beo3HWpE.js +1 -0
  143. package/dist/assets/plugins-views-D0GqJrx_.js +4 -0
  144. package/dist/assets/preferLocal-CKqyhTP9.js +1 -0
  145. package/dist/assets/{quadrantDiagram-ABIIQ3AL-Do3adYzz.js → quadrantDiagram-ABIIQ3AL-DyfgU6pe.js} +2 -2
  146. package/dist/assets/radar-I7S5WNFK-BXCATs_F.js +1 -0
  147. package/dist/assets/railroad-3IZDKUUU-M5RydKKn.js +1 -0
  148. package/dist/assets/railroad-abnf-AHOZXSZD-Cx_YZh-R.js +1 -0
  149. package/dist/assets/railroad-ebnf-EBAXGLYW-u_O-iXWA.js +1 -0
  150. package/dist/assets/railroad-peg-LSFZ7HO6-8zQc29Q0.js +1 -0
  151. package/dist/assets/railroadDiagram-RFXS5EU6-DOOVaoMM.js +1 -0
  152. package/dist/assets/{requirementDiagram-TGXJPOKE-CClkXauU.js → requirementDiagram-TGXJPOKE-B0370dfa.js} +2 -2
  153. package/dist/assets/{sankeyDiagram-HTMAVEWB-DlUFch6E.js → sankeyDiagram-HTMAVEWB-BAioZail.js} +2 -2
  154. package/dist/assets/{sequenceDiagram-DBY2YBRQ-BEDTwji4.js → sequenceDiagram-DBY2YBRQ-B20vuf87.js} +3 -3
  155. package/dist/assets/{skeletons-ySdMMgAT.js → skeletons-Dc-JqV4x.js} +1 -1
  156. package/dist/assets/{src-D0ZYDfff.js → src-CKPhOIOh.js} +1 -1
  157. package/dist/assets/{src-CSRoqdRD.js → src-Cglm_8jd.js} +4 -4
  158. package/dist/assets/src-DZVwE2OF.js +18 -0
  159. package/dist/assets/src-DxI3szM2.js +1 -0
  160. package/dist/assets/{src-X8yirhNO.js → src-Ep8btdv1.js} +1 -1
  161. package/dist/assets/{stateDiagram-2N3HPSRC-BN6M4MGy.js → stateDiagram-2N3HPSRC-BScu2B9X.js} +1 -1
  162. package/dist/assets/stateDiagram-v2-6OUMAXLB-9fyTUlZR.js +1 -0
  163. package/dist/assets/surfaceAgent-DPt23-K5.js +1 -0
  164. package/dist/assets/swimlanes-5IMT3BWC-VepjEXMA.js +1 -0
  165. package/dist/assets/swimlanesDiagram-G3AALYLV-i6IYZT2a.js +8 -0
  166. package/dist/assets/{timeline-definition-FHXFAJF6-B6Oiv_gP.js → timeline-definition-FHXFAJF6-CvpwpY5P.js} +2 -2
  167. package/dist/assets/treeView-QDETBFTQ-BiM0w_uS.js +1 -0
  168. package/dist/assets/treemap-6X3UGDF4-CuKHZODJ.js +1 -0
  169. package/dist/assets/{types-B99y2QyO.js → types-bxB_p8fZ.js} +1 -1
  170. package/dist/assets/ui-components-CmbUYw-E.js +42 -0
  171. package/dist/assets/ui-layout-elT9p0KY.js +1 -0
  172. package/dist/assets/use-book-data-BNn214nk.js +1 -0
  173. package/dist/assets/{useMetadata-DemWIEqg.js → useMetadata-B84fbReE.js} +1 -1
  174. package/dist/assets/{useOpenRecordList-B3tjtz1e.js → useOpenRecordList-C75NAaDm.js} +1 -1
  175. package/dist/assets/{usePackageL10n-CiFMHfKe.js → usePackageL10n-DfeTyD2w.js} +1 -1
  176. package/dist/assets/useRecordApprovals-CwD1sHs0.js +1 -0
  177. package/dist/assets/utils-Bxty7IIa.js +1 -0
  178. package/dist/assets/{vendor-charts-D_CNNxD5.js → vendor-charts-HLBqza5P.js} +6 -6
  179. package/dist/assets/vendor-dndkit-DoG7p74h.js +5 -0
  180. package/dist/assets/vendor-i18n-ByHglwq-.js +1 -0
  181. package/dist/assets/{vendor-icons-core-DvLgTVYc.js → vendor-icons-core-CO5pY7RP.js} +1 -1
  182. package/dist/assets/{vendor-markdown-BJvgKhXw.js → vendor-markdown-DlkSIxwM.js} +25 -25
  183. package/dist/assets/vendor-objectstack-BjCqbVaM.js +96 -0
  184. package/dist/assets/vendor-radix-CWCRv2pn.js +46 -0
  185. package/dist/assets/{vendor-react-BGDDiZfJ.js → vendor-react-BKSb6vFP.js} +3 -3
  186. package/dist/assets/vendor-sentry-C3ouQ5cr.js +501 -0
  187. package/dist/assets/{vendor-ui-utils-BzQBRdq3.js → vendor-ui-utils-D-WJ115h.js} +1 -1
  188. package/dist/assets/{vennDiagram-L72KCM5P-DqRcgOxS.js → vennDiagram-L72KCM5P-DlCQcm_6.js} +2 -2
  189. package/dist/assets/wardley-OPB4EBWU-zwaHU-Tl.js +1 -0
  190. package/dist/assets/{wardleyDiagram-EHGQE667-BDyIMWfB.js → wardleyDiagram-EHGQE667-mesER_Po.js} +3 -3
  191. package/dist/assets/{xychartDiagram-FW5EYKEG-BRNQk20I.js → xychartDiagram-FW5EYKEG-cODEcpNB.js} +2 -2
  192. package/dist/index.html +6 -6
  193. package/package.json +1 -1
  194. package/dist/assets/AppDocsIndex-Bzh_4ehZ.js +0 -1
  195. package/dist/assets/ApprovalsInboxPage-DKgnvZ-2.js +0 -1
  196. package/dist/assets/ConsoleFloatingChatbot-BW-g5YTu.js +0 -1
  197. package/dist/assets/DashboardView-CUXRWKPH.js +0 -1
  198. package/dist/assets/MetadataInspector-YoFTAkMA.js +0 -1
  199. package/dist/assets/ObjectDataPage-BSvqdmym.js +0 -1
  200. package/dist/assets/PageView-Dlpz3HgH.js +0 -1
  201. package/dist/assets/RecordDetailView-CEdkDgV8.js +0 -9
  202. package/dist/assets/RecordFormPage-Bj3lDGqC.js +0 -1
  203. package/dist/assets/ReportDefaultInspector-BNtsE5kW.js +0 -3
  204. package/dist/assets/ReportView-COxfnluU.js +0 -2
  205. package/dist/assets/abnfDiagram-VRR7QNED-o_fBNeYD.js +0 -1
  206. package/dist/assets/appRoute-1sYdkwBz.js +0 -1
  207. package/dist/assets/architecture-TIHT7OUA-BF_0SrOH.js +0 -1
  208. package/dist/assets/architectureDiagram-ZJ3FMSHR-Bk_LES5L.js +0 -36
  209. package/dist/assets/assistantBus-BFk4fCbM.js +0 -1
  210. package/dist/assets/channel-CvRTB8GE.js +0 -1
  211. package/dist/assets/chunk-VAUOI2AC-BrcFPe7Z.js +0 -1
  212. package/dist/assets/chunk-XXDRQBXY-DGANY6E3.js +0 -1
  213. package/dist/assets/classDiagram-OUVF2IWQ-BGL42sFI.js +0 -1
  214. package/dist/assets/classDiagram-v2-EOCWNBFH-BGL42sFI.js +0 -1
  215. package/dist/assets/cose-bilkent-JH36ORCC-DJ-X6wmF.js +0 -1
  216. package/dist/assets/cynefin-VYW2F7L2-CXt4AgYW.js +0 -1
  217. package/dist/assets/cynefinDiagram-TSTJHNR4-C5mKt5aU.js +0 -62
  218. package/dist/assets/cytoscape.esm-B3I8pqwA.js +0 -321
  219. package/dist/assets/data-adapter-CAqKExcJ.js +0 -7
  220. package/dist/assets/diagram-FQU43EPY-Bkx8ccpS.js +0 -3
  221. package/dist/assets/diagram-NH7WQ7WH-PaRAbfdR.js +0 -24
  222. package/dist/assets/diagram-WEI45ONY-BEyyGNpU.js +0 -41
  223. package/dist/assets/ebnfDiagram-CCIWWBDH-CtfwkNuv.js +0 -1
  224. package/dist/assets/eventmodeling-45OFAUF4-Dmacb12o.js +0 -1
  225. package/dist/assets/flowDiagram-23GEKE2U-DfQvGNQk.js +0 -1
  226. package/dist/assets/gitGraph-TEB2WS4Q-ChM6j6Bd.js +0 -1
  227. package/dist/assets/gitGraphDiagram-IHSO6WYX-B6Qcltd9.js +0 -106
  228. package/dist/assets/index-BhMd7RVY.js +0 -2
  229. package/dist/assets/index-Dt-GIgSI.css +0 -2
  230. package/dist/assets/info-DKCQHKI2-C0RTkygr.js +0 -1
  231. package/dist/assets/infoDiagram-FWYZ7A6U-CgEoZeWY.js +0 -2
  232. package/dist/assets/infrastructure-DexdbqHf.js +0 -3
  233. package/dist/assets/marketplaceApi-1mMRJWDq.js +0 -1
  234. package/dist/assets/mermaid-GHXKKRXX-DWvjDOK-.js +0 -1
  235. package/dist/assets/mermaid-parser.core-DV_Ys_OF.js +0 -6
  236. package/dist/assets/packet-7NZHBO7P-DSHvkxBR.js +0 -1
  237. package/dist/assets/pegDiagram-2B236MQR-B4IMkAIV.js +0 -1
  238. package/dist/assets/pie-RZYD4A2V-DjNUdL88.js +0 -1
  239. package/dist/assets/plugin-charts-DPNohuuV.js +0 -7
  240. package/dist/assets/plugin-chatbot-BT49v2CR.js +0 -120
  241. package/dist/assets/plugin-form-QFhBvb96.js +0 -1
  242. package/dist/assets/plugin-gantt-2HGBxhYq.js +0 -93
  243. package/dist/assets/plugin-grid-qkHiovZ2.js +0 -8
  244. package/dist/assets/plugin-kanban-D8kWLfql.js +0 -1
  245. package/dist/assets/plugin-report-CH4uZunJ.js +0 -59
  246. package/dist/assets/plugin-view-CTBpbehM.js +0 -1
  247. package/dist/assets/plugins-views-BxKprmRN.js +0 -4
  248. package/dist/assets/radar-I7S5WNFK-qO0bWLwF.js +0 -1
  249. package/dist/assets/railroad-3IZDKUUU-CAj9esX-.js +0 -1
  250. package/dist/assets/railroad-abnf-AHOZXSZD-Ci_Yg729.js +0 -1
  251. package/dist/assets/railroad-ebnf-EBAXGLYW-Tz7H2Jrw.js +0 -1
  252. package/dist/assets/railroad-peg-LSFZ7HO6-BJIalSaK.js +0 -1
  253. package/dist/assets/railroadDiagram-RFXS5EU6-DDA7XtKq.js +0 -1
  254. package/dist/assets/recordFormNavigation-8nEYNxNo.js +0 -1
  255. package/dist/assets/src-TG89vY9R.js +0 -18
  256. package/dist/assets/stateDiagram-v2-6OUMAXLB-DCaXJLPh.js +0 -1
  257. package/dist/assets/surfaceAgent-qmokOosD.js +0 -1
  258. package/dist/assets/swimlanes-5IMT3BWC-Bycq06w3.js +0 -1
  259. package/dist/assets/swimlanesDiagram-G3AALYLV-DWFAvAh7.js +0 -8
  260. package/dist/assets/treeView-QDETBFTQ-Cc2FYETg.js +0 -1
  261. package/dist/assets/treemap-6X3UGDF4-a4EjGpO3.js +0 -1
  262. package/dist/assets/ui-components-DHIW7RSX.js +0 -42
  263. package/dist/assets/ui-layout-DeDkO2oG.js +0 -1
  264. package/dist/assets/useRecordApprovals-R3Q7Bt7f.js +0 -1
  265. package/dist/assets/utils-Bixzg6Bz.js +0 -1
  266. package/dist/assets/vendor-dndkit-CzBh0_98.js +0 -5
  267. package/dist/assets/vendor-i18n-B6GOGCem.js +0 -1
  268. package/dist/assets/vendor-objectstack-6Mgxtaa1.js +0 -96
  269. package/dist/assets/vendor-radix-DCTEpigg.js +0 -46
  270. package/dist/assets/vendor-sentry-CHRc7_3y.js +0 -501
  271. package/dist/assets/wardley-OPB4EBWU-CuNyH0xZ.js +0 -1
@@ -1,7 +1,7 @@
1
- import{dn as e,ot as t,rt as n}from"./vendor-charts-D_CNNxD5.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-D0ZYDfff.js";import{D as a,H as o,K as s,U as c,a as l,b as u,c as d,f,v as p,w as m,y as h,z as g}from"./chunk-WYO6CB5R-Cndg0Yo5.js";import{t as _}from"./chunk-VAUOI2AC-BrcFPe7Z.js";import"./chunk-HOUHSVGY-B5nScni0.js";import{i as v}from"./chunk-ICXQ74PX-zJg8KmvA.js";import{t as y}from"./chunk-Q4XR5HBZ-BP9atbVx.js";var b=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,10,12,14,16,18,19,21,23],n=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(t,n,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),e(t,n,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,36]),e(c,[2,37]),e(c,[2,38]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},e(c,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),e(E,[2,40]),e(E,[2,41]),e(D,[2,42]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),e(D,[2,53]),e(T,[2,10]),e(T,[2,24],{32:41,31:56,24:x,29:S}),e(T,[2,26]),e(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,11]),e(T,[2,32],{35:60,29:C}),e(T,[2,34]),{33:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},e(T,[2,14]),{17:66,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,43]),e(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(T,[2,33]),{29:[1,70]},e(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(k,[2,23],{30:[1,73]}),e(T,[2,15]),e(T,[2,28]),e(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,35]),e(T,[2,19]),{25:75,27:64,29:O},e(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{dn as e,ot as t,rt as n}from"./vendor-charts-HLBqza5P.js";import{n as r}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as i}from"./src-CKPhOIOh.js";import{D as a,H as o,K as s,U as c,a as l,b as u,c as d,f,v as p,w as m,y as h,z as g}from"./chunk-WYO6CB5R-C0_XZtpj.js";import{t as _}from"./chunk-VAUOI2AC-HYDQgaka.js";import"./chunk-HOUHSVGY-Bfkm0El3.js";import{i as v}from"./chunk-ICXQ74PX-WsDRuBhL.js";import{t as y}from"./chunk-Q4XR5HBZ-B99LraLe.js";var b=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,10,12,14,16,18,19,21,23],n=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[e(t,n,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},e(t,n,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),e(t,n,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(c,[2,36]),e(c,[2,37]),e(c,[2,38]),{1:[2,1]},e(t,n,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},e(c,[2,5]),e(t,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},e(T,[2,18]),{1:[2,2]},e(T,[2,8]),e(T,[2,9]),e(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),e(E,[2,40]),e(E,[2,41]),e(D,[2,42]),e(D,[2,44]),e(D,[2,45]),e(D,[2,46]),e(D,[2,47]),e(D,[2,48]),e(D,[2,49]),e(D,[2,50]),e(D,[2,51]),e(D,[2,52]),e(D,[2,53]),e(T,[2,10]),e(T,[2,24],{32:41,31:56,24:x,29:S}),e(T,[2,26]),e(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,11]),e(T,[2,32],{35:60,29:C}),e(T,[2,34]),{33:[1,61]},e(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},e(T,[2,14]),{17:66,24:w},e(T,[2,16]),e(T,[2,17]),e(D,[2,43]),e(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(T,[2,33]),{29:[1,70]},e(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(k,[2,23],{30:[1,73]}),e(T,[2,15]),e(T,[2,28]),e(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},e(T,[2,35]),e(T,[2,19]),{25:75,27:64,29:O},e(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),a.push(h.yytext),o.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:r(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:r(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:r(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:r(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:r(function(){return this._more=!0,this},`more`),reject:r(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:r(function(e){this.unput(this.match.slice(e))},`less`),pastInput:r(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:r(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:r(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
- `+t+`^`},`showPosition`),test_match:r(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
5
+ `+t+`^`},`showPosition`),test_match:r(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
6
  `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:r(function(){return this.next()||this.lex()},`lex`),begin:r(function(e){this.conditionStack.push(e)},`begin`),popState:r(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:r(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:r(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:r(function(e){this.begin(e)},`pushState`),stateStackSize:r(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:r(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState(`acc_title`),19;case 8:return this.popState(),`acc_title_value`;case 9:return this.pushState(`acc_descr`),21;case 10:return this.popState(),`acc_descr_value`;case 11:this.pushState(`acc_descr_multiline`);break;case 12:this.popState();break;case 13:return`acc_descr_multiline_value`;case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState(`axis_data`),`X_AXIS`;case 18:return this.pushState(`axis_data`),`Y_AXIS`;case 19:return this.pushState(`axis_band_data`),24;case 20:return 33;case 21:return this.pushState(`data`),16;case 22:return this.pushState(`data`),18;case 23:return this.pushState(`data_inner`),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState(`string`);break;case 28:this.popState();break;case 29:return`STR`;case 30:return 24;case 31:return 26;case 32:return 44;case 33:return`COLON`;case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},`anonymous`),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}}})();function j(){this.yy={}}return r(j,`Parser`),j.prototype=A,A.Parser=j,new j})();b.parser=b;var x=b;function S(e){return e.type===`bar`}r(S,`isBarPlot`);function C(e){return e.type===`band`}r(C,`isBandAxisData`);function w(e){return e.type===`linear`}r(w,`isLinearAxisData`);var T=class{constructor(e){this.parentGroup=e}static{r(this,`TextDimensionCalculatorWithFont`)}getMaxDimension(e,t){if(!this.parentGroup)return{width:e.reduce((e,t)=>Math.max(t.length,e),0)*t,height:t};let n={width:0,height:0},r=this.parentGroup.append(`g`).attr(`visibility`,`hidden`).attr(`font-size`,t);for(let i of e){let e=y(r,1,i),a=e?e.width:i.length*t,o=e?e.height:t;n.width=Math.max(n.width,a),n.height=Math.max(n.height,o)}return r.remove(),n}},E=.7,D=.2,O=class{constructor(e,t,n,r){this.axisConfig=e,this.title=t,this.textDimensionCalculator=n,this.axisThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition=`left`,this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}static{r(this,`BaseAxis`)}setRange(e){this.range=e,this.axisPosition===`left`||this.axisPosition===`right`?this.boundingRect.height=e[1]-e[0]:this.boundingRect.width=e[1]-e[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(e){this.axisPosition=e,this.setRange(this.range)}getTickDistance(){let e=this.getRange();return Math.abs(e[0]-e[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(e=>e.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){E*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(E*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(e){let t=e.height;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=D*e.width;this.outerPadding=Math.min(n.width/2,r);let i=n.height;this.axisPosition===`bottom`&&this.normalizedLabelRotationInRad!==0&&(i=Math.max(i,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*n.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*n.height))),i+=this.axisConfig.labelPadding*2,this.labelTextHeight=n.height,i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width,this.boundingRect.height=e.height-t}calculateSpaceIfDrawnVertical(e){let t=e.width;if(this.axisConfig.showAxisLine&&t>this.axisConfig.axisLineWidth&&(t-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){let n=this.getLabelDimension(),r=D*e.height;this.outerPadding=Math.min(n.height/2,r);let i=n.width+this.axisConfig.labelPadding*2;i<=t&&(t-=i,this.showLabel=!0)}if(this.axisConfig.showTick&&t>=this.axisConfig.tickLength&&(this.showTick=!0,t-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){let e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,n<=t&&(t-=n,this.showTitle=!0)}this.boundingRect.width=e.width-t,this.boundingRect.height=e.height}calculateSpace(e){return this.axisPosition===`left`||this.axisPosition===`right`?this.calculateSpaceIfDrawnVertical(e):this.calculateSpaceIfDrawnHorizontally(e),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateOffsetByRotation(e){let t=this.normalizedLabelRotationInRad;return t===0?0:Math.sin(t)*this.getLabelDimension()[e]/2}getDrawableElementsForLeftAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`left-axis`,`axisl-line`],data:[{path:`M ${t},${this.boundingRect.y} L ${t},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`left-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`middle`,horizontalPos:`right`}))}),this.showTick){let t=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`left-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${t},${this.getScaleValue(e)} L ${t-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`left-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForBottomAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`bottom-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`bottom-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e)+this.calculateOffsetByRotation(`height`),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation(`width`)),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);e.push({type:`path`,groupTexts:[`bottom-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t} L ${this.getScaleValue(e)},${t+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`bottom-axis`,`title`],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElementsForTopAxis(){let e=[];if(this.showAxisLine){let t=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;e.push({type:`path`,groupTexts:[`top-axis`,`axis-line`],data:[{path:`M ${this.boundingRect.x},${t} L ${this.boundingRect.x+this.boundingRect.width},${t}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&e.push({type:`text`,groupTexts:[`top-axis`,`label`],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}))}),this.showTick){let t=this.boundingRect.y;e.push({type:`path`,groupTexts:[`top-axis`,`ticks`],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${t+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${t+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&e.push({type:`text`,groupTexts:[`top-axis`,`title`],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:`top`,horizontalPos:`center`}]}),e}getDrawableElements(){if(this.axisPosition===`left`)return this.getDrawableElementsForLeftAxis();if(this.axisPosition===`right`)throw Error(`Drawing of right axis is not implemented`);return this.axisPosition===`bottom`?this.getDrawableElementsForBottomAxis():this.axisPosition===`top`?this.getDrawableElementsForTopAxis():[]}},k=class extends O{static{r(this,`BandAxis`)}constructor(e,n,r,i,a){super(e,i,a,n),this.categories=r,this.scale=t().domain(this.categories).range(this.getRange())}setRange(e){super.setRange(e)}recalculateScale(){this.scale=t().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),i.trace(`BandAxis axis final categories, range: `,this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(e){return this.scale(e)??this.getRange()[0]}},A=class extends O{static{r(this,`LinearAxis`)}constructor(e,t,r,i,a){super(e,i,a,t),this.domain=r,this.scale=n().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){let e=[...this.domain];this.axisPosition===`left`&&e.reverse(),this.scale=n().domain(e).range(this.getRange())}getScaleValue(e){return this.scale(e)}};function j(e,t,n,r){let i=new T(r);return C(e)?new k(t,n,e.categories,e.title,i):new A(t,n,[e.min,e.max],e.title,i)}r(j,`getAxis`);var M=class{constructor(e,t,n,r){this.textDimensionCalculator=e,this.chartConfig=t,this.chartData=n,this.chartThemeConfig=r,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}static{r(this,`ChartTitle`)}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){let t=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),n=Math.max(t.width,e.width),r=t.height+2*this.chartConfig.titlePadding;return t.width<=n&&t.height<=r&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=n,this.boundingRect.height=r,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){let e=[];return this.showChartTitle&&e.push({groupTexts:[`chart-title`],type:`text`,data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:`middle`,horizontalPos:`center`,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),e}};function N(e,t,n,r){return new M(new T(r),e,t,n)}r(N,`getChartTitleComponent`);var ee=class{constructor(e,t,n,r,i){this.plotData=e,this.xAxis=t,this.yAxis=n,this.orientation=r,this.plotIndex=i}static{r(this,`LinePlot`)}getDrawableElement(){let t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),n;if(n=this.orientation===`horizontal`?e().y(e=>e[0]).x(e=>e[1])(t):e().x(e=>e[0]).y(e=>e[1])(t),!n)return[];let r=[{groupTexts:[`plot`,`line-plot-${this.plotIndex}`],type:`path`,data:[{path:n,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){let e=[];for(let[n,[r,i]]of t.entries()){let t=this.plotData.pointLabels[n];t&&(this.orientation===`horizontal`?e.push({x:i+10,y:r,text:t,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`left`,fontSize:12,rotation:0}):e.push({x:r,y:i-10,text:t,fill:this.plotData.strokeFill,verticalPos:`middle`,horizontalPos:`center`,fontSize:12,rotation:0}))}e.length>0&&r.push({groupTexts:[`plot`,`line-plot-${this.plotIndex}`,`labels`],type:`text`,data:e})}return r}},te=class{constructor(e,t,n,r,i,a){this.barData=e,this.boundingRect=t,this.xAxis=n,this.yAxis=r,this.orientation=i,this.plotIndex=a}static{r(this,`BarPlot`)}getDrawableElement(){let e=this.barData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]),t=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*.95,n=t/2;return this.orientation===`horizontal`?[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:this.boundingRect.x,y:e[0]-n,height:t,width:e[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:[`plot`,`bar-plot-${this.plotIndex}`],type:`rect`,data:e.map(e=>({x:e[0]-n,y:e[1],width:t,height:this.boundingRect.y+this.boundingRect.height-e[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},ne=class{constructor(e,t,n){this.chartConfig=e,this.chartData=t,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0}}static{r(this,`BasePlot`)}setAxes(e,t){this.xAxis=e,this.yAxis=t}setBoundingBoxXY(e){this.boundingRect.x=e.x,this.boundingRect.y=e.y}calculateSpace(e){return this.boundingRect.width=e.width,this.boundingRect.height=e.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error(`Axes must be passed to render Plots`);let e=[];for(let[t,n]of this.chartData.plots.entries())switch(n.type){case`line`:{let r=new ee(n,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break;case`bar`:{let r=new te(n,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,t);e.push(...r.getDrawableElement())}break}return e}};function re(e,t,n){return new ne(e,t,n)}r(re,`getPlotComponent`);var ie=class{constructor(e,t,n,r){this.chartConfig=e,this.chartData=t,this.componentStore={title:N(e,t,n,r),plot:re(e,t,n),xAxis:j(t.xAxis,e.xAxis,{titleColor:n.xAxisTitleColor,labelColor:n.xAxisLabelColor,tickColor:n.xAxisTickColor,axisLineColor:n.xAxisLineColor},r),yAxis:j(t.yAxis,e.yAxis,{titleColor:n.yAxisTitleColor,labelColor:n.yAxisLabelColor,tickColor:n.yAxisTickColor,axisLineColor:n.yAxisLineColor},r)}}static{r(this,`Orchestrator`)}calculateVerticalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),o=this.componentStore.plot.calculateSpace({width:i,height:a});e-=o.width,t-=o.height,o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),r=o.height,t-=o.height,this.componentStore.xAxis.setAxisPosition(`bottom`),o=this.componentStore.xAxis.calculateSpace({width:e,height:t}),t-=o.height,this.componentStore.yAxis.setAxisPosition(`left`),o=this.componentStore.yAxis.calculateSpace({width:e,height:t}),n=o.width,e-=o.width,e>0&&(i+=e,e=0),t>0&&(a+=t,t=0),this.componentStore.plot.calculateSpace({width:i,height:a}),this.componentStore.plot.setBoundingBoxXY({x:n,y:r}),this.componentStore.xAxis.setRange([n,n+i]),this.componentStore.xAxis.setBoundingBoxXY({x:n,y:r+a}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:r}),this.chartData.plots.some(e=>S(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let e=this.chartConfig.width,t=this.chartConfig.height,n=0,r=0,i=0,a=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),s=this.componentStore.plot.calculateSpace({width:a,height:o});e-=s.width,t-=s.height,s=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:t}),n=s.height,t-=s.height,this.componentStore.xAxis.setAxisPosition(`left`),s=this.componentStore.xAxis.calculateSpace({width:e,height:t}),e-=s.width,r=s.width,this.componentStore.yAxis.setAxisPosition(`top`),s=this.componentStore.yAxis.calculateSpace({width:e,height:t}),t-=s.height,i=n+s.height,e>0&&(a+=e,e=0),t>0&&(o+=t,t=0),this.componentStore.plot.calculateSpace({width:a,height:o}),this.componentStore.plot.setBoundingBoxXY({x:r,y:i}),this.componentStore.yAxis.setRange([r,r+a]),this.componentStore.yAxis.setBoundingBoxXY({x:r,y:n}),this.componentStore.xAxis.setRange([i,i+o]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:i}),this.chartData.plots.some(e=>S(e))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation===`horizontal`?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();let e=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(let t of Object.values(this.componentStore))e.push(...t.getDrawableElements());return e}},ae=class{static{r(this,`XYChartBuilder`)}static build(e,t,n,r){return new ie(e,t,n,r).getDrawableElement()}},P=0,F,I=U(),L=H(),R=W(),z=L.plotColorPalette.split(`,`).map(e=>e.trim()),B=!1,V=!1;function H(){let e=a(),t=u();return v(e.xyChart,t.themeVariables.xyChart)}r(H,`getChartDefaultThemeConfig`);function U(){let e=u();return v(f.xyChart,e.xyChart)}r(U,`getChartDefaultConfig`);function W(){return{yAxis:{type:`linear`,title:``,min:1/0,max:-1/0},xAxis:{type:`band`,title:``,categories:[]},title:``,plots:[]}}r(W,`getChartDefaultData`);function G(e){let t=u();return g(e.trim(),t)}r(G,`textSanitizer`);function K(e){F=e}r(K,`setTmpSVGG`);function q(e){e===`horizontal`?I.chartOrientation=`horizontal`:I.chartOrientation=`vertical`}r(q,`setOrientation`);function J(e){R.xAxis.title=G(e.text)}r(J,`setXAxisTitle`);function Y(e,t){R.xAxis={type:`linear`,title:R.xAxis.title,min:e,max:t},B=!0}r(Y,`setXAxisRangeData`);function X(e){R.xAxis={type:`band`,title:R.xAxis.title,categories:e.map(e=>G(e.text))},B=!0}r(X,`setXAxisBand`);function oe(e){R.yAxis.title=G(e.text)}r(oe,`setYAxisTitle`);function se(e,t){R.yAxis={type:`linear`,title:R.yAxis.title,min:e,max:t},V=!0}r(se,`setYAxisRangeData`);function ce(e){let t=Math.min(...e),n=Math.max(...e),r=w(R.yAxis)?R.yAxis.min:1/0,i=w(R.yAxis)?R.yAxis.max:-1/0;R.yAxis={type:`linear`,title:R.yAxis.title,min:Math.min(r,t),max:Math.max(i,n)}}r(ce,`setYAxisRangeFromPlotData`);function Z(e){let t=[];if(e.length===0)return t;if(!B){let t=w(R.xAxis)?R.xAxis.min:1/0,n=w(R.xAxis)?R.xAxis.max:-1/0;Y(Math.min(t,1),Math.max(n,e.length))}if(C(R.xAxis)&&e.length>R.xAxis.categories.length&&(e=e.slice(0,R.xAxis.categories.length)),V||ce(e),C(R.xAxis)&&(t=R.xAxis.categories.map((t,n)=>[t,e[n]])),w(R.xAxis)){let n=R.xAxis.min,r=R.xAxis.max,i=(r-n)/(e.length-1),a=[];for(let e=n;e<=r;e+=i)a.push(`${e}`);t=a.map((t,n)=>[t,e[n]])}return t}r(Z,`transformDataWithoutCategory`);function Q(e){return z[e===0?0:e%z.length]}r(Q,`getPlotColorFromPalette`);function le(e,t){let n=t.map(e=>e.value),r=t.map(e=>e.label?G(e.label):``),i=Z(n),a=r.some(e=>e!==``);R.plots.push({type:`line`,strokeFill:Q(P),strokeWidth:2,data:i,...a?{pointLabels:r}:{}}),P++}r(le,`setLineData`);function $(e,t){let n=Z(t.map(e=>e.value));R.plots.push({type:`bar`,fill:Q(P),data:n}),P++}r($,`setBarData`);function ue(){if(R.plots.length===0)throw Error(`No Plot to render, please provide a plot with some data`);return R.title=m(),ae.build(I,R,L,F)}r(ue,`getDrawableElem`);function de(){return L}r(de,`getChartThemeConfig`);function fe(){return I}r(fe,`getChartConfig`);function pe(){return R}r(pe,`getXYChartData`);var me={parser:x,db:{getDrawableElem:ue,clear:r(function(){l(),P=0,I=U(),R=W(),L=H(),z=L.plotColorPalette.split(`,`).map(e=>e.trim()),B=!1,V=!1},`clear`),setAccTitle:c,getAccTitle:h,setDiagramTitle:s,getDiagramTitle:m,getAccDescription:p,setAccDescription:o,setOrientation:q,setXAxisTitle:J,setXAxisRangeData:Y,setXAxisBand:X,setYAxisTitle:oe,setYAxisRangeData:se,setLineData:le,setBarData:$,setTmpSVGG:K,getChartThemeConfig:de,getChartConfig:fe,getXYChartData:pe},renderer:{draw:r((e,t,n,a)=>{let o=a.db,s=o.getChartThemeConfig(),c=o.getChartConfig(),l=o.getXYChartData().plots[0].data.map(e=>e[1]);function u(e){return e===`top`?`text-before-edge`:`middle`}r(u,`getDominantBaseLine`);function f(e){return e===`left`?`start`:e===`right`?`end`:`middle`}r(f,`getTextAnchor`);function p(e){return`translate(${e.x}, ${e.y}) rotate(${e.rotation||0})`}r(p,`getTextTransformation`),i.debug(`Rendering xychart chart
7
7
  `+e);let m=_(t),h=m.append(`g`).attr(`class`,`main`),g=h.append(`rect`).attr(`width`,c.width).attr(`height`,c.height).attr(`class`,`background`);d(m,c.height,c.width,!0),m.attr(`viewBox`,`0 0 ${c.width} ${c.height}`),g.attr(`fill`,s.backgroundColor),o.setTmpSVGG(m.append(`g`).attr(`class`,`mermaid-tmp-group`));let v=o.getDrawableElem(),y={};function b(e){let t=h,n=``;for(let[r]of e.entries()){let i=h;r>0&&y[n]&&(i=y[n]),n+=e[r],t=y[n],t||=y[n]=i.append(`g`).attr(`class`,e[r])}return t}r(b,`getGroup`);for(let e of v){if(e.data.length===0)continue;let t=b(e.groupTexts);switch(e.type){case`rect`:if(t.selectAll(`rect`).data(e.data).enter().append(`rect`).attr(`x`,e=>e.x).attr(`y`,e=>e.y).attr(`width`,e=>e.width).attr(`height`,e=>e.height).attr(`fill`,e=>e.fill).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth),c.showDataLabel){let n=c.showDataLabelOutsideBar;if(c.chartOrientation===`horizontal`){let i=function(e,t){let{data:n,label:r}=e;return t*r.length*a<=n.width-o};r(i,`fitsHorizontally`);let a=.7,o=10,c=e.data.map((e,t)=>({data:e,label:l[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),u=c.map(e=>{let{data:t}=e,n=t.height*.7;for(;!i(e,n)&&n>0;)--n;return n}),d=Math.floor(Math.min(...u)),f=r(e=>n?e.data.x+e.data.width+10:e.data.x+e.data.width-10,`determineLabelXPosition`);t.selectAll(`text`).data(c).enter().append(`text`).attr(`x`,f).attr(`y`,e=>e.data.y+e.data.height/2).attr(`text-anchor`,n?`start`:`end`).attr(`dominant-baseline`,`middle`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${d}px`).text(e=>e.label)}else{let i=function(e,t,n){let{data:r,label:i}=e,a=t*i.length*.7,o=r.x+r.width/2,s=o-a/2,c=o+a/2,l=s>=r.x&&c<=r.x+r.width,u=r.y+n+t<=r.y+r.height;return l&&u};r(i,`fitsInBar`);let a=e.data.map((e,t)=>({data:e,label:l[t].toString()})).filter(e=>e.data.width>0&&e.data.height>0),o=a.map(e=>{let{data:t,label:n}=e,r=t.width/(n.length*.7);for(;!i(e,r,10)&&r>0;)--r;return r}),c=Math.floor(Math.min(...o)),u=r(e=>n?e.data.y-10:e.data.y+10,`determineLabelYPosition`);t.selectAll(`text`).data(a).enter().append(`text`).attr(`x`,e=>e.data.x+e.data.width/2).attr(`y`,u).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,n?`auto`:`hanging`).attr(`fill`,s.dataLabelColor).attr(`font-size`,`${c}px`).text(e=>e.label)}}break;case`text`:t.selectAll(`text`).data(e.data).enter().append(`text`).attr(`x`,0).attr(`y`,0).attr(`fill`,e=>e.fill).attr(`font-size`,e=>e.fontSize).attr(`dominant-baseline`,e=>u(e.verticalPos)).attr(`text-anchor`,e=>f(e.horizontalPos)).attr(`transform`,e=>p(e)).text(e=>e.text);break;case`path`:t.selectAll(`path`).data(e.data).enter().append(`path`).attr(`d`,e=>e.path).attr(`fill`,e=>e.fill?e.fill:`none`).attr(`stroke`,e=>e.strokeFill).attr(`stroke-width`,e=>e.strokeWidth);break}}},`draw`)}};export{me as diagram};
package/dist/index.html CHANGED
@@ -46,14 +46,14 @@
46
46
  <script>
47
47
  window.process = window.process || { env: { NODE_ENV: 'development' }, version: '', platform: 'browser' };
48
48
  </script>
49
- <script type="module" crossorigin src="./assets/index-BhMd7RVY.js"></script>
49
+ <script type="module" crossorigin src="./assets/index-CETzvR9k.js"></script>
50
50
  <link rel="stylesheet" crossorigin href="./assets/ui-components-BL3SEdAz.css">
51
51
  <link rel="stylesheet" crossorigin href="./assets/plugin-dashboard-DnNKJB60.css">
52
- <link rel="stylesheet" crossorigin href="./assets/index-Dt-GIgSI.css">
53
- <link rel="modulepreload" href="./assets/framework-CWU64Lvg.js" />
54
- <link rel="modulepreload" href="./assets/ui-components-DHIW7RSX.js" />
55
- <link rel="modulepreload" href="./assets/vendor-radix-DCTEpigg.js" />
56
- <link rel="modulepreload" href="./assets/vendor-react-BGDDiZfJ.js" />
52
+ <link rel="stylesheet" crossorigin href="./assets/index-DZuzAri6.css">
53
+ <link rel="modulepreload" href="./assets/framework-DNWcCoBP.js" />
54
+ <link rel="modulepreload" href="./assets/ui-components-CmbUYw-E.js" />
55
+ <link rel="modulepreload" href="./assets/vendor-radix-CWCRv2pn.js" />
56
+ <link rel="modulepreload" href="./assets/vendor-react-BKSb6vFP.js" />
57
57
  </head>
58
58
  <body>
59
59
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/console",
3
- "version": "14.6.0",
3
+ "version": "14.7.0",
4
4
  "description": "Prebuilt Console SPA pinned to this @objectstack/framework release. Source of truth: @object-ui/console (https://github.com/objectstack-ai/objectui).",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/objectstack-ai/framework/tree/main/packages/console",
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{a as t,m as n,r,s as i,y as a}from"./vendor-react-BGDDiZfJ.js";import{Ha as o,uc as s}from"./ui-components-DHIW7RSX.js";import{a as c,i as l,n as u,r as d}from"./index-BhMd7RVY.js";var f=e(a(),1),p=r();function m(){let{appName:e}=n(),{books:r,docs:a,state:m}=u(),h=(0,f.useMemo)(()=>r.filter(t=>l(t)===e),[r,e]),g=(0,f.useMemo)(()=>d(h,a),[h,a]);return m===`loading`?(0,p.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,p.jsx)(o,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):g.length===1?(0,p.jsx)(i,{to:`/apps/${e}/docs/${g[0].slug}`,replace:!0}):(0,p.jsx)(c,{children:(0,p.jsx)(`div`,{className:`mx-auto max-w-3xl p-4 sm:p-6`,children:g.length===0?(0,p.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-16 text-center text-muted-foreground`,children:[(0,p.jsx)(s,{className:`h-10 w-10`}),(0,p.jsx)(`p`,{className:`text-sm`,children:`This app does not ship any documentation yet.`}),(0,p.jsx)(t,{to:`/docs`,className:`text-sm font-medium text-primary hover:underline`,children:`Browse all documentation`})]}):(0,p.jsx)(`ul`,{className:`grid gap-3 sm:grid-cols-2`,children:g.map(n=>(0,p.jsx)(`li`,{children:(0,p.jsxs)(t,{to:`/apps/${e}/docs/${n.slug}`,className:`flex h-full items-start gap-3 rounded-md border border-border p-3 hover:bg-muted/50`,children:[(0,p.jsx)(s,{className:`mt-0.5 h-5 w-5 shrink-0 text-muted-foreground`}),(0,p.jsxs)(`div`,{className:`min-w-0`,children:[(0,p.jsx)(`div`,{className:`text-sm font-semibold`,children:n.label}),n.description?(0,p.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:n.description}):n.subtitle?(0,p.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/70`,children:n.subtitle}):null,(0,p.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground/80`,children:[n.docCount,` `,n.docCount===1?`article`:`articles`]})]})]})},n.name))})})})}export{m as default};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{a as t,m as n,r,y as i}from"./vendor-react-BGDDiZfJ.js";import{d as a,f as ee}from"./infrastructure-DexdbqHf.js";import{l as te}from"./framework-CWU64Lvg.js";import{Ai as ne,Ar as re,Bs as ie,Bt as o,Cr as s,Es as ae,Gt as oe,Ht as se,Jt as ce,K as le,Kt as ue,Ps as de,Qt as fe,Sc as pe,Sr as me,Ss as he,Us as ge,Ut as _e,Vs as ve,Wi as ye,Wr as be,Wt as xe,X as Se,Xt as c,Yo as Ce,Yt as we,Zt as Te,_r as l,_t as u,br as d,cs as Ee,dr as De,dt as Oe,er as ke,fr as Ae,ft as je,gr as f,gs as Me,gt as p,hi as Ne,hr as m,ht as Pe,ji as Fe,js as Ie,kc as h,ln as Le,lt as Re,mr as g,mt as ze,nr as Be,os as Ve,pc as He,pn as Ue,pt as We,q as Ge,qt as Ke,sr as qe,tr as Je,ut as Ye,vr as _,vt as Xe,xr as v,yr as y,yt as Ze,zr as Qe}from"./ui-components-DHIW7RSX.js";import{r as b}from"./vendor-ui-utils-BzQBRdq3.js";var x=e(i(),1),$e=`${``.replace(/\/$/,``)}/api/v1`;async function S(e,t){let n=await fetch(`${$e}${e}`,{credentials:`include`,headers:{"Content-Type":`application/json`,...t?.headers||{}},...t}),r=null;try{r=await n.json()}catch{}if(!n.ok){let e=r?.code??`HTTP_${n.status}`,t=r?.message??r?.error??n.statusText,i=Error(`${e}: ${t}`);throw i.code=e,i.status=n.status,i.details=r,i}return r}var C={listProcesses(e={}){let t=new URLSearchParams;e.object&&t.set(`object`,e.object),e.activeOnly&&t.set(`activeOnly`,`true`);let n=t.toString();return S(`/approvals/processes${n?`?${n}`:``}`)},listRequests(e={}){let t=new URLSearchParams;e.status&&t.set(`status`,e.status),e.object&&t.set(`object`,e.object),e.recordId&&t.set(`recordId`,e.recordId);let n=Array.isArray(e.approverId)?e.approverId.filter(Boolean).join(`,`):e.approverId;n&&t.set(`approverId`,n),e.submitterId&&t.set(`submitterId`,e.submitterId),e.q?.trim()&&t.set(`q`,e.q.trim()),e.limit!=null&&t.set(`limit`,String(e.limit)),e.offset!=null&&t.set(`offset`,String(e.offset));let r=t.toString();return S(`/approvals/requests${r?`?${r}`:``}`)},async getRequest(e){return{data:await S(`/approvals/requests/${encodeURIComponent(e)}`)}},listActions(e){return S(`/approvals/requests/${encodeURIComponent(e)}/actions`)},async approve(e,t){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,finalized:n.finalized}},async reject(e,t){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/reject`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,finalized:n.finalized}},async recall(e,t){return{data:(await S(`/approvals/requests/${encodeURIComponent(e)}/recall`,{method:`POST`,body:JSON.stringify(t)})).request,finalized:!0}},async reassign(e,t){return{data:(await S(`/approvals/requests/${encodeURIComponent(e)}/reassign`,{method:`POST`,body:JSON.stringify(t)})).request}},async remind(e,t={}){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/remind`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,notified:n.notified}},async requestInfo(e,t){return{data:(await S(`/approvals/requests/${encodeURIComponent(e)}/request-info`,{method:`POST`,body:JSON.stringify(t)})).request}},async sendBack(e,t){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/revise`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,autoRejected:n.autoRejected===!0}},async resubmit(e,t={}){let n=await S(`/approvals/requests/${encodeURIComponent(e)}/resubmit`,{method:`POST`,body:JSON.stringify(t)});return{data:n.request,resumed:n.resumed===!0}},async comment(e,t){return{data:(await S(`/approvals/requests/${encodeURIComponent(e)}/comment`,{method:`POST`,body:JSON.stringify(t)})).request}},async submit(e){return S(`/approvals/requests`,{method:`POST`,body:JSON.stringify(e)})}};function et(e){if(!e)return[];let t=new Set;e.id&&t.add(e.id),e.email&&t.add(e.email);let n=[...e.roles||[],...typeof e.role==`string`?e.role.split(`,`):[]];for(let e of n){let n=String(e).trim();n&&t.add(`role:${n}`)}return Array.from(t)}var w=r(),tt=50,nt={pending:`border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400`,approved:`border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400`,rejected:`border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-400`,recalled:`border-border bg-muted text-muted-foreground`,returned:`border-violet-200 bg-violet-50 text-violet-700 dark:border-violet-500/30 dark:bg-violet-500/10 dark:text-violet-400`};function rt(e){if(!e)return`—`;try{return new Date(e).toLocaleString()}catch{return e}}function T(e){return e?e.includes(`@`)?e:e.startsWith(`role:`)?`Role: ${e.slice(5)}`:e.length>14?`${e.slice(0,6)}…${e.slice(-4)}`:e:`—`}function E(e){return e&&String(e).replace(/^flow:/,``).trim().split(/[_\-\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)||`—`}function it(e){return e.process_label||E(e.process_name)}function at(e){return e.step_label?e.step_label:e.current_step?E(e.current_step):null}function ot(e){return e.submitter_name||T(e.submitter_id)}function st(e,t){return t.pending_approver_names?.[e]||T(e)}function ct(e){return e.object_label||e.object_name}function D(e){return e.submitted_at||e.created_at||void 0}function O(e){let t=D(e);if(!t)return null;let n=Date.parse(t);return Number.isNaN(n)?null:(Date.now()-n)/36e5}function lt(e){if(e.status!==`pending`)return`text-muted-foreground`;let t=O(e);return t==null?`text-muted-foreground`:t>72?`text-red-600 dark:text-red-400 font-medium`:t>24?`text-amber-600 dark:text-amber-400`:`text-muted-foreground`}function ut(e){let t=Math.max(1,Math.round(Math.abs(e)/36e5));return t<48?`${t}h`:`${Math.round(t/24)}d`}var k=new Set([`id`,`created_at`,`updated_at`,`created_by`,`updated_by`,`organization_id`]);function A(e){return e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function j(e,t){if(typeof t==`boolean`)return t?`✓`:`—`;if(typeof t==`number`){if(t>0xe8d4a51000&&/(_at$|_date$|^date_|_time$)/.test(e))try{return new Date(t).toLocaleDateString()}catch{}return t.toLocaleString()}let n=String(t);if(/^\d{4}-\d{2}-\d{2}T\d{2}/.test(n))try{return new Date(n).toLocaleString()}catch{}return n}var dt=/^[A-Za-z0-9_-]{15,}$/;function ft(e,t,n=6){if(!e||typeof e!=`object`||Array.isArray(e))return[];let r=[];for(let[i,a]of Object.entries(e)){if(k.has(i)||a==null||typeof a==`object`||String(a).trim()===``)continue;let e=t?.[i];if(!(!e&&typeof a==`string`&&dt.test(a.trim())&&!/^\d+$/.test(a.trim()))&&(r.push([A(i),e??j(i,a)]),r.length>=n))break}return r}function pt(){let{t:e,language:r}=te(),{user:i}=ee(),$e=a(),{appName:S}=n(),E=(0,x.useMemo)(()=>et(i),[i]),O=(0,x.useCallback)((t,n,r)=>String(e(`approvalsInbox.${t}`,{defaultValue:n,...r})),[e]),k=(0,x.useCallback)(e=>{if(!e)return`—`;let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.round((Date.now()-t)/1e3);if(n<45)return O(`justNow`,`just now`);let i=Math.round(n/60);if(i<60)return O(`minutesAgo`,`{{count}}m ago`,{count:i});let a=Math.round(i/60);if(a<24)return O(`hoursAgo`,`{{count}}h ago`,{count:a});let ee=Math.round(a/24);if(ee<30)return O(`daysAgo`,`{{count}}d ago`,{count:ee});try{return new Date(e).toLocaleDateString(r)}catch{return e}},[O,r]),A=(0,x.useCallback)(e=>{switch(e){case`pending`:return O(`statusPending`,`Pending`);case`approved`:return O(`statusApproved`,`Approved`);case`rejected`:return O(`statusRejected`,`Rejected`);case`recalled`:return O(`statusRecalled`,`Recalled`);case`returned`:return O(`statusReturned`,`Returned for revision`);default:return e}},[O]),j=(0,x.useCallback)((e,t)=>{let n=e?.code??``,r=e?.status??0;return n===`NOT_IMPLEMENTED`||r===501?O(`recallUnavailable`,`Recall is not available on this deployment.`):n===`THROTTLED`||r===429?O(`remindThrottled`,`A reminder was sent recently — try again later.`):r===404?O(`requestGone`,`This request no longer exists. Refresh the list.`):n===`FORBIDDEN`||r===403?O(`notAllowed`,`You are not allowed to perform this action.`):n===`INVALID_STATE`||r===409?O(`alreadyDecided`,`This request was already decided. Refresh the list.`):e?.message||t},[O]);function dt({status:e}){return(0,w.jsx)(qe,{variant:`outline`,className:h(`font-medium`,nt[e]??``),children:A(e)})}let pt=(0,x.useCallback)(e=>`/apps/${S||`setup`}/${encodeURIComponent(e.object_name)}/record/${encodeURIComponent(e.record_id)}`,[S]),[M,mt]=(0,x.useState)(`pending`),[N,ht]=(0,x.useState)([]),[gt,_t]=(0,x.useState)(!1),[vt,yt]=(0,x.useState)(!1),[bt,xt]=(0,x.useState)(null),[St,Ct]=(0,x.useState)(null),[wt,Tt]=(0,x.useState)(0),[P,Et]=(0,x.useState)(null),[F,Dt]=(0,x.useState)(null),[Ot,kt]=(0,x.useState)([]),[At,jt]=(0,x.useState)(!1),[I,L]=(0,x.useState)(``),[R,Mt]=(0,x.useState)(``),[z,Nt]=(0,x.useState)(null),[B,Pt]=(0,x.useState)(``),[Ft,It]=(0,x.useState)(``),[Lt,Rt]=(0,x.useState)(`all`),[zt,Bt]=(0,x.useState)(`all`),[V,Vt]=(0,x.useState)(`all`),[H,Ht]=(0,x.useState)(new Set),[Ut,Wt]=(0,x.useState)(!1),[U,Gt]=(0,x.useState)(null),[Kt,qt]=(0,x.useState)(null),[Jt,Yt]=(0,x.useState)(!1),[Xt,Zt]=(0,x.useState)(``),[Qt,$t]=(0,x.useState)(!1),[en,tn]=(0,x.useState)(``),[nn,rn]=(0,x.useState)(!1),[an,on]=(0,x.useState)(``),[sn,cn]=(0,x.useState)(!1),[ln,un]=(0,x.useState)(``),[W,G]=(0,x.useState)(!1),[dn,fn]=(0,x.useState)([]),[pn,mn]=(0,x.useState)(-1);(0,x.useEffect)(()=>{if(M===`pending`)return;let e=window.setTimeout(()=>It(B),350);return()=>window.clearTimeout(e)},[B,M]);let K=(0,x.useCallback)(async()=>{_t(!0),Ct(null);try{let e=[];if(M===`pending`)e=E.length?(await C.listRequests({status:`pending`,approverId:E})).data:[],Tt(e.length),xt(null);else{let t={q:Ft||void 0,status:V===`all`?void 0:V,limit:tt,offset:0};if(M===`submitted`){let n=i?.id;if(n){let r=await C.listRequests({submitterId:n,...t});e=r.data,xt(r.total??r.data.length)}else e=[],xt(0)}else{let n=await C.listRequests(t);e=n.data,xt(n.total??n.data.length)}E.length&&C.listRequests({status:`pending`,approverId:E}).then(e=>Tt(e.data.length)).catch(()=>{})}e.sort((e,t)=>(D(t)||``).localeCompare(D(e)||``)),ht(e)}catch(e){Ct(e?.message||String(e)),ht([])}finally{_t(!1)}},[M,E,i?.id,Ft,V]);(0,x.useEffect)(()=>{K()},[K]);let hn=(0,x.useCallback)(async()=>{if(!(M===`pending`||vt)){yt(!0);try{let e=await C.listRequests({submitterId:M===`submitted`?i?.id??void 0:void 0,q:Ft||void 0,status:V===`all`?void 0:V,limit:tt,offset:N.length});ht(t=>{let n=new Set(t.map(e=>e.id));return[...t,...e.data.filter(e=>!n.has(e.id))]}),e.total!=null&&xt(e.total)}catch(e){b.error(j(e,O(`loadFailed`,`Failed to load request`)))}finally{yt(!1)}}},[M,vt,i?.id,Ft,V,N.length,j,O]),q=(0,x.useCallback)(async e=>{Et(e),jt(!0),L(``),Mt(``);try{let[t,n]=await Promise.all([C.getRequest(e),C.listActions(e)]);Dt(t.data),kt(n.data)}catch(e){b.error(j(e,O(`loadFailed`,`Failed to load request`))),Dt(null),kt([])}finally{jt(!1)}},[j,O]),gn=()=>{Et(null),Dt(null),kt([]),L(``),Mt(``)},J=(0,x.useCallback)(e=>{if(R.trim())return R.trim();if(!e)return i?.id||``;let t=new Set(e.pending_approvers||[]);for(let e of E)if(t.has(e))return e;return i?.id||``},[R,E,i?.id]),Y=(0,x.useCallback)(()=>{E.length&&C.listRequests({status:`pending`,approverId:E}).then(e=>Tt(e.data.length)).catch(()=>{})},[E]),_n=(0,x.useCallback)(async e=>{if(!F)return;let t=e===`recall`&&i?.id||J(F);if(!t){b.error(O(`noActor`,`Cannot determine the acting identity`));return}Nt(e);try{let n={actor_id:t,comment:I.trim()||void 0},r=await(e===`approve`?C.approve:e===`reject`?C.reject:C.recall)(F.id,n);if(b.success(e===`approve`?r.finalized?O(`approvedFinal`,`Approved`):O(`approvedWaiting`,`Approved — waiting on the remaining approvers`):e===`reject`?O(`rejectedToast`,`Rejected`):O(`recalledToast`,`Request recalled`)),L(``),e!==`recall`&&M===`pending`){let e=Rn.current,t=e.findIndex(e=>e.id===F.id),n=e[t+1]??e[t-1];K(),n&&n.id!==F.id?q(n.id):gn();return}let[i,a]=await Promise.all([C.getRequest(F.id),C.listActions(F.id)]);Dt(i.data),kt(a.data),K()}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{Nt(null)}},[F,J,I,K,i?.id,j,O,M,q]),X=(0,x.useCallback)(async e=>{let[t,n]=await Promise.all([C.getRequest(e),C.listActions(e)]);Dt(t.data),kt(n.data),K()},[K]),vn=(0,x.useCallback)(async()=>{if(!(!F||!Xt.trim())){G(!0);try{await C.reassign(F.id,{actor_id:J(F),to:Xt.trim(),comment:I.trim()||void 0}),b.success(O(`reassignSuccess`,`Handed to {{to}}`,{to:Xt.trim()})),Yt(!1),Zt(``),L(``),await X(F.id),Y()}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{G(!1)}}},[F,Xt,I,J,X,Y,j,O]),yn=(0,x.useCallback)(async()=>{if(F){G(!0);try{let e=await C.remind(F.id,{actor_id:i?.id});b.success(O(`remindSuccess`,`Reminder sent to {{count}} approver(s)`,{count:e.notified})),await X(F.id)}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{G(!1)}}},[F,i?.id,X,j,O]),bn=(0,x.useCallback)(async()=>{if(!(!F||!en.trim())){G(!0);try{await C.requestInfo(F.id,{actor_id:J(F),comment:en.trim()}),b.success(O(`requestInfoSent`,`Sent back to the requester for more information`)),$t(!1),tn(``),await X(F.id)}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{G(!1)}}},[F,en,J,X,j,O]),xn=(0,x.useCallback)(async()=>{if(F){G(!0);try{let e=await C.sendBack(F.id,{actor_id:J(F),comment:an.trim()||void 0});b.success(e.autoRejected?O(`sendBackAutoRejected`,`Revision limit reached — the request was auto-rejected`):O(`sendBackSuccess`,`Sent back for revision — the requester can now edit and resubmit`)),rn(!1),on(``),await X(F.id),Y()}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{G(!1)}}},[F,an,J,X,Y,j,O]),Sn=(0,x.useCallback)(async()=>{if(F){cn(!0);try{await C.resubmit(F.id,{actor_id:i?.id,comment:I.trim()||void 0}),b.success(O(`resubmitSuccess`,`Resubmitted — a new approval round has opened`)),L(``),await X(F.id),Y()}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{cn(!1)}}},[F,I,i?.id,X,Y,j,O]),Cn=(0,x.useCallback)(async()=>{if(!(!F||!ln.trim())){G(!0);try{await C.comment(F.id,{actor_id:i?.id,comment:ln.trim()}),un(``),await X(F.id)}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{G(!1)}}},[F,ln,i?.id,X,j,O]),wn=(0,x.useCallback)(async()=>{if(!dn.length)try{let e=``.replace(/\/$/,``),t=await(await fetch(`${e}/api/v1/data/sys_user?limit=100`,{credentials:`include`})).json();fn((t.records||[]).filter(e=>e.email&&e.name&&e.id!==i?.id).map(e=>({name:String(e.name),email:String(e.email)})))}catch{}},[dn.length,i?.id]),Tn=(0,x.useMemo)(()=>{if(!F||F.status!==`pending`)return!1;let e=new Set(F.pending_approvers||[]);return E.some(t=>e.has(t))||R.trim().length>0},[F,E,R]),En=(0,x.useMemo)(()=>!F||F.status!==`pending`?!1:F.submitter_id===i?.id||R.trim().length>0,[F,i?.id,R]),Dn=(0,x.useMemo)(()=>!F||F.status!==`returned`?!1:F.submitter_id===i?.id||R.trim().length>0,[F,i?.id,R]),On=(0,x.useMemo)(()=>{let e=new Set;for(let t of N)e.add(it(t));return Array.from(e).sort()},[N]),kn=(0,x.useMemo)(()=>{let e=new Set;for(let t of N)t.object_name&&e.add(t.object_name);return Array.from(e).sort()},[N]),Z=(0,x.useMemo)(()=>{let e=B.trim().toLowerCase();return N.filter(t=>Lt!==`all`&&it(t)!==Lt||zt!==`all`&&t.object_name!==zt||V!==`all`&&t.status!==V?!1:M!==`pending`||!e?!0:[t.process_name,t.process_label,t.step_label,t.object_name,t.record_id,t.record_title,t.submitter_id,t.submitter_name,...t.pending_approvers||[]].filter(Boolean).join(` `).toLowerCase().includes(e))},[N,B,Lt,zt,V,M]),An=(0,x.useMemo)(()=>P?Z.findIndex(e=>e.id===P):-1,[Z,P]);(0,x.useEffect)(()=>{if(H.size===0)return;let e=new Set(Z.map(e=>e.id)),t=!1,n=new Set;for(let r of H)e.has(r)?n.add(r):t=!0;t&&Ht(n)},[Z,H]),(0,x.useEffect)(()=>{pn>=Z.length&&mn(Z.length-1)},[Z.length,pn]);let Q=(0,x.useCallback)(e=>{if(e.status!==`pending`)return!1;let t=new Set(E);return(e.pending_approvers||[]).some(e=>t.has(e))},[E]),$=(0,x.useMemo)(()=>Z.filter(e=>H.has(e.id)&&Q(e)),[Z,H,Q]),jn=Z.filter(e=>e.status===`pending`),Mn=jn.length>0&&jn.every(e=>H.has(e.id)),Nn=(0,x.useCallback)(()=>{Ht(e=>{if(Mn)return new Set;let t=new Set(e);for(let e of jn)t.add(e.id);return t})},[Mn,jn]),Pn=(0,x.useCallback)(e=>{Ht(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Fn=(0,x.useCallback)(async e=>{let t=$;if(t.length===0)return;Wt(!0);let n=0,r=[];for(let a of t){let t=new Set(a.pending_approvers||[]),ee=E.find(e=>t.has(e))||i?.id||``;try{await(e===`approve`?C.approve:C.reject)(a.id,{actor_id:ee}),n++}catch{r.push(a.record_title||T(a.record_id))}}if(Wt(!1),Ht(new Set),r.length===0)b.success(e===`approve`?O(`bulkApproved`,`Approved {{count}} requests`,{count:n}):O(`bulkRejected`,`Rejected {{count}} requests`,{count:n}));else{let e=r.slice(0,3).join(`, `);b.error(O(`bulkPartial`,`{{ok}} succeeded, {{fail}} failed: {{which}}`,{ok:n,fail:r.length,which:e+(r.length>3?`…`:``)}))}K(),Y()},[$,E,i?.id,K,Y,O]),In=(0,x.useCallback)(async e=>{if(!Q(e)||Kt)return;let t=new Set(e.pending_approvers||[]),n=E.find(e=>t.has(e))||i?.id||``;qt(e.id);try{let t=await C.approve(e.id,{actor_id:n});b.success(t.finalized?O(`inlineApproved`,`Approved "{{title}}"`,{title:e.record_title||T(e.record_id)}):O(`approvedWaiting`,`Approved — waiting on the remaining approvers`)),K(),Y()}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{qt(null)}},[Q,Kt,E,i?.id,K,Y,j,O]),Ln=(0,x.useCallback)(async()=>{let e=U;if(!e)return;let t=new Set(e.pending_approvers||[]),n=E.find(e=>t.has(e))||i?.id||``;qt(e.id),Gt(null);try{await C.reject(e.id,{actor_id:n}),b.success(O(`inlineRejected`,`Rejected "{{title}}"`,{title:e.record_title||T(e.record_id)})),K(),Y()}catch(e){b.error(j(e,O(`actionFailed`,`Action failed`)))}finally{qt(null)}},[U,E,i?.id,K,Y,j,O]),Rn=(0,x.useRef)(Z);Rn.current=Z;let zn=(0,x.useRef)(pn);zn.current=pn,(0,x.useEffect)(()=>{let e=e=>{if(P||U)return;let t=e.target,n=t?.tagName;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable||document.querySelector(`[role="alertdialog"]`))return;let r=Rn.current;if(!r.length)return;let i=zn.current;e.key===`j`||e.key===`ArrowDown`?(e.preventDefault(),mn(Math.min(i+1,r.length-1))):e.key===`k`||e.key===`ArrowUp`?(e.preventDefault(),mn(Math.max(i-1,0))):e.key===`Enter`&&i>=0&&r[i]?(e.preventDefault(),q(r[i].id)):(e.key===`x`||e.key===` `)&&i>=0&&r[i]&&M===`pending`?(e.preventDefault(),Pn(r[i].id)):e.key===`a`&&i>=0&&r[i]?(e.preventDefault(),In(r[i])):e.key===`r`&&i>=0&&r[i]&&Q(r[i])&&(e.preventDefault(),Gt(r[i]))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[P,U,M,q,Pn,In,Q]),(0,x.useEffect)(()=>{if(!P)return;let e=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=e.target,n=t?.tagName;if(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t?.isContentEditable||document.querySelector(`[role="alertdialog"]`))return;let r=Rn.current,i=r.findIndex(e=>e.id===P);if(i<0)return;let a=e.key===`ArrowLeft`?r[i-1]:r[i+1];a&&(e.preventDefault(),q(a.id))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[P,q]);let Bn=!!B||Lt!==`all`||zt!==`all`||V!==`all`,Vn=e=>{mt(e),Vt(`all`),Rt(`all`),Bt(`all`),Pt(``),mn(-1)};function Hn({r:e}){return(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`div`,{className:`font-medium truncate`,children:it(e)}),(0,w.jsxs)(`div`,{className:`text-xs text-muted-foreground truncate`,children:[at(e)||`—`,(e.round??1)>1&&(0,w.jsx)(`span`,{className:`ml-1.5 text-violet-600 dark:text-violet-400`,children:O(`roundChip`,`Round {{n}}`,{n:e.round})})]})]})}function Un({r:e}){return(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsxs)(t,{to:pt(e),onClick:e=>e.stopPropagation(),className:`inline-flex items-center gap-1 text-sm hover:underline truncate max-w-full`,title:e.record_id,children:[(0,w.jsx)(`span`,{className:`truncate`,children:e.record_title||T(e.record_id)}),(0,w.jsx)(Ce,{className:`h-3 w-3 shrink-0 text-muted-foreground`})]}),(0,w.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:ct(e)})]})}function Wn({r:e}){if(!Q(e))return null;let t=Kt===e.id;return(0,w.jsxs)(`div`,{className:`flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity`,onClick:e=>e.stopPropagation(),children:[(0,w.jsx)(s,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-emerald-700 hover:text-emerald-800 hover:bg-emerald-50 dark:text-emerald-400`,disabled:t,onClick:()=>void In(e),"aria-label":O(`approve`,`Approve`),children:(0,w.jsx)(Ie,{className:`h-4 w-4`})}),(0,w.jsx)(s,{size:`sm`,variant:`ghost`,className:`h-7 px-2 text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400`,disabled:t,onClick:()=>Gt(e),"aria-label":O(`reject`,`Reject`),children:(0,w.jsx)(he,{className:`h-4 w-4`})})]})}return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-6xl`,children:[(0,w.jsxs)(`header`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`h1`,{className:`text-2xl font-semibold flex items-center gap-2`,children:[(0,w.jsx)(Ne,{className:`h-6 w-6`}),O(`title`,`Approvals Inbox`)]}),(0,w.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:O(`subtitle`,`Review and act on approval requests.`)})]}),(0,w.jsxs)(s,{variant:`outline`,size:`sm`,onClick:K,disabled:gt,className:`self-start sm:self-auto`,children:[(0,w.jsx)(ye,{className:`h-4 w-4 mr-2 ${gt?`animate-spin`:``}`}),O(`refresh`,`Refresh`)]})]}),St&&(0,w.jsxs)(De,{variant:`destructive`,children:[(0,w.jsx)(de,{className:`h-4 w-4`}),(0,w.jsx)(Ae,{children:St})]}),(0,w.jsxs)(Ye,{value:M,onValueChange:Vn,children:[(0,w.jsxs)(je,{children:[(0,w.jsxs)(We,{value:`pending`,children:[O(`tabMyPending`,`My Pending`),wt>0&&(0,w.jsx)(qe,{variant:`secondary`,className:`ml-2`,children:wt})]}),(0,w.jsx)(We,{value:`submitted`,children:O(`tabSubmitted`,`Submitted by me`)}),(0,w.jsx)(We,{value:`all`,children:O(`tabAll`,`All`)})]}),(0,w.jsxs)(Oe,{value:M,className:`mt-4 space-y-3`,children:[!gt&&(N.length>0||M!==`pending`&&(Ft||V!==`all`))&&(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1 min-w-[200px] max-w-sm`,children:[(0,w.jsx)(Fe,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,w.jsx)(Le,{value:B,onChange:e=>Pt(e.target.value),placeholder:O(`searchPlaceholder`,`Search record, process, requester…`),className:`pl-8 h-8 text-sm`}),B&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>Pt(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,"aria-label":O(`clearSearch`,`Clear search`),children:(0,w.jsx)(re,{className:`h-3.5 w-3.5`})})]}),M!==`pending`&&(0,w.jsxs)(ce,{value:V,onValueChange:Vt,children:[(0,w.jsx)(Te,{className:`h-8 w-auto min-w-[130px] text-sm`,children:(0,w.jsx)(fe,{placeholder:O(`statusFilter`,`Status`)})}),(0,w.jsxs)(we,{children:[(0,w.jsx)(c,{value:`all`,children:O(`allStatuses`,`All statuses`)}),(0,w.jsx)(c,{value:`pending`,children:A(`pending`)}),(0,w.jsx)(c,{value:`approved`,children:A(`approved`)}),(0,w.jsx)(c,{value:`rejected`,children:A(`rejected`)}),(0,w.jsx)(c,{value:`recalled`,children:A(`recalled`)}),(0,w.jsx)(c,{value:`returned`,children:A(`returned`)})]})]}),On.length>1&&(0,w.jsxs)(ce,{value:Lt,onValueChange:Rt,children:[(0,w.jsx)(Te,{className:`h-8 w-auto min-w-[140px] text-sm`,children:(0,w.jsx)(fe,{placeholder:O(`processFilter`,`Process`)})}),(0,w.jsxs)(we,{children:[(0,w.jsx)(c,{value:`all`,children:O(`allProcesses`,`All processes`)}),On.map(e=>(0,w.jsx)(c,{value:e,children:e},e))]})]}),kn.length>1&&(0,w.jsxs)(ce,{value:zt,onValueChange:Bt,children:[(0,w.jsx)(Te,{className:`h-8 w-auto min-w-[140px] text-sm`,children:(0,w.jsx)(fe,{placeholder:O(`objectFilter`,`Object`)})}),(0,w.jsxs)(we,{children:[(0,w.jsx)(c,{value:`all`,children:O(`allObjects`,`All objects`)}),kn.map(e=>(0,w.jsx)(c,{value:e,children:e},e))]})]}),Bn&&(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:O(`filterCount`,`{{shown}} of {{total}}`,{shown:Z.length,total:N.length})})]}),M===`pending`&&H.size>0&&(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 rounded-md border bg-accent/30 text-sm`,children:[(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`strong`,{children:H.size}),` `,O(`selected`,`selected`),$.length!==H.size&&(0,w.jsx)(`span`,{className:`text-muted-foreground ml-1`,children:O(`actionableCount`,`({{count}} actionable)`,{count:$.length})})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsxs)(g,{children:[(0,w.jsx)(me,{asChild:!0,children:(0,w.jsxs)(s,{size:`sm`,disabled:Ut||$.length===0,children:[(0,w.jsx)(Ie,{className:`h-3.5 w-3.5 mr-1`}),O(`approveN`,`Approve {{count}}`,{count:$.length||``})]})}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`bulkApproveTitle`,`Approve {{count}} requests?`,{count:$.length})}),(0,w.jsx)(_,{children:O(`bulkApproveBody`,`Each request is approved with your identity and its flow continues down the approve branch.`)})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{onClick:()=>Fn(`approve`),children:O(`approveN`,`Approve {{count}}`,{count:$.length})})]})]})]}),(0,w.jsxs)(g,{children:[(0,w.jsx)(me,{asChild:!0,children:(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:Ut||$.length===0,className:`border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground`,children:[(0,w.jsx)(he,{className:`h-3.5 w-3.5 mr-1`}),O(`rejectN`,`Reject {{count}}`,{count:$.length||``})]})}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`bulkRejectTitle`,`Reject {{count}} requests?`,{count:$.length})}),(0,w.jsx)(_,{children:O(`bulkRejectBody`,`This rejects the selected requests and notifies their submitters.`)})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{onClick:()=>Fn(`reject`),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:O(`rejectN`,`Reject {{count}}`,{count:$.length})})]})]})]}),(0,w.jsx)(s,{size:`sm`,variant:`ghost`,onClick:()=>Ht(new Set),disabled:Ut,children:O(`clear`,`Clear`)})]})]}),gt?(0,w.jsxs)(`div`,{className:`space-y-2`,children:[(0,w.jsx)(o,{className:`h-10 w-full`}),(0,w.jsx)(o,{className:`h-10 w-full`}),(0,w.jsx)(o,{className:`h-10 w-full`})]}):N.length===0?(0,w.jsx)(`div`,{className:`flex items-center justify-center min-h-[240px] rounded-md border border-dashed`,children:(0,w.jsxs)(le,{children:[(0,w.jsx)(Se,{children:O(`emptyTitle`,`No requests`)}),(0,w.jsx)(Ge,{children:M===`pending`?O(`emptyPending`,`You're all caught up — nothing is waiting on you.`):O(`emptyOther`,`Nothing here yet.`)}),M===`pending`&&(0,w.jsx)(s,{variant:`link`,size:`sm`,className:`mt-1`,onClick:()=>Vn(`all`),children:O(`emptyViewAll`,`Browse all requests`)})]})}):Z.length===0?(0,w.jsx)(`div`,{className:`flex items-center justify-center min-h-[160px] rounded-md border border-dashed text-sm text-muted-foreground`,children:O(`noMatches`,`No matches for current filters.`)}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Je,{className:`hidden md:block`,children:(0,w.jsx)(Be,{className:`p-0`,children:(0,w.jsxs)(ze,{children:[(0,w.jsx)(Xe,{children:(0,w.jsxs)(Ze,{children:[M===`pending`&&(0,w.jsx)(u,{className:`w-10`,children:(0,w.jsx)(ke,{checked:Mn,onCheckedChange:Nn,"aria-label":O(`selectAll`,`Select all`),disabled:jn.length===0})}),(0,w.jsx)(u,{children:O(`colRequest`,`Request`)}),(0,w.jsx)(u,{children:O(`colRecord`,`Record`)}),(0,w.jsx)(u,{children:O(`colRequester`,`Requester`)}),(0,w.jsx)(u,{children:O(`colStatus`,`Status`)}),(0,w.jsx)(u,{children:O(`colWaiting`,`Submitted`)}),(0,w.jsx)(u,{className:`w-20`,"aria-label":O(`colActions`,`Actions`)})]})}),(0,w.jsx)(Pe,{children:Z.map((e,t)=>(0,w.jsxs)(Ze,{className:h(`group cursor-pointer hover:bg-accent/50`,pn===t&&`ring-2 ring-inset ring-ring bg-accent/30`),onClick:()=>{mn(t),q(e.id)},children:[M===`pending`&&(0,w.jsx)(p,{className:`w-10`,onClick:e=>e.stopPropagation(),children:(0,w.jsx)(ke,{checked:H.has(e.id),onCheckedChange:()=>Pn(e.id),disabled:e.status!==`pending`,"aria-label":O(`selectRow`,`Select request`)})}),(0,w.jsx)(p,{children:(0,w.jsx)(Hn,{r:e})}),(0,w.jsx)(p,{children:(0,w.jsx)(Un,{r:e})}),(0,w.jsx)(p,{children:(0,w.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm`,children:[(0,w.jsx)(Qe,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,w.jsx)(`span`,{className:`truncate`,title:e.submitter_id||``,children:ot(e)})]})}),(0,w.jsx)(p,{children:(0,w.jsx)(dt,{status:e.status})}),(0,w.jsxs)(p,{className:h(`text-xs whitespace-nowrap`,lt(e)),title:rt(D(e)),children:[(0,w.jsx)(Me,{className:`h-3 w-3 inline mr-1`}),k(D(e)),e.status===`pending`&&e.sla_due_at&&(0,w.jsx)(`div`,{className:h(`mt-0.5 text-[10px] font-medium`,Date.parse(e.sla_due_at)<Date.now()?`text-red-600 dark:text-red-400`:`text-muted-foreground`),children:Date.parse(e.sla_due_at)<Date.now()?O(`slaOverdue`,`SLA overdue {{dur}}`,{dur:ut(Date.now()-Date.parse(e.sla_due_at))}):O(`slaRemaining`,`SLA {{dur}} left`,{dur:ut(Date.parse(e.sla_due_at)-Date.now())})})]}),(0,w.jsx)(p,{className:`w-20`,children:(0,w.jsx)(Wn,{r:e})})]},e.id))})]})})}),(0,w.jsx)(`div`,{className:`md:hidden space-y-2`,children:Z.map(e=>(0,w.jsx)(Je,{className:`cursor-pointer active:bg-accent/50`,onClick:()=>void q(e.id),children:(0,w.jsxs)(Be,{className:`p-3 space-y-1.5`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,w.jsx)(`div`,{className:`font-medium text-sm truncate`,children:it(e)}),(0,w.jsx)(dt,{status:e.status})]}),(0,w.jsxs)(`div`,{className:`text-sm truncate`,children:[e.record_title||T(e.record_id),(0,w.jsx)(`span`,{className:`text-muted-foreground text-xs ml-1.5`,children:ct(e)})]}),(0,w.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1 truncate`,children:[(0,w.jsx)(Qe,{className:`h-3 w-3`}),ot(e)]}),(0,w.jsxs)(`span`,{className:h(`inline-flex items-center gap-1 whitespace-nowrap`,lt(e)),children:[(0,w.jsx)(Me,{className:`h-3 w-3`}),k(D(e))]})]}),Q(e)&&(0,w.jsxs)(`div`,{className:`flex gap-2 pt-1`,onClick:e=>e.stopPropagation(),children:[(0,w.jsxs)(s,{size:`sm`,className:`h-7 flex-1`,disabled:Kt===e.id,onClick:()=>void In(e),children:[(0,w.jsx)(Ie,{className:`h-3.5 w-3.5 mr-1`}),O(`approve`,`Approve`)]}),(0,w.jsxs)(s,{size:`sm`,variant:`outline`,className:`h-7 flex-1 border-destructive text-destructive`,disabled:Kt===e.id,onClick:()=>Gt(e),children:[(0,w.jsx)(he,{className:`h-3.5 w-3.5 mr-1`}),O(`reject`,`Reject`)]})]})]})},e.id))}),M!==`pending`&&bt!=null&&(0,w.jsxs)(`div`,{className:`flex items-center justify-center gap-3 py-1`,children:[(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:O(`loadedOf`,`Loaded {{loaded}} of {{total}}`,{loaded:N.length,total:bt})}),N.length<bt&&(0,w.jsx)(s,{size:`sm`,variant:`outline`,disabled:vt,onClick:()=>void hn(),children:vt?O(`loadingMore`,`Loading…`):O(`loadMore`,`Load more`)})]}),(0,w.jsx)(`div`,{className:`hidden md:block text-[11px] text-muted-foreground`,children:O(`keyboardHint`,`Keyboard: j/k move · Enter open · x select · a approve · r reject`)})]})]})]}),(0,w.jsx)(g,{open:Jt,onOpenChange:e=>{e||(Yt(!1),Zt(``))},children:(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`reassignTitle`,`Hand this approval to someone else?`)}),(0,w.jsx)(_,{children:O(`reassignBody`,`Your approver slot moves to the person you pick — they are notified and can act immediately.`)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(Ue,{htmlFor:`reassign-to`,className:`text-xs`,children:O(`reassignTo`,`New approver`)}),(0,w.jsx)(Le,{id:`reassign-to`,list:`reassign-user-options`,value:Xt,onChange:e=>Zt(e.target.value),placeholder:O(`reassignToPlaceholder`,`Pick a user or type an email / role:<name>`),className:`mt-1`}),(0,w.jsx)(`datalist`,{id:`reassign-user-options`,children:dn.map(e=>(0,w.jsx)(`option`,{value:e.email,children:e.name},e.email))})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{disabled:!Xt.trim()||W,onClick:()=>void vn(),children:O(`reassignBtn`,`Reassign`)})]})]})}),(0,w.jsx)(g,{open:Qt,onOpenChange:e=>{e||($t(!1),tn(``))},children:(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`requestInfoTitle`,`Ask the requester for more information?`)}),(0,w.jsx)(_,{children:O(`requestInfoBody`,`The request stays pending; the requester is notified and can reply on the thread.`)})]}),(0,w.jsx)(Re,{value:en,onChange:e=>tn(e.target.value),rows:3,placeholder:O(`requestInfoPlaceholder`,`What do you need from the requester?`)}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{disabled:!en.trim()||W,onClick:()=>void bn(),children:O(`requestInfoBtn`,`Request info`)})]})]})}),(0,w.jsx)(g,{open:nn,onOpenChange:e=>{e||(rn(!1),on(``))},children:(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`sendBackTitle`,`Send this request back for revision?`)}),(0,w.jsx)(_,{children:O(`sendBackBody`,`This round ends and the record unlocks so the requester can fix the data. When they resubmit, a fresh approval round opens for all approvers.`)})]}),(0,w.jsx)(Re,{value:an,onChange:e=>on(e.target.value),rows:3,placeholder:O(`sendBackPlaceholder`,`What needs to be fixed before this can be approved?`)}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{disabled:W,onClick:()=>void xn(),children:O(`sendBackBtn`,`Send back`)})]})]})}),(0,w.jsx)(g,{open:!!U,onOpenChange:e=>!e&&Gt(null),children:(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`rejectOneTitle`,`Reject "{{title}}"?`,{title:U?U.record_title||T(U.record_id):``})}),(0,w.jsx)(_,{children:O(`rejectOneBody`,`This rejects the request and notifies the submitter.`)})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{onClick:()=>void Ln(),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:O(`reject`,`Reject`)})]})]})}),(0,w.jsx)(se,{open:!!P,onOpenChange:e=>!e&&gn(),children:(0,w.jsxs)(_e,{className:`w-full sm:max-w-xl overflow-y-auto`,children:[(0,w.jsxs)(oe,{children:[(0,w.jsx)(ue,{children:F?it(F):O(`drawerTitle`,`Approval Request`)}),(0,w.jsx)(xe,{children:F?at(F)||ct(F):``})]}),F&&An>=0&&Z.length>1&&(0,w.jsxs)(`div`,{className:`flex items-center justify-between mt-2 text-xs text-muted-foreground`,children:[(0,w.jsxs)(s,{variant:`ghost`,size:`sm`,className:`h-7 px-2`,disabled:An<=0,onClick:()=>{let e=Z[An-1];e&&q(e.id)},children:[(0,w.jsx)(ve,{className:`h-4 w-4 mr-0.5`}),O(`prevRequest`,`Previous`)]}),(0,w.jsx)(`span`,{children:O(`positionOf`,`{{index}} of {{total}}`,{index:An+1,total:Z.length})}),(0,w.jsxs)(s,{variant:`ghost`,size:`sm`,className:`h-7 px-2`,disabled:An>=Z.length-1,onClick:()=>{let e=Z[An+1];e&&q(e.id)},children:[O(`nextRequest`,`Next`),(0,w.jsx)(ie,{className:`h-4 w-4 ml-0.5`})]})]}),At?(0,w.jsxs)(`div`,{className:`space-y-2 mt-6`,children:[(0,w.jsx)(o,{className:`h-6 w-3/4`}),(0,w.jsx)(o,{className:`h-6 w-1/2`}),(0,w.jsx)(o,{className:`h-20 w-full`})]}):F?(0,w.jsxs)(`div`,{className:`space-y-4 mt-6`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:[(0,w.jsx)(dt,{status:F.status}),(F.round??1)>1&&(0,w.jsx)(qe,{variant:`outline`,className:`text-[10px] border-violet-200 text-violet-700 dark:border-violet-500/30 dark:text-violet-400`,children:O(`roundChip`,`Round {{n}}`,{n:F.round})}),(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1`,title:rt(D(F)),children:[(0,w.jsx)(Me,{className:`h-3 w-3`}),O(`submittedAgo`,`Submitted {{when}}`,{when:k(D(F))})]}),F.completed_at&&(0,w.jsxs)(`span`,{children:[`· `,O(`completedAt`,`Completed {{when}}`,{when:k(F.completed_at)})]}),F.status===`pending`&&F.sla_due_at&&(0,w.jsx)(qe,{variant:`outline`,className:h(`text-[10px]`,Date.parse(F.sla_due_at)<Date.now()?`border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-400`:`border-border text-muted-foreground`),children:Date.parse(F.sla_due_at)<Date.now()?O(`slaOverdue`,`SLA overdue {{dur}}`,{dur:ut(Date.now()-Date.parse(F.sla_due_at))}):O(`slaRemaining`,`SLA {{dur}} left`,{dur:ut(Date.parse(F.sla_due_at)-Date.now())})})]}),(0,w.jsx)(Je,{children:(0,w.jsxs)(Be,{className:`p-4 space-y-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsxs)(t,{to:pt(F),className:`text-base font-semibold hover:underline inline-flex items-center gap-1.5`,children:[(0,w.jsx)(`span`,{className:`truncate`,children:F.record_title||T(F.record_id)}),(0,w.jsx)(Ce,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}),(0,w.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:ct(F)})]}),(0,w.jsx)(`div`,{className:`text-right text-xs text-muted-foreground shrink-0`,children:(0,w.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,w.jsx)(Qe,{className:`h-3 w-3`}),(0,w.jsx)(`span`,{title:F.submitter_id||``,children:ot(F)})]})})]}),ft(F.payload,F.payload_display).length>0&&(0,w.jsx)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-2 text-sm border-t pt-3`,children:ft(F.payload,F.payload_display).map(([e,t])=>(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e}),(0,w.jsx)(`div`,{className:`truncate`,title:t,children:t})]},e))}),F.status===`pending`&&(F.pending_approvers||[]).length>0&&(0,w.jsxs)(`div`,{className:`border-t pt-3`,children:[(0,w.jsx)(`div`,{className:`text-[11px] text-muted-foreground mb-1`,children:O(`waitingOn`,`Waiting on`)}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:(F.pending_approvers||[]).map((e,t)=>(0,w.jsx)(qe,{variant:`outline`,className:`text-[11px]`,title:e,children:st(e,F)},t))})]})]})}),(F.flow_steps?.length??0)>1&&(0,w.jsx)(`div`,{className:`flex items-center px-1`,"aria-label":O(`stepProgress`,`Approval steps`),children:F.flow_steps.map((e,t)=>(0,w.jsxs)(x.Fragment,{children:[t>0&&(0,w.jsx)(`div`,{className:h(`h-px flex-1 mx-2`,e.state===`done`||e.state===`current`?`bg-emerald-300 dark:bg-emerald-700`:`bg-border`)}),(0,w.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,w.jsx)(`span`,{className:h(`flex items-center justify-center h-5 w-5 rounded-full text-[10px] font-semibold`,e.state===`done`&&`bg-emerald-500 text-white`,e.state===`current`&&`bg-amber-500 text-white ring-2 ring-amber-200 dark:ring-amber-500/30`,e.state===`upcoming`&&`bg-muted text-muted-foreground border`),children:e.state===`done`?(0,w.jsx)(ge,{className:`h-3 w-3`}):t+1}),(0,w.jsx)(`span`,{className:h(`text-xs`,e.state===`current`?`font-medium`:`text-muted-foreground`),children:e.label})]})]},e.id))}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h3`,{className:`text-sm font-semibold mb-3`,children:O(`history`,`Activity`)}),Ot.length===0?(0,w.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:O(`noActions`,`No actions yet.`)}):(0,w.jsx)(`ol`,{className:`relative space-y-3 pl-5 before:absolute before:left-[7px] before:top-1 before:bottom-1 before:w-px before:bg-border`,children:Ot.map(e=>{let t=e.action===`approve`?`bg-emerald-500`:e.action===`reject`?`bg-destructive`:e.action===`submit`?`bg-blue-500`:e.action===`reassign`?`bg-indigo-500`:e.action===`remind`||e.action===`request_info`?`bg-amber-500`:e.action===`comment`?`bg-slate-400`:e.action===`escalate`?`bg-red-500`:e.action===`revise`?`bg-violet-500`:e.action===`resubmit`?`bg-blue-500`:`bg-muted-foreground`,n=e.actor_id===`system:sla`?O(`systemSlaActor`,`System (SLA)`):e.actor_name??(e.actor_id&&e.actor_id===F.submitter_id?ot(F):T(e.actor_id)),r=e.action===`submit`?O(`actSubmit`,`Submitted`):e.action===`approve`?O(`actApprove`,`Approved`):e.action===`reject`?O(`actReject`,`Rejected`):e.action===`recall`?O(`actRecall`,`Recalled`):e.action===`reassign`?O(`actReassign`,`Reassigned`):e.action===`remind`?O(`actRemind`,`Reminder sent`):e.action===`request_info`?O(`actRequestInfo`,`Requested more info`):e.action===`comment`?O(`actComment`,`Commented`):e.action===`escalate`?O(`actEscalate`,`SLA escalated`):e.action===`revise`?O(`actRevise`,`Sent back for revision`):e.action===`resubmit`?O(`actResubmit`,`Resubmitted`):e.action;return(0,w.jsxs)(`li`,{className:`relative text-xs`,children:[(0,w.jsx)(`span`,{className:`absolute -left-[18px] top-1 h-3 w-3 rounded-full ring-2 ring-background ${t}`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`flex items-baseline gap-1.5 flex-wrap`,children:[(0,w.jsx)(`span`,{className:`font-medium`,children:r}),(0,w.jsx)(`span`,{className:`text-muted-foreground`,children:`·`}),(0,w.jsx)(`span`,{title:e.actor_id||``,children:n}),(0,w.jsx)(`span`,{className:`ml-auto text-muted-foreground text-[10px]`,title:rt(e.created_at),children:k(e.created_at)})]}),e.comment&&(0,w.jsxs)(`div`,{className:`text-muted-foreground italic mt-0.5`,children:[`"`,e.comment,`"`]})]},e.id)})}),F.status===`pending`&&(Tn||En)&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 mt-3`,children:[(0,w.jsx)(Le,{value:ln,onChange:e=>un(e.target.value),onKeyDown:e=>{e.key===`Enter`&&ln.trim()&&(e.preventDefault(),Cn())},placeholder:O(`replyPlaceholder`,`Reply on this request…`),className:`h-8 text-sm`}),(0,w.jsx)(s,{size:`sm`,variant:`outline`,className:`h-8 px-2 shrink-0`,disabled:!ln.trim()||W,onClick:()=>void Cn(),children:(0,w.jsx)(ne,{className:`h-3.5 w-3.5`})})]})]}),F.payload!=null&&(0,w.jsxs)(`details`,{className:`group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground hover:text-foreground select-none`,children:O(`rawData`,`Raw data (JSON)`)}),(0,w.jsxs)(`div`,{className:`mt-2`,children:[(0,w.jsx)(`div`,{className:`flex justify-end`,children:(0,w.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(JSON.stringify(F.payload,null,2)),b.success(O(`copied`,`Copied`))}catch{b.error(O(`copyFailed`,`Copy failed`))}},className:`text-[10px] text-muted-foreground hover:text-foreground inline-flex items-center gap-1`,children:[(0,w.jsx)(Ee,{className:`h-3 w-3`}),O(`copy`,`Copy`)]})}),(0,w.jsx)(`pre`,{className:`text-[11px] bg-muted/50 rounded p-2 overflow-auto max-h-48 mt-1`,children:JSON.stringify(F.payload,null,2)})]})]}),F.status===`pending`&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Ke,{}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[$e&&(0,w.jsxs)(`details`,{className:`group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-xs text-muted-foreground hover:text-foreground select-none`,children:O(`overrideActor`,`Act as another identity (admin)`)}),(0,w.jsxs)(`div`,{className:`mt-2`,children:[(0,w.jsx)(Ue,{htmlFor:`actor-override`,className:`text-xs`,children:O(`actor`,`Actor`)}),(0,w.jsx)(`input`,{id:`actor-override`,type:`text`,value:R,onChange:e=>Mt(e.target.value),placeholder:`${O(`auto`,`Auto`)}: ${J(F)||`—`}`,className:`w-full mt-1 px-3 py-2 text-sm border rounded-md bg-background`}),(0,w.jsx)(`div`,{className:`text-[10px] text-muted-foreground mt-1`,children:O(`overrideHint`,`e.g. role:sales_manager. Leave blank to use the auto-detected identity.`)})]})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(Ue,{htmlFor:`comment`,className:`text-xs`,children:O(`comment`,`Comment (optional)`)}),(0,w.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mt-1.5`,children:[O(`quickPhrase1`,`Approved — meets requirements.`),O(`quickPhrase2`,`Approved with conditions — please monitor execution.`),O(`quickPhrase3`,`Please add supporting material and resubmit.`)].map(e=>(0,w.jsx)(`button`,{type:`button`,onClick:()=>L(e),className:`text-[11px] px-2 py-0.5 rounded-full border text-muted-foreground hover:text-foreground hover:bg-accent transition-colors`,children:e},e))}),(0,w.jsx)(Re,{id:`comment`,value:I,onChange:e=>L(e.target.value),rows:2,className:`mt-1`})]}),(0,w.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[(0,w.jsxs)(s,{size:`sm`,onClick:()=>_n(`approve`),disabled:!Tn||z!==null,children:[(0,w.jsx)(Ie,{className:`h-4 w-4 mr-1`}),z===`approve`?O(`approving`,`Approving…`):O(`approve`,`Approve`)]}),(0,w.jsxs)(g,{children:[(0,w.jsx)(me,{asChild:!0,children:(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:!Tn||z!==null,className:`border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground`,children:[(0,w.jsx)(he,{className:`h-4 w-4 mr-1`}),z===`reject`?O(`rejecting`,`Rejecting…`):O(`reject`,`Reject`)]})}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`rejectTitle`,`Reject this request?`)}),(0,w.jsx)(_,{children:O(`rejectBody`,`This marks the request as rejected and notifies the submitter.`)})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{onClick:()=>_n(`reject`),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:O(`reject`,`Reject`)})]})]})]}),Tn&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:z!==null||W,className:`border-violet-300 text-violet-700 hover:bg-violet-50 dark:text-violet-400`,onClick:()=>rn(!0),children:[(0,w.jsx)(Ve,{className:`h-4 w-4 mr-1`}),O(`sendBackBtn`,`Send back`)]}),(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:z!==null||W,className:`border-amber-300 text-amber-700 hover:bg-amber-50 dark:text-amber-400`,onClick:()=>$t(!0),children:[(0,w.jsx)(ae,{className:`h-4 w-4 mr-1`}),O(`requestInfoBtn`,`Request info`)]}),(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:z!==null||W,onClick:()=>{wn(),Yt(!0)},children:[(0,w.jsx)(pe,{className:`h-4 w-4 mr-1`}),O(`reassignBtn`,`Reassign`)]})]}),En&&(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:W,onClick:()=>void yn(),children:[(0,w.jsx)(He,{className:`h-4 w-4 mr-1`}),O(`remindBtn`,`Send reminder`)]}),En&&(0,w.jsxs)(g,{children:[(0,w.jsx)(me,{asChild:!0,children:(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:z!==null,children:[(0,w.jsx)(be,{className:`h-4 w-4 mr-1`}),z===`recall`?O(`recalling`,`Recalling…`):O(`recall`,`Recall`)]})}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`recallTitle`,`Recall this request?`)}),(0,w.jsx)(_,{children:O(`recallBody`,`This withdraws your request. Approvers can no longer act on it, and the record is unlocked.`)})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{onClick:()=>_n(`recall`),children:O(`recall`,`Recall`)})]})]})]})]}),!Tn&&(0,w.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:En?O(`whyDisabledSubmitter`,`You submitted this request, so you can recall it — but only the assigned approvers can approve or reject.`):O(`whyDisabled`,`Only the assigned approvers can act on this request. It is waiting on: {{who}}.`,{who:(F.pending_approvers||[]).map(e=>st(e,F)).join(`, `)||`—`})})]})]}),Dn&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(Ke,{}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[(0,w.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:O(`returnedHint`,`An approver sent this back to you. The record is unlocked — fix the data, then resubmit to start a new approval round.`)}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(Ue,{htmlFor:`resubmit-comment`,className:`text-xs`,children:O(`comment`,`Comment (optional)`)}),(0,w.jsx)(Re,{id:`resubmit-comment`,value:I,onChange:e=>L(e.target.value),rows:2,className:`mt-1`,placeholder:O(`resubmitPlaceholder`,`What did you change?`)})]}),(0,w.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[(0,w.jsx)(s,{asChild:!0,size:`sm`,variant:`outline`,children:(0,w.jsxs)(t,{to:pt(F),children:[(0,w.jsx)(Ce,{className:`h-4 w-4 mr-1`}),O(`editRecordBtn`,`Edit record`)]})}),(0,w.jsxs)(s,{size:`sm`,disabled:sn,onClick:()=>void Sn(),children:[(0,w.jsx)(ye,{className:h(`h-4 w-4 mr-1`,sn&&`animate-spin`)}),sn?O(`resubmitting`,`Resubmitting…`):O(`resubmitBtn`,`Resubmit`)]}),(0,w.jsxs)(g,{children:[(0,w.jsx)(me,{asChild:!0,children:(0,w.jsxs)(s,{size:`sm`,variant:`outline`,disabled:sn,children:[(0,w.jsx)(be,{className:`h-4 w-4 mr-1`}),O(`recall`,`Recall`)]})}),(0,w.jsxs)(l,{children:[(0,w.jsxs)(d,{children:[(0,w.jsx)(v,{children:O(`abandonTitle`,`Abandon this revision?`)}),(0,w.jsx)(_,{children:O(`abandonBody`,`This withdraws the request instead of resubmitting it. The approval ends here.`)})]}),(0,w.jsxs)(y,{children:[(0,w.jsx)(f,{children:O(`cancel`,`Cancel`)}),(0,w.jsx)(m,{onClick:()=>_n(`recall`),children:O(`recall`,`Recall`)})]})]})]})]})]})]})]}):null]})})]})}export{pt as ApprovalsInboxPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{d as t,f as n,r,y as i}from"./vendor-react-BGDDiZfJ.js";import{l as a}from"./framework-CWU64Lvg.js";import{Cr as o,Di as s,Jt as c,Qt as l,Xt as u,Yt as d,Zt as f,ft as p,j as m,pi as h,pt as g,ut as _}from"./ui-components-DHIW7RSX.js";import{r as v}from"./vendor-ui-utils-BzQBRdq3.js";import{i as y,n as b,s as x,t as ee}from"./assistantBus-BFk4fCbM.js";import{a as te,d as S,f as ne,i as re,l as ie,n as C,t as w}from"./surfaceAgent-qmokOosD.js";import{C as ae,a as oe,f as T,g as E,h as D,m as O,r as se,t as ce,u as le,y as ue}from"./plugin-chatbot-BT49v2CR.js";import{E as k,n as de}from"./marketplaceApi-1mMRJWDq.js";var A=e(i(),1);function j(e){return e.some(e=>D(e.name))&&e.some(e=>E(e.name))}function M({agents:e,showAgentPickerProp:t,envOptIn:n=!1,aiStudioEnabled:r=!0}){return t===void 0?n?!0:r&&j(e):t}var N=r(),P={ask:{zh:`智能助手`,en:`Assistant`},build:{zh:`构建助手`,en:`Build assistant`}};function F(e,t,n){let r=t?P[O(t)]:void 0;return r?e?r.zh:r.en:n}function fe(e,t,n,r,i){let a=(e??``).toLowerCase().startsWith(`zh`),o=F(a,n,r),s=i.slice(0,2).map(e=>e.label||e.name),c=O(n??``)===`build`;if(a){let e=c?[`帮我搭一个客户跟进 CRM`,`搭一个项目与任务管理应用`,`给当前应用加一个仪表盘`]:[s[0]?`查询最近创建的${s[0]}`:`帮我查询最近的数据`,s[0]?`统计${s[0]}的总数量`:`统计各对象的记录数量`,s[1]?`${s[1]}有哪些字段?`:`当前应用里有哪些数据对象?`].filter(Boolean);return{agentLabel:o,labels:{emptyTitle:`你好,我是${o}`,emptyDescription:c?`告诉我你想管理什么,我会为你搭出完整应用——对象、视图、仪表盘和示例数据一次到位;也可以直接说要改哪里。`:`随时帮你查询和分析「${t}」中的数据。试试下面的问题,或直接输入你的需求。`,clear:`清空对话`,sendHint:`发送`,agentActivity:`执行过程`,toolCompleted:`已完成`,toolRunning:`运行中`,toolAwaitingApproval:`等待确认`,toolFailed:`失败`,connectionWaiting:`正在等待服务器响应…`,connectionStalledLabel:`仍在处理中…`,connectionOfflineLabel:`网络已断开,正在重连…`,designingPlanLabel:`正在为你设计方案…`,designingPlanHints:[`梳理需要记录的数据…`,`设计对象与字段…`,`关联相关记录…`,`配置关系与查找字段…`,`规划页面与视图…`,`布置表单与列表…`,`补充默认值与校验…`,`规划一个看板来跟踪…`,`复核整体结构是否自洽…`,`汇总成完整方案…`],toolDetailsHidden:`已隐藏工具参数和原始结果,仅保留过程摘要。`,copy:`复制`,copied:`已复制`,regenerate:`重新生成`,model:`模型`,submit:`发送`,uploadFiles:`上传文件`,stopResponse:`停止生成`,sendFailedRateLimited:`发送过于频繁,请稍候再试。你的消息已保留在输入框中。`,sendFailedGeneric:`消息发送失败,请重试。你的消息已保留在输入框中。`,trace:`调试 trace`,viewTrace:`查看调试 trace`},placeholder:`向${o}提问…`,loadingPlaceholder:`正在加载助手…`,title:`${t} 智能助手`,newChat:`开启新对话`,share:`分享对话`,reviewDraft:e=>`查看 ${e} 项变更`,publishDrafts:`发布`,published:`已发布`,nextSteps:`下一步`,planTitle:`方案预览`,planQuestions:`搭建前请确认`,planAssumptions:`假设`,planDeferred:`待补 / 暂未搭建`,planApproveHint:`回复以确认或调整该方案。`,planApprove:`开始搭建`,planAdjust:`调整方案`,planBuilt:`已搭建`,planReady:`方案已就绪。点击开始搭建,或告诉我需要调整什么。`,planApproveMessage:`确认,开始搭建。`,planApproveDefaultsMessage:`确认搭建,未决问题按你的合理假设和默认处理。`,planAnswer:(e,t)=>`关于「${e}」,我选择「${t}」。`,publishOk:`已发布,对象已生效。`,publishFailed:`发布失败`,seedWarn:`已发布,但部分示例数据未能载入。`,openBuiltApp:`打开应用`,suggestions:e}}let l=c?[`Build me a customer follow-up CRM`,`Build a project & task tracker`,`Add a dashboard to this app`]:[s[0]?`Show the latest ${s[0]}`:`Show my most recent records`,s[0]?`How many ${s[0]} are there?`:`Count records by status`,s[1]?`What fields does ${s[1]} have?`:`What data can I work with here?`].filter(Boolean);return{agentLabel:o,labels:{emptyTitle:`Hi, I'm ${o}`,emptyDescription:c?`Tell me what you want to manage and I'll build the app — objects, views, a dashboard and sample data in one go. Or just say what to change.`:`I can help you query and analyze your ${t} data. Try a prompt below, or just type your question.`,clear:`Clear`,sendHint:`to send`,agentActivity:`Agent activity`,toolCompleted:`Completed`,toolRunning:`Running`,toolAwaitingApproval:`Awaiting approval`,toolFailed:`Failed`,connectionWaiting:`Waiting for server…`,connectionStalledLabel:`Still working…`,connectionOfflineLabel:`Connection lost — reconnecting…`,designingPlanLabel:`Designing your app…`,designingPlanHints:[`Mapping out the data you’ll track…`,`Shaping objects and their fields…`,`Connecting related records…`,`Setting up relationships and lookups…`,`Planning the screens and views…`,`Laying out forms and lists…`,`Adding sensible defaults and validations…`,`Sketching a dashboard to track it…`,`Double-checking the structure hangs together…`,`Pulling the plan together…`],toolDetailsHidden:`Tool inputs and raw results are hidden in this view.`,copy:`Copy`,copied:`Copied`,regenerate:`Regenerate`,model:`Model`,submit:`Submit`,uploadFiles:`Upload files`,stopResponse:`Stop response`,sendFailedRateLimited:`You're sending messages too quickly. Your message is kept below — wait a moment and try again.`,sendFailedGeneric:`Couldn't send your message. It's kept below — please try again.`,trace:`trace`,viewTrace:`View trace`},placeholder:`Ask ${o}...`,loadingPlaceholder:`Loading assistant...`,title:`${t} Assistant`,newChat:`New chat`,share:`Share conversation`,reviewDraft:e=>`Review ${e} change${e===1?``:`s`}`,publishDrafts:`Publish`,published:`Published`,nextSteps:`What's next`,planTitle:`Proposed plan`,planQuestions:`Confirm before building`,planAssumptions:`Assumptions`,planDeferred:`Not yet built`,planApproveHint:`Reply to approve or adjust this plan.`,planApprove:`Build it`,planAdjust:`Adjust`,planBuilt:`Built`,planReady:`The plan is ready. Build it now, or tell me what to adjust.`,planApproveMessage:`Looks good — build it as proposed.`,planApproveDefaultsMessage:`Build it with your best assumptions; use sensible defaults for the open questions.`,planAnswer:(e,t)=>`For "${e}", go with: ${t}.`,publishOk:`Published — objects are now live.`,publishFailed:`Publish failed`,seedWarn:`Published, but some sample data failed to load.`,openBuiltApp:`Open app`,suggestions:l}}var I=`/api/v1/ai`;function L(e){if(e)return e.replace(/\/$/,``);let t={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_SENTRY_DSN:`https://1373a588ceb9da150b11e64bf85f583d@o4510356161757184.ingest.us.sentry.io/4511439670673408`,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_SEND_DEFAULT_PII:`true`,VITE_SERVER_URL:``,VITE_USE_MOCK_SERVER:`false`},n=t.VITE_AI_BASE_URL;return n?n.replace(/\/$/,``):`${(t.VITE_SERVER_URL??``).replace(/\/$/,``)}${I}`}function pe(e,t){if(!e||e.type!==`object`)return null;let n=e.label||e.name||`this object`;return(t??``).toLowerCase().startsWith(`zh`)?[`为「${n}」补充字段`,`为「${n}」建议校验规则`,`添加一个状态选项字段`]:[`Add fields to ${n}`,`Suggest validations for ${n}`,`Add a status picklist field`]}var R=new Set([`view`,`record`,`page`,`dashboard`,`design`,`report`,`metadata`]);function z(e){try{return decodeURIComponent(e)}catch{return e}}function me(e,t){let n=e.split(`/`).filter(Boolean),r=n.indexOf(`apps`);if(r===-1||n.length<r+3)return{};let i=z(n[r+2]);if(R.has(i)||!t.some(e=>e.name===i))return{};let a=n[r+3]?z(n[r+3]):void 0,o=a&&a!==`new`?a:void 0;return{objectName:i,...o?{recordId:o}:{}}}function B({appLabel:e,appName:r,objects:i,agents:S,agentsLoading:w,activeAgent:T,onAgentChange:E,showAgentPicker:D,chatApi:O,apiBase:j,defaultOpen:M=!1,conversationId:P,initialMessages:I,onNewChat:L}){let{language:R}=a(),z=n(),B=t(),V=A.useMemo(()=>me(B.pathname,i),[B.pathname,i]),{editor:H}=x(),{models:he,defaultModelId:ge}=le({apiBase:j}),[_e,ve]=A.useState(void 0),ye=_e??ge,U=A.useMemo(()=>!I||I.length===0?[]:ae(I),[I]),W=A.useMemo(()=>S.find(e=>e.name===T)?.label??T??e,[S,T,e]),{errorSuppressed:be,handleChatError:xe,setMessagesRef:Se,resetSuppression:G}=re({chatApi:O,conversationId:P}),{messages:K,isLoading:q,error:Ce,sendMessage:J,stop:we,reload:Te,clear:Ee,setMessages:Y}=ue({api:O,conversationId:P,model:ye,onError:xe,body:{context:{activeApp:e,appName:r,objects:i.map(e=>({name:e.name,label:e.label})),agentName:T,autoPublishAiBuilds:k().features.autoPublishAiBuilds,...V.objectName?{objectName:V.objectName}:{},...V.recordId?{recordId:V.recordId}:{},...H?{editing:H}:{}}},initialMessages:U,autoResponse:!O,autoResponseText:i.length>0?`I can help you work with ${i.map(e=>e.label||e.name).join(`, `)}. What would you like to do?`:`Thanks for your message! I'm here to help you navigate and manage your data.`,autoResponseDelay:600});A.useEffect(()=>{Se.current=Y},[Y]),A.useEffect(()=>{ne(P,ie(K))},[P,K]);let X=A.useMemo(()=>C(K)??C(U)??R,[K,U,R]),Z=A.useMemo(()=>fe(X,e,T,W,i),[X,e,T,W,i]),De=A.useMemo(()=>pe(H,X),[H,X]),Q=ce({messages:K,apiBase:j,continueConversation:e=>{G(),J(e)}}),Oe=(R??``).toLowerCase().startsWith(`zh`),ke=D&&S.length>1?S.length<=3?(0,N.jsx)(_,{value:T,onValueChange:E,children:(0,N.jsx)(p,{className:`h-7 gap-0.5 p-0.5`,"data-testid":`floating-chatbot-agent-picker`,children:S.map(e=>(0,N.jsx)(g,{value:e.name,disabled:w,title:e.description||void 0,className:`h-6 px-2.5 text-xs`,children:F(Oe,e.name,e.label)},e.name))})}):(0,N.jsxs)(c,{value:T,onValueChange:E,disabled:w,children:[(0,N.jsx)(f,{className:`h-7 w-[180px] text-xs`,"data-testid":`floating-chatbot-agent-picker`,children:(0,N.jsx)(l,{placeholder:`Choose agent...`})}),(0,N.jsx)(d,{align:`end`,children:S.map(e=>(0,N.jsxs)(u,{value:e.name,className:`text-xs`,children:[(0,N.jsx)(`span`,{className:`font-medium`,children:e.label}),e.description?(0,N.jsx)(`span`,{className:`block text-muted-foreground text-[10px] truncate max-w-[220px]`,children:e.description}):null]},e.name))})]}):null,[Ae,$]=A.useState(!1),je=A.useMemo(()=>j.replace(/\/v1\/ai$/,``).replace(/\/ai$/,``)||`/api`,[j]),Me=(0,N.jsxs)(N.Fragment,{children:[K.length>0?(0,N.jsx)(o,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":Z.newChat,title:Z.newChat,"data-testid":`floating-chatbot-new`,onClick:L,children:(0,N.jsx)(h,{className:`h-4 w-4`})}):null,P?(0,N.jsx)(o,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,"aria-label":Z.share,title:Z.share,"data-testid":`floating-chatbot-share`,onClick:()=>$(!0),children:(0,N.jsx)(s,{className:`h-4 w-4`})}):null]});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(se,{onUpgrade:()=>window.open(de(),`_blank`,`noopener,noreferrer`),floatingConfig:{position:`bottom-right`,defaultOpen:M,panelWidth:420,panelHeight:560,title:Z.title,triggerSize:56},headerExtra:ke,headerActions:Me,messages:K,labels:Z.labels,models:he,selectedModelId:ye,onModelChange:ve,showAvatars:!0,hideClearBar:!0,assistantAvatarFallback:Z.agentLabel,suggestions:K.length===0?De??Z.suggestions:void 0,placeholder:T?Z.placeholder:w?Z.loadingPlaceholder:Z.placeholder,onSendMessage:e=>{G(),J(e)},onClear:Ee,onStop:q?we:void 0,onReload:Te,isLoading:q,error:be?void 0:Ce,enableMarkdown:!0,onToolApprove:Q.decide,toolDecisions:Q.decisions,toolApproveLabel:`Approve & run`,toolDenyLabel:`Reject`,toolDenyReason:`Operator rejected from chat`,onReviewDraft:e=>{e[0]&&y(e[0])},toolReviewLabel:Z.reviewDraft,onOpenBuiltApp:e=>z(`/apps/${encodeURIComponent(e)}`),openBuiltAppLabel:Z.openBuiltApp,onPreviewDraftApp:(e,t)=>z(t?.materialized?`/apps/${encodeURIComponent(e)}`:`/apps/${encodeURIComponent(e)}?preview=draft`),onDraftArtifacts:e=>{for(let t of e)ee(t)},fetchPendingDraftCount:te,onPublishDrafts:async e=>{try{let t=await fetch(`/api/v1/packages/${encodeURIComponent(e)}/publish-drafts`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:`{}`}),n=await t.json().catch(()=>null);if(!t.ok||n?.success===!1)throw Error(n?.error?.message||`HTTP ${t.status}`);let r=n?.data?.failedCount??n?.failedCount??0;if(r){let e=n?.data?.failed??n?.failed??[],t=e.find(e=>e?.error)??e[0],i=t?`${[t.type,t.name].filter(Boolean).join(` `)}${t.error?`: ${t.error}`:``}`:n?.error?.message;throw Error(i?`${i}${r>1?` (+${r-1} more)`:``}`:`${r} item(s) failed to publish`)}let i=n?.data?.seedApplied??n?.seedApplied;i&&i.success===!1?v.warning(Z.seedWarn,{description:i.error??(Array.isArray(i.errors)&&i.errors.length?String(i.errors[0]):void 0)}):v.success(Z.publishOk),b();let a=(n?.data?.published??n?.published??[]).find(e=>e?.type===`app`&&e?.name);return a?.name&&z(`/apps/${encodeURIComponent(a.name)}`),{ok:!0,health:oe(n)}}catch(e){return v.error(Z.publishFailed,{description:e instanceof Error?e.message:void 0}),!1}},publishDraftsLabel:Z.publishDrafts,nextStepsLabel:Z.nextSteps,planTitleLabel:Z.planTitle,planQuestionsLabel:Z.planQuestions,planAssumptionsLabel:Z.planAssumptions,planDeferredLabel:Z.planDeferred,planApproveHintLabel:Z.planApproveHint,planApproveLabel:Z.planApprove,planAdjustLabel:Z.planAdjust,planBuiltLabel:Z.planBuilt,planReadyLabel:Z.planReady,planApproveMessage:Z.planApproveMessage,planApproveDefaultsMessage:Z.planApproveDefaultsMessage,planAnswerMessage:Z.planAnswer,publishedLabel:Z.published,autoPublishDrafts:k().features.autoPublishAiBuilds}),P&&(0,N.jsx)(m,{open:Ae,onOpenChange:$,objectName:`ai_conversations`,recordId:P,recordLabel:`this conversation`,apiBase:je})]})}function V({appLabel:e,appName:t,objects:n,apiBase:r,defaultAgent:i,showAgentPicker:a,defaultOpen:o=!1,userId:s}){let c=A.useMemo(()=>L(r),[r]),l={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_SENTRY_DSN:`https://1373a588ceb9da150b11e64bf85f583d@o4510356161757184.ingest.us.sentry.io/4511439670673408`,VITE_SENTRY_ENVIRONMENT:`production`,VITE_SENTRY_SEND_DEFAULT_PII:`true`,VITE_SERVER_URL:``,VITE_USE_MOCK_SERVER:`false`},u=l.VITE_AI_DEFAULT_AGENT,{agents:d,isLoading:f,error:p}=T({apiBase:c}),m=M({agents:d,showAgentPickerProp:a,envOptIn:l.VITE_AI_SHOW_AGENT_PICKER===`true`,aiStudioEnabled:k().features.aiStudio!==!1}),[h,g]=A.useState(void 0);A.useEffect(()=>{if(!h&&d.length>0){let e=d.some(e=>O(e.name)===`build`),t=w(`default`,{agents:d,appDefaultAgent:i??u??(e?`build`:void 0),aiStudioEnabled:k().features.aiStudio!==!1});t&&g(t)}},[d,h,i,u]);let _=h?`${c}/agents/${encodeURIComponent(h)}/chat`:void 0,v=h?O(h)===`build`:!1,{conversationId:y,initialMessages:b,startNew:x}=S({userId:h?s:void 0,scope:h,apiBase:c,resumeMode:v?`resume`:`fresh`});return(0,N.jsx)(B,{appLabel:e,appName:t,objects:n,agents:d,agentsLoading:f,agentsError:p,activeAgent:h,onAgentChange:g,showAgentPicker:m,chatApi:_,apiBase:c,defaultOpen:o,conversationId:y,initialMessages:b,onNewChat:x},`${_??`local`}:${y??`pending`}`)}export{V as default};
@@ -1 +0,0 @@
1
- import{o as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{m as n,r,y as i}from"./vendor-react-BGDDiZfJ.js";import{E as a,L as o,R as s,l as c}from"./framework-CWU64Lvg.js";import{$a as l,Cr as u,Fc as d,Gn as f,Jn as p,K as m,Kn as h,X as g,Xn as _,Yn as v,q as y,qn as b}from"./ui-components-DHIW7RSX.js";import{r as x}from"./vendor-ui-utils-BzQBRdq3.js";import"./AdapterProvider-cnK1q1oP.js";import{n as S}from"./plugin-form-QFhBvb96.js";import"./MetadataProvider-C8ABa_gQ.js";import{r as C}from"./ExpressionProvider-D94jBDAc.js";import{t as w}from"./utils-Bixzg6Bz.js";import{n as T,r as E,t as D}from"./MetadataInspector-YoFTAkMA.js";import{n as O}from"./skeletons-ySdMMgAT.js";import{n as k}from"./plugin-dashboard-N2kUovsm.js";import{t as A}from"./useOpenRecordList-B3tjtz1e.js";var j=t({DashboardView:()=>P}),M=e(i(),1),N=r();function P({dataSource:e}){let t=A(),{dashboardName:r}=n(),{showDebug:i}=T(),j=o(),{t:P}=c(),{dashboardLabel:F,dashboardDescription:I}=d(),[L,R]=(0,M.useState)(!0),[z,B]=(0,M.useState)(null),V=(0,M.useCallback)(e=>{B(t=>(t&&t.resolve(e),null))},[]),H=(0,M.useCallback)(e=>new Promise(t=>{let n;if(typeof e==`string`){let t=e.match(/^(create|new|add|edit|update)_(.+)$/);if(t){let e=t[1];n={objectName:t[2],mode:e===`edit`||e===`update`?`edit`:`create`}}else n={objectName:e,mode:`create`}}else n=e;B({schema:n,resolve:t})}),[]),U=(0,M.useMemo)(()=>({export_dashboard_pdf:async()=>{x.info(P(`dashboardActions.pdfPreparing`));try{return window.print(),{success:!0}}catch(e){return x.error(P(`dashboardActions.exportFailed`,{message:e?.message||String(e)})),{success:!1,error:e?.message||String(e)}}},forecast_dashboard:async()=>(x.info(P(`dashboardActions.forecastSoon`)),{success:!0})}),[P]);(0,M.useEffect)(()=>{R(!0),queueMicrotask(()=>R(!1))},[r]);let{dashboards:W,objects:G}=s(),{app:K}=C(),q=E(W,r,K?._packageId),J=(0,M.useMemo)(()=>new Set((G||[]).map(e=>e?.name).filter(Boolean)),[G]),Y=(0,M.useMemo)(()=>{if(!q||J.size===0)return q;let e=q.widgets;if(!Array.isArray(e)||e.length===0)return q;let t=e.filter(e=>{let t=e?.requiresObject??e?.object;return t?J.has(t):!0});return t.length===e.length?q:{...q,widgets:t}},[q,J]);return L?(0,N.jsx)(O,{}):q?(0,N.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,N.jsx)(`div`,{className:`flex flex-col sm:flex-row justify-between sm:items-center gap-3 sm:gap-4 p-4 sm:p-6 border-b shrink-0`,children:(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(()=>{let e=w((Y||q).title,P),t=w(q.label,P),n=F({name:q.name,label:t});return(0,N.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:e||n||q.name})})(),(()=>{let e=(Y||q).description??q.description,t=I({name:q.name,description:w(e,P)});return t?(0,N.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:t}):null})()]})}),(0,N.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,N.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-2 sm:p-4 md:p-6`,children:(0,N.jsx)(a,{value:{openRecordList:t},children:(0,N.jsx)(k,{schema:Y,dataSource:e,modalHandler:H,scriptHandlers:U,hideHeaderText:!0})})}),(0,N.jsx)(D,{open:i,sections:[{title:`Dashboard Configuration`,data:Y}]})]}),z&&z.schema?.objectName?(0,N.jsx)(S,{schema:{type:`object-form`,formType:`modal`,objectName:z.schema.objectName,mode:z.schema.mode||`create`,recordId:z.schema.recordId,title:z.schema.title,description:z.schema.description,fields:z.schema.fields,open:!0,onOpenChange:e=>{e||V({success:!1})},onSuccess:e=>{V({success:!0,reload:!0,data:e})},onCancel:()=>{V({success:!1})},showSubmit:!0,showCancel:!0},dataSource:j}):z?(0,N.jsx)(f,{open:!0,onOpenChange:e=>{e||V({success:!1})},children:(0,N.jsxs)(h,{children:[(0,N.jsxs)(v,{children:[(0,N.jsx)(_,{children:z.schema?.title||P(`actionDialog.defaultActionTitle`)}),z.schema?.description&&(0,N.jsx)(b,{children:z.schema.description})]}),(0,N.jsxs)(p,{children:[(0,N.jsx)(u,{variant:`outline`,onClick:()=>V({success:!1}),children:P(`actionDialog.cancel`)}),(0,N.jsx)(u,{onClick:()=>V({success:!0}),children:P(`actionDialog.ok`)})]})]})}):null]}):(0,N.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,N.jsxs)(m,{children:[(0,N.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,N.jsx)(l,{className:`h-6 w-6 text-muted-foreground`})}),(0,N.jsx)(g,{children:P(`empty.dashboardNotFound`)}),(0,N.jsx)(y,{children:P(`empty.dashboardNotFoundDescription`,{name:r})})]})})}export{j as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{r as t,y as n}from"./vendor-react-BGDDiZfJ.js";import{Dt as r,l as i}from"./framework-CWU64Lvg.js";import{Bs as a,Hs as o,Us as s,cs as c}from"./ui-components-DHIW7RSX.js";function l(e,t,n){if(!(!e||t==null)){if(n){let r=e.find(e=>e.name===t&&e._packageId===n);if(r)return r}return e.find(e=>e.name===t)}}var u=e(n(),1),d=t();function f({sections:e,open:t}){if(!t)return null;let{t:n}=i(),[r,l]=(0,u.useState)([`0`]),[f,p]=(0,u.useState)(null),m=async(e,t)=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),p(t),setTimeout(()=>p(null),2e3)}catch(e){console.error(`Failed to copy:`,e)}},h=e=>{l(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,d.jsxs)(`div`,{className:`w-80 border-l bg-background p-0 overflow-hidden flex flex-col shrink-0 z-20 transition-all`,children:[(0,d.jsxs)(`div`,{className:`px-4 py-3 border-b bg-muted/5 flex items-center justify-between`,children:[(0,d.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:n(`layout.metadata.panelTitle`)}),(0,d.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:n(`layout.metadata.jsonBadge`)})]}),(0,d.jsx)(`div`,{className:`flex-1 overflow-auto`,children:e.map((e,t)=>{let i=String(t),l=r.includes(i),u=f===t;return(0,d.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 hover:bg-muted/5 transition-colors`,children:[(0,d.jsxs)(`button`,{onClick:()=>h(i),className:`flex-1 flex items-center justify-between text-left`,children:[(0,d.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:e.title}),l?(0,d.jsx)(o,{className:`h-3 w-3 text-muted-foreground ml-2`}):(0,d.jsx)(a,{className:`h-3 w-3 text-muted-foreground ml-2`})]}),(0,d.jsx)(`button`,{onClick:()=>m(e.data,t),className:`p-1 hover:bg-muted rounded transition-colors ml-2`,title:n(`layout.metadata.copyJson`),children:u?(0,d.jsx)(s,{className:`h-3 w-3 text-green-600`}):(0,d.jsx)(c,{className:`h-3 w-3 text-muted-foreground`})})]}),l&&(0,d.jsx)(`div`,{className:`px-4 pb-4`,children:(0,d.jsx)(`div`,{className:`relative rounded-md border border-border/50 bg-muted/5 overflow-hidden`,children:(0,d.jsx)(`pre`,{className:`text-[11px] leading-relaxed p-3 overflow-auto max-h-96 font-mono text-foreground/90`,children:JSON.stringify(e.data,null,2)})})})]},t)})})]})}function p(){let[e,t]=(0,u.useState)((0,u.useMemo)(()=>{try{return typeof window<`u`?r(window.location.search).enabled:!1}catch{return!1}},[]));return{showDebug:e,toggleDebug:()=>t(e=>!e)}}export{p as n,l as r,f as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{f as t,h as n,m as r,r as i,y as a}from"./vendor-react-BGDDiZfJ.js";import{d as ee,f as o,n as s,t as c}from"./infrastructure-DexdbqHf.js";import{l,q as u}from"./framework-CWU64Lvg.js";import{Ar as te,Cr as d,Fc as ne,K as f,Pi as re,Qi as ie,U as ae,Va as oe,X as p,q as m,rs as se}from"./ui-components-DHIW7RSX.js";import{t as ce}from"./RecordDetailView-CEdkDgV8.js";import{r as le}from"./useMetadata-DemWIEqg.js";import{t as h}from"./getIcon-p-vXfFiY.js";import{n as g,t as _}from"./CreateViewDialog-BhCe1ZPc.js";import{a as v,i as y,n as b,o as x,r as ue,s as de}from"./InterfaceListPage-BFlwb0U7.js";import{l as fe}from"./plugins-views-BxKprmRN.js";import{t as pe}from"./runtime-metadata-persistence-D1KKivGr.js";var S=e(a(),1),C=i();function me(e){let t=[];return e.forEach((e,n)=>{let r=/^filter\[(.+)\]$/.exec(n);r&&r[1]&&e!==``&&t.push([r[1],`=`,e])}),t}var w=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),T=4;function E({dataSource:e,objects:i}){let{appName:a,objectName:E}=r(),{t:D}=l(),{objectLabel:O,fieldLabel:k}=ne(),A=t(),[j,M]=n(),{can:N}=s(),{canRead:P}=c(E??``),{user:F}=o(),I=ee(),L=le(),[R,z]=S.useState(!1),B=S.useMemo(()=>(i||[]).find(e=>e.name===E),[i,E]),[he]=S.useState(()=>de(new URLSearchParams(window.location.search))),ge=S.useCallback(e=>{M(t=>x(t,e),{replace:!0})},[M]),V=Array.from(j.entries()).filter(([e])=>e.startsWith(`filter[`)).map(([e,t])=>`${e}=${t}`).join(`&`),H=S.useMemo(()=>{let e=me(new URLSearchParams(V)),t=e.filter(([e])=>P(e));if(t.length<e.length){let t=e.filter(([e])=>!P(e)).map(([e])=>e);console.warn(`[ObjectDataPage] Dropped URL filter(s) on unreadable field(s): ${t.join(`, `)}`)}return t.map(([e,t,n])=>n===`{current_user_id}`?[e,t,F?.id??n]:[e,t,n])},[V,P,F?.id]),_e=S.useCallback(e=>{M(t=>{let n=new URLSearchParams(t);return n.delete(`filter[${e}]`),n})},[M]),U=S.useMemo(()=>ue(B).filter(e=>P(e)),[B,P]),W=S.useMemo(()=>{let e=B?.fields;if(!e||typeof e!=`object`)return;let t=Object.entries(e).filter(([e,t])=>t&&!t.hidden&&w.has(t.type)&&P(e)).slice(0,T).map(([e])=>({field:e}));return t.length>0?{element:`dropdown`,fields:t}:void 0},[B,P]),G=S.useCallback(e=>`/apps/${a}/${E}/record/${encodeURIComponent(String(e))}`,[a,E]),K=u({navigation:{mode:`drawer`},objectName:E??``,onNavigate:e=>A(G(e))}),q=j.get(`recordId`),J=S.useCallback((e,t)=>{let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(G(n),`_blank`);return}n!=null&&M(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t})},[G,M]),ve=S.useCallback(()=>{M(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[M]);S.useEffect(()=>{q&&!K.isOpen?K.open({id:q}):!q&&K.isOpen&&K.close()},[q]);let Y=S.useMemo(()=>v(B),[B]),X=S.useMemo(()=>b(B),[B]),Z=S.useMemo(()=>y(B),[B]),Q=S.useMemo(()=>{let e=[`grid`];return Y&&e.push(`kanban`),X&&e.push(`calendar`),Z&&e.push(`gallery`),e},[Y,X,Z]),$=S.useMemo(()=>{if(B)return{type:`list-view`,objectName:B.name,viewType:`grid`,fields:U,...H.length?{filters:H}:{},kanban:Y,calendar:X,gallery:Z,userFilters:W,appearance:{allowedVisualizations:Q},showViewSwitcher:Q.length>1,showSearch:!0,showSort:!0,showFilters:!0,showGroup:!0,showHideFields:!0,showDensity:!0,showRecordCount:!0}},[B,U,H,Y,X,Z,W,Q]),ye=S.useCallback(async e=>{try{let t={...e,columns:Array.isArray(e.columns)&&e.columns.length>0?e.columns:U,...H.length?{filter:H}:{}},n=await pe(`view`,String(e?.name??e?.id??``),t,{metadataClient:L});n&&A(`../view/${n}`,{relative:`path`})}catch(e){console.error(`[ObjectDataPage] Failed to save view:`,e)}},[U,H,L,A]);return B?N(B.name,`read`)?(0,C.jsxs)(`div`,{className:`h-full flex flex-col bg-background min-w-0 overflow-hidden`,"data-testid":`object-data-page`,children:[(0,C.jsx)(`div`,{className:`hidden sm:block`,children:(0,C.jsx)(g,{title:(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:O(B)}),(0,C.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:D(`console.objectData.badge`,{defaultValue:`Data`})})]}),description:D(`console.objectData.description`,{defaultValue:`URL-defined data slice — not bound to any saved view.`}),icon:S.createElement(h(B?.icon),{className:`h-4 w-4`}),actions:(0,C.jsxs)(C.Fragment,{children:[N(B.name,`create`)&&(0,C.jsxs)(d,{size:`sm`,onClick:()=>A(`../new`,{relative:`path`}),className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-new-button`,children:[(0,C.jsx)(ie,{className:`h-4 w-4`}),(0,C.jsx)(`span`,{className:`hidden sm:inline`,children:D(`console.objectView.new`)})]}),I&&(0,C.jsxs)(d,{size:`sm`,variant:`outline`,onClick:()=>z(!0),className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-save-as-view`,children:[(0,C.jsx)(re,{className:`h-4 w-4`}),(0,C.jsx)(`span`,{className:`hidden sm:inline`,children:D(`console.objectData.saveAsView`,{defaultValue:`Save as view`})})]})]})})}),H.length>0&&(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b px-3 sm:px-4 py-2 shrink-0`,"data-testid":`object-data-filter-chips`,children:[(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:D(`console.objectData.filteredBy`,{defaultValue:`Filtered by`})}),H.map(([e,,t])=>(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-muted/40 px-2 py-0.5 text-xs`,children:[(0,C.jsx)(`span`,{className:`font-medium`,children:k(B.name,e,e)}),(0,C.jsxs)(`span`,{className:`text-muted-foreground`,children:[`= `,String(t)]}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>_e(e),className:`ml-0.5 rounded-full hover:bg-muted p-0.5`,"aria-label":D(`console.objectData.removeFilter`,{defaultValue:`Remove filter {{field}}`,field:e}),"data-testid":`object-data-remove-filter-${e}`,children:(0,C.jsx)(te,{className:`h-3 w-3`})})]},e))]}),(0,C.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:$&&(0,C.jsx)(fe,{schema:$,dataSource:e,userFilterSelections:he,onUserFilterSelectionsChange:ge,onRowClick:J})}),K.isOverlay&&(0,C.jsx)(ae,{...K,setIsOpen:e=>{e||ve()},title:O(B),children:t=>(0,C.jsx)(ce,{objectNameOverride:B.name,recordIdOverride:String(t?.id??t?._id??q??``),embedded:!0,dataSource:e,objects:i,onEdit:()=>{}})}),I&&(0,C.jsx)(_,{open:R,onOpenChange:z,onCreate:ye,objectDef:B})]}):(0,C.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,"data-testid":`object-data-403`,children:(0,C.jsxs)(f,{children:[(0,C.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,C.jsx)(oe,{className:`h-6 w-6 text-muted-foreground`})}),(0,C.jsx)(p,{children:D(`console.objectData.noAccessTitle`,{defaultValue:`Access denied`})}),(0,C.jsx)(m,{children:D(`console.objectData.noAccess`,{defaultValue:`You do not have permission to view this data.`})})]})}):(0,C.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,C.jsxs)(f,{children:[(0,C.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,C.jsx)(se,{className:`h-6 w-6 text-muted-foreground`})}),(0,C.jsx)(p,{children:D(`console.objectView.objectNotFound`)}),(0,C.jsx)(m,{children:D(`console.objectView.objectNotFoundDescription`,{objectName:E})})]})})}export{E as ObjectDataPage};
@@ -1 +0,0 @@
1
- import{o as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{d as n,f as r,h as i,m as a,r as o,y as s}from"./vendor-react-BGDDiZfJ.js";import{d as c,f as l,m as u,n as d}from"./infrastructure-DexdbqHf.js";import{H as f,L as p,R as m,Y as h,b as g,l as _}from"./framework-CWU64Lvg.js";import{Cr as v,Fc as y,H as b,Io as x,K as S,X as C,_r as w,aa as T,br as E,gr as D,mr as O,q as k,vr as A,xr as j,yr as M}from"./ui-components-DHIW7RSX.js";import{r as N}from"./vendor-ui-utils-BzQBRdq3.js";import"./MetadataProvider-C8ABa_gQ.js";import{r as P}from"./ExpressionProvider-D94jBDAc.js";import{c as ee,i as te,l as ne,r as re,u as ie}from"./RecordDetailView-CEdkDgV8.js";import{n as F,r as I,t as L}from"./MetadataInspector-YoFTAkMA.js";import{t as R}from"./InterfaceListPage-BFlwb0U7.js";var z=e(s(),1),B=o();function V(e,t){if(/^https?:\/\//i.test(e)||e.startsWith(`mailto:`))return{href:e,external:!e.startsWith(`mailto:`)};let n=(t||``).replace(/\/+$/,``);return{href:`${n}${e}`,external:!!n}}function H({cta:e,apiBase:t,primary:n,onNavigate:r}){let{href:i,external:a}=V(e.url,t);return(0,B.jsx)(v,{asChild:!0,variant:n?`default`:`outline`,size:`sm`,children:(0,B.jsx)(`a`,{href:i,onClick:r,...a?{target:`_blank`,rel:`noopener noreferrer`}:{},"data-testid":`entitlement-cta-${n?`primary`:`secondary`}`,children:e.label})})}function ae({state:e,apiBase:t,onOpenChange:n}){let r=e.spec;return(0,B.jsx)(O,{open:e.open,onOpenChange:e=>{e||n(!1)},children:(0,B.jsxs)(w,{"data-testid":`environment-entitlement-dialog`,children:[(0,B.jsxs)(E,{children:[(0,B.jsx)(j,{children:r?.title}),(0,B.jsx)(A,{children:r?.message})]}),(0,B.jsxs)(M,{children:[(0,B.jsx)(D,{children:`Close`}),r?.secondaryCta&&(0,B.jsx)(H,{cta:r.secondaryCta,apiBase:t,primary:!1,onNavigate:()=>n(!1)}),r?.cta&&(0,B.jsx)(H,{cta:r.cta,apiBase:t,primary:!0,onNavigate:()=>n(!1)})]})]})})}var U=new Set([`DEV_ENV_PLAN_LOCKED`,`DEV_ENV_LIMIT`,`PRODUCTION_ENV_LIMIT`]);function W(e){return typeof e==`string`&&U.has(e)}var G=`/settings/billing`;function oe(e){let t=e?.code;if(!W(t))return null;let n=typeof e?.error==`string`&&e.error?e.error:typeof e?.message==`string`?e.message:``,r=typeof e?.upgrade_url==`string`&&e.upgrade_url?e.upgrade_url:G,i=typeof e?.contact_url==`string`&&e.contact_url?e.contact_url:``;return t===`PRODUCTION_ENV_LIMIT`?{code:t,title:`You already have your production environment`,message:n||`Each organization includes exactly one production environment. Create a separate organization for another, or contact us about an Enterprise arrangement.`,cta:i?{label:`Contact sales`,url:i}:void 0}:{code:t,title:t===`DEV_ENV_PLAN_LOCKED`?`Development environments are a paid feature`:`Development environment limit reached`,message:n||(t===`DEV_ENV_PLAN_LOCKED`?`Your free plan includes one production environment. Upgrade to add development environments — build in dev, then publish to production.`:`Capacity scales with AI seats. Add an AI seat, or archive an unused development environment to free one up.`),cta:{label:`Upgrade plan`,url:r}}}function K(e){return e.hasProductionEnv?e.canCreateDevelopmentEnv===!1?`upgrade_for_development`:`add_development`:`setup_production`}function q(e){return{code:`DEV_ENV_PLAN_LOCKED`,title:`Development environments are a paid feature`,message:`${e.plan&&e.plan!==`free`?`your ${e.plan} plan`:`your free plan`} includes one production environment. Upgrade to add development environments — build in dev, then publish to production.`,cta:{label:`Upgrade plan`,url:e.upgradeUrl||`/settings/billing`}}}var J=/^\s*\{\{\s*page\.([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\}\}\s*$/;function Y(e,t){let n=t;for(let t of e.split(`.`)){if(n==null)return;n=n[t]}return n}function se(e,t){if(!e.includes(`{{`))return e;let n=e.match(J);if(n){let e=Y(n[1],t);return e===void 0?``:e}return e.replace(/\{\{\s*page\.([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\}\}/g,(e,n)=>{let r=Y(n,t);return r==null?``:String(r)})}function X(e,t){if(typeof e==`string`)return se(e,t);if(Array.isArray(e))return e.map(e=>X(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))n[r]=X(i,t);return n}return e}function Z(e,t){return t?X(e,t):e}var ce={id:`current-user`,name:`Demo User`,isPlatformAdmin:!1};function Q(e){let t=e.locations;return Array.isArray(t)?t.some(e=>e===`list_item`||e===`record_header`||e===`record_more`||e===`record_section`):!1}function $(e){let{dataSource:t,objects:n,objectName:i,onRefresh:a}=e,o=r(),{user:s,activeOrganization:c}=l(),{systemPermissions:f}=d(),{fieldLabel:p,fieldOptionLabel:m,actionParamText:h,actionParamOptionLabel:_,actionDescription:v}=y(),b=(0,z.useMemo)(()=>i?n?.find(e=>e.name===i):void 0,[n,i]),x=i||b?.name,S=(0,z.useCallback)(()=>{a?.()},[a]),C=g({dataSource:t,onUndo:()=>{S(),N.success(`Change undone`)}}),[w,T]=(0,z.useState)({open:!1,message:``}),[E,D]=(0,z.useState)({open:!1,params:[]}),[O,k]=(0,z.useState)({open:!1}),[A,j]=(0,z.useState)(null),[M,P]=(0,z.useState)({open:!1}),F=(0,z.useRef)(new Set),I=(0,z.useCallback)((e,t)=>new Promise(n=>{k({open:!0,spec:e,data:t,resolve:n})}),[]),L=(0,z.useCallback)((e,t)=>new Promise(n=>{T({open:!0,message:e,options:t,resolve:n})}),[]),R=(0,z.useCallback)((e,t)=>new Promise(r=>{let a=t?.params&&!Array.isArray(t.params)?t.params._rowRecord:void 0,o=typeof t?.objectName==`string`&&t.objectName?t.objectName:void 0,s=re(e,{objectName:o||i||b?.name||``,objects:n||[],fieldLabel:p,fieldOptionLabel:m,row:a}),c=o||i||b?.name,l=s.map(e=>({...e,label:h(c,t?.name,e.name,`label`,e.label)??e.label,placeholder:h(c,t?.name,e.name,`placeholder`,e.placeholder)??e.placeholder,helpText:h(c,t?.name,e.name,`helpText`,e.helpText)??e.helpText,options:Array.isArray(e.options)?e.options.map(n=>({...n,label:_(c,t?.name,e.name,n.value,n.label)})):e.options}));D({open:!0,params:l,title:t?.label||t?.title,description:v(c,t?.name,t?.description),resolve:r})}),[i,b,n,p,m,h,_]),V=s?{id:s.id,name:s.name,avatar:s.image,isPlatformAdmin:s?.isPlatformAdmin??!1,systemPermissions:f??[]}:{...ce,systemPermissions:f??[]},H=(0,z.useCallback)((e,t)=>{if(t?.type===`error`){N.error(e);return}if(t?.undo){N.success(e,{duration:t.duration,action:{label:t.undo.label||`Undo`,onClick:()=>{C.undo()}}});return}N.success(e,{duration:t?.duration})},[C]),U=(0,z.useCallback)((e,t)=>{t?.external||t?.newTab?window.open(e,`_blank`,`noopener,noreferrer`):o(e)},[o]),W=(0,z.useMemo)(()=>u(),[]),G=(0,z.useCallback)(e=>{P({open:!0,spec:e})},[]),K=(0,z.useCallback)(async(e,n)=>{try{let r=e.target||e.name,i=e.params||{},a=typeof r==`string`?r:``;if(a.startsWith(`/`)||/^https?:\/\//i.test(a)){let t={...i},r=t._rowRecord;delete t._rowRecord;let o=n?.pageVariables??void 0,s=Z(t,o),l=a;r&&/\{[a-z_][a-z0-9_]*\}/i.test(l)&&(l=l.replace(/\{([a-z_][a-z0-9_]*)\}/gi,(e,t)=>{let n=r[t];return n==null?``:encodeURIComponent(String(n))}));let u=l.startsWith(`http`)?l:`${l}`,d=e.bodyShape&&typeof e.bodyShape==`object`&&e.bodyShape.wrap?e.bodyShape.wrap:void 0,f=d?{[d]:s}:{...s};if(r&&e.recordIdParam){let t=r[e.recordIdField||`id`];t!=null&&(f[e.recordIdParam]=t)}/\/api\/v1\/auth\//.test(l)&&!f.organizationId&&c?.id&&(f.organizationId=c.id),e.bodyExtra&&typeof e.bodyExtra==`object`&&Object.assign(f,Z(e.bodyExtra,o));let p=(e.method||`POST`).toUpperCase(),m={method:p,headers:{"Content-Type":`application/json`},credentials:`include`};p!==`GET`&&p!==`DELETE`&&(m.body=JSON.stringify(f));let h=await W(u,m);if(!h.ok){let e=null;try{e=await h.json()}catch{}let t=oe(e);return t?(G(t),{success:!1}):{success:!1,error:e?.error||e?.message||`HTTP ${h.status}`}}let g=await h.json().catch(()=>({}));return e.refreshAfter!==!1&&S(),{success:!0,data:g&&typeof g==`object`&&!Array.isArray(g)&&`data`in g?g.data:g,reload:e.refreshAfter!==!1}}let o=e.objectName||x,s=i._rowRecord,l={...i};delete l._rowRecord;let u=l.recordId??s?.[e.recordIdField||`id`];delete l.recordId,e.bodyExtra&&typeof e.bodyExtra==`object`&&Object.assign(l,e.bodyExtra),o&&typeof t?.execute==`function`?await t.execute(o,r,l):o&&u&&Object.keys(l).length>0&&typeof t?.update==`function`&&await t.update(o,u,l);let d;if(e.undoable&&o&&u&&s&&Object.keys(l).length>0&&typeof t?.update==`function`){let t={};for(let e of Object.keys(l))t[e]=s[e]??null;d={id:`undo-${o}-${u}-${Date.now()}`,type:`update`,objectName:o,recordId:String(u),timestamp:Date.now(),description:e.label||`Undo ${o}`,undoData:t,redoData:{...l}}}let f=e.refreshAfter!==!1;return f&&S(),{success:!0,reload:f,undo:d}}catch(e){return{success:!1,error:e.message}}},[t,x,W,c,S,G]),q=(0,z.useCallback)(async(e,t)=>{let n=e.target||e.name;if(!n)return{success:!1,error:`No flow target provided for flow action`};try{let r={...e.params||{}},i=r._rowRecord;delete r._rowRecord;let a=r.recordId??i?.id;if(a==null){let n=Array.isArray(t?.selectedRecords)?t.selectedRecords:[];if(n.length===1)a=n[0]?.id;else if(n.length>1)return{success:!1,error:`This flow runs on a single record — select exactly one row.`};else if(Q(e))return{success:!1,error:`This flow runs on a single record — select a row first.`}}a!=null&&r.recordId==null&&(r.recordId=a);let o=await W(`/api/v1/automation/${encodeURIComponent(n)}/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:a,objectName:e.objectName||x,params:r})}),s=await o.json().catch(()=>null);if(!o.ok||s&&s.success===!1)return{success:!1,error:s?.error||`Flow "${n}" failed (HTTP ${o.status})`};let c=s?.data??{};if(c.status===`paused`&&c.screen)return j({flowName:n,runId:c.runId,screen:c.screen}),{success:!0,silent:!0};let l=e.refreshAfter!==!1;return l&&S(),{success:!0,data:s?.data,reload:l}}catch(e){return{success:!1,error:e.message}}},[W,x,S]),J=(0,z.useCallback)(async(e,t)=>{let n=e.target||e.name;if(!n)return{success:!1,error:`No action target provided`};let r=e.params&&!Array.isArray(e.params)?{...e.params}:{},i=r._rowRecord;delete r._rowRecord;let a=e.recordIdField||`id`,o=r.recordId??i?.[a];if(o==null){let n=Array.isArray(t?.selectedRecords)?t.selectedRecords:[];if(n.length===1)o=n[0]?.[a];else if(n.length>1)return{success:!1,error:`This action runs on a single record — select exactly one row.`};else if(Q(e))return{success:!1,error:`This action runs on a single record — select a row first.`}}let s=`${n}:${o??``}`;if(F.current.has(s))return{success:!1,error:`Action already in progress`};F.current.add(s);let c=null;if(e.opensInNewTab)try{c=window.open(`about:blank`,`_blank`),c&&(c.document.write(`<!doctype html><meta charset="utf-8"><title>正在打开… Opening…</title><body style="margin:0;font-family:system-ui,sans-serif;display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;gap:16px;color:#4b5563"><div style="width:28px;height:28px;border:3px solid #e5e7eb;border-top-color:#6366f1;border-radius:50%;animation:s .8s linear infinite"></div><div>正在为你打开环境…</div><style>@keyframes s{to{transform:rotate(360deg)}}</style></body>`),c.document.close())}catch{c=null}try{let t=typeof e.newTabUrl==`string`?e.newTabUrl:``;if(e.opensInNewTab&&t){if(o==null){if(c)try{c.close()}catch{}return{success:!1,error:`This action runs on a single record — no record id available.`}}let n=`${window.location.origin}${t.replace(`{recordId}`,encodeURIComponent(String(o)))}`;if(c)try{c.location.href=n}catch{try{c.close()}catch{}window.location.href=n}else{let e=null;try{e=window.open(n,`_blank`)}catch{e=null}e||N(`浏览器拦截了弹窗 / Popup blocked`,{description:`点击在新标签页打开环境`,action:{label:`打开环境`,onClick:()=>{try{window.open(n,`_blank`)}catch{window.location.href=n}}},duration:1e4})}return e.refreshAfter===!0&&S(),{success:!0}}let i=e.objectName||x||`global`,a=await W(`/api/v1/actions/${encodeURIComponent(i)}/${encodeURIComponent(n)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recordId:o,params:r})}),s=await a.json().catch(()=>null);if(!a.ok||s&&s.success===!1){let e=s?.error||`Action "${n}" failed (HTTP ${a.status})`;if(c)try{c.close()}catch{}return{success:!1,error:e}}let l=e.refreshAfter!==!1;l&&S();let u=s?.data,d=u&&typeof u==`object`&&typeof u.redirectUrl==`string`?u.redirectUrl:null;if(d)if(c)try{c.location.href=d}catch{try{c.close()}catch{}window.location.href=d}else{let e=null;try{e=window.open(d,`_blank`)}catch{e=null}e||N(`浏览器拦截了弹窗 / Popup blocked`,{description:`点击在新标签页打开环境`,action:{label:`打开环境`,onClick:()=>{try{window.open(d,`_blank`)}catch{window.location.href=d}}},duration:1e4})}else if(c)try{c.close()}catch{}return{success:!0,data:u,reload:l}}catch(e){if(c)try{c.close()}catch{}return{success:!1,error:e.message}}finally{F.current.delete(s)}},[W,x,S]);return{confirmHandler:L,toastHandler:H,navigateHandler:U,paramCollectionHandler:R,resultDialogHandler:I,apiHandler:K,flowHandler:q,serverActionHandler:J,authFetch:W,openEntitlementDialog:G,actionProviderProps:(0,z.useMemo)(()=>({context:{...i?{objectName:i}:{},user:V,apiBase:``,activeOrganization:c?{id:c.id,slug:c.slug,name:c.name}:null},onConfirm:L,onToast:H,onNavigate:U,onParamCollection:R,onResultDialog:I,handlers:{api:K,flow:q,script:J,modal:J}}),[i,V,c,L,H,U,R,I,K,q,J]),dialogs:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(ie,{state:w,onOpenChange:e=>{e||T({open:!1,message:``})}}),(0,B.jsx)(ne,{state:E,onOpenChange:e=>{e||D({open:!1,params:[]})}}),(0,B.jsx)(ee,{state:O,onAcknowledge:()=>{O.resolve?.(),k({open:!1})}}),(0,B.jsx)(te,{state:A,authFetch:W,baseUrl:``,dataSource:t,objects:n,onClose:()=>j(null),onComplete:()=>{j(null),S()}}),(0,B.jsx)(ae,{state:M,apiBase:``,onOpenChange:e=>{e||P({open:!1})}})]})}}function le({children:e,...t}){let n=$(t);return(0,B.jsxs)(f,{...n.actionProviderProps,children:[e,n.dialogs]})}var ue=t({PageView:()=>de});function de(){let{t:e}=_(),{pageName:t}=a(),[o]=i(),{showDebug:s}=F(),l=r(),u=n(),d=c(),{pages:f,objects:g,getTypeStatus:v}=m(),{app:y}=P(),w=p(),[E,D]=(0,z.useState)(0),O=I(f,t,y?._packageId);if(!O){let n=v?.(`page`);return n===`idle`||n===`loading`?(0,B.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,"data-testid":`page-loading`,children:(0,B.jsx)(b,{className:`h-5 w-5 text-muted-foreground`})}):(0,B.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,B.jsxs)(S,{children:[(0,B.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,B.jsx)(x,{className:`h-6 w-6 text-muted-foreground`})}),(0,B.jsx)(C,{children:e(`empty.pageNotFound`)}),(0,B.jsx)(k,{children:e(`empty.pageNotFoundDescription`,{name:t})})]})})}let A=Object.fromEntries(o.entries()),j=u.pathname.match(/\/apps\/([^/]+)/)?.[1],M=d&&!!j&&!!t;return(0,B.jsx)(le,{dataSource:w,objects:g,onRefresh:()=>D(e=>e+1),children:(0,B.jsxs)(`div`,{className:`flex flex-row h-full w-full overflow-hidden relative`,children:[(0,B.jsxs)(`div`,{className:`flex-1 overflow-auto h-full relative`,children:[M&&(0,B.jsx)(`button`,{type:`button`,onClick:()=>{M&&l(`/apps/${j}/metadata/page/${encodeURIComponent(t)}`)},className:`absolute right-3 top-3 z-30 inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background/90 text-muted-foreground shadow-sm backdrop-blur hover:bg-accent hover:text-accent-foreground`,"data-testid":`page-edit-in-studio-button`,title:e(`common.editInStudio`,{defaultValue:`Edit in studio`}),"aria-label":e(`common.editInStudio`,{defaultValue:`Edit in studio`}),children:(0,B.jsx)(T,{className:`h-3.5 w-3.5`})}),O.interfaceConfig?.source?(0,B.jsx)(R,{page:O,reserveEditAffordance:M},E):(0,B.jsx)(h,{schema:{...O,type:O.type||`page`,context:{...O.context,params:A,refreshKey:E}}},E)]}),(0,B.jsx)(L,{open:s,sections:[{title:`Page Configuration`,data:O}]})]})})}export{q as a,K as i,$ as n,G as r,ue as t};