treege 3.0.0-beta.7 → 3.0.0-beta.71

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