treege 3.0.0-beta.5 → 3.0.0-beta.50

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 (181) hide show
  1. package/LICENSE +18 -12
  2. package/README.md +313 -52
  3. package/dist/DefaultInputs-lez0rJ7m.js +1761 -0
  4. package/dist/ThemeContext-BbA-sJ85.js +1353 -0
  5. package/dist/editor/components/input/ComboboxWithCreate.d.ts +2 -1
  6. package/dist/editor/components/styles/EditorStyles.d.ts +2 -0
  7. package/dist/editor/constants/defaultNode.d.ts +1 -1
  8. package/dist/editor/constants/edgeTypes.d.ts +3 -2
  9. package/dist/editor/constants/inputTypeIcons.d.ts +3 -0
  10. package/dist/editor/constants/nodeSpacing.d.ts +33 -0
  11. package/dist/editor/constants/nodeTypes.d.ts +4 -5
  12. package/dist/editor/context/OpenApiContext.d.ts +79 -0
  13. package/dist/editor/context/TreegeEditorContext.d.ts +60 -1
  14. package/dist/editor/features/TreegeEditor/TreegeEditor.d.ts +1 -1
  15. package/dist/editor/features/TreegeEditor/controls/MiniMapControl.d.ts +6 -0
  16. package/dist/editor/features/TreegeEditor/dialogs/AuthorizeDialog.d.ts +20 -0
  17. package/dist/editor/features/TreegeEditor/dialogs/ChangeNodeTypeDialog.d.ts +2 -0
  18. package/dist/editor/features/TreegeEditor/dialogs/DeleteNodeDialog.d.ts +2 -0
  19. package/dist/editor/features/TreegeEditor/dialogs/HeadersDialog.d.ts +19 -0
  20. package/dist/editor/features/TreegeEditor/dialogs/OpenApiDialog.d.ts +6 -0
  21. package/dist/editor/features/TreegeEditor/edges/ConditionalEdge.d.ts +2 -2
  22. package/dist/editor/features/TreegeEditor/edges/DefaultEdge.d.ts +3 -0
  23. package/dist/editor/features/TreegeEditor/forms/OptionsSourceForm.d.ts +7 -0
  24. package/dist/editor/features/TreegeEditor/forms/SubmitConfigForm.d.ts +7 -0
  25. package/dist/editor/features/TreegeEditor/inputs/ApiUrlCombobox.d.ts +30 -0
  26. package/dist/editor/features/TreegeEditor/inputs/ComboboxPattern.d.ts +2 -1
  27. package/dist/editor/features/TreegeEditor/inputs/OptionImageField.d.ts +6 -0
  28. package/dist/editor/features/TreegeEditor/inputs/SelectNodeGroup.d.ts +22 -1
  29. package/dist/editor/features/TreegeEditor/layout/AutoLayout.d.ts +15 -0
  30. package/dist/editor/features/TreegeEditor/nodes/TreegeNode.d.ts +5 -0
  31. package/dist/editor/features/TreegeEditor/nodes/components/BottomHandleDropdown.d.ts +7 -0
  32. package/dist/editor/features/TreegeEditor/nodes/components/NodeGroupBadge.d.ts +6 -0
  33. package/dist/editor/features/TreegeEditor/nodes/components/NodeImage.d.ts +5 -0
  34. package/dist/editor/features/TreegeEditor/nodes/components/NodeImageButton.d.ts +6 -0
  35. package/dist/editor/features/TreegeEditor/nodes/components/NodeInputPreview.d.ts +12 -0
  36. package/dist/editor/features/TreegeEditor/nodes/components/NodeLabelInput.d.ts +10 -0
  37. package/dist/editor/features/TreegeEditor/nodes/components/NodeMoreMenu.d.ts +6 -0
  38. package/dist/editor/features/TreegeEditor/nodes/components/NodeRequiredButton.d.ts +6 -0
  39. package/dist/editor/features/TreegeEditor/nodes/components/NodeStackOrderButtons.d.ts +6 -0
  40. package/dist/editor/features/TreegeEditor/nodes/components/NodeTypeBadge.d.ts +7 -0
  41. package/dist/editor/features/TreegeEditor/nodes/layout/NodeWrapper.d.ts +4 -2
  42. package/dist/editor/features/TreegeEditor/panel/AIGeneratorDialog.d.ts +16 -0
  43. package/dist/editor/features/TreegeEditor/panel/ActionsPanel.d.ts +7 -2
  44. package/dist/editor/features/TreegeEditor/panel/MultiSelectionPanel.d.ts +7 -0
  45. package/dist/editor/hooks/useAvailableParentFields.d.ts +13 -0
  46. package/dist/editor/hooks/useFlowActions.d.ts +6 -2
  47. package/dist/editor/hooks/useFlowConnections.d.ts +13 -0
  48. package/dist/editor/hooks/useHistoryStore.d.ts +26 -0
  49. package/dist/editor/hooks/useIsStackedEdge.d.ts +8 -0
  50. package/dist/editor/hooks/useNodesSelection.d.ts +5 -5
  51. package/dist/editor/hooks/useStackPosition.d.ts +14 -0
  52. package/dist/editor/hooks/useUndoRedo.d.ts +31 -0
  53. package/dist/editor/types/ai.d.ts +65 -0
  54. package/dist/editor/types/editor.d.ts +71 -9
  55. package/dist/editor/types/openapi.d.ts +81 -0
  56. package/dist/editor/utils/aiFlowGenerator.d.ts +5 -0
  57. package/dist/editor/utils/dagreLayout.d.ts +8 -0
  58. package/dist/editor/utils/edge.d.ts +14 -0
  59. package/dist/editor/utils/groupColor.d.ts +14 -0
  60. package/dist/editor/utils/image.d.ts +7 -0
  61. package/dist/editor/utils/inputTypeIcon.d.ts +6 -0
  62. package/dist/editor/utils/openapi.d.ts +35 -0
  63. package/dist/editor/utils/stackPositionIndex.d.ts +9 -0
  64. package/dist/editor-BEhbmVtH.js +5740 -0
  65. package/dist/editor.js +3 -8
  66. package/dist/main.js +4 -53
  67. package/dist/renderer/context/TreegeConfigContext.d.ts +3 -27
  68. package/dist/renderer/context/TreegeRendererContext.d.ts +100 -2
  69. package/dist/renderer/features/TreegeRenderer/native/TreegeRenderer.d.ts +19 -11
  70. package/dist/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.d.ts +7 -7
  71. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputWrapper.d.ts +9 -0
  72. package/dist/renderer/features/TreegeRenderer/native/components/DefaultInputs.d.ts +21 -15
  73. package/dist/renderer/features/TreegeRenderer/native/components/DefaultStep.d.ts +3 -0
  74. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButton.d.ts +9 -7
  75. package/dist/renderer/features/TreegeRenderer/native/components/DefaultSubmitButtonWrapper.d.ts +11 -0
  76. package/dist/renderer/features/TreegeRenderer/native/components/DefaultUI.d.ts +8 -7
  77. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAddressInput.d.ts +3 -0
  78. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultAutocompleteInput.d.ts +3 -0
  79. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultCheckboxInput.d.ts +3 -0
  80. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateInput.d.ts +3 -0
  81. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultDateRangeInput.d.ts +3 -0
  82. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultFileInput.d.ts +3 -0
  83. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHiddenInput.d.ts +3 -0
  84. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultHttpInput.d.ts +3 -0
  85. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultNumberInput.d.ts +3 -0
  86. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultPasswordInput.d.ts +3 -0
  87. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultRadioInput.d.ts +3 -0
  88. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSelectInput.d.ts +3 -0
  89. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultSwitchInput.d.ts +3 -0
  90. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextInput.d.ts +3 -0
  91. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTextareaInput.d.ts +3 -0
  92. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeInput.d.ts +3 -0
  93. package/dist/renderer/features/TreegeRenderer/native/components/inputs/DefaultTimeRangeInput.d.ts +3 -0
  94. package/dist/renderer/features/TreegeRenderer/useTreegeRenderer.d.ts +92 -24
  95. package/dist/renderer/features/TreegeRenderer/web/TreegeRenderer.d.ts +1 -1
  96. package/dist/renderer/features/TreegeRenderer/web/components/DefaultFormWrapper.d.ts +1 -1
  97. package/dist/renderer/features/TreegeRenderer/web/components/DefaultInputWrapper.d.ts +9 -0
  98. package/dist/renderer/features/TreegeRenderer/web/components/DefaultStep.d.ts +3 -0
  99. package/dist/renderer/features/TreegeRenderer/web/components/DefaultSubmitButton.d.ts +1 -1
  100. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAddressInput.d.ts +1 -1
  101. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultAutocompleteInput.d.ts +1 -1
  102. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultCheckboxInput.d.ts +1 -1
  103. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateInput.d.ts +1 -1
  104. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultDateRangeInput.d.ts +1 -1
  105. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultFileInput.d.ts +1 -1
  106. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHiddenInput.d.ts +1 -1
  107. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultHttpInput.d.ts +1 -1
  108. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultNumberInput.d.ts +1 -1
  109. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultPasswordInput.d.ts +1 -1
  110. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultRadioInput.d.ts +1 -1
  111. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSelectInput.d.ts +1 -1
  112. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSubmitInput.d.ts +3 -0
  113. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultSwitchInput.d.ts +1 -1
  114. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextAreaInput.d.ts +1 -1
  115. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTextInput.d.ts +1 -1
  116. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeInput.d.ts +1 -1
  117. package/dist/renderer/features/TreegeRenderer/web/components/inputs/DefaultTimeRangeInput.d.ts +1 -1
  118. package/dist/renderer/features/TreegeRenderer/web/components/styles/RendererStyles.d.ts +2 -0
  119. package/dist/renderer/hooks/useInputOptions.d.ts +28 -0
  120. package/dist/renderer/hooks/useRenderNode.d.ts +57 -0
  121. package/dist/renderer/hooks/useSubmitHandler.d.ts +35 -0
  122. package/dist/renderer/hooks/useTranslate.d.ts +6 -4
  123. package/dist/renderer/index.d.ts +3 -1
  124. package/dist/renderer/index.native.d.ts +19 -0
  125. package/dist/renderer/types/renderer.d.ts +131 -33
  126. package/dist/renderer/utils/flow.d.ts +1 -18
  127. package/dist/renderer/utils/form.d.ts +22 -2
  128. package/dist/renderer/utils/http.d.ts +129 -0
  129. package/dist/renderer/utils/node.d.ts +18 -1
  130. package/dist/renderer/utils/sanitize.d.ts +85 -0
  131. package/dist/renderer/utils/sanitize.native.d.ts +69 -0
  132. package/dist/renderer/utils/step.d.ts +27 -0
  133. package/dist/renderer/utils/submit.d.ts +48 -0
  134. package/dist/renderer-native.d.ts +2 -0
  135. package/dist/renderer-native.js +3580 -0
  136. package/dist/renderer.js +3 -46
  137. package/dist/shared/components/ui/badge.d.ts +2 -2
  138. package/dist/shared/components/ui/button.d.ts +3 -3
  139. package/dist/shared/components/ui/collapsible.d.ts +1 -1
  140. package/dist/shared/components/ui/command.d.ts +1 -1
  141. package/dist/shared/components/ui/dropdown-menu.d.ts +1 -1
  142. package/dist/shared/components/ui/field.d.ts +24 -0
  143. package/dist/shared/components/ui/form.d.ts +1 -1
  144. package/dist/shared/components/ui/popover.d.ts +4 -2
  145. package/dist/shared/components/ui/select.d.ts +3 -1
  146. package/dist/shared/components/ui/sheet.d.ts +1 -1
  147. package/dist/shared/components/ui/toggle-group.d.ts +7 -0
  148. package/dist/shared/components/ui/toggle.d.ts +9 -0
  149. package/dist/shared/components/ui/tooltip.d.ts +1 -1
  150. package/dist/shared/constants/colors.d.ts +45 -0
  151. package/dist/shared/constants/inputType.d.ts +1 -0
  152. package/dist/shared/constants/node.d.ts +0 -1
  153. package/dist/shared/context/ThemeContext.d.ts +2 -0
  154. package/dist/shared/context/ThemeContext.native.d.ts +22 -0
  155. package/dist/shared/hooks/useMediaQuery.d.ts +12 -0
  156. package/dist/shared/hooks/useThemeColors.d.ts +37 -0
  157. package/dist/shared/locales/ar.json.d.ts +220 -18
  158. package/dist/shared/locales/de.json.d.ts +221 -19
  159. package/dist/shared/locales/en.json.d.ts +222 -20
  160. package/dist/shared/locales/es.json.d.ts +221 -19
  161. package/dist/shared/locales/fr.json.d.ts +221 -19
  162. package/dist/shared/locales/it.json.d.ts +221 -19
  163. package/dist/shared/locales/pt.json.d.ts +221 -19
  164. package/dist/shared/types/edge.d.ts +6 -0
  165. package/dist/shared/types/node.d.ts +109 -7
  166. package/dist/shared/utils/inputTypeGuards.d.ts +7 -0
  167. package/dist/shared/utils/nodeTypeGuards.d.ts +1 -6
  168. package/package.json +48 -22
  169. package/dist/ThemeContext-D4xMOrdt.js +0 -759
  170. package/dist/TreegeEditor-B8FP1rKR.js +0 -2153
  171. package/dist/TreegeRenderer-BOCobRLr.js +0 -1414
  172. package/dist/editor/features/TreegeEditor/forms/FlowNodeForm.d.ts +0 -2
  173. package/dist/editor/features/TreegeEditor/inputs/SelectInputType.d.ts +0 -7
  174. package/dist/editor/features/TreegeEditor/nodes/FlowNode.d.ts +0 -6
  175. package/dist/editor/features/TreegeEditor/nodes/GroupNode.d.ts +0 -6
  176. package/dist/editor/features/TreegeEditor/nodes/InputNode.d.ts +0 -6
  177. package/dist/editor/features/TreegeEditor/nodes/UINode.d.ts +0 -6
  178. package/dist/editor/hooks/useEdgesSelection.d.ts +0 -11
  179. package/dist/renderer/features/TreegeRenderer/native/components/DefaultGroup.d.ts +0 -7
  180. package/dist/renderer/features/TreegeRenderer/web/components/DefaultGroup.d.ts +0 -6
  181. /package/dist/editor/components/{data-display/logo.d.ts → branding/Logo.d.ts} +0 -0
@@ -0,0 +1,3580 @@
1
+ import { E as e, L as t, M as n, O as r, S as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, j as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C, w, x as T } from "./ThemeContext-BbA-sJ85.js";
2
+ import { useCallback as ee, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
3
+ import { jsx as A, jsxs as j } from "react/jsx-runtime";
4
+ import { ActivityIndicator as M, Alert as N, FlatList as te, Image as P, Modal as F, ScrollView as I, StyleSheet as L, Switch as R, Text as z, TextInput as ne, TouchableOpacity as B, View as V } from "react-native";
5
+ //#region src/renderer/features/TreegeRenderer/native/components/DefaultFormWrapper.tsx
6
+ var H = ({ children: e }) => /* @__PURE__ */ A(V, {
7
+ style: re.container,
8
+ children: e
9
+ }), re = L.create({ container: { padding: 16 } }), ie = async (e, t) => {
10
+ if (!e || e.trim().length < 3) return [];
11
+ try {
12
+ let n = await fetch(`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(e)}&format=jsonv2&addressdetails=1&limit=5`, { headers: {
13
+ Accept: "application/json",
14
+ "User-Agent": "Treege Renderer",
15
+ ...t && { "Accept-Language": t }
16
+ } });
17
+ return n.ok ? (await n.json()).map((e) => ({
18
+ label: e.display_name,
19
+ value: e.display_name
20
+ })) : [];
21
+ } catch (e) {
22
+ return console.error("Nominatim fetch error:", e), [];
23
+ }
24
+ }, ae = async (e, t) => {
25
+ if (!e || e.trim().length < 3) return [];
26
+ try {
27
+ let n = await fetch(`https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${encodeURIComponent(e)}&key=${t}`);
28
+ if (!n.ok) return console.warn("Google Places API request failed:", n.status), [];
29
+ let r = await n.json();
30
+ return r.status !== "OK" && r.status !== "ZERO_RESULTS" ? (console.warn("Google Places API status:", r.status), []) : (r.predictions || []).map((e) => ({
31
+ label: e.description,
32
+ value: e.description
33
+ }));
34
+ } catch (e) {
35
+ return console.error("Google Places fetch error:", e), [];
36
+ }
37
+ }, oe = ({ node: e, value: t, setValue: i, error: a, label: o, placeholder: s, helperText: c, id: l, name: u }) => {
38
+ let [d, f] = k(""), [p, m] = k([]), [h, g] = k(!1), [v, y] = k(!1), { language: b, googleApiKey: x } = n(), S = r(), { colors: C } = _(), w = ee((e) => {
39
+ i(e.value), f(""), g(!1), m([]);
40
+ }, [i]), T = () => {
41
+ g(!1);
42
+ };
43
+ return E(() => {
44
+ if (!d || d.trim().length < 3) {
45
+ m([]), y(!1);
46
+ return;
47
+ }
48
+ y(!0);
49
+ let e = setTimeout(async () => {
50
+ m(x ? await ae(d, x) : await ie(d, b)), y(!1);
51
+ }, 300);
52
+ return () => {
53
+ clearTimeout(e), y(!1);
54
+ };
55
+ }, [
56
+ d,
57
+ b,
58
+ x
59
+ ]), /* @__PURE__ */ j(V, {
60
+ style: U.container,
61
+ children: [
62
+ /* @__PURE__ */ j(z, {
63
+ style: [U.label, { color: C.textSecondary }],
64
+ children: [o || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
65
+ style: { color: C.error },
66
+ children: "*"
67
+ })]
68
+ }),
69
+ /* @__PURE__ */ j(B, {
70
+ style: [
71
+ U.trigger,
72
+ {
73
+ backgroundColor: C.input,
74
+ borderColor: C.border
75
+ },
76
+ a && { borderColor: C.error }
77
+ ],
78
+ onPress: () => g(!0),
79
+ activeOpacity: .7,
80
+ children: [/* @__PURE__ */ A(z, {
81
+ style: [
82
+ U.triggerText,
83
+ { color: C.text },
84
+ !t && { color: C.textMuted }
85
+ ],
86
+ numberOfLines: 1,
87
+ children: t || s || S("renderer.defaultAddressInput.enterAddress")
88
+ }), /* @__PURE__ */ A(z, {
89
+ style: U.icon,
90
+ children: "📍"
91
+ })]
92
+ }),
93
+ /* @__PURE__ */ A(F, {
94
+ visible: h,
95
+ transparent: !0,
96
+ animationType: "fade",
97
+ onRequestClose: T,
98
+ children: /* @__PURE__ */ A(B, {
99
+ style: U.modalOverlay,
100
+ activeOpacity: 1,
101
+ onPress: T,
102
+ children: /* @__PURE__ */ j(B, {
103
+ style: [U.modalContent, { backgroundColor: C.card }],
104
+ activeOpacity: 1,
105
+ onPress: () => {},
106
+ children: [
107
+ /* @__PURE__ */ j(V, {
108
+ style: [U.modalHeader, { borderBottomColor: C.separator }],
109
+ children: [/* @__PURE__ */ A(z, {
110
+ style: [U.modalTitle, { color: C.text }],
111
+ children: o || e.data.name
112
+ }), /* @__PURE__ */ A(B, {
113
+ onPress: T,
114
+ children: /* @__PURE__ */ A(z, {
115
+ style: [U.closeButton, { color: C.textMuted }],
116
+ children: "✕"
117
+ })
118
+ })]
119
+ }),
120
+ /* @__PURE__ */ j(V, {
121
+ style: U.searchContainer,
122
+ children: [/* @__PURE__ */ A(ne, {
123
+ style: [U.searchInput, {
124
+ backgroundColor: C.muted,
125
+ borderColor: C.border,
126
+ color: C.text
127
+ }],
128
+ placeholder: s || S("renderer.defaultAddressInput.enterAddress"),
129
+ placeholderTextColor: C.textMuted,
130
+ value: d,
131
+ onChangeText: f,
132
+ autoFocus: !0,
133
+ autoCapitalize: "none",
134
+ autoCorrect: !1
135
+ }), v && /* @__PURE__ */ A(M, {
136
+ size: "small",
137
+ color: C.primary,
138
+ style: U.searchLoader
139
+ })]
140
+ }),
141
+ v ? /* @__PURE__ */ j(V, {
142
+ style: U.loadingContainer,
143
+ children: [/* @__PURE__ */ A(M, {
144
+ size: "small",
145
+ color: C.primary
146
+ }), /* @__PURE__ */ A(z, {
147
+ style: [U.loadingText, { color: C.textMuted }],
148
+ children: S("renderer.defaultAddressInput.searching")
149
+ })]
150
+ }) : /* @__PURE__ */ A(te, {
151
+ data: p,
152
+ keyExtractor: (e, t) => t.toString(),
153
+ style: U.suggestionsList,
154
+ contentContainerStyle: U.suggestionsListContent,
155
+ keyboardShouldPersistTaps: "handled",
156
+ ListEmptyComponent: d.length >= 3 ? /* @__PURE__ */ A(V, {
157
+ style: U.emptyContainer,
158
+ children: /* @__PURE__ */ A(z, {
159
+ style: [U.emptyText, { color: C.textMuted }],
160
+ children: S("renderer.defaultAddressInput.noAddressesFound")
161
+ })
162
+ }) : /* @__PURE__ */ A(V, {
163
+ style: U.emptyContainer,
164
+ children: /* @__PURE__ */ A(z, {
165
+ style: [U.emptyText, { color: C.textMuted }],
166
+ children: S("renderer.defaultAddressInput.typeMinChars")
167
+ })
168
+ }),
169
+ renderItem: ({ item: e }) => /* @__PURE__ */ j(B, {
170
+ style: U.suggestionItem,
171
+ onPress: () => w(e),
172
+ activeOpacity: .7,
173
+ children: [/* @__PURE__ */ A(z, {
174
+ style: U.suggestionIcon,
175
+ children: "📍"
176
+ }), /* @__PURE__ */ A(z, {
177
+ style: [U.suggestionText, { color: C.text }],
178
+ numberOfLines: 2,
179
+ children: e.label
180
+ })]
181
+ })
182
+ })
183
+ ]
184
+ })
185
+ })
186
+ }),
187
+ a && /* @__PURE__ */ A(z, {
188
+ style: [U.error, { color: C.error }],
189
+ children: a
190
+ }),
191
+ c && !a && /* @__PURE__ */ A(z, {
192
+ style: [U.helperText, { color: C.textMuted }],
193
+ children: c
194
+ })
195
+ ]
196
+ });
197
+ }, U = L.create({
198
+ closeButton: {
199
+ fontSize: 24,
200
+ fontWeight: "300"
201
+ },
202
+ container: { marginBottom: 16 },
203
+ emptyContainer: {
204
+ alignItems: "center",
205
+ paddingVertical: 24
206
+ },
207
+ emptyText: { fontSize: 14 },
208
+ error: {
209
+ fontSize: 12,
210
+ marginTop: 4
211
+ },
212
+ helperText: {
213
+ fontSize: 12,
214
+ marginTop: 4
215
+ },
216
+ icon: { fontSize: 16 },
217
+ label: {
218
+ fontSize: 14,
219
+ fontWeight: "500",
220
+ marginBottom: 8
221
+ },
222
+ loadingContainer: {
223
+ alignItems: "center",
224
+ flexDirection: "row",
225
+ justifyContent: "center",
226
+ paddingVertical: 24
227
+ },
228
+ loadingText: {
229
+ fontSize: 14,
230
+ marginLeft: 8
231
+ },
232
+ modalContent: {
233
+ borderRadius: 12,
234
+ maxHeight: "80%",
235
+ padding: 16,
236
+ width: "90%"
237
+ },
238
+ modalHeader: {
239
+ alignItems: "center",
240
+ borderBottomWidth: 1,
241
+ flexDirection: "row",
242
+ justifyContent: "space-between",
243
+ marginBottom: 12,
244
+ paddingBottom: 12
245
+ },
246
+ modalOverlay: {
247
+ alignItems: "center",
248
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
249
+ flex: 1,
250
+ justifyContent: "center"
251
+ },
252
+ modalTitle: {
253
+ fontSize: 18,
254
+ fontWeight: "600"
255
+ },
256
+ searchContainer: {
257
+ marginBottom: 12,
258
+ position: "relative"
259
+ },
260
+ searchInput: {
261
+ borderRadius: 6,
262
+ borderWidth: 1,
263
+ fontSize: 14,
264
+ paddingHorizontal: 12,
265
+ paddingRight: 40,
266
+ paddingVertical: 10
267
+ },
268
+ searchLoader: {
269
+ position: "absolute",
270
+ right: 12,
271
+ top: "50%",
272
+ transform: [{ translateY: -10 }]
273
+ },
274
+ suggestionIcon: {
275
+ fontSize: 16,
276
+ marginRight: 8
277
+ },
278
+ suggestionItem: {
279
+ alignItems: "center",
280
+ borderRadius: 6,
281
+ flexDirection: "row",
282
+ paddingHorizontal: 12,
283
+ paddingVertical: 12
284
+ },
285
+ suggestionsList: {
286
+ flexGrow: 0,
287
+ flexShrink: 1
288
+ },
289
+ suggestionsListContent: { flexGrow: 0 },
290
+ suggestionText: {
291
+ flex: 1,
292
+ fontSize: 14
293
+ },
294
+ trigger: {
295
+ alignItems: "center",
296
+ borderRadius: 6,
297
+ borderWidth: 1,
298
+ flexDirection: "row",
299
+ justifyContent: "space-between",
300
+ paddingHorizontal: 12,
301
+ paddingVertical: 10
302
+ },
303
+ triggerText: {
304
+ flex: 1,
305
+ fontSize: 14
306
+ }
307
+ }), se = ({ node: e, value: t, setValue: n, error: i, label: a, placeholder: o, helperText: s }) => {
308
+ let [c, l] = k(!1), [u, d] = k(""), f = r(), { colors: p } = _(), m = e.data.options || [], h = m.find((e) => e.value === t), g = D(() => {
309
+ if (!u.trim()) return m;
310
+ let e = u.toLowerCase();
311
+ return m.filter((t) => f(t.label).toLowerCase().includes(e) || t.value.toLowerCase().includes(e));
312
+ }, [
313
+ m,
314
+ u,
315
+ f
316
+ ]), v = (e) => {
317
+ n(e === t ? "" : e), l(!1), d("");
318
+ }, y = () => {
319
+ l(!1), d("");
320
+ };
321
+ return /* @__PURE__ */ j(V, {
322
+ style: W.container,
323
+ children: [
324
+ /* @__PURE__ */ j(z, {
325
+ style: [W.label, { color: p.textSecondary }],
326
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
327
+ style: { color: p.error },
328
+ children: "*"
329
+ })]
330
+ }),
331
+ /* @__PURE__ */ j(B, {
332
+ style: [
333
+ W.trigger,
334
+ {
335
+ backgroundColor: p.input,
336
+ borderColor: p.border
337
+ },
338
+ i && { borderColor: p.error }
339
+ ],
340
+ onPress: () => l(!0),
341
+ activeOpacity: .7,
342
+ children: [/* @__PURE__ */ A(z, {
343
+ style: [
344
+ W.triggerText,
345
+ { color: p.text },
346
+ !t && { color: p.textMuted }
347
+ ],
348
+ numberOfLines: 1,
349
+ children: t && h ? f(h.label) : o || f("renderer.defaultAutocompleteInput.selectOption")
350
+ }), /* @__PURE__ */ A(z, {
351
+ style: [W.arrow, { color: p.textMuted }],
352
+ children: "▼"
353
+ })]
354
+ }),
355
+ /* @__PURE__ */ A(F, {
356
+ visible: c,
357
+ transparent: !0,
358
+ animationType: "fade",
359
+ onRequestClose: y,
360
+ children: /* @__PURE__ */ A(B, {
361
+ style: W.modalOverlay,
362
+ activeOpacity: 1,
363
+ onPress: y,
364
+ children: /* @__PURE__ */ j(B, {
365
+ style: [W.modalContent, { backgroundColor: p.card }],
366
+ activeOpacity: 1,
367
+ onPress: () => {},
368
+ children: [
369
+ /* @__PURE__ */ j(V, {
370
+ style: [W.modalHeader, { borderBottomColor: p.separator }],
371
+ children: [/* @__PURE__ */ A(z, {
372
+ style: [W.modalTitle, { color: p.text }],
373
+ children: a || e.data.name
374
+ }), /* @__PURE__ */ A(B, {
375
+ onPress: y,
376
+ children: /* @__PURE__ */ A(z, {
377
+ style: [W.closeButton, { color: p.textMuted }],
378
+ children: "✕"
379
+ })
380
+ })]
381
+ }),
382
+ /* @__PURE__ */ A(V, {
383
+ style: W.searchContainer,
384
+ children: /* @__PURE__ */ A(ne, {
385
+ style: [W.searchInput, {
386
+ backgroundColor: p.muted,
387
+ borderColor: p.border,
388
+ color: p.text
389
+ }],
390
+ placeholder: o || f("renderer.defaultAutocompleteInput.search"),
391
+ placeholderTextColor: p.textMuted,
392
+ value: u,
393
+ onChangeText: d,
394
+ autoFocus: !0,
395
+ autoCapitalize: "none",
396
+ autoCorrect: !1
397
+ })
398
+ }),
399
+ /* @__PURE__ */ A(te, {
400
+ data: g,
401
+ keyExtractor: (e) => e.value,
402
+ style: W.optionsList,
403
+ contentContainerStyle: W.optionsListContent,
404
+ ListEmptyComponent: /* @__PURE__ */ A(V, {
405
+ style: W.emptyContainer,
406
+ children: /* @__PURE__ */ A(z, {
407
+ style: [W.emptyText, { color: p.textMuted }],
408
+ children: f("renderer.defaultAutocompleteInput.noResults")
409
+ })
410
+ }),
411
+ renderItem: ({ item: e }) => {
412
+ let n = e.value === t;
413
+ return /* @__PURE__ */ j(B, {
414
+ style: [W.option, n && { backgroundColor: p.primaryLight }],
415
+ onPress: () => v(e.value),
416
+ disabled: e.disabled,
417
+ activeOpacity: .7,
418
+ children: [/* @__PURE__ */ A(z, {
419
+ style: [
420
+ W.optionText,
421
+ { color: p.text },
422
+ e.disabled && { color: p.textMuted }
423
+ ],
424
+ children: f(e.label)
425
+ }), n && /* @__PURE__ */ A(z, {
426
+ style: [W.checkmark, { color: p.primary }],
427
+ children: "✓"
428
+ })]
429
+ });
430
+ }
431
+ })
432
+ ]
433
+ })
434
+ })
435
+ }),
436
+ i && /* @__PURE__ */ A(z, {
437
+ style: [W.error, { color: p.error }],
438
+ children: i
439
+ }),
440
+ s && !i && /* @__PURE__ */ A(z, {
441
+ style: [W.helperText, { color: p.textMuted }],
442
+ children: s
443
+ })
444
+ ]
445
+ });
446
+ }, W = L.create({
447
+ arrow: { fontSize: 12 },
448
+ checkmark: {
449
+ fontSize: 18,
450
+ fontWeight: "700"
451
+ },
452
+ closeButton: {
453
+ fontSize: 24,
454
+ fontWeight: "300"
455
+ },
456
+ container: { marginBottom: 16 },
457
+ emptyContainer: {
458
+ alignItems: "center",
459
+ paddingVertical: 24
460
+ },
461
+ emptyText: { fontSize: 14 },
462
+ error: {
463
+ fontSize: 12,
464
+ marginTop: 4
465
+ },
466
+ helperText: {
467
+ fontSize: 12,
468
+ marginTop: 4
469
+ },
470
+ label: {
471
+ fontSize: 14,
472
+ fontWeight: "500",
473
+ marginBottom: 8
474
+ },
475
+ modalContent: {
476
+ borderRadius: 12,
477
+ maxHeight: "80%",
478
+ padding: 16,
479
+ width: "90%"
480
+ },
481
+ modalHeader: {
482
+ alignItems: "center",
483
+ borderBottomWidth: 1,
484
+ flexDirection: "row",
485
+ justifyContent: "space-between",
486
+ marginBottom: 12,
487
+ paddingBottom: 12
488
+ },
489
+ modalOverlay: {
490
+ alignItems: "center",
491
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
492
+ flex: 1,
493
+ justifyContent: "center"
494
+ },
495
+ modalTitle: {
496
+ fontSize: 18,
497
+ fontWeight: "600"
498
+ },
499
+ option: {
500
+ alignItems: "center",
501
+ borderRadius: 6,
502
+ flexDirection: "row",
503
+ justifyContent: "space-between",
504
+ paddingHorizontal: 12,
505
+ paddingVertical: 12
506
+ },
507
+ optionsList: {
508
+ flexGrow: 0,
509
+ flexShrink: 1
510
+ },
511
+ optionsListContent: { flexGrow: 0 },
512
+ optionText: {
513
+ flex: 1,
514
+ fontSize: 14
515
+ },
516
+ searchContainer: { marginBottom: 12 },
517
+ searchInput: {
518
+ borderRadius: 6,
519
+ borderWidth: 1,
520
+ fontSize: 14,
521
+ paddingHorizontal: 12,
522
+ paddingVertical: 10
523
+ },
524
+ trigger: {
525
+ alignItems: "center",
526
+ borderRadius: 6,
527
+ borderWidth: 1,
528
+ flexDirection: "row",
529
+ justifyContent: "space-between",
530
+ paddingHorizontal: 12,
531
+ paddingVertical: 10
532
+ },
533
+ triggerText: {
534
+ flex: 1,
535
+ fontSize: 14
536
+ }
537
+ }), ce = ({ node: e, value: t, setValue: n, error: i, label: a, helperText: o }) => {
538
+ let s = r(), { colors: c } = _(), l = e.data.options || [], u = l.length > 0, d = Array.isArray(t) ? t : [], f = typeof t == "boolean" ? t : !1, p = (e) => {
539
+ n(u ? d.includes(e) ? d.filter((t) => t !== e) : [...d, e] : !f);
540
+ }, m = (e) => u ? d.includes(e) : f;
541
+ return /* @__PURE__ */ j(V, {
542
+ style: G.container,
543
+ children: [
544
+ /* @__PURE__ */ j(z, {
545
+ style: [G.label, { color: c.textSecondary }],
546
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
547
+ style: { color: c.error },
548
+ children: "*"
549
+ })]
550
+ }),
551
+ l.length > 0 ? l.map((e) => {
552
+ let t = s(e.description);
553
+ return /* @__PURE__ */ j(B, {
554
+ style: G.option,
555
+ onPress: () => p(e.value),
556
+ disabled: e.disabled,
557
+ activeOpacity: .7,
558
+ accessible: !0,
559
+ accessibilityRole: "checkbox",
560
+ accessibilityState: {
561
+ checked: m(e.value),
562
+ disabled: e.disabled
563
+ },
564
+ accessibilityLabel: s(e.label) || e.value,
565
+ children: [/* @__PURE__ */ A(V, {
566
+ style: [
567
+ G.checkbox,
568
+ {
569
+ backgroundColor: c.input,
570
+ borderColor: c.border
571
+ },
572
+ m(e.value) && {
573
+ backgroundColor: c.primary,
574
+ borderColor: c.primary
575
+ }
576
+ ],
577
+ children: m(e.value) && /* @__PURE__ */ A(z, {
578
+ style: G.checkmark,
579
+ children: "✓"
580
+ })
581
+ }), /* @__PURE__ */ j(V, {
582
+ style: G.optionTextContainer,
583
+ children: [/* @__PURE__ */ A(z, {
584
+ style: [
585
+ G.optionLabel,
586
+ { color: c.textSecondary },
587
+ e.disabled && { color: c.textMuted }
588
+ ],
589
+ children: s(e.label) || e.value
590
+ }), t && /* @__PURE__ */ A(z, {
591
+ style: [G.optionDescription, { color: c.textMuted }],
592
+ children: t
593
+ })]
594
+ })]
595
+ }, e.value);
596
+ }) : /* @__PURE__ */ j(B, {
597
+ style: G.option,
598
+ onPress: () => p(""),
599
+ activeOpacity: .7,
600
+ accessible: !0,
601
+ accessibilityRole: "checkbox",
602
+ accessibilityState: { checked: f },
603
+ accessibilityLabel: a || e.data.name,
604
+ children: [/* @__PURE__ */ A(V, {
605
+ style: [
606
+ G.checkbox,
607
+ {
608
+ backgroundColor: c.input,
609
+ borderColor: c.border
610
+ },
611
+ f && {
612
+ backgroundColor: c.primary,
613
+ borderColor: c.primary
614
+ }
615
+ ],
616
+ children: f && /* @__PURE__ */ A(z, {
617
+ style: G.checkmark,
618
+ children: "✓"
619
+ })
620
+ }), /* @__PURE__ */ A(z, {
621
+ style: [G.optionLabel, { color: c.textSecondary }],
622
+ children: a || e.data.name
623
+ })]
624
+ }),
625
+ i && /* @__PURE__ */ A(z, {
626
+ style: [G.error, { color: c.error }],
627
+ children: i
628
+ }),
629
+ o && !i && /* @__PURE__ */ A(z, {
630
+ style: [G.helperText, { color: c.textMuted }],
631
+ children: o
632
+ })
633
+ ]
634
+ });
635
+ }, G = L.create({
636
+ checkbox: {
637
+ alignItems: "center",
638
+ borderRadius: 4,
639
+ borderWidth: 2,
640
+ height: 20,
641
+ justifyContent: "center",
642
+ marginRight: 12,
643
+ width: 20
644
+ },
645
+ checkmark: {
646
+ color: "#FFFFFF",
647
+ fontSize: 14,
648
+ fontWeight: "700"
649
+ },
650
+ container: { marginBottom: 16 },
651
+ error: {
652
+ fontSize: 12,
653
+ marginTop: 4
654
+ },
655
+ helperText: {
656
+ fontSize: 12,
657
+ marginTop: 4
658
+ },
659
+ label: {
660
+ fontSize: 14,
661
+ fontWeight: "500",
662
+ marginBottom: 8
663
+ },
664
+ option: {
665
+ alignItems: "flex-start",
666
+ flexDirection: "row",
667
+ marginBottom: 8
668
+ },
669
+ optionDescription: {
670
+ fontSize: 12,
671
+ marginTop: 2
672
+ },
673
+ optionLabel: { fontSize: 14 },
674
+ optionTextContainer: { flex: 1 }
675
+ }), le = ({ node: e, value: t, setValue: n, error: i, label: a, placeholder: o, helperText: s }) => {
676
+ let [c, l] = k(!1), u = r(), { colors: d } = _(), f = t ? new Date(t) : void 0, { year: p, month: m, today: h } = D(() => {
677
+ let e = f || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
678
+ return r.setHours(0, 0, 0, 0), {
679
+ month: n,
680
+ today: r,
681
+ year: t
682
+ };
683
+ }, [f]), [g, v] = k(p), [y, b] = k(m), x = [
684
+ "January",
685
+ "February",
686
+ "March",
687
+ "April",
688
+ "May",
689
+ "June",
690
+ "July",
691
+ "August",
692
+ "September",
693
+ "October",
694
+ "November",
695
+ "December"
696
+ ], S = D(() => {
697
+ let e = new Date(g, y, 1).getDay(), t = new Date(g, y + 1, 0).getDate(), n = new Date(g, y, 0).getDate(), r = [];
698
+ for (let t = e - 1; t >= 0; t--) r.push({
699
+ date: new Date(g, y - 1, n - t),
700
+ day: n - t,
701
+ isCurrentMonth: !1
702
+ });
703
+ for (let e = 1; e <= t; e++) r.push({
704
+ date: new Date(g, y, e),
705
+ day: e,
706
+ isCurrentMonth: !0
707
+ });
708
+ let i = 42 - r.length;
709
+ for (let e = 1; e <= i; e++) r.push({
710
+ date: new Date(g, y + 1, e),
711
+ day: e,
712
+ isCurrentMonth: !1
713
+ });
714
+ return r;
715
+ }, [g, y]), C = ee((t) => {
716
+ e.data.disablePast && t < h || (n(t.toISOString()), l(!1));
717
+ }, [
718
+ e.data.disablePast,
719
+ h,
720
+ n
721
+ ]), w = () => {
722
+ y === 0 ? (b(11), v(g - 1)) : b(y - 1);
723
+ }, T = () => {
724
+ y === 11 ? (b(0), v(g + 1)) : b(y + 1);
725
+ }, E = () => f ? f.toLocaleDateString() : o || u("renderer.defaultInputs.selectDate"), O = (t) => e.data.disablePast ? t < h : !1, M = (e) => f ? e.getDate() === f.getDate() && e.getMonth() === f.getMonth() && e.getFullYear() === f.getFullYear() : !1;
726
+ return /* @__PURE__ */ j(V, {
727
+ style: K.container,
728
+ children: [
729
+ /* @__PURE__ */ j(z, {
730
+ style: [K.label, { color: d.textSecondary }],
731
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
732
+ style: { color: d.error },
733
+ children: "*"
734
+ })]
735
+ }),
736
+ /* @__PURE__ */ j(B, {
737
+ style: [
738
+ K.trigger,
739
+ {
740
+ backgroundColor: d.input,
741
+ borderColor: d.border
742
+ },
743
+ i && { borderColor: d.error }
744
+ ],
745
+ onPress: () => l(!0),
746
+ activeOpacity: .7,
747
+ children: [/* @__PURE__ */ A(z, {
748
+ style: [
749
+ K.triggerText,
750
+ { color: d.text },
751
+ !t && { color: d.textMuted }
752
+ ],
753
+ numberOfLines: 1,
754
+ children: E()
755
+ }), /* @__PURE__ */ A(z, {
756
+ style: K.icon,
757
+ children: "📅"
758
+ })]
759
+ }),
760
+ /* @__PURE__ */ A(F, {
761
+ visible: c,
762
+ transparent: !0,
763
+ animationType: "fade",
764
+ onRequestClose: () => l(!1),
765
+ children: /* @__PURE__ */ A(B, {
766
+ style: K.modalOverlay,
767
+ activeOpacity: 1,
768
+ onPress: () => l(!1),
769
+ children: /* @__PURE__ */ j(B, {
770
+ style: [K.modalContent, { backgroundColor: d.card }],
771
+ activeOpacity: 1,
772
+ onPress: () => {},
773
+ children: [
774
+ /* @__PURE__ */ j(V, {
775
+ style: [K.modalHeader, { borderBottomColor: d.separator }],
776
+ children: [/* @__PURE__ */ A(z, {
777
+ style: [K.modalTitle, { color: d.text }],
778
+ children: a || e.data.name
779
+ }), /* @__PURE__ */ A(B, {
780
+ onPress: () => l(!1),
781
+ children: /* @__PURE__ */ A(z, {
782
+ style: [K.closeButton, { color: d.textMuted }],
783
+ children: "✕"
784
+ })
785
+ })]
786
+ }),
787
+ /* @__PURE__ */ j(V, {
788
+ style: K.calendarHeader,
789
+ children: [
790
+ /* @__PURE__ */ A(B, {
791
+ onPress: w,
792
+ style: K.navButton,
793
+ children: /* @__PURE__ */ A(z, {
794
+ style: [K.navButtonText, { color: d.primary }],
795
+ children: "‹"
796
+ })
797
+ }),
798
+ /* @__PURE__ */ j(z, {
799
+ style: [K.monthYear, { color: d.text }],
800
+ children: [
801
+ x[y],
802
+ " ",
803
+ g
804
+ ]
805
+ }),
806
+ /* @__PURE__ */ A(B, {
807
+ onPress: T,
808
+ style: K.navButton,
809
+ children: /* @__PURE__ */ A(z, {
810
+ style: [K.navButtonText, { color: d.primary }],
811
+ children: "›"
812
+ })
813
+ })
814
+ ]
815
+ }),
816
+ /* @__PURE__ */ A(V, {
817
+ style: K.weekDays,
818
+ children: [
819
+ "Sun",
820
+ "Mon",
821
+ "Tue",
822
+ "Wed",
823
+ "Thu",
824
+ "Fri",
825
+ "Sat"
826
+ ].map((e) => /* @__PURE__ */ A(z, {
827
+ style: [K.weekDay, { color: d.textMuted }],
828
+ children: e
829
+ }, e))
830
+ }),
831
+ /* @__PURE__ */ A(te, {
832
+ data: S,
833
+ keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
834
+ numColumns: 7,
835
+ scrollEnabled: !1,
836
+ style: K.calendar,
837
+ contentContainerStyle: K.calendarContent,
838
+ renderItem: ({ item: e }) => {
839
+ let t = O(e.date), n = M(e.date);
840
+ return /* @__PURE__ */ A(B, {
841
+ style: [
842
+ K.dayCell,
843
+ !e.isCurrentMonth && K.dayCellOtherMonth,
844
+ n && {
845
+ backgroundColor: d.primary,
846
+ borderRadius: 20
847
+ },
848
+ t && K.dayCellDisabled
849
+ ],
850
+ onPress: () => C(e.date),
851
+ disabled: t,
852
+ activeOpacity: .7,
853
+ children: /* @__PURE__ */ A(z, {
854
+ style: [
855
+ K.dayText,
856
+ { color: d.text },
857
+ !e.isCurrentMonth && { color: d.textMuted },
858
+ n && {
859
+ color: d.background,
860
+ fontWeight: "600"
861
+ },
862
+ t && { color: d.textMuted }
863
+ ],
864
+ children: e.day
865
+ })
866
+ });
867
+ }
868
+ })
869
+ ]
870
+ })
871
+ })
872
+ }),
873
+ i && /* @__PURE__ */ A(z, {
874
+ style: [K.error, { color: d.error }],
875
+ children: i
876
+ }),
877
+ s && !i && /* @__PURE__ */ A(z, {
878
+ style: [K.helperText, { color: d.textMuted }],
879
+ children: s
880
+ })
881
+ ]
882
+ });
883
+ }, K = L.create({
884
+ calendar: {
885
+ flexGrow: 0,
886
+ flexShrink: 1
887
+ },
888
+ calendarContent: { flexGrow: 0 },
889
+ calendarHeader: {
890
+ alignItems: "center",
891
+ flexDirection: "row",
892
+ justifyContent: "space-between",
893
+ marginBottom: 16,
894
+ paddingHorizontal: 8
895
+ },
896
+ closeButton: {
897
+ fontSize: 24,
898
+ fontWeight: "300"
899
+ },
900
+ container: { marginBottom: 16 },
901
+ dayCell: {
902
+ alignItems: "center",
903
+ aspectRatio: 1,
904
+ flex: 1,
905
+ justifyContent: "center",
906
+ margin: 2,
907
+ maxWidth: "14.28%"
908
+ },
909
+ dayCellDisabled: { opacity: .3 },
910
+ dayCellOtherMonth: { opacity: .3 },
911
+ dayText: { fontSize: 14 },
912
+ error: {
913
+ fontSize: 12,
914
+ marginTop: 4
915
+ },
916
+ helperText: {
917
+ fontSize: 12,
918
+ marginTop: 4
919
+ },
920
+ icon: { fontSize: 16 },
921
+ label: {
922
+ fontSize: 14,
923
+ fontWeight: "500",
924
+ marginBottom: 8
925
+ },
926
+ modalContent: {
927
+ borderRadius: 12,
928
+ maxHeight: "80%",
929
+ padding: 16,
930
+ width: "90%"
931
+ },
932
+ modalHeader: {
933
+ alignItems: "center",
934
+ borderBottomWidth: 1,
935
+ flexDirection: "row",
936
+ justifyContent: "space-between",
937
+ marginBottom: 16,
938
+ paddingBottom: 12
939
+ },
940
+ modalOverlay: {
941
+ alignItems: "center",
942
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
943
+ flex: 1,
944
+ justifyContent: "center"
945
+ },
946
+ modalTitle: {
947
+ fontSize: 18,
948
+ fontWeight: "600"
949
+ },
950
+ monthYear: {
951
+ fontSize: 16,
952
+ fontWeight: "600"
953
+ },
954
+ navButton: { padding: 8 },
955
+ navButtonText: {
956
+ fontSize: 24,
957
+ fontWeight: "600"
958
+ },
959
+ trigger: {
960
+ alignItems: "center",
961
+ borderRadius: 6,
962
+ borderWidth: 1,
963
+ flexDirection: "row",
964
+ justifyContent: "space-between",
965
+ paddingHorizontal: 12,
966
+ paddingVertical: 10
967
+ },
968
+ triggerText: {
969
+ flex: 1,
970
+ fontSize: 14
971
+ },
972
+ weekDay: {
973
+ flex: 1,
974
+ fontSize: 12,
975
+ fontWeight: "600",
976
+ maxWidth: "14.28%",
977
+ textAlign: "center"
978
+ },
979
+ weekDays: {
980
+ flexDirection: "row",
981
+ marginBottom: 8
982
+ }
983
+ }), ue = ({ node: e, value: t, setValue: n, error: i, label: a, helperText: o }) => {
984
+ let [s, c] = k(!1), [l, u] = k(!0), d = r(), { colors: f } = _(), p = Array.isArray(t) ? t : [], m = p[0] ? new Date(p[0]) : void 0, h = p[1] ? new Date(p[1]) : void 0, { year: g, month: v, today: y } = D(() => {
985
+ let e = m || /* @__PURE__ */ new Date(), t = e.getFullYear(), n = e.getMonth(), r = /* @__PURE__ */ new Date();
986
+ return r.setHours(0, 0, 0, 0), {
987
+ month: n,
988
+ today: r,
989
+ year: t
990
+ };
991
+ }, [m]), [b, x] = k(g), [S, C] = k(v), w = [
992
+ "January",
993
+ "February",
994
+ "March",
995
+ "April",
996
+ "May",
997
+ "June",
998
+ "July",
999
+ "August",
1000
+ "September",
1001
+ "October",
1002
+ "November",
1003
+ "December"
1004
+ ], T = D(() => {
1005
+ let e = new Date(b, S, 1).getDay(), t = new Date(b, S + 1, 0).getDate(), n = new Date(b, S, 0).getDate(), r = [];
1006
+ for (let t = e - 1; t >= 0; t--) r.push({
1007
+ date: new Date(b, S - 1, n - t),
1008
+ day: n - t,
1009
+ isCurrentMonth: !1
1010
+ });
1011
+ for (let e = 1; e <= t; e++) r.push({
1012
+ date: new Date(b, S, e),
1013
+ day: e,
1014
+ isCurrentMonth: !0
1015
+ });
1016
+ let i = 42 - r.length;
1017
+ for (let e = 1; e <= i; e++) r.push({
1018
+ date: new Date(b, S + 1, e),
1019
+ day: e,
1020
+ isCurrentMonth: !1
1021
+ });
1022
+ return r;
1023
+ }, [b, S]), E = ee((t) => {
1024
+ e.data.disablePast && t < y || (l ? (n([t.toISOString(), h?.toISOString()]), u(!1)) : (n(m && t < m ? [t.toISOString(), m.toISOString()] : [m?.toISOString(), t.toISOString()]), c(!1), u(!0)));
1025
+ }, [
1026
+ e.data.disablePast,
1027
+ y,
1028
+ l,
1029
+ m,
1030
+ h,
1031
+ n
1032
+ ]), O = () => {
1033
+ S === 0 ? (C(11), x(b - 1)) : C(S - 1);
1034
+ }, M = () => {
1035
+ S === 11 ? (C(0), x(b + 1)) : C(S + 1);
1036
+ }, N = () => m && h ? `${m.toLocaleDateString()} - ${h.toLocaleDateString()}` : m ? m.toLocaleDateString() : d("renderer.defaultInputs.selectDateRange"), P = (t) => e.data.disablePast ? t < y : !1, I = (e) => m && h ? e >= m && e <= h : !1, L = (e) => {
1037
+ if (!(m || h)) return !1;
1038
+ let t = m && e.getDate() === m.getDate() && e.getMonth() === m.getMonth() && e.getFullYear() === m.getFullYear(), n = h && e.getDate() === h.getDate() && e.getMonth() === h.getMonth() && e.getFullYear() === h.getFullYear();
1039
+ return t || n;
1040
+ };
1041
+ return /* @__PURE__ */ j(V, {
1042
+ style: q.container,
1043
+ children: [
1044
+ /* @__PURE__ */ j(z, {
1045
+ style: [q.label, { color: f.textSecondary }],
1046
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
1047
+ style: { color: f.error },
1048
+ children: "*"
1049
+ })]
1050
+ }),
1051
+ /* @__PURE__ */ j(B, {
1052
+ style: [
1053
+ q.trigger,
1054
+ {
1055
+ backgroundColor: f.input,
1056
+ borderColor: f.border
1057
+ },
1058
+ i && { borderColor: f.error }
1059
+ ],
1060
+ onPress: () => c(!0),
1061
+ activeOpacity: .7,
1062
+ children: [/* @__PURE__ */ A(z, {
1063
+ style: [
1064
+ q.triggerText,
1065
+ { color: f.text },
1066
+ !m && { color: f.textMuted }
1067
+ ],
1068
+ numberOfLines: 1,
1069
+ children: N()
1070
+ }), /* @__PURE__ */ A(z, {
1071
+ style: q.icon,
1072
+ children: "📅"
1073
+ })]
1074
+ }),
1075
+ /* @__PURE__ */ A(F, {
1076
+ visible: s,
1077
+ transparent: !0,
1078
+ animationType: "fade",
1079
+ onRequestClose: () => c(!1),
1080
+ children: /* @__PURE__ */ A(B, {
1081
+ style: q.modalOverlay,
1082
+ activeOpacity: 1,
1083
+ onPress: () => c(!1),
1084
+ children: /* @__PURE__ */ j(B, {
1085
+ style: [q.modalContent, { backgroundColor: f.card }],
1086
+ activeOpacity: 1,
1087
+ onPress: () => {},
1088
+ children: [
1089
+ /* @__PURE__ */ j(V, {
1090
+ style: [q.modalHeader, { borderBottomColor: f.separator }],
1091
+ children: [/* @__PURE__ */ A(z, {
1092
+ style: [q.modalTitle, { color: f.text }],
1093
+ children: a || e.data.name
1094
+ }), /* @__PURE__ */ A(B, {
1095
+ onPress: () => c(!1),
1096
+ children: /* @__PURE__ */ A(z, {
1097
+ style: [q.closeButton, { color: f.textMuted }],
1098
+ children: "✕"
1099
+ })
1100
+ })]
1101
+ }),
1102
+ /* @__PURE__ */ A(V, {
1103
+ style: [q.rangeIndicator, { backgroundColor: f.primaryLight }],
1104
+ children: /* @__PURE__ */ A(z, {
1105
+ style: [q.rangeIndicatorText, { color: f.primary }],
1106
+ children: d(l ? "renderer.defaultInputs.startDate" : "renderer.defaultInputs.endDate")
1107
+ })
1108
+ }),
1109
+ /* @__PURE__ */ j(V, {
1110
+ style: q.calendarHeader,
1111
+ children: [
1112
+ /* @__PURE__ */ A(B, {
1113
+ onPress: O,
1114
+ style: q.navButton,
1115
+ children: /* @__PURE__ */ A(z, {
1116
+ style: [q.navButtonText, { color: f.primary }],
1117
+ children: "‹"
1118
+ })
1119
+ }),
1120
+ /* @__PURE__ */ j(z, {
1121
+ style: [q.monthYear, { color: f.text }],
1122
+ children: [
1123
+ w[S],
1124
+ " ",
1125
+ b
1126
+ ]
1127
+ }),
1128
+ /* @__PURE__ */ A(B, {
1129
+ onPress: M,
1130
+ style: q.navButton,
1131
+ children: /* @__PURE__ */ A(z, {
1132
+ style: [q.navButtonText, { color: f.primary }],
1133
+ children: "›"
1134
+ })
1135
+ })
1136
+ ]
1137
+ }),
1138
+ /* @__PURE__ */ A(V, {
1139
+ style: q.weekDays,
1140
+ children: [
1141
+ "Sun",
1142
+ "Mon",
1143
+ "Tue",
1144
+ "Wed",
1145
+ "Thu",
1146
+ "Fri",
1147
+ "Sat"
1148
+ ].map((e) => /* @__PURE__ */ A(z, {
1149
+ style: [q.weekDay, { color: f.textMuted }],
1150
+ children: e
1151
+ }, e))
1152
+ }),
1153
+ /* @__PURE__ */ A(te, {
1154
+ data: T,
1155
+ keyExtractor: (e, t) => `${e.date.getTime()}-${t}`,
1156
+ numColumns: 7,
1157
+ scrollEnabled: !1,
1158
+ style: q.calendar,
1159
+ contentContainerStyle: q.calendarContent,
1160
+ renderItem: ({ item: e }) => {
1161
+ let t = P(e.date), n = I(e.date), r = L(e.date);
1162
+ return /* @__PURE__ */ A(B, {
1163
+ style: [
1164
+ q.dayCell,
1165
+ !e.isCurrentMonth && q.dayCellOtherMonth,
1166
+ n && { backgroundColor: f.primaryLight },
1167
+ r && {
1168
+ backgroundColor: f.primary,
1169
+ borderRadius: 20
1170
+ },
1171
+ t && q.dayCellDisabled
1172
+ ],
1173
+ onPress: () => E(e.date),
1174
+ disabled: t,
1175
+ activeOpacity: .7,
1176
+ children: /* @__PURE__ */ A(z, {
1177
+ style: [
1178
+ q.dayText,
1179
+ { color: f.text },
1180
+ !e.isCurrentMonth && { color: f.textMuted },
1181
+ n && { color: f.primary },
1182
+ r && {
1183
+ color: f.background,
1184
+ fontWeight: "600"
1185
+ },
1186
+ t && { color: f.textMuted }
1187
+ ],
1188
+ children: e.day
1189
+ })
1190
+ });
1191
+ }
1192
+ })
1193
+ ]
1194
+ })
1195
+ })
1196
+ }),
1197
+ i && /* @__PURE__ */ A(z, {
1198
+ style: [q.error, { color: f.error }],
1199
+ children: i
1200
+ }),
1201
+ o && !i && /* @__PURE__ */ A(z, {
1202
+ style: [q.helperText, { color: f.textMuted }],
1203
+ children: o
1204
+ })
1205
+ ]
1206
+ });
1207
+ }, q = L.create({
1208
+ calendar: {
1209
+ flexGrow: 0,
1210
+ flexShrink: 1
1211
+ },
1212
+ calendarContent: { flexGrow: 0 },
1213
+ calendarHeader: {
1214
+ alignItems: "center",
1215
+ flexDirection: "row",
1216
+ justifyContent: "space-between",
1217
+ marginBottom: 16,
1218
+ paddingHorizontal: 8
1219
+ },
1220
+ closeButton: {
1221
+ fontSize: 24,
1222
+ fontWeight: "300"
1223
+ },
1224
+ container: { marginBottom: 16 },
1225
+ dayCell: {
1226
+ alignItems: "center",
1227
+ aspectRatio: 1,
1228
+ flex: 1,
1229
+ justifyContent: "center",
1230
+ margin: 2,
1231
+ maxWidth: "14.28%"
1232
+ },
1233
+ dayCellDisabled: { opacity: .3 },
1234
+ dayCellOtherMonth: { opacity: .3 },
1235
+ dayText: { fontSize: 14 },
1236
+ error: {
1237
+ fontSize: 12,
1238
+ marginTop: 4
1239
+ },
1240
+ helperText: {
1241
+ fontSize: 12,
1242
+ marginTop: 4
1243
+ },
1244
+ icon: { fontSize: 16 },
1245
+ label: {
1246
+ fontSize: 14,
1247
+ fontWeight: "500",
1248
+ marginBottom: 8
1249
+ },
1250
+ modalContent: {
1251
+ borderRadius: 12,
1252
+ maxHeight: "80%",
1253
+ padding: 16,
1254
+ width: "90%"
1255
+ },
1256
+ modalHeader: {
1257
+ alignItems: "center",
1258
+ borderBottomWidth: 1,
1259
+ flexDirection: "row",
1260
+ justifyContent: "space-between",
1261
+ marginBottom: 12,
1262
+ paddingBottom: 12
1263
+ },
1264
+ modalOverlay: {
1265
+ alignItems: "center",
1266
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
1267
+ flex: 1,
1268
+ justifyContent: "center"
1269
+ },
1270
+ modalTitle: {
1271
+ fontSize: 18,
1272
+ fontWeight: "600"
1273
+ },
1274
+ monthYear: {
1275
+ fontSize: 16,
1276
+ fontWeight: "600"
1277
+ },
1278
+ navButton: { padding: 8 },
1279
+ navButtonText: {
1280
+ fontSize: 24,
1281
+ fontWeight: "600"
1282
+ },
1283
+ rangeIndicator: {
1284
+ alignItems: "center",
1285
+ borderRadius: 6,
1286
+ marginBottom: 12,
1287
+ paddingVertical: 8
1288
+ },
1289
+ rangeIndicatorText: {
1290
+ fontSize: 14,
1291
+ fontWeight: "600"
1292
+ },
1293
+ trigger: {
1294
+ alignItems: "center",
1295
+ borderRadius: 6,
1296
+ borderWidth: 1,
1297
+ flexDirection: "row",
1298
+ justifyContent: "space-between",
1299
+ paddingHorizontal: 12,
1300
+ paddingVertical: 10
1301
+ },
1302
+ triggerText: {
1303
+ flex: 1,
1304
+ fontSize: 14
1305
+ },
1306
+ weekDay: {
1307
+ flex: 1,
1308
+ fontSize: 12,
1309
+ fontWeight: "600",
1310
+ maxWidth: "14.28%",
1311
+ textAlign: "center"
1312
+ },
1313
+ weekDays: {
1314
+ flexDirection: "row",
1315
+ marginBottom: 8
1316
+ }
1317
+ }), de = ({ node: e, value: t, setValue: n, error: i, label: a, helperText: o }) => {
1318
+ let [s, c] = k(null), [l, u] = k(!0), d = r(), { colors: f } = _(), p = Array.isArray(t) ? t : t ? [t] : [], m = e.data.multiple, h = ee(async () => {
1319
+ if (s) try {
1320
+ let e = (await s({ allowMultiSelection: m })).map((e) => ({
1321
+ data: e.uri,
1322
+ lastModified: Date.now(),
1323
+ name: e.name,
1324
+ size: e.size,
1325
+ type: e.type || "application/octet-stream"
1326
+ }));
1327
+ n(m ? [...p, ...e] : e[0] || null);
1328
+ } catch (e) {
1329
+ e.code !== "DOCUMENT_PICKER_CANCELED" && N.alert("Error", d("renderer.defaultInputs.filePickerError"));
1330
+ }
1331
+ }, [
1332
+ s,
1333
+ p,
1334
+ m,
1335
+ n,
1336
+ d
1337
+ ]), g = ee((e) => {
1338
+ let t = p.filter((t, n) => n !== e);
1339
+ n(t.length > 0 ? t : null);
1340
+ }, [p, n]), v = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1341
+ return E(() => {
1342
+ (async () => {
1343
+ try {
1344
+ let { pick: e } = await import("react-native-document-picker");
1345
+ c(() => e);
1346
+ } catch {
1347
+ c(null);
1348
+ } finally {
1349
+ u(!1);
1350
+ }
1351
+ })();
1352
+ }, []), l ? null : s ? /* @__PURE__ */ j(V, {
1353
+ style: J.container,
1354
+ children: [
1355
+ /* @__PURE__ */ j(z, {
1356
+ style: [J.label, { color: f.textSecondary }],
1357
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
1358
+ style: { color: f.error },
1359
+ children: "*"
1360
+ })]
1361
+ }),
1362
+ p.length > 0 && /* @__PURE__ */ A(V, {
1363
+ style: J.filesList,
1364
+ children: p.map((e, t) => /* @__PURE__ */ j(V, {
1365
+ style: [J.fileItem, {
1366
+ backgroundColor: f.card,
1367
+ borderColor: f.separator
1368
+ }],
1369
+ children: [
1370
+ /* @__PURE__ */ A(V, {
1371
+ style: [J.fileIcon, { backgroundColor: f.muted }],
1372
+ children: /* @__PURE__ */ A(z, {
1373
+ style: J.fileIconText,
1374
+ children: "📄"
1375
+ })
1376
+ }),
1377
+ /* @__PURE__ */ j(V, {
1378
+ style: J.fileInfo,
1379
+ children: [/* @__PURE__ */ A(z, {
1380
+ style: [J.fileName, { color: f.text }],
1381
+ numberOfLines: 1,
1382
+ children: e.name
1383
+ }), e.size > 0 && /* @__PURE__ */ A(z, {
1384
+ style: [J.fileSize, { color: f.textMuted }],
1385
+ children: v(e.size)
1386
+ })]
1387
+ }),
1388
+ /* @__PURE__ */ A(B, {
1389
+ style: J.removeButton,
1390
+ onPress: () => g(t),
1391
+ activeOpacity: .7,
1392
+ children: /* @__PURE__ */ A(z, {
1393
+ style: [J.removeButtonText, { color: f.textMuted }],
1394
+ children: "✕"
1395
+ })
1396
+ })
1397
+ ]
1398
+ }, `${e.name}-${t}`))
1399
+ }),
1400
+ /* @__PURE__ */ A(B, {
1401
+ style: [J.pickButton, {
1402
+ backgroundColor: f.input,
1403
+ borderColor: f.border
1404
+ }],
1405
+ onPress: h,
1406
+ activeOpacity: .7,
1407
+ children: /* @__PURE__ */ A(z, {
1408
+ style: [J.pickButtonText, { color: f.textMuted }],
1409
+ children: p.length === 0 ? d(m ? "renderer.defaultInputs.selectFiles" : "renderer.defaultInputs.selectFile") : d(m ? "renderer.defaultInputs.addMoreFiles" : "renderer.defaultInputs.replaceFile")
1410
+ })
1411
+ }),
1412
+ i && /* @__PURE__ */ A(z, {
1413
+ style: [J.error, { color: f.error }],
1414
+ children: i
1415
+ }),
1416
+ o && !i && /* @__PURE__ */ A(z, {
1417
+ style: [J.helperText, { color: f.textMuted }],
1418
+ children: o
1419
+ })
1420
+ ]
1421
+ }) : /* @__PURE__ */ j(V, {
1422
+ style: J.container,
1423
+ children: [
1424
+ /* @__PURE__ */ j(z, {
1425
+ style: [J.label, { color: f.textSecondary }],
1426
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
1427
+ style: { color: f.error },
1428
+ children: "*"
1429
+ })]
1430
+ }),
1431
+ /* @__PURE__ */ A(V, {
1432
+ style: [J.unavailableContainer, {
1433
+ backgroundColor: f.errorLight,
1434
+ borderColor: f.error
1435
+ }],
1436
+ children: /* @__PURE__ */ A(z, {
1437
+ style: [J.unavailableText, { color: f.error }],
1438
+ children: d("renderer.defaultInputs.filePickerUnavailable")
1439
+ })
1440
+ }),
1441
+ o && /* @__PURE__ */ A(z, {
1442
+ style: [J.helperText, { color: f.textMuted }],
1443
+ children: o
1444
+ })
1445
+ ]
1446
+ });
1447
+ }, J = L.create({
1448
+ container: { marginBottom: 16 },
1449
+ error: {
1450
+ fontSize: 12,
1451
+ marginTop: 4
1452
+ },
1453
+ fileIcon: {
1454
+ alignItems: "center",
1455
+ borderRadius: 6,
1456
+ height: 40,
1457
+ justifyContent: "center",
1458
+ width: 40
1459
+ },
1460
+ fileIconText: { fontSize: 20 },
1461
+ fileInfo: {
1462
+ flex: 1,
1463
+ marginLeft: 12
1464
+ },
1465
+ fileItem: {
1466
+ alignItems: "center",
1467
+ borderRadius: 6,
1468
+ borderWidth: 1,
1469
+ flexDirection: "row",
1470
+ marginBottom: 8,
1471
+ padding: 12
1472
+ },
1473
+ fileName: {
1474
+ fontSize: 14,
1475
+ fontWeight: "500"
1476
+ },
1477
+ fileSize: {
1478
+ fontSize: 12,
1479
+ marginTop: 2
1480
+ },
1481
+ filesList: { marginBottom: 12 },
1482
+ helperText: {
1483
+ fontSize: 12,
1484
+ marginTop: 4
1485
+ },
1486
+ label: {
1487
+ fontSize: 14,
1488
+ fontWeight: "500",
1489
+ marginBottom: 8
1490
+ },
1491
+ pickButton: {
1492
+ alignItems: "center",
1493
+ borderRadius: 6,
1494
+ borderStyle: "dashed",
1495
+ borderWidth: 2,
1496
+ justifyContent: "center",
1497
+ paddingVertical: 16
1498
+ },
1499
+ pickButtonText: {
1500
+ fontSize: 14,
1501
+ fontWeight: "500"
1502
+ },
1503
+ removeButton: { padding: 4 },
1504
+ removeButtonText: { fontSize: 18 },
1505
+ unavailableContainer: {
1506
+ alignItems: "center",
1507
+ borderRadius: 6,
1508
+ borderWidth: 1,
1509
+ justifyContent: "center",
1510
+ paddingVertical: 16
1511
+ },
1512
+ unavailableText: {
1513
+ fontSize: 12,
1514
+ textAlign: "center"
1515
+ }
1516
+ }), fe = (e) => null, pe = (e) => e.replace(/<[^>]*>/g, ""), me = (e) => e.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#x27;/g, "'").replace(/&#x2F;/g, "/"), he = (e, t = {}) => e == null || e === "" ? "" : me(pe(String(e))), ge = 100, _e = (e, t = {}, n = 0, r = /* @__PURE__ */ new WeakSet()) => {
1517
+ if (n > ge) return console.warn(`sanitizeHttpResponse: Maximum depth (${ge}) exceeded.`), typeof e == "string" ? he(e, t) : "[Max Depth Exceeded]";
1518
+ if (e == null) return e;
1519
+ if (typeof e == "string") return he(e, t);
1520
+ if (Array.isArray(e)) return e.map((e) => _e(e, t, n + 1, r));
1521
+ if (typeof e == "object") {
1522
+ if (r.has(e)) return console.warn("sanitizeHttpResponse: Circular reference detected. Breaking cycle to prevent infinite recursion."), "[Circular Reference]";
1523
+ r.add(e);
1524
+ let i = {};
1525
+ for (let [a, o] of Object.entries(e)) i[a] = _e(o, t, n + 1, r);
1526
+ return r.delete(e), i;
1527
+ }
1528
+ return e;
1529
+ }, ve = (e) => {
1530
+ let t = e.matchAll(/{{([\w-]+)}}/g);
1531
+ return Array.from(t, (e) => e[1]);
1532
+ }, ye = (e, t) => ve(e).every((e) => {
1533
+ let n = t[e];
1534
+ return n != null && n !== "";
1535
+ }), be = (e, t, n = !1) => e.replace(/{{([\w-]+)}}/g, (e, r) => {
1536
+ let i = t[r], a = i == null ? "" : String(i);
1537
+ return n ? encodeURIComponent(a) : a;
1538
+ }), xe = ({ node: t, value: i, setValue: o, error: s, label: c, placeholder: l, helperText: u, id: d, name: p }) => {
1539
+ let [m, h] = k(!1), [g, v] = k(null), [y, b] = k([]), [x, S] = k(""), [C, T] = k(!1), { formValues: N, inputNodes: P, headers: I } = n(), { colors: L } = _(), { httpConfig: R } = t.data, H = r(), re = O(!1), ie = O(""), ae = O(R), oe = O(N), U = O(P), se = O(I), W = O(o), ce = O(null), G = O(null), le = D(() => R?.url ? ve(R.url) : [], [R?.url]), K = le.length > 0, ue = D(() => le.map((e) => `${e}:${String(N[e] ?? "")}`).join("|"), [le, N]), q = D(() => R?.url ? K ? ye(R.url, N) : !0 : !1, [
1540
+ R?.url,
1541
+ K,
1542
+ N
1543
+ ]), de = ee(async (t) => {
1544
+ G.current && G.current.abort();
1545
+ let n = new AbortController();
1546
+ G.current = n;
1547
+ let r = ae.current, i = oe.current, a = W.current;
1548
+ if (!r?.url) {
1549
+ v(H("renderer.defaultHttpInput.noUrlConfigured")), G.current = null;
1550
+ return;
1551
+ }
1552
+ if (r.url && !ye(r.url, i)) {
1553
+ G.current = null;
1554
+ return;
1555
+ }
1556
+ h(!0), v(null);
1557
+ try {
1558
+ let o = be(r.url, i, !0), s = r.searchParam && t ? `${o}${o.includes("?") ? "&" : "?"}${r.searchParam}=${encodeURIComponent(t)}` : o, c = (e) => ({
1559
+ key: e.key,
1560
+ value: be(e.value, i)
1561
+ }), l = e([{
1562
+ key: "Content-Type",
1563
+ value: "application/json"
1564
+ }], se.current?.map(c), r.headers?.map(c)), u = [
1565
+ "POST",
1566
+ "PUT",
1567
+ "PATCH"
1568
+ ].includes(r.method || "") ? r.sendAllFormValues ? JSON.stringify(f(i, U.current)) : r.body ? be(r.body, i) : void 0 : void 0, d = setTimeout(() => n.abort(), 3e4), p = await fetch(s, {
1569
+ body: u || void 0,
1570
+ headers: Object.fromEntries(l.filter((e) => e.key && e.value).map((e) => [e.key, e.value])),
1571
+ method: r.method || "GET",
1572
+ signal: n.signal
1573
+ });
1574
+ if (clearTimeout(d), !p.ok) {
1575
+ v(`HTTP Error ${p.status}: ${p.statusText}`), h(!1);
1576
+ return;
1577
+ }
1578
+ let m = _e(await p.json()), g = r.responsePath ? w(m, r.responsePath) : m;
1579
+ if (r.responseMapping && Array.isArray(g)) {
1580
+ let { valueField: e = "value", labelField: t = "label" } = r.responseMapping;
1581
+ b(g.map((n) => ({
1582
+ label: String(w(n, t) || ""),
1583
+ value: String(w(n, e) || "")
1584
+ })));
1585
+ } else a(typeof g == "string" ? g : JSON.stringify(g));
1586
+ } catch (e) {
1587
+ if (e instanceof Error && e.name === "AbortError") return;
1588
+ v(e instanceof Error ? e.message : H("renderer.defaultHttpInput.fetchFailed")), console.error("HTTP Input fetch error:", e);
1589
+ } finally {
1590
+ h(!1), G.current = null;
1591
+ }
1592
+ }, [H]);
1593
+ if (E(() => {
1594
+ ae.current = R, oe.current = N, U.current = P, se.current = I, W.current = o, ce.current = de;
1595
+ }, [
1596
+ R,
1597
+ N,
1598
+ P,
1599
+ I,
1600
+ o,
1601
+ de
1602
+ ]), E(() => () => {
1603
+ G.current && G.current.abort();
1604
+ }, []), E(() => {
1605
+ if (re.current) return;
1606
+ re.current = !0;
1607
+ let e = ae.current, t = oe.current, n = ce.current, r = e?.url && ye(e.url, t);
1608
+ e?.fetchOnMount && r && n && (n(), e.url && (ie.current = ve(e.url).map((e) => `${e}:${String(t[e] ?? "")}`).join("|")));
1609
+ }, []), E(() => {
1610
+ if (!re.current || !K || ie.current === ue || !q) return;
1611
+ let e = setTimeout(() => {
1612
+ de(), ie.current = ue;
1613
+ }, 500);
1614
+ return () => clearTimeout(e);
1615
+ }, [
1616
+ ue,
1617
+ K,
1618
+ q,
1619
+ de
1620
+ ]), E(() => {
1621
+ if (!(R?.searchParam && x)) return;
1622
+ let e = setTimeout(() => {
1623
+ de(x);
1624
+ }, 300);
1625
+ return () => clearTimeout(e);
1626
+ }, [
1627
+ x,
1628
+ R?.searchParam,
1629
+ de
1630
+ ]), R?.responseMapping) {
1631
+ let e = Array.isArray(i) ? i[0] : i, n = y.find((t) => t.value === e);
1632
+ if (R.searchParam) {
1633
+ let r = m && R?.showLoading;
1634
+ return /* @__PURE__ */ j(V, {
1635
+ style: Y.container,
1636
+ children: [
1637
+ /* @__PURE__ */ j(z, {
1638
+ style: [Y.label, { color: L.textSecondary }],
1639
+ children: [c || t.data.name, t.data.required && /* @__PURE__ */ A(z, {
1640
+ style: { color: L.error },
1641
+ children: "*"
1642
+ })]
1643
+ }),
1644
+ /* @__PURE__ */ j(B, {
1645
+ style: [
1646
+ Y.trigger,
1647
+ {
1648
+ backgroundColor: L.input,
1649
+ borderColor: L.border
1650
+ },
1651
+ s && { borderColor: L.error }
1652
+ ],
1653
+ onPress: () => T(!0),
1654
+ activeOpacity: .7,
1655
+ children: [r ? /* @__PURE__ */ j(V, {
1656
+ style: Y.loadingTrigger,
1657
+ children: [/* @__PURE__ */ A(M, {
1658
+ size: "small",
1659
+ color: L.primary
1660
+ }), /* @__PURE__ */ A(z, {
1661
+ style: [Y.triggerText, { color: L.textMuted }],
1662
+ numberOfLines: 1,
1663
+ children: n?.label || l || H("renderer.defaultHttpInput.search")
1664
+ })]
1665
+ }) : /* @__PURE__ */ A(z, {
1666
+ style: [
1667
+ Y.triggerText,
1668
+ { color: L.text },
1669
+ !n && { color: L.textMuted }
1670
+ ],
1671
+ numberOfLines: 1,
1672
+ children: n?.label || l || H("renderer.defaultHttpInput.search")
1673
+ }), /* @__PURE__ */ A(z, {
1674
+ style: [Y.arrow, { color: L.textMuted }],
1675
+ children: "▼"
1676
+ })]
1677
+ }),
1678
+ /* @__PURE__ */ A(F, {
1679
+ visible: C,
1680
+ transparent: !0,
1681
+ animationType: "fade",
1682
+ onRequestClose: () => T(!1),
1683
+ children: /* @__PURE__ */ A(B, {
1684
+ style: Y.modalOverlay,
1685
+ activeOpacity: 1,
1686
+ onPress: () => T(!1),
1687
+ children: /* @__PURE__ */ j(B, {
1688
+ style: [Y.modalContent, { backgroundColor: L.card }],
1689
+ activeOpacity: 1,
1690
+ onPress: () => {},
1691
+ children: [
1692
+ /* @__PURE__ */ j(V, {
1693
+ style: [Y.modalHeader, { borderBottomColor: L.separator }],
1694
+ children: [/* @__PURE__ */ A(z, {
1695
+ style: [Y.modalTitle, { color: L.text }],
1696
+ children: c || t.data.name
1697
+ }), /* @__PURE__ */ A(B, {
1698
+ onPress: () => T(!1),
1699
+ children: /* @__PURE__ */ A(z, {
1700
+ style: [Y.closeButton, { color: L.textMuted }],
1701
+ children: "✕"
1702
+ })
1703
+ })]
1704
+ }),
1705
+ /* @__PURE__ */ A(V, {
1706
+ style: Y.searchContainer,
1707
+ children: /* @__PURE__ */ A(ne, {
1708
+ style: [Y.searchInput, {
1709
+ backgroundColor: L.muted,
1710
+ borderColor: L.border,
1711
+ color: L.text
1712
+ }],
1713
+ placeholder: H("renderer.defaultHttpInput.search"),
1714
+ placeholderTextColor: L.textMuted,
1715
+ value: x,
1716
+ onChangeText: (e) => {
1717
+ S(e), v(null);
1718
+ },
1719
+ autoFocus: !0,
1720
+ autoCapitalize: "none",
1721
+ autoCorrect: !1
1722
+ })
1723
+ }),
1724
+ m ? /* @__PURE__ */ A(V, {
1725
+ style: Y.loadingContainer,
1726
+ children: /* @__PURE__ */ A(M, {
1727
+ size: "small",
1728
+ color: L.primary
1729
+ })
1730
+ }) : g ? /* @__PURE__ */ j(V, {
1731
+ style: Y.errorContainer,
1732
+ children: [/* @__PURE__ */ A(z, {
1733
+ style: [Y.errorText, { color: L.error }],
1734
+ children: g
1735
+ }), /* @__PURE__ */ A(B, {
1736
+ onPress: () => de(x),
1737
+ style: Y.retryButton,
1738
+ children: /* @__PURE__ */ A(z, {
1739
+ style: [Y.retryButtonText, { color: L.primary }],
1740
+ children: H("renderer.defaultHttpInput.retry")
1741
+ })
1742
+ })]
1743
+ }) : /* @__PURE__ */ A(te, {
1744
+ data: y,
1745
+ keyExtractor: (e) => e.value,
1746
+ style: Y.optionsList,
1747
+ contentContainerStyle: Y.optionsListContent,
1748
+ ListEmptyComponent: /* @__PURE__ */ A(V, {
1749
+ style: Y.emptyContainer,
1750
+ children: /* @__PURE__ */ A(z, {
1751
+ style: [Y.emptyText, { color: L.textMuted }],
1752
+ children: H("renderer.defaultHttpInput.noResults")
1753
+ })
1754
+ }),
1755
+ renderItem: ({ item: t }) => {
1756
+ let n = t.value === e;
1757
+ return /* @__PURE__ */ j(B, {
1758
+ style: [Y.option, n && { backgroundColor: L.primaryLight }],
1759
+ onPress: () => {
1760
+ o(t.value), T(!1);
1761
+ },
1762
+ activeOpacity: .7,
1763
+ children: [/* @__PURE__ */ A(z, {
1764
+ style: [Y.optionText, { color: L.text }],
1765
+ children: t.label
1766
+ }), n && /* @__PURE__ */ A(z, {
1767
+ style: [Y.checkmark, { color: L.primary }],
1768
+ children: "✓"
1769
+ })]
1770
+ });
1771
+ }
1772
+ })
1773
+ ]
1774
+ })
1775
+ })
1776
+ }),
1777
+ s && /* @__PURE__ */ A(z, {
1778
+ style: [Y.error, { color: L.error }],
1779
+ children: s
1780
+ }),
1781
+ u && !s && /* @__PURE__ */ A(z, {
1782
+ style: [Y.helperText, { color: L.textMuted }],
1783
+ children: u
1784
+ })
1785
+ ]
1786
+ });
1787
+ }
1788
+ let r = m && R?.showLoading, d = le.filter((e) => {
1789
+ let t = N[e];
1790
+ return t == null || t === "";
1791
+ }), f = d.map((e) => a(e, P) || e), p = y.length === 0 && !r ? g || (d.length > 0 ? `${H("renderer.defaultHttpInput.waitingForRequiredFields")}: ${f.join(", ")}` : H("renderer.defaultHttpInput.noDataAvailable")) : void 0;
1792
+ return /* @__PURE__ */ j(V, {
1793
+ style: Y.container,
1794
+ children: [
1795
+ /* @__PURE__ */ j(z, {
1796
+ style: [Y.label, { color: L.textSecondary }],
1797
+ children: [c || t.data.name, t.data.required && /* @__PURE__ */ A(z, {
1798
+ style: { color: L.error },
1799
+ children: "*"
1800
+ })]
1801
+ }),
1802
+ /* @__PURE__ */ j(B, {
1803
+ style: [
1804
+ Y.trigger,
1805
+ {
1806
+ backgroundColor: L.input,
1807
+ borderColor: L.border
1808
+ },
1809
+ s && { borderColor: L.error },
1810
+ (r || y.length === 0) && { backgroundColor: L.muted }
1811
+ ],
1812
+ onPress: () => T(!0),
1813
+ disabled: r || y.length === 0,
1814
+ activeOpacity: .7,
1815
+ children: [
1816
+ r && /* @__PURE__ */ A(M, {
1817
+ size: "small",
1818
+ color: L.primary,
1819
+ style: Y.triggerLoader
1820
+ }),
1821
+ /* @__PURE__ */ A(z, {
1822
+ style: [
1823
+ Y.triggerText,
1824
+ { color: L.text },
1825
+ !n && { color: L.textMuted }
1826
+ ],
1827
+ numberOfLines: 1,
1828
+ children: n?.label || l || H("renderer.defaultHttpInput.selectOption")
1829
+ }),
1830
+ /* @__PURE__ */ A(z, {
1831
+ style: [Y.arrow, { color: L.textMuted }],
1832
+ children: "▼"
1833
+ })
1834
+ ]
1835
+ }),
1836
+ p && /* @__PURE__ */ A(z, {
1837
+ style: [Y.disabledMessage, { color: L.error }],
1838
+ children: p
1839
+ }),
1840
+ /* @__PURE__ */ A(F, {
1841
+ visible: C,
1842
+ transparent: !0,
1843
+ animationType: "fade",
1844
+ onRequestClose: () => T(!1),
1845
+ children: /* @__PURE__ */ A(B, {
1846
+ style: Y.modalOverlay,
1847
+ activeOpacity: 1,
1848
+ onPress: () => T(!1),
1849
+ children: /* @__PURE__ */ j(B, {
1850
+ style: [Y.modalContent, { backgroundColor: L.card }],
1851
+ activeOpacity: 1,
1852
+ onPress: () => {},
1853
+ children: [/* @__PURE__ */ j(V, {
1854
+ style: [Y.modalHeader, { borderBottomColor: L.separator }],
1855
+ children: [/* @__PURE__ */ A(z, {
1856
+ style: [Y.modalTitle, { color: L.text }],
1857
+ children: c || t.data.name
1858
+ }), /* @__PURE__ */ A(B, {
1859
+ onPress: () => T(!1),
1860
+ children: /* @__PURE__ */ A(z, {
1861
+ style: [Y.closeButton, { color: L.textMuted }],
1862
+ children: "✕"
1863
+ })
1864
+ })]
1865
+ }), /* @__PURE__ */ A(te, {
1866
+ data: y,
1867
+ keyExtractor: (e) => e.value,
1868
+ style: Y.optionsList,
1869
+ contentContainerStyle: Y.optionsListContent,
1870
+ renderItem: ({ item: t }) => {
1871
+ let n = t.value === e;
1872
+ return /* @__PURE__ */ j(B, {
1873
+ style: [Y.option, n && { backgroundColor: L.primaryLight }],
1874
+ onPress: () => {
1875
+ o(t.value), T(!1);
1876
+ },
1877
+ activeOpacity: .7,
1878
+ children: [/* @__PURE__ */ A(z, {
1879
+ style: [Y.optionText, { color: L.text }],
1880
+ children: t.label
1881
+ }), n && /* @__PURE__ */ A(z, {
1882
+ style: [Y.checkmark, { color: L.primary }],
1883
+ children: "✓"
1884
+ })]
1885
+ });
1886
+ }
1887
+ })]
1888
+ })
1889
+ })
1890
+ }),
1891
+ s && /* @__PURE__ */ A(z, {
1892
+ style: [Y.error, { color: L.error }],
1893
+ children: s
1894
+ }),
1895
+ u && !s && /* @__PURE__ */ A(z, {
1896
+ style: [Y.helperText, { color: L.textMuted }],
1897
+ children: u
1898
+ })
1899
+ ]
1900
+ });
1901
+ }
1902
+ return /* @__PURE__ */ j(V, {
1903
+ style: Y.container,
1904
+ children: [
1905
+ /* @__PURE__ */ j(z, {
1906
+ style: [Y.label, { color: L.textSecondary }],
1907
+ children: [c || t.data.name, t.data.required && /* @__PURE__ */ A(z, {
1908
+ style: { color: L.error },
1909
+ children: "*"
1910
+ })]
1911
+ }),
1912
+ /* @__PURE__ */ A(ne, {
1913
+ style: [Y.input, {
1914
+ backgroundColor: L.muted,
1915
+ borderColor: L.border,
1916
+ color: L.textMuted
1917
+ }],
1918
+ value: typeof i == "string" ? i : JSON.stringify(i),
1919
+ editable: !1
1920
+ }),
1921
+ s && /* @__PURE__ */ A(z, {
1922
+ style: [Y.error, { color: L.error }],
1923
+ children: s
1924
+ }),
1925
+ u && !s && /* @__PURE__ */ A(z, {
1926
+ style: [Y.helperText, { color: L.textMuted }],
1927
+ children: u
1928
+ })
1929
+ ]
1930
+ });
1931
+ }, Y = L.create({
1932
+ arrow: { fontSize: 12 },
1933
+ checkmark: {
1934
+ fontSize: 18,
1935
+ fontWeight: "700"
1936
+ },
1937
+ closeButton: {
1938
+ fontSize: 24,
1939
+ fontWeight: "300"
1940
+ },
1941
+ container: { marginBottom: 16 },
1942
+ disabledMessage: {
1943
+ fontSize: 12,
1944
+ marginTop: 4
1945
+ },
1946
+ emptyContainer: {
1947
+ alignItems: "center",
1948
+ paddingVertical: 24
1949
+ },
1950
+ emptyText: { fontSize: 14 },
1951
+ error: {
1952
+ fontSize: 12,
1953
+ marginTop: 4
1954
+ },
1955
+ errorContainer: {
1956
+ alignItems: "center",
1957
+ paddingVertical: 16
1958
+ },
1959
+ errorText: {
1960
+ fontSize: 14,
1961
+ textAlign: "center"
1962
+ },
1963
+ helperText: {
1964
+ fontSize: 12,
1965
+ marginTop: 4
1966
+ },
1967
+ input: {
1968
+ borderRadius: 6,
1969
+ borderWidth: 1,
1970
+ fontSize: 14,
1971
+ paddingHorizontal: 12,
1972
+ paddingVertical: 10
1973
+ },
1974
+ label: {
1975
+ fontSize: 14,
1976
+ fontWeight: "500",
1977
+ marginBottom: 8
1978
+ },
1979
+ loadingContainer: {
1980
+ alignItems: "center",
1981
+ paddingVertical: 24
1982
+ },
1983
+ loadingTrigger: {
1984
+ alignItems: "center",
1985
+ flex: 1,
1986
+ flexDirection: "row",
1987
+ gap: 8
1988
+ },
1989
+ modalContent: {
1990
+ borderRadius: 12,
1991
+ maxHeight: "80%",
1992
+ padding: 16,
1993
+ width: "90%"
1994
+ },
1995
+ modalHeader: {
1996
+ alignItems: "center",
1997
+ borderBottomWidth: 1,
1998
+ flexDirection: "row",
1999
+ justifyContent: "space-between",
2000
+ marginBottom: 12,
2001
+ paddingBottom: 12
2002
+ },
2003
+ modalOverlay: {
2004
+ alignItems: "center",
2005
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2006
+ flex: 1,
2007
+ justifyContent: "center"
2008
+ },
2009
+ modalTitle: {
2010
+ fontSize: 18,
2011
+ fontWeight: "600"
2012
+ },
2013
+ option: {
2014
+ alignItems: "center",
2015
+ borderRadius: 6,
2016
+ flexDirection: "row",
2017
+ justifyContent: "space-between",
2018
+ paddingHorizontal: 12,
2019
+ paddingVertical: 12
2020
+ },
2021
+ optionsList: {
2022
+ flexGrow: 0,
2023
+ flexShrink: 1
2024
+ },
2025
+ optionsListContent: { flexGrow: 0 },
2026
+ optionText: {
2027
+ flex: 1,
2028
+ fontSize: 14
2029
+ },
2030
+ retryButton: { marginTop: 12 },
2031
+ retryButtonText: {
2032
+ fontSize: 14,
2033
+ textDecorationLine: "underline"
2034
+ },
2035
+ searchContainer: { marginBottom: 12 },
2036
+ searchInput: {
2037
+ borderRadius: 6,
2038
+ borderWidth: 1,
2039
+ fontSize: 14,
2040
+ paddingHorizontal: 12,
2041
+ paddingVertical: 10
2042
+ },
2043
+ trigger: {
2044
+ alignItems: "center",
2045
+ borderRadius: 6,
2046
+ borderWidth: 1,
2047
+ flexDirection: "row",
2048
+ justifyContent: "space-between",
2049
+ paddingHorizontal: 12,
2050
+ paddingVertical: 10
2051
+ },
2052
+ triggerLoader: { marginRight: 8 },
2053
+ triggerText: {
2054
+ flex: 1,
2055
+ fontSize: 14
2056
+ }
2057
+ }), Se = ({ node: e, value: t, setValue: n, error: r, label: i, placeholder: a, helperText: o, name: s }) => {
2058
+ let { colors: c } = _(), [l, u] = k(t?.toString() ?? "");
2059
+ return E(() => {
2060
+ u(t?.toString() ?? "");
2061
+ }, [t]), /* @__PURE__ */ j(V, {
2062
+ style: Ce.container,
2063
+ children: [
2064
+ /* @__PURE__ */ j(z, {
2065
+ style: [Ce.label, { color: c.textSecondary }],
2066
+ children: [i || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2067
+ style: { color: c.error },
2068
+ children: "*"
2069
+ })]
2070
+ }),
2071
+ /* @__PURE__ */ A(ne, {
2072
+ style: [
2073
+ Ce.input,
2074
+ {
2075
+ backgroundColor: c.input,
2076
+ borderColor: c.border,
2077
+ color: c.text
2078
+ },
2079
+ r && { borderColor: c.error }
2080
+ ],
2081
+ value: l,
2082
+ onChangeText: (e) => {
2083
+ if (u(e), e.trim() === "") {
2084
+ n(null);
2085
+ return;
2086
+ }
2087
+ let t = Number(e);
2088
+ Number.isNaN(t) || n(t);
2089
+ },
2090
+ placeholder: a,
2091
+ placeholderTextColor: c.textMuted,
2092
+ keyboardType: "numeric",
2093
+ accessibilityLabel: s
2094
+ }),
2095
+ r && /* @__PURE__ */ A(z, {
2096
+ style: [Ce.error, { color: c.error }],
2097
+ children: r
2098
+ }),
2099
+ o && !r && /* @__PURE__ */ A(z, {
2100
+ style: [Ce.helperText, { color: c.textMuted }],
2101
+ children: o
2102
+ })
2103
+ ]
2104
+ });
2105
+ }, Ce = L.create({
2106
+ container: { marginBottom: 16 },
2107
+ error: {
2108
+ fontSize: 12,
2109
+ marginTop: 4
2110
+ },
2111
+ helperText: {
2112
+ fontSize: 12,
2113
+ marginTop: 4
2114
+ },
2115
+ input: {
2116
+ borderRadius: 6,
2117
+ borderWidth: 1,
2118
+ fontSize: 14,
2119
+ paddingHorizontal: 12,
2120
+ paddingVertical: 8
2121
+ },
2122
+ label: {
2123
+ fontSize: 14,
2124
+ fontWeight: "500",
2125
+ marginBottom: 8
2126
+ }
2127
+ }), we = ({ node: e, value: t, setValue: n, error: r, label: i, placeholder: a, helperText: o, name: s }) => {
2128
+ let { colors: c } = _(), [l, u] = k(!1);
2129
+ return /* @__PURE__ */ j(V, {
2130
+ style: Te.container,
2131
+ children: [
2132
+ /* @__PURE__ */ j(z, {
2133
+ style: [Te.label, { color: c.textSecondary }],
2134
+ children: [i || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2135
+ style: { color: c.error },
2136
+ children: "*"
2137
+ })]
2138
+ }),
2139
+ /* @__PURE__ */ j(V, {
2140
+ style: Te.inputWrapper,
2141
+ children: [/* @__PURE__ */ A(ne, {
2142
+ style: [
2143
+ Te.input,
2144
+ {
2145
+ backgroundColor: c.input,
2146
+ borderColor: c.border,
2147
+ color: c.text
2148
+ },
2149
+ r && { borderColor: c.error }
2150
+ ],
2151
+ value: t ?? "",
2152
+ onChangeText: n,
2153
+ placeholder: a,
2154
+ placeholderTextColor: c.textMuted,
2155
+ secureTextEntry: !l,
2156
+ accessibilityLabel: s
2157
+ }), /* @__PURE__ */ A(B, {
2158
+ style: Te.toggleButton,
2159
+ onPress: () => u(!l),
2160
+ activeOpacity: .7,
2161
+ children: /* @__PURE__ */ A(z, {
2162
+ style: [Te.toggleText, { color: c.primary }],
2163
+ children: l ? "Hide" : "Show"
2164
+ })
2165
+ })]
2166
+ }),
2167
+ r && /* @__PURE__ */ A(z, {
2168
+ style: [Te.error, { color: c.error }],
2169
+ children: r
2170
+ }),
2171
+ o && !r && /* @__PURE__ */ A(z, {
2172
+ style: [Te.helperText, { color: c.textMuted }],
2173
+ children: o
2174
+ })
2175
+ ]
2176
+ });
2177
+ }, Te = L.create({
2178
+ container: { marginBottom: 16 },
2179
+ error: {
2180
+ fontSize: 12,
2181
+ marginTop: 4
2182
+ },
2183
+ helperText: {
2184
+ fontSize: 12,
2185
+ marginTop: 4
2186
+ },
2187
+ input: {
2188
+ borderRadius: 6,
2189
+ borderWidth: 1,
2190
+ flex: 1,
2191
+ fontSize: 14,
2192
+ paddingHorizontal: 12,
2193
+ paddingVertical: 8
2194
+ },
2195
+ inputWrapper: {
2196
+ alignItems: "center",
2197
+ flexDirection: "row",
2198
+ position: "relative"
2199
+ },
2200
+ label: {
2201
+ fontSize: 14,
2202
+ fontWeight: "500",
2203
+ marginBottom: 8
2204
+ },
2205
+ toggleButton: {
2206
+ paddingHorizontal: 12,
2207
+ paddingVertical: 8,
2208
+ position: "absolute",
2209
+ right: 0
2210
+ },
2211
+ toggleText: {
2212
+ fontSize: 12,
2213
+ fontWeight: "600"
2214
+ }
2215
+ }), Ee = ({ node: e, value: t, setValue: n, error: i, label: a, helperText: o }) => {
2216
+ let s = r(), { colors: c } = _(), l = e.data.options || [], u = t || "", d = e.data.variant !== "default", f = (e) => {
2217
+ n(e);
2218
+ };
2219
+ return /* @__PURE__ */ j(V, {
2220
+ style: X.container,
2221
+ children: [
2222
+ /* @__PURE__ */ j(z, {
2223
+ style: [X.label, { color: c.textSecondary }],
2224
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2225
+ style: { color: c.error },
2226
+ children: "*"
2227
+ })]
2228
+ }),
2229
+ l.map((e) => {
2230
+ let t = u === e.value, n = s(e.label) || e.value, r = s(e.description);
2231
+ return d ? /* @__PURE__ */ j(B, {
2232
+ style: [
2233
+ X.card,
2234
+ {
2235
+ backgroundColor: c.input,
2236
+ borderColor: c.border
2237
+ },
2238
+ t && {
2239
+ backgroundColor: `${c.primary}10`,
2240
+ borderColor: c.primary
2241
+ },
2242
+ e.disabled && { opacity: .5 }
2243
+ ],
2244
+ onPress: () => f(e.value),
2245
+ disabled: e.disabled,
2246
+ activeOpacity: .7,
2247
+ children: [
2248
+ e.image && /* @__PURE__ */ A(P, {
2249
+ source: { uri: e.image },
2250
+ style: X.cardImage
2251
+ }),
2252
+ /* @__PURE__ */ j(V, {
2253
+ style: X.cardTextContainer,
2254
+ children: [/* @__PURE__ */ A(z, {
2255
+ style: [X.cardLabel, { color: c.textSecondary }],
2256
+ children: n
2257
+ }), r && /* @__PURE__ */ A(z, {
2258
+ style: [X.cardDescription, { color: c.textMuted }],
2259
+ children: r
2260
+ })]
2261
+ }),
2262
+ /* @__PURE__ */ A(V, {
2263
+ style: [
2264
+ X.radio,
2265
+ X.cardRadio,
2266
+ {
2267
+ backgroundColor: c.input,
2268
+ borderColor: c.border
2269
+ },
2270
+ t && { borderColor: c.primary }
2271
+ ],
2272
+ children: t && /* @__PURE__ */ A(V, { style: [X.radioInner, { backgroundColor: c.primary }] })
2273
+ })
2274
+ ]
2275
+ }, e.value) : /* @__PURE__ */ j(B, {
2276
+ style: X.option,
2277
+ onPress: () => f(e.value),
2278
+ disabled: e.disabled,
2279
+ activeOpacity: .7,
2280
+ children: [
2281
+ /* @__PURE__ */ A(V, {
2282
+ style: [
2283
+ X.radio,
2284
+ {
2285
+ backgroundColor: c.input,
2286
+ borderColor: c.border
2287
+ },
2288
+ t && { borderColor: c.primary }
2289
+ ],
2290
+ children: t && /* @__PURE__ */ A(V, { style: [X.radioInner, { backgroundColor: c.primary }] })
2291
+ }),
2292
+ e.image && /* @__PURE__ */ A(P, {
2293
+ source: { uri: e.image },
2294
+ style: X.image
2295
+ }),
2296
+ /* @__PURE__ */ j(V, {
2297
+ style: X.optionTextContainer,
2298
+ children: [/* @__PURE__ */ A(z, {
2299
+ style: [
2300
+ X.optionLabel,
2301
+ { color: c.textSecondary },
2302
+ e.disabled && { color: c.textMuted }
2303
+ ],
2304
+ children: n
2305
+ }), r && /* @__PURE__ */ A(z, {
2306
+ style: [X.optionDescription, { color: c.textMuted }],
2307
+ children: r
2308
+ })]
2309
+ })
2310
+ ]
2311
+ }, e.value);
2312
+ }),
2313
+ i && /* @__PURE__ */ A(z, {
2314
+ style: [X.error, { color: c.error }],
2315
+ children: i
2316
+ }),
2317
+ o && !i && /* @__PURE__ */ A(z, {
2318
+ style: [X.helperText, { color: c.textMuted }],
2319
+ children: o
2320
+ })
2321
+ ]
2322
+ });
2323
+ }, X = L.create({
2324
+ card: {
2325
+ alignItems: "center",
2326
+ borderRadius: 8,
2327
+ borderWidth: 1,
2328
+ flexDirection: "row",
2329
+ marginBottom: 8,
2330
+ padding: 16
2331
+ },
2332
+ cardDescription: {
2333
+ fontSize: 12,
2334
+ marginTop: 4
2335
+ },
2336
+ cardImage: {
2337
+ borderRadius: 4,
2338
+ height: 40,
2339
+ marginRight: 12,
2340
+ width: 40
2341
+ },
2342
+ cardLabel: {
2343
+ fontSize: 14,
2344
+ fontWeight: "500"
2345
+ },
2346
+ cardRadio: {
2347
+ marginLeft: 12,
2348
+ marginRight: 0
2349
+ },
2350
+ cardTextContainer: { flex: 1 },
2351
+ container: { marginBottom: 16 },
2352
+ error: {
2353
+ fontSize: 12,
2354
+ marginTop: 4
2355
+ },
2356
+ helperText: {
2357
+ fontSize: 12,
2358
+ marginTop: 4
2359
+ },
2360
+ image: {
2361
+ borderRadius: 4,
2362
+ height: 32,
2363
+ marginRight: 8,
2364
+ width: 32
2365
+ },
2366
+ label: {
2367
+ fontSize: 14,
2368
+ fontWeight: "500",
2369
+ marginBottom: 8
2370
+ },
2371
+ option: {
2372
+ alignItems: "center",
2373
+ flexDirection: "row",
2374
+ marginBottom: 8
2375
+ },
2376
+ optionDescription: {
2377
+ fontSize: 12,
2378
+ marginTop: 2
2379
+ },
2380
+ optionLabel: { fontSize: 14 },
2381
+ optionTextContainer: { flex: 1 },
2382
+ radio: {
2383
+ alignItems: "center",
2384
+ borderRadius: 10,
2385
+ borderWidth: 2,
2386
+ height: 20,
2387
+ justifyContent: "center",
2388
+ marginRight: 12,
2389
+ width: 20
2390
+ },
2391
+ radioInner: {
2392
+ borderRadius: 5,
2393
+ height: 10,
2394
+ width: 10
2395
+ }
2396
+ }), De = ({ node: e, value: t, setValue: n, error: i, label: a, placeholder: o, helperText: s }) => {
2397
+ let [c, l] = k(!1), u = r(), { colors: d } = _(), f = e.data.options || [], p = e.data.multiple, m = Array.isArray(t) ? t : t ? [t] : [], h = (e) => {
2398
+ p ? n(m.includes(e) ? m.filter((t) => t !== e) : [...m, e]) : (n(e), l(!1));
2399
+ };
2400
+ return /* @__PURE__ */ j(V, {
2401
+ style: Z.container,
2402
+ children: [
2403
+ /* @__PURE__ */ j(z, {
2404
+ style: [Z.label, { color: d.textSecondary }],
2405
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2406
+ style: { color: d.error },
2407
+ children: "*"
2408
+ })]
2409
+ }),
2410
+ /* @__PURE__ */ j(B, {
2411
+ style: [
2412
+ Z.trigger,
2413
+ {
2414
+ backgroundColor: d.input,
2415
+ borderColor: d.border
2416
+ },
2417
+ i && { borderColor: d.error }
2418
+ ],
2419
+ onPress: () => l(!0),
2420
+ activeOpacity: .7,
2421
+ children: [/* @__PURE__ */ A(z, {
2422
+ style: [
2423
+ Z.triggerText,
2424
+ { color: d.text },
2425
+ m.length === 0 && { color: d.textMuted }
2426
+ ],
2427
+ children: (() => {
2428
+ if (m.length === 0) return o || "Select...";
2429
+ if (p) return f.filter((e) => m.includes(e.value)).map((e) => u(e.label) || e.value).join(", ");
2430
+ let e = f.find((e) => e.value === m[0]);
2431
+ return e ? u(e.label) || e.value : o || "Select...";
2432
+ })()
2433
+ }), /* @__PURE__ */ A(z, {
2434
+ style: [Z.arrow, { color: d.textMuted }],
2435
+ children: "▼"
2436
+ })]
2437
+ }),
2438
+ /* @__PURE__ */ A(F, {
2439
+ visible: c,
2440
+ transparent: !0,
2441
+ animationType: "fade",
2442
+ onRequestClose: () => l(!1),
2443
+ children: /* @__PURE__ */ A(B, {
2444
+ style: Z.modalOverlay,
2445
+ activeOpacity: 1,
2446
+ onPress: () => l(!1),
2447
+ children: /* @__PURE__ */ j(V, {
2448
+ style: [Z.modalContent, { backgroundColor: d.card }],
2449
+ onStartShouldSetResponder: () => !0,
2450
+ children: [
2451
+ /* @__PURE__ */ j(V, {
2452
+ style: [Z.modalHeader, { borderBottomColor: d.border }],
2453
+ children: [/* @__PURE__ */ A(z, {
2454
+ style: [Z.modalTitle, { color: d.text }],
2455
+ children: a || e.data.name
2456
+ }), /* @__PURE__ */ A(B, {
2457
+ onPress: () => l(!1),
2458
+ children: /* @__PURE__ */ A(z, {
2459
+ style: [Z.closeButton, { color: d.textMuted }],
2460
+ children: "✕"
2461
+ })
2462
+ })]
2463
+ }),
2464
+ /* @__PURE__ */ A(I, {
2465
+ style: Z.optionsList,
2466
+ children: f.map((e) => {
2467
+ let t = m.includes(e.value);
2468
+ return /* @__PURE__ */ j(B, {
2469
+ style: [Z.option, t && { backgroundColor: `${d.primary}20` }],
2470
+ onPress: () => h(e.value),
2471
+ disabled: e.disabled,
2472
+ activeOpacity: .7,
2473
+ children: [/* @__PURE__ */ A(z, {
2474
+ style: [
2475
+ Z.optionText,
2476
+ { color: d.textSecondary },
2477
+ e.disabled && { color: d.textMuted }
2478
+ ],
2479
+ children: u(e.label) || e.value
2480
+ }), t && /* @__PURE__ */ A(z, {
2481
+ style: [Z.checkmark, { color: d.primary }],
2482
+ children: "✓"
2483
+ })]
2484
+ }, e.value);
2485
+ })
2486
+ }),
2487
+ p && /* @__PURE__ */ A(B, {
2488
+ style: [Z.doneButton, { backgroundColor: d.primary }],
2489
+ onPress: () => l(!1),
2490
+ children: /* @__PURE__ */ A(z, {
2491
+ style: Z.doneButtonText,
2492
+ children: "Done"
2493
+ })
2494
+ })
2495
+ ]
2496
+ })
2497
+ })
2498
+ }),
2499
+ i && /* @__PURE__ */ A(z, {
2500
+ style: [Z.error, { color: d.error }],
2501
+ children: i
2502
+ }),
2503
+ s && !i && /* @__PURE__ */ A(z, {
2504
+ style: [Z.helperText, { color: d.textMuted }],
2505
+ children: s
2506
+ })
2507
+ ]
2508
+ });
2509
+ }, Z = L.create({
2510
+ arrow: { fontSize: 12 },
2511
+ checkmark: {
2512
+ fontSize: 18,
2513
+ fontWeight: "700"
2514
+ },
2515
+ closeButton: {
2516
+ fontSize: 24,
2517
+ fontWeight: "300"
2518
+ },
2519
+ container: { marginBottom: 16 },
2520
+ doneButton: {
2521
+ alignItems: "center",
2522
+ borderRadius: 6,
2523
+ marginTop: 12,
2524
+ paddingVertical: 12
2525
+ },
2526
+ doneButtonText: {
2527
+ color: "#FFFFFF",
2528
+ fontSize: 16,
2529
+ fontWeight: "600"
2530
+ },
2531
+ error: {
2532
+ fontSize: 12,
2533
+ marginTop: 4
2534
+ },
2535
+ helperText: {
2536
+ fontSize: 12,
2537
+ marginTop: 4
2538
+ },
2539
+ label: {
2540
+ fontSize: 14,
2541
+ fontWeight: "500",
2542
+ marginBottom: 8
2543
+ },
2544
+ modalContent: {
2545
+ borderRadius: 12,
2546
+ maxHeight: "80%",
2547
+ padding: 16,
2548
+ width: "90%"
2549
+ },
2550
+ modalHeader: {
2551
+ alignItems: "center",
2552
+ borderBottomWidth: 1,
2553
+ flexDirection: "row",
2554
+ justifyContent: "space-between",
2555
+ marginBottom: 12,
2556
+ paddingBottom: 12
2557
+ },
2558
+ modalOverlay: {
2559
+ alignItems: "center",
2560
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2561
+ flex: 1,
2562
+ justifyContent: "center"
2563
+ },
2564
+ modalTitle: {
2565
+ fontSize: 18,
2566
+ fontWeight: "600"
2567
+ },
2568
+ option: {
2569
+ alignItems: "center",
2570
+ borderRadius: 6,
2571
+ flexDirection: "row",
2572
+ justifyContent: "space-between",
2573
+ paddingHorizontal: 12,
2574
+ paddingVertical: 12
2575
+ },
2576
+ optionsList: { maxHeight: 300 },
2577
+ optionText: { fontSize: 14 },
2578
+ trigger: {
2579
+ alignItems: "center",
2580
+ borderRadius: 6,
2581
+ borderWidth: 1,
2582
+ flexDirection: "row",
2583
+ justifyContent: "space-between",
2584
+ paddingHorizontal: 12,
2585
+ paddingVertical: 10
2586
+ },
2587
+ triggerText: {
2588
+ flex: 1,
2589
+ fontSize: 14
2590
+ }
2591
+ }), Oe = ({ node: e, value: t, setValue: n, error: r, label: i, helperText: a }) => {
2592
+ let { colors: o } = _(), s = !!t;
2593
+ return /* @__PURE__ */ j(V, {
2594
+ style: ke.container,
2595
+ children: [
2596
+ /* @__PURE__ */ j(V, {
2597
+ style: ke.row,
2598
+ children: [/* @__PURE__ */ A(V, {
2599
+ style: ke.labelContainer,
2600
+ children: /* @__PURE__ */ j(z, {
2601
+ style: [ke.label, { color: o.textSecondary }],
2602
+ children: [i || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2603
+ style: { color: o.error },
2604
+ children: "*"
2605
+ })]
2606
+ })
2607
+ }), /* @__PURE__ */ A(R, {
2608
+ trackColor: {
2609
+ false: o.border,
2610
+ true: `${o.primary}80`
2611
+ },
2612
+ thumbColor: s ? o.primary : o.card,
2613
+ ios_backgroundColor: o.border,
2614
+ onValueChange: n,
2615
+ value: s
2616
+ })]
2617
+ }),
2618
+ r && /* @__PURE__ */ A(z, {
2619
+ style: [ke.error, { color: o.error }],
2620
+ children: r
2621
+ }),
2622
+ a && !r && /* @__PURE__ */ A(z, {
2623
+ style: [ke.helperText, { color: o.textMuted }],
2624
+ children: a
2625
+ })
2626
+ ]
2627
+ });
2628
+ }, ke = L.create({
2629
+ container: { marginBottom: 16 },
2630
+ error: {
2631
+ fontSize: 12,
2632
+ marginTop: 4
2633
+ },
2634
+ helperText: {
2635
+ fontSize: 12,
2636
+ marginTop: 4
2637
+ },
2638
+ label: {
2639
+ fontSize: 14,
2640
+ fontWeight: "500"
2641
+ },
2642
+ labelContainer: { flex: 1 },
2643
+ row: {
2644
+ alignItems: "center",
2645
+ flexDirection: "row",
2646
+ justifyContent: "space-between"
2647
+ }
2648
+ }), Ae = ({ node: e, value: t, setValue: n, error: r, label: i, placeholder: a, helperText: o, name: s }) => {
2649
+ let { colors: c } = _();
2650
+ return /* @__PURE__ */ j(V, {
2651
+ style: je.container,
2652
+ children: [
2653
+ /* @__PURE__ */ j(z, {
2654
+ style: [je.label, { color: c.textSecondary }],
2655
+ children: [i || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2656
+ style: { color: c.error },
2657
+ children: "*"
2658
+ })]
2659
+ }),
2660
+ /* @__PURE__ */ A(ne, {
2661
+ style: [
2662
+ je.textarea,
2663
+ {
2664
+ backgroundColor: c.input,
2665
+ borderColor: c.border,
2666
+ color: c.text
2667
+ },
2668
+ r && { borderColor: c.error }
2669
+ ],
2670
+ value: t ?? "",
2671
+ onChangeText: n,
2672
+ placeholder: a,
2673
+ placeholderTextColor: c.textMuted,
2674
+ multiline: !0,
2675
+ numberOfLines: 4,
2676
+ textAlignVertical: "top",
2677
+ accessibilityLabel: s
2678
+ }),
2679
+ r && /* @__PURE__ */ A(z, {
2680
+ style: [je.error, { color: c.error }],
2681
+ children: r
2682
+ }),
2683
+ o && !r && /* @__PURE__ */ A(z, {
2684
+ style: [je.helperText, { color: c.textMuted }],
2685
+ children: o
2686
+ })
2687
+ ]
2688
+ });
2689
+ }, je = L.create({
2690
+ container: { marginBottom: 16 },
2691
+ error: {
2692
+ fontSize: 12,
2693
+ marginTop: 4
2694
+ },
2695
+ helperText: {
2696
+ fontSize: 12,
2697
+ marginTop: 4
2698
+ },
2699
+ label: {
2700
+ fontSize: 14,
2701
+ fontWeight: "500",
2702
+ marginBottom: 8
2703
+ },
2704
+ textarea: {
2705
+ borderRadius: 6,
2706
+ borderWidth: 1,
2707
+ fontSize: 14,
2708
+ minHeight: 100,
2709
+ paddingHorizontal: 12,
2710
+ paddingVertical: 8
2711
+ }
2712
+ }), Me = ({ node: e, value: t, setValue: n, error: r, label: i, placeholder: a, helperText: o, name: s }) => {
2713
+ let { colors: c } = _();
2714
+ return /* @__PURE__ */ j(V, {
2715
+ style: Ne.container,
2716
+ children: [
2717
+ /* @__PURE__ */ j(z, {
2718
+ style: [Ne.label, { color: c.textSecondary }],
2719
+ children: [i || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2720
+ style: { color: c.error },
2721
+ children: "*"
2722
+ })]
2723
+ }),
2724
+ /* @__PURE__ */ A(ne, {
2725
+ style: [
2726
+ Ne.input,
2727
+ {
2728
+ backgroundColor: c.input,
2729
+ borderColor: c.border,
2730
+ color: c.text
2731
+ },
2732
+ r && { borderColor: c.error }
2733
+ ],
2734
+ value: t ?? "",
2735
+ onChangeText: n,
2736
+ placeholder: a,
2737
+ placeholderTextColor: c.textMuted,
2738
+ accessibilityLabel: s
2739
+ }),
2740
+ r && /* @__PURE__ */ A(z, {
2741
+ style: [Ne.error, { color: c.error }],
2742
+ children: r
2743
+ }),
2744
+ o && !r && /* @__PURE__ */ A(z, {
2745
+ style: [Ne.helperText, { color: c.textMuted }],
2746
+ children: o
2747
+ })
2748
+ ]
2749
+ });
2750
+ }, Ne = L.create({
2751
+ container: { marginBottom: 16 },
2752
+ error: {
2753
+ fontSize: 12,
2754
+ marginTop: 4
2755
+ },
2756
+ helperText: {
2757
+ fontSize: 12,
2758
+ marginTop: 4
2759
+ },
2760
+ input: {
2761
+ borderRadius: 6,
2762
+ borderWidth: 1,
2763
+ fontSize: 14,
2764
+ paddingHorizontal: 12,
2765
+ paddingVertical: 8
2766
+ },
2767
+ label: {
2768
+ fontSize: 14,
2769
+ fontWeight: "500",
2770
+ marginBottom: 8
2771
+ }
2772
+ }), Pe = ({ node: e, value: t, setValue: n, error: r, label: i, placeholder: a, helperText: o }) => {
2773
+ let [s, c] = k(!1), { colors: l } = _(), u = (t || "").split(":"), d = Number.parseInt(u[0], 10), f = Number.parseInt(u[1], 10), p = Number.isNaN(d) ? 0 : d, m = Number.isNaN(f) ? 0 : f, [h, g] = k(p || 0), [v, y] = k(m || 0), b = O(null), x = O(null), S = Array.from({ length: 24 }, (e, t) => t), C = Array.from({ length: 60 }, (e, t) => t), w = () => t || a || "Select time", T = ee(() => {
2774
+ n(`${String(h).padStart(2, "0")}:${String(v).padStart(2, "0")}`), c(!1);
2775
+ }, [
2776
+ h,
2777
+ v,
2778
+ n
2779
+ ]);
2780
+ return /* @__PURE__ */ j(V, {
2781
+ style: Q.container,
2782
+ children: [
2783
+ /* @__PURE__ */ j(z, {
2784
+ style: [Q.label, { color: l.textSecondary }],
2785
+ children: [i || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
2786
+ style: { color: l.error },
2787
+ children: "*"
2788
+ })]
2789
+ }),
2790
+ /* @__PURE__ */ j(B, {
2791
+ style: [
2792
+ Q.trigger,
2793
+ {
2794
+ backgroundColor: l.input,
2795
+ borderColor: l.border
2796
+ },
2797
+ r && { borderColor: l.error }
2798
+ ],
2799
+ onPress: () => {
2800
+ g(p || 0), y(m || 0), c(!0);
2801
+ },
2802
+ activeOpacity: .7,
2803
+ children: [/* @__PURE__ */ A(z, {
2804
+ style: [
2805
+ Q.triggerText,
2806
+ { color: l.text },
2807
+ !t && { color: l.textMuted }
2808
+ ],
2809
+ numberOfLines: 1,
2810
+ children: w()
2811
+ }), /* @__PURE__ */ A(z, {
2812
+ style: Q.icon,
2813
+ children: "🕐"
2814
+ })]
2815
+ }),
2816
+ /* @__PURE__ */ A(F, {
2817
+ visible: s,
2818
+ transparent: !0,
2819
+ animationType: "fade",
2820
+ onRequestClose: () => c(!1),
2821
+ children: /* @__PURE__ */ A(B, {
2822
+ style: Q.modalOverlay,
2823
+ activeOpacity: 1,
2824
+ onPress: () => c(!1),
2825
+ children: /* @__PURE__ */ j(B, {
2826
+ style: [Q.modalContent, { backgroundColor: l.card }],
2827
+ activeOpacity: 1,
2828
+ onPress: () => {},
2829
+ children: [
2830
+ /* @__PURE__ */ j(V, {
2831
+ style: [Q.modalHeader, { borderBottomColor: l.separator }],
2832
+ children: [/* @__PURE__ */ A(z, {
2833
+ style: [Q.modalTitle, { color: l.text }],
2834
+ children: i || e.data.name
2835
+ }), /* @__PURE__ */ A(B, {
2836
+ onPress: () => c(!1),
2837
+ children: /* @__PURE__ */ A(z, {
2838
+ style: [Q.closeButton, { color: l.textMuted }],
2839
+ children: "✕"
2840
+ })
2841
+ })]
2842
+ }),
2843
+ /* @__PURE__ */ j(V, {
2844
+ style: Q.pickerContainer,
2845
+ children: [
2846
+ /* @__PURE__ */ j(V, {
2847
+ style: Q.pickerColumn,
2848
+ children: [/* @__PURE__ */ A(z, {
2849
+ style: [Q.pickerLabel, { color: l.textMuted }],
2850
+ children: "Hour"
2851
+ }), /* @__PURE__ */ A(I, {
2852
+ ref: b,
2853
+ style: Q.picker,
2854
+ contentContainerStyle: Q.pickerContent,
2855
+ showsVerticalScrollIndicator: !1,
2856
+ children: S.map((e) => /* @__PURE__ */ A(B, {
2857
+ style: [Q.pickerItem, h === e && { backgroundColor: l.primary }],
2858
+ onPress: () => g(e),
2859
+ activeOpacity: .7,
2860
+ children: /* @__PURE__ */ A(z, {
2861
+ style: [
2862
+ Q.pickerItemText,
2863
+ { color: l.text },
2864
+ h === e && {
2865
+ color: l.background,
2866
+ fontWeight: "600"
2867
+ }
2868
+ ],
2869
+ children: String(e).padStart(2, "0")
2870
+ })
2871
+ }, e))
2872
+ })]
2873
+ }),
2874
+ /* @__PURE__ */ A(z, {
2875
+ style: [Q.pickerSeparator, { color: l.text }],
2876
+ children: ":"
2877
+ }),
2878
+ /* @__PURE__ */ j(V, {
2879
+ style: Q.pickerColumn,
2880
+ children: [/* @__PURE__ */ A(z, {
2881
+ style: [Q.pickerLabel, { color: l.textMuted }],
2882
+ children: "Minute"
2883
+ }), /* @__PURE__ */ A(I, {
2884
+ ref: x,
2885
+ style: Q.picker,
2886
+ contentContainerStyle: Q.pickerContent,
2887
+ showsVerticalScrollIndicator: !1,
2888
+ children: C.map((e) => /* @__PURE__ */ A(B, {
2889
+ style: [Q.pickerItem, v === e && { backgroundColor: l.primary }],
2890
+ onPress: () => y(e),
2891
+ activeOpacity: .7,
2892
+ children: /* @__PURE__ */ A(z, {
2893
+ style: [
2894
+ Q.pickerItemText,
2895
+ { color: l.text },
2896
+ v === e && {
2897
+ color: l.background,
2898
+ fontWeight: "600"
2899
+ }
2900
+ ],
2901
+ children: String(e).padStart(2, "0")
2902
+ })
2903
+ }, e))
2904
+ })]
2905
+ })
2906
+ ]
2907
+ }),
2908
+ /* @__PURE__ */ A(B, {
2909
+ style: [Q.confirmButton, { backgroundColor: l.primary }],
2910
+ onPress: T,
2911
+ activeOpacity: .7,
2912
+ children: /* @__PURE__ */ A(z, {
2913
+ style: [Q.confirmButtonText, { color: l.background }],
2914
+ children: "Confirm"
2915
+ })
2916
+ })
2917
+ ]
2918
+ })
2919
+ })
2920
+ }),
2921
+ r && /* @__PURE__ */ A(z, {
2922
+ style: [Q.error, { color: l.error }],
2923
+ children: r
2924
+ }),
2925
+ o && !r && /* @__PURE__ */ A(z, {
2926
+ style: [Q.helperText, { color: l.textMuted }],
2927
+ children: o
2928
+ })
2929
+ ]
2930
+ });
2931
+ }, Q = L.create({
2932
+ closeButton: {
2933
+ fontSize: 24,
2934
+ fontWeight: "300"
2935
+ },
2936
+ confirmButton: {
2937
+ alignItems: "center",
2938
+ borderRadius: 6,
2939
+ marginTop: 16,
2940
+ paddingVertical: 12
2941
+ },
2942
+ confirmButtonText: {
2943
+ fontSize: 16,
2944
+ fontWeight: "600"
2945
+ },
2946
+ container: { marginBottom: 16 },
2947
+ error: {
2948
+ fontSize: 12,
2949
+ marginTop: 4
2950
+ },
2951
+ helperText: {
2952
+ fontSize: 12,
2953
+ marginTop: 4
2954
+ },
2955
+ icon: { fontSize: 16 },
2956
+ label: {
2957
+ fontSize: 14,
2958
+ fontWeight: "500",
2959
+ marginBottom: 8
2960
+ },
2961
+ modalContent: {
2962
+ borderRadius: 12,
2963
+ padding: 16,
2964
+ width: "80%"
2965
+ },
2966
+ modalHeader: {
2967
+ alignItems: "center",
2968
+ borderBottomWidth: 1,
2969
+ flexDirection: "row",
2970
+ justifyContent: "space-between",
2971
+ marginBottom: 16,
2972
+ paddingBottom: 12
2973
+ },
2974
+ modalOverlay: {
2975
+ alignItems: "center",
2976
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
2977
+ flex: 1,
2978
+ justifyContent: "center"
2979
+ },
2980
+ modalTitle: {
2981
+ fontSize: 18,
2982
+ fontWeight: "600"
2983
+ },
2984
+ picker: { maxHeight: 200 },
2985
+ pickerColumn: { flex: 1 },
2986
+ pickerContainer: {
2987
+ alignItems: "center",
2988
+ flexDirection: "row",
2989
+ gap: 8
2990
+ },
2991
+ pickerContent: { paddingVertical: 8 },
2992
+ pickerItem: {
2993
+ alignItems: "center",
2994
+ borderRadius: 6,
2995
+ marginVertical: 2,
2996
+ paddingVertical: 10
2997
+ },
2998
+ pickerItemText: { fontSize: 18 },
2999
+ pickerLabel: {
3000
+ fontSize: 12,
3001
+ fontWeight: "600",
3002
+ marginBottom: 8,
3003
+ textAlign: "center"
3004
+ },
3005
+ pickerSeparator: {
3006
+ fontSize: 24,
3007
+ fontWeight: "600"
3008
+ },
3009
+ trigger: {
3010
+ alignItems: "center",
3011
+ borderRadius: 6,
3012
+ borderWidth: 1,
3013
+ flexDirection: "row",
3014
+ justifyContent: "space-between",
3015
+ paddingHorizontal: 12,
3016
+ paddingVertical: 10
3017
+ },
3018
+ triggerText: {
3019
+ flex: 1,
3020
+ fontSize: 14
3021
+ }
3022
+ }), Fe = ({ node: e, value: t, setValue: n, error: i, label: a, helperText: o }) => {
3023
+ let [s, c] = k(!1), [l, u] = k(!0), d = r(), { colors: f } = _(), p = Array.isArray(t) ? t : [], m = p[0] || "", h = p[1] || "", g = m.split(":"), v = Number.parseInt(g[0], 10), y = Number.parseInt(g[1], 10), b = Number.isNaN(v) ? 0 : v, x = Number.isNaN(y) ? 0 : y, S = h.split(":"), C = Number.parseInt(S[0], 10), w = Number.parseInt(S[1], 10), T = Number.isNaN(C) ? 0 : C, E = Number.isNaN(w) ? 0 : w, [D, O] = k(0), [M, N] = k(0), te = Array.from({ length: 24 }, (e, t) => t), P = Array.from({ length: 60 }, (e, t) => t), L = () => m && h ? `${m} - ${h}` : m || d("renderer.defaultInputs.selectDateRange"), R = ee(() => {
3024
+ let e = `${String(D).padStart(2, "0")}:${String(M).padStart(2, "0")}`;
3025
+ l ? (n([e, h]), u(!1), O(T || 0), N(E || 0)) : (n([m, e]), c(!1), u(!0));
3026
+ }, [
3027
+ l,
3028
+ D,
3029
+ M,
3030
+ m,
3031
+ h,
3032
+ T,
3033
+ E,
3034
+ n
3035
+ ]);
3036
+ return /* @__PURE__ */ j(V, {
3037
+ style: $.container,
3038
+ children: [
3039
+ /* @__PURE__ */ j(z, {
3040
+ style: [$.label, { color: f.textSecondary }],
3041
+ children: [a || e.data.name, e.data.required && /* @__PURE__ */ A(z, {
3042
+ style: { color: f.error },
3043
+ children: "*"
3044
+ })]
3045
+ }),
3046
+ /* @__PURE__ */ j(B, {
3047
+ style: [
3048
+ $.trigger,
3049
+ {
3050
+ backgroundColor: f.input,
3051
+ borderColor: f.border
3052
+ },
3053
+ i && { borderColor: f.error }
3054
+ ],
3055
+ onPress: () => {
3056
+ O(b || 0), N(x || 0), u(!0), c(!0);
3057
+ },
3058
+ activeOpacity: .7,
3059
+ children: [/* @__PURE__ */ A(z, {
3060
+ style: [
3061
+ $.triggerText,
3062
+ { color: f.text },
3063
+ !m && { color: f.textMuted }
3064
+ ],
3065
+ numberOfLines: 1,
3066
+ children: L()
3067
+ }), /* @__PURE__ */ A(z, {
3068
+ style: $.icon,
3069
+ children: "🕐"
3070
+ })]
3071
+ }),
3072
+ /* @__PURE__ */ A(F, {
3073
+ visible: s,
3074
+ transparent: !0,
3075
+ animationType: "fade",
3076
+ onRequestClose: () => c(!1),
3077
+ children: /* @__PURE__ */ A(B, {
3078
+ style: $.modalOverlay,
3079
+ activeOpacity: 1,
3080
+ onPress: () => c(!1),
3081
+ children: /* @__PURE__ */ j(B, {
3082
+ style: [$.modalContent, { backgroundColor: f.card }],
3083
+ activeOpacity: 1,
3084
+ onPress: () => {},
3085
+ children: [
3086
+ /* @__PURE__ */ j(V, {
3087
+ style: [$.modalHeader, { borderBottomColor: f.separator }],
3088
+ children: [/* @__PURE__ */ A(z, {
3089
+ style: [$.modalTitle, { color: f.text }],
3090
+ children: a || e.data.name
3091
+ }), /* @__PURE__ */ A(B, {
3092
+ onPress: () => c(!1),
3093
+ children: /* @__PURE__ */ A(z, {
3094
+ style: [$.closeButton, { color: f.textMuted }],
3095
+ children: "✕"
3096
+ })
3097
+ })]
3098
+ }),
3099
+ /* @__PURE__ */ A(V, {
3100
+ style: [$.rangeIndicator, { backgroundColor: f.primaryLight }],
3101
+ children: /* @__PURE__ */ A(z, {
3102
+ style: [$.rangeIndicatorText, { color: f.primary }],
3103
+ children: d(l ? "renderer.defaultInputs.startTime" : "renderer.defaultInputs.endTime")
3104
+ })
3105
+ }),
3106
+ /* @__PURE__ */ j(V, {
3107
+ style: $.pickerContainer,
3108
+ children: [
3109
+ /* @__PURE__ */ j(V, {
3110
+ style: $.pickerColumn,
3111
+ children: [/* @__PURE__ */ A(z, {
3112
+ style: [$.pickerLabel, { color: f.textMuted }],
3113
+ children: "Hour"
3114
+ }), /* @__PURE__ */ A(I, {
3115
+ style: $.picker,
3116
+ contentContainerStyle: $.pickerContent,
3117
+ showsVerticalScrollIndicator: !1,
3118
+ children: te.map((e) => /* @__PURE__ */ A(B, {
3119
+ style: [$.pickerItem, D === e && { backgroundColor: f.primary }],
3120
+ onPress: () => O(e),
3121
+ activeOpacity: .7,
3122
+ children: /* @__PURE__ */ A(z, {
3123
+ style: [
3124
+ $.pickerItemText,
3125
+ { color: f.text },
3126
+ D === e && {
3127
+ color: f.background,
3128
+ fontWeight: "600"
3129
+ }
3130
+ ],
3131
+ children: String(e).padStart(2, "0")
3132
+ })
3133
+ }, e))
3134
+ })]
3135
+ }),
3136
+ /* @__PURE__ */ A(z, {
3137
+ style: [$.pickerSeparator, { color: f.text }],
3138
+ children: ":"
3139
+ }),
3140
+ /* @__PURE__ */ j(V, {
3141
+ style: $.pickerColumn,
3142
+ children: [/* @__PURE__ */ A(z, {
3143
+ style: [$.pickerLabel, { color: f.textMuted }],
3144
+ children: "Minute"
3145
+ }), /* @__PURE__ */ A(I, {
3146
+ style: $.picker,
3147
+ contentContainerStyle: $.pickerContent,
3148
+ showsVerticalScrollIndicator: !1,
3149
+ children: P.map((e) => /* @__PURE__ */ A(B, {
3150
+ style: [$.pickerItem, M === e && { backgroundColor: f.primary }],
3151
+ onPress: () => N(e),
3152
+ activeOpacity: .7,
3153
+ children: /* @__PURE__ */ A(z, {
3154
+ style: [
3155
+ $.pickerItemText,
3156
+ { color: f.text },
3157
+ M === e && {
3158
+ color: f.background,
3159
+ fontWeight: "600"
3160
+ }
3161
+ ],
3162
+ children: String(e).padStart(2, "0")
3163
+ })
3164
+ }, e))
3165
+ })]
3166
+ })
3167
+ ]
3168
+ }),
3169
+ /* @__PURE__ */ A(B, {
3170
+ style: [$.confirmButton, { backgroundColor: f.primary }],
3171
+ onPress: R,
3172
+ activeOpacity: .7,
3173
+ children: /* @__PURE__ */ A(z, {
3174
+ style: [$.confirmButtonText, { color: f.background }],
3175
+ children: l ? "Next" : "Confirm"
3176
+ })
3177
+ })
3178
+ ]
3179
+ })
3180
+ })
3181
+ }),
3182
+ i && /* @__PURE__ */ A(z, {
3183
+ style: [$.error, { color: f.error }],
3184
+ children: i
3185
+ }),
3186
+ o && !i && /* @__PURE__ */ A(z, {
3187
+ style: [$.helperText, { color: f.textMuted }],
3188
+ children: o
3189
+ })
3190
+ ]
3191
+ });
3192
+ }, $ = L.create({
3193
+ closeButton: {
3194
+ fontSize: 24,
3195
+ fontWeight: "300"
3196
+ },
3197
+ confirmButton: {
3198
+ alignItems: "center",
3199
+ borderRadius: 6,
3200
+ marginTop: 16,
3201
+ paddingVertical: 12
3202
+ },
3203
+ confirmButtonText: {
3204
+ fontSize: 16,
3205
+ fontWeight: "600"
3206
+ },
3207
+ container: { marginBottom: 16 },
3208
+ error: {
3209
+ fontSize: 12,
3210
+ marginTop: 4
3211
+ },
3212
+ helperText: {
3213
+ fontSize: 12,
3214
+ marginTop: 4
3215
+ },
3216
+ icon: { fontSize: 16 },
3217
+ label: {
3218
+ fontSize: 14,
3219
+ fontWeight: "500",
3220
+ marginBottom: 8
3221
+ },
3222
+ modalContent: {
3223
+ borderRadius: 12,
3224
+ padding: 16,
3225
+ width: "80%"
3226
+ },
3227
+ modalHeader: {
3228
+ alignItems: "center",
3229
+ borderBottomWidth: 1,
3230
+ flexDirection: "row",
3231
+ justifyContent: "space-between",
3232
+ marginBottom: 12,
3233
+ paddingBottom: 12
3234
+ },
3235
+ modalOverlay: {
3236
+ alignItems: "center",
3237
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
3238
+ flex: 1,
3239
+ justifyContent: "center"
3240
+ },
3241
+ modalTitle: {
3242
+ fontSize: 18,
3243
+ fontWeight: "600"
3244
+ },
3245
+ picker: { maxHeight: 200 },
3246
+ pickerColumn: { flex: 1 },
3247
+ pickerContainer: {
3248
+ alignItems: "center",
3249
+ flexDirection: "row",
3250
+ gap: 8
3251
+ },
3252
+ pickerContent: { paddingVertical: 8 },
3253
+ pickerItem: {
3254
+ alignItems: "center",
3255
+ borderRadius: 6,
3256
+ marginVertical: 2,
3257
+ paddingVertical: 10
3258
+ },
3259
+ pickerItemText: { fontSize: 18 },
3260
+ pickerLabel: {
3261
+ fontSize: 12,
3262
+ fontWeight: "600",
3263
+ marginBottom: 8,
3264
+ textAlign: "center"
3265
+ },
3266
+ pickerSeparator: {
3267
+ fontSize: 24,
3268
+ fontWeight: "600"
3269
+ },
3270
+ rangeIndicator: {
3271
+ alignItems: "center",
3272
+ borderRadius: 6,
3273
+ marginBottom: 12,
3274
+ paddingVertical: 8
3275
+ },
3276
+ rangeIndicatorText: {
3277
+ fontSize: 14,
3278
+ fontWeight: "600"
3279
+ },
3280
+ trigger: {
3281
+ alignItems: "center",
3282
+ borderRadius: 6,
3283
+ borderWidth: 1,
3284
+ flexDirection: "row",
3285
+ justifyContent: "space-between",
3286
+ paddingHorizontal: 12,
3287
+ paddingVertical: 10
3288
+ },
3289
+ triggerText: {
3290
+ flex: 1,
3291
+ fontSize: 14
3292
+ }
3293
+ }), Ie = ({ node: e }) => /* @__PURE__ */ j(z, { children: [
3294
+ "TODO: Implement ",
3295
+ e.data.type,
3296
+ " input for React Native"
3297
+ ] }), Le = {
3298
+ address: oe,
3299
+ autocomplete: se,
3300
+ checkbox: ce,
3301
+ date: le,
3302
+ daterange: ue,
3303
+ file: de,
3304
+ hidden: fe,
3305
+ http: xe,
3306
+ number: Se,
3307
+ password: we,
3308
+ radio: Ee,
3309
+ select: De,
3310
+ submit: Ie,
3311
+ switch: Oe,
3312
+ text: Me,
3313
+ textarea: Ae,
3314
+ time: Pe,
3315
+ timerange: Fe
3316
+ }, Re = ({ label: e, children: t, isFirstStep: n, isLastStep: i, canContinue: a, isSubmitting: o, onBack: s, onContinue: c }) => {
3317
+ let l = r(), { colors: u } = _(), d = !a || o;
3318
+ return /* @__PURE__ */ j(V, { children: [
3319
+ e ? /* @__PURE__ */ A(z, {
3320
+ style: [ze.label, { color: u.text }],
3321
+ children: e
3322
+ }) : null,
3323
+ /* @__PURE__ */ A(V, {
3324
+ style: ze.content,
3325
+ children: t
3326
+ }),
3327
+ /* @__PURE__ */ j(V, {
3328
+ style: ze.actions,
3329
+ children: [n ? /* @__PURE__ */ A(V, {}) : /* @__PURE__ */ A(B, {
3330
+ style: [
3331
+ ze.backButton,
3332
+ { borderColor: u.border },
3333
+ o && ze.disabled
3334
+ ],
3335
+ onPress: s,
3336
+ disabled: o,
3337
+ activeOpacity: .7,
3338
+ children: /* @__PURE__ */ A(z, {
3339
+ style: [ze.backButtonText, { color: u.text }],
3340
+ children: l("renderer.step.back")
3341
+ })
3342
+ }), /* @__PURE__ */ A(B, {
3343
+ style: [
3344
+ ze.continueButton,
3345
+ { backgroundColor: u.primary },
3346
+ d && {
3347
+ backgroundColor: u.primaryDisabled,
3348
+ opacity: .6
3349
+ }
3350
+ ],
3351
+ onPress: c,
3352
+ disabled: d,
3353
+ activeOpacity: .7,
3354
+ children: o ? /* @__PURE__ */ A(M, { color: u.primaryForeground }) : /* @__PURE__ */ A(z, {
3355
+ style: [ze.continueButtonText, { color: u.primaryForeground }],
3356
+ children: l(i ? "renderer.defaultSubmitButton.submit" : "renderer.step.continue")
3357
+ })
3358
+ })]
3359
+ })
3360
+ ] });
3361
+ }, ze = L.create({
3362
+ actions: {
3363
+ alignItems: "center",
3364
+ flexDirection: "row",
3365
+ justifyContent: "space-between",
3366
+ marginTop: 24
3367
+ },
3368
+ backButton: {
3369
+ borderRadius: 6,
3370
+ borderWidth: 1,
3371
+ paddingHorizontal: 16,
3372
+ paddingVertical: 10
3373
+ },
3374
+ backButtonText: {
3375
+ fontSize: 14,
3376
+ fontWeight: "500"
3377
+ },
3378
+ content: { gap: 8 },
3379
+ continueButton: {
3380
+ alignItems: "center",
3381
+ borderRadius: 6,
3382
+ justifyContent: "center",
3383
+ paddingHorizontal: 24,
3384
+ paddingVertical: 12
3385
+ },
3386
+ continueButtonText: {
3387
+ fontSize: 14,
3388
+ fontWeight: "600"
3389
+ },
3390
+ disabled: { opacity: .5 },
3391
+ label: {
3392
+ fontSize: 16,
3393
+ fontWeight: "600",
3394
+ marginBottom: 12
3395
+ }
3396
+ }), Be = ({ children: e = "Submit", disabled: t, isSubmitting: n, onPress: r }) => {
3397
+ let { colors: i } = _();
3398
+ return /* @__PURE__ */ A(B, {
3399
+ style: [
3400
+ Ve.button,
3401
+ { backgroundColor: i.primary },
3402
+ (t || n) && {
3403
+ backgroundColor: i.primaryDisabled,
3404
+ opacity: .6
3405
+ }
3406
+ ],
3407
+ disabled: t || n,
3408
+ onPress: r,
3409
+ activeOpacity: .7,
3410
+ children: n ? /* @__PURE__ */ A(M, { color: i.primaryForeground }) : /* @__PURE__ */ A(z, {
3411
+ style: [Ve.buttonText, { color: i.primaryForeground }],
3412
+ children: e
3413
+ })
3414
+ });
3415
+ }, Ve = L.create({
3416
+ button: {
3417
+ alignItems: "center",
3418
+ borderRadius: 6,
3419
+ justifyContent: "center",
3420
+ marginTop: 16,
3421
+ paddingHorizontal: 24,
3422
+ paddingVertical: 12
3423
+ },
3424
+ buttonText: {
3425
+ fontSize: 16,
3426
+ fontWeight: "600"
3427
+ }
3428
+ }), He = ({ children: e }) => e, Ue = ({ node: e }) => {
3429
+ let t = r(), { colors: n } = _(), i = t(e.data?.label);
3430
+ return /* @__PURE__ */ A(z, {
3431
+ style: [Ge.title, { color: n.text }],
3432
+ children: i
3433
+ });
3434
+ }, We = () => {
3435
+ let { colors: e } = _();
3436
+ return /* @__PURE__ */ A(V, { style: [Ge.divider, { backgroundColor: e.separator }] });
3437
+ }, Ge = L.create({
3438
+ divider: {
3439
+ height: 1,
3440
+ marginBottom: 16,
3441
+ marginTop: 0
3442
+ },
3443
+ title: {
3444
+ fontSize: 20,
3445
+ fontWeight: "700",
3446
+ marginBottom: 16
3447
+ }
3448
+ }), Ke = {
3449
+ divider: We,
3450
+ title: Ue
3451
+ }, qe = ({ node: e, children: t }) => {
3452
+ let { image: n } = e.data;
3453
+ return /* @__PURE__ */ j(V, { children: [n && /* @__PURE__ */ A(P, {
3454
+ source: { uri: n },
3455
+ style: Je.image,
3456
+ resizeMode: "cover"
3457
+ }), t] });
3458
+ }, Je = L.create({ image: {
3459
+ borderRadius: 6,
3460
+ height: 160,
3461
+ marginBottom: 8,
3462
+ width: "100%"
3463
+ } }), Ye = ({ components: e, contentContainerStyle: t, flows: n, googleApiKey: r, headers: i, initialValues: a, language: o, onChange: s, onSubmit: c, style: l, theme: u, validate: d, validationMode: f }) => {
3464
+ let { colors: h } = _(), { canContinueStep: g, canSubmit: v, clearSubmitMessage: y, config: x, currentStep: S, currentStepGroupNode: C, currentStepIndex: w, formErrors: T, formValues: E, goToNextStep: O, goToPreviousStep: k, handleSubmit: M, inputNodes: N, isFirstStep: te, isLastStep: P, isSubmitting: F, missingRequiredFields: L, setFieldValue: R, steps: ne, submitMessage: B, t: re } = p({
3465
+ components: e,
3466
+ flows: n,
3467
+ googleApiKey: r,
3468
+ headers: i,
3469
+ initialValues: a,
3470
+ language: o,
3471
+ onChange: s,
3472
+ onSubmit: c,
3473
+ theme: u,
3474
+ validate: d,
3475
+ validationMode: f
3476
+ }), { FormWrapper: ie, SubmitButtonWrapper: ae, renderNode: oe } = b({
3477
+ config: x,
3478
+ DefaultFormWrapper: H,
3479
+ DefaultInputWrapper: qe,
3480
+ DefaultSubmitButton: Be,
3481
+ DefaultSubmitButtonWrapper: He,
3482
+ defaultInputRenderers: Le,
3483
+ defaultUI: Ke,
3484
+ formErrors: T,
3485
+ formValues: E,
3486
+ missingRequiredFields: L,
3487
+ setFieldValue: R
3488
+ }), U = x.components.step ?? Re, se = D(() => re(C?.data?.label), [re, C]), W = ee(() => {
3489
+ if (P) {
3490
+ M();
3491
+ return;
3492
+ }
3493
+ O();
3494
+ }, [
3495
+ P,
3496
+ M,
3497
+ O
3498
+ ]);
3499
+ return /* @__PURE__ */ A(I, {
3500
+ nestedScrollEnabled: !0,
3501
+ style: [
3502
+ Ze.container,
3503
+ { backgroundColor: h.background },
3504
+ l
3505
+ ],
3506
+ contentContainerStyle: t,
3507
+ children: /* @__PURE__ */ j(m, {
3508
+ value: {
3509
+ flows: n,
3510
+ formErrors: T,
3511
+ formValues: E,
3512
+ googleApiKey: x.googleApiKey,
3513
+ headers: x.headers,
3514
+ inputNodes: N,
3515
+ language: x.language,
3516
+ setFieldValue: R
3517
+ },
3518
+ children: [/* @__PURE__ */ j(ie, {
3519
+ onSubmit: M,
3520
+ children: [S && /* @__PURE__ */ A(ae, {
3521
+ missingFields: P ? L : void 0,
3522
+ children: /* @__PURE__ */ A(U, {
3523
+ step: S,
3524
+ groupNode: C,
3525
+ stepIndex: w,
3526
+ totalSteps: ne.length,
3527
+ isFirstStep: te,
3528
+ isLastStep: P,
3529
+ canContinue: g && (!P || v),
3530
+ isSubmitting: F,
3531
+ onBack: k,
3532
+ onContinue: W,
3533
+ label: se,
3534
+ children: S.nodes.map((e) => oe(e))
3535
+ })
3536
+ }), /* @__PURE__ */ A(z, {
3537
+ style: [Ze.poweredBy, { color: h.textMuted }],
3538
+ children: "Powered by Treege"
3539
+ })]
3540
+ }), B && /* @__PURE__ */ j(V, {
3541
+ style: [Ze.message, { backgroundColor: B.type === "success" ? h.successBg : h.errorBg }],
3542
+ children: [/* @__PURE__ */ A(z, {
3543
+ style: [Ze.messageText, { color: B.type === "success" ? h.success : h.error }],
3544
+ children: B.message
3545
+ }), /* @__PURE__ */ A(z, {
3546
+ style: [Ze.messageClose, { color: B.type === "success" ? h.success : h.error }],
3547
+ onPress: y,
3548
+ children: re("common.close")
3549
+ })]
3550
+ })]
3551
+ })
3552
+ });
3553
+ }, Xe = (e) => /* @__PURE__ */ A(S, {
3554
+ theme: e.theme,
3555
+ storageKey: "treege-renderer-theme",
3556
+ children: /* @__PURE__ */ A(Ye, { ...e })
3557
+ }), Ze = L.create({
3558
+ container: { flex: 1 },
3559
+ message: {
3560
+ borderRadius: 6,
3561
+ marginVertical: 16,
3562
+ padding: 16
3563
+ },
3564
+ messageClose: {
3565
+ fontSize: 14,
3566
+ marginTop: 8,
3567
+ textDecorationLine: "underline"
3568
+ },
3569
+ messageText: {
3570
+ fontSize: 14,
3571
+ fontWeight: "500"
3572
+ },
3573
+ poweredBy: {
3574
+ fontSize: 12,
3575
+ paddingVertical: 8,
3576
+ textAlign: "right"
3577
+ }
3578
+ });
3579
+ //#endregion
3580
+ export { oe as DefaultAddressInput, se as DefaultAutocompleteInput, ce as DefaultCheckboxInput, le as DefaultDateInput, ue as DefaultDateRangeInput, We as DefaultDividerUI, de as DefaultFileInput, fe as DefaultHiddenInput, xe as DefaultHttpInput, Se as DefaultNumberInput, we as DefaultPasswordInput, Ee as DefaultRadioInput, De as DefaultSelectInput, Ie as DefaultSubmitInput, Oe as DefaultSwitchInput, Me as DefaultTextInput, Ae as DefaultTextareaInput, Pe as DefaultTimeInput, Fe as DefaultTimeRangeInput, Ue as DefaultTitleUI, C as TreegeConfigProvider, Xe as TreegeRenderer, u as applyReferenceTransformation, y as calculateReferenceFieldUpdates, g as checkFormFieldHasValue, f as convertFormValuesToNamedFormat, Le as defaultInputRenderers, Ke as defaultUI, c as evaluateCondition, h as evaluateConditions, s as fileToSerializable, T as filesToSerializable, o as findStartNode, v as getFlowRenderState, t as getTranslatedText, d as isFieldEmpty, x as isStartNode, he as sanitize, _e as sanitizeHttpResponse, i as serializableToFile, l as useTreegeConfig, p as useTreegeRenderer };