@datatechsolutions/ui 3.13.1 → 3.15.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/graph-node.js +6 -6
- package/dist/astrlabe/graph-node.mjs +2 -2
- package/dist/astrlabe/index.js +113 -113
- 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-Q7QPHZOV.js → chunk-2JPS5OND.js} +67 -67
- package/dist/{chunk-Q7QPHZOV.js.map → chunk-2JPS5OND.js.map} +1 -1
- package/dist/{chunk-RPNMDGRA.js → chunk-2QZFKQP6.js} +37 -40
- package/dist/chunk-2QZFKQP6.js.map +1 -0
- package/dist/{chunk-O4RZCDP2.mjs → chunk-2SBVFLPZ.mjs} +19 -2
- package/dist/chunk-2SBVFLPZ.mjs.map +1 -0
- package/dist/{chunk-4VEQJAXJ.mjs → chunk-3FOLXKVP.mjs} +5 -5
- package/dist/{chunk-4VEQJAXJ.mjs.map → chunk-3FOLXKVP.mjs.map} +1 -1
- package/dist/{chunk-PM7A5I3X.js → chunk-435TRHC2.js} +118 -118
- package/dist/{chunk-PM7A5I3X.js.map → chunk-435TRHC2.js.map} +1 -1
- package/dist/{chunk-M4KRQXOT.mjs → chunk-5QRU3KKV.mjs} +3 -3
- package/dist/{chunk-M4KRQXOT.mjs.map → chunk-5QRU3KKV.mjs.map} +1 -1
- package/dist/{chunk-DTFU3ZTD.js → chunk-6NBQTIXX.js} +9 -9
- package/dist/{chunk-DTFU3ZTD.js.map → chunk-6NBQTIXX.js.map} +1 -1
- package/dist/{chunk-CVEI4RQP.js → chunk-6NEESZVO.js} +4 -4
- package/dist/{chunk-CVEI4RQP.js.map → chunk-6NEESZVO.js.map} +1 -1
- package/dist/{chunk-CKY2QIRR.js → chunk-6UUFPSAR.js} +4 -4
- package/dist/{chunk-CKY2QIRR.js.map → chunk-6UUFPSAR.js.map} +1 -1
- package/dist/{chunk-DJHNSBIR.mjs → chunk-7LIJTAIF.mjs} +31 -31
- package/dist/{chunk-DJHNSBIR.mjs.map → chunk-7LIJTAIF.mjs.map} +1 -1
- package/dist/{chunk-4MNKVDTJ.mjs → chunk-A5M7SPPG.mjs} +4 -4
- package/dist/{chunk-4MNKVDTJ.mjs.map → chunk-A5M7SPPG.mjs.map} +1 -1
- package/dist/{chunk-FV42SSLP.js → chunk-A5OMGPMR.js} +4 -4
- package/dist/{chunk-FV42SSLP.js.map → chunk-A5OMGPMR.js.map} +1 -1
- package/dist/{chunk-VWZ53TE2.js → chunk-BN4BKFE2.js} +9 -9
- package/dist/{chunk-VWZ53TE2.js.map → chunk-BN4BKFE2.js.map} +1 -1
- package/dist/{chunk-4Z5NZINA.js → chunk-C4UYEHPY.js} +136 -136
- package/dist/chunk-C4UYEHPY.js.map +1 -0
- package/dist/{chunk-54T5F65C.js → chunk-CPTHSYM2.js} +17 -17
- package/dist/{chunk-54T5F65C.js.map → chunk-CPTHSYM2.js.map} +1 -1
- package/dist/{chunk-3VCSMSJB.mjs → chunk-EZVBRLQH.mjs} +9 -9
- package/dist/{chunk-3VCSMSJB.mjs.map → chunk-EZVBRLQH.mjs.map} +1 -1
- package/dist/{chunk-4QCO4CBC.mjs → chunk-F3PQ5EFQ.mjs} +4 -4
- package/dist/{chunk-4QCO4CBC.mjs.map → chunk-F3PQ5EFQ.mjs.map} +1 -1
- package/dist/{chunk-RUZPOHJW.js → chunk-GD3YV46U.js} +41 -41
- package/dist/{chunk-RUZPOHJW.js.map → chunk-GD3YV46U.js.map} +1 -1
- package/dist/{chunk-Y65X2NHF.mjs → chunk-I6ULYJR4.mjs} +3 -3
- package/dist/{chunk-Y65X2NHF.mjs.map → chunk-I6ULYJR4.mjs.map} +1 -1
- package/dist/{chunk-YHD6SJIN.mjs → chunk-JJUWZNJY.mjs} +4 -4
- package/dist/{chunk-YHD6SJIN.mjs.map → chunk-JJUWZNJY.mjs.map} +1 -1
- package/dist/{chunk-VPRAESA7.mjs → chunk-KDDXDQR2.mjs} +3 -3
- package/dist/{chunk-VPRAESA7.mjs.map → chunk-KDDXDQR2.mjs.map} +1 -1
- package/dist/{chunk-UPWJRCAD.js → chunk-KRS2CLPR.js} +223 -229
- package/dist/chunk-KRS2CLPR.js.map +1 -0
- package/dist/{chunk-RWZ2PLMQ.js → chunk-KZDABEML.js} +211 -154
- package/dist/chunk-KZDABEML.js.map +1 -0
- package/dist/{chunk-TRNDFSM6.mjs → chunk-MSXJFWKD.mjs} +28 -28
- package/dist/chunk-MSXJFWKD.mjs.map +1 -0
- package/dist/{chunk-EBARYRSA.js → chunk-MXQ2EYG2.js} +19 -2
- package/dist/chunk-MXQ2EYG2.js.map +1 -0
- package/dist/{chunk-RMPXGEFL.mjs → chunk-NNR44MM5.mjs} +7 -7
- package/dist/{chunk-RMPXGEFL.mjs.map → chunk-NNR44MM5.mjs.map} +1 -1
- package/dist/{chunk-AC54BNSK.js → chunk-NQCFGIWC.js} +13 -13
- package/dist/{chunk-AC54BNSK.js.map → chunk-NQCFGIWC.js.map} +1 -1
- package/dist/{chunk-7IAWXG43.js → chunk-OQM252SM.js} +33 -33
- package/dist/{chunk-7IAWXG43.js.map → chunk-OQM252SM.js.map} +1 -1
- package/dist/{chunk-VCL5LDS5.js → chunk-PADXORD2.js} +38 -38
- package/dist/{chunk-VCL5LDS5.js.map → chunk-PADXORD2.js.map} +1 -1
- package/dist/{chunk-SCGICCQM.mjs → chunk-PSS3E463.mjs} +7 -10
- package/dist/chunk-PSS3E463.mjs.map +1 -0
- package/dist/{chunk-QEACOJXX.mjs → chunk-QCGSE24W.mjs} +139 -83
- package/dist/chunk-QCGSE24W.mjs.map +1 -0
- package/dist/{chunk-ZPV7X4ZE.mjs → chunk-RH6Z425K.mjs} +6 -6
- package/dist/{chunk-ZPV7X4ZE.mjs.map → chunk-RH6Z425K.mjs.map} +1 -1
- package/dist/{chunk-RSCRIDMW.mjs → chunk-SMUBE3RO.mjs} +46 -52
- package/dist/chunk-SMUBE3RO.mjs.map +1 -0
- package/dist/{chunk-WX44DAQD.mjs → chunk-TQADF23S.mjs} +3 -3
- package/dist/{chunk-WX44DAQD.mjs.map → chunk-TQADF23S.mjs.map} +1 -1
- package/dist/{chunk-B3TA74C4.js → chunk-WG26KW6D.js} +57 -60
- package/dist/chunk-WG26KW6D.js.map +1 -0
- package/dist/{chunk-UUTTS3VV.mjs → chunk-WGS65S7S.mjs} +8 -11
- package/dist/chunk-WGS65S7S.mjs.map +1 -0
- package/dist/{chunk-ULSG4JLR.js → chunk-XJJZ6DHE.js} +6 -6
- package/dist/{chunk-ULSG4JLR.js.map → chunk-XJJZ6DHE.js.map} +1 -1
- package/dist/{chunk-XYMHIZ3K.mjs → chunk-ZBX7UCAP.mjs} +7 -7
- package/dist/{chunk-XYMHIZ3K.mjs.map → chunk-ZBX7UCAP.mjs.map} +1 -1
- package/dist/index.d.mts +77 -7
- package/dist/index.d.ts +77 -7
- package/dist/index.js +707 -703
- package/dist/index.mjs +2 -2
- 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 +4 -4
- package/dist/platform/app-shell.mjs +3 -3
- package/dist/platform/auth/index.js +28 -28
- package/dist/platform/auth/index.mjs +5 -5
- package/dist/platform/billing/index.js +6 -6
- package/dist/platform/billing/index.mjs +4 -4
- package/dist/platform/impersonation/index.js +4 -4
- package/dist/platform/impersonation/index.mjs +3 -3
- package/dist/platform/index.js +93 -93
- package/dist/platform/index.mjs +21 -21
- package/dist/platform/pages/index.d.mts +103 -1
- package/dist/platform/pages/index.d.ts +103 -1
- package/dist/platform/pages/index.js +1756 -1429
- package/dist/platform/pages/index.js.map +1 -1
- package/dist/platform/pages/index.mjs +1458 -1137
- 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-canvas-shell.js +6 -6
- package/dist/platform/workflow-canvas-shell.mjs +5 -5
- package/package.json +1 -1
- package/dist/chunk-4Z5NZINA.js.map +0 -1
- package/dist/chunk-B3TA74C4.js.map +0 -1
- package/dist/chunk-EBARYRSA.js.map +0 -1
- package/dist/chunk-O4RZCDP2.mjs.map +0 -1
- package/dist/chunk-QEACOJXX.mjs.map +0 -1
- package/dist/chunk-RPNMDGRA.js.map +0 -1
- package/dist/chunk-RSCRIDMW.mjs.map +0 -1
- package/dist/chunk-RWZ2PLMQ.js.map +0 -1
- package/dist/chunk-SCGICCQM.mjs.map +0 -1
- package/dist/chunk-TRNDFSM6.mjs.map +0 -1
- package/dist/chunk-UPWJRCAD.js.map +0 -1
- package/dist/chunk-UUTTS3VV.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 { DIALECT_CATEGORIES, DatasourceModal, findDialect, findCategory } from '../../chunk-
|
|
6
|
-
export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-
|
|
7
|
-
import { defaultRuleForm, RuleForm, ExecutionTimelinePanel, defaultRuleCondition, defaultRuleAction, RuleConditionBuilder, RuleActionBuilder } from '../../chunk-
|
|
3
|
+
import { WorkflowWorkspace } from '../../chunk-3FOLXKVP.mjs';
|
|
4
|
+
export { RolesPageView, UsersPageView } from '../../chunk-3FOLXKVP.mjs';
|
|
5
|
+
import { DIALECT_CATEGORIES, DatasourceModal, findDialect, findCategory } from '../../chunk-A5M7SPPG.mjs';
|
|
6
|
+
export { DIALECT_CATEGORIES, DatasourceFormModal, DatasourceModal, findCategory, findDialect } from '../../chunk-A5M7SPPG.mjs';
|
|
7
|
+
import { defaultRuleForm, RuleForm, ExecutionTimelinePanel, defaultRuleCondition, defaultRuleAction, RuleConditionBuilder, RuleActionBuilder } from '../../chunk-SMUBE3RO.mjs';
|
|
8
8
|
import '../../chunk-JB6RNAD2.mjs';
|
|
9
9
|
import '../../chunk-LEXBTVGM.mjs';
|
|
10
|
-
import '../../chunk-
|
|
11
|
-
import { HeroSection, SearchBar, FormSection, ChipPicker, 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, FormCheckbox, SegmentedControl, DatePicker, TimePicker } from '../../chunk-
|
|
10
|
+
import '../../chunk-MSXJFWKD.mjs';
|
|
11
|
+
import { HeroSection, SearchBar, FormSection, ChipPicker, 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, Card, CardContent, FilterTileButton, PickerTile, FormToggle, Spinner, StatusBadge, FormCheckbox, SegmentedControl, DatePicker, TimePicker } from '../../chunk-QCGSE24W.mjs';
|
|
12
12
|
import '../../chunk-ZEFNBGYI.mjs';
|
|
13
13
|
import '../../chunk-NBW6WJQT.mjs';
|
|
14
14
|
import '../../chunk-3AY5HIQ6.mjs';
|
|
15
|
-
import '../../chunk-
|
|
16
|
-
import { Button, Badge } from '../../chunk-
|
|
15
|
+
import '../../chunk-KDDXDQR2.mjs';
|
|
16
|
+
import { Button, Badge, IconButton } from '../../chunk-2SBVFLPZ.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,
|
|
21
|
+
import { CubeTransparentIcon, CpuChipIcon, ChatBubbleLeftEllipsisIcon, WrenchScrewdriverIcon, AdjustmentsHorizontalIcon, CircleStackIcon, RectangleStackIcon, ClockIcon, LinkIcon, KeyIcon, ArrowPathIcon, TrashIcon, PlusIcon, XMarkIcon, CodeBracketIcon, ServerStackIcon, SparklesIcon, BoltIcon, CloudIcon, BeakerIcon, GlobeAltIcon, BellAlertIcon, PencilIcon, ArrowUpCircleIcon, PencilSquareIcon } from '@heroicons/react/24/outline';
|
|
22
22
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
23
23
|
|
|
24
24
|
function AgentsModelsPageView({ labels, models, loading }) {
|
|
@@ -1786,20 +1786,20 @@ function DatasourcesPageView({
|
|
|
1786
1786
|
title: ds.name ?? ds.id,
|
|
1787
1787
|
subtitle: dialectLabel,
|
|
1788
1788
|
status: /* @__PURE__ */ jsx(Badge, { color: ds.enabled ? "emerald" : "zinc", children: ds.enabled ? labels.enabled : labels.disabled }),
|
|
1789
|
-
footer: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-
|
|
1789
|
+
footer: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-slate-400 dark:text-slate-500", children: [
|
|
1790
1790
|
ds.readOnly && /* @__PURE__ */ jsx("span", { className: "rounded-full bg-blue-100 px-2 py-0.5 text-[10px] font-semibold text-blue-700 dark:bg-blue-900/30 dark:text-blue-300", children: "Read-only" }),
|
|
1791
1791
|
ds.timeoutMs && /* @__PURE__ */ jsxs("span", { children: [
|
|
1792
1792
|
ds.timeoutMs / 1e3,
|
|
1793
1793
|
"s timeout"
|
|
1794
1794
|
] })
|
|
1795
1795
|
] }),
|
|
1796
|
-
children: /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-
|
|
1796
|
+
children: /* @__PURE__ */ jsxs("div", { className: "mt-2 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
1797
1797
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1798
1798
|
labels.dialect,
|
|
1799
1799
|
": ",
|
|
1800
1800
|
dialectLabel
|
|
1801
1801
|
] }),
|
|
1802
|
-
ds.slug && /* @__PURE__ */ jsxs("div", { className: "truncate text-
|
|
1802
|
+
ds.slug && /* @__PURE__ */ jsxs("div", { className: "truncate text-slate-400", children: [
|
|
1803
1803
|
"/",
|
|
1804
1804
|
ds.slug
|
|
1805
1805
|
] })
|
|
@@ -3664,7 +3664,6 @@ function AgentNewWizardPageView({
|
|
|
3664
3664
|
setSubmitting(false);
|
|
3665
3665
|
}
|
|
3666
3666
|
}
|
|
3667
|
-
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS));
|
|
3668
3667
|
const hero = /* @__PURE__ */ jsx(
|
|
3669
3668
|
HeroSection,
|
|
3670
3669
|
{
|
|
@@ -3676,10 +3675,19 @@ function AgentNewWizardPageView({
|
|
|
3676
3675
|
children: emoji
|
|
3677
3676
|
}
|
|
3678
3677
|
),
|
|
3679
|
-
label:
|
|
3680
|
-
title:
|
|
3678
|
+
label: labels.pageTitle,
|
|
3679
|
+
title: stepTitles[step - 1],
|
|
3681
3680
|
subtitle: stepSubtitles[step - 1],
|
|
3682
3681
|
gradient: activePreset.accent,
|
|
3682
|
+
actions: /* @__PURE__ */ jsx(
|
|
3683
|
+
IconButton,
|
|
3684
|
+
{
|
|
3685
|
+
label: labels.wizardCancel,
|
|
3686
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
3687
|
+
variant: "ghost",
|
|
3688
|
+
onClick: cancelWithConfirm
|
|
3689
|
+
}
|
|
3690
|
+
),
|
|
3683
3691
|
children: /* @__PURE__ */ jsx(
|
|
3684
3692
|
StepIndicator,
|
|
3685
3693
|
{
|
|
@@ -3694,432 +3702,326 @@ function AgentNewWizardPageView({
|
|
|
3694
3702
|
);
|
|
3695
3703
|
function renderStep1() {
|
|
3696
3704
|
return /* @__PURE__ */ jsx(
|
|
3697
|
-
|
|
3705
|
+
"div",
|
|
3698
3706
|
{
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
icon: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-base leading-none", children: preset.emoji }),
|
|
3718
|
-
label: preset.id === "custom" ? labels.presetCustom : preset.name,
|
|
3719
|
-
count: preset.role || labels.presetCustomHint,
|
|
3720
|
-
onClick: () => applyPreset(preset)
|
|
3721
|
-
},
|
|
3722
|
-
preset.id
|
|
3723
|
-
);
|
|
3724
|
-
})
|
|
3725
|
-
}
|
|
3726
|
-
)
|
|
3707
|
+
role: "radiogroup",
|
|
3708
|
+
"aria-label": labels.presetTitle,
|
|
3709
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
3710
|
+
children: AGENT_PRESETS.map((preset) => {
|
|
3711
|
+
const selected = preset.id === presetId;
|
|
3712
|
+
return /* @__PURE__ */ jsx(
|
|
3713
|
+
FilterTileButton,
|
|
3714
|
+
{
|
|
3715
|
+
isActive: selected,
|
|
3716
|
+
color: preset.tileColor,
|
|
3717
|
+
icon: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-base leading-none", children: preset.emoji }),
|
|
3718
|
+
label: preset.id === "custom" ? labels.presetCustom : preset.name,
|
|
3719
|
+
count: preset.role || labels.presetCustomHint,
|
|
3720
|
+
onClick: () => applyPreset(preset)
|
|
3721
|
+
},
|
|
3722
|
+
preset.id
|
|
3723
|
+
);
|
|
3724
|
+
})
|
|
3727
3725
|
}
|
|
3728
3726
|
);
|
|
3729
3727
|
}
|
|
3730
3728
|
function renderStep2() {
|
|
3731
|
-
return /* @__PURE__ */
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
"
|
|
3744
|
-
{
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
)
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
onValueChange: (v) => {
|
|
3793
|
-
setDescription(v);
|
|
3794
|
-
markTouched();
|
|
3795
|
-
},
|
|
3796
|
-
rows: 3,
|
|
3797
|
-
placeholder: labels.descriptionPlaceholder
|
|
3798
|
-
}
|
|
3799
|
-
)
|
|
3800
|
-
] })
|
|
3801
|
-
}
|
|
3802
|
-
);
|
|
3729
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
3730
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3731
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.avatarLabel }),
|
|
3732
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: EMOJI_PALETTE.map((e) => /* @__PURE__ */ jsx(
|
|
3733
|
+
PickerTile,
|
|
3734
|
+
{
|
|
3735
|
+
onClick: () => {
|
|
3736
|
+
setEmoji(e);
|
|
3737
|
+
markTouched();
|
|
3738
|
+
},
|
|
3739
|
+
selected: emoji === e,
|
|
3740
|
+
className: [
|
|
3741
|
+
"flex h-9 w-9 items-center justify-center rounded-lg text-base transition-all",
|
|
3742
|
+
emoji === e ? `bg-gradient-to-br ${activePreset.accent} shadow-sm ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent` : "liquid-surface hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
|
|
3743
|
+
].join(" "),
|
|
3744
|
+
children: e
|
|
3745
|
+
},
|
|
3746
|
+
e
|
|
3747
|
+
)) })
|
|
3748
|
+
] }),
|
|
3749
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
3750
|
+
/* @__PURE__ */ jsx(
|
|
3751
|
+
FormInput,
|
|
3752
|
+
{
|
|
3753
|
+
label: labels.name,
|
|
3754
|
+
value: name,
|
|
3755
|
+
onValueChange: (v) => {
|
|
3756
|
+
setName(v);
|
|
3757
|
+
markTouched();
|
|
3758
|
+
},
|
|
3759
|
+
required: true,
|
|
3760
|
+
placeholder: labels.namePlaceholder
|
|
3761
|
+
}
|
|
3762
|
+
),
|
|
3763
|
+
/* @__PURE__ */ jsx(
|
|
3764
|
+
FormInput,
|
|
3765
|
+
{
|
|
3766
|
+
label: labels.role,
|
|
3767
|
+
value: role,
|
|
3768
|
+
onValueChange: (v) => {
|
|
3769
|
+
setRole(v);
|
|
3770
|
+
markTouched();
|
|
3771
|
+
},
|
|
3772
|
+
placeholder: labels.rolePlaceholder
|
|
3773
|
+
}
|
|
3774
|
+
)
|
|
3775
|
+
] }),
|
|
3776
|
+
/* @__PURE__ */ jsx(
|
|
3777
|
+
FormTextarea,
|
|
3778
|
+
{
|
|
3779
|
+
label: labels.descriptionLabel,
|
|
3780
|
+
value: description,
|
|
3781
|
+
onValueChange: (v) => {
|
|
3782
|
+
setDescription(v);
|
|
3783
|
+
markTouched();
|
|
3784
|
+
},
|
|
3785
|
+
rows: 3,
|
|
3786
|
+
placeholder: labels.descriptionPlaceholder
|
|
3787
|
+
}
|
|
3788
|
+
)
|
|
3789
|
+
] });
|
|
3803
3790
|
}
|
|
3804
3791
|
function renderStep3() {
|
|
3805
|
-
return /* @__PURE__ */
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
)
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
setOutputSchema(v);
|
|
3860
|
-
markTouched();
|
|
3861
|
-
},
|
|
3862
|
-
rows: 5,
|
|
3863
|
-
placeholder: labels.outputSchemaPlaceholder
|
|
3864
|
-
}
|
|
3865
|
-
)
|
|
3866
|
-
] })
|
|
3867
|
-
}
|
|
3868
|
-
);
|
|
3792
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
3793
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
3794
|
+
/* @__PURE__ */ jsx(
|
|
3795
|
+
FormSelect,
|
|
3796
|
+
{
|
|
3797
|
+
label: labels.connectionLabel,
|
|
3798
|
+
value: connectionId,
|
|
3799
|
+
onValueChange: (v) => {
|
|
3800
|
+
setConnectionId(v);
|
|
3801
|
+
markTouched();
|
|
3802
|
+
},
|
|
3803
|
+
options: connectionOptions,
|
|
3804
|
+
icon: /* @__PURE__ */ jsx(LinkIcon, { className: "h-4 w-4" })
|
|
3805
|
+
}
|
|
3806
|
+
),
|
|
3807
|
+
/* @__PURE__ */ jsx(
|
|
3808
|
+
FormSelect,
|
|
3809
|
+
{
|
|
3810
|
+
label: labels.frameworkLabel,
|
|
3811
|
+
value: framework,
|
|
3812
|
+
onValueChange: (v) => {
|
|
3813
|
+
setFramework(v);
|
|
3814
|
+
markTouched();
|
|
3815
|
+
},
|
|
3816
|
+
options: frameworkOptions
|
|
3817
|
+
}
|
|
3818
|
+
),
|
|
3819
|
+
/* @__PURE__ */ jsx(
|
|
3820
|
+
FormSelect,
|
|
3821
|
+
{
|
|
3822
|
+
label: labels.model,
|
|
3823
|
+
value: modelId,
|
|
3824
|
+
onValueChange: (v) => {
|
|
3825
|
+
setModelId(v);
|
|
3826
|
+
markTouched();
|
|
3827
|
+
},
|
|
3828
|
+
options: modelOptions.length > 0 ? modelOptions : [{ value: "", label: labels.modelEmpty }]
|
|
3829
|
+
}
|
|
3830
|
+
)
|
|
3831
|
+
] }),
|
|
3832
|
+
/* @__PURE__ */ jsx(
|
|
3833
|
+
FormTextarea,
|
|
3834
|
+
{
|
|
3835
|
+
label: labels.outputSchemaLabel,
|
|
3836
|
+
value: outputSchema,
|
|
3837
|
+
onValueChange: (v) => {
|
|
3838
|
+
setOutputSchema(v);
|
|
3839
|
+
markTouched();
|
|
3840
|
+
},
|
|
3841
|
+
rows: 5,
|
|
3842
|
+
placeholder: labels.outputSchemaPlaceholder
|
|
3843
|
+
}
|
|
3844
|
+
)
|
|
3845
|
+
] });
|
|
3869
3846
|
}
|
|
3870
3847
|
function renderStep4() {
|
|
3871
3848
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
3872
3849
|
/* @__PURE__ */ jsx(
|
|
3873
|
-
|
|
3850
|
+
FormTextarea,
|
|
3874
3851
|
{
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3852
|
+
label: labels.promptSystemPrompt,
|
|
3853
|
+
value: systemPrompt,
|
|
3854
|
+
onValueChange: (v) => {
|
|
3855
|
+
setSystemPrompt(v);
|
|
3856
|
+
markTouched();
|
|
3879
3857
|
},
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "wizard-system-prompt", className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.promptSystemPrompt }),
|
|
3884
|
-
/* @__PURE__ */ jsxs("span", { className: "text-[10px] text-slate-400 dark:text-slate-500", children: [
|
|
3885
|
-
systemPrompt.length,
|
|
3886
|
-
" chars"
|
|
3887
|
-
] })
|
|
3888
|
-
] }),
|
|
3889
|
-
/* @__PURE__ */ jsx(
|
|
3890
|
-
"textarea",
|
|
3891
|
-
{
|
|
3892
|
-
id: "wizard-system-prompt",
|
|
3893
|
-
value: systemPrompt,
|
|
3894
|
-
onChange: (e) => {
|
|
3895
|
-
setSystemPrompt(e.target.value);
|
|
3896
|
-
markTouched();
|
|
3897
|
-
},
|
|
3898
|
-
rows: 8,
|
|
3899
|
-
className: "w-full resize-y rounded-lg bg-white/40 dark:bg-white/[0.04] backdrop-blur-sm border border-slate-200/50 dark:border-white/10 px-3 py-2.5 font-mono text-xs leading-relaxed text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:ring-indigo-500/70 focus:ring-offset-1 motion-reduce:transition-none dark:text-slate-300 dark:placeholder:text-slate-500",
|
|
3900
|
-
placeholder: labels.promptPlaceholder
|
|
3901
|
-
}
|
|
3902
|
-
)
|
|
3903
|
-
] }),
|
|
3904
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3905
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-1 flex items-center justify-between", children: [
|
|
3906
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "wizard-user-prompt", className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.userPromptLabel }),
|
|
3907
|
-
/* @__PURE__ */ jsxs("span", { className: "text-[10px] text-slate-400 dark:text-slate-500", children: [
|
|
3908
|
-
userPrompt.length,
|
|
3909
|
-
" chars"
|
|
3910
|
-
] })
|
|
3911
|
-
] }),
|
|
3912
|
-
/* @__PURE__ */ jsx(
|
|
3913
|
-
"textarea",
|
|
3914
|
-
{
|
|
3915
|
-
id: "wizard-user-prompt",
|
|
3916
|
-
value: userPrompt,
|
|
3917
|
-
onChange: (e) => {
|
|
3918
|
-
setUserPrompt(e.target.value);
|
|
3919
|
-
markTouched();
|
|
3920
|
-
},
|
|
3921
|
-
rows: 5,
|
|
3922
|
-
className: "w-full resize-y rounded-lg bg-white/40 dark:bg-white/[0.04] backdrop-blur-sm border border-slate-200/50 dark:border-white/10 px-3 py-2.5 font-mono text-xs leading-relaxed text-slate-700 outline-none transition-colors placeholder:text-slate-400 focus:ring-indigo-500/70 focus:ring-offset-1 motion-reduce:transition-none dark:text-slate-300 dark:placeholder:text-slate-500",
|
|
3923
|
-
placeholder: labels.userPromptPlaceholder
|
|
3924
|
-
}
|
|
3925
|
-
)
|
|
3926
|
-
] }),
|
|
3927
|
-
/* @__PURE__ */ jsx(
|
|
3928
|
-
RangeSliderField,
|
|
3929
|
-
{
|
|
3930
|
-
sliderId: "wizard-temperature",
|
|
3931
|
-
label: labels.temperature,
|
|
3932
|
-
value: temperature,
|
|
3933
|
-
onChange: (v) => {
|
|
3934
|
-
setTemperature(v);
|
|
3935
|
-
markTouched();
|
|
3936
|
-
},
|
|
3937
|
-
min: 0,
|
|
3938
|
-
max: 1,
|
|
3939
|
-
step: 0.05,
|
|
3940
|
-
trackGradient: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)",
|
|
3941
|
-
formatValue: (v) => v.toFixed(2),
|
|
3942
|
-
zones: [
|
|
3943
|
-
{ label: "Precise", max: 0.3, color: "text-blue-500", thumbColor: "#3b82f6" },
|
|
3944
|
-
{ label: "Balanced", max: 0.7, color: "text-purple-500", thumbColor: "#8b5cf6" },
|
|
3945
|
-
{ label: "Creative", max: 1, color: "text-pink-500", thumbColor: "#ec4899" }
|
|
3946
|
-
]
|
|
3947
|
-
}
|
|
3948
|
-
),
|
|
3949
|
-
/* @__PURE__ */ jsx(
|
|
3950
|
-
RangeSliderField,
|
|
3951
|
-
{
|
|
3952
|
-
sliderId: "wizard-top-p",
|
|
3953
|
-
label: labels.topPLabel,
|
|
3954
|
-
value: topP,
|
|
3955
|
-
onChange: (v) => {
|
|
3956
|
-
setTopP(v);
|
|
3957
|
-
markTouched();
|
|
3958
|
-
},
|
|
3959
|
-
min: 0,
|
|
3960
|
-
max: 1,
|
|
3961
|
-
step: 0.05,
|
|
3962
|
-
trackGradient: "linear-gradient(90deg, #6366f1, #8b5cf6)",
|
|
3963
|
-
formatValue: (v) => v.toFixed(2),
|
|
3964
|
-
zones: [
|
|
3965
|
-
{ label: "Top-P", max: 1, color: "text-violet-500", thumbColor: "#8b5cf6" }
|
|
3966
|
-
]
|
|
3967
|
-
}
|
|
3968
|
-
),
|
|
3969
|
-
/* @__PURE__ */ jsx(
|
|
3970
|
-
RangeSliderField,
|
|
3971
|
-
{
|
|
3972
|
-
sliderId: "wizard-top-k",
|
|
3973
|
-
label: labels.topKLabel,
|
|
3974
|
-
value: topK,
|
|
3975
|
-
onChange: (v) => {
|
|
3976
|
-
setTopK(Math.max(0, Math.floor(v)));
|
|
3977
|
-
markTouched();
|
|
3978
|
-
},
|
|
3979
|
-
min: 0,
|
|
3980
|
-
max: 500,
|
|
3981
|
-
step: 1,
|
|
3982
|
-
trackGradient: "linear-gradient(90deg, #10b981, #14b8a6)",
|
|
3983
|
-
formatValue: (v) => v.toString(),
|
|
3984
|
-
zones: [
|
|
3985
|
-
{ label: "Top-K", max: 500, color: "text-emerald-500", thumbColor: "#10b981" }
|
|
3986
|
-
]
|
|
3987
|
-
}
|
|
3988
|
-
),
|
|
3989
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3990
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
3991
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "wizard-max-tokens", className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.maxTokens }),
|
|
3992
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-bold tabular-nums text-slate-900 dark:text-white", children: maxTokens.toLocaleString() })
|
|
3993
|
-
] }),
|
|
3994
|
-
/* @__PURE__ */ jsx(
|
|
3995
|
-
"input",
|
|
3996
|
-
{
|
|
3997
|
-
id: "wizard-max-tokens",
|
|
3998
|
-
type: "number",
|
|
3999
|
-
value: maxTokens,
|
|
4000
|
-
onChange: (e) => {
|
|
4001
|
-
setMaxTokens(Math.max(1, Math.floor(Number(e.target.value) || 0)));
|
|
4002
|
-
markTouched();
|
|
4003
|
-
},
|
|
4004
|
-
min: 1,
|
|
4005
|
-
max: 32e3,
|
|
4006
|
-
step: 1,
|
|
4007
|
-
className: "w-full rounded-lg bg-white/40 dark:bg-white/[0.04] backdrop-blur-sm border border-slate-200/50 dark:border-white/10 px-3 py-2.5 text-sm tabular-nums text-slate-700 outline-none transition-colors focus:ring-indigo-500/70 focus:ring-offset-1 motion-reduce:transition-none dark:text-slate-300"
|
|
4008
|
-
}
|
|
4009
|
-
)
|
|
4010
|
-
] }),
|
|
4011
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-lg border border-slate-200/30 dark:border-white/10", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-px bg-slate-200/30 dark:bg-white/10", children: [
|
|
4012
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
|
|
4013
|
-
/* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.model }),
|
|
4014
|
-
/* @__PURE__ */ jsx("p", { className: "truncate text-xs font-semibold text-slate-900 dark:text-white", children: matchingModels.find((m) => m.id === modelId)?.name ?? labels.modelEmpty })
|
|
4015
|
-
] }),
|
|
4016
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
|
|
4017
|
-
/* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.maxTokens }),
|
|
4018
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-slate-900 dark:text-white", children: maxTokens.toLocaleString() })
|
|
4019
|
-
] }),
|
|
4020
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-white/60 px-3 py-2 dark:bg-slate-900/60", children: [
|
|
4021
|
-
/* @__PURE__ */ jsx("p", { className: "text-[9px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: labels.temperature }),
|
|
4022
|
-
/* @__PURE__ */ jsxs("p", { className: `text-xs font-semibold ${temperature <= 0.3 ? "text-blue-500" : temperature <= 0.7 ? "text-purple-500" : "text-pink-500"}`, children: [
|
|
4023
|
-
temperature.toFixed(2),
|
|
4024
|
-
" \xB7 ",
|
|
4025
|
-
temperature <= 0.3 ? "Precise" : temperature <= 0.7 ? "Balanced" : "Creative"
|
|
4026
|
-
] })
|
|
4027
|
-
] })
|
|
4028
|
-
] }) })
|
|
4029
|
-
] })
|
|
3858
|
+
rows: 6,
|
|
3859
|
+
placeholder: labels.promptPlaceholder,
|
|
3860
|
+
hint: `${systemPrompt.length} chars`
|
|
4030
3861
|
}
|
|
4031
3862
|
),
|
|
4032
3863
|
/* @__PURE__ */ jsx(
|
|
4033
|
-
|
|
3864
|
+
FormTextarea,
|
|
4034
3865
|
{
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
3866
|
+
label: labels.userPromptLabel,
|
|
3867
|
+
value: userPrompt,
|
|
3868
|
+
onValueChange: (v) => {
|
|
3869
|
+
setUserPrompt(v);
|
|
3870
|
+
markTouched();
|
|
4039
3871
|
},
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: DIFFICULTY_OPTIONS.map((opt) => {
|
|
4044
|
-
const selected = difficulty === opt.id;
|
|
4045
|
-
const label = opt.id === "beginner" ? labels.difficultyBeginner : opt.id === "intermediate" ? labels.difficultyIntermediate : opt.id === "advanced" ? labels.difficultyAdvanced : labels.difficultyExpert;
|
|
4046
|
-
return /* @__PURE__ */ jsxs(
|
|
4047
|
-
"button",
|
|
4048
|
-
{
|
|
4049
|
-
type: "button",
|
|
4050
|
-
onClick: () => {
|
|
4051
|
-
setDifficulty(opt.id);
|
|
4052
|
-
markTouched();
|
|
4053
|
-
},
|
|
4054
|
-
"aria-pressed": selected,
|
|
4055
|
-
className: [
|
|
4056
|
-
"liquid-surface flex items-center gap-2 rounded-xl px-3 py-2 text-left transition-all",
|
|
4057
|
-
selected ? "ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent" : "hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
|
|
4058
|
-
].join(" "),
|
|
4059
|
-
children: [
|
|
4060
|
-
/* @__PURE__ */ jsx(
|
|
4061
|
-
"span",
|
|
4062
|
-
{
|
|
4063
|
-
"aria-hidden": "true",
|
|
4064
|
-
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${opt.accent} text-base shadow-sm`,
|
|
4065
|
-
children: opt.emoji
|
|
4066
|
-
}
|
|
4067
|
-
),
|
|
4068
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-900 dark:text-white", children: label })
|
|
4069
|
-
]
|
|
4070
|
-
},
|
|
4071
|
-
opt.id
|
|
4072
|
-
);
|
|
4073
|
-
}) })
|
|
4074
|
-
] }),
|
|
4075
|
-
/* @__PURE__ */ jsx(
|
|
4076
|
-
FormInput,
|
|
4077
|
-
{
|
|
4078
|
-
label: labels.tagsLabel,
|
|
4079
|
-
value: tagsInput,
|
|
4080
|
-
onValueChange: (v) => {
|
|
4081
|
-
setTagsInput(v);
|
|
4082
|
-
markTouched();
|
|
4083
|
-
},
|
|
4084
|
-
placeholder: labels.tagsPlaceholder
|
|
4085
|
-
}
|
|
4086
|
-
)
|
|
4087
|
-
] })
|
|
3872
|
+
rows: 4,
|
|
3873
|
+
placeholder: labels.userPromptPlaceholder,
|
|
3874
|
+
hint: `${userPrompt.length} chars`
|
|
4088
3875
|
}
|
|
4089
|
-
)
|
|
3876
|
+
),
|
|
3877
|
+
/* @__PURE__ */ jsx(
|
|
3878
|
+
RangeSliderField,
|
|
3879
|
+
{
|
|
3880
|
+
sliderId: "wizard-temperature",
|
|
3881
|
+
label: labels.temperature,
|
|
3882
|
+
value: temperature,
|
|
3883
|
+
onChange: (v) => {
|
|
3884
|
+
setTemperature(v);
|
|
3885
|
+
markTouched();
|
|
3886
|
+
},
|
|
3887
|
+
min: 0,
|
|
3888
|
+
max: 1,
|
|
3889
|
+
step: 0.05,
|
|
3890
|
+
trackGradient: "linear-gradient(90deg, #3b82f6, #8b5cf6 50%, #ec4899)",
|
|
3891
|
+
formatValue: (v) => v.toFixed(2),
|
|
3892
|
+
zones: [
|
|
3893
|
+
{ label: "Precise", max: 0.3, color: "text-blue-500", thumbColor: "#3b82f6" },
|
|
3894
|
+
{ label: "Balanced", max: 0.7, color: "text-purple-500", thumbColor: "#8b5cf6" },
|
|
3895
|
+
{ label: "Creative", max: 1, color: "text-pink-500", thumbColor: "#ec4899" }
|
|
3896
|
+
]
|
|
3897
|
+
}
|
|
3898
|
+
),
|
|
3899
|
+
/* @__PURE__ */ jsx(
|
|
3900
|
+
RangeSliderField,
|
|
3901
|
+
{
|
|
3902
|
+
sliderId: "wizard-top-p",
|
|
3903
|
+
label: labels.topPLabel,
|
|
3904
|
+
value: topP,
|
|
3905
|
+
onChange: (v) => {
|
|
3906
|
+
setTopP(v);
|
|
3907
|
+
markTouched();
|
|
3908
|
+
},
|
|
3909
|
+
min: 0,
|
|
3910
|
+
max: 1,
|
|
3911
|
+
step: 0.05,
|
|
3912
|
+
trackGradient: "linear-gradient(90deg, #6366f1, #8b5cf6)",
|
|
3913
|
+
formatValue: (v) => v.toFixed(2),
|
|
3914
|
+
zones: [
|
|
3915
|
+
{ label: "Top-P", max: 1, color: "text-violet-500", thumbColor: "#8b5cf6" }
|
|
3916
|
+
]
|
|
3917
|
+
}
|
|
3918
|
+
),
|
|
3919
|
+
/* @__PURE__ */ jsx(
|
|
3920
|
+
RangeSliderField,
|
|
3921
|
+
{
|
|
3922
|
+
sliderId: "wizard-top-k",
|
|
3923
|
+
label: labels.topKLabel,
|
|
3924
|
+
value: topK,
|
|
3925
|
+
onChange: (v) => {
|
|
3926
|
+
setTopK(Math.max(0, Math.floor(v)));
|
|
3927
|
+
markTouched();
|
|
3928
|
+
},
|
|
3929
|
+
min: 0,
|
|
3930
|
+
max: 500,
|
|
3931
|
+
step: 1,
|
|
3932
|
+
trackGradient: "linear-gradient(90deg, #10b981, #14b8a6)",
|
|
3933
|
+
formatValue: (v) => v.toString(),
|
|
3934
|
+
zones: [
|
|
3935
|
+
{ label: "Top-K", max: 500, color: "text-emerald-500", thumbColor: "#10b981" }
|
|
3936
|
+
]
|
|
3937
|
+
}
|
|
3938
|
+
),
|
|
3939
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
3940
|
+
/* @__PURE__ */ jsx(
|
|
3941
|
+
FormInput,
|
|
3942
|
+
{
|
|
3943
|
+
label: labels.maxTokens,
|
|
3944
|
+
type: "number",
|
|
3945
|
+
value: String(maxTokens),
|
|
3946
|
+
onValueChange: (v) => {
|
|
3947
|
+
setMaxTokens(Math.max(1, Math.floor(Number(v) || 0)));
|
|
3948
|
+
markTouched();
|
|
3949
|
+
},
|
|
3950
|
+
min: 1,
|
|
3951
|
+
max: 32e3,
|
|
3952
|
+
step: 1,
|
|
3953
|
+
hint: maxTokens.toLocaleString()
|
|
3954
|
+
}
|
|
3955
|
+
),
|
|
3956
|
+
/* @__PURE__ */ jsx(
|
|
3957
|
+
FormInput,
|
|
3958
|
+
{
|
|
3959
|
+
label: labels.tagsLabel,
|
|
3960
|
+
value: tagsInput,
|
|
3961
|
+
onValueChange: (v) => {
|
|
3962
|
+
setTagsInput(v);
|
|
3963
|
+
markTouched();
|
|
3964
|
+
},
|
|
3965
|
+
placeholder: labels.tagsPlaceholder
|
|
3966
|
+
}
|
|
3967
|
+
)
|
|
3968
|
+
] }),
|
|
3969
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3970
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.difficultyLabel }),
|
|
3971
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: DIFFICULTY_OPTIONS.map((opt) => {
|
|
3972
|
+
const selected = difficulty === opt.id;
|
|
3973
|
+
const label = opt.id === "beginner" ? labels.difficultyBeginner : opt.id === "intermediate" ? labels.difficultyIntermediate : opt.id === "advanced" ? labels.difficultyAdvanced : labels.difficultyExpert;
|
|
3974
|
+
return /* @__PURE__ */ jsxs(
|
|
3975
|
+
PickerTile,
|
|
3976
|
+
{
|
|
3977
|
+
onClick: () => {
|
|
3978
|
+
setDifficulty(opt.id);
|
|
3979
|
+
markTouched();
|
|
3980
|
+
},
|
|
3981
|
+
selected,
|
|
3982
|
+
className: [
|
|
3983
|
+
"liquid-surface flex items-center gap-2 rounded-xl px-3 py-2 text-left transition-all",
|
|
3984
|
+
selected ? "ring-2 ring-indigo-500/70 ring-offset-1 ring-offset-transparent" : "hover:border-indigo-400/40 focus-visible:ring-2 focus-visible:ring-indigo-500/70 focus-visible:ring-offset-1"
|
|
3985
|
+
].join(" "),
|
|
3986
|
+
children: [
|
|
3987
|
+
/* @__PURE__ */ jsx(
|
|
3988
|
+
"span",
|
|
3989
|
+
{
|
|
3990
|
+
"aria-hidden": "true",
|
|
3991
|
+
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br ${opt.accent} text-base shadow-sm`,
|
|
3992
|
+
children: opt.emoji
|
|
3993
|
+
}
|
|
3994
|
+
),
|
|
3995
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-900 dark:text-white", children: label })
|
|
3996
|
+
]
|
|
3997
|
+
},
|
|
3998
|
+
opt.id
|
|
3999
|
+
);
|
|
4000
|
+
}) })
|
|
4001
|
+
] })
|
|
4090
4002
|
] });
|
|
4091
4003
|
}
|
|
4092
4004
|
function renderStep5() {
|
|
4093
4005
|
const modelLabel = models.find((m) => m.id === modelId)?.name ?? labels.modelEmpty;
|
|
4094
4006
|
const connectionLabel = connectionId ? connections.find((c) => c.id === connectionId)?.name ?? labels.connectionInline : labels.connectionInline;
|
|
4095
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-
|
|
4007
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
4096
4008
|
/* @__PURE__ */ jsx(
|
|
4097
|
-
|
|
4009
|
+
ReviewBlock,
|
|
4098
4010
|
{
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
},
|
|
4104
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
4105
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4106
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4107
|
-
] }),
|
|
4011
|
+
stepTitle: labels.wizardStep1Title,
|
|
4012
|
+
stepSubtitle: labels.wizardStep1Subtitle,
|
|
4013
|
+
editLabel: labels.wizardReviewEdit,
|
|
4014
|
+
onEdit: () => goToStep(1),
|
|
4108
4015
|
children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: presetId === "custom" ? labels.presetCustom : AGENT_PRESETS.find((p) => p.id === presetId)?.name ?? labels.presetCustom })
|
|
4109
4016
|
}
|
|
4110
4017
|
),
|
|
4111
4018
|
/* @__PURE__ */ jsx(
|
|
4112
|
-
|
|
4113
|
-
{
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
},
|
|
4119
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
4120
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4121
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4122
|
-
] }),
|
|
4019
|
+
ReviewBlock,
|
|
4020
|
+
{
|
|
4021
|
+
stepTitle: labels.wizardStep2Title,
|
|
4022
|
+
stepSubtitle: labels.wizardStep2Subtitle,
|
|
4023
|
+
editLabel: labels.wizardReviewEdit,
|
|
4024
|
+
onEdit: () => goToStep(2),
|
|
4123
4025
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
4124
4026
|
/* @__PURE__ */ jsx(
|
|
4125
4027
|
"span",
|
|
@@ -4138,17 +4040,12 @@ function AgentNewWizardPageView({
|
|
|
4138
4040
|
}
|
|
4139
4041
|
),
|
|
4140
4042
|
/* @__PURE__ */ jsx(
|
|
4141
|
-
|
|
4043
|
+
ReviewBlock,
|
|
4142
4044
|
{
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
},
|
|
4148
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
4149
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4150
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4151
|
-
] }),
|
|
4045
|
+
stepTitle: labels.wizardStep3Title,
|
|
4046
|
+
stepSubtitle: labels.wizardStep3Subtitle,
|
|
4047
|
+
editLabel: labels.wizardReviewEdit,
|
|
4048
|
+
onEdit: () => goToStep(3),
|
|
4152
4049
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4153
4050
|
/* @__PURE__ */ jsx(ReviewRow, { label: labels.connectionLabel, value: connectionLabel }),
|
|
4154
4051
|
/* @__PURE__ */ jsx(ReviewRow, { label: labels.frameworkLabel, value: framework || "\u2014" }),
|
|
@@ -4158,17 +4055,12 @@ function AgentNewWizardPageView({
|
|
|
4158
4055
|
}
|
|
4159
4056
|
),
|
|
4160
4057
|
/* @__PURE__ */ jsxs(
|
|
4161
|
-
|
|
4058
|
+
ReviewBlock,
|
|
4162
4059
|
{
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
},
|
|
4168
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(4), children: [
|
|
4169
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4170
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4171
|
-
] }),
|
|
4060
|
+
stepTitle: labels.wizardStep4Title,
|
|
4061
|
+
stepSubtitle: labels.wizardStep4Subtitle,
|
|
4062
|
+
editLabel: labels.wizardReviewEdit,
|
|
4063
|
+
onEdit: () => goToStep(4),
|
|
4172
4064
|
children: [
|
|
4173
4065
|
/* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-2 gap-2 sm:grid-cols-4", children: [
|
|
4174
4066
|
/* @__PURE__ */ jsx(ReviewRow, { label: labels.temperature, value: temperature.toFixed(2) }),
|
|
@@ -4187,14 +4079,14 @@ function AgentNewWizardPageView({
|
|
|
4187
4079
|
}
|
|
4188
4080
|
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
|
|
4189
4081
|
const advanceDisabled = !canAdvance(step);
|
|
4190
|
-
const
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4082
|
+
const isLast = step === TOTAL_STEPS;
|
|
4083
|
+
const scrollableStep = step === 4 || step === 5;
|
|
4084
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
4085
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
4086
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
4087
|
+
isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
4196
4088
|
] });
|
|
4197
|
-
|
|
4089
|
+
return /* @__PURE__ */ jsxs(
|
|
4198
4090
|
"form",
|
|
4199
4091
|
{
|
|
4200
4092
|
onSubmit: (e) => {
|
|
@@ -4204,15 +4096,12 @@ function AgentNewWizardPageView({
|
|
|
4204
4096
|
},
|
|
4205
4097
|
className: "space-y-4",
|
|
4206
4098
|
children: [
|
|
4207
|
-
|
|
4099
|
+
hero,
|
|
4100
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
4208
4101
|
footer
|
|
4209
4102
|
]
|
|
4210
4103
|
}
|
|
4211
4104
|
);
|
|
4212
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4213
|
-
hero,
|
|
4214
|
-
content
|
|
4215
|
-
] });
|
|
4216
4105
|
}
|
|
4217
4106
|
function ReviewRow({ label, value }) {
|
|
4218
4107
|
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: [
|
|
@@ -4220,6 +4109,27 @@ function ReviewRow({ label, value }) {
|
|
|
4220
4109
|
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
4221
4110
|
] });
|
|
4222
4111
|
}
|
|
4112
|
+
function ReviewBlock({
|
|
4113
|
+
stepTitle,
|
|
4114
|
+
stepSubtitle,
|
|
4115
|
+
editLabel,
|
|
4116
|
+
onEdit,
|
|
4117
|
+
children
|
|
4118
|
+
}) {
|
|
4119
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
4120
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
4121
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
4122
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
4123
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
4124
|
+
] }),
|
|
4125
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
4126
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4127
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
4128
|
+
] })
|
|
4129
|
+
] }),
|
|
4130
|
+
children
|
|
4131
|
+
] });
|
|
4132
|
+
}
|
|
4223
4133
|
var DIALECT_LOGO_SRC = {
|
|
4224
4134
|
bigquery: "/logos/datasources/bigquery.svg",
|
|
4225
4135
|
postgres: "/logos/datasources/postgres.svg",
|
|
@@ -4431,15 +4341,23 @@ function DatasourceNewWizardPageView({
|
|
|
4431
4341
|
id: String(idx + 1),
|
|
4432
4342
|
title
|
|
4433
4343
|
}));
|
|
4434
|
-
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS2));
|
|
4435
4344
|
const hero = /* @__PURE__ */ jsx(
|
|
4436
4345
|
HeroSection,
|
|
4437
4346
|
{
|
|
4438
4347
|
icon: /* @__PURE__ */ jsx(CircleStackIcon, { className: "h-5 w-5" }),
|
|
4439
|
-
label:
|
|
4440
|
-
title: labels.pageTitle,
|
|
4348
|
+
label: labels.pageTitle,
|
|
4349
|
+
title: stepTitles[step - 1] ?? labels.pageTitle,
|
|
4441
4350
|
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
4442
4351
|
gradient: category?.gradient ?? "from-amber-500 to-orange-600",
|
|
4352
|
+
actions: /* @__PURE__ */ jsx(
|
|
4353
|
+
IconButton,
|
|
4354
|
+
{
|
|
4355
|
+
label: labels.wizardCancel,
|
|
4356
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
4357
|
+
variant: "ghost",
|
|
4358
|
+
onClick: cancelWithConfirm
|
|
4359
|
+
}
|
|
4360
|
+
),
|
|
4443
4361
|
children: /* @__PURE__ */ jsx(
|
|
4444
4362
|
StepIndicator,
|
|
4445
4363
|
{
|
|
@@ -4453,48 +4371,42 @@ function DatasourceNewWizardPageView({
|
|
|
4453
4371
|
}
|
|
4454
4372
|
);
|
|
4455
4373
|
function renderStep1() {
|
|
4456
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-
|
|
4374
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-5", children: DIALECT_CATEGORIES.map((cat) => {
|
|
4457
4375
|
const color = CATEGORY_COLOR[cat.id] ?? "slate";
|
|
4458
4376
|
const categoryLabel = labels[cat.labelKey] ?? cat.id;
|
|
4459
|
-
return /* @__PURE__ */
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
"
|
|
4470
|
-
{
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
})
|
|
4493
|
-
}
|
|
4494
|
-
)
|
|
4495
|
-
},
|
|
4496
|
-
cat.id
|
|
4497
|
-
);
|
|
4377
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
4378
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: [
|
|
4379
|
+
/* @__PURE__ */ jsx(cat.icon, { className: "h-3.5 w-3.5" }),
|
|
4380
|
+
categoryLabel
|
|
4381
|
+
] }),
|
|
4382
|
+
/* @__PURE__ */ jsx(
|
|
4383
|
+
"div",
|
|
4384
|
+
{
|
|
4385
|
+
role: "radiogroup",
|
|
4386
|
+
"aria-label": categoryLabel,
|
|
4387
|
+
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
4388
|
+
children: cat.dialects.map((opt) => {
|
|
4389
|
+
const selected = opt.value === dialect;
|
|
4390
|
+
const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
|
|
4391
|
+
return /* @__PURE__ */ jsx(
|
|
4392
|
+
FilterTileButton,
|
|
4393
|
+
{
|
|
4394
|
+
isActive: selected,
|
|
4395
|
+
color,
|
|
4396
|
+
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" }),
|
|
4397
|
+
label: opt.label,
|
|
4398
|
+
count: opt.formType.replace("-", " "),
|
|
4399
|
+
onClick: () => {
|
|
4400
|
+
setDialect(opt.value);
|
|
4401
|
+
markTouched();
|
|
4402
|
+
}
|
|
4403
|
+
},
|
|
4404
|
+
opt.value
|
|
4405
|
+
);
|
|
4406
|
+
})
|
|
4407
|
+
}
|
|
4408
|
+
)
|
|
4409
|
+
] }, cat.id);
|
|
4498
4410
|
}) });
|
|
4499
4411
|
}
|
|
4500
4412
|
function renderConnectionFields() {
|
|
@@ -4801,207 +4713,180 @@ function DatasourceNewWizardPageView({
|
|
|
4801
4713
|
}
|
|
4802
4714
|
function renderStep2() {
|
|
4803
4715
|
if (!dialectOption) {
|
|
4804
|
-
return /* @__PURE__ */ jsxs(
|
|
4716
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
4805
4717
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: labels.wizardStep1Subtitle }),
|
|
4806
|
-
/* @__PURE__ */ jsx(
|
|
4718
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: () => goToStep(1), children: labels.wizardBack })
|
|
4807
4719
|
] });
|
|
4808
4720
|
}
|
|
4809
|
-
return /* @__PURE__ */
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4870
|
-
/* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
4871
|
-
labels.testing
|
|
4872
|
-
] }) : labels.testConnection
|
|
4873
|
-
}
|
|
4874
|
-
),
|
|
4875
|
-
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
4876
|
-
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
4877
|
-
] })
|
|
4878
|
-
] })
|
|
4879
|
-
}
|
|
4880
|
-
);
|
|
4721
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4722
|
+
/* @__PURE__ */ jsx(
|
|
4723
|
+
FormInput,
|
|
4724
|
+
{
|
|
4725
|
+
label: labels.fieldName,
|
|
4726
|
+
value: name,
|
|
4727
|
+
onValueChange: (v) => {
|
|
4728
|
+
setName(v);
|
|
4729
|
+
markTouched();
|
|
4730
|
+
},
|
|
4731
|
+
placeholder: labels.fieldNamePlaceholder,
|
|
4732
|
+
required: true
|
|
4733
|
+
}
|
|
4734
|
+
),
|
|
4735
|
+
/* @__PURE__ */ jsx(FormGrid, { children: renderConnectionFields() }),
|
|
4736
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-6 pt-1", children: [
|
|
4737
|
+
/* @__PURE__ */ jsx(
|
|
4738
|
+
FormToggle,
|
|
4739
|
+
{
|
|
4740
|
+
checked: ssl,
|
|
4741
|
+
onChange: (v) => {
|
|
4742
|
+
setSsl(v);
|
|
4743
|
+
markTouched();
|
|
4744
|
+
},
|
|
4745
|
+
label: labels.fieldSsl,
|
|
4746
|
+
variant: "inline"
|
|
4747
|
+
}
|
|
4748
|
+
),
|
|
4749
|
+
/* @__PURE__ */ jsx(
|
|
4750
|
+
FormToggle,
|
|
4751
|
+
{
|
|
4752
|
+
checked: readOnly,
|
|
4753
|
+
onChange: (v) => {
|
|
4754
|
+
setReadOnly(v);
|
|
4755
|
+
markTouched();
|
|
4756
|
+
},
|
|
4757
|
+
label: labels.fieldReadOnly,
|
|
4758
|
+
variant: "inline"
|
|
4759
|
+
}
|
|
4760
|
+
)
|
|
4761
|
+
] }),
|
|
4762
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: labels.fieldReadOnlyHelp }),
|
|
4763
|
+
/* @__PURE__ */ jsxs("div", { className: "liquid-divider flex flex-wrap items-center gap-3 border-t pt-4", children: [
|
|
4764
|
+
/* @__PURE__ */ jsx(
|
|
4765
|
+
Button,
|
|
4766
|
+
{
|
|
4767
|
+
type: "button",
|
|
4768
|
+
outline: true,
|
|
4769
|
+
onClick: () => void handleTestConnection(),
|
|
4770
|
+
disabled: testStatus === "testing",
|
|
4771
|
+
children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4772
|
+
/* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
4773
|
+
labels.testing
|
|
4774
|
+
] }) : labels.testConnection
|
|
4775
|
+
}
|
|
4776
|
+
),
|
|
4777
|
+
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
4778
|
+
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
4779
|
+
] })
|
|
4780
|
+
] });
|
|
4881
4781
|
}
|
|
4882
4782
|
function renderStep3() {
|
|
4883
|
-
return /* @__PURE__ */
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
)
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
)
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
setMaskPii(v);
|
|
4977
|
-
markTouched();
|
|
4978
|
-
},
|
|
4979
|
-
label: labels.fieldMaskPii,
|
|
4980
|
-
description: labels.fieldMaskPiiDescription
|
|
4981
|
-
}
|
|
4982
|
-
)
|
|
4983
|
-
] })
|
|
4984
|
-
}
|
|
4985
|
-
);
|
|
4783
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
4784
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
4785
|
+
/* @__PURE__ */ jsx(
|
|
4786
|
+
FormInput,
|
|
4787
|
+
{
|
|
4788
|
+
label: labels.fieldMaxPoolSize,
|
|
4789
|
+
type: "number",
|
|
4790
|
+
min: 1,
|
|
4791
|
+
max: 100,
|
|
4792
|
+
value: maxPoolSize,
|
|
4793
|
+
onValueChange: (v) => {
|
|
4794
|
+
setMaxPoolSize(v);
|
|
4795
|
+
markTouched();
|
|
4796
|
+
},
|
|
4797
|
+
hint: labels.fieldMaxPoolSizeHint
|
|
4798
|
+
}
|
|
4799
|
+
),
|
|
4800
|
+
/* @__PURE__ */ jsx(
|
|
4801
|
+
FormInput,
|
|
4802
|
+
{
|
|
4803
|
+
label: labels.fieldTimeoutMs,
|
|
4804
|
+
type: "number",
|
|
4805
|
+
min: 100,
|
|
4806
|
+
value: timeoutMs,
|
|
4807
|
+
onValueChange: (v) => {
|
|
4808
|
+
setTimeoutMs(v);
|
|
4809
|
+
markTouched();
|
|
4810
|
+
},
|
|
4811
|
+
hint: labels.fieldTimeoutMsHint
|
|
4812
|
+
}
|
|
4813
|
+
)
|
|
4814
|
+
] }),
|
|
4815
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4816
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTables }),
|
|
4817
|
+
/* @__PURE__ */ jsx(
|
|
4818
|
+
ChipPicker,
|
|
4819
|
+
{
|
|
4820
|
+
items: allowedTablesItems,
|
|
4821
|
+
selectedIds: allowedTablesSelected,
|
|
4822
|
+
onChange: (ids) => {
|
|
4823
|
+
setAllowedTablesSelected(ids);
|
|
4824
|
+
markTouched();
|
|
4825
|
+
},
|
|
4826
|
+
onItemsChange: (items) => {
|
|
4827
|
+
setAllowedTablesItems(items);
|
|
4828
|
+
markTouched();
|
|
4829
|
+
},
|
|
4830
|
+
allowCustom: true,
|
|
4831
|
+
unselectedStyle: allowedTablesStyle,
|
|
4832
|
+
showActions: false,
|
|
4833
|
+
addPlaceholder: labels.fieldAllowedTablesPlaceholder,
|
|
4834
|
+
addAriaLabel: labels.fieldAllowedTables
|
|
4835
|
+
}
|
|
4836
|
+
),
|
|
4837
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTablesHint })
|
|
4838
|
+
] }),
|
|
4839
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
4840
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumns }),
|
|
4841
|
+
/* @__PURE__ */ jsx(
|
|
4842
|
+
ChipPicker,
|
|
4843
|
+
{
|
|
4844
|
+
items: blockedColumnsItems,
|
|
4845
|
+
selectedIds: blockedColumnsSelected,
|
|
4846
|
+
onChange: (ids) => {
|
|
4847
|
+
setBlockedColumnsSelected(ids);
|
|
4848
|
+
markTouched();
|
|
4849
|
+
},
|
|
4850
|
+
onItemsChange: (items) => {
|
|
4851
|
+
setBlockedColumnsItems(items);
|
|
4852
|
+
markTouched();
|
|
4853
|
+
},
|
|
4854
|
+
allowCustom: true,
|
|
4855
|
+
unselectedStyle: blockedColumnsStyle,
|
|
4856
|
+
showActions: false,
|
|
4857
|
+
addPlaceholder: labels.fieldBlockedColumnsPlaceholder,
|
|
4858
|
+
addAriaLabel: labels.fieldBlockedColumns
|
|
4859
|
+
}
|
|
4860
|
+
),
|
|
4861
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumnsHint })
|
|
4862
|
+
] }),
|
|
4863
|
+
/* @__PURE__ */ jsx(
|
|
4864
|
+
FormCheckbox,
|
|
4865
|
+
{
|
|
4866
|
+
checked: maskPii,
|
|
4867
|
+
onChange: (v) => {
|
|
4868
|
+
setMaskPii(v);
|
|
4869
|
+
markTouched();
|
|
4870
|
+
},
|
|
4871
|
+
label: labels.fieldMaskPii,
|
|
4872
|
+
description: labels.fieldMaskPiiDescription
|
|
4873
|
+
}
|
|
4874
|
+
)
|
|
4875
|
+
] });
|
|
4986
4876
|
}
|
|
4987
4877
|
function renderStep4() {
|
|
4988
4878
|
const categoryLabel = category ? labels[category.labelKey] ?? category.id : labels.reviewNoneValue;
|
|
4989
4879
|
const dialectLabel = dialectOption?.label ?? labels.reviewNoneValue;
|
|
4990
4880
|
const allowed = allowedTablesSelected;
|
|
4991
4881
|
const blocked = blockedColumnsSelected;
|
|
4992
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-
|
|
4882
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
4993
4883
|
/* @__PURE__ */ jsx(
|
|
4994
|
-
|
|
4884
|
+
ReviewBlock2,
|
|
4995
4885
|
{
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
},
|
|
5001
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
5002
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5003
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5004
|
-
] }),
|
|
4886
|
+
stepTitle: labels.wizardStep1Title,
|
|
4887
|
+
stepSubtitle: labels.wizardStep1Subtitle,
|
|
4888
|
+
editLabel: labels.wizardReviewEdit,
|
|
4889
|
+
onEdit: () => goToStep(1),
|
|
5005
4890
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5006
4891
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCategoryLabel, value: categoryLabel }),
|
|
5007
4892
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewDialectLabel, value: dialectLabel })
|
|
@@ -5009,17 +4894,12 @@ function DatasourceNewWizardPageView({
|
|
|
5009
4894
|
}
|
|
5010
4895
|
),
|
|
5011
4896
|
/* @__PURE__ */ jsx(
|
|
5012
|
-
|
|
4897
|
+
ReviewBlock2,
|
|
5013
4898
|
{
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
},
|
|
5019
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
5020
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5021
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5022
|
-
] }),
|
|
4899
|
+
stepTitle: labels.wizardStep2Title,
|
|
4900
|
+
stepSubtitle: labels.wizardStep2Subtitle,
|
|
4901
|
+
editLabel: labels.wizardReviewEdit,
|
|
4902
|
+
onEdit: () => goToStep(2),
|
|
5023
4903
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5024
4904
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
|
|
5025
4905
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewCredentialsLabel, value: labels.reviewCredentialsRedacted }),
|
|
@@ -5029,17 +4909,12 @@ function DatasourceNewWizardPageView({
|
|
|
5029
4909
|
}
|
|
5030
4910
|
),
|
|
5031
4911
|
/* @__PURE__ */ jsx(
|
|
5032
|
-
|
|
4912
|
+
ReviewBlock2,
|
|
5033
4913
|
{
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
},
|
|
5039
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
5040
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5041
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5042
|
-
] }),
|
|
4914
|
+
stepTitle: labels.wizardStep3Title,
|
|
4915
|
+
stepSubtitle: labels.wizardStep3Subtitle,
|
|
4916
|
+
editLabel: labels.wizardReviewEdit,
|
|
4917
|
+
onEdit: () => goToStep(3),
|
|
5043
4918
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5044
4919
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewPoolLabel, value: maxPoolSize || labels.reviewNoneValue }),
|
|
5045
4920
|
/* @__PURE__ */ jsx(ReviewRow2, { label: labels.reviewTimeoutLabel, value: timeoutMs ? `${timeoutMs}ms` : labels.reviewNoneValue }),
|
|
@@ -5065,14 +4940,14 @@ function DatasourceNewWizardPageView({
|
|
|
5065
4940
|
}
|
|
5066
4941
|
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
|
|
5067
4942
|
const advanceDisabled = !canAdvance(step);
|
|
5068
|
-
const
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
4943
|
+
const isLast = step === TOTAL_STEPS2;
|
|
4944
|
+
const scrollableStep = step === 1 || step === 4;
|
|
4945
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
4946
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
4947
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
4948
|
+
isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !dialect || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
5074
4949
|
] });
|
|
5075
|
-
|
|
4950
|
+
return /* @__PURE__ */ jsxs(
|
|
5076
4951
|
"form",
|
|
5077
4952
|
{
|
|
5078
4953
|
onSubmit: (e) => {
|
|
@@ -5082,20 +4957,38 @@ function DatasourceNewWizardPageView({
|
|
|
5082
4957
|
},
|
|
5083
4958
|
className: "space-y-4",
|
|
5084
4959
|
children: [
|
|
5085
|
-
|
|
4960
|
+
hero,
|
|
4961
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
5086
4962
|
footer
|
|
5087
4963
|
]
|
|
5088
4964
|
}
|
|
5089
4965
|
);
|
|
5090
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5091
|
-
hero,
|
|
5092
|
-
content
|
|
5093
|
-
] });
|
|
5094
4966
|
}
|
|
5095
4967
|
function ReviewRow2({ label, value }) {
|
|
5096
4968
|
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: [
|
|
5097
|
-
/* @__PURE__ */ jsx("dt", { className: "text-[10px] uppercase tracking-wider text-
|
|
5098
|
-
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-
|
|
4969
|
+
/* @__PURE__ */ jsx("dt", { className: "text-[10px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: label }),
|
|
4970
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
4971
|
+
] });
|
|
4972
|
+
}
|
|
4973
|
+
function ReviewBlock2({
|
|
4974
|
+
stepTitle,
|
|
4975
|
+
stepSubtitle,
|
|
4976
|
+
editLabel,
|
|
4977
|
+
onEdit,
|
|
4978
|
+
children
|
|
4979
|
+
}) {
|
|
4980
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
4981
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
4982
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
4983
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
4984
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
4985
|
+
] }),
|
|
4986
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
4987
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4988
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
4989
|
+
] })
|
|
4990
|
+
] }),
|
|
4991
|
+
children
|
|
5099
4992
|
] });
|
|
5100
4993
|
}
|
|
5101
4994
|
async function simulateTest() {
|
|
@@ -5347,421 +5240,376 @@ function RuleNewWizardPageView({
|
|
|
5347
5240
|
id: String(idx + 1),
|
|
5348
5241
|
title
|
|
5349
5242
|
}));
|
|
5350
|
-
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS3));
|
|
5351
5243
|
const hero = /* @__PURE__ */ jsx(
|
|
5352
5244
|
HeroSection,
|
|
5353
5245
|
{
|
|
5354
5246
|
icon: /* @__PURE__ */ jsx(AdjustmentsHorizontalIcon, { className: "h-5 w-5" }),
|
|
5355
|
-
label:
|
|
5356
|
-
title: labels.pageTitle,
|
|
5247
|
+
label: labels.pageTitle,
|
|
5248
|
+
title: stepTitles[step - 1] ?? labels.pageTitle,
|
|
5357
5249
|
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
5358
5250
|
gradient: "from-fuchsia-500 to-purple-700",
|
|
5251
|
+
actions: /* @__PURE__ */ jsx(
|
|
5252
|
+
IconButton,
|
|
5253
|
+
{
|
|
5254
|
+
label: labels.wizardCancel,
|
|
5255
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
5256
|
+
variant: "ghost",
|
|
5257
|
+
onClick: cancelWithConfirm
|
|
5258
|
+
}
|
|
5259
|
+
),
|
|
5359
5260
|
children: /* @__PURE__ */ jsx(
|
|
5360
5261
|
StepIndicator,
|
|
5361
5262
|
{
|
|
5362
|
-
accent: "violet",
|
|
5363
|
-
currentStep: step - 1,
|
|
5364
|
-
onStepChange: (idx) => goToStep(idx + 1),
|
|
5365
|
-
progressLabel: labels.pageTitle,
|
|
5366
|
-
steps: indicatorSteps
|
|
5263
|
+
accent: "violet",
|
|
5264
|
+
currentStep: step - 1,
|
|
5265
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
5266
|
+
progressLabel: labels.pageTitle,
|
|
5267
|
+
steps: indicatorSteps
|
|
5268
|
+
}
|
|
5269
|
+
)
|
|
5270
|
+
}
|
|
5271
|
+
);
|
|
5272
|
+
function renderStep1() {
|
|
5273
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5274
|
+
/* @__PURE__ */ jsx(
|
|
5275
|
+
FormInput,
|
|
5276
|
+
{
|
|
5277
|
+
label: labels.nameLabel,
|
|
5278
|
+
value: name,
|
|
5279
|
+
onValueChange: (v) => {
|
|
5280
|
+
setName(v);
|
|
5281
|
+
markTouched();
|
|
5282
|
+
},
|
|
5283
|
+
placeholder: labels.namePlaceholder,
|
|
5284
|
+
required: true
|
|
5285
|
+
}
|
|
5286
|
+
),
|
|
5287
|
+
/* @__PURE__ */ jsx(
|
|
5288
|
+
FormTextarea,
|
|
5289
|
+
{
|
|
5290
|
+
label: labels.descriptionLabel,
|
|
5291
|
+
value: description,
|
|
5292
|
+
onValueChange: (v) => {
|
|
5293
|
+
setDescription(v);
|
|
5294
|
+
markTouched();
|
|
5295
|
+
},
|
|
5296
|
+
placeholder: labels.descriptionPlaceholder,
|
|
5297
|
+
rows: 3
|
|
5298
|
+
}
|
|
5299
|
+
),
|
|
5300
|
+
/* @__PURE__ */ jsx(
|
|
5301
|
+
RangeSliderField2,
|
|
5302
|
+
{
|
|
5303
|
+
sliderId: "wizard-rule-priority",
|
|
5304
|
+
label: labels.priorityLabel,
|
|
5305
|
+
value: priority,
|
|
5306
|
+
onChange: (v) => {
|
|
5307
|
+
setPriority(Math.round(v));
|
|
5308
|
+
markTouched();
|
|
5309
|
+
},
|
|
5310
|
+
min: 0,
|
|
5311
|
+
max: 100,
|
|
5312
|
+
step: 1,
|
|
5313
|
+
trackGradient: "linear-gradient(90deg, #10b981, #38bdf8 33%, #f59e0b 66%, #f43f5e)",
|
|
5314
|
+
formatValue: (v) => String(Math.round(v)),
|
|
5315
|
+
zones: [
|
|
5316
|
+
{ label: labels.priorityLow, max: 25, color: "text-emerald-500", thumbColor: "#10b981" },
|
|
5317
|
+
{ label: labels.priorityNormal, max: 50, color: "text-sky-500", thumbColor: "#38bdf8" },
|
|
5318
|
+
{ label: labels.priorityHigh, max: 75, color: "text-amber-500", thumbColor: "#f59e0b" },
|
|
5319
|
+
{ label: labels.priorityCritical, max: 100, color: "text-rose-500", thumbColor: "#f43f5e" }
|
|
5320
|
+
]
|
|
5321
|
+
}
|
|
5322
|
+
),
|
|
5323
|
+
/* @__PURE__ */ jsx(
|
|
5324
|
+
FormToggle,
|
|
5325
|
+
{
|
|
5326
|
+
checked: enabled,
|
|
5327
|
+
onChange: (v) => {
|
|
5328
|
+
setEnabled(v);
|
|
5329
|
+
markTouched();
|
|
5330
|
+
},
|
|
5331
|
+
label: labels.enabledLabel,
|
|
5332
|
+
variant: "card"
|
|
5367
5333
|
}
|
|
5368
5334
|
)
|
|
5369
|
-
}
|
|
5370
|
-
);
|
|
5371
|
-
function renderStep1() {
|
|
5372
|
-
return /* @__PURE__ */ jsx(
|
|
5373
|
-
SectionCard,
|
|
5374
|
-
{
|
|
5375
|
-
variant: "glass",
|
|
5376
|
-
header: {
|
|
5377
|
-
title: labels.wizardStep1Title,
|
|
5378
|
-
subtitle: labels.wizardStep1Subtitle
|
|
5379
|
-
},
|
|
5380
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5381
|
-
/* @__PURE__ */ jsx(
|
|
5382
|
-
FormInput,
|
|
5383
|
-
{
|
|
5384
|
-
label: labels.nameLabel,
|
|
5385
|
-
value: name,
|
|
5386
|
-
onValueChange: (v) => {
|
|
5387
|
-
setName(v);
|
|
5388
|
-
markTouched();
|
|
5389
|
-
},
|
|
5390
|
-
placeholder: labels.namePlaceholder,
|
|
5391
|
-
required: true
|
|
5392
|
-
}
|
|
5393
|
-
),
|
|
5394
|
-
/* @__PURE__ */ jsx(
|
|
5395
|
-
FormTextarea,
|
|
5396
|
-
{
|
|
5397
|
-
label: labels.descriptionLabel,
|
|
5398
|
-
value: description,
|
|
5399
|
-
onValueChange: (v) => {
|
|
5400
|
-
setDescription(v);
|
|
5401
|
-
markTouched();
|
|
5402
|
-
},
|
|
5403
|
-
placeholder: labels.descriptionPlaceholder,
|
|
5404
|
-
rows: 3
|
|
5405
|
-
}
|
|
5406
|
-
),
|
|
5407
|
-
/* @__PURE__ */ jsx(
|
|
5408
|
-
RangeSliderField2,
|
|
5409
|
-
{
|
|
5410
|
-
sliderId: "wizard-rule-priority",
|
|
5411
|
-
label: labels.priorityLabel,
|
|
5412
|
-
value: priority,
|
|
5413
|
-
onChange: (v) => {
|
|
5414
|
-
setPriority(Math.round(v));
|
|
5415
|
-
markTouched();
|
|
5416
|
-
},
|
|
5417
|
-
min: 0,
|
|
5418
|
-
max: 100,
|
|
5419
|
-
step: 1,
|
|
5420
|
-
trackGradient: "linear-gradient(90deg, #10b981, #38bdf8 33%, #f59e0b 66%, #f43f5e)",
|
|
5421
|
-
formatValue: (v) => String(Math.round(v)),
|
|
5422
|
-
zones: [
|
|
5423
|
-
{ label: labels.priorityLow, max: 25, color: "text-emerald-500", thumbColor: "#10b981" },
|
|
5424
|
-
{ label: labels.priorityNormal, max: 50, color: "text-sky-500", thumbColor: "#38bdf8" },
|
|
5425
|
-
{ label: labels.priorityHigh, max: 75, color: "text-amber-500", thumbColor: "#f59e0b" },
|
|
5426
|
-
{ label: labels.priorityCritical, max: 100, color: "text-rose-500", thumbColor: "#f43f5e" }
|
|
5427
|
-
]
|
|
5428
|
-
}
|
|
5429
|
-
),
|
|
5430
|
-
/* @__PURE__ */ jsx(
|
|
5431
|
-
FormToggle,
|
|
5432
|
-
{
|
|
5433
|
-
checked: enabled,
|
|
5434
|
-
onChange: (v) => {
|
|
5435
|
-
setEnabled(v);
|
|
5436
|
-
markTouched();
|
|
5437
|
-
},
|
|
5438
|
-
label: labels.enabledLabel,
|
|
5439
|
-
variant: "card"
|
|
5440
|
-
}
|
|
5441
|
-
)
|
|
5442
|
-
] })
|
|
5443
|
-
}
|
|
5444
|
-
);
|
|
5335
|
+
] });
|
|
5445
5336
|
}
|
|
5446
5337
|
function renderStep2() {
|
|
5447
|
-
return /* @__PURE__ */
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
)
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
value: condition,
|
|
5479
|
-
onChange: (next) => {
|
|
5480
|
-
setCondition(next);
|
|
5481
|
-
markTouched();
|
|
5482
|
-
}
|
|
5483
|
-
}
|
|
5484
|
-
)
|
|
5485
|
-
] })
|
|
5486
|
-
}
|
|
5487
|
-
);
|
|
5338
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5339
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5340
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.combinatorLabel }),
|
|
5341
|
+
/* @__PURE__ */ jsx(
|
|
5342
|
+
SegmentedControl,
|
|
5343
|
+
{
|
|
5344
|
+
segments: [
|
|
5345
|
+
{ value: "and", label: labels.combinatorAnd },
|
|
5346
|
+
{ value: "or", label: labels.combinatorOr },
|
|
5347
|
+
{ value: "not", label: labels.combinatorNot }
|
|
5348
|
+
],
|
|
5349
|
+
value: combinator,
|
|
5350
|
+
onChange: (v) => {
|
|
5351
|
+
setCombinator(v);
|
|
5352
|
+
markTouched();
|
|
5353
|
+
},
|
|
5354
|
+
size: "sm"
|
|
5355
|
+
}
|
|
5356
|
+
)
|
|
5357
|
+
] }),
|
|
5358
|
+
/* @__PURE__ */ jsx(
|
|
5359
|
+
RuleConditionBuilder,
|
|
5360
|
+
{
|
|
5361
|
+
value: condition,
|
|
5362
|
+
onChange: (next) => {
|
|
5363
|
+
setCondition(next);
|
|
5364
|
+
markTouched();
|
|
5365
|
+
}
|
|
5366
|
+
}
|
|
5367
|
+
)
|
|
5368
|
+
] });
|
|
5488
5369
|
}
|
|
5489
5370
|
function renderStep3() {
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
"
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
{
|
|
5514
|
-
isActive: selected,
|
|
5515
|
-
color: tile.color,
|
|
5516
|
-
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
5517
|
-
label,
|
|
5518
|
-
count: description2,
|
|
5519
|
-
onClick: () => {
|
|
5520
|
-
setActionTileId(tile.id);
|
|
5521
|
-
markTouched();
|
|
5522
|
-
}
|
|
5523
|
-
},
|
|
5524
|
-
tile.id
|
|
5525
|
-
);
|
|
5526
|
-
})
|
|
5527
|
-
}
|
|
5528
|
-
),
|
|
5529
|
-
selectedTile && /* @__PURE__ */ jsx(
|
|
5530
|
-
SectionCard,
|
|
5531
|
-
{
|
|
5532
|
-
variant: "glass",
|
|
5533
|
-
header: {
|
|
5534
|
-
title: labels[selectedTile.labelKey] ?? selectedTile.id,
|
|
5535
|
-
subtitle: labels.actionConfigSubtitle
|
|
5536
|
-
},
|
|
5537
|
-
children: /* @__PURE__ */ jsx(
|
|
5538
|
-
RuleActionBuilder,
|
|
5539
|
-
{
|
|
5540
|
-
value: action,
|
|
5541
|
-
onChange: (next) => {
|
|
5542
|
-
setAction(next);
|
|
5543
|
-
markTouched();
|
|
5544
|
-
}
|
|
5371
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5372
|
+
/* @__PURE__ */ jsx(
|
|
5373
|
+
"div",
|
|
5374
|
+
{
|
|
5375
|
+
role: "radiogroup",
|
|
5376
|
+
"aria-label": labels.actionSectionTitle,
|
|
5377
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
5378
|
+
children: ACTION_TILES.map((tile) => {
|
|
5379
|
+
const Icon = tile.icon;
|
|
5380
|
+
const selected = tile.id === actionTileId;
|
|
5381
|
+
const label = labels[tile.labelKey] ?? tile.id;
|
|
5382
|
+
const description2 = labels[tile.descriptionKey] ?? "";
|
|
5383
|
+
return /* @__PURE__ */ jsx(
|
|
5384
|
+
FilterTileButton,
|
|
5385
|
+
{
|
|
5386
|
+
isActive: selected,
|
|
5387
|
+
color: tile.color,
|
|
5388
|
+
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
5389
|
+
label,
|
|
5390
|
+
count: description2,
|
|
5391
|
+
onClick: () => {
|
|
5392
|
+
setActionTileId(tile.id);
|
|
5393
|
+
markTouched();
|
|
5545
5394
|
}
|
|
5546
|
-
|
|
5395
|
+
},
|
|
5396
|
+
tile.id
|
|
5397
|
+
);
|
|
5398
|
+
})
|
|
5399
|
+
}
|
|
5400
|
+
),
|
|
5401
|
+
actionTileId && /* @__PURE__ */ jsxs("div", { className: "border-t liquid-divider pt-4", children: [
|
|
5402
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-slate-500 dark:text-slate-400", children: labels.actionConfigSubtitle }),
|
|
5403
|
+
/* @__PURE__ */ jsx(
|
|
5404
|
+
RuleActionBuilder,
|
|
5405
|
+
{
|
|
5406
|
+
value: action,
|
|
5407
|
+
onChange: (next) => {
|
|
5408
|
+
setAction(next);
|
|
5409
|
+
markTouched();
|
|
5547
5410
|
}
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
}
|
|
5551
|
-
);
|
|
5411
|
+
}
|
|
5412
|
+
)
|
|
5413
|
+
] })
|
|
5414
|
+
] });
|
|
5552
5415
|
}
|
|
5553
5416
|
function renderStep4() {
|
|
5554
|
-
return /* @__PURE__ */
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
title: labels.scheduleSectionTitle,
|
|
5560
|
-
subtitle: labels.scheduleSectionSubtitle
|
|
5561
|
-
},
|
|
5562
|
-
children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5563
|
-
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
5564
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5565
|
-
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
|
|
5566
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5567
|
-
/* @__PURE__ */ jsx(
|
|
5568
|
-
DatePicker,
|
|
5569
|
-
{
|
|
5570
|
-
value: validFromDate,
|
|
5571
|
-
onChange: (d) => {
|
|
5572
|
-
setValidFromDate(d);
|
|
5573
|
-
markTouched();
|
|
5574
|
-
},
|
|
5575
|
-
placeholder: labels.validFromDateLabel
|
|
5576
|
-
}
|
|
5577
|
-
),
|
|
5578
|
-
/* @__PURE__ */ jsx(
|
|
5579
|
-
TimePicker,
|
|
5580
|
-
{
|
|
5581
|
-
value: validFromTime,
|
|
5582
|
-
onChange: (t) => {
|
|
5583
|
-
setValidFromTime(t);
|
|
5584
|
-
markTouched();
|
|
5585
|
-
},
|
|
5586
|
-
placeholder: labels.validFromTimeLabel
|
|
5587
|
-
}
|
|
5588
|
-
)
|
|
5589
|
-
] })
|
|
5590
|
-
] }),
|
|
5591
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5592
|
-
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
|
|
5593
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5594
|
-
/* @__PURE__ */ jsx(
|
|
5595
|
-
DatePicker,
|
|
5596
|
-
{
|
|
5597
|
-
value: validUntilDate,
|
|
5598
|
-
onChange: (d) => {
|
|
5599
|
-
setValidUntilDate(d);
|
|
5600
|
-
markTouched();
|
|
5601
|
-
},
|
|
5602
|
-
placeholder: labels.validUntilDateLabel
|
|
5603
|
-
}
|
|
5604
|
-
),
|
|
5605
|
-
/* @__PURE__ */ jsx(
|
|
5606
|
-
TimePicker,
|
|
5607
|
-
{
|
|
5608
|
-
value: validUntilTime,
|
|
5609
|
-
onChange: (t) => {
|
|
5610
|
-
setValidUntilTime(t);
|
|
5611
|
-
markTouched();
|
|
5612
|
-
},
|
|
5613
|
-
placeholder: labels.validUntilTimeLabel
|
|
5614
|
-
}
|
|
5615
|
-
)
|
|
5616
|
-
] })
|
|
5617
|
-
] })
|
|
5618
|
-
] }),
|
|
5619
|
-
/* @__PURE__ */ jsx(
|
|
5620
|
-
FormCheckbox,
|
|
5621
|
-
{
|
|
5622
|
-
checked: noExpiry,
|
|
5623
|
-
onChange: (v) => {
|
|
5624
|
-
setNoExpiry(v);
|
|
5625
|
-
markTouched();
|
|
5626
|
-
},
|
|
5627
|
-
label: labels.noExpiryLabel,
|
|
5628
|
-
description: labels.noExpiryDescription
|
|
5629
|
-
}
|
|
5630
|
-
),
|
|
5631
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
5632
|
-
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.statusLabel }),
|
|
5417
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5418
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
5419
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5420
|
+
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
|
|
5421
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5633
5422
|
/* @__PURE__ */ jsx(
|
|
5634
|
-
|
|
5423
|
+
DatePicker,
|
|
5635
5424
|
{
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
{ value: "archived", label: labels.statusArchived }
|
|
5640
|
-
],
|
|
5641
|
-
value: status,
|
|
5642
|
-
onChange: (v) => {
|
|
5643
|
-
setStatus(v);
|
|
5425
|
+
value: validFromDate,
|
|
5426
|
+
onChange: (d) => {
|
|
5427
|
+
setValidFromDate(d);
|
|
5644
5428
|
markTouched();
|
|
5645
5429
|
},
|
|
5646
|
-
|
|
5430
|
+
placeholder: labels.validFromDateLabel
|
|
5647
5431
|
}
|
|
5648
|
-
)
|
|
5649
|
-
] }),
|
|
5650
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
5651
|
-
/* @__PURE__ */ jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
|
|
5432
|
+
),
|
|
5652
5433
|
/* @__PURE__ */ jsx(
|
|
5653
|
-
|
|
5434
|
+
TimePicker,
|
|
5654
5435
|
{
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
setTagsSelected(ids);
|
|
5436
|
+
value: validFromTime,
|
|
5437
|
+
onChange: (t) => {
|
|
5438
|
+
setValidFromTime(t);
|
|
5659
5439
|
markTouched();
|
|
5660
5440
|
},
|
|
5661
|
-
|
|
5662
|
-
|
|
5441
|
+
placeholder: labels.validFromTimeLabel
|
|
5442
|
+
}
|
|
5443
|
+
)
|
|
5444
|
+
] })
|
|
5445
|
+
] }),
|
|
5446
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
5447
|
+
/* @__PURE__ */ jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
|
|
5448
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5449
|
+
/* @__PURE__ */ jsx(
|
|
5450
|
+
DatePicker,
|
|
5451
|
+
{
|
|
5452
|
+
value: validUntilDate,
|
|
5453
|
+
onChange: (d) => {
|
|
5454
|
+
setValidUntilDate(d);
|
|
5663
5455
|
markTouched();
|
|
5664
5456
|
},
|
|
5665
|
-
|
|
5666
|
-
unselectedStyle: tagsStyle,
|
|
5667
|
-
showActions: false,
|
|
5668
|
-
addPlaceholder: labels.tagsPlaceholder,
|
|
5669
|
-
addAriaLabel: labels.tagsLabel
|
|
5457
|
+
placeholder: labels.validUntilDateLabel
|
|
5670
5458
|
}
|
|
5671
5459
|
),
|
|
5672
|
-
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
|
|
5673
|
-
] }),
|
|
5674
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
5675
|
-
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
|
|
5676
5460
|
/* @__PURE__ */ jsx(
|
|
5677
|
-
|
|
5461
|
+
TimePicker,
|
|
5678
5462
|
{
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
{ value: "recurring", label: labels.recurrenceRecurring }
|
|
5683
|
-
],
|
|
5684
|
-
value: recurrence,
|
|
5685
|
-
onChange: (v) => {
|
|
5686
|
-
setRecurrence(v);
|
|
5463
|
+
value: validUntilTime,
|
|
5464
|
+
onChange: (t) => {
|
|
5465
|
+
setValidUntilTime(t);
|
|
5687
5466
|
markTouched();
|
|
5688
5467
|
},
|
|
5689
|
-
|
|
5468
|
+
placeholder: labels.validUntilTimeLabel
|
|
5690
5469
|
}
|
|
5691
5470
|
)
|
|
5692
|
-
] })
|
|
5693
|
-
|
|
5694
|
-
|
|
5471
|
+
] })
|
|
5472
|
+
] })
|
|
5473
|
+
] }),
|
|
5474
|
+
/* @__PURE__ */ jsx(
|
|
5475
|
+
FormCheckbox,
|
|
5476
|
+
{
|
|
5477
|
+
checked: noExpiry,
|
|
5478
|
+
onChange: (v) => {
|
|
5479
|
+
setNoExpiry(v);
|
|
5480
|
+
markTouched();
|
|
5481
|
+
},
|
|
5482
|
+
label: labels.noExpiryLabel,
|
|
5483
|
+
description: labels.noExpiryDescription
|
|
5484
|
+
}
|
|
5485
|
+
),
|
|
5486
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5487
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.statusLabel }),
|
|
5488
|
+
/* @__PURE__ */ jsx(
|
|
5489
|
+
SegmentedControl,
|
|
5490
|
+
{
|
|
5491
|
+
segments: [
|
|
5492
|
+
{ value: "active", label: labels.statusActive },
|
|
5493
|
+
{ value: "paused", label: labels.statusPaused },
|
|
5494
|
+
{ value: "archived", label: labels.statusArchived }
|
|
5495
|
+
],
|
|
5496
|
+
value: status,
|
|
5497
|
+
onChange: (v) => {
|
|
5498
|
+
setStatus(v);
|
|
5499
|
+
markTouched();
|
|
5500
|
+
},
|
|
5501
|
+
size: "sm"
|
|
5502
|
+
}
|
|
5503
|
+
)
|
|
5504
|
+
] }),
|
|
5505
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
5506
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
|
|
5507
|
+
/* @__PURE__ */ jsx(
|
|
5508
|
+
ChipPicker,
|
|
5509
|
+
{
|
|
5510
|
+
items: tagsItems,
|
|
5511
|
+
selectedIds: tagsSelected,
|
|
5512
|
+
onChange: (ids) => {
|
|
5513
|
+
setTagsSelected(ids);
|
|
5514
|
+
markTouched();
|
|
5515
|
+
},
|
|
5516
|
+
onItemsChange: (items) => {
|
|
5517
|
+
setTagsItems(items);
|
|
5518
|
+
markTouched();
|
|
5519
|
+
},
|
|
5520
|
+
allowCustom: true,
|
|
5521
|
+
unselectedStyle: tagsStyle,
|
|
5522
|
+
showActions: false,
|
|
5523
|
+
addPlaceholder: labels.tagsPlaceholder,
|
|
5524
|
+
addAriaLabel: labels.tagsLabel
|
|
5525
|
+
}
|
|
5526
|
+
),
|
|
5527
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
|
|
5528
|
+
] }),
|
|
5529
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5530
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
|
|
5531
|
+
/* @__PURE__ */ jsx(
|
|
5532
|
+
SegmentedControl,
|
|
5533
|
+
{
|
|
5534
|
+
segments: [
|
|
5535
|
+
{ value: "one-off", label: labels.recurrenceOneOff },
|
|
5536
|
+
{ value: "cron", label: labels.recurrenceCron },
|
|
5537
|
+
{ value: "recurring", label: labels.recurrenceRecurring }
|
|
5538
|
+
],
|
|
5539
|
+
value: recurrence,
|
|
5540
|
+
onChange: (v) => {
|
|
5541
|
+
setRecurrence(v);
|
|
5542
|
+
markTouched();
|
|
5543
|
+
},
|
|
5544
|
+
size: "sm"
|
|
5545
|
+
}
|
|
5546
|
+
)
|
|
5547
|
+
] }),
|
|
5548
|
+
recurrence === "cron" && /* @__PURE__ */ jsx(
|
|
5549
|
+
FormInput,
|
|
5550
|
+
{
|
|
5551
|
+
label: labels.cronExpressionLabel,
|
|
5552
|
+
value: cronExpression,
|
|
5553
|
+
onValueChange: (v) => {
|
|
5554
|
+
setCronExpression(v);
|
|
5555
|
+
markTouched();
|
|
5556
|
+
},
|
|
5557
|
+
placeholder: labels.cronExpressionPlaceholder,
|
|
5558
|
+
hint: labels.cronExpressionHint
|
|
5559
|
+
}
|
|
5560
|
+
),
|
|
5561
|
+
recurrence === "recurring" && /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
5562
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5563
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.weekdaysLabel }),
|
|
5564
|
+
/* @__PURE__ */ jsx(
|
|
5565
|
+
ChipPicker,
|
|
5695
5566
|
{
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5567
|
+
items: WEEKDAYS.map((d) => ({
|
|
5568
|
+
id: d.id,
|
|
5569
|
+
name: labels[d.labelKey] ?? d.id,
|
|
5570
|
+
style: {
|
|
5571
|
+
bg: "bg-fuchsia-500/15",
|
|
5572
|
+
text: "text-fuchsia-700 dark:text-fuchsia-300"
|
|
5573
|
+
}
|
|
5574
|
+
})),
|
|
5575
|
+
selectedIds: weekdays,
|
|
5576
|
+
onChange: (ids) => {
|
|
5577
|
+
setWeekdays(ids);
|
|
5700
5578
|
markTouched();
|
|
5701
5579
|
},
|
|
5702
|
-
|
|
5703
|
-
hint: labels.cronExpressionHint
|
|
5580
|
+
showActions: false
|
|
5704
5581
|
}
|
|
5705
|
-
)
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
selectedIds: weekdays,
|
|
5721
|
-
onChange: (ids) => {
|
|
5722
|
-
setWeekdays(ids);
|
|
5723
|
-
markTouched();
|
|
5724
|
-
},
|
|
5725
|
-
showActions: false
|
|
5726
|
-
}
|
|
5727
|
-
)
|
|
5728
|
-
] }),
|
|
5729
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
5730
|
-
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
|
|
5731
|
-
/* @__PURE__ */ jsx(
|
|
5732
|
-
TimePicker,
|
|
5733
|
-
{
|
|
5734
|
-
value: recurringTime,
|
|
5735
|
-
onChange: (t) => {
|
|
5736
|
-
setRecurringTime(t);
|
|
5737
|
-
markTouched();
|
|
5738
|
-
},
|
|
5739
|
-
placeholder: labels.timeOfDayLabel
|
|
5740
|
-
}
|
|
5741
|
-
)
|
|
5742
|
-
] })
|
|
5743
|
-
] })
|
|
5582
|
+
)
|
|
5583
|
+
] }),
|
|
5584
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
5585
|
+
/* @__PURE__ */ jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
|
|
5586
|
+
/* @__PURE__ */ jsx(
|
|
5587
|
+
TimePicker,
|
|
5588
|
+
{
|
|
5589
|
+
value: recurringTime,
|
|
5590
|
+
onChange: (t) => {
|
|
5591
|
+
setRecurringTime(t);
|
|
5592
|
+
markTouched();
|
|
5593
|
+
},
|
|
5594
|
+
placeholder: labels.timeOfDayLabel
|
|
5595
|
+
}
|
|
5596
|
+
)
|
|
5744
5597
|
] })
|
|
5745
|
-
}
|
|
5746
|
-
|
|
5598
|
+
] })
|
|
5599
|
+
] });
|
|
5747
5600
|
}
|
|
5748
5601
|
function renderStep5() {
|
|
5749
5602
|
const payload = buildPayload();
|
|
5750
5603
|
const conditionSentence = humanReadableCondition(payload.condition, labels);
|
|
5751
5604
|
const actionSentence = humanReadableAction(payload.action, labels, ACTION_TILES, actionTileId);
|
|
5752
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-
|
|
5605
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
5753
5606
|
/* @__PURE__ */ jsx(
|
|
5754
|
-
|
|
5607
|
+
ReviewBlock3,
|
|
5755
5608
|
{
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
},
|
|
5761
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
5762
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5763
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5764
|
-
] }),
|
|
5609
|
+
stepTitle: labels.wizardStep1Title,
|
|
5610
|
+
stepSubtitle: labels.wizardStep1Subtitle,
|
|
5611
|
+
editLabel: labels.wizardReviewEdit,
|
|
5612
|
+
onEdit: () => goToStep(1),
|
|
5765
5613
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5766
5614
|
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewNameLabel, value: payload.name }),
|
|
5767
5615
|
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewPriorityLabel, value: String(payload.priority) }),
|
|
@@ -5777,54 +5625,35 @@ function RuleNewWizardPageView({
|
|
|
5777
5625
|
}
|
|
5778
5626
|
),
|
|
5779
5627
|
/* @__PURE__ */ jsxs(
|
|
5780
|
-
|
|
5628
|
+
ReviewBlock3,
|
|
5781
5629
|
{
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
},
|
|
5787
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
5788
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5789
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5790
|
-
] }),
|
|
5630
|
+
stepTitle: labels.wizardStep2Title,
|
|
5631
|
+
stepSubtitle: labels.wizardStep2Subtitle,
|
|
5632
|
+
editLabel: labels.wizardReviewEdit,
|
|
5633
|
+
onEdit: () => goToStep(2),
|
|
5791
5634
|
children: [
|
|
5792
5635
|
/* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: conditionSentence }),
|
|
5793
|
-
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() })
|
|
5794
|
-
/* @__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) })
|
|
5636
|
+
/* @__PURE__ */ jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() })
|
|
5795
5637
|
]
|
|
5796
5638
|
}
|
|
5797
5639
|
),
|
|
5798
|
-
/* @__PURE__ */
|
|
5799
|
-
|
|
5640
|
+
/* @__PURE__ */ jsx(
|
|
5641
|
+
ReviewBlock3,
|
|
5800
5642
|
{
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
}
|
|
5806
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
5807
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5808
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5809
|
-
] }),
|
|
5810
|
-
children: [
|
|
5811
|
-
/* @__PURE__ */ jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: actionSentence }),
|
|
5812
|
-
/* @__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) })
|
|
5813
|
-
]
|
|
5643
|
+
stepTitle: labels.wizardStep3Title,
|
|
5644
|
+
stepSubtitle: labels.wizardStep3Subtitle,
|
|
5645
|
+
editLabel: labels.wizardReviewEdit,
|
|
5646
|
+
onEdit: () => goToStep(3),
|
|
5647
|
+
children: /* @__PURE__ */ jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: actionSentence })
|
|
5814
5648
|
}
|
|
5815
5649
|
),
|
|
5816
5650
|
/* @__PURE__ */ jsx(
|
|
5817
|
-
|
|
5651
|
+
ReviewBlock3,
|
|
5818
5652
|
{
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
},
|
|
5824
|
-
actions: /* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(4), children: [
|
|
5825
|
-
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5826
|
-
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5827
|
-
] }),
|
|
5653
|
+
stepTitle: labels.wizardStep4Title,
|
|
5654
|
+
stepSubtitle: labels.wizardStep4Subtitle,
|
|
5655
|
+
editLabel: labels.wizardReviewEdit,
|
|
5656
|
+
onEdit: () => goToStep(4),
|
|
5828
5657
|
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5829
5658
|
/* @__PURE__ */ jsx(
|
|
5830
5659
|
ReviewRow3,
|
|
@@ -5852,27 +5681,27 @@ function RuleNewWizardPageView({
|
|
|
5852
5681
|
] })
|
|
5853
5682
|
}
|
|
5854
5683
|
)
|
|
5855
|
-
] });
|
|
5856
|
-
}
|
|
5857
|
-
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
|
|
5858
|
-
const advanceDisabled = !canAdvance(step);
|
|
5859
|
-
const
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5684
|
+
] });
|
|
5685
|
+
}
|
|
5686
|
+
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
|
|
5687
|
+
const advanceDisabled = !canAdvance(step);
|
|
5688
|
+
const isLast = step === TOTAL_STEPS3;
|
|
5689
|
+
const scrollableStep = step === 2 || step === 3 || step === 4 || step === 5;
|
|
5690
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
5691
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
5692
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
5693
|
+
isLast ? /* @__PURE__ */ jsx(
|
|
5694
|
+
Button,
|
|
5695
|
+
{
|
|
5696
|
+
type: "button",
|
|
5697
|
+
color: "ios-glass-blue",
|
|
5698
|
+
onClick: () => void submit(),
|
|
5699
|
+
disabled: submitting || !name.trim() || !actionTileId,
|
|
5700
|
+
children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate
|
|
5701
|
+
}
|
|
5702
|
+
) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
5874
5703
|
] });
|
|
5875
|
-
|
|
5704
|
+
return /* @__PURE__ */ jsxs(
|
|
5876
5705
|
"form",
|
|
5877
5706
|
{
|
|
5878
5707
|
onSubmit: (e) => {
|
|
@@ -5882,15 +5711,12 @@ function RuleNewWizardPageView({
|
|
|
5882
5711
|
},
|
|
5883
5712
|
className: "space-y-4",
|
|
5884
5713
|
children: [
|
|
5885
|
-
|
|
5714
|
+
hero,
|
|
5715
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
5886
5716
|
footer
|
|
5887
5717
|
]
|
|
5888
5718
|
}
|
|
5889
5719
|
);
|
|
5890
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
5891
|
-
hero,
|
|
5892
|
-
content
|
|
5893
|
-
] });
|
|
5894
5720
|
}
|
|
5895
5721
|
function ReviewRow3({ label, value }) {
|
|
5896
5722
|
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: [
|
|
@@ -5898,6 +5724,27 @@ function ReviewRow3({ label, value }) {
|
|
|
5898
5724
|
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
5899
5725
|
] });
|
|
5900
5726
|
}
|
|
5727
|
+
function ReviewBlock3({
|
|
5728
|
+
stepTitle,
|
|
5729
|
+
stepSubtitle,
|
|
5730
|
+
editLabel,
|
|
5731
|
+
onEdit,
|
|
5732
|
+
children
|
|
5733
|
+
}) {
|
|
5734
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
5735
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
5736
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
5737
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
5738
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
5739
|
+
] }),
|
|
5740
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
5741
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5742
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
5743
|
+
] })
|
|
5744
|
+
] }),
|
|
5745
|
+
children
|
|
5746
|
+
] });
|
|
5747
|
+
}
|
|
5901
5748
|
function pad(n) {
|
|
5902
5749
|
return String(n).padStart(2, "0");
|
|
5903
5750
|
}
|
|
@@ -5945,7 +5792,481 @@ function humanReadableAction(action, labels, tiles, actionTileId) {
|
|
|
5945
5792
|
const paramSummary = action.params ? Object.entries(action.params).slice(0, 3).map(([k, v]) => `${k}=${String(v)}`).join(", ") : "";
|
|
5946
5793
|
return paramSummary ? `${tileLabel} \u2014 ${paramSummary}` : tileLabel;
|
|
5947
5794
|
}
|
|
5795
|
+
function AgentNewModal({ open, onClose, ...wizardProps }) {
|
|
5796
|
+
return /* @__PURE__ */ jsx(
|
|
5797
|
+
GlassModal,
|
|
5798
|
+
{
|
|
5799
|
+
open,
|
|
5800
|
+
onClose,
|
|
5801
|
+
maxWidth: "2xl",
|
|
5802
|
+
closeOnBackdrop: false,
|
|
5803
|
+
closeLabel: wizardProps.labels.wizardCancel,
|
|
5804
|
+
children: /* @__PURE__ */ jsx(AgentNewWizardPageView, { ...wizardProps })
|
|
5805
|
+
}
|
|
5806
|
+
);
|
|
5807
|
+
}
|
|
5808
|
+
function DatasourceNewModal({ open, onClose, ...wizardProps }) {
|
|
5809
|
+
return /* @__PURE__ */ jsx(
|
|
5810
|
+
GlassModal,
|
|
5811
|
+
{
|
|
5812
|
+
open,
|
|
5813
|
+
onClose,
|
|
5814
|
+
maxWidth: "2xl",
|
|
5815
|
+
closeOnBackdrop: false,
|
|
5816
|
+
closeLabel: wizardProps.labels.wizardCancel,
|
|
5817
|
+
children: /* @__PURE__ */ jsx(DatasourceNewWizardPageView, { ...wizardProps })
|
|
5818
|
+
}
|
|
5819
|
+
);
|
|
5820
|
+
}
|
|
5821
|
+
function RuleNewModal({ open, onClose, ...wizardProps }) {
|
|
5822
|
+
return /* @__PURE__ */ jsx(
|
|
5823
|
+
GlassModal,
|
|
5824
|
+
{
|
|
5825
|
+
open,
|
|
5826
|
+
onClose,
|
|
5827
|
+
maxWidth: "2xl",
|
|
5828
|
+
closeOnBackdrop: false,
|
|
5829
|
+
closeLabel: wizardProps.labels.wizardCancel,
|
|
5830
|
+
children: /* @__PURE__ */ jsx(RuleNewWizardPageView, { ...wizardProps })
|
|
5831
|
+
}
|
|
5832
|
+
);
|
|
5833
|
+
}
|
|
5834
|
+
var AWS_REGIONS = [
|
|
5835
|
+
{ value: "us-east-1", label: "us-east-1 (N. Virginia)" },
|
|
5836
|
+
{ value: "us-east-2", label: "us-east-2 (Ohio)" },
|
|
5837
|
+
{ value: "us-west-2", label: "us-west-2 (Oregon)" },
|
|
5838
|
+
{ value: "eu-west-1", label: "eu-west-1 (Ireland)" },
|
|
5839
|
+
{ value: "eu-central-1", label: "eu-central-1 (Frankfurt)" },
|
|
5840
|
+
{ value: "ap-southeast-1", label: "ap-southeast-1 (Singapore)" },
|
|
5841
|
+
{ value: "sa-east-1", label: "sa-east-1 (S\xE3o Paulo)" }
|
|
5842
|
+
];
|
|
5843
|
+
var GCP_REGIONS = [
|
|
5844
|
+
{ value: "us-central1", label: "us-central1 (Iowa)" },
|
|
5845
|
+
{ value: "us-east1", label: "us-east1 (S. Carolina)" },
|
|
5846
|
+
{ value: "us-west1", label: "us-west1 (Oregon)" },
|
|
5847
|
+
{ value: "europe-west1", label: "europe-west1 (Belgium)" },
|
|
5848
|
+
{ value: "europe-west4", label: "europe-west4 (Netherlands)" },
|
|
5849
|
+
{ value: "asia-southeast1", label: "asia-southeast1 (Singapore)" },
|
|
5850
|
+
{ value: "southamerica-east1", label: "southamerica-east1 (S\xE3o Paulo)" }
|
|
5851
|
+
];
|
|
5852
|
+
var AZURE_REGIONS = [
|
|
5853
|
+
{ value: "eastus", label: "eastus" },
|
|
5854
|
+
{ value: "westus2", label: "westus2" },
|
|
5855
|
+
{ value: "northeurope", label: "northeurope" },
|
|
5856
|
+
{ value: "westeurope", label: "westeurope" },
|
|
5857
|
+
{ value: "brazilsouth", label: "brazilsouth" }
|
|
5858
|
+
];
|
|
5859
|
+
var MODEL_PROVIDERS = [
|
|
5860
|
+
{ value: "anthropic_api", label: "Anthropic API", category: "managed" },
|
|
5861
|
+
{ value: "openai_api", label: "OpenAI API", category: "managed" },
|
|
5862
|
+
{ value: "aws_bedrock", label: "AWS Bedrock", category: "cloud", needsRegion: true, defaultRegion: "us-east-1", regions: AWS_REGIONS },
|
|
5863
|
+
{ value: "google_vertex", label: "Google Vertex AI", category: "cloud", needsRegion: true, defaultRegion: "us-central1", regions: GCP_REGIONS },
|
|
5864
|
+
{ value: "azure_openai", label: "Azure OpenAI", category: "cloud", needsRegion: true, needsEndpoint: true, defaultRegion: "eastus", regions: AZURE_REGIONS },
|
|
5865
|
+
{ value: "groq", label: "Groq", category: "managed" },
|
|
5866
|
+
{ value: "mistral", label: "Mistral API", category: "managed" },
|
|
5867
|
+
{ value: "huggingface", label: "Hugging Face", category: "hosted", needsEndpoint: true },
|
|
5868
|
+
{ value: "ollama", label: "Ollama", category: "local", needsEndpoint: true },
|
|
5869
|
+
{ value: "custom", label: "Custom / OpenAI-compatible", category: "custom", needsEndpoint: true }
|
|
5870
|
+
];
|
|
5871
|
+
var PROVIDER_ICON = {
|
|
5872
|
+
anthropic_api: SparklesIcon,
|
|
5873
|
+
openai_api: BeakerIcon,
|
|
5874
|
+
aws_bedrock: CloudIcon,
|
|
5875
|
+
google_vertex: CloudIcon,
|
|
5876
|
+
azure_openai: CloudIcon,
|
|
5877
|
+
groq: BoltIcon,
|
|
5878
|
+
mistral: SparklesIcon,
|
|
5879
|
+
huggingface: ServerStackIcon,
|
|
5880
|
+
ollama: CpuChipIcon,
|
|
5881
|
+
custom: CodeBracketIcon
|
|
5882
|
+
};
|
|
5883
|
+
var PROVIDER_COLOR = {
|
|
5884
|
+
anthropic_api: "amber",
|
|
5885
|
+
openai_api: "emerald",
|
|
5886
|
+
aws_bedrock: "amber",
|
|
5887
|
+
google_vertex: "blue",
|
|
5888
|
+
azure_openai: "sky",
|
|
5889
|
+
groq: "purple",
|
|
5890
|
+
mistral: "pink",
|
|
5891
|
+
huggingface: "amber",
|
|
5892
|
+
ollama: "slate",
|
|
5893
|
+
custom: "slate"
|
|
5894
|
+
};
|
|
5895
|
+
var TOTAL_STEPS4 = 4;
|
|
5896
|
+
function ModelNewWizardPageView({
|
|
5897
|
+
labels,
|
|
5898
|
+
initialStep,
|
|
5899
|
+
onStepChange,
|
|
5900
|
+
onSubmit,
|
|
5901
|
+
onCancel,
|
|
5902
|
+
onTestConnection
|
|
5903
|
+
}) {
|
|
5904
|
+
const clampedInitial = Math.min(TOTAL_STEPS4, Math.max(1, initialStep ?? 1));
|
|
5905
|
+
const [step, setStep] = useState(clampedInitial);
|
|
5906
|
+
const [providerSlug, setProviderSlug] = useState("anthropic_api");
|
|
5907
|
+
const [name, setName] = useState("");
|
|
5908
|
+
const [region, setRegion] = useState("");
|
|
5909
|
+
const [endpoint, setEndpoint] = useState("");
|
|
5910
|
+
const [apiKey, setApiKey] = useState("");
|
|
5911
|
+
const [modelFilterItems, setModelFilterItems] = useState([]);
|
|
5912
|
+
const [modelFilterSelected, setModelFilterSelected] = useState([]);
|
|
5913
|
+
const [submitting, setSubmitting] = useState(false);
|
|
5914
|
+
const [touched, setTouched] = useState(false);
|
|
5915
|
+
const [testStatus, setTestStatus] = useState("idle");
|
|
5916
|
+
const preset = useMemo(
|
|
5917
|
+
() => MODEL_PROVIDERS.find((p) => p.value === providerSlug) ?? MODEL_PROVIDERS[0],
|
|
5918
|
+
[providerSlug]
|
|
5919
|
+
);
|
|
5920
|
+
useEffect(() => {
|
|
5921
|
+
if (preset.defaultRegion && !region) setRegion(preset.defaultRegion);
|
|
5922
|
+
}, [providerSlug]);
|
|
5923
|
+
useEffect(() => {
|
|
5924
|
+
const next = Math.min(TOTAL_STEPS4, Math.max(1, initialStep ?? 1));
|
|
5925
|
+
if (next !== step) setStep(next);
|
|
5926
|
+
}, [initialStep]);
|
|
5927
|
+
function markTouched() {
|
|
5928
|
+
if (!touched) setTouched(true);
|
|
5929
|
+
}
|
|
5930
|
+
const goToStep = useCallback((next) => {
|
|
5931
|
+
const clamped = Math.min(TOTAL_STEPS4, Math.max(1, next));
|
|
5932
|
+
setStep(clamped);
|
|
5933
|
+
onStepChange?.(clamped);
|
|
5934
|
+
}, [onStepChange]);
|
|
5935
|
+
function canAdvance(from) {
|
|
5936
|
+
if (from === 1) return Boolean(providerSlug);
|
|
5937
|
+
if (from === 2) return name.trim().length > 0;
|
|
5938
|
+
return true;
|
|
5939
|
+
}
|
|
5940
|
+
const goNext = useCallback(() => {
|
|
5941
|
+
if (!canAdvance(step)) return;
|
|
5942
|
+
if (step < TOTAL_STEPS4) goToStep(step + 1);
|
|
5943
|
+
}, [step, providerSlug, name]);
|
|
5944
|
+
const goBack = useCallback(() => {
|
|
5945
|
+
if (step > 1) goToStep(step - 1);
|
|
5946
|
+
}, [step, goToStep]);
|
|
5947
|
+
const cancelWithConfirm = useCallback(() => {
|
|
5948
|
+
if (touched && !window.confirm(labels.wizardCancelConfirm)) return;
|
|
5949
|
+
onCancel();
|
|
5950
|
+
}, [touched, labels.wizardCancelConfirm, onCancel]);
|
|
5951
|
+
function buildPayload() {
|
|
5952
|
+
return {
|
|
5953
|
+
providerSlug,
|
|
5954
|
+
name: name.trim(),
|
|
5955
|
+
region: region.trim() || void 0,
|
|
5956
|
+
endpoint: endpoint.trim() || void 0,
|
|
5957
|
+
apiKey: apiKey || void 0,
|
|
5958
|
+
modelFilters: modelFilterSelected.length > 0 ? [...modelFilterSelected] : void 0
|
|
5959
|
+
};
|
|
5960
|
+
}
|
|
5961
|
+
async function handleTestConnection() {
|
|
5962
|
+
if (!onTestConnection) return;
|
|
5963
|
+
setTestStatus("testing");
|
|
5964
|
+
try {
|
|
5965
|
+
const ok = await onTestConnection(buildPayload());
|
|
5966
|
+
setTestStatus(ok ? "success" : "failed");
|
|
5967
|
+
setTimeout(() => setTestStatus("idle"), 3500);
|
|
5968
|
+
} catch {
|
|
5969
|
+
setTestStatus("failed");
|
|
5970
|
+
setTimeout(() => setTestStatus("idle"), 3500);
|
|
5971
|
+
}
|
|
5972
|
+
}
|
|
5973
|
+
async function submit() {
|
|
5974
|
+
setSubmitting(true);
|
|
5975
|
+
try {
|
|
5976
|
+
await onSubmit(buildPayload());
|
|
5977
|
+
} finally {
|
|
5978
|
+
setSubmitting(false);
|
|
5979
|
+
}
|
|
5980
|
+
}
|
|
5981
|
+
const stepTitles = [labels.step1Title, labels.step2Title, labels.step3Title, labels.step4Title];
|
|
5982
|
+
const stepSubtitles = [labels.step1Subtitle, labels.step2Subtitle, labels.step3Subtitle, labels.step4Subtitle];
|
|
5983
|
+
const indicatorSteps = stepTitles.map((title, idx) => ({ id: String(idx + 1), title }));
|
|
5984
|
+
const hero = /* @__PURE__ */ jsx(
|
|
5985
|
+
HeroSection,
|
|
5986
|
+
{
|
|
5987
|
+
icon: /* @__PURE__ */ jsx(CubeTransparentIcon, { className: "h-5 w-5" }),
|
|
5988
|
+
label: labels.pageTitle,
|
|
5989
|
+
title: stepTitles[step - 1] ?? labels.pageTitle,
|
|
5990
|
+
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
5991
|
+
gradient: "from-emerald-500 to-teal-700",
|
|
5992
|
+
actions: /* @__PURE__ */ jsx(
|
|
5993
|
+
IconButton,
|
|
5994
|
+
{
|
|
5995
|
+
label: labels.wizardCancel,
|
|
5996
|
+
icon: /* @__PURE__ */ jsx(XMarkIcon, { className: "h-5 w-5" }),
|
|
5997
|
+
variant: "ghost",
|
|
5998
|
+
onClick: cancelWithConfirm
|
|
5999
|
+
}
|
|
6000
|
+
),
|
|
6001
|
+
children: /* @__PURE__ */ jsx(
|
|
6002
|
+
StepIndicator,
|
|
6003
|
+
{
|
|
6004
|
+
accent: "indigo",
|
|
6005
|
+
currentStep: step - 1,
|
|
6006
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
6007
|
+
progressLabel: labels.pageTitle,
|
|
6008
|
+
steps: indicatorSteps
|
|
6009
|
+
}
|
|
6010
|
+
)
|
|
6011
|
+
}
|
|
6012
|
+
);
|
|
6013
|
+
function renderStep1() {
|
|
6014
|
+
return /* @__PURE__ */ jsx(
|
|
6015
|
+
"div",
|
|
6016
|
+
{
|
|
6017
|
+
role: "radiogroup",
|
|
6018
|
+
"aria-label": labels.providerLabel,
|
|
6019
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
6020
|
+
children: MODEL_PROVIDERS.map((p) => {
|
|
6021
|
+
const Icon = PROVIDER_ICON[p.value] ?? GlobeAltIcon;
|
|
6022
|
+
const color = PROVIDER_COLOR[p.value] ?? "slate";
|
|
6023
|
+
const selected = providerSlug === p.value;
|
|
6024
|
+
return /* @__PURE__ */ jsx(
|
|
6025
|
+
FilterTileButton,
|
|
6026
|
+
{
|
|
6027
|
+
isActive: selected,
|
|
6028
|
+
color,
|
|
6029
|
+
icon: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }),
|
|
6030
|
+
label: p.label,
|
|
6031
|
+
count: p.category,
|
|
6032
|
+
onClick: () => {
|
|
6033
|
+
setProviderSlug(p.value);
|
|
6034
|
+
markTouched();
|
|
6035
|
+
}
|
|
6036
|
+
},
|
|
6037
|
+
p.value
|
|
6038
|
+
);
|
|
6039
|
+
})
|
|
6040
|
+
}
|
|
6041
|
+
);
|
|
6042
|
+
}
|
|
6043
|
+
function renderStep2() {
|
|
6044
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
6045
|
+
/* @__PURE__ */ jsx(
|
|
6046
|
+
FormInput,
|
|
6047
|
+
{
|
|
6048
|
+
label: labels.nameLabel,
|
|
6049
|
+
value: name,
|
|
6050
|
+
onValueChange: (v) => {
|
|
6051
|
+
setName(v);
|
|
6052
|
+
markTouched();
|
|
6053
|
+
},
|
|
6054
|
+
placeholder: labels.namePlaceholder || `${preset.label} \u2014 produ\xE7\xE3o`,
|
|
6055
|
+
required: true
|
|
6056
|
+
}
|
|
6057
|
+
),
|
|
6058
|
+
/* @__PURE__ */ jsx(
|
|
6059
|
+
FormInput,
|
|
6060
|
+
{
|
|
6061
|
+
label: labels.apiKeyLabel,
|
|
6062
|
+
type: "password",
|
|
6063
|
+
value: apiKey,
|
|
6064
|
+
onValueChange: (v) => {
|
|
6065
|
+
setApiKey(v);
|
|
6066
|
+
markTouched();
|
|
6067
|
+
},
|
|
6068
|
+
placeholder: labels.apiKeyPlaceholder
|
|
6069
|
+
}
|
|
6070
|
+
)
|
|
6071
|
+
] }) });
|
|
6072
|
+
}
|
|
6073
|
+
function renderStep3() {
|
|
6074
|
+
const showRegion = preset.needsRegion === true;
|
|
6075
|
+
const showEndpoint = preset.needsEndpoint === true;
|
|
6076
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
6077
|
+
/* @__PURE__ */ jsxs(FormGrid, { children: [
|
|
6078
|
+
showRegion && (preset.regions ? /* @__PURE__ */ jsx(
|
|
6079
|
+
FormSelect,
|
|
6080
|
+
{
|
|
6081
|
+
label: labels.regionLabel,
|
|
6082
|
+
value: region,
|
|
6083
|
+
onValueChange: (v) => {
|
|
6084
|
+
setRegion(v);
|
|
6085
|
+
markTouched();
|
|
6086
|
+
},
|
|
6087
|
+
options: [...preset.regions]
|
|
6088
|
+
}
|
|
6089
|
+
) : /* @__PURE__ */ jsx(
|
|
6090
|
+
FormInput,
|
|
6091
|
+
{
|
|
6092
|
+
label: labels.regionLabel,
|
|
6093
|
+
value: region,
|
|
6094
|
+
onValueChange: (v) => {
|
|
6095
|
+
setRegion(v);
|
|
6096
|
+
markTouched();
|
|
6097
|
+
},
|
|
6098
|
+
placeholder: labels.regionPlaceholder ?? preset.defaultRegion
|
|
6099
|
+
}
|
|
6100
|
+
)),
|
|
6101
|
+
showEndpoint && /* @__PURE__ */ jsx(
|
|
6102
|
+
FormInput,
|
|
6103
|
+
{
|
|
6104
|
+
label: labels.endpointLabel,
|
|
6105
|
+
type: "url",
|
|
6106
|
+
value: endpoint,
|
|
6107
|
+
onValueChange: (v) => {
|
|
6108
|
+
setEndpoint(v);
|
|
6109
|
+
markTouched();
|
|
6110
|
+
},
|
|
6111
|
+
placeholder: labels.endpointPlaceholder ?? "https://\u2026"
|
|
6112
|
+
}
|
|
6113
|
+
)
|
|
6114
|
+
] }),
|
|
6115
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
6116
|
+
/* @__PURE__ */ jsx("label", { className: "block text-xs font-medium text-slate-500 dark:text-slate-400", children: labels.modelFilterLabel }),
|
|
6117
|
+
/* @__PURE__ */ jsx(
|
|
6118
|
+
ChipPicker,
|
|
6119
|
+
{
|
|
6120
|
+
items: modelFilterItems,
|
|
6121
|
+
selectedIds: modelFilterSelected,
|
|
6122
|
+
onChange: (ids) => {
|
|
6123
|
+
setModelFilterSelected(ids);
|
|
6124
|
+
markTouched();
|
|
6125
|
+
},
|
|
6126
|
+
onItemsChange: (items) => {
|
|
6127
|
+
setModelFilterItems(items);
|
|
6128
|
+
markTouched();
|
|
6129
|
+
},
|
|
6130
|
+
allowCustom: true,
|
|
6131
|
+
showActions: false,
|
|
6132
|
+
addPlaceholder: labels.modelFilterPlaceholder,
|
|
6133
|
+
addAriaLabel: labels.modelFilterLabel
|
|
6134
|
+
}
|
|
6135
|
+
)
|
|
6136
|
+
] }),
|
|
6137
|
+
onTestConnection && /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex flex-wrap items-center gap-3 border-t pt-4", children: [
|
|
6138
|
+
/* @__PURE__ */ jsx(
|
|
6139
|
+
Button,
|
|
6140
|
+
{
|
|
6141
|
+
type: "button",
|
|
6142
|
+
outline: true,
|
|
6143
|
+
onClick: () => void handleTestConnection(),
|
|
6144
|
+
disabled: testStatus === "testing",
|
|
6145
|
+
children: testStatus === "testing" ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
6146
|
+
/* @__PURE__ */ jsx(Spinner, { size: "xs" }),
|
|
6147
|
+
labels.testing
|
|
6148
|
+
] }) : labels.testConnection
|
|
6149
|
+
}
|
|
6150
|
+
),
|
|
6151
|
+
testStatus === "success" && /* @__PURE__ */ jsx(StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
6152
|
+
testStatus === "failed" && /* @__PURE__ */ jsx(StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
6153
|
+
] })
|
|
6154
|
+
] });
|
|
6155
|
+
}
|
|
6156
|
+
function renderStep4() {
|
|
6157
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
6158
|
+
/* @__PURE__ */ jsx(
|
|
6159
|
+
ReviewBlock4,
|
|
6160
|
+
{
|
|
6161
|
+
stepTitle: labels.step1Title,
|
|
6162
|
+
stepSubtitle: labels.step1Subtitle,
|
|
6163
|
+
editLabel: labels.wizardReviewEdit,
|
|
6164
|
+
onEdit: () => goToStep(1),
|
|
6165
|
+
children: /* @__PURE__ */ jsx("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: /* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewProviderLabel, value: preset.label }) })
|
|
6166
|
+
}
|
|
6167
|
+
),
|
|
6168
|
+
/* @__PURE__ */ jsx(
|
|
6169
|
+
ReviewBlock4,
|
|
6170
|
+
{
|
|
6171
|
+
stepTitle: labels.step2Title,
|
|
6172
|
+
stepSubtitle: labels.step2Subtitle,
|
|
6173
|
+
editLabel: labels.wizardReviewEdit,
|
|
6174
|
+
onEdit: () => goToStep(2),
|
|
6175
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
6176
|
+
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
|
|
6177
|
+
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewApiKeyLabel, value: apiKey ? labels.reviewApiKeyRedacted : labels.reviewNoneValue })
|
|
6178
|
+
] })
|
|
6179
|
+
}
|
|
6180
|
+
),
|
|
6181
|
+
/* @__PURE__ */ jsx(
|
|
6182
|
+
ReviewBlock4,
|
|
6183
|
+
{
|
|
6184
|
+
stepTitle: labels.step3Title,
|
|
6185
|
+
stepSubtitle: labels.step3Subtitle,
|
|
6186
|
+
editLabel: labels.wizardReviewEdit,
|
|
6187
|
+
onEdit: () => goToStep(3),
|
|
6188
|
+
children: /* @__PURE__ */ jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
6189
|
+
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewRegionLabel, value: region || labels.reviewNoneValue }),
|
|
6190
|
+
/* @__PURE__ */ jsx(ReviewRow4, { label: labels.reviewEndpointLabel, value: endpoint || labels.reviewNoneValue }),
|
|
6191
|
+
/* @__PURE__ */ jsx(
|
|
6192
|
+
ReviewRow4,
|
|
6193
|
+
{
|
|
6194
|
+
label: labels.reviewModelsLabel,
|
|
6195
|
+
value: modelFilterSelected.length > 0 ? modelFilterSelected.join(", ") : labels.reviewNoneValue
|
|
6196
|
+
}
|
|
6197
|
+
)
|
|
6198
|
+
] })
|
|
6199
|
+
}
|
|
6200
|
+
)
|
|
6201
|
+
] });
|
|
6202
|
+
}
|
|
6203
|
+
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
|
|
6204
|
+
const advanceDisabled = !canAdvance(step);
|
|
6205
|
+
const isLast = step === TOTAL_STEPS4;
|
|
6206
|
+
const scrollableStep = step === 1 || step === 4;
|
|
6207
|
+
const bodyClass = scrollableStep ? "p-5 pt-5 sm:p-8 sm:pt-8 max-h-[60vh] overflow-y-auto" : "p-5 pt-5 sm:p-8 sm:pt-8";
|
|
6208
|
+
const footer = /* @__PURE__ */ jsxs("div", { className: "liquid-divider flex items-center justify-between border-t pt-4", children: [
|
|
6209
|
+
/* @__PURE__ */ jsx(Button, { type: "button", outline: true, onClick: step === 1 ? cancelWithConfirm : goBack, disabled: submitting, children: step === 1 ? labels.wizardCancel : labels.wizardBack }),
|
|
6210
|
+
isLast ? /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: () => void submit(), disabled: submitting || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate }) : /* @__PURE__ */ jsx(Button, { type: "button", color: "ios-glass-blue", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext })
|
|
6211
|
+
] });
|
|
6212
|
+
return /* @__PURE__ */ jsxs(
|
|
6213
|
+
"form",
|
|
6214
|
+
{
|
|
6215
|
+
onSubmit: (e) => {
|
|
6216
|
+
e.preventDefault();
|
|
6217
|
+
if (step < TOTAL_STEPS4) goNext();
|
|
6218
|
+
else void submit();
|
|
6219
|
+
},
|
|
6220
|
+
className: "space-y-4",
|
|
6221
|
+
children: [
|
|
6222
|
+
hero,
|
|
6223
|
+
/* @__PURE__ */ jsx(Card, { variant: "default", children: /* @__PURE__ */ jsx(CardContent, { className: bodyClass, children: stepBody }) }),
|
|
6224
|
+
footer
|
|
6225
|
+
]
|
|
6226
|
+
}
|
|
6227
|
+
);
|
|
6228
|
+
}
|
|
6229
|
+
function ReviewRow4({ label, value }) {
|
|
6230
|
+
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: [
|
|
6231
|
+
/* @__PURE__ */ jsx("dt", { className: "text-[10px] uppercase tracking-wider text-slate-400 dark:text-slate-500", children: label }),
|
|
6232
|
+
/* @__PURE__ */ jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-slate-900 dark:text-white", children: value })
|
|
6233
|
+
] });
|
|
6234
|
+
}
|
|
6235
|
+
function ReviewBlock4({
|
|
6236
|
+
stepTitle,
|
|
6237
|
+
stepSubtitle,
|
|
6238
|
+
editLabel,
|
|
6239
|
+
onEdit,
|
|
6240
|
+
children
|
|
6241
|
+
}) {
|
|
6242
|
+
return /* @__PURE__ */ jsxs("section", { className: "border-b liquid-divider pb-4 last:border-b-0 last:pb-0", children: [
|
|
6243
|
+
/* @__PURE__ */ jsxs("header", { className: "mb-2 flex items-start justify-between gap-3", children: [
|
|
6244
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
6245
|
+
/* @__PURE__ */ jsx("h4", { className: "truncate text-sm font-semibold text-slate-900 dark:text-white", children: stepTitle }),
|
|
6246
|
+
stepSubtitle && /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-slate-500 dark:text-slate-400", children: stepSubtitle })
|
|
6247
|
+
] }),
|
|
6248
|
+
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", outline: true, onClick: onEdit, children: [
|
|
6249
|
+
/* @__PURE__ */ jsx(PencilSquareIcon, { className: "h-4 w-4" }),
|
|
6250
|
+
/* @__PURE__ */ jsx("span", { className: "ml-1.5", children: editLabel })
|
|
6251
|
+
] })
|
|
6252
|
+
] }),
|
|
6253
|
+
children
|
|
6254
|
+
] });
|
|
6255
|
+
}
|
|
6256
|
+
function ModelNewModal({ open, onClose, ...wizardProps }) {
|
|
6257
|
+
return /* @__PURE__ */ jsx(
|
|
6258
|
+
GlassModal,
|
|
6259
|
+
{
|
|
6260
|
+
open,
|
|
6261
|
+
onClose,
|
|
6262
|
+
maxWidth: "2xl",
|
|
6263
|
+
closeOnBackdrop: false,
|
|
6264
|
+
closeLabel: wizardProps.labels.wizardCancel,
|
|
6265
|
+
children: /* @__PURE__ */ jsx(ModelNewWizardPageView, { ...wizardProps })
|
|
6266
|
+
}
|
|
6267
|
+
);
|
|
6268
|
+
}
|
|
5948
6269
|
|
|
5949
|
-
export { AgentNewWizardPageView, AgentsConfigPageView, AgentsIndexPageView, AgentsModelsPageView, AgentsPromptsPageView, AgentsToolDefinitionsPageView, AgentsWorkspacePageView, ConnectionsPageView, CredentialsPageView, DashboardPageView, DatasourceNewWizardPageView, DatasourcesPageView, RuleNewWizardPageView, RulesPageView, RunTimelinePageView, TOOL_TYPES, WorkflowRunsPageView, WorkflowsPageView, jsonSchemaToParameters, parametersToJsonSchema };
|
|
6270
|
+
export { AgentNewModal, AgentNewWizardPageView, AgentsConfigPageView, AgentsIndexPageView, AgentsModelsPageView, AgentsPromptsPageView, AgentsToolDefinitionsPageView, AgentsWorkspacePageView, ConnectionsPageView, CredentialsPageView, DashboardPageView, DatasourceNewModal, DatasourceNewWizardPageView, DatasourcesPageView, MODEL_PROVIDERS, ModelNewModal, ModelNewWizardPageView, RuleNewModal, RuleNewWizardPageView, RulesPageView, RunTimelinePageView, TOOL_TYPES, WorkflowRunsPageView, WorkflowsPageView, jsonSchemaToParameters, parametersToJsonSchema };
|
|
5950
6271
|
//# sourceMappingURL=index.mjs.map
|
|
5951
6272
|
//# sourceMappingURL=index.mjs.map
|