treege 3.0.0-beta.62 → 3.0.0-beta.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +95 -43
  2. package/dist/DefaultInputs-2wzCRMKH.js +1742 -0
  3. package/dist/{ThemeContext-cGSTk24y.js → ThemeContext-7cghqUb0.js} +108 -602
  4. package/dist/{editor-K1jjfc5n.js → editor-DPECN9XS.js} +1799 -1800
  5. package/dist/editor.js +2 -2
  6. package/dist/main.js +6 -4
  7. package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +1 -1
  8. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +1 -2
  9. package/dist/renderer/features/TreegeRenderer/native/components/DefaultStep.d.ts +1 -1
  10. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +2 -2
  11. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +2 -2
  12. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +2 -2
  13. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +2 -2
  14. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +2 -2
  15. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +2 -2
  16. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +2 -2
  17. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +2 -2
  18. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +2 -2
  19. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +2 -2
  20. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +2 -2
  21. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +2 -2
  22. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSubmitInput.d.ts +11 -0
  23. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +2 -2
  24. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +2 -2
  25. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +2 -2
  26. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +2 -2
  27. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +2 -2
  28. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +2 -0
  29. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  30. package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +2 -1
  31. package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +1 -1
  32. package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +4 -0
  33. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +2 -2
  34. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +2 -2
  35. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +2 -2
  36. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +2 -2
  37. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +2 -2
  38. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +2 -2
  39. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +2 -2
  40. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +2 -2
  41. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +2 -2
  42. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +2 -2
  43. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +2 -2
  44. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +2 -2
  45. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +10 -2
  46. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +2 -2
  47. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +2 -2
  48. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +2 -2
  49. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +2 -2
  50. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +2 -2
  51. package/dist/renderer/hooks/useRenderNode.d.ts +4 -1
  52. package/dist/renderer/types/renderer.d.ts +73 -11
  53. package/dist/renderer/utils/form.d.ts +16 -0
  54. package/dist/renderer-DlAYvOLz.js +272 -0
  55. package/dist/renderer-native.js +1011 -1002
  56. package/dist/renderer.js +5 -3
  57. package/dist/useRenderNode-CZt7LwVV.js +504 -0
  58. package/package.json +1 -1
  59. package/dist/DefaultInputs-DamDWb5R.js +0 -1988
  60. package/dist/renderer/features/TreegeRenderer/InputRendererHost.d.ts +0 -15
@@ -0,0 +1,1742 @@
1
+ import { C as e, D as t, S as n, T as r, _ as i, b as a, g as o, k as s, m as c, p as l, s as u, v as d, w as f, y as p } from "./ThemeContext-7cghqUb0.js";
2
+ import * as m from "react";
3
+ import { createContext as h, useCallback as g, useContext as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
4
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
5
+ import { Check as T, CheckIcon as E, ChevronDownIcon as D, ChevronLeftIcon as ee, ChevronRightIcon as te, ChevronUpIcon as ne, ChevronsUpDown as re, CircleIcon as ie, Loader2 as O, MapPin as k, SearchIcon as ae, XIcon as A } from "lucide-react";
6
+ import { Slot as j } from "@radix-ui/react-slot";
7
+ import { cva as M } from "class-variance-authority";
8
+ import { clsx as oe } from "clsx";
9
+ import { extendTailwindMerge as N } from "tailwind-merge";
10
+ import * as se from "@radix-ui/react-checkbox";
11
+ import * as P from "@radix-ui/react-label";
12
+ import * as F from "@radix-ui/react-popover";
13
+ import * as I from "@radix-ui/react-select";
14
+ import * as L from "@radix-ui/react-tooltip";
15
+ import * as R from "@radix-ui/react-separator";
16
+ import { Command as z } from "cmdk";
17
+ import * as B from "@radix-ui/react-dialog";
18
+ import { DayPicker as ce, getDefaultClassNames as V } from "react-day-picker";
19
+ import * as H from "@radix-ui/react-radio-group";
20
+ import * as U from "@radix-ui/react-switch";
21
+ //#region src/shared/lib/utils.ts
22
+ var le = N({ prefix: "tg" });
23
+ function W(...e) {
24
+ return le(oe(e));
25
+ }
26
+ //#endregion
27
+ //#region src/shared/components/ui/button.tsx
28
+ var ue = M("tg:inline-flex tg:items-center tg:justify-center tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:text-sm tg:font-medium tg:transition-all tg:disabled:pointer-events-none tg:disabled:opacity-50 tg:[&_svg]:pointer-events-none tg:[&_svg:not([class*='size-'])]:size-4 tg:shrink-0 tg:[&_svg]:shrink-0 tg:outline-none tg:focus-visible:border-ring tg:focus-visible:ring-ring/50 tg:focus-visible:ring-[3px] tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40 tg:aria-invalid:border-destructive", {
29
+ defaultVariants: {
30
+ size: "default",
31
+ variant: "default"
32
+ },
33
+ variants: {
34
+ size: {
35
+ default: "tg:h-9 tg:px-4 tg:py-2 tg:has-[>svg]:px-3",
36
+ icon: "tg:size-9",
37
+ "icon-lg": "tg:size-10",
38
+ "icon-sm": "tg:size-8",
39
+ lg: "tg:h-10 tg:rounded-md tg:px-6 tg:has-[>svg]:px-4",
40
+ sm: "tg:h-8 tg:rounded-md tg:gap-1.5 tg:px-3 tg:has-[>svg]:px-2.5",
41
+ xs: "tg:h-6 tg:rounded-md tg:gap-1 tg:px-2 tg:text-xs tg:has-[>svg]:px-1.5"
42
+ },
43
+ variant: {
44
+ default: "tg:bg-primary tg:text-primary-foreground tg:hover:bg-primary/90",
45
+ destructive: "tg:bg-destructive tg:text-white tg:hover:bg-destructive/90 tg:focus-visible:ring-destructive/20 tg:dark:focus-visible:ring-destructive/40 tg:dark:bg-destructive/60",
46
+ ghost: "tg:hover:bg-accent tg:hover:text-accent-foreground tg:dark:hover:bg-accent/50",
47
+ icon: "tg:opacity-60 tg:hover:bg-transparent! tg:hover:opacity-100",
48
+ link: "tg:text-primary tg:underline-offset-4 tg:hover:underline",
49
+ outline: "tg:border tg:bg-background tg:shadow-xs tg:hover:bg-accent tg:hover:text-accent-foreground tg:dark:bg-input/30 tg:dark:border-input tg:dark:hover:bg-input/50",
50
+ secondary: "tg:bg-secondary tg:text-secondary-foreground tg:hover:bg-secondary/80"
51
+ }
52
+ }
53
+ });
54
+ function G({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
55
+ return /* @__PURE__ */ C(r ? j : "button", {
56
+ "data-slot": "button",
57
+ className: W(ue({
58
+ className: e,
59
+ size: n,
60
+ variant: t
61
+ })),
62
+ ...i
63
+ });
64
+ }
65
+ //#endregion
66
+ //#region src/shared/components/ui/checkbox.tsx
67
+ function de({ className: e, ...t }) {
68
+ return /* @__PURE__ */ C(se.Root, {
69
+ "data-slot": "checkbox",
70
+ className: W("tg:peer tg:size-4 tg:shrink-0 tg:rounded-[4px] tg:border tg:border-input tg:shadow-xs tg:outline-none tg:transition-shadow tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:data-[state=checked]:border-primary tg:data-[state=checked]:bg-primary tg:data-[state=checked]:text-primary-foreground tg:dark:bg-input/30 tg:dark:data-[state=checked]:bg-primary tg:dark:aria-invalid:ring-destructive/40", e),
71
+ ...t,
72
+ children: /* @__PURE__ */ C(se.Indicator, {
73
+ "data-slot": "checkbox-indicator",
74
+ className: "tg:grid tg:place-content-center tg:text-current tg:transition-none",
75
+ children: /* @__PURE__ */ C(E, { className: "tg:size-3.5" })
76
+ })
77
+ });
78
+ }
79
+ //#endregion
80
+ //#region src/shared/components/ui/form.tsx
81
+ function K({ className: e, ...t }) {
82
+ return /* @__PURE__ */ C("div", {
83
+ "data-slot": "form-item",
84
+ className: W("tg:grid tg:gap-2", e),
85
+ ...t
86
+ });
87
+ }
88
+ function q({ className: e, ...t }) {
89
+ return /* @__PURE__ */ C("p", {
90
+ "data-slot": "form-description",
91
+ className: W("tg:text-muted-foreground tg:text-xs", e),
92
+ ...t
93
+ });
94
+ }
95
+ function J({ className: e, ...t }) {
96
+ return /* @__PURE__ */ C("p", {
97
+ "data-slot": "form-error",
98
+ className: W("tg:text-destructive tg:text-xs", e),
99
+ ...t
100
+ });
101
+ }
102
+ //#endregion
103
+ //#region src/shared/components/ui/input.tsx
104
+ function Y({ className: e, type: t, ...n }) {
105
+ return /* @__PURE__ */ C("input", {
106
+ type: t,
107
+ "data-slot": "input",
108
+ className: W("tg:h-9 tg:w-full tg:min-w-0 tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-1 tg:text-base tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:selection:bg-primary tg:selection:text-primary-foreground tg:file:inline-flex tg:file:h-7 tg:file:border-0 tg:file:bg-transparent tg:file:font-medium tg:file:text-foreground tg:file:text-sm tg:placeholder:text-muted-foreground tg:disabled:pointer-events-none tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:md:text-sm tg:dark:bg-input/30", "tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50", "tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:dark:aria-invalid:ring-destructive/40", e),
109
+ ...n
110
+ });
111
+ }
112
+ //#endregion
113
+ //#region src/shared/components/ui/label.tsx
114
+ var X = ({ className: e, ...t }) => /* @__PURE__ */ C(P.Root, {
115
+ "data-slot": "label",
116
+ className: W("tg:flex tg:select-none tg:items-center tg:gap-2 tg:font-medium tg:text-muted-foreground tg:text-sm tg:leading-none tg:peer-disabled:cursor-not-allowed tg:peer-disabled:opacity-50 tg:group-data-[disabled=true]:pointer-events-none tg:group-data-[disabled=true]:opacity-50", e),
117
+ ...t
118
+ }), fe = h(null), Z = () => _(fe), Q = ({ container: e, children: t }) => /* @__PURE__ */ C(fe.Provider, {
119
+ value: e,
120
+ children: t
121
+ });
122
+ //#endregion
123
+ //#region src/shared/components/ui/popover.tsx
124
+ function pe({ ...e }) {
125
+ return /* @__PURE__ */ C(F.Root, {
126
+ "data-slot": "popover",
127
+ ...e
128
+ });
129
+ }
130
+ function me({ ...e }) {
131
+ return /* @__PURE__ */ C(F.Trigger, {
132
+ "data-slot": "popover-trigger",
133
+ ...e
134
+ });
135
+ }
136
+ function he({ className: e, align: t = "center", sideOffset: n = 4, disablePortal: r = !1, container: i, ...a }) {
137
+ let o = Z(), s = i ?? o, c = /* @__PURE__ */ C(F.Content, {
138
+ "data-slot": "popover-content",
139
+ align: t,
140
+ sideOffset: n,
141
+ className: W("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:z-[2000] tg:w-72 tg:origin-(--radix-popover-content-transform-origin) tg:rounded-md tg:border tg:bg-popover tg:p-4 tg:text-popover-foreground tg:shadow-md tg:outline-hidden tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
142
+ ...a
143
+ });
144
+ return r ? c : /* @__PURE__ */ C(F.Portal, {
145
+ container: s ?? void 0,
146
+ children: c
147
+ });
148
+ }
149
+ //#endregion
150
+ //#region src/shared/components/ui/select.tsx
151
+ var ge = ({ ...e }) => /* @__PURE__ */ C(I.Root, {
152
+ "data-slot": "select",
153
+ ...e
154
+ }), _e = ({ ...e }) => /* @__PURE__ */ C(I.Group, {
155
+ "data-slot": "select-group",
156
+ ...e
157
+ }), ve = ({ ...e }) => /* @__PURE__ */ C(I.Value, {
158
+ "data-slot": "select-value",
159
+ ...e
160
+ }), ye = ({ className: e, size: t = "default", children: n, ...r }) => /* @__PURE__ */ w(I.Trigger, {
161
+ "data-slot": "select-trigger",
162
+ "data-size": t,
163
+ className: W("tg:flex tg:w-fit tg:items-center tg:justify-between tg:gap-2 tg:whitespace-nowrap tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-2 tg:text-sm tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:data-[size=default]:h-9 tg:data-[size=sm]:h-8 tg:data-[placeholder]:text-muted-foreground tg:*:data-[slot=select-value]:line-clamp-1 tg:*:data-[slot=select-value]:flex tg:*:data-[slot=select-value]:items-center tg:*:data-[slot=select-value]:gap-2 tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40 tg:dark:hover:bg-input/50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
164
+ ...r,
165
+ children: [n, /* @__PURE__ */ C(I.Icon, {
166
+ asChild: !0,
167
+ children: /* @__PURE__ */ C(D, { className: "tg:size-4 tg:opacity-50" })
168
+ })]
169
+ }), be = ({ className: e, children: t, position: n = "popper", ...r }) => /* @__PURE__ */ C(I.Portal, {
170
+ container: Z() ?? void 0,
171
+ children: /* @__PURE__ */ w(I.Content, {
172
+ "data-slot": "select-content",
173
+ className: W("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:relative tg:z-[2000] tg:max-h-(--radix-select-content-available-height) tg:min-w-[8rem] tg:origin-(--radix-select-content-transform-origin) tg:overflow-y-auto tg:overflow-x-hidden tg:rounded-md tg:border tg:bg-popover tg:text-popover-foreground tg:shadow-md tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", n === "popper" && "tg:data-[side=left]:-translate-x-1 tg:data-[side=top]:-translate-y-1 tg:data-[side=right]:translate-x-1 tg:data-[side=bottom]:translate-y-1", e),
174
+ position: n,
175
+ ...r,
176
+ children: [
177
+ /* @__PURE__ */ C(we, {}),
178
+ /* @__PURE__ */ C(I.Viewport, {
179
+ className: W("tg:p-1", n === "popper" && "tg:h-[var(--radix-select-trigger-height)] tg:w-full tg:min-w-[var(--radix-select-trigger-width)] tg:scroll-my-1"),
180
+ children: t
181
+ }),
182
+ /* @__PURE__ */ C(Te, {})
183
+ ]
184
+ })
185
+ }), xe = ({ className: e, htmlFor: t, children: n, ...r }) => /* @__PURE__ */ C(I.Label, {
186
+ "data-slot": "select-label",
187
+ className: W("tg:pb-1.5 tg:font-medium tg:text-muted-foreground tg:text-sm", e),
188
+ ...r,
189
+ children: /* @__PURE__ */ C("label", {
190
+ htmlFor: t,
191
+ children: n
192
+ })
193
+ }), Se = ({ className: e, children: t, ...n }) => /* @__PURE__ */ w(I.Item, {
194
+ "data-slot": "select-item",
195
+ className: W("tg:relative tg:flex tg:w-full tg:cursor-pointer tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:py-1.5 tg:pr-8 tg:pl-2 tg:text-sm tg:outline-hidden tg:focus:bg-accent tg:focus:text-accent-foreground tg:data-[disabled]:pointer-events-none tg:data-[disabled]:opacity-50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0 tg:*:[span]:last:flex tg:*:[span]:last:items-center tg:*:[span]:last:gap-2", e),
196
+ ...n,
197
+ children: [/* @__PURE__ */ C("span", {
198
+ className: "tg:absolute tg:right-2 tg:flex tg:size-3.5 tg:items-center tg:justify-center",
199
+ children: /* @__PURE__ */ C(I.ItemIndicator, { children: /* @__PURE__ */ C(E, { className: "tg:size-4" }) })
200
+ }), /* @__PURE__ */ C(I.ItemText, { children: t })]
201
+ }), Ce = ({ className: e, ...t }) => /* @__PURE__ */ C(I.Separator, {
202
+ "data-slot": "select-separator",
203
+ className: W("tg:-mx-1 tg:pointer-events-none tg:my-1 tg:h-px tg:bg-border", e),
204
+ ...t
205
+ }), we = ({ className: e, ...t }) => /* @__PURE__ */ C(I.ScrollUpButton, {
206
+ "data-slot": "select-scroll-up-button",
207
+ className: W("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
208
+ ...t,
209
+ children: /* @__PURE__ */ C(ne, { className: "tg:size-4" })
210
+ }), Te = ({ className: e, ...t }) => /* @__PURE__ */ C(I.ScrollDownButton, {
211
+ "data-slot": "select-scroll-down-button",
212
+ className: W("tg:flex tg:cursor-default tg:items-center tg:justify-center tg:py-1", e),
213
+ ...t,
214
+ children: /* @__PURE__ */ C(D, { className: "tg:size-4" })
215
+ });
216
+ //#endregion
217
+ //#region src/shared/components/ui/tooltip.tsx
218
+ function Ee({ delayDuration: e = 0, ...t }) {
219
+ return /* @__PURE__ */ C(L.Provider, {
220
+ "data-slot": "tooltip-provider",
221
+ delayDuration: e,
222
+ ...t
223
+ });
224
+ }
225
+ function De({ ...e }) {
226
+ return /* @__PURE__ */ C(Ee, { children: /* @__PURE__ */ C(L.Root, {
227
+ "data-slot": "tooltip",
228
+ ...e
229
+ }) });
230
+ }
231
+ function Oe({ ...e }) {
232
+ return /* @__PURE__ */ C(L.Trigger, {
233
+ "data-slot": "tooltip-trigger",
234
+ ...e
235
+ });
236
+ }
237
+ function ke({ className: e, sideOffset: t = 0, children: n, ...r }) {
238
+ return /* @__PURE__ */ C(L.Portal, {
239
+ container: Z() ?? void 0,
240
+ children: /* @__PURE__ */ w(L.Content, {
241
+ "data-slot": "tooltip-content",
242
+ sideOffset: t,
243
+ className: W("tg:fade-in-0 tg:zoom-in-95 tg:data-[state=closed]:fade-out-0 tg:data-[state=closed]:zoom-out-95 tg:data-[side=bottom]:slide-in-from-top-2 tg:data-[side=left]:slide-in-from-right-2 tg:data-[side=right]:slide-in-from-left-2 tg:data-[side=top]:slide-in-from-bottom-2 tg:z-[2000] tg:w-fit tg:origin-(--radix-tooltip-content-transform-origin) tg:animate-in tg:text-balance tg:rounded-md tg:bg-foreground tg:px-3 tg:py-1.5 tg:text-background tg:text-xs tg:data-[state=closed]:animate-out", e),
244
+ ...r,
245
+ children: [n, /* @__PURE__ */ C(L.Arrow, { className: "tg:z-[2000] tg:size-2.5 tg:translate-y-[calc(-50%_-_2px)] tg:rotate-45 tg:rounded-[2px] tg:bg-foreground tg:fill-foreground" })]
246
+ })
247
+ });
248
+ }
249
+ //#endregion
250
+ //#region src/shared/components/ui/separator.tsx
251
+ function $({ className: e, orientation: t = "horizontal", decorative: n = !0, ...r }) {
252
+ return /* @__PURE__ */ C(R.Root, {
253
+ "data-slot": "separator",
254
+ decorative: n,
255
+ orientation: t,
256
+ className: W("tg:shrink-0 tg:bg-border tg:data-[orientation=horizontal]:h-px tg:data-[orientation=vertical]:h-full tg:data-[orientation=horizontal]:w-full tg:data-[orientation=vertical]:w-px", e),
257
+ ...r
258
+ });
259
+ }
260
+ //#endregion
261
+ //#region src/shared/components/ui/dialog.tsx
262
+ function Ae({ ...e }) {
263
+ return /* @__PURE__ */ C(B.Root, {
264
+ "data-slot": "dialog",
265
+ ...e
266
+ });
267
+ }
268
+ function je({ ...e }) {
269
+ return /* @__PURE__ */ C(B.Trigger, {
270
+ "data-slot": "dialog-trigger",
271
+ ...e
272
+ });
273
+ }
274
+ function Me({ ...e }) {
275
+ return /* @__PURE__ */ C(B.Portal, {
276
+ "data-slot": "dialog-portal",
277
+ ...e
278
+ });
279
+ }
280
+ function Ne({ className: e, ...t }) {
281
+ return /* @__PURE__ */ C(B.Overlay, {
282
+ "data-slot": "dialog-overlay",
283
+ className: W("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:fixed tg:inset-0 tg:z-[2000] tg:bg-black/50 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in", e),
284
+ ...t
285
+ });
286
+ }
287
+ function Pe({ className: e, children: t, showCloseButton: n = !0, ...r }) {
288
+ let [i, a] = m.useState(null);
289
+ return /* @__PURE__ */ w(Me, {
290
+ "data-slot": "dialog-portal",
291
+ children: [/* @__PURE__ */ C(Ne, {}), /* @__PURE__ */ C(B.Content, {
292
+ ref: a,
293
+ "data-slot": "dialog-content",
294
+ className: W("tg:data-[state=closed]:fade-out-0 tg:data-[state=open]:fade-in-0 tg:data-[state=closed]:zoom-out-95 tg:data-[state=open]:zoom-in-95 tg:fixed tg:top-[50%] tg:left-[50%] tg:z-[2000] tg:grid tg:w-full tg:max-w-[calc(100%-2rem)] tg:translate-x-[-50%] tg:translate-y-[-50%] tg:gap-4 tg:rounded-lg tg:border tg:bg-background tg:p-6 tg:shadow-lg tg:duration-200 tg:data-[state=closed]:animate-out tg:data-[state=open]:animate-in tg:sm:max-w-lg", e),
295
+ ...r,
296
+ children: /* @__PURE__ */ w(Q, {
297
+ container: i,
298
+ children: [t, n && /* @__PURE__ */ w(B.Close, {
299
+ "data-slot": "dialog-close",
300
+ className: "tg:absolute tg:top-4 tg:right-4 tg:rounded-xs tg:opacity-70 tg:ring-offset-background tg:transition-opacity tg:hover:opacity-100 tg:focus:outline-hidden tg:focus:ring-2 tg:focus:ring-ring tg:focus:ring-offset-2 tg:disabled:pointer-events-none tg:data-[state=open]:bg-accent tg:data-[state=open]:text-muted-foreground tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0",
301
+ children: [/* @__PURE__ */ C(A, {}), /* @__PURE__ */ C("span", {
302
+ className: "tg:sr-only",
303
+ children: "Close"
304
+ })]
305
+ })]
306
+ })
307
+ })]
308
+ });
309
+ }
310
+ function Fe({ className: e, ...t }) {
311
+ return /* @__PURE__ */ C("div", {
312
+ "data-slot": "dialog-header",
313
+ className: W("tg:flex tg:flex-col tg:gap-2 tg:text-center tg:sm:text-left", e),
314
+ ...t
315
+ });
316
+ }
317
+ function Ie({ className: e, ...t }) {
318
+ return /* @__PURE__ */ C("div", {
319
+ "data-slot": "dialog-footer",
320
+ className: W("tg:flex tg:flex-col-reverse tg:gap-2 tg:sm:flex-row tg:sm:justify-end", e),
321
+ ...t
322
+ });
323
+ }
324
+ function Le({ className: e, ...t }) {
325
+ return /* @__PURE__ */ C(B.Title, {
326
+ "data-slot": "dialog-title",
327
+ className: W("tg:font-semibold tg:text-lg tg:leading-none", e),
328
+ ...t
329
+ });
330
+ }
331
+ function Re({ className: e, ...t }) {
332
+ return /* @__PURE__ */ C(B.Description, {
333
+ "data-slot": "dialog-description",
334
+ className: W("tg:text-muted-foreground tg:text-sm", e),
335
+ ...t
336
+ });
337
+ }
338
+ //#endregion
339
+ //#region src/shared/components/ui/command.tsx
340
+ function ze({ className: e, ...t }) {
341
+ return /* @__PURE__ */ C(z, {
342
+ "data-slot": "command",
343
+ className: W("tg:flex tg:h-full tg:w-full tg:flex-col tg:overflow-hidden tg:rounded-md tg:bg-popover tg:text-popover-foreground", e),
344
+ ...t
345
+ });
346
+ }
347
+ function Be({ className: e, ...t }) {
348
+ return /* @__PURE__ */ w("div", {
349
+ "data-slot": "command-input-wrapper",
350
+ className: "tg:flex tg:h-9 tg:items-center tg:gap-2 tg:border-b tg:px-3",
351
+ children: [/* @__PURE__ */ C(ae, { className: "tg:size-4 tg:shrink-0 tg:opacity-50" }), /* @__PURE__ */ C(z.Input, {
352
+ "data-slot": "command-input",
353
+ className: W("tg:flex tg:h-10 tg:w-full tg:rounded-md tg:bg-transparent tg:py-3 tg:text-sm tg:outline-hidden tg:placeholder:text-muted-foreground tg:disabled:cursor-not-allowed tg:disabled:opacity-50", e),
354
+ ...t
355
+ })]
356
+ });
357
+ }
358
+ function Ve({ className: e, ...t }) {
359
+ return /* @__PURE__ */ C(z.List, {
360
+ "data-slot": "command-list",
361
+ className: W("tg:max-h-[300px] tg:scroll-py-1 tg:overflow-y-auto tg:overflow-x-hidden", e),
362
+ ...t
363
+ });
364
+ }
365
+ function He({ ...e }) {
366
+ return /* @__PURE__ */ C(z.Empty, {
367
+ "data-slot": "command-empty",
368
+ className: "tg:py-6 tg:text-center tg:text-sm",
369
+ ...e
370
+ });
371
+ }
372
+ function Ue({ className: e, ...t }) {
373
+ return /* @__PURE__ */ C(z.Group, {
374
+ "data-slot": "command-group",
375
+ className: W("tg:overflow-hidden tg:p-1 tg:text-foreground tg:[&_[cmdk-group-heading]]:px-2 tg:[&_[cmdk-group-heading]]:py-1.5 tg:[&_[cmdk-group-heading]]:font-medium tg:[&_[cmdk-group-heading]]:text-muted-foreground tg:[&_[cmdk-group-heading]]:text-xs", e),
376
+ ...t
377
+ });
378
+ }
379
+ function We({ className: e, ...t }) {
380
+ return /* @__PURE__ */ C(z.Item, {
381
+ "data-slot": "command-item",
382
+ className: W("tg:relative tg:flex tg:cursor-default tg:select-none tg:items-center tg:gap-2 tg:rounded-sm tg:px-2 tg:py-1.5 tg:text-sm tg:outline-hidden tg:data-[disabled=true]:pointer-events-none tg:data-[selected=true]:bg-accent tg:data-[selected=true]:text-accent-foreground tg:data-[disabled=true]:opacity-50 tg:[&_svg:not([class*='size-'])]:size-4 tg:[&_svg:not([class*='text-'])]:text-muted-foreground tg:[&_svg]:pointer-events-none tg:[&_svg]:shrink-0", e),
383
+ ...t
384
+ });
385
+ }
386
+ //#endregion
387
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.tsx
388
+ var Ge = async (e, t) => {
389
+ if (!e || e.trim().length < 3) return [];
390
+ try {
391
+ let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
392
+ Accept: "application/json",
393
+ "User-Agent": "Treege Renderer",
394
+ ...t && { "Accept-Language": t }
395
+ } });
396
+ return n.ok ? (await n.json()).map((e) => ({
397
+ label: e.display_name,
398
+ value: e.display_name
399
+ })) : [];
400
+ } catch (e) {
401
+ return console.error("Nominatim fetch error:", e), [];
402
+ }
403
+ }, Ke = (e) => !e || e.trim().length < 3 ? Promise.resolve([]) : new Promise((t) => {
404
+ if (!window.google?.maps?.places) {
405
+ console.warn("Google Places SDK not loaded yet"), t([]);
406
+ return;
407
+ }
408
+ new window.google.maps.places.AutocompleteService().getPlacePredictions({ input: e }, (e, n) => {
409
+ if (n !== google.maps.places.PlacesServiceStatus.OK || !e) {
410
+ console.warn("Google Places API status:", n), t([]);
411
+ return;
412
+ }
413
+ t(e.map((e) => ({
414
+ label: e.description,
415
+ value: e.description
416
+ })));
417
+ });
418
+ }), qe = ({ field: e, extra: t }) => {
419
+ let [n, i] = x(""), [a, o] = x([]), [c, l] = x(!1), { id: u, name: d, value: f, placeholder: p } = e, { node: m, setValue: h, error: _, label: y, helperText: b } = t, { googleApiKey: T, language: E } = s(), D = r(), ee = g((e) => {
420
+ h(e.value), i(e.value), l(!1);
421
+ }, [h]), te = g((e) => {
422
+ h(e), i(e), e.length >= 3 && l(!0);
423
+ }, [h]);
424
+ return v(() => {
425
+ if (!n || n.trim().length < 3) {
426
+ o([]);
427
+ return;
428
+ }
429
+ let e = setTimeout(async () => {
430
+ o(T ? await Ke(n) : await Ge(n, E));
431
+ }, 300);
432
+ return () => clearTimeout(e);
433
+ }, [
434
+ n,
435
+ T,
436
+ E
437
+ ]), /* @__PURE__ */ w(S, { children: [T && /* @__PURE__ */ C("script", {
438
+ async: !0,
439
+ src: `https://maps.googleapis.com/maps/api/js?key=${T}&libraries=places`
440
+ }), /* @__PURE__ */ w(K, {
441
+ className: "tg:mb-4",
442
+ children: [
443
+ /* @__PURE__ */ w(X, {
444
+ htmlFor: u,
445
+ children: [y || m.data.name, m.data.required && /* @__PURE__ */ C("span", {
446
+ className: "tg:text-red-500",
447
+ children: "*"
448
+ })]
449
+ }),
450
+ /* @__PURE__ */ w("div", {
451
+ className: "tg:relative",
452
+ children: [
453
+ /* @__PURE__ */ C(Y, {
454
+ type: "text",
455
+ id: u,
456
+ name: d,
457
+ value: f || "",
458
+ onChange: (e) => te(e.target.value),
459
+ onFocus: () => {
460
+ a.length > 0 && l(!0);
461
+ },
462
+ placeholder: p || D("renderer.defaultAddressInput.enterAddress"),
463
+ className: "tg:pr-10",
464
+ autoComplete: "off"
465
+ }),
466
+ /* @__PURE__ */ C(k, { className: "tg:-translate-y-1/2 tg:pointer-events-none tg:absolute tg:top-1/2 tg:right-3 tg:h-4 tg:w-4 tg:text-muted-foreground" }),
467
+ c && /* @__PURE__ */ C("div", {
468
+ className: "tg:absolute tg:z-50 tg:mt-1 tg:w-full tg:rounded-md tg:border tg:bg-popover tg:shadow-md",
469
+ children: /* @__PURE__ */ C(ze, { children: /* @__PURE__ */ w(Ve, { children: [/* @__PURE__ */ C(He, { children: D("renderer.defaultAddressInput.noAddressesFound") }), /* @__PURE__ */ C(Ue, { children: a.map((e, t) => /* @__PURE__ */ w(We, {
470
+ value: e.value,
471
+ onSelect: () => ee(e),
472
+ onMouseDown: (e) => e.preventDefault(),
473
+ children: [/* @__PURE__ */ C(k, { className: "tg:mr-2 tg:h-4 tg:w-4" }), e.label]
474
+ }, t)) })] }) })
475
+ })
476
+ ]
477
+ }),
478
+ _ && /* @__PURE__ */ C(J, { children: _ }),
479
+ b && !_ && /* @__PURE__ */ C(q, { children: b })
480
+ ]
481
+ })] });
482
+ }, Je = ({ missing: e }) => /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("p", {
483
+ className: "tg:font-medium",
484
+ children: r()("renderer.dependencyHint.title")
485
+ }), /* @__PURE__ */ C("ul", {
486
+ className: "tg:mt-1 tg:list-disc tg:pl-4",
487
+ children: e.map((e) => /* @__PURE__ */ C("li", { children: e.label }, e.id))
488
+ })] }), Ye = ({ missing: e, children: t }) => e.length === 0 ? /* @__PURE__ */ C(S, { children: t }) : /* @__PURE__ */ C(Ee, { children: /* @__PURE__ */ w(De, { children: [/* @__PURE__ */ C(Oe, {
489
+ asChild: !0,
490
+ children: /* @__PURE__ */ C("div", {
491
+ className: "tg:w-full",
492
+ children: t
493
+ })
494
+ }), /* @__PURE__ */ C(ke, { children: /* @__PURE__ */ C(Je, { missing: e }) })] }) }), Xe = ({ missing: e }) => e.length === 0 ? null : /* @__PURE__ */ C("div", {
495
+ className: "tg:text-muted-foreground tg:text-sm",
496
+ children: /* @__PURE__ */ C(Je, { missing: e })
497
+ });
498
+ M("tg:group/item tg:flex tg:flex-wrap tg:items-center tg:rounded-md tg:border tg:border-transparent tg:text-sm tg:outline-none tg:transition-colors tg:duration-100 tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:[a]:transition-colors tg:[a]:hover:bg-accent/50", {
499
+ defaultVariants: {
500
+ size: "default",
501
+ variant: "default"
502
+ },
503
+ variants: {
504
+ size: {
505
+ default: "tg:gap-4 tg:p-4",
506
+ sm: "tg:gap-2.5 tg:px-4 tg:py-3"
507
+ },
508
+ variant: {
509
+ default: "tg:bg-transparent",
510
+ muted: "tg:bg-muted/50",
511
+ outline: "tg:border-border"
512
+ }
513
+ }
514
+ });
515
+ var Ze = M("tg:flex tg:shrink-0 tg:items-center tg:justify-center tg:gap-2 tg:group-has-[[data-slot=item-description]]/item:translate-y-0.5 tg:group-has-[[data-slot=item-description]]/item:self-start tg:[&_svg]:pointer-events-none", {
516
+ defaultVariants: { variant: "default" },
517
+ variants: { variant: {
518
+ default: "tg:bg-transparent",
519
+ icon: "tg:size-8 tg:rounded-sm tg:border tg:bg-muted tg:[&_svg:not([class*='size-'])]:size-4",
520
+ image: "tg:size-10 tg:overflow-hidden tg:rounded-sm tg:[&_img]:size-full tg:[&_img]:object-cover"
521
+ } }
522
+ });
523
+ function Qe({ className: e, variant: t = "default", ...n }) {
524
+ return /* @__PURE__ */ C("div", {
525
+ "data-slot": "item-media",
526
+ "data-variant": t,
527
+ className: W(Ze({
528
+ className: e,
529
+ variant: t
530
+ })),
531
+ ...n
532
+ });
533
+ }
534
+ function $e({ className: e, ...t }) {
535
+ return /* @__PURE__ */ C("div", {
536
+ "data-slot": "item-content",
537
+ className: W("tg:flex tg:flex-1 tg:flex-col tg:gap-1 tg:[&+[data-slot=item-content]]:flex-none", e),
538
+ ...t
539
+ });
540
+ }
541
+ function et({ className: e, ...t }) {
542
+ return /* @__PURE__ */ C("div", {
543
+ "data-slot": "item-title",
544
+ className: W("tg:flex tg:w-fit tg:items-center tg:gap-2 tg:font-medium tg:text-sm tg:leading-snug", e),
545
+ ...t
546
+ });
547
+ }
548
+ function tt({ className: e, ...t }) {
549
+ return /* @__PURE__ */ C("p", {
550
+ "data-slot": "item-description",
551
+ className: W("tg:line-clamp-2 tg:text-balance tg:font-normal tg:text-muted-foreground tg:text-sm tg:leading-normal", "tg:[&>a]:underline tg:[&>a]:underline-offset-4 tg:[&>a:hover]:text-primary", e),
552
+ ...t
553
+ });
554
+ }
555
+ //#endregion
556
+ //#region src/renderer/features/TreegeRenderer/web/components/OptionItemContent.tsx
557
+ var nt = ({ label: e, description: t, image: n }) => /* @__PURE__ */ w(S, { children: [n && /* @__PURE__ */ C(Qe, {
558
+ variant: "image",
559
+ children: /* @__PURE__ */ C("img", {
560
+ src: n,
561
+ alt: ""
562
+ })
563
+ }), /* @__PURE__ */ w($e, {
564
+ className: "tg:min-w-0 tg:gap-0",
565
+ children: [/* @__PURE__ */ C(et, {
566
+ className: "tg:block tg:w-full tg:truncate tg:font-normal",
567
+ children: e
568
+ }), t && /* @__PURE__ */ C(tt, {
569
+ className: "tg:line-clamp-1",
570
+ children: t
571
+ })]
572
+ })] }), rt = /\{\{([\w-]+)}}/g, it = (t) => {
573
+ let [r, o] = x({
574
+ error: null,
575
+ fetched: null,
576
+ isLoading: !1
577
+ }), { baseUrl: c, formValues: l, headers: u } = s(), d = t.data.optionsSource, m = t.data.options, h = y(() => {
578
+ if (!(d?.url && d.mapping?.valueField && d.mapping?.labelField) || !Array.from(d.url.matchAll(rt), (e) => e[1]).every((e) => {
579
+ let t = l[e];
580
+ return t != null && t !== "";
581
+ })) return null;
582
+ let t = d.method ?? "GET", r = {
583
+ body: d.body && [
584
+ "POST",
585
+ "PUT",
586
+ "PATCH"
587
+ ].includes(t) ? n(d.body, l, { json: !0 }) : void 0,
588
+ headers: a(e(u, l), e(d.headers, l)),
589
+ mapping: d.mapping,
590
+ method: t,
591
+ queryParams: e(d.queryParams, l) ?? {},
592
+ responsePath: d.responsePath,
593
+ url: f(n(d.url, l, { encode: !0 }), c)
594
+ };
595
+ return JSON.stringify(r);
596
+ }, [
597
+ c,
598
+ d,
599
+ l,
600
+ u
601
+ ]);
602
+ v(() => {
603
+ if (!h) {
604
+ o({
605
+ error: null,
606
+ fetched: null,
607
+ isLoading: !1
608
+ });
609
+ return;
610
+ }
611
+ let e = JSON.parse(h), t = new AbortController();
612
+ return o((e) => ({
613
+ ...e,
614
+ error: null,
615
+ isLoading: !0
616
+ })), (async () => {
617
+ let n = await p({
618
+ body: e.body,
619
+ headers: e.headers,
620
+ method: e.method,
621
+ queryParams: e.queryParams,
622
+ signal: t.signal,
623
+ url: e.url
624
+ });
625
+ if (!t.signal.aborted) {
626
+ if (!n.success) {
627
+ o({
628
+ error: n.error ?? "Fetch failed",
629
+ fetched: null,
630
+ isLoading: !1
631
+ });
632
+ return;
633
+ }
634
+ o({
635
+ error: null,
636
+ fetched: i(n.data, e.responsePath, e.mapping),
637
+ isLoading: !1
638
+ });
639
+ }
640
+ })(), () => t.abort();
641
+ }, [h]);
642
+ let g = r.fetched ?? m ?? [];
643
+ return {
644
+ error: r.error,
645
+ isLoading: r.isLoading,
646
+ options: g
647
+ };
648
+ }, at = ({ field: e, extra: t }) => {
649
+ let [n, i] = x(!1), { id: a, value: o, placeholder: s } = e, { node: c, setValue: l, error: u, label: d, helperText: f, missingDependencies: p } = t, { options: m, isLoading: h, error: g } = it(c), _ = r(), v = `${a}-trigger`, y = `${a}-error`, b = m.find((e) => e.value === o);
650
+ return /* @__PURE__ */ w(K, {
651
+ className: "tg:mb-4",
652
+ children: [
653
+ /* @__PURE__ */ w(X, {
654
+ htmlFor: v,
655
+ children: [d || c.data.name, c.data.required && /* @__PURE__ */ C("span", {
656
+ className: "tg:text-red-500",
657
+ children: "*"
658
+ })]
659
+ }),
660
+ /* @__PURE__ */ C(Ye, {
661
+ missing: p,
662
+ children: /* @__PURE__ */ w(pe, {
663
+ open: n,
664
+ onOpenChange: i,
665
+ children: [/* @__PURE__ */ C(me, {
666
+ asChild: !0,
667
+ children: /* @__PURE__ */ w(G, {
668
+ id: v,
669
+ variant: "outline",
670
+ role: "combobox",
671
+ "aria-expanded": n,
672
+ "aria-invalid": !!u || void 0,
673
+ "aria-describedby": u ? y : void 0,
674
+ disabled: h || p.length > 0,
675
+ className: "tg:w-full tg:justify-between tg:font-normal",
676
+ children: [/* @__PURE__ */ w("span", {
677
+ className: "tg:flex tg:items-center tg:gap-2 tg:truncate",
678
+ children: [h && /* @__PURE__ */ C(O, { className: "tg:h-4 tg:w-4 tg:shrink-0 tg:animate-spin" }), o ? b?.label ? _(b.label) : o : s || _("renderer.defaultAutocompleteInput.selectOption")]
679
+ }), /* @__PURE__ */ C(re, { className: "tg:ml-2 tg:size-4 tg:shrink-0 tg:opacity-50" })]
680
+ })
681
+ }), /* @__PURE__ */ C(he, {
682
+ className: "tg:w-(--radix-popover-trigger-width) tg:p-0",
683
+ align: "start",
684
+ children: /* @__PURE__ */ w(ze, { children: [/* @__PURE__ */ C(Be, { placeholder: s || _("renderer.defaultAutocompleteInput.search") }), /* @__PURE__ */ w(Ve, { children: [/* @__PURE__ */ C(He, { children: _("renderer.defaultAutocompleteInput.noResults") }), /* @__PURE__ */ C(Ue, { children: m.map((e) => /* @__PURE__ */ w(We, {
685
+ value: e.value,
686
+ disabled: e.disabled,
687
+ onSelect: (e) => {
688
+ l(e === o ? "" : e), i(!1);
689
+ },
690
+ children: [/* @__PURE__ */ C(T, { className: W("tg:mr-2 tg:size-4", o === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ C(nt, {
691
+ label: _(e.label) || e.value,
692
+ description: _(e.description),
693
+ image: e.image
694
+ })]
695
+ }, e.value)) })] })] })
696
+ })]
697
+ })
698
+ }),
699
+ u && /* @__PURE__ */ C(J, {
700
+ id: y,
701
+ children: u
702
+ }),
703
+ g && !u && /* @__PURE__ */ C(J, { children: g }),
704
+ f && !u && !g && /* @__PURE__ */ C(q, { children: f })
705
+ ]
706
+ });
707
+ }, ot = ({ field: e, extra: t }) => {
708
+ let { id: n, name: i, value: a } = e, { node: o, setValue: c, error: l, label: u, helperText: d, renderOptionExtras: f, compactOptions: p, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = it(o), { optionsDisplayLimit: v } = s(), y = r();
709
+ if (h.length > 0 || o.data.optionsSource) {
710
+ let e = Array.isArray(a) ? a.map(String) : [], t = v ? h.slice(0, v) : h, r = h.length - t.length, s = (t, n) => {
711
+ c(n ? [...e, t] : e.filter((e) => e !== t));
712
+ };
713
+ return /* @__PURE__ */ w(K, {
714
+ className: "tg:mb-4",
715
+ children: [
716
+ /* @__PURE__ */ w(X, {
717
+ className: "tg:mb-1",
718
+ children: [u || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
719
+ className: "tg:text-red-500",
720
+ children: "*"
721
+ })]
722
+ }),
723
+ /* @__PURE__ */ C(Xe, { missing: m }),
724
+ g && /* @__PURE__ */ w("div", {
725
+ className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
726
+ children: [/* @__PURE__ */ C(O, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C("span", { children: y("renderer.defaultCheckboxInput.loadingOptions") })]
727
+ }),
728
+ /* @__PURE__ */ w("div", {
729
+ className: "tg:min-w-0 tg:space-y-2",
730
+ children: [t.map((t, r) => {
731
+ let a = y(t.description);
732
+ return /* @__PURE__ */ w("div", {
733
+ className: W("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:gap-3", p && "tg:pr-22"),
734
+ children: [
735
+ /* @__PURE__ */ C(de, {
736
+ id: `${n}-${t.value}`,
737
+ name: i,
738
+ checked: e.includes(String(t.value)),
739
+ onCheckedChange: (e) => s(String(t.value), !!e),
740
+ disabled: t.disabled,
741
+ className: "tg:mt-0.5"
742
+ }),
743
+ t.image && /* @__PURE__ */ C("img", {
744
+ src: t.image,
745
+ alt: "",
746
+ className: "tg:h-8 tg:w-8 tg:shrink-0 tg:rounded tg:object-cover"
747
+ }),
748
+ /* @__PURE__ */ w("div", {
749
+ className: W("tg:flex tg:flex-col", p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
750
+ children: [/* @__PURE__ */ C(X, {
751
+ htmlFor: `${n}-${t.value}`,
752
+ className: W("tg:cursor-pointer tg:font-normal tg:text-sm", p && "tg:block tg:max-w-full tg:truncate"),
753
+ children: y(t.label) ? y(t.label) : t.value
754
+ }), a && /* @__PURE__ */ C("span", {
755
+ className: W("tg:text-muted-foreground tg:text-xs", p && "tg:block tg:max-w-full tg:truncate"),
756
+ children: a
757
+ })]
758
+ }),
759
+ f?.({
760
+ index: r,
761
+ option: t
762
+ })
763
+ ]
764
+ }, t.value + r);
765
+ }), r > 0 && /* @__PURE__ */ C("div", {
766
+ className: "tg:px-2 tg:text-muted-foreground tg:text-xs",
767
+ children: "…"
768
+ })]
769
+ }),
770
+ l && /* @__PURE__ */ C(J, { children: l }),
771
+ _ && !l && /* @__PURE__ */ C(J, { children: _ }),
772
+ d && !l && !_ && /* @__PURE__ */ C(q, { children: d })
773
+ ]
774
+ });
775
+ }
776
+ return /* @__PURE__ */ w(K, {
777
+ className: "tg:mb-4",
778
+ children: [/* @__PURE__ */ w("div", {
779
+ className: "tg:flex tg:items-center tg:gap-3",
780
+ children: [/* @__PURE__ */ C(de, {
781
+ id: n,
782
+ name: i,
783
+ checked: typeof a == "boolean" ? a : !1,
784
+ onCheckedChange: (e) => c(!!e)
785
+ }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w(X, {
786
+ htmlFor: n,
787
+ className: "tg:cursor-pointer tg:font-medium tg:text-sm",
788
+ children: [u || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
789
+ className: "tg:text-red-500",
790
+ children: "*"
791
+ })]
792
+ }), d && !l && /* @__PURE__ */ C(q, { children: d })] })]
793
+ }), l && /* @__PURE__ */ C(J, { children: l })]
794
+ });
795
+ };
796
+ //#endregion
797
+ //#region src/shared/components/ui/calendar.tsx
798
+ function st({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", formatters: a, components: o, ...s }) {
799
+ let c = V();
800
+ return /* @__PURE__ */ C(ce, {
801
+ showOutsideDays: n,
802
+ className: W("tg:group/calendar tg:bg-background tg:p-3 tg:[--cell-size:--spacing(8)] tg:[[data-slot=card-content]_&]:bg-transparent tg:[[data-slot=popover-content]_&]:bg-transparent", String.raw`tg:rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`tg:rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
803
+ captionLayout: r,
804
+ formatters: {
805
+ formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
806
+ ...a
807
+ },
808
+ classNames: {
809
+ button_next: W(ue({ variant: i }), "tg:size-(--cell-size) tg:aria-disabled:opacity-50 tg:p-0 tg:select-none", c.button_next),
810
+ button_previous: W(ue({ variant: i }), "tg:size-(--cell-size) tg:aria-disabled:opacity-50 tg:p-0 tg:select-none", c.button_previous),
811
+ caption_label: W("tg:select-none tg:font-medium", r === "label" ? "tg:text-sm" : "tg:rounded-md tg:pl-2 tg:pr-1 tg:flex tg:items-center tg:gap-1 tg:text-sm tg:h-8 tg:[&>svg]:text-muted-foreground tg:[&>svg]:size-3.5", c.caption_label),
812
+ day: W("tg:relative tg:w-full tg:h-full tg:p-0 tg:text-center tg:[&:first-child[data-selected=true]_button]:rounded-l-md tg:[&:last-child[data-selected=true]_button]:rounded-r-md tg:group/day tg:aspect-square tg:select-none", c.day),
813
+ disabled: W("tg:text-muted-foreground tg:opacity-50", c.disabled),
814
+ dropdown: W("tg:absolute tg:bg-popover tg:inset-0 tg:opacity-0", c.dropdown),
815
+ dropdown_root: W("tg:relative tg:has-focus:border-ring tg:border tg:border-input tg:shadow-xs tg:has-focus:ring-ring/50 tg:has-focus:ring-[3px] tg:rounded-md", c.dropdown_root),
816
+ dropdowns: W("tg:w-full tg:flex tg:items-center tg:text-sm tg:font-medium tg:justify-center tg:h-(--cell-size) tg:gap-1.5", c.dropdowns),
817
+ hidden: W("tg:invisible", c.hidden),
818
+ month: W("tg:flex tg:flex-col tg:w-full tg:gap-4", c.month),
819
+ month_caption: W("tg:flex tg:items-center tg:justify-center tg:h-(--cell-size) tg:w-full tg:px-(--cell-size)", c.month_caption),
820
+ months: W("tg:flex tg:gap-4 tg:flex-col tg:md:flex-row tg:relative", c.months),
821
+ nav: W("tg:flex tg:items-center tg:gap-1 tg:w-full tg:absolute tg:top-0 tg:inset-x-0 tg:justify-between", c.nav),
822
+ outside: W("tg:text-muted-foreground tg:aria-selected:text-muted-foreground", c.outside),
823
+ range_end: W("tg:rounded-r-md tg:bg-accent", c.range_end),
824
+ range_middle: W("tg:rounded-none", c.range_middle),
825
+ range_start: W("tg:rounded-l-md tg:bg-accent", c.range_start),
826
+ root: W("tg:w-fit", c.root),
827
+ table: "tg:w-full tg:border-collapse",
828
+ today: W("tg:bg-accent tg:text-accent-foreground tg:rounded-md tg:data-[selected=true]:rounded-none", c.today),
829
+ week: W("tg:flex tg:w-full tg:mt-2", c.week),
830
+ week_number: W("tg:text-[0.8rem] tg:select-none tg:text-muted-foreground", c.week_number),
831
+ week_number_header: W("tg:select-none tg:w-(--cell-size)", c.week_number_header),
832
+ weekday: W("tg:text-muted-foreground tg:rounded-md tg:flex-1 tg:font-normal tg:text-[0.8rem] tg:select-none", c.weekday),
833
+ weekdays: W("tg:flex", c.weekdays),
834
+ ...t
835
+ },
836
+ components: {
837
+ Chevron: ({ className: e, orientation: t, ...n }) => C(t === "left" ? ee : t === "right" ? te : D, {
838
+ className: W("tg:size-4", e),
839
+ ...n
840
+ }),
841
+ DayButton: ct,
842
+ Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ C("div", {
843
+ "data-slot": "calendar",
844
+ ref: t,
845
+ className: W(e),
846
+ ...n
847
+ }),
848
+ WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ C("td", {
849
+ ...t,
850
+ children: /* @__PURE__ */ C("div", {
851
+ className: "tg:flex tg:size-(--cell-size) tg:items-center tg:justify-center tg:text-center",
852
+ children: e
853
+ })
854
+ }),
855
+ ...o
856
+ },
857
+ ...s
858
+ });
859
+ }
860
+ function ct({ className: e, day: t, modifiers: n, ...r }) {
861
+ let i = V(), a = m.useRef(null);
862
+ return m.useEffect(() => {
863
+ n.focused && a.current?.focus();
864
+ }, [n.focused]), /* @__PURE__ */ C(G, {
865
+ ref: a,
866
+ variant: "ghost",
867
+ size: "icon",
868
+ "data-day": t.date.toLocaleDateString(),
869
+ "data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
870
+ "data-range-start": n.range_start,
871
+ "data-range-end": n.range_end,
872
+ "data-range-middle": n.range_middle,
873
+ className: W("tg:flex tg:aspect-square tg:size-auto tg:w-full tg:min-w-(--cell-size) tg:flex-col tg:gap-1 tg:font-normal tg:leading-none tg:data-[range-end=true]:rounded-md tg:data-[range-middle=true]:rounded-none tg:data-[range-start=true]:rounded-md tg:data-[range-end=true]:rounded-r-md tg:data-[range-start=true]:rounded-l-md tg:data-[range-end=true]:bg-primary tg:data-[range-middle=true]:bg-accent tg:data-[range-start=true]:bg-primary tg:data-[selected-single=true]:bg-primary tg:data-[range-end=true]:text-primary-foreground tg:data-[range-middle=true]:text-accent-foreground tg:data-[range-start=true]:text-primary-foreground tg:data-[selected-single=true]:text-primary-foreground tg:group-data-[focused=true]/day:relative tg:group-data-[focused=true]/day:z-10 tg:group-data-[focused=true]/day:border-ring tg:group-data-[focused=true]/day:ring-[3px] tg:group-data-[focused=true]/day:ring-ring/50 tg:dark:hover:text-accent-foreground tg:[&>span]:text-xs tg:[&>span]:opacity-70", i.day, e),
874
+ ...r
875
+ });
876
+ }
877
+ //#endregion
878
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.tsx
879
+ var lt = ({ field: e, extra: t }) => {
880
+ let [n, i] = x(!1), { id: a, name: o, value: s, placeholder: c } = e, { node: l, setValue: u, error: d, label: f, helperText: p } = t, m = r(), h = s ? new Date(s) : void 0;
881
+ return /* @__PURE__ */ w(K, {
882
+ className: "tg:mb-4",
883
+ children: [
884
+ /* @__PURE__ */ w(X, {
885
+ htmlFor: a,
886
+ children: [f || l.data.name, l.data.required && /* @__PURE__ */ C("span", {
887
+ className: "tg:text-red-500",
888
+ children: "*"
889
+ })]
890
+ }),
891
+ /* @__PURE__ */ w(pe, {
892
+ open: n,
893
+ onOpenChange: i,
894
+ children: [/* @__PURE__ */ C(me, {
895
+ asChild: !0,
896
+ children: /* @__PURE__ */ w(G, {
897
+ variant: "outline",
898
+ id: a,
899
+ name: o,
900
+ className: "tg:w-full tg:justify-between tg:font-normal",
901
+ children: [h ? h.toLocaleDateString() : c || m("renderer.defaultInputs.selectDate"), /* @__PURE__ */ C(D, { className: "tg:size-4" })]
902
+ })
903
+ }), /* @__PURE__ */ C(he, {
904
+ className: "tg:w-auto tg:overflow-hidden tg:p-0",
905
+ align: "start",
906
+ children: /* @__PURE__ */ C(st, {
907
+ mode: "single",
908
+ selected: h,
909
+ captionLayout: "dropdown",
910
+ disabled: (e) => {
911
+ if (l.data.disablePast) {
912
+ let t = /* @__PURE__ */ new Date();
913
+ return t.setHours(0, 0, 0, 0), e < t;
914
+ }
915
+ return !1;
916
+ },
917
+ onSelect: (e) => {
918
+ u(e ? e.toISOString() : ""), i(!1);
919
+ }
920
+ })
921
+ })]
922
+ }),
923
+ d && /* @__PURE__ */ C(J, { children: d }),
924
+ p && !d && /* @__PURE__ */ C(q, { children: p })
925
+ ]
926
+ });
927
+ }, ut = ({ field: e, extra: t }) => {
928
+ let [n, i] = x(!1), { id: a, value: o } = e, { node: s, setValue: c, error: l, label: u, helperText: d } = t, f = r(), p = Array.isArray(o) ? o : [], m = p[0] ? new Date(p[0]) : void 0, h = p[1] ? new Date(p[1]) : void 0;
929
+ return /* @__PURE__ */ w(K, {
930
+ className: "tg:mb-4",
931
+ children: [
932
+ /* @__PURE__ */ w(X, {
933
+ htmlFor: a,
934
+ children: [u || s.data.name, s.data.required && /* @__PURE__ */ C("span", {
935
+ className: "tg:text-red-500",
936
+ children: "*"
937
+ })]
938
+ }),
939
+ /* @__PURE__ */ w(pe, {
940
+ open: n,
941
+ onOpenChange: i,
942
+ children: [/* @__PURE__ */ C(me, {
943
+ asChild: !0,
944
+ children: /* @__PURE__ */ w(G, {
945
+ id: a,
946
+ variant: "outline",
947
+ className: "tg:w-full tg:justify-between tg:font-normal",
948
+ children: [m && h ? `${m.toLocaleDateString()} - ${h.toLocaleDateString()}` : m ? m.toLocaleDateString() : f("renderer.defaultInputs.selectDateRange"), /* @__PURE__ */ C(D, { className: "tg:size-4" })]
949
+ })
950
+ }), /* @__PURE__ */ C(he, {
951
+ className: "tg:w-auto tg:overflow-hidden tg:p-0",
952
+ align: "start",
953
+ children: /* @__PURE__ */ C(st, {
954
+ mode: "range",
955
+ selected: {
956
+ from: m,
957
+ to: h
958
+ },
959
+ captionLayout: "dropdown",
960
+ disabled: (e) => {
961
+ if (s.data.disablePast) {
962
+ let t = /* @__PURE__ */ new Date();
963
+ return t.setHours(0, 0, 0, 0), e < t;
964
+ }
965
+ return !1;
966
+ },
967
+ onSelect: (e) => {
968
+ c([e?.from ? e.from.toISOString() : void 0, e?.to ? e.to.toISOString() : void 0]);
969
+ },
970
+ numberOfMonths: 2
971
+ })
972
+ })]
973
+ }),
974
+ l && /* @__PURE__ */ C(J, { children: l }),
975
+ d && !l && /* @__PURE__ */ C(q, { children: d })
976
+ ]
977
+ });
978
+ }, dt = ({ field: e, extra: t }) => {
979
+ let { id: n, name: r, placeholder: i } = e, { node: a, setValue: o, error: s, label: u, helperText: d } = t;
980
+ return /* @__PURE__ */ w(K, {
981
+ className: "tg:mb-4",
982
+ children: [
983
+ /* @__PURE__ */ w(X, {
984
+ htmlFor: n,
985
+ children: [u || a.data.name, a.data.required && /* @__PURE__ */ C("span", {
986
+ className: "tg:text-red-500",
987
+ children: "*"
988
+ })]
989
+ }),
990
+ /* @__PURE__ */ C(Y, {
991
+ type: "file",
992
+ name: r,
993
+ id: n,
994
+ onChange: async (e) => {
995
+ let { files: t } = e.target;
996
+ if (!t || t.length === 0) {
997
+ o(null);
998
+ return;
999
+ }
1000
+ if (a.data.multiple) {
1001
+ o(await c(Array.from(t)));
1002
+ return;
1003
+ }
1004
+ o(await l(t[0]));
1005
+ },
1006
+ multiple: a.data.multiple,
1007
+ placeholder: i
1008
+ }),
1009
+ s && /* @__PURE__ */ C(J, { children: s }),
1010
+ d && !s && /* @__PURE__ */ C(q, { children: d })
1011
+ ]
1012
+ });
1013
+ }, ft = ({ field: e }) => {
1014
+ let { id: t, name: n, value: r } = e;
1015
+ return /* @__PURE__ */ C(Y, {
1016
+ type: "hidden",
1017
+ id: t,
1018
+ name: n,
1019
+ value: r ?? ""
1020
+ });
1021
+ }, pt = (e) => {
1022
+ let t = e.matchAll(/{{([\w-]+)}}/g);
1023
+ return Array.from(t, (e) => e[1]);
1024
+ }, mt = (e, t) => pt(e).every((e) => {
1025
+ let n = t[e];
1026
+ return n != null && n !== "";
1027
+ }), ht = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
1028
+ let i = t[r], a = i == null ? "" : String(i);
1029
+ return n ? encodeURIComponent(a) : a;
1030
+ }), gt = ({ field: n, extra: i }) => {
1031
+ let [c, l] = x(!1), [p, m] = x(null), [h, _] = x([]), [E, D] = x(""), [ee, te] = x(!1), { id: ne, name: ie, value: k, placeholder: ae } = n, { node: A, setValue: j, error: M, label: oe, helperText: N, missingDependencies: se } = i, { formValues: P, inputNodes: F, headers: I, baseUrl: L } = s(), { httpConfig: R } = A.data, z = b(!1), B = b(!1), ce = b(""), V = r(), H = b(R), U = b(P), le = b(F), ue = b(I), de = b(L), fe = b(j), Z = b(null), Q = b(null), xe = y(() => R?.url ? pt(R.url) : [], [R?.url]), Ce = xe.length > 0, we = y(() => xe.map((e) => `${e}:${String(P[e] ?? "")}`).join("|"), [xe, P]), Te = y(() => R?.url ? Ce ? mt(R.url, P) : !0 : !1, [
1032
+ R?.url,
1033
+ Ce,
1034
+ P
1035
+ ]), $ = g(async (n) => {
1036
+ Q.current && Q.current.abort();
1037
+ let r = new AbortController();
1038
+ Q.current = r;
1039
+ let i = H.current, s = U.current, c = fe.current;
1040
+ if (!i?.url) {
1041
+ m(V("renderer.defaultHttpInput.noUrlConfigured")), Q.current = null;
1042
+ return;
1043
+ }
1044
+ if (i.url && !mt(i.url, s)) {
1045
+ Q.current = null;
1046
+ return;
1047
+ }
1048
+ l(!0), m(null);
1049
+ try {
1050
+ let p = f(ht(i.url, s, !0), de.current), h = o(i.searchParam && n ? `${p}${p.includes("?") ? "&" : "?"}${i.searchParam}=${encodeURIComponent(n)}` : p, e(i.queryParams, s)), g = a({ "Content-Type": "application/json" }, e(ue.current, s), e(i.headers, s)), v = [
1051
+ "POST",
1052
+ "PUT",
1053
+ "PATCH"
1054
+ ].includes(i.method || "") ? i.sendAllFormValues ? JSON.stringify(u(s, le.current)) : i.body ? ht(i.body, s) : void 0 : void 0, y = setTimeout(() => r.abort(), 3e4), b = await fetch(h, {
1055
+ body: v || void 0,
1056
+ headers: Object.fromEntries(Object.entries(g).filter(([, e]) => e)),
1057
+ method: i.method || "GET",
1058
+ signal: r.signal
1059
+ });
1060
+ if (clearTimeout(y), !b.ok) {
1061
+ m(`HTTP Error ${b.status}: ${b.statusText}`), l(!1);
1062
+ return;
1063
+ }
1064
+ let x = t(await b.json()), S = i.responsePath ? d(x, i.responsePath) : x;
1065
+ if (i.responseMapping && Array.isArray(S)) {
1066
+ let { valueField: e = "value", labelField: t = "label", descriptionField: n, imageField: r } = i.responseMapping;
1067
+ _(S.map((i) => {
1068
+ let a = n ? d(i, n) : void 0, o = r ? d(i, r) : void 0;
1069
+ return {
1070
+ description: a != null && a !== "" ? String(a) : void 0,
1071
+ image: typeof o == "string" && o !== "" ? o : void 0,
1072
+ label: String(d(i, t) || ""),
1073
+ value: String(d(i, e) || "")
1074
+ };
1075
+ }));
1076
+ } else c(typeof S == "string" ? S : JSON.stringify(S));
1077
+ } catch (e) {
1078
+ if (e instanceof Error && e.name === "AbortError") return;
1079
+ m(e instanceof Error ? e.message : V("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
1080
+ } finally {
1081
+ l(!1), Q.current = null;
1082
+ }
1083
+ }, [V]);
1084
+ if (v(() => {
1085
+ H.current = R, U.current = P, le.current = F, ue.current = I, de.current = L, fe.current = j, Z.current = $;
1086
+ }, [
1087
+ R,
1088
+ P,
1089
+ F,
1090
+ I,
1091
+ L,
1092
+ j,
1093
+ $
1094
+ ]), v(() => () => {
1095
+ Q.current && Q.current.abort(), z.current = !1, B.current = !1;
1096
+ }, []), v(() => {
1097
+ if (z.current) return;
1098
+ z.current = !0;
1099
+ let e = H.current, t = U.current, n = Z.current, r = e?.url && mt(e.url, t);
1100
+ e?.fetchOnMount && r && n && (n(), e.url && (ce.current = pt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1101
+ }, []), v(() => {
1102
+ if (!z.current || !Ce || ce.current === we || !Te) return;
1103
+ let e = setTimeout(() => {
1104
+ $(), ce.current = we;
1105
+ }, 500);
1106
+ return () => clearTimeout(e);
1107
+ }, [
1108
+ we,
1109
+ Ce,
1110
+ Te,
1111
+ $
1112
+ ]), v(() => {
1113
+ if (!B.current) {
1114
+ B.current = !0;
1115
+ return;
1116
+ }
1117
+ let e = H.current, t = U.current, n = Z.current, r = e?.url && mt(e.url, t);
1118
+ e?.fetchOnMount && r && n && (n(), e.url && (ce.current = pt(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1119
+ }, [y(() => JSON.stringify({
1120
+ body: R?.body,
1121
+ fetchOnMount: R?.fetchOnMount,
1122
+ headers: R?.headers,
1123
+ method: R?.method,
1124
+ queryParams: R?.queryParams,
1125
+ responseMapping: R?.responseMapping,
1126
+ responsePath: R?.responsePath,
1127
+ searchParam: R?.searchParam,
1128
+ sendAllFormValues: R?.sendAllFormValues,
1129
+ url: R?.url
1130
+ }), [R])]), v(() => {
1131
+ if (!(R?.searchParam && E)) return;
1132
+ let e = setTimeout(() => {
1133
+ $(E);
1134
+ }, 300);
1135
+ return () => clearTimeout(e);
1136
+ }, [
1137
+ E,
1138
+ R?.searchParam,
1139
+ $
1140
+ ]), R?.responseMapping) {
1141
+ let e = Array.isArray(k) ? k[0] : k, t = h.find((t) => t.value === e);
1142
+ if (R.searchParam) {
1143
+ let e = c && R?.showLoading ? /* @__PURE__ */ w("div", {
1144
+ className: "tg:flex tg:items-center tg:gap-2",
1145
+ children: [/* @__PURE__ */ C(O, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C("span", {
1146
+ className: "tg:text-muted-foreground",
1147
+ children: t?.label || ae || V("renderer.defaultHttpInput.search")
1148
+ })]
1149
+ }) : t?.label || ae || V("renderer.defaultHttpInput.search");
1150
+ return /* @__PURE__ */ w(K, {
1151
+ className: "tg:mb-4",
1152
+ children: [
1153
+ /* @__PURE__ */ w(X, { children: [oe || A.data.name, A.data.required && /* @__PURE__ */ C("span", {
1154
+ className: "tg:text-red-500",
1155
+ children: "*"
1156
+ })] }),
1157
+ /* @__PURE__ */ C(Ye, {
1158
+ missing: se,
1159
+ children: /* @__PURE__ */ w(pe, {
1160
+ open: ee,
1161
+ onOpenChange: te,
1162
+ children: [/* @__PURE__ */ C(me, {
1163
+ asChild: !0,
1164
+ children: /* @__PURE__ */ w(G, {
1165
+ variant: "outline",
1166
+ role: "combobox",
1167
+ "aria-expanded": ee,
1168
+ disabled: se.length > 0,
1169
+ className: "tg:w-full tg:justify-between",
1170
+ children: [e, /* @__PURE__ */ C(re, { className: "tg:ml-2 tg:h-4 tg:w-4 tg:shrink-0 tg:opacity-50" })]
1171
+ })
1172
+ }), /* @__PURE__ */ C(he, {
1173
+ className: "tg:w-[var(--radix-popover-trigger-width)] tg:p-0",
1174
+ align: "start",
1175
+ children: /* @__PURE__ */ w(ze, {
1176
+ shouldFilter: !1,
1177
+ children: [/* @__PURE__ */ C(Be, {
1178
+ placeholder: V("renderer.defaultHttpInput.search"),
1179
+ value: E,
1180
+ onValueChange: (e) => {
1181
+ D(e), m(null);
1182
+ }
1183
+ }), /* @__PURE__ */ w(Ve, { children: [
1184
+ c && /* @__PURE__ */ C("div", {
1185
+ className: "tg:flex tg:items-center tg:justify-center tg:p-4",
1186
+ children: /* @__PURE__ */ C(O, { className: "tg:h-4 tg:w-4 tg:animate-spin" })
1187
+ }),
1188
+ !c && p && /* @__PURE__ */ w("div", {
1189
+ className: "tg:p-4 tg:text-destructive tg:text-sm",
1190
+ children: [/* @__PURE__ */ C("div", { children: p }), /* @__PURE__ */ C("button", {
1191
+ type: "button",
1192
+ onClick: () => $(E),
1193
+ className: "tg:mt-2 tg:block tg:text-primary tg:hover:underline",
1194
+ children: V("renderer.defaultHttpInput.retry")
1195
+ })]
1196
+ }),
1197
+ !(c || p) && /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(He, { children: V("renderer.defaultHttpInput.noResults") }), /* @__PURE__ */ C(Ue, { children: h.map((e) => /* @__PURE__ */ w(We, {
1198
+ value: e.value,
1199
+ onSelect: () => {
1200
+ j(e.value), te(!1);
1201
+ },
1202
+ children: [/* @__PURE__ */ C(T, { className: W("tg:mr-2 tg:h-4 tg:w-4", k === e.value ? "tg:opacity-100" : "tg:opacity-0") }), /* @__PURE__ */ C(nt, {
1203
+ label: e.label,
1204
+ description: e.description,
1205
+ image: e.image
1206
+ })]
1207
+ }, e.value)) })] })
1208
+ ] })]
1209
+ })
1210
+ })]
1211
+ })
1212
+ }),
1213
+ M && /* @__PURE__ */ C(J, { children: M }),
1214
+ N && !M && /* @__PURE__ */ C(q, { children: N })
1215
+ ]
1216
+ });
1217
+ }
1218
+ let n = c && R?.showLoading, r = se.length === 0 && h.length === 0 && !n ? p ?? V("renderer.defaultHttpInput.noDataAvailable") : void 0, i = /* @__PURE__ */ w(ge, {
1219
+ value: Array.isArray(k) ? k[0] ?? "" : k ?? "",
1220
+ onValueChange: (e) => j(e),
1221
+ disabled: n || h.length === 0,
1222
+ name: ie,
1223
+ children: [/* @__PURE__ */ w(ye, {
1224
+ id: ne,
1225
+ name: ie,
1226
+ className: "tg:w-full",
1227
+ children: [n && /* @__PURE__ */ C(O, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C(ve, { placeholder: ae || V("renderer.defaultHttpInput.selectOption") })]
1228
+ }), /* @__PURE__ */ C(be, { children: /* @__PURE__ */ C(_e, { children: h.map((e, t) => /* @__PURE__ */ C(Se, {
1229
+ value: e.value,
1230
+ children: /* @__PURE__ */ C(nt, {
1231
+ label: e.label,
1232
+ description: e.description,
1233
+ image: e.image
1234
+ })
1235
+ }, e.value + t)) }) })]
1236
+ });
1237
+ return /* @__PURE__ */ w(K, {
1238
+ className: "tg:mb-4",
1239
+ children: [
1240
+ /* @__PURE__ */ w(X, {
1241
+ htmlFor: ne,
1242
+ children: [oe || A.data.name, A.data.required && /* @__PURE__ */ C("span", {
1243
+ className: "tg:text-red-500",
1244
+ children: "*"
1245
+ })]
1246
+ }),
1247
+ /* @__PURE__ */ C(Ye, {
1248
+ missing: se,
1249
+ children: r ? /* @__PURE__ */ C(Ee, { children: /* @__PURE__ */ w(De, { children: [/* @__PURE__ */ C(Oe, {
1250
+ asChild: !0,
1251
+ children: /* @__PURE__ */ C("div", {
1252
+ className: "tg:w-full",
1253
+ children: i
1254
+ })
1255
+ }), /* @__PURE__ */ C(ke, { children: /* @__PURE__ */ C("p", { children: r }) })] }) }) : i
1256
+ }),
1257
+ M && /* @__PURE__ */ C(J, { children: M }),
1258
+ N && !M && /* @__PURE__ */ C(q, { children: N })
1259
+ ]
1260
+ });
1261
+ }
1262
+ return /* @__PURE__ */ w(K, {
1263
+ className: "tg:mb-4",
1264
+ children: [
1265
+ /* @__PURE__ */ w(X, {
1266
+ htmlFor: ne,
1267
+ children: [oe || A.data.name, A.data.required && /* @__PURE__ */ C("span", {
1268
+ className: "tg:text-red-500",
1269
+ children: "*"
1270
+ })]
1271
+ }),
1272
+ /* @__PURE__ */ C(Y, {
1273
+ type: "text",
1274
+ name: ie,
1275
+ id: ne,
1276
+ value: typeof k == "string" ? k : JSON.stringify(k),
1277
+ readOnly: !0,
1278
+ disabled: !0
1279
+ }),
1280
+ M && /* @__PURE__ */ C(J, { children: M }),
1281
+ N && !M && /* @__PURE__ */ C(q, { children: N })
1282
+ ]
1283
+ });
1284
+ }, _t = ({ field: e, extra: t }) => {
1285
+ let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
1286
+ return /* @__PURE__ */ w(K, {
1287
+ className: "tg:mb-4",
1288
+ children: [
1289
+ /* @__PURE__ */ w(X, {
1290
+ htmlFor: n,
1291
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
1292
+ className: "tg:text-red-500",
1293
+ children: "*"
1294
+ })]
1295
+ }),
1296
+ /* @__PURE__ */ C(Y, {
1297
+ id: n,
1298
+ type: "number",
1299
+ name: r,
1300
+ value: i ?? "",
1301
+ onChange: (e) => s(e.target.value === "" ? null : Number(e.target.value)),
1302
+ placeholder: a
1303
+ }),
1304
+ c && /* @__PURE__ */ C(J, { children: c }),
1305
+ u && !c && /* @__PURE__ */ C(q, { children: u })
1306
+ ]
1307
+ });
1308
+ }, vt = ({ field: e, extra: t }) => {
1309
+ let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
1310
+ return /* @__PURE__ */ w(K, {
1311
+ className: "tg:mb-4",
1312
+ children: [
1313
+ /* @__PURE__ */ w(X, {
1314
+ htmlFor: n,
1315
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
1316
+ className: "tg:text-red-500",
1317
+ children: "*"
1318
+ })]
1319
+ }),
1320
+ /* @__PURE__ */ C(Y, {
1321
+ id: n,
1322
+ name: r,
1323
+ type: "password",
1324
+ value: i ?? "",
1325
+ onChange: (e) => s(e.target.value),
1326
+ placeholder: a,
1327
+ autoComplete: "new-password"
1328
+ }),
1329
+ c && /* @__PURE__ */ C(J, { children: c }),
1330
+ u && !c && /* @__PURE__ */ C(q, { children: u })
1331
+ ]
1332
+ });
1333
+ }, yt = M("tg:group/field tg:flex tg:w-full tg:gap-3 tg:data-[invalid=true]:text-destructive", {
1334
+ defaultVariants: { orientation: "vertical" },
1335
+ variants: { orientation: {
1336
+ horizontal: [
1337
+ "tg:flex-row tg:items-center",
1338
+ "tg:[&>[data-slot=field-label]]:flex-auto",
1339
+ "tg:has-[>[data-slot=field-content]]:items-start tg:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
1340
+ ],
1341
+ responsive: [
1342
+ "tg:flex-col tg:@md/field-group:flex-row tg:@md/field-group:items-center tg:[&>*]:w-full tg:@md/field-group:[&>*]:w-auto tg:[&>.sr-only]:w-auto",
1343
+ "tg:@md/field-group:[&>[data-slot=field-label]]:flex-auto",
1344
+ "tg:@md/field-group:has-[>[data-slot=field-content]]:items-start tg:@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
1345
+ ],
1346
+ vertical: ["tg:flex-col tg:[&>*]:w-full tg:[&>.sr-only]:w-auto"]
1347
+ } }
1348
+ });
1349
+ function bt({ className: e, orientation: t = "vertical", ...n }) {
1350
+ return /* @__PURE__ */ C("div", {
1351
+ role: "group",
1352
+ "data-slot": "field",
1353
+ "data-orientation": t,
1354
+ className: W(yt({ orientation: t }), e),
1355
+ ...n
1356
+ });
1357
+ }
1358
+ function xt({ className: e, ...t }) {
1359
+ return /* @__PURE__ */ C("div", {
1360
+ "data-slot": "field-content",
1361
+ className: W("tg:group/field-content tg:flex tg:flex-1 tg:flex-col tg:gap-1.5 tg:leading-snug", e),
1362
+ ...t
1363
+ });
1364
+ }
1365
+ function St({ className: e, ...t }) {
1366
+ return /* @__PURE__ */ C(X, {
1367
+ "data-slot": "field-label",
1368
+ className: W("tg:group/field-label tg:peer/field-label tg:flex tg:w-fit tg:gap-2 tg:leading-snug tg:group-data-[disabled=true]/field:opacity-50", "tg:has-[>[data-slot=field]]:w-full tg:has-[>[data-slot=field]]:flex-col tg:has-[>[data-slot=field]]:rounded-md tg:has-[>[data-slot=field]]:border tg:[&>*]:data-[slot=field]:p-4", "tg:has-data-[state=checked]:border-primary tg:has-data-[state=checked]:bg-primary/5 tg:dark:has-data-[state=checked]:bg-primary/10", e),
1369
+ ...t
1370
+ });
1371
+ }
1372
+ function Ct({ className: e, ...t }) {
1373
+ return /* @__PURE__ */ C("div", {
1374
+ "data-slot": "field-label",
1375
+ className: W("tg:flex tg:w-fit tg:items-center tg:gap-2 tg:font-medium tg:text-sm tg:leading-snug tg:group-data-[disabled=true]/field:opacity-50", e),
1376
+ ...t
1377
+ });
1378
+ }
1379
+ function wt({ className: e, ...t }) {
1380
+ return /* @__PURE__ */ C("p", {
1381
+ "data-slot": "field-description",
1382
+ className: W("tg:font-normal tg:text-muted-foreground tg:text-sm tg:leading-normal tg:group-has-[[data-orientation=horizontal]]/field:text-balance", "tg:last:mt-0 tg:nth-last-2:-mt-1 tg:[[data-variant=legend]+&]:-mt-1.5", "tg:[&>a]:underline tg:[&>a]:underline-offset-4 tg:[&>a:hover]:text-primary", e),
1383
+ ...t
1384
+ });
1385
+ }
1386
+ //#endregion
1387
+ //#region src/shared/components/ui/radio-group.tsx
1388
+ function Tt({ className: e, ...t }) {
1389
+ return /* @__PURE__ */ C(H.Root, {
1390
+ "data-slot": "radio-group",
1391
+ className: W("tg:grid tg:gap-3", e),
1392
+ ...t
1393
+ });
1394
+ }
1395
+ function Et({ className: e, ...t }) {
1396
+ return /* @__PURE__ */ C(H.Item, {
1397
+ "data-slot": "radio-group-item",
1398
+ className: W("tg:aspect-square tg:size-4 tg:shrink-0 tg:rounded-full tg:border tg:border-input tg:text-primary tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40", e),
1399
+ ...t,
1400
+ children: /* @__PURE__ */ C(H.Indicator, {
1401
+ "data-slot": "radio-group-indicator",
1402
+ className: "tg:relative tg:flex tg:items-center tg:justify-center",
1403
+ children: /* @__PURE__ */ C(ie, { className: "tg:-translate-x-1/2 tg:-translate-y-1/2 tg:absolute tg:top-1/2 tg:left-1/2 tg:size-2 tg:fill-primary" })
1404
+ })
1405
+ });
1406
+ }
1407
+ //#endregion
1408
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.tsx
1409
+ var Dt = ({ field: e, extra: t }) => {
1410
+ let { id: n, name: i, value: a } = e, { node: o, setValue: c, error: l, label: u, helperText: d, renderOptionExtras: f, compactOptions: p, missingDependencies: m } = t, { options: h, isLoading: g, error: _ } = it(o), { optionsDisplayLimit: v } = s(), y = r(), b = a ? String(a) : "", x = o.data.variant !== "default", S = `${n}-label`, T = v ? h.slice(0, v) : h, E = h.length - T.length;
1411
+ return /* @__PURE__ */ w(K, {
1412
+ className: "tg:mb-4",
1413
+ children: [
1414
+ /* @__PURE__ */ w(X, {
1415
+ className: "tg:mb-1",
1416
+ id: S,
1417
+ children: [u || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
1418
+ className: "tg:text-red-500",
1419
+ children: "*"
1420
+ })]
1421
+ }),
1422
+ /* @__PURE__ */ C(Xe, { missing: m }),
1423
+ g && /* @__PURE__ */ w("div", {
1424
+ className: "tg:flex tg:items-center tg:gap-2 tg:py-2 tg:text-muted-foreground tg:text-sm",
1425
+ children: [/* @__PURE__ */ C(O, { className: "tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C("span", { children: y("renderer.defaultRadioInput.loadingOptions") })]
1426
+ }),
1427
+ /* @__PURE__ */ w(Tt, {
1428
+ value: b,
1429
+ onValueChange: (e) => c(e),
1430
+ "aria-labelledby": S,
1431
+ name: i,
1432
+ className: W("tg:min-w-0", x && "tg:flex tg:flex-col tg:gap-2"),
1433
+ children: [T.map((e, t) => {
1434
+ let r = `${n}-${e.value}`, i = y(e.label) || e.value, a = y(e.description), o = String(e.value);
1435
+ return x ? /* @__PURE__ */ w(St, {
1436
+ htmlFor: r,
1437
+ className: W("tg:group/option tg:pointer-events-auto tg:relative", p && "tg:group-hover/option:pr-16"),
1438
+ children: [/* @__PURE__ */ w(bt, {
1439
+ orientation: "horizontal",
1440
+ "data-disabled": e.disabled || void 0,
1441
+ children: [
1442
+ e.image && /* @__PURE__ */ C("img", {
1443
+ src: e.image,
1444
+ alt: "",
1445
+ className: "tg:h-10 tg:w-10 tg:shrink-0 tg:self-center tg:rounded tg:object-cover"
1446
+ }),
1447
+ /* @__PURE__ */ w(xt, {
1448
+ className: W(p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1449
+ children: [/* @__PURE__ */ C(Ct, {
1450
+ className: W(p && "tg:block tg:max-w-full tg:truncate"),
1451
+ children: i
1452
+ }), a && /* @__PURE__ */ C(wt, {
1453
+ className: W(p && "tg:block tg:max-w-full tg:truncate"),
1454
+ children: a
1455
+ })]
1456
+ }),
1457
+ /* @__PURE__ */ C(Et, {
1458
+ value: o,
1459
+ id: r,
1460
+ disabled: e.disabled,
1461
+ className: W(p && "tg:ml-auto tg:shrink-0 tg:group-hover/option:invisible")
1462
+ })
1463
+ ]
1464
+ }), f?.({
1465
+ index: t,
1466
+ option: e,
1467
+ variant: "card"
1468
+ })]
1469
+ }, e.value + t) : /* @__PURE__ */ w("div", {
1470
+ className: W("tg:group/option tg:pointer-events-auto tg:relative tg:flex tg:items-start tg:space-x-2", p && "tg:min-w-0 tg:pr-22"),
1471
+ children: [
1472
+ /* @__PURE__ */ C(Et, {
1473
+ value: o,
1474
+ id: r,
1475
+ disabled: e.disabled,
1476
+ className: "tg:mt-0.5"
1477
+ }),
1478
+ e.image && /* @__PURE__ */ C("img", {
1479
+ src: e.image,
1480
+ alt: "",
1481
+ className: "tg:h-8 tg:w-8 tg:rounded tg:object-cover"
1482
+ }),
1483
+ /* @__PURE__ */ w("div", {
1484
+ className: W("tg:flex tg:flex-col", p && "tg:min-w-0 tg:flex-1 tg:overflow-hidden"),
1485
+ children: [/* @__PURE__ */ C(X, {
1486
+ htmlFor: r,
1487
+ className: W("tg:cursor-pointer tg:font-normal tg:text-sm", p && "tg:block tg:max-w-full tg:truncate"),
1488
+ children: i
1489
+ }), a && /* @__PURE__ */ C("span", {
1490
+ className: W("tg:text-muted-foreground tg:text-xs", p && "tg:block tg:max-w-full tg:truncate"),
1491
+ children: a
1492
+ })]
1493
+ }),
1494
+ f?.({
1495
+ index: t,
1496
+ option: e,
1497
+ variant: "default"
1498
+ })
1499
+ ]
1500
+ }, e.value + t);
1501
+ }), E > 0 && /* @__PURE__ */ C("div", {
1502
+ className: "tg:px-2 tg:py-1 tg:text-muted-foreground tg:text-xs",
1503
+ children: "…"
1504
+ })]
1505
+ }),
1506
+ l && /* @__PURE__ */ C(J, { children: l }),
1507
+ _ && !l && /* @__PURE__ */ C(J, { children: _ }),
1508
+ d && !l && !_ && /* @__PURE__ */ C(q, { children: d })
1509
+ ]
1510
+ });
1511
+ }, Ot = ({ field: e, extra: t }) => {
1512
+ let { id: n, name: i, value: a, placeholder: o } = e, { node: s, setValue: c, error: l, label: u, helperText: d, missingDependencies: f } = t, { options: p, isLoading: m, error: h } = it(s), g = r(), _ = a ? String(a) : "";
1513
+ return /* @__PURE__ */ w(K, {
1514
+ className: "tg:mb-4",
1515
+ children: [
1516
+ /* @__PURE__ */ w(X, {
1517
+ htmlFor: n,
1518
+ children: [u || s.data.name, s.data.required && /* @__PURE__ */ C("span", {
1519
+ className: "tg:text-red-500",
1520
+ children: "*"
1521
+ })]
1522
+ }),
1523
+ /* @__PURE__ */ C(Ye, {
1524
+ missing: f,
1525
+ children: /* @__PURE__ */ w(ge, {
1526
+ name: i,
1527
+ value: _,
1528
+ onValueChange: (e) => c(e),
1529
+ disabled: m || f.length > 0,
1530
+ children: [/* @__PURE__ */ w(ye, {
1531
+ id: n,
1532
+ name: i,
1533
+ className: "tg:w-full",
1534
+ children: [m && /* @__PURE__ */ C(O, { className: "tg:mr-2 tg:h-4 tg:w-4 tg:animate-spin" }), /* @__PURE__ */ C(ve, { placeholder: o || g("renderer.defaultSelectInput.selectOption") })]
1535
+ }), /* @__PURE__ */ C(be, { children: /* @__PURE__ */ C(_e, { children: p.map((e, t) => /* @__PURE__ */ C(Se, {
1536
+ value: String(e.value),
1537
+ disabled: e.disabled,
1538
+ children: /* @__PURE__ */ C(nt, {
1539
+ label: g(e.label) || e.value,
1540
+ description: g(e.description),
1541
+ image: e.image
1542
+ })
1543
+ }, `${e.value}-${t}`)) }) })]
1544
+ })
1545
+ }),
1546
+ l && /* @__PURE__ */ C(J, { children: l }),
1547
+ h && !l && /* @__PURE__ */ C(J, { children: h }),
1548
+ d && !l && !h && /* @__PURE__ */ C(q, { children: d })
1549
+ ]
1550
+ });
1551
+ }, kt = (e) => null;
1552
+ //#endregion
1553
+ //#region src/shared/components/ui/switch.tsx
1554
+ function At({ className: e, ...t }) {
1555
+ return /* @__PURE__ */ C(U.Root, {
1556
+ "data-slot": "switch",
1557
+ className: W("tg:peer tg:inline-flex tg:h-[1.15rem] tg:w-8 tg:shrink-0 tg:items-center tg:rounded-full tg:border tg:border-transparent tg:shadow-xs tg:outline-none tg:transition-all tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:data-[state=checked]:bg-primary tg:data-[state=unchecked]:bg-input tg:dark:data-[state=unchecked]:bg-input/80", e),
1558
+ ...t,
1559
+ children: /* @__PURE__ */ C(U.Thumb, {
1560
+ "data-slot": "switch-thumb",
1561
+ className: W("tg:pointer-events-none tg:block tg:size-4 tg:rounded-full tg:bg-background tg:ring-0 tg:transition-transform tg:data-[state=checked]:translate-x-[calc(100%-2px)] tg:data-[state=unchecked]:translate-x-0 tg:dark:data-[state=checked]:bg-primary-foreground tg:dark:data-[state=unchecked]:bg-foreground")
1562
+ })
1563
+ });
1564
+ }
1565
+ //#endregion
1566
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.tsx
1567
+ var jt = ({ field: e, extra: t }) => {
1568
+ let { id: n, name: r, value: i } = e, { node: a, setValue: o, error: s, label: c, helperText: l } = t;
1569
+ return /* @__PURE__ */ w(K, {
1570
+ className: "tg:mb-4",
1571
+ children: [
1572
+ /* @__PURE__ */ w(X, {
1573
+ htmlFor: n,
1574
+ children: [c || a.data.name, a.data.required && /* @__PURE__ */ C("span", {
1575
+ className: "tg:text-red-500",
1576
+ children: "*"
1577
+ })]
1578
+ }),
1579
+ /* @__PURE__ */ C(At, {
1580
+ id: n,
1581
+ name: r,
1582
+ checked: i,
1583
+ onCheckedChange: o
1584
+ }),
1585
+ l && !s && /* @__PURE__ */ C(q, { children: l }),
1586
+ s && /* @__PURE__ */ C(J, { children: s })
1587
+ ]
1588
+ });
1589
+ };
1590
+ //#endregion
1591
+ //#region src/shared/components/ui/textarea.tsx
1592
+ function Mt({ className: e, ...t }) {
1593
+ return /* @__PURE__ */ C("textarea", {
1594
+ "data-slot": "textarea",
1595
+ className: W("tg:field-sizing-content tg:flex tg:min-h-16 tg:w-full tg:rounded-md tg:border tg:border-input tg:bg-transparent tg:px-3 tg:py-2 tg:text-base tg:shadow-xs tg:outline-none tg:transition-[color,box-shadow] tg:placeholder:text-muted-foreground tg:focus-visible:border-ring tg:focus-visible:ring-[3px] tg:focus-visible:ring-ring/50 tg:disabled:cursor-not-allowed tg:disabled:opacity-50 tg:aria-invalid:border-destructive tg:aria-invalid:ring-destructive/20 tg:md:text-sm tg:dark:bg-input/30 tg:dark:aria-invalid:ring-destructive/40", e),
1596
+ ...t
1597
+ });
1598
+ }
1599
+ //#endregion
1600
+ //#region src/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.tsx
1601
+ var Nt = ({ field: e, extra: t }) => {
1602
+ let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
1603
+ return /* @__PURE__ */ w(K, {
1604
+ className: "tg:mb-4",
1605
+ children: [
1606
+ /* @__PURE__ */ w(X, {
1607
+ htmlFor: n,
1608
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
1609
+ className: "tg:text-red-500",
1610
+ children: "*"
1611
+ })]
1612
+ }),
1613
+ /* @__PURE__ */ C(Mt, {
1614
+ id: n,
1615
+ name: r,
1616
+ value: i ?? "",
1617
+ onChange: (e) => s(e.target.value),
1618
+ placeholder: a,
1619
+ className: "tg:w-full tg:rounded-md tg:border tg:px-3 tg:py-2",
1620
+ rows: 4
1621
+ }),
1622
+ c && /* @__PURE__ */ C(J, { children: c }),
1623
+ u && !c && /* @__PURE__ */ C(q, { children: u })
1624
+ ]
1625
+ });
1626
+ }, Pt = ({ field: e, extra: t }) => {
1627
+ let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
1628
+ return /* @__PURE__ */ w(K, {
1629
+ className: "tg:mb-4",
1630
+ children: [
1631
+ /* @__PURE__ */ w(X, {
1632
+ htmlFor: n,
1633
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
1634
+ className: "tg:text-red-500",
1635
+ children: "*"
1636
+ })]
1637
+ }),
1638
+ /* @__PURE__ */ C(Y, {
1639
+ type: "text",
1640
+ id: n,
1641
+ name: r,
1642
+ value: i ?? "",
1643
+ onChange: (e) => s(e.target.value),
1644
+ placeholder: a
1645
+ }),
1646
+ c && /* @__PURE__ */ C(J, { children: c }),
1647
+ u && !c && /* @__PURE__ */ C(q, { children: u })
1648
+ ]
1649
+ });
1650
+ }, Ft = ({ field: e, extra: t }) => {
1651
+ let { id: n, name: r, value: i, placeholder: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t;
1652
+ return /* @__PURE__ */ w(K, {
1653
+ className: "tg:mb-4",
1654
+ children: [
1655
+ /* @__PURE__ */ w(X, {
1656
+ htmlFor: n,
1657
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
1658
+ className: "tg:text-red-500",
1659
+ children: "*"
1660
+ })]
1661
+ }),
1662
+ /* @__PURE__ */ C(Y, {
1663
+ type: "time",
1664
+ id: n,
1665
+ name: r,
1666
+ value: i ?? "",
1667
+ onChange: (e) => s(e.target.value),
1668
+ placeholder: a,
1669
+ className: "tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1670
+ }),
1671
+ c && /* @__PURE__ */ C(J, { children: c }),
1672
+ u && !c && /* @__PURE__ */ C(q, { children: u })
1673
+ ]
1674
+ });
1675
+ }, It = ({ field: e, extra: t }) => {
1676
+ let { id: n, name: i, value: a } = e, { node: o, setValue: s, error: c, label: l, helperText: u } = t, d = r(), f = Array.isArray(a) ? a : [], p = f[0] || "", m = f[1] || "", h = (e) => {
1677
+ s([e, m]);
1678
+ }, g = (e) => {
1679
+ s([p, e]);
1680
+ };
1681
+ return /* @__PURE__ */ w(K, {
1682
+ className: "tg:mb-4",
1683
+ children: [
1684
+ /* @__PURE__ */ w(X, {
1685
+ htmlFor: `${n}-start`,
1686
+ children: [l || o.data.name, o.data.required && /* @__PURE__ */ C("span", {
1687
+ className: "tg:text-red-500",
1688
+ children: "*"
1689
+ })]
1690
+ }),
1691
+ /* @__PURE__ */ w("div", {
1692
+ className: "tg:flex tg:gap-2",
1693
+ children: [/* @__PURE__ */ C(Y, {
1694
+ id: `${n}-start`,
1695
+ name: `${i}-start`,
1696
+ "aria-label": `${l || o.data.name} - ${d("renderer.defaultInputs.startTime")}`,
1697
+ "aria-invalid": !!c,
1698
+ "aria-describedby": c ? `${o.id}-error` : void 0,
1699
+ type: "time",
1700
+ value: p,
1701
+ onChange: (e) => h(e.target.value),
1702
+ placeholder: d("renderer.defaultInputs.startTime"),
1703
+ className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1704
+ }), /* @__PURE__ */ C(Y, {
1705
+ id: `${n}-end`,
1706
+ name: `${i}-end`,
1707
+ "aria-label": `${l || o.data.name} - ${d("renderer.defaultInputs.endTime")}`,
1708
+ "aria-invalid": !!c,
1709
+ "aria-describedby": c ? `${o.id}-error` : void 0,
1710
+ type: "time",
1711
+ value: m,
1712
+ onChange: (e) => g(e.target.value),
1713
+ placeholder: d("renderer.defaultInputs.endTime"),
1714
+ className: "tg:flex-1 tg:bg-background tg:[color-scheme:light] tg:dark:[color-scheme:dark]"
1715
+ })]
1716
+ }),
1717
+ c && /* @__PURE__ */ C(J, { children: c }),
1718
+ u && !c && /* @__PURE__ */ C(q, { children: u })
1719
+ ]
1720
+ });
1721
+ }, Lt = {
1722
+ address: qe,
1723
+ autocomplete: at,
1724
+ checkbox: ot,
1725
+ date: lt,
1726
+ daterange: ut,
1727
+ file: dt,
1728
+ hidden: ft,
1729
+ http: gt,
1730
+ number: _t,
1731
+ password: vt,
1732
+ radio: Dt,
1733
+ select: Ot,
1734
+ submit: kt,
1735
+ switch: jt,
1736
+ text: Pt,
1737
+ textarea: Nt,
1738
+ time: Ft,
1739
+ timerange: It
1740
+ };
1741
+ //#endregion
1742
+ export { Z as $, Pe as A, Oe as B, ze as C, We as D, Be as E, je as F, xe as G, be as H, $ as I, ve as J, Ce as K, De as L, Ie as M, Fe as N, Ve as O, Le as P, Q, ke as R, qe as S, Ue as T, _e as U, ge as V, Se as W, he as X, pe as Y, me as Z, dt as _, Nt as a, G as at, ot as b, At as c, Tt as d, X as et, Et as f, ft as g, gt as h, Pt as i, de as it, Re as j, Ae as k, Ot as l, _t as m, It as n, q as nt, Mt as o, W as ot, vt as p, ye as q, Ft as r, K as rt, jt as s, Lt as t, Y as tt, Dt as u, ut as v, He as w, at as x, lt as y, Ee as z };