@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.8

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 (323) hide show
  1. package/README.md +564 -2
  2. package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
  3. package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
  4. package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
  5. package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
  6. package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
  7. package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
  8. package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
  9. package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
  10. package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
  11. package/dist/DateTimeField-B1qR4ruo.js +51 -0
  12. package/dist/Disclosure-BNKij7-v.js +45 -0
  13. package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
  14. package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
  15. package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
  16. package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
  17. package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
  18. package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
  19. package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
  20. package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
  21. package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
  22. package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
  23. package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
  24. package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
  25. package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
  26. package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
  27. package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
  28. package/dist/FluidGridsMark-CE2blT7K.js +74 -0
  29. package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
  30. package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
  31. package/dist/HistoryPage-BSBISXoj.js +2835 -0
  32. package/dist/Icon-BtQ0HXLh.js +160 -0
  33. package/dist/InsightsPage-D7ybj8N9.js +11245 -0
  34. package/dist/IsolationSetting-vy911E8b.js +1153 -0
  35. package/dist/LibraryParts-DOeNgR8A.js +413 -0
  36. package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
  37. package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
  38. package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
  39. package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
  40. package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
  41. package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
  42. package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
  43. package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
  44. package/dist/NodesPage-O7KeeKtd.js +653 -0
  45. package/dist/OfflineIcon-TwMKYWjA.js +207 -0
  46. package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
  47. package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
  48. package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
  49. package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
  50. package/dist/RunActionsMenu-DodOgIQm.js +59 -0
  51. package/dist/RunnerStatusPill-C1v967iq.js +24 -0
  52. package/dist/RunnersPage-dB0RSdY_.js +1929 -0
  53. package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
  54. package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
  55. package/dist/SearchBox-BGtYjvfs.js +49 -0
  56. package/dist/SequenceEditor-CFiHeHkR.js +497 -0
  57. package/dist/SettingsPage-0CQBNPZV.js +8695 -0
  58. package/dist/StewardPages-DAJhepen.js +47 -0
  59. package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
  60. package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
  61. package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
  62. package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
  63. package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
  64. package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
  65. package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
  66. package/dist/TemplatePreview-cx7-NOeG.js +868 -0
  67. package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
  68. package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
  69. package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
  70. package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
  71. package/dist/TranslationBridge-Da-TPgQm.js +68 -0
  72. package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
  73. package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
  74. package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
  75. package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
  76. package/dist/VariablesPage-ChfGuW22.js +2243 -0
  77. package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
  78. package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
  79. package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
  80. package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
  81. package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
  82. package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
  83. package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
  84. package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
  85. package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
  86. package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
  87. package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
  88. package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
  89. package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
  90. package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
  91. package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
  92. package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
  93. package/dist/WorkflowsList--hR2_8gf.js +4593 -0
  94. package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
  95. package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
  96. package/dist/addonCatalog-CbZS4deh.js +58 -0
  97. package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
  98. package/dist/addons.d.ts +3 -0
  99. package/dist/addons.js +4 -0
  100. package/dist/agent-form-Bfvm32j1.js +83 -0
  101. package/dist/agent-tools.d.ts +3 -0
  102. package/dist/agent-tools.js +5 -0
  103. package/dist/agentTools-CyL7DLOF.js +320 -0
  104. package/dist/ai-usage-BrxDgvdR.js +240 -0
  105. package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
  106. package/dist/api-BKq-nIOZ.js +2286 -0
  107. package/dist/api-Ol7I8NxE.js +8289 -0
  108. package/dist/apollo-type-policies.d.ts +11 -0
  109. package/dist/apollo-type-policies.js +64 -0
  110. package/dist/askAboutBridge-ByYsQams.js +106 -0
  111. package/dist/askQuestions-Cmx7VnMm.js +742 -0
  112. package/dist/assert-rules-lfYEMc99.js +318 -0
  113. package/dist/assistant.d.ts +94 -0
  114. package/dist/assistant.js +99 -0
  115. package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
  116. package/dist/badge-CXfPhoMH.js +26 -0
  117. package/dist/basil.generated-BK-EHbwN.js +10 -0
  118. package/dist/browser-steps-DMpS5TyB.js +533 -0
  119. package/dist/builderTimings-pvGnK1m-.js +510 -0
  120. package/dist/button-DG7y_FVJ.js +48 -0
  121. package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
  122. package/dist/card-Bomy_1UG.js +44 -0
  123. package/dist/catalogGrid-BOrfMgi-.js +41 -0
  124. package/dist/channel-CPyQ1NR1.js +212 -0
  125. package/dist/chips-CvNrYJZa.js +27 -0
  126. package/dist/client-holder-C0M5Cfwl.js +68 -0
  127. package/dist/cn-QqidFIgr.js +10 -0
  128. package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
  129. package/dist/code-editor-field-x_JrY8KR.js +113 -0
  130. package/dist/codec-client-DPuD6mw7.js +515 -0
  131. package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
  132. package/dist/config-DO68jw5k.js +322 -0
  133. package/dist/constants-DgbVc24O.d.ts +296 -0
  134. package/dist/constants-DlRnHBfQ.js +217 -0
  135. package/dist/convert-browser-action-pfecelF7.js +347 -0
  136. package/dist/convert-dialog-B_o22NiJ.js +382 -0
  137. package/dist/create-workflow-first-Azg3JUdX.js +120 -0
  138. package/dist/definition-canvas-Bsda-rDT.js +31 -0
  139. package/dist/dialog-BVd152GS.js +94 -0
  140. package/dist/durable-nodes-BXyYCLxT.js +91 -0
  141. package/dist/duration-CDb7-mT_.js +33 -0
  142. package/dist/edge-mapper-wEAdGVU2.js +4477 -0
  143. package/dist/element-library-DkSlg_VE.js +727 -0
  144. package/dist/entities-I_0kio3q.js +38 -0
  145. package/dist/error-advice-QLr5NCm7.js +65 -0
  146. package/dist/errors-ClKb5sEt.js +188 -0
  147. package/dist/executions.d.ts +3 -0
  148. package/dist/executions.js +5 -0
  149. package/dist/feature-flags-B2qetXKd.js +385 -0
  150. package/dist/field-label-DPZRmE_B.js +153 -0
  151. package/dist/firstWorkflow-C_h0KMB2.js +133 -0
  152. package/dist/flags.d.ts +3 -0
  153. package/dist/flags.js +4 -0
  154. package/dist/flow-builder-DIvLOhz0.js +28038 -0
  155. package/dist/flow-store-holder-CUN7Terz.js +52 -0
  156. package/dist/fluent.generated-CA_e6-4l.js +14 -0
  157. package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
  158. package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
  159. package/dist/global-client-BQPuFrFa.js +433 -0
  160. package/dist/global-operations-BG6YgxrM.js +136 -0
  161. package/dist/graphql-types-UTYtujY9.js +21358 -0
  162. package/dist/history.d.ts +3 -0
  163. package/dist/history.js +4 -0
  164. package/dist/index-AoJAa5vU.d.ts +164958 -0
  165. package/dist/index-DEMT3iAM.d.ts +120 -0
  166. package/dist/index-ROZzNGyY.d.ts +76 -0
  167. package/dist/index.d.ts +20 -0
  168. package/dist/index.js +8123 -0
  169. package/dist/ion.generated-mbajjcAg.js +10 -0
  170. package/dist/label-Lzb8ZXf_.js +29 -0
  171. package/dist/labels-rXd9gYQz.js +1236 -0
  172. package/dist/liveCanvas-D5ytXDp8.js +103 -0
  173. package/dist/logos.generated-X6_0kjVR.js +21 -0
  174. package/dist/logs-panel-Cw0DkG0l.js +468 -0
  175. package/dist/lucide.generated-B6NVd3GT.js +29 -0
  176. package/dist/marksStore-a9oIMMot.js +175 -0
  177. package/dist/mcp-trigger-D0nRdvq5.js +307 -0
  178. package/dist/mdi.generated-D1BV74d6.js +292 -0
  179. package/dist/menus-CU3hDGYl.js +160 -0
  180. package/dist/mynaui.generated-DMWr5cXz.js +66 -0
  181. package/dist/navigation-v2.d.ts +3 -0
  182. package/dist/navigation-v2.js +5 -0
  183. package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
  184. package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
  185. package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
  186. package/dist/node-registry-refresh-s3okf83X.js +27 -0
  187. package/dist/node-role-TMbnkmeP.js +132 -0
  188. package/dist/node-type-icon-BZa8n4iG.js +33 -0
  189. package/dist/nodes.d.ts +3 -0
  190. package/dist/nodes.js +4 -0
  191. package/dist/notesKey-5EaREBGA.js +12 -0
  192. package/dist/observability.d.ts +3 -0
  193. package/dist/observability.js +5 -0
  194. package/dist/offset-pages-zghoClB3.js +55 -0
  195. package/dist/operations-BBmT9ToP.js +663 -0
  196. package/dist/operations-WxRJWeqO.js +3133 -0
  197. package/dist/output-files-Ba8bu5lv.js +196 -0
  198. package/dist/page-operation-DrWuhd6Y.js +129 -0
  199. package/dist/page-twins.d.ts +13 -0
  200. package/dist/page-twins.js +186 -0
  201. package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
  202. package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
  203. package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
  204. package/dist/panels-PfBBAToE.js +346 -0
  205. package/dist/parts-B7fBcw-B.js +346 -0
  206. package/dist/popover-Dms9Vz3j.js +3389 -0
  207. package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
  208. package/dist/proactive.d.ts +66 -0
  209. package/dist/proactive.js +237 -0
  210. package/dist/quick-config-panel-DFd77xho.js +451 -0
  211. package/dist/quota-DeA_CJ2e.js +175 -0
  212. package/dist/quota.d.ts +3 -0
  213. package/dist/quota.js +4 -0
  214. package/dist/read-only-context-Dt9N9SIG.js +18 -0
  215. package/dist/relative-time-Dxt8ZIIu.js +55 -0
  216. package/dist/results-CwK_yDxK.js +325 -0
  217. package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
  218. package/dist/route-data.d.ts +12 -0
  219. package/dist/route-data.js +69 -0
  220. package/dist/route-match-C-0_EnAt.d.ts +5 -0
  221. package/dist/route-match-DMkUICYV.js +41 -0
  222. package/dist/route-preload-C4DlGoCd.js +120 -0
  223. package/dist/run-display-UjLAoYqQ.js +81 -0
  224. package/dist/run-history-arGiHzGU.js +285 -0
  225. package/dist/run-list-links-DJn4Mf1T.js +98 -0
  226. package/dist/run-mode-USmM0-Uo.js +82 -0
  227. package/dist/run-parity-CWXqEJqM.js +144 -0
  228. package/dist/runsQuota-B6SyTbne.js +100 -0
  229. package/dist/runsQuota-DsniKiSg.d.ts +20 -0
  230. package/dist/safe-expression-Cw7-SCsm.js +1251 -0
  231. package/dist/save-status-store-C7nEYpfb.js +631 -0
  232. package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
  233. package/dist/schedule-rules-ggVKRkBH.js +358 -0
  234. package/dist/secrets-Re_wSiE3.js +153 -0
  235. package/dist/settings.d.ts +4 -0
  236. package/dist/settings.js +6 -0
  237. package/dist/shared-DAWGGMSM.js +177 -0
  238. package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
  239. package/dist/solar.generated-CGYuUQAC.js +10 -0
  240. package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
  241. package/dist/start-url-CT6Yz96K.js +24 -0
  242. package/dist/status-CessxGpm.js +55 -0
  243. package/dist/store-icon-OctYp5zP.js +155 -0
  244. package/dist/styles-WGmTnZ2n.js +26 -0
  245. package/dist/styles.css +139 -0
  246. package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
  247. package/dist/template-code-CzN6JWNV.js +191 -0
  248. package/dist/template-graph-DLF9dygU.js +20 -0
  249. package/dist/template-preview-DcIIKOOL.js +32 -0
  250. package/dist/template-price-CdUHZRMF.js +40 -0
  251. package/dist/templates.d.ts +3 -0
  252. package/dist/templates.js +5 -0
  253. package/dist/theme-provider-CntfC4_i.js +23 -0
  254. package/dist/transient-DgZfhDfN.js +57 -0
  255. package/dist/typed-calls-C5tO03wq.js +26 -0
  256. package/dist/ui-script-By74Guk3.js +1094 -0
  257. package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
  258. package/dist/ui-step-fix-8uM2_Hft.js +67 -0
  259. package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
  260. package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
  261. package/dist/ui-target-editor-D2JhB_lD.js +673 -0
  262. package/dist/uiMarkTools-CSznnO1i.js +1054 -0
  263. package/dist/upgradePrompt-BAFBKKW5.js +72 -0
  264. package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
  265. package/dist/use-browser-available-hj8wc3Kb.js +241 -0
  266. package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
  267. package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
  268. package/dist/use-mobile-BTqCUjzS.js +27 -0
  269. package/dist/use-sdk-query-C697xZVv.js +116 -0
  270. package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
  271. package/dist/useActionParam-B2tU2BlY.js +85 -0
  272. package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
  273. package/dist/useBrowserClients-3v95-gSh.js +103 -0
  274. package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
  275. package/dist/useConnections-DsgEJs05.js +439 -0
  276. package/dist/useDebouncedValue-BFekcv6n.js +18 -0
  277. package/dist/useDurableParity-8fnMZmBc.js +1787 -0
  278. package/dist/useEntityTags-D0spL6Ut.js +460 -0
  279. package/dist/useExecutions-2u5nGJJk.js +681 -0
  280. package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
  281. package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
  282. package/dist/useHumanRequests-zlYDp3l1.js +221 -0
  283. package/dist/useNavigationV2-C2WeqN7d.js +29 -0
  284. package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
  285. package/dist/useObservability-BRlQ0tOA.js +285 -0
  286. package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
  287. package/dist/useRunHistory-CXCMUPyf.js +2759 -0
  288. package/dist/useRunLive-D0JvVZT2.js +1060 -0
  289. package/dist/useRunnerList-Dbi59i1K.js +446 -0
  290. package/dist/useRunners-URUc5quU.js +173 -0
  291. package/dist/useRunsPage-DG656UCK.js +2709 -0
  292. package/dist/useVariables-BIelxcWr.js +463 -0
  293. package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
  294. package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
  295. package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
  296. package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
  297. package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
  298. package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
  299. package/dist/utils-fvBb5qOD.js +89 -0
  300. package/dist/webhook-deliveries-AvQujaZy.js +99 -0
  301. package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
  302. package/dist/workflow-builder.d.ts +3 -0
  303. package/dist/workflow-builder.js +8 -0
  304. package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
  305. package/dist/workflow-embed.d.ts +3 -0
  306. package/dist/workflow-embed.js +4 -0
  307. package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
  308. package/dist/workflow-host.d.ts +6 -0
  309. package/dist/workflow-host.js +11 -0
  310. package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
  311. package/dist/workflow-pages.d.ts +3 -0
  312. package/dist/workflow-pages.js +115 -0
  313. package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
  314. package/dist/workflow-preview.d.ts +65 -0
  315. package/dist/workflow-preview.js +4 -0
  316. package/dist/workflow-route.d.ts +33 -0
  317. package/dist/workflow-route.js +4 -0
  318. package/dist/workflow-save-state-D0l-DkLf.js +767 -0
  319. package/dist/workflow-transfer-CQnQC-ke.js +104 -0
  320. package/dist/workflowRouteData-BkfVOc-O.js +169 -0
  321. package/dist/workflows-list.d.ts +10 -0
  322. package/dist/workflows-list.js +5 -0
  323. package/package.json +320 -4
@@ -0,0 +1,1702 @@
1
+ "use client";
2
+ import { t as __exportAll } from "./rolldown-runtime-hDbaFkMy.js";
3
+ import { t as focusDialogOnOpen } from "./stableTabbedDialog-BBhrfXGe.js";
4
+ import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
5
+ import { n as getFluidGridsClient } from "./client-holder-C0M5Cfwl.js";
6
+ import { s as throwIfResultError, t as describeOperationError } from "./errors-ClKb5sEt.js";
7
+ import { t as WorkflowDefinitionDocument } from "./WorkflowDefinitionDocument-DZLbTPUZ.js";
8
+ import { t as canvasFromDefinition } from "./definition-canvas-Bsda-rDT.js";
9
+ import { a as lifecycleStageLabel, c as lifecycleStageOf, i as diffStatusLabel, n as DIFF_EDGE_STROKE, o as plainDiffStatusLabel, r as DIFF_STATUS_CLASSES, s as countLifecycle, t as VersionLifecycleBar } from "./VersionLifecycleBar-BBeWVtz-.js";
10
+ import { n as humanizeFieldName } from "./field-label-DPZRmE_B.js";
11
+ import { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
12
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
13
+ import { Background, Controls, Handle, MiniMap, Position, ReactFlow, ReactFlowProvider } from "@xyflow/react";
14
+ import "@xyflow/react/dist/style.css";
15
+ import { ArrowLeftRight, Braces, Eye, RotateCcw, Workflow } from "lucide-react";
16
+ import { cn } from "@burdenoff/fe-libs/utils";
17
+ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, Badge, Button, Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, ShowTechnicalDetails, SpinnerIcon, TabbedDialog, TabbedDialogContent, TabbedDialogHeader, TabbedDialogTabs, Tabs, TabsContent, TabsList, TabsTrigger, ThemedSelect, useStableTabbedDialogs } from "@burdenoff/fe-libs/ui";
18
+
19
+ // src/generated/documents/wspace/WorkflowVersionDiffDocument.ts
20
+ const WorkflowVersionDiffDocument = {
21
+ "kind": "Document",
22
+ "definitions": [{
23
+ "kind": "OperationDefinition",
24
+ "operation": "query",
25
+ "name": {
26
+ "kind": "Name",
27
+ "value": "WorkflowVersionDiff"
28
+ },
29
+ "variableDefinitions": [
30
+ {
31
+ "kind": "VariableDefinition",
32
+ "variable": {
33
+ "kind": "Variable",
34
+ "name": {
35
+ "kind": "Name",
36
+ "value": "workflowKey"
37
+ }
38
+ },
39
+ "type": {
40
+ "kind": "NonNullType",
41
+ "type": {
42
+ "kind": "NamedType",
43
+ "name": {
44
+ "kind": "Name",
45
+ "value": "String"
46
+ }
47
+ }
48
+ },
49
+ "directives": []
50
+ },
51
+ {
52
+ "kind": "VariableDefinition",
53
+ "variable": {
54
+ "kind": "Variable",
55
+ "name": {
56
+ "kind": "Name",
57
+ "value": "fromVersion"
58
+ }
59
+ },
60
+ "type": {
61
+ "kind": "NonNullType",
62
+ "type": {
63
+ "kind": "NamedType",
64
+ "name": {
65
+ "kind": "Name",
66
+ "value": "String"
67
+ }
68
+ }
69
+ },
70
+ "directives": []
71
+ },
72
+ {
73
+ "kind": "VariableDefinition",
74
+ "variable": {
75
+ "kind": "Variable",
76
+ "name": {
77
+ "kind": "Name",
78
+ "value": "toVersion"
79
+ }
80
+ },
81
+ "type": {
82
+ "kind": "NonNullType",
83
+ "type": {
84
+ "kind": "NamedType",
85
+ "name": {
86
+ "kind": "Name",
87
+ "value": "String"
88
+ }
89
+ }
90
+ },
91
+ "directives": []
92
+ }
93
+ ],
94
+ "directives": [],
95
+ "selectionSet": {
96
+ "kind": "SelectionSet",
97
+ "selections": [{
98
+ "kind": "Field",
99
+ "name": {
100
+ "kind": "Name",
101
+ "value": "workflowVersionDiff"
102
+ },
103
+ "arguments": [
104
+ {
105
+ "kind": "Argument",
106
+ "name": {
107
+ "kind": "Name",
108
+ "value": "workflowKey"
109
+ },
110
+ "value": {
111
+ "kind": "Variable",
112
+ "name": {
113
+ "kind": "Name",
114
+ "value": "workflowKey"
115
+ }
116
+ }
117
+ },
118
+ {
119
+ "kind": "Argument",
120
+ "name": {
121
+ "kind": "Name",
122
+ "value": "fromVersion"
123
+ },
124
+ "value": {
125
+ "kind": "Variable",
126
+ "name": {
127
+ "kind": "Name",
128
+ "value": "fromVersion"
129
+ }
130
+ }
131
+ },
132
+ {
133
+ "kind": "Argument",
134
+ "name": {
135
+ "kind": "Name",
136
+ "value": "toVersion"
137
+ },
138
+ "value": {
139
+ "kind": "Variable",
140
+ "name": {
141
+ "kind": "Name",
142
+ "value": "toVersion"
143
+ }
144
+ }
145
+ }
146
+ ],
147
+ "directives": [],
148
+ "selectionSet": {
149
+ "kind": "SelectionSet",
150
+ "selections": [
151
+ {
152
+ "kind": "Field",
153
+ "name": {
154
+ "kind": "Name",
155
+ "value": "workflowKey"
156
+ },
157
+ "arguments": [],
158
+ "directives": []
159
+ },
160
+ {
161
+ "kind": "Field",
162
+ "name": {
163
+ "kind": "Name",
164
+ "value": "fromVersion"
165
+ },
166
+ "arguments": [],
167
+ "directives": []
168
+ },
169
+ {
170
+ "kind": "Field",
171
+ "name": {
172
+ "kind": "Name",
173
+ "value": "toVersion"
174
+ },
175
+ "arguments": [],
176
+ "directives": []
177
+ },
178
+ {
179
+ "kind": "Field",
180
+ "name": {
181
+ "kind": "Name",
182
+ "value": "truncated"
183
+ },
184
+ "arguments": [],
185
+ "directives": []
186
+ },
187
+ {
188
+ "kind": "Field",
189
+ "name": {
190
+ "kind": "Name",
191
+ "value": "entries"
192
+ },
193
+ "arguments": [],
194
+ "directives": [],
195
+ "selectionSet": {
196
+ "kind": "SelectionSet",
197
+ "selections": [
198
+ {
199
+ "kind": "Field",
200
+ "name": {
201
+ "kind": "Name",
202
+ "value": "path"
203
+ },
204
+ "arguments": [],
205
+ "directives": []
206
+ },
207
+ {
208
+ "kind": "Field",
209
+ "name": {
210
+ "kind": "Name",
211
+ "value": "kind"
212
+ },
213
+ "arguments": [],
214
+ "directives": []
215
+ },
216
+ {
217
+ "kind": "Field",
218
+ "name": {
219
+ "kind": "Name",
220
+ "value": "before"
221
+ },
222
+ "arguments": [],
223
+ "directives": []
224
+ },
225
+ {
226
+ "kind": "Field",
227
+ "name": {
228
+ "kind": "Name",
229
+ "value": "after"
230
+ },
231
+ "arguments": [],
232
+ "directives": []
233
+ }
234
+ ]
235
+ }
236
+ }
237
+ ]
238
+ }
239
+ }]
240
+ }
241
+ }]
242
+ };
243
+
244
+ // src/modules/history/utils/version-graph-diff.ts
245
+ /** Node keys that only describe how the canvas is drawn, never what runs. */
246
+ const LAYOUT_NODE_KEYS = /* @__PURE__ */ new Set([
247
+ "position",
248
+ "positionAbsolute",
249
+ "selected",
250
+ "dragging",
251
+ "measured",
252
+ "width",
253
+ "height",
254
+ "zIndex",
255
+ "resizing",
256
+ "style",
257
+ "className"
258
+ ]);
259
+ /** Edge keys that only describe how the canvas is drawn, or the edge's own generated id. */
260
+ const LAYOUT_EDGE_KEYS = /* @__PURE__ */ new Set([
261
+ "id",
262
+ "selected",
263
+ "animated",
264
+ "style",
265
+ "className",
266
+ "zIndex",
267
+ "interactionWidth",
268
+ "markerEnd",
269
+ "markerStart"
270
+ ]);
271
+ /**
272
+ * The footprint of one diff card on the merged canvas (the card is 200px wide
273
+ * and roughly 70px tall), plus breathing room. A removed node whose old
274
+ * position falls inside another card's footprint is moved below it so both
275
+ * stay visible and clickable.
276
+ */
277
+ const DIFF_CARD_FOOTPRINT = {
278
+ width: 220,
279
+ height: 90
280
+ };
281
+ /** How many changed paths one node reports; deeper detail lives in the JSON view. */
282
+ const MAX_CHANGED_FIELDS = 20;
283
+ function isRecord$1(value) {
284
+ return typeof value === "object" && value !== null && !Array.isArray(value);
285
+ }
286
+ function equalJson(left, right) {
287
+ if (Object.is(left, right)) return true;
288
+ if (Array.isArray(left) && Array.isArray(right)) return left.length === right.length && left.every((value, index) => equalJson(value, right[index]));
289
+ if (isRecord$1(left) && isRecord$1(right)) {
290
+ const leftKeys = Object.keys(left).filter((k) => left[k] !== void 0);
291
+ const rightKeys = Object.keys(right).filter((k) => right[k] !== void 0);
292
+ if (leftKeys.length !== rightKeys.length) return false;
293
+ return leftKeys.every((key) => key in right && equalJson(left[key], right[key]));
294
+ }
295
+ return false;
296
+ }
297
+ /** Dotted paths at which two values differ, depth-first, capped. */
298
+ function changedPaths(before, after, prefix = "", limit = 20) {
299
+ const paths = [];
300
+ const visit = (left, right, path) => {
301
+ if (paths.length >= limit || equalJson(left, right)) return;
302
+ if (isRecord$1(left) && isRecord$1(right)) {
303
+ const keys = [.../* @__PURE__ */ new Set([...Object.keys(left), ...Object.keys(right)])].sort((a, b) => a.localeCompare(b));
304
+ for (const key of keys) {
305
+ visit(left[key], right[key], path ? `${path}.${key}` : key);
306
+ if (paths.length >= limit) return;
307
+ }
308
+ return;
309
+ }
310
+ paths.push(path || "(value)");
311
+ };
312
+ visit(before, after, prefix);
313
+ return paths;
314
+ }
315
+ function withoutKeys(value, keys) {
316
+ const out = {};
317
+ for (const [key, entry] of Object.entries(value)) if (!keys.has(key)) out[key] = entry;
318
+ return out;
319
+ }
320
+ function text(value) {
321
+ return typeof value === "string" && value.trim() ? value.trim() : null;
322
+ }
323
+ /** The name a person sees on the canvas for a node. */
324
+ function nodeLabel(node) {
325
+ const data = isRecord$1(node.data) ? node.data : {};
326
+ return text(data.label) ?? text(data.name) ?? text(data.title) ?? String(node.id);
327
+ }
328
+ /** The node's block type (`internal:if`, `trigger:api`, a store node key, …). */
329
+ function nodeTypeOf(node) {
330
+ const data = isRecord$1(node.data) ? node.data : {};
331
+ return text(data.nodeType) ?? text(data.type) ?? text(node.type) ?? "node";
332
+ }
333
+ function positionOf(node) {
334
+ const position = node?.position;
335
+ if (position && typeof position.x === "number" && Number.isFinite(position.x) && typeof position.y === "number" && Number.isFinite(position.y)) return {
336
+ x: position.x,
337
+ y: position.y
338
+ };
339
+ return {
340
+ x: 0,
341
+ y: 0
342
+ };
343
+ }
344
+ function overlaps(a, b) {
345
+ return Math.abs(a.x - b.x) < DIFF_CARD_FOOTPRINT.width && Math.abs(a.y - b.y) < DIFF_CARD_FOOTPRINT.height;
346
+ }
347
+ /**
348
+ * The first spot at or below `position` whose card footprint overlaps none of
349
+ * `taken`. Moving straight down keeps a removed node next to the column it
350
+ * came from; the bound keeps a pathological canvas from looping for long.
351
+ */
352
+ function clearOf(position, taken) {
353
+ let candidate = position;
354
+ for (let attempt = 0; attempt <= taken.length; attempt += 1) {
355
+ const blocker = taken.find((spot) => overlaps(candidate, spot));
356
+ if (!blocker) return candidate;
357
+ candidate = {
358
+ x: candidate.x,
359
+ y: blocker.y + DIFF_CARD_FOOTPRINT.height
360
+ };
361
+ }
362
+ return candidate;
363
+ }
364
+ function handle(value) {
365
+ return typeof value === "string" && value.length > 0 ? value : null;
366
+ }
367
+ /**
368
+ * Edges are matched by what they connect, not by their id: the builder mints
369
+ * a new id when a connection is redrawn, which is not a change a reviewer
370
+ * cares about.
371
+ */
372
+ function edgeSignature(edge) {
373
+ return [
374
+ edge.source,
375
+ handle(edge.sourceHandle) ?? "",
376
+ edge.target,
377
+ handle(edge.targetHandle) ?? ""
378
+ ].join("|");
379
+ }
380
+ function edgeLabel(edge) {
381
+ if (typeof edge.label === "string" && edge.label.trim()) return edge.label.trim();
382
+ return text((isRecord$1(edge.data) ? edge.data : {}).label);
383
+ }
384
+ function emptyCounts() {
385
+ return {
386
+ added: 0,
387
+ removed: 0,
388
+ modified: 0,
389
+ unchanged: 0
390
+ };
391
+ }
392
+ /**
393
+ * Compare two canvases. `null` stands for a version without a canvas (a
394
+ * code-first workflow, or an unreadable definition) and compares as empty.
395
+ */
396
+ function diffWorkflowGraphs(from, to) {
397
+ const fromNodes = new Map((from?.nodes ?? []).map((n) => [String(n.id), n]));
398
+ const toNodes = new Map((to?.nodes ?? []).map((n) => [String(n.id), n]));
399
+ const nodes = [];
400
+ const nodeCounts = emptyCounts();
401
+ for (const [id, after] of toNodes) {
402
+ const before = fromNodes.get(id);
403
+ const afterPosition = positionOf(after);
404
+ if (!before) {
405
+ nodes.push({
406
+ id,
407
+ status: "added",
408
+ label: nodeLabel(after),
409
+ nodeType: nodeTypeOf(after),
410
+ position: afterPosition,
411
+ changedFields: [],
412
+ moved: false
413
+ });
414
+ nodeCounts.added += 1;
415
+ continue;
416
+ }
417
+ const fields = changedPaths(withoutKeys(before, LAYOUT_NODE_KEYS), withoutKeys(after, LAYOUT_NODE_KEYS));
418
+ const beforePosition = positionOf(before);
419
+ const status = fields.length ? "modified" : "unchanged";
420
+ nodes.push({
421
+ id,
422
+ status,
423
+ label: nodeLabel(after),
424
+ nodeType: nodeTypeOf(after),
425
+ position: afterPosition,
426
+ changedFields: fields,
427
+ moved: beforePosition.x !== afterPosition.x || beforePosition.y !== afterPosition.y
428
+ });
429
+ nodeCounts[status] += 1;
430
+ }
431
+ const placed = nodes.map((node) => node.position);
432
+ for (const [id, before] of fromNodes) {
433
+ if (toNodes.has(id)) continue;
434
+ const position = clearOf(positionOf(before), placed);
435
+ placed.push(position);
436
+ nodes.push({
437
+ id,
438
+ status: "removed",
439
+ label: nodeLabel(before),
440
+ nodeType: nodeTypeOf(before),
441
+ position,
442
+ changedFields: [],
443
+ moved: false
444
+ });
445
+ nodeCounts.removed += 1;
446
+ }
447
+ const firstBySignature = (list) => {
448
+ const bySignature = /* @__PURE__ */ new Map();
449
+ for (const edge of list) {
450
+ const signature = edgeSignature(edge);
451
+ if (!bySignature.has(signature)) bySignature.set(signature, edge);
452
+ }
453
+ return bySignature;
454
+ };
455
+ const fromEdges = firstBySignature(from?.edges ?? []);
456
+ const toEdges = firstBySignature(to?.edges ?? []);
457
+ const edges = [];
458
+ const edgeCounts = emptyCounts();
459
+ const pushEdge = (edge, status) => {
460
+ edges.push({
461
+ id: edgeSignature(edge),
462
+ status,
463
+ source: String(edge.source),
464
+ target: String(edge.target),
465
+ sourceHandle: handle(edge.sourceHandle),
466
+ targetHandle: handle(edge.targetHandle),
467
+ label: edgeLabel(edge)
468
+ });
469
+ edgeCounts[status] += 1;
470
+ };
471
+ for (const [signature, after] of toEdges) {
472
+ const before = fromEdges.get(signature);
473
+ if (!before) {
474
+ pushEdge(after, "added");
475
+ continue;
476
+ }
477
+ pushEdge(after, equalJson(withoutKeys(before, LAYOUT_EDGE_KEYS), withoutKeys(after, LAYOUT_EDGE_KEYS)) ? "unchanged" : "modified");
478
+ }
479
+ for (const [signature, before] of fromEdges) if (!toEdges.has(signature)) pushEdge(before, "removed");
480
+ return {
481
+ nodes,
482
+ edges,
483
+ nodeCounts,
484
+ edgeCounts,
485
+ identical: nodeCounts.added + nodeCounts.removed + nodeCounts.modified + edgeCounts.added + edgeCounts.removed + edgeCounts.modified === 0
486
+ };
487
+ }
488
+
489
+ // src/modules/history/hooks/useVersionComparison.ts
490
+ /**
491
+ * Loads what the version diff view shows for two versions of one workflow
492
+ * (BOFF-4074): both definitions (the graph view draws them) and the service's
493
+ * `workflowVersionDiff` (the JSON change list: computed server-side, with
494
+ * secrets masked and code-first versions compared on their normalised IR).
495
+ *
496
+ * The definitions are required; the server diff is not. When only the diff
497
+ * call fails, the graph and the side-by-side JSON still render and the change
498
+ * list says why it is missing.
499
+ */
500
+ async function fetchDefinition(client, workflowKey, version) {
501
+ const definition = throwIfResultError(await client.query({
502
+ query: WorkflowDefinitionDocument,
503
+ variables: {
504
+ workflowKey,
505
+ version
506
+ },
507
+ fetchPolicy: "network-only"
508
+ })).data?.workflowDefinition;
509
+ if (!definition) throw new Error(`Version ${version} was not found`);
510
+ return definition;
511
+ }
512
+ async function fetchServerDiff(client, workflowKey, fromVersion, toVersion) {
513
+ const diff = throwIfResultError(await client.query({
514
+ query: WorkflowVersionDiffDocument,
515
+ variables: {
516
+ workflowKey,
517
+ fromVersion,
518
+ toVersion
519
+ },
520
+ fetchPolicy: "network-only"
521
+ })).data?.workflowVersionDiff;
522
+ if (!diff) throw new Error("The service returned no diff");
523
+ return diff;
524
+ }
525
+ /** Fetch both versions and the service diff; exported for tests. */
526
+ async function loadVersionComparison(client, workflowKey, fromVersion, toVersion) {
527
+ const [from, to, diff] = await Promise.all([
528
+ fetchDefinition(client, workflowKey, fromVersion),
529
+ fetchDefinition(client, workflowKey, toVersion),
530
+ fetchServerDiff(client, workflowKey, fromVersion, toVersion).then((value) => ({
531
+ value,
532
+ error: null
533
+ }), (error) => ({
534
+ value: null,
535
+ error: describeOperationError(error, "Failed to load the change list")
536
+ }))
537
+ ]);
538
+ const fromCanvas = canvasFromDefinition(from.definitionJson);
539
+ const toCanvas = canvasFromDefinition(to.definitionJson);
540
+ return {
541
+ workflowKey,
542
+ fromVersion,
543
+ toVersion,
544
+ from,
545
+ to,
546
+ fromCanvas,
547
+ toCanvas,
548
+ graph: diffWorkflowGraphs(fromCanvas, toCanvas),
549
+ serverDiff: diff.value,
550
+ serverDiffError: diff.error
551
+ };
552
+ }
553
+ /**
554
+ * Compare `fromVersion` with `toVersion` whenever both are set and differ.
555
+ * A newer request supersedes an older one still in flight.
556
+ */
557
+ function useVersionComparison(workflowKey, fromVersion, toVersion) {
558
+ const [comparison, setComparison] = useState(null);
559
+ const [loading, setLoading] = useState(false);
560
+ const [error, setError] = useState(null);
561
+ const [nonce, setNonce] = useState(0);
562
+ const requestId = useRef(0);
563
+ useEffect(() => {
564
+ if (!workflowKey || !fromVersion || !toVersion || fromVersion === toVersion) {
565
+ setComparison(null);
566
+ setError(null);
567
+ setLoading(false);
568
+ return;
569
+ }
570
+ const id = ++requestId.current;
571
+ setLoading(true);
572
+ setError(null);
573
+ loadVersionComparison(getFluidGridsClient(), workflowKey, fromVersion, toVersion).then((result) => {
574
+ if (id === requestId.current) setComparison(result);
575
+ }).catch((err) => {
576
+ if (id !== requestId.current) return;
577
+ setComparison(null);
578
+ setError(describeOperationError(err, "Failed to compare versions"));
579
+ }).finally(() => {
580
+ if (id === requestId.current) setLoading(false);
581
+ });
582
+ }, [
583
+ workflowKey,
584
+ fromVersion,
585
+ toVersion,
586
+ nonce
587
+ ]);
588
+ const reload = useCallback(() => setNonce((n) => n + 1), []);
589
+ return {
590
+ comparison: comparison && comparison.workflowKey === workflowKey && comparison.fromVersion === fromVersion && comparison.toVersion === toVersion ? comparison : null,
591
+ loading,
592
+ error,
593
+ reload
594
+ };
595
+ }
596
+
597
+ // src/modules/history/components/diff-flow.ts
598
+ /** The builder's names for a node's single default output and input. */
599
+ const DEFAULT_HANDLES = /* @__PURE__ */ new Set(["source", "target"]);
600
+ function namedHandle(value) {
601
+ return value && !DEFAULT_HANDLES.has(value) ? value : null;
602
+ }
603
+ /**
604
+ * The handle part of a connection's caption, e.g. `true` or `true → input`.
605
+ * Default handles are left out so a plain connection stays uncaptioned.
606
+ */
607
+ function handleCaption(edge) {
608
+ const source = namedHandle(edge.sourceHandle);
609
+ const target = namedHandle(edge.targetHandle);
610
+ if (source && target) return `${source} → ${target}`;
611
+ return source ?? (target ? `→ ${target}` : null);
612
+ }
613
+ /** What the canvas writes on a connection: its label and the handles it uses. */
614
+ function edgeCaption(edge) {
615
+ const handles = handleCaption(edge);
616
+ if (edge.label && handles) return `${edge.label} (${handles})`;
617
+ return edge.label ?? handles ?? void 0;
618
+ }
619
+ /** React Flow nodes and edges for a diff. */
620
+ function toFlowElements(graph) {
621
+ const known = new Set(graph.nodes.map((node) => node.id));
622
+ return {
623
+ nodes: graph.nodes.map((node) => ({
624
+ id: node.id,
625
+ type: "diff",
626
+ position: node.position,
627
+ data: { diff: node },
628
+ draggable: false,
629
+ connectable: false
630
+ })),
631
+ edges: graph.edges.filter((edge) => known.has(edge.source) && known.has(edge.target)).map((edge) => ({
632
+ id: edge.id,
633
+ source: edge.source,
634
+ target: edge.target,
635
+ type: edge.status === "removed" ? "smoothstep" : void 0,
636
+ label: edgeCaption(edge),
637
+ animated: edge.status === "added",
638
+ focusable: false,
639
+ data: { status: edge.status },
640
+ style: {
641
+ stroke: DIFF_EDGE_STROKE[edge.status],
642
+ strokeWidth: edge.status === "unchanged" ? 1.5 : 2.5,
643
+ strokeDasharray: edge.status === "removed" ? "6 4" : void 0
644
+ }
645
+ }))
646
+ };
647
+ }
648
+
649
+ // src/modules/history/utils/plain-changes.ts
650
+ function summarizeGraphDiff(graph) {
651
+ return {
652
+ added: graph.nodeCounts.added,
653
+ changed: graph.nodeCounts.modified,
654
+ removed: graph.nodeCounts.removed,
655
+ moved: graph.nodes.filter((node) => node.status === "unchanged" && node.moved).length,
656
+ connections: graph.edgeCounts.added + graph.edgeCounts.removed + graph.edgeCounts.modified,
657
+ identical: graph.identical
658
+ };
659
+ }
660
+ /** Path segments that only group a step's settings; left out of the field's name. */
661
+ const GROUP_SEGMENTS = /* @__PURE__ */ new Set([
662
+ "data",
663
+ "config",
664
+ "parameters",
665
+ "params",
666
+ "settings",
667
+ "inputs"
668
+ ]);
669
+ /** The longest value shown before it is cut with "…". */
670
+ const MAX_VALUE_LENGTH = 160;
671
+ /**
672
+ * A changed setting's path in words: "data.config.replyTo" → "Reply To",
673
+ * "data.config.headers.Authorization" → "Headers › Authorization".
674
+ */
675
+ function describeFieldPath(path) {
676
+ const segments = path.split(".").filter(Boolean);
677
+ return segments.filter((segment, index) => index === segments.length - 1 || !GROUP_SEGMENTS.has(segment)).slice(-2).map(humanizeFieldName).join(" › ");
678
+ }
679
+ /** A value on one line, shortened; null when there is none to show. */
680
+ function formatPlainValue(value) {
681
+ if (value === void 0 || value === null) return null;
682
+ let text;
683
+ if (typeof value === "string") text = value;
684
+ else if (typeof value === "number" || typeof value === "boolean") text = String(value);
685
+ else try {
686
+ text = JSON.stringify(value) ?? String(value);
687
+ } catch {
688
+ text = String(value);
689
+ }
690
+ text = text.replace(/\s+/g, " ").trim();
691
+ if (!text) return null;
692
+ return text.length > MAX_VALUE_LENGTH ? `${text.slice(0, 159)}…` : text;
693
+ }
694
+ function isRecord(value) {
695
+ return typeof value === "object" && value !== null && !Array.isArray(value);
696
+ }
697
+ /** The value at a dotted path inside a node, as `changedPaths` names it. */
698
+ function valueAt(source, path) {
699
+ let current = source;
700
+ for (const segment of path.split(".")) {
701
+ if (!isRecord(current)) return void 0;
702
+ current = current[segment];
703
+ }
704
+ return current;
705
+ }
706
+ const KIND_OF = {
707
+ added: "added",
708
+ modified: "changed",
709
+ removed: "removed"
710
+ };
711
+ function connectionTitle(edge, labelOf) {
712
+ const caption = edgeCaption(edge);
713
+ const path = `${labelOf(edge.source)} → ${labelOf(edge.target)}`;
714
+ return caption ? `${path} (${caption})` : path;
715
+ }
716
+ /**
717
+ * Every change between two canvases, changed steps first (one entry per
718
+ * setting), then added and removed steps, then connections.
719
+ */
720
+ function plainChanges(graph, from, to) {
721
+ const nodesById = (canvas) => new Map((canvas?.nodes ?? []).map((node) => [String(node.id), node]));
722
+ const before = nodesById(from);
723
+ const after = nodesById(to);
724
+ const labels = new Map(graph.nodes.map((node) => [node.id, node.label]));
725
+ const labelOf = (id) => labels.get(id) ?? id;
726
+ const changed = [];
727
+ const added = [];
728
+ const removed = [];
729
+ const cappedSteps = [];
730
+ for (const node of graph.nodes) {
731
+ if (node.status === "unchanged") continue;
732
+ if (node.status !== "modified") {
733
+ (node.status === "added" ? added : removed).push({
734
+ key: `${node.status}:${node.id}`,
735
+ kind: KIND_OF[node.status],
736
+ subject: "step",
737
+ title: node.label,
738
+ field: null,
739
+ before: null,
740
+ after: null
741
+ });
742
+ continue;
743
+ }
744
+ for (const path of node.changedFields) changed.push({
745
+ key: `changed:${node.id}:${path}`,
746
+ kind: "changed",
747
+ subject: "step",
748
+ title: node.label,
749
+ field: describeFieldPath(path),
750
+ before: formatPlainValue(valueAt(before.get(node.id), path)),
751
+ after: formatPlainValue(valueAt(after.get(node.id), path))
752
+ });
753
+ if (node.changedFields.length >= 20) cappedSteps.push(node.label);
754
+ }
755
+ const connections = [];
756
+ for (const edge of graph.edges) {
757
+ if (edge.status === "unchanged") continue;
758
+ connections.push({
759
+ key: `connection:${edge.status}:${edge.id}`,
760
+ kind: KIND_OF[edge.status],
761
+ subject: "connection",
762
+ title: connectionTitle(edge, labelOf),
763
+ field: null,
764
+ before: null,
765
+ after: null
766
+ });
767
+ }
768
+ return {
769
+ changes: [
770
+ ...changed,
771
+ ...added,
772
+ ...removed,
773
+ ...connections
774
+ ],
775
+ cappedSteps
776
+ };
777
+ }
778
+
779
+ // src/modules/history/components/VersionDiffGraph.tsx
780
+ /**
781
+ * Read-only canvas of a version diff (BOFF-4074): both versions' nodes and
782
+ * connections on one React Flow canvas, coloured by status (added, removed,
783
+ * modified, unchanged), with a legend and the changed fields of the selected
784
+ * node. It owns its own ReactFlowProvider, so it never touches the builder's
785
+ * flow store even when opened from inside the builder.
786
+ */
787
+ /**
788
+ * Plain words for the redesigned compare dialog (BOFF-15502): "Changed"
789
+ * instead of "Modified", no raw block types on the cards, setting names in
790
+ * words and the node id under "Show technical details". Off by default, so
791
+ * the builder's dialog keeps today's canvas.
792
+ */
793
+ const PlainDiffContext = createContext(false);
794
+ const NODE_TYPES = { diff: memo(function DiffNodeCard({ data, selected }) {
795
+ const tr = useTr();
796
+ const plain = useContext(PlainDiffContext);
797
+ const statusLabel = plain ? plainDiffStatusLabel : diffStatusLabel;
798
+ const { diff } = data;
799
+ const styles = DIFF_STATUS_CLASSES[diff.status];
800
+ return /* @__PURE__ */ jsxs("div", {
801
+ className: cn("w-[200px] rounded-lg border-2 px-3 py-2 text-left shadow-sm", styles.card, selected && "ring-2 ring-primary"),
802
+ "data-testid": "fluidgrids-version-diff-node",
803
+ "data-diff-status": diff.status,
804
+ "data-node-id": diff.id,
805
+ children: [
806
+ /* @__PURE__ */ jsx(Handle, {
807
+ type: "target",
808
+ position: Position.Left,
809
+ isConnectable: false,
810
+ className: "!size-2 !border-0 !bg-muted-foreground"
811
+ }),
812
+ /* @__PURE__ */ jsxs("div", {
813
+ className: "flex items-center justify-between gap-2",
814
+ children: [/* @__PURE__ */ jsx("span", {
815
+ className: cn("truncate text-sm font-medium text-foreground", diff.status === "removed" && "line-through"),
816
+ title: diff.label,
817
+ children: diff.label
818
+ }), /* @__PURE__ */ jsx("span", {
819
+ className: cn("shrink-0 text-[10px] font-semibold uppercase", styles.text),
820
+ children: statusLabel(tr, diff.status)
821
+ })]
822
+ }),
823
+ !plain && /* @__PURE__ */ jsx("p", {
824
+ className: "mt-0.5 truncate font-mono text-[10px] text-muted-foreground",
825
+ title: diff.nodeType,
826
+ children: diff.nodeType
827
+ }),
828
+ diff.status === "modified" && /* @__PURE__ */ jsx("p", {
829
+ className: "mt-1 text-[10px] text-muted-foreground",
830
+ children: tr("fluidgrids.history.versionDiff.changedFieldCount", "{{count}} field(s) changed", { count: diff.changedFields.length })
831
+ }),
832
+ /* @__PURE__ */ jsx(Handle, {
833
+ type: "source",
834
+ position: Position.Right,
835
+ isConnectable: false,
836
+ className: "!size-2 !border-0 !bg-muted-foreground"
837
+ })
838
+ ]
839
+ });
840
+ }) };
841
+ const LEGEND_ORDER = [
842
+ "added",
843
+ "modified",
844
+ "removed",
845
+ "unchanged"
846
+ ];
847
+ function VersionDiffLegend({ nodeCounts, edgeCounts }) {
848
+ const tr = useTr();
849
+ return /* @__PURE__ */ jsx("ul", {
850
+ className: "flex flex-wrap items-center gap-2 text-xs",
851
+ "aria-label": tr("fluidgrids.history.versionDiff.legend", "Legend"),
852
+ "data-testid": "fluidgrids-version-diff-legend",
853
+ children: LEGEND_ORDER.map((status) => /* @__PURE__ */ jsxs("li", {
854
+ "data-diff-status": status,
855
+ className: cn("flex items-center gap-1.5 rounded-full border px-2 py-0.5", DIFF_STATUS_CLASSES[status].chip),
856
+ children: [/* @__PURE__ */ jsx("span", {
857
+ className: "font-medium",
858
+ children: diffStatusLabel(tr, status)
859
+ }), /* @__PURE__ */ jsx("span", {
860
+ className: "tabular-nums",
861
+ children: tr("fluidgrids.history.versionDiff.legendCounts", "{{nodes}} nodes · {{edges}} connections", {
862
+ nodes: nodeCounts[status],
863
+ edges: edgeCounts[status]
864
+ })
865
+ })]
866
+ }, status))
867
+ });
868
+ }
869
+ /** The plain legend: a swatch and a step count per status, and the steps that only moved. */
870
+ function PlainDiffLegend({ graph }) {
871
+ const tr = useTr();
872
+ const { moved } = summarizeGraphDiff(graph);
873
+ return /* @__PURE__ */ jsxs("ul", {
874
+ className: "flex flex-wrap items-center gap-x-3.5 gap-y-1.5 text-xs text-text-secondary",
875
+ "aria-label": tr("fluidgrids.history.versionDiff.legend", "Legend"),
876
+ "data-testid": "fluidgrids-version-diff-legend",
877
+ children: [LEGEND_ORDER.map((status) => /* @__PURE__ */ jsxs("li", {
878
+ "data-diff-status": status,
879
+ className: "inline-flex items-center gap-1.5",
880
+ children: [
881
+ /* @__PURE__ */ jsx("span", {
882
+ "aria-hidden": "true",
883
+ className: cn("size-3 rounded-[3px] border", DIFF_STATUS_CLASSES[status].chip)
884
+ }),
885
+ plainDiffStatusLabel(tr, status),
886
+ " ",
887
+ /* @__PURE__ */ jsx("span", {
888
+ className: "tabular-nums",
889
+ children: graph.nodeCounts[status]
890
+ })
891
+ ]
892
+ }, status)), moved > 0 && /* @__PURE__ */ jsx("li", {
893
+ className: "text-text-muted",
894
+ children: moved === 1 ? tr("fluidgrids.moreTools.versions.diff.movedOne", "1 step only moved on the canvas") : tr("fluidgrids.moreTools.versions.diff.movedOther", "{{count}} steps only moved on the canvas", { count: moved })
895
+ })]
896
+ });
897
+ }
898
+ function VersionDiffGraphInner({ graph, className, plain }) {
899
+ const tr = useTr();
900
+ const { nodes, edges } = useMemo(() => toFlowElements(graph), [graph]);
901
+ const [selectedId, setSelectedId] = useState(null);
902
+ const selected = graph.nodes.find((node) => node.id === selectedId) ?? null;
903
+ return /* @__PURE__ */ jsxs("div", {
904
+ className: cn("flex flex-col gap-3", className),
905
+ children: [
906
+ plain ? /* @__PURE__ */ jsx(PlainDiffLegend, { graph }) : /* @__PURE__ */ jsx(VersionDiffLegend, {
907
+ nodeCounts: graph.nodeCounts,
908
+ edgeCounts: graph.edgeCounts
909
+ }),
910
+ graph.nodes.length === 0 ? /* @__PURE__ */ jsx("p", {
911
+ className: "rounded-md border border-dashed border-border p-6 text-center text-sm text-muted-foreground",
912
+ children: tr("fluidgrids.history.versionDiff.noCanvas", "Neither version has a canvas to draw. Use the JSON view to compare them.")
913
+ }) : /* @__PURE__ */ jsx("div", {
914
+ className: "h-[420px] w-full overflow-hidden rounded-lg border border-border bg-background",
915
+ "data-testid": "fluidgrids-version-diff-canvas",
916
+ children: /* @__PURE__ */ jsxs(ReactFlow, {
917
+ nodes,
918
+ edges,
919
+ nodeTypes: NODE_TYPES,
920
+ nodesDraggable: false,
921
+ nodesConnectable: false,
922
+ edgesFocusable: false,
923
+ elementsSelectable: true,
924
+ onNodeClick: (_, node) => setSelectedId(node.id),
925
+ onPaneClick: () => setSelectedId(null),
926
+ fitView: true,
927
+ fitViewOptions: { padding: .2 },
928
+ minZoom: .2,
929
+ maxZoom: 1.5,
930
+ proOptions: { hideAttribution: true },
931
+ children: [
932
+ /* @__PURE__ */ jsx(Background, {
933
+ gap: 16,
934
+ size: 1
935
+ }),
936
+ /* @__PURE__ */ jsx(Controls, { showInteractive: false }),
937
+ /* @__PURE__ */ jsx(MiniMap, {
938
+ pannable: true,
939
+ zoomable: true
940
+ })
941
+ ]
942
+ })
943
+ }),
944
+ selected && /* @__PURE__ */ jsxs("section", {
945
+ className: "rounded-md border border-border bg-card p-3 text-xs",
946
+ "aria-label": tr("fluidgrids.history.versionDiff.nodeDetails", "Node details"),
947
+ "data-testid": "fluidgrids-version-diff-node-details",
948
+ children: [
949
+ /* @__PURE__ */ jsxs("p", {
950
+ className: "font-medium text-foreground",
951
+ children: [
952
+ selected.label,
953
+ " ",
954
+ /* @__PURE__ */ jsxs("span", {
955
+ className: DIFF_STATUS_CLASSES[selected.status].text,
956
+ children: [
957
+ "·",
958
+ " ",
959
+ (plain ? plainDiffStatusLabel : diffStatusLabel)(tr, selected.status)
960
+ ]
961
+ })
962
+ ]
963
+ }),
964
+ plain ? /* @__PURE__ */ jsx(ShowTechnicalDetails, {
965
+ copyable: true,
966
+ className: "mt-1",
967
+ children: selected.id
968
+ }) : /* @__PURE__ */ jsx("p", {
969
+ className: "font-mono text-muted-foreground",
970
+ children: selected.id
971
+ }),
972
+ selected.moved && /* @__PURE__ */ jsx("p", {
973
+ className: "mt-1 text-muted-foreground",
974
+ children: tr("fluidgrids.history.versionDiff.moved", "Moved on the canvas (layout only).")
975
+ }),
976
+ selected.changedFields.length > 0 && /* @__PURE__ */ jsx("ul", {
977
+ className: "mt-2 space-y-0.5",
978
+ children: selected.changedFields.map((field) => /* @__PURE__ */ jsx("li", {
979
+ className: cn("text-foreground", !plain && "font-mono"),
980
+ children: plain ? describeFieldPath(field) : field
981
+ }, field))
982
+ })
983
+ ]
984
+ })
985
+ ]
986
+ });
987
+ }
988
+ function VersionDiffGraph(props) {
989
+ return /* @__PURE__ */ jsx(PlainDiffContext.Provider, {
990
+ value: props.plain === true,
991
+ children: /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(VersionDiffGraphInner, { ...props }) })
992
+ });
993
+ }
994
+
995
+ // src/modules/history/utils/json-line-diff.ts
996
+ /** Default bound on the LCS table (rows × columns). */
997
+ const DEFAULT_MAX_CELLS = 4e6;
998
+ function sortKeys(value) {
999
+ if (Array.isArray(value)) return value.map(sortKeys);
1000
+ if (typeof value === "object" && value !== null) {
1001
+ const out = {};
1002
+ for (const key of Object.keys(value).sort((a, b) => a.localeCompare(b))) out[key] = sortKeys(value[key]);
1003
+ return out;
1004
+ }
1005
+ return value;
1006
+ }
1007
+ /** Canonical, key-sorted, pretty JSON for a definition (a JSON string is parsed first). */
1008
+ function canonicalJson(value) {
1009
+ let parsed = value;
1010
+ if (typeof parsed === "string") try {
1011
+ parsed = JSON.parse(parsed);
1012
+ } catch {
1013
+ return parsed;
1014
+ }
1015
+ if (parsed === void 0) return "";
1016
+ return JSON.stringify(sortKeys(parsed), null, 2) ?? "";
1017
+ }
1018
+ function splitLines(text) {
1019
+ return text === "" ? [] : text.split("\n");
1020
+ }
1021
+ function diffJsonLines(before, after, maxCells = DEFAULT_MAX_CELLS) {
1022
+ const a = splitLines(canonicalJson(before));
1023
+ const b = splitLines(canonicalJson(after));
1024
+ let head = 0;
1025
+ while (head < a.length && head < b.length && a[head] === b[head]) head += 1;
1026
+ let tail = 0;
1027
+ while (tail < a.length - head && tail < b.length - head && a[a.length - 1 - tail] === b[b.length - 1 - tail]) tail += 1;
1028
+ const lines = [];
1029
+ for (let i = 0; i < head; i += 1) lines.push({
1030
+ kind: "same",
1031
+ text: a[i],
1032
+ fromLine: i + 1,
1033
+ toLine: i + 1
1034
+ });
1035
+ const midA = a.slice(head, a.length - tail);
1036
+ const midB = b.slice(head, b.length - tail);
1037
+ let approximate = false;
1038
+ let added = 0;
1039
+ let removed = 0;
1040
+ const pushRemoved = (index) => {
1041
+ lines.push({
1042
+ kind: "removed",
1043
+ text: midA[index],
1044
+ fromLine: head + index + 1,
1045
+ toLine: null
1046
+ });
1047
+ removed += 1;
1048
+ };
1049
+ const pushAdded = (index) => {
1050
+ lines.push({
1051
+ kind: "added",
1052
+ text: midB[index],
1053
+ fromLine: null,
1054
+ toLine: head + index + 1
1055
+ });
1056
+ added += 1;
1057
+ };
1058
+ if ((midA.length + 1) * (midB.length + 1) > maxCells) {
1059
+ approximate = true;
1060
+ for (let i = 0; i < midA.length; i += 1) pushRemoved(i);
1061
+ for (let j = 0; j < midB.length; j += 1) pushAdded(j);
1062
+ } else {
1063
+ const width = midB.length + 1;
1064
+ const lcs = new Uint32Array((midA.length + 1) * width);
1065
+ for (let i = midA.length - 1; i >= 0; i -= 1) for (let j = midB.length - 1; j >= 0; j -= 1) lcs[i * width + j] = midA[i] === midB[j] ? lcs[(i + 1) * width + j + 1] + 1 : Math.max(lcs[(i + 1) * width + j], lcs[i * width + j + 1]);
1066
+ let i = 0;
1067
+ let j = 0;
1068
+ while (i < midA.length && j < midB.length) if (midA[i] === midB[j]) {
1069
+ lines.push({
1070
+ kind: "same",
1071
+ text: midA[i],
1072
+ fromLine: head + i + 1,
1073
+ toLine: head + j + 1
1074
+ });
1075
+ i += 1;
1076
+ j += 1;
1077
+ } else if (lcs[(i + 1) * width + j] >= lcs[i * width + j + 1]) {
1078
+ pushRemoved(i);
1079
+ i += 1;
1080
+ } else {
1081
+ pushAdded(j);
1082
+ j += 1;
1083
+ }
1084
+ while (i < midA.length) pushRemoved(i++);
1085
+ while (j < midB.length) pushAdded(j++);
1086
+ }
1087
+ for (let k = 0; k < tail; k += 1) {
1088
+ const fromIndex = a.length - tail + k;
1089
+ const toIndex = b.length - tail + k;
1090
+ lines.push({
1091
+ kind: "same",
1092
+ text: a[fromIndex],
1093
+ fromLine: fromIndex + 1,
1094
+ toLine: toIndex + 1
1095
+ });
1096
+ }
1097
+ return {
1098
+ lines,
1099
+ added,
1100
+ removed,
1101
+ approximate
1102
+ };
1103
+ }
1104
+ /**
1105
+ * Group a diff into hunks with `context` unchanged lines around each change,
1106
+ * so a one-line edit in a 2,000-line definition does not print all of it.
1107
+ */
1108
+ function toHunks(lines, context = 3) {
1109
+ const keep = new Array(lines.length).fill(false);
1110
+ lines.forEach((line, index) => {
1111
+ if (line.kind === "same") return;
1112
+ const start = Math.max(0, index - context);
1113
+ const end = Math.min(lines.length - 1, index + context);
1114
+ for (let k = start; k <= end; k += 1) keep[k] = true;
1115
+ });
1116
+ const hunks = [];
1117
+ let skipped = 0;
1118
+ let current = null;
1119
+ lines.forEach((line, index) => {
1120
+ if (!keep[index]) {
1121
+ skipped += 1;
1122
+ current = null;
1123
+ return;
1124
+ }
1125
+ if (!current) {
1126
+ current = {
1127
+ skippedBefore: skipped,
1128
+ lines: []
1129
+ };
1130
+ hunks.push(current);
1131
+ skipped = 0;
1132
+ }
1133
+ current.lines.push(line);
1134
+ });
1135
+ return {
1136
+ hunks,
1137
+ skippedAfter: skipped
1138
+ };
1139
+ }
1140
+
1141
+ // src/modules/history/components/diff-format.ts
1142
+ /**
1143
+ * Value and time formatting for the version diff view (BOFF-4074).
1144
+ */
1145
+ const VERSION_TIME_FORMAT = new Intl.DateTimeFormat(void 0, {
1146
+ year: "numeric",
1147
+ month: "short",
1148
+ day: "numeric",
1149
+ hour: "2-digit",
1150
+ minute: "2-digit"
1151
+ });
1152
+ /** A version timestamp for display; unparseable input is shown as-is. */
1153
+ function formatVersionTime(value) {
1154
+ if (!value) return "";
1155
+ const date = new Date(value);
1156
+ if (Number.isNaN(date.getTime())) return value;
1157
+ return VERSION_TIME_FORMAT.format(date);
1158
+ }
1159
+ /** One side of a change-list row: JSON for values, a dash when absent. */
1160
+ function formatDiffValue(value) {
1161
+ if (value === void 0 || value === null) return "—";
1162
+ try {
1163
+ return JSON.stringify(value);
1164
+ } catch {
1165
+ return String(value);
1166
+ }
1167
+ }
1168
+
1169
+ // src/modules/history/components/VersionDiffJson.tsx
1170
+ /**
1171
+ * JSON side of the version diff (BOFF-4074): the service's change list
1172
+ * (`workflowVersionDiff`, one row per changed path) and a line diff of the
1173
+ * two definitions printed as canonical JSON.
1174
+ */
1175
+ function lineKey(line) {
1176
+ return `${line.fromLine ?? "-"}:${line.toLine ?? "-"}`;
1177
+ }
1178
+ function hunkKey(hunk) {
1179
+ const first = hunk.lines[0];
1180
+ return first ? lineKey(first) : `skip-${hunk.skippedBefore}`;
1181
+ }
1182
+ function kindStatus(kind) {
1183
+ if (kind === "ADDED") return "added";
1184
+ if (kind === "REMOVED") return "removed";
1185
+ return "modified";
1186
+ }
1187
+ function VersionChangeList({ diff, error, plain }) {
1188
+ const tr = useTr();
1189
+ if (!diff) return /* @__PURE__ */ jsx("p", {
1190
+ role: "alert",
1191
+ className: "rounded-md border border-[var(--color-status-error-border)] bg-[var(--color-status-error-bg)] p-3 text-xs text-[var(--color-status-error-text)]",
1192
+ children: tr("fluidgrids.history.versionDiff.changeListError", "The change list could not be loaded: {{error}}", { error: error ?? "" })
1193
+ });
1194
+ if (diff.entries.length === 0) return /* @__PURE__ */ jsx("p", {
1195
+ className: "text-sm text-muted-foreground",
1196
+ children: tr("fluidgrids.history.versionDiff.identical", "The definitions are identical.")
1197
+ });
1198
+ return /* @__PURE__ */ jsxs("div", {
1199
+ className: "space-y-2",
1200
+ children: [/* @__PURE__ */ jsxs("p", {
1201
+ className: "text-xs text-muted-foreground",
1202
+ children: [tr("fluidgrids.history.versionDiff.changeCount", "{{count}} change(s)", { count: diff.entries.length }), diff.truncated && ` · ${tr("fluidgrids.history.versionDiff.truncated", "the list is truncated; the raw JSON view shows everything")}`]
1203
+ }), /* @__PURE__ */ jsx("ul", {
1204
+ className: "max-h-[420px] space-y-1 overflow-y-auto",
1205
+ "data-testid": "fluidgrids-version-diff-changes",
1206
+ children: diff.entries.map((entry) => {
1207
+ const status = kindStatus(entry.kind);
1208
+ return /* @__PURE__ */ jsxs("li", {
1209
+ className: "rounded border border-border p-2 text-xs",
1210
+ "data-diff-kind": entry.kind,
1211
+ children: [
1212
+ /* @__PURE__ */ jsxs("div", {
1213
+ className: "flex min-w-0 items-center gap-2",
1214
+ children: [/* @__PURE__ */ jsx(Badge, {
1215
+ variant: "outline",
1216
+ className: cn("shrink-0 text-[10px]", DIFF_STATUS_CLASSES[status].chip),
1217
+ children: plain ? plainDiffStatusLabel(tr, status) : entry.kind
1218
+ }), /* @__PURE__ */ jsx("code", {
1219
+ className: "min-w-0 break-all font-mono",
1220
+ children: entry.path
1221
+ })]
1222
+ }),
1223
+ entry.kind !== "ADDED" && /* @__PURE__ */ jsxs("p", {
1224
+ className: "mt-1 break-all font-mono text-[11px] text-[var(--color-status-error-text)]",
1225
+ children: ["− ", formatDiffValue(entry.before)]
1226
+ }),
1227
+ entry.kind !== "REMOVED" && /* @__PURE__ */ jsxs("p", {
1228
+ className: "mt-1 break-all font-mono text-[11px] text-[var(--color-status-success-text)]",
1229
+ children: ["+ ", formatDiffValue(entry.after)]
1230
+ })
1231
+ ]
1232
+ }, `${entry.kind}-${entry.path}`);
1233
+ })
1234
+ })]
1235
+ });
1236
+ }
1237
+ function lineClass(line) {
1238
+ if (line.kind === "added") return "bg-[var(--color-status-success-bg)] text-[var(--color-status-success-text)]";
1239
+ if (line.kind === "removed") return "bg-[var(--color-status-error-bg)] text-[var(--color-status-error-text)]";
1240
+ return "text-foreground";
1241
+ }
1242
+ function JsonLineDiffView({ before, after, fromVersion, toVersion }) {
1243
+ const tr = useTr();
1244
+ const diff = useMemo(() => diffJsonLines(before, after), [before, after]);
1245
+ const [full, setFull] = useState(false);
1246
+ const { hunks, skippedAfter } = useMemo(() => full ? {
1247
+ hunks: [{
1248
+ skippedBefore: 0,
1249
+ lines: diff.lines
1250
+ }],
1251
+ skippedAfter: 0
1252
+ } : toHunks(diff.lines), [diff, full]);
1253
+ return /* @__PURE__ */ jsxs("div", {
1254
+ className: "space-y-2",
1255
+ children: [/* @__PURE__ */ jsxs("div", {
1256
+ className: "flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",
1257
+ children: [/* @__PURE__ */ jsxs("span", { children: [
1258
+ /* @__PURE__ */ jsxs("span", {
1259
+ className: "text-[var(--color-status-error-text)]",
1260
+ children: ["− ", fromVersion]
1261
+ }),
1262
+ " ",
1263
+ /* @__PURE__ */ jsxs("span", {
1264
+ className: "text-[var(--color-status-success-text)]",
1265
+ children: ["+ ", toVersion]
1266
+ }),
1267
+ " ",
1268
+ "·",
1269
+ " ",
1270
+ tr("fluidgrids.history.versionDiff.lineCounts", "{{added}} line(s) added, {{removed}} removed", {
1271
+ added: diff.added,
1272
+ removed: diff.removed
1273
+ }),
1274
+ diff.approximate && ` · ${tr("fluidgrids.history.versionDiff.approximate", "too large for a line-by-line match; the changed block is shown whole")}`
1275
+ ] }), /* @__PURE__ */ jsx(Button, {
1276
+ size: "sm",
1277
+ variant: "ghost",
1278
+ onClick: () => setFull((v) => !v),
1279
+ children: full ? tr("fluidgrids.history.versionDiff.showChangesOnly", "Changes only") : tr("fluidgrids.history.versionDiff.showFullJson", "Full JSON")
1280
+ })]
1281
+ }), diff.added + diff.removed === 0 && !full ? /* @__PURE__ */ jsx("p", {
1282
+ className: "text-sm text-muted-foreground",
1283
+ children: tr("fluidgrids.history.versionDiff.identical", "The definitions are identical.")
1284
+ }) : /* @__PURE__ */ jsxs("div", {
1285
+ className: "max-h-[480px] overflow-auto rounded-md border border-border bg-background font-mono text-[11px] leading-5",
1286
+ "data-testid": "fluidgrids-version-diff-json",
1287
+ children: [hunks.map((hunk) => /* @__PURE__ */ jsxs("div", { children: [hunk.skippedBefore > 0 && /* @__PURE__ */ jsx("div", {
1288
+ className: "border-y border-border bg-muted px-2 text-muted-foreground",
1289
+ children: tr("fluidgrids.history.versionDiff.unchangedLines", "… {{count}} unchanged line(s)", { count: hunk.skippedBefore })
1290
+ }), hunk.lines.map((line) => /* @__PURE__ */ jsxs("div", {
1291
+ className: cn("flex whitespace-pre", lineClass(line)),
1292
+ "data-line-kind": line.kind,
1293
+ children: [
1294
+ /* @__PURE__ */ jsx("span", {
1295
+ className: "w-10 shrink-0 select-none pr-1 text-right text-muted-foreground",
1296
+ children: line.fromLine ?? ""
1297
+ }),
1298
+ /* @__PURE__ */ jsx("span", {
1299
+ className: "w-10 shrink-0 select-none pr-1 text-right text-muted-foreground",
1300
+ children: line.toLine ?? ""
1301
+ }),
1302
+ /* @__PURE__ */ jsx("span", {
1303
+ className: "w-4 shrink-0 select-none text-center",
1304
+ children: line.kind === "added" ? "+" : line.kind === "removed" ? "−" : " "
1305
+ }),
1306
+ /* @__PURE__ */ jsx("span", {
1307
+ className: "pr-2",
1308
+ children: line.text
1309
+ })
1310
+ ]
1311
+ }, lineKey(line)))] }, hunkKey(hunk))), skippedAfter > 0 && /* @__PURE__ */ jsx("div", {
1312
+ className: "border-t border-border bg-muted px-2 text-muted-foreground",
1313
+ children: tr("fluidgrids.history.versionDiff.unchangedLines", "… {{count}} unchanged line(s)", { count: skippedAfter })
1314
+ })]
1315
+ })]
1316
+ });
1317
+ }
1318
+
1319
+ // src/modules/history/components/VersionDiffDialog.tsx
1320
+ /**
1321
+ * Version diff dialog (BOFF-4074, mock fg-23-version-history.png): pick two
1322
+ * versions of one workflow and compare them as a graph (added, modified and
1323
+ * removed nodes and connections on a read-only canvas) or as JSON (the
1324
+ * service's change list and a line diff of the definitions). Each side shows
1325
+ * its lifecycle stage, author and time, and can be restored as a new draft.
1326
+ *
1327
+ * Used by the builder's Versions panel and by the Version History page.
1328
+ *
1329
+ * Under the stable tabbed-dialog opt-in (BOFF-15607, `useStableTabbedDialogs`)
1330
+ * it is fe-libs' shared layout: a fixed-height viewer box (a bottom sheet on
1331
+ * phones), the version pickers fixed under the header, Graph and JSON as
1332
+ * cross-faded panels that each scroll on their own and open with the two
1333
+ * versions' cards. Same pair, loading and a failed comparison show in the
1334
+ * panel, so the tabs stay put. Without it the dialog is today's.
1335
+ */
1336
+ var VersionDiffDialog_exports = /* @__PURE__ */ __exportAll({ VersionDiffDialog: () => VersionDiffDialog });
1337
+ function statusVariant(status) {
1338
+ switch (lifecycleStageOf(status)) {
1339
+ case "ACTIVE": return "default";
1340
+ case "DEPRECATED": return "destructive";
1341
+ case "ARCHIVED": return "outline";
1342
+ default: return "secondary";
1343
+ }
1344
+ }
1345
+ function VersionSide({ tr, side, version, counts, authorName, currentVersion, busy, onRestore, onOpenVersion }) {
1346
+ if (!version) return null;
1347
+ const author = authorName?.(version.createdById) ?? null;
1348
+ const when = formatVersionTime(version.updatedAt ?? version.createdAt);
1349
+ const isCurrent = currentVersion === version.version;
1350
+ return /* @__PURE__ */ jsxs("section", {
1351
+ className: "flex min-w-0 flex-col gap-2 rounded-lg border border-border bg-card p-3",
1352
+ "data-testid": `fluidgrids-version-diff-${side}`,
1353
+ "aria-label": side === "from" ? tr("fluidgrids.history.versionDiff.fromSideAria", "Compared from") : tr("fluidgrids.history.versionDiff.toSideAria", "Compared to"),
1354
+ children: [
1355
+ /* @__PURE__ */ jsxs("div", {
1356
+ className: "flex flex-wrap items-center gap-2",
1357
+ children: [
1358
+ /* @__PURE__ */ jsx("code", {
1359
+ className: "rounded bg-muted px-1.5 py-0.5 text-xs text-foreground",
1360
+ children: version.version
1361
+ }),
1362
+ /* @__PURE__ */ jsx(Badge, {
1363
+ variant: statusVariant(version.status),
1364
+ className: "text-[10px]",
1365
+ children: lifecycleStageLabel(tr, lifecycleStageOf(version.status))
1366
+ }),
1367
+ isCurrent && /* @__PURE__ */ jsx(Badge, {
1368
+ variant: "outline",
1369
+ className: "text-[10px]",
1370
+ children: tr("fluidgrids.history.versionDiff.currentlyOpen", "Currently open")
1371
+ })
1372
+ ]
1373
+ }),
1374
+ /* @__PURE__ */ jsxs("p", {
1375
+ className: "text-xs text-muted-foreground",
1376
+ children: [author ? `${author} · ` : "", when]
1377
+ }),
1378
+ /* @__PURE__ */ jsx(VersionLifecycleBar, {
1379
+ status: version.status,
1380
+ counts
1381
+ }),
1382
+ (onRestore || onOpenVersion && !isCurrent) && /* @__PURE__ */ jsxs("div", {
1383
+ className: "flex flex-wrap gap-2",
1384
+ children: [onOpenVersion && !isCurrent && /* @__PURE__ */ jsxs(Button, {
1385
+ size: "sm",
1386
+ variant: "outline",
1387
+ disabled: busy,
1388
+ onClick: () => onOpenVersion(version.version),
1389
+ children: [/* @__PURE__ */ jsx(Eye, { className: "mr-1.5 size-3.5" }), tr("fluidgrids.history.versionDiff.view", "View in builder")]
1390
+ }), onRestore && !isCurrent && /* @__PURE__ */ jsxs(Button, {
1391
+ size: "sm",
1392
+ variant: "secondary",
1393
+ disabled: busy,
1394
+ onClick: () => onRestore(version.version),
1395
+ "data-testid": `fluidgrids-version-diff-restore-${side}`,
1396
+ children: [/* @__PURE__ */ jsx(RotateCcw, { className: "mr-1.5 size-3.5" }), tr("fluidgrids.history.versionDiff.restore", "Restore as new draft")]
1397
+ })]
1398
+ })
1399
+ ]
1400
+ });
1401
+ }
1402
+ function VersionSelect({ versions, value, onChange, label }) {
1403
+ const tr = useTr();
1404
+ return /* @__PURE__ */ jsx(ThemedSelect, {
1405
+ value,
1406
+ onChange: (event) => onChange(event.target.value),
1407
+ "aria-label": label,
1408
+ className: "h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs text-foreground",
1409
+ children: versions.map((v) => /* @__PURE__ */ jsxs("option", {
1410
+ value: v.version,
1411
+ children: [
1412
+ v.version,
1413
+ " · ",
1414
+ lifecycleStageLabel(tr, lifecycleStageOf(v.status))
1415
+ ]
1416
+ }, v.id))
1417
+ });
1418
+ }
1419
+ /** One view of a loaded comparison: the graph, or the JSON. */
1420
+ function DiffView({ view, comparison }) {
1421
+ const tr = useTr();
1422
+ if (view === "graph") return /* @__PURE__ */ jsxs(Fragment$1, { children: [comparison.graph.identical && /* @__PURE__ */ jsx("p", {
1423
+ className: "mb-2 text-xs text-muted-foreground",
1424
+ children: tr("fluidgrids.history.versionDiff.graphIdentical", "No node or connection changed between these versions.")
1425
+ }), /* @__PURE__ */ jsx(VersionDiffGraph, { graph: comparison.graph })] });
1426
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("h3", {
1427
+ className: "mb-2 text-sm font-semibold text-foreground",
1428
+ children: tr("fluidgrids.history.versionDiff.changesHeading", "Changes")
1429
+ }), /* @__PURE__ */ jsx(VersionChangeList, {
1430
+ diff: comparison.serverDiff,
1431
+ error: comparison.serverDiffError
1432
+ })] }), /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("h3", {
1433
+ className: "mb-2 text-sm font-semibold text-foreground",
1434
+ children: tr("fluidgrids.history.versionDiff.rawHeading", "Definition JSON")
1435
+ }), /* @__PURE__ */ jsx(JsonLineDiffView, {
1436
+ before: comparison.from.definitionJson,
1437
+ after: comparison.to.definitionJson,
1438
+ fromVersion: comparison.fromVersion,
1439
+ toVersion: comparison.toVersion
1440
+ })] })] });
1441
+ }
1442
+ function ComparisonTabs({ comparison, tab, onTabChange }) {
1443
+ const tr = useTr();
1444
+ return /* @__PURE__ */ jsxs(Tabs, {
1445
+ value: tab,
1446
+ onValueChange: (value) => onTabChange(value === "json" ? "json" : "graph"),
1447
+ children: [
1448
+ /* @__PURE__ */ jsxs(TabsList, { children: [/* @__PURE__ */ jsx(TabsTrigger, {
1449
+ value: "graph",
1450
+ children: tr("fluidgrids.history.versionDiff.graphTab", "Graph")
1451
+ }), /* @__PURE__ */ jsx(TabsTrigger, {
1452
+ value: "json",
1453
+ children: tr("fluidgrids.history.versionDiff.jsonTab", "JSON")
1454
+ })] }),
1455
+ /* @__PURE__ */ jsx(TabsContent, {
1456
+ value: "graph",
1457
+ className: "mt-3",
1458
+ children: /* @__PURE__ */ jsx(DiffView, {
1459
+ view: "graph",
1460
+ comparison
1461
+ })
1462
+ }),
1463
+ /* @__PURE__ */ jsx(TabsContent, {
1464
+ value: "json",
1465
+ className: "mt-3 space-y-4",
1466
+ children: /* @__PURE__ */ jsx(DiffView, {
1467
+ view: "json",
1468
+ comparison
1469
+ })
1470
+ })
1471
+ ]
1472
+ });
1473
+ }
1474
+ /**
1475
+ * Same pair, loading, or a failed comparison; null once there is one to show
1476
+ * (or nothing to show yet), which the caller then renders.
1477
+ */
1478
+ function ComparisonStatus({ samePair, loading, error, comparison, onRetry }) {
1479
+ const tr = useTr();
1480
+ if (samePair) return /* @__PURE__ */ jsx("p", {
1481
+ className: "text-sm text-muted-foreground",
1482
+ children: tr("fluidgrids.history.versionDiff.sameVersion", "Pick two different versions to compare.")
1483
+ });
1484
+ if (loading && !comparison) return /* @__PURE__ */ jsxs("div", {
1485
+ className: "flex items-center justify-center gap-2 py-10 text-sm text-muted-foreground",
1486
+ children: [/* @__PURE__ */ jsx(SpinnerIcon, { className: "size-4 animate-spin" }), tr("fluidgrids.history.versionDiff.loading", "Comparing versions…")]
1487
+ });
1488
+ if (error) return /* @__PURE__ */ jsxs("div", {
1489
+ role: "alert",
1490
+ className: "flex flex-wrap items-center justify-between gap-2 rounded-md border border-[var(--color-status-error-border)] bg-[var(--color-status-error-bg)] p-3 text-sm text-[var(--color-status-error-text)]",
1491
+ children: [/* @__PURE__ */ jsx("span", { children: error }), /* @__PURE__ */ jsx(Button, {
1492
+ size: "sm",
1493
+ variant: "outline",
1494
+ onClick: onRetry,
1495
+ children: tr("fluidgrids.history.versionDiff.retry", "Retry")
1496
+ })]
1497
+ });
1498
+ return null;
1499
+ }
1500
+ /** Whether `ComparisonStatus` has something to say instead of the comparison. */
1501
+ const showsStatus = ({ samePair, loading, error, comparison }) => samePair || loading && !comparison || Boolean(error);
1502
+ function ComparisonBody({ tab, onTabChange, ...state }) {
1503
+ if (showsStatus(state)) return /* @__PURE__ */ jsx(ComparisonStatus, { ...state });
1504
+ return state.comparison ? /* @__PURE__ */ jsx(ComparisonTabs, {
1505
+ comparison: state.comparison,
1506
+ tab,
1507
+ onTabChange
1508
+ }) : null;
1509
+ }
1510
+ /** A panel of the stable layout: the comparison's state, or the view. */
1511
+ function StableDiffPanel({ view, ...state }) {
1512
+ if (showsStatus(state)) return /* @__PURE__ */ jsx(ComparisonStatus, { ...state });
1513
+ if (!state.comparison) return null;
1514
+ return /* @__PURE__ */ jsx("div", {
1515
+ className: view === "json" ? "space-y-4" : void 0,
1516
+ children: /* @__PURE__ */ jsx(DiffView, {
1517
+ view,
1518
+ comparison: state.comparison
1519
+ })
1520
+ });
1521
+ }
1522
+ function RestoreConfirmDialog({ target, restoring, className, onCancel, onConfirm }) {
1523
+ const tr = useTr();
1524
+ return /* @__PURE__ */ jsx(AlertDialog, {
1525
+ open: target !== null,
1526
+ onOpenChange: (next) => !next && !restoring && onCancel(),
1527
+ children: /* @__PURE__ */ jsxs(AlertDialogContent, {
1528
+ className,
1529
+ children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: tr("fluidgrids.history.versionDiff.restoreTitle", "Restore version {{version}}?", { version: target ?? "" }) }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: tr("fluidgrids.history.versionDiff.restoreBody", "This creates a new draft version from it. Existing versions, including the active one, are not changed.") })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, {
1530
+ disabled: restoring,
1531
+ children: tr("fluidgrids.history.versionDiff.cancel", "Cancel")
1532
+ }), /* @__PURE__ */ jsxs(AlertDialogAction, {
1533
+ disabled: restoring,
1534
+ onClick: (event) => {
1535
+ event.preventDefault();
1536
+ onConfirm();
1537
+ },
1538
+ children: [restoring && /* @__PURE__ */ jsx(SpinnerIcon, { className: "mr-2 size-3.5 animate-spin" }), tr("fluidgrids.history.versionDiff.restoreConfirm", "Restore")]
1539
+ })] })]
1540
+ })
1541
+ });
1542
+ }
1543
+ function VersionDiffDialog({ open, onOpenChange, workflowKey, workflowName, versions, initialFrom, initialTo, currentVersion, authorName, onRestore, onOpenVersion, className }) {
1544
+ const tr = useTr();
1545
+ const [from, setFrom] = useState(initialFrom);
1546
+ const [to, setTo] = useState(initialTo);
1547
+ const [tab, setTab] = useState("graph");
1548
+ const [restoreTarget, setRestoreTarget] = useState(null);
1549
+ const [restoring, setRestoring] = useState(false);
1550
+ useEffect(() => {
1551
+ if (!open) return;
1552
+ setFrom(initialFrom);
1553
+ setTo(initialTo);
1554
+ }, [
1555
+ open,
1556
+ initialFrom,
1557
+ initialTo
1558
+ ]);
1559
+ const { comparison, loading, error, reload } = useVersionComparison(workflowKey, open ? from : null, open ? to : null);
1560
+ const counts = useMemo(() => countLifecycle(versions), [versions]);
1561
+ const byVersion = useMemo(() => new Map(versions.map((v) => [v.version, v])), [versions]);
1562
+ const confirmRestore = async () => {
1563
+ if (!restoreTarget || !onRestore) return;
1564
+ setRestoring(true);
1565
+ try {
1566
+ await onRestore(restoreTarget);
1567
+ setRestoreTarget(null);
1568
+ } finally {
1569
+ setRestoring(false);
1570
+ }
1571
+ };
1572
+ const stable = useStableTabbedDialogs();
1573
+ const title = tr("fluidgrids.history.versionDiff.title", "Version diff");
1574
+ const titleSuffix = workflowName ? ` · ${workflowName}` : "";
1575
+ const description = tr("fluidgrids.history.versionDiff.description", "Compare two versions on the canvas or as JSON. The graph ignores layout-only moves; the JSON view lists every difference.");
1576
+ const state = {
1577
+ samePair: from === to,
1578
+ loading,
1579
+ error,
1580
+ comparison,
1581
+ onRetry: reload
1582
+ };
1583
+ const pickers = /* @__PURE__ */ jsxs(Fragment$1, { children: [
1584
+ /* @__PURE__ */ jsx(VersionSelect, {
1585
+ versions,
1586
+ value: from,
1587
+ onChange: setFrom,
1588
+ label: tr("fluidgrids.history.versionDiff.fromLabel", "From version")
1589
+ }),
1590
+ /* @__PURE__ */ jsx(Button, {
1591
+ size: "icon",
1592
+ variant: "ghost",
1593
+ "aria-label": tr("fluidgrids.history.versionDiff.swap", "Swap versions"),
1594
+ onClick: () => {
1595
+ setFrom(to);
1596
+ setTo(from);
1597
+ },
1598
+ children: /* @__PURE__ */ jsx(ArrowLeftRight, { className: "size-4" })
1599
+ }),
1600
+ /* @__PURE__ */ jsx(VersionSelect, {
1601
+ versions,
1602
+ value: to,
1603
+ onChange: setTo,
1604
+ label: tr("fluidgrids.history.versionDiff.toLabel", "To version")
1605
+ })
1606
+ ] });
1607
+ const sides = ["from", "to"].map((side) => /* @__PURE__ */ jsx(VersionSide, {
1608
+ tr,
1609
+ side,
1610
+ version: byVersion.get(side === "from" ? from : to),
1611
+ counts,
1612
+ authorName,
1613
+ currentVersion,
1614
+ busy: restoring,
1615
+ onRestore: onRestore ? setRestoreTarget : void 0,
1616
+ onOpenVersion
1617
+ }, side));
1618
+ const restoreConfirm = /* @__PURE__ */ jsx(RestoreConfirmDialog, {
1619
+ target: restoreTarget,
1620
+ restoring,
1621
+ className,
1622
+ onCancel: () => setRestoreTarget(null),
1623
+ onConfirm: () => void confirmRestore()
1624
+ });
1625
+ if (stable) {
1626
+ const tabs = [{
1627
+ value: "graph",
1628
+ label: tr("fluidgrids.history.versionDiff.graphTab", "Graph"),
1629
+ icon: Workflow,
1630
+ testId: "fluidgrids-version-diff-tab-graph"
1631
+ }, {
1632
+ value: "json",
1633
+ label: tr("fluidgrids.history.versionDiff.jsonTab", "JSON"),
1634
+ icon: Braces,
1635
+ testId: "fluidgrids-version-diff-tab-json"
1636
+ }];
1637
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TabbedDialog, {
1638
+ open,
1639
+ onOpenChange,
1640
+ children: /* @__PURE__ */ jsxs(TabbedDialogContent, {
1641
+ size: "viewer",
1642
+ width: "wide",
1643
+ className,
1644
+ onOpenAutoFocus: focusDialogOnOpen,
1645
+ "data-testid": "fluidgrids-version-diff-dialog",
1646
+ children: [
1647
+ /* @__PURE__ */ jsx(TabbedDialogHeader, {
1648
+ title: /* @__PURE__ */ jsxs(Fragment$1, { children: [title, titleSuffix] }),
1649
+ description,
1650
+ closeLabel: tr("fluidgrids.ui.dialog.closeLabel", "Close")
1651
+ }),
1652
+ /* @__PURE__ */ jsx("div", {
1653
+ className: "flex shrink-0 items-center gap-2 border-b border-border-subtle px-5 py-3",
1654
+ children: pickers
1655
+ }),
1656
+ /* @__PURE__ */ jsx(TabbedDialogTabs, {
1657
+ tabs,
1658
+ value: tab,
1659
+ onValueChange: setTab,
1660
+ "aria-label": title,
1661
+ renderPanel: (view) => /* @__PURE__ */ jsxs("div", {
1662
+ className: "space-y-4",
1663
+ children: [/* @__PURE__ */ jsx("div", {
1664
+ className: "grid gap-3 sm:grid-cols-2",
1665
+ children: sides
1666
+ }), /* @__PURE__ */ jsx(StableDiffPanel, {
1667
+ view,
1668
+ ...state
1669
+ })]
1670
+ })
1671
+ })
1672
+ ]
1673
+ })
1674
+ }), restoreConfirm] });
1675
+ }
1676
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Dialog, {
1677
+ open,
1678
+ onOpenChange,
1679
+ children: /* @__PURE__ */ jsxs(DialogContent, {
1680
+ className: cn("max-h-[92vh] w-[calc(100vw-2rem)] overflow-y-auto sm:max-w-5xl", className),
1681
+ "data-testid": "fluidgrids-version-diff-dialog",
1682
+ children: [
1683
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsxs(DialogTitle, { children: [title, titleSuffix] }), /* @__PURE__ */ jsx(DialogDescription, { children: description })] }),
1684
+ /* @__PURE__ */ jsx("div", {
1685
+ className: "flex items-center gap-2",
1686
+ children: pickers
1687
+ }),
1688
+ /* @__PURE__ */ jsx("div", {
1689
+ className: "grid gap-3 sm:grid-cols-2",
1690
+ children: sides
1691
+ }),
1692
+ /* @__PURE__ */ jsx(ComparisonBody, {
1693
+ tab,
1694
+ onTabChange: setTab,
1695
+ ...state
1696
+ })
1697
+ ]
1698
+ })
1699
+ }), restoreConfirm] });
1700
+ }
1701
+
1702
+ export { VersionDiffGraph as a, useVersionComparison as c, VersionChangeList as i, WorkflowVersionDiffDocument as l, VersionDiffDialog_exports as n, plainChanges as o, JsonLineDiffView as r, summarizeGraphDiff as s, VersionDiffDialog as t };