@protobase/ui 0.119.3 → 0.119.5

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 (231) hide show
  1. package/dist/account/messages.d.ts +2 -2
  2. package/dist/app/charts/messages.d.ts +2 -2
  3. package/dist/app/confirm-sign-in-messages.d.ts +2 -2
  4. package/dist/app/delete/messages.d.ts +2 -2
  5. package/dist/app/displays/messages.d.ts +2 -2
  6. package/dist/app/export/messages.d.ts +2 -2
  7. package/dist/app/field-types/json/messages.d.ts +2 -2
  8. package/dist/app/field-types/runner-install/messages.d.ts +2 -2
  9. package/dist/app/field-types/workflow/definition.d.ts +1 -1
  10. package/dist/app/field-types/workflow/messages.d.ts +2 -2
  11. package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
  12. package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
  13. package/dist/app/focus/messages.d.ts +2 -2
  14. package/dist/app/gallery/gallery-layout.d.ts +2 -2
  15. package/dist/app/hand-order/messages.d.ts +2 -2
  16. package/dist/app/import/messages.d.ts +2 -2
  17. package/dist/app/list-messages.d.ts +2 -2
  18. package/dist/app/messages.d.ts +2 -2
  19. package/dist/app/meta-gate-messages.d.ts +2 -2
  20. package/dist/app/pages/messages.d.ts +2 -2
  21. package/dist/app/record-chart/messages.d.ts +2 -2
  22. package/dist/app/record-messages.d.ts +2 -2
  23. package/dist/app/record-row/messages.d.ts +2 -2
  24. package/dist/app/runtime/messages.d.ts +2 -2
  25. package/dist/app/saved/messages.d.ts +2 -2
  26. package/dist/app/saved/use-favorite.d.ts +1 -1
  27. package/dist/app/searches/messages.d.ts +2 -2
  28. package/dist/app/searches/use-save-search.d.ts +1 -1
  29. package/dist/app-shell/messages.d.ts +2 -2
  30. package/dist/assistant-dock/messages.d.ts +2 -2
  31. package/dist/auth/messages.d.ts +2 -2
  32. package/dist/calls/messages.d.ts +2 -2
  33. package/dist/forms/messages.d.ts +2 -2
  34. package/dist/invitations/messages.d.ts +2 -2
  35. package/dist/markdown/markdown-html.js +2 -29
  36. package/dist/markdown/safe-html.d.ts +11 -0
  37. package/dist/markdown/safe-html.js +35 -0
  38. package/dist/mentions/link-text.d.ts +7 -0
  39. package/dist/mentions/link-text.js +19 -0
  40. package/dist/mentions/mention-text.d.ts +2 -0
  41. package/dist/mentions/mention-text.js +3 -1
  42. package/dist/mentions/mentioned-text.d.ts +7 -7
  43. package/dist/mentions/mentioned-text.js +14 -4
  44. package/dist/mentions/message-content.d.ts +10 -0
  45. package/dist/mentions/message-content.js +17 -0
  46. package/dist/mentions/message-html.d.ts +11 -0
  47. package/dist/mentions/message-html.js +55 -0
  48. package/dist/mentions/message-lines.d.ts +4 -0
  49. package/dist/mentions/message-lines.js +38 -0
  50. package/dist/notifications/bell/messages.d.ts +2 -2
  51. package/dist/organizations/messages.d.ts +2 -2
  52. package/dist/package.js +1 -1
  53. package/dist/primitives/messages.d.ts +2 -2
  54. package/dist/shell/assets/{account-page-d4bA-Rnh.js → account-page-ve4BUXRh.js} +2 -2
  55. package/dist/shell/assets/{app-xwgcmboV.css → app-DLkpxjgP.css} +1 -1
  56. package/dist/shell/assets/{app-B94YfKGx.js → app-DU-Bny4k.js} +7 -7
  57. package/dist/shell/assets/{assistant-shell-DTNOfaAZ.js → assistant-shell-KyMQvcsn.js} +2 -2
  58. package/dist/shell/assets/board-display-BaMLmYUJ.js +2 -0
  59. package/dist/shell/assets/calendar-display-CzQPcItV.js +2 -0
  60. package/dist/shell/assets/{call-rings-D8cGALi4.js → call-rings-DUzC7UYz.js} +2 -2
  61. package/dist/shell/assets/{calls-DLSo4hNS.js → calls-drZLv0wW.js} +2 -2
  62. package/dist/shell/assets/{circle-alert-C8YjGdRx.js → circle-alert-COV0WNyG.js} +2 -2
  63. package/dist/shell/assets/composed-page-CBJLOXNJ.js +2 -0
  64. package/dist/shell/assets/{composer-section-6TvE0L2w.js → composer-section-05sGMnpR.js} +2 -2
  65. package/dist/shell/assets/{connect-route-C8Km-e8S.js → connect-route-KBsPFlW4.js} +2 -2
  66. package/dist/shell/assets/{copy-field-DXp0fGDR.js → copy-field-14Vmg95D.js} +2 -2
  67. package/dist/shell/assets/create-route-DAprAV2h.js +2 -0
  68. package/dist/shell/assets/{custom-step-container-field-B8ut5WnP.js → custom-step-container-field-D0cmhURR.js} +4 -4
  69. package/dist/shell/assets/embedded-list-Ra3OLUh6.js +3 -0
  70. package/dist/shell/assets/{export-dialog-gSUSlzOy.js → export-dialog-Cz26bxgN.js} +2 -2
  71. package/dist/shell/assets/{first-organization-page-C7YZ32Kt.js → first-organization-page-C9ejBI4S.js} +2 -2
  72. package/dist/shell/assets/{graph-view-_7poAZsr.js → graph-view-B3TE-xbG.js} +2 -2
  73. package/dist/shell/assets/{group-donut-XjNEBVUq.js → group-donut-BAyTgqYv.js} +2 -2
  74. package/dist/shell/assets/{guest-call-page-Cj6F3D3u.js → guest-call-page-CEcPrLXS.js} +3 -3
  75. package/dist/shell/assets/{html-viewer-CmYTAzWa.js → html-viewer-DaeVR6PB.js} +2 -2
  76. package/dist/shell/assets/{import-dialog-bNG6qX6Q.js → import-dialog-6I25EI49.js} +2 -2
  77. package/dist/shell/assets/import-table-dialog-COsPNket.js +2 -0
  78. package/dist/shell/assets/{index-CYraq2Hi.js → index-CLyiQa16.js} +1 -1
  79. package/dist/shell/assets/{invitations-page-XV6kL2Mk.js → invitations-page-TBz_-ekD.js} +2 -2
  80. package/dist/shell/assets/{layout-grid-dpoR6hFU.js → layout-grid-BTGS8Vdw.js} +2 -2
  81. package/dist/shell/assets/{legend-item-WwKh2W6n.js → legend-item-DkIaBiD0.js} +2 -2
  82. package/dist/shell/assets/list-page-Dpq9M7YO.js +4 -0
  83. package/dist/shell/assets/{maplibre-Bm0OQH9k.js → maplibre-JTZsxvhv.js} +2 -2
  84. package/dist/shell/assets/{markdown-content-BZLiLira.js → markdown-content-DBVa63k_.js} +2 -2
  85. package/dist/shell/assets/members-page-CHRY9H9W.js +2 -0
  86. package/dist/shell/assets/message-content-DzyGCvgQ.js +3 -0
  87. package/dist/shell/assets/messages-BwcGcxFR.js +2 -0
  88. package/dist/shell/assets/organization-page-BE182e_K.js +2 -0
  89. package/dist/shell/assets/organizations-page-DaN6zQZj.js +2 -0
  90. package/dist/shell/assets/{pending-invitation-row-BZVOux9W.js → pending-invitation-row-DvqK-Lh5.js} +2 -2
  91. package/dist/shell/assets/{period-chart-GDqLnl9l.js → period-chart-Cn9bgVfB.js} +2 -2
  92. package/dist/shell/assets/{person-row-DgXLW9D8.js → person-row-CSBZnBQc.js} +2 -2
  93. package/dist/shell/assets/public-form-page-CaNVr6BS.js +2 -0
  94. package/dist/shell/assets/{record-lines-CDTPiIdF.js → record-lines-3DhkRSpH.js} +2 -2
  95. package/dist/shell/assets/{record-map-Dcmuv9J8.js → record-map-D4rgUOwb.js} +2 -2
  96. package/dist/shell/assets/{record-opens-D7SV04zf.js → record-opens-BSFQWqio.js} +2 -2
  97. package/dist/shell/assets/record-page-Cbx9gqMY.js +3 -0
  98. package/dist/shell/assets/{record-preview-DsIrTWKZ.js → record-preview-Bdzkrw0H.js} +2 -2
  99. package/dist/shell/assets/{records-map-G0QXqaUR.js → records-map-BfkBfva4.js} +2 -2
  100. package/dist/shell/assets/render-node-ChsAMZVA.js +3 -0
  101. package/dist/shell/assets/reorder-button-pGaEX5DI.js +2 -0
  102. package/dist/shell/assets/{run-trace-view-DLY3Mt5m.js → run-trace-view-Cd3DppYM.js} +2 -2
  103. package/dist/shell/assets/{runner-install-field-Iwp4UP6o.js → runner-install-field-CK3olYt5.js} +2 -2
  104. package/dist/shell/assets/{runtime-update-DKcAQek2.js → runtime-update-BNTp15Vo.js} +2 -2
  105. package/dist/shell/assets/safe-html-CmkqDcA6.js +2 -0
  106. package/dist/shell/assets/shared-protobase-ui-gnK6D3Al.js +1 -0
  107. package/dist/shell/assets/sheet-source-DONoSDqu.js +3 -0
  108. package/dist/shell/assets/sign-in-policy-page-C4MEEpwM.js +2 -0
  109. package/dist/shell/assets/start-block-queries-B7qJvkWD.js +2 -0
  110. package/dist/shell/assets/step-catalog-CgPcuEu_.js +2 -0
  111. package/dist/shell/assets/{step-panel-BXHWAw8x.js → step-panel-CoFQOZfZ.js} +2 -2
  112. package/dist/shell/assets/timeline-display-F8qMrey9.js +2 -0
  113. package/dist/shell/assets/{trash-MHAT5Hf3.js → trash-BFH8OA7M.js} +2 -2
  114. package/dist/shell/assets/{update-set-B0D_tNDz.js → update-set-CivHicWr.js} +2 -2
  115. package/dist/shell/assets/use-calendar-move-CezBW0KE.js +2 -0
  116. package/dist/shell/assets/{use-display-rows-vjthlkqo.js → use-display-rows-7iLrRpz6.js} +2 -2
  117. package/dist/shell/assets/use-my-invitations-B7w0Q5kk.js +2 -0
  118. package/dist/shell/assets/{use-paged-search-DRj8498k.js → use-paged-search-CblCRsCd.js} +2 -2
  119. package/dist/shell/assets/{use-run-trace-CWGAibgF.js → use-run-trace-vMzYYuXG.js} +2 -2
  120. package/dist/shell/assets/{use-workflow-page-C9ZEXX5R.js → use-workflow-page-Dac4wyOA.js} +2 -2
  121. package/dist/shell/assets/{use-workflow-types-DDh28X2_.js → use-workflow-types-Bi8u42jQ.js} +2 -2
  122. package/dist/shell/assets/{workflow-canvas-n_YJtaOh.js → workflow-canvas-2owtFZNz.js} +4 -4
  123. package/dist/shell/assets/{workflow-field-CpkY17Cc.js → workflow-field-Ct0HoH5Z.js} +3 -3
  124. package/dist/shell/assets/{workflow-graph-editor-V-ZGHSrC.js → workflow-graph-editor-oAKVQAgf.js} +2 -2
  125. package/dist/shell/assets/{workflow-run-field-CoUJGVdX.js → workflow-run-field-C7ff1D9_.js} +3 -3
  126. package/dist/shell/assets/workflow-status-field-iHUr4FZM.js +2 -0
  127. package/dist/shell/assets/workflow-workbench-BCsEjQVw.js +4 -0
  128. package/dist/shell/index.html +4 -4
  129. package/dist/shell/protobase.shell.json +2 -2
  130. package/dist/shell/protobase.sw.js +2 -2
  131. package/dist/shell-source-maps/assets/{account-page-d4bA-Rnh.js.map → account-page-ve4BUXRh.js.map} +1 -1
  132. package/dist/shell-source-maps/assets/app-DU-Bny4k.js.map +1 -0
  133. package/dist/shell-source-maps/assets/{assistant-shell-DTNOfaAZ.js.map → assistant-shell-KyMQvcsn.js.map} +1 -1
  134. package/dist/shell-source-maps/assets/{board-display-ClTe26F0.js.map → board-display-BaMLmYUJ.js.map} +1 -1
  135. package/dist/shell-source-maps/assets/{calendar-display-CwBcu_JO.js.map → calendar-display-CzQPcItV.js.map} +1 -1
  136. package/dist/shell-source-maps/assets/{call-rings-D8cGALi4.js.map → call-rings-DUzC7UYz.js.map} +1 -1
  137. package/dist/shell-source-maps/assets/{calls-DLSo4hNS.js.map → calls-drZLv0wW.js.map} +1 -1
  138. package/dist/shell-source-maps/assets/{circle-alert-C8YjGdRx.js.map → circle-alert-COV0WNyG.js.map} +1 -1
  139. package/dist/shell-source-maps/assets/{composed-page-DBHl-wl_.js.map → composed-page-CBJLOXNJ.js.map} +1 -1
  140. package/dist/shell-source-maps/assets/{composer-section-6TvE0L2w.js.map → composer-section-05sGMnpR.js.map} +1 -1
  141. package/dist/shell-source-maps/assets/{connect-route-C8Km-e8S.js.map → connect-route-KBsPFlW4.js.map} +1 -1
  142. package/dist/shell-source-maps/assets/{copy-field-DXp0fGDR.js.map → copy-field-14Vmg95D.js.map} +1 -1
  143. package/dist/shell-source-maps/assets/{create-route-s8RsjtyM.js.map → create-route-DAprAV2h.js.map} +1 -1
  144. package/dist/shell-source-maps/assets/{custom-step-container-field-B8ut5WnP.js.map → custom-step-container-field-D0cmhURR.js.map} +1 -1
  145. package/dist/shell-source-maps/assets/{embedded-list-OJQKeuBN.js.map → embedded-list-Ra3OLUh6.js.map} +1 -1
  146. package/dist/shell-source-maps/assets/{export-dialog-gSUSlzOy.js.map → export-dialog-Cz26bxgN.js.map} +1 -1
  147. package/dist/shell-source-maps/assets/{first-organization-page-C7YZ32Kt.js.map → first-organization-page-C9ejBI4S.js.map} +1 -1
  148. package/dist/shell-source-maps/assets/{graph-view-_7poAZsr.js.map → graph-view-B3TE-xbG.js.map} +1 -1
  149. package/dist/shell-source-maps/assets/{group-donut-XjNEBVUq.js.map → group-donut-BAyTgqYv.js.map} +1 -1
  150. package/dist/shell-source-maps/assets/{guest-call-page-Cj6F3D3u.js.map → guest-call-page-CEcPrLXS.js.map} +1 -1
  151. package/dist/shell-source-maps/assets/{html-viewer-CmYTAzWa.js.map → html-viewer-DaeVR6PB.js.map} +1 -1
  152. package/dist/shell-source-maps/assets/{import-dialog-bNG6qX6Q.js.map → import-dialog-6I25EI49.js.map} +1 -1
  153. package/dist/shell-source-maps/assets/{import-table-dialog-BbI7GJ8R.js.map → import-table-dialog-COsPNket.js.map} +1 -1
  154. package/dist/shell-source-maps/assets/{invitations-page-XV6kL2Mk.js.map → invitations-page-TBz_-ekD.js.map} +1 -1
  155. package/dist/shell-source-maps/assets/{layout-grid-dpoR6hFU.js.map → layout-grid-BTGS8Vdw.js.map} +1 -1
  156. package/dist/shell-source-maps/assets/{legend-item-WwKh2W6n.js.map → legend-item-DkIaBiD0.js.map} +1 -1
  157. package/dist/shell-source-maps/assets/{list-page-DImD2FRO.js.map → list-page-Dpq9M7YO.js.map} +1 -1
  158. package/dist/shell-source-maps/assets/{maplibre-Bm0OQH9k.js.map → maplibre-JTZsxvhv.js.map} +1 -1
  159. package/dist/shell-source-maps/assets/markdown-content-DBVa63k_.js.map +1 -0
  160. package/dist/shell-source-maps/assets/{members-page-ZcqzlQu6.js.map → members-page-CHRY9H9W.js.map} +1 -1
  161. package/dist/shell-source-maps/assets/message-content-DzyGCvgQ.js.map +1 -0
  162. package/dist/shell-source-maps/assets/{messages-vzi5T1Xo.js.map → messages-BwcGcxFR.js.map} +1 -1
  163. package/dist/shell-source-maps/assets/{organization-page-CjrQmpot.js.map → organization-page-BE182e_K.js.map} +1 -1
  164. package/dist/shell-source-maps/assets/{organizations-page-C7gJsoCx.js.map → organizations-page-DaN6zQZj.js.map} +1 -1
  165. package/dist/shell-source-maps/assets/{pending-invitation-row-BZVOux9W.js.map → pending-invitation-row-DvqK-Lh5.js.map} +1 -1
  166. package/dist/shell-source-maps/assets/{period-chart-GDqLnl9l.js.map → period-chart-Cn9bgVfB.js.map} +1 -1
  167. package/dist/shell-source-maps/assets/{person-row-DgXLW9D8.js.map → person-row-CSBZnBQc.js.map} +1 -1
  168. package/dist/shell-source-maps/assets/{public-form-page-DjLnqHPx.js.map → public-form-page-CaNVr6BS.js.map} +1 -1
  169. package/dist/shell-source-maps/assets/{record-lines-CDTPiIdF.js.map → record-lines-3DhkRSpH.js.map} +1 -1
  170. package/dist/shell-source-maps/assets/{record-map-Dcmuv9J8.js.map → record-map-D4rgUOwb.js.map} +1 -1
  171. package/dist/shell-source-maps/assets/{record-opens-D7SV04zf.js.map → record-opens-BSFQWqio.js.map} +1 -1
  172. package/dist/shell-source-maps/assets/{record-page-DGWHTUdD.js.map → record-page-Cbx9gqMY.js.map} +1 -1
  173. package/dist/shell-source-maps/assets/{record-preview-DsIrTWKZ.js.map → record-preview-Bdzkrw0H.js.map} +1 -1
  174. package/dist/shell-source-maps/assets/{records-map-G0QXqaUR.js.map → records-map-BfkBfva4.js.map} +1 -1
  175. package/dist/shell-source-maps/assets/{render-node-0_Pb8ixy.js.map → render-node-ChsAMZVA.js.map} +1 -1
  176. package/dist/shell-source-maps/assets/{reorder-button-BhhzhhTO.js.map → reorder-button-pGaEX5DI.js.map} +1 -1
  177. package/dist/shell-source-maps/assets/{run-trace-view-DLY3Mt5m.js.map → run-trace-view-Cd3DppYM.js.map} +1 -1
  178. package/dist/shell-source-maps/assets/{runner-install-field-Iwp4UP6o.js.map → runner-install-field-CK3olYt5.js.map} +1 -1
  179. package/dist/shell-source-maps/assets/{runtime-update-DKcAQek2.js.map → runtime-update-BNTp15Vo.js.map} +1 -1
  180. package/dist/shell-source-maps/assets/safe-html-CmkqDcA6.js.map +1 -0
  181. package/dist/shell-source-maps/assets/{sheet-source-DxVQhlKF.js.map → sheet-source-DONoSDqu.js.map} +1 -1
  182. package/dist/shell-source-maps/assets/{sign-in-policy-page-E1eBhmUM.js.map → sign-in-policy-page-C4MEEpwM.js.map} +1 -1
  183. package/dist/shell-source-maps/assets/{start-block-queries-Bu7xMabd.js.map → start-block-queries-B7qJvkWD.js.map} +1 -1
  184. package/dist/shell-source-maps/assets/{step-catalog-BPk6WuYH.js.map → step-catalog-CgPcuEu_.js.map} +1 -1
  185. package/dist/shell-source-maps/assets/{step-panel-BXHWAw8x.js.map → step-panel-CoFQOZfZ.js.map} +1 -1
  186. package/dist/shell-source-maps/assets/{timeline-display-CJHQiDm9.js.map → timeline-display-F8qMrey9.js.map} +1 -1
  187. package/dist/shell-source-maps/assets/{trash-MHAT5Hf3.js.map → trash-BFH8OA7M.js.map} +1 -1
  188. package/dist/shell-source-maps/assets/{update-set-B0D_tNDz.js.map → update-set-CivHicWr.js.map} +1 -1
  189. package/dist/shell-source-maps/assets/{use-calendar-move-O_48Gqvs.js.map → use-calendar-move-CezBW0KE.js.map} +1 -1
  190. package/dist/shell-source-maps/assets/{use-display-rows-vjthlkqo.js.map → use-display-rows-7iLrRpz6.js.map} +1 -1
  191. package/dist/shell-source-maps/assets/{use-my-invitations-DDPuugTE.js.map → use-my-invitations-B7w0Q5kk.js.map} +1 -1
  192. package/dist/shell-source-maps/assets/{use-paged-search-DRj8498k.js.map → use-paged-search-CblCRsCd.js.map} +1 -1
  193. package/dist/shell-source-maps/assets/{use-run-trace-CWGAibgF.js.map → use-run-trace-vMzYYuXG.js.map} +1 -1
  194. package/dist/shell-source-maps/assets/{use-workflow-page-C9ZEXX5R.js.map → use-workflow-page-Dac4wyOA.js.map} +1 -1
  195. package/dist/shell-source-maps/assets/{use-workflow-types-DDh28X2_.js.map → use-workflow-types-Bi8u42jQ.js.map} +1 -1
  196. package/dist/shell-source-maps/assets/{workflow-canvas-n_YJtaOh.js.map → workflow-canvas-2owtFZNz.js.map} +1 -1
  197. package/dist/shell-source-maps/assets/{workflow-field-CpkY17Cc.js.map → workflow-field-Ct0HoH5Z.js.map} +1 -1
  198. package/dist/shell-source-maps/assets/{workflow-graph-editor-V-ZGHSrC.js.map → workflow-graph-editor-oAKVQAgf.js.map} +1 -1
  199. package/dist/shell-source-maps/assets/{workflow-run-field-CoUJGVdX.js.map → workflow-run-field-C7ff1D9_.js.map} +1 -1
  200. package/dist/shell-source-maps/assets/{workflow-status-field-nmrhtSls.js.map → workflow-status-field-iHUr4FZM.js.map} +1 -1
  201. package/dist/shell-source-maps/assets/{workflow-workbench-DvzNEdn3.js.map → workflow-workbench-BCsEjQVw.js.map} +1 -1
  202. package/dist/status/messages.d.ts +2 -2
  203. package/dist/users/messages.d.ts +2 -2
  204. package/package.json +5 -5
  205. package/dist/shell/assets/board-display-ClTe26F0.js +0 -2
  206. package/dist/shell/assets/calendar-display-CwBcu_JO.js +0 -2
  207. package/dist/shell/assets/composed-page-DBHl-wl_.js +0 -2
  208. package/dist/shell/assets/create-route-s8RsjtyM.js +0 -2
  209. package/dist/shell/assets/embedded-list-OJQKeuBN.js +0 -3
  210. package/dist/shell/assets/import-table-dialog-BbI7GJ8R.js +0 -2
  211. package/dist/shell/assets/list-page-DImD2FRO.js +0 -4
  212. package/dist/shell/assets/members-page-ZcqzlQu6.js +0 -2
  213. package/dist/shell/assets/messages-vzi5T1Xo.js +0 -2
  214. package/dist/shell/assets/organization-page-CjrQmpot.js +0 -2
  215. package/dist/shell/assets/organizations-page-C7gJsoCx.js +0 -2
  216. package/dist/shell/assets/public-form-page-DjLnqHPx.js +0 -2
  217. package/dist/shell/assets/record-page-DGWHTUdD.js +0 -3
  218. package/dist/shell/assets/render-node-0_Pb8ixy.js +0 -3
  219. package/dist/shell/assets/reorder-button-BhhzhhTO.js +0 -2
  220. package/dist/shell/assets/shared-protobase-ui-XTZSVgEm.js +0 -1
  221. package/dist/shell/assets/sheet-source-DxVQhlKF.js +0 -3
  222. package/dist/shell/assets/sign-in-policy-page-E1eBhmUM.js +0 -2
  223. package/dist/shell/assets/start-block-queries-Bu7xMabd.js +0 -2
  224. package/dist/shell/assets/step-catalog-BPk6WuYH.js +0 -2
  225. package/dist/shell/assets/timeline-display-CJHQiDm9.js +0 -2
  226. package/dist/shell/assets/use-calendar-move-O_48Gqvs.js +0 -2
  227. package/dist/shell/assets/use-my-invitations-DDPuugTE.js +0 -2
  228. package/dist/shell/assets/workflow-status-field-nmrhtSls.js +0 -2
  229. package/dist/shell/assets/workflow-workbench-DvzNEdn3.js +0 -4
  230. package/dist/shell-source-maps/assets/app-B94YfKGx.js.map +0 -1
  231. package/dist/shell-source-maps/assets/markdown-content-BZLiLira.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Ba as r,Cl as i,Dl as a,Ea as o,El as s,Hl as c,Ia as l,Ml as u,Nl as d,Ol as f,Qc as p,Sl as m,Ss as h,Tl as g,Vi as _,Vl as v,Zi as y,_l as b,as as x,bl as ee,bn as S,ds as C,gl as w,hl as te,il as ne,jl as T,lc as re,vl as ie,wl as ae,xl as oe,yl as se,yo as E,zr as ce}from"./app-DU-Bny4k.js";import{i as le,r as ue,t as de}from"./update-set-CivHicWr.js";import{a as D,c as O,d as fe,i as pe,l as me,n as he,o as ge,r as _e,s as ve,t as ye,u as be}from"./lib-zod-B92j-KH2.js";import{t as xe}from"./view-chart-ChBtewKd.js";import{n as Se,o as Ce,s as we}from"./use-workflow-page-Dac4wyOA.js";var k=/^-?\d+$/,Te=-(2n**63n),Ee=2n**63n-1n,De={type:`bigint`,constraints:[],build:()=>O().refine(e=>k.test(e)&&BigInt(e)>=Te&&BigInt(e)<=Ee,{message:`Expected a 64-bit integer as a string`})},Oe={type:`boolean`,constraints:[],build:()=>pe()},ke={type:`country`,constraints:[],build:()=>O().regex(/^[A-Z]{2}$/,`Expected an ISO 3166-1 alpha-2 country code`)},Ae={type:`currency`,constraints:[],build:()=>O().regex(/^[A-Z]{3}$/,`Expected an ISO 4217 currency code`)},je={type:`date`,constraints:[],build:()=>ye()},Me=/^-?(\d*)(?:\.(\d+))?$/,Ne={type:`decimal`,constraints:[],build:e=>{if(e.precision===void 0||e.scale===void 0)throw Error(`f.decimal requires precision and scale`);let t=e.precision-e.scale,n=e.scale;return O().refine(e=>{let r=Me.exec(e);if(!r)return!1;let i=(r[1]??``).replace(/^0+/,``),a=r[2]??``;return r[1]||a?i.length<=t&&a.length<=n:!1},{message:`Expected a decimal string with at most ${e.precision} digits, ${e.scale} after the point`,params:{precision:e.precision,scale:e.scale}})}},Pe={type:`enum`,constraints:[],build:e=>{if(!e.enumValues?.length)throw Error(`f.enum requires at least one value`);return _e(e.enumValues)}},A={type:`file`,constraints:[],build:()=>O().min(1).max(4096)},Fe={type:`integer`,constraints:[`min`,`max`],build:e=>{let t=D();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),t}},Ie=(e,t=256)=>{let n=[[e,0]];for(;n.length>0;){let[e,r]=n.pop();if(typeof e==`object`&&e){if(r+1>t)return!1;for(let t of Object.values(e))n.push([t,r+1])}}return!0},Le={type:`json`,constraints:[],build:()=>ve((e,t)=>(Ie(e)||t.addIssue({code:`custom`,message:`Nested deeper than 256 levels`,params:{max_depth:256}}),e),ge())},j={type:`relation`,constraints:[],build:()=>me([O(),D()])},Re={type:`text`,constraints:[`min`,`max`,`regex`],build:e=>{let t=O();return e.min!==void 0&&(t=t.min(e.min)),e.max!==void 0&&(t=t.max(e.max)),e.regex&&(t=t.regex(e.regex.re,e.regex.message)),t}},ze={type:`timestamp`,constraints:[],build:()=>he({offset:!0})},Be={type:`uuid`,constraints:[],build:()=>be()},Ve=e=>v(e),M=e=>Ve(e).length===0?`its prompt must name at least one {{field}} of the record`:void 0,N=/\s*(?:(\d+(?:\.\d+)?)|([A-Za-z_][A-Za-z0-9_]*)|([-+*/(),]))/y,He=e=>{let t=[];for(N.lastIndex=0;N.lastIndex<e.length;){let n=N.lastIndex,r=N.exec(e);if(!r){let t=e.slice(n);if(t.trim()===``)break;let r=t.length-t.trimStart().length;throw Error(`Formula "${e}": unexpected "${t[r]}" at ${n+r+1}`)}let[i,a,o,s]=r,c=a??o??s;t.push({kind:a===void 0?o===void 0?`symbol`:`name`:`number`,text:c,at:n+i.length-c.length})}return t},Ue=e=>{let t=He(e),n=0,r=r=>{let i=t[n];throw Error(`Formula "${e}": ${r}${i?` at ${i.at+1}, found "${i.text}"`:` at the end`}`)},i=e=>t[n]?.kind===`symbol`&&t[n].text===e,a=e=>{i(e)||r(`expected "${e}"`),n+=1},o=()=>{a(`(`);let e=[u()];for(;i(`,`);)n+=1,e.push(u());return a(`)`),e},s=e=>{if(e===`coalesce`){let e=o();return e.length<2&&r(`coalesce() takes at least two values`),{kind:`coalesce`,args:e}}let t=o(),[n,i]=t;return t.length>2&&r(`round() takes a value and at most a number of digits`),i===void 0?{kind:`round`,value:n}:((i.kind!==`number`||i.value.includes(`.`))&&r(`round()'s digits must be a whole number`),{kind:`round`,value:n,digits:Number(i.value)})},c=()=>{let e=t[n];if(!e)return r(`expected a number, a field or "("`);if(e.kind===`number`)return n+=1,{kind:`number`,value:e.text};if(e.kind===`name`)return n+=1,i(`(`)?e.text!==`coalesce`&&e.text!==`round`?(--n,r(`unknown function "${e.text}", only coalesce() and round()`)):s(e.text):{kind:`field`,name:e.text};if(e.text===`-`)return n+=1,{kind:`negate`,operand:c()};if(e.text===`(`){n+=1;let e=u();return a(`)`),e}return r(`expected a number, a field or "("`)},l=()=>{let e=c();for(;i(`*`)||i(`/`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:c()}}return e},u=()=>{let e=l();for(;i(`+`)||i(`-`);){let r=t[n].text;n+=1,e={kind:`binary`,op:r,left:e,right:l()}}return e},d=u();return n<t.length&&r(`expected an operator`),d},We=fe(),P=class e{def;meta;schema;constructor(e,t){this.def=e,this.meta=t;let n=e.build(t);t.nullable&&(n=n.nullable()),t.hasDefault&&(n=n.default(t.defaultValue)),this.schema=n.register(We,t)}column(e){return this.with({column:e})}readOnly(){return this.with({readOnly:!0})}optional(){return this.with({nullable:!0})}default(e){return this.with({hasDefault:!0,defaultValue:e})}access(e){return this.with({access:{...this.meta.access,...e}})}sensitive(){return this.with({sensitive:!0})}encrypted(){if(this.meta.type!==`text`)throw Error(`.encrypted() takes only f.text() fields`);return this.with({encrypted:!0,sensitive:!0})}strongSignIn(e={}){let t=e.minutes??15;if(!Number.isInteger(t)||t<1)throw Error(`.strongSignIn(): minutes must be a whole number of at least 1`);return this.with({strongSignIn:{minutes:t},sensitive:!0})}dbDefault(){return this.with({dbDefault:!0})}alias(...e){return this.with({aliases:[...this.meta.aliases,...e]})}filterable(){return this.with({filterable:!0})}sortable(){return this.with({sortable:!0})}regex(e,t){return this.constrain(`regex`,{regex:{re:e,message:t}})}min(e){return this.constrain(`min`,{min:e})}max(e){return this.constrain(`max`,{max:e})}ai(e){let t=M(e.prompt);if(t)throw Error(`.ai(): ${t}`);return this.with({ai:{prompt:e.prompt}})}rollup(e){return this.with({rollup:{...e},readOnly:!0})}formula(e){return Ue(e),this.with({formula:e,readOnly:!0})}lookup(e){return this.with({lookup:{...e},readOnly:!0,nullable:!0})}with(t){return new e(this.def,{...this.meta,...t})}constrain(e,t){if(!this.def.constraints.includes(e))throw Error(`f.${this.def.type} does not support .${e}()`);return this.with(t)}},Ge=class extends P{columns(e){return this.with({relation:{resource:this.meta.relation.resource,columns:e}})}},F=[`webp`,`avif`,`jpeg`,`png`],Ke=5e7,qe={b:1,kb:1e3,mb:1e6,gb:1e9,kib:1024,mib:1024**2,gib:1024**3},I=e=>{if(typeof e==`number`){if(!Number.isSafeInteger(e)||e<=0)throw Error(`A file size must be a positive whole number of bytes, not ${e}`);return e}let t=/^\s*(\d+(?:\.\d+)?)\s*([a-z]+)?\s*$/i.exec(e),n=qe[(t?.[2]??`b`).toLowerCase()];if(!t||!n)throw Error(`"${e}" is not a size; write it like "10 MB" or "512 KiB"`);return I(Math.round(Number(t[1])*n))},Je=/^(?:\*\/\*|[a-z0-9][a-z0-9!#$&^_.+-]*\/(?:\*|[a-z0-9][a-z0-9!#$&^_.+-]*))$/,Ye=e=>e.map(e=>{let t=e.trim().toLowerCase();if(!Je.test(t))throw Error(`"${e}" is not a media type or a type/* wildcard`);return t}),L=/^[a-z][a-z0-9-]{0,31}$/,Xe=new Set([`http`,`https`,`data`,`blob`,`file`,`javascript`,`mailto`]),Ze=e=>{if(!L.test(e))throw Error(`"${e}" is not a file provider name: lowercase letters, digits and dashes, starting with a letter`);if(Xe.has(e))throw Error(`"${e}" cannot name a file provider: stored values would read as ${e}: links`);return e},Qe=/^[a-z][a-z0-9_]{0,31}$/,$e=[`inside`,`cover`],R=(e,t)=>{if(t!==void 0&&(!Number.isSafeInteger(t)||t<1||t>16384))throw Error(`${e} must be a whole number of pixels from 1 to 16384, not ${t}`)},z=(e,t)=>{if(!F.includes(t.format))throw Error(`${e}: "${t.format}" is not an image format; use ${F.join(`, `)}`);if(t.fit!==void 0&&!$e.includes(t.fit))throw Error(`${e}: fit is "inside" or "cover", not "${t.fit}"`);if(t.fit===`cover`&&(t.width===void 0||t.height===void 0))throw Error(`${e}: fit "cover" needs both a width and a height`);if(R(`${e}: width`,t.width),R(`${e}: height`,t.height),t.quality!==void 0&&(!Number.isSafeInteger(t.quality)||t.quality<1||t.quality>100))throw Error(`${e}: quality must be a whole number from 1 to 100, not ${t.quality}`);return{...t}},et=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>{if(!Qe.test(e))throw Error(`"${e}" cannot name an image variant: lowercase letters, digits and underscores, starting with a letter`);return[e,z(`Image variant "${e}"`,t)]})),tt=class e extends P{accept(e){return this.withFile({accept:Ye(e)})}maxSize(e){return this.withFile({maxSize:I(e)})}public(){return this.storage(`public`)}storage(e){return this.withFile({provider:Ze(e)})}derive(e){return this.withFile({derive:{...this.meta.file.derive,...e}})}placeholder(e){return this.withFile({placeholder:e})}typeField(e){return this.withFile({typeField:e})}sizeField(e){return this.withFile({sizeField:e})}variants(e,t={}){return this.withFile({variants:{...this.meta.file.variants,...et(e)},...t.original&&{original:z(`The original`,t.original)}})}externalUrls(){return this.withFile({external:!0})}optional(){return this.with({nullable:!0})}readOnly(){return this.with({readOnly:!0})}column(e){return this.with({column:e})}access(e){return this.with({access:{...this.meta.access,...e}})}with(t){return new e(this.def,{...this.meta,...t})}withFile(e){return this.with({file:{...this.meta.file,...e}})}},B=e=>({type:e.type,nullable:!1,readOnly:!1,filterable:!1,sortable:!1,aliases:[],hasDefault:!1}),V=(e,t={})=>new P(e,{...B(e),...t}),H={text:()=>V(Re),integer:()=>V(Fe),bigint:()=>V(De),decimal:e=>V(Ne,e),boolean:()=>V(Oe),date:()=>V(je),timestamp:()=>V(ze),uuid:()=>V(Be),enum:e=>V(Pe,{enumValues:[...e]}),json:()=>V(Le),relation:e=>new Ge(j,{...B(j),relation:{resource:e}}),file:()=>new tt(A,{...B(A),file:{accept:[],maxSize:Ke,provider:`private`}}),currency:()=>V(Ae),country:()=>V(ke)},nt=e=>/^(https?:\/\/|mailto:)/i.test(e),rt=(e,t)=>[...typeof e.filter==`string`&&e.filter.trim()!==``?b(t,e.filter).map(e=>`filter: ${e.message}`):[`needs a filter that finds the record`],...e.orderBy===void 0?[]:se(t,e.orderBy).map(e=>`orderBy: ${e.message}`)],it=e=>e.when===void 0?e.otherwise!==void 0||e.reason!==void 0?`"otherwise" and "reason" need a "when" condition`:void 0:e.when.trim()===``?`"when" is empty`:e.otherwise===`disable`?e.reason?void 0:`a button disabled by "when" needs a "reason"`:e.reason===void 0?void 0:`"reason" shows only with otherwise: 'disable'`,U=(e,t)=>{let n=it(t);if(n)throw Error(`Action "${e}": ${n}`);return{name:e,label:t.label,bulk:t.bulk??!1,...t.icon!==void 0&&{icon:t.icon},...t.confirm!==void 0&&{confirm:t.confirm},...t.when!==void 0&&{when:t.when},...t.otherwise===`disable`&&{otherwise:t.otherwise,reason:t.reason},...t.variant!==void 0&&{variant:t.variant}}},W=(e,t)=>{if(!t)return{};let n=t(le),r=ue(n);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{inputs:n}},at={action:(e,t)=>({...U(e,t),...W(e,t.inputs),...t.mailbox&&{mailbox:!0}}),update:(e,t)=>{let n=W(e,t.inputs),r=de(t.set,n.inputs);if(r.length>0)throw Error(`Action "${e}": ${r.join(`; `)}`);return{...U(e,t),...n,run:{kind:`update`,values:t.set}}},remove:(e,t)=>({...U(e,t),run:{kind:`delete`}}),link:(e,t)=>{let n=c(t.label,t);if(n)throw Error(`Action "${e}": ${n}`);return`to`in t?{...U(e,t),run:{kind:`link`,to:structuredClone(t.to)}}:{...U(e,t),run:{kind:`link`,href:t.href}}},ai:(e,t)=>{let n=M(t.prompt)??(t.writes===``?`it writes no field`:void 0);if(n)throw Error(`Action "${e}": ${n}`);return{...U(e,t),run:{kind:`ai`,prompt:t.prompt,writes:t.writes}}}},ot=e=>{let{name:t,title:n,fields:r,thanks:i}=e;if(!m.test(t))throw Error(`A form's name goes in its address, so it takes lowercase letters, digits, - and _, not "${t}"`);if(r.length===0)throw Error(`Form "${t}" has no fields`);let a=r.map(e=>e.name),o=a.find((e,t)=>a.indexOf(e)!==t);if(o!==void 0)throw Error(`Form "${t}" lists the field "${o}" twice`);if(i.trim()===``)throw Error(`Form "${t}" needs a thanks text, shown once a visitor sends it`);if(n!==void 0&&n.trim()===``)throw Error(`Form "${t}" has an empty title; leave it out for the view's name`);let s=e.perMinute??5;if(!Number.isInteger(s)||s<1)throw Error(`Form "${t}" takes perMinute as a positive whole number, not ${s}`);return{name:t,...n!==void 0&&{title:n},fields:a,thanks:i,perMinute:s}},st=e=>typeof e==`object`&&!!e&&e.kind===`related`,ct={related:(e,t)=>({kind:`related`,name:e,...structuredClone(t)})},lt=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,ut=/^[A-Z]{3}$/,dt=class e{name;props;constructor(e,t={}){this.name=e,this.props=t}label(e){return this.with({label:e})}help(e,t={}){return this.with({help:e,...t.when!==void 0&&{helpWhen:t.when}})}when(e){return this.with({when:e})}notOnCreate(){return this.with({notOnCreate:!0})}confirm(e){if(e.trim()===``)throw Error(`Field "${this.name}": .confirm() needs the question to ask`);return this.with({confirm:e})}format(t,n={}){if(n.text===void 0&&t===`url`)return this.with({format:t});if(n.text===void 0){let{linkText:n,...r}=this.props;return new e(this.name,{...r,format:t})}if(t!==`url`)throw Error(`Field "${this.name}": only format('url') takes a link text`);if(n.text.trim()===``)throw Error(`Field "${this.name}": format('url') needs a link text that is not empty`);return this.with({format:t,linkText:n.text})}multiline(){return this.with({multiline:!0})}markdown(){return this.with({markdown:!0})}prefix(e){return this.with({prefix:e})}currency(e){if(!ut.test(e))throw Error(`Field "${this.name}": currency "${e}" is not an ISO 4217 code such as EUR`);return this.with({currency:e})}suffix(e){return this.with({suffix:e})}decimals(e){return this.with({decimals:e})}valueLabels(e){return this.with({valueLabels:{...this.props.valueLabels,...e}})}valueColors(e){let t=Object.entries(e),n=t.find(([,e])=>!w(e)&&!lt.test(e));if(n)throw Error(`Field "${this.name}": value colour "${n[1]}" of "${n[0]}" is not a tone (${te.join(`, `)}) or a hex colour such as #00a651`);return this.with({valueColors:{...this.props.valueColors,...Object.fromEntries(t)}})}waitingValues(e){return this.with({waitingValues:[...e]})}badgeShape(e){return this.with({badgeShape:e})}icon(e){return this.with({icon:e})}widget(e,t){return this.with({widget:{name:e,...t&&{props:t}}})}with(t){return new e(this.name,{...this.props,...t})}},ft={range:(e,t={})=>({kind:`range`,field:e.name,histogram:t.histogram??!1,...t.secondary&&{secondary:!0}}),facets:(e,t={})=>({kind:`facets`,field:e.name,search:t.search??!1,...t.secondary&&{secondary:!0}}),dateRange:(e,t={})=>({kind:`dateRange`,field:e.name,presets:t.presets??[],...t.secondary&&{secondary:!0}}),toggle:(e,t={})=>({kind:`toggle`,field:e.name,...t.secondary&&{secondary:!0}}),flags:(e,t)=>({kind:`flags`,fields:e.map(e=>e.name),label:t.label,...t.secondary&&{secondary:!0}})},pt=new Set([`resource`,`names`,`nav`,`help`,`list`,`filters`,`chart`]),mt=(e,t)=>{let n=(e,n,r)=>n===void 0||t.fields[n]?.type===r?[]:[`${e} "${n}" is not a ${r} field of the resource`];return[...n(`filter`,e.filter,`text`),...n(`name`,e.name,`text`),...n(`unseen.seenAt`,e.unseen?.seenAt,`timestamp`),...(e.controls??[]).flatMap(e=>[`enum`,`boolean`].includes(t.fields[e]?.type??``)?[]:[`control "${e}" is not an enum or boolean field of the resource`]),...e.limit===void 0||Number.isInteger(e.limit)&&e.limit>0?[]:[`limit must be a positive whole number`]]},ht=class e{state;constructor(e){this.state=e}names(e){return this.next({names:e})}icon(e){return this.next({icon:e})}forRoles(e){return this.next({roles:e})}title(e){return this.next({title:e(this.refs()).name})}titleFrom(e,t){let n=t(this.refs()).map(e=>e.name);if(e===``)throw Error(`View "${this.state.resource}": titleFrom needs the name of a rule`);if(n.length===0)throw Error(`View "${this.state.resource}": titleFrom "${e}" reads no fields`);return this.next({titleFrom:{rule:e,fields:n}})}searchResult(e){let{title:t,subtitle:n}=e(this.refs()),r=t===void 0?[]:Array.isArray(t)?t:[t];return this.next({searchResult:{...r.length>0&&{title:r.map(e=>e.name)},...n&&{subtitle:n.name}}})}nav(e){return this.next({nav:e})}help(e){return this.next({help:e})}fields(e){let t=e(T(e=>new dt(e))),n=Object.fromEntries(Object.values(t).map(e=>[e.name,e.props]));return this.next({fields:{...this.state.fields,...n}})}list(e){let{columns:t,sort:n,search:r,filter:i,editable:a,displays:o=[],default:c,drag:l}=e(this.refs(),f,ct),u=t.filter(st).map(({kind:e,...t})=>t),d=t.map(e=>e.name),p=d.find((e,t)=>d.indexOf(e)!==t);if(p!==void 0)throw Error(`View "${this.state.resource}": the list has two columns named "${p}"`);let m=a?.find(e=>!d.includes(e.name));if(m)throw Error(`View "${this.state.resource}": editable field "${m.name}" is not among the list's columns`);let h={columns:d,...u.length>0&&{relatedColumns:u},...n&&{sort:n.map(([e,t])=>[e.name,t])},...r&&{search:r.map(e=>e.name)},...i!==void 0&&i!==``&&{filter:i},...a&&a.length>0&&{editable:a.map(e=>e.name)},...o.length>0&&{displays:o},...c!==void 0&&{default:c},...l&&{drag:{...l}}},g=s(h);if(g.length>0)throw Error(`View "${this.state.resource}": ${g.join(`; `)}`);return this.next({list:h})}filters(e){return this.next({filters:e(this.refs(),ft)})}namedList(e,t){let n=`View "${this.state.resource}": named list "${e}"`;if(!m.test(e))throw Error(`${n}: its name goes in its address, so it takes lowercase letters, digits, - and _`);if(this.state.lists?.some(t=>t.name===e))throw Error(`${n} is declared twice`);let r=G(this.state.resource),{state:i}=t(r),a=Object.keys(i).filter(e=>!pt.has(e)&&i[e]!==r.state[e]);if(a.length>0)throw Error(`${n} sets ${a.join(`, `)}; a named list takes names, nav, help, list, filters and chart`);if(!i.names)throw Error(`${n} needs .names(...), its sidebar entry`);if(i.nav?.recent)throw Error(`${n}: recent records are the view's own, not a named list's`);let o={name:e,names:i.names,filters:i.filters,...i.nav&&{nav:i.nav},...i.help!==void 0&&{help:i.help},...i.list&&{list:i.list},...i.chart&&{chart:i.chart}};return this.next({lists:[...this.state.lists??[],o]})}layout(e){return this.next({layout:e(this.refs())})}chart(e){return this.next({chart:xe(e(this.refs()))})}form(e){return this.next({forms:[...this.state.forms??[],ot(e(this.refs()))]})}recordMode(e){return this.next({recordMode:e})}helpWhen(e){return this.next({helpWhen:e})}saveFeedback(e){return this.next({saveFeedback:e})}recordWidth(e){return this.next({recordWidth:e})}titleBadge(e){return this.next({titleBadge:e(this.refs()).name})}import(e){return this.next({import:e})}actions(e){return this.next({actions:e(at)})}listOf(e){return this.next({listOf:e(this.refs()).name})}signIn(e){if(e.signUp&&!nt(e.signUp.href))throw Error(`View "${this.state.resource}": signIn signUp.href must start with https://, http:// or mailto:`);return this.next({signIn:structuredClone(e)})}saveSearch(e){return this.next({saveSearch:{...e}})}export(e){if(e&&e.maxRows!==void 0&&!(Number.isInteger(e.maxRows)&&e.maxRows>0))throw Error(`View "${this.state.resource}": export maxRows must be a positive whole number`);return this.next({export:e&&{...e}})}create(e){return this.next({create:{...e}})}record(e){let t=typeof e==`function`?{surface:e(this.refs()).surface.name}:{component:ae(e.component,`record component`),...e.focus&&{focus:!0}};return this.next({record:t})}recordOpens(e){let t=Array.isArray(e)?[...e]:[e];if(t.length===0)throw Error(`View "${this.state.resource}": recordOpens needs at least one address`);return this.next({recordOpens:structuredClone(t)})}createOpens(e){return this.next({createOpens:structuredClone(e)})}searchesOf(e){let{resource:t,filter:n,name:r,controls:i,unseen:a,limit:o}=e(this.refs()),s={resource:t,filter:n.name,...r&&{name:r.name},...i&&{controls:i.map(e=>e.name)},...a&&{unseen:{seenAt:a.seenAt.name,field:a.field}},...o!==void 0&&{limit:o}};return this.next({searchesOf:s})}toModel(t){let{title:n,titleFrom:r,titleBadge:o,nav:s,searchResult:c,list:l,listOf:u}=this.state;if(t&&n!==void 0&&!Object.hasOwn(t.fields,n))throw Error(`View "${this.state.resource}": title field "${n}" does not exist on the resource`);if(t&&o!==void 0&&!Object.hasOwn(t.fields,o))throw Error(`View "${this.state.resource}": title badge field "${o}" does not exist on the resource`);if(t&&o!==void 0&&t.fields[o].type!==`enum`&&this.state.fields[o]?.format!==`badge`)throw Error(`View "${this.state.resource}": title badge field "${o}" is no enum and has no .format('badge'), so it would not fit a badge`);let f=t?r?.fields.find(e=>!Object.hasOwn(t.fields,e)):void 0;if(f!==void 0)throw Error(`View "${this.state.resource}": titleFrom field "${f}" does not exist on the resource`);let p=t?[...c?.title??[],...c?.subtitle?[c.subtitle]:[]].filter(e=>!Object.hasOwn(t.fields,e)):[];if(p.length>0)throw Error(`View "${this.state.resource}": search result field "${p[0]}" does not exist on the resource`);for(let e of t?l?.displays??[]:[]){let n=a(e).find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" names field "${n}", which the resource does not have`);if(e.kind===`cards`&&e.image!==void 0&&t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${e.image}" as its image, which is not a file field`);let r=e.kind===`cards`?e.flags?.find(e=>t.fields[e].type!==`boolean`):void 0;if(r!==void 0)throw Error(`View "${this.state.resource}": display "${e.name}" shows "${r}" as a flag, which is not a boolean field`);let o=e.kind===`board`?i(e,t):[];if(o.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${o.join(`; `)}`);let s=e.kind===`calendar`||e.kind===`timeline`?g(e,t):[];if(s.length>0)throw Error(`View "${this.state.resource}": display "${e.name}": ${s.join(`; `)}`)}let m=t?l?.relatedColumns?.find(e=>Object.hasOwn(t.fields,e.name)):void 0;if(m)throw Error(`View "${this.state.resource}": related column "${m.name}" has the name of a field of the resource`);let h=new Set,_=this.state.layout.flatMap((e,t)=>e.kind===`tab`?[{item:e,index:t}]:[]),v=_.find((e,t)=>t>0&&e.index!==_[t-1].index+1);if(v)throw Error(`View "${this.state.resource}": tabs stand together, and "${v.item.title}" is apart from the others`);let y=new Set;for(let{item:e}of _){if(y.has(e.title))throw Error(`View "${this.state.resource}": two tabs are titled "${e.title}"`);y.add(e.title)}for(let e of this.state.layout.flatMap(e=>e.kind===`tab`?e.items:[e]))if(e.kind===`group`){if(h.has(e.title))throw Error(`View "${this.state.resource}": two groups are titled "${e.title}"`);h.add(e.title)}for(let e of t?oe(this.state.layout):[])if(e.kind===`gallery`&&e.image!==void 0){if(!Object.hasOwn(t.fields,e.image))throw Error(`View "${this.state.resource}": gallery "${e.title}" names field "${e.image}", which the resource does not have`);if(t.fields[e.image].type!==`file`)throw Error(`View "${this.state.resource}": gallery "${e.title}" shows "${e.image}" as its image, which is not a file field`)}if(t&&u!==void 0&&(!Object.hasOwn(t.fields,u)||t.fields[u].type!==`relation`))throw Error(`View "${this.state.resource}": listOf names "${u}", which is not a relation field of the resource`);let b=t&&this.state.searchesOf?mt(this.state.searchesOf,t):[];if(b.length>0)throw Error(`View "${this.state.resource}": searchesOf ${b.join(`; `)}`);for(let e of t?this.state.forms??[]:[]){let n=e.fields.find(e=>!Object.hasOwn(t.fields,e));if(n!==void 0)throw Error(`View "${this.state.resource}": form "${e.name}" names field "${n}", which the resource does not have`)}if(s?.tenant===`current`&&!l)throw Error(`View "${this.state.resource}": nav.tenant narrows the opening filter of the list, so the view needs .list(...)`);let x=t?.tenant===void 0?void 0:t.fields[t.tenant];if(t&&s?.tenant===`current`&&!x?.filterable)throw Error(`View "${this.state.resource}": nav.tenant opens the list on the current tenant, so the resource needs .tenant() on a .filterable() field`);if(typeof s?.create==`object`&&s.create.label.trim()===``)throw Error(`View "${this.state.resource}": nav.create needs a label, or true for "New <singular>"`);let S=t&&s?.recent?ie(s.recent,t):[];if(S.length>0)throw Error(`View "${this.state.resource}": nav.recent ${S.join(`; `)}`);let C=t&&s?.start?rt(s.start,t):[];if(C.length>0)throw Error(`View "${this.state.resource}": nav.start ${C.join(`; `)}`);let w=t?(this.state.recordOpens??[]).flatMap(d).find(e=>!Object.hasOwn(t.fields,e)):void 0;if(w!==void 0)throw Error(`View "${this.state.resource}": recordOpens names field "${w}", which the resource does not have`);if(this.state.lists?.length&&(u!==void 0||this.state.searchesOf))throw Error(`View "${this.state.resource}": named lists cannot go with listOf or searchesOf, which replace the list page`);for(let n of this.state.lists??[])new e(ee(this.state,n.name)).toModel(t);return structuredClone(this.state)}refs(){return T(u)}next(t){return new e({...this.state,...t})}},G=e=>new ht({resource:e,fields:{},filters:[],layout:[],actions:[]}),K=[`failing`,`unresolved`,`healthy`,`no_runs`,`resolved`,`new_version`],gt={failing:`danger`,unresolved:`warning`,healthy:`success`},_t=[`failing`,`unresolved`],q={read:e=>e.holds?.(`workflow_runs.read`)??!1};H.enum(K).readOnly().dbDefault().access(q),H.relation(`workflow_runs`).optional().readOnly().access(q),H.timestamp().optional().readOnly().access(q),H.integer().readOnly().dbDefault().access(q),H.timestamp().optional().readOnly(),H.text().optional().readOnly(),G(`workflow_resolutions`).names({singular:`Workflow resolution`,plural:`Workflow resolutions`}).icon(`check`).nav({hidden:!0}).title(e=>e.resolved_at).fields(e=>({workflow_id:e.workflow_id.label(`Workflow`),resolved_by:e.resolved_by.label(`Resolved by`),resolved_at:e.resolved_at.label(`Resolved`)})).list(e=>({columns:[e.workflow_id,e.resolved_by,e.resolved_at],sort:[[e.resolved_at,`desc`]]}));var J=p(`app/field-types/workflow-status`),Y=e(n(),1),vt=({id:e})=>(0,Y.jsx)(Y.Fragment,{children:_().member(e)?.name??e}),yt=({by:e,at:t})=>{let n=h(),r=n?.state.kind===`signed-in`&&e!==null&&String(n.state.user.id)===e?J(`you`):e===null?`?`:n?.organizations?(0,Y.jsx)(vt,{id:e}):e;return(0,Y.jsx)(`p`,{className:`text-body text-muted-foreground`,children:J.rich(`resolvedBy`,{who:r,when:y(Date.parse(t))})})},X=e=>K.includes(e),Z=e=>gt[e]??`neutral`,bt=e=>{if(X(e))return{tone:Z(e),words:J(`label`,{status:e})}},Q=e=>y(Date.parse(String(e))),xt=e=>{let t=e.run_status;if(!X(t))return;let n={status:t,tone:Z(t),resolvable:_t.includes(t)},r=e.status_run_id==null?void 0:String(e.status_run_id);return t===`failing`||t===`healthy`?{...n,words:J(t,{when:Q(e.status_run_at),runs:10}),...r&&{run:r}}:t===`unresolved`?{...n,words:J(t,{count:Number(e.unresolved_failures),runs:10,when:Q(e.status_run_at)}),...r&&{run:r}}:{...n,words:J(t)}},St=e(t(),1),$=`workflow_resolutions`,Ct=(e,t)=>{let n=C(),r=S(),i=l(),a=o(x(`workflow_resolutions`),`create`)&&t,[s,c]=(0,St.useState)(!1);return{permitted:a,busy:s,resolve:async()=>{c(!0),await n.create($,{workflow_id:e}).then(async()=>{await Promise.all([r(`workflows`),r($)]),i.show({state:`success`,title:J(`resolveDone`)})},()=>i.show({state:`error`,title:J(`resolveFailed`)})),c(!1)}}},wt=({workflow:e,value:t})=>{let n=r(we,e).data,i=n?.record,a=Ct(e,n?.permissions?.update!==!1),o=i&&xt({...i,run_status:t});return!i||!o?null:(0,Y.jsxs)(`div`,{className:`grid gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,Y.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-body`,"data-status":o.status,children:[(0,Y.jsx)(E,{tone:o.tone}),o.run?(0,Y.jsx)(ce,{to:Ce({workflow:e,run:o.run}),className:`font-medium text-primary-text hover:underline`,children:o.words}):(0,Y.jsx)(`span`,{children:o.words})]}),o.resolvable&&a.permitted&&(0,Y.jsx)(re,{size:`sm`,loading:a.busy,onClick:()=>void a.resolve(),children:J(`resolve`)})]}),i.resolved_at!=null&&(0,Y.jsx)(yt,{by:i.resolved_by==null?null:String(i.resolved_by),at:String(i.resolved_at)})]})},Tt=({value:e})=>{let t=Se();return e===null||!t?null:(0,Y.jsx)(wt,{workflow:t.workflow,value:e})},Et=({value:e})=>{let t=bt(e);return t?(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Y.jsx)(E,{tone:t.tone}),t.words]}):null},Dt={of:[...ne.workflow_status],display:Tt,cell:Et};export{Dt as workflowStatusField};
2
+ //# debugId=221d4af8-1593-4437-b969-431fb873a593
@@ -0,0 +1,4 @@
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{$ as r,$o as i,Ba as a,Bn as o,Br as s,Dc as c,Ea as l,En as u,Hc as d,Js as f,Q as p,R as m,Rn as h,Sc as g,So as _,Uc as v,V as y,Vo as b,X as x,Zc as S,Zi as C,as as ee,bc as te,ds as w,et as T,gr as E,is as D,lc as O,ll as k,mc as ne,n as A,nt as re,oc as j,ot as M,r as N,tt as P,uc as F,vc as ie,xc as I,zr as L}from"./app-DU-Bny4k.js";import{h as ae}from"./vendor-t7Q7QbPu.js";import{A as R,C as oe,D as se,E as ce,O as le,T as ue,_ as de,a as fe,b as pe,c as me,d as he,f as ge,g as _e,h as ve,i as ye,k as be,l as z,m as xe,n as Se,o as Ce,p as we,r as B,s as V,t as H,u as Te,v as Ee,w as De,x as Oe,y as ke}from"./step-catalog-CgPcuEu_.js";import{t as Ae}from"./circle-alert-COV0WNyG.js";import{h as U,m as W,t as je}from"./workflow-canvas-2owtFZNz.js";import{t as G}from"./record-sidebar-HqyBXBwn.js";import{a as Me,o as K,r as Ne,t as Pe}from"./step-panel-CoFQOZfZ.js";import{M as q,N as J,_ as Fe,g as Ie,h as Le,j as Re}from"./workflows-Bey4jszG.js";import{E as Y,S as ze,T as X,_ as Be,b as Ve,n as He,v as Ue,w as We,y as Ge}from"./use-run-trace-vMzYYuXG.js";import{n as Z}from"./use-workflow-types-Bi8u42jQ.js";import{a as Ke,i as qe,o as Je,r as Ye,s as Xe,t as Ze}from"./use-workflow-page-Dac4wyOA.js";var Qe={name:`shuffle`,size:24,node:[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]};Qe.node;var $e=v(Qe),Q=e(t(),1),$=e(n(),1),et=({types:e,placement:t,onAdd:n,onClose:r})=>{let i=(0,Q.useMemo)(()=>Se(e),[e]);return(0,$.jsx)(P,{title:B(`addStepTitle`),onClose:r,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}),(0,$.jsx)(x,{autoFocus:!0,groups:i,onPick:e=>n(H(e.id))})]})})},tt=`$states.context.Execution.Input`,nt=e=>(e.description??``).split(` · `)[0],rt=({definition:e,path:t,target:n,run:r,onAssign:i,onBack:a,onTestRun:o})=>{let s=He(r===void 0?void 0:String(r.id),!1),c=(0,Q.useMemo)(()=>s.data??[],[s.data]),l=(0,Q.useMemo)(()=>Ce(e,t),[e,t]),u=(0,Q.useMemo)(()=>l.filter(t=>!z(e,t)),[l,e]),f=l.filter(t=>z(e,t)),p=e=>c.filter(t=>K(t.scope,t.state)===e).at(-1)?.output,m=(0,Q.useMemo)(()=>r?[{title:B(`runInputGroup`),items:me(r.input??{}).map(({path:e,sample:t})=>({id:`input:${e}`,title:e===``?B(`wholeValue`):e,description:t}))},...u.flatMap(t=>{let n=p(t);if(n==null)return[];let r=X(t).name;return[{title:r,items:me(n).map(({path:n,sample:i})=>({id:`step:${t}\n${n}`,title:n===``?B(`wholeValue`):n,description:Te(e,t).added?`${i} · ${B(`addsVariable`,{step:r})}`:i}))}]})]:[],[r,c,u,e]),h=(t,r)=>{if(t.startsWith(`input:`)){n.set(he(n.value,V(tt,t.slice(6)))),a();return}let[o,s]=t.slice(5).split(`
2
+ `),{variable:c,added:l}=Te(e,o);l&&i(o,c,r),n.set(he(n.value,V(`$${c}`,s))),a()},g=u.filter(t=>Y(e,t)&&p(t)==null);return(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(O,{size:`sm`,variant:`ghost`,className:`self-start`,onClick:a,children:[(0,$.jsx)(d,{className:`size-3.5`,"aria-hidden":!0}),B(`back`)]}),(0,$.jsx)(`h3`,{className:`font-semibold`,children:B(`insertInto`,{field:n.label})}),r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:B(`valuesFrom`,{when:C(Date.parse(String(r.created_at)))})}),(0,$.jsx)(x,{autoFocus:!0,groups:m,onPick:e=>h(e.id,nt(e))}),g.length>0&&(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[g.map(e=>X(e).name).join(`, `),`: `,B(`noSample`)]}),f.length>0&&(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[f.map(e=>X(e).name).join(`, `),`: `,B(`outputShaped`)]})]}):(0,$.jsxs)(`div`,{className:`grid justify-items-start gap-2 text-body`,children:[(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:B(`noRunYet`)}),(0,$.jsx)(O,{onClick:o,children:B(`testRun`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:B(`typeByHand`)})]})]})},it=(e,t)=>{let n=p(),r=w(),{go:i}=s(),[a,o]=(0,Q.useState)(),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(!1);return{start:async a=>{d(!0),o(void 0),l(!1);try{if(n.dirty&&!await n.save()){l(!0);return}let{record:o}=await r.create(`workflow_runs`,{workflow_id:e.workflow,rerun_of:e.run,...a}),{record:s}=await r.get(Xe,e.workflow);t(),i(qe(e.workflow,String(o.id),Number(o.version),Number(s.version)))}catch(e){if(!f(e))throw e;o(e)}finally{d(!1)}},failure:a,refused:c,busy:u}},at=e=>e.map(e=>B(`stepActs`,e)).join(`, `),ot=({failure:e,refused:t})=>(0,$.jsxs)($.Fragment,{children:[e!==void 0&&(0,$.jsx)(E,{title:B(`notRerun`),error:e}),t&&(0,$.jsx)(`p`,{role:`alert`,className:`text-danger-text`,children:B(`rerunRefused`)})]}),st=({view:e,page:t,definition:n,types:r,step:i,onStep:a,onClose:o})=>{let s=p(),c=it(e,o),l=t.trace.steps.filter(e=>e.scope===``),u=Math.max(l.findIndex(e=>e.state===i),0),d=we(n,r,i),f=new Set(l.map(e=>e.state)),m=d.filter(e=>f.has(e.name)),h=d.filter(e=>!f.has(e.name)),g=(t.latest??0)+ +!!s.dirty,_=l.slice(0,u).find(e=>ge(t.trace.definition,n,e.state))?.state;return(0,$.jsx)(P,{title:B(`rerunTitle`,{step:i}),onClose:o,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[(0,$.jsx)(ot,{failure:c.failure,refused:c.refused}),(0,$.jsx)(`p`,{children:u===0?B(`rerunFromStart`,{version:g}):B(`rerunKeeps`,{count:u,version:g})}),m.length>0&&(0,$.jsx)(`p`,{children:B(`rerunActsAgain`,{steps:at(m)})}),h.length>0&&(0,$.jsx)(`p`,{children:B(`stepsAct`,{steps:at(h)})}),_&&(0,$.jsx)(`p`,{children:B(`rerunChanged`,{changed:_,step:i})}),_&&(0,$.jsx)(O,{variant:`primary`,className:`max-md:min-h-11`,onClick:()=>a(_),children:B(`rerunFromInstead`,{step:_})}),(0,$.jsx)(O,{variant:_?`secondary`:`primary`,className:`max-md:min-h-11`,loading:c.busy,onClick:()=>void c.start({rerun_from:i}),children:_?B(`rerunWithOldResult`,{step:i}):s.dirty?B(`saveAndRerunShort`):B(`rerunStart`)})]})})},ct=({view:e,page:t,onClose:n})=>{let r=it(e,n);return(0,$.jsx)(P,{title:B(`replayTitle`),onClose:n,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[(0,$.jsx)(ot,{failure:r.failure,refused:r.refused}),(0,$.jsx)(`p`,{children:B(`replayLine`,{version:t.latest??0})}),(0,$.jsx)(O,{variant:`primary`,className:`max-md:min-h-11`,loading:r.busy,onClick:()=>void r.start({replay:!0}),children:B(`replayStart`)})]})})},lt=()=>{let e=D().views.workflow_runs?.fields.status;return{hints:e,label:t=>k(String(t),e?.valueLabels)}},ut=e=>e==null?void 0:C(Date.parse(String(e))),dt=({trace:e,valueActions:t,onReplay:n,onClose:r})=>{let i=lt(),{run:a,id:o}=e;if(!a||!o)return null;let s=[{label:B(`status`),value:(0,$.jsx)(u,{value:a.status,hints:i.hints,children:i.label(a.status)})},{label:B(`started`),value:ut(a.created_at)},{label:B(`startedBy`),value:a.started_by==null?void 0:String(a.started_by)},{label:B(`goesOnAt`),value:ut(a.resume_at)},{label:B(`finished`),value:ut(a.finished_at)},{label:B(`duration`),value:a.duration_ms==null?void 0:B(`durationMs`,{ms:Number(a.duration_ms)})}].flatMap(e=>e.value===void 0?[]:[e]);return(0,$.jsx)(P,{title:B(`runDetails`),onClose:r,...n&&{footer:(0,$.jsx)(O,{className:`w-full max-md:min-h-11`,onClick:n,children:B(`replay`)})},children:(0,$.jsxs)(`div`,{className:`grid gap-4`,children:[(0,$.jsx)(G,{title:B(`runDetails`),rows:s}),!e.going&&e.steps.length===0&&(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:B(`runNoTrace`)}),a.error!=null&&(0,$.jsx)(Ne,{title:B(`error`),children:(0,$.jsxs)(`p`,{className:`text-body text-danger-text`,children:[(0,$.jsx)(`span`,{className:`font-mono`,children:String(a.error)}),a.cause!=null&&(0,$.jsxs)(`span`,{children:[`: `,String(a.cause)]})]})}),a.input!=null&&(0,$.jsxs)(Ne,{title:B(`input`),children:[(0,$.jsx)(h,{value:a.input}),t(a.input,`input`)]}),a.output!=null&&(0,$.jsxs)(Ne,{title:B(`output`),children:[(0,$.jsx)(h,{value:a.output}),t(a.output,`output`)]}),(0,$.jsx)(L,{to:{kind:`record`,resource:`workflow_runs`,key:o,standard:!0},className:`text-body font-medium text-primary-text hover:underline`,children:B(`runPage`)})]})})},ft=({value:e,onUse:t})=>{let[n,r]=(0,Q.useState)(!1),i=async()=>{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),r(!0)};return(0,$.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[t&&(0,$.jsx)(O,{size:`sm`,onClick:t,children:B(`useAsTestInput`)}),(0,$.jsx)(O,{size:`sm`,onClick:()=>void i(),children:B(`copyJson`)}),(0,$.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:n&&B(`copied`)})]})},pt=e=>e.Type===`Map`?{...e,ItemProcessor:{...e.ItemProcessor,States:Object.keys(e.ItemProcessor.States)}}:e.Type===`Block`?{...e,Processor:{...e.Processor,States:Object.keys(e.Processor.States)}}:e,mt=e=>Object.entries(e.States).flatMap(([e,t])=>[[e,pt(t)],...q(t)?mt(q(t)):[]]),ht=(e,t)=>{let n=new Map(mt(e.stateMachine).map(([e,t])=>[e,JSON.stringify(t)])),r=mt(t.stateMachine),i=r.filter(([e])=>!n.has(e)).length;return{changed:r.filter(([e,t])=>n.has(e)&&n.get(e)!==JSON.stringify(t)).length,added:i,removed:n.size-(r.length-i)}},gt=e=>{let t=w(),n=ae();return async r=>{await t.update(Xe,e,{enabled_version:r},`*`),await n.invalidateQueries({queryKey:S.record(Xe,e)})}},_t=({view:e,page:t,definition:n,types:r,newVersion:i,onClose:o})=>{let s=p(),c=w(),l=gt(e.workflow),[u,d]=(0,Q.useState)(),[f,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_=e.version===void 0&&s.dirty,v=e.version??(t.latest??0)+(_&&i?1:0),{enabled:y,latest:b}=t,x=a(`workflow_versions`,[e.workflow,y??0],y!==void 0),S=!_&&b!==void 0&&v<b,C=t.runs.some(e=>Number(e.version)===v),ee=x.data?ht(We(x.data.record),n):void 0,te=U(n.trigger),T=async()=>{if(m(!0),g(!1),d(void 0),_&&!await s.save()){m(!1),g(!0);return}let t=e.version??Number((await c.get(`workflows`,e.workflow)).record.version);await l(t).then(o,d),m(!1)},D=_?B(`saveAndPublish`):y===void 0&&te!==`manual`?B(`publishAndTurnOn`):B(`publishVersion`,{version:v});return(0,$.jsx)(P,{title:B(S?`goBackTo`:`publishVersion`,{version:v}),onClose:o,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[u!==void 0&&(0,$.jsx)(E,{title:B(`notPublished`),error:u}),h&&(0,$.jsx)(`p`,{role:`alert`,className:`text-danger-text`,children:B(`notPublishedSave`)}),_&&(0,$.jsx)(`p`,{children:B(`savesThenPublishes`,{version:v})}),S&&(0,$.jsx)(`p`,{children:B(`rollback`,{latest:b,version:v})}),!S&&y!==void 0&&(0,$.jsx)(`p`,{children:B(`publishChange`,{live:y,version:v})}),y===void 0&&(te===`manual`?(0,$.jsx)(`p`,{children:B(`publishManual`,{version:v})}):(0,$.jsx)(`p`,{children:B(`startsTrigger`,{trigger:W(n.trigger,r)})})),ee&&(0,$.jsx)(`p`,{className:`text-muted-foreground`,children:B(`publishDiff`,{...ee,version:y??0})}),!C&&(0,$.jsx)(`p`,{className:`text-warning-text`,children:B(`untested`,{version:v})}),(0,$.jsx)(O,{variant:`primary`,className:`max-md:min-h-11`,loading:f,onClick:()=>void T(),children:D})]})})},vt=({view:e,onClose:t})=>{let n=gt(e.workflow),[r,i]=(0,Q.useState)(),[a,o]=(0,Q.useState)(!1),s=async()=>{o(!0),await n(null).then(t,i),o(!1)};return(0,$.jsx)(P,{title:B(`turnOffTitle`),onClose:t,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 text-body`,children:[r!==void 0&&(0,$.jsx)(E,{title:B(`notTurnedOff`),error:r}),(0,$.jsx)(`p`,{children:B(`turnOffLine`)}),(0,$.jsx)(O,{variant:`danger`,className:`max-md:min-h-11`,loading:a,onClick:()=>void s(),children:B(`turnOff`)})]})})},yt=({view:e,page:t,failed:n,changed:r,gone:i,onOpenFailed:a})=>{let{latest:o,trace:s}=t,c=s.run,l=e.version!==void 0&&e.version!==o,u=Je({workflow:e.workflow,...e.run&&{run:e.run}}),d=(0,$.jsx)(L,{to:u,className:F({size:`sm`}),children:B(`editLatest`)}),f=(0,$.jsx)(L,{to:Ye(e,o),className:F({size:`sm`}),children:B(`hideRun`)});if(e.run===void 0)return l?(0,$.jsxs)(T,{level:`info`,actions:d,children:[B(`olderVersion`,{version:e.version??0,latest:o??0}),t.enabled!==void 0&&` ${B(`versionIsLive`,{version:t.enabled})}`]}):null;if(!c)return null;let p=C(Date.parse(String(c.created_at))),m=Number(c.version),h=!l&&m!==o&&(0,$.jsx)(L,{to:qe(e.workflow,e.run,m,o),className:F({size:`sm`}),children:B(`showRunVersion`,{version:m})}),g=typeof c.block_state==`string`?c.block_state:void 0,_=typeof c.block_of==`string`&&(0,$.jsx)(L,{to:qe(e.workflow,c.block_of,m,o),className:F({size:`sm`}),children:B(`openReachingRun`)});return(0,$.jsxs)(T,{level:`info`,actions:(0,$.jsxs)($.Fragment,{children:[n&&a&&(0,$.jsx)(O,{size:`sm`,onClick:a,children:B(`openFailed`)}),_,l&&d,h,f]}),children:[g===void 0?l?B(`runOlder`,{when:p,version:e.version??0,latest:o??0}):r?B(`runChanged`,{when:p,version:m}):m===o?n?B(`runFailedAt`,{when:p,step:n,version:m}):B(`runSame`,{when:p,version:m}):B(`runUsed`,{when:p,version:m,latest:o??0}):B(`blockRun`,{when:p,block:g,version:m}),i>0&&(0,$.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,B(`stepsGone`,{count:i})]})]})},bt=e=>e<1e3?B(`durationMs`,{ms:e}):B(`durationSeconds`,{seconds:Math.round(e/100)/10}),xt=e=>e==null?void 0:JSON.stringify(e),St=({view:e,page:t,onTestRun:n,onClose:r})=>{let[i,a]=(0,Q.useState)(`all`),o=lt(),s=t.runs.filter(e=>i===`all`||e.status===`failed`);return(0,$.jsx)(P,{title:B(`runs`),onClose:r,takesFocus:!0,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,$.jsx)(_,{value:i,label:B(`runs`),options:[{value:`all`,label:B(`filterAll`)},{value:`failed`,label:B(`filterFailed`)}],onChange:a}),t.runs.length===0&&(0,$.jsxs)(`div`,{className:`grid gap-2 justify-items-start`,children:[(0,$.jsx)(`p`,{className:`text-body text-muted-foreground`,children:B(`noRuns`)}),n&&(0,$.jsx)(O,{onClick:n,children:B(`testRun`)})]}),(0,$.jsx)(`ul`,{className:`grid gap-1`,children:s.map(n=>(0,$.jsx)(`li`,{children:(0,$.jsxs)(L,{to:qe(e.workflow,String(n.id),Number(n.version),t.latest),"aria-current":e.run===n.id?`true`:void 0,onClick:r,className:`grid gap-0.5 rounded-md px-2 py-2 hover:bg-muted aria-[current]:bg-muted max-md:min-h-11`,children:[(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-muted-foreground`,children:[(0,$.jsx)(u,{value:n.status,hints:o.hints,children:o.label(n.status)}),(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:C(Date.parse(String(n.created_at)))}),(0,$.jsx)(`span`,{children:B(`versionShort`,{version:Number(n.version)})}),n.duration_ms!=null&&(0,$.jsx)(`span`,{className:`tabular-nums`,children:bt(Number(n.duration_ms))}),(0,$.jsx)(`span`,{children:n.started_by==null?B(`startedByTrigger`):B(`startedByTest`)})]}),xt(n.input)&&(0,$.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,children:xt(n.input)})]})},String(n.id)))})]})})},Ct=({title:e,settings:t,run:n,state:r,block:i,tab:a,onTab:o,valueActions:s,footer:c,onClose:l})=>(0,$.jsx)(P,{title:e,onClose:l,footer:c,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[n&&(0,$.jsx)(_,{value:a,label:e,options:[{value:`data`,label:B(`tabData`)},{value:`settings`,label:B(`tabSettings`)}],onChange:o}),n&&a===`data`?r===void 0?(0,$.jsxs)(Ne,{title:B(`input`),children:[(0,$.jsx)(h,{value:n.input??null}),s?.(n.input,`input`)]}):(0,$.jsx)(Pe,{run:n,name:r,...i!==void 0&&{block:i},...s&&{valueActions:s}}):t]})}),wt=(e,t)=>e.slice(0,t).split(`
3
+ `).length,Tt=e=>{try{JSON.parse(e);return}catch(t){if(!(t instanceof SyntaxError))throw t;let n=/position (\d+)/.exec(t.message)?.[1],r=/line (\d+)/.exec(t.message)?.[1]??(n===void 0?void 0:wt(e,Number(n)));return r===void 0?B(`notJson`):B(`notJsonLine`,{line:Number(r)})}},Et=e=>JSON.stringify(e??{},null,2),Dt=({view:e,page:t,definition:n,types:r,seed:i,onClose:a})=>{let c=p(),l=w(),{go:u}=s(),d=lt(),f=t.runs.filter(e=>e.input!=null).slice(0,5),[h,g]=(0,Q.useState)(()=>Et(i?i.value:f[0]?.input)),[_,v]=(0,Q.useState)(!1),y=N({resource:`workflow_runs`,feedback:`button`,onCreated:n=>{n&&(a(),u(qe(e.workflow,String(n.id),Number(n.version),e.version===void 0?Number(n.version):t.latest)))}}),b=Tt(h),x=e.version===void 0&&c.dirty,S=e.version??t.latest??0,ee=async()=>{if(v(!1),x&&!await c.save())return v(!0);let t=e.version??Number((await l.get(`workflows`,e.workflow)).record.version);await y.submit({workflow_id:e.workflow,input:JSON.parse(h),version:t})},te=we(n,r);return(0,$.jsx)(P,{title:B(`testRun`),onClose:a,takesFocus:!0,children:(0,$.jsxs)(A,{form:y,fields:[],submit:B(x?`saveAndStart`:`startRun`),disabled:b!==void 0,onSubmit:()=>void ee(),children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i?i.from:f[0]?B(`inputOfRun`,{when:C(Date.parse(String(f[0].created_at)))}):B(`noRunInput`)}),(0,$.jsx)(m,{label:B(`inputJson`),error:b,children:(0,$.jsx)(o,{rows:8,className:`font-mono text-xs`,value:h,invalid:b!==void 0,onChange:e=>g(e.target.value)})}),f.length>0&&(0,$.jsxs)(`div`,{className:`grid gap-1`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:B(`startFromEarlier`)}),f.map(e=>(0,$.jsx)(`button`,{type:`button`,className:`truncate rounded-md px-2 py-1 text-left text-xs hover:bg-muted max-md:min-h-11`,onClick:()=>g(Et(e.input)),children:B(`earlierRun`,{when:C(Date.parse(String(e.created_at))),status:d.label(e.status)})},String(e.id)))]}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:x?B(`savesThenRuns`,{version:S+1}):e.version===void 0?B(`runsLatest`,{version:S}):B(`runsVersion`,{version:S})}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:te.length>0?B(`stepsAct`,{steps:te.map(e=>B(`stepActs`,{name:e.name,kind:e.kind})).join(`, `)}):B(`nothingActs`)}),_&&(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-danger-text`,children:B(`notStarted`)})]})})},Ot=(e,{latest:t,enabled:n})=>B(e===t?e===n?`versionLatestLive`:`versionLatestDraft`:e===n?`versionLive`:`versionNumber`,{version:e}),kt=({page:e,draftOnly:t})=>{let n=p(),r=M()?.size,[i,a]=(0,Q.useState)(),o=(0,Q.useRef)(e.latest);(0,Q.useEffect)(()=>{if(e.latest===o.current)return;let t=o.current===void 0;if(o.current=e.latest,t)return;a(e.latest);let n=setTimeout(()=>a(void 0),At);return()=>clearTimeout(n)},[e.latest]);let s=n.saving?B(`saving`):n.refused?B(`saveRefused`):n.dirty&&t?B(`draftHere`):n.dirty?B(r===`wide`?`unsaved`:`unsavedShort`):i===void 0?void 0:B(`savedAs`,{version:i});return s?(0,$.jsx)(re,{zone:`state`,children:(0,$.jsx)(`span`,{role:`status`,className:`truncate`,children:s})}):null},At=4e3,jt=({view:e,page:t,editable:n,newVersion:a,empty:o,problems:c,missing:u,onAddStep:d,onProblems:f,onRuns:m,onTestRun:h,onPublish:_,onTurnOff:v,runActions:x,orderSwitch:S})=>{let C=p(),{go:w}=s(),T=M()?.size,E=b(),D=l(ee(`workflow_runs`),`create`),{latest:k,enabled:A}=t,j=e.version??k,N=A!==void 0&&A===j,P=(0,Q.useMemo)(()=>j===void 0||t.versions.some(e=>e.version===j)?t.versions:[...t.versions,{version:j,savedAt:``}],[t.versions,j]),F=o?B(`noStepsToRun`):N&&!a?B(`alreadyLive`,{version:j??0}):void 0,L=T===`compact`,ae=D?{name:B(`testRun`),icon:g,onRun:h,inBar:!0,...o&&{blocked:B(`noStepsToRun`)}}:void 0,R={name:B(`publish`),icon:ne,onRun:_,...F&&{blocked:F}},oe=[...ae&&!L?[ae]:[],...L&&C.mayUpdate?[R]:[],...x??[],...A!==void 0&&C.mayUpdate?[{name:B(`turnOff`),icon:te,onRun:v}]:[],...n&&S?[{name:Z(`orderSwitchTitle`,{order:S.to}),icon:$e,onRun:S.onRun,...S.refused!==void 0&&{blocked:Z(`orderSwitchRefused`,{reason:S.refused})}}]:[]];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(re,{zone:`mode`,children:[(0,$.jsx)(i,{tone:A===void 0?`neutral`:`green`,children:A===void 0?B(`off`):B(`live`,{version:A})}),T!==`compact`&&(0,$.jsx)(y,{"aria-label":B(`version`),className:`w-auto`,value:j??``,onChange:t=>w(Ke(e.workflow,Number(t.target.value),k)),children:P.map(({version:e})=>(0,$.jsx)(`option`,{value:e,children:Ot(e,{latest:k,enabled:A})},e))})]}),(0,$.jsxs)(re,{zone:`controls`,children:[n&&E&&(0,$.jsxs)(O,{onClick:d,"aria-label":B(`addStep`),children:[(0,$.jsx)(I,{className:`size-3.5`,"aria-hidden":!0}),T!==`narrow`&&B(`addStep`)]}),(0,$.jsxs)(O,{onClick:m,className:`max-md:min-h-11`,children:[(0,$.jsx)(ie,{className:`size-3.5`,"aria-hidden":!0}),B(`runs`)]}),c>0&&(0,$.jsxs)(O,{onClick:f,className:`text-danger-text`,children:[(0,$.jsx)(Ae,{className:`size-3.5`,"aria-hidden":!0}),B(`problems`,{count:c})]}),u>0&&c===0&&(0,$.jsx)(O,{onClick:f,children:B(`fieldsToFill`,{count:u})})]}),(0,$.jsx)(kt,{page:t,draftOnly:u>0}),(0,$.jsx)(r,{actions:oe}),C.mayUpdate&&!L&&(0,$.jsx)(re,{zone:`primary`,children:(0,$.jsx)(O,{variant:C.dirty?`secondary`:`primary`,"aria-disabled":F!==void 0,title:F,onClick:()=>F===void 0&&_(),children:B(`publish`)})}),L&&ae&&!C.dirty&&!o&&(0,$.jsx)(re,{zone:`primary`,children:(0,$.jsx)(O,{variant:`primary`,className:`min-h-11`,onClick:h,children:B(`testRun`)})})]})},Mt=e=>[`Task`,`Pass`,`Wait`,`Map`,`Block`].includes(e.Type),Nt=e=>{let t=new Set;for(let[,n]of Re(e))for(let e of J(n)){if(t.has(e))return e;t.add(e)}},Pt=e=>(e.Type===`Pass`||e.Type===`Succeed`)&&e.Output===void 0,Ft=(e,t,n)=>{let r=new Set(Object.values(e.States).flatMap(e=>e.Next===void 0?[]:[e.Next]));for(let[i,a]of Object.entries(e.States)){if(Pt(a)&&(t?r.has(i):i!==n))return i;let e=q(a),o=e&&Ft(e,t,t?void 0:Bt(e).StartAt);if(o)return o}},It=e=>{for(let t of Object.keys(e.States)){let n=new Set;for(let r=t;r!==void 0&&e.States[r];r=e.States[r].Next){if(n.has(r))return r;n.add(r)}}for(let t of Object.values(e.States)){let e=q(t),n=e&&It(e);if(n)return n}},Lt=e=>{let t=new Set;for(let n=e.StartAt;n!==void 0&&e.States[n]&&!t.has(n);n=e.States[n].Next)t.add(n);let n=Object.keys(e.States).find(e=>!t.has(e));if(n!==void 0)return n;for(let t of Object.values(e.States)){let e=q(t),n=e&&Lt(e);if(n)return n}},Rt=e=>`{% ${e.map(e=>`$states.context.Steps.${R(e)}.Status = 'SUCCEEDED'`).join(` and `)} %}`,zt=e=>{let t=Fe(e),n=new Map;for(let[r,i]of Object.entries(e.States)){let e=i.Next;e!==void 0&&!t.get(e)?.data.has(r)&&n.set(e,[...n.get(e)??[],r])}let{StartAt:r,...i}=e,a=Object.fromEntries(Object.entries(e.States).map(([e,t])=>{let{Next:r,End:i,...a}=t,o=t.Type===`Succeed`?{...a,Type:`Pass`}:a,s=q(o),c=s?{...o,...o.Type===`Map`?{ItemProcessor:zt(s)}:{Processor:zt(s)}}:o,l=n.get(e);return[e,l?{...c,Condition:Rt(l)}:c]}));return{...i,States:a}},Bt=e=>{let t=Fe(e),n=[],r=new Set(Object.keys(e.States));for(;r.size>0;){let e=[...r].filter(e=>[...Ie(t.get(e))].every(e=>n.includes(e))).sort()[0]??[...r].sort()[0];n.push(e),r.delete(e)}let i=Object.fromEntries(n.map((t,r)=>{let i=e.States[t],a=q(i),o=a?{...i,...i.Type===`Map`?{ItemProcessor:Bt(a)}:{Processor:Bt(a)}}:i;if(!Mt(i))return[t,o];let s=n[r+1];return[t,s===void 0?{...o,End:!0}:{...o,Next:s}]}));return{...e,StartAt:n[0]??``,States:i}},Vt=e=>{let t=Re(e.stateMachine),n=t.find(([,e])=>e.Type===`Choice`);if(n)return{refused:Z(`switchChoice`,{state:n[0]})};let r=t.find(([,e])=>`Catch`in e&&(e.Catch??[]).some(e=>e.Next!==void 0));if(r)return{refused:Z(`switchCatchNext`,{state:r[0]})};let i=Nt(e.stateMachine);if(i!==void 0)return{refused:Z(`switchAssignedTwice`,{variable:i})};let a=Lt(e.stateMachine);if(a!==void 0)return{refused:Z(`switchUnreached`,{state:a})};let o=It(e.stateMachine);if(o!==void 0)return{refused:Z(`switchLoop`,{state:o})};let s=Ft(e.stateMachine,!0);return s===void 0?{definition:{...e,order:`data`,stateMachine:{...zt(e.stateMachine),QueryLanguage:`JSONata`}}}:{refused:Z(`switchPassThroughData`,{state:s})}},Ht=e=>{let t=Re(e.stateMachine),n=t.find(([,e])=>e.Condition!==void 0);if(n)return{refused:Z(`switchCondition`,{state:n[0]})};let r=t.find(([,e])=>`Catch`in e&&(e.Catch??[]).some(e=>e.Next===void 0));if(r)return{refused:Z(`switchCatchNoNext`,{state:r[0]})};let i=Bt(e.stateMachine),a=Ft(e.stateMachine,!1,i.StartAt);return a===void 0?{definition:{...e,order:`sequence`,stateMachine:{...i,QueryLanguage:`JSONata`}}}:{refused:Z(`switchPassThroughSequence`,{state:a})}},Ut=e=>Le(e)===`data`?Ht(e):Vt(e),Wt=new Map,Gt=(e,t)=>{let n=Ut(e),r=Le(e)===`data`?`sequence`:`data`;return`refused`in n?{to:r,refused:n.refused,onRun:()=>{}}:{to:r,onRun:()=>t(n.definition)}},Kt=(e,t)=>{if(t===void 0||t===``)return[];let n=t.split(`/`);return Ve(Y(e,t))?n:n.slice(0,-1)},qt=({view:e,value:t,types:n,onChange:r,layout:i,onLayoutChange:a})=>{let o=p(),u=Ze(e),d=b(),f=(0,Q.useRef)(void 0),m=JSON.stringify(t??null),h=(0,Q.useMemo)(()=>Ue(JSON.parse(m)),[m]),g=(0,Q.useMemo)(()=>u.pastDefinition===void 0?void 0:Ue(u.pastDefinition),[u.pastDefinition]),_=e.version!==void 0&&e.version!==u.latest,v=_?g:h,y=(0,Q.useMemo)(()=>JSON.stringify(Ge(We(o.record))),[o.record]),x=o.dirty&&JSON.stringify(Ge(h))!==y,S=_?u.pastLayout:i,te=_||!r||o.readOnly?void 0:a,w=_||!r?void 0:e=>{let t=f.current;f.current=void 0,t||Ce(void 0),r(t?t(e):e)},T=ye(n),D=(0,Q.useMemo)(()=>ke(v?de(v,n,T):[]),[v,n,T]),k=(0,Q.useMemo)(()=>v?pe(v):Wt,[v]),{address:ne}=s(),A=ne?.kind===`record`?ne.panel:void 0,re=Be(h.stateMachine).length===0,[M,N]=(0,Q.useState)(A===`test_run`?{kind:`test`}:A===`replay`?{kind:`replay`}:re&&d&&r?{kind:`add`}:void 0),[F,ie]=(0,Q.useState)(!1),[I,L]=(0,Q.useState)(),[ae,R]=(0,Q.useState)(`data`),[me,he]=(0,Q.useState)(!1),[ge,z]=(0,Q.useState)(),[Se,Ce]=(0,Q.useState)(),we=l(ee(`workflow_runs`),`create`);(0,Q.useEffect)(()=>{L(void 0),R(`data`),he(!1)},[e.run]),(0,Q.useEffect)(()=>{o.refused&&ie(!0)},[o.refused]);let{trace:V}=u,H=e.run===void 0||!V.run||!V.id?void 0:{...V.run,id:V.id,created_at:String(V.run.created_at)},Ae=(0,Q.useMemo)(()=>{if(!V.definition||!V.place)return;let e=Me(V.steps,{inProgress:V.going,...V.place});return v?new Map([...e].map(([e,t])=>[e,{...t,changed:JSON.stringify(Y(V.definition,e))!==JSON.stringify(Y(v,e))}])):e},[V.definition,V.place,V.steps,V.going,v]),U=Ae&&[...Ae].filter(([,e])=>e.status===`failed`).map(([e])=>e).sort((e,t)=>t.split(`/`).length-e.split(`/`).length)[0],W=v&&(I===``||typeof I==`string`&&Y(v,I))?I:I===void 0&&U!==void 0&&v&&Y(v,U)?U:void 0;if((0,Q.useEffect)(()=>z(void 0),[W]),u.pastError)return(0,$.jsx)(E,{title:B(`versionFailed`),error:u.pastError});if(u.versionsError)return(0,$.jsx)(E,{title:B(`versionsFailed`),error:u.versionsError});if(u.runsError)return(0,$.jsx)(E,{title:B(`runsFailed`),error:u.runsError});if(!v)return(0,$.jsx)(j,{className:`h-full w-full`});let G=()=>N(void 0),K=Kt(v,W),Ne=e=>{let t=se(v,e);if(e.kind===`start`)return t===void 0?B(`addsFirst`):B(`addsBetween`,{step:Z(`trigger`),next:t});let n=X(e.source).name;return t===void 0?e.kind===`rule`?B(`addsRule`,{step:n}):e.kind==="default"?B(`addsOtherwise`,{step:n}):e.kind===`catch`?B(`addsOnError`,{step:n}):B(`addsAfter`,{step:n}):B(`addsBetween`,{step:n,next:t})},Pe=()=>{if(W===``||Be(v.stateMachine).length===0)return B(`addsFirst`);if(K.length>0&&W===K.join(`/`))return B(`addsInside`,{map:X(W).name});let e=le(v,K,W);return e===void 0?B(`addsUnconnected`):B(`addsAfter`,{step:e})},q=(e,t)=>{if(!w)return;let n=ce(v,Z(`newStep`)),r=Z(`newStep`),i=t?De(v,e,n,r,t):W===``?ue(v,e,n,r):oe(v,K,e,n,r,le(v,K,W));w(i),L(ze(t?be(t):K,n)),R(`settings`),G()},J=Be(v.stateMachine).length===0,Fe=[...D.whole,...[...D.byNode.values()].flat()],Ie=J?0:Fe.filter(Ee).length,Le=J?0:Fe.length-Ie,Re=F?D.byNode:Oe(D.byNode),Ve=()=>{if(Ie===0)return!1;ie(!0);let e=[...D.byNode].find(([,e])=>e.some(Ee))?.[0];return e!==void 0&&L(e),R(`settings`),N(void 0),!0},He=V.definition?Be(V.definition.stateMachine).filter(e=>!Be(v.stateMachine).includes(e)).length:0,Ke=H&&C(Date.parse(H.created_at)),qe=(e,t)=>t===`output`||e===void 0||e===V.definition?.stateMachine.StartAt,Je=e=>(t,n)=>(0,$.jsx)(ft,{value:t,...we&&qe(e,n)&&{onUse:()=>N({kind:`test`,seed:{value:t,from:B(n===`output`?`seedOutput`:`seedInput`,{step:e??Z(`trigger`),when:Ke??``})}})}}),Ye=H!==void 0&&!V.going,Xe=(e,t)=>{if(!Ye)return B(`runNotEnded`);if(e===void 0)return;if(V.place&&V.place.within.length>0)return B(`rerunInBlock`);let n=X(t).scope[0];return n===void 0?Y(h,t)?void 0:B(`stepNotInVersion`,{version:u.latest??0}):Y(h,n)?.Type===`Block`?B(`rerunInBlockStep`,{block:n}):B(`rerunInMap`,{map:n})},Qe=e=>{let t=X(e).scope,n=V.place?.within.length??0,r=V.definition??v,i=t.findIndex((e,i)=>i>=n&&Y(r,t.slice(0,i+1).join(`/`))?.Type===`Block`);return i===-1?void 0:t[i]},$e=(e,t)=>{if(!H||!we||e===void 0)return;let n=Xe(e,t);return(0,$.jsx)(O,{variant:`primary`,className:`w-full max-md:min-h-11`,"aria-disabled":n!==void 0,title:n,onClick:()=>n===void 0&&N({kind:`rerun`,step:e}),children:o.dirty?B(`saveAndRerun`):B(`rerunFromStep`)})},tt=()=>{if(W===void 0)return null;let e=W===``?void 0:X(W).name,t=(0,$.jsx)(xe,{definition:v,types:n,selected:W,problems:Re.get(W)??[],warnings:k.get(W)??[],...w&&!o.readOnly&&{onChange:w},onSelect:e=>L(e??null)}),r=H??u.runs.find(e=>e.status===`succeeded`||e.status===`failed`),i=ge?(0,$.jsx)(rt,{definition:v,path:W,target:ge,run:r,onAssign:(e,t,n)=>{Ce({message:`${B(`addedVariable`,{variable:t,step:X(e).name})} ${B(`inThisRun`,{value:n})}`,undo:v}),f.current=t=>Te(t,e).definition},onBack:()=>z(void 0),onTestRun:()=>{z(void 0),N({kind:`test`})}}):(0,$.jsxs)($.Fragment,{children:[Se&&(0,$.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 rounded-md bg-muted px-3 py-2 text-xs`,children:[(0,$.jsx)(`span`,{className:`min-w-0 flex-1`,children:Se.message}),(0,$.jsx)(O,{size:`sm`,onClick:()=>{w?.(Se.undo),Ce(void 0)},children:B(`undo`)})]}),t]});return(0,$.jsx)(Ct,{title:e??Z(`trigger`),tab:H?ae:`settings`,onTab:R,run:H,state:e,block:Qe(W),valueActions:Je(e),footer:$e(e,W),onClose:()=>L(null),settings:i})};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(jt,{view:e,page:u,editable:!!w&&!o.readOnly,newVersion:x,empty:J,problems:Le,missing:Ie,onAddStep:()=>N({kind:`add`}),onProblems:()=>{Ve()||N({kind:`problems`})},onRuns:()=>N({kind:`runs`}),onTestRun:()=>{Ve()||N({kind:`test`})},onPublish:()=>{Ve()||N({kind:`publish`})},onTurnOff:()=>N({kind:`off`}),...w&&!o.readOnly&&{orderSwitch:Gt(v,w)},runActions:H&&[...W!==void 0||me?[{name:B(`runDetails`),icon:c,onRun:()=>{L(null),he(!1)}}]:[]]}),(0,$.jsx)(yt,{view:e,page:u,failed:U&&X(U).name,changed:o.dirty,gone:He,...U!==void 0&&U!==W&&{onOpenFailed:()=>L(U)}}),(0,$.jsx)(`div`,{className:`h-full`,children:(0,$.jsx)(je,{fills:!0,definition:v,problems:H||J?Wt:Re,warnings:H||J?Wt:k,selected:W,onSelect:e=>L(e??null),...w&&!o.readOnly&&{onChange:w,edits:fe,onAddAt:e=>N({kind:`add`,at:e})},...Ae&&H&&{traces:Ae},types:n,schemas:T,layout:S,onLayoutChange:te})}),J&&M===void 0&&(0,$.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-[60%] flex justify-center`,children:(0,$.jsx)(`div`,{className:`pointer-events-auto grid justify-items-center gap-2 rounded-lg border bg-background p-6 text-center shadow-sm`,children:d?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`h2`,{className:`font-semibold`,children:B(`noSteps`)}),(0,$.jsx)(`p`,{className:`text-body text-muted-foreground`,children:B(`noStepsLine`)}),w&&!o.readOnly&&(0,$.jsx)(O,{variant:`primary`,onClick:()=>N({kind:`add`}),children:B(`addStep`)})]}):(0,$.jsx)(`p`,{className:`text-body text-muted-foreground`,children:B(`noStepsMobile`)})})}),M?.kind===`add`&&(0,$.jsx)(et,{types:n,placement:M.at?Ne(M.at):Pe(),onAdd:e=>q(e,M.at),onClose:G}),M?.kind===`test`&&(0,$.jsx)(Dt,{view:e,page:u,definition:v,types:n,seed:M.seed,onClose:G}),M?.kind===`runs`&&(0,$.jsx)(St,{view:e,page:u,onTestRun:()=>N({kind:`test`}),onClose:G}),M?.kind===`publish`&&(0,$.jsx)(_t,{view:e,page:u,definition:v,types:n,newVersion:x,onClose:G}),M?.kind===`off`&&(0,$.jsx)(vt,{view:e,onClose:G}),M?.kind===`problems`&&(0,$.jsx)(P,{title:B(`problemsTitle`),onClose:G,takesFocus:!0,children:(0,$.jsx)(_e,{problems:[...D.whole,...[...D.byNode.values()].flat()]})}),M?.kind===`rerun`&&(0,$.jsx)(st,{view:e,page:u,definition:h,types:n,step:M.step,onStep:e=>N({kind:`rerun`,step:e}),onClose:G}),M?.kind===`replay`&&(0,$.jsx)(ct,{view:e,page:u,onClose:G}),M===void 0&&(0,$.jsx)(ve.Provider,{value:w&&!o.readOnly?z:void 0,children:W===void 0&&H&&!me?(0,$.jsx)(dt,{trace:V,valueActions:Je(void 0),onReplay:Ye&&we?()=>N({kind:`replay`}):void 0,onClose:()=>he(!0)}):tt()})]})};export{qt as WorkflowWorkbench};
4
+ //# debugId=42b048d0-5700-4eb3-ab78-63cdb78065b6
@@ -25,13 +25,13 @@
25
25
  a project's protobase.theme.css included, else those of tokens.css, which index-html.test.ts keeps them equal to.
26
26
  -->
27
27
  <style>html,#pb-start{background:var(--background,#fff);color:var(--muted-foreground,#71717a)}html[data-theme=dark],[data-theme=dark] #pb-start{background:var(--background,#0f0f11);color:var(--muted-foreground,#a1a1aa);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}#pb-start{z-index:2147483647;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}#pb-start svg{animation:1ms .18s backwards pb-start-reveal,1s linear infinite pb-start-spin}@media (prefers-reduced-motion:reduce){#pb-start svg{animation:1ms .18s backwards pb-start-reveal}}@keyframes pb-start-reveal{0%{visibility:hidden}}@keyframes pb-start-spin{to{transform:rotate(360deg)}}#pb-start [role=alert]{text-align:center;flex-direction:column;align-items:center;gap:12px;max-width:20rem;padding:16px;font:14px/1.5 system-ui,sans-serif;display:flex}#pb-start [role=alert][hidden]{display:none}#pb-start button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:1px solid;border-radius:6px;padding:6px 12px}</style>
28
- <script type="importmap">{"imports":{"react":"/assets/shared-react-CFF6wnOE.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-my2ampGl.js","react-dom":"/assets/shared-react-dom-cJzC7U_-.js","@protobase/ui":"/assets/shared-protobase-ui-XTZSVgEm.js"}}</script>
29
- <script type="module" crossorigin src="/assets/index-CYraq2Hi.js"></script>
28
+ <script type="importmap">{"imports":{"react":"/assets/shared-react-CFF6wnOE.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-my2ampGl.js","react-dom":"/assets/shared-react-dom-cJzC7U_-.js","@protobase/ui":"/assets/shared-protobase-ui-gnK6D3Al.js"}}</script>
29
+ <script type="module" crossorigin src="/assets/index-CLyiQa16.js"></script>
30
30
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-DFwUHQ4A.js">
31
31
  <link rel="modulepreload" crossorigin href="/assets/react-CuiNlnus.js">
32
32
  <link rel="modulepreload" crossorigin href="/assets/vendor-t7Q7QbPu.js">
33
- <link rel="modulepreload" crossorigin href="/assets/app-B94YfKGx.js">
34
- <link rel="stylesheet" crossorigin href="/assets/app-xwgcmboV.css">
33
+ <link rel="modulepreload" crossorigin href="/assets/app-DU-Bny4k.js">
34
+ <link rel="stylesheet" crossorigin href="/assets/app-DLkpxjgP.css">
35
35
  <link rel="stylesheet" href="/protobase.theme.css">
36
36
  <link rel="icon" type="image/svg+xml" href="/protobase.favicon.svg">
37
37
  <link rel="apple-touch-icon" href="/protobase.apple-touch-icon.png">
@@ -1,12 +1,12 @@
1
1
  {
2
- "protobase": "0.119.3",
2
+ "protobase": "0.119.5",
3
3
  "pluginApi": 1,
4
4
  "paths": [
5
5
  "/index.html",
6
6
  "/assets",
7
7
  "/protobase.sw.js"
8
8
  ],
9
- "builtAt": 1795245276924,
9
+ "builtAt": 1795252870422,
10
10
  "native": {
11
11
  "@capacitor/android": "8.5.3",
12
12
  "@capacitor/app": "8.1.2",
@@ -1,5 +1,5 @@
1
- const cacheName = "protobase-shell-7c893a2d6d13c584"
2
- const precache = ["/index.html","/assets/shared-react-CFF6wnOE.js","/assets/shared-react-jsx-runtime-my2ampGl.js","/assets/shared-react-dom-cJzC7U_-.js","/assets/shared-protobase-ui-XTZSVgEm.js","/assets/index-CYraq2Hi.js","/assets/rolldown-runtime-DFwUHQ4A.js","/assets/react-CuiNlnus.js","/assets/vendor-t7Q7QbPu.js","/assets/app-B94YfKGx.js","/assets/app-xwgcmboV.css","/protobase.theme.css","/protobase.favicon.svg"]
1
+ const cacheName = "protobase-shell-73b5d82aeaad7248"
2
+ const precache = ["/index.html","/assets/shared-react-CFF6wnOE.js","/assets/shared-react-jsx-runtime-my2ampGl.js","/assets/shared-react-dom-cJzC7U_-.js","/assets/shared-protobase-ui-gnK6D3Al.js","/assets/index-CLyiQa16.js","/assets/rolldown-runtime-DFwUHQ4A.js","/assets/react-CuiNlnus.js","/assets/vendor-t7Q7QbPu.js","/assets/app-DU-Bny4k.js","/assets/app-DLkpxjgP.css","/protobase.theme.css","/protobase.favicon.svg"]
3
3
  const revalidated = ["/protobase.theme.css","/protobase.favicon.svg"]
4
4
 
5
5
  const fromCache = (request) =>
@@ -1 +1 @@
1
- {"version":3,"file":"account-page-d4bA-Rnh.js","names":["n","a","t","__toESM","useAccountPage","accountTabPath","PageTabsProvider","Notice","text","RenderNode","import_jsx_runtime","require_jsx_runtime","AccountPage","page","tab"],"sources":["../../../src/account/account-page.tsx"],"sourcesContent":["import { Notice } from '../app/meta-gate'\nimport { PageTabsProvider } from '../app/pages/page-tabs'\nimport { RenderNode } from '../app/pages/render-node'\nimport { accountTabPath } from './account-pages'\nimport { text } from './messages'\nimport { useAccountPage } from './use-account-page'\n\n/** `/-/account`, and `/-/account/<tab>` for one of its tabs: the signed-in person's account page. */\nexport const AccountPage = ({ tab }: { tab?: string }) => {\n const page = useAccountPage()\n if (!page) return <Notice title={text('noAccount')}>{text('noAccountDescription')}</Notice>\n return (\n <PageTabsProvider route={{ ...(tab && { tab }), pathOf: accountTabPath }}>\n <RenderNode node={page.tree} />\n </PageTabsProvider>\n )\n}\n"],"mappings":"irBAQaY,GAAe,CAAE,SAA4B,CACxD,IAAMC,EAAOT,EAAe,EAE5B,OADKS,GAEH,EAAAH,EAAA,IAAA,CAACJ,EAAD,CAAkB,MAAO,CAAE,GAAIQ,GAAO,CAAE,KAAI,EAAI,OAAQT,CAAe,EACrE,UAAA,EAAAK,EAAA,IAAA,CAACD,EAAD,CAAY,KAAMI,EAAK,IAAO,CAAA,CACd,CAAA,GAJF,EAAAH,EAAA,IAAA,CAACH,EAAD,CAAQ,MAAOC,EAAK,WAAW,EAAI,SAAAA,EAAK,sBAAsB,CAAU,CAAA,CAM5F","debugId":"1de1b03e-4678-4482-a279-b182b7154244"}
1
+ {"version":3,"file":"account-page-ve4BUXRh.js","names":["n","a","t","__toESM","useAccountPage","text","PageTabsProvider","Notice","accountTabPath","RenderNode","import_jsx_runtime","require_jsx_runtime","AccountPage","page","tab"],"sources":["../../../src/account/account-page.tsx"],"sourcesContent":["import { Notice } from '../app/meta-gate'\nimport { PageTabsProvider } from '../app/pages/page-tabs'\nimport { RenderNode } from '../app/pages/render-node'\nimport { accountTabPath } from './account-pages'\nimport { text } from './messages'\nimport { useAccountPage } from './use-account-page'\n\n/** `/-/account`, and `/-/account/<tab>` for one of its tabs: the signed-in person's account page. */\nexport const AccountPage = ({ tab }: { tab?: string }) => {\n const page = useAccountPage()\n if (!page) return <Notice title={text('noAccount')}>{text('noAccountDescription')}</Notice>\n return (\n <PageTabsProvider route={{ ...(tab && { tab }), pathOf: accountTabPath }}>\n <RenderNode node={page.tree} />\n </PageTabsProvider>\n )\n}\n"],"mappings":"irBAQaY,GAAe,CAAE,SAA4B,CACxD,IAAMC,EAAOT,EAAe,EAE5B,OADKS,GAEH,EAAAH,EAAA,IAAA,CAACJ,EAAD,CAAkB,MAAO,CAAE,GAAIQ,GAAO,CAAE,KAAI,EAAI,OAAQN,CAAe,EACrE,UAAA,EAAAE,EAAA,IAAA,CAACD,EAAD,CAAY,KAAMI,EAAK,IAAO,CAAA,CACd,CAAA,GAJF,EAAAH,EAAA,IAAA,CAACH,EAAD,CAAQ,MAAOF,EAAK,WAAW,EAAI,SAAAA,EAAK,sBAAsB,CAAU,CAAA,CAM5F","debugId":"2f7b8054-5d18-47e9-b19a-f828102d7f47"}