@datatechsolutions/ui 3.9.1 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/astrlabe/contracts.d.mts +18 -2
- package/dist/astrlabe/contracts.d.ts +18 -2
- package/dist/astrlabe/index.d.mts +2 -2
- package/dist/astrlabe/index.d.ts +2 -2
- package/dist/astrlabe/index.js +109 -109
- package/dist/astrlabe/index.mjs +5 -5
- package/dist/astrlabe/workflow-canvas.js +5 -5
- package/dist/astrlabe/workflow-canvas.mjs +4 -4
- package/dist/{chunk-SJ6SUS7H.mjs → chunk-2AJ73ULK.mjs} +3 -3
- package/dist/{chunk-SJ6SUS7H.mjs.map → chunk-2AJ73ULK.mjs.map} +1 -1
- package/dist/{chunk-WJENX6KB.js → chunk-35O2X7WY.js} +9 -9
- package/dist/{chunk-WJENX6KB.js.map → chunk-35O2X7WY.js.map} +1 -1
- package/dist/{chunk-ZQRUAXGP.mjs → chunk-35P352JX.mjs} +331 -200
- package/dist/chunk-35P352JX.mjs.map +1 -0
- package/dist/{chunk-6QJI5YOJ.mjs → chunk-37FWIPYO.mjs} +3 -3
- package/dist/{chunk-6QJI5YOJ.mjs.map → chunk-37FWIPYO.mjs.map} +1 -1
- package/dist/{chunk-EAIE4QGD.mjs → chunk-3US2QXEF.mjs} +20 -20
- package/dist/{chunk-EAIE4QGD.mjs.map → chunk-3US2QXEF.mjs.map} +1 -1
- package/dist/{chunk-R6GEJBFC.js → chunk-62BD4WLW.js} +34 -34
- package/dist/{chunk-R6GEJBFC.js.map → chunk-62BD4WLW.js.map} +1 -1
- package/dist/{chunk-7AM2SXEF.js → chunk-6TKCMQ75.js} +85 -85
- package/dist/{chunk-7AM2SXEF.js.map → chunk-6TKCMQ75.js.map} +1 -1
- package/dist/{chunk-OVQ4MKCV.mjs → chunk-7D52TFVL.mjs} +3 -3
- package/dist/{chunk-OVQ4MKCV.mjs.map → chunk-7D52TFVL.mjs.map} +1 -1
- package/dist/{chunk-PD3JLDA5.mjs → chunk-7KPMLHPR.mjs} +3 -3
- package/dist/{chunk-PD3JLDA5.mjs.map → chunk-7KPMLHPR.mjs.map} +1 -1
- package/dist/{chunk-DQIEVLA3.js → chunk-7MPIYSRH.js} +63 -63
- package/dist/{chunk-DQIEVLA3.js.map → chunk-7MPIYSRH.js.map} +1 -1
- package/dist/{chunk-2ZY3IQ2I.mjs → chunk-7V7WEXHS.mjs} +3 -3
- package/dist/{chunk-2ZY3IQ2I.mjs.map → chunk-7V7WEXHS.mjs.map} +1 -1
- package/dist/{chunk-T4IYOKHR.js → chunk-BCJATFZE.js} +25 -25
- package/dist/{chunk-T4IYOKHR.js.map → chunk-BCJATFZE.js.map} +1 -1
- package/dist/{chunk-ZDXEGSCF.js → chunk-BO3RXG6M.js} +45 -45
- package/dist/{chunk-ZDXEGSCF.js.map → chunk-BO3RXG6M.js.map} +1 -1
- package/dist/{chunk-CRBGZA6Y.js → chunk-G52HXPSB.js} +13 -13
- package/dist/{chunk-CRBGZA6Y.js.map → chunk-G52HXPSB.js.map} +1 -1
- package/dist/{chunk-UZIICTIY.js → chunk-GKI74CPB.js} +55 -55
- package/dist/{chunk-UZIICTIY.js.map → chunk-GKI74CPB.js.map} +1 -1
- package/dist/{chunk-RFUSH7WD.js → chunk-GTJGX7IZ.js} +10 -10
- package/dist/{chunk-RFUSH7WD.js.map → chunk-GTJGX7IZ.js.map} +1 -1
- package/dist/{chunk-U6VFS3RD.js → chunk-H475T2N7.js} +143 -143
- package/dist/chunk-H475T2N7.js.map +1 -0
- package/dist/{chunk-ZQEMKEEH.mjs → chunk-HUAWGBYL.mjs} +3 -3
- package/dist/{chunk-ZQEMKEEH.mjs.map → chunk-HUAWGBYL.mjs.map} +1 -1
- package/dist/{chunk-RHRJXK5R.mjs → chunk-IGOMJHC6.mjs} +11 -3
- package/dist/chunk-IGOMJHC6.mjs.map +1 -0
- package/dist/{chunk-6E2YH67A.js → chunk-JTD3BBVI.js} +35 -35
- package/dist/{chunk-6E2YH67A.js.map → chunk-JTD3BBVI.js.map} +1 -1
- package/dist/{chunk-2E7HYTS7.mjs → chunk-K4AJL4BH.mjs} +3 -3
- package/dist/{chunk-2E7HYTS7.mjs.map → chunk-K4AJL4BH.mjs.map} +1 -1
- package/dist/{chunk-OEZ7GAJY.mjs → chunk-KTEEXEAX.mjs} +6 -6
- package/dist/{chunk-OEZ7GAJY.mjs.map → chunk-KTEEXEAX.mjs.map} +1 -1
- package/dist/{chunk-WS3IJFPW.mjs → chunk-NM3YTQ26.mjs} +3 -3
- package/dist/{chunk-WS3IJFPW.mjs.map → chunk-NM3YTQ26.mjs.map} +1 -1
- package/dist/{chunk-BWUFLW5W.mjs → chunk-NRVV4PHB.mjs} +7 -7
- package/dist/{chunk-BWUFLW5W.mjs.map → chunk-NRVV4PHB.mjs.map} +1 -1
- package/dist/{chunk-A2RIX2RK.js → chunk-O2CUOJ74.js} +4 -4
- package/dist/{chunk-A2RIX2RK.js.map → chunk-O2CUOJ74.js.map} +1 -1
- package/dist/{chunk-CLTNCBSP.js → chunk-PHBZ3TXE.js} +4 -4
- package/dist/{chunk-CLTNCBSP.js.map → chunk-PHBZ3TXE.js.map} +1 -1
- package/dist/{chunk-ARLYOLSO.mjs → chunk-R3CGJK7D.mjs} +3 -3
- package/dist/{chunk-ARLYOLSO.mjs.map → chunk-R3CGJK7D.mjs.map} +1 -1
- package/dist/{chunk-GQWC4EKE.mjs → chunk-TCIK6WHT.mjs} +24 -22
- package/dist/chunk-TCIK6WHT.mjs.map +1 -0
- package/dist/{chunk-IVKFXPLO.js → chunk-Z6FZQOTW.js} +46 -44
- package/dist/chunk-Z6FZQOTW.js.map +1 -0
- package/dist/{chunk-MT66VKLS.js → chunk-ZGVN23J4.js} +331 -200
- package/dist/chunk-ZGVN23J4.js.map +1 -0
- package/dist/{chunk-AXBD6OAF.mjs → chunk-ZJMYLUZ2.mjs} +12 -12
- package/dist/chunk-ZJMYLUZ2.mjs.map +1 -0
- package/dist/{chunk-SY4MUT5V.js → chunk-ZUU7G3PC.js} +11 -2
- package/dist/chunk-ZUU7G3PC.js.map +1 -0
- package/dist/index.d.mts +124 -34
- package/dist/index.d.ts +124 -34
- package/dist/index.js +666 -666
- package/dist/index.mjs +3 -3
- package/dist/platform/admin/index.js +11 -11
- package/dist/platform/admin/index.mjs +5 -5
- package/dist/platform/agents-workspace.js +8 -8
- package/dist/platform/agents-workspace.mjs +7 -7
- package/dist/platform/app-shell.js +5 -5
- package/dist/platform/app-shell.mjs +4 -4
- package/dist/platform/auth/index.js +23 -23
- package/dist/platform/auth/index.mjs +5 -5
- package/dist/platform/billing/index.js +5 -5
- package/dist/platform/billing/index.mjs +4 -4
- package/dist/platform/impersonation/index.js +5 -5
- package/dist/platform/impersonation/index.mjs +4 -4
- package/dist/platform/index.js +86 -86
- package/dist/platform/index.mjs +19 -19
- package/dist/platform/pages/index.d.mts +238 -6
- package/dist/platform/pages/index.d.ts +238 -6
- package/dist/platform/pages/index.js +2093 -345
- package/dist/platform/pages/index.js.map +1 -1
- package/dist/platform/pages/index.mjs +1872 -126
- package/dist/platform/pages/index.mjs.map +1 -1
- package/dist/platform/settings/index.js +8 -8
- package/dist/platform/settings/index.mjs +7 -7
- package/dist/platform/workflow-api-client.d.mts +1 -1
- package/dist/platform/workflow-api-client.d.ts +1 -1
- package/dist/platform/workflow-api-client.js +65 -61
- package/dist/platform/workflow-api-client.mjs +1 -1
- package/dist/platform/workflow-canvas-shell.js +6 -6
- package/dist/platform/workflow-canvas-shell.mjs +5 -5
- package/dist/{rule-form-BYJzyork.d.mts → rule-form-BkKCY8Tc.d.mts} +8 -2
- package/dist/{rule-form-BYJzyork.d.ts → rule-form-CBD8wlrw.d.ts} +8 -2
- package/dist/{workflow-api-client-CpFl3WcG.d.mts → workflow-api-client-D9_0Spdz.d.mts} +16 -1
- package/dist/{workflow-api-client-uLICOanv.d.ts → workflow-api-client-E1QFRgeP.d.ts} +16 -1
- package/package.json +1 -1
- package/dist/chunk-AXBD6OAF.mjs.map +0 -1
- package/dist/chunk-GQWC4EKE.mjs.map +0 -1
- package/dist/chunk-IVKFXPLO.js.map +0 -1
- package/dist/chunk-MT66VKLS.js.map +0 -1
- package/dist/chunk-RHRJXK5R.mjs.map +0 -1
- package/dist/chunk-SY4MUT5V.js.map +0 -1
- package/dist/chunk-U6VFS3RD.js.map +0 -1
- package/dist/chunk-ZQRUAXGP.mjs.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { adaptWorkflowGraphToUi, formatDurationMs } from '../../chunk-UQXVCVAN.mjs';
|
|
3
|
-
import { WorkflowWorkspace } from '../../chunk-
|
|
4
|
-
export { RolesPageView, UsersPageView } from '../../chunk-
|
|
5
|
-
import { DatasourceModal, findCategory, DIALECT_CATEGORIES } from '../../chunk-
|
|
6
|
-
export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-
|
|
7
|
-
import { defaultRuleForm, RuleForm, ExecutionTimelinePanel } from '../../chunk-
|
|
3
|
+
import { WorkflowWorkspace } from '../../chunk-TCIK6WHT.mjs';
|
|
4
|
+
export { RolesPageView, UsersPageView } from '../../chunk-TCIK6WHT.mjs';
|
|
5
|
+
import { DatasourceModal, findDialect, findCategory, DIALECT_CATEGORIES } from '../../chunk-37FWIPYO.mjs';
|
|
6
|
+
export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-37FWIPYO.mjs';
|
|
7
|
+
import { defaultRuleForm, RuleForm, ExecutionTimelinePanel, defaultRuleCondition, defaultRuleAction, RuleConditionBuilder, RuleActionBuilder } from '../../chunk-ZJMYLUZ2.mjs';
|
|
8
8
|
import '../../chunk-JB6RNAD2.mjs';
|
|
9
9
|
import '../../chunk-LEXBTVGM.mjs';
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import { HeroSection, PageLoadingState, PageEmptyState,
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import '../../chunk-RHRJXK5R.mjs';
|
|
10
|
+
import '../../chunk-3US2QXEF.mjs';
|
|
11
|
+
import { HeroSection, SearchBar, PageLoadingState, PageEmptyState, EntityCard, CreateActionButton, GlassModal, FormGrid, FormSelect, FormInput, FormTextarea, SectionHeader, Text, Form, FormActionsRow, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, InlineForm, CopyableId, ListCard, ListCardItem, Avatar, SectionCard, Tabs, TabsList, TabsTrigger, TabsContent, StepIndicator, FilterTileButton, FormToggle, Spinner, StatusBadge, ChipPicker, FormCheckbox, SegmentedControl, DatePicker, TimePicker } from '../../chunk-35P352JX.mjs';
|
|
12
|
+
import '../../chunk-IGOMJHC6.mjs';
|
|
14
13
|
import '../../chunk-3AY5HIQ6.mjs';
|
|
14
|
+
import '../../chunk-7VJ7CMMT.mjs';
|
|
15
15
|
import '../../chunk-PLTLRL2V.mjs';
|
|
16
16
|
import { Badge, Button } from '../../chunk-WR55H7DH.mjs';
|
|
17
17
|
import '../../chunk-D2JF6C3E.mjs';
|
|
18
18
|
import { useLink } from '../../chunk-QWG2FMUN.mjs';
|
|
19
19
|
import '../../chunk-G7JQ4OCE.mjs';
|
|
20
20
|
import { useState, useMemo, useEffect, useCallback } from 'react';
|
|
21
|
-
import { CubeTransparentIcon, CpuChipIcon, ChatBubbleLeftEllipsisIcon, WrenchScrewdriverIcon, AdjustmentsHorizontalIcon, CircleStackIcon, RectangleStackIcon, ClockIcon, LinkIcon, KeyIcon, ArrowPathIcon, TrashIcon, PlusIcon, PencilSquareIcon } from '@heroicons/react/24/outline';
|
|
21
|
+
import { CubeTransparentIcon, CpuChipIcon, ChatBubbleLeftEllipsisIcon, WrenchScrewdriverIcon, AdjustmentsHorizontalIcon, CircleStackIcon, RectangleStackIcon, ClockIcon, LinkIcon, KeyIcon, ArrowPathIcon, TrashIcon, PlusIcon, PencilSquareIcon, BellAlertIcon, GlobeAltIcon, PencilIcon, ArrowUpCircleIcon, SparklesIcon } from '@heroicons/react/24/outline';
|
|
22
22
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
23
23
|
|
|
24
24
|
function AgentsModelsPageView({ labels, models, loading }) {
|
|
@@ -33,30 +33,29 @@ function AgentsModelsPageView({ labels, models, loading }) {
|
|
|
33
33
|
label: labels.title,
|
|
34
34
|
title: labels.title,
|
|
35
35
|
subtitle: labels.subtitle,
|
|
36
|
-
gradient: "from-emerald-500 to-teal-700"
|
|
36
|
+
gradient: "from-emerald-500 to-teal-700",
|
|
37
|
+
toolbar: !isEmpty ? /* @__PURE__ */ jsx(
|
|
38
|
+
SearchBar,
|
|
39
|
+
{
|
|
40
|
+
searchTerm,
|
|
41
|
+
onSearchChange: setSearchTerm,
|
|
42
|
+
placeholder: labels.searchPlaceholder ?? labels.title,
|
|
43
|
+
noBorder: true
|
|
44
|
+
}
|
|
45
|
+
) : void 0
|
|
37
46
|
}
|
|
38
47
|
);
|
|
39
|
-
const content = loading ? /* @__PURE__ */ jsx(PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsx(PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
accentGradient: "from-emerald-500 to-teal-700",
|
|
52
|
-
icon: /* @__PURE__ */ jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:bg-emerald-500/20 dark:text-emerald-400", children: /* @__PURE__ */ jsx(CubeTransparentIcon, { className: "h-6 w-6" }) }),
|
|
53
|
-
title: model.name,
|
|
54
|
-
subtitle: `${labels.provider}: ${model.provider}`,
|
|
55
|
-
status: /* @__PURE__ */ jsx(Badge, { color: model.enabled ? "emerald" : "zinc", children: model.enabled ? labels.enabled : labels.disabled })
|
|
56
|
-
},
|
|
57
|
-
model.id
|
|
58
|
-
)) })
|
|
59
|
-
] });
|
|
48
|
+
const content = loading ? /* @__PURE__ */ jsx(PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsx(PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredModels.map((model) => /* @__PURE__ */ jsx(
|
|
49
|
+
EntityCard,
|
|
50
|
+
{
|
|
51
|
+
accentGradient: "from-emerald-500 to-teal-700",
|
|
52
|
+
icon: /* @__PURE__ */ jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:bg-emerald-500/20 dark:text-emerald-400", children: /* @__PURE__ */ jsx(CubeTransparentIcon, { className: "h-6 w-6" }) }),
|
|
53
|
+
title: model.name,
|
|
54
|
+
subtitle: `${labels.provider}: ${model.provider}`,
|
|
55
|
+
status: /* @__PURE__ */ jsx(Badge, { color: model.enabled ? "emerald" : "zinc", children: model.enabled ? labels.enabled : labels.disabled })
|
|
56
|
+
},
|
|
57
|
+
model.id
|
|
58
|
+
)) });
|
|
60
59
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
61
60
|
hero,
|
|
62
61
|
content
|
|
@@ -944,8 +943,12 @@ function setFromJson(set, key, raw) {
|
|
|
944
943
|
set(key, raw);
|
|
945
944
|
}
|
|
946
945
|
}
|
|
947
|
-
function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete }) {
|
|
946
|
+
function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete, onAddClick }) {
|
|
948
947
|
const [createOpen, setCreateOpen] = useState(false);
|
|
948
|
+
const openCreate = () => {
|
|
949
|
+
if (onAddClick) onAddClick();
|
|
950
|
+
else setCreateOpen(true);
|
|
951
|
+
};
|
|
949
952
|
const [editing, setEditing] = useState(null);
|
|
950
953
|
const [searchTerm, setSearchTerm] = useState("");
|
|
951
954
|
const allRules = rules;
|
|
@@ -964,7 +967,7 @@ function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete })
|
|
|
964
967
|
{
|
|
965
968
|
mode: "desktop",
|
|
966
969
|
label: labels.addRule,
|
|
967
|
-
onClick:
|
|
970
|
+
onClick: openCreate,
|
|
968
971
|
accent: "fuchsia"
|
|
969
972
|
}
|
|
970
973
|
)
|
|
@@ -975,7 +978,7 @@ function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete })
|
|
|
975
978
|
{
|
|
976
979
|
mode: "mobile",
|
|
977
980
|
label: labels.addRule,
|
|
978
|
-
onClick:
|
|
981
|
+
onClick: openCreate,
|
|
979
982
|
accent: "fuchsia"
|
|
980
983
|
}
|
|
981
984
|
);
|
|
@@ -1091,7 +1094,10 @@ function ruleToFormValue(rule) {
|
|
|
1091
1094
|
status: typeof rule.status === "string" ? rule.status : base.status,
|
|
1092
1095
|
validFrom: typeof rule.validFrom === "string" ? rule.validFrom : base.validFrom,
|
|
1093
1096
|
validUntil: typeof rule.validUntil === "string" ? rule.validUntil : base.validUntil,
|
|
1094
|
-
tags: Array.isArray(rule.tags) ? rule.tags.filter((tag) => typeof tag === "string") : base.tags
|
|
1097
|
+
tags: Array.isArray(rule.tags) ? rule.tags.filter((tag) => typeof tag === "string") : base.tags,
|
|
1098
|
+
// Round-trip recurrence (Fallback 4) — backend persists it as the
|
|
1099
|
+
// structured `{ kind, ... }` blob the wizard sends.
|
|
1100
|
+
recurrence: rule.recurrence ?? null
|
|
1095
1101
|
};
|
|
1096
1102
|
}
|
|
1097
1103
|
function pickAction(rule) {
|
|
@@ -1119,6 +1125,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1119
1125
|
timeoutMs: 3e4,
|
|
1120
1126
|
allowedTables: null,
|
|
1121
1127
|
blockedColumns: null,
|
|
1128
|
+
maskPii: null,
|
|
1122
1129
|
enabled: true,
|
|
1123
1130
|
createdAt: "2026-03-20T10:00:00Z",
|
|
1124
1131
|
updatedAt: "2026-03-20T10:00:00Z",
|
|
@@ -1135,6 +1142,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1135
1142
|
timeoutMs: 15e3,
|
|
1136
1143
|
allowedTables: null,
|
|
1137
1144
|
blockedColumns: null,
|
|
1145
|
+
maskPii: null,
|
|
1138
1146
|
enabled: true,
|
|
1139
1147
|
createdAt: "2026-03-18T08:30:00Z",
|
|
1140
1148
|
updatedAt: "2026-03-22T14:00:00Z",
|
|
@@ -1151,6 +1159,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1151
1159
|
timeoutMs: 3e4,
|
|
1152
1160
|
allowedTables: null,
|
|
1153
1161
|
blockedColumns: null,
|
|
1162
|
+
maskPii: null,
|
|
1154
1163
|
enabled: true,
|
|
1155
1164
|
createdAt: "2026-03-15T09:00:00Z",
|
|
1156
1165
|
updatedAt: "2026-03-21T11:00:00Z",
|
|
@@ -1167,6 +1176,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1167
1176
|
timeoutMs: 1e4,
|
|
1168
1177
|
allowedTables: null,
|
|
1169
1178
|
blockedColumns: null,
|
|
1179
|
+
maskPii: null,
|
|
1170
1180
|
enabled: false,
|
|
1171
1181
|
createdAt: "2026-03-10T12:00:00Z",
|
|
1172
1182
|
updatedAt: "2026-03-19T16:00:00Z",
|
|
@@ -1183,6 +1193,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1183
1193
|
timeoutMs: 5e3,
|
|
1184
1194
|
allowedTables: null,
|
|
1185
1195
|
blockedColumns: null,
|
|
1196
|
+
maskPii: null,
|
|
1186
1197
|
enabled: true,
|
|
1187
1198
|
createdAt: "2026-03-12T07:00:00Z",
|
|
1188
1199
|
updatedAt: "2026-03-23T09:00:00Z",
|
|
@@ -1199,6 +1210,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1199
1210
|
timeoutMs: 2e4,
|
|
1200
1211
|
allowedTables: null,
|
|
1201
1212
|
blockedColumns: null,
|
|
1213
|
+
maskPii: null,
|
|
1202
1214
|
enabled: true,
|
|
1203
1215
|
createdAt: "2026-03-22T15:00:00Z",
|
|
1204
1216
|
updatedAt: "2026-03-25T10:00:00Z",
|
|
@@ -1259,9 +1271,14 @@ function DatasourcesPageView({
|
|
|
1259
1271
|
labels,
|
|
1260
1272
|
datasources: externalDatasources,
|
|
1261
1273
|
useSampleData = false,
|
|
1262
|
-
onCreate
|
|
1274
|
+
onCreate,
|
|
1275
|
+
onAddClick
|
|
1263
1276
|
}) {
|
|
1264
1277
|
const [modalOpen, setModalOpen] = useState(false);
|
|
1278
|
+
const openCreate = () => {
|
|
1279
|
+
if (onAddClick) onAddClick();
|
|
1280
|
+
else setModalOpen(true);
|
|
1281
|
+
};
|
|
1265
1282
|
const [searchTerm, setSearchTerm] = useState("");
|
|
1266
1283
|
const [localDatasources, setLocalDatasources] = useState(
|
|
1267
1284
|
useSampleData ? SAMPLE_DATASOURCES : []
|
|
@@ -1285,6 +1302,7 @@ function DatasourcesPageView({
|
|
|
1285
1302
|
timeoutMs: 3e4,
|
|
1286
1303
|
allowedTables: null,
|
|
1287
1304
|
blockedColumns: null,
|
|
1305
|
+
maskPii: null,
|
|
1288
1306
|
enabled: true,
|
|
1289
1307
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1290
1308
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1306,7 +1324,7 @@ function DatasourcesPageView({
|
|
|
1306
1324
|
{
|
|
1307
1325
|
mode: "desktop",
|
|
1308
1326
|
label: labels.addDatasource,
|
|
1309
|
-
onClick:
|
|
1327
|
+
onClick: openCreate,
|
|
1310
1328
|
accent: "amber"
|
|
1311
1329
|
}
|
|
1312
1330
|
)
|
|
@@ -1317,7 +1335,7 @@ function DatasourcesPageView({
|
|
|
1317
1335
|
{
|
|
1318
1336
|
mode: "mobile",
|
|
1319
1337
|
label: labels.addDatasource,
|
|
1320
|
-
onClick:
|
|
1338
|
+
onClick: openCreate,
|
|
1321
1339
|
accent: "amber"
|
|
1322
1340
|
}
|
|
1323
1341
|
),
|
|
@@ -1409,31 +1427,30 @@ function AgentsIndexPageView({ labels }) {
|
|
|
1409
1427
|
label: labels.title,
|
|
1410
1428
|
title: labels.title,
|
|
1411
1429
|
subtitle: labels.subtitle,
|
|
1412
|
-
gradient: "from-violet-500 to-indigo-700"
|
|
1430
|
+
gradient: "from-violet-500 to-indigo-700",
|
|
1431
|
+
toolbar: !isEmpty ? /* @__PURE__ */ jsx(
|
|
1432
|
+
SearchBar,
|
|
1433
|
+
{
|
|
1434
|
+
searchTerm,
|
|
1435
|
+
onSearchChange: setSearchTerm,
|
|
1436
|
+
placeholder: labels.searchPlaceholder ?? labels.title,
|
|
1437
|
+
noBorder: true
|
|
1438
|
+
}
|
|
1439
|
+
) : void 0
|
|
1413
1440
|
}
|
|
1414
1441
|
);
|
|
1415
|
-
const content = /* @__PURE__ */
|
|
1416
|
-
|
|
1417
|
-
|
|
1442
|
+
const content = /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4", children: filteredTiles.map((tile) => {
|
|
1443
|
+
const Icon = tile.icon;
|
|
1444
|
+
return /* @__PURE__ */ jsx(Link, { href: tile.href, className: "block focus:outline-none", children: /* @__PURE__ */ jsx(
|
|
1445
|
+
EntityCard,
|
|
1418
1446
|
{
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1447
|
+
accentGradient: tile.gradient,
|
|
1448
|
+
icon: /* @__PURE__ */ jsx("div", { className: `flex h-11 w-11 items-center justify-center rounded-lg bg-gradient-to-br ${tile.gradient} shadow-lg`, children: /* @__PURE__ */ jsx(Icon, { className: "h-6 w-6 text-white" }) }),
|
|
1449
|
+
title: tile.title,
|
|
1450
|
+
children: /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: tile.subtitle })
|
|
1422
1451
|
}
|
|
1423
|
-
),
|
|
1424
|
-
|
|
1425
|
-
const Icon = tile.icon;
|
|
1426
|
-
return /* @__PURE__ */ jsx(Link, { href: tile.href, className: "block focus:outline-none", children: /* @__PURE__ */ jsx(
|
|
1427
|
-
EntityCard,
|
|
1428
|
-
{
|
|
1429
|
-
accentGradient: tile.gradient,
|
|
1430
|
-
icon: /* @__PURE__ */ jsx("div", { className: `flex h-11 w-11 items-center justify-center rounded-lg bg-gradient-to-br ${tile.gradient} shadow-lg`, children: /* @__PURE__ */ jsx(Icon, { className: "h-6 w-6 text-white" }) }),
|
|
1431
|
-
title: tile.title,
|
|
1432
|
-
children: /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: tile.subtitle })
|
|
1433
|
-
}
|
|
1434
|
-
) }, tile.id);
|
|
1435
|
-
}) })
|
|
1436
|
-
] });
|
|
1452
|
+
) }, tile.id);
|
|
1453
|
+
}) });
|
|
1437
1454
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
1438
1455
|
hero,
|
|
1439
1456
|
content
|
|
@@ -1524,6 +1541,7 @@ var BADGE_COLOR = {
|
|
|
1524
1541
|
function WorkflowRunsPageView({ labels, runs, loading, onCancel, onReplay, onView, onViewTimeline }) {
|
|
1525
1542
|
const [statusFilter, setStatusFilter] = useState("all");
|
|
1526
1543
|
const [searchTerm, setSearchTerm] = useState("");
|
|
1544
|
+
const [filtersOpen, setFiltersOpen] = useState(false);
|
|
1527
1545
|
const statusOptions = useMemo(() => [
|
|
1528
1546
|
{ value: "all", label: labels.filterAll },
|
|
1529
1547
|
{ value: "pending", label: labels.statusPending },
|
|
@@ -1566,54 +1584,61 @@ function WorkflowRunsPageView({ labels, runs, loading, onCancel, onReplay, onVie
|
|
|
1566
1584
|
title: labels.title,
|
|
1567
1585
|
subtitle: labels.subtitle,
|
|
1568
1586
|
gradient: "from-indigo-500 to-sky-700",
|
|
1569
|
-
toolbar:
|
|
1570
|
-
|
|
1587
|
+
toolbar: !isEmpty ? /* @__PURE__ */ jsx(
|
|
1588
|
+
SearchBar,
|
|
1571
1589
|
{
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1590
|
+
searchTerm,
|
|
1591
|
+
onSearchChange: setSearchTerm,
|
|
1592
|
+
placeholder: labels.searchPlaceholder ?? labels.title,
|
|
1593
|
+
noBorder: true,
|
|
1594
|
+
filtersModal: {
|
|
1595
|
+
open: filtersOpen,
|
|
1596
|
+
onOpen: () => setFiltersOpen(true),
|
|
1597
|
+
onClose: () => setFiltersOpen(false),
|
|
1598
|
+
title: labels.filterStatus,
|
|
1599
|
+
count: statusFilter !== "all" ? 1 : 0,
|
|
1600
|
+
onClear: statusFilter !== "all" ? () => setStatusFilter("all") : void 0,
|
|
1601
|
+
children: /* @__PURE__ */ jsx(
|
|
1602
|
+
FormSelect,
|
|
1603
|
+
{
|
|
1604
|
+
name: "statusFilter",
|
|
1605
|
+
label: labels.filterStatus,
|
|
1606
|
+
options: statusOptions,
|
|
1607
|
+
value: statusFilter,
|
|
1608
|
+
onValueChange: setStatusFilter
|
|
1609
|
+
}
|
|
1610
|
+
)
|
|
1611
|
+
}
|
|
1577
1612
|
}
|
|
1578
|
-
)
|
|
1613
|
+
) : void 0
|
|
1579
1614
|
}
|
|
1580
1615
|
);
|
|
1581
|
-
const content = loading ? /* @__PURE__ */ jsx(PageLoadingState, {}) : filteredRuns.length === 0 ? /* @__PURE__ */ jsx(PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
/* @__PURE__ */ jsx(Button, { type: "button", size: "sm", outline: true, onClick: () => onReplay(run), children: labels.replay }),
|
|
1602
|
-
run.status === "running" && /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", color: "rose", onClick: () => onCancel(run), children: labels.cancel })
|
|
1616
|
+
const content = loading ? /* @__PURE__ */ jsx(PageLoadingState, {}) : filteredRuns.length === 0 ? /* @__PURE__ */ jsx(PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredRuns.map((run) => /* @__PURE__ */ jsxs(
|
|
1617
|
+
EntityCard,
|
|
1618
|
+
{
|
|
1619
|
+
accentGradient: "from-indigo-500 to-sky-700",
|
|
1620
|
+
icon: /* @__PURE__ */ jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-indigo-500/10 text-indigo-600 dark:bg-indigo-500/20 dark:text-indigo-400", children: /* @__PURE__ */ jsx(ClockIcon, { className: "h-6 w-6" }) }),
|
|
1621
|
+
title: run.id.slice(0, 8),
|
|
1622
|
+
subtitle: `${labels.startedAt}: ${new Date(run.createdAt).toLocaleString()}`,
|
|
1623
|
+
status: /* @__PURE__ */ jsx(Badge, { color: BADGE_COLOR[run.status] ?? "zinc", children: statusLabelFor(run.status) }),
|
|
1624
|
+
footer: /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
1625
|
+
onView && /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", outline: true, onClick: () => onView(run), children: labels.view }),
|
|
1626
|
+
onViewTimeline && labels.timeline && /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", outline: true, onClick: () => onViewTimeline(run), children: labels.timeline }),
|
|
1627
|
+
/* @__PURE__ */ jsx(Button, { type: "button", size: "sm", outline: true, onClick: () => onReplay(run), children: labels.replay }),
|
|
1628
|
+
run.status === "running" && /* @__PURE__ */ jsx(Button, { type: "button", size: "sm", color: "rose", onClick: () => onCancel(run), children: labels.cancel })
|
|
1629
|
+
] }),
|
|
1630
|
+
children: [
|
|
1631
|
+
/* @__PURE__ */ jsxs("dl", { className: "mt-1 grid grid-cols-2 gap-1 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
1632
|
+
/* @__PURE__ */ jsx("dt", { children: labels.duration }),
|
|
1633
|
+
/* @__PURE__ */ jsx("dd", { className: "text-right", children: formatDurationMs(run.totalDurationMs) }),
|
|
1634
|
+
/* @__PURE__ */ jsx("dt", { children: labels.triggeredBy }),
|
|
1635
|
+
/* @__PURE__ */ jsx("dd", { className: "text-right truncate", children: run.triggeredBy || "\u2014" })
|
|
1603
1636
|
] }),
|
|
1604
|
-
children:
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
/* @__PURE__ */ jsx("dd", { className: "text-right truncate", children: run.triggeredBy || "\u2014" })
|
|
1610
|
-
] }),
|
|
1611
|
-
run.error && /* @__PURE__ */ jsx("p", { className: "mt-1 line-clamp-2 text-xs text-rose-600 dark:text-rose-400", children: run.error })
|
|
1612
|
-
]
|
|
1613
|
-
},
|
|
1614
|
-
run.id
|
|
1615
|
-
)) })
|
|
1616
|
-
] });
|
|
1637
|
+
run.error && /* @__PURE__ */ jsx("p", { className: "mt-1 line-clamp-2 text-xs text-rose-600 dark:text-rose-400", children: run.error })
|
|
1638
|
+
]
|
|
1639
|
+
},
|
|
1640
|
+
run.id
|
|
1641
|
+
)) });
|
|
1617
1642
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
1618
1643
|
hero,
|
|
1619
1644
|
content
|
|
@@ -2820,14 +2845,14 @@ function RangeSliderField({
|
|
|
2820
2845
|
step,
|
|
2821
2846
|
zones,
|
|
2822
2847
|
trackGradient,
|
|
2823
|
-
formatValue,
|
|
2848
|
+
formatValue: formatValue2,
|
|
2824
2849
|
ariaLabel
|
|
2825
2850
|
}) {
|
|
2826
2851
|
const percent = (value - min) / (max - min) * 100;
|
|
2827
2852
|
const activeZone = zones?.find((z) => value <= z.max) ?? zones?.[zones.length - 1];
|
|
2828
2853
|
const thumbColor = activeZone?.thumbColor ?? "#6366f1";
|
|
2829
2854
|
const glow = hexToGlow(thumbColor);
|
|
2830
|
-
const displayValue =
|
|
2855
|
+
const displayValue = formatValue2 ? formatValue2(value) : value.toString();
|
|
2831
2856
|
const ariaText = activeZone ? `${displayValue} \u2014 ${activeZone.label}` : displayValue;
|
|
2832
2857
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2833
2858
|
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
@@ -2970,11 +2995,9 @@ function AgentNewWizardPageView({
|
|
|
2970
2995
|
labels.wizardStep4Subtitle,
|
|
2971
2996
|
labels.wizardStep5Subtitle
|
|
2972
2997
|
];
|
|
2973
|
-
const
|
|
2998
|
+
const indicatorSteps = stepTitles.map((title, idx) => ({
|
|
2974
2999
|
id: String(idx + 1),
|
|
2975
|
-
|
|
2976
|
-
description: stepSubtitles[idx],
|
|
2977
|
-
status: idx + 1 < step ? "complete" : idx + 1 === step ? "current" : "upcoming"
|
|
3000
|
+
title
|
|
2978
3001
|
}));
|
|
2979
3002
|
function markTouched() {
|
|
2980
3003
|
if (!touched) setTouched(true);
|
|
@@ -3073,7 +3096,17 @@ function AgentNewWizardPageView({
|
|
|
3073
3096
|
label: counter,
|
|
3074
3097
|
title: labels.pageTitle,
|
|
3075
3098
|
subtitle: stepSubtitles[step - 1],
|
|
3076
|
-
gradient: activePreset.accent
|
|
3099
|
+
gradient: activePreset.accent,
|
|
3100
|
+
children: /* @__PURE__ */ jsx(
|
|
3101
|
+
StepIndicator,
|
|
3102
|
+
{
|
|
3103
|
+
accent: "indigo",
|
|
3104
|
+
currentStep: step - 1,
|
|
3105
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
3106
|
+
progressLabel: labels.pageTitle,
|
|
3107
|
+
steps: indicatorSteps
|
|
3108
|
+
}
|
|
3109
|
+
)
|
|
3077
3110
|
}
|
|
3078
3111
|
);
|
|
3079
3112
|
function renderStep1() {
|
|
@@ -3586,22 +3619,10 @@ function AgentNewWizardPageView({
|
|
|
3586
3619
|
if (step < TOTAL_STEPS) goNext();
|
|
3587
3620
|
else void submit();
|
|
3588
3621
|
},
|
|
3589
|
-
className: "space-y-
|
|
3622
|
+
className: "space-y-4",
|
|
3590
3623
|
children: [
|
|
3591
|
-
/* @__PURE__ */ jsx(
|
|
3592
|
-
|
|
3593
|
-
{
|
|
3594
|
-
steps: timelineSteps,
|
|
3595
|
-
progressLabel: labels.pageTitle,
|
|
3596
|
-
onStepClick: (idx) => {
|
|
3597
|
-
goToStep(idx + 1);
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
),
|
|
3601
|
-
/* @__PURE__ */ jsxs("div", { className: "w-full space-y-5", children: [
|
|
3602
|
-
stepBody,
|
|
3603
|
-
footer
|
|
3604
|
-
] })
|
|
3624
|
+
/* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
|
|
3625
|
+
footer
|
|
3605
3626
|
]
|
|
3606
3627
|
}
|
|
3607
3628
|
);
|
|
@@ -3616,7 +3637,1732 @@ function ReviewRow({ label, value }) {
|
|
|
3616
3637
|
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-gray-900 dark:text-white", children: value })
|
|
3617
3638
|
] });
|
|
3618
3639
|
}
|
|
3640
|
+
var DIALECT_LOGO_SRC = {
|
|
3641
|
+
bigquery: "/logos/datasources/bigquery.svg",
|
|
3642
|
+
postgres: "/logos/datasources/postgres.svg",
|
|
3643
|
+
postgresql: "/logos/datasources/postgres.svg",
|
|
3644
|
+
mysql: "/logos/datasources/mysql.svg",
|
|
3645
|
+
mariadb: "/logos/datasources/mariadb.svg",
|
|
3646
|
+
snowflake: "/logos/datasources/snowflake.svg",
|
|
3647
|
+
mongodb: "/logos/datasources/mongodb.svg",
|
|
3648
|
+
redis: "/logos/datasources/redis.svg",
|
|
3649
|
+
clickhouse: "/logos/datasources/clickhouse.svg",
|
|
3650
|
+
elasticsearch: "/logos/datasources/elasticsearch.svg",
|
|
3651
|
+
duckdb: "/logos/datasources/duckdb.svg",
|
|
3652
|
+
sqlite: "/logos/datasources/sqlite.svg",
|
|
3653
|
+
oracle: "/logos/datasources/oracle.svg",
|
|
3654
|
+
mssql: "/logos/datasources/mssql.svg",
|
|
3655
|
+
sqlserver: "/logos/datasources/mssql.svg",
|
|
3656
|
+
cassandra: "/logos/datasources/cassandra.svg",
|
|
3657
|
+
dynamodb: "/logos/datasources/dynamodb.svg",
|
|
3658
|
+
cockroach: "/logos/datasources/cockroachdb.svg",
|
|
3659
|
+
cockroachdb: "/logos/datasources/cockroachdb.svg",
|
|
3660
|
+
supabase: "/logos/datasources/supabase.svg",
|
|
3661
|
+
firebase: "/logos/datasources/firebase.svg",
|
|
3662
|
+
neo4j: "/logos/datasources/neo4j.svg",
|
|
3663
|
+
neptune: "/logos/datasources/neptune.svg",
|
|
3664
|
+
timestream: "/logos/datasources/timestream.svg",
|
|
3665
|
+
opensearch: "/logos/datasources/opensearch.svg"
|
|
3666
|
+
};
|
|
3667
|
+
var CATEGORY_COLOR = {
|
|
3668
|
+
relational: "blue",
|
|
3669
|
+
nosql: "emerald",
|
|
3670
|
+
warehouse: "purple",
|
|
3671
|
+
timeseries: "sky",
|
|
3672
|
+
graph: "pink",
|
|
3673
|
+
keyvalue: "red",
|
|
3674
|
+
search: "amber"
|
|
3675
|
+
};
|
|
3676
|
+
var TOTAL_STEPS2 = 4;
|
|
3677
|
+
function DatasourceNewWizardPageView({
|
|
3678
|
+
labels,
|
|
3679
|
+
initialStep,
|
|
3680
|
+
onStepChange,
|
|
3681
|
+
onSubmit,
|
|
3682
|
+
onCancel,
|
|
3683
|
+
onTestConnection
|
|
3684
|
+
}) {
|
|
3685
|
+
const clampedInitial = Math.min(TOTAL_STEPS2, Math.max(1, initialStep ?? 1));
|
|
3686
|
+
const [step, setStep] = useState(clampedInitial);
|
|
3687
|
+
const [dialect, setDialect] = useState("");
|
|
3688
|
+
const [name, setName] = useState("");
|
|
3689
|
+
const [host, setHost] = useState("");
|
|
3690
|
+
const [port, setPort] = useState("");
|
|
3691
|
+
const [database, setDatabase] = useState("");
|
|
3692
|
+
const [username, setUsername] = useState("");
|
|
3693
|
+
const [password, setPassword] = useState("");
|
|
3694
|
+
const [schema, setSchema] = useState("");
|
|
3695
|
+
const [connectionString, setConnectionString] = useState("");
|
|
3696
|
+
const [projectId, setProjectId] = useState("");
|
|
3697
|
+
const [dataset, setDataset] = useState("");
|
|
3698
|
+
const [keyFile, setKeyFile] = useState("");
|
|
3699
|
+
const [account, setAccount] = useState("");
|
|
3700
|
+
const [warehouseField, setWarehouseField] = useState("");
|
|
3701
|
+
const [region, setRegion] = useState("");
|
|
3702
|
+
const [bucket, setBucket] = useState("");
|
|
3703
|
+
const [token, setToken] = useState("");
|
|
3704
|
+
const [apiKey, setApiKey] = useState("");
|
|
3705
|
+
const [environment, setEnvironment] = useState("");
|
|
3706
|
+
const [index, setIndex] = useState("");
|
|
3707
|
+
const [ssl, setSsl] = useState(true);
|
|
3708
|
+
const [readOnly, setReadOnly] = useState(true);
|
|
3709
|
+
const [maxPoolSize, setMaxPoolSize] = useState("5");
|
|
3710
|
+
const [timeoutMs, setTimeoutMs] = useState("5000");
|
|
3711
|
+
const [allowedTablesItems, setAllowedTablesItems] = useState([]);
|
|
3712
|
+
const [allowedTablesSelected, setAllowedTablesSelected] = useState([]);
|
|
3713
|
+
const [blockedColumnsItems, setBlockedColumnsItems] = useState([]);
|
|
3714
|
+
const [blockedColumnsSelected, setBlockedColumnsSelected] = useState([]);
|
|
3715
|
+
const [maskPii, setMaskPii] = useState(false);
|
|
3716
|
+
const allowedTablesStyle = {
|
|
3717
|
+
bg: "bg-amber-500/15",
|
|
3718
|
+
text: "text-amber-700 dark:text-amber-300"
|
|
3719
|
+
};
|
|
3720
|
+
const blockedColumnsStyle = {
|
|
3721
|
+
bg: "bg-rose-500/15",
|
|
3722
|
+
text: "text-rose-700 dark:text-rose-300"
|
|
3723
|
+
};
|
|
3724
|
+
const [submitting, setSubmitting] = useState(false);
|
|
3725
|
+
const [touched, setTouched] = useState(false);
|
|
3726
|
+
const [testStatus, setTestStatus] = useState("idle");
|
|
3727
|
+
const dialectOption = useMemo(() => dialect ? findDialect(dialect) : null, [dialect]);
|
|
3728
|
+
const category = useMemo(() => dialect ? findCategory(dialect) : null, [dialect]);
|
|
3729
|
+
useEffect(() => {
|
|
3730
|
+
if (dialectOption?.defaultPort && (port === "" || /^[0-9]+$/.test(port))) {
|
|
3731
|
+
setPort(String(dialectOption.defaultPort));
|
|
3732
|
+
}
|
|
3733
|
+
}, [dialect]);
|
|
3734
|
+
useEffect(() => {
|
|
3735
|
+
const next = Math.min(TOTAL_STEPS2, Math.max(1, initialStep ?? 1));
|
|
3736
|
+
if (next !== step) setStep(next);
|
|
3737
|
+
}, [initialStep]);
|
|
3738
|
+
function markTouched() {
|
|
3739
|
+
if (!touched) setTouched(true);
|
|
3740
|
+
}
|
|
3741
|
+
const goToStep = useCallback((next) => {
|
|
3742
|
+
const clamped = Math.min(TOTAL_STEPS2, Math.max(1, next));
|
|
3743
|
+
setStep(clamped);
|
|
3744
|
+
onStepChange?.(clamped);
|
|
3745
|
+
}, [onStepChange]);
|
|
3746
|
+
function canAdvance(from) {
|
|
3747
|
+
if (from === 1) return Boolean(dialect);
|
|
3748
|
+
if (from === 2) return name.trim().length > 0;
|
|
3749
|
+
return true;
|
|
3750
|
+
}
|
|
3751
|
+
const goNext = useCallback(() => {
|
|
3752
|
+
if (!canAdvance(step)) return;
|
|
3753
|
+
if (step < TOTAL_STEPS2) goToStep(step + 1);
|
|
3754
|
+
}, [step, dialect, name]);
|
|
3755
|
+
const goBack = useCallback(() => {
|
|
3756
|
+
if (step > 1) goToStep(step - 1);
|
|
3757
|
+
}, [step, goToStep]);
|
|
3758
|
+
const cancelWithConfirm = useCallback(() => {
|
|
3759
|
+
if (touched && !window.confirm(labels.wizardCancelConfirm)) return;
|
|
3760
|
+
onCancel();
|
|
3761
|
+
}, [touched, labels.wizardCancelConfirm, onCancel]);
|
|
3762
|
+
function buildPayload() {
|
|
3763
|
+
const payload = {
|
|
3764
|
+
name: name.trim(),
|
|
3765
|
+
dialect,
|
|
3766
|
+
ssl,
|
|
3767
|
+
readOnly
|
|
3768
|
+
};
|
|
3769
|
+
if (host.trim()) payload.host = host.trim();
|
|
3770
|
+
const portNum = Number(port);
|
|
3771
|
+
if (Number.isFinite(portNum) && portNum > 0) payload.port = portNum;
|
|
3772
|
+
if (database.trim()) payload.database = database.trim();
|
|
3773
|
+
if (username.trim()) payload.username = username.trim();
|
|
3774
|
+
if (password) payload.password = password;
|
|
3775
|
+
if (schema.trim()) payload.schema = schema.trim();
|
|
3776
|
+
if (connectionString.trim()) payload.connectionString = connectionString.trim();
|
|
3777
|
+
if (projectId.trim()) payload.projectId = projectId.trim();
|
|
3778
|
+
if (dataset.trim()) payload.dataset = dataset.trim();
|
|
3779
|
+
if (keyFile.trim()) payload.keyFile = keyFile.trim();
|
|
3780
|
+
if (account.trim()) payload.account = account.trim();
|
|
3781
|
+
if (warehouseField.trim()) payload.warehouse = warehouseField.trim();
|
|
3782
|
+
if (region.trim()) payload.region = region.trim();
|
|
3783
|
+
if (bucket.trim()) payload.bucket = bucket.trim();
|
|
3784
|
+
if (token) payload.token = token;
|
|
3785
|
+
if (apiKey) payload.apiKey = apiKey;
|
|
3786
|
+
if (environment.trim()) payload.environment = environment.trim();
|
|
3787
|
+
if (index.trim()) payload.index = index.trim();
|
|
3788
|
+
const pool = Number(maxPoolSize);
|
|
3789
|
+
if (Number.isFinite(pool) && pool > 0) payload.maxPoolSize = pool;
|
|
3790
|
+
const timeout = Number(timeoutMs);
|
|
3791
|
+
if (Number.isFinite(timeout) && timeout > 0) payload.timeoutMs = timeout;
|
|
3792
|
+
if (allowedTablesSelected.length > 0) payload.allowedTables = [...allowedTablesSelected];
|
|
3793
|
+
if (blockedColumnsSelected.length > 0) payload.blockedColumns = [...blockedColumnsSelected];
|
|
3794
|
+
if (maskPii) payload.maskPii = true;
|
|
3795
|
+
return payload;
|
|
3796
|
+
}
|
|
3797
|
+
async function handleTestConnection() {
|
|
3798
|
+
setTestStatus("testing");
|
|
3799
|
+
try {
|
|
3800
|
+
const ok = onTestConnection ? await onTestConnection(buildPayload()) : await simulateTest();
|
|
3801
|
+
setTestStatus(ok ? "success" : "failed");
|
|
3802
|
+
setTimeout(() => setTestStatus("idle"), 3500);
|
|
3803
|
+
} catch {
|
|
3804
|
+
setTestStatus("failed");
|
|
3805
|
+
setTimeout(() => setTestStatus("idle"), 3500);
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
async function submit() {
|
|
3809
|
+
setSubmitting(true);
|
|
3810
|
+
try {
|
|
3811
|
+
await onSubmit(buildPayload());
|
|
3812
|
+
} finally {
|
|
3813
|
+
setSubmitting(false);
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
useEffect(() => {
|
|
3817
|
+
function onKey(e) {
|
|
3818
|
+
if (e.key === "Escape") {
|
|
3819
|
+
e.preventDefault();
|
|
3820
|
+
cancelWithConfirm();
|
|
3821
|
+
return;
|
|
3822
|
+
}
|
|
3823
|
+
if (e.key === "Enter") {
|
|
3824
|
+
const target = e.target;
|
|
3825
|
+
const tag = target?.tagName?.toLowerCase();
|
|
3826
|
+
if (tag === "textarea" || tag === "select" || tag === "input" || tag === "button") return;
|
|
3827
|
+
e.preventDefault();
|
|
3828
|
+
if (step < TOTAL_STEPS2) goNext();
|
|
3829
|
+
else void submit();
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
window.addEventListener("keydown", onKey);
|
|
3833
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
3834
|
+
}, [step, dialect, name, touched]);
|
|
3835
|
+
const stepTitles = [
|
|
3836
|
+
labels.wizardStep1Title,
|
|
3837
|
+
labels.wizardStep2Title,
|
|
3838
|
+
labels.wizardStep3Title,
|
|
3839
|
+
labels.wizardStep4Title
|
|
3840
|
+
];
|
|
3841
|
+
const stepSubtitles = [
|
|
3842
|
+
labels.wizardStep1Subtitle,
|
|
3843
|
+
labels.wizardStep2Subtitle,
|
|
3844
|
+
labels.wizardStep3Subtitle,
|
|
3845
|
+
labels.wizardStep4Subtitle
|
|
3846
|
+
];
|
|
3847
|
+
const indicatorSteps = stepTitles.map((title, idx) => ({
|
|
3848
|
+
id: String(idx + 1),
|
|
3849
|
+
title
|
|
3850
|
+
}));
|
|
3851
|
+
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS2));
|
|
3852
|
+
const hero = /* @__PURE__ */ jsx(
|
|
3853
|
+
HeroSection,
|
|
3854
|
+
{
|
|
3855
|
+
icon: /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
|
|
3856
|
+
label: counter,
|
|
3857
|
+
title: labels.pageTitle,
|
|
3858
|
+
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
3859
|
+
gradient: category?.gradient ?? "from-amber-500 to-orange-600",
|
|
3860
|
+
children: /* @__PURE__ */ jsx(
|
|
3861
|
+
StepIndicator,
|
|
3862
|
+
{
|
|
3863
|
+
accent: "indigo",
|
|
3864
|
+
currentStep: step - 1,
|
|
3865
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
3866
|
+
progressLabel: labels.pageTitle,
|
|
3867
|
+
steps: indicatorSteps
|
|
3868
|
+
}
|
|
3869
|
+
)
|
|
3870
|
+
}
|
|
3871
|
+
);
|
|
3872
|
+
function renderStep1() {
|
|
3873
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-6", children: DIALECT_CATEGORIES.map((cat) => {
|
|
3874
|
+
const color = CATEGORY_COLOR[cat.id] ?? "slate";
|
|
3875
|
+
const categoryLabel = labels[cat.labelKey] ?? cat.id;
|
|
3876
|
+
return /* @__PURE__ */ jsx(
|
|
3877
|
+
SectionCard,
|
|
3878
|
+
{
|
|
3879
|
+
variant: "glass",
|
|
3880
|
+
header: {
|
|
3881
|
+
title: categoryLabel,
|
|
3882
|
+
icon: /* @__PURE__ */ jsx(cat.icon, { className: "h-4 w-4" }),
|
|
3883
|
+
gradient: cat.gradient
|
|
3884
|
+
},
|
|
3885
|
+
children: /* @__PURE__ */ jsx(
|
|
3886
|
+
"div",
|
|
3887
|
+
{
|
|
3888
|
+
role: "radiogroup",
|
|
3889
|
+
"aria-label": categoryLabel,
|
|
3890
|
+
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
3891
|
+
children: cat.dialects.map((opt) => {
|
|
3892
|
+
const selected = opt.value === dialect;
|
|
3893
|
+
const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
|
|
3894
|
+
return /* @__PURE__ */ jsx(
|
|
3895
|
+
FilterTileButton,
|
|
3896
|
+
{
|
|
3897
|
+
isActive: selected,
|
|
3898
|
+
color,
|
|
3899
|
+
icon: logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
|
|
3900
|
+
label: opt.label,
|
|
3901
|
+
count: opt.formType.replace("-", " "),
|
|
3902
|
+
onClick: () => {
|
|
3903
|
+
setDialect(opt.value);
|
|
3904
|
+
markTouched();
|
|
3905
|
+
}
|
|
3906
|
+
},
|
|
3907
|
+
opt.value
|
|
3908
|
+
);
|
|
3909
|
+
})
|
|
3910
|
+
}
|
|
3911
|
+
)
|
|
3912
|
+
},
|
|
3913
|
+
cat.id
|
|
3914
|
+
);
|
|
3915
|
+
}) });
|
|
3916
|
+
}
|
|
3917
|
+
function renderConnectionFields() {
|
|
3918
|
+
if (!dialectOption) return null;
|
|
3919
|
+
switch (dialectOption.formType) {
|
|
3920
|
+
case "standard":
|
|
3921
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3922
|
+
/* @__PURE__ */ jsx(
|
|
3923
|
+
FormInput,
|
|
3924
|
+
{
|
|
3925
|
+
label: labels.fieldHost,
|
|
3926
|
+
value: host,
|
|
3927
|
+
onValueChange: (v) => {
|
|
3928
|
+
setHost(v);
|
|
3929
|
+
markTouched();
|
|
3930
|
+
},
|
|
3931
|
+
placeholder: labels.fieldHostPlaceholder,
|
|
3932
|
+
required: true
|
|
3933
|
+
}
|
|
3934
|
+
),
|
|
3935
|
+
/* @__PURE__ */ jsx(
|
|
3936
|
+
FormInput,
|
|
3937
|
+
{
|
|
3938
|
+
label: labels.fieldPort,
|
|
3939
|
+
type: "number",
|
|
3940
|
+
value: port,
|
|
3941
|
+
onValueChange: (v) => {
|
|
3942
|
+
setPort(v);
|
|
3943
|
+
markTouched();
|
|
3944
|
+
}
|
|
3945
|
+
}
|
|
3946
|
+
),
|
|
3947
|
+
/* @__PURE__ */ jsx(
|
|
3948
|
+
FormInput,
|
|
3949
|
+
{
|
|
3950
|
+
label: labels.fieldDatabase,
|
|
3951
|
+
value: database,
|
|
3952
|
+
onValueChange: (v) => {
|
|
3953
|
+
setDatabase(v);
|
|
3954
|
+
markTouched();
|
|
3955
|
+
},
|
|
3956
|
+
placeholder: labels.fieldDatabasePlaceholder,
|
|
3957
|
+
required: true
|
|
3958
|
+
}
|
|
3959
|
+
),
|
|
3960
|
+
/* @__PURE__ */ jsx(
|
|
3961
|
+
FormInput,
|
|
3962
|
+
{
|
|
3963
|
+
label: labels.fieldUsername,
|
|
3964
|
+
value: username,
|
|
3965
|
+
onValueChange: (v) => {
|
|
3966
|
+
setUsername(v);
|
|
3967
|
+
markTouched();
|
|
3968
|
+
},
|
|
3969
|
+
placeholder: labels.fieldUsernamePlaceholder
|
|
3970
|
+
}
|
|
3971
|
+
),
|
|
3972
|
+
/* @__PURE__ */ jsx(
|
|
3973
|
+
FormInput,
|
|
3974
|
+
{
|
|
3975
|
+
label: labels.fieldPassword,
|
|
3976
|
+
type: "password",
|
|
3977
|
+
value: password,
|
|
3978
|
+
onValueChange: (v) => {
|
|
3979
|
+
setPassword(v);
|
|
3980
|
+
markTouched();
|
|
3981
|
+
},
|
|
3982
|
+
placeholder: labels.fieldPasswordPlaceholder
|
|
3983
|
+
}
|
|
3984
|
+
),
|
|
3985
|
+
/* @__PURE__ */ jsx(
|
|
3986
|
+
FormInput,
|
|
3987
|
+
{
|
|
3988
|
+
label: labels.fieldSchema,
|
|
3989
|
+
value: schema,
|
|
3990
|
+
onValueChange: (v) => {
|
|
3991
|
+
setSchema(v);
|
|
3992
|
+
markTouched();
|
|
3993
|
+
},
|
|
3994
|
+
placeholder: labels.fieldSchemaPlaceholder
|
|
3995
|
+
}
|
|
3996
|
+
)
|
|
3997
|
+
] });
|
|
3998
|
+
case "connection-string":
|
|
3999
|
+
return /* @__PURE__ */ jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsx(
|
|
4000
|
+
FormInput,
|
|
4001
|
+
{
|
|
4002
|
+
label: labels.fieldConnectionString,
|
|
4003
|
+
value: connectionString,
|
|
4004
|
+
onValueChange: (v) => {
|
|
4005
|
+
setConnectionString(v);
|
|
4006
|
+
markTouched();
|
|
4007
|
+
},
|
|
4008
|
+
placeholder: labels.fieldConnectionStringPlaceholder,
|
|
4009
|
+
required: true
|
|
4010
|
+
}
|
|
4011
|
+
) });
|
|
4012
|
+
case "cloud-bigquery":
|
|
4013
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4014
|
+
/* @__PURE__ */ jsx(
|
|
4015
|
+
FormInput,
|
|
4016
|
+
{
|
|
4017
|
+
label: labels.fieldProjectId,
|
|
4018
|
+
value: projectId,
|
|
4019
|
+
onValueChange: (v) => {
|
|
4020
|
+
setProjectId(v);
|
|
4021
|
+
markTouched();
|
|
4022
|
+
},
|
|
4023
|
+
placeholder: labels.fieldProjectIdPlaceholder,
|
|
4024
|
+
required: true
|
|
4025
|
+
}
|
|
4026
|
+
),
|
|
4027
|
+
/* @__PURE__ */ jsx(
|
|
4028
|
+
FormInput,
|
|
4029
|
+
{
|
|
4030
|
+
label: labels.fieldDataset,
|
|
4031
|
+
value: dataset,
|
|
4032
|
+
onValueChange: (v) => {
|
|
4033
|
+
setDataset(v);
|
|
4034
|
+
markTouched();
|
|
4035
|
+
},
|
|
4036
|
+
placeholder: labels.fieldDatasetPlaceholder,
|
|
4037
|
+
required: true
|
|
4038
|
+
}
|
|
4039
|
+
),
|
|
4040
|
+
/* @__PURE__ */ jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsx(
|
|
4041
|
+
FormInput,
|
|
4042
|
+
{
|
|
4043
|
+
label: labels.fieldKeyFile,
|
|
4044
|
+
value: keyFile,
|
|
4045
|
+
onValueChange: (v) => {
|
|
4046
|
+
setKeyFile(v);
|
|
4047
|
+
markTouched();
|
|
4048
|
+
},
|
|
4049
|
+
placeholder: labels.fieldKeyFilePlaceholder
|
|
4050
|
+
}
|
|
4051
|
+
) })
|
|
4052
|
+
] });
|
|
4053
|
+
case "cloud-snowflake":
|
|
4054
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4055
|
+
/* @__PURE__ */ jsx(
|
|
4056
|
+
FormInput,
|
|
4057
|
+
{
|
|
4058
|
+
label: labels.fieldAccount,
|
|
4059
|
+
value: account,
|
|
4060
|
+
onValueChange: (v) => {
|
|
4061
|
+
setAccount(v);
|
|
4062
|
+
markTouched();
|
|
4063
|
+
},
|
|
4064
|
+
placeholder: labels.fieldAccountPlaceholder,
|
|
4065
|
+
required: true
|
|
4066
|
+
}
|
|
4067
|
+
),
|
|
4068
|
+
/* @__PURE__ */ jsx(
|
|
4069
|
+
FormInput,
|
|
4070
|
+
{
|
|
4071
|
+
label: labels.fieldWarehouse,
|
|
4072
|
+
value: warehouseField,
|
|
4073
|
+
onValueChange: (v) => {
|
|
4074
|
+
setWarehouseField(v);
|
|
4075
|
+
markTouched();
|
|
4076
|
+
},
|
|
4077
|
+
placeholder: labels.fieldWarehousePlaceholder,
|
|
4078
|
+
required: true
|
|
4079
|
+
}
|
|
4080
|
+
),
|
|
4081
|
+
/* @__PURE__ */ jsx(
|
|
4082
|
+
FormInput,
|
|
4083
|
+
{
|
|
4084
|
+
label: labels.fieldDatabase,
|
|
4085
|
+
value: database,
|
|
4086
|
+
onValueChange: (v) => {
|
|
4087
|
+
setDatabase(v);
|
|
4088
|
+
markTouched();
|
|
4089
|
+
},
|
|
4090
|
+
placeholder: labels.fieldDatabasePlaceholder,
|
|
4091
|
+
required: true
|
|
4092
|
+
}
|
|
4093
|
+
),
|
|
4094
|
+
/* @__PURE__ */ jsx(
|
|
4095
|
+
FormInput,
|
|
4096
|
+
{
|
|
4097
|
+
label: labels.fieldUsername,
|
|
4098
|
+
value: username,
|
|
4099
|
+
onValueChange: (v) => {
|
|
4100
|
+
setUsername(v);
|
|
4101
|
+
markTouched();
|
|
4102
|
+
},
|
|
4103
|
+
placeholder: labels.fieldUsernamePlaceholder,
|
|
4104
|
+
required: true
|
|
4105
|
+
}
|
|
4106
|
+
),
|
|
4107
|
+
/* @__PURE__ */ jsx(
|
|
4108
|
+
FormInput,
|
|
4109
|
+
{
|
|
4110
|
+
label: labels.fieldPassword,
|
|
4111
|
+
type: "password",
|
|
4112
|
+
value: password,
|
|
4113
|
+
onValueChange: (v) => {
|
|
4114
|
+
setPassword(v);
|
|
4115
|
+
markTouched();
|
|
4116
|
+
},
|
|
4117
|
+
placeholder: labels.fieldPasswordPlaceholder
|
|
4118
|
+
}
|
|
4119
|
+
),
|
|
4120
|
+
/* @__PURE__ */ jsx(
|
|
4121
|
+
FormInput,
|
|
4122
|
+
{
|
|
4123
|
+
label: labels.fieldSchema,
|
|
4124
|
+
value: schema,
|
|
4125
|
+
onValueChange: (v) => {
|
|
4126
|
+
setSchema(v);
|
|
4127
|
+
markTouched();
|
|
4128
|
+
},
|
|
4129
|
+
placeholder: labels.fieldSchemaPlaceholder
|
|
4130
|
+
}
|
|
4131
|
+
)
|
|
4132
|
+
] });
|
|
4133
|
+
case "cloud-key":
|
|
4134
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4135
|
+
/* @__PURE__ */ jsx(
|
|
4136
|
+
FormInput,
|
|
4137
|
+
{
|
|
4138
|
+
label: labels.fieldRegion,
|
|
4139
|
+
value: region,
|
|
4140
|
+
onValueChange: (v) => {
|
|
4141
|
+
setRegion(v);
|
|
4142
|
+
markTouched();
|
|
4143
|
+
},
|
|
4144
|
+
placeholder: labels.fieldRegionPlaceholder,
|
|
4145
|
+
required: true
|
|
4146
|
+
}
|
|
4147
|
+
),
|
|
4148
|
+
/* @__PURE__ */ jsx(
|
|
4149
|
+
FormInput,
|
|
4150
|
+
{
|
|
4151
|
+
label: labels.fieldToken,
|
|
4152
|
+
type: "password",
|
|
4153
|
+
value: token,
|
|
4154
|
+
onValueChange: (v) => {
|
|
4155
|
+
setToken(v);
|
|
4156
|
+
markTouched();
|
|
4157
|
+
},
|
|
4158
|
+
placeholder: labels.fieldTokenPlaceholder,
|
|
4159
|
+
required: true
|
|
4160
|
+
}
|
|
4161
|
+
),
|
|
4162
|
+
/* @__PURE__ */ jsx(
|
|
4163
|
+
FormInput,
|
|
4164
|
+
{
|
|
4165
|
+
label: labels.fieldBucket,
|
|
4166
|
+
value: bucket,
|
|
4167
|
+
onValueChange: (v) => {
|
|
4168
|
+
setBucket(v);
|
|
4169
|
+
markTouched();
|
|
4170
|
+
},
|
|
4171
|
+
placeholder: labels.fieldBucketPlaceholder
|
|
4172
|
+
}
|
|
4173
|
+
)
|
|
4174
|
+
] });
|
|
4175
|
+
case "vector-key":
|
|
4176
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4177
|
+
/* @__PURE__ */ jsx(
|
|
4178
|
+
FormInput,
|
|
4179
|
+
{
|
|
4180
|
+
label: labels.fieldApiKey,
|
|
4181
|
+
type: "password",
|
|
4182
|
+
value: apiKey,
|
|
4183
|
+
onValueChange: (v) => {
|
|
4184
|
+
setApiKey(v);
|
|
4185
|
+
markTouched();
|
|
4186
|
+
},
|
|
4187
|
+
placeholder: labels.fieldApiKeyPlaceholder,
|
|
4188
|
+
required: true
|
|
4189
|
+
}
|
|
4190
|
+
),
|
|
4191
|
+
/* @__PURE__ */ jsx(
|
|
4192
|
+
FormInput,
|
|
4193
|
+
{
|
|
4194
|
+
label: labels.fieldEnvironment,
|
|
4195
|
+
value: environment,
|
|
4196
|
+
onValueChange: (v) => {
|
|
4197
|
+
setEnvironment(v);
|
|
4198
|
+
markTouched();
|
|
4199
|
+
},
|
|
4200
|
+
placeholder: labels.fieldEnvironmentPlaceholder,
|
|
4201
|
+
required: true
|
|
4202
|
+
}
|
|
4203
|
+
),
|
|
4204
|
+
/* @__PURE__ */ jsx(
|
|
4205
|
+
FormInput,
|
|
4206
|
+
{
|
|
4207
|
+
label: labels.fieldIndex,
|
|
4208
|
+
value: index,
|
|
4209
|
+
onValueChange: (v) => {
|
|
4210
|
+
setIndex(v);
|
|
4211
|
+
markTouched();
|
|
4212
|
+
},
|
|
4213
|
+
placeholder: labels.fieldIndexPlaceholder
|
|
4214
|
+
}
|
|
4215
|
+
)
|
|
4216
|
+
] });
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4219
|
+
function renderStep2() {
|
|
4220
|
+
if (!dialectOption) {
|
|
4221
|
+
return /* @__PURE__ */ jsxs(SectionCard, { variant: "glass", header: { title: labels.wizardStep1Title }, children: [
|
|
4222
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: labels.wizardStep1Subtitle }),
|
|
4223
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: () => goToStep(1), children: labels.wizardBack }) })
|
|
4224
|
+
] });
|
|
4225
|
+
}
|
|
4226
|
+
return /* @__PURE__ */ jsx(
|
|
4227
|
+
SectionCard,
|
|
4228
|
+
{
|
|
4229
|
+
variant: "glass",
|
|
4230
|
+
header: {
|
|
4231
|
+
title: dialectOption.label,
|
|
4232
|
+
subtitle: labels.wizardStep2Subtitle,
|
|
4233
|
+
icon: category?.icon ? /* @__PURE__ */ jsx(category.icon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-4 w-4" }),
|
|
4234
|
+
gradient: category?.gradient
|
|
4235
|
+
},
|
|
4236
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4237
|
+
/* @__PURE__ */ jsx(
|
|
4238
|
+
FormInput,
|
|
4239
|
+
{
|
|
4240
|
+
label: labels.fieldName,
|
|
4241
|
+
value: name,
|
|
4242
|
+
onValueChange: (v) => {
|
|
4243
|
+
setName(v);
|
|
4244
|
+
markTouched();
|
|
4245
|
+
},
|
|
4246
|
+
placeholder: labels.fieldNamePlaceholder,
|
|
4247
|
+
required: true
|
|
4248
|
+
}
|
|
4249
|
+
),
|
|
4250
|
+
/* @__PURE__ */ jsx(FormGrid, { children: renderConnectionFields() }),
|
|
4251
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-6 pt-1", children: [
|
|
4252
|
+
/* @__PURE__ */ jsx(
|
|
4253
|
+
FormToggle,
|
|
4254
|
+
{
|
|
4255
|
+
checked: ssl,
|
|
4256
|
+
onChange: (v) => {
|
|
4257
|
+
setSsl(v);
|
|
4258
|
+
markTouched();
|
|
4259
|
+
},
|
|
4260
|
+
label: labels.fieldSsl,
|
|
4261
|
+
variant: "inline"
|
|
4262
|
+
}
|
|
4263
|
+
),
|
|
4264
|
+
/* @__PURE__ */ jsx(
|
|
4265
|
+
FormToggle,
|
|
4266
|
+
{
|
|
4267
|
+
checked: readOnly,
|
|
4268
|
+
onChange: (v) => {
|
|
4269
|
+
setReadOnly(v);
|
|
4270
|
+
markTouched();
|
|
4271
|
+
},
|
|
4272
|
+
label: labels.fieldReadOnly,
|
|
4273
|
+
variant: "inline"
|
|
4274
|
+
}
|
|
4275
|
+
)
|
|
4276
|
+
] }),
|
|
4277
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: labels.fieldReadOnlyHelp }),
|
|
4278
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
|
|
4279
|
+
/* @__PURE__ */ jsx(
|
|
4280
|
+
Button,
|
|
4281
|
+
{
|
|
4282
|
+
type: "button",
|
|
4283
|
+
outline: true,
|
|
4284
|
+
onClick: () => void handleTestConnection(),
|
|
4285
|
+
disabled: testStatus === "testing",
|
|
4286
|
+
children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4287
|
+
/* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
4288
|
+
labels.testing
|
|
4289
|
+
] }) : labels.testConnection
|
|
4290
|
+
}
|
|
4291
|
+
),
|
|
4292
|
+
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
4293
|
+
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
4294
|
+
] })
|
|
4295
|
+
] })
|
|
4296
|
+
}
|
|
4297
|
+
);
|
|
4298
|
+
}
|
|
4299
|
+
function renderStep3() {
|
|
4300
|
+
return /* @__PURE__ */ jsx(
|
|
4301
|
+
SectionCard,
|
|
4302
|
+
{
|
|
4303
|
+
variant: "glass",
|
|
4304
|
+
header: {
|
|
4305
|
+
title: labels.governanceSectionTitle,
|
|
4306
|
+
subtitle: labels.governanceSectionSubtitle
|
|
4307
|
+
},
|
|
4308
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4309
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
4310
|
+
/* @__PURE__ */ jsx(
|
|
4311
|
+
FormInput,
|
|
4312
|
+
{
|
|
4313
|
+
label: labels.fieldMaxPoolSize,
|
|
4314
|
+
type: "number",
|
|
4315
|
+
min: 1,
|
|
4316
|
+
max: 100,
|
|
4317
|
+
value: maxPoolSize,
|
|
4318
|
+
onValueChange: (v) => {
|
|
4319
|
+
setMaxPoolSize(v);
|
|
4320
|
+
markTouched();
|
|
4321
|
+
},
|
|
4322
|
+
hint: labels.fieldMaxPoolSizeHint
|
|
4323
|
+
}
|
|
4324
|
+
),
|
|
4325
|
+
/* @__PURE__ */ jsx(
|
|
4326
|
+
FormInput,
|
|
4327
|
+
{
|
|
4328
|
+
label: labels.fieldTimeoutMs,
|
|
4329
|
+
type: "number",
|
|
4330
|
+
min: 100,
|
|
4331
|
+
value: timeoutMs,
|
|
4332
|
+
onValueChange: (v) => {
|
|
4333
|
+
setTimeoutMs(v);
|
|
4334
|
+
markTouched();
|
|
4335
|
+
},
|
|
4336
|
+
hint: labels.fieldTimeoutMsHint
|
|
4337
|
+
}
|
|
4338
|
+
)
|
|
4339
|
+
] }),
|
|
4340
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4341
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-gray-500 dark:text-gray-400", children: labels.fieldAllowedTables }),
|
|
4342
|
+
/* @__PURE__ */ jsx(
|
|
4343
|
+
ChipPicker,
|
|
4344
|
+
{
|
|
4345
|
+
items: allowedTablesItems,
|
|
4346
|
+
selectedIds: allowedTablesSelected,
|
|
4347
|
+
onChange: (ids) => {
|
|
4348
|
+
setAllowedTablesSelected(ids);
|
|
4349
|
+
markTouched();
|
|
4350
|
+
},
|
|
4351
|
+
onItemsChange: (items) => {
|
|
4352
|
+
setAllowedTablesItems(items);
|
|
4353
|
+
markTouched();
|
|
4354
|
+
},
|
|
4355
|
+
allowCustom: true,
|
|
4356
|
+
unselectedStyle: allowedTablesStyle,
|
|
4357
|
+
showActions: false,
|
|
4358
|
+
addPlaceholder: labels.fieldAllowedTablesPlaceholder,
|
|
4359
|
+
addAriaLabel: labels.fieldAllowedTables
|
|
4360
|
+
}
|
|
4361
|
+
),
|
|
4362
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTablesHint })
|
|
4363
|
+
] }),
|
|
4364
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4365
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-gray-500 dark:text-gray-400", children: labels.fieldBlockedColumns }),
|
|
4366
|
+
/* @__PURE__ */ jsx(
|
|
4367
|
+
ChipPicker,
|
|
4368
|
+
{
|
|
4369
|
+
items: blockedColumnsItems,
|
|
4370
|
+
selectedIds: blockedColumnsSelected,
|
|
4371
|
+
onChange: (ids) => {
|
|
4372
|
+
setBlockedColumnsSelected(ids);
|
|
4373
|
+
markTouched();
|
|
4374
|
+
},
|
|
4375
|
+
onItemsChange: (items) => {
|
|
4376
|
+
setBlockedColumnsItems(items);
|
|
4377
|
+
markTouched();
|
|
4378
|
+
},
|
|
4379
|
+
allowCustom: true,
|
|
4380
|
+
unselectedStyle: blockedColumnsStyle,
|
|
4381
|
+
showActions: false,
|
|
4382
|
+
addPlaceholder: labels.fieldBlockedColumnsPlaceholder,
|
|
4383
|
+
addAriaLabel: labels.fieldBlockedColumns
|
|
4384
|
+
}
|
|
4385
|
+
),
|
|
4386
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumnsHint })
|
|
4387
|
+
] }),
|
|
4388
|
+
/* @__PURE__ */ jsx(
|
|
4389
|
+
FormCheckbox,
|
|
4390
|
+
{
|
|
4391
|
+
checked: maskPii,
|
|
4392
|
+
onChange: (v) => {
|
|
4393
|
+
setMaskPii(v);
|
|
4394
|
+
markTouched();
|
|
4395
|
+
},
|
|
4396
|
+
label: labels.fieldMaskPii,
|
|
4397
|
+
description: labels.fieldMaskPiiDescription
|
|
4398
|
+
}
|
|
4399
|
+
)
|
|
4400
|
+
] })
|
|
4401
|
+
}
|
|
4402
|
+
);
|
|
4403
|
+
}
|
|
4404
|
+
function renderStep4() {
|
|
4405
|
+
const categoryLabel = category ? labels[category.labelKey] ?? category.id : labels.reviewNoneValue;
|
|
4406
|
+
const dialectLabel = dialectOption?.label ?? labels.reviewNoneValue;
|
|
4407
|
+
const allowed = allowedTablesSelected;
|
|
4408
|
+
const blocked = blockedColumnsSelected;
|
|
4409
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4410
|
+
/* @__PURE__ */ jsx(
|
|
4411
|
+
SectionCard,
|
|
4412
|
+
{
|
|
4413
|
+
variant: "glass",
|
|
4414
|
+
header: {
|
|
4415
|
+
title: labels.wizardStep1Title,
|
|
4416
|
+
subtitle: labels.wizardStep1Subtitle
|
|
4417
|
+
},
|
|
4418
|
+
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
4419
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4420
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4421
|
+
] }),
|
|
4422
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4423
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCategoryLabel, value: categoryLabel }),
|
|
4424
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewDialectLabel, value: dialectLabel })
|
|
4425
|
+
] })
|
|
4426
|
+
}
|
|
4427
|
+
),
|
|
4428
|
+
/* @__PURE__ */ jsx(
|
|
4429
|
+
SectionCard,
|
|
4430
|
+
{
|
|
4431
|
+
variant: "glass",
|
|
4432
|
+
header: {
|
|
4433
|
+
title: labels.wizardStep2Title,
|
|
4434
|
+
subtitle: labels.wizardStep2Subtitle
|
|
4435
|
+
},
|
|
4436
|
+
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
4437
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4438
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4439
|
+
] }),
|
|
4440
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4441
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
|
|
4442
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCredentialsLabel, value: labels.reviewCredentialsRedacted }),
|
|
4443
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewSslLabel, value: ssl ? labels.reviewYes : labels.reviewNo }),
|
|
4444
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewReadOnlyLabel, value: readOnly ? labels.reviewYes : labels.reviewNo })
|
|
4445
|
+
] })
|
|
4446
|
+
}
|
|
4447
|
+
),
|
|
4448
|
+
/* @__PURE__ */ jsx(
|
|
4449
|
+
SectionCard,
|
|
4450
|
+
{
|
|
4451
|
+
variant: "glass",
|
|
4452
|
+
header: {
|
|
4453
|
+
title: labels.wizardStep3Title,
|
|
4454
|
+
subtitle: labels.wizardStep3Subtitle
|
|
4455
|
+
},
|
|
4456
|
+
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
4457
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4458
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4459
|
+
] }),
|
|
4460
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4461
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewPoolLabel, value: maxPoolSize || labels.reviewNoneValue }),
|
|
4462
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewTimeoutLabel, value: timeoutMs ? `${timeoutMs}ms` : labels.reviewNoneValue }),
|
|
4463
|
+
/* @__PURE__ */ jsx(
|
|
4464
|
+
ReviewRow2,
|
|
4465
|
+
{
|
|
4466
|
+
label: labels.reviewAllowedTablesLabel,
|
|
4467
|
+
value: allowed.length > 0 ? allowed.join(", ") : labels.reviewNoneValue
|
|
4468
|
+
}
|
|
4469
|
+
),
|
|
4470
|
+
/* @__PURE__ */ jsx(
|
|
4471
|
+
ReviewRow2,
|
|
4472
|
+
{
|
|
4473
|
+
label: labels.reviewBlockedColumnsLabel,
|
|
4474
|
+
value: blocked.length > 0 ? blocked.join(", ") : labels.reviewNoneValue
|
|
4475
|
+
}
|
|
4476
|
+
),
|
|
4477
|
+
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewMaskPiiLabel, value: maskPii ? labels.reviewYes : labels.reviewNo })
|
|
4478
|
+
] })
|
|
4479
|
+
}
|
|
4480
|
+
)
|
|
4481
|
+
] });
|
|
4482
|
+
}
|
|
4483
|
+
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
|
|
4484
|
+
const advanceDisabled = !canAdvance(step);
|
|
4485
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
|
|
4486
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
|
|
4487
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4488
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
|
|
4489
|
+
step < TOTAL_STEPS2 ? /* @__PURE__ */ jsx(Button, { type: "button", color: "amber", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "amber", onClick: () => void submit(), disabled: submitting || !dialect || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate })
|
|
4490
|
+
] })
|
|
4491
|
+
] });
|
|
4492
|
+
const content = /* @__PURE__ */ jsxs(
|
|
4493
|
+
"form",
|
|
4494
|
+
{
|
|
4495
|
+
onSubmit: (e) => {
|
|
4496
|
+
e.preventDefault();
|
|
4497
|
+
if (step < TOTAL_STEPS2) goNext();
|
|
4498
|
+
else void submit();
|
|
4499
|
+
},
|
|
4500
|
+
className: "space-y-4",
|
|
4501
|
+
children: [
|
|
4502
|
+
/* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
|
|
4503
|
+
footer
|
|
4504
|
+
]
|
|
4505
|
+
}
|
|
4506
|
+
);
|
|
4507
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4508
|
+
hero,
|
|
4509
|
+
content
|
|
4510
|
+
] });
|
|
4511
|
+
}
|
|
4512
|
+
function ReviewRow2({ label, value }) {
|
|
4513
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
4514
|
+
/* @__PURE__ */ jsx("dt", { className: "text-[10px] uppercase tracking-wider text-gray-400 dark:text-gray-500", children: label }),
|
|
4515
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-gray-900 dark:text-white", children: value })
|
|
4516
|
+
] });
|
|
4517
|
+
}
|
|
4518
|
+
async function simulateTest() {
|
|
4519
|
+
await new Promise((r) => setTimeout(r, 1500));
|
|
4520
|
+
return true;
|
|
4521
|
+
}
|
|
4522
|
+
function RangeSliderField2({
|
|
4523
|
+
sliderId,
|
|
4524
|
+
label,
|
|
4525
|
+
value,
|
|
4526
|
+
onChange,
|
|
4527
|
+
min,
|
|
4528
|
+
max,
|
|
4529
|
+
step,
|
|
4530
|
+
zones,
|
|
4531
|
+
trackGradient,
|
|
4532
|
+
formatValue: formatValue2,
|
|
4533
|
+
ariaLabel
|
|
4534
|
+
}) {
|
|
4535
|
+
const percent = (value - min) / (max - min) * 100;
|
|
4536
|
+
const activeZone = zones?.find((z) => value <= z.max) ?? zones?.[zones.length - 1];
|
|
4537
|
+
const thumbColor = activeZone?.thumbColor ?? "#6366f1";
|
|
4538
|
+
const glow = hexToGlow2(thumbColor);
|
|
4539
|
+
const displayValue = formatValue2 ? formatValue2(value) : value.toString();
|
|
4540
|
+
const ariaText = activeZone ? `${displayValue} \u2014 ${activeZone.label}` : displayValue;
|
|
4541
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
4542
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
4543
|
+
/* @__PURE__ */ jsx("label", { htmlFor: sliderId, className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: label }),
|
|
4544
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-bold tabular-nums text-gray-900 dark:text-white", children: displayValue })
|
|
4545
|
+
] }),
|
|
4546
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
4547
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-1/2 h-2 -translate-y-1/2 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700", children: /* @__PURE__ */ jsx(
|
|
4548
|
+
"div",
|
|
4549
|
+
{
|
|
4550
|
+
className: "h-full rounded-full transition-all duration-300 ease-out motion-reduce:transition-none",
|
|
4551
|
+
style: {
|
|
4552
|
+
width: `${Math.max(0, Math.min(100, percent))}%`,
|
|
4553
|
+
background: trackGradient ?? `linear-gradient(90deg, ${thumbColor}, ${thumbColor})`
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
) }),
|
|
4557
|
+
/* @__PURE__ */ jsx(
|
|
4558
|
+
"input",
|
|
4559
|
+
{
|
|
4560
|
+
id: sliderId,
|
|
4561
|
+
"data-slider-id": sliderId,
|
|
4562
|
+
type: "range",
|
|
4563
|
+
min,
|
|
4564
|
+
max,
|
|
4565
|
+
step,
|
|
4566
|
+
value,
|
|
4567
|
+
onChange: (e) => onChange(parseFloat(e.target.value)),
|
|
4568
|
+
"aria-label": ariaLabel ?? label,
|
|
4569
|
+
"aria-valuemin": min,
|
|
4570
|
+
"aria-valuemax": max,
|
|
4571
|
+
"aria-valuenow": value,
|
|
4572
|
+
"aria-valuetext": ariaText,
|
|
4573
|
+
className: "relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-lg dark:[&::-webkit-slider-thumb]:border-gray-900"
|
|
4574
|
+
}
|
|
4575
|
+
),
|
|
4576
|
+
/* @__PURE__ */ jsx("style", { children: `[data-slider-id="${sliderId}"]::-webkit-slider-thumb { background: ${thumbColor}; box-shadow: 0 0 8px ${glow}; } [data-slider-id="${sliderId}"]::-moz-range-thumb { background: ${thumbColor}; border: 2px solid white; box-shadow: 0 0 8px ${glow}; }` })
|
|
4577
|
+
] }),
|
|
4578
|
+
zones && zones.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 flex items-center justify-between", children: zones.map((z) => {
|
|
4579
|
+
const isActive = z.label === activeZone?.label;
|
|
4580
|
+
return /* @__PURE__ */ jsx(
|
|
4581
|
+
"span",
|
|
4582
|
+
{
|
|
4583
|
+
className: `text-[10px] font-medium transition-colors motion-reduce:transition-none ${isActive ? z.color : "text-gray-400 dark:text-gray-500"}`,
|
|
4584
|
+
children: z.label
|
|
4585
|
+
},
|
|
4586
|
+
z.label
|
|
4587
|
+
);
|
|
4588
|
+
}) })
|
|
4589
|
+
] });
|
|
4590
|
+
}
|
|
4591
|
+
function hexToGlow2(hex) {
|
|
4592
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex);
|
|
4593
|
+
if (!m) return "rgba(99,102,241,0.5)";
|
|
4594
|
+
const int = parseInt(m[1], 16);
|
|
4595
|
+
const r = int >> 16 & 255;
|
|
4596
|
+
const g = int >> 8 & 255;
|
|
4597
|
+
const b = int & 255;
|
|
4598
|
+
return `rgba(${r},${g},${b},0.5)`;
|
|
4599
|
+
}
|
|
4600
|
+
var ACTION_TILES = [
|
|
4601
|
+
{ id: "notify", color: "sky", icon: BellAlertIcon, labelKey: "actionNotifyLabel", descriptionKey: "actionNotifyDescription" },
|
|
4602
|
+
{ id: "call-webhook", color: "indigo", icon: GlobeAltIcon, labelKey: "actionWebhookLabel", descriptionKey: "actionWebhookDescription" },
|
|
4603
|
+
{ id: "mutate", color: "amber", icon: PencilIcon, labelKey: "actionMutateLabel", descriptionKey: "actionMutateDescription" },
|
|
4604
|
+
{ id: "escalate", color: "rose", icon: ArrowUpCircleIcon, labelKey: "actionEscalateLabel", descriptionKey: "actionEscalateDescription" },
|
|
4605
|
+
{ id: "route-to-agent", color: "violet", icon: SparklesIcon, labelKey: "actionRouteLabel", descriptionKey: "actionRouteDescription" }
|
|
4606
|
+
];
|
|
4607
|
+
var WEEKDAYS = [
|
|
4608
|
+
{ id: "mon", labelKey: "weekdayMon" },
|
|
4609
|
+
{ id: "tue", labelKey: "weekdayTue" },
|
|
4610
|
+
{ id: "wed", labelKey: "weekdayWed" },
|
|
4611
|
+
{ id: "thu", labelKey: "weekdayThu" },
|
|
4612
|
+
{ id: "fri", labelKey: "weekdayFri" },
|
|
4613
|
+
{ id: "sat", labelKey: "weekdaySat" },
|
|
4614
|
+
{ id: "sun", labelKey: "weekdaySun" }
|
|
4615
|
+
];
|
|
4616
|
+
var TOTAL_STEPS3 = 5;
|
|
4617
|
+
function RuleNewWizardPageView({
|
|
4618
|
+
labels,
|
|
4619
|
+
initialStep,
|
|
4620
|
+
onStepChange,
|
|
4621
|
+
onSubmit,
|
|
4622
|
+
onCancel
|
|
4623
|
+
}) {
|
|
4624
|
+
const clampedInitial = Math.min(TOTAL_STEPS3, Math.max(1, initialStep ?? 1));
|
|
4625
|
+
const [step, setStep] = useState(clampedInitial);
|
|
4626
|
+
const [name, setName] = useState("");
|
|
4627
|
+
const [description, setDescription] = useState("");
|
|
4628
|
+
const [priority, setPriority] = useState(50);
|
|
4629
|
+
const [enabled, setEnabled] = useState(true);
|
|
4630
|
+
const [status, setStatus] = useState("active");
|
|
4631
|
+
const [tagsItems, setTagsItems] = useState([]);
|
|
4632
|
+
const [tagsSelected, setTagsSelected] = useState([]);
|
|
4633
|
+
const tagsStyle = {
|
|
4634
|
+
bg: "bg-fuchsia-500/15",
|
|
4635
|
+
text: "text-fuchsia-700 dark:text-fuchsia-300"
|
|
4636
|
+
};
|
|
4637
|
+
const [combinator, setCombinator] = useState("and");
|
|
4638
|
+
const [condition, setCondition] = useState(defaultRuleCondition());
|
|
4639
|
+
const [actionTileId, setActionTileId] = useState("");
|
|
4640
|
+
const [action, setAction] = useState(defaultRuleAction());
|
|
4641
|
+
const [validFromDate, setValidFromDate] = useState(null);
|
|
4642
|
+
const [validFromTime, setValidFromTime] = useState(null);
|
|
4643
|
+
const [validUntilDate, setValidUntilDate] = useState(null);
|
|
4644
|
+
const [validUntilTime, setValidUntilTime] = useState(null);
|
|
4645
|
+
const [noExpiry, setNoExpiry] = useState(true);
|
|
4646
|
+
const [recurrence, setRecurrence] = useState("one-off");
|
|
4647
|
+
const [cronExpression, setCronExpression] = useState("");
|
|
4648
|
+
const [weekdays, setWeekdays] = useState([]);
|
|
4649
|
+
const [recurringTime, setRecurringTime] = useState(null);
|
|
4650
|
+
const [submitting, setSubmitting] = useState(false);
|
|
4651
|
+
const [touched, setTouched] = useState(false);
|
|
4652
|
+
function markTouched() {
|
|
4653
|
+
if (!touched) setTouched(true);
|
|
4654
|
+
}
|
|
4655
|
+
useEffect(() => {
|
|
4656
|
+
const next = Math.min(TOTAL_STEPS3, Math.max(1, initialStep ?? 1));
|
|
4657
|
+
if (next !== step) setStep(next);
|
|
4658
|
+
}, [initialStep]);
|
|
4659
|
+
const goToStep = useCallback((next) => {
|
|
4660
|
+
const clamped = Math.min(TOTAL_STEPS3, Math.max(1, next));
|
|
4661
|
+
setStep(clamped);
|
|
4662
|
+
onStepChange?.(clamped);
|
|
4663
|
+
}, [onStepChange]);
|
|
4664
|
+
function canAdvance(from) {
|
|
4665
|
+
if (from === 1) return name.trim().length > 0;
|
|
4666
|
+
if (from === 3) return actionTileId.length > 0;
|
|
4667
|
+
return true;
|
|
4668
|
+
}
|
|
4669
|
+
const goNext = useCallback(() => {
|
|
4670
|
+
if (!canAdvance(step)) return;
|
|
4671
|
+
if (step < TOTAL_STEPS3) goToStep(step + 1);
|
|
4672
|
+
}, [step, name, actionTileId]);
|
|
4673
|
+
const goBack = useCallback(() => {
|
|
4674
|
+
if (step > 1) goToStep(step - 1);
|
|
4675
|
+
}, [step, goToStep]);
|
|
4676
|
+
const cancelWithConfirm = useCallback(() => {
|
|
4677
|
+
if (touched && !window.confirm(labels.wizardCancelConfirm)) return;
|
|
4678
|
+
onCancel();
|
|
4679
|
+
}, [touched, labels.wizardCancelConfirm, onCancel]);
|
|
4680
|
+
function combineDateTime(date, time) {
|
|
4681
|
+
if (!date) return null;
|
|
4682
|
+
const next = new Date(date);
|
|
4683
|
+
next.setHours(time?.hours ?? 0, time?.minutes ?? 0, 0, 0);
|
|
4684
|
+
return next.toISOString();
|
|
4685
|
+
}
|
|
4686
|
+
const tags = useMemo(() => [...tagsSelected], [tagsSelected]);
|
|
4687
|
+
function buildPayload() {
|
|
4688
|
+
const validFrom = combineDateTime(validFromDate, validFromTime);
|
|
4689
|
+
const validUntil = noExpiry ? null : combineDateTime(validUntilDate, validUntilTime);
|
|
4690
|
+
const conditionWithCombinator = combinator === "and" ? condition : {
|
|
4691
|
+
operator: "boolean_expression",
|
|
4692
|
+
combinator,
|
|
4693
|
+
operands: [condition]
|
|
4694
|
+
};
|
|
4695
|
+
const finalAction = {
|
|
4696
|
+
type: action.type,
|
|
4697
|
+
params: {
|
|
4698
|
+
...action.params ?? {},
|
|
4699
|
+
actionVariant: actionTileId
|
|
4700
|
+
}
|
|
4701
|
+
};
|
|
4702
|
+
const recurrencePayload = recurrence === "cron" ? { kind: "cron", expression: cronExpression.trim() } : recurrence === "recurring" ? {
|
|
4703
|
+
kind: "recurring",
|
|
4704
|
+
weekdays: [...weekdays],
|
|
4705
|
+
timeOfDay: recurringTime ? `${pad(recurringTime.hours)}:${pad(recurringTime.minutes)}` : "00:00"
|
|
4706
|
+
} : { kind: "one-off" };
|
|
4707
|
+
return {
|
|
4708
|
+
name: name.trim() || "Untitled Rule",
|
|
4709
|
+
description: description.trim() || void 0,
|
|
4710
|
+
enabled,
|
|
4711
|
+
priority,
|
|
4712
|
+
// `paused` ships as-is — backend understands it natively (Fallback 2).
|
|
4713
|
+
status,
|
|
4714
|
+
validFrom,
|
|
4715
|
+
validUntil,
|
|
4716
|
+
tags,
|
|
4717
|
+
condition: conditionWithCombinator,
|
|
4718
|
+
action: finalAction,
|
|
4719
|
+
recurrence: recurrencePayload
|
|
4720
|
+
};
|
|
4721
|
+
}
|
|
4722
|
+
async function submit() {
|
|
4723
|
+
setSubmitting(true);
|
|
4724
|
+
try {
|
|
4725
|
+
await onSubmit(buildPayload());
|
|
4726
|
+
} finally {
|
|
4727
|
+
setSubmitting(false);
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
useEffect(() => {
|
|
4731
|
+
function onKey(e) {
|
|
4732
|
+
if (e.key === "Escape") {
|
|
4733
|
+
e.preventDefault();
|
|
4734
|
+
cancelWithConfirm();
|
|
4735
|
+
return;
|
|
4736
|
+
}
|
|
4737
|
+
if (e.key === "Enter") {
|
|
4738
|
+
const target = e.target;
|
|
4739
|
+
const tag = target?.tagName?.toLowerCase();
|
|
4740
|
+
if (tag === "textarea" || tag === "select" || tag === "input" || tag === "button") return;
|
|
4741
|
+
e.preventDefault();
|
|
4742
|
+
if (step < TOTAL_STEPS3) goNext();
|
|
4743
|
+
else void submit();
|
|
4744
|
+
}
|
|
4745
|
+
}
|
|
4746
|
+
window.addEventListener("keydown", onKey);
|
|
4747
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
4748
|
+
}, [step, name, actionTileId, touched]);
|
|
4749
|
+
const stepTitles = [
|
|
4750
|
+
labels.wizardStep1Title,
|
|
4751
|
+
labels.wizardStep2Title,
|
|
4752
|
+
labels.wizardStep3Title,
|
|
4753
|
+
labels.wizardStep4Title,
|
|
4754
|
+
labels.wizardStep5Title
|
|
4755
|
+
];
|
|
4756
|
+
const stepSubtitles = [
|
|
4757
|
+
labels.wizardStep1Subtitle,
|
|
4758
|
+
labels.wizardStep2Subtitle,
|
|
4759
|
+
labels.wizardStep3Subtitle,
|
|
4760
|
+
labels.wizardStep4Subtitle,
|
|
4761
|
+
labels.wizardStep5Subtitle
|
|
4762
|
+
];
|
|
4763
|
+
const indicatorSteps = stepTitles.map((title, idx) => ({
|
|
4764
|
+
id: String(idx + 1),
|
|
4765
|
+
title
|
|
4766
|
+
}));
|
|
4767
|
+
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS3));
|
|
4768
|
+
const hero = /* @__PURE__ */ jsx(
|
|
4769
|
+
HeroSection,
|
|
4770
|
+
{
|
|
4771
|
+
icon: /* @__PURE__ */ jsx(AdjustmentsHorizontalIcon, { className: "h-5 w-5" }),
|
|
4772
|
+
label: counter,
|
|
4773
|
+
title: labels.pageTitle,
|
|
4774
|
+
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
4775
|
+
gradient: "from-fuchsia-500 to-purple-700",
|
|
4776
|
+
children: /* @__PURE__ */ jsx(
|
|
4777
|
+
StepIndicator,
|
|
4778
|
+
{
|
|
4779
|
+
accent: "violet",
|
|
4780
|
+
currentStep: step - 1,
|
|
4781
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
4782
|
+
progressLabel: labels.pageTitle,
|
|
4783
|
+
steps: indicatorSteps
|
|
4784
|
+
}
|
|
4785
|
+
)
|
|
4786
|
+
}
|
|
4787
|
+
);
|
|
4788
|
+
function renderStep1() {
|
|
4789
|
+
return /* @__PURE__ */ jsx(
|
|
4790
|
+
SectionCard,
|
|
4791
|
+
{
|
|
4792
|
+
variant: "glass",
|
|
4793
|
+
header: {
|
|
4794
|
+
title: labels.wizardStep1Title,
|
|
4795
|
+
subtitle: labels.wizardStep1Subtitle
|
|
4796
|
+
},
|
|
4797
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4798
|
+
/* @__PURE__ */ jsx(
|
|
4799
|
+
FormInput,
|
|
4800
|
+
{
|
|
4801
|
+
label: labels.nameLabel,
|
|
4802
|
+
value: name,
|
|
4803
|
+
onValueChange: (v) => {
|
|
4804
|
+
setName(v);
|
|
4805
|
+
markTouched();
|
|
4806
|
+
},
|
|
4807
|
+
placeholder: labels.namePlaceholder,
|
|
4808
|
+
required: true
|
|
4809
|
+
}
|
|
4810
|
+
),
|
|
4811
|
+
/* @__PURE__ */ jsx(
|
|
4812
|
+
FormTextarea,
|
|
4813
|
+
{
|
|
4814
|
+
label: labels.descriptionLabel,
|
|
4815
|
+
value: description,
|
|
4816
|
+
onValueChange: (v) => {
|
|
4817
|
+
setDescription(v);
|
|
4818
|
+
markTouched();
|
|
4819
|
+
},
|
|
4820
|
+
placeholder: labels.descriptionPlaceholder,
|
|
4821
|
+
rows: 3
|
|
4822
|
+
}
|
|
4823
|
+
),
|
|
4824
|
+
/* @__PURE__ */ jsx(
|
|
4825
|
+
RangeSliderField2,
|
|
4826
|
+
{
|
|
4827
|
+
sliderId: "wizard-rule-priority",
|
|
4828
|
+
label: labels.priorityLabel,
|
|
4829
|
+
value: priority,
|
|
4830
|
+
onChange: (v) => {
|
|
4831
|
+
setPriority(Math.round(v));
|
|
4832
|
+
markTouched();
|
|
4833
|
+
},
|
|
4834
|
+
min: 0,
|
|
4835
|
+
max: 100,
|
|
4836
|
+
step: 1,
|
|
4837
|
+
trackGradient: "linear-gradient(90deg, #10b981, #38bdf8 33%, #f59e0b 66%, #f43f5e)",
|
|
4838
|
+
formatValue: (v) => String(Math.round(v)),
|
|
4839
|
+
zones: [
|
|
4840
|
+
{ label: labels.priorityLow, max: 25, color: "text-emerald-500", thumbColor: "#10b981" },
|
|
4841
|
+
{ label: labels.priorityNormal, max: 50, color: "text-sky-500", thumbColor: "#38bdf8" },
|
|
4842
|
+
{ label: labels.priorityHigh, max: 75, color: "text-amber-500", thumbColor: "#f59e0b" },
|
|
4843
|
+
{ label: labels.priorityCritical, max: 100, color: "text-rose-500", thumbColor: "#f43f5e" }
|
|
4844
|
+
]
|
|
4845
|
+
}
|
|
4846
|
+
),
|
|
4847
|
+
/* @__PURE__ */ jsx(
|
|
4848
|
+
FormToggle,
|
|
4849
|
+
{
|
|
4850
|
+
checked: enabled,
|
|
4851
|
+
onChange: (v) => {
|
|
4852
|
+
setEnabled(v);
|
|
4853
|
+
markTouched();
|
|
4854
|
+
},
|
|
4855
|
+
label: labels.enabledLabel,
|
|
4856
|
+
variant: "card"
|
|
4857
|
+
}
|
|
4858
|
+
)
|
|
4859
|
+
] })
|
|
4860
|
+
}
|
|
4861
|
+
);
|
|
4862
|
+
}
|
|
4863
|
+
function renderStep2() {
|
|
4864
|
+
return /* @__PURE__ */ jsx(
|
|
4865
|
+
SectionCard,
|
|
4866
|
+
{
|
|
4867
|
+
variant: "glass",
|
|
4868
|
+
header: {
|
|
4869
|
+
title: labels.conditionSectionTitle,
|
|
4870
|
+
subtitle: labels.conditionSectionSubtitle
|
|
4871
|
+
},
|
|
4872
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4873
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4874
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.combinatorLabel }),
|
|
4875
|
+
/* @__PURE__ */ jsx(
|
|
4876
|
+
SegmentedControl,
|
|
4877
|
+
{
|
|
4878
|
+
segments: [
|
|
4879
|
+
{ value: "and", label: labels.combinatorAnd },
|
|
4880
|
+
{ value: "or", label: labels.combinatorOr },
|
|
4881
|
+
{ value: "not", label: labels.combinatorNot }
|
|
4882
|
+
],
|
|
4883
|
+
value: combinator,
|
|
4884
|
+
onChange: (v) => {
|
|
4885
|
+
setCombinator(v);
|
|
4886
|
+
markTouched();
|
|
4887
|
+
},
|
|
4888
|
+
size: "sm"
|
|
4889
|
+
}
|
|
4890
|
+
)
|
|
4891
|
+
] }),
|
|
4892
|
+
/* @__PURE__ */ jsx(
|
|
4893
|
+
RuleConditionBuilder,
|
|
4894
|
+
{
|
|
4895
|
+
value: condition,
|
|
4896
|
+
onChange: (next) => {
|
|
4897
|
+
setCondition(next);
|
|
4898
|
+
markTouched();
|
|
4899
|
+
}
|
|
4900
|
+
}
|
|
4901
|
+
)
|
|
4902
|
+
] })
|
|
4903
|
+
}
|
|
4904
|
+
);
|
|
4905
|
+
}
|
|
4906
|
+
function renderStep3() {
|
|
4907
|
+
const selectedTile = ACTION_TILES.find((t) => t.id === actionTileId) ?? null;
|
|
4908
|
+
return /* @__PURE__ */ jsx(
|
|
4909
|
+
SectionCard,
|
|
4910
|
+
{
|
|
4911
|
+
variant: "glass",
|
|
4912
|
+
header: {
|
|
4913
|
+
title: labels.actionSectionTitle,
|
|
4914
|
+
subtitle: labels.actionSectionSubtitle
|
|
4915
|
+
},
|
|
4916
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
4917
|
+
/* @__PURE__ */ jsx(
|
|
4918
|
+
"div",
|
|
4919
|
+
{
|
|
4920
|
+
role: "radiogroup",
|
|
4921
|
+
"aria-label": labels.actionSectionTitle,
|
|
4922
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
4923
|
+
children: ACTION_TILES.map((tile) => {
|
|
4924
|
+
const Icon = tile.icon;
|
|
4925
|
+
const selected = tile.id === actionTileId;
|
|
4926
|
+
const label = labels[tile.labelKey] ?? tile.id;
|
|
4927
|
+
const description2 = labels[tile.descriptionKey] ?? "";
|
|
4928
|
+
return /* @__PURE__ */ jsx(
|
|
4929
|
+
FilterTileButton,
|
|
4930
|
+
{
|
|
4931
|
+
isActive: selected,
|
|
4932
|
+
color: tile.color,
|
|
4933
|
+
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
4934
|
+
label,
|
|
4935
|
+
count: description2,
|
|
4936
|
+
onClick: () => {
|
|
4937
|
+
setActionTileId(tile.id);
|
|
4938
|
+
markTouched();
|
|
4939
|
+
}
|
|
4940
|
+
},
|
|
4941
|
+
tile.id
|
|
4942
|
+
);
|
|
4943
|
+
})
|
|
4944
|
+
}
|
|
4945
|
+
),
|
|
4946
|
+
selectedTile && /* @__PURE__ */ jsx(
|
|
4947
|
+
SectionCard,
|
|
4948
|
+
{
|
|
4949
|
+
variant: "glass",
|
|
4950
|
+
header: {
|
|
4951
|
+
title: labels[selectedTile.labelKey] ?? selectedTile.id,
|
|
4952
|
+
subtitle: labels.actionConfigSubtitle
|
|
4953
|
+
},
|
|
4954
|
+
children: /* @__PURE__ */ jsx(
|
|
4955
|
+
RuleActionBuilder,
|
|
4956
|
+
{
|
|
4957
|
+
value: action,
|
|
4958
|
+
onChange: (next) => {
|
|
4959
|
+
setAction(next);
|
|
4960
|
+
markTouched();
|
|
4961
|
+
}
|
|
4962
|
+
}
|
|
4963
|
+
)
|
|
4964
|
+
}
|
|
4965
|
+
)
|
|
4966
|
+
] })
|
|
4967
|
+
}
|
|
4968
|
+
);
|
|
4969
|
+
}
|
|
4970
|
+
function renderStep4() {
|
|
4971
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsx(
|
|
4972
|
+
SectionCard,
|
|
4973
|
+
{
|
|
4974
|
+
variant: "glass",
|
|
4975
|
+
header: {
|
|
4976
|
+
title: labels.scheduleSectionTitle,
|
|
4977
|
+
subtitle: labels.scheduleSectionSubtitle
|
|
4978
|
+
},
|
|
4979
|
+
children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
4980
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
4981
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
4982
|
+
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
|
|
4983
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4984
|
+
/* @__PURE__ */ jsx(
|
|
4985
|
+
DatePicker,
|
|
4986
|
+
{
|
|
4987
|
+
value: validFromDate,
|
|
4988
|
+
onChange: (d) => {
|
|
4989
|
+
setValidFromDate(d);
|
|
4990
|
+
markTouched();
|
|
4991
|
+
},
|
|
4992
|
+
placeholder: labels.validFromDateLabel
|
|
4993
|
+
}
|
|
4994
|
+
),
|
|
4995
|
+
/* @__PURE__ */ jsx(
|
|
4996
|
+
TimePicker,
|
|
4997
|
+
{
|
|
4998
|
+
value: validFromTime,
|
|
4999
|
+
onChange: (t) => {
|
|
5000
|
+
setValidFromTime(t);
|
|
5001
|
+
markTouched();
|
|
5002
|
+
},
|
|
5003
|
+
placeholder: labels.validFromTimeLabel
|
|
5004
|
+
}
|
|
5005
|
+
)
|
|
5006
|
+
] })
|
|
5007
|
+
] }),
|
|
5008
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5009
|
+
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
|
|
5010
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5011
|
+
/* @__PURE__ */ jsx(
|
|
5012
|
+
DatePicker,
|
|
5013
|
+
{
|
|
5014
|
+
value: validUntilDate,
|
|
5015
|
+
onChange: (d) => {
|
|
5016
|
+
setValidUntilDate(d);
|
|
5017
|
+
markTouched();
|
|
5018
|
+
},
|
|
5019
|
+
placeholder: labels.validUntilDateLabel
|
|
5020
|
+
}
|
|
5021
|
+
),
|
|
5022
|
+
/* @__PURE__ */ jsx(
|
|
5023
|
+
TimePicker,
|
|
5024
|
+
{
|
|
5025
|
+
value: validUntilTime,
|
|
5026
|
+
onChange: (t) => {
|
|
5027
|
+
setValidUntilTime(t);
|
|
5028
|
+
markTouched();
|
|
5029
|
+
},
|
|
5030
|
+
placeholder: labels.validUntilTimeLabel
|
|
5031
|
+
}
|
|
5032
|
+
)
|
|
5033
|
+
] })
|
|
5034
|
+
] })
|
|
5035
|
+
] }),
|
|
5036
|
+
/* @__PURE__ */ jsx(
|
|
5037
|
+
FormCheckbox,
|
|
5038
|
+
{
|
|
5039
|
+
checked: noExpiry,
|
|
5040
|
+
onChange: (v) => {
|
|
5041
|
+
setNoExpiry(v);
|
|
5042
|
+
markTouched();
|
|
5043
|
+
},
|
|
5044
|
+
label: labels.noExpiryLabel,
|
|
5045
|
+
description: labels.noExpiryDescription
|
|
5046
|
+
}
|
|
5047
|
+
),
|
|
5048
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5049
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.statusLabel }),
|
|
5050
|
+
/* @__PURE__ */ jsx(
|
|
5051
|
+
SegmentedControl,
|
|
5052
|
+
{
|
|
5053
|
+
segments: [
|
|
5054
|
+
{ value: "active", label: labels.statusActive },
|
|
5055
|
+
{ value: "paused", label: labels.statusPaused },
|
|
5056
|
+
{ value: "archived", label: labels.statusArchived }
|
|
5057
|
+
],
|
|
5058
|
+
value: status,
|
|
5059
|
+
onChange: (v) => {
|
|
5060
|
+
setStatus(v);
|
|
5061
|
+
markTouched();
|
|
5062
|
+
},
|
|
5063
|
+
size: "sm"
|
|
5064
|
+
}
|
|
5065
|
+
)
|
|
5066
|
+
] }),
|
|
5067
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
5068
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
|
|
5069
|
+
/* @__PURE__ */ jsx(
|
|
5070
|
+
ChipPicker,
|
|
5071
|
+
{
|
|
5072
|
+
items: tagsItems,
|
|
5073
|
+
selectedIds: tagsSelected,
|
|
5074
|
+
onChange: (ids) => {
|
|
5075
|
+
setTagsSelected(ids);
|
|
5076
|
+
markTouched();
|
|
5077
|
+
},
|
|
5078
|
+
onItemsChange: (items) => {
|
|
5079
|
+
setTagsItems(items);
|
|
5080
|
+
markTouched();
|
|
5081
|
+
},
|
|
5082
|
+
allowCustom: true,
|
|
5083
|
+
unselectedStyle: tagsStyle,
|
|
5084
|
+
showActions: false,
|
|
5085
|
+
addPlaceholder: labels.tagsPlaceholder,
|
|
5086
|
+
addAriaLabel: labels.tagsLabel
|
|
5087
|
+
}
|
|
5088
|
+
),
|
|
5089
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
|
|
5090
|
+
] }),
|
|
5091
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5092
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
|
|
5093
|
+
/* @__PURE__ */ jsx(
|
|
5094
|
+
SegmentedControl,
|
|
5095
|
+
{
|
|
5096
|
+
segments: [
|
|
5097
|
+
{ value: "one-off", label: labels.recurrenceOneOff },
|
|
5098
|
+
{ value: "cron", label: labels.recurrenceCron },
|
|
5099
|
+
{ value: "recurring", label: labels.recurrenceRecurring }
|
|
5100
|
+
],
|
|
5101
|
+
value: recurrence,
|
|
5102
|
+
onChange: (v) => {
|
|
5103
|
+
setRecurrence(v);
|
|
5104
|
+
markTouched();
|
|
5105
|
+
},
|
|
5106
|
+
size: "sm"
|
|
5107
|
+
}
|
|
5108
|
+
)
|
|
5109
|
+
] }),
|
|
5110
|
+
recurrence === "cron" && /* @__PURE__ */ jsx(
|
|
5111
|
+
FormInput,
|
|
5112
|
+
{
|
|
5113
|
+
label: labels.cronExpressionLabel,
|
|
5114
|
+
value: cronExpression,
|
|
5115
|
+
onValueChange: (v) => {
|
|
5116
|
+
setCronExpression(v);
|
|
5117
|
+
markTouched();
|
|
5118
|
+
},
|
|
5119
|
+
placeholder: labels.cronExpressionPlaceholder,
|
|
5120
|
+
hint: labels.cronExpressionHint
|
|
5121
|
+
}
|
|
5122
|
+
),
|
|
5123
|
+
recurrence === "recurring" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
5124
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5125
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.weekdaysLabel }),
|
|
5126
|
+
/* @__PURE__ */ jsx(
|
|
5127
|
+
ChipPicker,
|
|
5128
|
+
{
|
|
5129
|
+
items: WEEKDAYS.map((d) => ({
|
|
5130
|
+
id: d.id,
|
|
5131
|
+
name: labels[d.labelKey] ?? d.id,
|
|
5132
|
+
style: {
|
|
5133
|
+
bg: "bg-fuchsia-500/15",
|
|
5134
|
+
text: "text-fuchsia-700 dark:text-fuchsia-300"
|
|
5135
|
+
}
|
|
5136
|
+
})),
|
|
5137
|
+
selectedIds: weekdays,
|
|
5138
|
+
onChange: (ids) => {
|
|
5139
|
+
setWeekdays(ids);
|
|
5140
|
+
markTouched();
|
|
5141
|
+
},
|
|
5142
|
+
showActions: false
|
|
5143
|
+
}
|
|
5144
|
+
)
|
|
5145
|
+
] }),
|
|
5146
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5147
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
|
|
5148
|
+
/* @__PURE__ */ jsx(
|
|
5149
|
+
TimePicker,
|
|
5150
|
+
{
|
|
5151
|
+
value: recurringTime,
|
|
5152
|
+
onChange: (t) => {
|
|
5153
|
+
setRecurringTime(t);
|
|
5154
|
+
markTouched();
|
|
5155
|
+
},
|
|
5156
|
+
placeholder: labels.timeOfDayLabel
|
|
5157
|
+
}
|
|
5158
|
+
)
|
|
5159
|
+
] })
|
|
5160
|
+
] })
|
|
5161
|
+
] })
|
|
5162
|
+
}
|
|
5163
|
+
) });
|
|
5164
|
+
}
|
|
5165
|
+
function renderStep5() {
|
|
5166
|
+
const payload = buildPayload();
|
|
5167
|
+
const conditionSentence = humanReadableCondition(payload.condition, labels);
|
|
5168
|
+
const actionSentence = humanReadableAction(payload.action, labels, ACTION_TILES, actionTileId);
|
|
5169
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5170
|
+
/* @__PURE__ */ jsx(
|
|
5171
|
+
SectionCard,
|
|
5172
|
+
{
|
|
5173
|
+
variant: "glass",
|
|
5174
|
+
header: {
|
|
5175
|
+
title: labels.wizardStep1Title,
|
|
5176
|
+
subtitle: labels.wizardStep1Subtitle
|
|
5177
|
+
},
|
|
5178
|
+
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
5179
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5180
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5181
|
+
] }),
|
|
5182
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5183
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewNameLabel, value: payload.name }),
|
|
5184
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewPriorityLabel, value: String(payload.priority) }),
|
|
5185
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewEnabledLabel, value: payload.enabled ? labels.reviewYes : labels.reviewNo }),
|
|
5186
|
+
/* @__PURE__ */ jsx(
|
|
5187
|
+
ReviewRow3,
|
|
5188
|
+
{
|
|
5189
|
+
label: labels.reviewDescriptionLabel,
|
|
5190
|
+
value: payload.description ?? labels.reviewNoneValue
|
|
5191
|
+
}
|
|
5192
|
+
)
|
|
5193
|
+
] })
|
|
5194
|
+
}
|
|
5195
|
+
),
|
|
5196
|
+
/* @__PURE__ */ jsxs(
|
|
5197
|
+
SectionCard,
|
|
5198
|
+
{
|
|
5199
|
+
variant: "glass",
|
|
5200
|
+
header: {
|
|
5201
|
+
title: labels.wizardStep2Title,
|
|
5202
|
+
subtitle: labels.wizardStep2Subtitle
|
|
5203
|
+
},
|
|
5204
|
+
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
5205
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5206
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5207
|
+
] }),
|
|
5208
|
+
children: [
|
|
5209
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: conditionSentence }),
|
|
5210
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() }),
|
|
5211
|
+
/* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.condition, null, 2) })
|
|
5212
|
+
]
|
|
5213
|
+
}
|
|
5214
|
+
),
|
|
5215
|
+
/* @__PURE__ */ jsxs(
|
|
5216
|
+
SectionCard,
|
|
5217
|
+
{
|
|
5218
|
+
variant: "glass",
|
|
5219
|
+
header: {
|
|
5220
|
+
title: labels.wizardStep3Title,
|
|
5221
|
+
subtitle: labels.wizardStep3Subtitle
|
|
5222
|
+
},
|
|
5223
|
+
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
5224
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5225
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5226
|
+
] }),
|
|
5227
|
+
children: [
|
|
5228
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: actionSentence }),
|
|
5229
|
+
/* @__PURE__ */ jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.action, null, 2) })
|
|
5230
|
+
]
|
|
5231
|
+
}
|
|
5232
|
+
),
|
|
5233
|
+
/* @__PURE__ */ jsx(
|
|
5234
|
+
SectionCard,
|
|
5235
|
+
{
|
|
5236
|
+
variant: "glass",
|
|
5237
|
+
header: {
|
|
5238
|
+
title: labels.wizardStep4Title,
|
|
5239
|
+
subtitle: labels.wizardStep4Subtitle
|
|
5240
|
+
},
|
|
5241
|
+
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(4), children: [
|
|
5242
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5243
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5244
|
+
] }),
|
|
5245
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5246
|
+
/* @__PURE__ */ jsx(
|
|
5247
|
+
ReviewRow3,
|
|
5248
|
+
{
|
|
5249
|
+
label: labels.reviewValidFromLabel,
|
|
5250
|
+
value: payload.validFrom ?? labels.reviewNoneValue
|
|
5251
|
+
}
|
|
5252
|
+
),
|
|
5253
|
+
/* @__PURE__ */ jsx(
|
|
5254
|
+
ReviewRow3,
|
|
5255
|
+
{
|
|
5256
|
+
label: labels.reviewValidUntilLabel,
|
|
5257
|
+
value: payload.validUntil ?? (noExpiry ? labels.noExpiryLabel : labels.reviewNoneValue)
|
|
5258
|
+
}
|
|
5259
|
+
),
|
|
5260
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewStatusLabel, value: payload.status ?? "active" }),
|
|
5261
|
+
/* @__PURE__ */ jsx(
|
|
5262
|
+
ReviewRow3,
|
|
5263
|
+
{
|
|
5264
|
+
label: labels.reviewTagsLabel,
|
|
5265
|
+
value: payload.tags && payload.tags.length > 0 ? payload.tags.join(", ") : labels.reviewNoneValue
|
|
5266
|
+
}
|
|
5267
|
+
),
|
|
5268
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewRecurrenceLabel, value: recurrence })
|
|
5269
|
+
] })
|
|
5270
|
+
}
|
|
5271
|
+
)
|
|
5272
|
+
] });
|
|
5273
|
+
}
|
|
5274
|
+
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
|
|
5275
|
+
const advanceDisabled = !canAdvance(step);
|
|
5276
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
|
|
5277
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
|
|
5278
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5279
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
|
|
5280
|
+
step < TOTAL_STEPS3 ? /* @__PURE__ */ jsx(Button, { type: "button", color: "fuchsia", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsx(
|
|
5281
|
+
Button,
|
|
5282
|
+
{
|
|
5283
|
+
type: "button",
|
|
5284
|
+
color: "fuchsia",
|
|
5285
|
+
onClick: () => void submit(),
|
|
5286
|
+
disabled: submitting || !name.trim() || !actionTileId,
|
|
5287
|
+
children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate
|
|
5288
|
+
}
|
|
5289
|
+
)
|
|
5290
|
+
] })
|
|
5291
|
+
] });
|
|
5292
|
+
const content = /* @__PURE__ */ jsxs(
|
|
5293
|
+
"form",
|
|
5294
|
+
{
|
|
5295
|
+
onSubmit: (e) => {
|
|
5296
|
+
e.preventDefault();
|
|
5297
|
+
if (step < TOTAL_STEPS3) goNext();
|
|
5298
|
+
else void submit();
|
|
5299
|
+
},
|
|
5300
|
+
className: "space-y-4",
|
|
5301
|
+
children: [
|
|
5302
|
+
/* @__PURE__ */ jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
|
|
5303
|
+
footer
|
|
5304
|
+
]
|
|
5305
|
+
}
|
|
5306
|
+
);
|
|
5307
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5308
|
+
hero,
|
|
5309
|
+
content
|
|
5310
|
+
] });
|
|
5311
|
+
}
|
|
5312
|
+
function ReviewRow3({ label, value }) {
|
|
5313
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
5314
|
+
/* @__PURE__ */ jsx("dt", { className: "text-[10px] uppercase tracking-wider text-gray-400 dark:text-gray-500", children: label }),
|
|
5315
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs font-semibold text-gray-900 dark:text-white", children: value })
|
|
5316
|
+
] });
|
|
5317
|
+
}
|
|
5318
|
+
function pad(n) {
|
|
5319
|
+
return String(n).padStart(2, "0");
|
|
5320
|
+
}
|
|
5321
|
+
function humanReadableCondition(cond, labels) {
|
|
5322
|
+
if (!cond) return labels.reviewNoneValue;
|
|
5323
|
+
if (cond.operator === "boolean_expression" && Array.isArray(cond.operands)) {
|
|
5324
|
+
const inner = cond.operands.map((o) => humanReadableCondition(o, labels)).join(` ${cond.combinator?.toUpperCase() ?? "AND"} `);
|
|
5325
|
+
return `(${inner})`;
|
|
5326
|
+
}
|
|
5327
|
+
const field = cond.field ?? "?";
|
|
5328
|
+
switch (cond.operator) {
|
|
5329
|
+
case "truthy":
|
|
5330
|
+
return `${field} is set`;
|
|
5331
|
+
case "eq":
|
|
5332
|
+
return `${field} = ${formatValue(cond.value)}`;
|
|
5333
|
+
case "neq":
|
|
5334
|
+
return `${field} \u2260 ${formatValue(cond.value)}`;
|
|
5335
|
+
case "gt":
|
|
5336
|
+
return `${field} > ${formatValue(cond.value)}`;
|
|
5337
|
+
case "gte":
|
|
5338
|
+
return `${field} \u2265 ${formatValue(cond.value)}`;
|
|
5339
|
+
case "lt":
|
|
5340
|
+
return `${field} < ${formatValue(cond.value)}`;
|
|
5341
|
+
case "lte":
|
|
5342
|
+
return `${field} \u2264 ${formatValue(cond.value)}`;
|
|
5343
|
+
case "contains":
|
|
5344
|
+
return `${field} contains "${formatValue(cond.value)}"`;
|
|
5345
|
+
case "regex_match":
|
|
5346
|
+
return `${field} matches /${cond.pattern ?? ""}/`;
|
|
5347
|
+
case "threshold":
|
|
5348
|
+
return `${field} ${cond.comparison ?? "gte"} ${formatValue(cond.value)}`;
|
|
5349
|
+
case "time_window":
|
|
5350
|
+
return `${field} within time-window(${(cond.windows ?? []).length})`;
|
|
5351
|
+
default:
|
|
5352
|
+
return `${cond.operator}(${field})`;
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5355
|
+
function formatValue(v) {
|
|
5356
|
+
if (v === null || v === void 0) return "";
|
|
5357
|
+
return String(v);
|
|
5358
|
+
}
|
|
5359
|
+
function humanReadableAction(action, labels, tiles, actionTileId) {
|
|
5360
|
+
const tile = tiles.find((t) => t.id === actionTileId);
|
|
5361
|
+
const tileLabel = tile ? labels[tile.labelKey] ?? tile.id : action.type;
|
|
5362
|
+
const paramSummary = action.params ? Object.entries(action.params).slice(0, 3).map(([k, v]) => `${k}=${String(v)}`).join(", ") : "";
|
|
5363
|
+
return paramSummary ? `${tileLabel} \u2014 ${paramSummary}` : tileLabel;
|
|
5364
|
+
}
|
|
3619
5365
|
|
|
3620
|
-
export { AgentNewWizardPageView, AgentsConfigPageView, AgentsIndexPageView, AgentsModelsPageView, AgentsPromptsPageView, AgentsToolDefinitionsPageView, AgentsWorkspacePageView, ConnectionsPageView, CredentialsPageView, DashboardPageView, DatasourcesPageView, RulesPageView, RunTimelinePageView, TOOL_TYPES, WorkflowRunsPageView, WorkflowsPageView, jsonSchemaToParameters, parametersToJsonSchema };
|
|
5366
|
+
export { AgentNewWizardPageView, AgentsConfigPageView, AgentsIndexPageView, AgentsModelsPageView, AgentsPromptsPageView, AgentsToolDefinitionsPageView, AgentsWorkspacePageView, ConnectionsPageView, CredentialsPageView, DashboardPageView, DatasourceNewWizardPageView, DatasourcesPageView, RuleNewWizardPageView, RulesPageView, RunTimelinePageView, TOOL_TYPES, WorkflowRunsPageView, WorkflowsPageView, jsonSchemaToParameters, parametersToJsonSchema };
|
|
3621
5367
|
//# sourceMappingURL=index.mjs.map
|
|
3622
5368
|
//# sourceMappingURL=index.mjs.map
|