treege 3.0.0-beta.4 → 3.0.0-beta.41

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