treege 3.0.0-beta.32 → 3.0.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThemeContext-CF4x2MjM.js → ThemeContext-DBFles56.js} +48 -225
- package/dist/{editor-Bu-BRxFn.js → editor-5TMX4qqC.js} +1059 -1058
- package/dist/editor.js +3 -3
- package/dist/main.js +5 -5
- package/dist/renderer-JJGxelGQ.js +1199 -0
- package/dist/renderer-native.js +675 -674
- package/dist/renderer.js +3 -3
- package/dist/{separator-NOjYTDU_.js → separator-Cdfv5nIR.js} +181 -181
- package/dist/{useRenderNode-B5u9MZKo.js → useRenderNode-BTzgPipn.js} +148 -147
- package/package.json +1 -1
- package/dist/renderer-BTSDEkG-.js +0 -1204
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { a as e, c as t, d as n,
|
|
2
|
-
import { C as
|
|
3
|
-
import { Background as de, BackgroundVariant as fe, BaseEdge as pe, Controls as me, EdgeLabelRenderer as he, Handle as ge, MiniMap as _e, NodeResizer as ve, Panel as ye, Position as be, ReactFlow as xe, ReactFlowProvider as Se, addEdge as Ce, getBezierPath as we, useEdges as Te, useNodes as Ee, useReactFlow as
|
|
4
|
-
import {
|
|
5
|
-
import { useForm as
|
|
6
|
-
import { AlignLeft as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import * as
|
|
11
|
-
import * as B from "@radix-ui/react-
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import * as
|
|
15
|
-
import
|
|
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, P as h, S as g, T as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as ee, i as te, j as T, k as E, l as ne, m as re, n as ie, o as D, p as ae, r as oe, s as O, t as se, u as ce, v as k, w as le, x as ue, y as A } from "./separator-Cdfv5nIR.js";
|
|
3
|
+
import { Background as de, BackgroundVariant as fe, BaseEdge as pe, Controls as me, EdgeLabelRenderer as he, Handle as ge, MiniMap as _e, NodeResizer as ve, Panel as ye, Position as be, ReactFlow as xe, ReactFlowProvider as Se, addEdge as Ce, getBezierPath as we, useEdges as Te, useNodes as Ee, useReactFlow as De } from "@xyflow/react";
|
|
4
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
5
|
+
import { useForm as P } from "@tanstack/react-form";
|
|
6
|
+
import { AlignLeft as Oe, ArrowRightFromLine as ke, Boxes as Ae, Calendar as je, CalendarRange as Me, CaseSensitive as Ne, Check as Pe, CheckSquare as Fe, ChevronDown as Ie, ChevronsUpDown as Le, CircleDot as Re, Clock as ze, Cloud as Be, Copy as Ve, Download as He, EllipsisVertical as Ue, EyeOff as We, Hash as Ge, Heading as Ke, ImagePlus as qe, KeyRound as Je, Link2 as Ye, ListFilter as Xe, Loader2 as Ze, MapPin as Qe, Minus as $e, MoreVertical as et, Paperclip as tt, Plus as F, PlusCircle as nt, RectangleEllipsis as rt, Save as it, Search as at, Send as ot, Settings as st, ToggleLeft as ct, Trash2 as lt, Upload as ut, Variable as dt, WandSparkles as ft, Waypoints as pt, X as I, XIcon as mt } from "lucide-react";
|
|
7
|
+
import { createContext as ht, memo as gt, useCallback as L, useContext as _t, useEffect as vt, useId as yt, useMemo as R, useRef as bt, useState as z } from "react";
|
|
8
|
+
import { Slot as xt } from "@radix-ui/react-slot";
|
|
9
|
+
import { cva as St } from "class-variance-authority";
|
|
10
|
+
import * as Ct from "@radix-ui/react-scroll-area";
|
|
11
|
+
import * as B from "@radix-ui/react-alert-dialog";
|
|
12
|
+
import * as V from "@radix-ui/react-dropdown-menu";
|
|
13
|
+
import { Toaster as wt, toast as H } from "sonner";
|
|
14
|
+
import * as U from "@radix-ui/react-dialog";
|
|
15
|
+
import * as Tt from "@radix-ui/react-collapsible";
|
|
16
|
+
import { useTheme as Et } from "next-themes";
|
|
16
17
|
//#region src/editor/assets/img/treege-black.svg
|
|
17
|
-
var 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_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", 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_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", U = r(), Ot = ({ theme: e = "dark" }) => /* @__PURE__ */ (0, U.jsx)("div", {
|
|
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__ */ M("div", {
|
|
18
19
|
className: "absolute top-5 left-5 z-50 select-none",
|
|
19
|
-
children: /* @__PURE__ */ (
|
|
20
|
-
src: e === "dark" ?
|
|
20
|
+
children: /* @__PURE__ */ M("img", {
|
|
21
|
+
src: e === "dark" ? Ot : Dt,
|
|
21
22
|
alt: "Treege",
|
|
22
23
|
className: "relative h-14 w-auto drop-shadow-[0_0px_35px] drop-shadow-blue-600"
|
|
23
24
|
})
|
|
24
|
-
}),
|
|
25
|
+
}), At = (e) => {
|
|
25
26
|
let t = Ee(), n = Te();
|
|
26
|
-
return
|
|
27
|
+
return R(() => {
|
|
27
28
|
if (!e) return [];
|
|
28
29
|
let r = (e, t = /* @__PURE__ */ new Set()) => {
|
|
29
30
|
if (t.has(e)) return [];
|
|
30
31
|
let i = new Set(t).add(e);
|
|
31
32
|
return n.filter((t) => t.target === e).flatMap((e) => [e.source, ...r(e.source, i)]);
|
|
32
33
|
}, i = r(e);
|
|
33
|
-
return t.filter((e) => i.includes(e.id) &&
|
|
34
|
+
return t.filter((e) => i.includes(e.id) && s(e)).map((e) => {
|
|
34
35
|
let t = e.data;
|
|
35
36
|
return {
|
|
36
37
|
label: (typeof t.label == "object" ? t.label.en : t.label) || t.name || e.id,
|
|
@@ -44,8 +45,8 @@ var Et = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
44
45
|
t,
|
|
45
46
|
n
|
|
46
47
|
]);
|
|
47
|
-
},
|
|
48
|
-
let [n, r] =
|
|
48
|
+
}, jt = ht(null), Mt = ({ children: e, value: t }) => {
|
|
49
|
+
let [n, r] = z(t?.flowId), [i, a] = z(!1), o = R(() => ({
|
|
49
50
|
...t,
|
|
50
51
|
...t?.aiConfig && { aiConfig: {
|
|
51
52
|
...t.aiConfig,
|
|
@@ -60,45 +61,45 @@ var Et = "data:image/svg+xml,%3csvg%20width='462'%20height='144'%20viewBox='0%20
|
|
|
60
61
|
t,
|
|
61
62
|
i
|
|
62
63
|
]);
|
|
63
|
-
return /* @__PURE__ */ (
|
|
64
|
+
return /* @__PURE__ */ M(jt.Provider, {
|
|
64
65
|
value: o,
|
|
65
66
|
children: e
|
|
66
67
|
});
|
|
67
|
-
},
|
|
68
|
+
}, W = () => _t(jt) ?? {
|
|
68
69
|
flowId: void 0,
|
|
69
70
|
isNodeSheetOpen: !1,
|
|
70
71
|
language: "en",
|
|
71
72
|
setFlowId: () => {},
|
|
72
73
|
setIsNodeSheetOpen: () => {}
|
|
73
|
-
},
|
|
74
|
-
let n =
|
|
74
|
+
}, G = (t) => {
|
|
75
|
+
let n = W();
|
|
75
76
|
return e(t ?? n.language);
|
|
76
77
|
};
|
|
77
78
|
//#endregion
|
|
78
79
|
//#region src/shared/components/ui/scroll-area.tsx
|
|
79
80
|
function Nt({ className: e, children: t, ...n }) {
|
|
80
|
-
return /* @__PURE__ */ (
|
|
81
|
+
return /* @__PURE__ */ N(Ct.Root, {
|
|
81
82
|
"data-slot": "scroll-area",
|
|
82
|
-
className:
|
|
83
|
+
className: d("relative", e),
|
|
83
84
|
...n,
|
|
84
85
|
children: [
|
|
85
|
-
/* @__PURE__ */ (
|
|
86
|
+
/* @__PURE__ */ M(Ct.Viewport, {
|
|
86
87
|
"data-slot": "scroll-area-viewport",
|
|
87
88
|
className: "size-full rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:outline-1 focus-visible:ring-[3px] focus-visible:ring-ring/50",
|
|
88
89
|
children: t
|
|
89
90
|
}),
|
|
90
|
-
/* @__PURE__ */ (
|
|
91
|
-
/* @__PURE__ */ (
|
|
91
|
+
/* @__PURE__ */ M(Pt, {}),
|
|
92
|
+
/* @__PURE__ */ M(Ct.Corner, {})
|
|
92
93
|
]
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
96
|
function Pt({ className: e, orientation: t = "vertical", ...n }) {
|
|
96
|
-
return /* @__PURE__ */ (
|
|
97
|
+
return /* @__PURE__ */ M(Ct.ScrollAreaScrollbar, {
|
|
97
98
|
"data-slot": "scroll-area-scrollbar",
|
|
98
99
|
orientation: t,
|
|
99
|
-
className:
|
|
100
|
+
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),
|
|
100
101
|
...n,
|
|
101
|
-
children: /* @__PURE__ */ (
|
|
102
|
+
children: /* @__PURE__ */ M(Ct.ScrollAreaThumb, {
|
|
102
103
|
"data-slot": "scroll-area-thumb",
|
|
103
104
|
className: "relative flex-1 rounded-full bg-border"
|
|
104
105
|
})
|
|
@@ -107,23 +108,23 @@ function Pt({ className: e, orientation: t = "vertical", ...n }) {
|
|
|
107
108
|
//#endregion
|
|
108
109
|
//#region src/editor/constants/edgeTypes.ts
|
|
109
110
|
var Ft = {
|
|
110
|
-
conditional:
|
|
111
|
-
let [S, C,
|
|
111
|
+
conditional: gt(({ id: e, target: t, sourceX: n, sourceY: i, targetX: a, targetY: o, sourcePosition: s, targetPosition: d, markerEnd: h, style: y, data: x }) => {
|
|
112
|
+
let [S, C, w] = we({
|
|
112
113
|
sourcePosition: s,
|
|
113
114
|
sourceX: n,
|
|
114
|
-
sourceY:
|
|
115
|
-
targetPosition:
|
|
115
|
+
sourceY: i,
|
|
116
|
+
targetPosition: d,
|
|
116
117
|
targetX: a,
|
|
117
118
|
targetY: o
|
|
118
|
-
}), [
|
|
119
|
+
}), [ee, te] = z(!1), { updateEdgeData: ne } = De(), re = At(t), ie = x?.conditions && x.conditions.length > 0, D = G(), { handleSubmit: ae, reset: oe, Field: O } = P({
|
|
119
120
|
defaultValues: {
|
|
120
|
-
conditions:
|
|
121
|
-
field:
|
|
121
|
+
conditions: x?.conditions || [{
|
|
122
|
+
field: re[0]?.nodeId ?? "",
|
|
122
123
|
operator: "===",
|
|
123
124
|
value: ""
|
|
124
125
|
}],
|
|
125
|
-
isFallback: !!
|
|
126
|
-
label:
|
|
126
|
+
isFallback: !!x?.isFallback,
|
|
127
|
+
label: x?.label || ""
|
|
127
128
|
},
|
|
128
129
|
listeners: {
|
|
129
130
|
onChange: ({ formApi: e }) => {
|
|
@@ -134,10 +135,10 @@ var Ft = {
|
|
|
134
135
|
onSubmit: ({ value: t }) => {
|
|
135
136
|
ne(e, t);
|
|
136
137
|
}
|
|
137
|
-
}),
|
|
138
|
+
}), se = (e) => {
|
|
138
139
|
e.stopPropagation();
|
|
139
|
-
},
|
|
140
|
-
|
|
140
|
+
}, ce = () => {
|
|
141
|
+
oe({
|
|
141
142
|
conditions: [],
|
|
142
143
|
isFallback: !1,
|
|
143
144
|
label: ""
|
|
@@ -146,139 +147,139 @@ var Ft = {
|
|
|
146
147
|
isFallback: void 0,
|
|
147
148
|
label: void 0
|
|
148
149
|
});
|
|
149
|
-
},
|
|
150
|
-
if (
|
|
151
|
-
if (!
|
|
152
|
-
if (
|
|
153
|
-
let e =
|
|
154
|
-
if (e.length === 1) return `${
|
|
155
|
-
let t = e.filter((e) => e.logicalOperator ===
|
|
156
|
-
return t > 0 && n === 0 ? `${e.length} ${
|
|
157
|
-
},
|
|
158
|
-
return /* @__PURE__ */ (
|
|
150
|
+
}, ue = () => {
|
|
151
|
+
if (x?.isFallback) return x.label || D("editor.conditionalEdge.fallback");
|
|
152
|
+
if (!ie) return null;
|
|
153
|
+
if (x.label) return x.label;
|
|
154
|
+
let e = x.conditions;
|
|
155
|
+
if (e.length === 1) return `${re.find((t) => t.nodeId === e[0].field)?.label || e[0].field} ${e[0].operator} ${e[0].value}`;
|
|
156
|
+
let t = e.filter((e) => e.logicalOperator === r.AND).length, n = e.filter((e) => e.logicalOperator === r.OR).length;
|
|
157
|
+
return t > 0 && n === 0 ? `${e.length} ${D("editor.conditionalEdge.conditionsAnd")}` : n > 0 && t === 0 ? `${e.length} ${D("editor.conditionalEdge.conditionsOr")}` : `${e.length} ${D("editor.conditionalEdge.conditionsMixed")}`;
|
|
158
|
+
}, A = () => x?.isFallback ? "var(--color-chart-4)" : ie ? "var(--color-chart-2)" : "var(--color-chart-3)";
|
|
159
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(pe, {
|
|
159
160
|
path: S,
|
|
160
|
-
markerEnd:
|
|
161
|
+
markerEnd: h,
|
|
161
162
|
style: {
|
|
162
|
-
...
|
|
163
|
-
stroke:
|
|
164
|
-
strokeDasharray:
|
|
165
|
-
strokeWidth:
|
|
163
|
+
...y,
|
|
164
|
+
stroke: A(),
|
|
165
|
+
strokeDasharray: x?.isFallback ? "5,5" : void 0,
|
|
166
|
+
strokeWidth: ie || x?.isFallback ? 2 : y?.strokeWidth
|
|
166
167
|
}
|
|
167
|
-
}), /* @__PURE__ */ (
|
|
168
|
+
}), /* @__PURE__ */ M(he, { children: /* @__PURE__ */ M("div", {
|
|
168
169
|
className: "nodrag nopan absolute",
|
|
169
170
|
style: {
|
|
170
171
|
pointerEvents: "all",
|
|
171
|
-
transform: `translate(-50%, -50%) translate(${C}px,${
|
|
172
|
+
transform: `translate(-50%, -50%) translate(${C}px,${w}px)`
|
|
172
173
|
},
|
|
173
|
-
children: /* @__PURE__ */ (
|
|
174
|
-
open:
|
|
175
|
-
onOpenChange:
|
|
176
|
-
children: [/* @__PURE__ */ (
|
|
174
|
+
children: /* @__PURE__ */ N(le, {
|
|
175
|
+
open: ee,
|
|
176
|
+
onOpenChange: te,
|
|
177
|
+
children: [/* @__PURE__ */ M(u, {
|
|
177
178
|
asChild: !0,
|
|
178
|
-
children: /* @__PURE__ */ (
|
|
179
|
-
variant:
|
|
179
|
+
children: /* @__PURE__ */ N(p, {
|
|
180
|
+
variant: ie || x?.isFallback ? "default" : "secondary",
|
|
180
181
|
className: "h-8 px-2 text-xs",
|
|
181
|
-
onClick:
|
|
182
|
-
children: [/* @__PURE__ */ (
|
|
182
|
+
onClick: se,
|
|
183
|
+
children: [/* @__PURE__ */ M(pt, { className: "mr-1 h-3 w-3" }), ie || x?.isFallback ? ue() : D("editor.conditionalEdge.condition")]
|
|
183
184
|
})
|
|
184
|
-
}), /* @__PURE__ */ (
|
|
185
|
+
}), /* @__PURE__ */ M(_, {
|
|
185
186
|
className: "w-96 p-1",
|
|
186
187
|
align: "center",
|
|
187
188
|
onClick: (e) => e.stopPropagation(),
|
|
188
|
-
children: /* @__PURE__ */ (
|
|
189
|
+
children: /* @__PURE__ */ M(Nt, {
|
|
189
190
|
className: "flex max-h-150 flex-col p-3",
|
|
190
|
-
children: /* @__PURE__ */ (
|
|
191
|
+
children: /* @__PURE__ */ M("form", {
|
|
191
192
|
onSubmit: (e) => {
|
|
192
193
|
e.preventDefault(), e.stopPropagation();
|
|
193
194
|
},
|
|
194
|
-
children: /* @__PURE__ */ (
|
|
195
|
+
children: /* @__PURE__ */ N("div", {
|
|
195
196
|
className: "grid gap-5",
|
|
196
197
|
children: [
|
|
197
|
-
/* @__PURE__ */ (
|
|
198
|
+
/* @__PURE__ */ N("div", {
|
|
198
199
|
className: "space-y-2",
|
|
199
|
-
children: [/* @__PURE__ */ (
|
|
200
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
200
201
|
className: "font-medium leading-none",
|
|
201
|
-
children:
|
|
202
|
-
}), /* @__PURE__ */ (
|
|
202
|
+
children: D("editor.conditionalEdge.displayConditions")
|
|
203
|
+
}), /* @__PURE__ */ M("p", {
|
|
203
204
|
className: "text-muted-foreground text-sm",
|
|
204
|
-
children:
|
|
205
|
+
children: D("editor.conditionalEdge.displayConditionsDesc")
|
|
205
206
|
})]
|
|
206
207
|
}),
|
|
207
|
-
/* @__PURE__ */ (
|
|
208
|
+
/* @__PURE__ */ N("div", {
|
|
208
209
|
className: "grid gap-4",
|
|
209
210
|
children: [
|
|
210
|
-
/* @__PURE__ */ (
|
|
211
|
+
/* @__PURE__ */ M(O, {
|
|
211
212
|
name: "label",
|
|
212
|
-
children: (e) => /* @__PURE__ */ (
|
|
213
|
-
/* @__PURE__ */ (
|
|
213
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
214
|
+
/* @__PURE__ */ M(l, {
|
|
214
215
|
htmlFor: e.name,
|
|
215
|
-
children:
|
|
216
|
+
children: D("editor.conditionalEdge.labelOptional")
|
|
216
217
|
}),
|
|
217
|
-
/* @__PURE__ */ (
|
|
218
|
+
/* @__PURE__ */ M(m, {
|
|
218
219
|
id: e.name,
|
|
219
|
-
placeholder:
|
|
220
|
+
placeholder: D("editor.conditionalEdge.labelPlaceholder"),
|
|
220
221
|
value: e.state.value,
|
|
221
222
|
onChange: (t) => e.handleChange(t.target.value)
|
|
222
223
|
}),
|
|
223
|
-
/* @__PURE__ */ (
|
|
224
|
+
/* @__PURE__ */ M(E, { children: D("editor.conditionalEdge.labelDesc") })
|
|
224
225
|
] })
|
|
225
226
|
}),
|
|
226
|
-
/* @__PURE__ */ (
|
|
227
|
+
/* @__PURE__ */ M(O, {
|
|
227
228
|
name: "isFallback",
|
|
228
|
-
children: (e) => /* @__PURE__ */ (
|
|
229
|
+
children: (e) => /* @__PURE__ */ M(T, { children: /* @__PURE__ */ N("div", {
|
|
229
230
|
className: "flex items-center gap-3 rounded-lg border bg-muted/20 p-3",
|
|
230
|
-
children: [/* @__PURE__ */ (
|
|
231
|
+
children: [/* @__PURE__ */ M(f, {
|
|
231
232
|
id: e.name,
|
|
232
233
|
checked: e.state.value,
|
|
233
234
|
onCheckedChange: (t) => e.handleChange(t)
|
|
234
|
-
}), /* @__PURE__ */ (
|
|
235
|
+
}), /* @__PURE__ */ N("div", {
|
|
235
236
|
className: "flex flex-col gap-1",
|
|
236
|
-
children: [/* @__PURE__ */ (
|
|
237
|
+
children: [/* @__PURE__ */ M(l, {
|
|
237
238
|
htmlFor: e.name,
|
|
238
239
|
className: "cursor-pointer font-medium",
|
|
239
|
-
children:
|
|
240
|
-
}), /* @__PURE__ */ (
|
|
240
|
+
children: D("editor.conditionalEdge.fallbackPath")
|
|
241
|
+
}), /* @__PURE__ */ M(E, {
|
|
241
242
|
className: "text-xs",
|
|
242
|
-
children:
|
|
243
|
+
children: D("editor.conditionalEdge.fallbackPathDesc")
|
|
243
244
|
})]
|
|
244
245
|
})]
|
|
245
246
|
}) })
|
|
246
247
|
}),
|
|
247
|
-
/* @__PURE__ */ (
|
|
248
|
+
/* @__PURE__ */ M(O, {
|
|
248
249
|
name: "conditions",
|
|
249
250
|
mode: "array",
|
|
250
251
|
children: (e) => {
|
|
251
252
|
let t = e.form.getFieldValue("isFallback");
|
|
252
|
-
return /* @__PURE__ */ (
|
|
253
|
+
return /* @__PURE__ */ N("div", {
|
|
253
254
|
className: "space-y-3",
|
|
254
|
-
children: [/* @__PURE__ */ (
|
|
255
|
+
children: [/* @__PURE__ */ M(l, {
|
|
255
256
|
className: t ? "text-muted-foreground" : "",
|
|
256
|
-
children:
|
|
257
|
-
}), /* @__PURE__ */ (
|
|
257
|
+
children: D("editor.conditionalEdge.conditions")
|
|
258
|
+
}), /* @__PURE__ */ N("div", {
|
|
258
259
|
className: "space-y-2",
|
|
259
|
-
children: [e.state.value?.map((n,
|
|
260
|
+
children: [e.state.value?.map((n, i) => /* @__PURE__ */ N("div", {
|
|
260
261
|
className: "space-y-2",
|
|
261
|
-
children: [/* @__PURE__ */ (
|
|
262
|
+
children: [/* @__PURE__ */ N("div", {
|
|
262
263
|
className: "space-y-2 rounded-lg border bg-muted/30 p-3",
|
|
263
264
|
children: [
|
|
264
|
-
/* @__PURE__ */ (
|
|
265
|
-
name: `conditions[${
|
|
266
|
-
children: (e) => /* @__PURE__ */ (
|
|
267
|
-
htmlFor: `field-${
|
|
268
|
-
children:
|
|
269
|
-
}), /* @__PURE__ */ (
|
|
265
|
+
/* @__PURE__ */ M(O, {
|
|
266
|
+
name: `conditions[${i}].field`,
|
|
267
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
268
|
+
htmlFor: `field-${i}`,
|
|
269
|
+
children: D("editor.conditionalEdge.field")
|
|
270
|
+
}), /* @__PURE__ */ N(v, {
|
|
270
271
|
disabled: t,
|
|
271
272
|
value: e.state.value || "",
|
|
272
273
|
onValueChange: (t) => e.handleChange(t),
|
|
273
|
-
children: [/* @__PURE__ */ (
|
|
274
|
-
id: `field-${
|
|
274
|
+
children: [/* @__PURE__ */ M(g, {
|
|
275
|
+
id: `field-${i}`,
|
|
275
276
|
className: "w-full",
|
|
276
|
-
children: /* @__PURE__ */ (
|
|
277
|
-
}), /* @__PURE__ */ (
|
|
277
|
+
children: /* @__PURE__ */ M(c, { placeholder: D("editor.conditionalEdge.selectField") })
|
|
278
|
+
}), /* @__PURE__ */ M(k, { children: re.length === 0 ? /* @__PURE__ */ M(b, {
|
|
278
279
|
value: "none",
|
|
279
280
|
disabled: !0,
|
|
280
|
-
children:
|
|
281
|
-
}) :
|
|
281
|
+
children: D("editor.conditionalEdge.noFieldsAvailable")
|
|
282
|
+
}) : re.map((e) => /* @__PURE__ */ N(b, {
|
|
282
283
|
value: e.nodeId,
|
|
283
284
|
children: [
|
|
284
285
|
e.label,
|
|
@@ -289,98 +290,98 @@ var Ft = {
|
|
|
289
290
|
}, e.nodeId)) })]
|
|
290
291
|
})] })
|
|
291
292
|
}),
|
|
292
|
-
/* @__PURE__ */ (
|
|
293
|
+
/* @__PURE__ */ N("div", {
|
|
293
294
|
className: "flex gap-2",
|
|
294
|
-
children: [/* @__PURE__ */ (
|
|
295
|
-
name: `conditions[${
|
|
296
|
-
children: (e) => /* @__PURE__ */ (
|
|
297
|
-
htmlFor: `operator-${
|
|
298
|
-
children:
|
|
299
|
-
}), /* @__PURE__ */ (
|
|
295
|
+
children: [/* @__PURE__ */ M(O, {
|
|
296
|
+
name: `conditions[${i}].operator`,
|
|
297
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
298
|
+
htmlFor: `operator-${i}`,
|
|
299
|
+
children: D("editor.conditionalEdge.operator")
|
|
300
|
+
}), /* @__PURE__ */ N(v, {
|
|
300
301
|
disabled: t,
|
|
301
302
|
value: e.state.value || "===",
|
|
302
303
|
onValueChange: (t) => e.handleChange(t),
|
|
303
|
-
children: [/* @__PURE__ */ (
|
|
304
|
-
id: `operator-${
|
|
305
|
-
children: /* @__PURE__ */ (
|
|
306
|
-
}), /* @__PURE__ */ (
|
|
307
|
-
/* @__PURE__ */ (
|
|
304
|
+
children: [/* @__PURE__ */ M(g, {
|
|
305
|
+
id: `operator-${i}`,
|
|
306
|
+
children: /* @__PURE__ */ M(c, {})
|
|
307
|
+
}), /* @__PURE__ */ N(k, { children: [
|
|
308
|
+
/* @__PURE__ */ M(b, {
|
|
308
309
|
value: "===",
|
|
309
310
|
children: "="
|
|
310
311
|
}),
|
|
311
|
-
/* @__PURE__ */ (
|
|
312
|
+
/* @__PURE__ */ M(b, {
|
|
312
313
|
value: "!==",
|
|
313
314
|
children: "≠"
|
|
314
315
|
}),
|
|
315
|
-
/* @__PURE__ */ (
|
|
316
|
+
/* @__PURE__ */ M(b, {
|
|
316
317
|
value: ">",
|
|
317
318
|
children: ">"
|
|
318
319
|
}),
|
|
319
|
-
/* @__PURE__ */ (
|
|
320
|
+
/* @__PURE__ */ M(b, {
|
|
320
321
|
value: "<",
|
|
321
322
|
children: "<"
|
|
322
323
|
}),
|
|
323
|
-
/* @__PURE__ */ (
|
|
324
|
+
/* @__PURE__ */ M(b, {
|
|
324
325
|
value: ">=",
|
|
325
326
|
children: ">="
|
|
326
327
|
}),
|
|
327
|
-
/* @__PURE__ */ (
|
|
328
|
+
/* @__PURE__ */ M(b, {
|
|
328
329
|
value: "<=",
|
|
329
330
|
children: "<="
|
|
330
331
|
})
|
|
331
332
|
] })]
|
|
332
333
|
})] })
|
|
333
|
-
}), /* @__PURE__ */ (
|
|
334
|
-
name: `conditions[${
|
|
335
|
-
children: (e) => /* @__PURE__ */ (
|
|
334
|
+
}), /* @__PURE__ */ M(O, {
|
|
335
|
+
name: `conditions[${i}].value`,
|
|
336
|
+
children: (e) => /* @__PURE__ */ N(T, {
|
|
336
337
|
className: "w-full",
|
|
337
|
-
children: [/* @__PURE__ */ (
|
|
338
|
-
htmlFor: `value-${
|
|
339
|
-
children:
|
|
340
|
-
}), /* @__PURE__ */ (
|
|
338
|
+
children: [/* @__PURE__ */ M(l, {
|
|
339
|
+
htmlFor: `value-${i}`,
|
|
340
|
+
children: D("editor.conditionalEdge.value")
|
|
341
|
+
}), /* @__PURE__ */ M(m, {
|
|
341
342
|
disabled: t,
|
|
342
|
-
id: `value-${
|
|
343
|
-
placeholder:
|
|
343
|
+
id: `value-${i}`,
|
|
344
|
+
placeholder: D("editor.conditionalEdge.valuePlaceholder"),
|
|
344
345
|
value: e.state.value || "",
|
|
345
346
|
onChange: (t) => e.handleChange(t.target.value)
|
|
346
347
|
})]
|
|
347
348
|
})
|
|
348
349
|
})]
|
|
349
350
|
}),
|
|
350
|
-
e.state.value && e.state.value.length > 1 && /* @__PURE__ */ (
|
|
351
|
+
e.state.value && e.state.value.length > 1 && /* @__PURE__ */ N(p, {
|
|
351
352
|
disabled: t,
|
|
352
353
|
type: "button",
|
|
353
354
|
variant: "ghost",
|
|
354
355
|
size: "sm",
|
|
355
356
|
className: "w-full",
|
|
356
357
|
onClick: () => {
|
|
357
|
-
e.removeValue(
|
|
358
|
+
e.removeValue(i), ae().then();
|
|
358
359
|
},
|
|
359
|
-
children: [/* @__PURE__ */ (
|
|
360
|
+
children: [/* @__PURE__ */ M(I, { className: "mr-1 h-4 w-4" }), D("editor.conditionalEdge.removeCondition")]
|
|
360
361
|
})
|
|
361
362
|
]
|
|
362
|
-
}), e.state.value &&
|
|
363
|
-
name: `conditions[${
|
|
364
|
-
children: (e) => /* @__PURE__ */ (
|
|
363
|
+
}), e.state.value && i < e.state.value.length - 1 && /* @__PURE__ */ M(O, {
|
|
364
|
+
name: `conditions[${i}].logicalOperator`,
|
|
365
|
+
children: (e) => /* @__PURE__ */ M("div", {
|
|
365
366
|
className: "flex justify-center",
|
|
366
|
-
children: /* @__PURE__ */ (
|
|
367
|
+
children: /* @__PURE__ */ N(v, {
|
|
367
368
|
disabled: t,
|
|
368
|
-
value: e.state.value ||
|
|
369
|
+
value: e.state.value || r.AND,
|
|
369
370
|
onValueChange: (t) => e.handleChange(t),
|
|
370
|
-
children: [/* @__PURE__ */ (
|
|
371
|
+
children: [/* @__PURE__ */ M(g, {
|
|
371
372
|
className: "h-9 w-32 font-semibold",
|
|
372
|
-
children: /* @__PURE__ */ (
|
|
373
|
-
}), /* @__PURE__ */ (
|
|
374
|
-
value:
|
|
373
|
+
children: /* @__PURE__ */ M(c, {})
|
|
374
|
+
}), /* @__PURE__ */ N(k, { children: [/* @__PURE__ */ M(b, {
|
|
375
|
+
value: r.AND,
|
|
375
376
|
children: "AND"
|
|
376
|
-
}), /* @__PURE__ */ (
|
|
377
|
-
value:
|
|
377
|
+
}), /* @__PURE__ */ M(b, {
|
|
378
|
+
value: r.OR,
|
|
378
379
|
children: "OR"
|
|
379
380
|
})] })]
|
|
380
381
|
})
|
|
381
382
|
})
|
|
382
383
|
})]
|
|
383
|
-
}, `condition-${
|
|
384
|
+
}, `condition-${i}`)), /* @__PURE__ */ N(p, {
|
|
384
385
|
disabled: t,
|
|
385
386
|
type: "button",
|
|
386
387
|
variant: "outline",
|
|
@@ -388,13 +389,13 @@ var Ft = {
|
|
|
388
389
|
className: "w-full",
|
|
389
390
|
onClick: () => {
|
|
390
391
|
e.pushValue({
|
|
391
|
-
field:
|
|
392
|
-
logicalOperator:
|
|
392
|
+
field: re[0]?.nodeId ?? "",
|
|
393
|
+
logicalOperator: r.AND,
|
|
393
394
|
operator: "===",
|
|
394
395
|
value: ""
|
|
395
|
-
}),
|
|
396
|
+
}), ae().then();
|
|
396
397
|
},
|
|
397
|
-
children: [/* @__PURE__ */ (
|
|
398
|
+
children: [/* @__PURE__ */ M(F, { className: "mr-2 h-4 w-4" }), D("editor.conditionalEdge.addCondition")]
|
|
398
399
|
})]
|
|
399
400
|
})]
|
|
400
401
|
});
|
|
@@ -402,19 +403,19 @@ var Ft = {
|
|
|
402
403
|
})
|
|
403
404
|
]
|
|
404
405
|
}),
|
|
405
|
-
/* @__PURE__ */ (
|
|
406
|
+
/* @__PURE__ */ N("div", {
|
|
406
407
|
className: "flex justify-end gap-2 pt-2",
|
|
407
|
-
children: [/* @__PURE__ */ (
|
|
408
|
+
children: [/* @__PURE__ */ N(p, {
|
|
408
409
|
type: "button",
|
|
409
410
|
size: "sm",
|
|
410
411
|
variant: "outline",
|
|
411
|
-
onClick:
|
|
412
|
-
children: [/* @__PURE__ */ (
|
|
413
|
-
}), /* @__PURE__ */ (
|
|
412
|
+
onClick: ce,
|
|
413
|
+
children: [/* @__PURE__ */ M(I, { className: "mr-1 h-4 w-4" }), D("common.clear")]
|
|
414
|
+
}), /* @__PURE__ */ M(p, {
|
|
414
415
|
type: "button",
|
|
415
416
|
size: "sm",
|
|
416
|
-
onClick: () =>
|
|
417
|
-
children:
|
|
417
|
+
onClick: () => te(!1),
|
|
418
|
+
children: D("common.close")
|
|
418
419
|
})]
|
|
419
420
|
})
|
|
420
421
|
]
|
|
@@ -425,7 +426,7 @@ var Ft = {
|
|
|
425
426
|
})
|
|
426
427
|
}) })] });
|
|
427
428
|
}),
|
|
428
|
-
default:
|
|
429
|
+
default: gt(({ id: e, sourceX: t, sourceY: n, targetX: r, targetY: i, sourcePosition: a, targetPosition: o, style: s, markerEnd: c, selected: l }) => {
|
|
429
430
|
let [u, d, f] = we({
|
|
430
431
|
sourcePosition: a,
|
|
431
432
|
sourceX: t,
|
|
@@ -433,15 +434,15 @@ var Ft = {
|
|
|
433
434
|
targetPosition: o,
|
|
434
435
|
targetX: r,
|
|
435
436
|
targetY: i
|
|
436
|
-
}), { setEdges: p } =
|
|
437
|
-
return /* @__PURE__ */ (
|
|
437
|
+
}), { setEdges: p } = De();
|
|
438
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(pe, {
|
|
438
439
|
path: u,
|
|
439
440
|
markerEnd: c,
|
|
440
441
|
style: s
|
|
441
|
-
}), /* @__PURE__ */ (
|
|
442
|
+
}), /* @__PURE__ */ M(he, { children: l && /* @__PURE__ */ M("div", {
|
|
442
443
|
className: "button-edge__label nodrag nopan",
|
|
443
444
|
style: { transform: `translate(-50%, -50%) translate(${d}px,${f}px)` },
|
|
444
|
-
children: /* @__PURE__ */ (
|
|
445
|
+
children: /* @__PURE__ */ M("button", {
|
|
445
446
|
type: "button",
|
|
446
447
|
className: "button-edge__button",
|
|
447
448
|
onClick: () => {
|
|
@@ -452,7 +453,7 @@ var Ft = {
|
|
|
452
453
|
})
|
|
453
454
|
}) })] });
|
|
454
455
|
})
|
|
455
|
-
},
|
|
456
|
+
}, K = {
|
|
456
457
|
address: "address",
|
|
457
458
|
autocomplete: "autocomplete",
|
|
458
459
|
checkbox: "checkbox",
|
|
@@ -471,15 +472,15 @@ var Ft = {
|
|
|
471
472
|
textarea: "textarea",
|
|
472
473
|
time: "time",
|
|
473
474
|
timerange: "timerange"
|
|
474
|
-
}, It = { [
|
|
475
|
-
let { setNodes: e, setEdges: t, getNodes: n } =
|
|
475
|
+
}, It = { [a.input]: { type: K.text } }, q = () => {
|
|
476
|
+
let { setNodes: e, setEdges: t, getNodes: n } = De(), r = L(() => {
|
|
476
477
|
e((e) => e.map(({ selected: e, ...t }) => t)), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
477
|
-
}, [t, e]), i =
|
|
478
|
+
}, [t, e]), i = L((n) => {
|
|
478
479
|
e((e) => e.map((e) => ({
|
|
479
480
|
...e,
|
|
480
481
|
selected: e.id === n
|
|
481
482
|
}))), t((e) => e.map(({ selected: e, ...t }) => t));
|
|
482
|
-
}, [t, e]), a =
|
|
483
|
+
}, [t, e]), a = L((t, n) => {
|
|
483
484
|
e((e) => e.map((e) => e.id === t ? {
|
|
484
485
|
...e,
|
|
485
486
|
data: {
|
|
@@ -487,25 +488,25 @@ var Ft = {
|
|
|
487
488
|
...n
|
|
488
489
|
}
|
|
489
490
|
} : e));
|
|
490
|
-
}, [e]), o =
|
|
491
|
+
}, [e]), o = L((t, n) => {
|
|
491
492
|
e((e) => e.map((e) => e.id === t ? {
|
|
492
493
|
...e,
|
|
493
494
|
data: It[n] ?? {},
|
|
494
495
|
type: n
|
|
495
496
|
} : e));
|
|
496
|
-
}, [e]), s =
|
|
497
|
+
}, [e]), s = L((e) => {
|
|
497
498
|
let t = n().find((e) => e.selected);
|
|
498
499
|
t && o(t.id, e);
|
|
499
|
-
}, [n, o]), c =
|
|
500
|
+
}, [n, o]), c = L((e) => {
|
|
500
501
|
let t = n().find((e) => e.selected);
|
|
501
502
|
t && a(t.id, e);
|
|
502
|
-
}, [n, a]), l =
|
|
503
|
+
}, [n, a]), l = L((n) => {
|
|
503
504
|
e((e) => e.filter((e) => e.id !== n)), t((e) => e.filter((e) => e.source !== n && e.target !== n));
|
|
504
505
|
}, [e, t]);
|
|
505
506
|
return {
|
|
506
507
|
clearSelection: r,
|
|
507
508
|
deleteNode: l,
|
|
508
|
-
deleteSelectedNode:
|
|
509
|
+
deleteSelectedNode: L(() => {
|
|
509
510
|
let e = n().find((e) => e.selected);
|
|
510
511
|
e && l(e.id);
|
|
511
512
|
}, [n, l]),
|
|
@@ -516,13 +517,13 @@ var Ft = {
|
|
|
516
517
|
updateSelectedNodeType: s
|
|
517
518
|
};
|
|
518
519
|
}, Lt = ({ nodeId: e, label: t, placeholder: n, className: r }) => {
|
|
519
|
-
let { language: i } =
|
|
520
|
+
let { language: i } = W(), { updateNodeData: a } = q(), o = G(), s = t?.[i] ?? "", c = n || o("editor.treegeNode.labelPlaceholder"), l = (n) => {
|
|
520
521
|
a(e, { label: {
|
|
521
522
|
...t,
|
|
522
523
|
[i]: n.target.value
|
|
523
524
|
} });
|
|
524
525
|
}, u = (e) => e.stopPropagation();
|
|
525
|
-
return /* @__PURE__ */ (
|
|
526
|
+
return /* @__PURE__ */ M("input", {
|
|
526
527
|
type: "text",
|
|
527
528
|
value: s,
|
|
528
529
|
placeholder: c,
|
|
@@ -530,171 +531,171 @@ var Ft = {
|
|
|
530
531
|
onClick: u,
|
|
531
532
|
onMouseDown: u,
|
|
532
533
|
onPointerDown: u,
|
|
533
|
-
className:
|
|
534
|
+
className: d("nodrag nopan w-full truncate bg-transparent outline-none placeholder:text-muted-foreground/40", r)
|
|
534
535
|
});
|
|
535
536
|
};
|
|
536
537
|
//#endregion
|
|
537
538
|
//#region src/shared/components/ui/alert-dialog.tsx
|
|
538
539
|
function Rt({ ...e }) {
|
|
539
|
-
return /* @__PURE__ */ (
|
|
540
|
+
return /* @__PURE__ */ M(B.Root, {
|
|
540
541
|
"data-slot": "alert-dialog",
|
|
541
542
|
...e
|
|
542
543
|
});
|
|
543
544
|
}
|
|
544
545
|
function zt({ ...e }) {
|
|
545
|
-
return /* @__PURE__ */ (
|
|
546
|
+
return /* @__PURE__ */ M(B.Trigger, {
|
|
546
547
|
"data-slot": "alert-dialog-trigger",
|
|
547
548
|
...e
|
|
548
549
|
});
|
|
549
550
|
}
|
|
550
551
|
function Bt({ ...e }) {
|
|
551
|
-
return /* @__PURE__ */ (
|
|
552
|
+
return /* @__PURE__ */ M(B.Portal, {
|
|
552
553
|
"data-slot": "alert-dialog-portal",
|
|
553
554
|
...e
|
|
554
555
|
});
|
|
555
556
|
}
|
|
556
557
|
function Vt({ className: e, ...t }) {
|
|
557
|
-
return /* @__PURE__ */ (
|
|
558
|
+
return /* @__PURE__ */ M(B.Overlay, {
|
|
558
559
|
"data-slot": "alert-dialog-overlay",
|
|
559
|
-
className:
|
|
560
|
+
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),
|
|
560
561
|
...t
|
|
561
562
|
});
|
|
562
563
|
}
|
|
563
564
|
function Ht({ className: e, ...t }) {
|
|
564
|
-
return /* @__PURE__ */ (
|
|
565
|
+
return /* @__PURE__ */ N(Bt, { children: [/* @__PURE__ */ M(Vt, {}), /* @__PURE__ */ M(B.Content, {
|
|
565
566
|
"data-slot": "alert-dialog-content",
|
|
566
|
-
className:
|
|
567
|
+
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),
|
|
567
568
|
...t
|
|
568
569
|
})] });
|
|
569
570
|
}
|
|
570
571
|
function Ut({ className: e, ...t }) {
|
|
571
|
-
return /* @__PURE__ */ (
|
|
572
|
+
return /* @__PURE__ */ M("div", {
|
|
572
573
|
"data-slot": "alert-dialog-header",
|
|
573
|
-
className:
|
|
574
|
+
className: d("flex flex-col gap-2 text-center sm:text-left", e),
|
|
574
575
|
...t
|
|
575
576
|
});
|
|
576
577
|
}
|
|
577
578
|
function Wt({ className: e, ...t }) {
|
|
578
|
-
return /* @__PURE__ */ (
|
|
579
|
+
return /* @__PURE__ */ M("div", {
|
|
579
580
|
"data-slot": "alert-dialog-footer",
|
|
580
|
-
className:
|
|
581
|
+
className: d("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
581
582
|
...t
|
|
582
583
|
});
|
|
583
584
|
}
|
|
584
585
|
function Gt({ className: e, ...t }) {
|
|
585
|
-
return /* @__PURE__ */ (
|
|
586
|
+
return /* @__PURE__ */ M(B.Title, {
|
|
586
587
|
"data-slot": "alert-dialog-title",
|
|
587
|
-
className:
|
|
588
|
+
className: d("font-semibold text-lg", e),
|
|
588
589
|
...t
|
|
589
590
|
});
|
|
590
591
|
}
|
|
591
592
|
function Kt({ className: e, ...t }) {
|
|
592
|
-
return /* @__PURE__ */ (
|
|
593
|
+
return /* @__PURE__ */ M(B.Description, {
|
|
593
594
|
"data-slot": "alert-dialog-description",
|
|
594
|
-
className:
|
|
595
|
+
className: d("text-muted-foreground text-sm", e),
|
|
595
596
|
...t
|
|
596
597
|
});
|
|
597
598
|
}
|
|
598
599
|
function qt({ className: e, ...t }) {
|
|
599
|
-
return /* @__PURE__ */ (
|
|
600
|
-
className:
|
|
600
|
+
return /* @__PURE__ */ M(B.Action, {
|
|
601
|
+
className: d(h(), e),
|
|
601
602
|
...t
|
|
602
603
|
});
|
|
603
604
|
}
|
|
604
605
|
function Jt({ className: e, ...t }) {
|
|
605
|
-
return /* @__PURE__ */ (
|
|
606
|
-
className:
|
|
606
|
+
return /* @__PURE__ */ M(B.Cancel, {
|
|
607
|
+
className: d(h({ variant: "outline" }), e),
|
|
607
608
|
...t
|
|
608
609
|
});
|
|
609
610
|
}
|
|
610
611
|
//#endregion
|
|
611
612
|
//#region src/shared/components/ui/dropdown-menu.tsx
|
|
612
|
-
function
|
|
613
|
-
return /* @__PURE__ */ (
|
|
613
|
+
function J({ ...e }) {
|
|
614
|
+
return /* @__PURE__ */ M(V.Root, {
|
|
614
615
|
"data-slot": "dropdown-menu",
|
|
615
616
|
...e
|
|
616
617
|
});
|
|
617
618
|
}
|
|
618
|
-
function
|
|
619
|
-
return /* @__PURE__ */ (
|
|
619
|
+
function Y({ ...e }) {
|
|
620
|
+
return /* @__PURE__ */ M(V.Trigger, {
|
|
620
621
|
"data-slot": "dropdown-menu-trigger",
|
|
621
622
|
...e
|
|
622
623
|
});
|
|
623
624
|
}
|
|
624
|
-
function
|
|
625
|
-
return /* @__PURE__ */ (
|
|
625
|
+
function X({ className: e, sideOffset: t = 4, ...n }) {
|
|
626
|
+
return /* @__PURE__ */ M(V.Portal, { children: /* @__PURE__ */ M(V.Content, {
|
|
626
627
|
"data-slot": "dropdown-menu-content",
|
|
627
628
|
sideOffset: t,
|
|
628
|
-
className:
|
|
629
|
+
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),
|
|
629
630
|
...n
|
|
630
631
|
}) });
|
|
631
632
|
}
|
|
632
633
|
function Yt({ ...e }) {
|
|
633
|
-
return /* @__PURE__ */ (
|
|
634
|
+
return /* @__PURE__ */ M(V.Group, {
|
|
634
635
|
"data-slot": "dropdown-menu-group",
|
|
635
636
|
...e
|
|
636
637
|
});
|
|
637
638
|
}
|
|
638
|
-
function
|
|
639
|
-
return /* @__PURE__ */ (
|
|
639
|
+
function Z({ className: e, inset: t, variant: n = "default", ...r }) {
|
|
640
|
+
return /* @__PURE__ */ M(V.Item, {
|
|
640
641
|
"data-slot": "dropdown-menu-item",
|
|
641
642
|
"data-inset": t,
|
|
642
643
|
"data-variant": n,
|
|
643
|
-
className:
|
|
644
|
+
className: d("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0", e),
|
|
644
645
|
...r
|
|
645
646
|
});
|
|
646
647
|
}
|
|
647
648
|
function Xt({ className: e, inset: t, ...n }) {
|
|
648
|
-
return /* @__PURE__ */ (
|
|
649
|
+
return /* @__PURE__ */ M(V.Label, {
|
|
649
650
|
"data-slot": "dropdown-menu-label",
|
|
650
651
|
"data-inset": t,
|
|
651
|
-
className:
|
|
652
|
+
className: d("px-1.5 py-1 font-medium text-muted-foreground text-xs data-[inset]:pl-7", e),
|
|
652
653
|
...n
|
|
653
654
|
});
|
|
654
655
|
}
|
|
655
656
|
function Zt({ className: e, ...t }) {
|
|
656
|
-
return /* @__PURE__ */ (
|
|
657
|
+
return /* @__PURE__ */ M(V.Separator, {
|
|
657
658
|
"data-slot": "dropdown-menu-separator",
|
|
658
|
-
className:
|
|
659
|
+
className: d("-mx-1 my-1 h-px bg-border", e),
|
|
659
660
|
...t
|
|
660
661
|
});
|
|
661
662
|
}
|
|
662
663
|
//#endregion
|
|
663
664
|
//#region src/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.tsx
|
|
664
665
|
var Qt = ({ nodeId: e, className: t }) => {
|
|
665
|
-
let { deleteNode: n, selectNode: r } =
|
|
666
|
-
return /* @__PURE__ */ (
|
|
666
|
+
let { deleteNode: n, selectNode: r } = q(), { setIsNodeSheetOpen: i } = W(), a = G(), [o, s] = z(!1), c = (e) => e.stopPropagation();
|
|
667
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N(J, { children: [/* @__PURE__ */ M(Y, {
|
|
667
668
|
asChild: !0,
|
|
668
669
|
onClick: c,
|
|
669
|
-
children: /* @__PURE__ */ (
|
|
670
|
+
children: /* @__PURE__ */ M("button", {
|
|
670
671
|
type: "button",
|
|
671
672
|
"aria-label": a("editor.nodeActionsSheet.editNode"),
|
|
672
|
-
className:
|
|
673
|
-
children: /* @__PURE__ */ (
|
|
673
|
+
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),
|
|
674
|
+
children: /* @__PURE__ */ M(et, { className: "h-3.5 w-3.5" })
|
|
674
675
|
})
|
|
675
|
-
}), /* @__PURE__ */ (
|
|
676
|
+
}), /* @__PURE__ */ N(X, {
|
|
676
677
|
align: "end",
|
|
677
678
|
onClick: c,
|
|
678
679
|
children: [
|
|
679
|
-
/* @__PURE__ */ (
|
|
680
|
+
/* @__PURE__ */ N(Z, {
|
|
680
681
|
onClick: () => {
|
|
681
682
|
r(e), i(!0);
|
|
682
683
|
},
|
|
683
|
-
children: [/* @__PURE__ */ (
|
|
684
|
+
children: [/* @__PURE__ */ M(st, {}), a("common.settings")]
|
|
684
685
|
}),
|
|
685
|
-
/* @__PURE__ */ (
|
|
686
|
-
/* @__PURE__ */ (
|
|
686
|
+
/* @__PURE__ */ M(Zt, {}),
|
|
687
|
+
/* @__PURE__ */ N(Z, {
|
|
687
688
|
variant: "destructive",
|
|
688
689
|
onClick: () => s(!0),
|
|
689
|
-
children: [/* @__PURE__ */ (
|
|
690
|
+
children: [/* @__PURE__ */ M(lt, {}), a("common.delete")]
|
|
690
691
|
})
|
|
691
692
|
]
|
|
692
|
-
})] }), /* @__PURE__ */ (
|
|
693
|
+
})] }), /* @__PURE__ */ M(Rt, {
|
|
693
694
|
open: o,
|
|
694
695
|
onOpenChange: s,
|
|
695
|
-
children: /* @__PURE__ */ (
|
|
696
|
+
children: /* @__PURE__ */ N(Ht, {
|
|
696
697
|
onClick: c,
|
|
697
|
-
children: [/* @__PURE__ */ (
|
|
698
|
+
children: [/* @__PURE__ */ N(Ut, { children: [/* @__PURE__ */ M(Gt, { children: a("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ M(Kt, { children: a("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ N(Wt, { children: [/* @__PURE__ */ M(Jt, { children: a("common.cancel") }), /* @__PURE__ */ M(qt, {
|
|
698
699
|
onClick: () => {
|
|
699
700
|
n(e), s(!1);
|
|
700
701
|
},
|
|
@@ -702,7 +703,7 @@ var Qt = ({ nodeId: e, className: t }) => {
|
|
|
702
703
|
})] })]
|
|
703
704
|
})
|
|
704
705
|
})] });
|
|
705
|
-
}, $t =
|
|
706
|
+
}, $t = St("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", {
|
|
706
707
|
defaultVariants: { variant: "default" },
|
|
707
708
|
variants: { variant: {
|
|
708
709
|
blue: "bg-blue-500 text-white dark:bg-blue-600",
|
|
@@ -714,26 +715,26 @@ var Qt = ({ nodeId: e, className: t }) => {
|
|
|
714
715
|
} }
|
|
715
716
|
});
|
|
716
717
|
function en({ className: e, variant: t, asChild: n = !1, ...r }) {
|
|
717
|
-
return /* @__PURE__ */ (
|
|
718
|
+
return /* @__PURE__ */ M(n ? xt : "span", {
|
|
718
719
|
"data-slot": "badge",
|
|
719
|
-
className:
|
|
720
|
+
className: d($t({ variant: t }), e),
|
|
720
721
|
...r
|
|
721
722
|
});
|
|
722
723
|
}
|
|
723
|
-
var tn =
|
|
724
|
-
/* @__PURE__ */ (
|
|
725
|
-
/* @__PURE__ */ (
|
|
724
|
+
var tn = gt(({ data: e, id: t }) => /* @__PURE__ */ N(j, { children: [
|
|
725
|
+
/* @__PURE__ */ M(ve, {}),
|
|
726
|
+
/* @__PURE__ */ M("div", {
|
|
726
727
|
className: "-top-3.5 absolute left-6",
|
|
727
|
-
children: /* @__PURE__ */ (
|
|
728
|
+
children: /* @__PURE__ */ N(en, {
|
|
728
729
|
className: "max-w-50 bg-chart-2",
|
|
729
|
-
children: [/* @__PURE__ */ (
|
|
730
|
+
children: [/* @__PURE__ */ M(Ae, { className: "!w-3 !h-3" }), /* @__PURE__ */ M(Lt, {
|
|
730
731
|
nodeId: t,
|
|
731
732
|
label: e?.label,
|
|
732
733
|
className: "min-w-0 flex-1 text-xs text-white placeholder:text-white/60"
|
|
733
734
|
})]
|
|
734
735
|
})
|
|
735
736
|
}),
|
|
736
|
-
/* @__PURE__ */ (
|
|
737
|
+
/* @__PURE__ */ M(Qt, { nodeId: t })
|
|
737
738
|
] })), nn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", rn = (e = 21) => {
|
|
738
739
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
739
740
|
for (; e--;) t += nn[n[e] & 63];
|
|
@@ -747,8 +748,8 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
747
748
|
},
|
|
748
749
|
type: "input"
|
|
749
750
|
}, on = () => {
|
|
750
|
-
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } =
|
|
751
|
-
let
|
|
751
|
+
let { setNodes: e, setEdges: t, screenToFlowPosition: n, getNode: r, getNodes: i, getEdges: a } = De(), o = L((n, r, i = !1, o) => {
|
|
752
|
+
let c = n.id, l = a().filter((e) => e.source === c), u = s(n);
|
|
752
753
|
if (l.length > 0 && !u) return;
|
|
753
754
|
let d = rn(), f = {
|
|
754
755
|
...an,
|
|
@@ -761,23 +762,23 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
761
762
|
selected: i
|
|
762
763
|
};
|
|
763
764
|
n?.parentId && (f.parentId = n.parentId, f.extent = "parent"), e((e) => e.concat(f)), t((e) => {
|
|
764
|
-
let t = e.filter((e) => e.source ===
|
|
765
|
+
let t = e.filter((e) => e.source === c).length > 0, n = {
|
|
765
766
|
data: t && u ? { conditions: [{
|
|
766
|
-
field:
|
|
767
|
+
field: c,
|
|
767
768
|
operator: "===",
|
|
768
769
|
value: ""
|
|
769
770
|
}] } : void 0,
|
|
770
771
|
id: rn(),
|
|
771
|
-
source:
|
|
772
|
+
source: c,
|
|
772
773
|
target: d,
|
|
773
774
|
type: t && u ? "conditional" : "default"
|
|
774
775
|
};
|
|
775
|
-
return t && u ? e.map((e) => e.source ===
|
|
776
|
+
return t && u ? e.map((e) => e.source === c ? {
|
|
776
777
|
...e,
|
|
777
778
|
data: {
|
|
778
779
|
...e.data,
|
|
779
780
|
conditions: e.data?.conditions || [{
|
|
780
|
-
field:
|
|
781
|
+
field: c,
|
|
781
782
|
operator: "===",
|
|
782
783
|
value: ""
|
|
783
784
|
}]
|
|
@@ -795,10 +796,10 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
795
796
|
a,
|
|
796
797
|
e,
|
|
797
798
|
t
|
|
798
|
-
]),
|
|
799
|
+
]), c = L((e) => {
|
|
799
800
|
t((t) => {
|
|
800
801
|
let n = Ce(e, t), i = e.source, a = r(i);
|
|
801
|
-
return n.filter((e) => e.source === i).length > 1 && a &&
|
|
802
|
+
return n.filter((e) => e.source === i).length > 1 && a && s(a) ? n.map((e) => e.source === i ? {
|
|
802
803
|
...e,
|
|
803
804
|
data: {
|
|
804
805
|
...e.data,
|
|
@@ -811,7 +812,7 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
811
812
|
type: "conditional"
|
|
812
813
|
} : e) : n;
|
|
813
814
|
});
|
|
814
|
-
}, [t, r]), l =
|
|
815
|
+
}, [t, r]), l = L((e, t) => {
|
|
815
816
|
let n = r(e);
|
|
816
817
|
if (!n) return;
|
|
817
818
|
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));
|
|
@@ -824,7 +825,7 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
824
825
|
i,
|
|
825
826
|
a,
|
|
826
827
|
o
|
|
827
|
-
]), u =
|
|
828
|
+
]), u = L((e, t) => {
|
|
828
829
|
if (!t.isValid) {
|
|
829
830
|
let { clientX: i, clientY: a } = "changedTouches" in e ? e.changedTouches[0] : e, s = t.fromNode;
|
|
830
831
|
if (!s) return;
|
|
@@ -844,7 +845,7 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
844
845
|
o,
|
|
845
846
|
r,
|
|
846
847
|
n
|
|
847
|
-
]), d =
|
|
848
|
+
]), d = L((e) => {
|
|
848
849
|
t((t) => {
|
|
849
850
|
let n = t.filter((t) => !e.find((e) => e.id === t.id)), r = new Set(e.map((e) => e.source)), i = /* @__PURE__ */ new Map();
|
|
850
851
|
return n.forEach((e) => {
|
|
@@ -863,183 +864,183 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
863
864
|
});
|
|
864
865
|
}, [t]);
|
|
865
866
|
return {
|
|
866
|
-
isValidConnection:
|
|
867
|
+
isValidConnection: L((e) => {
|
|
867
868
|
if (e.source === e.target) return !1;
|
|
868
869
|
let t = r(e.source);
|
|
869
|
-
return t ? !(a().filter((t) => t.source === e.source).length > 0 && !
|
|
870
|
+
return t ? !(a().filter((t) => t.source === e.source).length > 0 && !s(t)) : !1;
|
|
870
871
|
}, [r, a]),
|
|
871
872
|
onAddFromHandle: l,
|
|
872
|
-
onConnect:
|
|
873
|
+
onConnect: c,
|
|
873
874
|
onConnectEnd: u,
|
|
874
875
|
onEdgesDelete: d
|
|
875
876
|
};
|
|
876
|
-
},
|
|
877
|
+
}, sn = {
|
|
877
878
|
divider: "divider",
|
|
878
879
|
title: "title"
|
|
879
|
-
},
|
|
880
|
-
let { onAddFromHandle: n } = on(), r =
|
|
881
|
-
return /* @__PURE__ */ (
|
|
880
|
+
}, cn = ({ nodeId: e, isConnectable: t }) => {
|
|
881
|
+
let { onAddFromHandle: n } = on(), r = G(), [i, o] = z(!1);
|
|
882
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(ge, {
|
|
882
883
|
type: "source",
|
|
883
884
|
position: be.Bottom,
|
|
884
885
|
isConnectable: t,
|
|
885
886
|
onClick: (e) => {
|
|
886
|
-
e.defaultPrevented ||
|
|
887
|
+
e.defaultPrevented || o(!0);
|
|
887
888
|
},
|
|
888
889
|
className: "flex h-6! w-6! cursor-pointer items-center justify-center rounded-sm transition-colors hover:bg-primary/80!",
|
|
889
|
-
children: /* @__PURE__ */ (
|
|
890
|
-
}), /* @__PURE__ */ (
|
|
890
|
+
children: /* @__PURE__ */ M(F, { className: "h-4 w-4 text-primary-foreground" })
|
|
891
|
+
}), /* @__PURE__ */ N(J, {
|
|
891
892
|
open: i,
|
|
892
|
-
onOpenChange:
|
|
893
|
-
children: [/* @__PURE__ */ (
|
|
893
|
+
onOpenChange: o,
|
|
894
|
+
children: [/* @__PURE__ */ M(Y, {
|
|
894
895
|
asChild: !0,
|
|
895
|
-
children: /* @__PURE__ */ (
|
|
896
|
+
children: /* @__PURE__ */ M("span", {
|
|
896
897
|
"aria-hidden": !0,
|
|
897
898
|
className: "-translate-x-1/2 pointer-events-none absolute bottom-0 left-1/2 h-0 w-0"
|
|
898
899
|
})
|
|
899
|
-
}), /* @__PURE__ */ (
|
|
900
|
+
}), /* @__PURE__ */ N(X, {
|
|
900
901
|
align: "center",
|
|
901
902
|
side: "bottom",
|
|
902
903
|
className: "treege-scrollbar max-h-80",
|
|
903
904
|
children: [
|
|
904
|
-
/* @__PURE__ */ (
|
|
905
|
+
/* @__PURE__ */ N(Yt, { children: [/* @__PURE__ */ M(Xt, { children: r("editor.selectNodeType.options.input") }), Object.values(K).map((t) => /* @__PURE__ */ M(Z, {
|
|
905
906
|
onClick: () => n(e, {
|
|
906
907
|
data: { type: t },
|
|
907
|
-
type:
|
|
908
|
+
type: a.input
|
|
908
909
|
}),
|
|
909
910
|
className: "capitalize",
|
|
910
911
|
children: t
|
|
911
912
|
}, t))] }),
|
|
912
|
-
/* @__PURE__ */ (
|
|
913
|
-
/* @__PURE__ */ (
|
|
913
|
+
/* @__PURE__ */ M(Zt, {}),
|
|
914
|
+
/* @__PURE__ */ N(Yt, { children: [/* @__PURE__ */ M(Xt, { children: r("editor.selectNodeType.options.ui") }), Object.values(sn).map((t) => /* @__PURE__ */ M(Z, {
|
|
914
915
|
onClick: () => n(e, {
|
|
915
916
|
data: { type: t },
|
|
916
|
-
type:
|
|
917
|
+
type: a.ui
|
|
917
918
|
}),
|
|
918
919
|
className: "capitalize",
|
|
919
920
|
children: t
|
|
920
921
|
}, t))] }),
|
|
921
|
-
/* @__PURE__ */ (
|
|
922
|
-
/* @__PURE__ */ (
|
|
922
|
+
/* @__PURE__ */ M(Zt, {}),
|
|
923
|
+
/* @__PURE__ */ N(Yt, { children: [/* @__PURE__ */ M(Xt, { children: r("common.other") }), /* @__PURE__ */ M(Z, {
|
|
923
924
|
onClick: () => n(e, {
|
|
924
925
|
data: {},
|
|
925
|
-
type:
|
|
926
|
+
type: a.flow
|
|
926
927
|
}),
|
|
927
928
|
children: r("editor.selectNodeType.options.flow")
|
|
928
929
|
})] })
|
|
929
930
|
]
|
|
930
931
|
})]
|
|
931
932
|
})] });
|
|
932
|
-
},
|
|
933
|
-
[
|
|
934
|
-
[
|
|
935
|
-
[
|
|
936
|
-
[
|
|
937
|
-
[
|
|
938
|
-
[
|
|
939
|
-
[
|
|
940
|
-
[
|
|
941
|
-
[
|
|
942
|
-
[
|
|
943
|
-
[
|
|
944
|
-
[
|
|
945
|
-
[
|
|
946
|
-
[
|
|
947
|
-
[
|
|
948
|
-
[
|
|
949
|
-
[
|
|
950
|
-
[
|
|
951
|
-
[
|
|
952
|
-
[
|
|
953
|
-
},
|
|
954
|
-
input: Object.values(
|
|
955
|
-
ui: Object.values(
|
|
956
|
-
},
|
|
957
|
-
let { updateNodeData: r } =
|
|
958
|
-
return /* @__PURE__ */ (
|
|
933
|
+
}, ln = {
|
|
934
|
+
[K.address]: Qe,
|
|
935
|
+
[K.autocomplete]: at,
|
|
936
|
+
[K.checkbox]: Fe,
|
|
937
|
+
[K.date]: je,
|
|
938
|
+
[K.daterange]: Me,
|
|
939
|
+
[K.file]: tt,
|
|
940
|
+
[K.hidden]: We,
|
|
941
|
+
[K.http]: Be,
|
|
942
|
+
[K.number]: Ge,
|
|
943
|
+
[K.password]: Je,
|
|
944
|
+
[K.radio]: Re,
|
|
945
|
+
[K.select]: Xe,
|
|
946
|
+
[K.submit]: ot,
|
|
947
|
+
[K.switch]: ct,
|
|
948
|
+
[K.text]: Ne,
|
|
949
|
+
[K.textarea]: Oe,
|
|
950
|
+
[K.time]: ze,
|
|
951
|
+
[K.timerange]: ze,
|
|
952
|
+
[sn.divider]: $e,
|
|
953
|
+
[sn.title]: Ke
|
|
954
|
+
}, un = rt, dn = (e) => e && ln[e] || un, fn = {
|
|
955
|
+
input: Object.values(K),
|
|
956
|
+
ui: Object.values(sn)
|
|
957
|
+
}, pn = ({ nodeId: e, type: t, inputType: n }) => {
|
|
958
|
+
let { updateNodeData: r } = q(), i = G(), a = fn[t], o = (e) => e.stopPropagation();
|
|
959
|
+
return /* @__PURE__ */ N(J, { children: [/* @__PURE__ */ M(Y, {
|
|
959
960
|
asChild: !0,
|
|
960
961
|
onClick: o,
|
|
961
|
-
children: /* @__PURE__ */ (
|
|
962
|
+
children: /* @__PURE__ */ N(en, {
|
|
962
963
|
variant: "default",
|
|
963
964
|
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
964
965
|
children: [
|
|
965
|
-
/* @__PURE__ */ (
|
|
966
|
+
/* @__PURE__ */ M(dn(n), { className: "mt-0.5" }),
|
|
966
967
|
n || i("editor.selectInputType.type"),
|
|
967
|
-
/* @__PURE__ */ (
|
|
968
|
+
/* @__PURE__ */ M(Ie, {})
|
|
968
969
|
]
|
|
969
970
|
})
|
|
970
|
-
}), /* @__PURE__ */ (
|
|
971
|
+
}), /* @__PURE__ */ M(X, {
|
|
971
972
|
align: "start",
|
|
972
973
|
className: "treege-scrollbar max-h-60",
|
|
973
974
|
onClick: o,
|
|
974
975
|
children: a.map((t) => {
|
|
975
|
-
let i =
|
|
976
|
-
return /* @__PURE__ */ (
|
|
976
|
+
let i = dn(t);
|
|
977
|
+
return /* @__PURE__ */ N(Z, {
|
|
977
978
|
onClick: () => r(e, { type: t }),
|
|
978
|
-
className:
|
|
979
|
-
children: [/* @__PURE__ */ (
|
|
979
|
+
className: d("capitalize", t === n && "bg-accent"),
|
|
980
|
+
children: [/* @__PURE__ */ M(i, {}), t]
|
|
980
981
|
}, t);
|
|
981
982
|
})
|
|
982
983
|
})] });
|
|
983
|
-
},
|
|
984
|
+
}, mn = [
|
|
984
985
|
"radio",
|
|
985
986
|
"select",
|
|
986
987
|
"checkbox",
|
|
987
988
|
"autocomplete"
|
|
988
|
-
],
|
|
989
|
-
let [n, r] =
|
|
990
|
-
if (!(
|
|
991
|
-
let g = t.options ?? [],
|
|
989
|
+
], hn = ({ nodeId: e, data: t }) => {
|
|
990
|
+
let [n, r] = z(!1), [i, a] = z(""), [o, s] = z(""), { updateNodeData: c } = q(), { language: d } = W(), f = G(), h = t && "type" in t ? t.type : void 0;
|
|
991
|
+
if (!(h && mn.includes(h))) return null;
|
|
992
|
+
let g = t.options ?? [], v = () => {
|
|
992
993
|
a(""), s("");
|
|
993
994
|
}, y = (t) => {
|
|
994
995
|
t?.preventDefault();
|
|
995
996
|
let n = i.trim(), a = o.trim() || n;
|
|
996
997
|
if (!(n || a)) return;
|
|
997
998
|
let s = {
|
|
998
|
-
label: { [
|
|
999
|
+
label: { [d]: n },
|
|
999
1000
|
value: a
|
|
1000
1001
|
};
|
|
1001
|
-
c(e, { options: [...g, s] }),
|
|
1002
|
+
c(e, { options: [...g, s] }), v(), r(!1);
|
|
1002
1003
|
}, b = (e) => {
|
|
1003
|
-
r(e), e ||
|
|
1004
|
+
r(e), e || v();
|
|
1004
1005
|
}, x = (e) => {
|
|
1005
1006
|
e.key === "Enter" && (e.preventDefault(), y());
|
|
1006
1007
|
}, S = (e) => e.stopPropagation();
|
|
1007
|
-
return /* @__PURE__ */ (
|
|
1008
|
+
return /* @__PURE__ */ N("div", {
|
|
1008
1009
|
className: "nodrag nopan my-1 flex flex-col gap-0.5",
|
|
1009
1010
|
children: [g.map((e, t) => {
|
|
1010
1011
|
let n = f(e.label) || e.value || "—", r = `${e.value || "opt"}-${t}`;
|
|
1011
|
-
return /* @__PURE__ */ (
|
|
1012
|
+
return /* @__PURE__ */ M("div", {
|
|
1012
1013
|
className: "truncate text-muted-foreground text-xs",
|
|
1013
1014
|
children: n
|
|
1014
1015
|
}, r);
|
|
1015
|
-
}), /* @__PURE__ */ (
|
|
1016
|
+
}), /* @__PURE__ */ N(le, {
|
|
1016
1017
|
open: n,
|
|
1017
1018
|
onOpenChange: b,
|
|
1018
|
-
children: [/* @__PURE__ */ (
|
|
1019
|
+
children: [/* @__PURE__ */ M(u, {
|
|
1019
1020
|
asChild: !0,
|
|
1020
1021
|
onClick: S,
|
|
1021
|
-
children: /* @__PURE__ */ (
|
|
1022
|
+
children: /* @__PURE__ */ N(p, {
|
|
1022
1023
|
type: "button",
|
|
1023
1024
|
variant: "link",
|
|
1024
1025
|
size: "xs",
|
|
1025
1026
|
className: "w-fit p-0!",
|
|
1026
|
-
children: [/* @__PURE__ */ (
|
|
1027
|
+
children: [/* @__PURE__ */ M(F, { className: "size-3" }), f("editor.inputNodeForm.addOption")]
|
|
1027
1028
|
})
|
|
1028
|
-
}), /* @__PURE__ */ (
|
|
1029
|
+
}), /* @__PURE__ */ M(_, {
|
|
1029
1030
|
align: "start",
|
|
1030
1031
|
className: "w-64 p-3",
|
|
1031
1032
|
onClick: S,
|
|
1032
|
-
children: /* @__PURE__ */ (
|
|
1033
|
+
children: /* @__PURE__ */ N("form", {
|
|
1033
1034
|
onSubmit: y,
|
|
1034
1035
|
className: "flex flex-col gap-2",
|
|
1035
1036
|
children: [
|
|
1036
|
-
/* @__PURE__ */ (
|
|
1037
|
+
/* @__PURE__ */ N("div", {
|
|
1037
1038
|
className: "flex flex-col gap-1",
|
|
1038
|
-
children: [/* @__PURE__ */ (
|
|
1039
|
+
children: [/* @__PURE__ */ M(l, {
|
|
1039
1040
|
htmlFor: `${e}-option-label`,
|
|
1040
1041
|
className: "text-xs",
|
|
1041
1042
|
children: f("editor.inputNodeForm.optionLabel")
|
|
1042
|
-
}), /* @__PURE__ */ (
|
|
1043
|
+
}), /* @__PURE__ */ M(m, {
|
|
1043
1044
|
id: `${e}-option-label`,
|
|
1044
1045
|
autoFocus: !0,
|
|
1045
1046
|
value: i,
|
|
@@ -1047,20 +1048,20 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
1047
1048
|
onKeyDown: x
|
|
1048
1049
|
})]
|
|
1049
1050
|
}),
|
|
1050
|
-
/* @__PURE__ */ (
|
|
1051
|
+
/* @__PURE__ */ N("div", {
|
|
1051
1052
|
className: "flex flex-col gap-1",
|
|
1052
|
-
children: [/* @__PURE__ */ (
|
|
1053
|
+
children: [/* @__PURE__ */ M(l, {
|
|
1053
1054
|
htmlFor: `${e}-option-value`,
|
|
1054
1055
|
className: "text-xs",
|
|
1055
1056
|
children: f("editor.inputNodeForm.optionValue")
|
|
1056
|
-
}), /* @__PURE__ */ (
|
|
1057
|
+
}), /* @__PURE__ */ M(m, {
|
|
1057
1058
|
id: `${e}-option-value`,
|
|
1058
1059
|
value: o,
|
|
1059
1060
|
onChange: (e) => s(e.target.value),
|
|
1060
1061
|
onKeyDown: x
|
|
1061
1062
|
})]
|
|
1062
1063
|
}),
|
|
1063
|
-
/* @__PURE__ */ (
|
|
1064
|
+
/* @__PURE__ */ M(p, {
|
|
1064
1065
|
type: "submit",
|
|
1065
1066
|
size: "sm",
|
|
1066
1067
|
disabled: !(i.trim() || o.trim()),
|
|
@@ -1071,13 +1072,13 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
1071
1072
|
})]
|
|
1072
1073
|
})]
|
|
1073
1074
|
});
|
|
1074
|
-
},
|
|
1075
|
-
let { updateNodeData: n } =
|
|
1076
|
-
return /* @__PURE__ */ (
|
|
1075
|
+
}, gn = ({ nodeId: e, required: t }) => {
|
|
1076
|
+
let { updateNodeData: n } = q(), r = G();
|
|
1077
|
+
return /* @__PURE__ */ M(en, {
|
|
1077
1078
|
variant: t ? "destructive" : "outline",
|
|
1078
1079
|
asChild: !0,
|
|
1079
1080
|
className: "nodrag nopan cursor-pointer px-1.5 py-0 text-[10px] capitalize [&>svg]:size-2.5",
|
|
1080
|
-
children: /* @__PURE__ */ (
|
|
1081
|
+
children: /* @__PURE__ */ M("button", {
|
|
1081
1082
|
type: "button",
|
|
1082
1083
|
onClick: (r) => {
|
|
1083
1084
|
r.stopPropagation(), n(e, { required: !t });
|
|
@@ -1085,61 +1086,61 @@ var tn = Oe(({ data: e, id: t }) => /* @__PURE__ */ (0, U.jsxs)(U.Fragment, { ch
|
|
|
1085
1086
|
children: r(t ? "editor.inputNodeForm.required" : "editor.inputNodeForm.optional")
|
|
1086
1087
|
})
|
|
1087
1088
|
});
|
|
1088
|
-
},
|
|
1089
|
-
className:
|
|
1089
|
+
}, _n = ({ children: e, inGroup: t, isSubmit: n }) => /* @__PURE__ */ M("div", {
|
|
1090
|
+
className: d("react-flow__node__wrapper relative", t && "in-group", n && "submit-type"),
|
|
1090
1091
|
children: e
|
|
1091
|
-
}),
|
|
1092
|
+
}), vn = gt(({ data: e, isConnectable: t, parentId: n, type: r, id: i }) => {
|
|
1092
1093
|
let a = r === "input" || r === "ui" ? e?.type : void 0, o = r === "input" && e?.type === "submit", s = r === "input" ? e?.name : void 0;
|
|
1093
|
-
return /* @__PURE__ */ (
|
|
1094
|
+
return /* @__PURE__ */ N(_n, {
|
|
1094
1095
|
inGroup: !!n,
|
|
1095
1096
|
isSubmit: o,
|
|
1096
1097
|
children: [
|
|
1097
|
-
/* @__PURE__ */ (
|
|
1098
|
-
/* @__PURE__ */ (
|
|
1098
|
+
/* @__PURE__ */ M(Qt, { nodeId: i }),
|
|
1099
|
+
/* @__PURE__ */ M(ge, {
|
|
1099
1100
|
type: "target",
|
|
1100
1101
|
position: be.Top,
|
|
1101
1102
|
isConnectable: t,
|
|
1102
1103
|
isConnectableStart: r === "ui"
|
|
1103
1104
|
}),
|
|
1104
|
-
/* @__PURE__ */ (
|
|
1105
|
+
/* @__PURE__ */ M(Lt, {
|
|
1105
1106
|
nodeId: i,
|
|
1106
1107
|
label: e?.label,
|
|
1107
1108
|
placeholder: s,
|
|
1108
|
-
className:
|
|
1109
|
+
className: d("py-1", r === "ui" && "capitalize")
|
|
1109
1110
|
}),
|
|
1110
|
-
/* @__PURE__ */ (
|
|
1111
|
+
/* @__PURE__ */ N("div", {
|
|
1111
1112
|
className: "mb-1 flex gap-1",
|
|
1112
|
-
children: [(r === "input" || r === "ui") && /* @__PURE__ */ (
|
|
1113
|
+
children: [(r === "input" || r === "ui") && /* @__PURE__ */ M(pn, {
|
|
1113
1114
|
nodeId: i,
|
|
1114
1115
|
type: r,
|
|
1115
1116
|
inputType: a
|
|
1116
|
-
}), r === "input" && !o && /* @__PURE__ */ (
|
|
1117
|
+
}), r === "input" && !o && /* @__PURE__ */ M(gn, {
|
|
1117
1118
|
nodeId: i,
|
|
1118
1119
|
required: e?.required
|
|
1119
1120
|
})]
|
|
1120
1121
|
}),
|
|
1121
|
-
r === "input" && /* @__PURE__ */ (
|
|
1122
|
+
r === "input" && /* @__PURE__ */ M(hn, {
|
|
1122
1123
|
nodeId: i,
|
|
1123
1124
|
data: e
|
|
1124
1125
|
}),
|
|
1125
|
-
/* @__PURE__ */ (
|
|
1126
|
+
/* @__PURE__ */ M(cn, {
|
|
1126
1127
|
nodeId: i,
|
|
1127
1128
|
isConnectable: t
|
|
1128
1129
|
})
|
|
1129
1130
|
]
|
|
1130
1131
|
});
|
|
1131
|
-
}),
|
|
1132
|
-
[
|
|
1133
|
-
[
|
|
1134
|
-
[
|
|
1135
|
-
[
|
|
1136
|
-
}, yn = "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", bn = {
|
|
1132
|
+
}), yn = {
|
|
1133
|
+
[a.flow]: vn,
|
|
1134
|
+
[a.group]: tn,
|
|
1135
|
+
[a.input]: vn,
|
|
1136
|
+
[a.ui]: vn
|
|
1137
|
+
}, 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 = {
|
|
1137
1138
|
claude: "claude-3-5-haiku-20241022",
|
|
1138
1139
|
deepseek: "deepseek-chat",
|
|
1139
1140
|
gemini: "gemini-2.5-flash",
|
|
1140
1141
|
openai: "gpt-4o-mini"
|
|
1141
|
-
},
|
|
1142
|
-
function
|
|
1142
|
+
}, Sn = .3;
|
|
1143
|
+
function Cn(e) {
|
|
1143
1144
|
try {
|
|
1144
1145
|
return JSON.parse(e);
|
|
1145
1146
|
} catch (t) {
|
|
@@ -1151,10 +1152,10 @@ function Sn(e) {
|
|
|
1151
1152
|
}
|
|
1152
1153
|
}
|
|
1153
1154
|
}
|
|
1154
|
-
async function
|
|
1155
|
-
let t = e.config.model ||
|
|
1155
|
+
async function wn(e) {
|
|
1156
|
+
let t = e.config.model || xn.gemini, n = e.config.temperature ?? Sn, r = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent?key=${e.config.apiKey}`, {
|
|
1156
1157
|
body: JSON.stringify({
|
|
1157
|
-
contents: [{ parts: [{ text: `${
|
|
1158
|
+
contents: [{ parts: [{ text: `${bn}\n\nUser request: ${e.prompt}` }] }],
|
|
1158
1159
|
generationConfig: {
|
|
1159
1160
|
responseMimeType: "application/json",
|
|
1160
1161
|
temperature: n
|
|
@@ -1169,13 +1170,13 @@ async function Cn(e) {
|
|
|
1169
1170
|
}
|
|
1170
1171
|
let i = (await r.json()).candidates?.[0]?.content?.parts?.[0]?.text;
|
|
1171
1172
|
if (!i) throw Error("No response from Gemini");
|
|
1172
|
-
return
|
|
1173
|
+
return Cn(i);
|
|
1173
1174
|
}
|
|
1174
|
-
async function
|
|
1175
|
-
let t = e.config.model ||
|
|
1175
|
+
async function Tn(e) {
|
|
1176
|
+
let t = e.config.model || xn.openai, n = e.config.temperature ?? Sn, r = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
1176
1177
|
body: JSON.stringify({
|
|
1177
1178
|
messages: [{
|
|
1178
|
-
content:
|
|
1179
|
+
content: bn,
|
|
1179
1180
|
role: "system"
|
|
1180
1181
|
}, {
|
|
1181
1182
|
content: e.prompt,
|
|
@@ -1197,13 +1198,13 @@ async function wn(e) {
|
|
|
1197
1198
|
}
|
|
1198
1199
|
let i = (await r.json()).choices?.[0]?.message?.content;
|
|
1199
1200
|
if (!i) throw Error("No response from OpenAI");
|
|
1200
|
-
return
|
|
1201
|
+
return Cn(i);
|
|
1201
1202
|
}
|
|
1202
|
-
async function
|
|
1203
|
-
let t = e.config.model ||
|
|
1203
|
+
async function En(e) {
|
|
1204
|
+
let t = e.config.model || xn.deepseek, n = e.config.temperature ?? Sn, r = await fetch("https://api.deepseek.com/v1/chat/completions", {
|
|
1204
1205
|
body: JSON.stringify({
|
|
1205
1206
|
messages: [{
|
|
1206
|
-
content:
|
|
1207
|
+
content: bn,
|
|
1207
1208
|
role: "system"
|
|
1208
1209
|
}, {
|
|
1209
1210
|
content: e.prompt,
|
|
@@ -1225,10 +1226,10 @@ async function Tn(e) {
|
|
|
1225
1226
|
}
|
|
1226
1227
|
let i = (await r.json()).choices?.[0]?.message?.content;
|
|
1227
1228
|
if (!i) throw Error("No response from DeepSeek");
|
|
1228
|
-
return
|
|
1229
|
+
return Cn(i);
|
|
1229
1230
|
}
|
|
1230
|
-
async function
|
|
1231
|
-
let t = e.config.model ||
|
|
1231
|
+
async function Dn(e) {
|
|
1232
|
+
let t = e.config.model || xn.claude, n = e.config.temperature ?? Sn, r = await fetch("https://api.anthropic.com/v1/messages", {
|
|
1232
1233
|
body: JSON.stringify({
|
|
1233
1234
|
max_tokens: 4096,
|
|
1234
1235
|
messages: [{
|
|
@@ -1236,7 +1237,7 @@ async function En(e) {
|
|
|
1236
1237
|
role: "user"
|
|
1237
1238
|
}],
|
|
1238
1239
|
model: t,
|
|
1239
|
-
system:
|
|
1240
|
+
system: bn,
|
|
1240
1241
|
temperature: n
|
|
1241
1242
|
}),
|
|
1242
1243
|
headers: {
|
|
@@ -1252,75 +1253,75 @@ async function En(e) {
|
|
|
1252
1253
|
}
|
|
1253
1254
|
let i = (await r.json()).content?.[0]?.text;
|
|
1254
1255
|
if (!i) throw Error("No response from Claude");
|
|
1255
|
-
return
|
|
1256
|
+
return Cn(i);
|
|
1256
1257
|
}
|
|
1257
|
-
function
|
|
1258
|
+
function On(e) {
|
|
1258
1259
|
switch (e.config.provider) {
|
|
1259
|
-
case "gemini": return
|
|
1260
|
-
case "openai": return
|
|
1261
|
-
case "deepseek": return
|
|
1262
|
-
case "claude": return
|
|
1260
|
+
case "gemini": return wn(e);
|
|
1261
|
+
case "openai": return Tn(e);
|
|
1262
|
+
case "deepseek": return En(e);
|
|
1263
|
+
case "claude": return Dn(e);
|
|
1263
1264
|
default: throw Error(`Unsupported AI provider: ${e.config.provider}`);
|
|
1264
1265
|
}
|
|
1265
1266
|
}
|
|
1266
1267
|
//#endregion
|
|
1267
1268
|
//#region src/editor/features/TreegeEditor/panel/AIGeneratorDialog.tsx
|
|
1268
|
-
var
|
|
1269
|
-
let [n, r] =
|
|
1269
|
+
var kn = ({ aiConfig: e, onGenerate: t }) => {
|
|
1270
|
+
let [n, r] = z(!1), [i, a] = z(""), [o, s] = z(!1), c = G(), l = async () => {
|
|
1270
1271
|
if (!i.trim()) {
|
|
1271
|
-
|
|
1272
|
+
H.error(c("editor.aiGenerator.enterDescription"));
|
|
1272
1273
|
return;
|
|
1273
1274
|
}
|
|
1274
1275
|
if (!e?.apiKey) {
|
|
1275
|
-
|
|
1276
|
+
H.error(c("editor.aiGenerator.missingApiKey"), { description: c("editor.aiGenerator.missingApiKeyDesc") });
|
|
1276
1277
|
return;
|
|
1277
1278
|
}
|
|
1278
1279
|
s(!0);
|
|
1279
1280
|
try {
|
|
1280
|
-
let n = await
|
|
1281
|
+
let n = await On({
|
|
1281
1282
|
config: e,
|
|
1282
1283
|
prompt: i.trim()
|
|
1283
1284
|
});
|
|
1284
1285
|
t({
|
|
1285
1286
|
edges: n.edges,
|
|
1286
1287
|
nodes: n.nodes
|
|
1287
|
-
}),
|
|
1288
|
+
}), H.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);
|
|
1288
1289
|
} catch (e) {
|
|
1289
|
-
console.error("AI generation error:", e),
|
|
1290
|
+
console.error("AI generation error:", e), H.error(c("editor.aiGenerator.failedToGenerate"), { description: e instanceof Error ? e.message : c("editor.aiGenerator.unknownError") });
|
|
1290
1291
|
} finally {
|
|
1291
1292
|
s(!1);
|
|
1292
1293
|
}
|
|
1293
1294
|
};
|
|
1294
|
-
return /* @__PURE__ */ (
|
|
1295
|
+
return /* @__PURE__ */ N(ce, {
|
|
1295
1296
|
open: n,
|
|
1296
1297
|
onOpenChange: r,
|
|
1297
|
-
children: [/* @__PURE__ */ (
|
|
1298
|
+
children: [/* @__PURE__ */ M(w, {
|
|
1298
1299
|
asChild: !0,
|
|
1299
|
-
children: /* @__PURE__ */ (
|
|
1300
|
+
children: /* @__PURE__ */ N(p, {
|
|
1300
1301
|
variant: "outline",
|
|
1301
1302
|
size: "sm",
|
|
1302
1303
|
disabled: !e?.apiKey,
|
|
1303
1304
|
children: [
|
|
1304
|
-
/* @__PURE__ */ (
|
|
1305
|
+
/* @__PURE__ */ M(ft, { className: "h-4 w-4 text-[#13d3b4]" }),
|
|
1305
1306
|
" ",
|
|
1306
1307
|
c("editor.aiGenerator.buttonLabel")
|
|
1307
1308
|
]
|
|
1308
1309
|
})
|
|
1309
|
-
}), /* @__PURE__ */ (
|
|
1310
|
+
}), /* @__PURE__ */ N(S, {
|
|
1310
1311
|
className: "sm:max-w-[550px]",
|
|
1311
1312
|
children: [
|
|
1312
|
-
/* @__PURE__ */ (
|
|
1313
|
-
/* @__PURE__ */ (
|
|
1313
|
+
/* @__PURE__ */ N(re, { children: [/* @__PURE__ */ M(ee, { children: c("editor.aiGenerator.title") }), /* @__PURE__ */ M(C, { children: c("editor.aiGenerator.titleDescription") })] }),
|
|
1314
|
+
/* @__PURE__ */ N("div", {
|
|
1314
1315
|
className: "grid gap-4 py-4",
|
|
1315
|
-
children: [/* @__PURE__ */ (
|
|
1316
|
+
children: [/* @__PURE__ */ N("div", {
|
|
1316
1317
|
className: "grid gap-2",
|
|
1317
1318
|
children: [
|
|
1318
|
-
/* @__PURE__ */ (
|
|
1319
|
+
/* @__PURE__ */ M("label", {
|
|
1319
1320
|
htmlFor: "ai-prompt",
|
|
1320
1321
|
className: "font-medium text-sm",
|
|
1321
1322
|
children: c("editor.aiGenerator.description")
|
|
1322
1323
|
}),
|
|
1323
|
-
/* @__PURE__ */ (
|
|
1324
|
+
/* @__PURE__ */ M(ne, {
|
|
1324
1325
|
placeholder: c("editor.aiGenerator.descriptionPlaceholder"),
|
|
1325
1326
|
value: i,
|
|
1326
1327
|
onChange: (e) => a(e.target.value),
|
|
@@ -1331,22 +1332,22 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1331
1332
|
disabled: o,
|
|
1332
1333
|
className: "resize-none"
|
|
1333
1334
|
}),
|
|
1334
|
-
/* @__PURE__ */ (
|
|
1335
|
+
/* @__PURE__ */ M("p", {
|
|
1335
1336
|
className: "text-muted-foreground text-xs",
|
|
1336
1337
|
children: c("editor.aiGenerator.keyboardShortcut").replace("{cmdEnter}", "⌘ Enter").replace("{ctrlEnter}", "Ctrl Enter")
|
|
1337
1338
|
})
|
|
1338
1339
|
]
|
|
1339
|
-
}), !e?.apiKey && /* @__PURE__ */ (
|
|
1340
|
+
}), !e?.apiKey && /* @__PURE__ */ N("div", {
|
|
1340
1341
|
className: "rounded-md bg-muted p-3 text-sm",
|
|
1341
|
-
children: [/* @__PURE__ */ (
|
|
1342
|
+
children: [/* @__PURE__ */ M("p", {
|
|
1342
1343
|
className: "font-medium",
|
|
1343
1344
|
children: c("editor.aiGenerator.aiNotConfigured")
|
|
1344
|
-
}), /* @__PURE__ */ (
|
|
1345
|
+
}), /* @__PURE__ */ N("p", {
|
|
1345
1346
|
className: "mt-1 text-muted-foreground text-xs",
|
|
1346
1347
|
children: [
|
|
1347
1348
|
c("editor.aiGenerator.aiNotConfiguredDesc").replace("{code}", ""),
|
|
1348
1349
|
" ",
|
|
1349
|
-
/* @__PURE__ */ (
|
|
1350
|
+
/* @__PURE__ */ M("code", {
|
|
1350
1351
|
className: "rounded bg-background px-1 py-0.5",
|
|
1351
1352
|
children: "aiConfig"
|
|
1352
1353
|
})
|
|
@@ -1354,21 +1355,21 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1354
1355
|
})]
|
|
1355
1356
|
})]
|
|
1356
1357
|
}),
|
|
1357
|
-
/* @__PURE__ */ (
|
|
1358
|
+
/* @__PURE__ */ N(ae, { children: [/* @__PURE__ */ M(p, {
|
|
1358
1359
|
variant: "outline",
|
|
1359
1360
|
onClick: () => r(!1),
|
|
1360
1361
|
disabled: o,
|
|
1361
1362
|
children: c("editor.aiGenerator.cancel")
|
|
1362
|
-
}), /* @__PURE__ */ (
|
|
1363
|
+
}), /* @__PURE__ */ M(p, {
|
|
1363
1364
|
onClick: l,
|
|
1364
1365
|
disabled: o || !i.trim() || !e?.apiKey,
|
|
1365
|
-
children: o ? /* @__PURE__ */ (
|
|
1366
|
+
children: o ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(Ze, { className: "h-4 w-4 animate-spin" }), c("editor.aiGenerator.generating")] }) : /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(ft, { className: "h-4 w-4 text-[--treege-color-primary]" }), c("editor.aiGenerator.generate")] })
|
|
1366
1367
|
})] })
|
|
1367
1368
|
]
|
|
1368
1369
|
})]
|
|
1369
1370
|
});
|
|
1370
|
-
},
|
|
1371
|
-
let { flowId: n, setFlowId: r, aiConfig: i } =
|
|
1371
|
+
}, An = rn(), jn = ({ onExportJson: e, onSave: t }) => {
|
|
1372
|
+
let { flowId: n, setFlowId: r, aiConfig: i } = W(), { setNodes: a, setEdges: o, addNodes: s, screenToFlowPosition: c } = De(), l = n || An, u = Ee(), d = Te(), f = bt(null), m = G(), h = () => {
|
|
1372
1373
|
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({
|
|
1373
1374
|
x: e - n,
|
|
1374
1375
|
y: t - r
|
|
@@ -1386,9 +1387,9 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1386
1387
|
n.onload = (e) => {
|
|
1387
1388
|
try {
|
|
1388
1389
|
let t = JSON.parse(e.target?.result);
|
|
1389
|
-
t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges),
|
|
1390
|
+
t && Array.isArray(t.nodes) && Array.isArray(t.edges) ? (a(t.nodes), o(t.edges), H.success(m("editor.actionsPanel.importSuccess"), { description: m("editor.actionsPanel.importSuccessDesc") })) : H.error(m("editor.actionsPanel.invalidJson"), { description: m("editor.actionsPanel.invalidJsonDesc") });
|
|
1390
1391
|
} catch (e) {
|
|
1391
|
-
console.warn(e),
|
|
1392
|
+
console.warn(e), H.error(m("editor.actionsPanel.parseError"), { description: m("editor.actionsPanel.parseErrorDesc") });
|
|
1392
1393
|
}
|
|
1393
1394
|
f.current && (f.current.value = "");
|
|
1394
1395
|
}, n.readAsText(t);
|
|
@@ -1398,8 +1399,8 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1398
1399
|
id: l,
|
|
1399
1400
|
nodes: u
|
|
1400
1401
|
}, i = new Blob([JSON.stringify(t, null, 2)], { type: "application/json" }), a = URL.createObjectURL(i), o = document.createElement("a");
|
|
1401
|
-
o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a),
|
|
1402
|
-
}, v =
|
|
1402
|
+
o.href = a, o.download = "treege.json", o.click(), URL.revokeObjectURL(a), H.success(m("editor.actionsPanel.downloadSuccess"), { description: m("editor.actionsPanel.downloadSuccessDesc") }), n || r?.(l), e?.(t);
|
|
1403
|
+
}, v = L(() => {
|
|
1403
1404
|
n || r?.(l), t?.({
|
|
1404
1405
|
edges: d,
|
|
1405
1406
|
id: l,
|
|
@@ -1413,108 +1414,108 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1413
1414
|
t,
|
|
1414
1415
|
r
|
|
1415
1416
|
]);
|
|
1416
|
-
return
|
|
1417
|
+
return vt(() => {
|
|
1417
1418
|
let e = (e) => {
|
|
1418
1419
|
(e.ctrlKey || e.metaKey) && e.key === "s" && (e.preventDefault(), v());
|
|
1419
1420
|
};
|
|
1420
1421
|
return window.addEventListener("keydown", e), () => {
|
|
1421
1422
|
window.removeEventListener("keydown", e);
|
|
1422
1423
|
};
|
|
1423
|
-
}, [v]), /* @__PURE__ */ (
|
|
1424
|
+
}, [v]), /* @__PURE__ */ N(ye, {
|
|
1424
1425
|
position: "top-right",
|
|
1425
1426
|
className: "flex gap-2",
|
|
1426
1427
|
children: [
|
|
1427
|
-
/* @__PURE__ */ (
|
|
1428
|
+
/* @__PURE__ */ M(kn, {
|
|
1428
1429
|
aiConfig: i,
|
|
1429
1430
|
onGenerate: (e) => {
|
|
1430
1431
|
a(e.nodes), o(e.edges);
|
|
1431
1432
|
}
|
|
1432
1433
|
}),
|
|
1433
|
-
/* @__PURE__ */ (
|
|
1434
|
+
/* @__PURE__ */ N(p, {
|
|
1434
1435
|
variant: "outline",
|
|
1435
1436
|
size: "sm",
|
|
1436
1437
|
onClick: h,
|
|
1437
1438
|
children: [
|
|
1438
|
-
/* @__PURE__ */ (
|
|
1439
|
+
/* @__PURE__ */ M(F, {}),
|
|
1439
1440
|
" ",
|
|
1440
|
-
|
|
1441
|
+
m("editor.actionsPanel.addNode")
|
|
1441
1442
|
]
|
|
1442
1443
|
}),
|
|
1443
|
-
/* @__PURE__ */ (
|
|
1444
|
+
/* @__PURE__ */ N(p, {
|
|
1444
1445
|
variant: "outline",
|
|
1445
1446
|
size: "sm",
|
|
1446
1447
|
onClick: v,
|
|
1447
1448
|
children: [
|
|
1448
|
-
/* @__PURE__ */ (
|
|
1449
|
+
/* @__PURE__ */ M(it, {}),
|
|
1449
1450
|
" ",
|
|
1450
|
-
|
|
1451
|
+
m("common.save")
|
|
1451
1452
|
]
|
|
1452
1453
|
}),
|
|
1453
|
-
/* @__PURE__ */ (
|
|
1454
|
+
/* @__PURE__ */ N(J, { children: [/* @__PURE__ */ M(Y, {
|
|
1454
1455
|
asChild: !0,
|
|
1455
|
-
children: /* @__PURE__ */ (
|
|
1456
|
+
children: /* @__PURE__ */ M(p, {
|
|
1456
1457
|
variant: "outline",
|
|
1457
1458
|
size: "sm",
|
|
1458
|
-
children: /* @__PURE__ */ (
|
|
1459
|
+
children: /* @__PURE__ */ M(Ue, {})
|
|
1459
1460
|
})
|
|
1460
|
-
}), /* @__PURE__ */ (
|
|
1461
|
+
}), /* @__PURE__ */ N(X, {
|
|
1461
1462
|
align: "start",
|
|
1462
1463
|
children: [
|
|
1463
|
-
/* @__PURE__ */ (
|
|
1464
|
+
/* @__PURE__ */ M(Xt, {
|
|
1464
1465
|
className: "font-normal",
|
|
1465
|
-
children: /* @__PURE__ */ (
|
|
1466
|
+
children: /* @__PURE__ */ N("div", {
|
|
1466
1467
|
className: "flex flex-col gap-1",
|
|
1467
|
-
children: [/* @__PURE__ */ (
|
|
1468
|
+
children: [/* @__PURE__ */ M("span", {
|
|
1468
1469
|
className: "text-muted-foreground text-xs",
|
|
1469
1470
|
children: "Flow ID"
|
|
1470
|
-
}), /* @__PURE__ */ (
|
|
1471
|
+
}), /* @__PURE__ */ N("button", {
|
|
1471
1472
|
onClick: async () => {
|
|
1472
1473
|
try {
|
|
1473
|
-
await navigator.clipboard.writeText(l),
|
|
1474
|
+
await navigator.clipboard.writeText(l), H.success(m("editor.actionsPanel.idCopied"), { description: l });
|
|
1474
1475
|
} catch {
|
|
1475
|
-
|
|
1476
|
+
H.error(m("editor.actionsPanel.copyFailed"));
|
|
1476
1477
|
}
|
|
1477
1478
|
},
|
|
1478
1479
|
className: "flex items-center gap-2 font-mono text-muted-foreground transition-colors hover:text-primary",
|
|
1479
1480
|
type: "button",
|
|
1480
|
-
children: [/* @__PURE__ */ (
|
|
1481
|
+
children: [/* @__PURE__ */ M(Ve, { className: "h-3 w-3" }), /* @__PURE__ */ M("span", {
|
|
1481
1482
|
className: "truncate text-xs",
|
|
1482
1483
|
children: l
|
|
1483
1484
|
})]
|
|
1484
1485
|
})]
|
|
1485
1486
|
})
|
|
1486
1487
|
}),
|
|
1487
|
-
/* @__PURE__ */ (
|
|
1488
|
-
/* @__PURE__ */ (
|
|
1488
|
+
/* @__PURE__ */ M(Zt, {}),
|
|
1489
|
+
/* @__PURE__ */ N(Yt, { children: [/* @__PURE__ */ N(Z, {
|
|
1489
1490
|
onClick: () => f?.current?.click(),
|
|
1490
1491
|
children: [
|
|
1491
|
-
/* @__PURE__ */ (
|
|
1492
|
+
/* @__PURE__ */ M(He, {}),
|
|
1492
1493
|
" ",
|
|
1493
|
-
|
|
1494
|
+
m("editor.actionsPanel.importJson")
|
|
1494
1495
|
]
|
|
1495
|
-
}), /* @__PURE__ */ (
|
|
1496
|
+
}), /* @__PURE__ */ N(Z, {
|
|
1496
1497
|
onClick: _,
|
|
1497
1498
|
children: [
|
|
1498
|
-
/* @__PURE__ */ (
|
|
1499
|
+
/* @__PURE__ */ M(ke, {}),
|
|
1499
1500
|
" ",
|
|
1500
|
-
|
|
1501
|
+
m("editor.actionsPanel.exportJson")
|
|
1501
1502
|
]
|
|
1502
1503
|
})] }),
|
|
1503
|
-
/* @__PURE__ */ (
|
|
1504
|
-
/* @__PURE__ */ (
|
|
1504
|
+
/* @__PURE__ */ M(Zt, {}),
|
|
1505
|
+
/* @__PURE__ */ M(Yt, { children: /* @__PURE__ */ N(Z, {
|
|
1505
1506
|
onClick: () => {
|
|
1506
|
-
a([]), o([]),
|
|
1507
|
+
a([]), o([]), H.success(m("editor.actionsPanel.clearSuccess"), { description: m("editor.actionsPanel.clearSuccessDesc") });
|
|
1507
1508
|
},
|
|
1508
1509
|
className: "text-destructive focus:text-destructive",
|
|
1509
1510
|
children: [
|
|
1510
|
-
/* @__PURE__ */ (
|
|
1511
|
+
/* @__PURE__ */ M(lt, { className: "text-destructive" }),
|
|
1511
1512
|
" ",
|
|
1512
|
-
|
|
1513
|
+
m("editor.actionsPanel.clear")
|
|
1513
1514
|
]
|
|
1514
1515
|
}) })
|
|
1515
1516
|
]
|
|
1516
1517
|
})] }),
|
|
1517
|
-
/* @__PURE__ */ (
|
|
1518
|
+
/* @__PURE__ */ M("input", {
|
|
1518
1519
|
type: "file",
|
|
1519
1520
|
accept: "application/json,.json",
|
|
1520
1521
|
className: "hidden",
|
|
@@ -1523,7 +1524,7 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1523
1524
|
})
|
|
1524
1525
|
]
|
|
1525
1526
|
});
|
|
1526
|
-
},
|
|
1527
|
+
}, Mn = {
|
|
1527
1528
|
ar: "ar",
|
|
1528
1529
|
de: "de",
|
|
1529
1530
|
en: "en",
|
|
@@ -1531,19 +1532,19 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1531
1532
|
fr: "fr",
|
|
1532
1533
|
it: "it",
|
|
1533
1534
|
pt: "pt"
|
|
1534
|
-
}, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */ (
|
|
1535
|
+
}, Q = ({ value: e = "en", onValueChange: t }) => /* @__PURE__ */ N(v, {
|
|
1535
1536
|
value: e,
|
|
1536
1537
|
onValueChange: t,
|
|
1537
|
-
children: [/* @__PURE__ */ (
|
|
1538
|
+
children: [/* @__PURE__ */ M(g, {
|
|
1538
1539
|
className: "uppercase",
|
|
1539
|
-
children: /* @__PURE__ */ (
|
|
1540
|
-
}), /* @__PURE__ */ (
|
|
1540
|
+
children: /* @__PURE__ */ M(c, { placeholder: "" })
|
|
1541
|
+
}), /* @__PURE__ */ M(k, { children: /* @__PURE__ */ M(A, { children: Object.values(Mn).map((e) => /* @__PURE__ */ M(b, {
|
|
1541
1542
|
value: e,
|
|
1542
1543
|
className: "uppercase",
|
|
1543
1544
|
children: e
|
|
1544
1545
|
}, e)) }) })]
|
|
1545
1546
|
}), $ = () => {
|
|
1546
|
-
let e = Ee(), t =
|
|
1547
|
+
let e = Ee(), t = R(() => e.filter(i), [e]), n = R(() => e.filter((e) => e.selected), [e]), r = R(() => e.find((e) => e.selected), [e]);
|
|
1547
1548
|
return {
|
|
1548
1549
|
groupNodes: t,
|
|
1549
1550
|
hasSelectedNodes: n.length > 0,
|
|
@@ -1551,8 +1552,8 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1551
1552
|
selectedNode: r,
|
|
1552
1553
|
selectedNodes: n
|
|
1553
1554
|
};
|
|
1554
|
-
},
|
|
1555
|
-
let [e, t] =
|
|
1555
|
+
}, Nn = () => {
|
|
1556
|
+
let [e, t] = z("en"), { updateSelectedNodeData: n } = q(), { selectedNode: r } = $(), i = G(), { Field: a } = P({
|
|
1556
1557
|
defaultValues: {
|
|
1557
1558
|
label: r?.data?.label || { en: "" },
|
|
1558
1559
|
targetId: r?.data?.targetId || ""
|
|
@@ -1567,22 +1568,22 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1567
1568
|
n(e);
|
|
1568
1569
|
}
|
|
1569
1570
|
});
|
|
1570
|
-
return /* @__PURE__ */ (
|
|
1571
|
+
return /* @__PURE__ */ M("form", {
|
|
1571
1572
|
onSubmit: (e) => {
|
|
1572
1573
|
e.preventDefault(), e.stopPropagation();
|
|
1573
1574
|
},
|
|
1574
|
-
children: /* @__PURE__ */ (
|
|
1575
|
+
children: /* @__PURE__ */ N("div", {
|
|
1575
1576
|
className: "grid gap-6",
|
|
1576
|
-
children: [/* @__PURE__ */ (
|
|
1577
|
+
children: [/* @__PURE__ */ N("div", {
|
|
1577
1578
|
className: "flex items-end gap-2",
|
|
1578
|
-
children: [/* @__PURE__ */ (
|
|
1579
|
+
children: [/* @__PURE__ */ M(a, {
|
|
1579
1580
|
name: "label",
|
|
1580
|
-
children: (t) => /* @__PURE__ */ (
|
|
1581
|
+
children: (t) => /* @__PURE__ */ N(T, {
|
|
1581
1582
|
className: "flex-1",
|
|
1582
|
-
children: [/* @__PURE__ */ (
|
|
1583
|
+
children: [/* @__PURE__ */ M(l, {
|
|
1583
1584
|
htmlFor: t.name,
|
|
1584
1585
|
children: i("editor.flowNodeForm.label")
|
|
1585
|
-
}), /* @__PURE__ */ (
|
|
1586
|
+
}), /* @__PURE__ */ M(m, {
|
|
1586
1587
|
id: t.name,
|
|
1587
1588
|
name: t.name,
|
|
1588
1589
|
value: t.state.value?.[e] || "",
|
|
@@ -1595,31 +1596,31 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1595
1596
|
}
|
|
1596
1597
|
})]
|
|
1597
1598
|
})
|
|
1598
|
-
}), /* @__PURE__ */ (
|
|
1599
|
+
}), /* @__PURE__ */ M(Q, {
|
|
1599
1600
|
value: e,
|
|
1600
1601
|
onValueChange: t
|
|
1601
1602
|
})]
|
|
1602
|
-
}), /* @__PURE__ */ (
|
|
1603
|
+
}), /* @__PURE__ */ M(a, {
|
|
1603
1604
|
name: "targetId",
|
|
1604
|
-
children: (e) => /* @__PURE__ */ (
|
|
1605
|
-
/* @__PURE__ */ (
|
|
1605
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
1606
|
+
/* @__PURE__ */ N(l, {
|
|
1606
1607
|
htmlFor: e.name,
|
|
1607
1608
|
children: [i("editor.flowNodeForm.targetId"), " (Flow ID)"]
|
|
1608
1609
|
}),
|
|
1609
|
-
/* @__PURE__ */ (
|
|
1610
|
+
/* @__PURE__ */ M(m, {
|
|
1610
1611
|
id: e.name,
|
|
1611
1612
|
name: e.name,
|
|
1612
1613
|
value: e.state.value,
|
|
1613
1614
|
onBlur: e.handleBlur,
|
|
1614
1615
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1615
1616
|
}),
|
|
1616
|
-
/* @__PURE__ */ (
|
|
1617
|
+
/* @__PURE__ */ M(E, { children: "Unique identifier of the target flow." })
|
|
1617
1618
|
] })
|
|
1618
1619
|
})]
|
|
1619
1620
|
})
|
|
1620
1621
|
});
|
|
1621
|
-
},
|
|
1622
|
-
let [e, t] =
|
|
1622
|
+
}, Pn = () => {
|
|
1623
|
+
let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = P({
|
|
1623
1624
|
defaultValues: { label: n?.data?.label || { en: "" } },
|
|
1624
1625
|
listeners: {
|
|
1625
1626
|
onChange: ({ formApi: e }) => {
|
|
@@ -1631,20 +1632,20 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1631
1632
|
r(e);
|
|
1632
1633
|
}
|
|
1633
1634
|
});
|
|
1634
|
-
return /* @__PURE__ */ (
|
|
1635
|
+
return /* @__PURE__ */ M("form", {
|
|
1635
1636
|
onSubmit: (e) => {
|
|
1636
1637
|
e.preventDefault(), e.stopPropagation();
|
|
1637
1638
|
},
|
|
1638
|
-
children: /* @__PURE__ */ (
|
|
1639
|
+
children: /* @__PURE__ */ N("div", {
|
|
1639
1640
|
className: "flex items-end gap-2",
|
|
1640
|
-
children: [/* @__PURE__ */ (
|
|
1641
|
+
children: [/* @__PURE__ */ M(i, {
|
|
1641
1642
|
name: "label",
|
|
1642
|
-
children: (t) => /* @__PURE__ */ (
|
|
1643
|
+
children: (t) => /* @__PURE__ */ N(T, {
|
|
1643
1644
|
className: "flex-1",
|
|
1644
|
-
children: [/* @__PURE__ */ (
|
|
1645
|
+
children: [/* @__PURE__ */ M(l, {
|
|
1645
1646
|
htmlFor: t.name,
|
|
1646
1647
|
children: "Label"
|
|
1647
|
-
}), /* @__PURE__ */ (
|
|
1648
|
+
}), /* @__PURE__ */ M(m, {
|
|
1648
1649
|
id: t.name,
|
|
1649
1650
|
name: t.name,
|
|
1650
1651
|
value: t.state.value?.[e] || "",
|
|
@@ -1657,18 +1658,18 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1657
1658
|
}
|
|
1658
1659
|
})]
|
|
1659
1660
|
})
|
|
1660
|
-
}), /* @__PURE__ */ (
|
|
1661
|
+
}), /* @__PURE__ */ M(Q, {
|
|
1661
1662
|
value: e,
|
|
1662
1663
|
onValueChange: t
|
|
1663
1664
|
})]
|
|
1664
1665
|
})
|
|
1665
1666
|
});
|
|
1666
|
-
},
|
|
1667
|
+
}, Fn = [
|
|
1667
1668
|
"POST",
|
|
1668
1669
|
"PUT",
|
|
1669
1670
|
"PATCH"
|
|
1670
|
-
],
|
|
1671
|
-
let { selectedNode: n } = $(), r =
|
|
1671
|
+
], In = ({ value: e, onChange: t }) => {
|
|
1672
|
+
let { selectedNode: n } = $(), r = G(), i = At(n?.id), { handleSubmit: a, Field: o, Subscribe: s } = P({
|
|
1672
1673
|
defaultValues: {
|
|
1673
1674
|
body: e?.body || "",
|
|
1674
1675
|
fetchOnMount: e?.fetchOnMount ?? !e?.searchParam,
|
|
@@ -1694,19 +1695,19 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1694
1695
|
t(e);
|
|
1695
1696
|
}
|
|
1696
1697
|
});
|
|
1697
|
-
return /* @__PURE__ */ (
|
|
1698
|
+
return /* @__PURE__ */ M("div", { children: /* @__PURE__ */ N("div", {
|
|
1698
1699
|
className: "grid gap-6",
|
|
1699
1700
|
children: [
|
|
1700
|
-
/* @__PURE__ */ (
|
|
1701
|
+
/* @__PURE__ */ M(o, {
|
|
1701
1702
|
name: "url",
|
|
1702
|
-
children: (e) => /* @__PURE__ */ (
|
|
1703
|
-
/* @__PURE__ */ (
|
|
1703
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
1704
|
+
/* @__PURE__ */ M(l, {
|
|
1704
1705
|
htmlFor: e.name,
|
|
1705
1706
|
children: r("editor.httpConfigForm.apiUrl")
|
|
1706
1707
|
}),
|
|
1707
|
-
/* @__PURE__ */ (
|
|
1708
|
+
/* @__PURE__ */ N("div", {
|
|
1708
1709
|
className: "flex gap-2",
|
|
1709
|
-
children: [/* @__PURE__ */ (
|
|
1710
|
+
children: [/* @__PURE__ */ M(m, {
|
|
1710
1711
|
id: e.name,
|
|
1711
1712
|
name: e.name,
|
|
1712
1713
|
value: e.state.value,
|
|
@@ -1714,30 +1715,30 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1714
1715
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1715
1716
|
placeholder: r("editor.httpConfigForm.apiUrlPlaceholder"),
|
|
1716
1717
|
className: "flex-1"
|
|
1717
|
-
}), /* @__PURE__ */ (
|
|
1718
|
+
}), /* @__PURE__ */ N(J, { children: [/* @__PURE__ */ M(Y, {
|
|
1718
1719
|
asChild: !0,
|
|
1719
|
-
children: /* @__PURE__ */ (
|
|
1720
|
+
children: /* @__PURE__ */ M(p, {
|
|
1720
1721
|
type: "button",
|
|
1721
1722
|
variant: "outline",
|
|
1722
1723
|
size: "icon",
|
|
1723
|
-
children: /* @__PURE__ */ (
|
|
1724
|
+
children: /* @__PURE__ */ M(dt, { className: "h-4 w-4" })
|
|
1724
1725
|
})
|
|
1725
|
-
}), /* @__PURE__ */ (
|
|
1726
|
+
}), /* @__PURE__ */ M(X, {
|
|
1726
1727
|
align: "end",
|
|
1727
|
-
children: i.length === 0 ? /* @__PURE__ */ (
|
|
1728
|
+
children: i.length === 0 ? /* @__PURE__ */ M(Z, {
|
|
1728
1729
|
disabled: !0,
|
|
1729
1730
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1730
|
-
}) : i.map((t) => /* @__PURE__ */ (
|
|
1731
|
+
}) : i.map((t) => /* @__PURE__ */ M(Z, {
|
|
1731
1732
|
onClick: () => {
|
|
1732
1733
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1733
1734
|
e.handleChange(r + n);
|
|
1734
1735
|
},
|
|
1735
|
-
children: /* @__PURE__ */ (
|
|
1736
|
+
children: /* @__PURE__ */ N("div", {
|
|
1736
1737
|
className: "flex flex-col",
|
|
1737
|
-
children: [/* @__PURE__ */ (
|
|
1738
|
+
children: [/* @__PURE__ */ M("span", {
|
|
1738
1739
|
className: "font-medium",
|
|
1739
1740
|
children: t.label
|
|
1740
|
-
}), /* @__PURE__ */ (
|
|
1741
|
+
}), /* @__PURE__ */ M("span", {
|
|
1741
1742
|
className: "text-muted-foreground text-xs",
|
|
1742
1743
|
children: `{{${t.nodeId}}}`
|
|
1743
1744
|
})]
|
|
@@ -1745,87 +1746,87 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1745
1746
|
}, t.nodeId))
|
|
1746
1747
|
})] })]
|
|
1747
1748
|
}),
|
|
1748
|
-
/* @__PURE__ */ (
|
|
1749
|
+
/* @__PURE__ */ M(E, { children: r("editor.httpConfigForm.apiUrlDesc") })
|
|
1749
1750
|
] })
|
|
1750
1751
|
}),
|
|
1751
|
-
/* @__PURE__ */ (
|
|
1752
|
+
/* @__PURE__ */ M(o, {
|
|
1752
1753
|
name: "method",
|
|
1753
|
-
children: (e) => /* @__PURE__ */ (
|
|
1754
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
1754
1755
|
htmlFor: e.name,
|
|
1755
1756
|
children: r("editor.httpConfigForm.httpMethod")
|
|
1756
|
-
}), /* @__PURE__ */ (
|
|
1757
|
+
}), /* @__PURE__ */ N(v, {
|
|
1757
1758
|
value: e.state.value,
|
|
1758
1759
|
onValueChange: (t) => e.handleChange(t),
|
|
1759
|
-
children: [/* @__PURE__ */ (
|
|
1760
|
+
children: [/* @__PURE__ */ M(g, {
|
|
1760
1761
|
id: e.name,
|
|
1761
|
-
children: /* @__PURE__ */ (
|
|
1762
|
-
}), /* @__PURE__ */ (
|
|
1763
|
-
/* @__PURE__ */ (
|
|
1762
|
+
children: /* @__PURE__ */ M(c, { placeholder: r("editor.httpConfigForm.selectMethod") })
|
|
1763
|
+
}), /* @__PURE__ */ N(k, { children: [
|
|
1764
|
+
/* @__PURE__ */ M(b, {
|
|
1764
1765
|
value: "GET",
|
|
1765
1766
|
children: r("editor.httpConfigForm.methodGet")
|
|
1766
1767
|
}),
|
|
1767
|
-
/* @__PURE__ */ (
|
|
1768
|
+
/* @__PURE__ */ M(b, {
|
|
1768
1769
|
value: "POST",
|
|
1769
1770
|
children: r("editor.httpConfigForm.methodPost")
|
|
1770
1771
|
}),
|
|
1771
|
-
/* @__PURE__ */ (
|
|
1772
|
+
/* @__PURE__ */ M(b, {
|
|
1772
1773
|
value: "PUT",
|
|
1773
1774
|
children: r("editor.httpConfigForm.methodPut")
|
|
1774
1775
|
}),
|
|
1775
|
-
/* @__PURE__ */ (
|
|
1776
|
+
/* @__PURE__ */ M(b, {
|
|
1776
1777
|
value: "DELETE",
|
|
1777
1778
|
children: r("editor.httpConfigForm.methodDelete")
|
|
1778
1779
|
}),
|
|
1779
|
-
/* @__PURE__ */ (
|
|
1780
|
+
/* @__PURE__ */ M(b, {
|
|
1780
1781
|
value: "PATCH",
|
|
1781
1782
|
children: r("editor.httpConfigForm.methodPatch")
|
|
1782
1783
|
})
|
|
1783
1784
|
] })]
|
|
1784
1785
|
})] })
|
|
1785
1786
|
}),
|
|
1786
|
-
/* @__PURE__ */ (
|
|
1787
|
+
/* @__PURE__ */ N("div", {
|
|
1787
1788
|
className: "space-y-4",
|
|
1788
|
-
children: [/* @__PURE__ */ (
|
|
1789
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
1789
1790
|
className: "font-semibold text-sm",
|
|
1790
1791
|
children: r("editor.httpConfigForm.headers")
|
|
1791
|
-
}), /* @__PURE__ */ (
|
|
1792
|
+
}), /* @__PURE__ */ M(o, {
|
|
1792
1793
|
name: "headers",
|
|
1793
1794
|
mode: "array",
|
|
1794
|
-
children: (e) => /* @__PURE__ */ (
|
|
1795
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
1795
1796
|
className: "space-y-2",
|
|
1796
1797
|
children: [e.state.value?.map((t, n) => {
|
|
1797
1798
|
let i = `headers[${n}]`;
|
|
1798
|
-
return /* @__PURE__ */ (
|
|
1799
|
+
return /* @__PURE__ */ N("div", {
|
|
1799
1800
|
className: "flex items-start gap-2",
|
|
1800
1801
|
children: [
|
|
1801
|
-
/* @__PURE__ */ (
|
|
1802
|
+
/* @__PURE__ */ M(o, {
|
|
1802
1803
|
name: `headers[${n}].key`,
|
|
1803
|
-
children: (e) => /* @__PURE__ */ (
|
|
1804
|
+
children: (e) => /* @__PURE__ */ M(m, {
|
|
1804
1805
|
placeholder: r("editor.httpConfigForm.headerName"),
|
|
1805
1806
|
value: e.state.value || "",
|
|
1806
1807
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1807
1808
|
})
|
|
1808
1809
|
}),
|
|
1809
|
-
/* @__PURE__ */ (
|
|
1810
|
+
/* @__PURE__ */ M(o, {
|
|
1810
1811
|
name: `headers[${n}].value`,
|
|
1811
|
-
children: (e) => /* @__PURE__ */ (
|
|
1812
|
+
children: (e) => /* @__PURE__ */ M(m, {
|
|
1812
1813
|
placeholder: r("editor.httpConfigForm.headerValue"),
|
|
1813
1814
|
value: e.state.value || "",
|
|
1814
1815
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
1815
1816
|
})
|
|
1816
1817
|
}),
|
|
1817
|
-
/* @__PURE__ */ (
|
|
1818
|
+
/* @__PURE__ */ M(p, {
|
|
1818
1819
|
type: "button",
|
|
1819
1820
|
variant: "ghost",
|
|
1820
1821
|
size: "icon",
|
|
1821
1822
|
onClick: () => {
|
|
1822
1823
|
e.removeValue(n);
|
|
1823
1824
|
},
|
|
1824
|
-
children: /* @__PURE__ */ (
|
|
1825
|
+
children: /* @__PURE__ */ M(I, { className: "h-4 w-4" })
|
|
1825
1826
|
})
|
|
1826
1827
|
]
|
|
1827
1828
|
}, i);
|
|
1828
|
-
}), /* @__PURE__ */ (
|
|
1829
|
+
}), /* @__PURE__ */ N(p, {
|
|
1829
1830
|
type: "button",
|
|
1830
1831
|
variant: "outline",
|
|
1831
1832
|
size: "sm",
|
|
@@ -1835,64 +1836,64 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1835
1836
|
value: ""
|
|
1836
1837
|
});
|
|
1837
1838
|
},
|
|
1838
|
-
children: [/* @__PURE__ */ (
|
|
1839
|
+
children: [/* @__PURE__ */ M(F, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.addHeader")]
|
|
1839
1840
|
})]
|
|
1840
1841
|
})
|
|
1841
1842
|
})]
|
|
1842
1843
|
}),
|
|
1843
|
-
/* @__PURE__ */ (
|
|
1844
|
+
/* @__PURE__ */ M(s, {
|
|
1844
1845
|
selector: (e) => ({
|
|
1845
1846
|
method: e.values.method,
|
|
1846
1847
|
sendAllFormValues: e.values.sendAllFormValues
|
|
1847
1848
|
}),
|
|
1848
|
-
children: ({ method: e, sendAllFormValues: t }) =>
|
|
1849
|
+
children: ({ method: e, sendAllFormValues: t }) => Fn.includes(e || "") && /* @__PURE__ */ N("div", {
|
|
1849
1850
|
className: "space-y-4",
|
|
1850
|
-
children: [/* @__PURE__ */ (
|
|
1851
|
+
children: [/* @__PURE__ */ M(o, {
|
|
1851
1852
|
name: "sendAllFormValues",
|
|
1852
|
-
children: (e) => /* @__PURE__ */ (
|
|
1853
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
1853
1854
|
className: "flex items-center space-x-2",
|
|
1854
|
-
children: [/* @__PURE__ */ (
|
|
1855
|
+
children: [/* @__PURE__ */ M(x, {
|
|
1855
1856
|
id: e.name,
|
|
1856
1857
|
checked: e.state.value,
|
|
1857
1858
|
onCheckedChange: (t) => e.handleChange(t)
|
|
1858
|
-
}), /* @__PURE__ */ (
|
|
1859
|
+
}), /* @__PURE__ */ M(l, {
|
|
1859
1860
|
htmlFor: e.name,
|
|
1860
1861
|
children: r("editor.httpConfigForm.sendAllFormValues")
|
|
1861
1862
|
})]
|
|
1862
1863
|
})
|
|
1863
|
-
}), /* @__PURE__ */ (
|
|
1864
|
+
}), /* @__PURE__ */ M(o, {
|
|
1864
1865
|
name: "body",
|
|
1865
|
-
children: (e) => /* @__PURE__ */ (
|
|
1866
|
-
/* @__PURE__ */ (
|
|
1866
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
1867
|
+
/* @__PURE__ */ N("div", {
|
|
1867
1868
|
className: "mb-2 flex items-center justify-between",
|
|
1868
|
-
children: [/* @__PURE__ */ (
|
|
1869
|
+
children: [/* @__PURE__ */ M(l, {
|
|
1869
1870
|
htmlFor: e.name,
|
|
1870
1871
|
children: r("editor.httpConfigForm.requestBody")
|
|
1871
|
-
}), /* @__PURE__ */ (
|
|
1872
|
+
}), /* @__PURE__ */ N(J, { children: [/* @__PURE__ */ M(Y, {
|
|
1872
1873
|
asChild: !0,
|
|
1873
|
-
children: /* @__PURE__ */ (
|
|
1874
|
+
children: /* @__PURE__ */ N(p, {
|
|
1874
1875
|
type: "button",
|
|
1875
1876
|
variant: "ghost",
|
|
1876
1877
|
size: "sm",
|
|
1877
1878
|
disabled: t,
|
|
1878
|
-
children: [/* @__PURE__ */ (
|
|
1879
|
+
children: [/* @__PURE__ */ M(dt, { className: "mr-2 h-4 w-4" }), r("editor.httpConfigForm.insertVariable")]
|
|
1879
1880
|
})
|
|
1880
|
-
}), /* @__PURE__ */ (
|
|
1881
|
+
}), /* @__PURE__ */ M(X, {
|
|
1881
1882
|
align: "end",
|
|
1882
|
-
children: i.length === 0 ? /* @__PURE__ */ (
|
|
1883
|
+
children: i.length === 0 ? /* @__PURE__ */ M(Z, {
|
|
1883
1884
|
disabled: !0,
|
|
1884
1885
|
children: r("editor.httpConfigForm.noFieldsAvailable")
|
|
1885
|
-
}) : i.map((t) => /* @__PURE__ */ (
|
|
1886
|
+
}) : i.map((t) => /* @__PURE__ */ M(Z, {
|
|
1886
1887
|
onClick: () => {
|
|
1887
1888
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
1888
1889
|
e.handleChange(r + n), a().then();
|
|
1889
1890
|
},
|
|
1890
|
-
children: /* @__PURE__ */ (
|
|
1891
|
+
children: /* @__PURE__ */ N("div", {
|
|
1891
1892
|
className: "flex flex-col",
|
|
1892
|
-
children: [/* @__PURE__ */ (
|
|
1893
|
+
children: [/* @__PURE__ */ M("span", {
|
|
1893
1894
|
className: "font-medium",
|
|
1894
1895
|
children: t.label
|
|
1895
|
-
}), /* @__PURE__ */ (
|
|
1896
|
+
}), /* @__PURE__ */ M("span", {
|
|
1896
1897
|
className: "text-muted-foreground text-xs",
|
|
1897
1898
|
children: `{{${t.nodeId}}}`
|
|
1898
1899
|
})]
|
|
@@ -1900,7 +1901,7 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1900
1901
|
}, t.nodeId))
|
|
1901
1902
|
})] })]
|
|
1902
1903
|
}),
|
|
1903
|
-
/* @__PURE__ */ (
|
|
1904
|
+
/* @__PURE__ */ M(ne, {
|
|
1904
1905
|
id: e.name,
|
|
1905
1906
|
name: e.name,
|
|
1906
1907
|
value: e.state.value,
|
|
@@ -1910,26 +1911,26 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1910
1911
|
rows: 4,
|
|
1911
1912
|
disabled: t
|
|
1912
1913
|
}),
|
|
1913
|
-
/* @__PURE__ */ (
|
|
1914
|
+
/* @__PURE__ */ M(E, { children: r(t ? "editor.httpConfigForm.sendAllFormValuesDesc" : "editor.httpConfigForm.requestBodyDesc") })
|
|
1914
1915
|
] })
|
|
1915
1916
|
})]
|
|
1916
1917
|
})
|
|
1917
1918
|
}),
|
|
1918
|
-
/* @__PURE__ */ (
|
|
1919
|
+
/* @__PURE__ */ N("div", {
|
|
1919
1920
|
className: "space-y-4",
|
|
1920
1921
|
children: [
|
|
1921
|
-
/* @__PURE__ */ (
|
|
1922
|
+
/* @__PURE__ */ M("h4", {
|
|
1922
1923
|
className: "font-semibold text-sm",
|
|
1923
1924
|
children: r("editor.httpConfigForm.responseConfiguration")
|
|
1924
1925
|
}),
|
|
1925
|
-
/* @__PURE__ */ (
|
|
1926
|
+
/* @__PURE__ */ M(o, {
|
|
1926
1927
|
name: "responsePath",
|
|
1927
|
-
children: (e) => /* @__PURE__ */ (
|
|
1928
|
-
/* @__PURE__ */ (
|
|
1928
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
1929
|
+
/* @__PURE__ */ M(l, {
|
|
1929
1930
|
htmlFor: e.name,
|
|
1930
1931
|
children: r("editor.httpConfigForm.responsePath")
|
|
1931
1932
|
}),
|
|
1932
|
-
/* @__PURE__ */ (
|
|
1933
|
+
/* @__PURE__ */ M(m, {
|
|
1933
1934
|
id: e.name,
|
|
1934
1935
|
name: e.name,
|
|
1935
1936
|
value: e.state.value,
|
|
@@ -1937,24 +1938,24 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1937
1938
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1938
1939
|
placeholder: r("editor.httpConfigForm.responsePathPlaceholder")
|
|
1939
1940
|
}),
|
|
1940
|
-
/* @__PURE__ */ (
|
|
1941
|
+
/* @__PURE__ */ M(E, { children: r("editor.httpConfigForm.responsePathDesc") })
|
|
1941
1942
|
] })
|
|
1942
1943
|
}),
|
|
1943
|
-
/* @__PURE__ */ (
|
|
1944
|
+
/* @__PURE__ */ N("div", {
|
|
1944
1945
|
className: "space-y-4",
|
|
1945
1946
|
children: [
|
|
1946
|
-
/* @__PURE__ */ (
|
|
1947
|
+
/* @__PURE__ */ M("h5", {
|
|
1947
1948
|
className: "font-medium text-sm",
|
|
1948
1949
|
children: r("editor.httpConfigForm.mapToOptions")
|
|
1949
1950
|
}),
|
|
1950
|
-
/* @__PURE__ */ (
|
|
1951
|
+
/* @__PURE__ */ M(o, {
|
|
1951
1952
|
name: "responseMapping.valueField",
|
|
1952
|
-
children: (e) => /* @__PURE__ */ (
|
|
1953
|
-
/* @__PURE__ */ (
|
|
1953
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
1954
|
+
/* @__PURE__ */ M(l, {
|
|
1954
1955
|
htmlFor: e.name,
|
|
1955
1956
|
children: r("editor.httpConfigForm.valueField")
|
|
1956
1957
|
}),
|
|
1957
|
-
/* @__PURE__ */ (
|
|
1958
|
+
/* @__PURE__ */ M(m, {
|
|
1958
1959
|
id: e.name,
|
|
1959
1960
|
name: e.name,
|
|
1960
1961
|
value: e.state.value,
|
|
@@ -1962,17 +1963,17 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1962
1963
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1963
1964
|
placeholder: r("editor.httpConfigForm.valueFieldPlaceholder")
|
|
1964
1965
|
}),
|
|
1965
|
-
/* @__PURE__ */ (
|
|
1966
|
+
/* @__PURE__ */ M(E, { children: r("editor.httpConfigForm.valueFieldDesc") })
|
|
1966
1967
|
] })
|
|
1967
1968
|
}),
|
|
1968
|
-
/* @__PURE__ */ (
|
|
1969
|
+
/* @__PURE__ */ M(o, {
|
|
1969
1970
|
name: "responseMapping.labelField",
|
|
1970
|
-
children: (e) => /* @__PURE__ */ (
|
|
1971
|
-
/* @__PURE__ */ (
|
|
1971
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
1972
|
+
/* @__PURE__ */ M(l, {
|
|
1972
1973
|
htmlFor: e.name,
|
|
1973
1974
|
children: r("editor.httpConfigForm.labelField")
|
|
1974
1975
|
}),
|
|
1975
|
-
/* @__PURE__ */ (
|
|
1976
|
+
/* @__PURE__ */ M(m, {
|
|
1976
1977
|
id: e.name,
|
|
1977
1978
|
name: e.name,
|
|
1978
1979
|
value: e.state.value,
|
|
@@ -1980,19 +1981,19 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
1980
1981
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
1981
1982
|
placeholder: r("editor.httpConfigForm.labelFieldPlaceholder")
|
|
1982
1983
|
}),
|
|
1983
|
-
/* @__PURE__ */ (
|
|
1984
|
+
/* @__PURE__ */ M(E, { children: r("editor.httpConfigForm.labelFieldDesc") })
|
|
1984
1985
|
] })
|
|
1985
1986
|
})
|
|
1986
1987
|
]
|
|
1987
1988
|
}),
|
|
1988
|
-
/* @__PURE__ */ (
|
|
1989
|
+
/* @__PURE__ */ M(o, {
|
|
1989
1990
|
name: "searchParam",
|
|
1990
|
-
children: (e) => /* @__PURE__ */ (
|
|
1991
|
-
/* @__PURE__ */ (
|
|
1991
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
1992
|
+
/* @__PURE__ */ M(l, {
|
|
1992
1993
|
htmlFor: e.name,
|
|
1993
1994
|
children: r("editor.httpConfigForm.searchParameter")
|
|
1994
1995
|
}),
|
|
1995
|
-
/* @__PURE__ */ (
|
|
1996
|
+
/* @__PURE__ */ M(m, {
|
|
1996
1997
|
id: e.name,
|
|
1997
1998
|
name: e.name,
|
|
1998
1999
|
value: e.state.value,
|
|
@@ -2000,32 +2001,32 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2000
2001
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2001
2002
|
placeholder: r("editor.httpConfigForm.searchParameterPlaceholder")
|
|
2002
2003
|
}),
|
|
2003
|
-
/* @__PURE__ */ (
|
|
2004
|
+
/* @__PURE__ */ M(E, { children: r("editor.httpConfigForm.searchParameterDesc") })
|
|
2004
2005
|
] })
|
|
2005
2006
|
})
|
|
2006
2007
|
]
|
|
2007
2008
|
}),
|
|
2008
|
-
/* @__PURE__ */ (
|
|
2009
|
+
/* @__PURE__ */ N("div", {
|
|
2009
2010
|
className: "space-y-4",
|
|
2010
2011
|
children: [
|
|
2011
|
-
/* @__PURE__ */ (
|
|
2012
|
+
/* @__PURE__ */ M("h4", {
|
|
2012
2013
|
className: "font-semibold text-sm",
|
|
2013
2014
|
children: r("editor.httpConfigForm.behavior")
|
|
2014
2015
|
}),
|
|
2015
|
-
/* @__PURE__ */ (
|
|
2016
|
+
/* @__PURE__ */ M(s, {
|
|
2016
2017
|
selector: (e) => e.values.searchParam,
|
|
2017
|
-
children: (e) => /* @__PURE__ */ (
|
|
2018
|
+
children: (e) => /* @__PURE__ */ M(o, {
|
|
2018
2019
|
name: "fetchOnMount",
|
|
2019
2020
|
children: (t) => {
|
|
2020
2021
|
let n = !!e?.trim(), i = n ? t.state.value : !0;
|
|
2021
|
-
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ (
|
|
2022
|
+
return !n && t.state.value !== !0 && t.handleChange(!0), /* @__PURE__ */ N("div", {
|
|
2022
2023
|
className: "flex items-center space-x-2",
|
|
2023
|
-
children: [/* @__PURE__ */ (
|
|
2024
|
+
children: [/* @__PURE__ */ M(x, {
|
|
2024
2025
|
id: t.name,
|
|
2025
2026
|
checked: i,
|
|
2026
2027
|
disabled: !n,
|
|
2027
2028
|
onCheckedChange: (e) => t.handleChange(e)
|
|
2028
|
-
}), /* @__PURE__ */ (
|
|
2029
|
+
}), /* @__PURE__ */ M(l, {
|
|
2029
2030
|
htmlFor: t.name,
|
|
2030
2031
|
className: n ? "" : "text-muted-foreground",
|
|
2031
2032
|
children: r("editor.httpConfigForm.fetchOnMount")
|
|
@@ -2034,15 +2035,15 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2034
2035
|
}
|
|
2035
2036
|
})
|
|
2036
2037
|
}),
|
|
2037
|
-
/* @__PURE__ */ (
|
|
2038
|
+
/* @__PURE__ */ M(o, {
|
|
2038
2039
|
name: "showLoading",
|
|
2039
|
-
children: (e) => /* @__PURE__ */ (
|
|
2040
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
2040
2041
|
className: "flex items-center space-x-2",
|
|
2041
|
-
children: [/* @__PURE__ */ (
|
|
2042
|
+
children: [/* @__PURE__ */ M(x, {
|
|
2042
2043
|
id: e.name,
|
|
2043
2044
|
checked: e.state.value,
|
|
2044
2045
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2045
|
-
}), /* @__PURE__ */ (
|
|
2046
|
+
}), /* @__PURE__ */ M(l, {
|
|
2046
2047
|
htmlFor: e.name,
|
|
2047
2048
|
children: r("editor.httpConfigForm.showLoadingState")
|
|
2048
2049
|
})]
|
|
@@ -2052,12 +2053,12 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2052
2053
|
})
|
|
2053
2054
|
]
|
|
2054
2055
|
}) });
|
|
2055
|
-
},
|
|
2056
|
+
}, Ln = [
|
|
2056
2057
|
"POST",
|
|
2057
2058
|
"PUT",
|
|
2058
2059
|
"PATCH"
|
|
2059
|
-
],
|
|
2060
|
-
let [n, r] =
|
|
2060
|
+
], Rn = ({ value: e, onChange: t }) => {
|
|
2061
|
+
let [n, r] = z("en"), { selectedNode: i } = $(), a = G(), o = At(i?.id), { handleSubmit: s, Field: u, Subscribe: d } = P({
|
|
2061
2062
|
defaultValues: {
|
|
2062
2063
|
body: e?.body || "",
|
|
2063
2064
|
errorMessage: e?.errorMessage || { en: "" },
|
|
@@ -2079,19 +2080,19 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2079
2080
|
t(e);
|
|
2080
2081
|
}
|
|
2081
2082
|
});
|
|
2082
|
-
return /* @__PURE__ */ (
|
|
2083
|
+
return /* @__PURE__ */ M("div", { children: /* @__PURE__ */ N("div", {
|
|
2083
2084
|
className: "grid gap-6",
|
|
2084
2085
|
children: [
|
|
2085
|
-
/* @__PURE__ */ (
|
|
2086
|
+
/* @__PURE__ */ M(u, {
|
|
2086
2087
|
name: "url",
|
|
2087
|
-
children: (e) => /* @__PURE__ */ (
|
|
2088
|
-
/* @__PURE__ */ (
|
|
2088
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
2089
|
+
/* @__PURE__ */ M(l, {
|
|
2089
2090
|
htmlFor: e.name,
|
|
2090
2091
|
children: a("editor.submitConfigForm.apiUrl")
|
|
2091
2092
|
}),
|
|
2092
|
-
/* @__PURE__ */ (
|
|
2093
|
+
/* @__PURE__ */ N("div", {
|
|
2093
2094
|
className: "flex gap-2",
|
|
2094
|
-
children: [/* @__PURE__ */ (
|
|
2095
|
+
children: [/* @__PURE__ */ M(m, {
|
|
2095
2096
|
id: e.name,
|
|
2096
2097
|
name: e.name,
|
|
2097
2098
|
value: e.state.value,
|
|
@@ -2099,30 +2100,30 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2099
2100
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2100
2101
|
placeholder: a("editor.submitConfigForm.apiUrlPlaceholder"),
|
|
2101
2102
|
className: "flex-1"
|
|
2102
|
-
}), /* @__PURE__ */ (
|
|
2103
|
+
}), /* @__PURE__ */ N(J, { children: [/* @__PURE__ */ M(Y, {
|
|
2103
2104
|
asChild: !0,
|
|
2104
|
-
children: /* @__PURE__ */ (
|
|
2105
|
+
children: /* @__PURE__ */ M(p, {
|
|
2105
2106
|
type: "button",
|
|
2106
2107
|
variant: "outline",
|
|
2107
2108
|
size: "icon",
|
|
2108
|
-
children: /* @__PURE__ */ (
|
|
2109
|
+
children: /* @__PURE__ */ M(dt, { className: "h-4 w-4" })
|
|
2109
2110
|
})
|
|
2110
|
-
}), /* @__PURE__ */ (
|
|
2111
|
+
}), /* @__PURE__ */ M(X, {
|
|
2111
2112
|
align: "end",
|
|
2112
|
-
children: o.length === 0 ? /* @__PURE__ */ (
|
|
2113
|
+
children: o.length === 0 ? /* @__PURE__ */ M(Z, {
|
|
2113
2114
|
disabled: !0,
|
|
2114
2115
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
2115
|
-
}) : o.map((t) => /* @__PURE__ */ (
|
|
2116
|
+
}) : o.map((t) => /* @__PURE__ */ M(Z, {
|
|
2116
2117
|
onClick: () => {
|
|
2117
2118
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
2118
2119
|
e.handleChange(r + n);
|
|
2119
2120
|
},
|
|
2120
|
-
children: /* @__PURE__ */ (
|
|
2121
|
+
children: /* @__PURE__ */ N("div", {
|
|
2121
2122
|
className: "flex flex-col",
|
|
2122
|
-
children: [/* @__PURE__ */ (
|
|
2123
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2123
2124
|
className: "font-medium",
|
|
2124
2125
|
children: t.label
|
|
2125
|
-
}), /* @__PURE__ */ (
|
|
2126
|
+
}), /* @__PURE__ */ M("span", {
|
|
2126
2127
|
className: "text-muted-foreground text-xs",
|
|
2127
2128
|
children: `{{${t.nodeId}}}`
|
|
2128
2129
|
})]
|
|
@@ -2130,83 +2131,83 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2130
2131
|
}, t.nodeId))
|
|
2131
2132
|
})] })]
|
|
2132
2133
|
}),
|
|
2133
|
-
/* @__PURE__ */ (
|
|
2134
|
+
/* @__PURE__ */ M(E, { children: a("editor.submitConfigForm.apiUrlDesc") })
|
|
2134
2135
|
] })
|
|
2135
2136
|
}),
|
|
2136
|
-
/* @__PURE__ */ (
|
|
2137
|
+
/* @__PURE__ */ M(u, {
|
|
2137
2138
|
name: "method",
|
|
2138
|
-
children: (e) => /* @__PURE__ */ (
|
|
2139
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
2139
2140
|
htmlFor: e.name,
|
|
2140
2141
|
children: a("editor.submitConfigForm.httpMethod")
|
|
2141
|
-
}), /* @__PURE__ */ (
|
|
2142
|
+
}), /* @__PURE__ */ N(v, {
|
|
2142
2143
|
value: e.state.value,
|
|
2143
2144
|
onValueChange: (t) => e.handleChange(t),
|
|
2144
|
-
children: [/* @__PURE__ */ (
|
|
2145
|
+
children: [/* @__PURE__ */ M(g, {
|
|
2145
2146
|
id: e.name,
|
|
2146
|
-
children: /* @__PURE__ */ (
|
|
2147
|
-
}), /* @__PURE__ */ (
|
|
2148
|
-
/* @__PURE__ */ (
|
|
2147
|
+
children: /* @__PURE__ */ M(c, { placeholder: a("editor.submitConfigForm.selectMethod") })
|
|
2148
|
+
}), /* @__PURE__ */ N(k, { children: [
|
|
2149
|
+
/* @__PURE__ */ M(b, {
|
|
2149
2150
|
value: "POST",
|
|
2150
2151
|
children: a("editor.submitConfigForm.methodPost")
|
|
2151
2152
|
}),
|
|
2152
|
-
/* @__PURE__ */ (
|
|
2153
|
+
/* @__PURE__ */ M(b, {
|
|
2153
2154
|
value: "PUT",
|
|
2154
2155
|
children: a("editor.submitConfigForm.methodPut")
|
|
2155
2156
|
}),
|
|
2156
|
-
/* @__PURE__ */ (
|
|
2157
|
+
/* @__PURE__ */ M(b, {
|
|
2157
2158
|
value: "DELETE",
|
|
2158
2159
|
children: a("editor.submitConfigForm.methodDelete")
|
|
2159
2160
|
}),
|
|
2160
|
-
/* @__PURE__ */ (
|
|
2161
|
+
/* @__PURE__ */ M(b, {
|
|
2161
2162
|
value: "PATCH",
|
|
2162
2163
|
children: a("editor.submitConfigForm.methodPatch")
|
|
2163
2164
|
})
|
|
2164
2165
|
] })]
|
|
2165
2166
|
})] })
|
|
2166
2167
|
}),
|
|
2167
|
-
/* @__PURE__ */ (
|
|
2168
|
+
/* @__PURE__ */ N("div", {
|
|
2168
2169
|
className: "space-y-4",
|
|
2169
|
-
children: [/* @__PURE__ */ (
|
|
2170
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
2170
2171
|
className: "font-semibold text-sm",
|
|
2171
2172
|
children: a("editor.submitConfigForm.headers")
|
|
2172
|
-
}), /* @__PURE__ */ (
|
|
2173
|
+
}), /* @__PURE__ */ M(u, {
|
|
2173
2174
|
name: "headers",
|
|
2174
2175
|
mode: "array",
|
|
2175
|
-
children: (e) => /* @__PURE__ */ (
|
|
2176
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
2176
2177
|
className: "space-y-2",
|
|
2177
2178
|
children: [e.state.value?.map((t, n) => {
|
|
2178
2179
|
let r = `headers[${n}]`;
|
|
2179
|
-
return /* @__PURE__ */ (
|
|
2180
|
+
return /* @__PURE__ */ N("div", {
|
|
2180
2181
|
className: "flex items-start gap-2",
|
|
2181
2182
|
children: [
|
|
2182
|
-
/* @__PURE__ */ (
|
|
2183
|
+
/* @__PURE__ */ M(u, {
|
|
2183
2184
|
name: `headers[${n}].key`,
|
|
2184
|
-
children: (e) => /* @__PURE__ */ (
|
|
2185
|
+
children: (e) => /* @__PURE__ */ M(m, {
|
|
2185
2186
|
placeholder: a("editor.submitConfigForm.headerName"),
|
|
2186
2187
|
value: e.state.value || "",
|
|
2187
2188
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2188
2189
|
})
|
|
2189
2190
|
}),
|
|
2190
|
-
/* @__PURE__ */ (
|
|
2191
|
+
/* @__PURE__ */ M(u, {
|
|
2191
2192
|
name: `headers[${n}].value`,
|
|
2192
|
-
children: (e) => /* @__PURE__ */ (
|
|
2193
|
+
children: (e) => /* @__PURE__ */ M(m, {
|
|
2193
2194
|
placeholder: a("editor.submitConfigForm.headerValue"),
|
|
2194
2195
|
value: e.state.value || "",
|
|
2195
2196
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2196
2197
|
})
|
|
2197
2198
|
}),
|
|
2198
|
-
/* @__PURE__ */ (
|
|
2199
|
+
/* @__PURE__ */ M(p, {
|
|
2199
2200
|
type: "button",
|
|
2200
2201
|
variant: "ghost",
|
|
2201
2202
|
size: "icon",
|
|
2202
2203
|
onClick: () => {
|
|
2203
2204
|
e.removeValue(n);
|
|
2204
2205
|
},
|
|
2205
|
-
children: /* @__PURE__ */ (
|
|
2206
|
+
children: /* @__PURE__ */ M(I, { className: "h-4 w-4" })
|
|
2206
2207
|
})
|
|
2207
2208
|
]
|
|
2208
2209
|
}, r);
|
|
2209
|
-
}), /* @__PURE__ */ (
|
|
2210
|
+
}), /* @__PURE__ */ N(p, {
|
|
2210
2211
|
type: "button",
|
|
2211
2212
|
variant: "outline",
|
|
2212
2213
|
size: "sm",
|
|
@@ -2216,64 +2217,64 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2216
2217
|
value: ""
|
|
2217
2218
|
});
|
|
2218
2219
|
},
|
|
2219
|
-
children: [/* @__PURE__ */ (
|
|
2220
|
+
children: [/* @__PURE__ */ M(F, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.addHeader")]
|
|
2220
2221
|
})]
|
|
2221
2222
|
})
|
|
2222
2223
|
})]
|
|
2223
2224
|
}),
|
|
2224
|
-
/* @__PURE__ */ (
|
|
2225
|
+
/* @__PURE__ */ M(d, {
|
|
2225
2226
|
selector: (e) => ({
|
|
2226
2227
|
method: e.values.method,
|
|
2227
2228
|
sendAllFormValues: e.values.sendAllFormValues
|
|
2228
2229
|
}),
|
|
2229
|
-
children: ({ method: e, sendAllFormValues: t }) =>
|
|
2230
|
+
children: ({ method: e, sendAllFormValues: t }) => Ln.includes(e || "") && /* @__PURE__ */ N("div", {
|
|
2230
2231
|
className: "space-y-4",
|
|
2231
|
-
children: [/* @__PURE__ */ (
|
|
2232
|
+
children: [/* @__PURE__ */ M(u, {
|
|
2232
2233
|
name: "sendAllFormValues",
|
|
2233
|
-
children: (e) => /* @__PURE__ */ (
|
|
2234
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
2234
2235
|
className: "flex items-center space-x-2",
|
|
2235
|
-
children: [/* @__PURE__ */ (
|
|
2236
|
+
children: [/* @__PURE__ */ M(x, {
|
|
2236
2237
|
id: e.name,
|
|
2237
2238
|
checked: e.state.value,
|
|
2238
2239
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2239
|
-
}), /* @__PURE__ */ (
|
|
2240
|
+
}), /* @__PURE__ */ M(l, {
|
|
2240
2241
|
htmlFor: e.name,
|
|
2241
2242
|
children: a("editor.submitConfigForm.sendAllFormValues")
|
|
2242
2243
|
})]
|
|
2243
2244
|
})
|
|
2244
|
-
}), /* @__PURE__ */ (
|
|
2245
|
+
}), /* @__PURE__ */ M(u, {
|
|
2245
2246
|
name: "body",
|
|
2246
|
-
children: (e) => /* @__PURE__ */ (
|
|
2247
|
-
/* @__PURE__ */ (
|
|
2247
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
2248
|
+
/* @__PURE__ */ N("div", {
|
|
2248
2249
|
className: "mb-2 flex items-center justify-between",
|
|
2249
|
-
children: [/* @__PURE__ */ (
|
|
2250
|
+
children: [/* @__PURE__ */ M(l, {
|
|
2250
2251
|
htmlFor: e.name,
|
|
2251
2252
|
children: a("editor.submitConfigForm.requestBody")
|
|
2252
|
-
}), /* @__PURE__ */ (
|
|
2253
|
+
}), /* @__PURE__ */ N(J, { children: [/* @__PURE__ */ M(Y, {
|
|
2253
2254
|
asChild: !0,
|
|
2254
|
-
children: /* @__PURE__ */ (
|
|
2255
|
+
children: /* @__PURE__ */ N(p, {
|
|
2255
2256
|
type: "button",
|
|
2256
2257
|
variant: "ghost",
|
|
2257
2258
|
size: "sm",
|
|
2258
2259
|
disabled: t,
|
|
2259
|
-
children: [/* @__PURE__ */ (
|
|
2260
|
+
children: [/* @__PURE__ */ M(dt, { className: "mr-2 h-4 w-4" }), a("editor.submitConfigForm.insertVariable")]
|
|
2260
2261
|
})
|
|
2261
|
-
}), /* @__PURE__ */ (
|
|
2262
|
+
}), /* @__PURE__ */ M(X, {
|
|
2262
2263
|
align: "end",
|
|
2263
|
-
children: o.length === 0 ? /* @__PURE__ */ (
|
|
2264
|
+
children: o.length === 0 ? /* @__PURE__ */ M(Z, {
|
|
2264
2265
|
disabled: !0,
|
|
2265
2266
|
children: a("editor.submitConfigForm.noFieldsAvailable")
|
|
2266
|
-
}) : o.map((t) => /* @__PURE__ */ (
|
|
2267
|
+
}) : o.map((t) => /* @__PURE__ */ M(Z, {
|
|
2267
2268
|
onClick: () => {
|
|
2268
2269
|
let n = `{{${t.nodeId}}}`, r = e.state.value || "";
|
|
2269
2270
|
e.handleChange(r + n), s().then();
|
|
2270
2271
|
},
|
|
2271
|
-
children: /* @__PURE__ */ (
|
|
2272
|
+
children: /* @__PURE__ */ N("div", {
|
|
2272
2273
|
className: "flex flex-col",
|
|
2273
|
-
children: [/* @__PURE__ */ (
|
|
2274
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2274
2275
|
className: "font-medium",
|
|
2275
2276
|
children: t.label
|
|
2276
|
-
}), /* @__PURE__ */ (
|
|
2277
|
+
}), /* @__PURE__ */ M("span", {
|
|
2277
2278
|
className: "text-muted-foreground text-xs",
|
|
2278
2279
|
children: `{{${t.nodeId}}}`
|
|
2279
2280
|
})]
|
|
@@ -2281,7 +2282,7 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2281
2282
|
}, t.nodeId))
|
|
2282
2283
|
})] })]
|
|
2283
2284
|
}),
|
|
2284
|
-
/* @__PURE__ */ (
|
|
2285
|
+
/* @__PURE__ */ M(ne, {
|
|
2285
2286
|
id: e.name,
|
|
2286
2287
|
name: e.name,
|
|
2287
2288
|
value: e.state.value,
|
|
@@ -2291,26 +2292,26 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2291
2292
|
rows: 4,
|
|
2292
2293
|
disabled: t
|
|
2293
2294
|
}),
|
|
2294
|
-
/* @__PURE__ */ (
|
|
2295
|
+
/* @__PURE__ */ M(E, { children: a(t ? "editor.submitConfigForm.sendAllFormValuesDesc" : "editor.submitConfigForm.requestBodyDesc") })
|
|
2295
2296
|
] })
|
|
2296
2297
|
})]
|
|
2297
2298
|
})
|
|
2298
2299
|
}),
|
|
2299
|
-
/* @__PURE__ */ (
|
|
2300
|
+
/* @__PURE__ */ N("div", {
|
|
2300
2301
|
className: "space-y-4",
|
|
2301
2302
|
children: [
|
|
2302
|
-
/* @__PURE__ */ (
|
|
2303
|
+
/* @__PURE__ */ M("h4", {
|
|
2303
2304
|
className: "font-semibold text-sm",
|
|
2304
2305
|
children: a("editor.submitConfigForm.postSubmission")
|
|
2305
2306
|
}),
|
|
2306
|
-
/* @__PURE__ */ (
|
|
2307
|
+
/* @__PURE__ */ M(u, {
|
|
2307
2308
|
name: "redirectUrl",
|
|
2308
|
-
children: (e) => /* @__PURE__ */ (
|
|
2309
|
-
/* @__PURE__ */ (
|
|
2309
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
2310
|
+
/* @__PURE__ */ M(l, {
|
|
2310
2311
|
htmlFor: e.name,
|
|
2311
2312
|
children: a("editor.submitConfigForm.redirectUrl")
|
|
2312
2313
|
}),
|
|
2313
|
-
/* @__PURE__ */ (
|
|
2314
|
+
/* @__PURE__ */ M(m, {
|
|
2314
2315
|
id: e.name,
|
|
2315
2316
|
name: e.name,
|
|
2316
2317
|
value: e.state.value,
|
|
@@ -2318,21 +2319,21 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2318
2319
|
onChange: ({ target: t }) => e.handleChange(t.value),
|
|
2319
2320
|
placeholder: a("editor.submitConfigForm.redirectUrlPlaceholder")
|
|
2320
2321
|
}),
|
|
2321
|
-
/* @__PURE__ */ (
|
|
2322
|
+
/* @__PURE__ */ M(E, { children: a("editor.submitConfigForm.redirectUrlDesc") })
|
|
2322
2323
|
] })
|
|
2323
2324
|
}),
|
|
2324
|
-
/* @__PURE__ */ (
|
|
2325
|
+
/* @__PURE__ */ N("div", {
|
|
2325
2326
|
className: "flex items-center gap-2",
|
|
2326
|
-
children: [/* @__PURE__ */ (
|
|
2327
|
+
children: [/* @__PURE__ */ M(u, {
|
|
2327
2328
|
name: "successMessage",
|
|
2328
|
-
children: (e) => /* @__PURE__ */ (
|
|
2329
|
+
children: (e) => /* @__PURE__ */ N(T, {
|
|
2329
2330
|
className: "flex-1",
|
|
2330
2331
|
children: [
|
|
2331
|
-
/* @__PURE__ */ (
|
|
2332
|
+
/* @__PURE__ */ M(l, {
|
|
2332
2333
|
htmlFor: e.name,
|
|
2333
2334
|
children: a("editor.submitConfigForm.successMessage")
|
|
2334
2335
|
}),
|
|
2335
|
-
/* @__PURE__ */ (
|
|
2336
|
+
/* @__PURE__ */ M(m, {
|
|
2336
2337
|
id: e.name,
|
|
2337
2338
|
name: e.name,
|
|
2338
2339
|
value: e.state.value?.[n] || "",
|
|
@@ -2345,26 +2346,26 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2345
2346
|
},
|
|
2346
2347
|
placeholder: a("editor.submitConfigForm.successMessagePlaceholder")
|
|
2347
2348
|
}),
|
|
2348
|
-
/* @__PURE__ */ (
|
|
2349
|
+
/* @__PURE__ */ M(E, { children: a("editor.submitConfigForm.successMessageDesc") })
|
|
2349
2350
|
]
|
|
2350
2351
|
})
|
|
2351
|
-
}), /* @__PURE__ */ (
|
|
2352
|
+
}), /* @__PURE__ */ M(Q, {
|
|
2352
2353
|
value: n,
|
|
2353
2354
|
onValueChange: r
|
|
2354
2355
|
})]
|
|
2355
2356
|
}),
|
|
2356
|
-
/* @__PURE__ */ (
|
|
2357
|
+
/* @__PURE__ */ N("div", {
|
|
2357
2358
|
className: "flex items-center gap-2",
|
|
2358
|
-
children: [/* @__PURE__ */ (
|
|
2359
|
+
children: [/* @__PURE__ */ M(u, {
|
|
2359
2360
|
name: "errorMessage",
|
|
2360
|
-
children: (e) => /* @__PURE__ */ (
|
|
2361
|
+
children: (e) => /* @__PURE__ */ N(T, {
|
|
2361
2362
|
className: "flex-1",
|
|
2362
2363
|
children: [
|
|
2363
|
-
/* @__PURE__ */ (
|
|
2364
|
+
/* @__PURE__ */ M(l, {
|
|
2364
2365
|
htmlFor: e.name,
|
|
2365
2366
|
children: a("editor.submitConfigForm.errorMessage")
|
|
2366
2367
|
}),
|
|
2367
|
-
/* @__PURE__ */ (
|
|
2368
|
+
/* @__PURE__ */ M(m, {
|
|
2368
2369
|
id: e.name,
|
|
2369
2370
|
name: e.name,
|
|
2370
2371
|
value: e.state.value?.[n] || "",
|
|
@@ -2377,30 +2378,30 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2377
2378
|
},
|
|
2378
2379
|
placeholder: a("editor.submitConfigForm.errorMessagePlaceholder")
|
|
2379
2380
|
}),
|
|
2380
|
-
/* @__PURE__ */ (
|
|
2381
|
+
/* @__PURE__ */ M(E, { children: a("editor.submitConfigForm.errorMessageDesc") })
|
|
2381
2382
|
]
|
|
2382
2383
|
})
|
|
2383
|
-
}), /* @__PURE__ */ (
|
|
2384
|
+
}), /* @__PURE__ */ M(Q, {
|
|
2384
2385
|
value: n,
|
|
2385
2386
|
onValueChange: r
|
|
2386
2387
|
})]
|
|
2387
2388
|
})
|
|
2388
2389
|
]
|
|
2389
2390
|
}),
|
|
2390
|
-
/* @__PURE__ */ (
|
|
2391
|
+
/* @__PURE__ */ N("div", {
|
|
2391
2392
|
className: "space-y-4",
|
|
2392
|
-
children: [/* @__PURE__ */ (
|
|
2393
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
2393
2394
|
className: "font-semibold text-sm",
|
|
2394
2395
|
children: a("editor.submitConfigForm.behavior")
|
|
2395
|
-
}), /* @__PURE__ */ (
|
|
2396
|
+
}), /* @__PURE__ */ M(u, {
|
|
2396
2397
|
name: "showLoading",
|
|
2397
|
-
children: (e) => /* @__PURE__ */ (
|
|
2398
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
2398
2399
|
className: "flex items-center space-x-2",
|
|
2399
|
-
children: [/* @__PURE__ */ (
|
|
2400
|
+
children: [/* @__PURE__ */ M(x, {
|
|
2400
2401
|
id: e.name,
|
|
2401
2402
|
checked: e.state.value,
|
|
2402
2403
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2403
|
-
}), /* @__PURE__ */ (
|
|
2404
|
+
}), /* @__PURE__ */ M(l, {
|
|
2404
2405
|
htmlFor: e.name,
|
|
2405
2406
|
children: a("editor.submitConfigForm.showLoadingState")
|
|
2406
2407
|
})]
|
|
@@ -2409,69 +2410,69 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2409
2410
|
})
|
|
2410
2411
|
]
|
|
2411
2412
|
}) });
|
|
2412
|
-
},
|
|
2413
|
-
let [h, g] =
|
|
2414
|
-
e === C ?
|
|
2413
|
+
}, zn = ({ 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 }) => {
|
|
2414
|
+
let [h, g] = z(!1), [v, b] = z(""), x = (e) => e ?? "", S = (e) => e.trim().toLowerCase(), C = x(n), w = n !== null && n !== "", ee = w ? e.find((e) => x(e.value) === C) : void 0, T = S(v), E = m && T !== "" && !e.some((e) => S(e.label) === T || S(e.value ?? "") === T), ne = (e) => {
|
|
2415
|
+
e === C ? f && r?.("") : r?.(e), g(!1), b("");
|
|
2415
2416
|
};
|
|
2416
|
-
return /* @__PURE__ */ (
|
|
2417
|
+
return /* @__PURE__ */ N(le, {
|
|
2417
2418
|
open: h,
|
|
2418
2419
|
onOpenChange: g,
|
|
2419
|
-
children: [/* @__PURE__ */ (
|
|
2420
|
+
children: [/* @__PURE__ */ M(u, {
|
|
2420
2421
|
asChild: !0,
|
|
2421
2422
|
id: t,
|
|
2422
|
-
children: /* @__PURE__ */ (
|
|
2423
|
+
children: /* @__PURE__ */ N(p, {
|
|
2423
2424
|
type: "button",
|
|
2424
2425
|
variant: "outline",
|
|
2425
2426
|
role: "combobox",
|
|
2426
2427
|
"aria-expanded": h,
|
|
2427
|
-
className:
|
|
2428
|
-
children: [/* @__PURE__ */ (
|
|
2428
|
+
className: d("w-full justify-between font-normal", l),
|
|
2429
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2429
2430
|
className: "truncate",
|
|
2430
|
-
children:
|
|
2431
|
-
}), /* @__PURE__ */ (
|
|
2431
|
+
children: w && ee ? ee.label : i
|
|
2432
|
+
}), /* @__PURE__ */ M(Le, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
|
|
2432
2433
|
})
|
|
2433
|
-
}), /* @__PURE__ */ (
|
|
2434
|
+
}), /* @__PURE__ */ M(_, {
|
|
2434
2435
|
className: "w-full p-0",
|
|
2435
2436
|
align: "start",
|
|
2436
|
-
children: /* @__PURE__ */ (
|
|
2437
|
+
children: /* @__PURE__ */ N(ie, {
|
|
2437
2438
|
shouldFilter: !1,
|
|
2438
|
-
children: [/* @__PURE__ */ (
|
|
2439
|
+
children: [/* @__PURE__ */ M(y, {
|
|
2439
2440
|
placeholder: a,
|
|
2440
|
-
value:
|
|
2441
|
-
onValueChange:
|
|
2442
|
-
}), /* @__PURE__ */ (
|
|
2443
|
-
/* @__PURE__ */ (
|
|
2444
|
-
|
|
2441
|
+
value: v,
|
|
2442
|
+
onValueChange: b
|
|
2443
|
+
}), /* @__PURE__ */ N(O, { children: [
|
|
2444
|
+
/* @__PURE__ */ M(oe, { children: c }),
|
|
2445
|
+
f && w && /* @__PURE__ */ M(te, { children: /* @__PURE__ */ N(D, {
|
|
2445
2446
|
value: "__clear__",
|
|
2446
2447
|
onSelect: () => {
|
|
2447
|
-
r?.(""), g(!1),
|
|
2448
|
+
r?.(""), g(!1), b("");
|
|
2448
2449
|
},
|
|
2449
2450
|
className: "mt-1 text-muted-foreground",
|
|
2450
|
-
children: [/* @__PURE__ */ (
|
|
2451
|
+
children: [/* @__PURE__ */ M(I, { className: "mr-2 h-4 w-4" }), s]
|
|
2451
2452
|
}) }),
|
|
2452
|
-
/* @__PURE__ */ (
|
|
2453
|
-
value: `__create__${
|
|
2453
|
+
/* @__PURE__ */ N(te, { children: [E && /* @__PURE__ */ N(D, {
|
|
2454
|
+
value: `__create__${v}`,
|
|
2454
2455
|
onSelect: () => {
|
|
2455
|
-
|
|
2456
|
+
v.trim() && (r?.(v.trim()), g(!1), b(""));
|
|
2456
2457
|
},
|
|
2457
2458
|
className: "text-primary",
|
|
2458
|
-
children: [/* @__PURE__ */ (
|
|
2459
|
+
children: [/* @__PURE__ */ M(F, { className: "mr-2 h-4 w-4" }), o(v)]
|
|
2459
2460
|
}), e.filter((e) => {
|
|
2460
|
-
let t =
|
|
2461
|
+
let t = v.toLowerCase();
|
|
2461
2462
|
return e.label.toLowerCase().includes(t) || (e.value?.toLowerCase() ?? "").includes(t);
|
|
2462
|
-
}).map((e, t) => /* @__PURE__ */ (
|
|
2463
|
+
}).map((e, t) => /* @__PURE__ */ N(D, {
|
|
2463
2464
|
value: e.label,
|
|
2464
|
-
onSelect: () =>
|
|
2465
|
-
children: [/* @__PURE__ */ (
|
|
2465
|
+
onSelect: () => ne(e?.value || ""),
|
|
2466
|
+
children: [/* @__PURE__ */ M(Pe, {
|
|
2466
2467
|
"aria-hidden": "true",
|
|
2467
|
-
className:
|
|
2468
|
+
className: d("mr-2 h-4 w-4", w && x(e.value) === C ? "opacity-100" : "opacity-0")
|
|
2468
2469
|
}), e.label]
|
|
2469
2470
|
}, e.value ?? e.label ?? t))] })
|
|
2470
2471
|
] })]
|
|
2471
2472
|
})
|
|
2472
2473
|
})]
|
|
2473
2474
|
});
|
|
2474
|
-
},
|
|
2475
|
+
}, Bn = Object.entries({
|
|
2475
2476
|
alphanumeric: "^[a-zA-Z0-9]+$",
|
|
2476
2477
|
email: "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
|
|
2477
2478
|
letters: "^[a-zA-Z]+$",
|
|
@@ -2480,184 +2481,184 @@ var On = ({ aiConfig: e, onGenerate: t }) => {
|
|
|
2480
2481
|
}).map(([e, t]) => ({
|
|
2481
2482
|
label: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "),
|
|
2482
2483
|
value: t
|
|
2483
|
-
})),
|
|
2484
|
+
})), Vn = ({ id: e, value: t, onValueChange: n }) => /* @__PURE__ */ M(zn, {
|
|
2484
2485
|
id: e,
|
|
2485
|
-
options:
|
|
2486
|
+
options: R(() => t && !Bn.some((e) => e.value === t) ? [...Bn, {
|
|
2486
2487
|
label: `Custom: ${t}`,
|
|
2487
2488
|
value: t
|
|
2488
|
-
}] :
|
|
2489
|
+
}] : Bn, [t]),
|
|
2489
2490
|
value: t,
|
|
2490
2491
|
onValueChange: n,
|
|
2491
2492
|
placeholder: "Select or create a pattern",
|
|
2492
2493
|
searchPlaceholder: "Search patterns...",
|
|
2493
2494
|
createLabel: (e) => `Use pattern: ${e}`
|
|
2494
|
-
}),
|
|
2495
|
+
}), Hn = 400, Un = .8, Wn = (e) => new Promise((t, n) => {
|
|
2495
2496
|
let r = new FileReader();
|
|
2496
2497
|
r.onerror = () => n(/* @__PURE__ */ Error("read_failed")), r.onload = () => {
|
|
2497
2498
|
let e = new Image();
|
|
2498
2499
|
e.onload = () => t(e), e.onerror = () => n(/* @__PURE__ */ Error("decode_failed")), e.src = r.result;
|
|
2499
2500
|
}, r.readAsDataURL(e);
|
|
2500
|
-
}),
|
|
2501
|
+
}), Gn = async (e) => {
|
|
2501
2502
|
if (!e.type.startsWith("image/")) throw Error("invalid_type");
|
|
2502
2503
|
if (e.size > 5242880) throw Error("too_large");
|
|
2503
|
-
let t = await
|
|
2504
|
+
let t = await Wn(e), n = Math.min(1, Hn / Math.max(t.width, t.height)), r = document.createElement("canvas");
|
|
2504
2505
|
r.width = Math.round(t.width * n), r.height = Math.round(t.height * n);
|
|
2505
2506
|
let i = r.getContext("2d");
|
|
2506
2507
|
if (!i) throw Error("canvas_unavailable");
|
|
2507
|
-
return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg",
|
|
2508
|
-
},
|
|
2508
|
+
return i.drawImage(t, 0, 0, r.width, r.height), r.toDataURL("image/jpeg", Un);
|
|
2509
|
+
}, Kn = 400, qn = (e) => {
|
|
2509
2510
|
if (!/^https?:\/\//i.test(e)) return !1;
|
|
2510
2511
|
try {
|
|
2511
2512
|
return !!new URL(e).hostname;
|
|
2512
2513
|
} catch {
|
|
2513
2514
|
return !1;
|
|
2514
2515
|
}
|
|
2515
|
-
},
|
|
2516
|
-
let n =
|
|
2517
|
-
|
|
2516
|
+
}, Jn = ({ value: e, onChange: t }) => {
|
|
2517
|
+
let n = bt(null), r = bt(null), [i, a] = z(!1), [o, s] = z(e && /^https?:\/\//i.test(e) ? e : ""), c = G();
|
|
2518
|
+
vt(() => {
|
|
2518
2519
|
i || s(e && /^https?:\/\//i.test(e) ? e : "");
|
|
2519
|
-
}, [i, e]),
|
|
2520
|
+
}, [i, e]), vt(() => () => {
|
|
2520
2521
|
r.current && clearTimeout(r.current);
|
|
2521
2522
|
}, []);
|
|
2522
2523
|
let l = async (e) => {
|
|
2523
2524
|
let r = e.target.files?.[0];
|
|
2524
2525
|
if (r) try {
|
|
2525
|
-
t(await
|
|
2526
|
+
t(await Gn(r)), a(!1);
|
|
2526
2527
|
} catch (e) {
|
|
2527
2528
|
let t = e.message;
|
|
2528
|
-
t === "too_large" ?
|
|
2529
|
+
t === "too_large" ? H.error(c("editor.inputNodeForm.optionImageTooLarge")) : t === "invalid_type" ? H.error(c("editor.inputNodeForm.optionImageInvalid")) : H.error(c("editor.inputNodeForm.optionImageError"));
|
|
2529
2530
|
} finally {
|
|
2530
2531
|
n.current && (n.current.value = "");
|
|
2531
2532
|
}
|
|
2532
|
-
},
|
|
2533
|
+
}, d = () => {
|
|
2533
2534
|
let e = o.trim();
|
|
2534
2535
|
e && (t(e), a(!1));
|
|
2535
2536
|
};
|
|
2536
|
-
return /* @__PURE__ */ (
|
|
2537
|
+
return /* @__PURE__ */ N("div", {
|
|
2537
2538
|
className: "relative",
|
|
2538
2539
|
children: [
|
|
2539
|
-
/* @__PURE__ */ (
|
|
2540
|
+
/* @__PURE__ */ M("input", {
|
|
2540
2541
|
ref: n,
|
|
2541
2542
|
type: "file",
|
|
2542
2543
|
accept: "image/*",
|
|
2543
2544
|
className: "hidden",
|
|
2544
2545
|
onChange: l
|
|
2545
2546
|
}),
|
|
2546
|
-
/* @__PURE__ */ (
|
|
2547
|
+
/* @__PURE__ */ N(le, {
|
|
2547
2548
|
open: i,
|
|
2548
2549
|
onOpenChange: a,
|
|
2549
|
-
children: [/* @__PURE__ */ (
|
|
2550
|
+
children: [/* @__PURE__ */ M(u, {
|
|
2550
2551
|
asChild: !0,
|
|
2551
|
-
children: e ? /* @__PURE__ */ (
|
|
2552
|
+
children: e ? /* @__PURE__ */ M("button", {
|
|
2552
2553
|
type: "button",
|
|
2553
2554
|
className: "h-9 w-9 cursor-pointer overflow-hidden rounded-md border border-input",
|
|
2554
2555
|
"aria-label": c("editor.inputNodeForm.optionImageReplace"),
|
|
2555
|
-
children: /* @__PURE__ */ (
|
|
2556
|
+
children: /* @__PURE__ */ M("img", {
|
|
2556
2557
|
src: e,
|
|
2557
2558
|
alt: "",
|
|
2558
2559
|
className: "h-full w-full object-cover"
|
|
2559
2560
|
})
|
|
2560
|
-
}) : /* @__PURE__ */ (
|
|
2561
|
+
}) : /* @__PURE__ */ M(p, {
|
|
2561
2562
|
type: "button",
|
|
2562
2563
|
variant: "outline",
|
|
2563
2564
|
size: "icon",
|
|
2564
2565
|
"aria-label": c("editor.inputNodeForm.optionImageAdd"),
|
|
2565
|
-
children: /* @__PURE__ */ (
|
|
2566
|
+
children: /* @__PURE__ */ M(qe, { className: "h-4 w-4" })
|
|
2566
2567
|
})
|
|
2567
|
-
}), /* @__PURE__ */ (
|
|
2568
|
+
}), /* @__PURE__ */ N(_, {
|
|
2568
2569
|
align: "start",
|
|
2569
2570
|
className: "w-64 space-y-3 p-3",
|
|
2570
2571
|
children: [
|
|
2571
|
-
/* @__PURE__ */ (
|
|
2572
|
+
/* @__PURE__ */ N(p, {
|
|
2572
2573
|
type: "button",
|
|
2573
2574
|
variant: "outline",
|
|
2574
2575
|
size: "sm",
|
|
2575
2576
|
className: "w-full",
|
|
2576
2577
|
onClick: () => n.current?.click(),
|
|
2577
|
-
children: [/* @__PURE__ */ (
|
|
2578
|
+
children: [/* @__PURE__ */ M(ut, { className: "mr-2 h-4 w-4" }), c("editor.inputNodeForm.optionImageUpload")]
|
|
2578
2579
|
}),
|
|
2579
|
-
/* @__PURE__ */ (
|
|
2580
|
-
/* @__PURE__ */ (
|
|
2580
|
+
/* @__PURE__ */ M(se, {}),
|
|
2581
|
+
/* @__PURE__ */ N("div", {
|
|
2581
2582
|
className: "flex items-center gap-2",
|
|
2582
|
-
children: [/* @__PURE__ */ (
|
|
2583
|
+
children: [/* @__PURE__ */ M(Ye, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ M(m, {
|
|
2583
2584
|
placeholder: c("editor.inputNodeForm.optionImageUrlPlaceholder"),
|
|
2584
2585
|
value: o,
|
|
2585
2586
|
onChange: (n) => {
|
|
2586
2587
|
let i = n.target.value;
|
|
2587
2588
|
s(i), r.current && clearTimeout(r.current);
|
|
2588
2589
|
let a = i.trim();
|
|
2589
|
-
!
|
|
2590
|
+
!qn(a) || a === e || (r.current = setTimeout(() => {
|
|
2590
2591
|
t(a);
|
|
2591
|
-
},
|
|
2592
|
+
}, Kn));
|
|
2592
2593
|
},
|
|
2593
2594
|
onKeyDown: (e) => {
|
|
2594
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
2595
|
+
e.key === "Enter" && (e.preventDefault(), d());
|
|
2595
2596
|
},
|
|
2596
|
-
onBlur:
|
|
2597
|
+
onBlur: d
|
|
2597
2598
|
})]
|
|
2598
2599
|
})
|
|
2599
2600
|
]
|
|
2600
2601
|
})]
|
|
2601
2602
|
}),
|
|
2602
|
-
e && /* @__PURE__ */ (
|
|
2603
|
+
e && /* @__PURE__ */ M("button", {
|
|
2603
2604
|
type: "button",
|
|
2604
2605
|
onClick: (e) => {
|
|
2605
2606
|
e.stopPropagation(), t("");
|
|
2606
2607
|
},
|
|
2607
2608
|
className: "-top-1 -right-1 absolute flex h-4 w-4 cursor-pointer items-center justify-center rounded-full bg-destructive text-destructive-foreground",
|
|
2608
2609
|
"aria-label": c("editor.inputNodeForm.optionImageRemove"),
|
|
2609
|
-
children: /* @__PURE__ */ (
|
|
2610
|
+
children: /* @__PURE__ */ M(I, { className: "h-3 w-3" })
|
|
2610
2611
|
})
|
|
2611
2612
|
]
|
|
2612
2613
|
});
|
|
2613
|
-
},
|
|
2614
|
-
let n =
|
|
2615
|
-
return /* @__PURE__ */ (
|
|
2614
|
+
}, Yn = ({ value: e, onValueChange: t }) => {
|
|
2615
|
+
let n = G(), r = yt();
|
|
2616
|
+
return /* @__PURE__ */ N(A, { children: [/* @__PURE__ */ M(ue, {
|
|
2616
2617
|
htmlFor: r,
|
|
2617
2618
|
children: n("editor.selectInputType.type")
|
|
2618
|
-
}), /* @__PURE__ */ (
|
|
2619
|
+
}), /* @__PURE__ */ N(v, {
|
|
2619
2620
|
value: e,
|
|
2620
2621
|
onValueChange: t,
|
|
2621
|
-
children: [/* @__PURE__ */ (
|
|
2622
|
+
children: [/* @__PURE__ */ M(g, {
|
|
2622
2623
|
id: r,
|
|
2623
2624
|
className: "w-full capitalize",
|
|
2624
|
-
children: /* @__PURE__ */ (
|
|
2625
|
-
}), /* @__PURE__ */ (
|
|
2625
|
+
children: /* @__PURE__ */ M(c, { placeholder: "" })
|
|
2626
|
+
}), /* @__PURE__ */ M(k, { children: /* @__PURE__ */ M(A, { children: Object.values(K).map((e) => /* @__PURE__ */ N(b, {
|
|
2626
2627
|
value: e,
|
|
2627
2628
|
className: "capitalize",
|
|
2628
|
-
children: [/* @__PURE__ */ (
|
|
2629
|
+
children: [/* @__PURE__ */ M(dn(e), {}), e]
|
|
2629
2630
|
}, e)) }) })]
|
|
2630
2631
|
})] });
|
|
2631
2632
|
};
|
|
2632
2633
|
//#endregion
|
|
2633
2634
|
//#region src/shared/components/ui/collapsible.tsx
|
|
2634
|
-
function
|
|
2635
|
-
return /* @__PURE__ */ (
|
|
2635
|
+
function Xn({ ...e }) {
|
|
2636
|
+
return /* @__PURE__ */ M(Tt.Root, {
|
|
2636
2637
|
"data-slot": "collapsible",
|
|
2637
2638
|
...e
|
|
2638
2639
|
});
|
|
2639
2640
|
}
|
|
2640
|
-
function
|
|
2641
|
-
return /* @__PURE__ */ (
|
|
2641
|
+
function Zn({ ...e }) {
|
|
2642
|
+
return /* @__PURE__ */ M(Tt.CollapsibleTrigger, {
|
|
2642
2643
|
"data-slot": "collapsible-trigger",
|
|
2643
2644
|
...e
|
|
2644
2645
|
});
|
|
2645
2646
|
}
|
|
2646
|
-
function
|
|
2647
|
-
return /* @__PURE__ */ (
|
|
2647
|
+
function Qn({ ...e }) {
|
|
2648
|
+
return /* @__PURE__ */ M(Tt.CollapsibleContent, {
|
|
2648
2649
|
"data-slot": "collapsible-content",
|
|
2649
2650
|
...e
|
|
2650
2651
|
});
|
|
2651
2652
|
}
|
|
2652
2653
|
//#endregion
|
|
2653
2654
|
//#region src/editor/features/TreegeEditor/forms/InputNodeForm.tsx
|
|
2654
|
-
var
|
|
2655
|
-
let [e, t] =
|
|
2655
|
+
var $n = () => {
|
|
2656
|
+
let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), i = [
|
|
2656
2657
|
"select",
|
|
2657
2658
|
"radio",
|
|
2658
2659
|
"autocomplete",
|
|
2659
2660
|
"checkbox"
|
|
2660
|
-
].includes(n?.data?.type || ""), a =
|
|
2661
|
+
].includes(n?.data?.type || ""), a = At(n?.id), o = G(), s = n?.data?.type === "submit", { handleSubmit: u, Field: d } = P({
|
|
2661
2662
|
defaultValues: {
|
|
2662
2663
|
defaultValue: n?.data?.defaultValue,
|
|
2663
2664
|
disablePast: n?.data?.disablePast,
|
|
@@ -2685,30 +2686,30 @@ var Qn = () => {
|
|
|
2685
2686
|
r(e);
|
|
2686
2687
|
}
|
|
2687
2688
|
});
|
|
2688
|
-
return /* @__PURE__ */ (
|
|
2689
|
+
return /* @__PURE__ */ M("form", {
|
|
2689
2690
|
onSubmit: (e) => {
|
|
2690
2691
|
e.preventDefault(), e.stopPropagation();
|
|
2691
2692
|
},
|
|
2692
|
-
children: /* @__PURE__ */ (
|
|
2693
|
+
children: /* @__PURE__ */ N("div", {
|
|
2693
2694
|
className: "grid gap-6",
|
|
2694
2695
|
children: [
|
|
2695
|
-
/* @__PURE__ */ (
|
|
2696
|
+
/* @__PURE__ */ M(d, {
|
|
2696
2697
|
name: "type",
|
|
2697
|
-
children: (e) => /* @__PURE__ */ (
|
|
2698
|
+
children: (e) => /* @__PURE__ */ M(T, { children: /* @__PURE__ */ M(Yn, {
|
|
2698
2699
|
value: e.state.value,
|
|
2699
2700
|
onValueChange: (t) => e.handleChange(t)
|
|
2700
2701
|
}) })
|
|
2701
2702
|
}),
|
|
2702
|
-
/* @__PURE__ */ (
|
|
2703
|
+
/* @__PURE__ */ N("div", {
|
|
2703
2704
|
className: "flex items-end gap-2",
|
|
2704
|
-
children: [/* @__PURE__ */ (
|
|
2705
|
+
children: [/* @__PURE__ */ M(d, {
|
|
2705
2706
|
name: "label",
|
|
2706
|
-
children: (t) => /* @__PURE__ */ (
|
|
2707
|
+
children: (t) => /* @__PURE__ */ N(T, {
|
|
2707
2708
|
className: "flex-1",
|
|
2708
|
-
children: [/* @__PURE__ */ (
|
|
2709
|
+
children: [/* @__PURE__ */ M(l, {
|
|
2709
2710
|
htmlFor: t.name,
|
|
2710
2711
|
children: o("editor.inputNodeForm.label")
|
|
2711
|
-
}), /* @__PURE__ */ (
|
|
2712
|
+
}), /* @__PURE__ */ M(m, {
|
|
2712
2713
|
autoFocus: !0,
|
|
2713
2714
|
id: t.name,
|
|
2714
2715
|
name: t.name,
|
|
@@ -2722,21 +2723,21 @@ var Qn = () => {
|
|
|
2722
2723
|
}
|
|
2723
2724
|
})]
|
|
2724
2725
|
})
|
|
2725
|
-
}), /* @__PURE__ */ (
|
|
2726
|
+
}), /* @__PURE__ */ M(Q, {
|
|
2726
2727
|
value: e,
|
|
2727
2728
|
onValueChange: t
|
|
2728
2729
|
})]
|
|
2729
2730
|
}),
|
|
2730
|
-
!s && n?.data?.type !== "file" && /* @__PURE__ */ (
|
|
2731
|
+
!s && n?.data?.type !== "file" && /* @__PURE__ */ N("div", {
|
|
2731
2732
|
className: "flex items-end gap-2",
|
|
2732
|
-
children: [/* @__PURE__ */ (
|
|
2733
|
+
children: [/* @__PURE__ */ M(d, {
|
|
2733
2734
|
name: "placeholder",
|
|
2734
|
-
children: (t) => /* @__PURE__ */ (
|
|
2735
|
+
children: (t) => /* @__PURE__ */ N(T, {
|
|
2735
2736
|
className: "flex-1",
|
|
2736
|
-
children: [/* @__PURE__ */ (
|
|
2737
|
+
children: [/* @__PURE__ */ M(l, {
|
|
2737
2738
|
htmlFor: t.name,
|
|
2738
2739
|
children: o("editor.inputNodeForm.placeholder")
|
|
2739
|
-
}), /* @__PURE__ */ (
|
|
2740
|
+
}), /* @__PURE__ */ M(m, {
|
|
2740
2741
|
id: t.name,
|
|
2741
2742
|
name: t.name,
|
|
2742
2743
|
value: t.state.value?.[e] || "",
|
|
@@ -2749,21 +2750,21 @@ var Qn = () => {
|
|
|
2749
2750
|
}
|
|
2750
2751
|
})]
|
|
2751
2752
|
})
|
|
2752
|
-
}), /* @__PURE__ */ (
|
|
2753
|
+
}), /* @__PURE__ */ M(Q, {
|
|
2753
2754
|
value: e,
|
|
2754
2755
|
onValueChange: t
|
|
2755
2756
|
})]
|
|
2756
2757
|
}),
|
|
2757
|
-
!s && /* @__PURE__ */ (
|
|
2758
|
+
!s && /* @__PURE__ */ N("div", {
|
|
2758
2759
|
className: "flex items-end gap-2",
|
|
2759
|
-
children: [/* @__PURE__ */ (
|
|
2760
|
+
children: [/* @__PURE__ */ M(d, {
|
|
2760
2761
|
name: "helperText",
|
|
2761
|
-
children: (t) => /* @__PURE__ */ (
|
|
2762
|
+
children: (t) => /* @__PURE__ */ N(T, {
|
|
2762
2763
|
className: "flex-1",
|
|
2763
|
-
children: [/* @__PURE__ */ (
|
|
2764
|
+
children: [/* @__PURE__ */ M(l, {
|
|
2764
2765
|
htmlFor: t.name,
|
|
2765
2766
|
children: o("editor.inputNodeForm.helperText")
|
|
2766
|
-
}), /* @__PURE__ */ (
|
|
2767
|
+
}), /* @__PURE__ */ M(m, {
|
|
2767
2768
|
id: t.name,
|
|
2768
2769
|
name: t.name,
|
|
2769
2770
|
value: t.state.value?.[e] || "",
|
|
@@ -2776,135 +2777,135 @@ var Qn = () => {
|
|
|
2776
2777
|
}
|
|
2777
2778
|
})]
|
|
2778
2779
|
})
|
|
2779
|
-
}), /* @__PURE__ */ (
|
|
2780
|
+
}), /* @__PURE__ */ M(Q, {
|
|
2780
2781
|
value: e,
|
|
2781
2782
|
onValueChange: t
|
|
2782
2783
|
})]
|
|
2783
2784
|
}),
|
|
2784
|
-
n?.data?.type === "http" && /* @__PURE__ */ (
|
|
2785
|
+
n?.data?.type === "http" && /* @__PURE__ */ N(Xn, {
|
|
2785
2786
|
defaultOpen: !0,
|
|
2786
2787
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2787
|
-
children: [/* @__PURE__ */ (
|
|
2788
|
+
children: [/* @__PURE__ */ M(Zn, {
|
|
2788
2789
|
asChild: !0,
|
|
2789
|
-
children: /* @__PURE__ */ (
|
|
2790
|
+
children: /* @__PURE__ */ N("div", {
|
|
2790
2791
|
className: "flex items-center justify-between gap-4",
|
|
2791
|
-
children: [/* @__PURE__ */ (
|
|
2792
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
2792
2793
|
className: "font-semibold text-sm",
|
|
2793
2794
|
children: o("editor.inputNodeForm.httpConfiguration")
|
|
2794
|
-
}), /* @__PURE__ */ (
|
|
2795
|
+
}), /* @__PURE__ */ N(p, {
|
|
2795
2796
|
variant: "ghost",
|
|
2796
2797
|
size: "icon",
|
|
2797
2798
|
className: "size-8",
|
|
2798
|
-
children: [/* @__PURE__ */ (
|
|
2799
|
+
children: [/* @__PURE__ */ M(Le, {}), /* @__PURE__ */ M("span", {
|
|
2799
2800
|
className: "sr-only",
|
|
2800
2801
|
children: o("common.toggle")
|
|
2801
2802
|
})]
|
|
2802
2803
|
})]
|
|
2803
2804
|
})
|
|
2804
|
-
}), /* @__PURE__ */ (
|
|
2805
|
+
}), /* @__PURE__ */ M(Qn, {
|
|
2805
2806
|
className: "flex flex-col gap-4",
|
|
2806
|
-
children: /* @__PURE__ */ (
|
|
2807
|
+
children: /* @__PURE__ */ M(d, {
|
|
2807
2808
|
name: "httpConfig",
|
|
2808
|
-
children: (e) => /* @__PURE__ */ (
|
|
2809
|
+
children: (e) => /* @__PURE__ */ M(In, {
|
|
2809
2810
|
value: e.state.value,
|
|
2810
2811
|
onChange: (t) => {
|
|
2811
|
-
e.handleChange(t),
|
|
2812
|
+
e.handleChange(t), u().then();
|
|
2812
2813
|
}
|
|
2813
2814
|
})
|
|
2814
2815
|
})
|
|
2815
2816
|
})]
|
|
2816
2817
|
}),
|
|
2817
|
-
s && /* @__PURE__ */ (
|
|
2818
|
+
s && /* @__PURE__ */ N(Xn, {
|
|
2818
2819
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2819
|
-
children: [/* @__PURE__ */ (
|
|
2820
|
+
children: [/* @__PURE__ */ M(Zn, {
|
|
2820
2821
|
asChild: !0,
|
|
2821
|
-
children: /* @__PURE__ */ (
|
|
2822
|
+
children: /* @__PURE__ */ N("div", {
|
|
2822
2823
|
className: "flex items-center justify-between gap-4",
|
|
2823
|
-
children: [/* @__PURE__ */ (
|
|
2824
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
2824
2825
|
className: "font-semibold text-sm",
|
|
2825
2826
|
children: o("editor.inputNodeForm.submitConfiguration")
|
|
2826
|
-
}), /* @__PURE__ */ (
|
|
2827
|
+
}), /* @__PURE__ */ N(p, {
|
|
2827
2828
|
variant: "ghost",
|
|
2828
2829
|
size: "icon",
|
|
2829
2830
|
className: "size-8",
|
|
2830
|
-
children: [/* @__PURE__ */ (
|
|
2831
|
+
children: [/* @__PURE__ */ M(Le, {}), /* @__PURE__ */ M("span", {
|
|
2831
2832
|
className: "sr-only",
|
|
2832
2833
|
children: o("common.toggle")
|
|
2833
2834
|
})]
|
|
2834
2835
|
})]
|
|
2835
2836
|
})
|
|
2836
|
-
}), /* @__PURE__ */ (
|
|
2837
|
+
}), /* @__PURE__ */ M(Qn, {
|
|
2837
2838
|
className: "flex flex-col gap-4",
|
|
2838
|
-
children: /* @__PURE__ */ (
|
|
2839
|
+
children: /* @__PURE__ */ M(d, {
|
|
2839
2840
|
name: "submitConfig",
|
|
2840
|
-
children: (e) => /* @__PURE__ */ (
|
|
2841
|
+
children: (e) => /* @__PURE__ */ M(Rn, {
|
|
2841
2842
|
value: e.state.value,
|
|
2842
2843
|
onChange: (t) => {
|
|
2843
|
-
e.handleChange(t),
|
|
2844
|
+
e.handleChange(t), u().then();
|
|
2844
2845
|
}
|
|
2845
2846
|
})
|
|
2846
2847
|
})
|
|
2847
2848
|
})]
|
|
2848
2849
|
}),
|
|
2849
|
-
n?.data?.type === "file" && /* @__PURE__ */ (
|
|
2850
|
+
n?.data?.type === "file" && /* @__PURE__ */ M(d, {
|
|
2850
2851
|
name: "multiple",
|
|
2851
|
-
children: (e) => /* @__PURE__ */ (
|
|
2852
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
2852
2853
|
className: "flex items-center space-x-2",
|
|
2853
|
-
children: [/* @__PURE__ */ (
|
|
2854
|
+
children: [/* @__PURE__ */ M(x, {
|
|
2854
2855
|
id: e.name,
|
|
2855
2856
|
checked: e.state.value,
|
|
2856
2857
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2857
|
-
}), /* @__PURE__ */ (
|
|
2858
|
+
}), /* @__PURE__ */ M(l, {
|
|
2858
2859
|
htmlFor: e.name,
|
|
2859
2860
|
children: o("editor.inputNodeForm.multipleFiles")
|
|
2860
2861
|
})]
|
|
2861
2862
|
})
|
|
2862
2863
|
}),
|
|
2863
|
-
i && /* @__PURE__ */ (
|
|
2864
|
+
i && /* @__PURE__ */ N(Xn, {
|
|
2864
2865
|
defaultOpen: !0,
|
|
2865
2866
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
2866
|
-
children: [/* @__PURE__ */ (
|
|
2867
|
+
children: [/* @__PURE__ */ M(Zn, {
|
|
2867
2868
|
asChild: !0,
|
|
2868
|
-
children: /* @__PURE__ */ (
|
|
2869
|
+
children: /* @__PURE__ */ N("div", {
|
|
2869
2870
|
className: "flex items-center justify-between gap-4",
|
|
2870
|
-
children: [/* @__PURE__ */ (
|
|
2871
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
2871
2872
|
className: "font-semibold text-sm",
|
|
2872
2873
|
children: o("editor.inputNodeForm.options")
|
|
2873
|
-
}), /* @__PURE__ */ (
|
|
2874
|
+
}), /* @__PURE__ */ N(p, {
|
|
2874
2875
|
variant: "ghost",
|
|
2875
2876
|
size: "icon",
|
|
2876
2877
|
className: "size-8",
|
|
2877
|
-
children: [/* @__PURE__ */ (
|
|
2878
|
+
children: [/* @__PURE__ */ M(Le, {}), /* @__PURE__ */ M("span", {
|
|
2878
2879
|
className: "sr-only",
|
|
2879
2880
|
children: o("common.toggle")
|
|
2880
2881
|
})]
|
|
2881
2882
|
})]
|
|
2882
2883
|
})
|
|
2883
|
-
}), /* @__PURE__ */ (
|
|
2884
|
+
}), /* @__PURE__ */ N(Qn, {
|
|
2884
2885
|
className: "flex flex-col gap-4",
|
|
2885
2886
|
children: [
|
|
2886
|
-
/* @__PURE__ */ (
|
|
2887
|
+
/* @__PURE__ */ M(d, {
|
|
2887
2888
|
name: "options",
|
|
2888
2889
|
mode: "array",
|
|
2889
|
-
children: (t) => /* @__PURE__ */ (
|
|
2890
|
+
children: (t) => /* @__PURE__ */ N("div", {
|
|
2890
2891
|
className: "space-y-2",
|
|
2891
2892
|
children: [t.state.value?.map((r, i) => {
|
|
2892
2893
|
let a = `options[${i}]`;
|
|
2893
|
-
return /* @__PURE__ */ (
|
|
2894
|
+
return /* @__PURE__ */ N("div", {
|
|
2894
2895
|
className: "flex flex-col gap-2",
|
|
2895
|
-
children: [/* @__PURE__ */ (
|
|
2896
|
+
children: [/* @__PURE__ */ N("div", {
|
|
2896
2897
|
className: "flex items-start gap-2",
|
|
2897
2898
|
children: [
|
|
2898
|
-
n?.data?.type === "radio" && /* @__PURE__ */ (
|
|
2899
|
+
n?.data?.type === "radio" && /* @__PURE__ */ M(d, {
|
|
2899
2900
|
name: `options[${i}].image`,
|
|
2900
|
-
children: (e) => /* @__PURE__ */ (
|
|
2901
|
+
children: (e) => /* @__PURE__ */ M(Jn, {
|
|
2901
2902
|
value: e.state.value,
|
|
2902
2903
|
onChange: (t) => e.handleChange(t)
|
|
2903
2904
|
})
|
|
2904
2905
|
}),
|
|
2905
|
-
/* @__PURE__ */ (
|
|
2906
|
+
/* @__PURE__ */ M(d, {
|
|
2906
2907
|
name: `options[${i}].label`,
|
|
2907
|
-
children: (t) => /* @__PURE__ */ (
|
|
2908
|
+
children: (t) => /* @__PURE__ */ M(m, {
|
|
2908
2909
|
placeholder: o("editor.inputNodeForm.optionLabel"),
|
|
2909
2910
|
value: t.state.value?.[e] || "",
|
|
2910
2911
|
onChange: ({ target: n }) => {
|
|
@@ -2915,27 +2916,27 @@ var Qn = () => {
|
|
|
2915
2916
|
}
|
|
2916
2917
|
})
|
|
2917
2918
|
}),
|
|
2918
|
-
/* @__PURE__ */ (
|
|
2919
|
+
/* @__PURE__ */ M(d, {
|
|
2919
2920
|
name: `options[${i}].value`,
|
|
2920
|
-
children: (e) => /* @__PURE__ */ (
|
|
2921
|
+
children: (e) => /* @__PURE__ */ M(m, {
|
|
2921
2922
|
placeholder: o("editor.inputNodeForm.optionValue"),
|
|
2922
2923
|
value: e.state.value || "",
|
|
2923
2924
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
2924
2925
|
})
|
|
2925
2926
|
}),
|
|
2926
|
-
/* @__PURE__ */ (
|
|
2927
|
+
/* @__PURE__ */ M(p, {
|
|
2927
2928
|
type: "button",
|
|
2928
2929
|
variant: "ghost",
|
|
2929
2930
|
size: "icon",
|
|
2930
2931
|
onClick: () => {
|
|
2931
|
-
t.removeValue(i),
|
|
2932
|
+
t.removeValue(i), u().then();
|
|
2932
2933
|
},
|
|
2933
|
-
children: /* @__PURE__ */ (
|
|
2934
|
+
children: /* @__PURE__ */ M(I, { className: "h-4 w-4" })
|
|
2934
2935
|
})
|
|
2935
2936
|
]
|
|
2936
|
-
}), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */ (
|
|
2937
|
+
}), (n?.data?.type === "radio" || n?.data?.type === "checkbox") && /* @__PURE__ */ M(d, {
|
|
2937
2938
|
name: `options[${i}].description`,
|
|
2938
|
-
children: (t) => /* @__PURE__ */ (
|
|
2939
|
+
children: (t) => /* @__PURE__ */ M(m, {
|
|
2939
2940
|
placeholder: o("editor.inputNodeForm.optionDescription"),
|
|
2940
2941
|
value: t.state.value?.[e] || "",
|
|
2941
2942
|
onChange: ({ target: n }) => {
|
|
@@ -2947,7 +2948,7 @@ var Qn = () => {
|
|
|
2947
2948
|
})
|
|
2948
2949
|
})]
|
|
2949
2950
|
}, a);
|
|
2950
|
-
}), /* @__PURE__ */ (
|
|
2951
|
+
}), /* @__PURE__ */ M(p, {
|
|
2951
2952
|
type: "button",
|
|
2952
2953
|
variant: "outline",
|
|
2953
2954
|
size: "sm",
|
|
@@ -2955,42 +2956,42 @@ var Qn = () => {
|
|
|
2955
2956
|
t.pushValue({
|
|
2956
2957
|
label: { en: "" },
|
|
2957
2958
|
value: ""
|
|
2958
|
-
}),
|
|
2959
|
+
}), u().then();
|
|
2959
2960
|
},
|
|
2960
2961
|
children: o("editor.inputNodeForm.addOption")
|
|
2961
2962
|
})]
|
|
2962
2963
|
})
|
|
2963
2964
|
}),
|
|
2964
|
-
n?.data?.type === "select" && /* @__PURE__ */ (
|
|
2965
|
+
n?.data?.type === "select" && /* @__PURE__ */ M(d, {
|
|
2965
2966
|
name: "multiple",
|
|
2966
|
-
children: (e) => /* @__PURE__ */ (
|
|
2967
|
+
children: (e) => /* @__PURE__ */ N("div", {
|
|
2967
2968
|
className: "flex items-center space-x-2",
|
|
2968
|
-
children: [/* @__PURE__ */ (
|
|
2969
|
+
children: [/* @__PURE__ */ M(x, {
|
|
2969
2970
|
id: e.name,
|
|
2970
2971
|
checked: e.state.value,
|
|
2971
2972
|
onCheckedChange: (t) => e.handleChange(t)
|
|
2972
|
-
}), /* @__PURE__ */ (
|
|
2973
|
+
}), /* @__PURE__ */ M(l, {
|
|
2973
2974
|
htmlFor: e.name,
|
|
2974
2975
|
children: o("editor.inputNodeForm.multipleSelection")
|
|
2975
2976
|
})]
|
|
2976
2977
|
})
|
|
2977
2978
|
}),
|
|
2978
|
-
n?.data?.type === "radio" && /* @__PURE__ */ (
|
|
2979
|
+
n?.data?.type === "radio" && /* @__PURE__ */ M(d, {
|
|
2979
2980
|
name: "variant",
|
|
2980
|
-
children: (e) => /* @__PURE__ */ (
|
|
2981
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
2981
2982
|
htmlFor: e.name,
|
|
2982
2983
|
children: o("editor.inputNodeForm.variant")
|
|
2983
|
-
}), /* @__PURE__ */ (
|
|
2984
|
+
}), /* @__PURE__ */ N(v, {
|
|
2984
2985
|
value: e.state.value || "default",
|
|
2985
2986
|
onValueChange: (t) => e.handleChange(t),
|
|
2986
|
-
children: [/* @__PURE__ */ (
|
|
2987
|
+
children: [/* @__PURE__ */ M(g, {
|
|
2987
2988
|
id: e.name,
|
|
2988
2989
|
className: "w-full",
|
|
2989
|
-
children: /* @__PURE__ */ (
|
|
2990
|
-
}), /* @__PURE__ */ (
|
|
2990
|
+
children: /* @__PURE__ */ M(c, {})
|
|
2991
|
+
}), /* @__PURE__ */ N(k, { children: [/* @__PURE__ */ M(b, {
|
|
2991
2992
|
value: "default",
|
|
2992
2993
|
children: o("editor.inputNodeForm.variantDefault")
|
|
2993
|
-
}), /* @__PURE__ */ (
|
|
2994
|
+
}), /* @__PURE__ */ M(b, {
|
|
2994
2995
|
value: "card",
|
|
2995
2996
|
children: o("editor.inputNodeForm.variantCard")
|
|
2996
2997
|
})] })]
|
|
@@ -2999,77 +3000,77 @@ var Qn = () => {
|
|
|
2999
3000
|
]
|
|
3000
3001
|
})]
|
|
3001
3002
|
}),
|
|
3002
|
-
!s && /* @__PURE__ */ (
|
|
3003
|
+
!s && /* @__PURE__ */ N(Xn, {
|
|
3003
3004
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
3004
|
-
children: [/* @__PURE__ */ (
|
|
3005
|
+
children: [/* @__PURE__ */ M(Zn, {
|
|
3005
3006
|
asChild: !0,
|
|
3006
|
-
children: /* @__PURE__ */ (
|
|
3007
|
+
children: /* @__PURE__ */ N("div", {
|
|
3007
3008
|
className: "flex items-center justify-between gap-4",
|
|
3008
|
-
children: [/* @__PURE__ */ (
|
|
3009
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
3009
3010
|
className: "font-semibold text-sm",
|
|
3010
3011
|
children: o("editor.inputNodeForm.validation")
|
|
3011
|
-
}), /* @__PURE__ */ (
|
|
3012
|
+
}), /* @__PURE__ */ N(p, {
|
|
3012
3013
|
variant: "ghost",
|
|
3013
3014
|
size: "icon",
|
|
3014
3015
|
className: "size-8",
|
|
3015
|
-
children: [/* @__PURE__ */ (
|
|
3016
|
+
children: [/* @__PURE__ */ M(Le, {}), /* @__PURE__ */ M("span", {
|
|
3016
3017
|
className: "sr-only",
|
|
3017
3018
|
children: o("common.toggle")
|
|
3018
3019
|
})]
|
|
3019
3020
|
})]
|
|
3020
3021
|
})
|
|
3021
|
-
}), /* @__PURE__ */ (
|
|
3022
|
+
}), /* @__PURE__ */ N(Qn, {
|
|
3022
3023
|
className: "flex flex-col gap-6",
|
|
3023
3024
|
children: [
|
|
3024
|
-
/* @__PURE__ */ (
|
|
3025
|
+
/* @__PURE__ */ M(d, {
|
|
3025
3026
|
name: "required",
|
|
3026
|
-
children: (e) => /* @__PURE__ */ (
|
|
3027
|
+
children: (e) => /* @__PURE__ */ M(T, { children: /* @__PURE__ */ N("div", {
|
|
3027
3028
|
className: "flex items-center space-x-2",
|
|
3028
|
-
children: [/* @__PURE__ */ (
|
|
3029
|
+
children: [/* @__PURE__ */ M(x, {
|
|
3029
3030
|
id: e.name,
|
|
3030
3031
|
checked: e.state.value,
|
|
3031
3032
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3032
|
-
}), /* @__PURE__ */ (
|
|
3033
|
+
}), /* @__PURE__ */ M(l, {
|
|
3033
3034
|
htmlFor: e.name,
|
|
3034
3035
|
children: o("editor.inputNodeForm.required")
|
|
3035
3036
|
})]
|
|
3036
3037
|
}) })
|
|
3037
3038
|
}),
|
|
3038
|
-
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ (
|
|
3039
|
+
(n?.data?.type === "date" || n?.data?.type === "daterange") && /* @__PURE__ */ M(d, {
|
|
3039
3040
|
name: "disablePast",
|
|
3040
|
-
children: (e) => /* @__PURE__ */ (
|
|
3041
|
+
children: (e) => /* @__PURE__ */ M(T, { children: /* @__PURE__ */ N("div", {
|
|
3041
3042
|
className: "flex items-center space-x-2",
|
|
3042
|
-
children: [/* @__PURE__ */ (
|
|
3043
|
+
children: [/* @__PURE__ */ M(x, {
|
|
3043
3044
|
id: e.name,
|
|
3044
3045
|
checked: e.state.value,
|
|
3045
3046
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3046
|
-
}), /* @__PURE__ */ (
|
|
3047
|
+
}), /* @__PURE__ */ M(l, {
|
|
3047
3048
|
htmlFor: e.name,
|
|
3048
3049
|
children: o("editor.inputNodeForm.disablePast")
|
|
3049
3050
|
})]
|
|
3050
3051
|
}) })
|
|
3051
3052
|
}),
|
|
3052
|
-
/* @__PURE__ */ (
|
|
3053
|
+
/* @__PURE__ */ M(d, {
|
|
3053
3054
|
name: "pattern",
|
|
3054
|
-
children: (e) => /* @__PURE__ */ (
|
|
3055
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
3055
3056
|
htmlFor: e.name,
|
|
3056
3057
|
children: o("editor.inputNodeForm.pattern")
|
|
3057
|
-
}), /* @__PURE__ */ (
|
|
3058
|
+
}), /* @__PURE__ */ M(Vn, {
|
|
3058
3059
|
id: e.name,
|
|
3059
3060
|
value: e.state.value,
|
|
3060
3061
|
onValueChange: e.handleChange
|
|
3061
3062
|
})] })
|
|
3062
3063
|
}),
|
|
3063
|
-
/* @__PURE__ */ (
|
|
3064
|
+
/* @__PURE__ */ N("div", {
|
|
3064
3065
|
className: "flex items-end gap-2",
|
|
3065
|
-
children: [/* @__PURE__ */ (
|
|
3066
|
+
children: [/* @__PURE__ */ M(d, {
|
|
3066
3067
|
name: "errorMessage",
|
|
3067
|
-
children: (t) => /* @__PURE__ */ (
|
|
3068
|
+
children: (t) => /* @__PURE__ */ N(T, {
|
|
3068
3069
|
className: "flex-1",
|
|
3069
|
-
children: [/* @__PURE__ */ (
|
|
3070
|
+
children: [/* @__PURE__ */ M(l, {
|
|
3070
3071
|
htmlFor: t.name,
|
|
3071
3072
|
children: o("editor.inputNodeForm.errorMessage")
|
|
3072
|
-
}), /* @__PURE__ */ (
|
|
3073
|
+
}), /* @__PURE__ */ M(m, {
|
|
3073
3074
|
id: t.name,
|
|
3074
3075
|
name: t.name,
|
|
3075
3076
|
value: t.state.value?.[e] || "",
|
|
@@ -3082,7 +3083,7 @@ var Qn = () => {
|
|
|
3082
3083
|
}
|
|
3083
3084
|
})]
|
|
3084
3085
|
})
|
|
3085
|
-
}), /* @__PURE__ */ (
|
|
3086
|
+
}), /* @__PURE__ */ M(Q, {
|
|
3086
3087
|
value: e,
|
|
3087
3088
|
onValueChange: t
|
|
3088
3089
|
})]
|
|
@@ -3090,80 +3091,80 @@ var Qn = () => {
|
|
|
3090
3091
|
]
|
|
3091
3092
|
})]
|
|
3092
3093
|
}),
|
|
3093
|
-
!s && /* @__PURE__ */ (
|
|
3094
|
+
!s && /* @__PURE__ */ N(Xn, {
|
|
3094
3095
|
className: "flex w-full max-w-[350px] flex-col gap-2",
|
|
3095
|
-
children: [/* @__PURE__ */ (
|
|
3096
|
+
children: [/* @__PURE__ */ M(Zn, {
|
|
3096
3097
|
asChild: !0,
|
|
3097
|
-
children: /* @__PURE__ */ (
|
|
3098
|
+
children: /* @__PURE__ */ N("div", {
|
|
3098
3099
|
className: "flex items-center justify-between gap-4",
|
|
3099
|
-
children: [/* @__PURE__ */ (
|
|
3100
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
3100
3101
|
className: "font-semibold text-sm",
|
|
3101
3102
|
children: o("editor.inputNodeForm.advancedConfiguration")
|
|
3102
|
-
}), /* @__PURE__ */ (
|
|
3103
|
+
}), /* @__PURE__ */ N(p, {
|
|
3103
3104
|
variant: "ghost",
|
|
3104
3105
|
size: "icon",
|
|
3105
3106
|
className: "size-8",
|
|
3106
|
-
children: [/* @__PURE__ */ (
|
|
3107
|
+
children: [/* @__PURE__ */ M(Le, {}), /* @__PURE__ */ M("span", {
|
|
3107
3108
|
className: "sr-only",
|
|
3108
3109
|
children: o("common.toggle")
|
|
3109
3110
|
})]
|
|
3110
3111
|
})]
|
|
3111
3112
|
})
|
|
3112
|
-
}), /* @__PURE__ */ (
|
|
3113
|
+
}), /* @__PURE__ */ N(Qn, {
|
|
3113
3114
|
className: "flex flex-col gap-6",
|
|
3114
|
-
children: [/* @__PURE__ */ (
|
|
3115
|
+
children: [/* @__PURE__ */ M(d, {
|
|
3115
3116
|
name: "name",
|
|
3116
|
-
children: (e) => /* @__PURE__ */ (
|
|
3117
|
-
/* @__PURE__ */ (
|
|
3117
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
3118
|
+
/* @__PURE__ */ M(l, {
|
|
3118
3119
|
htmlFor: e.name,
|
|
3119
3120
|
children: o("editor.inputNodeForm.name")
|
|
3120
3121
|
}),
|
|
3121
|
-
/* @__PURE__ */ (
|
|
3122
|
+
/* @__PURE__ */ M(m, {
|
|
3122
3123
|
id: e.name,
|
|
3123
3124
|
name: e.name,
|
|
3124
3125
|
value: e.state.value,
|
|
3125
3126
|
onBlur: e.handleBlur,
|
|
3126
3127
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3127
3128
|
}),
|
|
3128
|
-
/* @__PURE__ */ (
|
|
3129
|
+
/* @__PURE__ */ M(E, { children: o("editor.inputNodeForm.nameDescription") })
|
|
3129
3130
|
] })
|
|
3130
|
-
}), /* @__PURE__ */ (
|
|
3131
|
+
}), /* @__PURE__ */ M(d, {
|
|
3131
3132
|
name: "defaultValue",
|
|
3132
|
-
children: (e) => /* @__PURE__ */ (
|
|
3133
|
-
/* @__PURE__ */ (
|
|
3133
|
+
children: (e) => /* @__PURE__ */ N(j, { children: [
|
|
3134
|
+
/* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
3134
3135
|
htmlFor: e.name,
|
|
3135
3136
|
children: o("editor.inputNodeForm.defaultValueType")
|
|
3136
|
-
}), /* @__PURE__ */ (
|
|
3137
|
+
}), /* @__PURE__ */ N(v, {
|
|
3137
3138
|
value: e.state.value?.type || "none",
|
|
3138
3139
|
onValueChange: (t) => {
|
|
3139
3140
|
e.handleChange(t === "none" ? null : { type: t });
|
|
3140
3141
|
},
|
|
3141
|
-
children: [/* @__PURE__ */ (
|
|
3142
|
+
children: [/* @__PURE__ */ M(g, {
|
|
3142
3143
|
id: e.name,
|
|
3143
|
-
children: /* @__PURE__ */ (
|
|
3144
|
-
}), /* @__PURE__ */ (
|
|
3145
|
-
/* @__PURE__ */ (
|
|
3144
|
+
children: /* @__PURE__ */ M(c, { placeholder: o("editor.inputNodeForm.selectType") })
|
|
3145
|
+
}), /* @__PURE__ */ N(k, { children: [
|
|
3146
|
+
/* @__PURE__ */ M(b, {
|
|
3146
3147
|
value: "none",
|
|
3147
3148
|
children: o("editor.inputNodeForm.defaultValueTypeNone")
|
|
3148
3149
|
}),
|
|
3149
|
-
/* @__PURE__ */ (
|
|
3150
|
+
/* @__PURE__ */ M(b, {
|
|
3150
3151
|
value: "static",
|
|
3151
3152
|
children: o("editor.inputNodeForm.defaultValueTypeStatic")
|
|
3152
3153
|
}),
|
|
3153
|
-
/* @__PURE__ */ (
|
|
3154
|
+
/* @__PURE__ */ M(b, {
|
|
3154
3155
|
value: "reference",
|
|
3155
3156
|
children: o("editor.inputNodeForm.defaultValueTypeReference")
|
|
3156
3157
|
})
|
|
3157
3158
|
] })]
|
|
3158
3159
|
})] }),
|
|
3159
|
-
e.state.value?.type === "static" && /* @__PURE__ */ (
|
|
3160
|
+
e.state.value?.type === "static" && /* @__PURE__ */ M(d, {
|
|
3160
3161
|
name: "defaultValue.staticValue",
|
|
3161
3162
|
children: (e) => {
|
|
3162
3163
|
let t = n?.data?.type;
|
|
3163
|
-
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ (
|
|
3164
|
+
return (t === "select" || t === "checkbox") && n?.data?.multiple ? /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
3164
3165
|
htmlFor: e.name,
|
|
3165
3166
|
children: o("editor.inputNodeForm.defaultValuesCommaSeparated")
|
|
3166
|
-
}), /* @__PURE__ */ (
|
|
3167
|
+
}), /* @__PURE__ */ M(m, {
|
|
3167
3168
|
id: e.name,
|
|
3168
3169
|
placeholder: o("editor.inputNodeForm.defaultValuesPlaceholder"),
|
|
3169
3170
|
value: Array.isArray(e.state.value) ? e.state.value.join(", ") : "",
|
|
@@ -3171,20 +3172,20 @@ var Qn = () => {
|
|
|
3171
3172
|
let n = t.value.split(",").map((e) => e.trim()).filter(Boolean);
|
|
3172
3173
|
e.handleChange(n.length > 0 ? n : null);
|
|
3173
3174
|
}
|
|
3174
|
-
})] }) : t === "checkbox" ? /* @__PURE__ */ (
|
|
3175
|
+
})] }) : t === "checkbox" ? /* @__PURE__ */ M(T, { children: /* @__PURE__ */ N("div", {
|
|
3175
3176
|
className: "flex items-center space-x-2",
|
|
3176
|
-
children: [/* @__PURE__ */ (
|
|
3177
|
+
children: [/* @__PURE__ */ M(x, {
|
|
3177
3178
|
id: e.name,
|
|
3178
3179
|
checked: !!e.state.value,
|
|
3179
3180
|
onCheckedChange: (t) => e.handleChange(t)
|
|
3180
|
-
}), /* @__PURE__ */ (
|
|
3181
|
+
}), /* @__PURE__ */ M(l, {
|
|
3181
3182
|
htmlFor: e.name,
|
|
3182
3183
|
children: o("editor.inputNodeForm.defaultChecked")
|
|
3183
3184
|
})]
|
|
3184
|
-
}) }) : /* @__PURE__ */ (
|
|
3185
|
+
}) }) : /* @__PURE__ */ N(T, { children: [/* @__PURE__ */ M(l, {
|
|
3185
3186
|
htmlFor: e.name,
|
|
3186
3187
|
children: o("editor.inputNodeForm.staticValue")
|
|
3187
|
-
}), /* @__PURE__ */ (
|
|
3188
|
+
}), /* @__PURE__ */ M(m, {
|
|
3188
3189
|
id: e.name,
|
|
3189
3190
|
placeholder: o("editor.inputNodeForm.staticValuePlaceholder"),
|
|
3190
3191
|
value: typeof e.state.value == "string" ? e.state.value : "",
|
|
@@ -3192,27 +3193,27 @@ var Qn = () => {
|
|
|
3192
3193
|
})] });
|
|
3193
3194
|
}
|
|
3194
3195
|
}),
|
|
3195
|
-
e.state.value?.type === "reference" && /* @__PURE__ */ (
|
|
3196
|
-
/* @__PURE__ */ (
|
|
3196
|
+
e.state.value?.type === "reference" && /* @__PURE__ */ N(j, { children: [
|
|
3197
|
+
/* @__PURE__ */ M(d, {
|
|
3197
3198
|
name: "defaultValue.referenceField",
|
|
3198
|
-
children: (e) => /* @__PURE__ */ (
|
|
3199
|
-
/* @__PURE__ */ (
|
|
3199
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
3200
|
+
/* @__PURE__ */ M(l, {
|
|
3200
3201
|
htmlFor: e.name,
|
|
3201
3202
|
children: o("editor.inputNodeForm.referenceField")
|
|
3202
3203
|
}),
|
|
3203
|
-
/* @__PURE__ */ (
|
|
3204
|
+
/* @__PURE__ */ N(v, {
|
|
3204
3205
|
value: e.state.value || "",
|
|
3205
3206
|
onValueChange: (t) => {
|
|
3206
3207
|
e.handleChange(t);
|
|
3207
3208
|
},
|
|
3208
|
-
children: [/* @__PURE__ */ (
|
|
3209
|
+
children: [/* @__PURE__ */ M(g, {
|
|
3209
3210
|
id: e.name,
|
|
3210
|
-
children: /* @__PURE__ */ (
|
|
3211
|
-
}), /* @__PURE__ */ (
|
|
3211
|
+
children: /* @__PURE__ */ M(c, { placeholder: o("editor.inputNodeForm.selectReferenceField") })
|
|
3212
|
+
}), /* @__PURE__ */ M(k, { children: a.length === 0 ? /* @__PURE__ */ M(b, {
|
|
3212
3213
|
value: "none",
|
|
3213
3214
|
disabled: !0,
|
|
3214
3215
|
children: o("editor.inputNodeForm.noParentFieldsAvailable")
|
|
3215
|
-
}) : a.map((e) => /* @__PURE__ */ (
|
|
3216
|
+
}) : a.map((e) => /* @__PURE__ */ N(b, {
|
|
3216
3217
|
value: e.nodeId,
|
|
3217
3218
|
children: [
|
|
3218
3219
|
e.label,
|
|
@@ -3222,17 +3223,17 @@ var Qn = () => {
|
|
|
3222
3223
|
]
|
|
3223
3224
|
}, e.nodeId)) })]
|
|
3224
3225
|
}),
|
|
3225
|
-
a.length === 0 && /* @__PURE__ */ (
|
|
3226
|
+
a.length === 0 && /* @__PURE__ */ M(E, { children: o("editor.inputNodeForm.addInputFieldsBeforeReference") })
|
|
3226
3227
|
] })
|
|
3227
3228
|
}),
|
|
3228
|
-
/* @__PURE__ */ (
|
|
3229
|
+
/* @__PURE__ */ M(d, {
|
|
3229
3230
|
name: "defaultValue.transformFunction",
|
|
3230
|
-
children: (t) => /* @__PURE__ */ (
|
|
3231
|
-
/* @__PURE__ */ (
|
|
3231
|
+
children: (t) => /* @__PURE__ */ N(T, { children: [
|
|
3232
|
+
/* @__PURE__ */ M(l, {
|
|
3232
3233
|
htmlFor: t.name,
|
|
3233
3234
|
children: o("editor.inputNodeForm.transformType")
|
|
3234
3235
|
}),
|
|
3235
|
-
/* @__PURE__ */ (
|
|
3236
|
+
/* @__PURE__ */ N(v, {
|
|
3236
3237
|
value: t.state.value || "none",
|
|
3237
3238
|
onValueChange: (n) => {
|
|
3238
3239
|
let r = n === "none" ? null : n;
|
|
@@ -3244,80 +3245,80 @@ var Qn = () => {
|
|
|
3244
3245
|
});
|
|
3245
3246
|
}
|
|
3246
3247
|
},
|
|
3247
|
-
children: [/* @__PURE__ */ (
|
|
3248
|
+
children: [/* @__PURE__ */ M(g, {
|
|
3248
3249
|
id: t.name,
|
|
3249
|
-
children: /* @__PURE__ */ (
|
|
3250
|
-
}), /* @__PURE__ */ (
|
|
3251
|
-
/* @__PURE__ */ (
|
|
3250
|
+
children: /* @__PURE__ */ M(c, { placeholder: o("editor.inputNodeForm.selectTransformation") })
|
|
3251
|
+
}), /* @__PURE__ */ N(k, { children: [
|
|
3252
|
+
/* @__PURE__ */ M(b, {
|
|
3252
3253
|
value: "none",
|
|
3253
3254
|
children: o("editor.inputNodeForm.transformNone")
|
|
3254
3255
|
}),
|
|
3255
|
-
/* @__PURE__ */ (
|
|
3256
|
+
/* @__PURE__ */ M(b, {
|
|
3256
3257
|
value: "toString",
|
|
3257
3258
|
children: o("editor.inputNodeForm.transformString")
|
|
3258
3259
|
}),
|
|
3259
|
-
/* @__PURE__ */ (
|
|
3260
|
+
/* @__PURE__ */ M(b, {
|
|
3260
3261
|
value: "toNumber",
|
|
3261
3262
|
children: o("editor.inputNodeForm.transformNumber")
|
|
3262
3263
|
}),
|
|
3263
|
-
/* @__PURE__ */ (
|
|
3264
|
+
/* @__PURE__ */ M(b, {
|
|
3264
3265
|
value: "toBoolean",
|
|
3265
3266
|
children: o("editor.inputNodeForm.transformBoolean")
|
|
3266
3267
|
}),
|
|
3267
|
-
/* @__PURE__ */ (
|
|
3268
|
+
/* @__PURE__ */ M(b, {
|
|
3268
3269
|
value: "toArray",
|
|
3269
3270
|
children: o("editor.inputNodeForm.transformArray")
|
|
3270
3271
|
}),
|
|
3271
|
-
/* @__PURE__ */ (
|
|
3272
|
+
/* @__PURE__ */ M(b, {
|
|
3272
3273
|
value: "toObject",
|
|
3273
3274
|
children: o("editor.inputNodeForm.transformMapToObject")
|
|
3274
3275
|
})
|
|
3275
3276
|
] })]
|
|
3276
3277
|
}),
|
|
3277
|
-
/* @__PURE__ */ (
|
|
3278
|
+
/* @__PURE__ */ M(E, { children: o("editor.inputNodeForm.transformDesc") })
|
|
3278
3279
|
] })
|
|
3279
3280
|
}),
|
|
3280
|
-
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ (
|
|
3281
|
+
e.state.value?.transformFunction === "toObject" && /* @__PURE__ */ M(d, {
|
|
3281
3282
|
name: "defaultValue.objectMapping",
|
|
3282
3283
|
mode: "array",
|
|
3283
|
-
children: (e) => /* @__PURE__ */ (
|
|
3284
|
-
/* @__PURE__ */ (
|
|
3285
|
-
/* @__PURE__ */ (
|
|
3284
|
+
children: (e) => /* @__PURE__ */ N(T, { children: [
|
|
3285
|
+
/* @__PURE__ */ M(l, { children: o("editor.inputNodeForm.objectMapping") }),
|
|
3286
|
+
/* @__PURE__ */ N("div", {
|
|
3286
3287
|
className: "space-y-2",
|
|
3287
|
-
children: [e.state.value?.map((t, n) => /* @__PURE__ */ (
|
|
3288
|
+
children: [e.state.value?.map((t, n) => /* @__PURE__ */ N("div", {
|
|
3288
3289
|
className: "flex items-center gap-2",
|
|
3289
3290
|
children: [
|
|
3290
|
-
/* @__PURE__ */ (
|
|
3291
|
+
/* @__PURE__ */ M(d, {
|
|
3291
3292
|
name: `defaultValue.objectMapping[${n}].sourceKey`,
|
|
3292
|
-
children: (e) => /* @__PURE__ */ (
|
|
3293
|
+
children: (e) => /* @__PURE__ */ M(m, {
|
|
3293
3294
|
placeholder: o("editor.inputNodeForm.sourceKey"),
|
|
3294
3295
|
value: e.state.value || "",
|
|
3295
3296
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3296
3297
|
})
|
|
3297
3298
|
}),
|
|
3298
|
-
/* @__PURE__ */ (
|
|
3299
|
+
/* @__PURE__ */ M("span", {
|
|
3299
3300
|
className: "text-muted-foreground",
|
|
3300
3301
|
children: "→"
|
|
3301
3302
|
}),
|
|
3302
|
-
/* @__PURE__ */ (
|
|
3303
|
+
/* @__PURE__ */ M(d, {
|
|
3303
3304
|
name: `defaultValue.objectMapping[${n}].targetKey`,
|
|
3304
|
-
children: (e) => /* @__PURE__ */ (
|
|
3305
|
+
children: (e) => /* @__PURE__ */ M(m, {
|
|
3305
3306
|
placeholder: o("editor.inputNodeForm.targetKey"),
|
|
3306
3307
|
value: e.state.value || "",
|
|
3307
3308
|
onChange: ({ target: t }) => e.handleChange(t.value)
|
|
3308
3309
|
})
|
|
3309
3310
|
}),
|
|
3310
|
-
/* @__PURE__ */ (
|
|
3311
|
+
/* @__PURE__ */ M(p, {
|
|
3311
3312
|
type: "button",
|
|
3312
3313
|
variant: "ghost",
|
|
3313
3314
|
size: "icon",
|
|
3314
3315
|
onClick: () => {
|
|
3315
|
-
e.removeValue(n),
|
|
3316
|
+
e.removeValue(n), u().then();
|
|
3316
3317
|
},
|
|
3317
|
-
children: /* @__PURE__ */ (
|
|
3318
|
+
children: /* @__PURE__ */ M(I, { className: "h-4 w-4" })
|
|
3318
3319
|
})
|
|
3319
3320
|
]
|
|
3320
|
-
}, `mapping-${n}`)), /* @__PURE__ */ (
|
|
3321
|
+
}, `mapping-${n}`)), /* @__PURE__ */ N(p, {
|
|
3321
3322
|
type: "button",
|
|
3322
3323
|
variant: "outline",
|
|
3323
3324
|
size: "sm",
|
|
@@ -3326,12 +3327,12 @@ var Qn = () => {
|
|
|
3326
3327
|
e.pushValue({
|
|
3327
3328
|
sourceKey: "",
|
|
3328
3329
|
targetKey: ""
|
|
3329
|
-
}),
|
|
3330
|
+
}), u().then();
|
|
3330
3331
|
},
|
|
3331
|
-
children: [/* @__PURE__ */ (
|
|
3332
|
+
children: [/* @__PURE__ */ M(F, { className: "mr-2 h-4 w-4" }), o("editor.inputNodeForm.addMapping")]
|
|
3332
3333
|
})]
|
|
3333
3334
|
}),
|
|
3334
|
-
/* @__PURE__ */ (
|
|
3335
|
+
/* @__PURE__ */ M(E, { children: o("editor.inputNodeForm.objectMappingDesc") })
|
|
3335
3336
|
] })
|
|
3336
3337
|
})
|
|
3337
3338
|
] })
|
|
@@ -3342,8 +3343,8 @@ var Qn = () => {
|
|
|
3342
3343
|
]
|
|
3343
3344
|
})
|
|
3344
3345
|
});
|
|
3345
|
-
},
|
|
3346
|
-
let [e, t] =
|
|
3346
|
+
}, er = () => {
|
|
3347
|
+
let [e, t] = z("en"), { selectedNode: n } = $(), { updateSelectedNodeData: r } = q(), { Field: i } = P({
|
|
3347
3348
|
defaultValues: {
|
|
3348
3349
|
label: n?.data?.label || { en: "" },
|
|
3349
3350
|
type: n?.data?.type || ""
|
|
@@ -3358,22 +3359,22 @@ var Qn = () => {
|
|
|
3358
3359
|
r(e);
|
|
3359
3360
|
}
|
|
3360
3361
|
});
|
|
3361
|
-
return /* @__PURE__ */ (
|
|
3362
|
+
return /* @__PURE__ */ M("form", {
|
|
3362
3363
|
onSubmit: (e) => {
|
|
3363
3364
|
e.preventDefault(), e.stopPropagation();
|
|
3364
3365
|
},
|
|
3365
|
-
children: /* @__PURE__ */ (
|
|
3366
|
+
children: /* @__PURE__ */ N("div", {
|
|
3366
3367
|
className: "grid gap-6",
|
|
3367
|
-
children: [/* @__PURE__ */ (
|
|
3368
|
+
children: [/* @__PURE__ */ N("div", {
|
|
3368
3369
|
className: "flex items-end gap-2",
|
|
3369
|
-
children: [/* @__PURE__ */ (
|
|
3370
|
+
children: [/* @__PURE__ */ M(i, {
|
|
3370
3371
|
name: "label",
|
|
3371
|
-
children: (t) => /* @__PURE__ */ (
|
|
3372
|
+
children: (t) => /* @__PURE__ */ N(T, {
|
|
3372
3373
|
className: "flex-1",
|
|
3373
|
-
children: [/* @__PURE__ */ (
|
|
3374
|
+
children: [/* @__PURE__ */ M(l, {
|
|
3374
3375
|
htmlFor: t.name,
|
|
3375
3376
|
children: "Label"
|
|
3376
|
-
}), /* @__PURE__ */ (
|
|
3377
|
+
}), /* @__PURE__ */ M(m, {
|
|
3377
3378
|
id: t.name,
|
|
3378
3379
|
name: t.name,
|
|
3379
3380
|
value: t.state.value?.[e] || "",
|
|
@@ -3386,44 +3387,44 @@ var Qn = () => {
|
|
|
3386
3387
|
}
|
|
3387
3388
|
})]
|
|
3388
3389
|
})
|
|
3389
|
-
}), /* @__PURE__ */ (
|
|
3390
|
+
}), /* @__PURE__ */ M(Q, {
|
|
3390
3391
|
value: e,
|
|
3391
3392
|
onValueChange: t
|
|
3392
3393
|
})]
|
|
3393
|
-
}), /* @__PURE__ */ (
|
|
3394
|
+
}), /* @__PURE__ */ M(i, {
|
|
3394
3395
|
name: "type",
|
|
3395
|
-
children: (e) => /* @__PURE__ */ (
|
|
3396
|
+
children: (e) => /* @__PURE__ */ N(A, { children: [/* @__PURE__ */ M(ue, {
|
|
3396
3397
|
htmlFor: e.name,
|
|
3397
3398
|
children: "Type"
|
|
3398
|
-
}), /* @__PURE__ */ (
|
|
3399
|
+
}), /* @__PURE__ */ N(v, {
|
|
3399
3400
|
value: e.state.value,
|
|
3400
3401
|
onValueChange: (t) => e.handleChange(t),
|
|
3401
|
-
children: [/* @__PURE__ */ (
|
|
3402
|
+
children: [/* @__PURE__ */ M(g, {
|
|
3402
3403
|
id: e.name,
|
|
3403
3404
|
className: "w-full",
|
|
3404
|
-
children: /* @__PURE__ */ (
|
|
3405
|
-
}), /* @__PURE__ */ (
|
|
3406
|
-
value:
|
|
3405
|
+
children: /* @__PURE__ */ M(c, { placeholder: "" })
|
|
3406
|
+
}), /* @__PURE__ */ M(k, { children: /* @__PURE__ */ N(A, { children: [/* @__PURE__ */ M(b, {
|
|
3407
|
+
value: sn.title,
|
|
3407
3408
|
children: "Title"
|
|
3408
|
-
}), /* @__PURE__ */ (
|
|
3409
|
-
value:
|
|
3409
|
+
}), /* @__PURE__ */ M(b, {
|
|
3410
|
+
value: sn.divider,
|
|
3410
3411
|
children: "Divider"
|
|
3411
3412
|
})] }) })]
|
|
3412
3413
|
})] })
|
|
3413
3414
|
})]
|
|
3414
3415
|
})
|
|
3415
3416
|
});
|
|
3416
|
-
},
|
|
3417
|
-
let [e, t] =
|
|
3417
|
+
}, tr = () => {
|
|
3418
|
+
let [e, t] = z(""), [n, r] = z(!1), { selectedNode: a, groupNodes: o } = $(), { setNodes: s } = De(), d = a?.parentId || "none", f = i(a), h = G(), y = yt(), x = yt();
|
|
3418
3419
|
if (f) return null;
|
|
3419
3420
|
let S = (e) => {
|
|
3420
|
-
|
|
3421
|
-
if (e.id ===
|
|
3421
|
+
a && s((t) => e === "none" ? t.map((e) => {
|
|
3422
|
+
if (e.id === a.id) {
|
|
3422
3423
|
let { parentId: t, extent: n, ...r } = e;
|
|
3423
3424
|
return r;
|
|
3424
3425
|
}
|
|
3425
3426
|
return e;
|
|
3426
|
-
}) : t.find((t) => t.id === e) ? t.map((t) => t.id ===
|
|
3427
|
+
}) : t.find((t) => t.id === e) ? t.map((t) => t.id === a.id ? {
|
|
3427
3428
|
...t,
|
|
3428
3429
|
extent: "parent",
|
|
3429
3430
|
parentId: e,
|
|
@@ -3433,12 +3434,12 @@ var Qn = () => {
|
|
|
3433
3434
|
}
|
|
3434
3435
|
} : t) : t);
|
|
3435
3436
|
}, C = () => {
|
|
3436
|
-
if (!(e.trim() &&
|
|
3437
|
+
if (!(e.trim() && a)) return;
|
|
3437
3438
|
if (o.find((t) => {
|
|
3438
3439
|
let n = t.data?.label?.en || t.data?.label;
|
|
3439
3440
|
return String(n).toLowerCase() === e.trim().toLowerCase();
|
|
3440
3441
|
})) {
|
|
3441
|
-
|
|
3442
|
+
H.error("This group already exists", { description: "Use the selector to add the node to an existing group." });
|
|
3442
3443
|
return;
|
|
3443
3444
|
}
|
|
3444
3445
|
let n = rn();
|
|
@@ -3446,15 +3447,15 @@ var Qn = () => {
|
|
|
3446
3447
|
data: { label: { en: e.trim() } },
|
|
3447
3448
|
id: n,
|
|
3448
3449
|
position: {
|
|
3449
|
-
x:
|
|
3450
|
-
y:
|
|
3450
|
+
x: a.position.x - 300,
|
|
3451
|
+
y: a.position.y
|
|
3451
3452
|
},
|
|
3452
3453
|
style: {
|
|
3453
3454
|
height: 400,
|
|
3454
3455
|
width: 600
|
|
3455
3456
|
},
|
|
3456
3457
|
type: "group"
|
|
3457
|
-
}, ...t.map((e) => e.id ===
|
|
3458
|
+
}, ...t.map((e) => e.id === a.id ? {
|
|
3458
3459
|
...e,
|
|
3459
3460
|
extent: "parent",
|
|
3460
3461
|
parentId: n,
|
|
@@ -3462,65 +3463,65 @@ var Qn = () => {
|
|
|
3462
3463
|
x: 175,
|
|
3463
3464
|
y: 30
|
|
3464
3465
|
}
|
|
3465
|
-
} : e)]), t(""), r(!1),
|
|
3466
|
+
} : e)]), t(""), r(!1), H.success("Group created", { description: `The group "${e.trim()}" has been created successfully.` });
|
|
3466
3467
|
};
|
|
3467
|
-
return /* @__PURE__ */ (
|
|
3468
|
+
return /* @__PURE__ */ N("div", {
|
|
3468
3469
|
className: "space-y-2",
|
|
3469
|
-
children: [/* @__PURE__ */ (
|
|
3470
|
-
htmlFor:
|
|
3471
|
-
children:
|
|
3472
|
-
}), /* @__PURE__ */ (
|
|
3470
|
+
children: [/* @__PURE__ */ M(l, {
|
|
3471
|
+
htmlFor: y,
|
|
3472
|
+
children: h("editor.selectNodeGroup.group")
|
|
3473
|
+
}), /* @__PURE__ */ N("div", {
|
|
3473
3474
|
className: "flex gap-2",
|
|
3474
|
-
children: [/* @__PURE__ */ (
|
|
3475
|
-
value:
|
|
3475
|
+
children: [/* @__PURE__ */ N(v, {
|
|
3476
|
+
value: d,
|
|
3476
3477
|
onValueChange: S,
|
|
3477
|
-
children: [/* @__PURE__ */ (
|
|
3478
|
-
id:
|
|
3478
|
+
children: [/* @__PURE__ */ M(g, {
|
|
3479
|
+
id: y,
|
|
3479
3480
|
className: "flex-1",
|
|
3480
|
-
children: /* @__PURE__ */ (
|
|
3481
|
-
}), /* @__PURE__ */ (
|
|
3481
|
+
children: /* @__PURE__ */ M(c, { placeholder: h("editor.selectNodeGroup.noGroup") })
|
|
3482
|
+
}), /* @__PURE__ */ M(k, { children: /* @__PURE__ */ N(A, { children: [/* @__PURE__ */ M(b, {
|
|
3482
3483
|
value: "none",
|
|
3483
|
-
children:
|
|
3484
|
-
}), o.map((e) => /* @__PURE__ */ (
|
|
3484
|
+
children: h("editor.selectNodeGroup.noGroup")
|
|
3485
|
+
}), o.map((e) => /* @__PURE__ */ M(b, {
|
|
3485
3486
|
value: e.id,
|
|
3486
3487
|
children: e.data.label?.en ? String(e.data.label?.en) : e.id
|
|
3487
3488
|
}, e.id))] }) })]
|
|
3488
|
-
}), /* @__PURE__ */ (
|
|
3489
|
+
}), /* @__PURE__ */ N(le, {
|
|
3489
3490
|
open: n,
|
|
3490
3491
|
onOpenChange: r,
|
|
3491
|
-
children: [/* @__PURE__ */ (
|
|
3492
|
+
children: [/* @__PURE__ */ M(u, {
|
|
3492
3493
|
asChild: !0,
|
|
3493
|
-
children: /* @__PURE__ */ (
|
|
3494
|
+
children: /* @__PURE__ */ M(p, {
|
|
3494
3495
|
variant: "outline",
|
|
3495
3496
|
size: "icon",
|
|
3496
3497
|
title: "Create a new group",
|
|
3497
|
-
children: /* @__PURE__ */ (
|
|
3498
|
+
children: /* @__PURE__ */ M(nt, { className: "h-4 w-4" })
|
|
3498
3499
|
})
|
|
3499
|
-
}), /* @__PURE__ */ (
|
|
3500
|
+
}), /* @__PURE__ */ M(_, {
|
|
3500
3501
|
className: "w-80",
|
|
3501
3502
|
align: "end",
|
|
3502
3503
|
disablePortal: !0,
|
|
3503
|
-
children: /* @__PURE__ */ (
|
|
3504
|
+
children: /* @__PURE__ */ N("div", {
|
|
3504
3505
|
className: "space-y-4",
|
|
3505
3506
|
children: [
|
|
3506
|
-
/* @__PURE__ */ (
|
|
3507
|
+
/* @__PURE__ */ N("div", {
|
|
3507
3508
|
className: "space-y-2",
|
|
3508
|
-
children: [/* @__PURE__ */ (
|
|
3509
|
+
children: [/* @__PURE__ */ M("h4", {
|
|
3509
3510
|
className: "font-medium leading-none",
|
|
3510
|
-
children:
|
|
3511
|
-
}), /* @__PURE__ */ (
|
|
3511
|
+
children: h("editor.selectNodeGroup.newGroup")
|
|
3512
|
+
}), /* @__PURE__ */ M("p", {
|
|
3512
3513
|
className: "text-muted-foreground text-sm",
|
|
3513
|
-
children:
|
|
3514
|
+
children: h("editor.selectNodeGroup.newGroupDescription")
|
|
3514
3515
|
})]
|
|
3515
3516
|
}),
|
|
3516
|
-
/* @__PURE__ */ (
|
|
3517
|
+
/* @__PURE__ */ N("div", {
|
|
3517
3518
|
className: "space-y-2",
|
|
3518
|
-
children: [/* @__PURE__ */ (
|
|
3519
|
-
htmlFor:
|
|
3520
|
-
children:
|
|
3521
|
-
}), /* @__PURE__ */ (
|
|
3519
|
+
children: [/* @__PURE__ */ M(l, {
|
|
3520
|
+
htmlFor: x,
|
|
3521
|
+
children: h("editor.selectNodeGroup.groupName")
|
|
3522
|
+
}), /* @__PURE__ */ M(m, {
|
|
3522
3523
|
autoFocus: !0,
|
|
3523
|
-
id:
|
|
3524
|
+
id: x,
|
|
3524
3525
|
value: e,
|
|
3525
3526
|
onChange: (e) => t(e.target.value),
|
|
3526
3527
|
placeholder: "Ex: Step 1 - Personal info",
|
|
@@ -3529,14 +3530,14 @@ var Qn = () => {
|
|
|
3529
3530
|
}
|
|
3530
3531
|
})]
|
|
3531
3532
|
}),
|
|
3532
|
-
/* @__PURE__ */ (
|
|
3533
|
+
/* @__PURE__ */ N("div", {
|
|
3533
3534
|
className: "flex justify-end gap-2",
|
|
3534
|
-
children: [/* @__PURE__ */ (
|
|
3535
|
+
children: [/* @__PURE__ */ M(p, {
|
|
3535
3536
|
variant: "outline",
|
|
3536
3537
|
size: "sm",
|
|
3537
3538
|
onClick: () => r(!1),
|
|
3538
3539
|
children: "Cancel"
|
|
3539
|
-
}), /* @__PURE__ */ (
|
|
3540
|
+
}), /* @__PURE__ */ M(p, {
|
|
3540
3541
|
size: "sm",
|
|
3541
3542
|
onClick: C,
|
|
3542
3543
|
disabled: !e.trim(),
|
|
@@ -3549,137 +3550,137 @@ var Qn = () => {
|
|
|
3549
3550
|
})]
|
|
3550
3551
|
})]
|
|
3551
3552
|
});
|
|
3552
|
-
},
|
|
3553
|
-
let { selectedNode: e } = $(), { updateSelectedNodeType: t } =
|
|
3554
|
-
return /* @__PURE__ */ (
|
|
3553
|
+
}, nr = () => {
|
|
3554
|
+
let { selectedNode: e } = $(), { updateSelectedNodeType: t } = q(), n = e?.type || "", r = i(e), a = G(), o = yt();
|
|
3555
|
+
return /* @__PURE__ */ N(A, { children: [/* @__PURE__ */ M(ue, {
|
|
3555
3556
|
htmlFor: o,
|
|
3556
|
-
children:
|
|
3557
|
-
}), /* @__PURE__ */ (
|
|
3557
|
+
children: a("editor.selectNodeType.nodeType")
|
|
3558
|
+
}), /* @__PURE__ */ N(v, {
|
|
3558
3559
|
value: n,
|
|
3559
3560
|
onValueChange: (e) => t(e),
|
|
3560
3561
|
disabled: r,
|
|
3561
|
-
children: [/* @__PURE__ */ (
|
|
3562
|
+
children: [/* @__PURE__ */ M(g, {
|
|
3562
3563
|
className: "w-full",
|
|
3563
3564
|
id: o,
|
|
3564
|
-
children: /* @__PURE__ */ (
|
|
3565
|
-
}), /* @__PURE__ */ (
|
|
3565
|
+
children: /* @__PURE__ */ M(c, { placeholder: a("editor.selectNodeType.nodeType") })
|
|
3566
|
+
}), /* @__PURE__ */ M(k, { children: /* @__PURE__ */ M(A, { children: Object.keys(yn).filter((e) => r ? e === "group" : e !== "group").map((e) => /* @__PURE__ */ M(b, {
|
|
3566
3567
|
value: e,
|
|
3567
|
-
children:
|
|
3568
|
+
children: a(`editor.selectNodeType.options.${e}`)
|
|
3568
3569
|
}, e)) }) })]
|
|
3569
3570
|
})] });
|
|
3570
3571
|
};
|
|
3571
3572
|
//#endregion
|
|
3572
3573
|
//#region src/shared/components/ui/sheet.tsx
|
|
3573
|
-
function
|
|
3574
|
-
return /* @__PURE__ */ (
|
|
3574
|
+
function rr({ ...e }) {
|
|
3575
|
+
return /* @__PURE__ */ M(U.Root, {
|
|
3575
3576
|
"data-slot": "sheet",
|
|
3576
3577
|
...e
|
|
3577
3578
|
});
|
|
3578
3579
|
}
|
|
3579
|
-
function
|
|
3580
|
-
return /* @__PURE__ */ (
|
|
3580
|
+
function ir({ ...e }) {
|
|
3581
|
+
return /* @__PURE__ */ M(U.Portal, {
|
|
3581
3582
|
"data-slot": "sheet-portal",
|
|
3582
3583
|
...e
|
|
3583
3584
|
});
|
|
3584
3585
|
}
|
|
3585
|
-
function
|
|
3586
|
-
return /* @__PURE__ */ (
|
|
3586
|
+
function ar({ className: e, ...t }) {
|
|
3587
|
+
return /* @__PURE__ */ M(U.Overlay, {
|
|
3587
3588
|
"data-slot": "sheet-overlay",
|
|
3588
|
-
className:
|
|
3589
|
+
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),
|
|
3589
3590
|
...t
|
|
3590
3591
|
});
|
|
3591
3592
|
}
|
|
3592
|
-
function
|
|
3593
|
-
return /* @__PURE__ */ (
|
|
3593
|
+
function or({ className: e, children: t, side: n = "right", ...r }) {
|
|
3594
|
+
return /* @__PURE__ */ N(ir, { children: [/* @__PURE__ */ M(ar, {}), /* @__PURE__ */ N(U.Content, {
|
|
3594
3595
|
"data-slot": "sheet-content",
|
|
3595
|
-
className:
|
|
3596
|
+
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),
|
|
3596
3597
|
...r,
|
|
3597
|
-
children: [t, /* @__PURE__ */ (
|
|
3598
|
+
children: [t, /* @__PURE__ */ N(U.Close, {
|
|
3598
3599
|
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",
|
|
3599
|
-
children: [/* @__PURE__ */ (
|
|
3600
|
+
children: [/* @__PURE__ */ M(mt, { className: "size-4" }), /* @__PURE__ */ M("span", {
|
|
3600
3601
|
className: "sr-only",
|
|
3601
3602
|
children: "Close"
|
|
3602
3603
|
})]
|
|
3603
3604
|
})]
|
|
3604
3605
|
})] });
|
|
3605
3606
|
}
|
|
3606
|
-
function
|
|
3607
|
-
return /* @__PURE__ */ (
|
|
3607
|
+
function sr({ className: e, ...t }) {
|
|
3608
|
+
return /* @__PURE__ */ M("div", {
|
|
3608
3609
|
"data-slot": "sheet-header",
|
|
3609
|
-
className:
|
|
3610
|
+
className: d("flex flex-col gap-1.5 p-4", e),
|
|
3610
3611
|
...t
|
|
3611
3612
|
});
|
|
3612
3613
|
}
|
|
3613
|
-
function
|
|
3614
|
-
return /* @__PURE__ */ (
|
|
3614
|
+
function cr({ className: e, ...t }) {
|
|
3615
|
+
return /* @__PURE__ */ M("div", {
|
|
3615
3616
|
"data-slot": "sheet-footer",
|
|
3616
|
-
className:
|
|
3617
|
+
className: d("mt-auto flex flex-col gap-2 p-4", e),
|
|
3617
3618
|
...t
|
|
3618
3619
|
});
|
|
3619
3620
|
}
|
|
3620
|
-
function
|
|
3621
|
-
return /* @__PURE__ */ (
|
|
3621
|
+
function lr({ className: e, ...t }) {
|
|
3622
|
+
return /* @__PURE__ */ M(U.Title, {
|
|
3622
3623
|
"data-slot": "sheet-title",
|
|
3623
|
-
className:
|
|
3624
|
+
className: d("font-semibold text-foreground", e),
|
|
3624
3625
|
...t
|
|
3625
3626
|
});
|
|
3626
3627
|
}
|
|
3627
|
-
function
|
|
3628
|
-
return /* @__PURE__ */ (
|
|
3628
|
+
function ur({ className: e, ...t }) {
|
|
3629
|
+
return /* @__PURE__ */ M(U.Description, {
|
|
3629
3630
|
"data-slot": "sheet-description",
|
|
3630
|
-
className:
|
|
3631
|
+
className: d("text-muted-foreground text-sm", e),
|
|
3631
3632
|
...t
|
|
3632
3633
|
});
|
|
3633
3634
|
}
|
|
3634
3635
|
//#endregion
|
|
3635
3636
|
//#region src/editor/features/TreegeEditor/sheets/NodeActionsSheet.tsx
|
|
3636
|
-
var
|
|
3637
|
-
let { selectedNode: e } = $(), { clearSelection: r, deleteSelectedNode:
|
|
3638
|
-
|
|
3637
|
+
var dr = () => {
|
|
3638
|
+
let { selectedNode: e } = $(), { clearSelection: r, deleteSelectedNode: a } = q(), { isNodeSheetOpen: o, setIsNodeSheetOpen: c } = W(), l = G(), u = l(e?.data?.label), d = () => {
|
|
3639
|
+
c(!1), r();
|
|
3639
3640
|
};
|
|
3640
|
-
return /* @__PURE__ */ (
|
|
3641
|
+
return /* @__PURE__ */ M(rr, {
|
|
3641
3642
|
open: o && !!e,
|
|
3642
3643
|
onOpenChange: (e) => {
|
|
3643
3644
|
e || d();
|
|
3644
3645
|
},
|
|
3645
|
-
children: /* @__PURE__ */ (
|
|
3646
|
+
children: /* @__PURE__ */ N(or, {
|
|
3646
3647
|
className: "flex flex-col gap-0",
|
|
3647
3648
|
children: [
|
|
3648
|
-
/* @__PURE__ */ (
|
|
3649
|
+
/* @__PURE__ */ N(sr, { children: [/* @__PURE__ */ N(lr, { children: [
|
|
3649
3650
|
l("editor.nodeActionsSheet.editNode"),
|
|
3650
3651
|
" ",
|
|
3651
|
-
/* @__PURE__ */ (
|
|
3652
|
+
/* @__PURE__ */ M("span", {
|
|
3652
3653
|
className: "font-light text-muted-foreground text-xs",
|
|
3653
3654
|
children: e?.id
|
|
3654
3655
|
})
|
|
3655
|
-
] }), /* @__PURE__ */ (
|
|
3656
|
-
/* @__PURE__ */ (
|
|
3656
|
+
] }), /* @__PURE__ */ M(ur, { children: u || "\xA0" })] }),
|
|
3657
|
+
/* @__PURE__ */ M(Nt, {
|
|
3657
3658
|
className: "flex min-h-0 flex-1 flex-col px-4",
|
|
3658
|
-
children: /* @__PURE__ */ (
|
|
3659
|
+
children: /* @__PURE__ */ N("div", {
|
|
3659
3660
|
className: "space-y-6 py-4",
|
|
3660
3661
|
children: [
|
|
3661
|
-
/* @__PURE__ */ (
|
|
3662
|
-
/* @__PURE__ */ (
|
|
3663
|
-
/* @__PURE__ */ (
|
|
3664
|
-
|
|
3665
|
-
n(e) && /* @__PURE__ */ (
|
|
3666
|
-
t(e) && /* @__PURE__ */ (
|
|
3667
|
-
|
|
3662
|
+
/* @__PURE__ */ M(nr, {}),
|
|
3663
|
+
/* @__PURE__ */ M(tr, {}),
|
|
3664
|
+
/* @__PURE__ */ M(se, {}),
|
|
3665
|
+
s(e) && /* @__PURE__ */ M($n, {}),
|
|
3666
|
+
n(e) && /* @__PURE__ */ M(er, {}),
|
|
3667
|
+
t(e) && /* @__PURE__ */ M(Nn, {}),
|
|
3668
|
+
i(e) && /* @__PURE__ */ M(Pn, {})
|
|
3668
3669
|
]
|
|
3669
3670
|
})
|
|
3670
3671
|
}),
|
|
3671
|
-
/* @__PURE__ */ (
|
|
3672
|
+
/* @__PURE__ */ M(cr, {
|
|
3672
3673
|
className: "flex items-end border-t",
|
|
3673
|
-
children: /* @__PURE__ */ (
|
|
3674
|
+
children: /* @__PURE__ */ N(Rt, { children: [/* @__PURE__ */ M(zt, {
|
|
3674
3675
|
asChild: !0,
|
|
3675
|
-
children: /* @__PURE__ */ (
|
|
3676
|
+
children: /* @__PURE__ */ M(p, {
|
|
3676
3677
|
variant: "ghost",
|
|
3677
3678
|
size: "icon",
|
|
3678
|
-
children: /* @__PURE__ */ (
|
|
3679
|
+
children: /* @__PURE__ */ M(lt, {})
|
|
3679
3680
|
})
|
|
3680
|
-
}), /* @__PURE__ */ (
|
|
3681
|
+
}), /* @__PURE__ */ N(Ht, { children: [/* @__PURE__ */ N(Ut, { children: [/* @__PURE__ */ M(Gt, { children: l("editor.nodeActionsSheet.deleteNode") }), /* @__PURE__ */ M(Kt, { children: l("editor.nodeActionsSheet.deleteNodeConfirm") })] }), /* @__PURE__ */ N(Wt, { children: [/* @__PURE__ */ M(Jt, { children: l("common.cancel") }), /* @__PURE__ */ M(qt, {
|
|
3681
3682
|
onClick: () => {
|
|
3682
|
-
|
|
3683
|
+
a(), d();
|
|
3683
3684
|
},
|
|
3684
3685
|
children: l("common.delete")
|
|
3685
3686
|
})] })] })] })
|
|
@@ -3687,9 +3688,9 @@ var ur = () => {
|
|
|
3687
3688
|
]
|
|
3688
3689
|
})
|
|
3689
3690
|
});
|
|
3690
|
-
},
|
|
3691
|
-
let { theme: t = "system" } =
|
|
3692
|
-
return /* @__PURE__ */ (
|
|
3691
|
+
}, fr = ({ ...e }) => {
|
|
3692
|
+
let { theme: t = "system" } = Et();
|
|
3693
|
+
return /* @__PURE__ */ M(wt, {
|
|
3693
3694
|
theme: t,
|
|
3694
3695
|
className: "toaster group",
|
|
3695
3696
|
style: {
|
|
@@ -3699,13 +3700,13 @@ var ur = () => {
|
|
|
3699
3700
|
},
|
|
3700
3701
|
...e
|
|
3701
3702
|
});
|
|
3702
|
-
},
|
|
3703
|
+
}, pr = ({ flow: e, onExportJson: t, onSave: n, theme: r, className: i }) => {
|
|
3703
3704
|
let { onConnect: a, onConnectEnd: o, onEdgesDelete: s, isValidConnection: c } = on();
|
|
3704
|
-
return /* @__PURE__ */ (
|
|
3705
|
+
return /* @__PURE__ */ N(xe, {
|
|
3705
3706
|
fitView: !0,
|
|
3706
3707
|
colorMode: r,
|
|
3707
3708
|
selectNodesOnDrag: !1,
|
|
3708
|
-
nodeTypes:
|
|
3709
|
+
nodeTypes: yn,
|
|
3709
3710
|
edgeTypes: Ft,
|
|
3710
3711
|
defaultEdges: e?.edges || [],
|
|
3711
3712
|
defaultNodes: e?.nodes || [],
|
|
@@ -3713,33 +3714,33 @@ var ur = () => {
|
|
|
3713
3714
|
onConnectEnd: o,
|
|
3714
3715
|
onEdgesDelete: s,
|
|
3715
3716
|
isValidConnection: c,
|
|
3716
|
-
className:
|
|
3717
|
+
className: d(i, "treege"),
|
|
3717
3718
|
children: [
|
|
3718
|
-
/* @__PURE__ */ (
|
|
3719
|
+
/* @__PURE__ */ M(de, {
|
|
3719
3720
|
gap: 10,
|
|
3720
3721
|
variant: fe.Dots
|
|
3721
3722
|
}),
|
|
3722
|
-
/* @__PURE__ */ (
|
|
3723
|
+
/* @__PURE__ */ M(jn, {
|
|
3723
3724
|
onExportJson: t,
|
|
3724
3725
|
onSave: n
|
|
3725
3726
|
}),
|
|
3726
|
-
/* @__PURE__ */ (
|
|
3727
|
-
/* @__PURE__ */ (
|
|
3728
|
-
/* @__PURE__ */ (
|
|
3729
|
-
/* @__PURE__ */ (
|
|
3727
|
+
/* @__PURE__ */ M(kt, { theme: r }),
|
|
3728
|
+
/* @__PURE__ */ M(_e, {}),
|
|
3729
|
+
/* @__PURE__ */ M(me, {}),
|
|
3730
|
+
/* @__PURE__ */ M(dr, {})
|
|
3730
3731
|
]
|
|
3731
3732
|
});
|
|
3732
|
-
},
|
|
3733
|
+
}, mr = ({ flow: e, onExportJson: t, onSave: n, theme: r = "dark", language: i = "en", aiConfig: a }) => /* @__PURE__ */ M(o, {
|
|
3733
3734
|
defaultTheme: r,
|
|
3734
3735
|
storageKey: "treege-editor-theme",
|
|
3735
3736
|
theme: r,
|
|
3736
|
-
children: /* @__PURE__ */ (
|
|
3737
|
+
children: /* @__PURE__ */ N(Mt, {
|
|
3737
3738
|
value: {
|
|
3738
3739
|
aiConfig: a,
|
|
3739
3740
|
flowId: e?.id,
|
|
3740
3741
|
language: i
|
|
3741
3742
|
},
|
|
3742
|
-
children: [/* @__PURE__ */ (
|
|
3743
|
+
children: [/* @__PURE__ */ M(fr, { position: "bottom-center" }), /* @__PURE__ */ M(Se, { children: /* @__PURE__ */ M(pr, {
|
|
3743
3744
|
onExportJson: t,
|
|
3744
3745
|
onSave: n,
|
|
3745
3746
|
flow: e,
|
|
@@ -3748,4 +3749,4 @@ var ur = () => {
|
|
|
3748
3749
|
})
|
|
3749
3750
|
});
|
|
3750
3751
|
//#endregion
|
|
3751
|
-
export {
|
|
3752
|
+
export { mr as t };
|