@burdenoff/microfe-bigconsole 2026.805.2 → 2026.812.1

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 (253) hide show
  1. package/dist/bigconsole/components/DrilldownDashboardRenderer.js +118 -106
  2. package/dist/bigconsole/components/DrilldownDashboardRenderer.js.map +1 -1
  3. package/dist/bigconsole/components/DrilldownModal.js +54 -50
  4. package/dist/bigconsole/components/DrilldownModal.js.map +1 -1
  5. package/dist/bigconsole/components/builder/BuilderCanvas.js +2 -2
  6. package/dist/bigconsole/components/builder/BuilderCanvas.js.map +1 -1
  7. package/dist/bigconsole/components/builder/BuilderTopbar.js +3 -3
  8. package/dist/bigconsole/components/builder/BuilderTopbar.js.map +1 -1
  9. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js +24 -25
  10. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js.map +1 -1
  11. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +40 -29
  12. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js.map +1 -1
  13. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +145 -111
  14. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -1
  15. package/dist/bigconsole/components/builder/inspector/GeneralSection.js +58 -44
  16. package/dist/bigconsole/components/builder/inspector/GeneralSection.js.map +1 -1
  17. package/dist/bigconsole/components/common/Section.js +70 -0
  18. package/dist/bigconsole/components/common/Section.js.map +1 -0
  19. package/dist/bigconsole/components/common/index.js +2 -0
  20. package/dist/bigconsole/components/common/sectionStyles.js +42 -0
  21. package/dist/bigconsole/components/common/sectionStyles.js.map +1 -0
  22. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +269 -251
  23. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js.map +1 -1
  24. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +214 -223
  25. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  26. package/dist/bigconsole/components/dashboard/DashboardGrid.js +12 -18
  27. package/dist/bigconsole/components/dashboard/DashboardGrid.js.map +1 -1
  28. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +110 -102
  29. package/dist/bigconsole/components/dashboard/DashboardToolbar.js.map +1 -1
  30. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +81 -68
  31. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js.map +1 -1
  32. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +125 -159
  33. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js.map +1 -1
  34. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +147 -144
  35. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js.map +1 -1
  36. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +154 -153
  37. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js.map +1 -1
  38. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +82 -79
  39. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js.map +1 -1
  40. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +171 -284
  41. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js.map +1 -1
  42. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +250 -273
  43. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js.map +1 -1
  44. package/dist/bigconsole/components/dashboard/LiveBoardBanner.js +45 -53
  45. package/dist/bigconsole/components/dashboard/LiveBoardBanner.js.map +1 -1
  46. package/dist/bigconsole/components/dashboard/PageTabsManager/PageTabsManager.js +157 -148
  47. package/dist/bigconsole/components/dashboard/PageTabsManager/PageTabsManager.js.map +1 -1
  48. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +75 -83
  49. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js.map +1 -1
  50. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +167 -161
  51. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js.map +1 -1
  52. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +181 -190
  53. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js.map +1 -1
  54. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -95
  55. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js.map +1 -1
  56. package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js +20 -18
  57. package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js.map +1 -1
  58. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -0
  59. package/dist/bigconsole/components/dashboard/TemplateSetupBanner.js +26 -58
  60. package/dist/bigconsole/components/dashboard/TemplateSetupBanner.js.map +1 -1
  61. package/dist/bigconsole/components/dashboard/WidgetPalette.js +307 -229
  62. package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
  63. package/dist/bigconsole/components/datasink/CacheTTLSelector.js +128 -129
  64. package/dist/bigconsole/components/datasink/CacheTTLSelector.js.map +1 -1
  65. package/dist/bigconsole/components/datasink/DataSinkCard.js +78 -79
  66. package/dist/bigconsole/components/datasink/DataSinkCard.js.map +1 -1
  67. package/dist/bigconsole/components/datasink/DataSinkDataViewer.js +33 -34
  68. package/dist/bigconsole/components/datasink/DataSinkDataViewer.js.map +1 -1
  69. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +79 -61
  70. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js.map +1 -1
  71. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +75 -64
  72. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js.map +1 -1
  73. package/dist/bigconsole/components/datasink/DataSinkStatusBadge.js +1 -1
  74. package/dist/bigconsole/components/datasink/DataSinkStatusBadge.js.map +1 -1
  75. package/dist/bigconsole/components/datasink/DataSinkTableViewer.js +20 -19
  76. package/dist/bigconsole/components/datasink/DataSinkTableViewer.js.map +1 -1
  77. package/dist/bigconsole/components/datasink/ExportDataSinkDialog.js +127 -171
  78. package/dist/bigconsole/components/datasink/ExportDataSinkDialog.js.map +1 -1
  79. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +113 -117
  80. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js.map +1 -1
  81. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +312 -307
  82. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js.map +1 -1
  83. package/dist/bigconsole/components/datasink/LinkedParsersPanel.js +65 -66
  84. package/dist/bigconsole/components/datasink/LinkedParsersPanel.js.map +1 -1
  85. package/dist/bigconsole/components/datasink/LinkedWorkflowsPanel.js +121 -127
  86. package/dist/bigconsole/components/datasink/LinkedWorkflowsPanel.js.map +1 -1
  87. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +194 -189
  88. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js.map +1 -1
  89. package/dist/bigconsole/components/datasink/SetupStateBadge.js +3 -3
  90. package/dist/bigconsole/components/datasink/SetupStateBadge.js.map +1 -1
  91. package/dist/bigconsole/components/datasink/WorkflowStatusPanel.js +95 -95
  92. package/dist/bigconsole/components/datasink/WorkflowStatusPanel.js.map +1 -1
  93. package/dist/bigconsole/components/parser/DataSinkSelector.js +163 -131
  94. package/dist/bigconsole/components/parser/DataSinkSelector.js.map +1 -1
  95. package/dist/bigconsole/components/parser/ExpressionEditor.js +3 -3
  96. package/dist/bigconsole/components/parser/ExpressionEditor.js.map +1 -1
  97. package/dist/bigconsole/components/parser/ImportParserDialog.js +205 -260
  98. package/dist/bigconsole/components/parser/ImportParserDialog.js.map +1 -1
  99. package/dist/bigconsole/components/parser/ParserCard.js +133 -114
  100. package/dist/bigconsole/components/parser/ParserCard.js.map +1 -1
  101. package/dist/bigconsole/components/parser/ParserSelector.js +193 -174
  102. package/dist/bigconsole/components/parser/ParserSelector.js.map +1 -1
  103. package/dist/bigconsole/components/parser/ParserStatusBadge.js +2 -2
  104. package/dist/bigconsole/components/parser/ParserStatusBadge.js.map +1 -1
  105. package/dist/bigconsole/components/parser/ParserTypeBadge.js +4 -4
  106. package/dist/bigconsole/components/parser/ParserTypeBadge.js.map +1 -1
  107. package/dist/bigconsole/components/pipeline/PipelineCard.js +134 -89
  108. package/dist/bigconsole/components/pipeline/PipelineCard.js.map +1 -1
  109. package/dist/bigconsole/components/pipeline/PipelineDeleteDialog.js +77 -64
  110. package/dist/bigconsole/components/pipeline/PipelineDeleteDialog.js.map +1 -1
  111. package/dist/bigconsole/components/pipeline/PipelineStatusBadge.js +7 -10
  112. package/dist/bigconsole/components/pipeline/PipelineStatusBadge.js.map +1 -1
  113. package/dist/bigconsole/components/preview/AiPreviewContent.js +31 -32
  114. package/dist/bigconsole/components/preview/AiPreviewContent.js.map +1 -1
  115. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +152 -103
  116. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js.map +1 -1
  117. package/dist/bigconsole/components/preview/AiPreviewPanel.js +193 -148
  118. package/dist/bigconsole/components/preview/AiPreviewPanel.js.map +1 -1
  119. package/dist/bigconsole/components/preview/previewShared.js +41 -23
  120. package/dist/bigconsole/components/preview/previewShared.js.map +1 -1
  121. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +405 -364
  122. package/dist/bigconsole/components/widgets/ActionConfigDialog.js.map +1 -1
  123. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +265 -237
  124. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js.map +1 -1
  125. package/dist/bigconsole/components/widgets/PropertiesPanel.js +764 -821
  126. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  127. package/dist/bigconsole/components/widgets/WidgetErrorBoundary.js +7 -5
  128. package/dist/bigconsole/components/widgets/WidgetErrorBoundary.js.map +1 -1
  129. package/dist/bigconsole/components/widgets/WidgetHeader.js +7 -8
  130. package/dist/bigconsole/components/widgets/WidgetHeader.js.map +1 -1
  131. package/dist/bigconsole/components/widgets/WidgetWrapper.js +8 -7
  132. package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
  133. package/dist/bigconsole/components/widgets/adaptive-card/AdaptiveCardWidget.js +1 -1
  134. package/dist/bigconsole/components/widgets/adaptive-card/AdaptiveCardWidget.js.map +1 -1
  135. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +46 -49
  136. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js.map +1 -1
  137. package/dist/bigconsole/components/widgets/chart/ChartConfig.js +154 -147
  138. package/dist/bigconsole/components/widgets/chart/ChartConfig.js.map +1 -1
  139. package/dist/bigconsole/components/widgets/comments/WidgetComments.js +118 -101
  140. package/dist/bigconsole/components/widgets/comments/WidgetComments.js.map +1 -1
  141. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +244 -191
  142. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js.map +1 -1
  143. package/dist/bigconsole/components/widgets/form/FormWidget.js +167 -159
  144. package/dist/bigconsole/components/widgets/form/FormWidget.js.map +1 -1
  145. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +92 -76
  146. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js.map +1 -1
  147. package/dist/bigconsole/components/widgets/gauge/GaugeWidget.js +1 -1
  148. package/dist/bigconsole/components/widgets/gauge/GaugeWidget.js.map +1 -1
  149. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +89 -86
  150. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js.map +1 -1
  151. package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.js +2 -2
  152. package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.js.map +1 -1
  153. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +64 -63
  154. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js.map +1 -1
  155. package/dist/bigconsole/components/widgets/kpi-comparison/KPIComparisonWidget.js +2 -2
  156. package/dist/bigconsole/components/widgets/kpi-comparison/KPIComparisonWidget.js.map +1 -1
  157. package/dist/bigconsole/components/widgets/list/ListConfig.js +65 -58
  158. package/dist/bigconsole/components/widgets/list/ListConfig.js.map +1 -1
  159. package/dist/bigconsole/components/widgets/list/ListItem.js +1 -1
  160. package/dist/bigconsole/components/widgets/list/ListItem.js.map +1 -1
  161. package/dist/bigconsole/components/widgets/map-widget/MapWidget.js +1 -1
  162. package/dist/bigconsole/components/widgets/map-widget/MapWidget.js.map +1 -1
  163. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +79 -72
  164. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js.map +1 -1
  165. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +35 -34
  166. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js.map +1 -1
  167. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +20 -19
  168. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js.map +1 -1
  169. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +181 -180
  170. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js.map +1 -1
  171. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +100 -90
  172. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js.map +1 -1
  173. package/dist/bigconsole/components/widgets/retention/RetentionWidget.js +3 -3
  174. package/dist/bigconsole/components/widgets/retention/RetentionWidget.js.map +1 -1
  175. package/dist/bigconsole/components/widgets/states/EmptyState.js +6 -4
  176. package/dist/bigconsole/components/widgets/states/EmptyState.js.map +1 -1
  177. package/dist/bigconsole/components/widgets/states/ErrorState.js +7 -5
  178. package/dist/bigconsole/components/widgets/states/ErrorState.js.map +1 -1
  179. package/dist/bigconsole/components/widgets/states/LoadingState.js +5 -4
  180. package/dist/bigconsole/components/widgets/states/LoadingState.js.map +1 -1
  181. package/dist/bigconsole/components/widgets/table/TableConfig.js +193 -172
  182. package/dist/bigconsole/components/widgets/table/TableConfig.js.map +1 -1
  183. package/dist/bigconsole/components/widgets/table/TableHeader.js +1 -1
  184. package/dist/bigconsole/components/widgets/table/TableHeader.js.map +1 -1
  185. package/dist/bigconsole/components/widgets/table/TableWidget.js +1 -1
  186. package/dist/bigconsole/components/widgets/table/TableWidget.js.map +1 -1
  187. package/dist/bigconsole/components/widgets/text-widget/TextWidget.js +1 -1
  188. package/dist/bigconsole/components/widgets/text-widget/TextWidget.js.map +1 -1
  189. package/dist/bigconsole/components/widgets/timeline/TimelineWidget.js +3 -3
  190. package/dist/bigconsole/components/widgets/timeline/TimelineWidget.js.map +1 -1
  191. package/dist/bigconsole/components/widgets/utils/conditionalFormat.js +2 -2
  192. package/dist/bigconsole/components/widgets/utils/conditionalFormat.js.map +1 -1
  193. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +283 -249
  194. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js.map +1 -1
  195. package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js +28 -20
  196. package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js.map +1 -1
  197. package/dist/bigconsole/components/workflow/WorkflowCard.js +92 -77
  198. package/dist/bigconsole/components/workflow/WorkflowCard.js.map +1 -1
  199. package/dist/bigconsole/components/workflow/WorkflowDeleteDialog.js +70 -51
  200. package/dist/bigconsole/components/workflow/WorkflowDeleteDialog.js.map +1 -1
  201. package/dist/bigconsole/components/workflow/WorkflowStatusBadge.js +16 -17
  202. package/dist/bigconsole/components/workflow/WorkflowStatusBadge.js.map +1 -1
  203. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +46 -42
  204. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js.map +1 -1
  205. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +372 -348
  206. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js.map +1 -1
  207. package/dist/bigconsole/hooks/useModalFocusTrap.js +53 -0
  208. package/dist/bigconsole/hooks/useModalFocusTrap.js.map +1 -0
  209. package/dist/bigconsole/pages/DashboardBuilderPage.js +153 -142
  210. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  211. package/dist/bigconsole/pages/DashboardViewPage.js +230 -220
  212. package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
  213. package/dist/bigconsole/pages/DashboardsPage.js +832 -790
  214. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  215. package/dist/bigconsole/pages/DataParsersPage.js +249 -304
  216. package/dist/bigconsole/pages/DataParsersPage.js.map +1 -1
  217. package/dist/bigconsole/pages/DataSinkBuilderPage.js +324 -349
  218. package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
  219. package/dist/bigconsole/pages/DataSinkViewPage.js +336 -323
  220. package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
  221. package/dist/bigconsole/pages/DataSinksPage.js +356 -458
  222. package/dist/bigconsole/pages/DataSinksPage.js.map +1 -1
  223. package/dist/bigconsole/pages/DataSourcesPage.js +14 -8
  224. package/dist/bigconsole/pages/DataSourcesPage.js.map +1 -1
  225. package/dist/bigconsole/pages/HomePage.js +186 -193
  226. package/dist/bigconsole/pages/HomePage.js.map +1 -1
  227. package/dist/bigconsole/pages/InsightsPage.js +901 -724
  228. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  229. package/dist/bigconsole/pages/ParserBuilderPage.js +769 -675
  230. package/dist/bigconsole/pages/ParserBuilderPage.js.map +1 -1
  231. package/dist/bigconsole/pages/ParserViewPage.js +382 -354
  232. package/dist/bigconsole/pages/ParserViewPage.js.map +1 -1
  233. package/dist/bigconsole/pages/PipelineBuilderPage.js +540 -420
  234. package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
  235. package/dist/bigconsole/pages/PipelineViewPage.js +416 -384
  236. package/dist/bigconsole/pages/PipelineViewPage.js.map +1 -1
  237. package/dist/bigconsole/pages/PipelinesPage.js +260 -309
  238. package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
  239. package/dist/bigconsole/pages/SettingsPage.js +177 -172
  240. package/dist/bigconsole/pages/SettingsPage.js.map +1 -1
  241. package/dist/bigconsole/pages/WidgetDemoPage.js +278 -142
  242. package/dist/bigconsole/pages/WidgetDemoPage.js.map +1 -1
  243. package/dist/bigconsole/pages/WorkflowViewPage.js +382 -366
  244. package/dist/bigconsole/pages/WorkflowViewPage.js.map +1 -1
  245. package/dist/bigconsole/pages/WorkflowsPage.js +202 -316
  246. package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
  247. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +111 -109
  248. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js.map +1 -1
  249. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +127 -126
  250. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js.map +1 -1
  251. package/dist/bigconsole/renderers/adapters/CustomRenderer.js +103 -103
  252. package/dist/bigconsole/renderers/adapters/CustomRenderer.js.map +1 -1
  253. package/package.json +2 -1
@@ -1,67 +1,80 @@
1
1
  import { useAppNavigate as e } from "../contexts/NavigationContext.js";
2
2
  import "../contexts/index.js";
3
- import t from "../hooks/useDashboardOperations.js";
4
- import ee from "../hooks/useDataSinkOperations.js";
5
- import te from "../hooks/useParserOperations.js";
6
- import { BIGCONSOLE_PERMISSIONS as n } from "../../constants/permissions.js";
7
- import ne from "../components/datasink/CacheTTLSelector.js";
8
- import { memo as r, useCallback as i, useEffect as a, useMemo as re, useRef as ie, useState as o } from "react";
3
+ import { Section as t, SectionStack as n } from "../components/common/Section.js";
4
+ import "../components/common/index.js";
5
+ import ee from "../hooks/useDashboardOperations.js";
6
+ import te from "../hooks/useDataSinkOperations.js";
7
+ import ne from "../hooks/useParserOperations.js";
8
+ import { BIGCONSOLE_PERMISSIONS as r } from "../../constants/permissions.js";
9
+ import re from "../components/datasink/CacheTTLSelector.js";
10
+ import { memo as i, useCallback as a, useEffect as o, useMemo as s, useRef as ie, useState as c } from "react";
9
11
  import { useParams as ae } from "react-router";
10
- import { AccessDenied as oe, PermissionButton as s } from "@burdenoff/fe-libs/shared/components";
11
- import { usePermissions as se } from "@burdenoff/fe-libs/shared/providers/shell";
12
- import { AlertCircle as c, ArrowLeft as ce, CheckCircle2 as le, ChevronDown as ue, ChevronRight as de, Code as fe, Download as pe, Eye as me, FileCode2 as he, LayoutDashboard as ge, Loader2 as l, Play as _e, Save as ve, Settings as ye, X as be } from "lucide-react";
13
- import { Button as u, CardContent as xe, CardHeader as Se, CardTitle as Ce, GlassCard as we, PagePurpose as Te, Stepper as Ee } from "@burdenoff/fe-libs/ui";
14
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
12
+ import { AccessDenied as oe, PermissionButton as se } from "@burdenoff/fe-libs/shared/components";
13
+ import { usePermissions as ce } from "@burdenoff/fe-libs/shared/providers/shell";
14
+ import { AlertCircle as l, ArrowLeft as le, CheckCircle2 as ue, ChevronDown as de, ChevronRight as fe, Code as pe, Download as me, Eye as he, FileCode2 as ge, LayoutDashboard as _e, Loader2 as u, Play as ve, Save as ye, Settings as be, X as xe } from "lucide-react";
15
+ import { useI18n as Se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
16
+ import { Button as d, PagePurpose as Ce, Stepper as we } from "@burdenoff/fe-libs/ui";
17
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
15
18
  //#region src/bigconsole/pages/ParserBuilderPage.tsx
16
- var m = 25, De = "default", Oe = [
19
+ var h = "w-full min-w-0 min-h-control-md rounded-md border bg-bg-surface px-3 py-2.5 text-sm text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-action-primary-bg motion-safe:transition-colors disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60";
20
+ function g(e = !1, t = "") {
21
+ return `${h} ${e ? "border-status-error-border" : "border-[var(--color-border-default)]"} ${t}`.trim();
22
+ }
23
+ var _ = "block text-sm font-medium text-text-primary mb-2", v = "text-xs text-text-muted mt-1.5", y = 25, Te = "default", Ee = [
17
24
  "details",
18
25
  "source",
19
26
  "expression",
20
27
  "review"
21
- ], h = [
22
- {
23
- key: "details",
24
- label: "Details",
25
- description: "Name & scope"
26
- },
27
- {
28
- key: "source",
29
- label: "Source & Type",
30
- description: "Engine & data"
31
- },
32
- {
33
- key: "expression",
34
- label: "Expression & Test",
35
- description: "Transform & verify"
36
- },
37
- {
38
- key: "review",
39
- label: "Cache & Review",
40
- description: "Finish up"
41
- }
42
28
  ];
43
- function ke(e) {
29
+ function De(e) {
30
+ return [
31
+ {
32
+ key: "details",
33
+ label: e("bigconsole.parsers.builder.steps.details.label", "Details"),
34
+ description: e("bigconsole.parsers.builder.steps.details.description", "Name & scope")
35
+ },
36
+ {
37
+ key: "source",
38
+ label: e("bigconsole.parsers.builder.steps.source.label", "Source & Type"),
39
+ description: e("bigconsole.parsers.builder.steps.source.description", "Engine & data")
40
+ },
41
+ {
42
+ key: "expression",
43
+ label: e("bigconsole.parsers.builder.steps.expression.label", "Expression & Test"),
44
+ description: e("bigconsole.parsers.builder.steps.expression.description", "Transform & verify")
45
+ },
46
+ {
47
+ key: "review",
48
+ label: e("bigconsole.parsers.builder.steps.review.label", "Cache & Review"),
49
+ description: e("bigconsole.parsers.builder.steps.review.description", "Finish up")
50
+ }
51
+ ];
52
+ }
53
+ function Oe(e) {
44
54
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").substring(0, 64);
45
55
  }
56
+ function ke(e, t) {
57
+ let n = {};
58
+ return e.name.trim() ? e.name.length < 2 && (n.name = t("bigconsole.parsers.builder.validation.nameMinLength", "Name must be at least 2 characters")) : n.name = t("bigconsole.parsers.builder.validation.nameRequired", "Name is required"), e.outputKey.trim() ? /^[a-z0-9_]+$/.test(e.outputKey) || (n.outputKey = t("bigconsole.parsers.builder.validation.outputKeyInvalid", "Output key can only contain lowercase letters, numbers, and underscores")) : n.outputKey = t("bigconsole.parsers.builder.validation.outputKeyRequired", "Output key is required"), e.expression.trim() || (n.expression = t("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required")), e.inputSinkKey.trim() || (n.inputSinkKey = t("bigconsole.parsers.builder.validation.inputSinkRequired", "Source DataSink is required")), e.ttl != null && e.ttl > 0 && (e.ttl < 30 || e.ttl > 86400) && (n.ttl = t("bigconsole.parsers.builder.validation.cacheDurationRange", "Cache duration must be between 30 and 86400 seconds")), n;
59
+ }
46
60
  function Ae(e) {
47
- let t = {};
48
- return e.name.trim() ? e.name.length < 2 && (t.name = "Name must be at least 2 characters") : t.name = "Name is required", e.outputKey.trim() ? /^[a-z0-9_]+$/.test(e.outputKey) || (t.outputKey = "Output key can only contain lowercase letters, numbers, and underscores") : t.outputKey = "Output key is required", e.expression.trim() || (t.expression = "Expression is required"), e.inputSinkKey.trim() || (t.inputSinkKey = "Source DataSink is required"), e.ttl != null && e.ttl > 0 && (e.ttl < 30 || e.ttl > 86400) && (t.ttl = "Cache duration must be between 30 and 86400 seconds"), t;
61
+ return {
62
+ jq: {
63
+ name: e("bigconsole.parsers.builder.parserType.jq.name", "JQ"),
64
+ description: e("bigconsole.parsers.builder.parserType.jq.description", "Lightweight JSON processor - fast and efficient for simple transformations"),
65
+ placeholder: ".data | map({name: .name, value: .count})",
66
+ example: e("bigconsole.parsers.builder.parserType.jq.example", ".data | map(.name) - Extract names from data array")
67
+ },
68
+ jsonata: {
69
+ name: e("bigconsole.parsers.builder.parserType.jsonata.name", "JSONata"),
70
+ description: e("bigconsole.parsers.builder.parserType.jsonata.description", "Query and transformation language - supports complex queries and calculations"),
71
+ placeholder: "$sum(data[*].value)",
72
+ example: e("bigconsole.parsers.builder.parserType.jsonata.example", "$sum(data.values) - Calculate sum of values")
73
+ }
74
+ };
49
75
  }
50
- var g = {
51
- jq: {
52
- name: "JQ",
53
- description: "Lightweight JSON processor - fast and efficient for simple transformations",
54
- placeholder: ".data | map({name: .name, value: .count})",
55
- example: ".data | map(.name) - Extract names from data array"
56
- },
57
- jsonata: {
58
- name: "JSONata",
59
- description: "Query and transformation language - supports complex queries and calculations",
60
- placeholder: "$sum(data[*].value)",
61
- example: "$sum(data.values) - Calculate sum of values"
62
- }
63
- }, _ = "w-full px-3 py-2.5 text-sm text-text-primary bg-bg-surface border rounded-md placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-bg transition-all", v = r(function() {
64
- let { parserId: r, consoleId: v } = ae(), je = e(), [y, b] = o(0), [x, S] = o(De), C = v || x || De, w = r !== "new" && !!r, { hasPermission: Me, isLoading: Ne } = se(), Pe = Me(n.PARSER_READ), Fe = Me(w ? n.PARSER_UPDATE : n.PARSER_CREATE), Ie = w ? n.PARSER_UPDATE : n.PARSER_CREATE, T = !v, [E, D] = o({
76
+ var b = i(function() {
77
+ let { parserId: i, consoleId: h } = ae(), b = e(), { t: x } = Se(), je = s(() => De(x), [x]), S = s(() => Ae(x), [x]), C = je.length, [w, T] = c(0), [E, Me] = c(Te), Ne = h || E || Te, D = i !== "new" && !!i, { hasPermission: Pe, isLoading: Fe } = ce(), Ie = Pe(r.PARSER_READ), Le = Pe(D ? r.PARSER_UPDATE : r.PARSER_CREATE), Re = D ? r.PARSER_UPDATE : r.PARSER_CREATE, O = !h, [k, A] = c({
65
78
  name: "",
66
79
  outputKey: "",
67
80
  description: "",
@@ -69,771 +82,852 @@ var g = {
69
82
  expression: "",
70
83
  inputSinkKey: "",
71
84
  ttl: 900
72
- }), [O, k] = o({}), [Le, Re] = o(!1), [ze, Be] = o(!1), [Ve, He] = o(null), [A, j] = o("{\n \"data\": [\n {\"name\": \"Item 1\", \"count\": 10},\n {\"name\": \"Item 2\", \"count\": 20}\n ]\n}"), [M, N] = o(""), [P, F] = o(null), [Ue, We] = o(!1), [I, L] = o(null), [R, z] = o(!1), [B, V] = o(null), [Ge, Ke] = o(!1), H = ie(E.inputSinkKey);
73
- a(() => {
74
- H.current = E.inputSinkKey;
75
- }, [E.inputSinkKey]);
76
- let [U, W] = o(!1), [qe, Je] = o(null), [Ye, Xe] = o(!1), [Ze, G] = o(null), [K, Qe] = o(null), { loading: $e, error: et, parsers: tt, fetchParser: nt, createParser: rt, updateParser: it, testParserExpression: at } = te({
77
- consoleId: C || "",
85
+ }), [j, M] = c({}), [ze, Be] = c(!1), [Ve, He] = c(!1), [Ue, We] = c(null), [N, P] = c("{\n \"data\": [\n {\"name\": \"Item 1\", \"count\": 10},\n {\"name\": \"Item 2\", \"count\": 20}\n ]\n}"), [F, I] = c(""), [L, R] = c(null), [Ge, Ke] = c(!1), [z, B] = c(null), [V, H] = c(!1), [U, qe] = c(null), [Je, Ye] = c(!1), W = ie(k.inputSinkKey);
86
+ o(() => {
87
+ W.current = k.inputSinkKey;
88
+ }, [k.inputSinkKey]);
89
+ let [G, Xe] = c(!1), [Ze, Qe] = c(null), [$e, et] = c(!1), [tt, K] = c(null), [q, nt] = c(null), { loading: rt, error: it, parsers: at, fetchParser: ot, createParser: st, updateParser: ct, testParserExpression: lt } = ne({
90
+ consoleId: Ne || "",
78
91
  skipFetch: !0
79
- }), { dataSinks: q, fetchDataSinks: ot, getDataSinkData: J } = ee({ skipFetch: !0 }), { dashboards: st, fetchDashboards: ct, loading: lt } = t(), Y = w ? tt.find((e) => e.id === r) : null;
80
- a(() => {
81
- ot(), w && r && nt(r), T && ct();
92
+ }), { dataSinks: J, fetchDataSinks: ut, getDataSinkData: Y } = te({ skipFetch: !0 }), { dashboards: dt, fetchDashboards: ft, loading: pt } = ee(), X = D ? at.find((e) => e.id === i) : null;
93
+ o(() => {
94
+ ut(), D && i && ot(i), O && ft();
82
95
  }, [
83
- w,
84
- r,
85
- nt,
96
+ D,
97
+ i,
86
98
  ot,
87
- T,
88
- ct
89
- ]), a(() => {
90
- Y && (D({
91
- name: Y.name || "",
92
- outputKey: Y.outputKey || "",
93
- description: Y.description || "",
94
- type: Y.type,
95
- expression: Y.expression || "",
96
- inputSinkKey: Y.inputSinkKey || "",
97
- ttl: Y.ttl ?? null
98
- }), Re(!0), Y.consoleId && S(Y.consoleId));
99
- }, [Y]);
100
- let X = re(() => q.find((e) => e.key === E.inputSinkKey)?.name || E.inputSinkKey, [q, E.inputSinkKey]), ut = i((e) => {
99
+ ut,
100
+ O,
101
+ ft
102
+ ]), o(() => {
103
+ X && (A({
104
+ name: X.name || "",
105
+ outputKey: X.outputKey || "",
106
+ description: X.description || "",
107
+ type: X.type,
108
+ expression: X.expression || "",
109
+ inputSinkKey: X.inputSinkKey || "",
110
+ ttl: X.ttl ?? null
111
+ }), Be(!0), X.consoleId && Me(X.consoleId));
112
+ }, [X]);
113
+ let Z = s(() => J.find((e) => e.key === k.inputSinkKey)?.name || k.inputSinkKey, [J, k.inputSinkKey]), mt = a((e) => {
101
114
  let t = e.target.value;
102
- D((e) => ({
115
+ A((e) => ({
103
116
  ...e,
104
117
  name: t,
105
- outputKey: Le ? e.outputKey : ke(t)
106
- })), k((e) => ({
118
+ outputKey: ze ? e.outputKey : Oe(t)
119
+ })), M((e) => ({
107
120
  ...e,
108
121
  name: void 0
109
122
  }));
110
- }, [Le]), dt = i((e) => {
123
+ }, [ze]), ht = a((e) => {
111
124
  let t = e.target.value.toLowerCase().replace(/[^a-z0-9_]/g, "");
112
- D((e) => ({
125
+ A((e) => ({
113
126
  ...e,
114
127
  outputKey: t
115
- })), Re(!0), k((e) => ({
128
+ })), Be(!0), M((e) => ({
116
129
  ...e,
117
130
  outputKey: void 0
118
131
  }));
119
- }, []), ft = i((e) => {
120
- D((t) => ({
132
+ }, []), gt = a((e) => {
133
+ A((t) => ({
121
134
  ...t,
122
135
  description: e.target.value
123
136
  }));
124
- }, []), pt = i((e) => {
125
- D((t) => ({
137
+ }, []), _t = a((e) => {
138
+ A((t) => ({
126
139
  ...t,
127
140
  type: e
128
- })), N(""), F(null);
129
- }, []), mt = i((e) => {
130
- D((t) => ({
141
+ })), I(""), R(null);
142
+ }, []), vt = a((e) => {
143
+ A((t) => ({
131
144
  ...t,
132
145
  expression: e.target.value
133
- })), k((e) => ({
146
+ })), M((e) => ({
134
147
  ...e,
135
148
  expression: void 0
136
149
  }));
137
- }, []), ht = i((e) => {
138
- D((t) => ({
150
+ }, []), yt = a((e) => {
151
+ A((t) => ({
139
152
  ...t,
140
153
  inputSinkKey: e.target.value
141
- })), k((e) => ({
154
+ })), M((e) => ({
142
155
  ...e,
143
156
  inputSinkKey: void 0
144
- })), W(!1), Je(null), Qe(null), G(null), R && (j(""), z(!1)), V(null), N(""), F(null), L(null);
145
- }, [R]), gt = i((e) => {
146
- D((t) => ({
157
+ })), Xe(!1), Qe(null), nt(null), K(null), V && (P(""), H(!1)), qe(null), I(""), R(null), B(null);
158
+ }, [V]), bt = a((e) => {
159
+ A((t) => ({
147
160
  ...t,
148
161
  ttl: e
149
- })), k((e) => ({
162
+ })), M((e) => ({
150
163
  ...e,
151
164
  ttl: void 0
152
165
  }));
153
- }, []), _t = i((e) => {
154
- S(e.target.value);
155
- }, []), vt = i((e) => {
156
- j(e.target.value);
157
- }, []), yt = i(async () => {
158
- let e = E.inputSinkKey;
166
+ }, []), xt = a((e) => {
167
+ Me(e.target.value);
168
+ }, []), St = a((e) => {
169
+ P(e.target.value);
170
+ }, []), Ct = a(async () => {
171
+ let e = k.inputSinkKey;
159
172
  if (e) {
160
- Ke(!0);
173
+ Ye(!0);
161
174
  try {
162
- let t = await J({ key: e }, { limit: m });
163
- if (H.current !== e) return;
164
- t?.raw !== void 0 && t?.raw !== null ? (j(JSON.stringify(t.raw, null, 2)), z(!0), V({
175
+ let t = await Y({ key: e }, { limit: y });
176
+ if (W.current !== e) return;
177
+ t?.raw !== void 0 && t?.raw !== null ? (P(JSON.stringify(t.raw, null, 2)), H(!0), qe({
165
178
  total: t.totalCount ?? null,
166
179
  hasMore: t.hasMore ?? null,
167
- sinkName: X
168
- }), N(""), F(null), L(null)) : F("Could not load a sample from the selected DataSink.");
180
+ sinkName: Z
181
+ }), I(""), R(null), B(null)) : R(x("bigconsole.parsers.builder.errors.loadSampleFailed", "Could not load a sample from the selected DataSink."));
169
182
  } catch (t) {
170
- if (H.current !== e) return;
171
- F(t instanceof Error ? t.message : "Failed to load sample data");
183
+ if (W.current !== e) return;
184
+ R(t instanceof Error ? t.message : x("bigconsole.parsers.builder.errors.loadSampleDataFailed", "Failed to load sample data"));
172
185
  } finally {
173
- Ke(!1);
186
+ Ye(!1);
174
187
  }
175
188
  }
176
189
  }, [
177
- E.inputSinkKey,
178
- J,
179
- X
180
- ]), bt = i(() => {
181
- j(""), z(!1), V(null), L(null), N(""), F(null);
182
- }, []), xt = i(async () => {
183
- if (U) {
184
- W(!1);
190
+ k.inputSinkKey,
191
+ Y,
192
+ Z,
193
+ x
194
+ ]), wt = a(() => {
195
+ P(""), H(!1), qe(null), B(null), I(""), R(null);
196
+ }, []), Tt = a(async () => {
197
+ if (G) {
198
+ Xe(!1);
185
199
  return;
186
200
  }
187
- if (!E.inputSinkKey) {
188
- G("Please select a source DataSink first");
201
+ if (!k.inputSinkKey) {
202
+ K(x("bigconsole.parsers.builder.errors.selectSourceFirst", "Please select a source DataSink first"));
189
203
  return;
190
204
  }
191
- W(!0), Xe(!0), G(null);
192
- let e = E.inputSinkKey;
205
+ Xe(!0), et(!0), K(null);
206
+ let e = k.inputSinkKey;
193
207
  try {
194
- let t = await J({ key: e }, { limit: m });
195
- if (H.current !== e) return;
196
- t?.raw !== void 0 && t?.raw !== null ? (Je(t.raw), Qe({
208
+ let t = await Y({ key: e }, { limit: y });
209
+ if (W.current !== e) return;
210
+ t?.raw !== void 0 && t?.raw !== null ? (Qe(t.raw), nt({
197
211
  total: t.totalCount ?? null,
198
212
  hasMore: t.hasMore ?? null,
199
- sinkName: X
200
- })) : G("No data available in selected DataSink");
213
+ sinkName: Z
214
+ })) : K(x("bigconsole.parsers.builder.errors.noDataInSink", "No data available in selected DataSink"));
201
215
  } catch (t) {
202
- if (H.current !== e) return;
203
- G(t instanceof Error ? t.message : "Failed to load data");
216
+ if (W.current !== e) return;
217
+ K(t instanceof Error ? t.message : x("bigconsole.parsers.builder.errors.loadDataFailed", "Failed to load data"));
204
218
  } finally {
205
- Xe(!1);
219
+ et(!1);
206
220
  }
207
221
  }, [
208
- U,
209
- E.inputSinkKey,
210
- J,
211
- X
212
- ]), St = i(async () => {
213
- if (!E.expression.trim()) {
214
- F("Expression is required");
222
+ G,
223
+ k.inputSinkKey,
224
+ Y,
225
+ Z,
226
+ x
227
+ ]), Et = a(async () => {
228
+ if (!k.expression.trim()) {
229
+ R(x("bigconsole.parsers.builder.validation.expressionRequired", "Expression is required"));
215
230
  return;
216
231
  }
217
232
  let e;
218
- if (R) e = {
219
- type: E.type,
220
- expression: E.expression,
221
- dataSinkKey: E.inputSinkKey,
222
- sampleLimit: m
233
+ if (V) e = {
234
+ type: k.type,
235
+ expression: k.expression,
236
+ dataSinkKey: k.inputSinkKey,
237
+ sampleLimit: y
223
238
  };
224
239
  else {
225
240
  let t;
226
241
  try {
227
- t = JSON.parse(A);
242
+ t = JSON.parse(N);
228
243
  } catch {
229
- F("Input JSON is not valid JSON");
244
+ R(x("bigconsole.parsers.builder.errors.invalidInputJson", "Input JSON is not valid JSON"));
230
245
  return;
231
246
  }
232
247
  e = {
233
- type: E.type,
234
- expression: E.expression,
248
+ type: k.type,
249
+ expression: k.expression,
235
250
  sampleData: t
236
251
  };
237
252
  }
238
- We(!0), F(null), N(""), L(null);
253
+ Ke(!0), R(null), I(""), B(null);
239
254
  try {
240
- let t = await at(e);
241
- t ? t.success ? (N(JSON.stringify(t.output, null, 2)), t.sampled && L({
255
+ let t = await lt(e);
256
+ t ? t.success ? (I(JSON.stringify(t.output, null, 2)), t.sampled && B({
242
257
  sampledRows: t.sampledRows ?? null,
243
258
  totalRows: t.totalRows ?? null
244
- })) : F(t.error || "Test failed") : F("Test request failed — please try again.");
259
+ })) : R(t.error || x("bigconsole.parsers.builder.errors.testFailed", "Test failed")) : R(x("bigconsole.parsers.builder.errors.testRequestFailed", "Test request failed — please try again."));
245
260
  } catch (e) {
246
- F(e instanceof Error ? e.message : "Test failed");
261
+ R(e instanceof Error ? e.message : x("bigconsole.parsers.builder.errors.testFailed", "Test failed"));
247
262
  } finally {
248
- We(!1);
263
+ Ke(!1);
249
264
  }
250
265
  }, [
251
- E.type,
252
- E.expression,
253
- E.inputSinkKey,
254
- A,
255
- R,
256
- at
257
- ]), Z = i(() => {
258
- je(v ? `/dashboards/${v}/parsers` : "/parsers");
259
- }, [je, v]), Ct = i(async () => {
260
- He(null);
261
- let e = Ae(E);
266
+ k.type,
267
+ k.expression,
268
+ k.inputSinkKey,
269
+ N,
270
+ V,
271
+ lt,
272
+ x
273
+ ]), Q = a(() => {
274
+ b(h ? `/dashboards/${h}/parsers` : "/parsers");
275
+ }, [b, h]), Dt = a(async () => {
276
+ We(null);
277
+ let e = ke(k, x);
262
278
  if (Object.keys(e).length > 0) {
263
- k(e), e.name || e.outputKey ? b(0) : e.inputSinkKey ? b(1) : e.expression && b(2);
279
+ M(e), e.name || e.outputKey ? T(0) : e.inputSinkKey ? T(1) : e.expression && T(2);
264
280
  return;
265
281
  }
266
- Be(!0);
282
+ He(!0);
267
283
  try {
268
- if (w && Y) {
269
- if (!await it(Y.id, {
270
- name: E.name,
271
- description: E.description || void 0,
272
- expression: E.expression,
273
- inputSinkKey: E.inputSinkKey,
274
- outputKey: E.outputKey,
275
- ttl: E.ttl
276
- }, Y.version)) throw Error("Failed to update parser");
277
- } else if (!await rt({
278
- consoleId: C || "",
279
- name: E.name,
280
- type: E.type,
281
- expression: E.expression,
282
- inputSinkKey: E.inputSinkKey,
283
- outputKey: E.outputKey,
284
- description: E.description || void 0,
285
- ttl: E.ttl ?? void 0
286
- })) throw Error("Failed to create parser");
287
- Z();
284
+ if (D && X) {
285
+ if (!await ct(X.id, {
286
+ name: k.name,
287
+ description: k.description || void 0,
288
+ expression: k.expression,
289
+ inputSinkKey: k.inputSinkKey,
290
+ outputKey: k.outputKey,
291
+ ttl: k.ttl
292
+ }, X.version)) throw Error(x("bigconsole.parsers.builder.errors.updateFailed", "Failed to update parser"));
293
+ } else if (!await st({
294
+ consoleId: Ne || "",
295
+ name: k.name,
296
+ type: k.type,
297
+ expression: k.expression,
298
+ inputSinkKey: k.inputSinkKey,
299
+ outputKey: k.outputKey,
300
+ description: k.description || void 0,
301
+ ttl: k.ttl ?? void 0
302
+ })) throw Error(x("bigconsole.parsers.builder.errors.createFailed", "Failed to create parser"));
303
+ Q();
288
304
  } catch (e) {
289
- He(e instanceof Error ? e.message : "Failed to save parser");
305
+ We(e instanceof Error ? e.message : x("bigconsole.parsers.builder.errors.saveFailed", "Failed to save parser"));
290
306
  } finally {
291
- Be(!1);
307
+ He(!1);
292
308
  }
293
309
  }, [
294
- E,
295
- w,
296
- Y,
297
- rt,
298
- it,
299
- C,
300
- Z
301
- ]), wt = re(() => E.name.trim().length >= 2 && E.expression.trim().length > 0 && E.inputSinkKey.trim().length > 0 && E.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(E.outputKey), [
302
- E.name,
303
- E.expression,
304
- E.inputSinkKey,
305
- E.outputKey
306
- ]), Q = i((e) => {
307
- switch (Oe[e]) {
308
- case "details": return E.name.trim().length >= 2 && E.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(E.outputKey);
309
- case "source": return E.inputSinkKey.trim().length > 0;
310
- case "expression": return E.expression.trim().length > 0;
310
+ k,
311
+ D,
312
+ X,
313
+ st,
314
+ ct,
315
+ Ne,
316
+ Q,
317
+ x
318
+ ]), Ot = s(() => k.name.trim().length >= 2 && k.expression.trim().length > 0 && k.inputSinkKey.trim().length > 0 && k.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(k.outputKey), [
319
+ k.name,
320
+ k.expression,
321
+ k.inputSinkKey,
322
+ k.outputKey
323
+ ]), kt = a((e) => {
324
+ switch (Ee[e]) {
325
+ case "details": return k.name.trim().length >= 2 && k.outputKey.trim().length > 0 && /^[a-z0-9_]+$/.test(k.outputKey);
326
+ case "source": return k.inputSinkKey.trim().length > 0;
327
+ case "expression": return k.expression.trim().length > 0;
311
328
  default: return !0;
312
329
  }
313
330
  }, [
314
- E.name,
315
- E.outputKey,
316
- E.inputSinkKey,
317
- E.expression
318
- ]), Tt = i((e) => {
319
- let t = Math.max(0, Math.min(e, h.length - 1));
320
- if (t > y) {
321
- for (let e = y; e < t; e++) if (!Q(e)) return;
331
+ k.name,
332
+ k.outputKey,
333
+ k.inputSinkKey,
334
+ k.expression
335
+ ]), At = a((e) => {
336
+ let t = Math.max(0, Math.min(e, C - 1));
337
+ if (t > w) {
338
+ for (let e = w; e < t; e++) if (!kt(e)) return;
322
339
  }
323
- b(t);
324
- }, [y, Q]), Et = i(() => {
325
- b((e) => Math.min(e + 1, h.length - 1));
326
- }, []), Dt = i(() => {
327
- b((e) => Math.max(e - 1, 0));
340
+ T(t);
341
+ }, [
342
+ w,
343
+ kt,
344
+ C
345
+ ]), jt = a(() => {
346
+ T((e) => Math.min(e + 1, C - 1));
347
+ }, [C]), Mt = a(() => {
348
+ T((e) => Math.max(e - 1, 0));
328
349
  }, []);
329
- if ($e && w || Ne) return /* @__PURE__ */ f("div", {
350
+ if (rt && D || Fe) return /* @__PURE__ */ p("div", {
330
351
  className: "flex items-center justify-center min-h-[400px]",
331
- children: /* @__PURE__ */ f(l, { className: "w-8 h-8 text-text-secondary animate-spin" })
352
+ children: /* @__PURE__ */ p(u, { className: "w-8 h-8 text-text-secondary animate-spin" })
332
353
  });
333
- if (w && !Pe) return /* @__PURE__ */ f(oe, {
334
- title: "Access Denied",
335
- description: "You don't have permission to view this parser."
354
+ if (D && !Ie) return /* @__PURE__ */ p(oe, {
355
+ title: x("bigconsole.parsers.builder.accessDenied.title", "Access Denied"),
356
+ description: x("bigconsole.parsers.builder.accessDenied.description", "You don't have permission to view this parser.")
336
357
  });
337
- if (et) return /* @__PURE__ */ f("div", {
338
- className: "flex items-center justify-center min-h-[400px] p-card-padding",
339
- children: /* @__PURE__ */ p("div", {
340
- className: "text-center",
341
- children: [
342
- /* @__PURE__ */ f(c, { className: "w-12 h-12 text-status-error-text mx-auto mb-4" }),
343
- /* @__PURE__ */ f("p", {
344
- className: "text-status-error-text text-body-sm font-medium mb-2",
345
- children: "Failed to load Parser"
346
- }),
347
- /* @__PURE__ */ f("p", {
348
- className: "text-text-tertiary text-body-xs",
349
- children: et.message
350
- })
351
- ]
358
+ if (it) return /* @__PURE__ */ p("div", {
359
+ className: "p-card-padding",
360
+ children: /* @__PURE__ */ p(t, {
361
+ tone: "danger",
362
+ headingLevel: 2,
363
+ title: x("bigconsole.parsers.builder.errors.loadParserFailed", "Failed to load Parser"),
364
+ description: "The parser could not be fetched, so the form cannot be filled in.",
365
+ icon: /* @__PURE__ */ p(l, { className: "h-icon-md w-icon-md text-[var(--color-status-error-text)]" }),
366
+ actions: /* @__PURE__ */ m(d, {
367
+ onClick: Q,
368
+ variant: "secondary",
369
+ size: "sm",
370
+ children: [/* @__PURE__ */ p(le, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
371
+ }),
372
+ "data-testid": "parser-builder-load-error",
373
+ children: /* @__PURE__ */ p("p", {
374
+ className: "font-mono text-xs break-words text-text-secondary",
375
+ children: it.message
376
+ })
377
+ })
378
+ });
379
+ let Nt = S[k.type], Pt = w === C - 1, $ = /* @__PURE__ */ p("span", {
380
+ className: "text-xs font-medium text-text-muted",
381
+ children: x("bigconsole.parsers.builder.header.stepCounter", "Step {{current}} of {{total}}", {
382
+ current: w + 1,
383
+ total: C
352
384
  })
353
385
  });
354
- let $ = g[E.type], Ot = y === h.length - 1;
355
- return /* @__PURE__ */ f("div", {
386
+ return /* @__PURE__ */ p("div", {
356
387
  className: "min-h-screen bg-bg-canvas",
357
388
  children: /* @__PURE__ */ p("div", {
358
389
  className: "max-w-4xl mx-auto p-card-padding pb-10",
359
- children: [
360
- /* @__PURE__ */ p("div", {
361
- className: "mb-6",
390
+ children: /* @__PURE__ */ m(n, { children: [
391
+ /* @__PURE__ */ m("div", {
392
+ className: "border-b border-[var(--color-border-subtle)] pb-form-gap",
362
393
  children: [
363
- /* @__PURE__ */ p(u, {
364
- onClick: Z,
394
+ /* @__PURE__ */ m(d, {
395
+ onClick: Q,
365
396
  variant: "ghost",
366
397
  size: "sm",
367
398
  className: "mb-4",
368
- children: [/* @__PURE__ */ f(ce, { className: "w-4 h-4 mr-2" }), "Back to Parsers"]
399
+ children: [/* @__PURE__ */ p(le, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.header.backToParsers", "Back to Parsers")]
369
400
  }),
370
- /* @__PURE__ */ f("h1", {
371
- className: "text-heading-h1 font-bold text-text-primary",
372
- children: w ? "Edit Parser" : "Create Parser"
401
+ /* @__PURE__ */ p("h1", {
402
+ className: "text-2xl font-bold text-text-primary sm:text-3xl",
403
+ children: D ? x("bigconsole.parsers.builder.header.editTitle", "Edit Parser") : x("bigconsole.parsers.builder.header.createTitle", "Create Parser")
373
404
  }),
374
- /* @__PURE__ */ f("p", {
375
- className: "text-body-sm text-text-secondary mt-1",
376
- children: "Transform data using JQ or JSONata expressions."
405
+ /* @__PURE__ */ p("p", {
406
+ className: "text-sm text-text-secondary mt-1",
407
+ children: x("bigconsole.parsers.builder.header.subtitle", "Transform data using JQ or JSONata expressions.")
377
408
  })
378
409
  ]
379
410
  }),
380
- /* @__PURE__ */ f(Te, {
381
- className: "mb-6",
382
- children: "A parser maps raw input into structured fields using a JQ or JSONata expression. Write the expression, run it against a sample to confirm the output, and save it once it produces the shape you need — then reuse it across pipelines to normalise any source."
411
+ /* @__PURE__ */ p(Ce, {
412
+ className: "max-w-[80ch]",
413
+ children: x("bigconsole.parsers.builder.header.purpose", "A parser maps raw input into structured fields using a JQ or JSONata expression. Write the expression, run it against a sample to confirm the output, and save it once it produces the shape you need — then reuse it across pipelines to normalise any source.")
383
414
  }),
384
- /* @__PURE__ */ f("div", {
385
- className: "mb-6",
386
- children: /* @__PURE__ */ f(Ee, {
387
- steps: h,
388
- active: y,
389
- onStepClick: Tt
415
+ /* @__PURE__ */ p("div", {
416
+ className: "min-w-0 overflow-x-auto",
417
+ children: /* @__PURE__ */ p(we, {
418
+ steps: je,
419
+ active: w,
420
+ onStepClick: At
390
421
  })
391
422
  }),
392
- Ve && /* @__PURE__ */ p("div", {
393
- className: "mb-6 p-4 bg-status-error-bg/10 border border-status-error-border/30 rounded-lg flex items-start gap-3",
394
- children: [/* @__PURE__ */ f(c, { className: "w-5 h-5 text-status-error-text flex-shrink-0 mt-0.5" }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
395
- className: "text-sm font-medium text-status-error-text",
396
- children: "Failed to save Parser"
397
- }), /* @__PURE__ */ f("p", {
398
- className: "text-xs text-status-error-text/80 mt-1",
399
- children: Ve
400
- })] })]
423
+ Ue && /* @__PURE__ */ p(t, {
424
+ tone: "danger",
425
+ headingLevel: 2,
426
+ title: x("bigconsole.parsers.builder.errors.saveParserFailed", "Failed to save Parser"),
427
+ icon: /* @__PURE__ */ p(l, { className: "h-icon-sm w-icon-sm text-[var(--color-status-error-text)]" }),
428
+ "data-testid": "parser-submit-error",
429
+ children: /* @__PURE__ */ p("p", {
430
+ className: "font-mono text-xs break-words text-text-secondary",
431
+ children: Ue
432
+ })
401
433
  }),
402
- /* @__PURE__ */ p(we, {
403
- treatment: "glass",
404
- glow: !0,
405
- children: [/* @__PURE__ */ f(Se, {
406
- className: "pb-4",
407
- children: /* @__PURE__ */ p("div", {
408
- className: "flex items-center gap-3",
409
- children: [/* @__PURE__ */ p("div", {
410
- className: "w-8 h-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center",
411
- children: [
412
- y === 0 && /* @__PURE__ */ f(he, { className: "w-4 h-4 text-action-primary-bg" }),
413
- y === 1 && /* @__PURE__ */ f(fe, { className: "w-4 h-4 text-action-primary-bg" }),
414
- y === 2 && /* @__PURE__ */ f(_e, { className: "w-4 h-4 text-action-primary-bg" }),
415
- y === 3 && /* @__PURE__ */ f(ye, { className: "w-4 h-4 text-action-primary-bg" })
416
- ]
417
- }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", {
418
- className: "text-xs text-text-tertiary",
419
- children: [
420
- "Step ",
421
- y + 1,
422
- " of ",
423
- h.length
424
- ]
425
- }), /* @__PURE__ */ f(Ce, {
426
- className: "text-base",
427
- children: h[y].label
428
- })] })]
429
- })
430
- }), /* @__PURE__ */ p(xe, {
431
- className: "space-y-5",
432
- children: [
433
- y === 0 && /* @__PURE__ */ p("div", {
434
- className: "space-y-5",
435
- children: [
436
- /* @__PURE__ */ p("div", {
437
- className: "grid gap-5 sm:grid-cols-2",
438
- children: [/* @__PURE__ */ p("div", { children: [
439
- /* @__PURE__ */ p("label", {
440
- htmlFor: "name",
441
- className: "block text-sm font-medium text-text-primary mb-2",
442
- children: ["Name ", /* @__PURE__ */ f("span", {
434
+ /* @__PURE__ */ m("form", {
435
+ className: "flex flex-col gap-section-gap",
436
+ onSubmit: (e) => {
437
+ e.preventDefault(), Pt && Dt();
438
+ },
439
+ children: [
440
+ w === 0 && /* @__PURE__ */ m(t, {
441
+ emphasis: "primary",
442
+ headingLevel: 2,
443
+ title: "Basic information",
444
+ description: "Essential details for your parser.",
445
+ icon: /* @__PURE__ */ p(ge, { className: "h-icon-sm w-icon-sm" }),
446
+ meta: $,
447
+ bodyClassName: "space-y-5",
448
+ "data-testid": "parser-basic-information",
449
+ children: [
450
+ /* @__PURE__ */ m("div", {
451
+ className: "grid gap-5 sm:grid-cols-2",
452
+ children: [/* @__PURE__ */ m("div", { children: [
453
+ /* @__PURE__ */ m("label", {
454
+ htmlFor: "name",
455
+ className: _,
456
+ children: [
457
+ x("bigconsole.parsers.builder.fields.name.label", "Name"),
458
+ " ",
459
+ /* @__PURE__ */ p("span", {
443
460
  className: "text-status-error-text",
444
461
  children: "*"
445
- })]
446
- }),
447
- /* @__PURE__ */ f("input", {
448
- id: "name",
449
- type: "text",
450
- value: E.name,
451
- onChange: ut,
452
- placeholder: "e.g., User Analytics Parser",
453
- className: `${_} ${O.name ? "border-status-error-border" : "border-border-default"}`
454
- }),
455
- O.name && /* @__PURE__ */ f("p", {
456
- className: "text-xs text-status-error-text mt-1.5",
457
- children: O.name
458
- })
459
- ] }), /* @__PURE__ */ p("div", { children: [
460
- /* @__PURE__ */ p("label", {
461
- htmlFor: "outputKey",
462
- className: "block text-sm font-medium text-text-primary mb-2",
463
- children: ["Output Key ", /* @__PURE__ */ f("span", {
462
+ })
463
+ ]
464
+ }),
465
+ /* @__PURE__ */ p("input", {
466
+ id: "name",
467
+ type: "text",
468
+ value: k.name,
469
+ onChange: mt,
470
+ placeholder: x("bigconsole.parsers.builder.fields.name.placeholder", "e.g., User Analytics Parser"),
471
+ className: g(!!j.name)
472
+ }),
473
+ j.name && /* @__PURE__ */ p("p", {
474
+ className: "text-xs text-status-error-text mt-1.5",
475
+ children: j.name
476
+ })
477
+ ] }), /* @__PURE__ */ m("div", { children: [
478
+ /* @__PURE__ */ m("label", {
479
+ htmlFor: "outputKey",
480
+ className: _,
481
+ children: [
482
+ x("bigconsole.parsers.builder.fields.outputKey.label", "Output Key"),
483
+ " ",
484
+ /* @__PURE__ */ p("span", {
464
485
  className: "text-status-error-text",
465
486
  children: "*"
466
- })]
467
- }),
468
- /* @__PURE__ */ f("input", {
469
- id: "outputKey",
470
- type: "text",
471
- value: E.outputKey,
472
- onChange: dt,
473
- placeholder: "user_analytics_parser",
474
- disabled: w,
475
- className: `${_} font-mono ${O.outputKey ? "border-status-error-border" : "border-border-default"} disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60`
476
- }),
477
- O.outputKey && /* @__PURE__ */ f("p", {
478
- className: "text-xs text-status-error-text mt-1.5",
479
- children: O.outputKey
480
- }),
481
- !w && /* @__PURE__ */ f("p", {
482
- className: "text-xs text-text-tertiary mt-1.5",
483
- children: "Auto-generated from name. Customize if needed."
484
- })
485
- ] })]
486
- }),
487
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
488
- htmlFor: "description",
489
- className: "block text-sm font-medium text-text-primary mb-2",
490
- children: "Description"
491
- }), /* @__PURE__ */ f("textarea", {
492
- id: "description",
493
- value: E.description,
494
- onChange: ft,
495
- placeholder: "Describe what this parser does...",
496
- rows: 2,
497
- className: `${_} border-border-default resize-y`
498
- })] }),
499
- T && /* @__PURE__ */ p("div", { children: [
500
- /* @__PURE__ */ f("label", {
501
- htmlFor: "dashboard",
502
- className: "block text-sm font-medium text-text-primary mb-2",
503
- children: /* @__PURE__ */ p("span", {
504
- className: "flex items-center gap-2",
505
- children: [/* @__PURE__ */ f(ge, { className: "w-4 h-4" }), "Dashboard Scope"]
506
- })
487
+ })
488
+ ]
507
489
  }),
508
- /* @__PURE__ */ p("select", {
509
- id: "dashboard",
510
- value: x,
511
- onChange: _t,
512
- disabled: lt || w,
513
- className: `${_} border-border-default disabled:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-60`,
514
- children: [/* @__PURE__ */ f("option", {
515
- value: "default",
516
- children: "Global (available everywhere)"
517
- }), st.map((e) => /* @__PURE__ */ f("option", {
518
- value: e.id,
519
- children: e.name
520
- }, e.id))]
490
+ /* @__PURE__ */ p("input", {
491
+ id: "outputKey",
492
+ type: "text",
493
+ value: k.outputKey,
494
+ onChange: ht,
495
+ placeholder: "user_analytics_parser",
496
+ disabled: D,
497
+ className: g(!!j.outputKey, "font-mono")
521
498
  }),
522
- /* @__PURE__ */ f("p", {
523
- className: "text-xs text-text-tertiary mt-1.5",
524
- children: w ? "Dashboard scope cannot be changed after creation." : x === "default" ? "Global parsers are available across all dashboards." : "This parser will only be available in the selected dashboard."
499
+ j.outputKey && /* @__PURE__ */ p("p", {
500
+ className: "text-xs text-status-error-text mt-1.5",
501
+ children: j.outputKey
502
+ }),
503
+ !D && /* @__PURE__ */ p("p", {
504
+ className: v,
505
+ children: x("bigconsole.parsers.builder.fields.outputKey.helper", "Auto-generated from name. Customize if needed.")
525
506
  })
526
- ] })
527
- ]
528
- }),
529
- y === 1 && /* @__PURE__ */ p("div", {
530
- className: "space-y-5",
531
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
532
- className: "block text-sm font-medium text-text-primary mb-3",
533
- children: ["Parser Type ", /* @__PURE__ */ f("span", {
534
- className: "text-status-error-text",
535
- children: "*"
536
- })]
537
- }), /* @__PURE__ */ f("div", {
538
- className: "grid gap-2 sm:grid-cols-2",
539
- children: Object.keys(g).map((e) => {
540
- let t = g[e];
541
- return /* @__PURE__ */ p("label", {
542
- className: `flex items-start gap-3 p-3 border rounded-md cursor-pointer transition-colors ${E.type === e ? "border-action-primary-bg bg-action-primary-bg/5" : "border-border-default hover:bg-bg-sunken"}`,
543
- children: [/* @__PURE__ */ f("input", {
507
+ ] })]
508
+ }),
509
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
510
+ htmlFor: "description",
511
+ className: _,
512
+ children: x("bigconsole.parsers.builder.fields.description.label", "Description")
513
+ }), /* @__PURE__ */ p("textarea", {
514
+ id: "description",
515
+ value: k.description,
516
+ onChange: gt,
517
+ placeholder: x("bigconsole.parsers.builder.fields.description.placeholder", "Describe what this parser does..."),
518
+ rows: 3,
519
+ className: g(!1, "resize-y")
520
+ })] }),
521
+ O && /* @__PURE__ */ m("div", { children: [
522
+ /* @__PURE__ */ m("label", {
523
+ htmlFor: "dashboard",
524
+ className: `${_} flex items-center gap-2`,
525
+ children: [/* @__PURE__ */ p(_e, {
526
+ "aria-hidden": "true",
527
+ className: "w-4 h-4"
528
+ }), x("bigconsole.parsers.builder.fields.dashboard.label", "Dashboard Scope")]
529
+ }),
530
+ /* @__PURE__ */ m("select", {
531
+ id: "dashboard",
532
+ value: E,
533
+ onChange: xt,
534
+ disabled: pt || D,
535
+ className: g(),
536
+ children: [/* @__PURE__ */ p("option", {
537
+ value: "default",
538
+ children: x("bigconsole.parsers.builder.fields.dashboard.globalOption", "Global (available everywhere)")
539
+ }), dt.map((e) => /* @__PURE__ */ p("option", {
540
+ value: e.id,
541
+ children: e.name
542
+ }, e.id))]
543
+ }),
544
+ /* @__PURE__ */ p("p", {
545
+ className: v,
546
+ children: D ? x("bigconsole.parsers.builder.fields.dashboard.helperLocked", "Dashboard scope cannot be changed after creation.") : E === "default" ? x("bigconsole.parsers.builder.fields.dashboard.helperGlobal", "Global parsers are available across all dashboards.") : x("bigconsole.parsers.builder.fields.dashboard.helperScoped", "This parser will only be available in the selected dashboard.")
547
+ })
548
+ ] })
549
+ ]
550
+ }),
551
+ w === 1 && /* @__PURE__ */ m(t, {
552
+ emphasis: "primary",
553
+ headingLevel: 2,
554
+ title: "Parser configuration",
555
+ description: "Pick the language and point it at a source.",
556
+ icon: /* @__PURE__ */ p(pe, { className: "h-icon-sm w-icon-sm" }),
557
+ meta: $,
558
+ bodyClassName: "space-y-5",
559
+ "data-testid": "parser-configuration",
560
+ children: [/* @__PURE__ */ m("fieldset", {
561
+ className: "min-w-0 border-0 p-0 m-0",
562
+ children: [/* @__PURE__ */ m("legend", {
563
+ className: "mb-3 text-sm font-medium text-text-primary",
564
+ children: [
565
+ x("bigconsole.parsers.builder.fields.parserType.label", "Parser Type"),
566
+ " ",
567
+ /* @__PURE__ */ p("span", {
568
+ className: "text-status-error-text",
569
+ children: "*"
570
+ })
571
+ ]
572
+ }), /* @__PURE__ */ p("div", {
573
+ className: "space-y-2",
574
+ children: Object.keys(S).map((e) => {
575
+ let t = S[e];
576
+ return /* @__PURE__ */ m("label", {
577
+ className: `
578
+ flex items-start gap-3 p-3
579
+ rounded-md border
580
+ cursor-pointer
581
+ motion-safe:transition-colors
582
+ ${k.type === e ? "border-action-primary-bg bg-action-primary-bg/5" : "border-transparent bg-bg-sunken hover:border-[var(--color-border-subtle)]"}
583
+ `,
584
+ children: [/* @__PURE__ */ p("input", {
544
585
  type: "radio",
545
586
  name: "parserType",
546
587
  value: e,
547
- checked: E.type === e,
548
- onChange: () => pt(e),
588
+ checked: k.type === e,
589
+ onChange: () => _t(e),
549
590
  className: "mt-1 w-4 h-4 text-action-primary-bg"
550
- }), /* @__PURE__ */ p("span", { children: [/* @__PURE__ */ f("span", {
551
- className: "text-sm font-medium text-text-primary",
552
- children: t.name
553
- }), /* @__PURE__ */ f("p", {
554
- className: "text-xs text-text-secondary mt-0.5",
555
- children: t.description
556
- })] })]
591
+ }), /* @__PURE__ */ m("span", {
592
+ className: "min-w-0",
593
+ children: [/* @__PURE__ */ p("span", {
594
+ className: "block text-sm font-medium text-text-primary",
595
+ children: t.name
596
+ }), /* @__PURE__ */ p("span", {
597
+ className: "mt-0.5 block text-xs text-text-secondary",
598
+ children: t.description
599
+ })]
600
+ })]
557
601
  }, e);
558
602
  })
559
- })] }), /* @__PURE__ */ p("div", { children: [
560
- /* @__PURE__ */ p("label", {
561
- htmlFor: "inputSinkKey",
562
- className: "block text-sm font-medium text-text-primary mb-2",
563
- children: ["Source DataSink ", /* @__PURE__ */ f("span", {
603
+ })]
604
+ }), /* @__PURE__ */ m("div", { children: [
605
+ /* @__PURE__ */ m("label", {
606
+ htmlFor: "inputSinkKey",
607
+ className: _,
608
+ children: [
609
+ x("bigconsole.parsers.builder.fields.sourceDataSink.label", "Source DataSink"),
610
+ " ",
611
+ /* @__PURE__ */ p("span", {
564
612
  className: "text-status-error-text",
565
613
  children: "*"
566
- })]
567
- }),
568
- /* @__PURE__ */ p("select", {
569
- id: "inputSinkKey",
570
- value: E.inputSinkKey,
571
- onChange: ht,
572
- className: `${_} ${O.inputSinkKey ? "border-status-error-border" : "border-border-default"}`,
573
- children: [/* @__PURE__ */ f("option", {
574
- value: "",
575
- children: "Select a DataSink..."
576
- }), q.map((e) => /* @__PURE__ */ f("option", {
577
- value: e.key,
578
- children: e.name || e.key
579
- }, e.id))]
580
- }),
581
- O.inputSinkKey && /* @__PURE__ */ f("p", {
582
- className: "text-xs text-status-error-text mt-1.5",
583
- children: O.inputSinkKey
584
- }),
585
- q.length === 0 && /* @__PURE__ */ f("p", {
586
- className: "text-xs text-text-tertiary mt-1.5",
587
- children: "No DataSinks yet — create one first, then return here to build a parser for it."
588
- }),
589
- E.inputSinkKey && /* @__PURE__ */ p("div", {
614
+ })
615
+ ]
616
+ }),
617
+ /* @__PURE__ */ m("select", {
618
+ id: "inputSinkKey",
619
+ value: k.inputSinkKey,
620
+ onChange: yt,
621
+ className: g(!!j.inputSinkKey),
622
+ children: [/* @__PURE__ */ p("option", {
623
+ value: "",
624
+ children: x("bigconsole.parsers.builder.fields.sourceDataSink.placeholder", "Select a DataSink...")
625
+ }), J.map((e) => /* @__PURE__ */ p("option", {
626
+ value: e.key,
627
+ children: e.name || e.key
628
+ }, e.id))]
629
+ }),
630
+ j.inputSinkKey && /* @__PURE__ */ p("p", {
631
+ className: "text-xs text-status-error-text mt-1.5",
632
+ children: j.inputSinkKey
633
+ }),
634
+ J.length === 0 ? /* @__PURE__ */ p("p", {
635
+ className: v,
636
+ children: x("bigconsole.parsers.builder.fields.sourceDataSink.emptyState", "No DataSinks yet — create one first, then return here to build a parser for it.")
637
+ }) : /* @__PURE__ */ p("p", {
638
+ className: v,
639
+ children: "Select the data source for this parser to transform."
640
+ }),
641
+ k.inputSinkKey && /* @__PURE__ */ m("div", {
642
+ className: "mt-3",
643
+ children: [/* @__PURE__ */ m("button", {
644
+ type: "button",
645
+ onClick: Tt,
646
+ "aria-expanded": G,
647
+ "aria-controls": "parser-data-preview",
648
+ className: "inline-flex min-h-control-md items-center gap-2 rounded-md text-sm text-action-primary-bg hover:text-action-primary-bgHover motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
649
+ children: [
650
+ p(G ? de : fe, { className: "w-4 h-4" }),
651
+ /* @__PURE__ */ p(he, { className: "w-4 h-4" }),
652
+ x("bigconsole.parsers.builder.dataPreview.toggle", "Show Data Preview")
653
+ ]
654
+ }), G && /* @__PURE__ */ p(t, {
655
+ id: "parser-data-preview",
656
+ emphasis: "muted",
657
+ padding: "compact",
658
+ headingLevel: 3,
659
+ title: "Sample data",
660
+ description: "A slice of the payload stored on the selected DataSink.",
590
661
  className: "mt-3",
591
- children: [/* @__PURE__ */ p("button", {
592
- type: "button",
593
- onClick: xt,
594
- className: "inline-flex items-center gap-2 text-sm text-action-primary-bg hover:text-action-primary-bgHover transition-colors",
662
+ "data-testid": "parser-data-preview",
663
+ children: $e ? /* @__PURE__ */ m("div", {
664
+ className: "flex items-center justify-center p-4",
665
+ children: [/* @__PURE__ */ p(u, { className: "w-5 h-5 text-text-secondary animate-spin" }), /* @__PURE__ */ p("span", {
666
+ className: "ml-2 text-sm text-text-secondary",
667
+ children: x("bigconsole.parsers.builder.dataPreview.loading", "Loading sample…")
668
+ })]
669
+ }) : tt ? /* @__PURE__ */ p("p", {
670
+ className: "text-sm text-status-error-text",
671
+ children: tt
672
+ }) : Ze ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("pre", {
673
+ className: "max-h-48 min-w-0 overflow-auto rounded-md bg-bg-canvas p-3 font-mono text-xs text-text-primary",
674
+ children: JSON.stringify(Ze, null, 2)
675
+ }), q && /* @__PURE__ */ m("p", {
676
+ className: v,
595
677
  children: [
596
- f(U ? ue : de, { className: "w-4 h-4" }),
597
- /* @__PURE__ */ f(me, { className: "w-4 h-4" }),
598
- "Show Data Preview"
678
+ x("bigconsole.parsers.builder.dataPreview.previewingSample", "Previewing a sample"),
679
+ q.total == null ? "" : x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
680
+ shown: Math.min(y, q.total),
681
+ total: q.total
682
+ }),
683
+ " · ",
684
+ q.sinkName
599
685
  ]
600
- }), U && /* @__PURE__ */ f("div", {
601
- className: "mt-3 border border-border-default rounded-md overflow-hidden",
602
- children: Ye ? /* @__PURE__ */ p("div", {
603
- className: "p-4 flex items-center justify-center",
604
- children: [/* @__PURE__ */ f(l, { className: "w-5 h-5 text-text-secondary animate-spin" }), /* @__PURE__ */ f("span", {
605
- className: "ml-2 text-sm text-text-secondary",
606
- children: "Loading sample…"
607
- })]
608
- }) : Ze ? /* @__PURE__ */ f("div", {
609
- className: "p-4 bg-status-error-bg/5",
610
- children: /* @__PURE__ */ f("p", {
611
- className: "text-sm text-status-error-text",
612
- children: Ze
613
- })
614
- }) : qe ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("pre", {
615
- className: "p-3 text-xs font-mono bg-bg-sunken text-text-primary overflow-auto max-h-48",
616
- children: JSON.stringify(qe, null, 2)
617
- }), K && /* @__PURE__ */ p("p", {
618
- className: "px-3 py-2 text-xs text-text-tertiary border-t border-border-default",
619
- children: [
620
- "Previewing a sample",
621
- K.total == null ? "" : ` (first ${Math.min(m, K.total)} of ${K.total} rows)`,
622
- " · ",
623
- K.sinkName
624
- ]
625
- })] }) : /* @__PURE__ */ f("div", {
626
- className: "p-4 text-sm text-text-secondary text-center",
627
- children: "No data available"
628
- })
629
- })]
630
- })
631
- ] })]
632
- }),
633
- y === 2 && /* @__PURE__ */ p("div", {
634
- className: "space-y-5",
635
- children: [
636
- /* @__PURE__ */ p("div", { children: [
637
- /* @__PURE__ */ p("label", {
638
- htmlFor: "expression",
639
- className: "block text-sm font-medium text-text-primary mb-2",
640
- children: ["Expression ", /* @__PURE__ */ f("span", {
686
+ })] }) : /* @__PURE__ */ p("p", {
687
+ className: "text-center text-sm text-text-secondary",
688
+ children: x("bigconsole.parsers.builder.dataPreview.noData", "No data available")
689
+ })
690
+ })]
691
+ })
692
+ ] })]
693
+ }),
694
+ w === 2 && /* @__PURE__ */ m(t, {
695
+ emphasis: "primary",
696
+ headingLevel: 2,
697
+ title: "Test expression",
698
+ description: "Write the expression, then run it against sample data before you save.",
699
+ icon: /* @__PURE__ */ p(ve, { className: "h-icon-sm w-icon-sm" }),
700
+ meta: $,
701
+ bodyClassName: "space-y-5",
702
+ "data-testid": "parser-test-expression",
703
+ children: [
704
+ /* @__PURE__ */ m("div", { children: [
705
+ /* @__PURE__ */ m("label", {
706
+ htmlFor: "expression",
707
+ className: _,
708
+ children: [
709
+ x("bigconsole.parsers.builder.fields.expression.label", "Expression"),
710
+ " ",
711
+ /* @__PURE__ */ p("span", {
641
712
  className: "text-status-error-text",
642
713
  children: "*"
714
+ })
715
+ ]
716
+ }),
717
+ /* @__PURE__ */ p("textarea", {
718
+ id: "expression",
719
+ value: k.expression,
720
+ onChange: vt,
721
+ placeholder: Nt.placeholder,
722
+ rows: 8,
723
+ className: g(!!j.expression, "font-mono resize-y min-h-[12rem]")
724
+ }),
725
+ j.expression && /* @__PURE__ */ p("p", {
726
+ className: "text-xs text-status-error-text mt-1.5",
727
+ children: j.expression
728
+ }),
729
+ /* @__PURE__ */ p("p", {
730
+ className: v,
731
+ children: x("bigconsole.parsers.builder.fields.expression.example", "Example: {{example}}", { example: Nt.example })
732
+ })
733
+ ] }),
734
+ /* @__PURE__ */ m("div", { children: [
735
+ /* @__PURE__ */ m("div", {
736
+ className: "mb-2 flex flex-wrap items-center justify-between gap-control-gap",
737
+ children: [/* @__PURE__ */ m("label", {
738
+ htmlFor: "test-input",
739
+ className: `${_} mb-0 flex flex-wrap items-center gap-2`,
740
+ children: [x("bigconsole.parsers.builder.test.inputJsonLabel", "Input JSON"), /* @__PURE__ */ p("span", {
741
+ className: `rounded border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${V ? "text-action-primary-bg bg-action-primary-bg/10 border-action-primary-bg/30" : "text-text-secondary bg-bg-sunken border-[var(--color-border-subtle)]"}`,
742
+ children: V ? x("bigconsole.parsers.builder.test.referenceMode", "Reference mode") : x("bigconsole.parsers.builder.test.sampleMode", "Sample mode")
643
743
  })]
644
- }),
645
- /* @__PURE__ */ f("textarea", {
646
- id: "expression",
647
- value: E.expression,
648
- onChange: mt,
649
- placeholder: $.placeholder,
650
- rows: 8,
651
- className: `${_} font-mono resize-y ${O.expression ? "border-status-error-border" : "border-border-default"}`
652
- }),
653
- O.expression && /* @__PURE__ */ f("p", {
654
- className: "text-xs text-status-error-text mt-1.5",
655
- children: O.expression
656
- }),
657
- /* @__PURE__ */ p("p", {
658
- className: "text-xs text-text-tertiary mt-1.5",
659
- children: ["Example: ", $.example]
660
- })
661
- ] }),
662
- /* @__PURE__ */ f(s, {
663
- permission: n.PARSER_TEST,
664
- deniedBehavior: "disable",
665
- children: /* @__PURE__ */ f(u, {
666
- type: "button",
667
- onClick: St,
668
- disabled: Ue || !E.expression.trim(),
669
- variant: "default",
670
- className: "w-full",
671
- children: Ue ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(l, { className: "w-4 h-4 mr-2 animate-spin" }), "Testing..."] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(_e, { className: "w-4 h-4 mr-2" }), "Run Test"] })
672
- })
744
+ }), /* @__PURE__ */ m("div", {
745
+ className: "flex flex-wrap items-center gap-2",
746
+ children: [k.inputSinkKey && !V && /* @__PURE__ */ m("button", {
747
+ type: "button",
748
+ onClick: Ct,
749
+ disabled: Je,
750
+ className: "inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-action-primary-bg px-2.5 py-1.5 text-xs font-semibold text-action-primary-bg hover:bg-action-primary-bg/10 motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface disabled:opacity-50 disabled:cursor-not-allowed",
751
+ children: [Je ? /* @__PURE__ */ p(u, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ p(me, { className: "w-3.5 h-3.5" }), x("bigconsole.parsers.builder.actions.loadSample", "Load Sample")]
752
+ }), V && /* @__PURE__ */ m("button", {
753
+ type: "button",
754
+ onClick: wt,
755
+ className: "inline-flex items-center gap-1.5 whitespace-nowrap rounded-md border border-[var(--color-border-default)] px-2.5 py-1.5 text-xs font-semibold text-text-primary hover:bg-bg-sunken motion-safe:transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
756
+ children: [/* @__PURE__ */ p(xe, { className: "w-3.5 h-3.5" }), x("bigconsole.parsers.builder.actions.clear", "Clear")]
757
+ })]
758
+ })]
673
759
  }),
674
- /* @__PURE__ */ p("div", {
675
- className: "grid gap-4 md:grid-cols-2",
676
- children: [/* @__PURE__ */ p("div", { children: [
677
- /* @__PURE__ */ p("div", {
678
- className: "flex items-center justify-between mb-2",
679
- children: [/* @__PURE__ */ p("label", {
680
- className: "text-sm font-medium text-text-primary",
681
- children: ["Input JSON", /* @__PURE__ */ f("span", {
682
- className: `ml-2 text-[10px] font-semibold uppercase tracking-wide px-2 py-0.5 rounded border align-middle ${R ? "text-action-primary-bg bg-action-primary-bg/10 border-action-primary-bg/30" : "text-text-secondary bg-bg-sunken border-border-default"}`,
683
- children: R ? "Reference mode" : "Sample mode"
684
- })]
685
- }), /* @__PURE__ */ p("div", {
686
- className: "flex items-center gap-2",
687
- children: [E.inputSinkKey && !R && /* @__PURE__ */ p("button", {
688
- type: "button",
689
- onClick: yt,
690
- disabled: Ge,
691
- className: "inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-action-primary-bg border border-action-primary-bg rounded-md hover:bg-action-primary-bg/10 transition-colors disabled:opacity-50",
692
- children: [Ge ? /* @__PURE__ */ f(l, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ f(pe, { className: "w-3.5 h-3.5" }), "Load Sample"]
693
- }), R && /* @__PURE__ */ p("button", {
694
- type: "button",
695
- onClick: bt,
696
- className: "inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-semibold text-text-primary border border-border-default rounded-md hover:bg-bg-sunken transition-colors",
697
- children: [/* @__PURE__ */ f(be, { className: "w-3.5 h-3.5" }), "Clear"]
698
- })]
699
- })]
700
- }),
701
- /* @__PURE__ */ f("textarea", {
702
- value: A,
703
- onChange: vt,
704
- readOnly: R,
705
- placeholder: "Type sample JSON to test against it — or Load a sample from the source…",
706
- rows: 8,
707
- className: `${_} min-h-[220px] text-xs font-mono leading-relaxed resize-y border-border-default ${R ? "bg-bg-sunken opacity-80 cursor-not-allowed" : ""}`
708
- }),
709
- R && B ? /* @__PURE__ */ p("p", {
710
- className: "text-xs text-text-tertiary mt-1.5",
711
- children: [
712
- "Loaded a small sample",
713
- B.total == null ? "" : ` (first ${Math.min(m, B.total)} of ${B.total} rows)`,
714
- " ",
715
- "from ",
716
- B.sinkName,
717
- " · locked — press Clear to edit."
718
- ]
719
- }) : /* @__PURE__ */ f("p", {
720
- className: "text-xs text-text-tertiary mt-1.5",
721
- children: "Type sample JSON to test against it, or Load a sample from the source."
722
- })
723
- ] }), /* @__PURE__ */ p("div", { children: [
724
- /* @__PURE__ */ p("div", {
725
- className: "flex items-center justify-between mb-2",
726
- children: [/* @__PURE__ */ f("label", {
727
- className: "text-sm font-medium text-text-primary",
728
- children: P ? "Error Output" : "Output"
729
- }), (M || P) && (P ? /* @__PURE__ */ p("span", {
730
- className: "text-xs px-2 py-1 bg-status-error-bg/10 text-status-error-text rounded flex items-center gap-1",
731
- children: [/* @__PURE__ */ f(c, { className: "w-3 h-3" }), " Failed"]
732
- }) : /* @__PURE__ */ p("span", {
733
- className: "text-xs px-2 py-1 bg-status-success-bg/10 text-status-success-text rounded flex items-center gap-1",
734
- children: [/* @__PURE__ */ f(le, { className: "w-3 h-3" }), " Passed"]
735
- }))]
736
- }),
737
- M || P ? /* @__PURE__ */ f("pre", {
738
- className: `w-full px-3 py-2.5 text-xs font-mono leading-relaxed border rounded-md overflow-auto min-h-[220px] max-h-[220px] resize-y ${P ? "bg-status-error-bg/5 text-status-error-text border-status-error-border/30" : "bg-status-success-bg/5 text-text-primary border-status-success-border/30"}`,
739
- children: P || M
740
- }) : /* @__PURE__ */ f("div", {
741
- className: "min-h-[220px] p-3 bg-bg-sunken rounded-md border border-border-default",
742
- children: /* @__PURE__ */ p("p", {
743
- className: "text-xs text-text-secondary leading-relaxed",
744
- children: [/* @__PURE__ */ f("strong", { children: "Tip:" }), " write your expression and click “Run Test” to see the transformation."]
745
- })
760
+ /* @__PURE__ */ p("textarea", {
761
+ id: "test-input",
762
+ value: N,
763
+ onChange: St,
764
+ readOnly: V,
765
+ placeholder: x("bigconsole.parsers.builder.test.inputPlaceholder", "Type sample JSON to test against it — or Load a sample from the source…"),
766
+ rows: 8,
767
+ className: g(!1, `font-mono leading-relaxed resize-y ${V ? "bg-bg-sunken opacity-80 cursor-not-allowed" : ""}`)
768
+ }),
769
+ V && U ? /* @__PURE__ */ m("p", {
770
+ className: v,
771
+ children: [
772
+ x("bigconsole.parsers.builder.test.loadedSample", "Loaded a small sample"),
773
+ U.total == null ? "" : x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
774
+ shown: Math.min(y, U.total),
775
+ total: U.total
746
776
  }),
747
- I && !P && /* @__PURE__ */ p("p", {
748
- className: "text-xs text-text-tertiary mt-1.5",
749
- children: [
750
- "Tested a sample",
751
- I.sampledRows != null && I.totalRows != null ? ` (first ${I.sampledRows} of ${I.totalRows} rows)` : "",
752
- " a saved parser runs over the full source, so results may differ."
753
- ]
754
- })
755
- ] })]
777
+ " ",
778
+ x("bigconsole.parsers.builder.test.loadedSampleFrom", "from {{sinkName}} · locked — press Clear to edit.", { sinkName: U.sinkName })
779
+ ]
780
+ }) : /* @__PURE__ */ p("p", {
781
+ className: v,
782
+ children: x("bigconsole.parsers.builder.test.inputHelper", "Type sample JSON to test against it, or Load a sample from the source.")
756
783
  })
757
- ]
758
- }),
759
- y === 3 && /* @__PURE__ */ p("div", {
760
- className: "space-y-6",
761
- children: [/* @__PURE__ */ p("div", { children: [
762
- /* @__PURE__ */ f("label", {
763
- className: "block text-sm font-medium text-text-primary mb-1",
764
- children: "Cache Duration"
765
- }),
766
- /* @__PURE__ */ f("p", {
767
- className: "text-xs text-text-tertiary mb-3",
768
- children: "How long should data be cached before refreshing?"
784
+ ] }),
785
+ /* @__PURE__ */ p(se, {
786
+ permission: r.PARSER_TEST,
787
+ deniedBehavior: "disable",
788
+ children: /* @__PURE__ */ p(d, {
789
+ type: "button",
790
+ onClick: Et,
791
+ disabled: Ge || !k.expression.trim(),
792
+ variant: "default",
793
+ className: "w-full",
794
+ children: Ge ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(u, { className: "w-4 h-4 mr-2 animate-spin" }), x("bigconsole.parsers.builder.actions.testing", "Testing...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(ve, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.actions.runTest", "Run Test")] })
795
+ })
796
+ }),
797
+ (F || L) && /* @__PURE__ */ m(t, {
798
+ emphasis: "muted",
799
+ padding: "compact",
800
+ headingLevel: 3,
801
+ tone: L ? "danger" : "success",
802
+ title: L ? x("bigconsole.parsers.builder.test.errorOutputLabel", "Error Output") : x("bigconsole.parsers.builder.test.outputLabel", "Output"),
803
+ meta: L ? /* @__PURE__ */ m("span", {
804
+ className: "inline-flex items-center gap-1 text-xs text-[var(--color-status-error-text)]",
805
+ children: [
806
+ /* @__PURE__ */ p(l, { className: "w-3 h-3" }),
807
+ " ",
808
+ x("bigconsole.parsers.builder.test.failed", "Failed")
809
+ ]
810
+ }) : /* @__PURE__ */ m("span", {
811
+ className: "inline-flex items-center gap-1 text-xs text-status-success-text",
812
+ children: [
813
+ /* @__PURE__ */ p(ue, { className: "w-3 h-3" }),
814
+ " ",
815
+ x("bigconsole.parsers.builder.test.passed", "Passed")
816
+ ]
769
817
  }),
770
- /* @__PURE__ */ f(ne, {
771
- value: E.ttl,
772
- onChange: gt,
773
- error: O.ttl,
774
- hideLabel: !0
818
+ "data-testid": "parser-test-output",
819
+ children: [/* @__PURE__ */ p("pre", {
820
+ className: "max-h-[150px] min-w-0 overflow-auto rounded-md bg-bg-canvas px-3 py-2.5 font-mono text-xs leading-relaxed text-text-primary",
821
+ children: L || F
822
+ }), z && !L && /* @__PURE__ */ m("p", {
823
+ className: v,
824
+ children: [
825
+ x("bigconsole.parsers.builder.test.testedSample", "Tested a sample"),
826
+ z.sampledRows != null && z.totalRows != null ? x("bigconsole.parsers.builder.dataPreview.rowRange", " (first {{shown}} of {{total}} rows)", {
827
+ shown: z.sampledRows,
828
+ total: z.totalRows
829
+ }) : "",
830
+ x("bigconsole.parsers.builder.test.testedSampleNote", " — a saved parser runs over the full source, so results may differ.")
831
+ ]
832
+ })]
833
+ }),
834
+ !F && !L && /* @__PURE__ */ p(t, {
835
+ emphasis: "muted",
836
+ padding: "compact",
837
+ headingLevel: 3,
838
+ title: "No run yet",
839
+ "data-testid": "parser-test-empty",
840
+ children: /* @__PURE__ */ m("p", {
841
+ className: "text-xs leading-relaxed text-text-secondary",
842
+ children: [
843
+ /* @__PURE__ */ p("strong", { children: x("bigconsole.parsers.builder.test.tipLabel", "Tip:") }),
844
+ " ",
845
+ x("bigconsole.parsers.builder.test.tipBody", "write your expression and click “Run Test” to see the transformation.")
846
+ ]
775
847
  })
776
- ] }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
777
- className: "block text-sm font-medium text-text-primary mb-2",
778
- children: "Review"
779
- }), /* @__PURE__ */ f("div", {
780
- className: "border border-border-default rounded-lg overflow-hidden",
781
- children: [
782
- ["Name", E.name || "—"],
783
- ["Output Key", E.outputKey || "—"],
784
- ["Scope", T ? x === "default" ? "Global" : st.find((e) => e.id === x)?.name || x : "Dashboard"],
785
- ["Type", g[E.type].name],
786
- ["Source", X || ""]
787
- ].map(([e, t]) => /* @__PURE__ */ p("div", {
788
- className: "flex items-center justify-between gap-3 px-4 py-2.5 text-sm border-b border-border-default last:border-b-0",
789
- children: [/* @__PURE__ */ f("span", {
790
- className: "text-text-secondary",
791
- children: e
792
- }), /* @__PURE__ */ f("span", {
793
- className: "font-medium text-text-primary text-right break-words",
794
- children: t
795
- })]
796
- }, e))
797
- })] })]
848
+ })
849
+ ]
850
+ }),
851
+ w === 3 && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(t, {
852
+ emphasis: "primary",
853
+ headingLevel: 2,
854
+ title: x("bigconsole.parsers.builder.review.cacheDurationLabel", "Cache Duration"),
855
+ description: x("bigconsole.parsers.builder.review.cacheDurationHelper", "How long should data be cached before refreshing?"),
856
+ icon: /* @__PURE__ */ p(be, { className: "h-icon-sm w-icon-sm" }),
857
+ meta: $,
858
+ "data-testid": "parser-advanced-settings",
859
+ children: /* @__PURE__ */ p(re, {
860
+ value: k.ttl,
861
+ onChange: bt,
862
+ error: j.ttl,
863
+ hideLabel: !0
798
864
  })
799
- ]
800
- })]
801
- }),
802
- /* @__PURE__ */ p("div", {
803
- className: "flex items-center justify-between gap-4 pt-6 mt-6 border-t border-border-default",
804
- children: [y === 0 ? /* @__PURE__ */ f(u, {
805
- type: "button",
806
- onClick: Z,
807
- variant: "secondary",
808
- children: "Cancel"
809
- }) : /* @__PURE__ */ p(u, {
810
- type: "button",
811
- onClick: Dt,
812
- variant: "secondary",
813
- children: [/* @__PURE__ */ f(ce, { className: "w-4 h-4 mr-2" }), "Back"]
814
- }), Ot ? /* @__PURE__ */ f(s, {
815
- permission: Ie,
816
- deniedBehavior: "disable",
817
- children: /* @__PURE__ */ f(u, {
818
- type: "button",
819
- onClick: Ct,
820
- disabled: !wt || ze || !Fe,
821
- variant: "default",
822
- children: ze ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(l, { className: "w-4 h-4 mr-2 animate-spin" }), "Saving..."] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(ve, { className: "w-4 h-4 mr-2" }), w ? "Save Changes" : "Create Parser"] })
865
+ }), /* @__PURE__ */ p(t, {
866
+ emphasis: "muted",
867
+ headingLevel: 2,
868
+ title: x("bigconsole.parsers.builder.review.label", "Review"),
869
+ description: "Check these details before you save.",
870
+ "data-testid": "parser-review",
871
+ children: /* @__PURE__ */ p("div", {
872
+ className: "overflow-hidden rounded-lg border border-[var(--color-border-subtle)]",
873
+ children: [
874
+ [x("bigconsole.parsers.builder.review.name", "Name"), k.name || "—"],
875
+ [x("bigconsole.parsers.builder.review.outputKey", "Output Key"), k.outputKey || "—"],
876
+ [x("bigconsole.parsers.builder.review.scope", "Scope"), O ? E === "default" ? x("bigconsole.parsers.builder.review.scopeGlobal", "Global") : dt.find((e) => e.id === E)?.name || E : x("bigconsole.parsers.builder.review.scopeDashboard", "Dashboard")],
877
+ [x("bigconsole.parsers.builder.review.type", "Type"), S[k.type].name],
878
+ [x("bigconsole.parsers.builder.review.source", "Source"), Z || "—"]
879
+ ].map(([e, t]) => /* @__PURE__ */ m("div", {
880
+ className: "flex flex-wrap items-center justify-between gap-3 border-b border-[var(--color-border-subtle)] px-4 py-2.5 text-sm last:border-b-0",
881
+ children: [/* @__PURE__ */ p("span", {
882
+ className: "text-text-secondary",
883
+ children: e
884
+ }), /* @__PURE__ */ p("span", {
885
+ className: "min-w-0 break-words text-right font-medium text-text-primary",
886
+ children: t
887
+ })]
888
+ }, e))
889
+ })
890
+ })] }),
891
+ /* @__PURE__ */ m("div", {
892
+ className: "sticky bottom-0 z-10 flex flex-col-reverse gap-control-gap border-t border-[var(--color-border-subtle)] bg-bg-canvas py-form-gap sm:flex-row sm:items-center sm:justify-between",
893
+ children: [w === 0 ? /* @__PURE__ */ p(d, {
894
+ type: "button",
895
+ onClick: Q,
896
+ variant: "secondary",
897
+ className: "w-full sm:w-auto",
898
+ children: x("bigconsole.parsers.builder.actions.cancel", "Cancel")
899
+ }) : /* @__PURE__ */ m(d, {
900
+ type: "button",
901
+ onClick: Mt,
902
+ variant: "secondary",
903
+ className: "w-full sm:w-auto",
904
+ children: [/* @__PURE__ */ p(le, { className: "w-4 h-4 mr-2" }), x("bigconsole.parsers.builder.actions.back", "Back")]
905
+ }), Pt ? /* @__PURE__ */ p(se, {
906
+ permission: Re,
907
+ deniedBehavior: "disable",
908
+ children: /* @__PURE__ */ p(d, {
909
+ type: "submit",
910
+ disabled: !Ot || Ve || !Le,
911
+ variant: "default",
912
+ className: "w-full sm:w-auto",
913
+ children: Ve ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(u, { className: "w-4 h-4 mr-2 animate-spin" }), x("bigconsole.parsers.builder.actions.saving", "Saving...")] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(ye, { className: "w-4 h-4 mr-2" }), D ? x("bigconsole.parsers.builder.actions.saveChanges", "Save Changes") : x("bigconsole.parsers.builder.actions.createParser", "Create Parser")] })
914
+ })
915
+ }) : /* @__PURE__ */ m(d, {
916
+ type: "button",
917
+ onClick: jt,
918
+ disabled: !kt(w),
919
+ variant: "default",
920
+ className: "w-full sm:w-auto",
921
+ children: [x("bigconsole.parsers.builder.actions.next", "Next"), /* @__PURE__ */ p(fe, { className: "w-4 h-4 ml-2" })]
922
+ })]
823
923
  })
824
- }) : /* @__PURE__ */ p(u, {
825
- type: "button",
826
- onClick: Et,
827
- disabled: !Q(y),
828
- variant: "default",
829
- children: ["Next", /* @__PURE__ */ f(de, { className: "w-4 h-4 ml-2" })]
830
- })]
924
+ ]
831
925
  })
832
- ]
926
+ ] })
833
927
  })
834
928
  });
835
929
  });
836
930
  //#endregion
837
- export { v as ParserBuilderPage, v as default };
931
+ export { b as ParserBuilderPage, b as default };
838
932
 
839
933
  //# sourceMappingURL=ParserBuilderPage.js.map