@burdenoff/microfe-bigconsole 2026.805.3 → 2026.812.2

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