@hzab/form-render-mobile 1.2.8 → 1.2.9

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 (74) hide show
  1. package/LICENSE +21 -0
  2. package/dist/common/array-base-utils.d.ts +9 -0
  3. package/dist/common/global-props-context.d.ts +8 -0
  4. package/dist/common/location-utils.d.ts +80 -0
  5. package/dist/components/ArrayCards/index.d.ts +10 -0
  6. package/dist/components/ArrayTable/common/utils.d.ts +23 -0
  7. package/dist/components/ArrayTable/index.d.ts +8 -0
  8. package/dist/components/Checkbox/index.d.ts +2 -0
  9. package/dist/components/DatePicker/common/utils.d.ts +1 -0
  10. package/dist/components/DatePicker/index.d.ts +16 -0
  11. package/dist/components/FormCollapse/index.d.ts +30 -0
  12. package/dist/components/FormItem/common/useFormItemLayout.d.ts +83 -0
  13. package/dist/components/FormItem/index.d.ts +9 -0
  14. package/dist/components/FormLayout/index.d.ts +76 -0
  15. package/dist/components/FormLayout/style.d.ts +1 -0
  16. package/dist/components/FormLayout/useResponsiveFormLayout.d.ts +17 -0
  17. package/dist/components/LocationPicker/Map/AMap/common/loader.d.ts +2 -0
  18. package/dist/components/LocationPicker/Map/AMap/common/utils.d.ts +74 -0
  19. package/dist/components/LocationPicker/common/utils.d.ts +24 -0
  20. package/dist/components/LocationPicker/components/ModalContent/index.d.ts +3 -0
  21. package/dist/components/LocationPicker/components/Notice/index.d.ts +2 -0
  22. package/dist/components/LocationPicker/components/PickerInfo/index.d.ts +3 -0
  23. package/dist/components/LocationPicker/components/ResInfo/index.d.ts +8 -0
  24. package/dist/components/LocationPicker/index.d.ts +3 -0
  25. package/dist/components/LocationPicker/servers/index.d.ts +21 -0
  26. package/dist/components/PickerRightOutline/index.d.ts +3 -0
  27. package/dist/components/Placeholder/index.d.ts +7 -0
  28. package/dist/components/Radio/index.d.ts +2 -0
  29. package/dist/components/Select/index.d.ts +8 -0
  30. package/dist/components/Slider/index.d.ts +2 -0
  31. package/dist/components/Text/index.d.ts +9 -0
  32. package/dist/components/TimePicker/common/utils.d.ts +1 -0
  33. package/dist/components/TimePicker/index.d.ts +6 -0
  34. package/dist/components/TreeSelect/SelectList/index.d.ts +3 -0
  35. package/dist/components/TreeSelect/TreeSearch/index.d.ts +3 -0
  36. package/dist/components/TreeSelect/common/data-handler.d.ts +70 -0
  37. package/dist/components/TreeSelect/index.d.ts +3 -0
  38. package/dist/components/Uploader/common/checkFileType.d.ts +4 -0
  39. package/dist/components/Uploader/common/img.d.ts +10 -0
  40. package/dist/components/Uploader/components/Image/index.d.ts +3 -0
  41. package/dist/components/Uploader/components/ItemList/ItemRender.d.ts +2 -0
  42. package/dist/components/Uploader/components/ItemList/index.d.ts +2 -0
  43. package/dist/components/UserSelect/index.d.ts +37 -0
  44. package/dist/components/index.d.ts +20 -0
  45. package/dist/globalConfig.d.ts +6 -0
  46. package/dist/index.cjs +1 -0
  47. package/dist/index.css +2 -0
  48. package/dist/index.d.ts +6 -0
  49. package/dist/index.js +3178 -0
  50. package/package.json +65 -76
  51. package/src/common/array-base-utils.ts +1 -1
  52. package/src/components/ArrayCards/index.tsx +5 -3
  53. package/src/components/ArrayTable/common/utils.tsx +2 -2
  54. package/src/components/ArrayTable/index.tsx +6 -3
  55. package/src/components/Checkbox/index.tsx +1 -1
  56. package/src/components/DatePicker/index.tsx +3 -3
  57. package/src/components/FormCollapse/index.tsx +5 -3
  58. package/src/components/FormItem/index.tsx +2 -1
  59. package/src/components/FormLayout/useResponsiveFormLayout.ts +1 -1
  60. package/src/components/LocationPicker/Map/AMap/common/utils.ts +6 -6
  61. package/src/components/LocationPicker/common/utils.ts +3 -3
  62. package/src/components/LocationPicker/components/ModalContent/index.tsx +1 -1
  63. package/src/components/LocationPicker/index.tsx +1 -1
  64. package/src/components/Radio/index.tsx +2 -1
  65. package/src/components/Select/index.tsx +2 -2
  66. package/src/components/TimePicker/common/utils.ts +1 -1
  67. package/src/components/TimePicker/index.tsx +2 -2
  68. package/src/components/Uploader/common/img.ts +4 -4
  69. package/src/components/UserSelect/index.tsx +1 -1
  70. package/src/global.d.ts +14 -0
  71. package/src/index.tsx +1 -1
  72. package/src/type.d.ts +7 -6
  73. package/src/vite-env.d.ts +1 -0
  74. package/README.md +0 -111
package/dist/index.js ADDED
@@ -0,0 +1,3178 @@
1
+ import e, { Fragment as t, createContext as n, forwardRef as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useMemo as c, useRef as l, useState as u } from "react";
2
+ import { CascadePicker as d, CheckList as f, DatePicker as p, FormButtonGroup as m, FormGrid as h, Input as g, List as _, Reset as v, Selector as y, Stepper as b, Submit as x, Switch as S } from "@formily/antd-mobile";
3
+ import { ActionSheet as C, Avatar as w, Badge as T, Button as E, Card as D, CascadePicker as O, CheckList as k, Checkbox as A, Collapse as j, DatePicker as M, Dialog as ee, DotLoading as N, Empty as P, ImageViewer as F, Input as I, Mask as L, NoticeBar as R, Picker as z, Popover as B, Popup as te, Radio as V, SearchBar as H, Selector as U, Slider as W, Space as G, SpinLoading as ne, Stepper as re, Toast as ie } from "antd-mobile";
4
+ import { createForm as ae, isVoidField as oe } from "@formily/core";
5
+ import { FormProvider as se, RecursionField as K, connect as ce, createSchemaField as le, mapProps as ue, observer as q, useField as J, useFieldSchema as de } from "@formily/react";
6
+ import Y from "classnames";
7
+ import { pickDataProps as fe, usePrefixCls as pe } from "@formily/antd-mobile/esm/__builtins__";
8
+ import { ArrayBase as me } from "@formily/antd-mobile/esm/array-base";
9
+ import { Fragment as he, jsx as X, jsxs as Z } from "react/jsx-runtime";
10
+ import { c as Q } from "react/compiler-runtime";
11
+ import { isArr as ge, isBool as _e, isFn as ve, isValid as ye, toArr as be } from "@formily/shared";
12
+ import { CheckCircleOutline as xe, CloseCircleFill as Se, CloseCircleOutline as Ce, DownOutline as we, ExclamationCircleOutline as Te, PlayOutline as Ee, RightOutline as De, UpOutline as Oe } from "antd-mobile-icons";
13
+ import ke from "dayjs";
14
+ import Ae from "dayjs/plugin/advancedFormat";
15
+ import je from "dayjs/plugin/weekOfYear";
16
+ import { markRaw as Me, model as Ne } from "@formily/reactive";
17
+ import { nanoid as Pe } from "nanoid";
18
+ import { addQuery as Fe } from "@hzab/utils/src/url";
19
+ import "@hzab/data-model";
20
+ import Ie from "@hzab/utils/src/upload/ossUpload";
21
+ import Le, { debounce as Re } from "lodash";
22
+ import { AutoSizer as ze, List as Be } from "react-virtualized";
23
+ export * from "@hzab/data-model";
24
+ //#region \0rolldown/runtime.js
25
+ var Ve = Object.defineProperty, He = (e, t) => {
26
+ let n = {};
27
+ for (var r in e) Ve(n, r, {
28
+ get: e[r],
29
+ enumerable: !0
30
+ });
31
+ return t || Ve(n, Symbol.toStringTag, { value: "Module" }), n;
32
+ }, Ue = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
33
+ if (typeof require < "u") return require.apply(this, arguments);
34
+ throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
35
+ }), We = (e) => e["x-component"]?.indexOf("Addition") > -1, Ge = (e) => e["x-component"]?.indexOf?.("Index") > -1, Ke = (e) => e["x-component"]?.indexOf?.("Remove") > -1, qe = (e) => e["x-component"]?.indexOf?.("Copy") > -1, Je = (e) => e["x-component"]?.indexOf?.("MoveUp") > -1, Ye = (e) => e["x-component"]?.indexOf?.("MoveDown") > -1, Xe = (e, t, n = -1) => {
36
+ let { titles: r, isOrderTitle: i } = e || {}, a = r?.[n] || e.title || t?.title;
37
+ return i && n >= 0 && (a += ` ${n + 1}`), a;
38
+ }, Ze = (e) => We(e) || Ke(e) || qe(e) || Ye(e) || Je(e), Qe = q((e) => {
39
+ let t = J(), n = de(), r = Array.isArray(t.value) ? t.value : [], i = pe("formily-array-cards", e), { onAdd: a, onCopy: o, onRemove: s, onMoveDown: c, onMoveUp: l } = e;
40
+ if (!n) throw Error("can not found schema object");
41
+ return /* @__PURE__ */ Z(me, {
42
+ onAdd: a,
43
+ onCopy: o,
44
+ onRemove: s,
45
+ onMoveUp: l,
46
+ onMoveDown: c,
47
+ children: [
48
+ (() => {
49
+ if (r?.length) return;
50
+ let n = Xe(e, t);
51
+ return /* @__PURE__ */ X(D, {
52
+ ...e,
53
+ className: Y(`${i}-item`, e.className),
54
+ title: n,
55
+ children: /* @__PURE__ */ X(P, {})
56
+ });
57
+ })(),
58
+ r?.map((r, a) => {
59
+ let o = Array.isArray(n.items) ? n.items[a] || n.items[0] : n.items, s = Xe(e, t, a), c = /* @__PURE__ */ Z("span", { children: [/* @__PURE__ */ X(K, {
60
+ schema: o,
61
+ name: a,
62
+ filterProperties: (e) => !!Ge(e),
63
+ onlyRenderProperties: !0
64
+ }), s] }), l = /* @__PURE__ */ Z("span", { children: [/* @__PURE__ */ X(K, {
65
+ schema: o,
66
+ name: a,
67
+ filterProperties: (e) => !!Ze(e),
68
+ onlyRenderProperties: !0
69
+ }), e.extra] }), u = /* @__PURE__ */ X(K, {
70
+ schema: o,
71
+ name: a,
72
+ filterProperties: (e) => !(Ge(e) || Ze(e))
73
+ });
74
+ return /* @__PURE__ */ X(me.Item, {
75
+ index: a,
76
+ record: () => t.value?.[a],
77
+ children: /* @__PURE__ */ X(D, {
78
+ ...e,
79
+ className: Y(`${i}-item`, e.className),
80
+ title: c,
81
+ extra: l,
82
+ children: u
83
+ })
84
+ }, a);
85
+ }),
86
+ n.reduceProperties((e, t, n) => We(t) ? /* @__PURE__ */ X(K, {
87
+ schema: t,
88
+ name: n
89
+ }) : e, null)
90
+ ]
91
+ });
92
+ });
93
+ Qe.displayName = "ArrayCards", me.mixin(Qe);
94
+ //#endregion
95
+ //#region src/components/ArrayTable/common/utils.tsx
96
+ var $e = (e) => e["x-component"]?.indexOf("Column") > -1, et = (e) => e["x-component"]?.indexOf("Operations") > -1, tt = () => {
97
+ let e = Q(3), t = J(), n = de(), r;
98
+ if (e[0] !== t || e[1] !== n) {
99
+ let i = (e) => {
100
+ if ($e(e) || et(e) || We(e)) {
101
+ if (!e["x-component-props"]?.dataIndex && !e.name) return [];
102
+ let n = e["x-component-props"]?.dataIndex || e.name, r = t.query(t.address.concat(n)).take(), i = r?.component?.[1] || e["x-component-props"] || {};
103
+ return [{
104
+ name: n,
105
+ display: r?.display || e["x-display"] || "visible",
106
+ field: r,
107
+ schema: e,
108
+ columnProps: i
109
+ }];
110
+ }
111
+ if (e.properties) return e.reduceProperties((e, t) => e.concat(i(t)), []);
112
+ }, a = (e) => e ? (ge(e) ? e : [e]).reduce((e, t) => {
113
+ let n = i(t);
114
+ return n ? e.concat(n) : e;
115
+ }, []) : [];
116
+ if (!n) throw Error("can not found schema object");
117
+ r = a(n.items), e[0] = t, e[1] = n, e[2] = r;
118
+ } else r = e[2];
119
+ return r;
120
+ }, nt = (e, t, n) => n.reduce((n, { name: r, columnProps: i, schema: a, display: o }, s) => o !== "visible" || !$e(a) ? n : n.concat({
121
+ ...i,
122
+ key: s,
123
+ dataIndex: r,
124
+ render: (n, r) => {
125
+ let i = e?.indexOf(r);
126
+ return /* @__PURE__ */ X(me.Item, {
127
+ index: i,
128
+ record: () => t?.value?.[i],
129
+ children: /* @__PURE__ */ X(K, {
130
+ schema: a,
131
+ name: i,
132
+ onlyRenderProperties: !0
133
+ })
134
+ });
135
+ }
136
+ }), []), rt = () => {
137
+ let e = Q(2), t = de(), n;
138
+ return e[0] === t ? n = e[1] : (n = t.reduceProperties(ot, null), e[0] = t, e[1] = n), n;
139
+ }, it = n({}), at = () => a(it);
140
+ function ot(e, t, n) {
141
+ return We(t) ? /* @__PURE__ */ X(K, {
142
+ schema: t,
143
+ name: n
144
+ }) : e;
145
+ }
146
+ //#endregion
147
+ //#region src/components/ArrayTable/index.tsx
148
+ var st = (e) => {
149
+ let n = Q(20), [r, i] = u(1), a = pe("formily-array-table"), s = e.showPagination ?? !0, c = e.pageSize || 10;
150
+ e.size;
151
+ let l = e.dataSource || [], d = (r - 1) * c, f = d + c - 1, p = l?.length || 0, m = Math.ceil(p / c);
152
+ Array.from(Array(m)).map(lt);
153
+ let h;
154
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (h = (e) => {
155
+ i(e);
156
+ }, n[0] = h) : h = n[0];
157
+ let g = h, _, v;
158
+ n[1] !== r || n[2] !== m ? (_ = () => {
159
+ m > 0 && m < r && g(m);
160
+ }, v = [m, r], n[1] = r, n[2] = m, n[3] = _, n[4] = v) : (_ = n[3], v = n[4]), o(_, v);
161
+ let y;
162
+ n[5] !== a || n[6] !== s || n[7] !== m ? (y = () => {
163
+ if (!(m <= 1 || !s)) return /* @__PURE__ */ X("div", {
164
+ className: `${a}-pagination`,
165
+ children: "pagination"
166
+ });
167
+ }, n[5] = a, n[6] = s, n[7] = m, n[8] = y) : y = n[8];
168
+ let b = y, x = t, S = it, C;
169
+ n[9] !== c || n[10] !== s || n[11] !== m ? (C = {
170
+ totalPage: m,
171
+ pageSize: c,
172
+ changePage: g,
173
+ showPagination: s
174
+ }, n[9] = c, n[10] = s, n[11] = m, n[12] = C) : C = n[12];
175
+ let w = e.children?.(s ? l?.slice(d, f + 1) : l, b(), { startIndex: d }), T;
176
+ n[13] !== S.Provider || n[14] !== C || n[15] !== w ? (T = /* @__PURE__ */ X(S.Provider, {
177
+ value: C,
178
+ children: w
179
+ }), n[13] = S.Provider, n[14] = C, n[15] = w, n[16] = T) : T = n[16];
180
+ let E;
181
+ return n[17] !== x || n[18] !== T ? (E = /* @__PURE__ */ X(x, { children: T }), n[17] = x, n[18] = T, n[19] = E) : E = n[19], E;
182
+ }, ct = q((t) => {
183
+ let n = l(), r = J(), i = pe("formily-array-table"), a = Array.isArray(r.value) ? r.value.slice() : [], o = tt(), s = nt(a, r, o), c = _e(t.pagination) ? { showPagination: t.pagination } : t.pagination, u = rt(), { onAdd: d, onCopy: f, onRemove: p, onMoveDown: m, onMoveUp: h } = t;
184
+ return /* @__PURE__ */ X(st, {
185
+ ...c,
186
+ dataSource: a,
187
+ children: (t, r, { startIndex: a }) => /* @__PURE__ */ X("div", {
188
+ ref: n,
189
+ className: i,
190
+ children: /* @__PURE__ */ Z(me, {
191
+ onAdd: d,
192
+ onCopy: f,
193
+ onRemove: p,
194
+ onMoveUp: h,
195
+ onMoveDown: m,
196
+ children: [
197
+ /* @__PURE__ */ Z("table", {
198
+ className: "array-table",
199
+ children: [/* @__PURE__ */ X("thead", { children: /* @__PURE__ */ X("tr", { children: s?.map((e, t) => /* @__PURE__ */ X("th", {
200
+ className: `array-table-th array-table-th-${t}`,
201
+ children: e?.title
202
+ }, t)) }) }), /* @__PURE__ */ X("tbody", { children: t?.map((e, t) => /* @__PURE__ */ X("tr", {
203
+ className: `array-table-tr array-table-tr-${t}`,
204
+ children: s?.map((n, r) => /* @__PURE__ */ X("td", {
205
+ className: `array-table-td array-table-td-${r}`,
206
+ children: n?.render && n?.render(e[n.dataIndex], e, t)
207
+ }, r))
208
+ }, t)) })]
209
+ }),
210
+ /* @__PURE__ */ X("div", {
211
+ style: {
212
+ marginTop: 5,
213
+ marginBottom: 5
214
+ },
215
+ children: r
216
+ }),
217
+ o.map((t, n) => {
218
+ if ($e(t.schema)) return e.createElement(K, {
219
+ name: t.name,
220
+ schema: t.schema,
221
+ onlyRenderSelf: !0,
222
+ key: n
223
+ });
224
+ }),
225
+ u
226
+ ]
227
+ })
228
+ })
229
+ });
230
+ });
231
+ ct.displayName = "ArrayTable", ct.Column = () => /* @__PURE__ */ X(t, {}), me.mixin(ct), ct.Addition = (e) => {
232
+ let t = Q(10), n = me.useArray(), { totalPage: r, pageSize: i, changePage: a, showPagination: o } = at(), s = r === void 0 ? 0 : r, c = i === void 0 ? 10 : i, l;
233
+ t[0] !== n?.field?.value.length || t[1] !== a || t[2] !== c || t[3] !== e || t[4] !== o || t[5] !== s ? (l = (t) => {
234
+ let r = n?.field?.value.length || 0;
235
+ o && r === s * c + 1 && ve(a) && a(s + 1), e.onClick?.(t);
236
+ }, t[0] = n?.field?.value.length, t[1] = a, t[2] = c, t[3] = e, t[4] = o, t[5] = s, t[6] = l) : l = t[6];
237
+ let u;
238
+ return t[7] !== e || t[8] !== l ? (u = /* @__PURE__ */ X(me.Addition, {
239
+ ...e,
240
+ onClick: l
241
+ }), t[7] = e, t[8] = l, t[9] = u) : u = t[9], u;
242
+ };
243
+ function lt(e, t) {
244
+ let n = t + 1;
245
+ return {
246
+ label: n,
247
+ value: n
248
+ };
249
+ }
250
+ //#endregion
251
+ //#region src/components/PickerRightOutline/index.tsx
252
+ var ut = (e) => {
253
+ let t = Q(7), { readOnly: n, disabled: r } = e, i = `form-item-picker-right-outline ${e.className}`, a;
254
+ t[0] !== r || t[1] !== n ? (a = n || r ? null : /* @__PURE__ */ X(De, { className: "picker-right-icon" }), t[0] = r, t[1] = n, t[2] = a) : a = t[2];
255
+ let o;
256
+ return t[3] !== e || t[4] !== i || t[5] !== a ? (o = /* @__PURE__ */ Z("div", {
257
+ ...e,
258
+ className: i,
259
+ children: [e.children, a]
260
+ }), t[3] = e, t[4] = i, t[5] = a, t[6] = o) : o = t[6], o;
261
+ }, dt = (e) => {
262
+ let t = Q(9), n, r, i;
263
+ t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: r, isPicker: i, ...n} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
264
+ let a = r === void 0 ? "" : r, o = i !== void 0 && i, { value: s, placeholder: c } = n;
265
+ if (s != null && s !== "") return s;
266
+ if (n.readOnly || n.disabled) {
267
+ let e;
268
+ return t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ X("span", {}), t[4] = e) : e = t[4], e;
269
+ }
270
+ let l = `form-item-placeholder ${a}`, u = c || (o ? "请选择" : "请输入"), d;
271
+ return t[5] !== n || t[6] !== l || t[7] !== u ? (d = /* @__PURE__ */ X("div", {
272
+ ...n,
273
+ className: l,
274
+ children: u
275
+ }), t[5] = n, t[6] = l, t[7] = u, t[8] = d) : d = t[8], d;
276
+ }, ft = q((e) => {
277
+ let { disabled: t, readOnly: n, placeholder: r = "请选择", onChange: i } = e, { dataSource: a } = J(), [s, c] = u(a || []), [l, d] = u(!1);
278
+ o(() => {
279
+ a && c(a);
280
+ }, [a]);
281
+ function f() {
282
+ d(!1);
283
+ }
284
+ function p() {
285
+ n || t || d((e) => !e);
286
+ }
287
+ function m(t) {
288
+ e.onConfirm && e.onConfirm(t), i && i(t);
289
+ }
290
+ return /* @__PURE__ */ X(ut, {
291
+ className: "formily-cascader picker-box",
292
+ readOnly: n,
293
+ disabled: t,
294
+ onClick: p,
295
+ children: /* @__PURE__ */ X(O, {
296
+ ...e,
297
+ style: { pointerEvents: n || t ? "none" : void 0 },
298
+ options: s,
299
+ visible: l,
300
+ onClose: f,
301
+ onConfirm: m,
302
+ children: (t) => !t || t.length <= 0 ? /* @__PURE__ */ X(dt, {
303
+ ...e,
304
+ placeholder: r,
305
+ isPicker: !0
306
+ }) : t?.reduce((e, t) => t ? (e && (e += " - "), e += t?.label) : e, "")
307
+ })
308
+ });
309
+ }), pt = {
310
+ 一: 1,
311
+ 二: 2,
312
+ 三: 3,
313
+ 四: 4,
314
+ 五: 5,
315
+ 六: 6,
316
+ 日: 7
317
+ };
318
+ function mt(e) {
319
+ let t = e.match(/(\d{4}) ?年 第 ?(\d{2}) ?周( 周(.))?/), n;
320
+ return t.length > 0 && (n = ke(t[1], "YYYY"), n = n.add(+t[2], "week"), t[4] && (n = n.subtract(1, "week"), n = n.add(pt[t[4]], "day"))), n;
321
+ }
322
+ function ht(e, t, n) {
323
+ let r = e;
324
+ if (typeof r == "string") {
325
+ if (n === "week" || n === "week-day") return new Date(mt(e));
326
+ r = new Date(ke(e, t, "zh-cn").valueOf());
327
+ }
328
+ return r;
329
+ }
330
+ ke.extend(Ae), ke.extend(je);
331
+ var gt = {
332
+ year: "YYYY",
333
+ month: "YYYY-MM",
334
+ day: "YYYY-MM-DD",
335
+ hour: "YYYY-MM-DD HH",
336
+ minute: "YYYY-MM-DD HH:mm",
337
+ second: "YYYY-MM-DD HH:mm:ss",
338
+ week: "YYYY 年 第 ww 周",
339
+ "week-day": "YYYY 年 第 ww 周 ddd"
340
+ }, _t = q((e) => {
341
+ let { value: t, disabled: n, readOnly: r, placeholder: i = "请选择", format: a, onChange: s } = e, { dataSource: l } = J(), [d, f] = u(l ? [l] : []), [p, m] = u(!1), h = c(() => {
342
+ if (e.precision) return e.precision;
343
+ let { picker: t, showTime: n } = e, r = t || "day";
344
+ return t === "date" && (r = "day"), (!t || t === "date") && n && (r = "second"), r;
345
+ }, [
346
+ e.precision,
347
+ e.picker,
348
+ e.showTime
349
+ ]);
350
+ o(() => {
351
+ l && f([l]);
352
+ }, [l]);
353
+ function g() {
354
+ m(!1);
355
+ }
356
+ function _() {
357
+ r || n || m((e) => !e);
358
+ }
359
+ let v = gt[h] || "YYYY-MM-DD";
360
+ function y(t) {
361
+ let n = ke(t).format(a || v);
362
+ e.onConfirm && e.onConfirm(n), s && s(n);
363
+ }
364
+ let b = ht(t, v, h);
365
+ return /* @__PURE__ */ X(ut, {
366
+ className: "picker-box formily-date-picker",
367
+ onClick: _,
368
+ children: /* @__PURE__ */ X(M, {
369
+ ...e,
370
+ value: b,
371
+ style: { pointerEvents: r || n ? "none" : void 0 },
372
+ visible: p,
373
+ onClose: g,
374
+ precision: h,
375
+ onConfirm: y,
376
+ children: (t) => t ? ke(t).format(v) : /* @__PURE__ */ X(dt, {
377
+ ...e,
378
+ placeholder: i,
379
+ isPicker: !0
380
+ })
381
+ })
382
+ });
383
+ }), vt = () => {
384
+ let e = Q(3), t = J(), n = de(), r;
385
+ return e[0] !== t || e[1] !== n ? (r = [], n.mapProperties((e, n) => {
386
+ let i = t.query(t.address.concat(n)).take();
387
+ if (i?.display !== "none" && i?.display !== "hidden" && e["x-component"]?.indexOf("CollapsePanel") > -1) {
388
+ let t = i?.componentProps;
389
+ r.push({
390
+ name: n,
391
+ props: {
392
+ ...t,
393
+ key: t?.key || n
394
+ },
395
+ schema: e
396
+ });
397
+ }
398
+ }), e[0] = t, e[1] = n, e[2] = r) : r = e[2], r;
399
+ }, yt = (e) => {
400
+ let t = Ne({
401
+ activeKeys: e,
402
+ setActiveKeys(e) {
403
+ t.activeKeys = e;
404
+ },
405
+ hasActiveKey(e) {
406
+ if (Array.isArray(t.activeKeys)) {
407
+ if (t.activeKeys.includes(e)) return !0;
408
+ } else if (t.activeKeys == e) return !0;
409
+ return !1;
410
+ },
411
+ addActiveKey(e) {
412
+ t.hasActiveKey(e) || (t.activeKeys = be(t.activeKeys).concat(e));
413
+ },
414
+ removeActiveKey(e) {
415
+ Array.isArray(t.activeKeys) ? t.activeKeys = t.activeKeys.filter((t) => t != e) : t.activeKeys = "";
416
+ },
417
+ toggleActiveKey(e) {
418
+ t.hasActiveKey(e) ? t.removeActiveKey(e) : t.addActiveKey(e);
419
+ }
420
+ });
421
+ return Me(t);
422
+ }, bt = q(({ formCollapse: e, ...t }) => {
423
+ let n = J(), r = vt(), i = pe("formily-collapse", t), a = c(() => e || yt(t.defaultActiveKey), []), [o, s] = u([]), l = () => t.activeKey ? t.activeKey : a?.activeKeys ? a?.activeKeys : t.accordion ? r[0]?.name : r.map((e) => e.name), d = (e, t) => {
424
+ let r = n.form.queryFeedbacks({
425
+ type: "error",
426
+ address: `${n.address.concat(e)}.*`
427
+ });
428
+ return r.length ? /* @__PURE__ */ X(T, {
429
+ className: "errors-badge",
430
+ content: r.length,
431
+ children: t.header
432
+ }) : t.header;
433
+ };
434
+ return /* @__PURE__ */ X(j, {
435
+ ...t,
436
+ className: `form-collapse ${Y(i, t.className)}`,
437
+ activeKey: l(),
438
+ onChange: (e) => {
439
+ t?.onChange?.(e), s(e), a?.setActiveKeys?.(e);
440
+ },
441
+ children: r.map(({ props: e, schema: t, name: n }, r) => {
442
+ let i = /* @__PURE__ */ Z("div", {
443
+ className: "panel-between-header",
444
+ children: [d(n, e), /* @__PURE__ */ X("div", { children: e.extra })]
445
+ });
446
+ return /* @__PURE__ */ X(j.Panel, {
447
+ ...e,
448
+ title: i,
449
+ forceRender: !0,
450
+ children: /* @__PURE__ */ X(K, {
451
+ schema: t,
452
+ name: n
453
+ })
454
+ }, r);
455
+ })
456
+ });
457
+ });
458
+ bt.CollapsePanel = (e) => {
459
+ let n = Q(2), { children: r } = e, i;
460
+ return n[0] === r ? i = n[1] : (i = /* @__PURE__ */ X(t, { children: r }), n[0] = r, n[1] = i), i;
461
+ }, bt.createFormCollapse = yt;
462
+ //#endregion
463
+ //#region src/components/NumberPicker/index.jsx
464
+ var xt = (e) => {
465
+ let t = Q(8), n, r, i;
466
+ if (t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({precision: r, className: n, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i), i.readOnly) return i.value || "";
467
+ let a = `number-picker ${n}`, o;
468
+ return t[4] !== r || t[5] !== i || t[6] !== a ? (o = /* @__PURE__ */ X(re, {
469
+ className: a,
470
+ ...i,
471
+ digits: r
472
+ }), t[4] = r, t[5] = i, t[6] = a, t[7] = o) : o = t[7], o;
473
+ }, St = (e) => {
474
+ let t = Q(3), n = e.readOnly ? "" : e.placeholder || "请输入", r;
475
+ return t[0] !== e || t[1] !== n ? (r = /* @__PURE__ */ X(I, {
476
+ ...e,
477
+ type: "password",
478
+ placeholder: n
479
+ }), t[0] = e, t[1] = n, t[2] = r) : r = t[2], r;
480
+ }, Ct = q((e) => {
481
+ let { value: t, disabled: n, readOnly: r, placeholder: i = "请选择", onChange: a } = e, { dataSource: s } = J(), [c, l] = u(s ? [s] : []), [d, f] = u(!1);
482
+ o(() => {
483
+ s && l([s]);
484
+ }, [s]);
485
+ function p() {
486
+ f(!1);
487
+ }
488
+ function m() {
489
+ r || n || f((e) => !e);
490
+ }
491
+ function h(t) {
492
+ let n = t.length === 1 ? t[0] : t;
493
+ e.onConfirm && e.onConfirm(n), a && a(n);
494
+ }
495
+ return /* @__PURE__ */ X(ut, {
496
+ className: "formily-select picker-box",
497
+ readOnly: r,
498
+ disabled: n,
499
+ onClick: m,
500
+ children: /* @__PURE__ */ X(z, {
501
+ ...e,
502
+ value: Array.isArray(t) ? t : [t],
503
+ style: { pointerEvents: r || n ? "none" : void 0 },
504
+ columns: c,
505
+ visible: d,
506
+ onClose: p,
507
+ onConfirm: h,
508
+ children: (t) => t && t.length > 0 && t[0] ? t[0]?.label : /* @__PURE__ */ X(dt, {
509
+ ...e,
510
+ placeholder: i,
511
+ isPicker: !0
512
+ })
513
+ })
514
+ });
515
+ }), wt = ({ value: t, mode: n, content: r, className: i, ...a }) => {
516
+ let o = n === "normal" || !n ? "div" : n;
517
+ return e.createElement(o, {
518
+ className: `formily-text ${i}`,
519
+ ...a
520
+ }, t || r);
521
+ };
522
+ //#endregion
523
+ //#region src/components/TimePicker/common/utils.ts
524
+ function Tt(e = {}) {
525
+ let { use12Hours: t, isPM: n } = e || {}, r = [
526
+ {
527
+ stepKey: "hourStep",
528
+ max: 23
529
+ },
530
+ {
531
+ stepKey: "minuteStep",
532
+ max: 59
533
+ },
534
+ {
535
+ stepKey: "secondStep",
536
+ max: 59
537
+ }
538
+ ], i = [
539
+ [],
540
+ [],
541
+ []
542
+ ];
543
+ return t && i.push([{
544
+ label: "AM",
545
+ value: "AM"
546
+ }, {
547
+ label: "PM",
548
+ value: "PM"
549
+ }]), r?.forEach((r, a) => {
550
+ let o = 0, { max: s, stepKey: c } = r, l = e[c] || 1;
551
+ for ((l <= 0 || l > s) && (l = 1), t && c === "hourStep" && (s = 11, n && (i[a].push({
552
+ label: "12",
553
+ value: "00"
554
+ }), o = l)); o <= s;) {
555
+ let e = `${o > 9 ? o : "0" + o}`;
556
+ i[a].push({
557
+ label: e,
558
+ value: e
559
+ }), o += l;
560
+ }
561
+ }), i;
562
+ }
563
+ //#endregion
564
+ //#region src/components/TimePicker/index.tsx
565
+ var Et = q((e) => {
566
+ let { value: t, disabled: n, readOnly: r, placeholder: i = "请选择", use12Hours: a, onChange: o } = e, {} = J(), [s, c] = u(!1), [l, d] = u(Tt(e));
567
+ function f(t) {
568
+ let n = t?.join(":");
569
+ a && (t[3] === "PM" && t[0] == 0 && (t[0] = 12), n = [...t].slice(0, 3)?.join(":"), n += ` ${t[3] || ""}`), e.onConfirm && e.onConfirm(n), o && o(n);
570
+ }
571
+ function p(t, ...n) {
572
+ a && t?.[3] == "PM" ? d(Tt({
573
+ ...e,
574
+ isPM: !0
575
+ })) : d(Tt(e));
576
+ }
577
+ function m() {
578
+ r || n || c((e) => !e);
579
+ }
580
+ let h = t?.split(":");
581
+ if (a && h && h.length > 0) {
582
+ let e = h[2];
583
+ h.splice(2, 1, e.split(" ")?.[0]), h.push(e.split(" ")?.[1]), h[3] === "PM" && h[0] == 12 && (h[0] = "00");
584
+ }
585
+ return /* @__PURE__ */ Z(ut, {
586
+ className: "picker-box formily-time-picker",
587
+ readOnly: r,
588
+ disabled: n,
589
+ onClick: m,
590
+ children: [/* @__PURE__ */ X(z, {
591
+ ...e,
592
+ value: h,
593
+ visible: s,
594
+ columns: l,
595
+ onSelect: p,
596
+ onClose: () => {
597
+ c(!1);
598
+ },
599
+ onConfirm: f
600
+ }), /* @__PURE__ */ X(dt, {
601
+ ...e,
602
+ value: t,
603
+ placeholder: i
604
+ })]
605
+ });
606
+ });
607
+ //#endregion
608
+ //#region src/globalConfig.ts
609
+ window.formRenderGlobalServeConfig = {};
610
+ function Dt() {
611
+ return window.formRenderGlobalServeConfig || {};
612
+ }
613
+ //#endregion
614
+ //#region src/components/Uploader/common/utils.js
615
+ function Ot(e) {
616
+ let t = e.url || null;
617
+ try {
618
+ window.createObjectURL == null ? window.URL == null ? window.webkitURL != null && (t = window.webkitURL.createObjectURL(e)) : t = window.URL.createObjectURL(e) : t = window.createObjectURL(e);
619
+ } catch (e) {
620
+ console.warn("getFileURL Error: ", e);
621
+ }
622
+ return t;
623
+ }
624
+ function kt(e) {
625
+ return Mt(e, [
626
+ "apng",
627
+ "avif",
628
+ "bmp",
629
+ "gif",
630
+ "ico",
631
+ "cur",
632
+ "jpg",
633
+ "jpeg",
634
+ "jfif",
635
+ "pjpeg",
636
+ "pjp",
637
+ "png",
638
+ "svg",
639
+ "tif",
640
+ "tiff",
641
+ "webp"
642
+ ]);
643
+ }
644
+ function At(e) {
645
+ return Mt(e, [
646
+ "3gp",
647
+ "mpg",
648
+ "mpeg",
649
+ "mp4",
650
+ "m4v",
651
+ "m4p",
652
+ "ogv",
653
+ "ogg",
654
+ "mov",
655
+ "webm"
656
+ ]);
657
+ }
658
+ function jt(e) {
659
+ return Mt(e, [
660
+ "3gp",
661
+ "adts",
662
+ "mpeg",
663
+ "mp3",
664
+ "mp4",
665
+ "ogg",
666
+ "mov",
667
+ "webm",
668
+ "rtp",
669
+ "amr",
670
+ "wav"
671
+ ]);
672
+ }
673
+ function Mt(e, t = [], n) {
674
+ if (!e) return !1;
675
+ let r = e?.replace(/\?.+/, "");
676
+ if (RegExp(`\.(${t.join("|")})$`, n ? void 0 : "i").test(r)) return !0;
677
+ }
678
+ function Nt(e) {
679
+ return Array.isArray(e) ? e : e && [e] || [];
680
+ }
681
+ function Pt(e, t) {
682
+ let n = Nt(e);
683
+ return t > 0 && n.length > t && (n = n.slice(t)), n;
684
+ }
685
+ function Ft(e, t = 1, n) {
686
+ let r = Pt(Nt(e), t);
687
+ if (r.length === 0) return r;
688
+ let i = r;
689
+ return Array.isArray(i) || (i = [i]), i = r.map((e, t) => {
690
+ if (typeof e == "string") {
691
+ let t = Pe(), r = "";
692
+ return Dt()?.showThumbnail && (r = Fe(e, n?.thumbnailParams)), {
693
+ name: t,
694
+ uid: t,
695
+ ossUrl: e,
696
+ url: e,
697
+ thumbnailUrl: r
698
+ };
699
+ }
700
+ return e && !e.uid && (e.uid = Pe()), e && !e.name && (e.name = e.uid), e;
701
+ }), i;
702
+ }
703
+ //#endregion
704
+ //#region src/components/Uploader/common/checkFileType.ts
705
+ var It = "video", Lt = "audio";
706
+ function Rt(e) {
707
+ let { type: t, url: n = e?.ossUrl } = e || {}, r = "";
708
+ return n ? n.startsWith("data:image/") || kt(n) ? r = "img" : At(n) ? r = It : jt(n) && (r = Lt) : t && (t?.startsWith("image/") && (r = "img"), t?.startsWith("video/") && (r = It), t?.startsWith("audio/") && (r = Lt)), r;
709
+ }
710
+ //#endregion
711
+ //#region src/components/Uploader/components/video/index.jsx
712
+ function zt(e) {
713
+ let t = Q(12), { src: n, href: r } = e, [i, a] = u(!1), o;
714
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = function() {
715
+ a(!0);
716
+ }, t[0] = o) : o = t[0];
717
+ let s = o, c;
718
+ t[1] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ X(Ee, {
719
+ className: "video-play-btn",
720
+ onClick: s
721
+ }), t[1] = c) : c = t[1];
722
+ let l;
723
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (l = () => a(!1), t[2] = l) : l = t[2];
724
+ let d = r || n, f;
725
+ t[3] === d ? f = t[4] : (f = /* @__PURE__ */ X("a", {
726
+ href: d,
727
+ children: "下载"
728
+ }), t[3] = d, t[4] = f);
729
+ let p;
730
+ t[5] !== n || t[6] !== f ? (p = /* @__PURE__ */ Z("video", {
731
+ className: "uploader-video-view",
732
+ src: n,
733
+ controls: !0,
734
+ children: [
735
+ "抱歉,您的浏览器不支持内嵌视频,不过不用担心,你可以",
736
+ f,
737
+ "并用你喜欢的播放器观看!"
738
+ ]
739
+ }), t[5] = n, t[6] = f, t[7] = p) : p = t[7];
740
+ let m;
741
+ t[8] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ X("div", {
742
+ className: "previewer-mask-close-btn",
743
+ onClick: () => a(!1),
744
+ children: "X"
745
+ }), t[8] = m) : m = t[8];
746
+ let h;
747
+ return t[9] !== i || t[10] !== p ? (h = /* @__PURE__ */ Z("div", {
748
+ className: "uploader-video-wrap",
749
+ children: [c, /* @__PURE__ */ Z(L, {
750
+ className: "uploader-video-mask",
751
+ visible: i,
752
+ getContainer: document.body,
753
+ destroyOnClose: !0,
754
+ onMaskClick: l,
755
+ children: [p, m]
756
+ })]
757
+ }), t[9] = i, t[10] = p, t[11] = h) : h = t[11], h;
758
+ }
759
+ //#endregion
760
+ //#region src/components/Uploader/common/img.ts
761
+ var Bt = (e, t) => new Promise((n) => {
762
+ let r = new XMLHttpRequest();
763
+ r.open("GET", e, !0), r.responseType = "blob", t && Object.keys(t).forEach((e) => {
764
+ r.setRequestHeader(e, t[e]);
765
+ }), r.onload = function() {
766
+ if (r.status === 200) {
767
+ let e = r.response;
768
+ n(URL.createObjectURL(e));
769
+ }
770
+ }, r.send();
771
+ });
772
+ function Vt(e, t = { width: 1024 }) {
773
+ return new Promise((n, r) => {
774
+ let i = new Image();
775
+ i.onload = function() {
776
+ let { width: e, height: r } = i;
777
+ for (; e > t.width;) e = Math.floor(e * .8), r = Math.floor(r * .8);
778
+ let a = document.createElement("canvas");
779
+ a.width = e, a.height = r, a.getContext("2d").drawImage(i, 0, 0, i.width, i.height, 0, 0, e, r), n(a.toDataURL());
780
+ }, i.onerror = r, i.src = e;
781
+ });
782
+ }
783
+ function Ht(e) {
784
+ let t = e.split(","), n = t[0].match(/:(.*?);/)[1], r = atob(t[1]), i = r.length, a = new Uint8Array(i);
785
+ for (; i--;) a[i] = r.charCodeAt(i);
786
+ return new Blob([a], { type: n });
787
+ }
788
+ //#endregion
789
+ //#region src/components/Uploader/components/Image/index.tsx
790
+ function Ut(e) {
791
+ let t = Q(23), { headers: n, src: r, thumbnailUrl: i } = e, [a, s] = u(!1), [c, l] = u(""), [d, f] = u(""), p;
792
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (p = function() {
793
+ s(!0);
794
+ }, t[0] = p) : p = t[0];
795
+ let m = p, h;
796
+ t[1] !== n || t[2] !== r || t[3] !== i ? (h = async () => {
797
+ n ? (Bt(r, n).then(l), Bt(i, n).then(f)) : (l(r), f(i));
798
+ }, t[1] = n, t[2] = r, t[3] = i, t[4] = h) : h = t[4];
799
+ let g = h, _;
800
+ t[5] === g ? _ = t[6] : (_ = () => {
801
+ g();
802
+ }, t[5] = g, t[6] = _);
803
+ let v;
804
+ t[7] === r ? v = t[8] : (v = [r], t[7] = r, t[8] = v), o(_, v);
805
+ let y = `uploader-image-previewer ${e.className || ""}`, b;
806
+ t[9] !== c || t[10] !== d ? (b = Dt()?.showThumbnail ? d : c, t[9] = c, t[10] = d, t[11] = b) : b = t[11];
807
+ let x;
808
+ t[12] !== e.alt || t[13] !== b ? (x = /* @__PURE__ */ X("div", {
809
+ className: "uploader-image-previewer-img-wrap",
810
+ onClick: m,
811
+ children: /* @__PURE__ */ X("img", {
812
+ className: "uploader-image-previewer-img",
813
+ src: b,
814
+ alt: e.alt,
815
+ onClick: m
816
+ })
817
+ }), t[12] = e.alt, t[13] = b, t[14] = x) : x = t[14];
818
+ let S;
819
+ t[15] === Symbol.for("react.memo_cache_sentinel") ? (S = () => {
820
+ s(!1);
821
+ }, t[15] = S) : S = t[15];
822
+ let C;
823
+ t[16] !== c || t[17] !== a ? (C = /* @__PURE__ */ X(F, {
824
+ image: c,
825
+ visible: a,
826
+ onClose: S
827
+ }), t[16] = c, t[17] = a, t[18] = C) : C = t[18];
828
+ let w;
829
+ return t[19] !== y || t[20] !== x || t[21] !== C ? (w = /* @__PURE__ */ Z("div", {
830
+ className: y,
831
+ children: [x, C]
832
+ }), t[19] = y, t[20] = x, t[21] = C, t[22] = w) : w = t[22], w;
833
+ }
834
+ //#endregion
835
+ //#region src/components/Uploader/components/ItemList/ItemRender.tsx
836
+ var Wt = (e) => {
837
+ let t = Q(8), { index: n, disabled: r, readOnly: i, onItemDel: a } = e, o;
838
+ t[0] !== r || t[1] !== n || t[2] !== a || t[3] !== i ? (o = r || i ? null : /* @__PURE__ */ X("div", {
839
+ className: "file-item-del",
840
+ onClick: () => {
841
+ a(n);
842
+ },
843
+ children: /* @__PURE__ */ X(Se, {})
844
+ }), t[0] = r, t[1] = n, t[2] = a, t[3] = i, t[4] = o) : o = t[4];
845
+ let s;
846
+ return t[5] !== e.children || t[6] !== o ? (s = /* @__PURE__ */ Z("div", {
847
+ className: "file-item",
848
+ children: [e.children, o]
849
+ }), t[5] = e.children, t[6] = o, t[7] = s) : s = t[7], s;
850
+ }, Gt = (e) => {
851
+ let { fileList: t, baseUrl: n, disabled: r, readOnly: i, onItemDel: a, headers: o } = e || {};
852
+ return /* @__PURE__ */ X(he, { children: t.map((e, t) => {
853
+ if (!e) return null;
854
+ let { name: s, url: c = e?.ossUrl, thumbnailUrl: l } = e || {}, u = c || Ot(e), d = l || u;
855
+ n && (u = n + u, d = n + l);
856
+ let f = e?.name, p = Rt(e);
857
+ return p === "img" && (f = /* @__PURE__ */ X(Ut, {
858
+ className: "file-item-view",
859
+ headers: o,
860
+ src: u,
861
+ thumbnailUrl: d,
862
+ alt: s
863
+ })), p === "video" && (f = /* @__PURE__ */ X(zt, {
864
+ src: u,
865
+ href: u
866
+ })), p === "audio" && (f = /* @__PURE__ */ X("audio", {
867
+ src: u,
868
+ controls: !0
869
+ })), /* @__PURE__ */ X(Wt, {
870
+ index: t,
871
+ disabled: r,
872
+ readOnly: i,
873
+ onItemDel: a,
874
+ children: /* @__PURE__ */ X("div", {
875
+ className: "file-item-content-box",
876
+ children: f
877
+ })
878
+ }, s + "_" + t);
879
+ }) });
880
+ };
881
+ //#endregion
882
+ //#region src/components/Uploader/common/cordova-camera.js
883
+ function Kt(e = {}, t = {}) {
884
+ return new Promise((n, r) => {
885
+ let i = {
886
+ quality: 70,
887
+ destinationType: navigator.camera.DestinationType.DATA_URL,
888
+ encodingType: navigator.camera.EncodingType.JPEG,
889
+ mediaType: navigator.camera.MediaType.PICTURE,
890
+ sourceType: navigator.camera.PictureSourceType.CAMERA,
891
+ allowEdit: !1,
892
+ correctOrientation: !0,
893
+ ...e
894
+ }, { isMediaCapturePlugin: a, isCameraPlugin: o = !0 } = t;
895
+ o && navigator.camera.getPicture((e) => {
896
+ let r = "data:image/jpeg;base64," + e;
897
+ t.isScale ? Vt(r, t.imgSize).then((e) => {
898
+ n(Ht(e));
899
+ }) : n(Ht(r));
900
+ }, (e) => {
901
+ console.log(e);
902
+ }, i), a && navigator.device.capture.captureImage(function(e) {
903
+ let t = e[0].localURL, i, a;
904
+ window.resolveLocalFileSystemURL(t, function(t) {
905
+ t.file(function(t) {
906
+ i = new FileReader(), i.onloadend = function(t) {
907
+ a = new Blob([this.result], { type: "image/jpeg" }), a?.uid || (a.uid = Date.now()), a?.name || (a.name = `${Date.now()}.${a.type?.replace("image/", "")}`), a?.lastModifiedDate || (a.lastModifiedDate = /* @__PURE__ */ new Date()), a?.lastModified || (a.lastModified = a.lastModifiedDate.getTime()), a?.localURL || (a.localURL = e[0].localURL), n(a);
908
+ }, i.readAsArrayBuffer(t);
909
+ }, function(e) {
910
+ r(e), console.error("error with photo file");
911
+ });
912
+ }, function(e) {
913
+ r(e), console.error("error with photo file");
914
+ });
915
+ }, function(e) {
916
+ r(e), alert("Error taking picture", "Error");
917
+ }, i);
918
+ });
919
+ }
920
+ function qt(e = {}) {
921
+ return new Promise((t, n) => {
922
+ let r = {
923
+ quality: 0,
924
+ destinationType: 1,
925
+ sourceType: 1,
926
+ encodingType: 0,
927
+ ...e
928
+ };
929
+ navigator.device.capture.captureVideo(function(e) {
930
+ let r = e[0].localURL, i, a;
931
+ window.resolveLocalFileSystemURL(r, function(r) {
932
+ r.file(function(n) {
933
+ i = new FileReader(), i.onloadend = function(n) {
934
+ a = new Blob([this.result], { type: "video/mp4" }), a?.uid || (a.uid = Date.now()), a?.name || (a.name = `${Date.now()}.${a.type?.replace("video/", "")}`), a?.lastModifiedDate || (a.lastModifiedDate = /* @__PURE__ */ new Date()), a?.lastModified || (a.lastModified = a.lastModifiedDate.getTime()), a?.localURL || (a.localURL = e[0].localURL), t(a);
935
+ }, i.readAsArrayBuffer(n);
936
+ }, function(e) {
937
+ n(e), console.error("error with photo file");
938
+ });
939
+ }, function(e) {
940
+ n(e), console.error("error with photo file");
941
+ });
942
+ }, function(e) {
943
+ n(e), alert("Error taking picture", "Error");
944
+ }, r);
945
+ });
946
+ }
947
+ //#endregion
948
+ //#region src/components/Uploader/common/ossUpload.js
949
+ async function Jt(e, t) {
950
+ let n = e, { ossUrl: r, signatureParams: i, ossParams: a, axiosConf: o, beforeUpload: s, thumbnailParams: c } = t || {}, l = new Ie({
951
+ axios: t.axios,
952
+ axiosConf: o,
953
+ serverUrl: r || Dt()?.serverUrl || "/api/v1/user/oss/getWebOssConfig"
954
+ }), u = [];
955
+ return n?.forEach((e) => {
956
+ typeof e == "string" ? u.push(Promise.resolve(e)) : typeof e.ossUrl == "string" ? u.push(Promise.resolve(e.ossUrl)) : u.push(new Promise(async (n, r) => {
957
+ let u = await (s && s(e, { reject: r })) || e;
958
+ l.upload(u, {
959
+ ...t,
960
+ signatureParams: {
961
+ isPublic: 1,
962
+ ...i || {}
963
+ },
964
+ ossParams: a,
965
+ axiosConf: o,
966
+ thumbnailParams: c
967
+ }).then((e) => {
968
+ let t = e?.data?.data?.fileUrl;
969
+ return Dt()?.showThumbnail && (t = {
970
+ fileUrl: e?.data?.data?.fileUrl,
971
+ thumbnailUrl: e?.data?.data?.thumbnailUrl
972
+ }), n(t), Promise.resolve(t);
973
+ }).catch(r);
974
+ }));
975
+ }), Promise.all(u).then((e) => (e?.forEach((e, t) => {
976
+ n[t].ossUrl = e?.fileUrl, Dt()?.showThumbnail && (n[t].thumbnailUrl = e?.thumbnailUrl);
977
+ }), Promise.resolve(n)));
978
+ }
979
+ //#endregion
980
+ //#region src/common/location-utils.ts
981
+ function Yt(e) {
982
+ return new Promise((t, n) => {
983
+ navigator?.geolocation?.getCurrentPosition((e) => {
984
+ t(e);
985
+ }, n, {
986
+ enableHighAccuracy: !0,
987
+ timeout: 5e3,
988
+ ...e
989
+ });
990
+ });
991
+ }
992
+ function Xt(e) {
993
+ if (!navigator.camera) {
994
+ console.error("navigator.camera is undefined");
995
+ return;
996
+ }
997
+ if (typeof window.resolveLocalFileSystemURL != "function") {
998
+ console.error("window the property 'resolveLocalFileSystemURL' does not exist");
999
+ return;
1000
+ }
1001
+ let { onUploadSuccess: t, onUploadError: n, options: r } = e || {};
1002
+ try {
1003
+ let e = {
1004
+ quality: 50,
1005
+ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,
1006
+ destinationType: navigator.camera.DestinationType.FILE_URI,
1007
+ ...r || {}
1008
+ }, i = (e) => {
1009
+ if (r?.destinationType === navigator.camera.DestinationType.DATA_URL) {
1010
+ t?.(e);
1011
+ return;
1012
+ }
1013
+ let n = ~e.indexOf("file://") ? e : `file://${e}`;
1014
+ window.resolveLocalFileSystemURL(n, function(e) {
1015
+ e.file(function(e) {
1016
+ let n = new FileReader();
1017
+ n.onloadend = function(e) {
1018
+ if (n.result) {
1019
+ let e = Qt(new Blob([n.result], { type: "jpeg" }));
1020
+ t?.(e);
1021
+ }
1022
+ }, n.readAsArrayBuffer(e);
1023
+ }, function(e) {
1024
+ a(e), console.error("fileEntry error", e);
1025
+ });
1026
+ }, function(e) {
1027
+ a(e), console.error("resolveLocalFileSystemURL error", e);
1028
+ });
1029
+ }, a = (e) => {
1030
+ n?.(e);
1031
+ };
1032
+ navigator.camera.getPicture(i, a, e);
1033
+ } catch (e) {
1034
+ n?.(e);
1035
+ }
1036
+ }
1037
+ var Zt = class {
1038
+ uploader;
1039
+ defaultAccept = [
1040
+ "image/jpg",
1041
+ "image/jpeg",
1042
+ "image/png",
1043
+ "image/gif"
1044
+ ];
1045
+ constructor(e) {
1046
+ this.uploader = e;
1047
+ }
1048
+ addAccept(e) {
1049
+ this.defaultAccept = [...this.defaultAccept, ...e];
1050
+ }
1051
+ setUploader(e) {
1052
+ this.uploader = e;
1053
+ }
1054
+ uploadFile(e) {
1055
+ this.uploader.upload(e);
1056
+ }
1057
+ }, Qt = (e) => {
1058
+ let t = e;
1059
+ return !e?.name && e.type.indexOf("image/") > 0 && (e.name = `${Date.now()}.${e.type?.replace("image/", "")}`), t?.lastModifiedDate || (t.lastModifiedDate = /* @__PURE__ */ new Date()), t?.lastModified || (t.lastModified = t.lastModifiedDate.getTime()), t;
1060
+ }, $t = class extends Zt {
1061
+ async upload(e) {
1062
+ try {
1063
+ let { mimeTypes: t } = e?.additionalParams || {}, n = [...this.defaultAccept, ...t || []], r = await window.chooser.getFile({ mimeTypes: n.join(",") }), { path: i, size: a, mimeType: o } = r || {};
1064
+ if (console.log("file", r.mimeType, r?.size), n.includes(r.mimeType)) window.resolveLocalFileSystemURL(i, (t) => {
1065
+ t.file((t) => {
1066
+ let n = new FileReader();
1067
+ n.onloadend = () => {
1068
+ let t = Qt(new Blob([n.result], { type: o.replace(/.*\//, "") }));
1069
+ e.onSuccess?.({
1070
+ blob: t,
1071
+ fileType: o
1072
+ });
1073
+ }, n.readAsArrayBuffer(t);
1074
+ }, (t) => e.onError?.(t));
1075
+ }, (t) => e.onError?.(t));
1076
+ else {
1077
+ e?.errorCallback?.(2);
1078
+ return;
1079
+ }
1080
+ } catch (e) {
1081
+ console.error("chooser:", e);
1082
+ }
1083
+ }
1084
+ }, en = Ue("lodash");
1085
+ function tn(e, t) {
1086
+ let { name: n, multiple: r, mode: i = "select", onChange: a, accept: d, disabled: f, readOnly: p, readPretty: m, value: h, baseUrl: g = "", maxSize: _, maxCount: v = 1, isOssUpload: y, isStrRes: b, isResRemoveArr: x = !0, ossUrl: S, ossOpt: w, onCountExceed: T, headers: E, uploadBtnNode: D, uploadCallback: O, cordovaPlugin: k = "cordova-plugin-camera", uploaderProps: A, thumbnailParams: j = { image_process: "resize,w_200" } } = e, [M, N] = u(!1), [P, F] = u(Ft(h, v, {
1087
+ thumbnailParams: j,
1088
+ ossOpt: w
1089
+ })), [I, L] = u(!1), R = l(new Zt(new $t()));
1090
+ o(() => {
1091
+ F(Ft(h, v, {
1092
+ thumbnailParams: j,
1093
+ ossOpt: w
1094
+ }));
1095
+ }, [h, w]), s(t, () => ({
1096
+ onPicker: U,
1097
+ setActionSheetVisible: L
1098
+ }));
1099
+ async function z(t) {
1100
+ t.persist();
1101
+ let { files: n } = t.target, r = [...P, ...[].slice.call(n)];
1102
+ v > 0 && r.length > v && (T && T(r.length - v), r.length = v, ie.show({
1103
+ icon: "fail",
1104
+ content: "文件个数超出限制"
1105
+ })), r = r.filter((e) => (e.uid ||= Pe(), _ && e.size > _ ? (ie.show({
1106
+ icon: "fail",
1107
+ content: "文件大小超出限制:" + e.size
1108
+ }), !1) : e)), y && (N(!0), r = await Jt(r, {
1109
+ axios: e.axios,
1110
+ axiosConf: e?.axiosConf,
1111
+ ...w,
1112
+ ossUrl: S,
1113
+ thumbnailParams: j
1114
+ }), N(!1)), t.target.value = "", B(r);
1115
+ }
1116
+ function B(e, t) {
1117
+ let n = e;
1118
+ t !== "del" && v > 1 && (n = [...P, ...n]), n = Pt(e, v), F(n), y && b && (n = n?.map((e) => e.url || e.ossUrl)), !n || n.length <= 0 ? n = void 0 : x && v === 1 && (n = n[0]), a && a(n);
1119
+ }
1120
+ let te = l(), V = l(), H = c(() => {
1121
+ let e = {
1122
+ select: {
1123
+ text: "选择文件",
1124
+ key: "select"
1125
+ },
1126
+ image: {
1127
+ text: "拍照",
1128
+ key: "captureImage"
1129
+ },
1130
+ video: {
1131
+ text: "录像",
1132
+ key: "captureVideo"
1133
+ },
1134
+ audio: {
1135
+ text: "录音",
1136
+ key: "captureAudio"
1137
+ }
1138
+ };
1139
+ return Array.isArray(i) ? i.filter((t) => !!e[t]).map((t) => e[t]) : i === "all" ? Object.keys(e).map((t) => e[t]) : e[i] ? [e[i]] : [e.select];
1140
+ }, [i]);
1141
+ function U({ key: t }) {
1142
+ switch (t) {
1143
+ case "select":
1144
+ navigator?.camera && k === "cordova-plugin-camera" ? Xt?.({
1145
+ onUploadSuccess: (e) => {
1146
+ z({
1147
+ persist: () => {},
1148
+ target: {
1149
+ value: "",
1150
+ files: [e]
1151
+ }
1152
+ });
1153
+ },
1154
+ options: {
1155
+ cameraDirection: A?.CameraConf?.frontCamera ? Camera.Direction.FRONT : null,
1156
+ ...A?.CameraConf
1157
+ }
1158
+ }) : window?.chooser && k === "cordova-plugin-chooser" ? R.current.uploadFile({
1159
+ errorCallback(e) {
1160
+ e === 2 && ie.show("文件类型错误,请重新选择");
1161
+ },
1162
+ onSuccess(e) {
1163
+ z({
1164
+ persist: () => {},
1165
+ target: {
1166
+ value: "",
1167
+ files: [e.blob]
1168
+ }
1169
+ });
1170
+ },
1171
+ onError(e) {
1172
+ console.log("文件选择失败:", e);
1173
+ }
1174
+ }) : te.current.click();
1175
+ break;
1176
+ case "captureImage":
1177
+ Kt(e.imgPluginOpt, e.getImgOpt).then((e) => {
1178
+ z({
1179
+ persist: () => {},
1180
+ target: {
1181
+ value: "",
1182
+ files: [e]
1183
+ }
1184
+ });
1185
+ });
1186
+ break;
1187
+ case "captureVideo":
1188
+ qt().then((e) => {
1189
+ z({
1190
+ persist: () => {},
1191
+ target: {
1192
+ value: "",
1193
+ files: [e]
1194
+ }
1195
+ });
1196
+ });
1197
+ break;
1198
+ case "captureAudio": V.current.click();
1199
+ }
1200
+ L(!1);
1201
+ }
1202
+ function W(e) {
1203
+ ee.confirm({
1204
+ content: "确认删除?",
1205
+ onConfirm: () => {
1206
+ let t = en.cloneDeep(P);
1207
+ t.splice(e, 1), B(t, "del"), F(t);
1208
+ }
1209
+ });
1210
+ }
1211
+ let G = {
1212
+ className: "aria-hidden",
1213
+ style: { display: "none" },
1214
+ id: n,
1215
+ onChange: z,
1216
+ type: "file",
1217
+ name: n,
1218
+ multiple: r,
1219
+ accept: d,
1220
+ capture: e.capture
1221
+ };
1222
+ return /* @__PURE__ */ Z("div", {
1223
+ className: "uploader",
1224
+ children: [
1225
+ /* @__PURE__ */ X("input", {
1226
+ ...G,
1227
+ ref: te
1228
+ }),
1229
+ /* @__PURE__ */ X("input", {
1230
+ ...G,
1231
+ ref: V,
1232
+ id: n + "-audio",
1233
+ accept: "audio/*"
1234
+ }),
1235
+ /* @__PURE__ */ X(Gt, {
1236
+ fileList: P,
1237
+ baseUrl: y ? g : "",
1238
+ disabled: f,
1239
+ readOnly: p,
1240
+ onItemDel: W,
1241
+ headers: E
1242
+ }),
1243
+ f || p || m || v > 0 && P.length >= v ? null : /* @__PURE__ */ Z(he, { children: [/* @__PURE__ */ X("div", {
1244
+ className: `uploader-add-btn ${M ? "uploader-add-btn-loading" : ""}`,
1245
+ onClick: async () => {
1246
+ M || (O && await O(), L(!0));
1247
+ },
1248
+ loading: M,
1249
+ children: M ? "上传中..." : D || "+"
1250
+ }), /* @__PURE__ */ X(C, {
1251
+ cancelText: "取消",
1252
+ visible: I,
1253
+ actions: H,
1254
+ onAction: U,
1255
+ onClose: () => L(!1)
1256
+ })] })
1257
+ ]
1258
+ });
1259
+ }
1260
+ var nn = r(tn), rn = n(null), an = () => a(rn), on = r((e, t) => {
1261
+ let n = Q(23), r = l(null), i = an() || {}, { field: a, onChange: o, value: c } = e, u;
1262
+ n[0] === a ? u = n[1] : (u = a === void 0 ? {} : a, n[0] = a, n[1] = u);
1263
+ let d = u, { name: f, mode: p, componentProps: m } = d, h;
1264
+ n[2] === m ? h = n[3] : (h = m === void 0 ? {} : m, n[2] = m, n[3] = h);
1265
+ let g = h, { multiple: _ } = g, v;
1266
+ n[4] === Symbol.for("react.memo_cache_sentinel") ? (v = () => ({
1267
+ onSelectFile: (e) => r.current?.onPicker?.({ key: e || "select" }),
1268
+ setActionSheetVisible: (e) => r.current?.setActionSheetVisible?.(e)
1269
+ }), n[4] = v) : v = n[4], s(t, v);
1270
+ let y;
1271
+ n[5] !== d.autoUpload || n[6] !== _ || n[7] !== f || n[8] !== o || n[9] !== e.fieldsConf ? (y = async function(t) {
1272
+ let n = t;
1273
+ d?.autoUpload && e.fieldsConf[f]?.onUpload && (n = await e.fieldsConf[f]?.onUpload(t), !n) || (!_ && n && n.length === 1 && (n = n[0]), o && o(n));
1274
+ }, n[5] = d.autoUpload, n[6] = _, n[7] = f, n[8] = o, n[9] = e.fieldsConf, n[10] = y) : y = n[10];
1275
+ let b = y, x;
1276
+ n[11] === c ? x = n[12] : (x = typeof c == "string" ? [c] : c, n[11] = c, n[12] = x);
1277
+ let S = i?.axios, C = i?.axiosConf, w;
1278
+ n[13] !== g || n[14] !== p || n[15] !== e || n[16] !== x || n[17] !== S || n[18] !== C ? (w = {
1279
+ mode: p,
1280
+ ...e,
1281
+ value: x,
1282
+ axios: S,
1283
+ axiosConf: C,
1284
+ ...g
1285
+ }, n[13] = g, n[14] = p, n[15] = e, n[16] = x, n[17] = S, n[18] = C, n[19] = w) : w = n[19];
1286
+ let T = w, E;
1287
+ return n[20] !== T || n[21] !== b ? (E = /* @__PURE__ */ X(nn, {
1288
+ ...T,
1289
+ onChange: b,
1290
+ ref: r
1291
+ }), n[20] = T, n[21] = b, n[22] = E) : E = n[22], E;
1292
+ }), sn = on, $ = {
1293
+ "popup-head-action": "_popup-head-action_1ki5c_1",
1294
+ "popup-head": "_popup-head_1ki5c_1",
1295
+ "search-warp": "_search-warp_1ki5c_8",
1296
+ list: "_list_1ki5c_11",
1297
+ search: "_search_1ki5c_8",
1298
+ item: "_item_1ki5c_32",
1299
+ "item-text": "_item-text_1ki5c_36",
1300
+ "item-text__name": "_item-text__name_1ki5c_39",
1301
+ "item-text__phone": "_item-text__phone_1ki5c_43",
1302
+ "item-text__idCard": "_item-text__idCard_1ki5c_44",
1303
+ placeholder: "_placeholder_1ki5c_48"
1304
+ }, cn = 3, ln = (e) => {
1305
+ let t = Q(9), n, r;
1306
+ if (t[0] !== e) {
1307
+ let { value: i, onChange: a, ...o } = e;
1308
+ n = a, r = o, t[0] = e, t[1] = n, t[2] = r;
1309
+ } else n = t[1], r = t[2];
1310
+ let [i, a] = u(""), o;
1311
+ t[3] === n ? o = t[4] : (o = (e) => {
1312
+ let t = e.target.value;
1313
+ a?.(t), n?.(t);
1314
+ }, t[3] = n, t[4] = o);
1315
+ let s = o, c;
1316
+ return t[5] !== s || t[6] !== r || t[7] !== i ? (c = /* @__PURE__ */ X("div", {
1317
+ className: $.search,
1318
+ children: /* @__PURE__ */ X("input", {
1319
+ type: "search",
1320
+ ...r,
1321
+ value: i,
1322
+ onChange: s
1323
+ })
1324
+ }), t[5] = s, t[6] = r, t[7] = i, t[8] = c) : c = t[8], c;
1325
+ }, un = (e) => {
1326
+ let t = Q(52), { value: n, onChange: r, options: i, mode: a, isAvatar: o, avatarSize: s, infoRender: c, configKey: l, shape: d } = e, f = s === void 0 ? 32 : s, p = d === void 0 ? "square" : d, m = J(), [h, g] = u(!1), [_, v] = u(i), y;
1327
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (y = [], t[0] = y) : y = t[0];
1328
+ let [b, x] = u(y), S;
1329
+ t[1] !== m || t[2] !== r || t[3] !== i ? (S = (e) => {
1330
+ let t = i.filter((t) => e.includes(t.value.toString()));
1331
+ m.setValue(t), r && r(t);
1332
+ }, t[1] = m, t[2] = r, t[3] = i, t[4] = S) : S = t[4];
1333
+ let C = S, T = dn, D;
1334
+ bb0: {
1335
+ if (p === "circle") {
1336
+ D = "50%";
1337
+ break bb0;
1338
+ }
1339
+ if (p === "square") {
1340
+ D = "4px";
1341
+ break bb0;
1342
+ }
1343
+ D = "4px";
1344
+ }
1345
+ let O = D, A;
1346
+ t[5] !== O || t[6] !== f || t[7] !== l?.phoneKey || t[8] !== c || t[9] !== o ? (A = (e) => /* @__PURE__ */ Z("div", {
1347
+ className: $.item,
1348
+ children: [o && /* @__PURE__ */ X(w, {
1349
+ src: e.avatar,
1350
+ style: {
1351
+ "--size": `${f}px`,
1352
+ "--border-radius": O
1353
+ }
1354
+ }), c || /* @__PURE__ */ Z("div", {
1355
+ className: $["item-text"],
1356
+ children: [
1357
+ /* @__PURE__ */ X("div", {
1358
+ className: $["item-text__name"],
1359
+ children: e.lable
1360
+ }),
1361
+ /* @__PURE__ */ Z("div", {
1362
+ className: $["item-text__phone"],
1363
+ children: ["手机号:", T(e, l?.phoneKey, "phone")]
1364
+ }),
1365
+ /* @__PURE__ */ Z("div", {
1366
+ className: $["item-text__idCard"],
1367
+ children: ["身份证号:", T(e, l?.phoneKey, "idCard")]
1368
+ })
1369
+ ]
1370
+ })]
1371
+ }), t[5] = O, t[6] = f, t[7] = l?.phoneKey, t[8] = c, t[9] = o, t[10] = A) : A = t[10];
1372
+ let j = A, M;
1373
+ t[11] === i ? M = t[12] : (M = (e) => {
1374
+ let t = e.toLowerCase(), n = i.filter((e) => Object.keys(e).some((n) => e[n].toString().toLowerCase().includes(t)));
1375
+ v(n);
1376
+ }, t[11] = i, t[12] = M);
1377
+ let ee = M, N;
1378
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (N = () => {
1379
+ g(!1);
1380
+ }, t[13] = N) : N = t[13];
1381
+ let P = N, F;
1382
+ t[14] === m.value ? F = t[15] : (F = () => {
1383
+ let e = m.value.map(fn);
1384
+ x(e), g(!1);
1385
+ }, t[14] = m.value, t[15] = F);
1386
+ let I = F, L;
1387
+ bb1: {
1388
+ if (b.length >= cn) {
1389
+ let e;
1390
+ t[16] === b ? e = t[17] : (e = b.slice(0, cn).join("、"), t[16] = b, t[17] = e), L = `${e}...等${b.length}人`;
1391
+ break bb1;
1392
+ }
1393
+ let e;
1394
+ t[18] === b ? e = t[19] : (e = b.join("、"), t[18] = b, t[19] = e), L = e;
1395
+ }
1396
+ let R = L, z;
1397
+ t[20] === Symbol.for("react.memo_cache_sentinel") ? (z = () => g(!0), t[20] = z) : z = t[20];
1398
+ let B = R || "请选择", V;
1399
+ t[21] === B ? V = t[22] : (V = /* @__PURE__ */ X("div", {
1400
+ onClick: z,
1401
+ className: $.placeholder,
1402
+ children: B
1403
+ }), t[21] = B, t[22] = V);
1404
+ let H, U;
1405
+ t[23] === Symbol.for("react.memo_cache_sentinel") ? (H = () => g(!1), U = {
1406
+ borderTopLeftRadius: "8px",
1407
+ borderTopRightRadius: "8px"
1408
+ }, t[23] = H, t[24] = U) : (H = t[23], U = t[24]);
1409
+ let W;
1410
+ t[25] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ X(E, {
1411
+ fill: "none",
1412
+ onClick: P,
1413
+ children: "取消"
1414
+ }), t[25] = W) : W = t[25];
1415
+ let G;
1416
+ t[26] === I ? G = t[27] : (G = /* @__PURE__ */ Z("div", {
1417
+ className: $["popup-head-action"],
1418
+ children: [W, /* @__PURE__ */ X(E, {
1419
+ color: "primary",
1420
+ fill: "none",
1421
+ onClick: I,
1422
+ children: "确定"
1423
+ })]
1424
+ }), t[26] = I, t[27] = G);
1425
+ let ne;
1426
+ t[28] === ee ? ne = t[29] : (ne = /* @__PURE__ */ X("div", {
1427
+ className: $["search-warp"],
1428
+ children: /* @__PURE__ */ X(ln, {
1429
+ onChange: ee,
1430
+ placeholder: "请输入关键字搜索"
1431
+ })
1432
+ }), t[28] = ee, t[29] = ne);
1433
+ let re;
1434
+ t[30] !== G || t[31] !== ne ? (re = /* @__PURE__ */ Z("div", {
1435
+ className: $["popup-head"],
1436
+ children: [G, ne]
1437
+ }), t[30] = G, t[31] = ne, t[32] = re) : re = t[32];
1438
+ let ie = a === "multiple", ae;
1439
+ t[33] === n ? ae = t[34] : (ae = n?.map(pn), t[33] = n, t[34] = ae);
1440
+ let oe;
1441
+ if (t[35] !== _ || t[36] !== j) {
1442
+ let e;
1443
+ t[38] === j ? e = t[39] : (e = (e, t) => /* @__PURE__ */ X(k.Item, {
1444
+ value: e.value.toString(),
1445
+ children: j(e)
1446
+ }, e.value.toString() + t), t[38] = j, t[39] = e), oe = _.map(e), t[35] = _, t[36] = j, t[37] = oe;
1447
+ } else oe = t[37];
1448
+ let se;
1449
+ t[40] !== C || t[41] !== ie || t[42] !== ae || t[43] !== oe ? (se = /* @__PURE__ */ X("div", {
1450
+ className: $.list,
1451
+ children: /* @__PURE__ */ X(k, {
1452
+ multiple: ie,
1453
+ value: ae,
1454
+ onChange: C,
1455
+ children: oe
1456
+ })
1457
+ }), t[40] = C, t[41] = ie, t[42] = ae, t[43] = oe, t[44] = se) : se = t[44];
1458
+ let K;
1459
+ t[45] !== re || t[46] !== se || t[47] !== h ? (K = /* @__PURE__ */ Z(te, {
1460
+ visible: h,
1461
+ onMaskClick: H,
1462
+ bodyStyle: U,
1463
+ children: [re, se]
1464
+ }), t[45] = re, t[46] = se, t[47] = h, t[48] = K) : K = t[48];
1465
+ let ce;
1466
+ return t[49] !== V || t[50] !== K ? (ce = /* @__PURE__ */ Z(he, { children: [V, K] }), t[49] = V, t[50] = K, t[51] = ce) : ce = t[51], ce;
1467
+ };
1468
+ function dn(e, t, n) {
1469
+ return t ? e[t] : e[n];
1470
+ }
1471
+ function fn(e) {
1472
+ return e.lable;
1473
+ }
1474
+ function pn(e) {
1475
+ return e.value.toString();
1476
+ }
1477
+ //#endregion
1478
+ //#region src/components/Radio/index.tsx
1479
+ var mn = (e) => {
1480
+ let t = Q(4), n = J(), r = n.value === e.value, i;
1481
+ return t[0] !== n.onInput || t[1] !== e || t[2] !== r ? (i = /* @__PURE__ */ X(V, {
1482
+ ...e,
1483
+ checked: r,
1484
+ onChange: n.onInput
1485
+ }), t[0] = n.onInput, t[1] = e, t[2] = r, t[3] = i) : i = t[3], i;
1486
+ }, hn = (e) => {
1487
+ let t = Q(26), n, r;
1488
+ if (t[0] !== e) {
1489
+ let { children: i, optionType: a, ...o } = e;
1490
+ n = a, r = o, t[0] = e, t[1] = n, t[2] = r;
1491
+ } else n = t[1], r = t[2];
1492
+ let i = J(), a = de(), o = n === "button", s;
1493
+ t[3] === a?.enum ? s = t[4] : (s = a?.enum || [], t[3] = a?.enum, t[4] = s);
1494
+ let c = s;
1495
+ if (o && c.length > 0) {
1496
+ let e = c, n;
1497
+ t[5] === e ? n = t[6] : (n = e.map(_n), t[5] = e, t[6] = n);
1498
+ let a = n, o = r, s;
1499
+ t[7] === i.value ? s = t[8] : (s = [i.value], t[7] = i.value, t[8] = s);
1500
+ let l;
1501
+ t[9] === i ? l = t[10] : (l = (e) => {
1502
+ i.setValue(e[0]);
1503
+ }, t[9] = i, t[10] = l);
1504
+ let u;
1505
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (u = {
1506
+ "--checked-color": "#186DDA",
1507
+ "--checked-text-color": "#FFFFFF"
1508
+ }, t[11] = u) : u = t[11];
1509
+ let d;
1510
+ return t[12] !== a || t[13] !== o || t[14] !== s || t[15] !== l ? (d = /* @__PURE__ */ X(U, {
1511
+ ...o,
1512
+ showCheckMark: !1,
1513
+ options: a,
1514
+ value: s,
1515
+ onChange: l,
1516
+ style: u
1517
+ }), t[12] = a, t[13] = o, t[14] = s, t[15] = l, t[16] = d) : d = t[16], d;
1518
+ }
1519
+ {
1520
+ let e = i.value ?? null, n;
1521
+ t[17] === i ? n = t[18] : (n = (e) => {
1522
+ i.setValue(e);
1523
+ }, t[17] = i, t[18] = n);
1524
+ let a = c, o;
1525
+ t[19] === a ? o = t[20] : (o = a.map(vn), t[19] = a, t[20] = o);
1526
+ let s;
1527
+ return t[21] !== r || t[22] !== e || t[23] !== n || t[24] !== o ? (s = /* @__PURE__ */ X(V.Group, {
1528
+ ...r,
1529
+ value: e,
1530
+ onChange: n,
1531
+ children: o
1532
+ }), t[21] = r, t[22] = e, t[23] = n, t[24] = o, t[25] = s) : s = t[25], s;
1533
+ }
1534
+ }, gn = q(mn);
1535
+ gn.Group = q(hn);
1536
+ function _n(e) {
1537
+ return {
1538
+ label: e.label,
1539
+ value: e.value
1540
+ };
1541
+ }
1542
+ function vn(e) {
1543
+ return /* @__PURE__ */ X(V, {
1544
+ value: e.value,
1545
+ children: e.label
1546
+ }, e.value);
1547
+ }
1548
+ //#endregion
1549
+ //#region src/components/Checkbox/index.tsx
1550
+ var yn = {
1551
+ defaultColor: "#f5f5f5",
1552
+ defaultTextColor: "#333333",
1553
+ allCheckedColor: "#186DDA",
1554
+ allCheckedTextColor: "#ffffff",
1555
+ someCheckedColor: "#e7f1ff",
1556
+ someCheckedTextColor: "#1677ff"
1557
+ }, bn = (e) => {
1558
+ let t = Q(10), n = J(), r;
1559
+ t[0] !== n.value || t[1] !== e.value ? (r = n.value.includes(e.value), t[0] = n.value, t[1] = e.value, t[2] = r) : r = t[2];
1560
+ let i;
1561
+ t[3] !== n || t[4] !== e.value ? (i = () => {
1562
+ let t = n.value.includes(e.value) ? n.value.filter((t) => t !== e.value) : [...n.value, e.value];
1563
+ n.setValue(t);
1564
+ }, t[3] = n, t[4] = e.value, t[5] = i) : i = t[5];
1565
+ let a;
1566
+ return t[6] !== e || t[7] !== r || t[8] !== i ? (a = /* @__PURE__ */ X(A, {
1567
+ ...e,
1568
+ checked: r,
1569
+ onChange: i
1570
+ }), t[6] = e, t[7] = r, t[8] = i, t[9] = a) : a = t[9], a;
1571
+ }, xn = (e) => {
1572
+ let t = Q(64), n, r, i;
1573
+ if (t[0] !== e) {
1574
+ let { children: a, optionType: o, indeterminate: s, ...c } = e;
1575
+ r = o, n = s, i = c, t[0] = e, t[1] = n, t[2] = r, t[3] = i;
1576
+ } else n = t[1], r = t[2], i = t[3];
1577
+ let a = J(), s = de(), c = r === "button", l;
1578
+ t[4] === s?.enum ? l = t[5] : (l = s?.enum || [], t[4] = s?.enum, t[5] = l);
1579
+ let d = l, [f, p] = u("#f5f5f5"), m;
1580
+ t[6] !== d || t[7] !== a.value ? (m = d?.every((e) => a.value?.includes(e.value)), t[6] = d, t[7] = a.value, t[8] = m) : m = t[8];
1581
+ let h = m, g;
1582
+ t[9] !== d || t[10] !== a.value ? (g = d?.every((e) => !a.value?.includes(e.value)), t[9] = d, t[10] = a.value, t[11] = g) : g = t[11];
1583
+ let _ = g, v = !h && !_, y;
1584
+ t[12] !== h || t[13] !== _ || t[14] !== v ? (y = {
1585
+ allChecked: h,
1586
+ noneChecked: _,
1587
+ someChecked: v
1588
+ }, t[12] = h, t[13] = _, t[14] = v, t[15] = y) : y = t[15];
1589
+ let { allChecked: b, someChecked: x } = y, S, C;
1590
+ t[16] !== b || t[17] !== x ? (S = () => {
1591
+ p(b ? yn.allCheckedColor : x ? yn.someCheckedColor : yn.defaultColor);
1592
+ }, C = [b, x], t[16] = b, t[17] = x, t[18] = S, t[19] = C) : (S = t[18], C = t[19]), o(S, C);
1593
+ let w;
1594
+ t[20] !== d || t[21] !== a ? (w = (e) => {
1595
+ e ? a.setValue(d?.map(Cn)) : a.setValue([]);
1596
+ }, t[20] = d, t[21] = a, t[22] = w) : w = t[22];
1597
+ let T = w;
1598
+ if (c && d.length > 0) {
1599
+ let e = d, r;
1600
+ t[23] === e ? r = t[24] : (r = e.map(wn), t[23] = e, t[24] = r);
1601
+ let o = r, s;
1602
+ t[25] === Symbol.for("react.memo_cache_sentinel") ? (s = { width: "100%" }, t[25] = s) : s = t[25];
1603
+ let c;
1604
+ t[26] !== b || t[27] !== T || t[28] !== n || t[29] !== f || t[30] !== x ? (c = n && /* @__PURE__ */ X(U, {
1605
+ options: [{
1606
+ label: "全选",
1607
+ value: "1"
1608
+ }],
1609
+ value: b ? ["1"] : [],
1610
+ showCheckMark: !1,
1611
+ style: {
1612
+ "--color": f,
1613
+ "--text-color": b || x ? yn.someCheckedTextColor : yn.defaultTextColor,
1614
+ "--checked-color": f,
1615
+ "--checked-text-color": yn.allCheckedTextColor
1616
+ },
1617
+ onChange: (e) => {
1618
+ let [t] = e;
1619
+ return T(t === "1");
1620
+ }
1621
+ }), t[26] = b, t[27] = T, t[28] = n, t[29] = f, t[30] = x, t[31] = c) : c = t[31];
1622
+ let l = i, u;
1623
+ t[32] === a.value ? u = t[33] : (u = a.value ?? [], t[32] = a.value, t[33] = u);
1624
+ let p;
1625
+ t[34] === a ? p = t[35] : (p = (e) => {
1626
+ a.setValue(e);
1627
+ }, t[34] = a, t[35] = p);
1628
+ let m;
1629
+ t[36] === Symbol.for("react.memo_cache_sentinel") ? (m = {
1630
+ "--checked-color": yn.allCheckedColor,
1631
+ "--checked-text-color": yn.allCheckedTextColor
1632
+ }, t[36] = m) : m = t[36];
1633
+ let h;
1634
+ t[37] !== o || t[38] !== l || t[39] !== u || t[40] !== p ? (h = /* @__PURE__ */ X(U, {
1635
+ ...l,
1636
+ multiple: !0,
1637
+ showCheckMark: !1,
1638
+ options: o,
1639
+ value: u,
1640
+ onChange: p,
1641
+ style: m
1642
+ }), t[37] = o, t[38] = l, t[39] = u, t[40] = p, t[41] = h) : h = t[41];
1643
+ let g;
1644
+ return t[42] !== c || t[43] !== h ? (g = /* @__PURE__ */ Z(G, {
1645
+ className: "selector",
1646
+ wrap: !0,
1647
+ justify: "end",
1648
+ style: s,
1649
+ children: [c, h]
1650
+ }), t[42] = c, t[43] = h, t[44] = g) : g = t[44], g;
1651
+ }
1652
+ {
1653
+ let e;
1654
+ t[45] !== b || t[46] !== T || t[47] !== n || t[48] !== x ? (e = n && /* @__PURE__ */ X(A, {
1655
+ checked: b,
1656
+ indeterminate: x,
1657
+ onChange: (e) => T(e),
1658
+ children: "全选"
1659
+ }), t[45] = b, t[46] = T, t[47] = n, t[48] = x, t[49] = e) : e = t[49];
1660
+ let r;
1661
+ t[50] === a.value ? r = t[51] : (r = a.value ?? [], t[50] = a.value, t[51] = r);
1662
+ let o;
1663
+ t[52] === a ? o = t[53] : (o = (e) => {
1664
+ a.setValue(e);
1665
+ }, t[52] = a, t[53] = o);
1666
+ let s = d, c;
1667
+ t[54] === s ? c = t[55] : (c = s.map(Tn), t[54] = s, t[55] = c);
1668
+ let l;
1669
+ t[56] !== i || t[57] !== o || t[58] !== c || t[59] !== r ? (l = /* @__PURE__ */ X(A.Group, {
1670
+ ...i,
1671
+ value: r,
1672
+ onChange: o,
1673
+ children: c
1674
+ }), t[56] = i, t[57] = o, t[58] = c, t[59] = r, t[60] = l) : l = t[60];
1675
+ let u;
1676
+ return t[61] !== l || t[62] !== e ? (u = /* @__PURE__ */ Z(he, { children: [e, l] }), t[61] = l, t[62] = e, t[63] = u) : u = t[63], u;
1677
+ }
1678
+ }, Sn = q(bn);
1679
+ Sn.Group = q(xn);
1680
+ function Cn(e) {
1681
+ return e.value;
1682
+ }
1683
+ function wn(e) {
1684
+ return {
1685
+ label: e.label,
1686
+ value: e.value
1687
+ };
1688
+ }
1689
+ function Tn(e) {
1690
+ return /* @__PURE__ */ X(A, {
1691
+ value: e.value,
1692
+ children: e.label
1693
+ }, e.value);
1694
+ }
1695
+ //#endregion
1696
+ //#region src/components/LocationPicker/assets/svg-icon.jsx
1697
+ var En = "data:image/svg+xml;charset=utf-8;base64,ICA8c3ZnCiAgICB0PSIxNzA4NDk3MTY0NjU0IgogICAgY2xhc3M9Imljb24iCiAgICB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IgogICAgdmVyc2lvbj0iMS4xIgogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICAgcC1pZD0iODQ4OSIKICAgIHdpZHRoPSIyMDAiCiAgICBoZWlnaHQ9IjIwMCIKICA+CiAgICA8cGF0aAogICAgICBkPSJNNTEyIDEwMjRjLTIwNS43Ni0yNDEuNDcyLTMyNi4yNzItNDExLjcxMi0zNjEuNjY0LTUxMC43MmEzODQgMzg0IDAgMSAxIDcyMy4wNzIgMC44MzJDODM3Ljc2IDYxMi45MjggNzE3LjMxMiA3ODIuODQ4IDUxMiAxMDI0LjA2NHogbTAtNTEyYTEyOCAxMjggMCAxIDAgMC0yNTYgMTI4IDEyOCAwIDAgMCAwIDI1NnoiCiAgICAgIGZpbGw9IiMxNjc3ZmYiCiAgICAgIHAtaWQ9Ijg0OTAiCiAgICA+PC9wYXRoPgogIDwvc3ZnPg==", Dn = /* @__PURE__ */ Z("svg", {
1698
+ t: "1708305242338",
1699
+ className: "picker-icon",
1700
+ viewBox: "0 0 1088 1024",
1701
+ version: "1.1",
1702
+ xmlns: "http://www.w3.org/2000/svg",
1703
+ "p-id": "1494",
1704
+ width: "200",
1705
+ height: "200",
1706
+ children: [/* @__PURE__ */ X("path", {
1707
+ d: "M812.224 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576 193.472-184.448 288-338.432 288-456.576z m-288 544c-234.688-213.312-352-394.688-352-544a352 352 0 1 1 704 0c0 149.312-117.312 330.688-352 544z",
1708
+ fill: "#1677ff",
1709
+ "p-id": "1495"
1710
+ }), /* @__PURE__ */ X("path", {
1711
+ d: "M524.224 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256z m345.6 192l102.4 256h-288v-64h-320v64h-288l102.4-256h691.2z m-68.928 0H247.552l-76.8 192h706.944l-76.8-192z",
1712
+ fill: "#1677ff",
1713
+ "p-id": "1496"
1714
+ })]
1715
+ }), On = /* @__PURE__ */ X("svg", {
1716
+ t: "1708478996666",
1717
+ className: "position-icon",
1718
+ viewBox: "0 0 1024 1024",
1719
+ version: "1.1",
1720
+ xmlns: "http://www.w3.org/2000/svg",
1721
+ "p-id": "6897",
1722
+ width: "200",
1723
+ height: "200",
1724
+ children: /* @__PURE__ */ X("path", {
1725
+ d: "M895.044488 550.176484l-42.200124 0C834.62235 708.540282 709.048353 834.001715 550.718325 852.244194l0 42.258453c0 21.946848-17.790178 39.730886-39.729863 39.730886s-39.729863-17.784038-39.729863-39.730886l0-42.258453C312.926524 834.001715 187.354574 708.540282 169.131537 550.176484l-42.199101 0c-21.940708 0-39.730886-17.786085-39.730886-39.729863 0-21.940708 17.789155-39.726793 39.730886-39.726793l42.257429 0c18.24248-158.335145 143.711076-283.907095 302.068733-302.126039l0-42.200124c0-21.940708 17.789155-39.730886 39.729863-39.730886s39.729863 17.789155 39.729863 39.730886l0 42.258453c158.331052 18.241456 283.904025 143.706983 302.126039 302.06771l42.200124 0c21.940708 0 39.729863 17.786085 39.729863 39.726793C934.774351 532.390399 916.986219 550.176484 895.044488 550.176484zM696.395172 470.719828l76.16161 0c-17.251919-114.39847-107.492176-204.651007-221.838458-221.913159l0 76.236312c0 21.939685-17.790178 39.726793-39.729863 39.726793s-39.729863-17.787108-39.729863-39.726793l0-76.165704c-114.39233 17.256012-204.644867 107.495246-221.910089 221.842551l76.233242 0c21.946848 0 39.729863 17.786085 39.729863 39.726793 0 21.943778-17.781992 39.729863-39.729863 39.729863l-76.162634 0c17.251919 114.39847 107.498316 204.649983 221.839481 221.910089l0-76.234265c0-21.943778 17.789155-39.72577 39.729863-39.72577s39.729863 17.781992 39.729863 39.72577l0 76.234265c114.346281-17.260106 204.586538-107.511619 221.838458-221.910089l-76.16161 0c-21.941732 0-39.729863-17.786085-39.729863-39.729863C656.665309 488.505913 674.453441 470.719828 696.395172 470.719828zM510.988462 550.176484c-21.939685 0-39.729863-17.786085-39.729863-39.729863 0-21.940708 17.789155-39.726793 39.729863-39.726793s39.729863 17.786085 39.729863 39.726793C550.718325 532.390399 532.928147 550.176484 510.988462 550.176484z",
1726
+ fill: "#000000",
1727
+ "p-id": "6898"
1728
+ })
1729
+ }), kn = /* @__PURE__ */ Z("svg", {
1730
+ t: "1708485324277",
1731
+ className: "reset-icon",
1732
+ viewBox: "0 0 1024 1024",
1733
+ version: "1.1",
1734
+ xmlns: "http://www.w3.org/2000/svg",
1735
+ "p-id": "7503",
1736
+ width: "200",
1737
+ height: "200",
1738
+ children: [/* @__PURE__ */ X("path", {
1739
+ d: "M512 682.666667c71.296 0 128-56.789333 128-128s-56.704-128-128-128-128 56.789333-128 128 56.704 128 128 128z",
1740
+ "p-id": "7504"
1741
+ }), /* @__PURE__ */ X("path", {
1742
+ d: "M888.192 477.269333a381.44 381.44 0 0 0-57.813333-137.344 386.261333 386.261333 0 0 0-103.68-103.68 381.866667 381.866667 0 0 0-137.344-57.813333 385.194667 385.194667 0 0 0-78.421334-7.68V85.333333L341.333333 213.333333l169.6 128V256.085333c20.650667-0.085333 41.301333 1.877333 61.226667 5.973334a297.002667 297.002667 0 0 1 106.752 44.928 298.88 298.88 0 0 1 80.725333 80.725333A297.258667 297.258667 0 0 1 810.666667 554.666667a300.032 300.032 0 0 1-23.466667 116.266666 303.36 303.36 0 0 1-27.477333 50.688 307.2 307.2 0 0 1-36.608 44.330667 299.861333 299.861333 0 0 1-150.869334 81.365333 304.213333 304.213333 0 0 1-120.405333 0 297.002667 297.002667 0 0 1-106.794667-44.970666 298.752 298.752 0 0 1-80.64-80.64A298.496 298.496 0 0 1 213.333333 554.666667H128a384.853333 384.853333 0 0 0 65.664 214.784 388.096 388.096 0 0 0 103.594667 103.594666A381.866667 381.866667 0 0 0 512 938.666667a387.84 387.84 0 0 0 77.397333-7.808 384.597333 384.597333 0 0 0 137.301334-57.813334 379.136 379.136 0 0 0 56.789333-46.890666 393.728 393.728 0 0 0 46.933333-56.832A381.952 381.952 0 0 0 896 554.666667a387.84 387.84 0 0 0-7.808-77.397334z",
1743
+ "p-id": "7505"
1744
+ })]
1745
+ });
1746
+ //#endregion
1747
+ //#region src/components/LocationPicker/common/utils.ts
1748
+ function An(e = {}, t) {
1749
+ let { lonKey: n = "longitude", latKey: r = "latitude", addrKey: i = "address" } = t || {};
1750
+ return {
1751
+ lon: e[n],
1752
+ lat: e[r],
1753
+ addr: e[i]
1754
+ };
1755
+ }
1756
+ //#endregion
1757
+ //#region src/components/LocationPicker/components/ResInfo/index.tsx
1758
+ var jn = q((e) => {
1759
+ let { onShow: t, lonKey: n, latKey: r, addrKey: i, value: a, pickerText: o = "选点", pickerIcon: s } = e || {};
1760
+ J();
1761
+ let l = c(() => An(a, {
1762
+ lonKey: n,
1763
+ latKey: r,
1764
+ addrKey: i
1765
+ }), [
1766
+ n,
1767
+ r,
1768
+ i,
1769
+ a,
1770
+ a?.[n],
1771
+ a?.[r],
1772
+ a?.[i]
1773
+ ]);
1774
+ return /* @__PURE__ */ Z("div", {
1775
+ className: "location-value-box",
1776
+ children: [
1777
+ /* @__PURE__ */ Z("div", {
1778
+ className: "location-lon-lat",
1779
+ children: [/* @__PURE__ */ Z("div", { children: [
1780
+ "经度:",
1781
+ l.lon,
1782
+ " "
1783
+ ] }), /* @__PURE__ */ Z("div", { children: ["纬度:", l.lat] })]
1784
+ }),
1785
+ /* @__PURE__ */ Z("div", { children: ["地址:", l.addr] }),
1786
+ /* @__PURE__ */ Z(E, {
1787
+ className: "location-btn",
1788
+ color: "primary",
1789
+ fill: "none",
1790
+ onClick: t,
1791
+ children: [/* @__PURE__ */ X("span", {
1792
+ className: "location-picker-icon-box",
1793
+ children: typeof s == "string" ? /* @__PURE__ */ X("img", {
1794
+ className: "location-picker-icon",
1795
+ src: s
1796
+ }) : s || Dn
1797
+ }), /* @__PURE__ */ X("span", {
1798
+ className: "location-picker-btn-text",
1799
+ children: o
1800
+ })]
1801
+ })
1802
+ ]
1803
+ });
1804
+ }), Mn = (e) => {
1805
+ let t = Q(44), { pickInfo: n, setPickInfo: r, setPoint: i, addrLoading: a, defaultLocation: o, disabled: s, readOnly: c } = e, l;
1806
+ t[0] !== n || t[1] !== r ? (l = function(e) {
1807
+ let t = e?.target?.value ?? e, i = { ...n };
1808
+ return i.lon = t, r(i), i;
1809
+ }, t[0] = n, t[1] = r, t[2] = l) : l = t[2];
1810
+ let u = l, d;
1811
+ t[3] !== n || t[4] !== r ? (d = function(e) {
1812
+ let t = e?.target?.value ?? e, i = { ...n };
1813
+ return i.lat = t, r(i), i;
1814
+ }, t[3] = n, t[4] = r, t[5] = d) : d = t[5];
1815
+ let f = d, p;
1816
+ t[6] !== o || t[7] !== u || t[8] !== i ? (p = function(e) {
1817
+ let t = u(e);
1818
+ i && i(t?.lon || o.lon, t?.lat || o.lat, { changeCenter: !0 });
1819
+ }, t[6] = o, t[7] = u, t[8] = i, t[9] = p) : p = t[9];
1820
+ let m = p, h;
1821
+ t[10] !== o || t[11] !== f || t[12] !== i ? (h = function(e) {
1822
+ let t = f(e);
1823
+ i && i(t?.lon || o.lon, t?.lat || o.lat, { changeCenter: !0 });
1824
+ }, t[10] = o, t[11] = f, t[12] = i, t[13] = h) : h = t[13];
1825
+ let g = h, _;
1826
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ X("div", {
1827
+ className: "picker-info-label",
1828
+ children: "经度:"
1829
+ }), t[14] = _) : _ = t[14];
1830
+ let v;
1831
+ t[15] !== a || t[16] !== s || t[17] !== m || t[18] !== u || t[19] !== n.lon || t[20] !== c ? (v = c ? n.lon : /* @__PURE__ */ X(I, {
1832
+ className: "picker-info-input",
1833
+ disabled: s || a,
1834
+ max: 180,
1835
+ min: -180,
1836
+ value: n.lon,
1837
+ onChange: u,
1838
+ onBlur: m,
1839
+ onEnterPress: m
1840
+ }), t[15] = a, t[16] = s, t[17] = m, t[18] = u, t[19] = n.lon, t[20] = c, t[21] = v) : v = t[21];
1841
+ let y;
1842
+ t[22] === v ? y = t[23] : (y = /* @__PURE__ */ Z("div", {
1843
+ className: "picker-info-lon",
1844
+ children: [_, v]
1845
+ }), t[22] = v, t[23] = y);
1846
+ let b;
1847
+ t[24] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ X("div", {
1848
+ className: "picker-info-label",
1849
+ children: "纬度:"
1850
+ }), t[24] = b) : b = t[24];
1851
+ let x;
1852
+ t[25] !== a || t[26] !== s || t[27] !== g || t[28] !== f || t[29] !== n.lat || t[30] !== c ? (x = c ? n.lat : /* @__PURE__ */ X(I, {
1853
+ className: "picker-info-input",
1854
+ disabled: s || a,
1855
+ max: 90,
1856
+ min: -90,
1857
+ value: n.lat,
1858
+ onChange: f,
1859
+ onBlur: g,
1860
+ onEnterPress: g
1861
+ }), t[25] = a, t[26] = s, t[27] = g, t[28] = f, t[29] = n.lat, t[30] = c, t[31] = x) : x = t[31];
1862
+ let S;
1863
+ t[32] === x ? S = t[33] : (S = /* @__PURE__ */ Z("div", {
1864
+ className: "picker-info-lat",
1865
+ children: [b, x]
1866
+ }), t[32] = x, t[33] = S);
1867
+ let C;
1868
+ t[34] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ X("div", {
1869
+ className: "picker-info-label",
1870
+ children: "地址:"
1871
+ }), t[34] = C) : C = t[34];
1872
+ let w;
1873
+ t[35] !== a || t[36] !== n.addr ? (w = a ? /* @__PURE__ */ X(N, {}) : n.addr, t[35] = a, t[36] = n.addr, t[37] = w) : w = t[37];
1874
+ let T;
1875
+ t[38] === w ? T = t[39] : (T = /* @__PURE__ */ Z("div", {
1876
+ className: "picker-info-addr",
1877
+ children: [C, w]
1878
+ }), t[38] = w, t[39] = T);
1879
+ let E;
1880
+ return t[40] !== T || t[41] !== y || t[42] !== S ? (E = /* @__PURE__ */ Z("div", {
1881
+ className: "location-picker-info",
1882
+ children: [
1883
+ y,
1884
+ S,
1885
+ T
1886
+ ]
1887
+ }), t[40] = T, t[41] = y, t[42] = S, t[43] = E) : E = t[43], E;
1888
+ }, Nn = "2.0", Pn = ["AMap.Geocoder", "AMap.AutoComplete"];
1889
+ window._AMapLoaderTemp || (window._AMapLoaderTemp = {}), window._AMapLoaderTemp.loading = !1, window._AMapLoaderTemp.promise = null;
1890
+ function Fn(e) {
1891
+ window.AMap || (window._AMapSecurityConfig = { securityJsCode: e.securityJsCode || window._AMapLoaderTemp.securityJsCode });
1892
+ let { key: t, version: n, plugins: r } = e || {};
1893
+ return new Promise((e, i) => {
1894
+ if (window._AMapLoaderTemp.loading && window._AMapLoaderTemp.promise) {
1895
+ window._AMapLoaderTemp.promise.then((t) => {
1896
+ e(window.AMap);
1897
+ });
1898
+ return;
1899
+ }
1900
+ if (window.AMap && !r || window.AMap && r && JSON.stringify(window._AMapLoaderTemp.plugins) === JSON.stringify(r)) {
1901
+ e(window.AMap);
1902
+ return;
1903
+ }
1904
+ window._AMapLoaderTemp.plugins = r ? [...Pn, ...r || []] : Pn;
1905
+ let a = Ue("@amap/amap-jsapi-loader");
1906
+ window._AMapLoaderTemp.loading = !0, window._AMapLoaderTemp.promise = a.load({
1907
+ key: t || window._AMapLoaderTemp.key,
1908
+ version: n || Nn,
1909
+ plugins: window._AMapLoaderTemp.plugins
1910
+ }).then((t) => (window.AMap = t, e(window.AMap), window._AMapLoaderTemp.loading = !1, t)).catch((e) => {
1911
+ i(e), console.error("AMap loader: ", e);
1912
+ });
1913
+ });
1914
+ }
1915
+ //#endregion
1916
+ //#region src/components/LocationPicker/Map/AMap/common/utils.ts
1917
+ window._AMapLoaderTemp || (window._AMapLoaderTemp = {});
1918
+ var In = class {
1919
+ map;
1920
+ AMap;
1921
+ markers = {};
1922
+ pickerMarker;
1923
+ markerIconConf;
1924
+ constructor({ map: e, AMap: t, markerIconConf: n }) {
1925
+ if (!e) throw Error("请传入地图实例");
1926
+ this.map = e, this.AMap = t, this.markerIconConf = n || {};
1927
+ }
1928
+ setMapRang({ map: e = this.map, AMap: t = this.AMap || window.AMap, rangeArr: n = [], rangeKey: r = "range", lonKey: i = "longitude", latKey: a = "latitude" }) {
1929
+ (e?.getAllOverlays() || [])?.forEach((e) => {
1930
+ e instanceof t.Circle && e.setMap(null);
1931
+ }), n.forEach((n) => {
1932
+ let o = new t.Circle({
1933
+ center: new t.LngLat(n[i], n[a]),
1934
+ radius: Number(n[r]),
1935
+ fillColor: "#1890ff",
1936
+ strokeColor: "#40a9ff"
1937
+ });
1938
+ e.add(o);
1939
+ });
1940
+ }
1941
+ getCenter(e = this.map) {
1942
+ if (!e) throw Error("请传入地图实例和 AMap");
1943
+ return e && e.getCenter && e.getCenter();
1944
+ }
1945
+ setCenter(e, t, n = {
1946
+ map: this.map,
1947
+ AMap: this.AMap || window.AMap
1948
+ }) {
1949
+ let { map: r = this.map, AMap: i = this.AMap || window.AMap } = n || {};
1950
+ if (!(i && r)) throw Error("请传入地图实例和 AMap");
1951
+ let a = new window.AMap.LngLat(e, t);
1952
+ r.setCenter(a);
1953
+ }
1954
+ setMarker(e, t, n) {
1955
+ let { id: r = Date.now(), marker: i, map: a = this.map, AMap: o = this.AMap, markerIconConf: s = {} } = n || {};
1956
+ if (!(o && a)) throw Error("请传入地图实例和 AMap");
1957
+ if (e == null || t == null) {
1958
+ console.warn("setMarker 请传入正确的经纬度");
1959
+ return;
1960
+ }
1961
+ let c = new o.LngLat(e, t), l = i || this.markers[r];
1962
+ if (l) return l.setPosition(c), l;
1963
+ let u = new o.Icon({
1964
+ size: new o.Size(34, 34),
1965
+ image: En,
1966
+ imageSize: new o.Size(34, 34),
1967
+ ...this.markerIconConf,
1968
+ ...s
1969
+ }), d = new o.Marker({
1970
+ offset: new o.Pixel(-17, -34),
1971
+ icon: u,
1972
+ position: c
1973
+ });
1974
+ return this.markers[r] = d, a?.add(d), d;
1975
+ }
1976
+ setPickerMarker(e, t, n) {
1977
+ let { marker: r = this.pickerMarker } = n || {};
1978
+ this.pickerMarker = this.setMarker(e, t, {
1979
+ ...n,
1980
+ marker: r
1981
+ });
1982
+ }
1983
+ on(...e) {
1984
+ return this.map?.on(...e);
1985
+ }
1986
+ off(...e) {
1987
+ return this.map?.off(...e);
1988
+ }
1989
+ };
1990
+ //#endregion
1991
+ //#region src/components/LocationPicker/Map/AMap/index.jsx
1992
+ window._AMapLoaderTemp && window._AMapLoaderTemp.key && Fn({
1993
+ key: window._AMapLoaderTemp.key,
1994
+ securityJsCode: window._AMapLoaderTemp.securityJsCode
1995
+ });
1996
+ function Ln(e) {
1997
+ let t = Q(8), n = l(), r = l(), i;
1998
+ t[0] === e ? i = t[1] : (i = () => {
1999
+ let { key: t, securityJsCode: i, plugins: a, markerIconConf: o } = e;
2000
+ Fn({
2001
+ key: t,
2002
+ securityJsCode: i,
2003
+ plugins: a
2004
+ }).then((t) => {
2005
+ let { zoom: i, center: a, init: s } = e;
2006
+ n.current = new t.Map(r.current, {
2007
+ zoom: i || 11,
2008
+ center: a || [120.160217, 30.243861]
2009
+ }), s && s({
2010
+ map: n.current,
2011
+ mapUtils: new In({
2012
+ map: n.current,
2013
+ AMap: t,
2014
+ markerIconConf: o
2015
+ }),
2016
+ AMap: t
2017
+ });
2018
+ });
2019
+ }, t[0] = e, t[1] = i);
2020
+ let a;
2021
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = [], t[2] = a) : a = t[2], o(i, a);
2022
+ let s, c;
2023
+ t[3] === e.center ? (s = t[4], c = t[5]) : (s = () => {
2024
+ Array.isArray(e.center) && e.center.length > 1 && n.current?.setCenter(e.center);
2025
+ }, c = [e.center], t[3] = e.center, t[4] = s, t[5] = c), o(s, c);
2026
+ let u;
2027
+ return t[6] === e.style ? u = t[7] : (u = /* @__PURE__ */ X("div", {
2028
+ ref: r,
2029
+ className: "a-map-container",
2030
+ style: e.style
2031
+ }), t[6] = e.style, t[7] = u), u;
2032
+ }
2033
+ //#endregion
2034
+ //#region src/components/LocationPicker/components/Notice/index.tsx
2035
+ var Rn = (e) => {
2036
+ let t = Q(1), n;
2037
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ X(R, {
2038
+ className: "location-picker-notice-bar",
2039
+ content: "点击地图上的位置,选择目标地址",
2040
+ color: "default",
2041
+ icon: /* @__PURE__ */ X(Te, {})
2042
+ }), t[0] = n) : n = t[0], n;
2043
+ };
2044
+ //#endregion
2045
+ //#region src/components/LocationPicker/servers/index.ts
2046
+ function zn(e, t) {
2047
+ return new Promise((n, r) => {
2048
+ Bn(e, t).then(n).catch((i) => {
2049
+ i.result === "USER_DAILY_QUERY_OVER_LIMIT" || i.result === "A_MAP_GEOCODER_IS_NOT_DEFINED" ? Vn(e, t).then(n).catch(r) : r(i);
2050
+ });
2051
+ });
2052
+ }
2053
+ var Bn = function(e, t) {
2054
+ return new Promise((n, r) => {
2055
+ if (!window.AMap?.Geocoder) {
2056
+ let e = Error("Error getAddress window.AMap.Geocoder is not defined.");
2057
+ e.result = "A_MAP_GEOCODER_IS_NOT_DEFINED", r(e);
2058
+ return;
2059
+ }
2060
+ new window.AMap.Geocoder({}).getAddress([e, t], function(e, t) {
2061
+ if (e === "complete" && t.info === "OK") {
2062
+ let e = t?.regeocode?.formattedAddress;
2063
+ return n(e), e;
2064
+ }
2065
+ if (t === "USER_DAILY_QUERY_OVER_LIMIT") {
2066
+ let e = /* @__PURE__ */ Error("超出使用限制,请联系管理员");
2067
+ e.result = t, r(e);
2068
+ } else r(t);
2069
+ });
2070
+ });
2071
+ }, Vn = function(e, t) {
2072
+ return new Promise((n, r) => {
2073
+ if (!window._AMapLoaderTemp?.serverKey) {
2074
+ r(/* @__PURE__ */ Error("请配置 serverKey"));
2075
+ return;
2076
+ }
2077
+ fetch(`https://restapi.amap.com/v3/geocode/regeo?location=${e?.toFixed(6)},${t?.toFixed(6)}&key=${window._AMapLoaderTemp.serverKey}`, { mode: "cors" }).then((e) => e.json()).then((e) => {
2078
+ e.status === "1" ? n(e.regeocode?.formatted_address) : (console.warn("Warn getAddressByFetch: ", e), r(Error(e.info)));
2079
+ }).catch(r);
2080
+ });
2081
+ };
2082
+ function Hn(e, t = "0571") {
2083
+ return new Promise((n, r) => {
2084
+ if (!window.AMap) {
2085
+ r(Error("Error getSearchTips window.AMap is not defined."));
2086
+ return;
2087
+ }
2088
+ window.AMap.AutoComplete ? Un(e, t).then(n).catch((i) => {
2089
+ i.result === "USER_DAILY_QUERY_OVER_LIMIT" || i.result === "A_MAP_AUTO_COMPLETE_IS_NOT_DEFINED" ? Wn(e, t).then(n).catch(r) : r(i);
2090
+ }) : Wn(e, t).then(n).catch(r);
2091
+ });
2092
+ }
2093
+ function Un(e, t = "0571") {
2094
+ return new Promise((n, r) => {
2095
+ if (!window.AMap?.Autocomplete) {
2096
+ let e = Error("Error getSearchTips window.AMap.Autocomplete is not defined.");
2097
+ e.result = "A_MAP_AUTO_COMPLETE_IS_NOT_DEFINED", r(e);
2098
+ return;
2099
+ }
2100
+ new window.AMap.Autocomplete({ city: t }).search(e, function(e, t) {
2101
+ e === "complete" && t.info === "OK" ? n(t.tips?.map((e) => {
2102
+ let { lng: t, lat: n } = e?.location || {};
2103
+ return {
2104
+ ...e,
2105
+ label: e.name,
2106
+ value: e.id,
2107
+ lon: +t,
2108
+ lng: +t,
2109
+ lat: +n
2110
+ };
2111
+ })) : r(t);
2112
+ });
2113
+ });
2114
+ }
2115
+ function Wn(e, t = "0571") {
2116
+ return new Promise((n, r) => {
2117
+ if (!window._AMapLoaderTemp?.serverKey) {
2118
+ r(/* @__PURE__ */ Error("请配置 serverKey"));
2119
+ return;
2120
+ }
2121
+ fetch(`https://restapi.amap.com/v3/assistant/inputtips?key=${window._AMapLoaderTemp.serverKey}&keywords=${e}&city=${t}`, { mode: "cors" }).then((e) => e.json()).then((e) => {
2122
+ e.status === "1" ? n(e.tips?.map((e) => {
2123
+ let [t, n] = e.location?.split(",");
2124
+ return {
2125
+ ...e,
2126
+ label: e.name,
2127
+ value: e.id,
2128
+ lng: +t,
2129
+ lon: +t,
2130
+ lat: +n
2131
+ };
2132
+ })) : (console.warn("Warn getSearchTips fetch: ", e), r(Error(e.info)));
2133
+ }).catch(r);
2134
+ });
2135
+ }
2136
+ //#endregion
2137
+ //#region src/components/LocationPicker/components/MapSearch/index.jsx
2138
+ var Gn = "0571";
2139
+ function Kn(e) {
2140
+ let [t, n] = u(!1), [r, a] = u([]), [o, s] = u(""), [c, l] = u(!1);
2141
+ function d(t) {
2142
+ let { lng: n, lat: r } = t || {};
2143
+ e.setPoint && e.setPoint(n, r, { changeCenter: !0 }), l(!1);
2144
+ }
2145
+ let f = i(Re(function(t = o) {
2146
+ if (!t) {
2147
+ a([]);
2148
+ return;
2149
+ }
2150
+ n(!0), Hn(t, e.cityCode || Gn).then((e) => {
2151
+ a(e), l(!0), n(!1);
2152
+ }).catch((e) => {
2153
+ ie.show({
2154
+ icon: "fail",
2155
+ content: e
2156
+ }), n(!1);
2157
+ });
2158
+ }, 500), []);
2159
+ function p() {
2160
+ l(!1), s("");
2161
+ }
2162
+ function m(t) {
2163
+ s(t), e.isAutoSearch && f(t);
2164
+ }
2165
+ return /* @__PURE__ */ Z("div", {
2166
+ className: "location-map-search",
2167
+ children: [/* @__PURE__ */ Z("div", {
2168
+ className: "search-bar-wrap",
2169
+ children: [/* @__PURE__ */ X(H, {
2170
+ className: "search-bar",
2171
+ loading: t,
2172
+ onClear: p,
2173
+ onCancel: p,
2174
+ onSearch: f,
2175
+ placeholder: "请输入",
2176
+ onChange: m,
2177
+ onFocus: () => {
2178
+ l(!0);
2179
+ }
2180
+ }), c ? /* @__PURE__ */ X(E, {
2181
+ className: "search-bar-btn",
2182
+ size: "mini",
2183
+ fill: "none",
2184
+ onClick: () => {
2185
+ l(!1);
2186
+ },
2187
+ children: "取消"
2188
+ }) : /* @__PURE__ */ X(E, {
2189
+ className: "search-bar-btn",
2190
+ size: "mini",
2191
+ fill: "none",
2192
+ color: "primary",
2193
+ onClick: () => {
2194
+ f(o);
2195
+ },
2196
+ loading: t,
2197
+ children: "搜索"
2198
+ })]
2199
+ }), /* @__PURE__ */ X("div", {
2200
+ className: "check-list-wrap",
2201
+ children: c && /* @__PURE__ */ X("div", {
2202
+ className: "check-list",
2203
+ children: /* @__PURE__ */ X(k, { children: r.map((e) => e.lng && e.lat && /* @__PURE__ */ X(k.Item, {
2204
+ value: e.id,
2205
+ onClick: () => {
2206
+ d(e);
2207
+ },
2208
+ children: e.label
2209
+ }, e.label)) })
2210
+ })
2211
+ })]
2212
+ });
2213
+ }
2214
+ //#endregion
2215
+ //#region src/components/LocationPicker/components/ModalContent/index.tsx
2216
+ var qn = q((e) => {
2217
+ let { layout: t = "ver", hasSearch: n = !0, isAutoFixAddr: r = !1, lonKey: i = "longitude", latKey: a = "latitude", addrKey: s = "address", rangeKey: d = "range", value: f, isAutoSearch: p = !0, visible: m, defaultLocation: h, disabled: g, readOnly: _, markerIconConf: v, icons: y, rangeArr: b = [] } = e, x = l(), S = c(() => An(f, {
2218
+ lonKey: i,
2219
+ latKey: a,
2220
+ addrKey: s
2221
+ }), [
2222
+ i,
2223
+ a,
2224
+ s,
2225
+ f,
2226
+ f?.[i],
2227
+ f?.[a],
2228
+ f?.[s]
2229
+ ]), [C, w] = u(e.loading || !1), [T, E] = u(!1), [D, O] = u(S);
2230
+ o(() => {
2231
+ w(e.loading);
2232
+ }, [e.loading]), o(() => {
2233
+ x.current?.setMapRang({
2234
+ lonKey: i,
2235
+ latKey: a,
2236
+ rangeKey: d,
2237
+ rangeArr: b
2238
+ });
2239
+ }, [b]), o(() => {
2240
+ if (m) {
2241
+ let e = h.lon, t = h.lat, n = h.addr;
2242
+ S.lon && S.lat && (e = S.lon, t = S.lat, n = S.addr), window.AMap && window.AMap.LngLat && A(e, t), j(e, t, {
2243
+ isAutoFixAddr: !1,
2244
+ addr: n
2245
+ });
2246
+ }
2247
+ }, [m, S]);
2248
+ function k({ map: t, mapUtils: n }) {
2249
+ x.current = n;
2250
+ let r = h.lon, o = h.lat;
2251
+ D.lon && D.lat && (r = D.lon, o = D.lat), A(r, o), w(e.loading || !1), g || _ ? x.current?.setPickerMarker(r, o) : (x.current?.setPickerMarker(r, o), x.current.on("click", function(e) {
2252
+ let { lng: t, lat: n } = e.lnglat || {};
2253
+ j(t, n, { changeCenter: !0 });
2254
+ })), x.current?.setMapRang({
2255
+ lonKey: i,
2256
+ latKey: a,
2257
+ rangeKey: d,
2258
+ rangeArr: b
2259
+ });
2260
+ }
2261
+ function A(e = D.lon, t = D.lat) {
2262
+ x.current?.setCenter(e, t);
2263
+ }
2264
+ async function j(t, n, i) {
2265
+ let { isAutoFixAddr: a = r || !0, changeCenter: o, addr: s } = i || {}, c = t || D.lon, l = n || D.lat, u = s;
2266
+ x.current?.setPickerMarker(t, n), o && A(t, n), a && !u && (u = await M(c, l));
2267
+ let d = {
2268
+ ...D,
2269
+ lon: c,
2270
+ lat: l,
2271
+ addr: u
2272
+ };
2273
+ O(d), e.setPickInfo && e.setPickInfo(d);
2274
+ }
2275
+ function M(e, t) {
2276
+ return new Promise((n, r) => {
2277
+ if (!window.AMap) return r(), /* @__PURE__ */ Error("window.AMap is not defined");
2278
+ E(!0), zn(e, t).then((e) => {
2279
+ E(!1), O((t) => ({
2280
+ ...t,
2281
+ addr: e
2282
+ })), n(e);
2283
+ }).catch((e) => {
2284
+ r(e), ie.show({
2285
+ icon: "fail",
2286
+ content: e
2287
+ }), E(!1);
2288
+ });
2289
+ });
2290
+ }
2291
+ function ee() {
2292
+ A();
2293
+ }
2294
+ function N() {
2295
+ w(!0), Yt().then((e) => {
2296
+ let { coords: t = {} } = e;
2297
+ j(t.longitude, t.latitude, { changeCenter: !0 }), w(!1);
2298
+ }).catch((e) => {
2299
+ w(!1), ie.show({
2300
+ icon: "fail",
2301
+ content: "定位获取失败"
2302
+ }), console.warn("Error getCurrentPosition e: ", e);
2303
+ });
2304
+ }
2305
+ let P = e.showGetPositionBtn !== !1 && !(g || _), { markerIcon: F, positionIcon: I, resetIcon: L } = y || {};
2306
+ return /* @__PURE__ */ Z("div", {
2307
+ className: `location-picker-modal-content location-modal-content-layout-${t}`,
2308
+ children: [
2309
+ /* @__PURE__ */ X(Mn, {
2310
+ pickInfo: D,
2311
+ setPickInfo: O,
2312
+ setPoint: j,
2313
+ addrLoading: T,
2314
+ defaultLocation: h,
2315
+ disabled: g,
2316
+ readOnly: _
2317
+ }),
2318
+ /* @__PURE__ */ Z("div", {
2319
+ className: "location-picker-map",
2320
+ children: [
2321
+ n && m ? /* @__PURE__ */ X(Kn, {
2322
+ setPoint: j,
2323
+ isAutoSearch: p
2324
+ }) : null,
2325
+ /* @__PURE__ */ X(Ln, {
2326
+ init: k,
2327
+ loading: C,
2328
+ markerIconConf: v
2329
+ }),
2330
+ /* @__PURE__ */ Z("div", {
2331
+ className: "set-map-actions",
2332
+ children: [/* @__PURE__ */ X("div", {
2333
+ className: "actions-icon-box reset-icon-box",
2334
+ onClick: ee,
2335
+ children: typeof L == "string" ? /* @__PURE__ */ X("img", {
2336
+ className: "reset-icon",
2337
+ src: L
2338
+ }) : L || kn
2339
+ }), P ? /* @__PURE__ */ X("div", {
2340
+ className: "actions-icon-box center-icon-box",
2341
+ onClick: N,
2342
+ children: typeof I == "string" ? /* @__PURE__ */ X("img", {
2343
+ className: "center-icon",
2344
+ src: I
2345
+ }) : I || On
2346
+ }) : null]
2347
+ }),
2348
+ /* @__PURE__ */ X(Rn, {})
2349
+ ]
2350
+ }),
2351
+ C && /* @__PURE__ */ X("div", {
2352
+ className: "spin-loading-wrap",
2353
+ children: /* @__PURE__ */ X(ne, { className: "spin-loading" })
2354
+ })
2355
+ ]
2356
+ });
2357
+ }), Jn = q(function(e) {
2358
+ let { mode: t = "dialog", layout: n = "ver", hasSearch: r = !0, showGetPositionBtn: i = !0, isAutoFixAddr: a = !1, lonKey: s = "longitude", latKey: c = "latitude", addrKey: d = "address", rangeKey: f = "range", value: p, isAutoSearch: m = !0, icons: h = {}, rangeArr: g = [] } = e, [_, v] = u({
2359
+ lon: 120.168893,
2360
+ lat: 30.225404,
2361
+ addr: "浙江省杭州市上城区南星街道杭州西湖风景名胜区"
2362
+ }), [y, b] = u(!1), [x, S] = u(!1), C = l(), w = l(_);
2363
+ o(() => {
2364
+ let e = An(p, {
2365
+ lonKey: s,
2366
+ latKey: c,
2367
+ addrKey: d
2368
+ });
2369
+ !e.lon || !e.lat ? (b(!0), Yt().then(async (e) => {
2370
+ let { coords: t = {} } = e, n = t.longitude, r = t.latitude, i = await zn(n, r).then((e) => e);
2371
+ w.current = {
2372
+ lon: n,
2373
+ lat: r,
2374
+ addr: i
2375
+ }, v(w.current), b(!1);
2376
+ }).catch((e) => {
2377
+ console.warn("Error LocationPicker getCurrentPosition e: ", e), b(!1);
2378
+ })) : b(!1);
2379
+ }, []);
2380
+ function T() {
2381
+ !C.current && S(!0), S(!0);
2382
+ }
2383
+ function D() {
2384
+ S(!1);
2385
+ }
2386
+ function O(t = w.current) {
2387
+ let n = t || w.current, r = {
2388
+ [s]: n.lon,
2389
+ [c]: n.lat,
2390
+ [d]: n.addr
2391
+ };
2392
+ e.onChange && e.onChange(r);
2393
+ }
2394
+ function k() {
2395
+ O(), D();
2396
+ }
2397
+ function A(e) {
2398
+ j(e), O(e);
2399
+ }
2400
+ function j(e) {
2401
+ w.current = e;
2402
+ }
2403
+ let M = {
2404
+ ...e,
2405
+ mode: t ?? "dialog",
2406
+ layout: n ?? "ver",
2407
+ hasSearch: r ?? !0,
2408
+ isAutoFixAddr: a ?? !1,
2409
+ lonKey: s ?? "longitude",
2410
+ latKey: c ?? "latitude",
2411
+ addrKey: d ?? "address",
2412
+ rangeKey: f ?? "range",
2413
+ rangeArr: g ?? [],
2414
+ value: p,
2415
+ isAutoSearch: m ?? !0,
2416
+ defaultLocation: _,
2417
+ showGetPositionBtn: i,
2418
+ visible: x,
2419
+ loading: y,
2420
+ setLoading: b
2421
+ };
2422
+ return /* @__PURE__ */ X("div", {
2423
+ className: "location-picker",
2424
+ children: t === "show" ? /* @__PURE__ */ X(qn, {
2425
+ ...M,
2426
+ setPickInfo: A
2427
+ }) : /* @__PURE__ */ Z(he, { children: [/* @__PURE__ */ X(jn, {
2428
+ ...M,
2429
+ onShow: T,
2430
+ pickerIcon: h.pickerIcon
2431
+ }), /* @__PURE__ */ Z(te, {
2432
+ maskClassName: "location-picker-popup-mask",
2433
+ className: "location-picker-popup",
2434
+ onMaskClick: D,
2435
+ onClose: D,
2436
+ bodyStyle: {
2437
+ minHeight: "78vh",
2438
+ maxHeight: "100vh"
2439
+ },
2440
+ visible: x,
2441
+ children: [/* @__PURE__ */ Z("div", {
2442
+ className: "location-popup-header",
2443
+ children: [/* @__PURE__ */ X(E, {
2444
+ fill: "none",
2445
+ onClick: D,
2446
+ children: "取消"
2447
+ }), /* @__PURE__ */ X(E, {
2448
+ color: "primary",
2449
+ fill: "none",
2450
+ onClick: k,
2451
+ loading: y,
2452
+ children: "确认"
2453
+ })]
2454
+ }), /* @__PURE__ */ X(qn, {
2455
+ ...M,
2456
+ setPickInfo: j
2457
+ })]
2458
+ })] })
2459
+ });
2460
+ }), Yn = function(e, t) {
2461
+ let { dataEnum: n = {}, fieldNames: r, level: i = 1, parent: a = {} } = t || {}, { value: o = "value", children: s = "children", label: c = "label" } = r || {};
2462
+ return e?.forEach((e) => {
2463
+ let r = {
2464
+ ...e,
2465
+ parent: a,
2466
+ level: i,
2467
+ fullPathLabels: [...a.fullPathLabels || [], e[c]],
2468
+ fullPathValues: [...a.fullPathValues || [], e[o]],
2469
+ parentEnum: { ...a.parentEnum }
2470
+ };
2471
+ a[o] && (r.parentEnum[a[o]] = 1), r.fullPathItems = [...a.fullPathItems || [], r], delete r[s], n[e[o]] = r;
2472
+ let l = e[s];
2473
+ if (l) {
2474
+ let e = {};
2475
+ l.forEach((t) => {
2476
+ e[t[o]] = 1;
2477
+ }), r.childrenEnum = e, Yn(l, {
2478
+ ...t,
2479
+ dataEnum: n,
2480
+ parent: r
2481
+ });
2482
+ }
2483
+ }), n;
2484
+ }, Xn = function(e, t, n) {
2485
+ let { fieldNames: r, filterKey: i } = n || {}, { label: a = "label", children: o = "children" } = r || {}, s = null, c = i || a;
2486
+ return e?.forEach((e) => {
2487
+ let r = { ...e };
2488
+ delete r[o];
2489
+ let i = !1;
2490
+ if (e[c]?.toString()?.indexOf(t) >= 0 && (s ||= [], s.push(r), i = !0), e[o]) {
2491
+ let a = Xn(e[o], t, n);
2492
+ a && (r[o] = a, i || (s ||= [], s.push(r)));
2493
+ }
2494
+ }), s;
2495
+ }, Zn = function(e, t = [], n) {
2496
+ let { list: r = [], fieldNames: i, parent: a = {}, level: o = 1 } = n || {}, { value: s = "value", children: c = "children", label: l = "label" } = i || {};
2497
+ return e?.forEach((e) => {
2498
+ let i = e?.[c], u = {
2499
+ ...e,
2500
+ parent: a,
2501
+ level: o,
2502
+ fullPathLabel: [...a.fullPathLabel || [], e[l]],
2503
+ fullPathValues: [...a.fullPathValues || [], e[s]],
2504
+ parentEnum: { ...a.parentEnum },
2505
+ childrenLen: i?.length || 0
2506
+ };
2507
+ if (a[s] && (u.parentEnum[a[s]] = 1), u.fullPathItems = [...a.fullPathItems || [], u], (u.parentId === null || u.parentId === void 0 || u.parentId === "") && (u.parentId = a[s]), delete u[c], r.push(u), Array.isArray(i) && i.length > 0) {
2508
+ let a = {};
2509
+ i.forEach((e) => {
2510
+ a[e[s]] = 1;
2511
+ }), u.childrenEnum = a, u.hasChildren = !0, t.includes(e[s]) && Zn(i, t, {
2512
+ ...n,
2513
+ list: r,
2514
+ parent: u,
2515
+ level: o + 1
2516
+ });
2517
+ }
2518
+ }), r;
2519
+ }, Qn = function(e, t) {
2520
+ let { expandKeys: n = [], fieldNames: r } = t || {}, { value: i = "value", children: a = "children" } = r || {};
2521
+ return e?.forEach((e) => {
2522
+ let r = e?.[a];
2523
+ Array.isArray(r) && r.length > 0 && (n.push(e[i]), Qn(r, {
2524
+ ...t,
2525
+ expandKeys: n
2526
+ }));
2527
+ }), n;
2528
+ }, $n = function(e, t = [], n) {
2529
+ let { fieldNames: r } = n || {}, { value: i = "value", children: a = "children" } = r || {};
2530
+ return e?.forEach((e) => {
2531
+ let r = e[i], o = t.findIndex((e) => e === r);
2532
+ o >= 0 && t.splice(o, 1);
2533
+ let s = e[a];
2534
+ Array.isArray(s) && s.length > 0 && $n(s, t, n);
2535
+ }), t;
2536
+ }, er = function(e, t, n, r) {
2537
+ let { fieldNames: i, treeCheckStrictly: a, selected: o = [] } = r || {}, { value: s = "value", children: c = "children" } = i || {}, l = e?.length, u = 0, d = !1;
2538
+ for (let i = 0; i < l; i++) {
2539
+ let l = e[i], f = l[s];
2540
+ if (f === t) l._checked = n, l._indeterminate = !1, a && nr(l[c], n, r);
2541
+ else {
2542
+ let e = l[c];
2543
+ if (Array.isArray(e) && e.length > 0) {
2544
+ let i = er(e, t, n, {
2545
+ ...r,
2546
+ selected: o
2547
+ });
2548
+ a && (l._checked = i._checked, l._indeterminate = i._indeterminate, l._indeterminate && !l._checked && (d = !0), l._checked && (l._indeterminate = !1, $n(e, o, r)));
2549
+ }
2550
+ }
2551
+ l._checked && (u += 1, o.push(f));
2552
+ }
2553
+ return {
2554
+ treeData: e,
2555
+ checkedCount: u,
2556
+ _checked: l > 0 && u === l,
2557
+ _indeterminate: d || u > 0 && u < l,
2558
+ selected: o
2559
+ };
2560
+ }, tr = function(e, t, n) {
2561
+ let r = Le.cloneDeep(e);
2562
+ return Le.uniq(t || [])?.forEach((e) => {
2563
+ er(r, e, !0, n);
2564
+ }), r;
2565
+ }, nr = function(e, t, n) {
2566
+ let { fieldNames: r } = n || {}, { children: i = "children" } = r || {};
2567
+ return e?.forEach((e) => {
2568
+ e._checked = t, e._indeterminate = void 0;
2569
+ let r = e[i];
2570
+ Array.isArray(r) && r.length > 0 && nr(r, t, n);
2571
+ }), e;
2572
+ }, rr = (e) => {
2573
+ let t = Q(37), { multiple: n, selected: r, treeData: i, fieldNames: a, setSelected: s, treeDefaultExpandAll: c, treeCheckStrictly: d } = e, f = s === void 0 ? ir : s, p;
2574
+ t[0] === a ? p = t[1] : (p = a || {}, t[0] = a, t[1] = p);
2575
+ let { label: m, value: h, children: g } = p, _ = m === void 0 ? "label" : m, v = h === void 0 ? "value" : h, y = g === void 0 ? "children" : g, b;
2576
+ t[2] !== a || t[3] !== i || t[4] !== c ? (b = c ? Qn(i, { fieldNames: a }) : [], t[2] = a, t[3] = i, t[4] = c, t[5] = b) : b = t[5];
2577
+ let [x, S] = u(b), C = {
2578
+ fieldNames: a,
2579
+ treeCheckStrictly: d
2580
+ }, w = l(), [T, E] = u(0), [D, O] = u(tr(i, n ? r : [r], C)), k;
2581
+ t[6] !== x || t[7] !== a || t[8] !== i ? (k = Zn(i, x, { fieldNames: a }), t[6] = x, t[7] = a, t[8] = i, t[9] = k) : k = t[9];
2582
+ let [j, M] = u(k), ee = l(r), N, P;
2583
+ t[10] === r ? (N = t[11], P = t[12]) : (N = () => {
2584
+ ee.current = r;
2585
+ }, P = [r], t[10] = r, t[11] = N, t[12] = P), o(N, P);
2586
+ let F;
2587
+ t[13] === i ? F = t[14] : (F = [i], t[13] = i, t[14] = F), o(() => {
2588
+ let e = tr(i, Array.isArray(ee.current) ? ee.current : [ee.current], C), t = c ? Qn(e, { fieldNames: a }) : [];
2589
+ S(t), M(Zn(e, t, { fieldNames: a })), O(e);
2590
+ }, F);
2591
+ let I;
2592
+ t[15] === E ? I = t[16] : (I = () => {
2593
+ E(parseInt(getComputedStyle(w.current).height));
2594
+ }, t[15] = E, t[16] = I);
2595
+ let L;
2596
+ t[17] === Symbol.for("react.memo_cache_sentinel") ? (L = [], t[17] = L) : L = t[17], o(I, L);
2597
+ let R;
2598
+ t[18] === Symbol.for("react.memo_cache_sentinel") ? (R = function(e) {
2599
+ e.stopPropagation && e.stopPropagation();
2600
+ }, t[18] = R) : R = t[18];
2601
+ let z = R, B;
2602
+ t[19] !== y || t[20] !== a || t[21] !== D || t[22] !== v ? (B = function(e) {
2603
+ if (!e || !e.hasChildren && !(e[y] && e[y].length > 0)) return;
2604
+ let t = e[v];
2605
+ S((e) => {
2606
+ let n = e.findIndex((e) => e === t);
2607
+ return n >= 0 ? e.splice(n, 1) : e.push(t), M(Zn(D, e, { fieldNames: a })), [...e];
2608
+ });
2609
+ }, t[19] = y, t[20] = a, t[21] = D, t[22] = v, t[23] = B) : B = t[23];
2610
+ let te = B, V = function(e, t) {
2611
+ if (n) {
2612
+ let n = er(D, e, t, C), r = Le.cloneDeep(n.treeData);
2613
+ O(r), M(Zn(n.treeData, x, { fieldNames: a })), f(n.selected);
2614
+ } else f(e);
2615
+ }, H;
2616
+ t[24] !== x || t[25] !== _ || t[26] !== j || t[27] !== V || t[28] !== te || t[29] !== v ? (H = function(e) {
2617
+ let { index: t, key: n, style: r } = e, i = j[t];
2618
+ if (!i) return null;
2619
+ let a = i[v], o = x.includes(a);
2620
+ return /* @__PURE__ */ Z("div", {
2621
+ className: "virtualized-list-item",
2622
+ style: {
2623
+ ...r,
2624
+ paddingLeft: `${i.level * 5}vw`
2625
+ },
2626
+ onClick: () => {
2627
+ te(i);
2628
+ },
2629
+ children: [/* @__PURE__ */ Z(A, {
2630
+ value: a,
2631
+ indeterminate: i._indeterminate,
2632
+ checked: i._checked,
2633
+ disabled: i.disabled,
2634
+ onClick: z,
2635
+ onChange: (e) => V(a, e),
2636
+ children: [
2637
+ i[_],
2638
+ "-",
2639
+ a
2640
+ ]
2641
+ }, a), i.hasChildren && X(o ? Oe : we, { className: "arrow-icon" })]
2642
+ }, n + a);
2643
+ }, t[24] = x, t[25] = _, t[26] = j, t[27] = V, t[28] = te, t[29] = v, t[30] = H) : H = t[30];
2644
+ let U = H, W;
2645
+ t[31] !== T || t[32] !== j.length || t[33] !== U ? (W = T && /* @__PURE__ */ X(ze, {
2646
+ disableHeight: !0,
2647
+ children: (e) => {
2648
+ let { width: t } = e;
2649
+ return /* @__PURE__ */ X(Be, {
2650
+ rowCount: j.length,
2651
+ rowRenderer: U,
2652
+ width: t,
2653
+ height: T,
2654
+ rowHeight: T / 10,
2655
+ overscanRowCount: 10
2656
+ });
2657
+ }
2658
+ }), t[31] = T, t[32] = j.length, t[33] = U, t[34] = W) : W = t[34];
2659
+ let G;
2660
+ return t[35] === W ? G = t[36] : (G = /* @__PURE__ */ X("div", {
2661
+ className: "tree-select-list",
2662
+ ref: w,
2663
+ children: W
2664
+ }), t[35] = W, t[36] = G), G;
2665
+ };
2666
+ function ir() {}
2667
+ //#endregion
2668
+ //#region src/components/TreeSelect/TreeSearch/index.tsx
2669
+ var ar = (e) => {
2670
+ let { dataSource: t, setTreeData: n, fieldNames: r, visible: i, placeholder: a, showCancelButton: s, treeNodeFilterProp: c } = e, [l, d] = u("");
2671
+ o(() => {
2672
+ !i && p();
2673
+ }, [i]);
2674
+ function f(e) {
2675
+ e || m(), n && n(Xn(t, e, {
2676
+ fieldNames: r,
2677
+ filterKey: c
2678
+ }));
2679
+ }
2680
+ function p() {
2681
+ d(""), f("");
2682
+ }
2683
+ function m() {
2684
+ n && n(t);
2685
+ }
2686
+ return /* @__PURE__ */ X(H, {
2687
+ className: "tree-search",
2688
+ placeholder: a || "请输入内容",
2689
+ value: l,
2690
+ onChange: d,
2691
+ showCancelButton: s,
2692
+ onSearch: f,
2693
+ onClear: p,
2694
+ onCancel: m
2695
+ });
2696
+ }, or = q((e) => {
2697
+ let { value: t, multiple: n, onChange: r, disabled: i, readOnly: a, fieldNames: s, showSearch: l = !0, showCheckedStrategy: d, placeholder: f, itemSeparator: p = "、", childSeparator: m = "/" } = e, { label: h = "label" } = s || {}, g = J(), _ = c(() => e.treeData || e.dataSource || g.dataSource, [
2698
+ e.treeData,
2699
+ e.dataSource,
2700
+ g.dataSource
2701
+ ]), [v, y] = u(_);
2702
+ o(() => {
2703
+ y(_);
2704
+ }, [_]);
2705
+ let b = c(() => Yn(_, { fieldNames: s }), [_]), [x, S] = u(!1), [C, w] = u(t || (n ? [] : void 0));
2706
+ o(() => {
2707
+ t && w(t);
2708
+ }, [t]);
2709
+ function T() {
2710
+ i || a || S(!0);
2711
+ }
2712
+ function D() {
2713
+ S(!1);
2714
+ }
2715
+ function O() {
2716
+ r && r(C), D();
2717
+ }
2718
+ function k() {
2719
+ return n ? d === "SHOW_ALL" ? Array.isArray(t) ? t?.map((e) => b[e]?.fullPathLabels?.join(m))?.join(p) : void 0 : d === "SHOW_PARENT" ? Array.isArray(t) ? t?.map((e) => `${b[e]?.parent?.[h]}${m}${b[e]?.[h]}`)?.join(p) : void 0 : Array.isArray(t) ? t?.map((e) => b[e]?.[h])?.join(p) : void 0 : b[t]?.[h];
2720
+ }
2721
+ return /* @__PURE__ */ Z(ut, {
2722
+ className: "formily-tree-select picker-box",
2723
+ readOnly: a,
2724
+ disabled: i,
2725
+ onClick: T,
2726
+ children: [/* @__PURE__ */ X("div", {
2727
+ className: "tree-selected",
2728
+ onClick: T,
2729
+ children: /* @__PURE__ */ X(dt, {
2730
+ readOnly: a,
2731
+ disabled: i,
2732
+ value: k(),
2733
+ placeholder: f,
2734
+ isPicker: !0
2735
+ })
2736
+ }), /* @__PURE__ */ Z(te, {
2737
+ className: "formily-tree-select-popup",
2738
+ visible: x,
2739
+ onMaskClick: D,
2740
+ onClose: D,
2741
+ bodyStyle: { height: "80vh" },
2742
+ children: [/* @__PURE__ */ Z("div", {
2743
+ className: "popup-head",
2744
+ children: [/* @__PURE__ */ X(E, {
2745
+ fill: "none",
2746
+ onClick: D,
2747
+ children: "取消"
2748
+ }), /* @__PURE__ */ X(E, {
2749
+ color: "primary",
2750
+ fill: "none",
2751
+ onClick: O,
2752
+ children: "确定"
2753
+ })]
2754
+ }), /* @__PURE__ */ Z("div", {
2755
+ className: "popup-content",
2756
+ children: [l && /* @__PURE__ */ X(ar, {
2757
+ visible: x,
2758
+ dataSource: _,
2759
+ setTreeData: y,
2760
+ fieldNames: s
2761
+ }), /* @__PURE__ */ X(rr, {
2762
+ ...e,
2763
+ visible: x,
2764
+ dataSource: _,
2765
+ treeData: v,
2766
+ selected: C,
2767
+ setSelected: w
2768
+ })]
2769
+ })]
2770
+ })]
2771
+ });
2772
+ }), sr = ce((e) => /* @__PURE__ */ X(W, { ...e }), ue((e) => {
2773
+ let t = e.value ?? "", { min: n = 0, range: r } = de()["x-component-props"] || {};
2774
+ return r && (t = e.value ?? [n, n]), {
2775
+ ...e,
2776
+ value: t
2777
+ };
2778
+ })), cr = (e, t) => {
2779
+ for (let n = 0; n < e.length; n++) if (t <= e[n]) return n;
2780
+ }, lr = (e, t) => Array.isArray(e) ? t === -1 ? e[0] : e[t] ?? e[e.length - 1] : e, ur = (e, t) => ye(e) ? lr(e, t) : e, dr = (e, t) => {
2781
+ let { clientWidth: n } = e, { breakpoints: r, layout: i, labelAlign: a, wrapperAlign: o, labelCol: s, wrapperCol: c, ...l } = t, u = cr(r, n);
2782
+ return {
2783
+ layout: ur(i, u),
2784
+ labelAlign: ur(a, u),
2785
+ wrapperAlign: ur(o, u),
2786
+ labelCol: ur(s, u),
2787
+ wrapperCol: ur(c, u),
2788
+ ...l
2789
+ };
2790
+ }, fr = (e) => {
2791
+ let t = l(null), { breakpoints: n } = e;
2792
+ if (!ge(n)) return {
2793
+ ref: t,
2794
+ props: e
2795
+ };
2796
+ let [r, i] = u(e), a = () => {
2797
+ t.current && i(dr(t.current, e));
2798
+ };
2799
+ return o(() => {
2800
+ let e = new ResizeObserver(() => {
2801
+ a();
2802
+ });
2803
+ return t.current && e.observe(t.current), a(), () => {
2804
+ e.disconnect();
2805
+ };
2806
+ }, []), {
2807
+ ref: t,
2808
+ props: r
2809
+ };
2810
+ }, pr = n(null), mr = n(null), hr = () => a(pr), gr = () => a(mr), _r = () => {
2811
+ let e = Q(3), t = hr(), n = gr(), r;
2812
+ return e[0] !== t || e[1] !== n ? (r = {
2813
+ ...t,
2814
+ ...n
2815
+ }, e[0] = t, e[1] = n, e[2] = r) : r = e[2], r;
2816
+ }, vr = ({ shallow: e, children: t, prefixCls: n, className: r, style: i, ...a }) => {
2817
+ let { ref: o, props: s } = fr(a), c = hr(), l = pe("form", { prefixCls: n }), u = pe("formily-layout", { prefixCls: n }), d = Y(u, {
2818
+ [`${l}-${s.layout}`]: !0,
2819
+ [`${l}-rtl`]: s.direction === "rtl",
2820
+ [`${l}-${s.size}`]: s.size
2821
+ }, r);
2822
+ return /* @__PURE__ */ X("div", {
2823
+ ref: o,
2824
+ className: d,
2825
+ style: i,
2826
+ children: (() => {
2827
+ let n = { ...c };
2828
+ return e ? (s.size && (n.size = s.size), s.colon && (n.colon = s.colon)) : Object.assign(n, s), /* @__PURE__ */ X(pr.Provider, {
2829
+ value: n,
2830
+ children: /* @__PURE__ */ X(mr.Provider, {
2831
+ value: e ? s : void 0,
2832
+ children: t
2833
+ })
2834
+ });
2835
+ })()
2836
+ });
2837
+ };
2838
+ vr.defaultProps = { shallow: !0 }, vr.useFormDeepLayout = hr, vr.useFormShallowLayout = gr, vr.useFormLayout = _r;
2839
+ //#endregion
2840
+ //#region src/components/FormItem/common/useFormItemLayout.tsx
2841
+ var yr = (e) => {
2842
+ let t = Q(23), n = _r(), r = e.layout ?? n.layout ?? "horizontal", i = e.colon ?? n.colon, a = r === "vertical" ? e.labelAlign ?? "left" : e.labelAlign ?? n.labelAlign ?? "right", o = e.labelWrap ?? n.labelWrap, s = e.labelWidth ?? n.labelWidth, c = e.wrapperWidth ?? n.wrapperWidth, l = e.labelCol ?? n.labelCol, u = e.wrapperCol ?? n.wrapperCol, d = e.wrapperAlign ?? n.wrapperAlign, f = e.wrapperWrap ?? n.wrapperWrap, p = e.fullness ?? n.fullness, m = e.size ?? n.size, h = e.inset ?? n.inset, g = e.bordered ?? n.bordered, _ = e.feedbackLayout ?? n.feedbackLayout ?? "loose", v = e.tooltipLayout ?? n.tooltipLayout ?? "icon", y;
2843
+ t[0] !== n.tooltipIcon || t[1] !== e.tooltipIcon ? (y = e.tooltipIcon ?? n.tooltipIcon ?? /* @__PURE__ */ X(Te, {}), t[0] = n.tooltipIcon, t[1] = e.tooltipIcon, t[2] = y) : y = t[2];
2844
+ let b;
2845
+ return t[3] !== n || t[4] !== r || t[5] !== e || t[6] !== i || t[7] !== a || t[8] !== m || t[9] !== h || t[10] !== g || t[11] !== _ || t[12] !== v || t[13] !== y || t[14] !== o || t[15] !== s || t[16] !== c || t[17] !== l || t[18] !== u || t[19] !== d || t[20] !== f || t[21] !== p ? (b = {
2846
+ ...n,
2847
+ ...e,
2848
+ layout: r,
2849
+ colon: i,
2850
+ labelAlign: a,
2851
+ labelWrap: o,
2852
+ labelWidth: s,
2853
+ wrapperWidth: c,
2854
+ labelCol: l,
2855
+ wrapperCol: u,
2856
+ wrapperAlign: d,
2857
+ wrapperWrap: f,
2858
+ fullness: p,
2859
+ size: m,
2860
+ inset: h,
2861
+ asterisk: e.asterisk,
2862
+ requiredMark: n.requiredMark,
2863
+ optionalMarkHidden: e.optionalMarkHidden,
2864
+ bordered: g,
2865
+ feedbackIcon: e.feedbackIcon,
2866
+ feedbackLayout: _,
2867
+ tooltipLayout: v,
2868
+ tooltipIcon: y
2869
+ }, t[3] = n, t[4] = r, t[5] = e, t[6] = i, t[7] = a, t[8] = m, t[9] = h, t[10] = g, t[11] = _, t[12] = v, t[13] = y, t[14] = o, t[15] = s, t[16] = c, t[17] = l, t[18] = u, t[19] = d, t[20] = f, t[21] = p, t[22] = b) : b = t[22], b;
2870
+ };
2871
+ //#endregion
2872
+ //#region src/components/FormItem/index.tsx
2873
+ function br() {
2874
+ let e = Q(8), [t, n] = u(!1), r = l(), i = l(), a = _r(), s;
2875
+ e[0] === a.labelCol ? s = e[1] : (s = JSON.stringify(a.labelCol), e[0] = a.labelCol, e[1] = s);
2876
+ let c = s, d;
2877
+ e[2] === t ? d = e[3] : (d = () => {
2878
+ requestAnimationFrame(() => {
2879
+ if (r.current && i.current) {
2880
+ let e = i.current.getBoundingClientRect().width, a = r.current.getBoundingClientRect().width;
2881
+ e && a && a < e ? t || n(!0) : t && n(!1);
2882
+ }
2883
+ });
2884
+ }, e[2] = t, e[3] = d);
2885
+ let f;
2886
+ e[4] === c ? f = e[5] : (f = [c], e[4] = c, e[5] = f), o(d, f);
2887
+ let p;
2888
+ return e[6] === t ? p = e[7] : (p = {
2889
+ overflow: t,
2890
+ containerRef: r,
2891
+ contentRef: i
2892
+ }, e[6] = t, e[7] = p), p;
2893
+ }
2894
+ var xr = {
2895
+ error: /* @__PURE__ */ X(Ce, {}),
2896
+ success: /* @__PURE__ */ X(xe, {}),
2897
+ warning: /* @__PURE__ */ X(Te, {})
2898
+ }, Sr = ({ children: t, ...n }) => {
2899
+ let [r, i] = u(!1), a = de(), o = yr(n), { containerRef: s, contentRef: c, overflow: l } = br(), { label: d, style: f, layout: p, colon: m = !0, addonBefore: h, addonAfter: g, requiredMark: _ = !0, optionalMarkHidden: v = !1, feedbackStatus: y, extra: b, feedbackText: x, fullness: S, feedbackLayout: C, feedbackIcon: w, enableOutlineFeedback: T = !0, getPopupContainer: E, inset: D, bordered: O = !0, labelWidth: k, wrapperWidth: A, labelCol: j, wrapperCol: M, labelAlign: ee, wrapperAlign: N = "left", size: P, labelWrap: F, wrapperWrap: I, tooltipLayout: L, tooltip: R, tooltipIcon: z, asterisk: te } = o, V = { ...o.labelStyle }, H = { ...o.wrapperStyle }, U = !1;
2900
+ (k || A) && (k && (V.width = k === "auto" ? void 0 : k, V.maxWidth = k === "auto" ? void 0 : k), A && (H.width = A === "auto" ? void 0 : A, H.maxWidth = A === "auto" ? void 0 : A)), (j || M) && !V.width && !H.width && p !== "vertical" && (U = !0);
2901
+ let W = pe("formily-item", n), G = C === "popover" ? /* @__PURE__ */ X(B, {
2902
+ placement: "top",
2903
+ content: /* @__PURE__ */ Z("div", {
2904
+ className: Y({
2905
+ [`${W}-${y}-help`]: !!y,
2906
+ [`${W}-help`]: !0
2907
+ }),
2908
+ children: [
2909
+ xr[y],
2910
+ " ",
2911
+ x
2912
+ ]
2913
+ }),
2914
+ visible: !!x,
2915
+ children: /* @__PURE__ */ X(he, { children: ne(t) })
2916
+ }) : ne(t);
2917
+ function ne(t) {
2918
+ return e.Children.map(t, (t) => e.cloneElement(t, { ...n }));
2919
+ }
2920
+ let re = {}, ie = () => l ? /* @__PURE__ */ Z("div", { children: [/* @__PURE__ */ X("div", { children: d }), /* @__PURE__ */ X("div", { children: R })] }) : R, ae = () => {
2921
+ let e = /* @__PURE__ */ X("div", {
2922
+ className: `${W}-label-content`,
2923
+ ref: s,
2924
+ children: /* @__PURE__ */ Z("span", {
2925
+ ref: c,
2926
+ children: [
2927
+ te && _ === !0 && /* @__PURE__ */ X("span", {
2928
+ className: `${W}-asterisk`,
2929
+ children: "*"
2930
+ }),
2931
+ /* @__PURE__ */ X("label", {
2932
+ htmlFor: n.labelFor,
2933
+ children: d
2934
+ }),
2935
+ !te && _ === "optional" && !v && /* @__PURE__ */ X("span", {
2936
+ className: `${W}-optional`,
2937
+ children: "选填"
2938
+ })
2939
+ ]
2940
+ })
2941
+ });
2942
+ return L === "text" && R || l ? /* @__PURE__ */ X(B, {
2943
+ placement: "top",
2944
+ mode: "dark",
2945
+ trigger: "click",
2946
+ content: ie(),
2947
+ children: e
2948
+ }) : e;
2949
+ }, oe = () => {
2950
+ if (R && L === "icon" && !l) return /* @__PURE__ */ X("span", {
2951
+ className: `${W}-label-tooltip-icon`,
2952
+ children: /* @__PURE__ */ X(B, {
2953
+ placement: "top",
2954
+ mode: "dark",
2955
+ trigger: "click",
2956
+ content: R,
2957
+ children: /* @__PURE__ */ X("span", { children: z })
2958
+ })
2959
+ });
2960
+ }, se = () => d ? /* @__PURE__ */ Z("div", {
2961
+ className: Y({
2962
+ [`${W}-label`]: !0,
2963
+ [`${W}-label-tooltip`]: R && L === "text" || l,
2964
+ [`${W}-item-col-${j}`]: U && !!j
2965
+ }),
2966
+ style: V,
2967
+ children: [
2968
+ ae(),
2969
+ oe(),
2970
+ d !== " " && /* @__PURE__ */ X("span", {
2971
+ className: `${W}-colon`,
2972
+ children: m ? ":" : ""
2973
+ })
2974
+ ]
2975
+ }) : null;
2976
+ return /* @__PURE__ */ Z("div", {
2977
+ ...fe(n),
2978
+ style: {
2979
+ ...f,
2980
+ ...re
2981
+ },
2982
+ className: Y({
2983
+ "formily-form-item": !0,
2984
+ [`item-name-${a.name}`]: !0,
2985
+ [`layout-${p}`]: !0,
2986
+ [`${W}`]: !0,
2987
+ [`${W}-layout-${p}`]: !0,
2988
+ [`${W}-${y}`]: T && !!y,
2989
+ [`${W}-feedback-has-text`]: !!x,
2990
+ [`${W}-size-${P}`]: !!P,
2991
+ [`${W}-feedback-layout-${C}`]: !!C,
2992
+ [`${W}-fullness`]: !!S || !!D || !!w,
2993
+ [`${W}-inset`]: !!D,
2994
+ [`${W}-active`]: r,
2995
+ [`${W}-inset-active`]: !!D && r,
2996
+ [`${W}-label-align-${ee}`]: !0,
2997
+ [`${W}-control-align-${N}`]: !0,
2998
+ [`${W}-label-wrap`]: !!F,
2999
+ [`${W}-control-wrap`]: !!I,
3000
+ [`${W}-bordered-none`]: O === !1 || !!D || !!w,
3001
+ [n.className]: !!n.className
3002
+ }),
3003
+ "data-grid-span": n.gridSpan,
3004
+ onFocus: () => {
3005
+ (w || D) && i(!0);
3006
+ },
3007
+ onBlur: () => {
3008
+ (w || D) && i(!1);
3009
+ },
3010
+ children: [se(), /* @__PURE__ */ Z("div", {
3011
+ className: Y({
3012
+ [`${W}-control`]: !0,
3013
+ [`${W}-item-col-${M}`]: U && !!M && d
3014
+ }),
3015
+ children: [
3016
+ /* @__PURE__ */ Z("div", {
3017
+ className: Y(`${W}-control-content`),
3018
+ children: [
3019
+ h && /* @__PURE__ */ X("div", {
3020
+ className: Y(`${W}-addon-before`),
3021
+ children: h
3022
+ }),
3023
+ /* @__PURE__ */ Z("div", {
3024
+ style: H,
3025
+ className: Y({
3026
+ [`${W}-control-content-component`]: !0,
3027
+ [`${W}-control-content-component-has-feedback-icon`]: !!w
3028
+ }),
3029
+ children: [/* @__PURE__ */ X(mr.Provider, {
3030
+ value: void 0,
3031
+ children: G
3032
+ }), w && /* @__PURE__ */ X("div", {
3033
+ className: Y(`${W}-feedback-icon`),
3034
+ children: w
3035
+ })]
3036
+ }),
3037
+ g && /* @__PURE__ */ X("div", {
3038
+ className: Y(`${W}-addon-after`),
3039
+ children: g
3040
+ })
3041
+ ]
3042
+ }),
3043
+ !!x && C !== "popover" && C !== "none" && /* @__PURE__ */ X("div", {
3044
+ className: Y({
3045
+ [`${W}-${y}-help`]: !!y,
3046
+ [`${W}-help`]: !0,
3047
+ [`${W}-help-enter`]: !0,
3048
+ [`${W}-help-enter-active`]: !0
3049
+ }),
3050
+ children: x
3051
+ }),
3052
+ b && /* @__PURE__ */ X("div", {
3053
+ className: Y(`${W}-extra`),
3054
+ children: b
3055
+ })
3056
+ ]
3057
+ })]
3058
+ });
3059
+ }, Cr = ce(Sr, ue((e, t) => {
3060
+ let n = an();
3061
+ return oe(t) ? {
3062
+ label: t.title || e.label,
3063
+ asterisk: e.asterisk,
3064
+ extra: e.extra || t.description
3065
+ } : t ? {
3066
+ label: e.label || t.title,
3067
+ feedbackStatus: t.validating ? "pending" : t.decoratorProps.feedbackStatus || t.validateStatus,
3068
+ feedbackText: (() => {
3069
+ let n = (e) => e.reduce((t, n, r) => n ? r < e.length - 1 ? t.concat([n, ", "]) : t.concat([n]) : t, []);
3070
+ if (!t.validating) {
3071
+ if (e.feedbackText) return e.feedbackText;
3072
+ if (t.selfErrors.length) return n(t.selfErrors);
3073
+ if (t.selfWarnings.length) return n(t.selfWarnings);
3074
+ if (t.selfSuccesses.length) return n(t.selfSuccesses);
3075
+ }
3076
+ })(),
3077
+ asterisk: n._scenario_ === "descriptions" ? !1 : t.required && t.pattern !== "readPretty" ? !0 : "asterisk" in e && e.asterisk,
3078
+ optionalMarkHidden: t.pattern === "readPretty" && !("asterisk" in e),
3079
+ extra: e.extra || t.description
3080
+ } : e;
3081
+ }));
3082
+ Cr.BaseItem = Sr;
3083
+ //#endregion
3084
+ //#region src/components/index.ts
3085
+ var wr = /* @__PURE__ */ He({
3086
+ ArrayCards: () => Qe,
3087
+ ArrayTable: () => ct,
3088
+ Cascader: () => ft,
3089
+ Checkbox: () => Sn,
3090
+ DatePicker: () => _t,
3091
+ FormCollapse: () => bt,
3092
+ FormItem: () => Cr,
3093
+ FormLayout: () => vr,
3094
+ LocationPicker: () => Jn,
3095
+ NumberPicker: () => xt,
3096
+ Password: () => St,
3097
+ Radio: () => gn,
3098
+ Select: () => Ct,
3099
+ Slider: () => sr,
3100
+ Text: () => wt,
3101
+ TimePicker: () => Et,
3102
+ TreeSelect: () => or,
3103
+ Upload: () => sn,
3104
+ Uploader: () => on,
3105
+ UserSelect: () => un
3106
+ });
3107
+ //#endregion
3108
+ //#region src/common/schemaHandler.js
3109
+ function Tr(e, t = {}) {
3110
+ let n = Le.cloneDeep(e), r = n.schema || n, i = n.form || {};
3111
+ return i.layout ||= "horizontal", t.layout && (i.layout = t.layout), n = {
3112
+ ...e,
3113
+ form: i,
3114
+ schema: r
3115
+ }, n;
3116
+ }
3117
+ //#endregion
3118
+ //#region src/index.tsx
3119
+ var Er = r((e, t) => {
3120
+ let { isDetail: n, readOnly: r } = e, i = c(() => le({
3121
+ components: {
3122
+ CascadePicker: d,
3123
+ CheckList: f,
3124
+ DatePicker: p,
3125
+ FormGrid: h,
3126
+ Input: g,
3127
+ List: _,
3128
+ Selector: y,
3129
+ Stepper: b,
3130
+ Switch: S,
3131
+ FormButtonGroup: m,
3132
+ Submit: x,
3133
+ Reset: v,
3134
+ Card: D,
3135
+ ...wr,
3136
+ ...e.components
3137
+ },
3138
+ scope: {
3139
+ scenario: "form-render-m",
3140
+ ...e.schemaScope
3141
+ }
3142
+ }), []), a = c(() => ae({
3143
+ initialValues: e.initialValues,
3144
+ readOnly: r || n,
3145
+ disabled: e.disabled,
3146
+ ...e.formOptions || {}
3147
+ }), []);
3148
+ s(t, () => ({ formRender: a })), o(() => {
3149
+ e.init && e.init(a);
3150
+ }, []);
3151
+ let l = c(() => Tr(e.schema), [e.schema]), u = { ...l?.form };
3152
+ return /* @__PURE__ */ X(rn.Provider, {
3153
+ value: e,
3154
+ children: /* @__PURE__ */ X("div", {
3155
+ className: `form-render ${e.className} ${n ? "form-render-detail" : ""}`,
3156
+ children: /* @__PURE__ */ Z(se, {
3157
+ form: a,
3158
+ children: [/* @__PURE__ */ X(pr.Provider, {
3159
+ value: u,
3160
+ children: /* @__PURE__ */ Z(vr, {
3161
+ ...u,
3162
+ children: [/* @__PURE__ */ X(i, { schema: l?.schema }), e.hasSubmit !== !1 && n !== !0 && r !== !0 && !e.disabled ? /* @__PURE__ */ X(m, { children: /* @__PURE__ */ X(x, {
3163
+ onSubmit: (t) => {
3164
+ e.onSubmit && e.onSubmit(t);
3165
+ },
3166
+ children: e.submitText || "提交"
3167
+ }) }) : null]
3168
+ })
3169
+ }), /* @__PURE__ */ X("div", {
3170
+ className: "form-render-footer",
3171
+ children: e.footerRender && e.footerRender()
3172
+ })]
3173
+ })
3174
+ })
3175
+ });
3176
+ });
3177
+ //#endregion
3178
+ export { Er as default };