treege 3.0.0-beta.35 → 3.0.0-beta.37
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.
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import { a as e, c as t, d as n, i as r, l as i, r as a, t as o, u as s } from "./ThemeContext-DBFles56.js";
|
|
2
|
-
import { C as c, D as l, E as u, F as d, M as f, N as p, O as m,
|
|
3
|
-
import { Background as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { useForm as
|
|
6
|
-
import { AlignLeft as
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { Slot as
|
|
9
|
-
import { cva as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import { Toaster as
|
|
14
|
-
import * as
|
|
15
|
-
import
|
|
16
|
-
import { useTheme as Et } from "next-themes";
|
|
2
|
+
import { C as c, D as l, E as u, F as d, M as f, N as p, O as m, S as h, T as ee, _ as g, a as _, b as v, c as y, d as b, f as x, g as S, h as C, i as te, j as w, k as T, l as ne, m as re, n as E, o as D, p as O, r as ie, s as ae, t as k, u as oe, v as A, w as se, x as ce, y as j } from "./separator-Cdfv5nIR.js";
|
|
3
|
+
import { Background as le, BackgroundVariant as ue, BaseEdge as de, Controls as fe, EdgeLabelRenderer as pe, Handle as me, MiniMap as he, NodeResizer as ge, Panel as _e, Position as ve, ReactFlow as ye, ReactFlowProvider as be, addEdge as xe, getBezierPath as Se, useEdges as Ce, useNodes as we, useReactFlow as M } from "@xyflow/react";
|
|
4
|
+
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
5
|
+
import { useForm as I } from "@tanstack/react-form";
|
|
6
|
+
import { AlignLeft as Te, ArrowRightFromLine as Ee, Boxes as De, Calendar as Oe, CalendarRange as ke, CaseSensitive as Ae, Check as je, CheckSquare as Me, ChevronDown as Ne, ChevronsUpDown as Pe, CircleDot as Fe, Clock as Ie, Cloud as Le, Copy as Re, Download as ze, EllipsisVertical as Be, EyeOff as Ve, Hash as He, Heading as Ue, ImagePlus as We, KeyRound as Ge, Link2 as Ke, ListFilter as qe, Loader2 as Je, MapPin as Ye, Minus as Xe, MoreVertical as Ze, Paperclip as Qe, Plus as L, PlusCircle as $e, RectangleEllipsis as et, Save as tt, Search as nt, Send as rt, Settings as it, ToggleLeft as at, Trash2 as ot, Upload as st, Variable as ct, WandSparkles as lt, Waypoints as ut, X as R, XIcon as dt } from "lucide-react";
|
|
7
|
+
import { createContext as ft, memo as pt, useCallback as z, useContext as mt, useEffect as ht, useId as gt, useMemo as _t, useRef as vt, useState as B } from "react";
|
|
8
|
+
import { Slot as yt } from "@radix-ui/react-slot";
|
|
9
|
+
import { cva as bt } from "class-variance-authority";
|
|
10
|
+
import * as xt from "@radix-ui/react-scroll-area";
|
|
11
|
+
import * as V from "@radix-ui/react-dropdown-menu";
|
|
12
|
+
import * as H from "@radix-ui/react-dialog";
|
|
13
|
+
import { Toaster as St, toast as U } from "sonner";
|
|
14
|
+
import * as Ct from "@radix-ui/react-collapsible";
|
|
15
|
+
import { useTheme as wt } from "next-themes";
|
|
17
16
|
//#region src/editor/assets/img/treege-black.svg
|
|
18
|
-
var Dt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1809_3434)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1303%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.455%2046.7988C17.0611%2047.1509%2017.7491%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34V41.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.251%20116.58%20138.64L151.39%2078.3401C151.741%2077.7316%20151.926%2077.0413%20151.926%2076.3386C151.926%2075.636%20151.74%2074.9458%20151.389%2074.3375C151.037%2073.7293%20150.531%2073.2244%20149.922%2072.8738C149.313%2072.5231%20148.623%2072.3391%20147.92%2072.3401H92.48C91.4191%2072.3401%2090.4017%2072.7615%2089.6516%2073.5117C88.9014%2074.2618%2088.48%2075.2792%2088.48%2076.3401V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.469C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.3201H3.99999C3.29819%2072.3208%202.60893%2072.5061%202.00143%2072.8575C1.39392%2073.2089%200.88955%2073.7139%200.538962%2074.3218C0.188375%2074.9298%200.00390931%2075.6193%200.00408949%2076.3211C0.00426966%2077.0229%200.189089%2077.7123%200.539989%2078.3201L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.489C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.3101C63.4773%2075.2509%2063.0547%2074.2361%2062.3049%2073.4881C61.555%2072.7401%2060.5391%2072.3201%2059.48%2072.3201V72.3201Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='black'/%3e%3cdefs%3e%3cclipPath%20id='clip0_1809_3434'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", Ot = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2_65)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1302%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.4549%2046.7988C17.061%2047.1509%2017.749%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.25%20116.58%20138.64L151.39%2078.34C151.741%2077.7315%20151.926%2077.0412%20151.926%2076.3385C151.926%2075.6359%20151.74%2074.9457%20151.389%2074.3374C151.037%2073.7292%20150.531%2073.2243%20149.922%2072.8737C149.313%2072.523%20148.623%2072.339%20147.92%2072.34H92.48C91.4191%2072.34%2090.4017%2072.7614%2089.6516%2073.5116C88.9014%2074.2617%2088.48%2075.2791%2088.48%2076.34V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.468C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.32H4C3.2982%2072.3207%202.60894%2072.5061%202.00143%2072.8574C1.39393%2073.2088%200.889558%2073.7138%200.53897%2074.3218C0.188382%2074.9297%200.00391694%2075.6192%200.00409712%2076.321C0.00427729%2077.0228%200.189097%2077.7122%200.539997%2078.32L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.488C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.31C63.4773%2075.2509%2063.0548%2074.236%2062.3049%2073.488C61.555%2072.7401%2060.5391%2072.32%2059.48%2072.32Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_2_65'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", kt = ({ theme: e = "dark" }) => /* @__PURE__ */ N("div", {
|
|
17
|
+
var Tt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1809_3434)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1303%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.455%2046.7988C17.0611%2047.1509%2017.7491%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34V41.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.251%20116.58%20138.64L151.39%2078.3401C151.741%2077.7316%20151.926%2077.0413%20151.926%2076.3386C151.926%2075.636%20151.74%2074.9458%20151.389%2074.3375C151.037%2073.7293%20150.531%2073.2244%20149.922%2072.8738C149.313%2072.5231%20148.623%2072.3391%20147.92%2072.3401H92.48C91.4191%2072.3401%2090.4017%2072.7615%2089.6516%2073.5117C88.9014%2074.2618%2088.48%2075.2792%2088.48%2076.3401V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.469C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.3201H3.99999C3.29819%2072.3208%202.60893%2072.5061%202.00143%2072.8575C1.39392%2073.2089%200.88955%2073.7139%200.538962%2074.3218C0.188375%2074.9298%200.00390931%2075.6193%200.00408949%2076.3211C0.00426966%2077.0229%200.189089%2077.7123%200.539989%2078.3201L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.489C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.3101C63.4773%2075.2509%2063.0547%2074.2361%2062.3049%2073.4881C61.555%2072.7401%2060.5391%2072.3201%2059.48%2072.3201V72.3201Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='black'/%3e%3cdefs%3e%3cclipPath%20id='clip0_1809_3434'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", Et = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%200%20462%20144'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2_65)'%3e%3cpath%20d='M137%2041.34L116.57%206C116.22%205.39399%20115.717%204.89037%20115.112%204.53942C114.507%204.18847%20113.82%204.00247%20113.12%204H38.83C38.1302%204.00247%2037.4434%204.18847%2036.838%204.53942C36.2326%204.89037%2035.7299%205.39399%2035.38%206L15%2041.34C14.6495%2041.947%2014.4647%2042.6355%2014.4641%2043.3365C14.4635%2044.0374%2014.6471%2044.7262%2014.9965%2045.3339C15.3459%2045.9416%2015.8488%2046.4467%2016.4549%2046.7988C17.061%2047.1509%2017.749%2047.3375%2018.45%2047.34H133.53C134.233%2047.341%20134.923%2047.157%20135.532%2046.8063C136.141%2046.4557%20136.647%2045.9508%20136.999%2045.3426C137.35%2044.7343%20137.536%2044.0441%20137.536%2043.3415C137.536%2042.6388%20137.351%2041.9485%20137%2041.34Z'%20fill='%2311D3B4'/%3e%3cpath%20d='M92.48%20140.64H113.1C113.805%20140.643%20114.498%20140.459%20115.109%20140.108C115.72%20139.757%20116.228%20139.25%20116.58%20138.64L151.39%2078.34C151.741%2077.7315%20151.926%2077.0412%20151.926%2076.3385C151.926%2075.6359%20151.74%2074.9457%20151.389%2074.3374C151.037%2073.7292%20150.531%2073.2243%20149.922%2072.8737C149.313%2072.523%20148.623%2072.339%20147.92%2072.34H92.48C91.4191%2072.34%2090.4017%2072.7614%2089.6516%2073.5116C88.9014%2074.2617%2088.48%2075.2791%2088.48%2076.34V136.64C88.48%20137.701%2088.9014%20138.718%2089.6516%20139.468C90.4017%20140.219%2091.4191%20140.64%2092.48%20140.64Z'%20fill='%23007EF6'/%3e%3cpath%20d='M59.48%2072.32H4C3.2982%2072.3207%202.60894%2072.5061%202.00143%2072.8574C1.39393%2073.2088%200.889558%2073.7138%200.53897%2074.3218C0.188382%2074.9297%200.00391694%2075.6192%200.00409712%2076.321C0.00427729%2077.0228%200.189097%2077.7122%200.539997%2078.32L35.38%20138.66C35.7299%20139.266%2036.2326%20139.77%2036.838%20140.121C37.4434%20140.472%2038.1302%20140.658%2038.83%20140.66H59.48C60.5409%20140.66%2061.5583%20140.239%2062.3084%20139.488C63.0586%20138.738%2063.48%20137.721%2063.48%20136.66V76.31C63.4773%2075.2509%2063.0548%2074.236%2062.3049%2073.488C61.555%2072.7401%2060.5391%2072.32%2059.48%2072.32Z'%20fill='%230164A8'/%3e%3c/g%3e%3cpath%20d='M207.52%20106.96C202.272%20106.96%20198.368%20105.584%20195.808%20102.832C193.312%20100.08%20192.064%2096.336%20192.064%2091.6V70.48H185.632V60.496H192.064V50.704L205.024%2046.864V60.496H216.544L215.776%2070.48H205.024V90.736C205.024%2093.232%20205.6%2094.96%20206.752%2095.92C207.904%2096.816%20209.696%2097.264%20212.128%2097.264C213.92%2097.264%20215.776%2096.944%20217.696%2096.304V105.232C216.288%20105.808%20214.752%20106.224%20213.088%20106.48C211.424%20106.8%20209.568%20106.96%20207.52%20106.96ZM224.347%20106V60.496H236.347L236.923%2065.2C238.971%2063.92%20241.499%2062.768%20244.507%2061.744C247.579%2060.656%20250.587%2059.92%20253.531%2059.536V69.328C251.803%2069.584%20249.915%2069.968%20247.867%2070.48C245.819%2070.992%20243.867%2071.568%20242.011%2072.208C240.155%2072.848%20238.587%2073.52%20237.307%2074.224V106H224.347ZM281.997%20106.96C274.125%20106.96%20267.885%20105.008%20263.277%20101.104C258.669%2097.136%20256.365%2091.152%20256.365%2083.152C256.365%2075.92%20258.285%2070.192%20262.125%2065.968C266.029%2061.68%20271.821%2059.536%20279.501%2059.536C286.541%2059.536%20291.917%2061.392%20295.629%2065.104C299.405%2068.752%20301.292%2073.552%20301.292%2079.504V87.76H268.365C269.069%2091.408%20270.733%2093.904%20273.357%2095.248C276.045%2096.592%20279.821%2097.264%20284.685%2097.264C287.117%2097.264%20289.581%2097.04%20292.077%2096.592C294.637%2096.144%20296.813%2095.568%20298.605%2094.864V104.08C296.493%20105.04%20294.029%20105.744%20291.213%20106.192C288.397%20106.704%20285.325%20106.96%20281.997%20106.96ZM268.365%2079.792H289.965V77.296C289.965%2074.672%20289.197%2072.624%20287.661%2071.152C286.125%2069.616%20283.533%2068.848%20279.885%2068.848C275.597%2068.848%20272.589%2069.712%20270.861%2071.44C269.197%2073.168%20268.365%2075.952%20268.365%2079.792ZM334.028%20106.96C326.156%20106.96%20319.916%20105.008%20315.308%20101.104C310.7%2097.136%20308.396%2091.152%20308.396%2083.152C308.396%2075.92%20310.316%2070.192%20314.156%2065.968C318.06%2061.68%20323.852%2059.536%20331.532%2059.536C338.572%2059.536%20343.948%2061.392%20347.66%2065.104C351.436%2068.752%20353.324%2073.552%20353.324%2079.504V87.76H320.396C321.1%2091.408%20322.764%2093.904%20325.388%2095.248C328.076%2096.592%20331.852%2097.264%20336.716%2097.264C339.148%2097.264%20341.612%2097.04%20344.108%2096.592C346.668%2096.144%20348.844%2095.568%20350.636%2094.864V104.08C348.524%20105.04%20346.06%20105.744%20343.244%20106.192C340.428%20106.704%20337.356%20106.96%20334.028%20106.96ZM320.396%2079.792H341.996V77.296C341.996%2074.672%20341.228%2072.624%20339.692%2071.152C338.156%2069.616%20335.564%2068.848%20331.916%2068.848C327.628%2068.848%20324.62%2069.712%20322.892%2071.44C321.228%2073.168%20320.396%2075.952%20320.396%2079.792ZM381.547%20122.896C378.155%20122.896%20374.667%20122.672%20371.083%20122.224C367.563%20121.776%20364.587%20121.136%20362.155%20120.304V110.608C364.715%20111.44%20367.723%20112.08%20371.179%20112.528C374.635%20113.04%20377.867%20113.296%20380.875%20113.296C385.291%20113.296%20388.491%20113.04%20390.475%20112.528C392.459%20112.08%20393.451%20111.248%20393.451%20110.032C393.451%20109.008%20393.003%20108.304%20392.107%20107.92C391.275%20107.536%20389.483%20107.344%20386.731%20107.344H374.347C366.219%20107.344%20362.155%20104.336%20362.155%2098.32C362.155%2096.464%20362.667%2094.768%20363.691%2093.232C364.715%2091.696%20366.347%2090.48%20368.587%2089.584C363.403%2086.96%20360.811%2082.544%20360.811%2076.336C360.811%2070.448%20362.635%2066.192%20366.283%2063.568C369.931%2060.88%20375.339%2059.536%20382.507%2059.536C383.979%2059.536%20385.579%2059.664%20387.307%2059.92C389.099%2060.112%20390.443%2060.304%20391.339%2060.496H408.427L408.139%2068.656H400.939C402.923%2070.512%20403.915%2073.104%20403.915%2076.432C403.915%2081.104%20402.443%2084.848%20399.499%2087.664C396.555%2090.416%20392.203%2091.792%20386.443%2091.792C385.419%2091.792%20384.427%2091.76%20383.467%2091.696C382.571%2091.568%20381.643%2091.44%20380.683%2091.312C378.763%2091.568%20377.131%2092.016%20375.787%2092.656C374.507%2093.296%20373.867%2094.16%20373.867%2095.248C373.867%2096.72%20375.179%2097.456%20377.803%2097.456H390.667C395.275%2097.456%20398.827%2098.512%20401.323%20100.624C403.819%20102.672%20405.067%20105.68%20405.067%20109.648C405.067%20114.128%20403.051%20117.456%20399.019%20119.632C394.987%20121.808%20389.163%20122.896%20381.547%20122.896ZM382.603%2084.496C386.443%2084.496%20389.099%2083.856%20390.571%2082.576C392.107%2081.232%20392.875%2078.992%20392.875%2075.856C392.875%2072.72%20392.107%2070.448%20390.571%2069.04C389.099%2067.632%20386.443%2066.928%20382.603%2066.928C378.955%2066.928%20376.331%2067.632%20374.731%2069.04C373.131%2070.384%20372.331%2072.656%20372.331%2075.856C372.331%2078.8%20373.067%2080.976%20374.539%2082.384C376.075%2083.792%20378.763%2084.496%20382.603%2084.496ZM439.028%20106.96C431.156%20106.96%20424.916%20105.008%20420.308%20101.104C415.7%2097.136%20413.396%2091.152%20413.396%2083.152C413.396%2075.92%20415.316%2070.192%20419.156%2065.968C423.06%2061.68%20428.852%2059.536%20436.532%2059.536C443.572%2059.536%20448.948%2061.392%20452.66%2065.104C456.436%2068.752%20458.324%2073.552%20458.324%2079.504V87.76H425.396C426.1%2091.408%20427.764%2093.904%20430.388%2095.248C433.076%2096.592%20436.852%2097.264%20441.716%2097.264C444.148%2097.264%20446.612%2097.04%20449.108%2096.592C451.668%2096.144%20453.844%2095.568%20455.636%2094.864V104.08C453.524%20105.04%20451.06%20105.744%20448.244%20106.192C445.428%20106.704%20442.356%20106.96%20439.028%20106.96ZM425.396%2079.792H446.996V77.296C446.996%2074.672%20446.228%2072.624%20444.692%2071.152C443.156%2069.616%20440.564%2068.848%20436.916%2068.848C432.628%2068.848%20429.62%2069.712%20427.892%2071.44C426.228%2073.168%20425.396%2075.952%20425.396%2079.792Z'%20fill='white'/%3e%3cdefs%3e%3cclipPath%20id='clip0_2_65'%3e%3crect%20width='151.93'%20height='136.64'%20fill='white'%20transform='translate(0%204)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e", Dt = ({ theme: e = "dark" }) => /* @__PURE__ */ P("div", {
|
|
19
18
|
className: "absolute top-5 left-5 z-50 select-none",
|
|
20
|
-
children: /* @__PURE__ */
|
|
21
|
-
src: e === "dark" ?
|
|
19
|
+
children: /* @__PURE__ */ P("img", {
|
|
20
|
+
src: e === "dark" ? Et : Tt,
|
|
22
21
|
alt: "Treege",
|
|
23
22
|
className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
|
|
24
23
|
})
|
|
25
|
-
}),
|
|
26
|
-
let t =
|
|
27
|
-
return
|
|
24
|
+
}), Ot = (e) => {
|
|
25
|
+
let t = we(), n = Ce();
|
|
26
|
+
return _t(() => {
|
|
28
27
|
if (!e) return [];
|
|
29
28
|
let r = (e, t = /* @__PURE__ */ new Set()) => {
|
|
30
29
|
if (t.has(e)) return [];
|
|
@@ -45,8 +44,8 @@ var Dt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
45
44
|
t,
|
|
46
45
|
n
|
|
47
46
|
]);
|
|
48
|
-
},
|
|
49
|
-
let [n, r] =
|
|
47
|
+
}, kt = ft(null), At = ({ children: e, value: t }) => {
|
|
48
|
+
let [n, r] = B(t?.flowId), [i, a] = B(!1), [o, s] = B(null), c = _t(() => ({
|
|
50
49
|
...t,
|
|
51
50
|
...t?.aiConfig && { aiConfig: {
|
|
52
51
|
...t.aiConfig,
|
|
@@ -65,11 +64,11 @@ var Dt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
65
64
|
i,
|
|
66
65
|
o
|
|
67
66
|
]);
|
|
68
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ P(kt.Provider, {
|
|
69
68
|
value: c,
|
|
70
69
|
children: e
|
|
71
70
|
});
|
|
72
|
-
}, W = () =>
|
|
71
|
+
}, W = () => mt(kt) ?? {
|
|
73
72
|
closeDeleteNodeConfirmation: () => {},
|
|
74
73
|
flowId: void 0,
|
|
75
74
|
isNodeSheetOpen: !1,
|
|
@@ -84,29 +83,29 @@ var Dt = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
84
83
|
};
|
|
85
84
|
//#endregion
|
|
86
85
|
//#region src/shared/components/ui/scroll-area.tsx
|
|
87
|
-
function
|
|
88
|
-
return /* @__PURE__ */
|
|
86
|
+
function jt({ className: e, children: t, ...n }) {
|
|
87
|
+
return /* @__PURE__ */ F(xt.Root, {
|
|
89
88
|
"data-slot": "scroll-area",
|
|
90
89
|
className: d("relative", e),
|
|
91
90
|
...n,
|
|
92
91
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ P(xt.Viewport, {
|
|
94
93
|
"data-slot": "scroll-area-viewport",
|
|
95
94
|
className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
96
95
|
children: t
|
|
97
96
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ P(Mt, {}),
|
|
98
|
+
/* @__PURE__ */ P(xt.Corner, {})
|
|
100
99
|
]
|
|
101
100
|
});
|
|
102
101
|
}
|
|
103
|
-
function
|
|
104
|
-
return /* @__PURE__ */
|
|
102
|
+
function Mt({ className: e, orientation: t = "vertical", ...n }) {
|
|
103
|
+
return /* @__PURE__ */ P(xt.ScrollAreaScrollbar, {
|
|
105
104
|
"data-slot": "scroll-area-scrollbar",
|
|
106
105
|
orientation: t,
|
|
107
106
|
className: d("flex touch-none select-none p-px transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
|
|
108
107
|
...n,
|
|
109
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ P(xt.ScrollAreaThumb, {
|
|
110
109
|
"data-slot": "scroll-area-thumb",
|
|
111
110
|
className: "relative flex-1 rounded-full bg-border"
|
|
112
111
|
})
|
|
@@ -114,24 +113,24 @@ function Pt({ className: e, orientation: t = "vertical", ...n }) {
|
|
|
114
113
|
}
|
|
115
114
|
//#endregion
|
|
116
115
|
//#region src/editor/constants/edgeTypes.ts
|
|
117
|
-
var
|
|
118
|
-
conditional:
|
|
119
|
-
let [S, C
|
|
116
|
+
var Nt = {
|
|
117
|
+
conditional: pt(({ id: e, target: t, sourceX: n, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: d, markerEnd: _, style: y, data: b }) => {
|
|
118
|
+
let [x, S, C] = Se({
|
|
120
119
|
sourcePosition: s,
|
|
121
120
|
sourceX: n,
|
|
122
121
|
sourceY: i,
|
|
123
122
|
targetPosition: d,
|
|
124
123
|
targetX: a,
|
|
125
124
|
targetY: o
|
|
126
|
-
}), [
|
|
125
|
+
}), [te, ne] = B(!1), { updateEdgeData: re } = M(), E = Ot(t), D = b?.conditions && b.conditions.length > 0, O = G(), { handleSubmit: ie, reset: ae, Field: k } = I({
|
|
127
126
|
defaultValues: {
|
|
128
|
-
conditions:
|
|
129
|
-
field:
|
|
127
|
+
conditions: b?.conditions || [{
|
|
128
|
+
field: E[0]?.nodeId ?? "",
|
|
130
129
|
operator: "===",
|
|
131
130
|
value: ""
|
|
132
131
|
}],
|
|
133
|
-
isFallback: !!
|
|
134
|
-
label:
|
|
132
|
+
isFallback: !!b?.isFallback,
|
|
133
|
+
label: b?.label || ""
|
|
135
134
|
},
|
|
136
135
|
listeners: {
|
|
137
136
|
onChange: ({ formApi: e }) => {
|
|
@@ -140,153 +139,153 @@ var Ft = {
|
|
|
140
139
|
onChangeDebounceMs: 150
|
|
141
140
|
},
|
|
142
141
|
onSubmit: ({ value: t }) => {
|
|
143
|
-
|
|
142
|
+
re(e, t);
|
|
144
143
|
}
|
|
145
|
-
}),
|
|
144
|
+
}), oe = (e) => {
|
|
146
145
|
e.stopPropagation();
|
|
147
146
|
}, ce = () => {
|
|
148
|
-
|
|
147
|
+
ae({
|
|
149
148
|
conditions: [],
|
|
150
149
|
isFallback: !1,
|
|
151
150
|
label: ""
|
|
152
|
-
}),
|
|
151
|
+
}), re(e, {
|
|
153
152
|
conditions: void 0,
|
|
154
153
|
isFallback: void 0,
|
|
155
154
|
label: void 0
|
|
156
155
|
});
|
|
157
|
-
},
|
|
158
|
-
if (
|
|
159
|
-
if (!
|
|
160
|
-
if (
|
|
161
|
-
let e =
|
|
162
|
-
if (e.length === 1) return `${
|
|
156
|
+
}, j = () => {
|
|
157
|
+
if (b?.isFallback) return b.label || O("editor.conditionalEdge.fallback");
|
|
158
|
+
if (!D) return null;
|
|
159
|
+
if (b.label) return b.label;
|
|
160
|
+
let e = b.conditions;
|
|
161
|
+
if (e.length === 1) return `${E.find((t) => t.nodeId === e[0].field)?.label || e[0].field} ${e[0].operator} ${e[0].value}`;
|
|
163
162
|
let t = e.filter((e) => e.logicalOperator === r.AND).length, n = e.filter((e) => e.logicalOperator === r.OR).length;
|
|
164
|
-
return t > 0 && n === 0 ? `${e.length} ${
|
|
165
|
-
},
|
|
166
|
-
return /* @__PURE__ */
|
|
167
|
-
path:
|
|
168
|
-
markerEnd:
|
|
163
|
+
return t > 0 && n === 0 ? `${e.length} ${O("editor.conditionalEdge.conditionsAnd")}` : n > 0 && t === 0 ? `${e.length} ${O("editor.conditionalEdge.conditionsOr")}` : `${e.length} ${O("editor.conditionalEdge.conditionsMixed")}`;
|
|
164
|
+
}, le = () => b?.isFallback ? "var(--color-chart-4)" : D ? "var(--color-chart-2)" : "var(--color-chart-3)";
|
|
165
|
+
return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(de, {
|
|
166
|
+
path: x,
|
|
167
|
+
markerEnd: _,
|
|
169
168
|
style: {
|
|
170
169
|
...y,
|
|
171
|
-
stroke:
|
|
172
|
-
strokeDasharray:
|
|
173
|
-
strokeWidth:
|
|
170
|
+
stroke: le(),
|
|
171
|
+
strokeDasharray: b?.isFallback ? "5,5" : void 0,
|
|
172
|
+
strokeWidth: D || b?.isFallback ? 2 : y?.strokeWidth
|
|
174
173
|
}
|
|
175
|
-
}), /* @__PURE__ */
|
|
174
|
+
}), /* @__PURE__ */ P(pe, { children: /* @__PURE__ */ P("div", {
|
|
176
175
|
className: "nodrag nopan absolute",
|
|
177
176
|
style: {
|
|
178
177
|
pointerEvents: "all",
|
|
179
|
-
transform: `translate(-50%, -50%) translate(${
|
|
178
|
+
transform: `translate(-50%, -50%) translate(${S}px,${C}px)`
|
|
180
179
|
},
|
|
181
|
-
children: /* @__PURE__ */
|
|
182
|
-
open:
|
|
183
|
-
onOpenChange:
|
|
184
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ F(se, {
|
|
181
|
+
open: te,
|
|
182
|
+
onOpenChange: ne,
|
|
183
|
+
children: [/* @__PURE__ */ P(u, {
|
|
185
184
|
asChild: !0,
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
variant:
|
|
185
|
+
children: /* @__PURE__ */ F(p, {
|
|
186
|
+
variant: D || b?.isFallback ? "default" : "secondary",
|
|
188
187
|
className: "h-8 px-2 text-xs",
|
|
189
|
-
onClick:
|
|
190
|
-
children: [/* @__PURE__ */
|
|
188
|
+
onClick: oe,
|
|
189
|
+
children: [/* @__PURE__ */ P(ut, { className: "mr-1 h-3 w-3" }), D || b?.isFallback ? j() : O("editor.conditionalEdge.condition")]
|
|
191
190
|
})
|
|
192
|
-
}), /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ P(ee, {
|
|
193
192
|
className: "w-96 p-1",
|
|
194
193
|
align: "center",
|
|
195
194
|
onClick: (e) => e.stopPropagation(),
|
|
196
|
-
children: /* @__PURE__ */
|
|
195
|
+
children: /* @__PURE__ */ P(jt, {
|
|
197
196
|
className: "flex max-h-150 flex-col p-3",
|
|
198
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ P("form", {
|
|
199
198
|
onSubmit: (e) => {
|
|
200
199
|
e.preventDefault(), e.stopPropagation();
|
|
201
200
|
},
|
|
202
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ F("div", {
|
|
203
202
|
className: "grid gap-5",
|
|
204
203
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ F("div", {
|
|
206
205
|
className: "space-y-2",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
208
207
|
className: "font-medium leading-none",
|
|
209
|
-
children:
|
|
210
|
-
}), /* @__PURE__ */
|
|
208
|
+
children: O("editor.conditionalEdge.displayConditions")
|
|
209
|
+
}), /* @__PURE__ */ P("p", {
|
|
211
210
|
className: "text-muted-foreground text-sm",
|
|
212
|
-
children:
|
|
211
|
+
children: O("editor.conditionalEdge.displayConditionsDesc")
|
|
213
212
|
})]
|
|
214
213
|
}),
|
|
215
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ F("div", {
|
|
216
215
|
className: "grid gap-4",
|
|
217
216
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ P(k, {
|
|
219
218
|
name: "label",
|
|
220
|
-
children: (e) => /* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */
|
|
219
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
220
|
+
/* @__PURE__ */ P(l, {
|
|
222
221
|
htmlFor: e.name,
|
|
223
|
-
children:
|
|
222
|
+
children: O("editor.conditionalEdge.labelOptional")
|
|
224
223
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ P(m, {
|
|
226
225
|
id: e.name,
|
|
227
|
-
placeholder:
|
|
226
|
+
placeholder: O("editor.conditionalEdge.labelPlaceholder"),
|
|
228
227
|
value: e.state.value,
|
|
229
228
|
onChange: (t) => e.handleChange(t.target.value)
|
|
230
229
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ P(T, { children: O("editor.conditionalEdge.labelDesc") })
|
|
232
231
|
] })
|
|
233
232
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ P(k, {
|
|
235
234
|
name: "isFallback",
|
|
236
|
-
children: (e) => /* @__PURE__ */
|
|
235
|
+
children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
|
|
237
236
|
className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ P(f, {
|
|
239
238
|
id: e.name,
|
|
240
239
|
checked: e.state.value,
|
|
241
240
|
onCheckedChange: (t) => e.handleChange(t)
|
|
242
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ F("div", {
|
|
243
242
|
className: "flex flex-col gap-1",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ P(l, {
|
|
245
244
|
htmlFor: e.name,
|
|
246
245
|
className: "cursor-pointer font-medium",
|
|
247
|
-
children:
|
|
248
|
-
}), /* @__PURE__ */
|
|
246
|
+
children: O("editor.conditionalEdge.fallbackPath")
|
|
247
|
+
}), /* @__PURE__ */ P(T, {
|
|
249
248
|
className: "text-xs",
|
|
250
|
-
children:
|
|
249
|
+
children: O("editor.conditionalEdge.fallbackPathDesc")
|
|
251
250
|
})]
|
|
252
251
|
})]
|
|
253
252
|
}) })
|
|
254
253
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ P(k, {
|
|
256
255
|
name: "conditions",
|
|
257
256
|
mode: "array",
|
|
258
257
|
children: (e) => {
|
|
259
258
|
let t = e.form.getFieldValue("isFallback");
|
|
260
|
-
return /* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ F("div", {
|
|
261
260
|
className: "space-y-3",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ P(l, {
|
|
263
262
|
className: t ? "text-muted-foreground" : "",
|
|
264
|
-
children:
|
|
265
|
-
}), /* @__PURE__ */
|
|
263
|
+
children: O("editor.conditionalEdge.conditions")
|
|
264
|
+
}), /* @__PURE__ */ F("div", {
|
|
266
265
|
className: "space-y-2",
|
|
267
|
-
children: [e.state.value?.map((n, i) => /* @__PURE__ */
|
|
266
|
+
children: [e.state.value?.map((n, i) => /* @__PURE__ */ F("div", {
|
|
268
267
|
className: "space-y-2",
|
|
269
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ F("div", {
|
|
270
269
|
className: "space-y-2 rounded-lg border bg-muted/30 p-3",
|
|
271
270
|
children: [
|
|
272
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ P(k, {
|
|
273
272
|
name: `conditions[${i}].field`,
|
|
274
|
-
children: (e) => /* @__PURE__ */
|
|
273
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
275
274
|
htmlFor: `field-${i}`,
|
|
276
|
-
children:
|
|
277
|
-
}), /* @__PURE__ */
|
|
275
|
+
children: O("editor.conditionalEdge.field")
|
|
276
|
+
}), /* @__PURE__ */ F(g, {
|
|
278
277
|
disabled: t,
|
|
279
278
|
value: e.state.value || "",
|
|
280
279
|
onValueChange: (t) => e.handleChange(t),
|
|
281
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ P(h, {
|
|
282
281
|
id: `field-${i}`,
|
|
283
282
|
className: "w-full",
|
|
284
|
-
children: /* @__PURE__ */
|
|
285
|
-
}), /* @__PURE__ */
|
|
283
|
+
children: /* @__PURE__ */ P(c, { placeholder: O("editor.conditionalEdge.selectField") })
|
|
284
|
+
}), /* @__PURE__ */ P(A, { children: E.length === 0 ? /* @__PURE__ */ P(v, {
|
|
286
285
|
value: "none",
|
|
287
286
|
disabled: !0,
|
|
288
|
-
children:
|
|
289
|
-
}) :
|
|
287
|
+
children: O("editor.conditionalEdge.noFieldsAvailable")
|
|
288
|
+
}) : E.map((e) => /* @__PURE__ */ F(v, {
|
|
290
289
|
value: e.nodeId,
|
|
291
290
|
children: [
|
|
292
291
|
e.label,
|
|
@@ -297,98 +296,98 @@ var Ft = {
|
|
|
297
296
|
}, e.nodeId)) })]
|
|
298
297
|
})] })
|
|
299
298
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ F("div", {
|
|
301
300
|
className: "flex gap-2",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ P(k, {
|
|
303
302
|
name: `conditions[${i}].operator`,
|
|
304
|
-
children: (e) => /* @__PURE__ */
|
|
303
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
305
304
|
htmlFor: `operator-${i}`,
|
|
306
|
-
children:
|
|
307
|
-
}), /* @__PURE__ */
|
|
305
|
+
children: O("editor.conditionalEdge.operator")
|
|
306
|
+
}), /* @__PURE__ */ F(g, {
|
|
308
307
|
disabled: t,
|
|
309
308
|
value: e.state.value || "===",
|
|
310
309
|
onValueChange: (t) => e.handleChange(t),
|
|
311
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ P(h, {
|
|
312
311
|
id: `operator-${i}`,
|
|
313
|
-
children: /* @__PURE__ */
|
|
314
|
-
}), /* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ P(c, {})
|
|
313
|
+
}), /* @__PURE__ */ F(A, { children: [
|
|
314
|
+
/* @__PURE__ */ P(v, {
|
|
316
315
|
value: "===",
|
|
317
316
|
children: "="
|
|
318
317
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ P(v, {
|
|
320
319
|
value: "!==",
|
|
321
320
|
children: "≠"
|
|
322
321
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ P(v, {
|
|
324
323
|
value: ">",
|
|
325
324
|
children: ">"
|
|
326
325
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ P(v, {
|
|
328
327
|
value: "<",
|
|
329
328
|
children: "<"
|
|
330
329
|
}),
|
|
331
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ P(v, {
|
|
332
331
|
value: ">=",
|
|
333
332
|
children: ">="
|
|
334
333
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ P(v, {
|
|
336
335
|
value: "<=",
|
|
337
336
|
children: "<="
|
|
338
337
|
})
|
|
339
338
|
] })]
|
|
340
339
|
})] })
|
|
341
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ P(k, {
|
|
342
341
|
name: `conditions[${i}].value`,
|
|
343
|
-
children: (e) => /* @__PURE__ */
|
|
342
|
+
children: (e) => /* @__PURE__ */ F(w, {
|
|
344
343
|
className: "w-full",
|
|
345
|
-
children: [/* @__PURE__ */
|
|
344
|
+
children: [/* @__PURE__ */ P(l, {
|
|
346
345
|
htmlFor: `value-${i}`,
|
|
347
|
-
children:
|
|
348
|
-
}), /* @__PURE__ */
|
|
346
|
+
children: O("editor.conditionalEdge.value")
|
|
347
|
+
}), /* @__PURE__ */ P(m, {
|
|
349
348
|
disabled: t,
|
|
350
349
|
id: `value-${i}`,
|
|
351
|
-
placeholder:
|
|
350
|
+
placeholder: O("editor.conditionalEdge.valuePlaceholder"),
|
|
352
351
|
value: e.state.value || "",
|
|
353
352
|
onChange: (t) => e.handleChange(t.target.value)
|
|
354
353
|
})]
|
|
355
354
|
})
|
|
356
355
|
})]
|
|
357
356
|
}),
|
|
358
|
-
e.state.value && e.state.value.length > 1 && /* @__PURE__ */
|
|
357
|
+
e.state.value && e.state.value.length > 1 && /* @__PURE__ */ F(p, {
|
|
359
358
|
disabled: t,
|
|
360
359
|
type: "button",
|
|
361
360
|
variant: "ghost",
|
|
362
361
|
size: "sm",
|
|
363
362
|
className: "w-full",
|
|
364
363
|
onClick: () => {
|
|
365
|
-
e.removeValue(i),
|
|
364
|
+
e.removeValue(i), ie().then();
|
|
366
365
|
},
|
|
367
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), O("editor.conditionalEdge.removeCondition")]
|
|
368
367
|
})
|
|
369
368
|
]
|
|
370
|
-
}), e.state.value && i < e.state.value.length - 1 && /* @__PURE__ */
|
|
369
|
+
}), e.state.value && i < e.state.value.length - 1 && /* @__PURE__ */ P(k, {
|
|
371
370
|
name: `conditions[${i}].logicalOperator`,
|
|
372
|
-
children: (e) => /* @__PURE__ */
|
|
371
|
+
children: (e) => /* @__PURE__ */ P("div", {
|
|
373
372
|
className: "flex justify-center",
|
|
374
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ F(g, {
|
|
375
374
|
disabled: t,
|
|
376
375
|
value: e.state.value || r.AND,
|
|
377
376
|
onValueChange: (t) => e.handleChange(t),
|
|
378
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ P(h, {
|
|
379
378
|
className: "h-9 w-32 font-semibold",
|
|
380
|
-
children: /* @__PURE__ */
|
|
381
|
-
}), /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ P(c, {})
|
|
380
|
+
}), /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(v, {
|
|
382
381
|
value: r.AND,
|
|
383
382
|
children: "AND"
|
|
384
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ P(v, {
|
|
385
384
|
value: r.OR,
|
|
386
385
|
children: "OR"
|
|
387
386
|
})] })]
|
|
388
387
|
})
|
|
389
388
|
})
|
|
390
389
|
})]
|
|
391
|
-
}, `condition-${i}`)), /* @__PURE__ */
|
|
390
|
+
}, `condition-${i}`)), /* @__PURE__ */ F(p, {
|
|
392
391
|
disabled: t,
|
|
393
392
|
type: "button",
|
|
394
393
|
variant: "outline",
|
|
@@ -396,13 +395,13 @@ var Ft = {
|
|
|
396
395
|
className: "w-full",
|
|
397
396
|
onClick: () => {
|
|
398
397
|
e.pushValue({
|
|
399
|
-
field:
|
|
398
|
+
field: E[0]?.nodeId ?? "",
|
|
400
399
|
logicalOperator: r.AND,
|
|
401
400
|
operator: "===",
|
|
402
401
|
value: ""
|
|
403
|
-
}),
|
|
402
|
+
}), ie().then();
|
|
404
403
|
},
|
|
405
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), O("editor.conditionalEdge.addCondition")]
|
|
406
405
|
})]
|
|
407
406
|
})]
|
|
408
407
|
});
|
|
@@ -410,19 +409,19 @@ var Ft = {
|
|
|
410
409
|
})
|
|
411
410
|
]
|
|
412
411
|
}),
|
|
413
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ F("div", {
|
|
414
413
|
className: "flex justify-end gap-2 pt-2",
|
|
415
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ F(p, {
|
|
416
415
|
type: "button",
|
|
417
416
|
size: "sm",
|
|
418
417
|
variant: "outline",
|
|
419
418
|
onClick: ce,
|
|
420
|
-
children: [/* @__PURE__ */
|
|
421
|
-
}), /* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ P(R, { className: "mr-1 h-4 w-4" }), O("common.clear")]
|
|
420
|
+
}), /* @__PURE__ */ P(p, {
|
|
422
421
|
type: "button",
|
|
423
422
|
size: "sm",
|
|
424
|
-
onClick: () =>
|
|
425
|
-
children:
|
|
423
|
+
onClick: () => ne(!1),
|
|
424
|
+
children: O("common.close")
|
|
426
425
|
})]
|
|
427
426
|
})
|
|
428
427
|
]
|
|
@@ -433,23 +432,23 @@ var Ft = {
|
|
|
433
432
|
})
|
|
434
433
|
}) })] });
|
|
435
434
|
}),
|
|
436
|
-
default:
|
|
437
|
-
let [u, d, f] =
|
|
435
|
+
default: pt(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
|
|
436
|
+
let [u, d, f] = Se({
|
|
438
437
|
sourcePosition: a,
|
|
439
438
|
sourceX: t,
|
|
440
439
|
sourceY: n,
|
|
441
440
|
targetPosition: o,
|
|
442
441
|
targetX: r,
|
|
443
442
|
targetY: i
|
|
444
|
-
}), { setEdges: p } =
|
|
445
|
-
return /* @__PURE__ */
|
|
443
|
+
}), { setEdges: p } = M();
|
|
444
|
+
return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(de, {
|
|
446
445
|
path: u,
|
|
447
446
|
markerEnd: c,
|
|
448
447
|
style: s
|
|
449
|
-
}), /* @__PURE__ */
|
|
448
|
+
}), /* @__PURE__ */ P(pe, { children: l && /* @__PURE__ */ P("div", {
|
|
450
449
|
className: "button-edge__label nodrag nopan",
|
|
451
450
|
style: { transform: `translate(-50%, -50%) translate(${d}px,${f}px)` },
|
|
452
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ P("button", {
|
|
453
452
|
type: "button",
|
|
454
453
|
className: "button-edge__button",
|
|
455
454
|
onClick: () => {
|
|
@@ -479,15 +478,15 @@ var Ft = {
|
|
|
479
478
|
textarea: "textarea",
|
|
480
479
|
time: "time",
|
|
481
480
|
timerange: "timerange"
|
|
482
|
-
},
|
|
483
|
-
let { setNodes: e, setEdges: t, getNodes: n } =
|
|
481
|
+
}, Pt = { [a.input]: { type: K.text } }, q = () => {
|
|
482
|
+
let { setNodes: e, setEdges: t, getNodes: n } = M(), r = z(() => {
|
|
484
483
|
e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
485
|
-
}, [t, e]), i =
|
|
484
|
+
}, [t, e]), i = z((n) => {
|
|
486
485
|
e((e) => e.map((e) => ({
|
|
487
486
|
...e,
|
|
488
487
|
selected: e.id === n
|
|
489
488
|
}))), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
490
|
-
}, [t, e]), a =
|
|
489
|
+
}, [t, e]), a = z((t, n) => {
|
|
491
490
|
e((e) => e.map((e) => e.id === t ? {
|
|
492
491
|
...e,
|
|
493
492
|
data: {
|
|
@@ -495,25 +494,25 @@ var Ft = {
|
|
|
495
494
|
...n
|
|
496
495
|
}
|
|
497
496
|
} : e));
|
|
498
|
-
}, [e]), o =
|
|
497
|
+
}, [e]), o = z((t, n) => {
|
|
499
498
|
e((e) => e.map((e) => e.id === t ? {
|
|
500
499
|
...e,
|
|
501
|
-
data:
|
|
500
|
+
data: Pt[n] ?? {},
|
|
502
501
|
type: n
|
|
503
502
|
} : e));
|
|
504
|
-
}, [e]), s =
|
|
503
|
+
}, [e]), s = z((e) => {
|
|
505
504
|
let t = n().find((e) => e.selected);
|
|
506
505
|
t && o(t.id, e);
|
|
507
|
-
}, [n, o]), c =
|
|
506
|
+
}, [n, o]), c = z((e) => {
|
|
508
507
|
let t = n().find((e) => e.selected);
|
|
509
508
|
t && a(t.id, e);
|
|
510
|
-
}, [n, a]), l =
|
|
509
|
+
}, [n, a]), l = z((n) => {
|
|
511
510
|
e((e) => e.filter((e) => e.id !== n)), t((e) => e.filter((e) => e.source !== n && e.target !== n));
|
|
512
511
|
}, [e, t]);
|
|
513
512
|
return {
|
|
514
513
|
clearSelection: r,
|
|
515
514
|
deleteNode: l,
|
|
516
|
-
deleteSelectedNode:
|
|
515
|
+
deleteSelectedNode: z(() => {
|
|
517
516
|
let e = n().find((e) => e.selected);
|
|
518
517
|
e && l(e.id);
|
|
519
518
|
}, [n, l]),
|
|
@@ -523,14 +522,14 @@ var Ft = {
|
|
|
523
522
|
updateSelectedNodeData: c,
|
|
524
523
|
updateSelectedNodeType: s
|
|
525
524
|
};
|
|
526
|
-
},
|
|
525
|
+
}, Ft = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
|
|
527
526
|
let { language: i } = W(), { updateNodeData: a } = q(), o = G(), s = t?.[i] ?? "", c = n || o("editor.treegeNode.labelPlaceholder"), l = (n) => {
|
|
528
527
|
a(e, { label: {
|
|
529
528
|
...t,
|
|
530
529
|
[i]: n.target.value
|
|
531
530
|
} });
|
|
532
531
|
}, u = (e) => e.stopPropagation();
|
|
533
|
-
return /* @__PURE__ */
|
|
532
|
+
return /* @__PURE__ */ P("input", {
|
|
534
533
|
type: "text",
|
|
535
534
|
value: s,
|
|
536
535
|
placeholder: c,
|
|
@@ -544,33 +543,33 @@ var Ft = {
|
|
|
544
543
|
//#endregion
|
|
545
544
|
//#region src/shared/components/ui/dropdown-menu.tsx
|
|
546
545
|
function J({ ...e }) {
|
|
547
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ P(V.Root, {
|
|
548
547
|
"data-slot": "dropdown-menu",
|
|
549
548
|
...e
|
|
550
549
|
});
|
|
551
550
|
}
|
|
552
551
|
function Y({ ...e }) {
|
|
553
|
-
return /* @__PURE__ */
|
|
552
|
+
return /* @__PURE__ */ P(V.Trigger, {
|
|
554
553
|
"data-slot": "dropdown-menu-trigger",
|
|
555
554
|
...e
|
|
556
555
|
});
|
|
557
556
|
}
|
|
558
557
|
function X({ className: e, sideOffset: t = 4, ...n }) {
|
|
559
|
-
return /* @__PURE__ */
|
|
558
|
+
return /* @__PURE__ */ P(V.Portal, { children: /* @__PURE__ */ P(V.Content, {
|
|
560
559
|
"data-slot": "dropdown-menu-content",
|
|
561
560
|
sideOffset: t,
|
|
562
561
|
className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
563
562
|
...n
|
|
564
563
|
}) });
|
|
565
564
|
}
|
|
566
|
-
function
|
|
567
|
-
return /* @__PURE__ */
|
|
565
|
+
function It({ ...e }) {
|
|
566
|
+
return /* @__PURE__ */ P(V.Group, {
|
|
568
567
|
"data-slot": "dropdown-menu-group",
|
|
569
568
|
...e
|
|
570
569
|
});
|
|
571
570
|
}
|
|
572
571
|
function Z({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
573
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ P(V.Item, {
|
|
574
573
|
"data-slot": "dropdown-menu-item",
|
|
575
574
|
"data-inset": t,
|
|
576
575
|
"data-variant": n,
|
|
@@ -578,16 +577,16 @@ function Z({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
|
578
577
|
...r
|
|
579
578
|
});
|
|
580
579
|
}
|
|
581
|
-
function
|
|
582
|
-
return /* @__PURE__ */
|
|
580
|
+
function Lt({ className: e, inset: t, ...n }) {
|
|
581
|
+
return /* @__PURE__ */ P(V.Label, {
|
|
583
582
|
"data-slot": "dropdown-menu-label",
|
|
584
583
|
"data-inset": t,
|
|
585
584
|
className: d("px-1.5 py-1 font-medium text-muted-foreground text-xs data-[inset]:pl-7", e),
|
|
586
585
|
...n
|
|
587
586
|
});
|
|
588
587
|
}
|
|
589
|
-
function
|
|
590
|
-
return /* @__PURE__ */
|
|
588
|
+
function Rt({ className: e, ...t }) {
|
|
589
|
+
return /* @__PURE__ */ P(V.Separator, {
|
|
591
590
|
"data-slot": "dropdown-menu-separator",
|
|
592
591
|
className: d("-mx-1 my-1 h-px bg-border", e),
|
|
593
592
|
...t
|
|
@@ -595,38 +594,38 @@ function Bt({ className: e, ...t }) {
|
|
|
595
594
|
}
|
|
596
595
|
//#endregion
|
|
597
596
|
//#region src/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.tsx
|
|
598
|
-
var
|
|
597
|
+
var zt = ({ nodeId: e, className: t }) => {
|
|
599
598
|
let { selectNode: n } = q(), { setIsNodeSheetOpen: r, openDeleteNodeConfirmation: i } = W(), a = G(), o = (e) => e.stopPropagation();
|
|
600
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
|
|
601
600
|
asChild: !0,
|
|
602
601
|
onClick: o,
|
|
603
|
-
children: /* @__PURE__ */
|
|
602
|
+
children: /* @__PURE__ */ P("button", {
|
|
604
603
|
type: "button",
|
|
605
604
|
"aria-label": a("editor.nodeActionsSheet.editNode"),
|
|
606
605
|
className: d("nodrag nopan absolute top-2 right-2 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md opacity-60 transition-all hover:text-[--treege-color-primary] hover:opacity-100", t),
|
|
607
|
-
children: /* @__PURE__ */
|
|
606
|
+
children: /* @__PURE__ */ P(Ze, { className: "h-3.5 w-3.5" })
|
|
608
607
|
})
|
|
609
|
-
}), /* @__PURE__ */
|
|
608
|
+
}), /* @__PURE__ */ F(X, {
|
|
610
609
|
align: "end",
|
|
611
610
|
onClick: o,
|
|
612
611
|
children: [
|
|
613
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ F(Z, {
|
|
614
613
|
onClick: () => {
|
|
615
614
|
n(e), r(!0);
|
|
616
615
|
},
|
|
617
|
-
children: [/* @__PURE__ */
|
|
616
|
+
children: [/* @__PURE__ */ P(it, {}), a("common.settings")]
|
|
618
617
|
}),
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ P(Rt, {}),
|
|
619
|
+
/* @__PURE__ */ F(Z, {
|
|
621
620
|
variant: "destructive",
|
|
622
621
|
onSelect: (t) => {
|
|
623
622
|
t.preventDefault(), i(e);
|
|
624
623
|
},
|
|
625
|
-
children: [/* @__PURE__ */
|
|
624
|
+
children: [/* @__PURE__ */ P(ot, {}), a("common.delete")]
|
|
626
625
|
})
|
|
627
626
|
]
|
|
628
627
|
})] });
|
|
629
|
-
},
|
|
628
|
+
}, Bt = bt("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
|
|
630
629
|
defaultVariants: { variant: "default" },
|
|
631
630
|
variants: { variant: {
|
|
632
631
|
blue: "bg-blue-500 text-white dark:bg-blue-600",
|
|
@@ -637,45 +636,45 @@ var Vt = ({ nodeId: e, className: t }) => {
|
|
|
637
636
|
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90"
|
|
638
637
|
} }
|
|
639
638
|
});
|
|
640
|
-
function
|
|
641
|
-
return /* @__PURE__ */
|
|
639
|
+
function Vt({ className: e, variant: t, asChild: n = !1, ...r }) {
|
|
640
|
+
return /* @__PURE__ */ P(n ? yt : "span", {
|
|
642
641
|
"data-slot": "badge",
|
|
643
|
-
className: d(
|
|
642
|
+
className: d(Bt({ variant: t }), e),
|
|
644
643
|
...r
|
|
645
644
|
});
|
|
646
645
|
}
|
|
647
|
-
var
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
-
/* @__PURE__ */
|
|
646
|
+
var Ht = pt(({ data: e, id: t }) => /* @__PURE__ */ F(N, { children: [
|
|
647
|
+
/* @__PURE__ */ P(ge, {}),
|
|
648
|
+
/* @__PURE__ */ P("div", {
|
|
650
649
|
className: "-top-3.5 absolute left-6",
|
|
651
|
-
children: /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ F(Vt, {
|
|
652
651
|
className: "max-w-50 bg-chart-2",
|
|
653
|
-
children: [/* @__PURE__ */
|
|
652
|
+
children: [/* @__PURE__ */ P(De, { className: "!w-3 !h-3" }), /* @__PURE__ */ P(Ft, {
|
|
654
653
|
nodeId: t,
|
|
655
654
|
label: e?.label,
|
|
656
655
|
className: "min-w-0 flex-1 text-xs text-white placeholder:text-white/60"
|
|
657
656
|
})]
|
|
658
657
|
})
|
|
659
658
|
}),
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
] })),
|
|
659
|
+
/* @__PURE__ */ P(zt, { nodeId: t })
|
|
660
|
+
] })), Ut = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", Wt = (e = 21) => {
|
|
662
661
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
663
|
-
for (; e--;) t +=
|
|
662
|
+
for (; e--;) t += Ut[n[e] & 63];
|
|
664
663
|
return t;
|
|
665
|
-
},
|
|
664
|
+
}, Gt = {
|
|
666
665
|
data: { type: "text" },
|
|
667
|
-
id:
|
|
666
|
+
id: Wt(),
|
|
668
667
|
position: {
|
|
669
668
|
x: 0,
|
|
670
669
|
y: 0
|
|
671
670
|
},
|
|
672
671
|
type: "input"
|
|
673
|
-
},
|
|
674
|
-
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } =
|
|
672
|
+
}, Kt = () => {
|
|
673
|
+
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } = M(), o = z((n, r, i = !1, o) => {
|
|
675
674
|
let c = n.id, l = a().filter((e) => e.source === c), u = s(n);
|
|
676
675
|
if (l.length > 0 && !u) return;
|
|
677
|
-
let d =
|
|
678
|
-
...
|
|
676
|
+
let d = Wt(), f = {
|
|
677
|
+
...Gt,
|
|
679
678
|
...o && {
|
|
680
679
|
data: o.data ?? {},
|
|
681
680
|
type: o.type
|
|
@@ -691,7 +690,7 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
691
690
|
operator: "===",
|
|
692
691
|
value: ""
|
|
693
692
|
}] } : void 0,
|
|
694
|
-
id:
|
|
693
|
+
id: Wt(),
|
|
695
694
|
source: c,
|
|
696
695
|
target: d,
|
|
697
696
|
type: t && u ? "conditional" : "default"
|
|
@@ -719,9 +718,9 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
719
718
|
a,
|
|
720
719
|
e,
|
|
721
720
|
t
|
|
722
|
-
]), c =
|
|
721
|
+
]), c = z((e) => {
|
|
723
722
|
t((t) => {
|
|
724
|
-
let n =
|
|
723
|
+
let n = xe(e, t), i = e.source, a = r(i);
|
|
725
724
|
return n.filter((e) => e.source === i).length > 1 && a && s(a) ? n.map((e) => e.source === i ? {
|
|
726
725
|
...e,
|
|
727
726
|
data: {
|
|
@@ -735,12 +734,12 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
735
734
|
type: "conditional"
|
|
736
735
|
} : e) : n;
|
|
737
736
|
});
|
|
738
|
-
}, [t, r]), l =
|
|
737
|
+
}, [t, r]), l = z((e, t) => {
|
|
739
738
|
let n = r(e);
|
|
740
739
|
if (!n) return;
|
|
741
|
-
let s = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), c = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), l = parseFloat(s) || 100, u = parseFloat(c) || 100, d = n.position.y + l + 100, f = i(), p = a(), m = f.filter((t) => p.some((n) => n.source === e && n.target === t.id));
|
|
740
|
+
let s = getComputedStyle(document.documentElement).getPropertyValue("--node-height"), c = getComputedStyle(document.documentElement).getPropertyValue("--node-width"), l = parseFloat(s) || 100, u = parseFloat(c) || 100, d = n.position.y + l + 100, f = i(), p = a(), m = f.filter((t) => p.some((n) => n.source === e && n.target === t.id)).map((e) => e.position.x);
|
|
742
741
|
o(n, {
|
|
743
|
-
x: m.length
|
|
742
|
+
x: m.length === 0 ? n.position.x : m.length % 2 == 1 ? Math.max(...m) + u + 50 : Math.min(...m) - u - 50,
|
|
744
743
|
y: d
|
|
745
744
|
}, !0, t);
|
|
746
745
|
}, [
|
|
@@ -748,7 +747,7 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
748
747
|
i,
|
|
749
748
|
a,
|
|
750
749
|
o
|
|
751
|
-
]), u =
|
|
750
|
+
]), u = z((e, t) => {
|
|
752
751
|
if (!t.isValid) {
|
|
753
752
|
let { clientX: i, clientY: a } = "changedTouches" in e ? e.changedTouches[0] : e, s = t.fromNode;
|
|
754
753
|
if (!s) return;
|
|
@@ -768,7 +767,7 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
768
767
|
o,
|
|
769
768
|
r,
|
|
770
769
|
n
|
|
771
|
-
]), d =
|
|
770
|
+
]), d = z((e) => {
|
|
772
771
|
t((t) => {
|
|
773
772
|
let n = t.filter((t) => !e.find((e) => e.id === t.id)), r = new Set(e.map((e) => e.source)), i = /* @__PURE__ */ new Map();
|
|
774
773
|
return n.forEach((e) => {
|
|
@@ -787,7 +786,7 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
787
786
|
});
|
|
788
787
|
}, [t]);
|
|
789
788
|
return {
|
|
790
|
-
isValidConnection:
|
|
789
|
+
isValidConnection: z((e) => {
|
|
791
790
|
if (e.source === e.target) return !1;
|
|
792
791
|
let t = r(e.source);
|
|
793
792
|
return t ? !(a().filter((t) => t.source === e.source).length > 0 && !s(t)) : !1;
|
|
@@ -797,35 +796,35 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
797
796
|
onConnectEnd: u,
|
|
798
797
|
onEdgesDelete: d
|
|
799
798
|
};
|
|
800
|
-
},
|
|
799
|
+
}, qt = {
|
|
801
800
|
divider: "divider",
|
|
802
801
|
title: "title"
|
|
803
|
-
},
|
|
804
|
-
let { onAddFromHandle: n } =
|
|
805
|
-
return /* @__PURE__ */
|
|
802
|
+
}, Jt = ({ nodeId: e, isConnectable: t }) => {
|
|
803
|
+
let { onAddFromHandle: n } = Kt(), r = G(), [i, o] = B(!1);
|
|
804
|
+
return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(me, {
|
|
806
805
|
type: "source",
|
|
807
|
-
position:
|
|
806
|
+
position: ve.Bottom,
|
|
808
807
|
isConnectable: t,
|
|
809
808
|
onClick: (e) => {
|
|
810
809
|
e.defaultPrevented || o(!0);
|
|
811
810
|
},
|
|
812
811
|
className: "flex h-6! w-6! cursor-pointer items-center justify-center rounded-sm transition-colors hover:bg-primary/80!",
|
|
813
|
-
children: /* @__PURE__ */
|
|
814
|
-
}), /* @__PURE__ */
|
|
812
|
+
children: /* @__PURE__ */ P(L, { className: "h-4 w-4 text-primary-foreground" })
|
|
813
|
+
}), /* @__PURE__ */ F(J, {
|
|
815
814
|
open: i,
|
|
816
815
|
onOpenChange: o,
|
|
817
|
-
children: [/* @__PURE__ */
|
|
816
|
+
children: [/* @__PURE__ */ P(Y, {
|
|
818
817
|
asChild: !0,
|
|
819
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */ P("span", {
|
|
820
819
|
"aria-hidden": !0,
|
|
821
820
|
className: "-translate-x-1/2 pointer-events-none absolute bottom-0 left-1/2 h-0 w-0"
|
|
822
821
|
})
|
|
823
|
-
}), /* @__PURE__ */
|
|
822
|
+
}), /* @__PURE__ */ F(X, {
|
|
824
823
|
align: "center",
|
|
825
824
|
side: "bottom",
|
|
826
825
|
className: "treege-scrollbar max-h-80",
|
|
827
826
|
children: [
|
|
828
|
-
/* @__PURE__ */
|
|
827
|
+
/* @__PURE__ */ F(It, { children: [/* @__PURE__ */ P(Lt, { children: r("editor.selectNodeType.options.input") }), Object.values(K).map((t) => /* @__PURE__ */ P(Z, {
|
|
829
828
|
onClick: () => n(e, {
|
|
830
829
|
data: { type: t },
|
|
831
830
|
type: a.input
|
|
@@ -833,8 +832,8 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
833
832
|
className: "capitalize",
|
|
834
833
|
children: t
|
|
835
834
|
}, t))] }),
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ P(Rt, {}),
|
|
836
|
+
/* @__PURE__ */ F(It, { children: [/* @__PURE__ */ P(Lt, { children: r("editor.selectNodeType.options.ui") }), Object.values(qt).map((t) => /* @__PURE__ */ P(Z, {
|
|
838
837
|
onClick: () => n(e, {
|
|
839
838
|
data: { type: t },
|
|
840
839
|
type: a.ui
|
|
@@ -842,8 +841,8 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
842
841
|
className: "capitalize",
|
|
843
842
|
children: t
|
|
844
843
|
}, t))] }),
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ P(Rt, {}),
|
|
845
|
+
/* @__PURE__ */ F(It, { children: [/* @__PURE__ */ P(Lt, { children: r("common.other") }), /* @__PURE__ */ P(Z, {
|
|
847
846
|
onClick: () => n(e, {
|
|
848
847
|
data: {},
|
|
849
848
|
type: a.flow
|
|
@@ -853,68 +852,68 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
853
852
|
]
|
|
854
853
|
})]
|
|
855
854
|
})] });
|
|
856
|
-
},
|
|
857
|
-
[K.address]:
|
|
858
|
-
[K.autocomplete]:
|
|
859
|
-
[K.checkbox]:
|
|
860
|
-
[K.date]:
|
|
861
|
-
[K.daterange]:
|
|
862
|
-
[K.file]:
|
|
863
|
-
[K.hidden]:
|
|
864
|
-
[K.http]:
|
|
865
|
-
[K.number]:
|
|
866
|
-
[K.password]:
|
|
867
|
-
[K.radio]:
|
|
868
|
-
[K.select]:
|
|
869
|
-
[K.submit]:
|
|
870
|
-
[K.switch]:
|
|
871
|
-
[K.text]:
|
|
872
|
-
[K.textarea]:
|
|
873
|
-
[K.time]:
|
|
874
|
-
[K.timerange]:
|
|
875
|
-
[
|
|
876
|
-
[
|
|
877
|
-
},
|
|
855
|
+
}, Yt = {
|
|
856
|
+
[K.address]: Ye,
|
|
857
|
+
[K.autocomplete]: nt,
|
|
858
|
+
[K.checkbox]: Me,
|
|
859
|
+
[K.date]: Oe,
|
|
860
|
+
[K.daterange]: ke,
|
|
861
|
+
[K.file]: Qe,
|
|
862
|
+
[K.hidden]: Ve,
|
|
863
|
+
[K.http]: Le,
|
|
864
|
+
[K.number]: He,
|
|
865
|
+
[K.password]: Ge,
|
|
866
|
+
[K.radio]: Fe,
|
|
867
|
+
[K.select]: qe,
|
|
868
|
+
[K.submit]: rt,
|
|
869
|
+
[K.switch]: at,
|
|
870
|
+
[K.text]: Ae,
|
|
871
|
+
[K.textarea]: Te,
|
|
872
|
+
[K.time]: Ie,
|
|
873
|
+
[K.timerange]: Ie,
|
|
874
|
+
[qt.divider]: Xe,
|
|
875
|
+
[qt.title]: Ue
|
|
876
|
+
}, Xt = et, Zt = (e) => e && Yt[e] || Xt, Qt = {
|
|
878
877
|
input: Object.values(K),
|
|
879
|
-
ui: Object.values(
|
|
880
|
-
},
|
|
881
|
-
let { updateNodeData: r } = q(), i = G(), a =
|
|
882
|
-
return /* @__PURE__ */
|
|
878
|
+
ui: Object.values(qt)
|
|
879
|
+
}, $t = ({ nodeId: e, type: t, inputType: n }) => {
|
|
880
|
+
let { updateNodeData: r } = q(), i = G(), a = Qt[t], o = (e) => e.stopPropagation();
|
|
881
|
+
return /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
|
|
883
882
|
asChild: !0,
|
|
884
883
|
onClick: o,
|
|
885
|
-
children: /* @__PURE__ */
|
|
884
|
+
children: /* @__PURE__ */ F(Vt, {
|
|
886
885
|
variant: "default",
|
|
887
886
|
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
888
887
|
children: [
|
|
889
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ P(Zt(n), { className: "mt-0.5" }),
|
|
890
889
|
n || i("editor.selectInputType.type"),
|
|
891
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ P(Ne, {})
|
|
892
891
|
]
|
|
893
892
|
})
|
|
894
|
-
}), /* @__PURE__ */
|
|
893
|
+
}), /* @__PURE__ */ P(X, {
|
|
895
894
|
align: "start",
|
|
896
895
|
className: "treege-scrollbar max-h-60",
|
|
897
896
|
onClick: o,
|
|
898
897
|
children: a.map((t) => {
|
|
899
|
-
let i =
|
|
900
|
-
return /* @__PURE__ */
|
|
898
|
+
let i = Zt(t);
|
|
899
|
+
return /* @__PURE__ */ F(Z, {
|
|
901
900
|
onClick: () => r(e, { type: t }),
|
|
902
901
|
className: d("capitalize", t === n && "bg-accent"),
|
|
903
|
-
children: [/* @__PURE__ */
|
|
902
|
+
children: [/* @__PURE__ */ P(i, {}), t]
|
|
904
903
|
}, t);
|
|
905
904
|
})
|
|
906
905
|
})] });
|
|
907
|
-
},
|
|
906
|
+
}, en = [
|
|
908
907
|
"radio",
|
|
909
908
|
"select",
|
|
910
909
|
"checkbox",
|
|
911
910
|
"autocomplete"
|
|
912
|
-
],
|
|
913
|
-
let [n, r] =
|
|
914
|
-
if (!(h &&
|
|
915
|
-
let g = t.options ?? [],
|
|
911
|
+
], tn = ({ nodeId: e, data: t }) => {
|
|
912
|
+
let [n, r] = B(!1), [i, a] = B(""), [o, s] = B(""), { updateNodeData: c } = q(), { language: d } = W(), f = G(), h = t && "type" in t ? t.type : void 0;
|
|
913
|
+
if (!(h && en.includes(h))) return null;
|
|
914
|
+
let g = t.options ?? [], _ = () => {
|
|
916
915
|
a(""), s("");
|
|
917
|
-
},
|
|
916
|
+
}, v = (t) => {
|
|
918
917
|
t?.preventDefault();
|
|
919
918
|
let n = i.trim(), a = o.trim() || n;
|
|
920
919
|
if (!(n || a)) return;
|
|
@@ -922,69 +921,69 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
922
921
|
label: { [d]: n },
|
|
923
922
|
value: a
|
|
924
923
|
};
|
|
925
|
-
c(e, { options: [...g, s] }),
|
|
924
|
+
c(e, { options: [...g, s] }), _(), r(!1);
|
|
925
|
+
}, y = (e) => {
|
|
926
|
+
r(e), e || _();
|
|
926
927
|
}, b = (e) => {
|
|
927
|
-
|
|
928
|
-
}, x = (e) =>
|
|
929
|
-
|
|
930
|
-
}, S = (e) => e.stopPropagation();
|
|
931
|
-
return /* @__PURE__ */ P("div", {
|
|
928
|
+
e.key === "Enter" && (e.preventDefault(), v());
|
|
929
|
+
}, x = (e) => e.stopPropagation();
|
|
930
|
+
return /* @__PURE__ */ F("div", {
|
|
932
931
|
className: "nodrag nopan my-1 flex flex-col gap-0.5",
|
|
933
932
|
children: [g.map((e, t) => {
|
|
934
933
|
let n = f(e.label) || e.value || "—", r = `${e.value || "opt"}-${t}`;
|
|
935
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ P("div", {
|
|
936
935
|
className: "truncate text-muted-foreground text-xs",
|
|
937
936
|
children: n
|
|
938
937
|
}, r);
|
|
939
|
-
}), /* @__PURE__ */
|
|
938
|
+
}), /* @__PURE__ */ F(se, {
|
|
940
939
|
open: n,
|
|
941
|
-
onOpenChange:
|
|
942
|
-
children: [/* @__PURE__ */
|
|
940
|
+
onOpenChange: y,
|
|
941
|
+
children: [/* @__PURE__ */ P(u, {
|
|
943
942
|
asChild: !0,
|
|
944
|
-
onClick:
|
|
945
|
-
children: /* @__PURE__ */
|
|
943
|
+
onClick: x,
|
|
944
|
+
children: /* @__PURE__ */ F(p, {
|
|
946
945
|
type: "button",
|
|
947
946
|
variant: "link",
|
|
948
947
|
size: "xs",
|
|
949
948
|
className: "w-fit p-0!",
|
|
950
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ P(L, { className: "size-3" }), f("editor.inputNodeForm.addOption")]
|
|
951
950
|
})
|
|
952
|
-
}), /* @__PURE__ */
|
|
951
|
+
}), /* @__PURE__ */ P(ee, {
|
|
953
952
|
align: "start",
|
|
954
953
|
className: "w-64 p-3",
|
|
955
|
-
onClick:
|
|
956
|
-
children: /* @__PURE__ */
|
|
957
|
-
onSubmit:
|
|
954
|
+
onClick: x,
|
|
955
|
+
children: /* @__PURE__ */ F("form", {
|
|
956
|
+
onSubmit: v,
|
|
958
957
|
className: "flex flex-col gap-2",
|
|
959
958
|
children: [
|
|
960
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ F("div", {
|
|
961
960
|
className: "flex flex-col gap-1",
|
|
962
|
-
children: [/* @__PURE__ */
|
|
961
|
+
children: [/* @__PURE__ */ P(l, {
|
|
963
962
|
htmlFor: `${e}-option-label`,
|
|
964
963
|
className: "text-xs",
|
|
965
964
|
children: f("editor.inputNodeForm.optionLabel")
|
|
966
|
-
}), /* @__PURE__ */
|
|
965
|
+
}), /* @__PURE__ */ P(m, {
|
|
967
966
|
id: `${e}-option-label`,
|
|
968
967
|
autoFocus: !0,
|
|
969
968
|
value: i,
|
|
970
969
|
onChange: (e) => a(e.target.value),
|
|
971
|
-
onKeyDown:
|
|
970
|
+
onKeyDown: b
|
|
972
971
|
})]
|
|
973
972
|
}),
|
|
974
|
-
/* @__PURE__ */
|
|
973
|
+
/* @__PURE__ */ F("div", {
|
|
975
974
|
className: "flex flex-col gap-1",
|
|
976
|
-
children: [/* @__PURE__ */
|
|
975
|
+
children: [/* @__PURE__ */ P(l, {
|
|
977
976
|
htmlFor: `${e}-option-value`,
|
|
978
977
|
className: "text-xs",
|
|
979
978
|
children: f("editor.inputNodeForm.optionValue")
|
|
980
|
-
}), /* @__PURE__ */
|
|
979
|
+
}), /* @__PURE__ */ P(m, {
|
|
981
980
|
id: `${e}-option-value`,
|
|
982
981
|
value: o,
|
|
983
982
|
onChange: (e) => s(e.target.value),
|
|
984
|
-
onKeyDown:
|
|
983
|
+
onKeyDown: b
|
|
985
984
|
})]
|
|
986
985
|
}),
|
|
987
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ P(p, {
|
|
988
987
|
type: "submit",
|
|
989
988
|
size: "sm",
|
|
990
989
|
disabled: !(i.trim() || o.trim()),
|
|
@@ -995,13 +994,13 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
995
994
|
})]
|
|
996
995
|
})]
|
|
997
996
|
});
|
|
998
|
-
},
|
|
997
|
+
}, nn = ({ nodeId: e, required: t }) => {
|
|
999
998
|
let { updateNodeData: n } = q(), r = G();
|
|
1000
|
-
return /* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ P(Vt, {
|
|
1001
1000
|
variant: t ? "destructive" : "outline",
|
|
1002
1001
|
asChild: !0,
|
|
1003
1002
|
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
1004
|
-
children: /* @__PURE__ */
|
|
1003
|
+
children: /* @__PURE__ */ P("button", {
|
|
1005
1004
|
type: "button",
|
|
1006
1005
|
onClick: (r) => {
|
|
1007
1006
|
r.stopPropagation(), n(e, { required: !t });
|
|
@@ -1009,149 +1008,85 @@ var Wt = ht(({ data: e, id: t }) => /* @__PURE__ */ P(M, { children: [
|
|
|
1009
1008
|
children: r(t ? "editor.inputNodeForm.required" : "editor.inputNodeForm.optional")
|
|
1010
1009
|
})
|
|
1011
1010
|
});
|
|
1012
|
-
},
|
|
1011
|
+
}, rn = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ P("div", {
|
|
1013
1012
|
className: d("react-flow__node__wrapper relative", t && "in-group", n && "submit-type"),
|
|
1014
1013
|
children: e
|
|
1015
|
-
}),
|
|
1014
|
+
}), an = pt(({ data: e, isConnectable: t, parentId: n, type: r, id: i }) => {
|
|
1016
1015
|
let a = r === "input" || r === "ui" ? e?.type : void 0, o = r === "input" && e?.type === "submit", s = r === "input" ? e?.name : void 0;
|
|
1017
|
-
return /* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ F(rn, {
|
|
1018
1017
|
inGroup: !!n,
|
|
1019
1018
|
isSubmit: o,
|
|
1020
1019
|
children: [
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1020
|
+
/* @__PURE__ */ P(zt, { nodeId: i }),
|
|
1021
|
+
/* @__PURE__ */ P(me, {
|
|
1023
1022
|
type: "target",
|
|
1024
|
-
position:
|
|
1023
|
+
position: ve.Top,
|
|
1025
1024
|
isConnectable: t,
|
|
1026
1025
|
isConnectableStart: r === "ui"
|
|
1027
1026
|
}),
|
|
1028
|
-
/* @__PURE__ */
|
|
1027
|
+
/* @__PURE__ */ P(Ft, {
|
|
1029
1028
|
nodeId: i,
|
|
1030
1029
|
label: e?.label,
|
|
1031
1030
|
placeholder: s,
|
|
1032
1031
|
className: d("py-1", r === "ui" && "capitalize")
|
|
1033
1032
|
}),
|
|
1034
|
-
/* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ F("div", {
|
|
1035
1034
|
className: "mb-1 flex gap-1",
|
|
1036
|
-
children: [(r === "input" || r === "ui") && /* @__PURE__ */
|
|
1035
|
+
children: [(r === "input" || r === "ui") && /* @__PURE__ */ P($t, {
|
|
1037
1036
|
nodeId: i,
|
|
1038
1037
|
type: r,
|
|
1039
1038
|
inputType: a
|
|
1040
|
-
}), r === "input" && !o && /* @__PURE__ */
|
|
1039
|
+
}), r === "input" && !o && /* @__PURE__ */ P(nn, {
|
|
1041
1040
|
nodeId: i,
|
|
1042
1041
|
required: e?.required
|
|
1043
1042
|
})]
|
|
1044
1043
|
}),
|
|
1045
|
-
r === "input" && /* @__PURE__ */
|
|
1044
|
+
r === "input" && /* @__PURE__ */ P(tn, {
|
|
1046
1045
|
nodeId: i,
|
|
1047
1046
|
data: e
|
|
1048
1047
|
}),
|
|
1049
|
-
/* @__PURE__ */
|
|
1048
|
+
/* @__PURE__ */ P(Jt, {
|
|
1050
1049
|
nodeId: i,
|
|
1051
1050
|
isConnectable: t
|
|
1052
1051
|
})
|
|
1053
1052
|
]
|
|
1054
1053
|
});
|
|
1055
|
-
}),
|
|
1056
|
-
[a.flow]:
|
|
1057
|
-
[a.group]:
|
|
1058
|
-
[a.input]:
|
|
1059
|
-
[a.ui]:
|
|
1060
|
-
}
|
|
1061
|
-
//#endregion
|
|
1062
|
-
//#region src/shared/components/ui/alert-dialog.tsx
|
|
1063
|
-
function ln({ ...e }) {
|
|
1064
|
-
return /* @__PURE__ */ N(V.Root, {
|
|
1065
|
-
"data-slot": "alert-dialog",
|
|
1066
|
-
...e
|
|
1067
|
-
});
|
|
1068
|
-
}
|
|
1069
|
-
function un({ ...e }) {
|
|
1070
|
-
return /* @__PURE__ */ N(V.Portal, {
|
|
1071
|
-
"data-slot": "alert-dialog-portal",
|
|
1072
|
-
...e
|
|
1073
|
-
});
|
|
1074
|
-
}
|
|
1075
|
-
function dn({ className: e, ...t }) {
|
|
1076
|
-
return /* @__PURE__ */ N(V.Overlay, {
|
|
1077
|
-
"data-slot": "alert-dialog-overlay",
|
|
1078
|
-
className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
1079
|
-
...t
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
function fn({ className: e, ...t }) {
|
|
1083
|
-
return /* @__PURE__ */ P(un, { children: [/* @__PURE__ */ N(dn, {}), /* @__PURE__ */ N(V.Content, {
|
|
1084
|
-
"data-slot": "alert-dialog-content",
|
|
1085
|
-
className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg", e),
|
|
1086
|
-
...t
|
|
1087
|
-
})] });
|
|
1088
|
-
}
|
|
1089
|
-
function pn({ className: e, ...t }) {
|
|
1090
|
-
return /* @__PURE__ */ N("div", {
|
|
1091
|
-
"data-slot": "alert-dialog-header",
|
|
1092
|
-
className: d("flex flex-col gap-2 text-center sm:text-left", e),
|
|
1093
|
-
...t
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
function mn({ className: e, ...t }) {
|
|
1097
|
-
return /* @__PURE__ */ N("div", {
|
|
1098
|
-
"data-slot": "alert-dialog-footer",
|
|
1099
|
-
className: d("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
1100
|
-
...t
|
|
1101
|
-
});
|
|
1102
|
-
}
|
|
1103
|
-
function hn({ className: e, ...t }) {
|
|
1104
|
-
return /* @__PURE__ */ N(V.Title, {
|
|
1105
|
-
"data-slot": "alert-dialog-title",
|
|
1106
|
-
className: d("font-semibold text-lg", e),
|
|
1107
|
-
...t
|
|
1108
|
-
});
|
|
1109
|
-
}
|
|
1110
|
-
function gn({ className: e, ...t }) {
|
|
1111
|
-
return /* @__PURE__ */ N(V.Description, {
|
|
1112
|
-
"data-slot": "alert-dialog-description",
|
|
1113
|
-
className: d("text-muted-foreground text-sm", e),
|
|
1114
|
-
...t
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
function _n({ className: e, ...t }) {
|
|
1118
|
-
return /* @__PURE__ */ N(V.Action, {
|
|
1119
|
-
className: d(h(), e),
|
|
1120
|
-
...t
|
|
1121
|
-
});
|
|
1122
|
-
}
|
|
1123
|
-
function vn({ className: e, ...t }) {
|
|
1124
|
-
return /* @__PURE__ */ N(V.Cancel, {
|
|
1125
|
-
className: d(h({ variant: "outline" }), e),
|
|
1126
|
-
...t
|
|
1127
|
-
});
|
|
1128
|
-
}
|
|
1129
|
-
//#endregion
|
|
1130
|
-
//#region src/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.tsx
|
|
1131
|
-
var yn = () => {
|
|
1054
|
+
}), on = {
|
|
1055
|
+
[a.flow]: an,
|
|
1056
|
+
[a.group]: Ht,
|
|
1057
|
+
[a.input]: an,
|
|
1058
|
+
[a.ui]: an
|
|
1059
|
+
}, sn = () => {
|
|
1132
1060
|
let { pendingDeleteNodeId: e, closeDeleteNodeConfirmation: t } = W(), { deleteNode: n } = q(), r = G();
|
|
1133
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ P(oe, {
|
|
1134
1062
|
open: e !== null,
|
|
1135
1063
|
onOpenChange: (e) => {
|
|
1136
1064
|
e || t();
|
|
1137
1065
|
},
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1066
|
+
modal: !1,
|
|
1067
|
+
children: /* @__PURE__ */ F(b, {
|
|
1068
|
+
showCloseButton: !1,
|
|
1069
|
+
onInteractOutside: (e) => e.preventDefault(),
|
|
1070
|
+
onPointerDownOutside: (e) => e.preventDefault(),
|
|
1071
|
+
children: [/* @__PURE__ */ F(re, { children: [/* @__PURE__ */ P(C, { children: r("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ P(x, { children: r("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ F(O, { children: [/* @__PURE__ */ P(p, {
|
|
1072
|
+
variant: "outline",
|
|
1073
|
+
onClick: t,
|
|
1074
|
+
children: r("common.cancel")
|
|
1075
|
+
}), /* @__PURE__ */ P(p, {
|
|
1076
|
+
onClick: () => {
|
|
1077
|
+
e && n(e), t();
|
|
1078
|
+
},
|
|
1079
|
+
children: r("common.delete")
|
|
1080
|
+
})] })]
|
|
1081
|
+
})
|
|
1147
1082
|
});
|
|
1148
|
-
}, bn = "You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.\n\nIMPORTANT RULES:\n1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON\n2. The JSON must have this exact structure: { \"nodes\": [...], \"edges\": [...] }\n3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)\n4. Every edge must have: id (string), source (string), target (string)\n5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)\n6. AVOID using \"pattern\" field unless specifically requested - prefer using simple validation\n7. For submit buttons, use type \"input\" with data.type \"submit\", NOT type \"flow\"\n8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)\n\nNODE TYPES:\n- \"input\": Form input fields (text, number, select, checkbox, etc.)\n- \"ui\": UI elements (title, divider)\n- \"flow\": Navigation/flow control nodes\n- \"group\": Container for organizing nodes\n\nINPUT NODE TYPES (data.type):\n- \"text\", \"number\", \"textarea\", \"password\"\n- \"select\", \"radio\", \"checkbox\", \"switch\"\n- \"autocomplete\", \"date\", \"daterange\", \"time\", \"timerange\"\n- \"file\", \"address\", \"http\", \"hidden\", \"submit\"\n\nINPUT NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Field Label\",\n \"name\": \"fieldName\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter value...\",\n \"helperText\": \"Optional helper text\",\n \"pattern\": \"regex pattern (optional)\",\n \"errorMessage\": \"Error message if validation fails\",\n \"options\": [{ \"value\": \"val\", \"label\": \"Label\" }], // for select/radio/checkbox\n \"multiple\": false // for select/checkbox\n }\n}\n\nUI NODE TYPES (data.type):\n- \"title\": Display a title\n- \"divider\": Display a divider line\n\nUI NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"UI Element Label\",\n \"type\": \"title\" // or \"divider\"\n }\n}\n\nFLOW NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"flow\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Flow Step Label\",\n \"targetId\": \"next-node-id\" // optional\n }\n}\n\nGROUP NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"group\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Group Label\"\n }\n}\n\nEDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"default\" // or \"conditional\" for conditional logic\n}\n\nCONDITIONAL EDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If condition is true\", // optional label for the edge\n \"conditions\": [\n {\n \"field\": \"field-node-id\", // ID of the field to check\n \"operator\": \">=\", // operators: ===, !==, >, <, >=, <=\n \"value\": \"18\" // value to compare (as string)\n }\n ],\n \"operator\": \"AND\" // optional: \"AND\" or \"OR\" for multiple conditions (default: AND)\n }\n}\n\nIMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.\nExample: For \"age >= 18\", use \"value\": \"18\" (not value: 18)\n\nLAYOUT GUIDELINES:\n- Position nodes in a vertical flow (top to bottom)\n- Start at position { x: 0, y: 0 }\n- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)\n- For horizontal spacing, use 350 pixels\n- Create logical flow from top to bottom\n- IMPORTANT: Keep consistent vertical spacing to avoid overlap\n- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.\n\nEXAMPLES:\n\nUser: \"Create a simple contact form with name, email and message\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Contact Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"email-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Email\",\n \"name\": \"email\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"your@email.com\"\n }\n },\n {\n \"id\": \"message-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Message\",\n \"name\": \"message\",\n \"type\": \"textarea\",\n \"required\": true,\n \"placeholder\": \"Enter your message\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"email-1\" },\n { \"id\": \"e3\", \"source\": \"email-1\", \"target\": \"message-1\" }\n ]\n}\n\nUser: \"Create a user registration form with age, address and country selector\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"User Registration\", \"type\": \"title\" }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"address-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Address\",\n \"name\": \"address\",\n \"type\": \"address\",\n \"required\": true,\n \"placeholder\": \"Enter your address\"\n }\n },\n {\n \"id\": \"country-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Country\",\n \"name\": \"country\",\n \"type\": \"select\",\n \"required\": true,\n \"options\": [\n { \"value\": \"us\", \"label\": \"United States\" },\n { \"value\": \"ca\", \"label\": \"Canada\" },\n { \"value\": \"uk\", \"label\": \"United Kingdom\" },\n { \"value\": \"fr\", \"label\": \"France\" },\n { \"value\": \"de\", \"label\": \"Germany\" }\n ]\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"age-1\" },\n { \"id\": \"e2\", \"source\": \"age-1\", \"target\": \"address-1\" },\n { \"id\": \"e3\", \"source\": \"address-1\", \"target\": \"country-1\" },\n { \"id\": \"e4\", \"source\": \"country-1\", \"target\": \"submit-1\" }\n ]\n}\n\nUser: \"Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Survey Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"movie-1\",\n \"type\": \"input\",\n \"position\": { \"x\": -350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Movie\",\n \"name\": \"favoriteMovie\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For adults 18 and over\"\n }\n },\n {\n \"id\": \"color-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Color\",\n \"name\": \"favoriteColor\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For those under 18\"\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"age-1\" },\n {\n \"id\": \"e3\",\n \"source\": \"age-1\",\n \"target\": \"movie-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If 18 or older\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \">=\",\n \"value\": \"18\"\n }\n ]\n }\n },\n {\n \"id\": \"e4\",\n \"source\": \"age-1\",\n \"target\": \"color-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If under 18\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \"<\",\n \"value\": \"18\"\n }\n ]\n }\n },\n { \"id\": \"e5\", \"source\": \"movie-1\", \"target\": \"submit-1\" },\n { \"id\": \"e6\", \"source\": \"color-1\", \"target\": \"submit-1\" }\n ]\n}\n\nRemember:\n- Always respond with ONLY valid JSON\n- No markdown code blocks\n- No explanations outside the JSON\n- Follow the exact structure shown above\n- For submit buttons, ALWAYS use type \"input\" with data.type \"submit\"\n- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)\n- Never leave condition values empty - always provide the comparison value\n", xn = {
|
|
1083
|
+
}, cn = "You are a Treege decision tree generator. You must generate valid JSON structures for decision trees.\n\nIMPORTANT RULES:\n1. Always respond with valid JSON only, no markdown, no code blocks, no explanations outside the JSON\n2. The JSON must have this exact structure: { \"nodes\": [...], \"edges\": [...] }\n3. Every node must have: id (string), type (string), position ({ x: number, y: number }), data (object)\n4. Every edge must have: id (string), source (string), target (string)\n5. For regex patterns: ALWAYS use double backslashes (\\\\) for special characters (\\\\s, \\\\d, etc.)\n6. AVOID using \"pattern\" field unless specifically requested - prefer using simple validation\n7. For submit buttons, use type \"input\" with data.type \"submit\", NOT type \"flow\"\n8. For conditional logic, use conditional edges with proper operators (===, !==, >, <, >=, <=)\n\nNODE TYPES:\n- \"input\": Form input fields (text, number, select, checkbox, etc.)\n- \"ui\": UI elements (title, divider)\n- \"flow\": Navigation/flow control nodes\n- \"group\": Container for organizing nodes\n\nINPUT NODE TYPES (data.type):\n- \"text\", \"number\", \"textarea\", \"password\"\n- \"select\", \"radio\", \"checkbox\", \"switch\"\n- \"autocomplete\", \"date\", \"daterange\", \"time\", \"timerange\"\n- \"file\", \"address\", \"http\", \"hidden\", \"submit\"\n\nINPUT NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Field Label\",\n \"name\": \"fieldName\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter value...\",\n \"helperText\": \"Optional helper text\",\n \"pattern\": \"regex pattern (optional)\",\n \"errorMessage\": \"Error message if validation fails\",\n \"options\": [{ \"value\": \"val\", \"label\": \"Label\" }], // for select/radio/checkbox\n \"multiple\": false // for select/checkbox\n }\n}\n\nUI NODE TYPES (data.type):\n- \"title\": Display a title\n- \"divider\": Display a divider line\n\nUI NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"UI Element Label\",\n \"type\": \"title\" // or \"divider\"\n }\n}\n\nFLOW NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"flow\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Flow Step Label\",\n \"targetId\": \"next-node-id\" // optional\n }\n}\n\nGROUP NODE DATA STRUCTURE:\n{\n \"id\": \"unique-id\",\n \"type\": \"group\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": {\n \"label\": \"Group Label\"\n }\n}\n\nEDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"default\" // or \"conditional\" for conditional logic\n}\n\nCONDITIONAL EDGE STRUCTURE:\n{\n \"id\": \"edge-id\",\n \"source\": \"source-node-id\",\n \"target\": \"target-node-id\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If condition is true\", // optional label for the edge\n \"conditions\": [\n {\n \"field\": \"field-node-id\", // ID of the field to check\n \"operator\": \">=\", // operators: ===, !==, >, <, >=, <=\n \"value\": \"18\" // value to compare (as string)\n }\n ],\n \"operator\": \"AND\" // optional: \"AND\" or \"OR\" for multiple conditions (default: AND)\n }\n}\n\nIMPORTANT: For conditional edges, the value must ALWAYS be a string, even for numbers.\nExample: For \"age >= 18\", use \"value\": \"18\" (not value: 18)\n\nLAYOUT GUIDELINES:\n- Position nodes in a vertical flow (top to bottom)\n- Start at position { x: 0, y: 0 }\n- Space nodes vertically by exactly 250 pixels between each position (node height 150px + 100px spacing)\n- For horizontal spacing, use 350 pixels\n- Create logical flow from top to bottom\n- IMPORTANT: Keep consistent vertical spacing to avoid overlap\n- Each node position Y should increment by 250: first at y:0, second at y:250, third at y:500, etc.\n\nEXAMPLES:\n\nUser: \"Create a simple contact form with name, email and message\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Contact Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"email-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Email\",\n \"name\": \"email\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"your@email.com\"\n }\n },\n {\n \"id\": \"message-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Message\",\n \"name\": \"message\",\n \"type\": \"textarea\",\n \"required\": true,\n \"placeholder\": \"Enter your message\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"email-1\" },\n { \"id\": \"e3\", \"source\": \"email-1\", \"target\": \"message-1\" }\n ]\n}\n\nUser: \"Create a user registration form with age, address and country selector\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"User Registration\", \"type\": \"title\" }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"address-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Address\",\n \"name\": \"address\",\n \"type\": \"address\",\n \"required\": true,\n \"placeholder\": \"Enter your address\"\n }\n },\n {\n \"id\": \"country-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 750 },\n \"data\": {\n \"label\": \"Country\",\n \"name\": \"country\",\n \"type\": \"select\",\n \"required\": true,\n \"options\": [\n { \"value\": \"us\", \"label\": \"United States\" },\n { \"value\": \"ca\", \"label\": \"Canada\" },\n { \"value\": \"uk\", \"label\": \"United Kingdom\" },\n { \"value\": \"fr\", \"label\": \"France\" },\n { \"value\": \"de\", \"label\": \"Germany\" }\n ]\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"age-1\" },\n { \"id\": \"e2\", \"source\": \"age-1\", \"target\": \"address-1\" },\n { \"id\": \"e3\", \"source\": \"address-1\", \"target\": \"country-1\" },\n { \"id\": \"e4\", \"source\": \"country-1\", \"target\": \"submit-1\" }\n ]\n}\n\nUser: \"Create a form with name, age, and show different questions based on age (movie for 18+, color for under 18)\"\nResponse:\n{\n \"nodes\": [\n {\n \"id\": \"title-1\",\n \"type\": \"ui\",\n \"position\": { \"x\": 0, \"y\": 0 },\n \"data\": { \"label\": \"Survey Form\", \"type\": \"title\" }\n },\n {\n \"id\": \"name-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 250 },\n \"data\": {\n \"label\": \"Name\",\n \"name\": \"name\",\n \"type\": \"text\",\n \"required\": true,\n \"placeholder\": \"Enter your name\"\n }\n },\n {\n \"id\": \"age-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 500 },\n \"data\": {\n \"label\": \"Age\",\n \"name\": \"age\",\n \"type\": \"number\",\n \"required\": true,\n \"placeholder\": \"Enter your age\"\n }\n },\n {\n \"id\": \"movie-1\",\n \"type\": \"input\",\n \"position\": { \"x\": -350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Movie\",\n \"name\": \"favoriteMovie\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For adults 18 and over\"\n }\n },\n {\n \"id\": \"color-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 350, \"y\": 750 },\n \"data\": {\n \"label\": \"Favorite Color\",\n \"name\": \"favoriteColor\",\n \"type\": \"text\",\n \"required\": true,\n \"helperText\": \"For those under 18\"\n }\n },\n {\n \"id\": \"submit-1\",\n \"type\": \"input\",\n \"position\": { \"x\": 0, \"y\": 1000 },\n \"data\": {\n \"label\": \"Submit\",\n \"type\": \"submit\"\n }\n }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"title-1\", \"target\": \"name-1\" },\n { \"id\": \"e2\", \"source\": \"name-1\", \"target\": \"age-1\" },\n {\n \"id\": \"e3\",\n \"source\": \"age-1\",\n \"target\": \"movie-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If 18 or older\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \">=\",\n \"value\": \"18\"\n }\n ]\n }\n },\n {\n \"id\": \"e4\",\n \"source\": \"age-1\",\n \"target\": \"color-1\",\n \"type\": \"conditional\",\n \"data\": {\n \"label\": \"If under 18\",\n \"conditions\": [\n {\n \"field\": \"age-1\",\n \"operator\": \"<\",\n \"value\": \"18\"\n }\n ]\n }\n },\n { \"id\": \"e5\", \"source\": \"movie-1\", \"target\": \"submit-1\" },\n { \"id\": \"e6\", \"source\": \"color-1\", \"target\": \"submit-1\" }\n ]\n}\n\nRemember:\n- Always respond with ONLY valid JSON\n- No markdown code blocks\n- No explanations outside the JSON\n- Follow the exact structure shown above\n- For submit buttons, ALWAYS use type \"input\" with data.type \"submit\"\n- For conditional edges, ALWAYS specify the value as a string and use proper operators (>=, <, ===, etc.)\n- Never leave condition values empty - always provide the comparison value\n", ln = {
|
|
1149
1084
|
claude: "claude-3-5-haiku-20241022",
|
|
1150
1085
|
deepseek: "deepseek-chat",
|
|
1151
1086
|
gemini: "gemini-2.5-flash",
|
|
1152
1087
|
openai: "gpt-4o-mini"
|
|
1153
|
-
},
|
|
1154
|
-
function
|
|
1088
|
+
}, un = .3;
|
|
1089
|
+
function dn(e) {
|
|
1155
1090
|
try {
|
|
1156
1091
|
return JSON.parse(e);
|
|
1157
1092
|
} catch (t) {
|
|
@@ -1163,10 +1098,10 @@ function Cn(e) {
|
|
|
1163
1098
|
}
|
|
1164
1099
|
}
|
|
1165
1100
|
}
|
|
1166
|
-
async function
|
|
1167
|
-
let t = e.config.model ||
|
|
1101
|
+
async function fn(e) {
|
|
1102
|
+
let t = e.config.model || ln.gemini, n = e.config.temperature ?? un, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
|
|
1168
1103
|
body: JSON.stringify({
|
|
1169
|
-
contents: [{ parts: [{ text: `${
|
|
1104
|
+
contents: [{ parts: [{ text: `${cn}\n\nUser request: ${e.prompt}` }] }],
|
|
1170
1105
|
generationConfig: {
|
|
1171
1106
|
responseMimeType: "application/json",
|
|
1172
1107
|
temperature: n
|
|
@@ -1181,13 +1116,13 @@ async function wn(e) {
|
|
|
1181
1116
|
}
|
|
1182
1117
|
let i = (await r.json()).candidates?.[0]?.content?.parts?.[0]?.text;
|
|
1183
1118
|
if (!i) throw Error("No response from Gemini");
|
|
1184
|
-
return
|
|
1119
|
+
return dn(i);
|
|
1185
1120
|
}
|
|
1186
|
-
async function
|
|
1187
|
-
let t = e.config.model ||
|
|
1121
|
+
async function pn(e) {
|
|
1122
|
+
let t = e.config.model || ln.openai, n = e.config.temperature ?? un, r = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
1188
1123
|
body: JSON.stringify({
|
|
1189
1124
|
messages: [{
|
|
1190
|
-
content:
|
|
1125
|
+
content: cn,
|
|
1191
1126
|
role: "system"
|
|
1192
1127
|
}, {
|
|
1193
1128
|
content: e.prompt,
|
|
@@ -1209,13 +1144,13 @@ async function Tn(e) {
|
|
|
1209
1144
|
}
|
|
1210
1145
|
let i = (await r.json()).choices?.[0]?.message?.content;
|
|
1211
1146
|
if (!i) throw Error("No response from OpenAI");
|
|
1212
|
-
return
|
|
1147
|
+
return dn(i);
|
|
1213
1148
|
}
|
|
1214
|
-
async function
|
|
1215
|
-
let t = e.config.model ||
|
|
1149
|
+
async function mn(e) {
|
|
1150
|
+
let t = e.config.model || ln.deepseek, n = e.config.temperature ?? un, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
|
|
1216
1151
|
body: JSON.stringify({
|
|
1217
1152
|
messages: [{
|
|
1218
|
-
content:
|
|
1153
|
+
content: cn,
|
|
1219
1154
|
role: "system"
|
|
1220
1155
|
}, {
|
|
1221
1156
|
content: e.prompt,
|
|
@@ -1237,10 +1172,10 @@ async function En(e) {
|
|
|
1237
1172
|
}
|
|
1238
1173
|
let i = (await r.json()).choices?.[0]?.message?.content;
|
|
1239
1174
|
if (!i) throw Error("No response from DeepSeek");
|
|
1240
|
-
return
|
|
1175
|
+
return dn(i);
|
|
1241
1176
|
}
|
|
1242
|
-
async function
|
|
1243
|
-
let t = e.config.model ||
|
|
1177
|
+
async function hn(e) {
|
|
1178
|
+
let t = e.config.model || ln.claude, n = e.config.temperature ?? un, r = await fetch("https://api.anthropic.com/v1/messages", {
|
|
1244
1179
|
body: JSON.stringify({
|
|
1245
1180
|
max_tokens: 4096,
|
|
1246
1181
|
messages: [{
|
|
@@ -1248,7 +1183,7 @@ async function Dn(e) {
|
|
|
1248
1183
|
role: "user"
|
|
1249
1184
|
}],
|
|
1250
1185
|
model: t,
|
|
1251
|
-
system:
|
|
1186
|
+
system: cn,
|
|
1252
1187
|
temperature: n
|
|
1253
1188
|
}),
|
|
1254
1189
|
headers: {
|
|
@@ -1264,75 +1199,75 @@ async function Dn(e) {
|
|
|
1264
1199
|
}
|
|
1265
1200
|
let i = (await r.json()).content?.[0]?.text;
|
|
1266
1201
|
if (!i) throw Error("No response from Claude");
|
|
1267
|
-
return
|
|
1202
|
+
return dn(i);
|
|
1268
1203
|
}
|
|
1269
|
-
function
|
|
1204
|
+
function gn(e) {
|
|
1270
1205
|
switch (e.config.provider) {
|
|
1271
|
-
case "gemini": return
|
|
1272
|
-
case "openai": return
|
|
1273
|
-
case "deepseek": return
|
|
1274
|
-
case "claude": return
|
|
1206
|
+
case "gemini": return fn(e);
|
|
1207
|
+
case "openai": return pn(e);
|
|
1208
|
+
case "deepseek": return mn(e);
|
|
1209
|
+
case "claude": return hn(e);
|
|
1275
1210
|
default: throw Error(`Unsupported AI provider: ${e.config.provider}`);
|
|
1276
1211
|
}
|
|
1277
1212
|
}
|
|
1278
1213
|
//#endregion
|
|
1279
1214
|
//#region src/editor/features/TreegeEditor/panel/AIGeneratorDialog.tsx
|
|
1280
|
-
var
|
|
1281
|
-
let [n, r] =
|
|
1215
|
+
var _n = ({ aiConfig: e, onGenerate: t }) => {
|
|
1216
|
+
let [n, r] = B(!1), [i, a] = B(""), [o, s] = B(!1), c = G(), l = async () => {
|
|
1282
1217
|
if (!i.trim()) {
|
|
1283
|
-
|
|
1218
|
+
U.error(c("editor.aiGenerator.enterDescription"));
|
|
1284
1219
|
return;
|
|
1285
1220
|
}
|
|
1286
1221
|
if (!e?.apiKey) {
|
|
1287
|
-
|
|
1222
|
+
U.error(c("editor.aiGenerator.missingApiKey"), { description: c("editor.aiGenerator.missingApiKeyDesc") });
|
|
1288
1223
|
return;
|
|
1289
1224
|
}
|
|
1290
1225
|
s(!0);
|
|
1291
1226
|
try {
|
|
1292
|
-
let n = await
|
|
1227
|
+
let n = await gn({
|
|
1293
1228
|
config: e,
|
|
1294
1229
|
prompt: i.trim()
|
|
1295
1230
|
});
|
|
1296
1231
|
t({
|
|
1297
1232
|
edges: n.edges,
|
|
1298
1233
|
nodes: n.nodes
|
|
1299
|
-
}),
|
|
1234
|
+
}), U.success(c("editor.aiGenerator.successTitle"), { description: c("editor.aiGenerator.successDescription").replace("{nodes}", String(n.nodes.length)).replace("{edges}", String(n.edges.length)) }), a(""), r(!1);
|
|
1300
1235
|
} catch (e) {
|
|
1301
|
-
console.error("AI generation error:", e),
|
|
1236
|
+
console.error("AI generation error:", e), U.error(c("editor.aiGenerator.failedToGenerate"), { description: e instanceof Error ? e.message : c("editor.aiGenerator.unknownError") });
|
|
1302
1237
|
} finally {
|
|
1303
1238
|
s(!1);
|
|
1304
1239
|
}
|
|
1305
1240
|
};
|
|
1306
|
-
return /* @__PURE__ */
|
|
1241
|
+
return /* @__PURE__ */ F(oe, {
|
|
1307
1242
|
open: n,
|
|
1308
1243
|
onOpenChange: r,
|
|
1309
|
-
children: [/* @__PURE__ */
|
|
1244
|
+
children: [/* @__PURE__ */ P(S, {
|
|
1310
1245
|
asChild: !0,
|
|
1311
|
-
children: /* @__PURE__ */
|
|
1246
|
+
children: /* @__PURE__ */ F(p, {
|
|
1312
1247
|
variant: "outline",
|
|
1313
1248
|
size: "sm",
|
|
1314
1249
|
disabled: !e?.apiKey,
|
|
1315
1250
|
children: [
|
|
1316
|
-
/* @__PURE__ */
|
|
1251
|
+
/* @__PURE__ */ P(lt, { className: "h-4 w-4 text-[#13d3b4]" }),
|
|
1317
1252
|
" ",
|
|
1318
1253
|
c("editor.aiGenerator.buttonLabel")
|
|
1319
1254
|
]
|
|
1320
1255
|
})
|
|
1321
|
-
}), /* @__PURE__ */
|
|
1322
|
-
className: "sm:max-w-[550px]",
|
|
1256
|
+
}), /* @__PURE__ */ F(b, {
|
|
1257
|
+
className: "sm:max-w-[550px]!",
|
|
1323
1258
|
children: [
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
/* @__PURE__ */
|
|
1259
|
+
/* @__PURE__ */ F(re, { children: [/* @__PURE__ */ P(C, { children: c("editor.aiGenerator.title") }), /* @__PURE__ */ P(x, { children: c("editor.aiGenerator.titleDescription") })] }),
|
|
1260
|
+
/* @__PURE__ */ F("div", {
|
|
1326
1261
|
className: "grid gap-4 py-4",
|
|
1327
|
-
children: [/* @__PURE__ */
|
|
1262
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1328
1263
|
className: "grid gap-2",
|
|
1329
1264
|
children: [
|
|
1330
|
-
/* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ P("label", {
|
|
1331
1266
|
htmlFor: "ai-prompt",
|
|
1332
1267
|
className: "font-medium text-sm",
|
|
1333
1268
|
children: c("editor.aiGenerator.description")
|
|
1334
1269
|
}),
|
|
1335
|
-
/* @__PURE__ */
|
|
1270
|
+
/* @__PURE__ */ P(ne, {
|
|
1336
1271
|
placeholder: c("editor.aiGenerator.descriptionPlaceholder"),
|
|
1337
1272
|
value: i,
|
|
1338
1273
|
onChange: (e) => a(e.target.value),
|
|
@@ -1343,22 +1278,22 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1343
1278
|
disabled: o,
|
|
1344
1279
|
className: "resize-none"
|
|
1345
1280
|
}),
|
|
1346
|
-
/* @__PURE__ */
|
|
1281
|
+
/* @__PURE__ */ P("p", {
|
|
1347
1282
|
className: "text-muted-foreground text-xs",
|
|
1348
1283
|
children: c("editor.aiGenerator.keyboardShortcut").replace("{cmdEnter}", "⌘ Enter").replace("{ctrlEnter}", "Ctrl Enter")
|
|
1349
1284
|
})
|
|
1350
1285
|
]
|
|
1351
|
-
}), !e?.apiKey && /* @__PURE__ */
|
|
1286
|
+
}), !e?.apiKey && /* @__PURE__ */ F("div", {
|
|
1352
1287
|
className: "rounded-md bg-muted p-3 text-sm",
|
|
1353
|
-
children: [/* @__PURE__ */
|
|
1288
|
+
children: [/* @__PURE__ */ P("p", {
|
|
1354
1289
|
className: "font-medium",
|
|
1355
1290
|
children: c("editor.aiGenerator.aiNotConfigured")
|
|
1356
|
-
}), /* @__PURE__ */
|
|
1291
|
+
}), /* @__PURE__ */ F("p", {
|
|
1357
1292
|
className: "mt-1 text-muted-foreground text-xs",
|
|
1358
1293
|
children: [
|
|
1359
1294
|
c("editor.aiGenerator.aiNotConfiguredDesc").replace("{code}", ""),
|
|
1360
1295
|
" ",
|
|
1361
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ P("code", {
|
|
1362
1297
|
className: "rounded bg-background px-1 py-0.5",
|
|
1363
1298
|
children: "aiConfig"
|
|
1364
1299
|
})
|
|
@@ -1366,52 +1301,52 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1366
1301
|
})]
|
|
1367
1302
|
})]
|
|
1368
1303
|
}),
|
|
1369
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ F(O, { children: [/* @__PURE__ */ P(p, {
|
|
1370
1305
|
variant: "outline",
|
|
1371
1306
|
onClick: () => r(!1),
|
|
1372
1307
|
disabled: o,
|
|
1373
1308
|
children: c("editor.aiGenerator.cancel")
|
|
1374
|
-
}), /* @__PURE__ */
|
|
1309
|
+
}), /* @__PURE__ */ P(p, {
|
|
1375
1310
|
onClick: l,
|
|
1376
1311
|
disabled: o || !i.trim() || !e?.apiKey,
|
|
1377
|
-
children: o ? /* @__PURE__ */
|
|
1312
|
+
children: o ? /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(Je, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(lt, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
|
|
1378
1313
|
})] })
|
|
1379
1314
|
]
|
|
1380
1315
|
})]
|
|
1381
1316
|
});
|
|
1382
|
-
},
|
|
1383
|
-
let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } =
|
|
1317
|
+
}, vn = Wt(), yn = ({ onExportJson: e, onSave: t }) => {
|
|
1318
|
+
let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = M(), l = n || vn, u = we(), d = Ce(), f = vt(null), m = G(), h = () => {
|
|
1384
1319
|
let e = (window.innerWidth || 0) / 2, t = (window.innerHeight || 0) / 2, n = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-width"), 10), r = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--node-height"), 10), i = c({
|
|
1385
1320
|
x: e - n,
|
|
1386
1321
|
y: t - r
|
|
1387
1322
|
});
|
|
1388
1323
|
s([{
|
|
1389
|
-
...
|
|
1390
|
-
id:
|
|
1324
|
+
...Gt,
|
|
1325
|
+
id: Wt(),
|
|
1391
1326
|
position: i,
|
|
1392
1327
|
selected: !0
|
|
1393
1328
|
}]);
|
|
1394
|
-
},
|
|
1329
|
+
}, ee = ({ target: e }) => {
|
|
1395
1330
|
let t = e.files?.[0];
|
|
1396
1331
|
if (!t) return;
|
|
1397
1332
|
let n = new FileReader();
|
|
1398
1333
|
n.onload = (e) => {
|
|
1399
1334
|
try {
|
|
1400
1335
|
let t = JSON.parse(e.target?.result);
|
|
1401
|
-
t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges),
|
|
1336
|
+
t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges), U.success(m("editor.actionsPanel.importSuccess"), { description: m("editor.actionsPanel.importSuccessDesc") })) : U.error(m("editor.actionsPanel.invalidJson"), { description: m("editor.actionsPanel.invalidJsonDesc") });
|
|
1402
1337
|
} catch (e) {
|
|
1403
|
-
console.warn(e),
|
|
1338
|
+
console.warn(e), U.error(m("editor.actionsPanel.parseError"), { description: m("editor.actionsPanel.parseErrorDesc") });
|
|
1404
1339
|
}
|
|
1405
1340
|
f.current && (f.current.value = "");
|
|
1406
1341
|
}, n.readAsText(t);
|
|
1407
|
-
},
|
|
1342
|
+
}, g = () => {
|
|
1408
1343
|
let t = {
|
|
1409
1344
|
edges: d,
|
|
1410
1345
|
id: l,
|
|
1411
1346
|
nodes: u
|
|
1412
1347
|
}, i = new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
1413
|
-
o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a),
|
|
1414
|
-
},
|
|
1348
|
+
o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a), U.success(m("editor.actionsPanel.downloadSuccess"), { description: m("editor.actionsPanel.downloadSuccessDesc") }), n || r?.(l), e?.(t);
|
|
1349
|
+
}, _ = z(() => {
|
|
1415
1350
|
n || r?.(l), t?.({
|
|
1416
1351
|
edges: d,
|
|
1417
1352
|
id: l,
|
|
@@ -1425,117 +1360,117 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1425
1360
|
t,
|
|
1426
1361
|
r
|
|
1427
1362
|
]);
|
|
1428
|
-
return
|
|
1363
|
+
return ht(() => {
|
|
1429
1364
|
let e = (e) => {
|
|
1430
|
-
(e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(),
|
|
1365
|
+
(e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), _());
|
|
1431
1366
|
};
|
|
1432
1367
|
return window.addEventListener("keydown", e), () => {
|
|
1433
1368
|
window.removeEventListener("keydown", e);
|
|
1434
1369
|
};
|
|
1435
|
-
}, [
|
|
1370
|
+
}, [_]), /* @__PURE__ */ F(_e, {
|
|
1436
1371
|
position: "top-right",
|
|
1437
1372
|
className: "flex gap-2",
|
|
1438
1373
|
children: [
|
|
1439
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ P(_n, {
|
|
1440
1375
|
aiConfig: i,
|
|
1441
1376
|
onGenerate: (e) => {
|
|
1442
1377
|
a(e.nodes), o(e.edges);
|
|
1443
1378
|
}
|
|
1444
1379
|
}),
|
|
1445
|
-
/* @__PURE__ */
|
|
1380
|
+
/* @__PURE__ */ F(p, {
|
|
1446
1381
|
variant: "outline",
|
|
1447
1382
|
size: "sm",
|
|
1448
1383
|
onClick: h,
|
|
1449
1384
|
children: [
|
|
1450
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ P(L, {}),
|
|
1451
1386
|
" ",
|
|
1452
1387
|
m("editor.actionsPanel.addNode")
|
|
1453
1388
|
]
|
|
1454
1389
|
}),
|
|
1455
|
-
/* @__PURE__ */
|
|
1390
|
+
/* @__PURE__ */ F(p, {
|
|
1456
1391
|
variant: "outline",
|
|
1457
1392
|
size: "sm",
|
|
1458
|
-
onClick:
|
|
1393
|
+
onClick: _,
|
|
1459
1394
|
children: [
|
|
1460
|
-
/* @__PURE__ */
|
|
1395
|
+
/* @__PURE__ */ P(tt, {}),
|
|
1461
1396
|
" ",
|
|
1462
1397
|
m("common.save")
|
|
1463
1398
|
]
|
|
1464
1399
|
}),
|
|
1465
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
|
|
1466
1401
|
asChild: !0,
|
|
1467
|
-
children: /* @__PURE__ */
|
|
1402
|
+
children: /* @__PURE__ */ P(p, {
|
|
1468
1403
|
variant: "outline",
|
|
1469
1404
|
size: "sm",
|
|
1470
|
-
children: /* @__PURE__ */
|
|
1405
|
+
children: /* @__PURE__ */ P(Be, {})
|
|
1471
1406
|
})
|
|
1472
|
-
}), /* @__PURE__ */
|
|
1407
|
+
}), /* @__PURE__ */ F(X, {
|
|
1473
1408
|
align: "start",
|
|
1474
1409
|
children: [
|
|
1475
|
-
/* @__PURE__ */
|
|
1410
|
+
/* @__PURE__ */ P(Lt, {
|
|
1476
1411
|
className: "font-normal",
|
|
1477
|
-
children: /* @__PURE__ */
|
|
1412
|
+
children: /* @__PURE__ */ F("div", {
|
|
1478
1413
|
className: "flex flex-col gap-1",
|
|
1479
|
-
children: [/* @__PURE__ */
|
|
1414
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1480
1415
|
className: "text-muted-foreground text-xs",
|
|
1481
1416
|
children: "Flow ID"
|
|
1482
|
-
}), /* @__PURE__ */
|
|
1417
|
+
}), /* @__PURE__ */ F("button", {
|
|
1483
1418
|
onClick: async () => {
|
|
1484
1419
|
try {
|
|
1485
|
-
await navigator.clipboard.writeText(l),
|
|
1420
|
+
await navigator.clipboard.writeText(l), U.success(m("editor.actionsPanel.idCopied"), { description: l });
|
|
1486
1421
|
} catch {
|
|
1487
|
-
|
|
1422
|
+
U.error(m("editor.actionsPanel.copyFailed"));
|
|
1488
1423
|
}
|
|
1489
1424
|
},
|
|
1490
1425
|
className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
|
|
1491
1426
|
type: "button",
|
|
1492
|
-
children: [/* @__PURE__ */
|
|
1427
|
+
children: [/* @__PURE__ */ P(Re, { className: "h-3 w-3" }), /* @__PURE__ */ P("span", {
|
|
1493
1428
|
className: "truncate text-xs",
|
|
1494
1429
|
children: l
|
|
1495
1430
|
})]
|
|
1496
1431
|
})]
|
|
1497
1432
|
})
|
|
1498
1433
|
}),
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1434
|
+
/* @__PURE__ */ P(Rt, {}),
|
|
1435
|
+
/* @__PURE__ */ F(It, { children: [/* @__PURE__ */ F(Z, {
|
|
1501
1436
|
onClick: () => f?.current?.click(),
|
|
1502
1437
|
children: [
|
|
1503
|
-
/* @__PURE__ */
|
|
1438
|
+
/* @__PURE__ */ P(ze, {}),
|
|
1504
1439
|
" ",
|
|
1505
1440
|
m("editor.actionsPanel.importJson")
|
|
1506
1441
|
]
|
|
1507
|
-
}), /* @__PURE__ */
|
|
1508
|
-
onClick:
|
|
1442
|
+
}), /* @__PURE__ */ F(Z, {
|
|
1443
|
+
onClick: g,
|
|
1509
1444
|
children: [
|
|
1510
|
-
/* @__PURE__ */
|
|
1445
|
+
/* @__PURE__ */ P(Ee, {}),
|
|
1511
1446
|
" ",
|
|
1512
1447
|
m("editor.actionsPanel.exportJson")
|
|
1513
1448
|
]
|
|
1514
1449
|
})] }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1516
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ P(Rt, {}),
|
|
1451
|
+
/* @__PURE__ */ P(It, { children: /* @__PURE__ */ F(Z, {
|
|
1517
1452
|
onClick: () => {
|
|
1518
|
-
a([]), o([]),
|
|
1453
|
+
a([]), o([]), U.success(m("editor.actionsPanel.clearSuccess"), { description: m("editor.actionsPanel.clearSuccessDesc") });
|
|
1519
1454
|
},
|
|
1520
1455
|
className: "text-destructive focus:text-destructive",
|
|
1521
1456
|
children: [
|
|
1522
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ P(ot, { className: "text-destructive" }),
|
|
1523
1458
|
" ",
|
|
1524
1459
|
m("editor.actionsPanel.clear")
|
|
1525
1460
|
]
|
|
1526
1461
|
}) })
|
|
1527
1462
|
]
|
|
1528
1463
|
})] }),
|
|
1529
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ P("input", {
|
|
1530
1465
|
type: "file",
|
|
1531
1466
|
accept: "application/json,.json",
|
|
1532
1467
|
className: "hidden",
|
|
1533
1468
|
ref: f,
|
|
1534
|
-
onChange:
|
|
1469
|
+
onChange: ee
|
|
1535
1470
|
})
|
|
1536
1471
|
]
|
|
1537
1472
|
});
|
|
1538
|
-
},
|
|
1473
|
+
}, bn = {
|
|
1539
1474
|
ar: "ar",
|
|
1540
1475
|
de: "de",
|
|
1541
1476
|
en: "en",
|
|
@@ -1543,19 +1478,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1543
1478
|
fr: "fr",
|
|
1544
1479
|
it: "it",
|
|
1545
1480
|
pt: "pt"
|
|
1546
|
-
}, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */
|
|
1481
|
+
}, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */ F(g, {
|
|
1547
1482
|
value: e,
|
|
1548
1483
|
onValueChange: t,
|
|
1549
|
-
children: [/* @__PURE__ */
|
|
1484
|
+
children: [/* @__PURE__ */ P(h, {
|
|
1550
1485
|
className: "uppercase",
|
|
1551
|
-
children: /* @__PURE__ */
|
|
1552
|
-
}), /* @__PURE__ */
|
|
1486
|
+
children: /* @__PURE__ */ P(c, { placeholder: "" })
|
|
1487
|
+
}), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.values(bn).map((e) => /* @__PURE__ */ P(v, {
|
|
1553
1488
|
value: e,
|
|
1554
1489
|
className: "uppercase",
|
|
1555
1490
|
children: e
|
|
1556
1491
|
}, e)) }) })]
|
|
1557
1492
|
}), $ = () => {
|
|
1558
|
-
let e =
|
|
1493
|
+
let e = we(), t = _t(() => e.filter(i), [e]), n = _t(() => e.filter((e) => e.selected), [e]), r = _t(() => e.find((e) => e.selected), [e]);
|
|
1559
1494
|
return {
|
|
1560
1495
|
groupNodes: t,
|
|
1561
1496
|
hasSelectedNodes: n.length > 0,
|
|
@@ -1563,8 +1498,8 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1563
1498
|
selectedNode: r,
|
|
1564
1499
|
selectedNodes: n
|
|
1565
1500
|
};
|
|
1566
|
-
},
|
|
1567
|
-
let [e, t] =
|
|
1501
|
+
}, xn = () => {
|
|
1502
|
+
let [e, t] = B("en"), { updateSelectedNodeData: n } = q(), { selectedNode: r } = $(), i = G(), { Field: a } = I({
|
|
1568
1503
|
defaultValues: {
|
|
1569
1504
|
label: r?.data?.label || { en: "" },
|
|
1570
1505
|
targetId: r?.data?.targetId || ""
|
|
@@ -1579,22 +1514,22 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1579
1514
|
n(e);
|
|
1580
1515
|
}
|
|
1581
1516
|
});
|
|
1582
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ P("form", {
|
|
1583
1518
|
onSubmit: (e) => {
|
|
1584
1519
|
e.preventDefault(), e.stopPropagation();
|
|
1585
1520
|
},
|
|
1586
|
-
children: /* @__PURE__ */
|
|
1521
|
+
children: /* @__PURE__ */ F("div", {
|
|
1587
1522
|
className: "grid gap-6",
|
|
1588
|
-
children: [/* @__PURE__ */
|
|
1523
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1589
1524
|
className: "flex items-end gap-2",
|
|
1590
|
-
children: [/* @__PURE__ */
|
|
1525
|
+
children: [/* @__PURE__ */ P(a, {
|
|
1591
1526
|
name: "label",
|
|
1592
|
-
children: (t) => /* @__PURE__ */
|
|
1527
|
+
children: (t) => /* @__PURE__ */ F(w, {
|
|
1593
1528
|
className: "flex-1",
|
|
1594
|
-
children: [/* @__PURE__ */
|
|
1529
|
+
children: [/* @__PURE__ */ P(l, {
|
|
1595
1530
|
htmlFor: t.name,
|
|
1596
1531
|
children: i("editor.flowNodeForm.label")
|
|
1597
|
-
}), /* @__PURE__ */
|
|
1532
|
+
}), /* @__PURE__ */ P(m, {
|
|
1598
1533
|
id: t.name,
|
|
1599
1534
|
name: t.name,
|
|
1600
1535
|
value: t.state.value?.[e] || "",
|
|
@@ -1607,31 +1542,31 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1607
1542
|
}
|
|
1608
1543
|
})]
|
|
1609
1544
|
})
|
|
1610
|
-
}), /* @__PURE__ */
|
|
1545
|
+
}), /* @__PURE__ */ P(Q, {
|
|
1611
1546
|
value: e,
|
|
1612
1547
|
onValueChange: t
|
|
1613
1548
|
})]
|
|
1614
|
-
}), /* @__PURE__ */
|
|
1549
|
+
}), /* @__PURE__ */ P(a, {
|
|
1615
1550
|
name: "targetId",
|
|
1616
|
-
children: (e) => /* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1551
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
1552
|
+
/* @__PURE__ */ F(l, {
|
|
1618
1553
|
htmlFor: e.name,
|
|
1619
1554
|
children: [i("editor.flowNodeForm.targetId"), " (Flow ID)"]
|
|
1620
1555
|
}),
|
|
1621
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ P(m, {
|
|
1622
1557
|
id: e.name,
|
|
1623
1558
|
name: e.name,
|
|
1624
1559
|
value: e.state.value,
|
|
1625
1560
|
onBlur: e.handleBlur,
|
|
1626
1561
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1627
1562
|
}),
|
|
1628
|
-
/* @__PURE__ */
|
|
1563
|
+
/* @__PURE__ */ P(T, { children: "Unique identifier of the target flow." })
|
|
1629
1564
|
] })
|
|
1630
1565
|
})]
|
|
1631
1566
|
})
|
|
1632
1567
|
});
|
|
1633
|
-
},
|
|
1634
|
-
let [e, t] =
|
|
1568
|
+
}, Sn = () => {
|
|
1569
|
+
let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = I({
|
|
1635
1570
|
defaultValues: { label: n?.data?.label || { en: "" } },
|
|
1636
1571
|
listeners: {
|
|
1637
1572
|
onChange: ({ formApi: e }) => {
|
|
@@ -1643,20 +1578,20 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1643
1578
|
r(e);
|
|
1644
1579
|
}
|
|
1645
1580
|
});
|
|
1646
|
-
return /* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ P("form", {
|
|
1647
1582
|
onSubmit: (e) => {
|
|
1648
1583
|
e.preventDefault(), e.stopPropagation();
|
|
1649
1584
|
},
|
|
1650
|
-
children: /* @__PURE__ */
|
|
1585
|
+
children: /* @__PURE__ */ F("div", {
|
|
1651
1586
|
className: "flex items-end gap-2",
|
|
1652
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ P(i, {
|
|
1653
1588
|
name: "label",
|
|
1654
|
-
children: (t) => /* @__PURE__ */
|
|
1589
|
+
children: (t) => /* @__PURE__ */ F(w, {
|
|
1655
1590
|
className: "flex-1",
|
|
1656
|
-
children: [/* @__PURE__ */
|
|
1591
|
+
children: [/* @__PURE__ */ P(l, {
|
|
1657
1592
|
htmlFor: t.name,
|
|
1658
1593
|
children: "Label"
|
|
1659
|
-
}), /* @__PURE__ */
|
|
1594
|
+
}), /* @__PURE__ */ P(m, {
|
|
1660
1595
|
id: t.name,
|
|
1661
1596
|
name: t.name,
|
|
1662
1597
|
value: t.state.value?.[e] || "",
|
|
@@ -1669,18 +1604,18 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1669
1604
|
}
|
|
1670
1605
|
})]
|
|
1671
1606
|
})
|
|
1672
|
-
}), /* @__PURE__ */
|
|
1607
|
+
}), /* @__PURE__ */ P(Q, {
|
|
1673
1608
|
value: e,
|
|
1674
1609
|
onValueChange: t
|
|
1675
1610
|
})]
|
|
1676
1611
|
})
|
|
1677
1612
|
});
|
|
1678
|
-
},
|
|
1613
|
+
}, Cn = [
|
|
1679
1614
|
"POST",
|
|
1680
1615
|
"PUT",
|
|
1681
1616
|
"PATCH"
|
|
1682
|
-
],
|
|
1683
|
-
let { selectedNode: n } = $(), r = G(), i =
|
|
1617
|
+
], wn = ({ value: e, onChange: t }) => {
|
|
1618
|
+
let { selectedNode: n } = $(), r = G(), i = Ot(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = I({
|
|
1684
1619
|
defaultValues: {
|
|
1685
1620
|
body: e?.body || "",
|
|
1686
1621
|
fetchOnMount: e?.fetchOnMount ?? !e?.searchParam,
|
|
@@ -1706,19 +1641,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1706
1641
|
t(e);
|
|
1707
1642
|
}
|
|
1708
1643
|
});
|
|
1709
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ P("div", { children: /* @__PURE__ */ F("div", {
|
|
1710
1645
|
className: "grid gap-6",
|
|
1711
1646
|
children: [
|
|
1712
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ P(o, {
|
|
1713
1648
|
name: "url",
|
|
1714
|
-
children: (e) => /* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1649
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
1650
|
+
/* @__PURE__ */ P(l, {
|
|
1716
1651
|
htmlFor: e.name,
|
|
1717
1652
|
children: r("editor.httpConfigForm.apiUrl")
|
|
1718
1653
|
}),
|
|
1719
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ F("div", {
|
|
1720
1655
|
className: "flex gap-2",
|
|
1721
|
-
children: [/* @__PURE__ */
|
|
1656
|
+
children: [/* @__PURE__ */ P(m, {
|
|
1722
1657
|
id: e.name,
|
|
1723
1658
|
name: e.name,
|
|
1724
1659
|
value: e.state.value,
|
|
@@ -1726,30 +1661,30 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1726
1661
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1727
1662
|
placeholder: r("editor.httpConfigForm.apiUrlPlaceholder"),
|
|
1728
1663
|
className: "flex-1"
|
|
1729
|
-
}), /* @__PURE__ */
|
|
1664
|
+
}), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
|
|
1730
1665
|
asChild: !0,
|
|
1731
|
-
children: /* @__PURE__ */
|
|
1666
|
+
children: /* @__PURE__ */ P(p, {
|
|
1732
1667
|
type: "button",
|
|
1733
1668
|
variant: "outline",
|
|
1734
1669
|
size: "icon",
|
|
1735
|
-
children: /* @__PURE__ */
|
|
1670
|
+
children: /* @__PURE__ */ P(ct, { className: "h-4 w-4" })
|
|
1736
1671
|
})
|
|
1737
|
-
}), /* @__PURE__ */
|
|
1672
|
+
}), /* @__PURE__ */ P(X, {
|
|
1738
1673
|
align: "end",
|
|
1739
|
-
children: i.length === 0 ? /* @__PURE__ */
|
|
1674
|
+
children: i.length === 0 ? /* @__PURE__ */ P(Z, {
|
|
1740
1675
|
disabled: !0,
|
|
1741
1676
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1742
|
-
}) : i.map((t) => /* @__PURE__ */
|
|
1677
|
+
}) : i.map((t) => /* @__PURE__ */ P(Z, {
|
|
1743
1678
|
onClick: () => {
|
|
1744
1679
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1745
1680
|
e.handleChange(r + n);
|
|
1746
1681
|
},
|
|
1747
|
-
children: /* @__PURE__ */
|
|
1682
|
+
children: /* @__PURE__ */ F("div", {
|
|
1748
1683
|
className: "flex flex-col",
|
|
1749
|
-
children: [/* @__PURE__ */
|
|
1684
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1750
1685
|
className: "font-medium",
|
|
1751
1686
|
children: t.label
|
|
1752
|
-
}), /* @__PURE__ */
|
|
1687
|
+
}), /* @__PURE__ */ P("span", {
|
|
1753
1688
|
className: "text-muted-foreground text-xs",
|
|
1754
1689
|
children: `{{${t.nodeId}}}`
|
|
1755
1690
|
})]
|
|
@@ -1757,87 +1692,87 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1757
1692
|
}, t.nodeId))
|
|
1758
1693
|
})] })]
|
|
1759
1694
|
}),
|
|
1760
|
-
/* @__PURE__ */
|
|
1695
|
+
/* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.apiUrlDesc") })
|
|
1761
1696
|
] })
|
|
1762
1697
|
}),
|
|
1763
|
-
/* @__PURE__ */
|
|
1698
|
+
/* @__PURE__ */ P(o, {
|
|
1764
1699
|
name: "method",
|
|
1765
|
-
children: (e) => /* @__PURE__ */
|
|
1700
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
1766
1701
|
htmlFor: e.name,
|
|
1767
1702
|
children: r("editor.httpConfigForm.httpMethod")
|
|
1768
|
-
}), /* @__PURE__ */
|
|
1703
|
+
}), /* @__PURE__ */ F(g, {
|
|
1769
1704
|
value: e.state.value,
|
|
1770
1705
|
onValueChange: (t) => e.handleChange(t),
|
|
1771
|
-
children: [/* @__PURE__ */
|
|
1706
|
+
children: [/* @__PURE__ */ P(h, {
|
|
1772
1707
|
id: e.name,
|
|
1773
|
-
children: /* @__PURE__ */
|
|
1774
|
-
}), /* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */
|
|
1708
|
+
children: /* @__PURE__ */ P(c, { placeholder: r("editor.httpConfigForm.selectMethod") })
|
|
1709
|
+
}), /* @__PURE__ */ F(A, { children: [
|
|
1710
|
+
/* @__PURE__ */ P(v, {
|
|
1776
1711
|
value: "GET",
|
|
1777
1712
|
children: r("editor.httpConfigForm.methodGet")
|
|
1778
1713
|
}),
|
|
1779
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ P(v, {
|
|
1780
1715
|
value: "POST",
|
|
1781
1716
|
children: r("editor.httpConfigForm.methodPost")
|
|
1782
1717
|
}),
|
|
1783
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ P(v, {
|
|
1784
1719
|
value: "PUT",
|
|
1785
1720
|
children: r("editor.httpConfigForm.methodPut")
|
|
1786
1721
|
}),
|
|
1787
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ P(v, {
|
|
1788
1723
|
value: "DELETE",
|
|
1789
1724
|
children: r("editor.httpConfigForm.methodDelete")
|
|
1790
1725
|
}),
|
|
1791
|
-
/* @__PURE__ */
|
|
1726
|
+
/* @__PURE__ */ P(v, {
|
|
1792
1727
|
value: "PATCH",
|
|
1793
1728
|
children: r("editor.httpConfigForm.methodPatch")
|
|
1794
1729
|
})
|
|
1795
1730
|
] })]
|
|
1796
1731
|
})] })
|
|
1797
1732
|
}),
|
|
1798
|
-
/* @__PURE__ */
|
|
1733
|
+
/* @__PURE__ */ F("div", {
|
|
1799
1734
|
className: "space-y-4",
|
|
1800
|
-
children: [/* @__PURE__ */
|
|
1735
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
1801
1736
|
className: "font-semibold text-sm",
|
|
1802
1737
|
children: r("editor.httpConfigForm.headers")
|
|
1803
|
-
}), /* @__PURE__ */
|
|
1738
|
+
}), /* @__PURE__ */ P(o, {
|
|
1804
1739
|
name: "headers",
|
|
1805
1740
|
mode: "array",
|
|
1806
|
-
children: (e) => /* @__PURE__ */
|
|
1741
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
1807
1742
|
className: "space-y-2",
|
|
1808
1743
|
children: [e.state.value?.map((t, n) => {
|
|
1809
1744
|
let i = `headers[${n}]`;
|
|
1810
|
-
return /* @__PURE__ */
|
|
1745
|
+
return /* @__PURE__ */ F("div", {
|
|
1811
1746
|
className: "flex items-start gap-2",
|
|
1812
1747
|
children: [
|
|
1813
|
-
/* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ P(o, {
|
|
1814
1749
|
name: `headers[${n}].key`,
|
|
1815
|
-
children: (e) => /* @__PURE__ */
|
|
1750
|
+
children: (e) => /* @__PURE__ */ P(m, {
|
|
1816
1751
|
placeholder: r("editor.httpConfigForm.headerName"),
|
|
1817
1752
|
value: e.state.value || "",
|
|
1818
1753
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1819
1754
|
})
|
|
1820
1755
|
}),
|
|
1821
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ P(o, {
|
|
1822
1757
|
name: `headers[${n}].value`,
|
|
1823
|
-
children: (e) => /* @__PURE__ */
|
|
1758
|
+
children: (e) => /* @__PURE__ */ P(m, {
|
|
1824
1759
|
placeholder: r("editor.httpConfigForm.headerValue"),
|
|
1825
1760
|
value: e.state.value || "",
|
|
1826
1761
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1827
1762
|
})
|
|
1828
1763
|
}),
|
|
1829
|
-
/* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ P(p, {
|
|
1830
1765
|
type: "button",
|
|
1831
1766
|
variant: "ghost",
|
|
1832
1767
|
size: "icon",
|
|
1833
1768
|
onClick: () => {
|
|
1834
1769
|
e.removeValue(n);
|
|
1835
1770
|
},
|
|
1836
|
-
children: /* @__PURE__ */
|
|
1771
|
+
children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
|
|
1837
1772
|
})
|
|
1838
1773
|
]
|
|
1839
1774
|
}, i);
|
|
1840
|
-
}), /* @__PURE__ */
|
|
1775
|
+
}), /* @__PURE__ */ F(p, {
|
|
1841
1776
|
type: "button",
|
|
1842
1777
|
variant: "outline",
|
|
1843
1778
|
size: "sm",
|
|
@@ -1847,64 +1782,64 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1847
1782
|
value: ""
|
|
1848
1783
|
});
|
|
1849
1784
|
},
|
|
1850
|
-
children: [/* @__PURE__ */
|
|
1785
|
+
children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.addHeader")]
|
|
1851
1786
|
})]
|
|
1852
1787
|
})
|
|
1853
1788
|
})]
|
|
1854
1789
|
}),
|
|
1855
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ P(s, {
|
|
1856
1791
|
selector: (e) => ({
|
|
1857
1792
|
method: e.values.method,
|
|
1858
1793
|
sendAllFormValues: e.values.sendAllFormValues
|
|
1859
1794
|
}),
|
|
1860
|
-
children: ({ method: e, sendAllFormValues: t }) =>
|
|
1795
|
+
children: ({ method: e, sendAllFormValues: t }) => Cn.includes(e || "") && /* @__PURE__ */ F("div", {
|
|
1861
1796
|
className: "space-y-4",
|
|
1862
|
-
children: [/* @__PURE__ */
|
|
1797
|
+
children: [/* @__PURE__ */ P(o, {
|
|
1863
1798
|
name: "sendAllFormValues",
|
|
1864
|
-
children: (e) => /* @__PURE__ */
|
|
1799
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
1865
1800
|
className: "flex items-center space-x-2",
|
|
1866
|
-
children: [/* @__PURE__ */
|
|
1801
|
+
children: [/* @__PURE__ */ P(y, {
|
|
1867
1802
|
id: e.name,
|
|
1868
1803
|
checked: e.state.value,
|
|
1869
1804
|
onCheckedChange: (t) => e.handleChange(t)
|
|
1870
|
-
}), /* @__PURE__ */
|
|
1805
|
+
}), /* @__PURE__ */ P(l, {
|
|
1871
1806
|
htmlFor: e.name,
|
|
1872
1807
|
children: r("editor.httpConfigForm.sendAllFormValues")
|
|
1873
1808
|
})]
|
|
1874
1809
|
})
|
|
1875
|
-
}), /* @__PURE__ */
|
|
1810
|
+
}), /* @__PURE__ */ P(o, {
|
|
1876
1811
|
name: "body",
|
|
1877
|
-
children: (e) => /* @__PURE__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1812
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
1813
|
+
/* @__PURE__ */ F("div", {
|
|
1879
1814
|
className: "mb-2 flex items-center justify-between",
|
|
1880
|
-
children: [/* @__PURE__ */
|
|
1815
|
+
children: [/* @__PURE__ */ P(l, {
|
|
1881
1816
|
htmlFor: e.name,
|
|
1882
1817
|
children: r("editor.httpConfigForm.requestBody")
|
|
1883
|
-
}), /* @__PURE__ */
|
|
1818
|
+
}), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
|
|
1884
1819
|
asChild: !0,
|
|
1885
|
-
children: /* @__PURE__ */
|
|
1820
|
+
children: /* @__PURE__ */ F(p, {
|
|
1886
1821
|
type: "button",
|
|
1887
1822
|
variant: "ghost",
|
|
1888
1823
|
size: "sm",
|
|
1889
1824
|
disabled: t,
|
|
1890
|
-
children: [/* @__PURE__ */
|
|
1825
|
+
children: [/* @__PURE__ */ P(ct, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
|
|
1891
1826
|
})
|
|
1892
|
-
}), /* @__PURE__ */
|
|
1827
|
+
}), /* @__PURE__ */ P(X, {
|
|
1893
1828
|
align: "end",
|
|
1894
|
-
children: i.length === 0 ? /* @__PURE__ */
|
|
1829
|
+
children: i.length === 0 ? /* @__PURE__ */ P(Z, {
|
|
1895
1830
|
disabled: !0,
|
|
1896
1831
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1897
|
-
}) : i.map((t) => /* @__PURE__ */
|
|
1832
|
+
}) : i.map((t) => /* @__PURE__ */ P(Z, {
|
|
1898
1833
|
onClick: () => {
|
|
1899
1834
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1900
1835
|
e.handleChange(r + n), a().then();
|
|
1901
1836
|
},
|
|
1902
|
-
children: /* @__PURE__ */
|
|
1837
|
+
children: /* @__PURE__ */ F("div", {
|
|
1903
1838
|
className: "flex flex-col",
|
|
1904
|
-
children: [/* @__PURE__ */
|
|
1839
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1905
1840
|
className: "font-medium",
|
|
1906
1841
|
children: t.label
|
|
1907
|
-
}), /* @__PURE__ */
|
|
1842
|
+
}), /* @__PURE__ */ P("span", {
|
|
1908
1843
|
className: "text-muted-foreground text-xs",
|
|
1909
1844
|
children: `{{${t.nodeId}}}`
|
|
1910
1845
|
})]
|
|
@@ -1912,7 +1847,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1912
1847
|
}, t.nodeId))
|
|
1913
1848
|
})] })]
|
|
1914
1849
|
}),
|
|
1915
|
-
/* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ P(ne, {
|
|
1916
1851
|
id: e.name,
|
|
1917
1852
|
name: e.name,
|
|
1918
1853
|
value: e.state.value,
|
|
@@ -1922,26 +1857,26 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1922
1857
|
rows: 4,
|
|
1923
1858
|
disabled: t
|
|
1924
1859
|
}),
|
|
1925
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ P(T, { children: r(t ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
|
|
1926
1861
|
] })
|
|
1927
1862
|
})]
|
|
1928
1863
|
})
|
|
1929
1864
|
}),
|
|
1930
|
-
/* @__PURE__ */
|
|
1865
|
+
/* @__PURE__ */ F("div", {
|
|
1931
1866
|
className: "space-y-4",
|
|
1932
1867
|
children: [
|
|
1933
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ P("h4", {
|
|
1934
1869
|
className: "font-semibold text-sm",
|
|
1935
1870
|
children: r("editor.httpConfigForm.responseConfiguration")
|
|
1936
1871
|
}),
|
|
1937
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ P(o, {
|
|
1938
1873
|
name: "responsePath",
|
|
1939
|
-
children: (e) => /* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
1874
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
1875
|
+
/* @__PURE__ */ P(l, {
|
|
1941
1876
|
htmlFor: e.name,
|
|
1942
1877
|
children: r("editor.httpConfigForm.responsePath")
|
|
1943
1878
|
}),
|
|
1944
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ P(m, {
|
|
1945
1880
|
id: e.name,
|
|
1946
1881
|
name: e.name,
|
|
1947
1882
|
value: e.state.value,
|
|
@@ -1949,24 +1884,24 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1949
1884
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1950
1885
|
placeholder: r("editor.httpConfigForm.responsePathPlaceholder")
|
|
1951
1886
|
}),
|
|
1952
|
-
/* @__PURE__ */
|
|
1887
|
+
/* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.responsePathDesc") })
|
|
1953
1888
|
] })
|
|
1954
1889
|
}),
|
|
1955
|
-
/* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ F("div", {
|
|
1956
1891
|
className: "space-y-4",
|
|
1957
1892
|
children: [
|
|
1958
|
-
/* @__PURE__ */
|
|
1893
|
+
/* @__PURE__ */ P("h5", {
|
|
1959
1894
|
className: "font-medium text-sm",
|
|
1960
1895
|
children: r("editor.httpConfigForm.mapToOptions")
|
|
1961
1896
|
}),
|
|
1962
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ P(o, {
|
|
1963
1898
|
name: "responseMapping.valueField",
|
|
1964
|
-
children: (e) => /* @__PURE__ */
|
|
1965
|
-
/* @__PURE__ */
|
|
1899
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
1900
|
+
/* @__PURE__ */ P(l, {
|
|
1966
1901
|
htmlFor: e.name,
|
|
1967
1902
|
children: r("editor.httpConfigForm.valueField")
|
|
1968
1903
|
}),
|
|
1969
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ P(m, {
|
|
1970
1905
|
id: e.name,
|
|
1971
1906
|
name: e.name,
|
|
1972
1907
|
value: e.state.value,
|
|
@@ -1974,17 +1909,17 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1974
1909
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1975
1910
|
placeholder: r("editor.httpConfigForm.valueFieldPlaceholder")
|
|
1976
1911
|
}),
|
|
1977
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.valueFieldDesc") })
|
|
1978
1913
|
] })
|
|
1979
1914
|
}),
|
|
1980
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ P(o, {
|
|
1981
1916
|
name: "responseMapping.labelField",
|
|
1982
|
-
children: (e) => /* @__PURE__ */
|
|
1983
|
-
/* @__PURE__ */
|
|
1917
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
1918
|
+
/* @__PURE__ */ P(l, {
|
|
1984
1919
|
htmlFor: e.name,
|
|
1985
1920
|
children: r("editor.httpConfigForm.labelField")
|
|
1986
1921
|
}),
|
|
1987
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ P(m, {
|
|
1988
1923
|
id: e.name,
|
|
1989
1924
|
name: e.name,
|
|
1990
1925
|
value: e.state.value,
|
|
@@ -1992,19 +1927,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1992
1927
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1993
1928
|
placeholder: r("editor.httpConfigForm.labelFieldPlaceholder")
|
|
1994
1929
|
}),
|
|
1995
|
-
/* @__PURE__ */
|
|
1930
|
+
/* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.labelFieldDesc") })
|
|
1996
1931
|
] })
|
|
1997
1932
|
})
|
|
1998
1933
|
]
|
|
1999
1934
|
}),
|
|
2000
|
-
/* @__PURE__ */
|
|
1935
|
+
/* @__PURE__ */ P(o, {
|
|
2001
1936
|
name: "searchParam",
|
|
2002
|
-
children: (e) => /* @__PURE__ */
|
|
2003
|
-
/* @__PURE__ */
|
|
1937
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
1938
|
+
/* @__PURE__ */ P(l, {
|
|
2004
1939
|
htmlFor: e.name,
|
|
2005
1940
|
children: r("editor.httpConfigForm.searchParameter")
|
|
2006
1941
|
}),
|
|
2007
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ P(m, {
|
|
2008
1943
|
id: e.name,
|
|
2009
1944
|
name: e.name,
|
|
2010
1945
|
value: e.state.value,
|
|
@@ -2012,32 +1947,32 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2012
1947
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2013
1948
|
placeholder: r("editor.httpConfigForm.searchParameterPlaceholder")
|
|
2014
1949
|
}),
|
|
2015
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ P(T, { children: r("editor.httpConfigForm.searchParameterDesc") })
|
|
2016
1951
|
] })
|
|
2017
1952
|
})
|
|
2018
1953
|
]
|
|
2019
1954
|
}),
|
|
2020
|
-
/* @__PURE__ */
|
|
1955
|
+
/* @__PURE__ */ F("div", {
|
|
2021
1956
|
className: "space-y-4",
|
|
2022
1957
|
children: [
|
|
2023
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ P("h4", {
|
|
2024
1959
|
className: "font-semibold text-sm",
|
|
2025
1960
|
children: r("editor.httpConfigForm.behavior")
|
|
2026
1961
|
}),
|
|
2027
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ P(s, {
|
|
2028
1963
|
selector: (e) => e.values.searchParam,
|
|
2029
|
-
children: (e) => /* @__PURE__ */
|
|
1964
|
+
children: (e) => /* @__PURE__ */ P(o, {
|
|
2030
1965
|
name: "fetchOnMount",
|
|
2031
1966
|
children: (t) => {
|
|
2032
1967
|
let n = !!e?.trim(), i = n ? t.state.value : !0;
|
|
2033
|
-
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */
|
|
1968
|
+
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ F("div", {
|
|
2034
1969
|
className: "flex items-center space-x-2",
|
|
2035
|
-
children: [/* @__PURE__ */
|
|
1970
|
+
children: [/* @__PURE__ */ P(y, {
|
|
2036
1971
|
id: t.name,
|
|
2037
1972
|
checked: i,
|
|
2038
1973
|
disabled: !n,
|
|
2039
1974
|
onCheckedChange: (e) => t.handleChange(e)
|
|
2040
|
-
}), /* @__PURE__ */
|
|
1975
|
+
}), /* @__PURE__ */ P(l, {
|
|
2041
1976
|
htmlFor: t.name,
|
|
2042
1977
|
className: n ? "" : "text-muted-foreground",
|
|
2043
1978
|
children: r("editor.httpConfigForm.fetchOnMount")
|
|
@@ -2046,15 +1981,15 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2046
1981
|
}
|
|
2047
1982
|
})
|
|
2048
1983
|
}),
|
|
2049
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ P(o, {
|
|
2050
1985
|
name: "showLoading",
|
|
2051
|
-
children: (e) => /* @__PURE__ */
|
|
1986
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
2052
1987
|
className: "flex items-center space-x-2",
|
|
2053
|
-
children: [/* @__PURE__ */
|
|
1988
|
+
children: [/* @__PURE__ */ P(y, {
|
|
2054
1989
|
id: e.name,
|
|
2055
1990
|
checked: e.state.value,
|
|
2056
1991
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2057
|
-
}), /* @__PURE__ */
|
|
1992
|
+
}), /* @__PURE__ */ P(l, {
|
|
2058
1993
|
htmlFor: e.name,
|
|
2059
1994
|
children: r("editor.httpConfigForm.showLoadingState")
|
|
2060
1995
|
})]
|
|
@@ -2064,12 +1999,12 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2064
1999
|
})
|
|
2065
2000
|
]
|
|
2066
2001
|
}) });
|
|
2067
|
-
},
|
|
2002
|
+
}, Tn = [
|
|
2068
2003
|
"POST",
|
|
2069
2004
|
"PUT",
|
|
2070
2005
|
"PATCH"
|
|
2071
|
-
],
|
|
2072
|
-
let [n, r] =
|
|
2006
|
+
], En = ({ value: e, onChange: t }) => {
|
|
2007
|
+
let [n, r] = B("en"), { selectedNode: i } = $(), a = G(), o = Ot(i?.id), { handleSubmit: s, Field: u, Subscribe: d } = I({
|
|
2073
2008
|
defaultValues: {
|
|
2074
2009
|
body: e?.body || "",
|
|
2075
2010
|
errorMessage: e?.errorMessage || { en: "" },
|
|
@@ -2091,19 +2026,19 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2091
2026
|
t(e);
|
|
2092
2027
|
}
|
|
2093
2028
|
});
|
|
2094
|
-
return /* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ P("div", { children: /* @__PURE__ */ F("div", {
|
|
2095
2030
|
className: "grid gap-6",
|
|
2096
2031
|
children: [
|
|
2097
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ P(u, {
|
|
2098
2033
|
name: "url",
|
|
2099
|
-
children: (e) => /* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2034
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
2035
|
+
/* @__PURE__ */ P(l, {
|
|
2101
2036
|
htmlFor: e.name,
|
|
2102
2037
|
children: a("editor.submitConfigForm.apiUrl")
|
|
2103
2038
|
}),
|
|
2104
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ F("div", {
|
|
2105
2040
|
className: "flex gap-2",
|
|
2106
|
-
children: [/* @__PURE__ */
|
|
2041
|
+
children: [/* @__PURE__ */ P(m, {
|
|
2107
2042
|
id: e.name,
|
|
2108
2043
|
name: e.name,
|
|
2109
2044
|
value: e.state.value,
|
|
@@ -2111,30 +2046,30 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2111
2046
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2112
2047
|
placeholder: a("editor.submitConfigForm.apiUrlPlaceholder"),
|
|
2113
2048
|
className: "flex-1"
|
|
2114
|
-
}), /* @__PURE__ */
|
|
2049
|
+
}), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
|
|
2115
2050
|
asChild: !0,
|
|
2116
|
-
children: /* @__PURE__ */
|
|
2051
|
+
children: /* @__PURE__ */ P(p, {
|
|
2117
2052
|
type: "button",
|
|
2118
2053
|
variant: "outline",
|
|
2119
2054
|
size: "icon",
|
|
2120
|
-
children: /* @__PURE__ */
|
|
2055
|
+
children: /* @__PURE__ */ P(ct, { className: "h-4 w-4" })
|
|
2121
2056
|
})
|
|
2122
|
-
}), /* @__PURE__ */
|
|
2057
|
+
}), /* @__PURE__ */ P(X, {
|
|
2123
2058
|
align: "end",
|
|
2124
|
-
children: o.length === 0 ? /* @__PURE__ */
|
|
2059
|
+
children: o.length === 0 ? /* @__PURE__ */ P(Z, {
|
|
2125
2060
|
disabled: !0,
|
|
2126
2061
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
2127
|
-
}) : o.map((t) => /* @__PURE__ */
|
|
2062
|
+
}) : o.map((t) => /* @__PURE__ */ P(Z, {
|
|
2128
2063
|
onClick: () => {
|
|
2129
2064
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
2130
2065
|
e.handleChange(r + n);
|
|
2131
2066
|
},
|
|
2132
|
-
children: /* @__PURE__ */
|
|
2067
|
+
children: /* @__PURE__ */ F("div", {
|
|
2133
2068
|
className: "flex flex-col",
|
|
2134
|
-
children: [/* @__PURE__ */
|
|
2069
|
+
children: [/* @__PURE__ */ P("span", {
|
|
2135
2070
|
className: "font-medium",
|
|
2136
2071
|
children: t.label
|
|
2137
|
-
}), /* @__PURE__ */
|
|
2072
|
+
}), /* @__PURE__ */ P("span", {
|
|
2138
2073
|
className: "text-muted-foreground text-xs",
|
|
2139
2074
|
children: `{{${t.nodeId}}}`
|
|
2140
2075
|
})]
|
|
@@ -2142,83 +2077,83 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2142
2077
|
}, t.nodeId))
|
|
2143
2078
|
})] })]
|
|
2144
2079
|
}),
|
|
2145
|
-
/* @__PURE__ */
|
|
2080
|
+
/* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.apiUrlDesc") })
|
|
2146
2081
|
] })
|
|
2147
2082
|
}),
|
|
2148
|
-
/* @__PURE__ */
|
|
2083
|
+
/* @__PURE__ */ P(u, {
|
|
2149
2084
|
name: "method",
|
|
2150
|
-
children: (e) => /* @__PURE__ */
|
|
2085
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
2151
2086
|
htmlFor: e.name,
|
|
2152
2087
|
children: a("editor.submitConfigForm.httpMethod")
|
|
2153
|
-
}), /* @__PURE__ */
|
|
2088
|
+
}), /* @__PURE__ */ F(g, {
|
|
2154
2089
|
value: e.state.value,
|
|
2155
2090
|
onValueChange: (t) => e.handleChange(t),
|
|
2156
|
-
children: [/* @__PURE__ */
|
|
2091
|
+
children: [/* @__PURE__ */ P(h, {
|
|
2157
2092
|
id: e.name,
|
|
2158
|
-
children: /* @__PURE__ */
|
|
2159
|
-
}), /* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2093
|
+
children: /* @__PURE__ */ P(c, { placeholder: a("editor.submitConfigForm.selectMethod") })
|
|
2094
|
+
}), /* @__PURE__ */ F(A, { children: [
|
|
2095
|
+
/* @__PURE__ */ P(v, {
|
|
2161
2096
|
value: "POST",
|
|
2162
2097
|
children: a("editor.submitConfigForm.methodPost")
|
|
2163
2098
|
}),
|
|
2164
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ P(v, {
|
|
2165
2100
|
value: "PUT",
|
|
2166
2101
|
children: a("editor.submitConfigForm.methodPut")
|
|
2167
2102
|
}),
|
|
2168
|
-
/* @__PURE__ */
|
|
2103
|
+
/* @__PURE__ */ P(v, {
|
|
2169
2104
|
value: "DELETE",
|
|
2170
2105
|
children: a("editor.submitConfigForm.methodDelete")
|
|
2171
2106
|
}),
|
|
2172
|
-
/* @__PURE__ */
|
|
2107
|
+
/* @__PURE__ */ P(v, {
|
|
2173
2108
|
value: "PATCH",
|
|
2174
2109
|
children: a("editor.submitConfigForm.methodPatch")
|
|
2175
2110
|
})
|
|
2176
2111
|
] })]
|
|
2177
2112
|
})] })
|
|
2178
2113
|
}),
|
|
2179
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ F("div", {
|
|
2180
2115
|
className: "space-y-4",
|
|
2181
|
-
children: [/* @__PURE__ */
|
|
2116
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
2182
2117
|
className: "font-semibold text-sm",
|
|
2183
2118
|
children: a("editor.submitConfigForm.headers")
|
|
2184
|
-
}), /* @__PURE__ */
|
|
2119
|
+
}), /* @__PURE__ */ P(u, {
|
|
2185
2120
|
name: "headers",
|
|
2186
2121
|
mode: "array",
|
|
2187
|
-
children: (e) => /* @__PURE__ */
|
|
2122
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
2188
2123
|
className: "space-y-2",
|
|
2189
2124
|
children: [e.state.value?.map((t, n) => {
|
|
2190
2125
|
let r = `headers[${n}]`;
|
|
2191
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ F("div", {
|
|
2192
2127
|
className: "flex items-start gap-2",
|
|
2193
2128
|
children: [
|
|
2194
|
-
/* @__PURE__ */
|
|
2129
|
+
/* @__PURE__ */ P(u, {
|
|
2195
2130
|
name: `headers[${n}].key`,
|
|
2196
|
-
children: (e) => /* @__PURE__ */
|
|
2131
|
+
children: (e) => /* @__PURE__ */ P(m, {
|
|
2197
2132
|
placeholder: a("editor.submitConfigForm.headerName"),
|
|
2198
2133
|
value: e.state.value || "",
|
|
2199
2134
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2200
2135
|
})
|
|
2201
2136
|
}),
|
|
2202
|
-
/* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ P(u, {
|
|
2203
2138
|
name: `headers[${n}].value`,
|
|
2204
|
-
children: (e) => /* @__PURE__ */
|
|
2139
|
+
children: (e) => /* @__PURE__ */ P(m, {
|
|
2205
2140
|
placeholder: a("editor.submitConfigForm.headerValue"),
|
|
2206
2141
|
value: e.state.value || "",
|
|
2207
2142
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2208
2143
|
})
|
|
2209
2144
|
}),
|
|
2210
|
-
/* @__PURE__ */
|
|
2145
|
+
/* @__PURE__ */ P(p, {
|
|
2211
2146
|
type: "button",
|
|
2212
2147
|
variant: "ghost",
|
|
2213
2148
|
size: "icon",
|
|
2214
2149
|
onClick: () => {
|
|
2215
2150
|
e.removeValue(n);
|
|
2216
2151
|
},
|
|
2217
|
-
children: /* @__PURE__ */
|
|
2152
|
+
children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
|
|
2218
2153
|
})
|
|
2219
2154
|
]
|
|
2220
2155
|
}, r);
|
|
2221
|
-
}), /* @__PURE__ */
|
|
2156
|
+
}), /* @__PURE__ */ F(p, {
|
|
2222
2157
|
type: "button",
|
|
2223
2158
|
variant: "outline",
|
|
2224
2159
|
size: "sm",
|
|
@@ -2228,64 +2163,64 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2228
2163
|
value: ""
|
|
2229
2164
|
});
|
|
2230
2165
|
},
|
|
2231
|
-
children: [/* @__PURE__ */
|
|
2166
|
+
children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.addHeader")]
|
|
2232
2167
|
})]
|
|
2233
2168
|
})
|
|
2234
2169
|
})]
|
|
2235
2170
|
}),
|
|
2236
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ P(d, {
|
|
2237
2172
|
selector: (e) => ({
|
|
2238
2173
|
method: e.values.method,
|
|
2239
2174
|
sendAllFormValues: e.values.sendAllFormValues
|
|
2240
2175
|
}),
|
|
2241
|
-
children: ({ method: e, sendAllFormValues: t }) =>
|
|
2176
|
+
children: ({ method: e, sendAllFormValues: t }) => Tn.includes(e || "") && /* @__PURE__ */ F("div", {
|
|
2242
2177
|
className: "space-y-4",
|
|
2243
|
-
children: [/* @__PURE__ */
|
|
2178
|
+
children: [/* @__PURE__ */ P(u, {
|
|
2244
2179
|
name: "sendAllFormValues",
|
|
2245
|
-
children: (e) => /* @__PURE__ */
|
|
2180
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
2246
2181
|
className: "flex items-center space-x-2",
|
|
2247
|
-
children: [/* @__PURE__ */
|
|
2182
|
+
children: [/* @__PURE__ */ P(y, {
|
|
2248
2183
|
id: e.name,
|
|
2249
2184
|
checked: e.state.value,
|
|
2250
2185
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2251
|
-
}), /* @__PURE__ */
|
|
2186
|
+
}), /* @__PURE__ */ P(l, {
|
|
2252
2187
|
htmlFor: e.name,
|
|
2253
2188
|
children: a("editor.submitConfigForm.sendAllFormValues")
|
|
2254
2189
|
})]
|
|
2255
2190
|
})
|
|
2256
|
-
}), /* @__PURE__ */
|
|
2191
|
+
}), /* @__PURE__ */ P(u, {
|
|
2257
2192
|
name: "body",
|
|
2258
|
-
children: (e) => /* @__PURE__ */
|
|
2259
|
-
/* @__PURE__ */
|
|
2193
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
2194
|
+
/* @__PURE__ */ F("div", {
|
|
2260
2195
|
className: "mb-2 flex items-center justify-between",
|
|
2261
|
-
children: [/* @__PURE__ */
|
|
2196
|
+
children: [/* @__PURE__ */ P(l, {
|
|
2262
2197
|
htmlFor: e.name,
|
|
2263
2198
|
children: a("editor.submitConfigForm.requestBody")
|
|
2264
|
-
}), /* @__PURE__ */
|
|
2199
|
+
}), /* @__PURE__ */ F(J, { children: [/* @__PURE__ */ P(Y, {
|
|
2265
2200
|
asChild: !0,
|
|
2266
|
-
children: /* @__PURE__ */
|
|
2201
|
+
children: /* @__PURE__ */ F(p, {
|
|
2267
2202
|
type: "button",
|
|
2268
2203
|
variant: "ghost",
|
|
2269
2204
|
size: "sm",
|
|
2270
2205
|
disabled: t,
|
|
2271
|
-
children: [/* @__PURE__ */
|
|
2206
|
+
children: [/* @__PURE__ */ P(ct, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
|
|
2272
2207
|
})
|
|
2273
|
-
}), /* @__PURE__ */
|
|
2208
|
+
}), /* @__PURE__ */ P(X, {
|
|
2274
2209
|
align: "end",
|
|
2275
|
-
children: o.length === 0 ? /* @__PURE__ */
|
|
2210
|
+
children: o.length === 0 ? /* @__PURE__ */ P(Z, {
|
|
2276
2211
|
disabled: !0,
|
|
2277
2212
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
2278
|
-
}) : o.map((t) => /* @__PURE__ */
|
|
2213
|
+
}) : o.map((t) => /* @__PURE__ */ P(Z, {
|
|
2279
2214
|
onClick: () => {
|
|
2280
2215
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
2281
2216
|
e.handleChange(r + n), s().then();
|
|
2282
2217
|
},
|
|
2283
|
-
children: /* @__PURE__ */
|
|
2218
|
+
children: /* @__PURE__ */ F("div", {
|
|
2284
2219
|
className: "flex flex-col",
|
|
2285
|
-
children: [/* @__PURE__ */
|
|
2220
|
+
children: [/* @__PURE__ */ P("span", {
|
|
2286
2221
|
className: "font-medium",
|
|
2287
2222
|
children: t.label
|
|
2288
|
-
}), /* @__PURE__ */
|
|
2223
|
+
}), /* @__PURE__ */ P("span", {
|
|
2289
2224
|
className: "text-muted-foreground text-xs",
|
|
2290
2225
|
children: `{{${t.nodeId}}}`
|
|
2291
2226
|
})]
|
|
@@ -2293,7 +2228,7 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2293
2228
|
}, t.nodeId))
|
|
2294
2229
|
})] })]
|
|
2295
2230
|
}),
|
|
2296
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ P(ne, {
|
|
2297
2232
|
id: e.name,
|
|
2298
2233
|
name: e.name,
|
|
2299
2234
|
value: e.state.value,
|
|
@@ -2303,26 +2238,26 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2303
2238
|
rows: 4,
|
|
2304
2239
|
disabled: t
|
|
2305
2240
|
}),
|
|
2306
|
-
/* @__PURE__ */
|
|
2241
|
+
/* @__PURE__ */ P(T, { children: a(t ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
|
|
2307
2242
|
] })
|
|
2308
2243
|
})]
|
|
2309
2244
|
})
|
|
2310
2245
|
}),
|
|
2311
|
-
/* @__PURE__ */
|
|
2246
|
+
/* @__PURE__ */ F("div", {
|
|
2312
2247
|
className: "space-y-4",
|
|
2313
2248
|
children: [
|
|
2314
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ P("h4", {
|
|
2315
2250
|
className: "font-semibold text-sm",
|
|
2316
2251
|
children: a("editor.submitConfigForm.postSubmission")
|
|
2317
2252
|
}),
|
|
2318
|
-
/* @__PURE__ */
|
|
2253
|
+
/* @__PURE__ */ P(u, {
|
|
2319
2254
|
name: "redirectUrl",
|
|
2320
|
-
children: (e) => /* @__PURE__ */
|
|
2321
|
-
/* @__PURE__ */
|
|
2255
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
2256
|
+
/* @__PURE__ */ P(l, {
|
|
2322
2257
|
htmlFor: e.name,
|
|
2323
2258
|
children: a("editor.submitConfigForm.redirectUrl")
|
|
2324
2259
|
}),
|
|
2325
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ P(m, {
|
|
2326
2261
|
id: e.name,
|
|
2327
2262
|
name: e.name,
|
|
2328
2263
|
value: e.state.value,
|
|
@@ -2330,21 +2265,21 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2330
2265
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2331
2266
|
placeholder: a("editor.submitConfigForm.redirectUrlPlaceholder")
|
|
2332
2267
|
}),
|
|
2333
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.redirectUrlDesc") })
|
|
2334
2269
|
] })
|
|
2335
2270
|
}),
|
|
2336
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ F("div", {
|
|
2337
2272
|
className: "flex items-center gap-2",
|
|
2338
|
-
children: [/* @__PURE__ */
|
|
2273
|
+
children: [/* @__PURE__ */ P(u, {
|
|
2339
2274
|
name: "successMessage",
|
|
2340
|
-
children: (e) => /* @__PURE__ */
|
|
2275
|
+
children: (e) => /* @__PURE__ */ F(w, {
|
|
2341
2276
|
className: "flex-1",
|
|
2342
2277
|
children: [
|
|
2343
|
-
/* @__PURE__ */
|
|
2278
|
+
/* @__PURE__ */ P(l, {
|
|
2344
2279
|
htmlFor: e.name,
|
|
2345
2280
|
children: a("editor.submitConfigForm.successMessage")
|
|
2346
2281
|
}),
|
|
2347
|
-
/* @__PURE__ */
|
|
2282
|
+
/* @__PURE__ */ P(m, {
|
|
2348
2283
|
id: e.name,
|
|
2349
2284
|
name: e.name,
|
|
2350
2285
|
value: e.state.value?.[n] || "",
|
|
@@ -2357,26 +2292,26 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2357
2292
|
},
|
|
2358
2293
|
placeholder: a("editor.submitConfigForm.successMessagePlaceholder")
|
|
2359
2294
|
}),
|
|
2360
|
-
/* @__PURE__ */
|
|
2295
|
+
/* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.successMessageDesc") })
|
|
2361
2296
|
]
|
|
2362
2297
|
})
|
|
2363
|
-
}), /* @__PURE__ */
|
|
2298
|
+
}), /* @__PURE__ */ P(Q, {
|
|
2364
2299
|
value: n,
|
|
2365
2300
|
onValueChange: r
|
|
2366
2301
|
})]
|
|
2367
2302
|
}),
|
|
2368
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ F("div", {
|
|
2369
2304
|
className: "flex items-center gap-2",
|
|
2370
|
-
children: [/* @__PURE__ */
|
|
2305
|
+
children: [/* @__PURE__ */ P(u, {
|
|
2371
2306
|
name: "errorMessage",
|
|
2372
|
-
children: (e) => /* @__PURE__ */
|
|
2307
|
+
children: (e) => /* @__PURE__ */ F(w, {
|
|
2373
2308
|
className: "flex-1",
|
|
2374
2309
|
children: [
|
|
2375
|
-
/* @__PURE__ */
|
|
2310
|
+
/* @__PURE__ */ P(l, {
|
|
2376
2311
|
htmlFor: e.name,
|
|
2377
2312
|
children: a("editor.submitConfigForm.errorMessage")
|
|
2378
2313
|
}),
|
|
2379
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ P(m, {
|
|
2380
2315
|
id: e.name,
|
|
2381
2316
|
name: e.name,
|
|
2382
2317
|
value: e.state.value?.[n] || "",
|
|
@@ -2389,30 +2324,30 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2389
2324
|
},
|
|
2390
2325
|
placeholder: a("editor.submitConfigForm.errorMessagePlaceholder")
|
|
2391
2326
|
}),
|
|
2392
|
-
/* @__PURE__ */
|
|
2327
|
+
/* @__PURE__ */ P(T, { children: a("editor.submitConfigForm.errorMessageDesc") })
|
|
2393
2328
|
]
|
|
2394
2329
|
})
|
|
2395
|
-
}), /* @__PURE__ */
|
|
2330
|
+
}), /* @__PURE__ */ P(Q, {
|
|
2396
2331
|
value: n,
|
|
2397
2332
|
onValueChange: r
|
|
2398
2333
|
})]
|
|
2399
2334
|
})
|
|
2400
2335
|
]
|
|
2401
2336
|
}),
|
|
2402
|
-
/* @__PURE__ */
|
|
2337
|
+
/* @__PURE__ */ F("div", {
|
|
2403
2338
|
className: "space-y-4",
|
|
2404
|
-
children: [/* @__PURE__ */
|
|
2339
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
2405
2340
|
className: "font-semibold text-sm",
|
|
2406
2341
|
children: a("editor.submitConfigForm.behavior")
|
|
2407
|
-
}), /* @__PURE__ */
|
|
2342
|
+
}), /* @__PURE__ */ P(u, {
|
|
2408
2343
|
name: "showLoading",
|
|
2409
|
-
children: (e) => /* @__PURE__ */
|
|
2344
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
2410
2345
|
className: "flex items-center space-x-2",
|
|
2411
|
-
children: [/* @__PURE__ */
|
|
2346
|
+
children: [/* @__PURE__ */ P(y, {
|
|
2412
2347
|
id: e.name,
|
|
2413
2348
|
checked: e.state.value,
|
|
2414
2349
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2415
|
-
}), /* @__PURE__ */
|
|
2350
|
+
}), /* @__PURE__ */ P(l, {
|
|
2416
2351
|
htmlFor: e.name,
|
|
2417
2352
|
children: a("editor.submitConfigForm.showLoadingState")
|
|
2418
2353
|
})]
|
|
@@ -2421,69 +2356,69 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2421
2356
|
})
|
|
2422
2357
|
]
|
|
2423
2358
|
}) });
|
|
2424
|
-
},
|
|
2425
|
-
let [h, g] =
|
|
2426
|
-
e ===
|
|
2359
|
+
}, Dn = ({ options: e, id: t, value: n, onValueChange: r, placeholder: i = "Select...", searchPlaceholder: a = "Search or create...", createLabel: o = (e) => `Use: ${e}`, clearLabel: s = "Clear selection", emptyLabel: c = "No results found", className: l, allowClear: f = !0, allowCreate: m = !0 }) => {
|
|
2360
|
+
let [h, g] = B(!1), [v, y] = B(""), b = (e) => e ?? "", x = (e) => e.trim().toLowerCase(), S = b(n), C = n !== null && n !== "", w = C ? e.find((e) => b(e.value) === S) : void 0, T = x(v), ne = m && T !== "" && !e.some((e) => x(e.label) === T || x(e.value ?? "") === T), re = (e) => {
|
|
2361
|
+
e === S ? f && r?.("") : r?.(e), g(!1), y("");
|
|
2427
2362
|
};
|
|
2428
|
-
return /* @__PURE__ */
|
|
2363
|
+
return /* @__PURE__ */ F(se, {
|
|
2429
2364
|
open: h,
|
|
2430
2365
|
onOpenChange: g,
|
|
2431
|
-
children: [/* @__PURE__ */
|
|
2366
|
+
children: [/* @__PURE__ */ P(u, {
|
|
2432
2367
|
asChild: !0,
|
|
2433
2368
|
id: t,
|
|
2434
|
-
children: /* @__PURE__ */
|
|
2369
|
+
children: /* @__PURE__ */ F(p, {
|
|
2435
2370
|
type: "button",
|
|
2436
2371
|
variant: "outline",
|
|
2437
2372
|
role: "combobox",
|
|
2438
2373
|
"aria-expanded": h,
|
|
2439
2374
|
className: d("w-full justify-between font-normal", l),
|
|
2440
|
-
children: [/* @__PURE__ */
|
|
2375
|
+
children: [/* @__PURE__ */ P("span", {
|
|
2441
2376
|
className: "truncate",
|
|
2442
|
-
children:
|
|
2443
|
-
}), /* @__PURE__ */
|
|
2377
|
+
children: C && w ? w.label : i
|
|
2378
|
+
}), /* @__PURE__ */ P(Pe, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
|
|
2444
2379
|
})
|
|
2445
|
-
}), /* @__PURE__ */
|
|
2380
|
+
}), /* @__PURE__ */ P(ee, {
|
|
2446
2381
|
className: "w-full p-0",
|
|
2447
2382
|
align: "start",
|
|
2448
|
-
children: /* @__PURE__ */
|
|
2383
|
+
children: /* @__PURE__ */ F(E, {
|
|
2449
2384
|
shouldFilter: !1,
|
|
2450
|
-
children: [/* @__PURE__ */
|
|
2385
|
+
children: [/* @__PURE__ */ P(_, {
|
|
2451
2386
|
placeholder: a,
|
|
2452
2387
|
value: v,
|
|
2453
|
-
onValueChange:
|
|
2454
|
-
}), /* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
f &&
|
|
2388
|
+
onValueChange: y
|
|
2389
|
+
}), /* @__PURE__ */ F(ae, { children: [
|
|
2390
|
+
/* @__PURE__ */ P(ie, { children: c }),
|
|
2391
|
+
f && C && /* @__PURE__ */ P(te, { children: /* @__PURE__ */ F(D, {
|
|
2457
2392
|
value: "__clear__",
|
|
2458
2393
|
onSelect: () => {
|
|
2459
|
-
r?.(""), g(!1),
|
|
2394
|
+
r?.(""), g(!1), y("");
|
|
2460
2395
|
},
|
|
2461
2396
|
className: "mt-1 text-muted-foreground",
|
|
2462
|
-
children: [/* @__PURE__ */
|
|
2397
|
+
children: [/* @__PURE__ */ P(R, { className: "mr-2 h-4 w-4" }), s]
|
|
2463
2398
|
}) }),
|
|
2464
|
-
/* @__PURE__ */
|
|
2399
|
+
/* @__PURE__ */ F(te, { children: [ne && /* @__PURE__ */ F(D, {
|
|
2465
2400
|
value: `__create__${v}`,
|
|
2466
2401
|
onSelect: () => {
|
|
2467
|
-
v.trim() && (r?.(v.trim()), g(!1),
|
|
2402
|
+
v.trim() && (r?.(v.trim()), g(!1), y(""));
|
|
2468
2403
|
},
|
|
2469
2404
|
className: "text-primary",
|
|
2470
|
-
children: [/* @__PURE__ */
|
|
2405
|
+
children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), o(v)]
|
|
2471
2406
|
}), e.filter((e) => {
|
|
2472
2407
|
let t = v.toLowerCase();
|
|
2473
2408
|
return e.label.toLowerCase().includes(t) || (e.value?.toLowerCase() ?? "").includes(t);
|
|
2474
|
-
}).map((e, t) => /* @__PURE__ */
|
|
2409
|
+
}).map((e, t) => /* @__PURE__ */ F(D, {
|
|
2475
2410
|
value: e.label,
|
|
2476
|
-
onSelect: () =>
|
|
2477
|
-
children: [/* @__PURE__ */
|
|
2411
|
+
onSelect: () => re(e?.value || ""),
|
|
2412
|
+
children: [/* @__PURE__ */ P(je, {
|
|
2478
2413
|
"aria-hidden": "true",
|
|
2479
|
-
className: d("mr-2 h-4 w-4",
|
|
2414
|
+
className: d("mr-2 h-4 w-4", C && b(e.value) === S ? "opacity-100" : "opacity-0")
|
|
2480
2415
|
}), e.label]
|
|
2481
2416
|
}, e.value ?? e.label ?? t))] })
|
|
2482
2417
|
] })]
|
|
2483
2418
|
})
|
|
2484
2419
|
})]
|
|
2485
2420
|
});
|
|
2486
|
-
},
|
|
2421
|
+
}, On = Object.entries({
|
|
2487
2422
|
alphanumeric: "^[a-zA-Z0-9]+$",
|
|
2488
2423
|
email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
|
|
2489
2424
|
letters: "^[a-zA-Z]+$",
|
|
@@ -2492,52 +2427,52 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2492
2427
|
}).map(([e, t]) => ({
|
|
2493
2428
|
label: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
|
|
2494
2429
|
value: t
|
|
2495
|
-
})),
|
|
2430
|
+
})), kn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ P(Dn, {
|
|
2496
2431
|
id: e,
|
|
2497
|
-
options:
|
|
2432
|
+
options: _t(() => t && !On.some((e) => e.value === t) ? [...On, {
|
|
2498
2433
|
label: `Custom: ${t}`,
|
|
2499
2434
|
value: t
|
|
2500
|
-
}] :
|
|
2435
|
+
}] : On, [t]),
|
|
2501
2436
|
value: t,
|
|
2502
2437
|
onValueChange: n,
|
|
2503
2438
|
placeholder: "Select or create a pattern",
|
|
2504
2439
|
searchPlaceholder: "Search patterns...",
|
|
2505
2440
|
createLabel: (e) => `Use pattern: ${e}`
|
|
2506
|
-
}),
|
|
2441
|
+
}), An = 400, jn = .8, Mn = (e) => new Promise((t, n) => {
|
|
2507
2442
|
let r = new FileReader();
|
|
2508
2443
|
r.onerror = () => n(/* @__PURE__ */ Error("read_failed")), r.onload = () => {
|
|
2509
2444
|
let e = new Image();
|
|
2510
2445
|
e.onload = () => t(e), e.onerror = () => n(/* @__PURE__ */ Error("decode_failed")), e.src = r.result;
|
|
2511
2446
|
}, r.readAsDataURL(e);
|
|
2512
|
-
}),
|
|
2447
|
+
}), Nn = async (e) => {
|
|
2513
2448
|
if (!e.type.startsWith("image/")) throw Error("invalid_type");
|
|
2514
2449
|
if (e.size > 5242880) throw Error("too_large");
|
|
2515
|
-
let t = await
|
|
2450
|
+
let t = await Mn(e), n = Math.min(1, An / Math.max(t.width, t.height)), r = document.createElement("canvas");
|
|
2516
2451
|
r.width = Math.round(t.width * n), r.height = Math.round(t.height * n);
|
|
2517
2452
|
let i = r.getContext("2d");
|
|
2518
2453
|
if (!i) throw Error("canvas_unavailable");
|
|
2519
|
-
return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg",
|
|
2520
|
-
},
|
|
2454
|
+
return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", jn);
|
|
2455
|
+
}, Pn = 400, Fn = (e) => {
|
|
2521
2456
|
if (!/^https?:\/\//i.test(e)) return !1;
|
|
2522
2457
|
try {
|
|
2523
2458
|
return !!new URL(e).hostname;
|
|
2524
2459
|
} catch {
|
|
2525
2460
|
return !1;
|
|
2526
2461
|
}
|
|
2527
|
-
},
|
|
2528
|
-
let n =
|
|
2529
|
-
|
|
2462
|
+
}, In = ({ value: e, onChange: t }) => {
|
|
2463
|
+
let n = vt(null), r = vt(null), [i, a] = B(!1), [o, s] = B(e && /^https?:\/\//i.test(e) ? e : ""), c = G();
|
|
2464
|
+
ht(() => {
|
|
2530
2465
|
i || s(e && /^https?:\/\//i.test(e) ? e : "");
|
|
2531
|
-
}, [i, e]),
|
|
2466
|
+
}, [i, e]), ht(() => () => {
|
|
2532
2467
|
r.current && clearTimeout(r.current);
|
|
2533
2468
|
}, []);
|
|
2534
2469
|
let l = async (e) => {
|
|
2535
2470
|
let r = e.target.files?.[0];
|
|
2536
2471
|
if (r) try {
|
|
2537
|
-
t(await
|
|
2472
|
+
t(await Nn(r)), a(!1);
|
|
2538
2473
|
} catch (e) {
|
|
2539
2474
|
let t = e.message;
|
|
2540
|
-
t === "too_large" ?
|
|
2475
|
+
t === "too_large" ? U.error(c("editor.inputNodeForm.optionImageTooLarge")) : t === "invalid_type" ? U.error(c("editor.inputNodeForm.optionImageInvalid")) : U.error(c("editor.inputNodeForm.optionImageError"));
|
|
2541
2476
|
} finally {
|
|
2542
2477
|
n.current && (n.current.value = "");
|
|
2543
2478
|
}
|
|
@@ -2545,62 +2480,62 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2545
2480
|
let e = o.trim();
|
|
2546
2481
|
e && (t(e), a(!1));
|
|
2547
2482
|
};
|
|
2548
|
-
return /* @__PURE__ */
|
|
2483
|
+
return /* @__PURE__ */ F("div", {
|
|
2549
2484
|
className: "relative",
|
|
2550
2485
|
children: [
|
|
2551
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ P("input", {
|
|
2552
2487
|
ref: n,
|
|
2553
2488
|
type: "file",
|
|
2554
2489
|
accept: "image/*",
|
|
2555
2490
|
className: "hidden",
|
|
2556
2491
|
onChange: l
|
|
2557
2492
|
}),
|
|
2558
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ F(se, {
|
|
2559
2494
|
open: i,
|
|
2560
2495
|
onOpenChange: a,
|
|
2561
|
-
children: [/* @__PURE__ */
|
|
2496
|
+
children: [/* @__PURE__ */ P(u, {
|
|
2562
2497
|
asChild: !0,
|
|
2563
|
-
children: e ? /* @__PURE__ */
|
|
2498
|
+
children: e ? /* @__PURE__ */ P("button", {
|
|
2564
2499
|
type: "button",
|
|
2565
2500
|
className: "h-9 w-9 cursor-pointer overflow-hidden rounded-md border border-input",
|
|
2566
2501
|
"aria-label": c("editor.inputNodeForm.optionImageReplace"),
|
|
2567
|
-
children: /* @__PURE__ */
|
|
2502
|
+
children: /* @__PURE__ */ P("img", {
|
|
2568
2503
|
src: e,
|
|
2569
2504
|
alt: "",
|
|
2570
2505
|
className: "h-full w-full object-cover"
|
|
2571
2506
|
})
|
|
2572
|
-
}) : /* @__PURE__ */
|
|
2507
|
+
}) : /* @__PURE__ */ P(p, {
|
|
2573
2508
|
type: "button",
|
|
2574
2509
|
variant: "outline",
|
|
2575
2510
|
size: "icon",
|
|
2576
2511
|
"aria-label": c("editor.inputNodeForm.optionImageAdd"),
|
|
2577
|
-
children: /* @__PURE__ */
|
|
2512
|
+
children: /* @__PURE__ */ P(We, { className: "h-4 w-4" })
|
|
2578
2513
|
})
|
|
2579
|
-
}), /* @__PURE__ */
|
|
2514
|
+
}), /* @__PURE__ */ F(ee, {
|
|
2580
2515
|
align: "start",
|
|
2581
2516
|
className: "w-64 space-y-3 p-3",
|
|
2582
2517
|
children: [
|
|
2583
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ F(p, {
|
|
2584
2519
|
type: "button",
|
|
2585
2520
|
variant: "outline",
|
|
2586
2521
|
size: "sm",
|
|
2587
2522
|
className: "w-full",
|
|
2588
2523
|
onClick: () => n.current?.click(),
|
|
2589
|
-
children: [/* @__PURE__ */
|
|
2524
|
+
children: [/* @__PURE__ */ P(st, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
|
|
2590
2525
|
}),
|
|
2591
|
-
/* @__PURE__ */
|
|
2592
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ P(k, {}),
|
|
2527
|
+
/* @__PURE__ */ F("div", {
|
|
2593
2528
|
className: "flex items-center gap-2",
|
|
2594
|
-
children: [/* @__PURE__ */
|
|
2529
|
+
children: [/* @__PURE__ */ P(Ke, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ P(m, {
|
|
2595
2530
|
placeholder: c("editor.inputNodeForm.optionImageUrlPlaceholder"),
|
|
2596
2531
|
value: o,
|
|
2597
2532
|
onChange: (n) => {
|
|
2598
2533
|
let i = n.target.value;
|
|
2599
2534
|
s(i), r.current && clearTimeout(r.current);
|
|
2600
2535
|
let a = i.trim();
|
|
2601
|
-
!
|
|
2536
|
+
!Fn(a) || a === e || (r.current = setTimeout(() => {
|
|
2602
2537
|
t(a);
|
|
2603
|
-
},
|
|
2538
|
+
}, Pn));
|
|
2604
2539
|
},
|
|
2605
2540
|
onKeyDown: (e) => {
|
|
2606
2541
|
e.key === "Enter" && (e.preventDefault(), d());
|
|
@@ -2611,65 +2546,65 @@ var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2611
2546
|
]
|
|
2612
2547
|
})]
|
|
2613
2548
|
}),
|
|
2614
|
-
e && /* @__PURE__ */
|
|
2549
|
+
e && /* @__PURE__ */ P("button", {
|
|
2615
2550
|
type: "button",
|
|
2616
2551
|
onClick: (e) => {
|
|
2617
2552
|
e.stopPropagation(), t("");
|
|
2618
2553
|
},
|
|
2619
2554
|
className: "-top-1 -right-1 absolute flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-destructive text-destructive-foreground",
|
|
2620
2555
|
"aria-label": c("editor.inputNodeForm.optionImageRemove"),
|
|
2621
|
-
children: /* @__PURE__ */
|
|
2556
|
+
children: /* @__PURE__ */ P(R, { className: "h-3 w-3" })
|
|
2622
2557
|
})
|
|
2623
2558
|
]
|
|
2624
2559
|
});
|
|
2625
|
-
},
|
|
2626
|
-
let n = G(), r =
|
|
2627
|
-
return /* @__PURE__ */
|
|
2560
|
+
}, Ln = ({ value: e, onValueChange: t }) => {
|
|
2561
|
+
let n = G(), r = gt();
|
|
2562
|
+
return /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
|
|
2628
2563
|
htmlFor: r,
|
|
2629
2564
|
children: n("editor.selectInputType.type")
|
|
2630
|
-
}), /* @__PURE__ */
|
|
2565
|
+
}), /* @__PURE__ */ F(g, {
|
|
2631
2566
|
value: e,
|
|
2632
2567
|
onValueChange: t,
|
|
2633
|
-
children: [/* @__PURE__ */
|
|
2568
|
+
children: [/* @__PURE__ */ P(h, {
|
|
2634
2569
|
id: r,
|
|
2635
2570
|
className: "w-full capitalize",
|
|
2636
|
-
children: /* @__PURE__ */
|
|
2637
|
-
}), /* @__PURE__ */
|
|
2571
|
+
children: /* @__PURE__ */ P(c, { placeholder: "" })
|
|
2572
|
+
}), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.values(K).map((e) => /* @__PURE__ */ F(v, {
|
|
2638
2573
|
value: e,
|
|
2639
2574
|
className: "capitalize",
|
|
2640
|
-
children: [/* @__PURE__ */
|
|
2575
|
+
children: [/* @__PURE__ */ P(Zt(e), {}), e]
|
|
2641
2576
|
}, e)) }) })]
|
|
2642
2577
|
})] });
|
|
2643
2578
|
};
|
|
2644
2579
|
//#endregion
|
|
2645
2580
|
//#region src/shared/components/ui/collapsible.tsx
|
|
2646
|
-
function
|
|
2647
|
-
return /* @__PURE__ */
|
|
2581
|
+
function Rn({ ...e }) {
|
|
2582
|
+
return /* @__PURE__ */ P(Ct.Root, {
|
|
2648
2583
|
"data-slot": "collapsible",
|
|
2649
2584
|
...e
|
|
2650
2585
|
});
|
|
2651
2586
|
}
|
|
2652
|
-
function
|
|
2653
|
-
return /* @__PURE__ */
|
|
2587
|
+
function zn({ ...e }) {
|
|
2588
|
+
return /* @__PURE__ */ P(Ct.CollapsibleTrigger, {
|
|
2654
2589
|
"data-slot": "collapsible-trigger",
|
|
2655
2590
|
...e
|
|
2656
2591
|
});
|
|
2657
2592
|
}
|
|
2658
|
-
function
|
|
2659
|
-
return /* @__PURE__ */
|
|
2593
|
+
function Bn({ ...e }) {
|
|
2594
|
+
return /* @__PURE__ */ P(Ct.CollapsibleContent, {
|
|
2660
2595
|
"data-slot": "collapsible-content",
|
|
2661
2596
|
...e
|
|
2662
2597
|
});
|
|
2663
2598
|
}
|
|
2664
2599
|
//#endregion
|
|
2665
2600
|
//#region src/editor/features/TreegeEditor/forms/InputNodeForm.tsx
|
|
2666
|
-
var
|
|
2667
|
-
let [e, t] =
|
|
2601
|
+
var Vn = () => {
|
|
2602
|
+
let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), i = [
|
|
2668
2603
|
"select",
|
|
2669
2604
|
"radio",
|
|
2670
2605
|
"autocomplete",
|
|
2671
2606
|
"checkbox"
|
|
2672
|
-
].includes(n?.data?.type || ""), a =
|
|
2607
|
+
].includes(n?.data?.type || ""), a = Ot(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: u, Field: d } = I({
|
|
2673
2608
|
defaultValues: {
|
|
2674
2609
|
defaultValue: n?.data?.defaultValue,
|
|
2675
2610
|
disablePast: n?.data?.disablePast,
|
|
@@ -2697,30 +2632,30 @@ var $n = () => {
|
|
|
2697
2632
|
r(e);
|
|
2698
2633
|
}
|
|
2699
2634
|
});
|
|
2700
|
-
return /* @__PURE__ */
|
|
2635
|
+
return /* @__PURE__ */ P("form", {
|
|
2701
2636
|
onSubmit: (e) => {
|
|
2702
2637
|
e.preventDefault(), e.stopPropagation();
|
|
2703
2638
|
},
|
|
2704
|
-
children: /* @__PURE__ */
|
|
2639
|
+
children: /* @__PURE__ */ F("div", {
|
|
2705
2640
|
className: "grid gap-6",
|
|
2706
2641
|
children: [
|
|
2707
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ P(d, {
|
|
2708
2643
|
name: "type",
|
|
2709
|
-
children: (e) => /* @__PURE__ */
|
|
2644
|
+
children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ P(Ln, {
|
|
2710
2645
|
value: e.state.value,
|
|
2711
2646
|
onValueChange: (t) => e.handleChange(t)
|
|
2712
2647
|
}) })
|
|
2713
2648
|
}),
|
|
2714
|
-
/* @__PURE__ */
|
|
2649
|
+
/* @__PURE__ */ F("div", {
|
|
2715
2650
|
className: "flex items-end gap-2",
|
|
2716
|
-
children: [/* @__PURE__ */
|
|
2651
|
+
children: [/* @__PURE__ */ P(d, {
|
|
2717
2652
|
name: "label",
|
|
2718
|
-
children: (t) => /* @__PURE__ */
|
|
2653
|
+
children: (t) => /* @__PURE__ */ F(w, {
|
|
2719
2654
|
className: "flex-1",
|
|
2720
|
-
children: [/* @__PURE__ */
|
|
2655
|
+
children: [/* @__PURE__ */ P(l, {
|
|
2721
2656
|
htmlFor: t.name,
|
|
2722
2657
|
children: o("editor.inputNodeForm.label")
|
|
2723
|
-
}), /* @__PURE__ */
|
|
2658
|
+
}), /* @__PURE__ */ P(m, {
|
|
2724
2659
|
autoFocus: !0,
|
|
2725
2660
|
id: t.name,
|
|
2726
2661
|
name: t.name,
|
|
@@ -2734,21 +2669,21 @@ var $n = () => {
|
|
|
2734
2669
|
}
|
|
2735
2670
|
})]
|
|
2736
2671
|
})
|
|
2737
|
-
}), /* @__PURE__ */
|
|
2672
|
+
}), /* @__PURE__ */ P(Q, {
|
|
2738
2673
|
value: e,
|
|
2739
2674
|
onValueChange: t
|
|
2740
2675
|
})]
|
|
2741
2676
|
}),
|
|
2742
|
-
!s && n?.data?.type !== "file" && /* @__PURE__ */
|
|
2677
|
+
!s && n?.data?.type !== "file" && /* @__PURE__ */ F("div", {
|
|
2743
2678
|
className: "flex items-end gap-2",
|
|
2744
|
-
children: [/* @__PURE__ */
|
|
2679
|
+
children: [/* @__PURE__ */ P(d, {
|
|
2745
2680
|
name: "placeholder",
|
|
2746
|
-
children: (t) => /* @__PURE__ */
|
|
2681
|
+
children: (t) => /* @__PURE__ */ F(w, {
|
|
2747
2682
|
className: "flex-1",
|
|
2748
|
-
children: [/* @__PURE__ */
|
|
2683
|
+
children: [/* @__PURE__ */ P(l, {
|
|
2749
2684
|
htmlFor: t.name,
|
|
2750
2685
|
children: o("editor.inputNodeForm.placeholder")
|
|
2751
|
-
}), /* @__PURE__ */
|
|
2686
|
+
}), /* @__PURE__ */ P(m, {
|
|
2752
2687
|
id: t.name,
|
|
2753
2688
|
name: t.name,
|
|
2754
2689
|
value: t.state.value?.[e] || "",
|
|
@@ -2761,21 +2696,21 @@ var $n = () => {
|
|
|
2761
2696
|
}
|
|
2762
2697
|
})]
|
|
2763
2698
|
})
|
|
2764
|
-
}), /* @__PURE__ */
|
|
2699
|
+
}), /* @__PURE__ */ P(Q, {
|
|
2765
2700
|
value: e,
|
|
2766
2701
|
onValueChange: t
|
|
2767
2702
|
})]
|
|
2768
2703
|
}),
|
|
2769
|
-
!s && /* @__PURE__ */
|
|
2704
|
+
!s && /* @__PURE__ */ F("div", {
|
|
2770
2705
|
className: "flex items-end gap-2",
|
|
2771
|
-
children: [/* @__PURE__ */
|
|
2706
|
+
children: [/* @__PURE__ */ P(d, {
|
|
2772
2707
|
name: "helperText",
|
|
2773
|
-
children: (t) => /* @__PURE__ */
|
|
2708
|
+
children: (t) => /* @__PURE__ */ F(w, {
|
|
2774
2709
|
className: "flex-1",
|
|
2775
|
-
children: [/* @__PURE__ */
|
|
2710
|
+
children: [/* @__PURE__ */ P(l, {
|
|
2776
2711
|
htmlFor: t.name,
|
|
2777
2712
|
children: o("editor.inputNodeForm.helperText")
|
|
2778
|
-
}), /* @__PURE__ */
|
|
2713
|
+
}), /* @__PURE__ */ P(m, {
|
|
2779
2714
|
id: t.name,
|
|
2780
2715
|
name: t.name,
|
|
2781
2716
|
value: t.state.value?.[e] || "",
|
|
@@ -2788,36 +2723,36 @@ var $n = () => {
|
|
|
2788
2723
|
}
|
|
2789
2724
|
})]
|
|
2790
2725
|
})
|
|
2791
|
-
}), /* @__PURE__ */
|
|
2726
|
+
}), /* @__PURE__ */ P(Q, {
|
|
2792
2727
|
value: e,
|
|
2793
2728
|
onValueChange: t
|
|
2794
2729
|
})]
|
|
2795
2730
|
}),
|
|
2796
|
-
n?.data?.type === "http" && /* @__PURE__ */
|
|
2731
|
+
n?.data?.type === "http" && /* @__PURE__ */ F(Rn, {
|
|
2797
2732
|
defaultOpen: !0,
|
|
2798
2733
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2799
|
-
children: [/* @__PURE__ */
|
|
2734
|
+
children: [/* @__PURE__ */ P(zn, {
|
|
2800
2735
|
asChild: !0,
|
|
2801
|
-
children: /* @__PURE__ */
|
|
2736
|
+
children: /* @__PURE__ */ F("div", {
|
|
2802
2737
|
className: "flex items-center justify-between gap-4",
|
|
2803
|
-
children: [/* @__PURE__ */
|
|
2738
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
2804
2739
|
className: "font-semibold text-sm",
|
|
2805
2740
|
children: o("editor.inputNodeForm.httpConfiguration")
|
|
2806
|
-
}), /* @__PURE__ */
|
|
2741
|
+
}), /* @__PURE__ */ F(p, {
|
|
2807
2742
|
variant: "ghost",
|
|
2808
2743
|
size: "icon",
|
|
2809
2744
|
className: "size-8",
|
|
2810
|
-
children: [/* @__PURE__ */
|
|
2745
|
+
children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
|
|
2811
2746
|
className: "sr-only",
|
|
2812
2747
|
children: o("common.toggle")
|
|
2813
2748
|
})]
|
|
2814
2749
|
})]
|
|
2815
2750
|
})
|
|
2816
|
-
}), /* @__PURE__ */
|
|
2751
|
+
}), /* @__PURE__ */ P(Bn, {
|
|
2817
2752
|
className: "flex flex-col gap-4",
|
|
2818
|
-
children: /* @__PURE__ */
|
|
2753
|
+
children: /* @__PURE__ */ P(d, {
|
|
2819
2754
|
name: "httpConfig",
|
|
2820
|
-
children: (e) => /* @__PURE__ */
|
|
2755
|
+
children: (e) => /* @__PURE__ */ P(wn, {
|
|
2821
2756
|
value: e.state.value,
|
|
2822
2757
|
onChange: (t) => {
|
|
2823
2758
|
e.handleChange(t), u().then();
|
|
@@ -2826,30 +2761,30 @@ var $n = () => {
|
|
|
2826
2761
|
})
|
|
2827
2762
|
})]
|
|
2828
2763
|
}),
|
|
2829
|
-
s && /* @__PURE__ */
|
|
2764
|
+
s && /* @__PURE__ */ F(Rn, {
|
|
2830
2765
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2831
|
-
children: [/* @__PURE__ */
|
|
2766
|
+
children: [/* @__PURE__ */ P(zn, {
|
|
2832
2767
|
asChild: !0,
|
|
2833
|
-
children: /* @__PURE__ */
|
|
2768
|
+
children: /* @__PURE__ */ F("div", {
|
|
2834
2769
|
className: "flex items-center justify-between gap-4",
|
|
2835
|
-
children: [/* @__PURE__ */
|
|
2770
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
2836
2771
|
className: "font-semibold text-sm",
|
|
2837
2772
|
children: o("editor.inputNodeForm.submitConfiguration")
|
|
2838
|
-
}), /* @__PURE__ */
|
|
2773
|
+
}), /* @__PURE__ */ F(p, {
|
|
2839
2774
|
variant: "ghost",
|
|
2840
2775
|
size: "icon",
|
|
2841
2776
|
className: "size-8",
|
|
2842
|
-
children: [/* @__PURE__ */
|
|
2777
|
+
children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
|
|
2843
2778
|
className: "sr-only",
|
|
2844
2779
|
children: o("common.toggle")
|
|
2845
2780
|
})]
|
|
2846
2781
|
})]
|
|
2847
2782
|
})
|
|
2848
|
-
}), /* @__PURE__ */
|
|
2783
|
+
}), /* @__PURE__ */ P(Bn, {
|
|
2849
2784
|
className: "flex flex-col gap-4",
|
|
2850
|
-
children: /* @__PURE__ */
|
|
2785
|
+
children: /* @__PURE__ */ P(d, {
|
|
2851
2786
|
name: "submitConfig",
|
|
2852
|
-
children: (e) => /* @__PURE__ */
|
|
2787
|
+
children: (e) => /* @__PURE__ */ P(En, {
|
|
2853
2788
|
value: e.state.value,
|
|
2854
2789
|
onChange: (t) => {
|
|
2855
2790
|
e.handleChange(t), u().then();
|
|
@@ -2858,65 +2793,65 @@ var $n = () => {
|
|
|
2858
2793
|
})
|
|
2859
2794
|
})]
|
|
2860
2795
|
}),
|
|
2861
|
-
n?.data?.type === "file" && /* @__PURE__ */
|
|
2796
|
+
n?.data?.type === "file" && /* @__PURE__ */ P(d, {
|
|
2862
2797
|
name: "multiple",
|
|
2863
|
-
children: (e) => /* @__PURE__ */
|
|
2798
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
2864
2799
|
className: "flex items-center space-x-2",
|
|
2865
|
-
children: [/* @__PURE__ */
|
|
2800
|
+
children: [/* @__PURE__ */ P(y, {
|
|
2866
2801
|
id: e.name,
|
|
2867
2802
|
checked: e.state.value,
|
|
2868
2803
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2869
|
-
}), /* @__PURE__ */
|
|
2804
|
+
}), /* @__PURE__ */ P(l, {
|
|
2870
2805
|
htmlFor: e.name,
|
|
2871
2806
|
children: o("editor.inputNodeForm.multipleFiles")
|
|
2872
2807
|
})]
|
|
2873
2808
|
})
|
|
2874
2809
|
}),
|
|
2875
|
-
i && /* @__PURE__ */
|
|
2810
|
+
i && /* @__PURE__ */ F(Rn, {
|
|
2876
2811
|
defaultOpen: !0,
|
|
2877
2812
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2878
|
-
children: [/* @__PURE__ */
|
|
2813
|
+
children: [/* @__PURE__ */ P(zn, {
|
|
2879
2814
|
asChild: !0,
|
|
2880
|
-
children: /* @__PURE__ */
|
|
2815
|
+
children: /* @__PURE__ */ F("div", {
|
|
2881
2816
|
className: "flex items-center justify-between gap-4",
|
|
2882
|
-
children: [/* @__PURE__ */
|
|
2817
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
2883
2818
|
className: "font-semibold text-sm",
|
|
2884
2819
|
children: o("editor.inputNodeForm.options")
|
|
2885
|
-
}), /* @__PURE__ */
|
|
2820
|
+
}), /* @__PURE__ */ F(p, {
|
|
2886
2821
|
variant: "ghost",
|
|
2887
2822
|
size: "icon",
|
|
2888
2823
|
className: "size-8",
|
|
2889
|
-
children: [/* @__PURE__ */
|
|
2824
|
+
children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
|
|
2890
2825
|
className: "sr-only",
|
|
2891
2826
|
children: o("common.toggle")
|
|
2892
2827
|
})]
|
|
2893
2828
|
})]
|
|
2894
2829
|
})
|
|
2895
|
-
}), /* @__PURE__ */
|
|
2830
|
+
}), /* @__PURE__ */ F(Bn, {
|
|
2896
2831
|
className: "flex flex-col gap-4",
|
|
2897
2832
|
children: [
|
|
2898
|
-
/* @__PURE__ */
|
|
2833
|
+
/* @__PURE__ */ P(d, {
|
|
2899
2834
|
name: "options",
|
|
2900
2835
|
mode: "array",
|
|
2901
|
-
children: (t) => /* @__PURE__ */
|
|
2836
|
+
children: (t) => /* @__PURE__ */ F("div", {
|
|
2902
2837
|
className: "space-y-2",
|
|
2903
2838
|
children: [t.state.value?.map((r, i) => {
|
|
2904
2839
|
let a = `options[${i}]`;
|
|
2905
|
-
return /* @__PURE__ */
|
|
2840
|
+
return /* @__PURE__ */ F("div", {
|
|
2906
2841
|
className: "flex flex-col gap-2",
|
|
2907
|
-
children: [/* @__PURE__ */
|
|
2842
|
+
children: [/* @__PURE__ */ F("div", {
|
|
2908
2843
|
className: "flex items-start gap-2",
|
|
2909
2844
|
children: [
|
|
2910
|
-
n?.data?.type === "radio" && /* @__PURE__ */
|
|
2845
|
+
n?.data?.type === "radio" && /* @__PURE__ */ P(d, {
|
|
2911
2846
|
name: `options[${i}].image`,
|
|
2912
|
-
children: (e) => /* @__PURE__ */
|
|
2847
|
+
children: (e) => /* @__PURE__ */ P(In, {
|
|
2913
2848
|
value: e.state.value,
|
|
2914
2849
|
onChange: (t) => e.handleChange(t)
|
|
2915
2850
|
})
|
|
2916
2851
|
}),
|
|
2917
|
-
/* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ P(d, {
|
|
2918
2853
|
name: `options[${i}].label`,
|
|
2919
|
-
children: (t) => /* @__PURE__ */
|
|
2854
|
+
children: (t) => /* @__PURE__ */ P(m, {
|
|
2920
2855
|
placeholder: o("editor.inputNodeForm.optionLabel"),
|
|
2921
2856
|
value: t.state.value?.[e] || "",
|
|
2922
2857
|
onChange: ({ target: n }) => {
|
|
@@ -2927,27 +2862,27 @@ var $n = () => {
|
|
|
2927
2862
|
}
|
|
2928
2863
|
})
|
|
2929
2864
|
}),
|
|
2930
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ P(d, {
|
|
2931
2866
|
name: `options[${i}].value`,
|
|
2932
|
-
children: (e) => /* @__PURE__ */
|
|
2867
|
+
children: (e) => /* @__PURE__ */ P(m, {
|
|
2933
2868
|
placeholder: o("editor.inputNodeForm.optionValue"),
|
|
2934
2869
|
value: e.state.value || "",
|
|
2935
2870
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2936
2871
|
})
|
|
2937
2872
|
}),
|
|
2938
|
-
/* @__PURE__ */
|
|
2873
|
+
/* @__PURE__ */ P(p, {
|
|
2939
2874
|
type: "button",
|
|
2940
2875
|
variant: "ghost",
|
|
2941
2876
|
size: "icon",
|
|
2942
2877
|
onClick: () => {
|
|
2943
2878
|
t.removeValue(i), u().then();
|
|
2944
2879
|
},
|
|
2945
|
-
children: /* @__PURE__ */
|
|
2880
|
+
children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
|
|
2946
2881
|
})
|
|
2947
2882
|
]
|
|
2948
|
-
}), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */
|
|
2883
|
+
}), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */ P(d, {
|
|
2949
2884
|
name: `options[${i}].description`,
|
|
2950
|
-
children: (t) => /* @__PURE__ */
|
|
2885
|
+
children: (t) => /* @__PURE__ */ P(m, {
|
|
2951
2886
|
placeholder: o("editor.inputNodeForm.optionDescription"),
|
|
2952
2887
|
value: t.state.value?.[e] || "",
|
|
2953
2888
|
onChange: ({ target: n }) => {
|
|
@@ -2959,7 +2894,7 @@ var $n = () => {
|
|
|
2959
2894
|
})
|
|
2960
2895
|
})]
|
|
2961
2896
|
}, a);
|
|
2962
|
-
}), /* @__PURE__ */
|
|
2897
|
+
}), /* @__PURE__ */ P(p, {
|
|
2963
2898
|
type: "button",
|
|
2964
2899
|
variant: "outline",
|
|
2965
2900
|
size: "sm",
|
|
@@ -2973,36 +2908,36 @@ var $n = () => {
|
|
|
2973
2908
|
})]
|
|
2974
2909
|
})
|
|
2975
2910
|
}),
|
|
2976
|
-
n?.data?.type === "select" && /* @__PURE__ */
|
|
2911
|
+
n?.data?.type === "select" && /* @__PURE__ */ P(d, {
|
|
2977
2912
|
name: "multiple",
|
|
2978
|
-
children: (e) => /* @__PURE__ */
|
|
2913
|
+
children: (e) => /* @__PURE__ */ F("div", {
|
|
2979
2914
|
className: "flex items-center space-x-2",
|
|
2980
|
-
children: [/* @__PURE__ */
|
|
2915
|
+
children: [/* @__PURE__ */ P(y, {
|
|
2981
2916
|
id: e.name,
|
|
2982
2917
|
checked: e.state.value,
|
|
2983
2918
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2984
|
-
}), /* @__PURE__ */
|
|
2919
|
+
}), /* @__PURE__ */ P(l, {
|
|
2985
2920
|
htmlFor: e.name,
|
|
2986
2921
|
children: o("editor.inputNodeForm.multipleSelection")
|
|
2987
2922
|
})]
|
|
2988
2923
|
})
|
|
2989
2924
|
}),
|
|
2990
|
-
n?.data?.type === "radio" && /* @__PURE__ */
|
|
2925
|
+
n?.data?.type === "radio" && /* @__PURE__ */ P(d, {
|
|
2991
2926
|
name: "variant",
|
|
2992
|
-
children: (e) => /* @__PURE__ */
|
|
2927
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
2993
2928
|
htmlFor: e.name,
|
|
2994
2929
|
children: o("editor.inputNodeForm.variant")
|
|
2995
|
-
}), /* @__PURE__ */
|
|
2930
|
+
}), /* @__PURE__ */ F(g, {
|
|
2996
2931
|
value: e.state.value || "default",
|
|
2997
2932
|
onValueChange: (t) => e.handleChange(t),
|
|
2998
|
-
children: [/* @__PURE__ */
|
|
2933
|
+
children: [/* @__PURE__ */ P(h, {
|
|
2999
2934
|
id: e.name,
|
|
3000
2935
|
className: "w-full",
|
|
3001
|
-
children: /* @__PURE__ */
|
|
3002
|
-
}), /* @__PURE__ */
|
|
2936
|
+
children: /* @__PURE__ */ P(c, {})
|
|
2937
|
+
}), /* @__PURE__ */ F(A, { children: [/* @__PURE__ */ P(v, {
|
|
3003
2938
|
value: "default",
|
|
3004
2939
|
children: o("editor.inputNodeForm.variantDefault")
|
|
3005
|
-
}), /* @__PURE__ */
|
|
2940
|
+
}), /* @__PURE__ */ P(v, {
|
|
3006
2941
|
value: "card",
|
|
3007
2942
|
children: o("editor.inputNodeForm.variantCard")
|
|
3008
2943
|
})] })]
|
|
@@ -3011,77 +2946,77 @@ var $n = () => {
|
|
|
3011
2946
|
]
|
|
3012
2947
|
})]
|
|
3013
2948
|
}),
|
|
3014
|
-
!s && /* @__PURE__ */
|
|
2949
|
+
!s && /* @__PURE__ */ F(Rn, {
|
|
3015
2950
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
3016
|
-
children: [/* @__PURE__ */
|
|
2951
|
+
children: [/* @__PURE__ */ P(zn, {
|
|
3017
2952
|
asChild: !0,
|
|
3018
|
-
children: /* @__PURE__ */
|
|
2953
|
+
children: /* @__PURE__ */ F("div", {
|
|
3019
2954
|
className: "flex items-center justify-between gap-4",
|
|
3020
|
-
children: [/* @__PURE__ */
|
|
2955
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
3021
2956
|
className: "font-semibold text-sm",
|
|
3022
2957
|
children: o("editor.inputNodeForm.validation")
|
|
3023
|
-
}), /* @__PURE__ */
|
|
2958
|
+
}), /* @__PURE__ */ F(p, {
|
|
3024
2959
|
variant: "ghost",
|
|
3025
2960
|
size: "icon",
|
|
3026
2961
|
className: "size-8",
|
|
3027
|
-
children: [/* @__PURE__ */
|
|
2962
|
+
children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
|
|
3028
2963
|
className: "sr-only",
|
|
3029
2964
|
children: o("common.toggle")
|
|
3030
2965
|
})]
|
|
3031
2966
|
})]
|
|
3032
2967
|
})
|
|
3033
|
-
}), /* @__PURE__ */
|
|
2968
|
+
}), /* @__PURE__ */ F(Bn, {
|
|
3034
2969
|
className: "flex flex-col gap-6",
|
|
3035
2970
|
children: [
|
|
3036
|
-
/* @__PURE__ */
|
|
2971
|
+
/* @__PURE__ */ P(d, {
|
|
3037
2972
|
name: "required",
|
|
3038
|
-
children: (e) => /* @__PURE__ */
|
|
2973
|
+
children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
|
|
3039
2974
|
className: "flex items-center space-x-2",
|
|
3040
|
-
children: [/* @__PURE__ */
|
|
2975
|
+
children: [/* @__PURE__ */ P(y, {
|
|
3041
2976
|
id: e.name,
|
|
3042
2977
|
checked: e.state.value,
|
|
3043
2978
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3044
|
-
}), /* @__PURE__ */
|
|
2979
|
+
}), /* @__PURE__ */ P(l, {
|
|
3045
2980
|
htmlFor: e.name,
|
|
3046
2981
|
children: o("editor.inputNodeForm.required")
|
|
3047
2982
|
})]
|
|
3048
2983
|
}) })
|
|
3049
2984
|
}),
|
|
3050
|
-
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */
|
|
2985
|
+
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ P(d, {
|
|
3051
2986
|
name: "disablePast",
|
|
3052
|
-
children: (e) => /* @__PURE__ */
|
|
2987
|
+
children: (e) => /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
|
|
3053
2988
|
className: "flex items-center space-x-2",
|
|
3054
|
-
children: [/* @__PURE__ */
|
|
2989
|
+
children: [/* @__PURE__ */ P(y, {
|
|
3055
2990
|
id: e.name,
|
|
3056
2991
|
checked: e.state.value,
|
|
3057
2992
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3058
|
-
}), /* @__PURE__ */
|
|
2993
|
+
}), /* @__PURE__ */ P(l, {
|
|
3059
2994
|
htmlFor: e.name,
|
|
3060
2995
|
children: o("editor.inputNodeForm.disablePast")
|
|
3061
2996
|
})]
|
|
3062
2997
|
}) })
|
|
3063
2998
|
}),
|
|
3064
|
-
/* @__PURE__ */
|
|
2999
|
+
/* @__PURE__ */ P(d, {
|
|
3065
3000
|
name: "pattern",
|
|
3066
|
-
children: (e) => /* @__PURE__ */
|
|
3001
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
3067
3002
|
htmlFor: e.name,
|
|
3068
3003
|
children: o("editor.inputNodeForm.pattern")
|
|
3069
|
-
}), /* @__PURE__ */
|
|
3004
|
+
}), /* @__PURE__ */ P(kn, {
|
|
3070
3005
|
id: e.name,
|
|
3071
3006
|
value: e.state.value,
|
|
3072
3007
|
onValueChange: e.handleChange
|
|
3073
3008
|
})] })
|
|
3074
3009
|
}),
|
|
3075
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ F("div", {
|
|
3076
3011
|
className: "flex items-end gap-2",
|
|
3077
|
-
children: [/* @__PURE__ */
|
|
3012
|
+
children: [/* @__PURE__ */ P(d, {
|
|
3078
3013
|
name: "errorMessage",
|
|
3079
|
-
children: (t) => /* @__PURE__ */
|
|
3014
|
+
children: (t) => /* @__PURE__ */ F(w, {
|
|
3080
3015
|
className: "flex-1",
|
|
3081
|
-
children: [/* @__PURE__ */
|
|
3016
|
+
children: [/* @__PURE__ */ P(l, {
|
|
3082
3017
|
htmlFor: t.name,
|
|
3083
3018
|
children: o("editor.inputNodeForm.errorMessage")
|
|
3084
|
-
}), /* @__PURE__ */
|
|
3019
|
+
}), /* @__PURE__ */ P(m, {
|
|
3085
3020
|
id: t.name,
|
|
3086
3021
|
name: t.name,
|
|
3087
3022
|
value: t.state.value?.[e] || "",
|
|
@@ -3094,7 +3029,7 @@ var $n = () => {
|
|
|
3094
3029
|
}
|
|
3095
3030
|
})]
|
|
3096
3031
|
})
|
|
3097
|
-
}), /* @__PURE__ */
|
|
3032
|
+
}), /* @__PURE__ */ P(Q, {
|
|
3098
3033
|
value: e,
|
|
3099
3034
|
onValueChange: t
|
|
3100
3035
|
})]
|
|
@@ -3102,80 +3037,80 @@ var $n = () => {
|
|
|
3102
3037
|
]
|
|
3103
3038
|
})]
|
|
3104
3039
|
}),
|
|
3105
|
-
!s && /* @__PURE__ */
|
|
3040
|
+
!s && /* @__PURE__ */ F(Rn, {
|
|
3106
3041
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
3107
|
-
children: [/* @__PURE__ */
|
|
3042
|
+
children: [/* @__PURE__ */ P(zn, {
|
|
3108
3043
|
asChild: !0,
|
|
3109
|
-
children: /* @__PURE__ */
|
|
3044
|
+
children: /* @__PURE__ */ F("div", {
|
|
3110
3045
|
className: "flex items-center justify-between gap-4",
|
|
3111
|
-
children: [/* @__PURE__ */
|
|
3046
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
3112
3047
|
className: "font-semibold text-sm",
|
|
3113
3048
|
children: o("editor.inputNodeForm.advancedConfiguration")
|
|
3114
|
-
}), /* @__PURE__ */
|
|
3049
|
+
}), /* @__PURE__ */ F(p, {
|
|
3115
3050
|
variant: "ghost",
|
|
3116
3051
|
size: "icon",
|
|
3117
3052
|
className: "size-8",
|
|
3118
|
-
children: [/* @__PURE__ */
|
|
3053
|
+
children: [/* @__PURE__ */ P(Pe, {}), /* @__PURE__ */ P("span", {
|
|
3119
3054
|
className: "sr-only",
|
|
3120
3055
|
children: o("common.toggle")
|
|
3121
3056
|
})]
|
|
3122
3057
|
})]
|
|
3123
3058
|
})
|
|
3124
|
-
}), /* @__PURE__ */
|
|
3059
|
+
}), /* @__PURE__ */ F(Bn, {
|
|
3125
3060
|
className: "flex flex-col gap-6",
|
|
3126
|
-
children: [/* @__PURE__ */
|
|
3061
|
+
children: [/* @__PURE__ */ P(d, {
|
|
3127
3062
|
name: "name",
|
|
3128
|
-
children: (e) => /* @__PURE__ */
|
|
3129
|
-
/* @__PURE__ */
|
|
3063
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
3064
|
+
/* @__PURE__ */ P(l, {
|
|
3130
3065
|
htmlFor: e.name,
|
|
3131
3066
|
children: o("editor.inputNodeForm.name")
|
|
3132
3067
|
}),
|
|
3133
|
-
/* @__PURE__ */
|
|
3068
|
+
/* @__PURE__ */ P(m, {
|
|
3134
3069
|
id: e.name,
|
|
3135
3070
|
name: e.name,
|
|
3136
3071
|
value: e.state.value,
|
|
3137
3072
|
onBlur: e.handleBlur,
|
|
3138
3073
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3139
3074
|
}),
|
|
3140
|
-
/* @__PURE__ */
|
|
3075
|
+
/* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.nameDescription") })
|
|
3141
3076
|
] })
|
|
3142
|
-
}), /* @__PURE__ */
|
|
3077
|
+
}), /* @__PURE__ */ P(d, {
|
|
3143
3078
|
name: "defaultValue",
|
|
3144
|
-
children: (e) => /* @__PURE__ */
|
|
3145
|
-
/* @__PURE__ */
|
|
3079
|
+
children: (e) => /* @__PURE__ */ F(N, { children: [
|
|
3080
|
+
/* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
3146
3081
|
htmlFor: e.name,
|
|
3147
3082
|
children: o("editor.inputNodeForm.defaultValueType")
|
|
3148
|
-
}), /* @__PURE__ */
|
|
3083
|
+
}), /* @__PURE__ */ F(g, {
|
|
3149
3084
|
value: e.state.value?.type || "none",
|
|
3150
3085
|
onValueChange: (t) => {
|
|
3151
3086
|
e.handleChange(t === "none" ? null : { type: t });
|
|
3152
3087
|
},
|
|
3153
|
-
children: [/* @__PURE__ */
|
|
3088
|
+
children: [/* @__PURE__ */ P(h, {
|
|
3154
3089
|
id: e.name,
|
|
3155
|
-
children: /* @__PURE__ */
|
|
3156
|
-
}), /* @__PURE__ */
|
|
3157
|
-
/* @__PURE__ */
|
|
3090
|
+
children: /* @__PURE__ */ P(c, { placeholder: o("editor.inputNodeForm.selectType") })
|
|
3091
|
+
}), /* @__PURE__ */ F(A, { children: [
|
|
3092
|
+
/* @__PURE__ */ P(v, {
|
|
3158
3093
|
value: "none",
|
|
3159
3094
|
children: o("editor.inputNodeForm.defaultValueTypeNone")
|
|
3160
3095
|
}),
|
|
3161
|
-
/* @__PURE__ */
|
|
3096
|
+
/* @__PURE__ */ P(v, {
|
|
3162
3097
|
value: "static",
|
|
3163
3098
|
children: o("editor.inputNodeForm.defaultValueTypeStatic")
|
|
3164
3099
|
}),
|
|
3165
|
-
/* @__PURE__ */
|
|
3100
|
+
/* @__PURE__ */ P(v, {
|
|
3166
3101
|
value: "reference",
|
|
3167
3102
|
children: o("editor.inputNodeForm.defaultValueTypeReference")
|
|
3168
3103
|
})
|
|
3169
3104
|
] })]
|
|
3170
3105
|
})] }),
|
|
3171
|
-
e.state.value?.type === "static" && /* @__PURE__ */
|
|
3106
|
+
e.state.value?.type === "static" && /* @__PURE__ */ P(d, {
|
|
3172
3107
|
name: "defaultValue.staticValue",
|
|
3173
3108
|
children: (e) => {
|
|
3174
3109
|
let t = n?.data?.type;
|
|
3175
|
-
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */
|
|
3110
|
+
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
3176
3111
|
htmlFor: e.name,
|
|
3177
3112
|
children: o("editor.inputNodeForm.defaultValuesCommaSeparated")
|
|
3178
|
-
}), /* @__PURE__ */
|
|
3113
|
+
}), /* @__PURE__ */ P(m, {
|
|
3179
3114
|
id: e.name,
|
|
3180
3115
|
placeholder: o("editor.inputNodeForm.defaultValuesPlaceholder"),
|
|
3181
3116
|
value: Array.isArray(e.state.value) ? e.state.value.join(", ") : "",
|
|
@@ -3183,20 +3118,20 @@ var $n = () => {
|
|
|
3183
3118
|
let n = t.value.split(",").map((e) => e.trim()).filter(Boolean);
|
|
3184
3119
|
e.handleChange(n.length > 0 ? n : null);
|
|
3185
3120
|
}
|
|
3186
|
-
})] }) : t === "checkbox" ? /* @__PURE__ */
|
|
3121
|
+
})] }) : t === "checkbox" ? /* @__PURE__ */ P(w, { children: /* @__PURE__ */ F("div", {
|
|
3187
3122
|
className: "flex items-center space-x-2",
|
|
3188
|
-
children: [/* @__PURE__ */
|
|
3123
|
+
children: [/* @__PURE__ */ P(y, {
|
|
3189
3124
|
id: e.name,
|
|
3190
3125
|
checked: !!e.state.value,
|
|
3191
3126
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3192
|
-
}), /* @__PURE__ */
|
|
3127
|
+
}), /* @__PURE__ */ P(l, {
|
|
3193
3128
|
htmlFor: e.name,
|
|
3194
3129
|
children: o("editor.inputNodeForm.defaultChecked")
|
|
3195
3130
|
})]
|
|
3196
|
-
}) }) : /* @__PURE__ */
|
|
3131
|
+
}) }) : /* @__PURE__ */ F(w, { children: [/* @__PURE__ */ P(l, {
|
|
3197
3132
|
htmlFor: e.name,
|
|
3198
3133
|
children: o("editor.inputNodeForm.staticValue")
|
|
3199
|
-
}), /* @__PURE__ */
|
|
3134
|
+
}), /* @__PURE__ */ P(m, {
|
|
3200
3135
|
id: e.name,
|
|
3201
3136
|
placeholder: o("editor.inputNodeForm.staticValuePlaceholder"),
|
|
3202
3137
|
value: typeof e.state.value == "string" ? e.state.value : "",
|
|
@@ -3204,27 +3139,27 @@ var $n = () => {
|
|
|
3204
3139
|
})] });
|
|
3205
3140
|
}
|
|
3206
3141
|
}),
|
|
3207
|
-
e.state.value?.type === "reference" && /* @__PURE__ */
|
|
3208
|
-
/* @__PURE__ */
|
|
3142
|
+
e.state.value?.type === "reference" && /* @__PURE__ */ F(N, { children: [
|
|
3143
|
+
/* @__PURE__ */ P(d, {
|
|
3209
3144
|
name: "defaultValue.referenceField",
|
|
3210
|
-
children: (e) => /* @__PURE__ */
|
|
3211
|
-
/* @__PURE__ */
|
|
3145
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
3146
|
+
/* @__PURE__ */ P(l, {
|
|
3212
3147
|
htmlFor: e.name,
|
|
3213
3148
|
children: o("editor.inputNodeForm.referenceField")
|
|
3214
3149
|
}),
|
|
3215
|
-
/* @__PURE__ */
|
|
3150
|
+
/* @__PURE__ */ F(g, {
|
|
3216
3151
|
value: e.state.value || "",
|
|
3217
3152
|
onValueChange: (t) => {
|
|
3218
3153
|
e.handleChange(t);
|
|
3219
3154
|
},
|
|
3220
|
-
children: [/* @__PURE__ */
|
|
3155
|
+
children: [/* @__PURE__ */ P(h, {
|
|
3221
3156
|
id: e.name,
|
|
3222
|
-
children: /* @__PURE__ */
|
|
3223
|
-
}), /* @__PURE__ */
|
|
3157
|
+
children: /* @__PURE__ */ P(c, { placeholder: o("editor.inputNodeForm.selectReferenceField") })
|
|
3158
|
+
}), /* @__PURE__ */ P(A, { children: a.length === 0 ? /* @__PURE__ */ P(v, {
|
|
3224
3159
|
value: "none",
|
|
3225
3160
|
disabled: !0,
|
|
3226
3161
|
children: o("editor.inputNodeForm.noParentFieldsAvailable")
|
|
3227
|
-
}) : a.map((e) => /* @__PURE__ */
|
|
3162
|
+
}) : a.map((e) => /* @__PURE__ */ F(v, {
|
|
3228
3163
|
value: e.nodeId,
|
|
3229
3164
|
children: [
|
|
3230
3165
|
e.label,
|
|
@@ -3234,17 +3169,17 @@ var $n = () => {
|
|
|
3234
3169
|
]
|
|
3235
3170
|
}, e.nodeId)) })]
|
|
3236
3171
|
}),
|
|
3237
|
-
a.length === 0 && /* @__PURE__ */
|
|
3172
|
+
a.length === 0 && /* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.addInputFieldsBeforeReference") })
|
|
3238
3173
|
] })
|
|
3239
3174
|
}),
|
|
3240
|
-
/* @__PURE__ */
|
|
3175
|
+
/* @__PURE__ */ P(d, {
|
|
3241
3176
|
name: "defaultValue.transformFunction",
|
|
3242
|
-
children: (t) => /* @__PURE__ */
|
|
3243
|
-
/* @__PURE__ */
|
|
3177
|
+
children: (t) => /* @__PURE__ */ F(w, { children: [
|
|
3178
|
+
/* @__PURE__ */ P(l, {
|
|
3244
3179
|
htmlFor: t.name,
|
|
3245
3180
|
children: o("editor.inputNodeForm.transformType")
|
|
3246
3181
|
}),
|
|
3247
|
-
/* @__PURE__ */
|
|
3182
|
+
/* @__PURE__ */ F(g, {
|
|
3248
3183
|
value: t.state.value || "none",
|
|
3249
3184
|
onValueChange: (n) => {
|
|
3250
3185
|
let r = n === "none" ? null : n;
|
|
@@ -3256,80 +3191,80 @@ var $n = () => {
|
|
|
3256
3191
|
});
|
|
3257
3192
|
}
|
|
3258
3193
|
},
|
|
3259
|
-
children: [/* @__PURE__ */
|
|
3194
|
+
children: [/* @__PURE__ */ P(h, {
|
|
3260
3195
|
id: t.name,
|
|
3261
|
-
children: /* @__PURE__ */
|
|
3262
|
-
}), /* @__PURE__ */
|
|
3263
|
-
/* @__PURE__ */
|
|
3196
|
+
children: /* @__PURE__ */ P(c, { placeholder: o("editor.inputNodeForm.selectTransformation") })
|
|
3197
|
+
}), /* @__PURE__ */ F(A, { children: [
|
|
3198
|
+
/* @__PURE__ */ P(v, {
|
|
3264
3199
|
value: "none",
|
|
3265
3200
|
children: o("editor.inputNodeForm.transformNone")
|
|
3266
3201
|
}),
|
|
3267
|
-
/* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ P(v, {
|
|
3268
3203
|
value: "toString",
|
|
3269
3204
|
children: o("editor.inputNodeForm.transformString")
|
|
3270
3205
|
}),
|
|
3271
|
-
/* @__PURE__ */
|
|
3206
|
+
/* @__PURE__ */ P(v, {
|
|
3272
3207
|
value: "toNumber",
|
|
3273
3208
|
children: o("editor.inputNodeForm.transformNumber")
|
|
3274
3209
|
}),
|
|
3275
|
-
/* @__PURE__ */
|
|
3210
|
+
/* @__PURE__ */ P(v, {
|
|
3276
3211
|
value: "toBoolean",
|
|
3277
3212
|
children: o("editor.inputNodeForm.transformBoolean")
|
|
3278
3213
|
}),
|
|
3279
|
-
/* @__PURE__ */
|
|
3214
|
+
/* @__PURE__ */ P(v, {
|
|
3280
3215
|
value: "toArray",
|
|
3281
3216
|
children: o("editor.inputNodeForm.transformArray")
|
|
3282
3217
|
}),
|
|
3283
|
-
/* @__PURE__ */
|
|
3218
|
+
/* @__PURE__ */ P(v, {
|
|
3284
3219
|
value: "toObject",
|
|
3285
3220
|
children: o("editor.inputNodeForm.transformMapToObject")
|
|
3286
3221
|
})
|
|
3287
3222
|
] })]
|
|
3288
3223
|
}),
|
|
3289
|
-
/* @__PURE__ */
|
|
3224
|
+
/* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.transformDesc") })
|
|
3290
3225
|
] })
|
|
3291
3226
|
}),
|
|
3292
|
-
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */
|
|
3227
|
+
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ P(d, {
|
|
3293
3228
|
name: "defaultValue.objectMapping",
|
|
3294
3229
|
mode: "array",
|
|
3295
|
-
children: (e) => /* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
3297
|
-
/* @__PURE__ */
|
|
3230
|
+
children: (e) => /* @__PURE__ */ F(w, { children: [
|
|
3231
|
+
/* @__PURE__ */ P(l, { children: o("editor.inputNodeForm.objectMapping") }),
|
|
3232
|
+
/* @__PURE__ */ F("div", {
|
|
3298
3233
|
className: "space-y-2",
|
|
3299
|
-
children: [e.state.value?.map((t, n) => /* @__PURE__ */
|
|
3234
|
+
children: [e.state.value?.map((t, n) => /* @__PURE__ */ F("div", {
|
|
3300
3235
|
className: "flex items-center gap-2",
|
|
3301
3236
|
children: [
|
|
3302
|
-
/* @__PURE__ */
|
|
3237
|
+
/* @__PURE__ */ P(d, {
|
|
3303
3238
|
name: `defaultValue.objectMapping[${n}].sourceKey`,
|
|
3304
|
-
children: (e) => /* @__PURE__ */
|
|
3239
|
+
children: (e) => /* @__PURE__ */ P(m, {
|
|
3305
3240
|
placeholder: o("editor.inputNodeForm.sourceKey"),
|
|
3306
3241
|
value: e.state.value || "",
|
|
3307
3242
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3308
3243
|
})
|
|
3309
3244
|
}),
|
|
3310
|
-
/* @__PURE__ */
|
|
3245
|
+
/* @__PURE__ */ P("span", {
|
|
3311
3246
|
className: "text-muted-foreground",
|
|
3312
3247
|
children: "→"
|
|
3313
3248
|
}),
|
|
3314
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ P(d, {
|
|
3315
3250
|
name: `defaultValue.objectMapping[${n}].targetKey`,
|
|
3316
|
-
children: (e) => /* @__PURE__ */
|
|
3251
|
+
children: (e) => /* @__PURE__ */ P(m, {
|
|
3317
3252
|
placeholder: o("editor.inputNodeForm.targetKey"),
|
|
3318
3253
|
value: e.state.value || "",
|
|
3319
3254
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3320
3255
|
})
|
|
3321
3256
|
}),
|
|
3322
|
-
/* @__PURE__ */
|
|
3257
|
+
/* @__PURE__ */ P(p, {
|
|
3323
3258
|
type: "button",
|
|
3324
3259
|
variant: "ghost",
|
|
3325
3260
|
size: "icon",
|
|
3326
3261
|
onClick: () => {
|
|
3327
3262
|
e.removeValue(n), u().then();
|
|
3328
3263
|
},
|
|
3329
|
-
children: /* @__PURE__ */
|
|
3264
|
+
children: /* @__PURE__ */ P(R, { className: "h-4 w-4" })
|
|
3330
3265
|
})
|
|
3331
3266
|
]
|
|
3332
|
-
}, `mapping-${n}`)), /* @__PURE__ */
|
|
3267
|
+
}, `mapping-${n}`)), /* @__PURE__ */ F(p, {
|
|
3333
3268
|
type: "button",
|
|
3334
3269
|
variant: "outline",
|
|
3335
3270
|
size: "sm",
|
|
@@ -3340,10 +3275,10 @@ var $n = () => {
|
|
|
3340
3275
|
targetKey: ""
|
|
3341
3276
|
}), u().then();
|
|
3342
3277
|
},
|
|
3343
|
-
children: [/* @__PURE__ */
|
|
3278
|
+
children: [/* @__PURE__ */ P(L, { className: "mr-2 h-4 w-4" }), o("editor.inputNodeForm.addMapping")]
|
|
3344
3279
|
})]
|
|
3345
3280
|
}),
|
|
3346
|
-
/* @__PURE__ */
|
|
3281
|
+
/* @__PURE__ */ P(T, { children: o("editor.inputNodeForm.objectMappingDesc") })
|
|
3347
3282
|
] })
|
|
3348
3283
|
})
|
|
3349
3284
|
] })
|
|
@@ -3354,8 +3289,8 @@ var $n = () => {
|
|
|
3354
3289
|
]
|
|
3355
3290
|
})
|
|
3356
3291
|
});
|
|
3357
|
-
},
|
|
3358
|
-
let [e, t] =
|
|
3292
|
+
}, Hn = () => {
|
|
3293
|
+
let [e, t] = B("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = I({
|
|
3359
3294
|
defaultValues: {
|
|
3360
3295
|
label: n?.data?.label || { en: "" },
|
|
3361
3296
|
type: n?.data?.type || ""
|
|
@@ -3370,22 +3305,22 @@ var $n = () => {
|
|
|
3370
3305
|
r(e);
|
|
3371
3306
|
}
|
|
3372
3307
|
});
|
|
3373
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ P("form", {
|
|
3374
3309
|
onSubmit: (e) => {
|
|
3375
3310
|
e.preventDefault(), e.stopPropagation();
|
|
3376
3311
|
},
|
|
3377
|
-
children: /* @__PURE__ */
|
|
3312
|
+
children: /* @__PURE__ */ F("div", {
|
|
3378
3313
|
className: "grid gap-6",
|
|
3379
|
-
children: [/* @__PURE__ */
|
|
3314
|
+
children: [/* @__PURE__ */ F("div", {
|
|
3380
3315
|
className: "flex items-end gap-2",
|
|
3381
|
-
children: [/* @__PURE__ */
|
|
3316
|
+
children: [/* @__PURE__ */ P(i, {
|
|
3382
3317
|
name: "label",
|
|
3383
|
-
children: (t) => /* @__PURE__ */
|
|
3318
|
+
children: (t) => /* @__PURE__ */ F(w, {
|
|
3384
3319
|
className: "flex-1",
|
|
3385
|
-
children: [/* @__PURE__ */
|
|
3320
|
+
children: [/* @__PURE__ */ P(l, {
|
|
3386
3321
|
htmlFor: t.name,
|
|
3387
3322
|
children: "Label"
|
|
3388
|
-
}), /* @__PURE__ */
|
|
3323
|
+
}), /* @__PURE__ */ P(m, {
|
|
3389
3324
|
id: t.name,
|
|
3390
3325
|
name: t.name,
|
|
3391
3326
|
value: t.state.value?.[e] || "",
|
|
@@ -3398,37 +3333,37 @@ var $n = () => {
|
|
|
3398
3333
|
}
|
|
3399
3334
|
})]
|
|
3400
3335
|
})
|
|
3401
|
-
}), /* @__PURE__ */
|
|
3336
|
+
}), /* @__PURE__ */ P(Q, {
|
|
3402
3337
|
value: e,
|
|
3403
3338
|
onValueChange: t
|
|
3404
3339
|
})]
|
|
3405
|
-
}), /* @__PURE__ */
|
|
3340
|
+
}), /* @__PURE__ */ P(i, {
|
|
3406
3341
|
name: "type",
|
|
3407
|
-
children: (e) => /* @__PURE__ */
|
|
3342
|
+
children: (e) => /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
|
|
3408
3343
|
htmlFor: e.name,
|
|
3409
3344
|
children: "Type"
|
|
3410
|
-
}), /* @__PURE__ */
|
|
3345
|
+
}), /* @__PURE__ */ F(g, {
|
|
3411
3346
|
value: e.state.value,
|
|
3412
3347
|
onValueChange: (t) => e.handleChange(t),
|
|
3413
|
-
children: [/* @__PURE__ */
|
|
3348
|
+
children: [/* @__PURE__ */ P(h, {
|
|
3414
3349
|
id: e.name,
|
|
3415
3350
|
className: "w-full",
|
|
3416
|
-
children: /* @__PURE__ */
|
|
3417
|
-
}), /* @__PURE__ */
|
|
3418
|
-
value:
|
|
3351
|
+
children: /* @__PURE__ */ P(c, { placeholder: "" })
|
|
3352
|
+
}), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(v, {
|
|
3353
|
+
value: qt.title,
|
|
3419
3354
|
children: "Title"
|
|
3420
|
-
}), /* @__PURE__ */
|
|
3421
|
-
value:
|
|
3355
|
+
}), /* @__PURE__ */ P(v, {
|
|
3356
|
+
value: qt.divider,
|
|
3422
3357
|
children: "Divider"
|
|
3423
3358
|
})] }) })]
|
|
3424
3359
|
})] })
|
|
3425
3360
|
})]
|
|
3426
3361
|
})
|
|
3427
3362
|
});
|
|
3428
|
-
},
|
|
3429
|
-
let [e, t] =
|
|
3363
|
+
}, Un = () => {
|
|
3364
|
+
let [e, t] = B(""), [n, r] = B(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = M(), d = a?.parentId || "none", f = i(a), _ = G(), y = gt(), b = gt();
|
|
3430
3365
|
if (f) return null;
|
|
3431
|
-
let
|
|
3366
|
+
let x = (e) => {
|
|
3432
3367
|
a && s((t) => e === "none" ? t.map((e) => {
|
|
3433
3368
|
if (e.id === a.id) {
|
|
3434
3369
|
let { parentId: t, extent: n, ...r } = e;
|
|
@@ -3444,16 +3379,16 @@ var $n = () => {
|
|
|
3444
3379
|
y: 80
|
|
3445
3380
|
}
|
|
3446
3381
|
} : t) : t);
|
|
3447
|
-
},
|
|
3382
|
+
}, S = () => {
|
|
3448
3383
|
if (!(e.trim() && a)) return;
|
|
3449
3384
|
if (o.find((t) => {
|
|
3450
3385
|
let n = t.data?.label?.en || t.data?.label;
|
|
3451
3386
|
return String(n).toLowerCase() === e.trim().toLowerCase();
|
|
3452
3387
|
})) {
|
|
3453
|
-
|
|
3388
|
+
U.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
|
|
3454
3389
|
return;
|
|
3455
3390
|
}
|
|
3456
|
-
let n =
|
|
3391
|
+
let n = Wt();
|
|
3457
3392
|
s((t) => [{
|
|
3458
3393
|
data: { label: { en: e.trim() } },
|
|
3459
3394
|
id: n,
|
|
@@ -3474,83 +3409,83 @@ var $n = () => {
|
|
|
3474
3409
|
x: 175,
|
|
3475
3410
|
y: 30
|
|
3476
3411
|
}
|
|
3477
|
-
} : e)]), t(""), r(!1),
|
|
3412
|
+
} : e)]), t(""), r(!1), U.success("Group created", { description: `The group "${e.trim()}" has been created successfully.` });
|
|
3478
3413
|
};
|
|
3479
|
-
return /* @__PURE__ */
|
|
3414
|
+
return /* @__PURE__ */ F("div", {
|
|
3480
3415
|
className: "space-y-2",
|
|
3481
|
-
children: [/* @__PURE__ */
|
|
3416
|
+
children: [/* @__PURE__ */ P(l, {
|
|
3482
3417
|
htmlFor: y,
|
|
3483
|
-
children:
|
|
3484
|
-
}), /* @__PURE__ */
|
|
3418
|
+
children: _("editor.selectNodeGroup.group")
|
|
3419
|
+
}), /* @__PURE__ */ F("div", {
|
|
3485
3420
|
className: "flex gap-2",
|
|
3486
|
-
children: [/* @__PURE__ */
|
|
3421
|
+
children: [/* @__PURE__ */ F(g, {
|
|
3487
3422
|
value: d,
|
|
3488
|
-
onValueChange:
|
|
3489
|
-
children: [/* @__PURE__ */
|
|
3423
|
+
onValueChange: x,
|
|
3424
|
+
children: [/* @__PURE__ */ P(h, {
|
|
3490
3425
|
id: y,
|
|
3491
3426
|
className: "flex-1",
|
|
3492
|
-
children: /* @__PURE__ */
|
|
3493
|
-
}), /* @__PURE__ */
|
|
3427
|
+
children: /* @__PURE__ */ P(c, { placeholder: _("editor.selectNodeGroup.noGroup") })
|
|
3428
|
+
}), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(v, {
|
|
3494
3429
|
value: "none",
|
|
3495
|
-
children:
|
|
3496
|
-
}), o.map((e) => /* @__PURE__ */
|
|
3430
|
+
children: _("editor.selectNodeGroup.noGroup")
|
|
3431
|
+
}), o.map((e) => /* @__PURE__ */ P(v, {
|
|
3497
3432
|
value: e.id,
|
|
3498
3433
|
children: e.data.label?.en ? String(e.data.label?.en) : e.id
|
|
3499
3434
|
}, e.id))] }) })]
|
|
3500
|
-
}), /* @__PURE__ */
|
|
3435
|
+
}), /* @__PURE__ */ F(se, {
|
|
3501
3436
|
open: n,
|
|
3502
3437
|
onOpenChange: r,
|
|
3503
|
-
children: [/* @__PURE__ */
|
|
3438
|
+
children: [/* @__PURE__ */ P(u, {
|
|
3504
3439
|
asChild: !0,
|
|
3505
|
-
children: /* @__PURE__ */
|
|
3440
|
+
children: /* @__PURE__ */ P(p, {
|
|
3506
3441
|
variant: "outline",
|
|
3507
3442
|
size: "icon",
|
|
3508
3443
|
title: "Create a new group",
|
|
3509
|
-
children: /* @__PURE__ */
|
|
3444
|
+
children: /* @__PURE__ */ P($e, { className: "h-4 w-4" })
|
|
3510
3445
|
})
|
|
3511
|
-
}), /* @__PURE__ */
|
|
3446
|
+
}), /* @__PURE__ */ P(ee, {
|
|
3512
3447
|
className: "w-80",
|
|
3513
3448
|
align: "end",
|
|
3514
3449
|
disablePortal: !0,
|
|
3515
|
-
children: /* @__PURE__ */
|
|
3450
|
+
children: /* @__PURE__ */ F("div", {
|
|
3516
3451
|
className: "space-y-4",
|
|
3517
3452
|
children: [
|
|
3518
|
-
/* @__PURE__ */
|
|
3453
|
+
/* @__PURE__ */ F("div", {
|
|
3519
3454
|
className: "space-y-2",
|
|
3520
|
-
children: [/* @__PURE__ */
|
|
3455
|
+
children: [/* @__PURE__ */ P("h4", {
|
|
3521
3456
|
className: "font-medium leading-none",
|
|
3522
|
-
children:
|
|
3523
|
-
}), /* @__PURE__ */
|
|
3457
|
+
children: _("editor.selectNodeGroup.newGroup")
|
|
3458
|
+
}), /* @__PURE__ */ P("p", {
|
|
3524
3459
|
className: "text-muted-foreground text-sm",
|
|
3525
|
-
children:
|
|
3460
|
+
children: _("editor.selectNodeGroup.newGroupDescription")
|
|
3526
3461
|
})]
|
|
3527
3462
|
}),
|
|
3528
|
-
/* @__PURE__ */
|
|
3463
|
+
/* @__PURE__ */ F("div", {
|
|
3529
3464
|
className: "space-y-2",
|
|
3530
|
-
children: [/* @__PURE__ */
|
|
3531
|
-
htmlFor:
|
|
3532
|
-
children:
|
|
3533
|
-
}), /* @__PURE__ */
|
|
3465
|
+
children: [/* @__PURE__ */ P(l, {
|
|
3466
|
+
htmlFor: b,
|
|
3467
|
+
children: _("editor.selectNodeGroup.groupName")
|
|
3468
|
+
}), /* @__PURE__ */ P(m, {
|
|
3534
3469
|
autoFocus: !0,
|
|
3535
|
-
id:
|
|
3470
|
+
id: b,
|
|
3536
3471
|
value: e,
|
|
3537
3472
|
onChange: (e) => t(e.target.value),
|
|
3538
3473
|
placeholder: "Ex: Step 1 - Personal info",
|
|
3539
3474
|
onKeyDown: (e) => {
|
|
3540
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
3475
|
+
e.key === "Enter" && (e.preventDefault(), S());
|
|
3541
3476
|
}
|
|
3542
3477
|
})]
|
|
3543
3478
|
}),
|
|
3544
|
-
/* @__PURE__ */
|
|
3479
|
+
/* @__PURE__ */ F("div", {
|
|
3545
3480
|
className: "flex justify-end gap-2",
|
|
3546
|
-
children: [/* @__PURE__ */
|
|
3481
|
+
children: [/* @__PURE__ */ P(p, {
|
|
3547
3482
|
variant: "outline",
|
|
3548
3483
|
size: "sm",
|
|
3549
3484
|
onClick: () => r(!1),
|
|
3550
3485
|
children: "Cancel"
|
|
3551
|
-
}), /* @__PURE__ */
|
|
3486
|
+
}), /* @__PURE__ */ P(p, {
|
|
3552
3487
|
size: "sm",
|
|
3553
|
-
onClick:
|
|
3488
|
+
onClick: S,
|
|
3554
3489
|
disabled: !e.trim(),
|
|
3555
3490
|
children: "Create"
|
|
3556
3491
|
})]
|
|
@@ -3561,20 +3496,20 @@ var $n = () => {
|
|
|
3561
3496
|
})]
|
|
3562
3497
|
})]
|
|
3563
3498
|
});
|
|
3564
|
-
},
|
|
3565
|
-
let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o =
|
|
3566
|
-
return /* @__PURE__ */
|
|
3499
|
+
}, Wn = () => {
|
|
3500
|
+
let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o = gt();
|
|
3501
|
+
return /* @__PURE__ */ F(j, { children: [/* @__PURE__ */ P(ce, {
|
|
3567
3502
|
htmlFor: o,
|
|
3568
3503
|
children: a("editor.selectNodeType.nodeType")
|
|
3569
|
-
}), /* @__PURE__ */
|
|
3504
|
+
}), /* @__PURE__ */ F(g, {
|
|
3570
3505
|
value: n,
|
|
3571
3506
|
onValueChange: (e) => t(e),
|
|
3572
3507
|
disabled: r,
|
|
3573
|
-
children: [/* @__PURE__ */
|
|
3508
|
+
children: [/* @__PURE__ */ P(h, {
|
|
3574
3509
|
className: "w-full",
|
|
3575
3510
|
id: o,
|
|
3576
|
-
children: /* @__PURE__ */
|
|
3577
|
-
}), /* @__PURE__ */
|
|
3511
|
+
children: /* @__PURE__ */ P(c, { placeholder: a("editor.selectNodeType.nodeType") })
|
|
3512
|
+
}), /* @__PURE__ */ P(A, { children: /* @__PURE__ */ P(j, { children: Object.keys(on).filter((e) => r ? e === "group" : e !== "group").map((e) => /* @__PURE__ */ P(v, {
|
|
3578
3513
|
value: e,
|
|
3579
3514
|
children: a(`editor.selectNodeType.options.${e}`)
|
|
3580
3515
|
}, e)) }) })]
|
|
@@ -3582,62 +3517,62 @@ var $n = () => {
|
|
|
3582
3517
|
};
|
|
3583
3518
|
//#endregion
|
|
3584
3519
|
//#region src/shared/components/ui/sheet.tsx
|
|
3585
|
-
function
|
|
3586
|
-
return /* @__PURE__ */
|
|
3520
|
+
function Gn({ ...e }) {
|
|
3521
|
+
return /* @__PURE__ */ P(H.Root, {
|
|
3587
3522
|
"data-slot": "sheet",
|
|
3588
3523
|
...e
|
|
3589
3524
|
});
|
|
3590
3525
|
}
|
|
3591
|
-
function
|
|
3592
|
-
return /* @__PURE__ */
|
|
3526
|
+
function Kn({ ...e }) {
|
|
3527
|
+
return /* @__PURE__ */ P(H.Portal, {
|
|
3593
3528
|
"data-slot": "sheet-portal",
|
|
3594
3529
|
...e
|
|
3595
3530
|
});
|
|
3596
3531
|
}
|
|
3597
|
-
function
|
|
3598
|
-
return /* @__PURE__ */
|
|
3532
|
+
function qn({ className: e, ...t }) {
|
|
3533
|
+
return /* @__PURE__ */ P(H.Overlay, {
|
|
3599
3534
|
"data-slot": "sheet-overlay",
|
|
3600
3535
|
className: d("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
3601
3536
|
...t
|
|
3602
3537
|
});
|
|
3603
3538
|
}
|
|
3604
|
-
function
|
|
3605
|
-
return /* @__PURE__ */
|
|
3539
|
+
function Jn({ className: e, children: t, side: n = "right", ...r }) {
|
|
3540
|
+
return /* @__PURE__ */ F(Kn, { children: [/* @__PURE__ */ P(qn, {}), /* @__PURE__ */ F(H.Content, {
|
|
3606
3541
|
"data-slot": "sheet-content",
|
|
3607
3542
|
className: d("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500", n === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm", n === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm", n === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b", n === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t", e),
|
|
3608
3543
|
...r,
|
|
3609
|
-
children: [t, /* @__PURE__ */
|
|
3544
|
+
children: [t, /* @__PURE__ */ F(H.Close, {
|
|
3610
3545
|
className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",
|
|
3611
|
-
children: [/* @__PURE__ */
|
|
3546
|
+
children: [/* @__PURE__ */ P(dt, { className: "size-4" }), /* @__PURE__ */ P("span", {
|
|
3612
3547
|
className: "sr-only",
|
|
3613
3548
|
children: "Close"
|
|
3614
3549
|
})]
|
|
3615
3550
|
})]
|
|
3616
3551
|
})] });
|
|
3617
3552
|
}
|
|
3618
|
-
function
|
|
3619
|
-
return /* @__PURE__ */
|
|
3553
|
+
function Yn({ className: e, ...t }) {
|
|
3554
|
+
return /* @__PURE__ */ P("div", {
|
|
3620
3555
|
"data-slot": "sheet-header",
|
|
3621
3556
|
className: d("flex flex-col gap-1.5 p-4", e),
|
|
3622
3557
|
...t
|
|
3623
3558
|
});
|
|
3624
3559
|
}
|
|
3625
|
-
function
|
|
3626
|
-
return /* @__PURE__ */
|
|
3560
|
+
function Xn({ className: e, ...t }) {
|
|
3561
|
+
return /* @__PURE__ */ P("div", {
|
|
3627
3562
|
"data-slot": "sheet-footer",
|
|
3628
3563
|
className: d("mt-auto flex flex-col gap-2 p-4", e),
|
|
3629
3564
|
...t
|
|
3630
3565
|
});
|
|
3631
3566
|
}
|
|
3632
|
-
function
|
|
3633
|
-
return /* @__PURE__ */
|
|
3567
|
+
function Zn({ className: e, ...t }) {
|
|
3568
|
+
return /* @__PURE__ */ P(H.Title, {
|
|
3634
3569
|
"data-slot": "sheet-title",
|
|
3635
3570
|
className: d("font-semibold text-foreground", e),
|
|
3636
3571
|
...t
|
|
3637
3572
|
});
|
|
3638
3573
|
}
|
|
3639
|
-
function
|
|
3640
|
-
return /* @__PURE__ */
|
|
3574
|
+
function Qn({ className: e, ...t }) {
|
|
3575
|
+
return /* @__PURE__ */ P(H.Description, {
|
|
3641
3576
|
"data-slot": "sheet-description",
|
|
3642
3577
|
className: d("text-muted-foreground text-sm", e),
|
|
3643
3578
|
...t
|
|
@@ -3645,59 +3580,59 @@ function ur({ className: e, ...t }) {
|
|
|
3645
3580
|
}
|
|
3646
3581
|
//#endregion
|
|
3647
3582
|
//#region src/editor/features/TreegeEditor/sheets/NodeActionsSheet.tsx
|
|
3648
|
-
var
|
|
3583
|
+
var $n = () => {
|
|
3649
3584
|
let { selectedNode: e } = $(), { clearSelection: r } = q(), { isNodeSheetOpen: a, setIsNodeSheetOpen: o, openDeleteNodeConfirmation: c } = W(), l = G(), u = l(e?.data?.label), d = () => {
|
|
3650
3585
|
o(!1), r();
|
|
3651
3586
|
};
|
|
3652
|
-
return /* @__PURE__ */
|
|
3587
|
+
return /* @__PURE__ */ P(Gn, {
|
|
3653
3588
|
open: a && !!e,
|
|
3654
3589
|
onOpenChange: (e) => {
|
|
3655
3590
|
e || d();
|
|
3656
3591
|
},
|
|
3657
|
-
children: /* @__PURE__ */
|
|
3592
|
+
children: /* @__PURE__ */ F(Jn, {
|
|
3658
3593
|
className: "flex flex-col gap-0",
|
|
3659
3594
|
children: [
|
|
3660
|
-
/* @__PURE__ */
|
|
3595
|
+
/* @__PURE__ */ F(Yn, { children: [/* @__PURE__ */ F(Zn, { children: [
|
|
3661
3596
|
l("editor.nodeActionsSheet.editNode"),
|
|
3662
3597
|
" ",
|
|
3663
|
-
/* @__PURE__ */
|
|
3598
|
+
/* @__PURE__ */ P("span", {
|
|
3664
3599
|
className: "font-light text-muted-foreground text-xs",
|
|
3665
3600
|
children: e?.id
|
|
3666
3601
|
})
|
|
3667
|
-
] }), /* @__PURE__ */
|
|
3668
|
-
/* @__PURE__ */
|
|
3602
|
+
] }), /* @__PURE__ */ P(Qn, { children: u || "\xA0" })] }),
|
|
3603
|
+
/* @__PURE__ */ P(jt, {
|
|
3669
3604
|
className: "flex min-h-0 flex-1 flex-col px-4",
|
|
3670
|
-
children: /* @__PURE__ */
|
|
3605
|
+
children: /* @__PURE__ */ F("div", {
|
|
3671
3606
|
className: "space-y-6 py-4",
|
|
3672
3607
|
children: [
|
|
3673
|
-
/* @__PURE__ */
|
|
3674
|
-
/* @__PURE__ */
|
|
3675
|
-
/* @__PURE__ */
|
|
3676
|
-
s(e) && /* @__PURE__ */
|
|
3677
|
-
n(e) && /* @__PURE__ */
|
|
3678
|
-
t(e) && /* @__PURE__ */
|
|
3679
|
-
i(e) && /* @__PURE__ */
|
|
3608
|
+
/* @__PURE__ */ P(Wn, {}),
|
|
3609
|
+
/* @__PURE__ */ P(Un, {}),
|
|
3610
|
+
/* @__PURE__ */ P(k, {}),
|
|
3611
|
+
s(e) && /* @__PURE__ */ P(Vn, {}),
|
|
3612
|
+
n(e) && /* @__PURE__ */ P(Hn, {}),
|
|
3613
|
+
t(e) && /* @__PURE__ */ P(xn, {}),
|
|
3614
|
+
i(e) && /* @__PURE__ */ P(Sn, {})
|
|
3680
3615
|
]
|
|
3681
3616
|
})
|
|
3682
3617
|
}),
|
|
3683
|
-
/* @__PURE__ */
|
|
3618
|
+
/* @__PURE__ */ P(Xn, {
|
|
3684
3619
|
className: "flex items-end border-t",
|
|
3685
|
-
children: /* @__PURE__ */
|
|
3620
|
+
children: /* @__PURE__ */ P(p, {
|
|
3686
3621
|
variant: "ghost",
|
|
3687
3622
|
size: "icon",
|
|
3688
3623
|
onClick: () => {
|
|
3689
3624
|
e && c(e.id);
|
|
3690
3625
|
},
|
|
3691
3626
|
"aria-label": l("editor.nodeActionsSheet.deleteNode"),
|
|
3692
|
-
children: /* @__PURE__ */
|
|
3627
|
+
children: /* @__PURE__ */ P(ot, {})
|
|
3693
3628
|
})
|
|
3694
3629
|
})
|
|
3695
3630
|
]
|
|
3696
3631
|
})
|
|
3697
3632
|
});
|
|
3698
|
-
},
|
|
3699
|
-
let { theme: t = "system" } =
|
|
3700
|
-
return /* @__PURE__ */
|
|
3633
|
+
}, er = ({ ...e }) => {
|
|
3634
|
+
let { theme: t = "system" } = wt();
|
|
3635
|
+
return /* @__PURE__ */ P(St, {
|
|
3701
3636
|
theme: t,
|
|
3702
3637
|
className: "toaster group",
|
|
3703
3638
|
style: {
|
|
@@ -3707,14 +3642,14 @@ var dr = () => {
|
|
|
3707
3642
|
},
|
|
3708
3643
|
...e
|
|
3709
3644
|
});
|
|
3710
|
-
},
|
|
3711
|
-
let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } =
|
|
3712
|
-
return /* @__PURE__ */
|
|
3645
|
+
}, tr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
|
|
3646
|
+
let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = Kt();
|
|
3647
|
+
return /* @__PURE__ */ F(ye, {
|
|
3713
3648
|
fitView: !0,
|
|
3714
3649
|
colorMode: r,
|
|
3715
3650
|
selectNodesOnDrag: !1,
|
|
3716
|
-
nodeTypes:
|
|
3717
|
-
edgeTypes:
|
|
3651
|
+
nodeTypes: on,
|
|
3652
|
+
edgeTypes: Nt,
|
|
3718
3653
|
defaultEdges: e?.edges || [],
|
|
3719
3654
|
defaultNodes: e?.nodes || [],
|
|
3720
3655
|
onConnect: a,
|
|
@@ -3723,32 +3658,32 @@ var dr = () => {
|
|
|
3723
3658
|
isValidConnection: c,
|
|
3724
3659
|
className: d(i, "treege"),
|
|
3725
3660
|
children: [
|
|
3726
|
-
/* @__PURE__ */
|
|
3661
|
+
/* @__PURE__ */ P(le, {
|
|
3727
3662
|
gap: 10,
|
|
3728
|
-
variant:
|
|
3663
|
+
variant: ue.Dots
|
|
3729
3664
|
}),
|
|
3730
|
-
/* @__PURE__ */
|
|
3665
|
+
/* @__PURE__ */ P(yn, {
|
|
3731
3666
|
onExportJson: t,
|
|
3732
3667
|
onSave: n
|
|
3733
3668
|
}),
|
|
3734
|
-
/* @__PURE__ */
|
|
3735
|
-
/* @__PURE__ */
|
|
3736
|
-
/* @__PURE__ */
|
|
3737
|
-
/* @__PURE__ */
|
|
3738
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ P(Dt, { theme: r }),
|
|
3670
|
+
/* @__PURE__ */ P(he, {}),
|
|
3671
|
+
/* @__PURE__ */ P(fe, {}),
|
|
3672
|
+
/* @__PURE__ */ P($n, {}),
|
|
3673
|
+
/* @__PURE__ */ P(sn, {})
|
|
3739
3674
|
]
|
|
3740
3675
|
});
|
|
3741
|
-
},
|
|
3676
|
+
}, nr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ P(o, {
|
|
3742
3677
|
defaultTheme: r,
|
|
3743
3678
|
storageKey: "treege-editor-theme",
|
|
3744
3679
|
theme: r,
|
|
3745
|
-
children: /* @__PURE__ */
|
|
3680
|
+
children: /* @__PURE__ */ F(At, {
|
|
3746
3681
|
value: {
|
|
3747
3682
|
aiConfig: a,
|
|
3748
3683
|
flowId: e?.id,
|
|
3749
3684
|
language: i
|
|
3750
3685
|
},
|
|
3751
|
-
children: [/* @__PURE__ */
|
|
3686
|
+
children: [/* @__PURE__ */ P(er, { position: "bottom-center" }), /* @__PURE__ */ P(be, { children: /* @__PURE__ */ P(tr, {
|
|
3752
3687
|
onExportJson: t,
|
|
3753
3688
|
onSave: n,
|
|
3754
3689
|
flow: e,
|
|
@@ -3757,4 +3692,4 @@ var dr = () => {
|
|
|
3757
3692
|
})
|
|
3758
3693
|
});
|
|
3759
3694
|
//#endregion
|
|
3760
|
-
export {
|
|
3695
|
+
export { nr as t };
|