@goodie-forms/core 1.2.5-alpha → 1.2.6-alpha
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.
- package/dist/field/FieldPath.d.ts +18 -9
- package/dist/field/FieldPath.d.ts.map +1 -1
- package/dist/field/FieldPathBuilder.d.ts +2 -2
- package/dist/field/FieldPathBuilder.d.ts.map +1 -1
- package/dist/field/Reconcile.d.ts +2 -2
- package/dist/field/Reconcile.d.ts.map +1 -1
- package/dist/form/FormController.d.ts +51 -20
- package/dist/form/FormController.d.ts.map +1 -1
- package/dist/form/FormField.d.ts +15 -10
- package/dist/form/FormField.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +523 -476
- package/dist/index.js.map +1 -1
- package/dist/types/DeepHelpers.d.ts +11 -0
- package/dist/types/DeepHelpers.d.ts.map +1 -0
- package/dist/types/FormHelpers.d.ts +5 -0
- package/dist/types/FormHelpers.d.ts.map +1 -0
- package/dist/types/Suppliable.d.ts +3 -0
- package/dist/types/Suppliable.d.ts.map +1 -0
- package/dist/validation/CustomValidation.d.ts +1 -1
- package/package.json +13 -3
- package/src/field/FieldPath.spec.ts +204 -0
- package/src/field/FieldPath.ts +62 -59
- package/src/field/FieldPathBuilder.spec.ts +47 -0
- package/src/field/FieldPathBuilder.ts +15 -81
- package/src/field/Reconcile.ts +2 -2
- package/src/form/FormController.spec.ts +55 -0
- package/src/form/FormController.ts +151 -115
- package/src/form/FormField.ts +63 -30
- package/src/index.ts +2 -2
- package/src/types/DeepHelpers.ts +15 -0
- package/src/types/FormHelpers.ts +13 -0
- package/src/types/Suppliable.ts +7 -0
- package/src/validation/CustomValidation.ts +1 -1
- package/dist/form/NonullFormField.d.ts +0 -9
- package/dist/form/NonullFormField.d.ts.map +0 -1
- package/dist/types/DeepPartial.d.ts +0 -6
- package/dist/types/DeepPartial.d.ts.map +0 -1
- package/src/form/NonullFormField.ts +0 -15
- package/src/types/DeepPartial.ts +0 -7
- package/tsconfig.json +0 -8
- package/vite.config.ts +0 -18
package/dist/index.js
CHANGED
|
@@ -1,177 +1,177 @@
|
|
|
1
1
|
var h;
|
|
2
2
|
((t) => {
|
|
3
|
-
function e(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t.toCanonicalPath = e;
|
|
7
|
-
function i(c) {
|
|
8
|
-
const a = r(c);
|
|
9
|
-
let l = "";
|
|
3
|
+
function e(f) {
|
|
4
|
+
const a = r(f);
|
|
5
|
+
let u = "";
|
|
10
6
|
for (const y of a)
|
|
11
|
-
typeof y == "number" ?
|
|
12
|
-
return
|
|
7
|
+
typeof y == "number" ? u += `[${y}]` : (u.length > 0 && (u += "."), u += y.toString());
|
|
8
|
+
return u;
|
|
13
9
|
}
|
|
14
|
-
t.toStringPath =
|
|
15
|
-
function
|
|
10
|
+
t.toStringPath = e;
|
|
11
|
+
function i(f) {
|
|
16
12
|
const a = [];
|
|
17
|
-
let
|
|
18
|
-
for (;
|
|
19
|
-
const y =
|
|
13
|
+
let u = 0;
|
|
14
|
+
for (; u < f.length; ) {
|
|
15
|
+
const y = f[u];
|
|
20
16
|
if (y === ".") {
|
|
21
|
-
|
|
17
|
+
u++;
|
|
22
18
|
continue;
|
|
23
19
|
}
|
|
24
20
|
if (y === "[") {
|
|
25
|
-
|
|
26
|
-
let
|
|
27
|
-
for (;
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
throw new Error(`Invalid array index in path: ${
|
|
31
|
-
a.push(Number(
|
|
21
|
+
u++;
|
|
22
|
+
let V = "";
|
|
23
|
+
for (; u < f.length && f[u] !== "]"; )
|
|
24
|
+
V += f[u], u++;
|
|
25
|
+
if (u++, !V || !/^\d+$/.test(V))
|
|
26
|
+
throw new Error(`Invalid array index in path: ${f}`);
|
|
27
|
+
a.push(Number(V));
|
|
32
28
|
continue;
|
|
33
29
|
}
|
|
34
|
-
let
|
|
35
|
-
for (;
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
let S = "";
|
|
31
|
+
for (; u < f.length && /[^\.\[]/.test(f[u]); )
|
|
32
|
+
S += f[u], u++;
|
|
33
|
+
S && a.push(S);
|
|
38
34
|
}
|
|
39
35
|
return a;
|
|
40
36
|
}
|
|
41
|
-
t.fromStringPath =
|
|
42
|
-
function r(
|
|
43
|
-
return
|
|
37
|
+
t.fromStringPath = i;
|
|
38
|
+
function r(f) {
|
|
39
|
+
return f?.map((a) => {
|
|
44
40
|
if (typeof a == "string" || typeof a == "number" || typeof a == "symbol") return a;
|
|
45
41
|
if (typeof a == "object" && "key" in a)
|
|
46
42
|
return typeof a == "string" || typeof a == "number" || typeof a == "symbol" ? a : a.key;
|
|
47
43
|
});
|
|
48
44
|
}
|
|
49
45
|
t.normalize = r;
|
|
50
|
-
function
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
for (let
|
|
54
|
-
if (
|
|
46
|
+
function n(f, a) {
|
|
47
|
+
if (f === a) return !0;
|
|
48
|
+
if (f == null || a == null || f.length !== a.length) return !1;
|
|
49
|
+
for (let u = 0; u < f.length; u++)
|
|
50
|
+
if (f[u] !== a[u]) return !1;
|
|
55
51
|
return !0;
|
|
56
52
|
}
|
|
57
|
-
t.equals =
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
60
|
-
for (let
|
|
61
|
-
if (
|
|
53
|
+
t.equals = n;
|
|
54
|
+
function s(f, a) {
|
|
55
|
+
if (f.length >= a.length) return !1;
|
|
56
|
+
for (let u = 0; u < f.length; u++)
|
|
57
|
+
if (f[u] !== a[u])
|
|
62
58
|
return !1;
|
|
63
59
|
return !0;
|
|
64
60
|
}
|
|
65
|
-
t.isDescendant =
|
|
66
|
-
function f
|
|
67
|
-
let
|
|
61
|
+
t.isDescendant = s;
|
|
62
|
+
function o(f, a, u) {
|
|
63
|
+
let y = f;
|
|
64
|
+
for (let V = 0; V < a.length - 1; V++) {
|
|
65
|
+
const Q = a[V], Ot = a[V + 1];
|
|
66
|
+
if (y[Q] == null) {
|
|
67
|
+
if (u?.returnOnEmptyBranch) return { target: null, key: null };
|
|
68
|
+
y[Q] = typeof Ot == "number" ? [] : {};
|
|
69
|
+
}
|
|
70
|
+
y = y[Q];
|
|
71
|
+
}
|
|
72
|
+
const S = a[a.length - 1];
|
|
73
|
+
return {
|
|
74
|
+
target: y,
|
|
75
|
+
key: S
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
t.walkPath = o;
|
|
79
|
+
function l(f, a) {
|
|
80
|
+
let u = f;
|
|
68
81
|
for (const y of a) {
|
|
69
|
-
if (
|
|
70
|
-
|
|
82
|
+
if (u == null) return;
|
|
83
|
+
u = u[y];
|
|
71
84
|
}
|
|
72
|
-
return
|
|
85
|
+
return u;
|
|
73
86
|
}
|
|
74
|
-
t.getValue =
|
|
75
|
-
function d(
|
|
76
|
-
|
|
87
|
+
t.getValue = l;
|
|
88
|
+
function d(f, a, u) {
|
|
89
|
+
const { target: y, key: S } = o(f, a);
|
|
90
|
+
y[S] = u;
|
|
77
91
|
}
|
|
78
92
|
t.setValue = d;
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
function _(c, a) {
|
|
90
|
-
let l = c;
|
|
91
|
-
for (let v = 0; v < a.length - 1; v++) {
|
|
92
|
-
const S = a[v];
|
|
93
|
-
if (l[S] == null) return;
|
|
94
|
-
l = l[S];
|
|
95
|
-
}
|
|
96
|
-
const y = a[a.length - 1];
|
|
97
|
-
delete l[y];
|
|
93
|
+
function c(f, a, u) {
|
|
94
|
+
const { target: y, key: S } = o(f, a);
|
|
95
|
+
u(y[S]);
|
|
96
|
+
}
|
|
97
|
+
t.modifyValue = c;
|
|
98
|
+
function _(f, a) {
|
|
99
|
+
const { target: u, key: y } = o(f, a, {
|
|
100
|
+
returnOnEmptyBranch: !0
|
|
101
|
+
});
|
|
102
|
+
y != null && delete u[y];
|
|
98
103
|
}
|
|
99
104
|
t.deleteValue = _;
|
|
100
105
|
})(h || (h = {}));
|
|
101
|
-
const
|
|
102
|
-
class
|
|
106
|
+
const dt = /* @__PURE__ */ Symbol("PathResolver");
|
|
107
|
+
class R {
|
|
103
108
|
static wrap(e) {
|
|
104
109
|
return new Proxy(e, {
|
|
105
|
-
get(i,
|
|
106
|
-
if (
|
|
107
|
-
const s = typeof
|
|
108
|
-
return
|
|
110
|
+
get(i, r, n) {
|
|
111
|
+
if (r === dt) return e;
|
|
112
|
+
const s = typeof r == "string" && /^\d+$/.test(r) ? Number(r) : r;
|
|
113
|
+
return R.wrap([
|
|
109
114
|
...e,
|
|
110
115
|
s
|
|
111
116
|
]);
|
|
112
117
|
}
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
|
-
|
|
116
|
-
return h.fromStringPath(
|
|
117
|
-
e
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
fromProxy(e) {
|
|
121
|
-
return e(et.wrap([]))[_t];
|
|
120
|
+
of(e) {
|
|
121
|
+
return typeof e == "function" ? e(R.wrap([]))[dt] : h.fromStringPath(e);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
var
|
|
124
|
+
var v;
|
|
125
125
|
((t) => {
|
|
126
|
-
function e(
|
|
127
|
-
if (
|
|
128
|
-
if (
|
|
129
|
-
if (Array.isArray(
|
|
130
|
-
if (!Array.isArray(
|
|
131
|
-
for (let d = 0; d <
|
|
132
|
-
if (!e(
|
|
126
|
+
function e(r, n, s) {
|
|
127
|
+
if (r === n) return !0;
|
|
128
|
+
if (r === null || n === null || typeof r != "object" || typeof n != "object") return !1;
|
|
129
|
+
if (Array.isArray(r)) {
|
|
130
|
+
if (!Array.isArray(n) || r.length !== n.length) return !1;
|
|
131
|
+
for (let d = 0; d < r.length; d++)
|
|
132
|
+
if (!e(r[d], n[d])) return !1;
|
|
133
133
|
return !0;
|
|
134
134
|
}
|
|
135
135
|
if (s != null) {
|
|
136
|
-
const d = s(
|
|
136
|
+
const d = s(r, n);
|
|
137
137
|
if (d !== void 0) return d;
|
|
138
138
|
}
|
|
139
|
-
if (
|
|
140
|
-
return
|
|
141
|
-
if (
|
|
142
|
-
return
|
|
143
|
-
if (
|
|
144
|
-
if (
|
|
145
|
-
for (const [d,
|
|
146
|
-
if (!
|
|
139
|
+
if (r instanceof Date && n instanceof Date)
|
|
140
|
+
return r.getTime() === n.getTime();
|
|
141
|
+
if (r instanceof RegExp && n instanceof RegExp)
|
|
142
|
+
return r.source === n.source && r.flags === n.flags;
|
|
143
|
+
if (r instanceof Map && n instanceof Map) {
|
|
144
|
+
if (r.size !== n.size) return !1;
|
|
145
|
+
for (const [d, c] of r)
|
|
146
|
+
if (!n.has(d) || !e(c, n.get(d))) return !1;
|
|
147
147
|
return !0;
|
|
148
148
|
}
|
|
149
|
-
if (
|
|
150
|
-
if (
|
|
151
|
-
for (const d of
|
|
152
|
-
if (!
|
|
149
|
+
if (r instanceof Set && n instanceof Set) {
|
|
150
|
+
if (r.size !== n.size) return !1;
|
|
151
|
+
for (const d of r)
|
|
152
|
+
if (!n.has(d)) return !1;
|
|
153
153
|
return !0;
|
|
154
154
|
}
|
|
155
|
-
if (Object.getPrototypeOf(
|
|
155
|
+
if (Object.getPrototypeOf(r) !== Object.getPrototypeOf(n))
|
|
156
156
|
return !1;
|
|
157
|
-
const o = Object.keys(
|
|
158
|
-
if (o.length !==
|
|
157
|
+
const o = Object.keys(r), l = Object.keys(n);
|
|
158
|
+
if (o.length !== l.length) return !1;
|
|
159
159
|
for (const d of o)
|
|
160
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
160
|
+
if (!Object.prototype.hasOwnProperty.call(n, d) || !e(r[d], n[d])) return !1;
|
|
161
161
|
return !0;
|
|
162
162
|
}
|
|
163
163
|
t.deepEqual = e;
|
|
164
|
-
function i(
|
|
165
|
-
const
|
|
166
|
-
for (const _ of r)
|
|
167
|
-
n.some((c) => s(c, _)) ? (o?.(_) ?? !0) && u.push(_) : (o?.(_) ?? !0) && f.push(_);
|
|
164
|
+
function i(r, n, s, o) {
|
|
165
|
+
const l = [], d = [], c = [];
|
|
168
166
|
for (const _ of n)
|
|
169
|
-
r.some((
|
|
170
|
-
|
|
167
|
+
r.some((f) => s(f, _)) ? (o?.(_) ?? !0) && c.push(_) : (o?.(_) ?? !0) && l.push(_);
|
|
168
|
+
for (const _ of r)
|
|
169
|
+
n.some((f) => s(_, f)) || (o?.(_) ?? !0) && d.push(_);
|
|
170
|
+
return { added: l, removed: d, unchanged: c };
|
|
171
171
|
}
|
|
172
|
-
t.
|
|
173
|
-
})(
|
|
174
|
-
var
|
|
172
|
+
t.arrayDiff = i;
|
|
173
|
+
})(v || (v = {}));
|
|
174
|
+
var Vt = /* @__PURE__ */ Symbol.for("immer-nothing"), x = /* @__PURE__ */ Symbol.for("immer-draftable"), g = /* @__PURE__ */ Symbol.for("immer-state"), It = process.env.NODE_ENV !== "production" ? [
|
|
175
175
|
// All error codes, starting by 0:
|
|
176
176
|
function(t) {
|
|
177
177
|
return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
|
|
@@ -202,22 +202,22 @@ var Dt = /* @__PURE__ */ Symbol.for("immer-nothing"), x = /* @__PURE__ */ Symbol
|
|
|
202
202
|
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
|
|
203
203
|
// See Patches.ts for additional errors
|
|
204
204
|
] : [];
|
|
205
|
-
function
|
|
205
|
+
function m(t, ...e) {
|
|
206
206
|
if (process.env.NODE_ENV !== "production") {
|
|
207
|
-
const i =
|
|
208
|
-
throw new Error(`[Immer] ${
|
|
207
|
+
const i = It[t], r = E(i) ? i.apply(null, e) : i;
|
|
208
|
+
throw new Error(`[Immer] ${r}`);
|
|
209
209
|
}
|
|
210
210
|
throw new Error(
|
|
211
211
|
`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
|
-
var p = Object, F = p.getPrototypeOf, U = "constructor", W = "prototype",
|
|
215
|
-
function
|
|
216
|
-
return t ?
|
|
214
|
+
var p = Object, F = p.getPrototypeOf, U = "constructor", W = "prototype", et = "configurable", q = "enumerable", A = "writable", z = "value", w = (t) => !!t && !!t[g];
|
|
215
|
+
function P(t) {
|
|
216
|
+
return t ? Dt(t) || K(t) || !!t[x] || !!t[U]?.[x] || H(t) || Y(t) : !1;
|
|
217
217
|
}
|
|
218
|
-
var Tt = p[W][U].toString(),
|
|
219
|
-
function
|
|
220
|
-
if (!t || !
|
|
218
|
+
var Tt = p[W][U].toString(), ht = /* @__PURE__ */ new WeakMap();
|
|
219
|
+
function Dt(t) {
|
|
220
|
+
if (!t || !lt(t))
|
|
221
221
|
return !1;
|
|
222
222
|
const e = F(t);
|
|
223
223
|
if (e === null || e === p[W])
|
|
@@ -225,35 +225,35 @@ function wt(t) {
|
|
|
225
225
|
const i = p.hasOwnProperty.call(e, U) && e[U];
|
|
226
226
|
if (i === Object)
|
|
227
227
|
return !0;
|
|
228
|
-
if (!
|
|
228
|
+
if (!E(i))
|
|
229
229
|
return !1;
|
|
230
|
-
let
|
|
231
|
-
return
|
|
230
|
+
let r = ht.get(i);
|
|
231
|
+
return r === void 0 && (r = Function.toString.call(i), ht.set(i, r)), r === Tt;
|
|
232
232
|
}
|
|
233
233
|
function G(t, e, i = !0) {
|
|
234
|
-
|
|
235
|
-
e(
|
|
236
|
-
}) : t.forEach((
|
|
234
|
+
I(t) === 0 ? (i ? Reflect.ownKeys(t) : p.keys(t)).forEach((n) => {
|
|
235
|
+
e(n, t[n], t);
|
|
236
|
+
}) : t.forEach((r, n) => e(n, r, t));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
const e = t[
|
|
238
|
+
function I(t) {
|
|
239
|
+
const e = t[g];
|
|
240
240
|
return e ? e.type_ : K(t) ? 1 : H(t) ? 2 : Y(t) ? 3 : 0;
|
|
241
241
|
}
|
|
242
|
-
var
|
|
242
|
+
var _t = (t, e, i = I(t)) => i === 2 ? t.has(e) : p[W].hasOwnProperty.call(t, e), it = (t, e, i = I(t)) => (
|
|
243
243
|
// @ts-ignore
|
|
244
244
|
i === 2 ? t.get(e) : t[e]
|
|
245
|
-
),
|
|
246
|
-
|
|
245
|
+
), B = (t, e, i, r = I(t)) => {
|
|
246
|
+
r === 2 ? t.set(e, i) : r === 3 ? t.add(i) : t[e] = i;
|
|
247
247
|
};
|
|
248
|
-
function
|
|
248
|
+
function At(t, e) {
|
|
249
249
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
250
250
|
}
|
|
251
|
-
var K = Array.isArray, H = (t) => t instanceof Map, Y = (t) => t instanceof Set,
|
|
252
|
-
function
|
|
251
|
+
var K = Array.isArray, H = (t) => t instanceof Map, Y = (t) => t instanceof Set, lt = (t) => typeof t == "object", E = (t) => typeof t == "function", Z = (t) => typeof t == "boolean";
|
|
252
|
+
function Mt(t) {
|
|
253
253
|
const e = +t;
|
|
254
254
|
return Number.isInteger(e) && String(e) === t;
|
|
255
255
|
}
|
|
256
|
-
var
|
|
256
|
+
var D = (t) => t.copy_ || t.base_, ft = (t) => t.modified_ ? t.copy_ : t.base_;
|
|
257
257
|
function rt(t, e) {
|
|
258
258
|
if (H(t))
|
|
259
259
|
return new Map(t);
|
|
@@ -261,59 +261,59 @@ function rt(t, e) {
|
|
|
261
261
|
return new Set(t);
|
|
262
262
|
if (K(t))
|
|
263
263
|
return Array[W].slice.call(t);
|
|
264
|
-
const i =
|
|
264
|
+
const i = Dt(t);
|
|
265
265
|
if (e === !0 || e === "class_only" && !i) {
|
|
266
|
-
const
|
|
267
|
-
delete
|
|
268
|
-
let
|
|
269
|
-
for (let s = 0; s <
|
|
270
|
-
const o =
|
|
271
|
-
|
|
272
|
-
[
|
|
273
|
-
[
|
|
266
|
+
const r = p.getOwnPropertyDescriptors(t);
|
|
267
|
+
delete r[g];
|
|
268
|
+
let n = Reflect.ownKeys(r);
|
|
269
|
+
for (let s = 0; s < n.length; s++) {
|
|
270
|
+
const o = n[s], l = r[o];
|
|
271
|
+
l[A] === !1 && (l[A] = !0, l[et] = !0), (l.get || l.set) && (r[o] = {
|
|
272
|
+
[et]: !0,
|
|
273
|
+
[A]: !0,
|
|
274
274
|
// could live with !!desc.set as well here...
|
|
275
|
-
[
|
|
276
|
-
[
|
|
275
|
+
[q]: l[q],
|
|
276
|
+
[z]: t[o]
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
return p.create(F(t),
|
|
279
|
+
return p.create(F(t), r);
|
|
280
280
|
} else {
|
|
281
|
-
const
|
|
282
|
-
if (
|
|
281
|
+
const r = F(t);
|
|
282
|
+
if (r !== null && i)
|
|
283
283
|
return { ...t };
|
|
284
|
-
const
|
|
285
|
-
return p.assign(
|
|
284
|
+
const n = p.create(r);
|
|
285
|
+
return p.assign(n, t);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
return X(t) || w(t) || !
|
|
288
|
+
function ct(t, e = !1) {
|
|
289
|
+
return X(t) || w(t) || !P(t) || (I(t) > 1 && p.defineProperties(t, {
|
|
290
290
|
set: T,
|
|
291
291
|
add: T,
|
|
292
292
|
clear: T,
|
|
293
293
|
delete: T
|
|
294
294
|
}), p.freeze(t), e && G(
|
|
295
295
|
t,
|
|
296
|
-
(i,
|
|
297
|
-
|
|
296
|
+
(i, r) => {
|
|
297
|
+
ct(r, !0);
|
|
298
298
|
},
|
|
299
299
|
!1
|
|
300
300
|
)), t;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
|
|
302
|
+
function Nt() {
|
|
303
|
+
m(2);
|
|
304
304
|
}
|
|
305
305
|
var T = {
|
|
306
|
-
[
|
|
306
|
+
[z]: Nt
|
|
307
307
|
};
|
|
308
308
|
function X(t) {
|
|
309
|
-
return t === null || !
|
|
309
|
+
return t === null || !lt(t) ? !0 : p.isFrozen(t);
|
|
310
310
|
}
|
|
311
|
-
var
|
|
312
|
-
function
|
|
313
|
-
const e =
|
|
314
|
-
return e ||
|
|
311
|
+
var j = "MapSet", nt = "Patches", yt = "ArrayMethods", Pt = {};
|
|
312
|
+
function k(t) {
|
|
313
|
+
const e = Pt[t];
|
|
314
|
+
return e || m(0, t), e;
|
|
315
315
|
}
|
|
316
|
-
var
|
|
316
|
+
var gt = (t) => !!Pt[t], C, wt = () => C, Rt = (t, e) => ({
|
|
317
317
|
drafts_: [],
|
|
318
318
|
parent_: t,
|
|
319
319
|
immer_: e,
|
|
@@ -323,42 +323,42 @@ var pt = (t) => !!bt[t], k, Et = () => k, xt = (t, e) => ({
|
|
|
323
323
|
unfinalizedDrafts_: 0,
|
|
324
324
|
handledSet_: /* @__PURE__ */ new Set(),
|
|
325
325
|
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
326
|
-
mapSetPlugin_:
|
|
327
|
-
arrayMethodsPlugin_:
|
|
326
|
+
mapSetPlugin_: gt(j) ? k(j) : void 0,
|
|
327
|
+
arrayMethodsPlugin_: gt(yt) ? k(yt) : void 0
|
|
328
328
|
});
|
|
329
|
-
function
|
|
330
|
-
e && (t.patchPlugin_ =
|
|
329
|
+
function mt(t, e) {
|
|
330
|
+
e && (t.patchPlugin_ = k(nt), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = e);
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
|
|
332
|
+
function st(t) {
|
|
333
|
+
ot(t), t.drafts_.forEach(xt), t.drafts_ = null;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
t ===
|
|
335
|
+
function ot(t) {
|
|
336
|
+
t === C && (C = t.parent_);
|
|
337
337
|
}
|
|
338
|
-
var
|
|
339
|
-
function
|
|
340
|
-
const e = t[
|
|
338
|
+
var pt = (t) => C = Rt(C, t);
|
|
339
|
+
function xt(t) {
|
|
340
|
+
const e = t[g];
|
|
341
341
|
e.type_ === 0 || e.type_ === 1 ? e.revoke_() : e.revoked_ = !0;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function vt(t, e) {
|
|
344
344
|
e.unfinalizedDrafts_ = e.drafts_.length;
|
|
345
345
|
const i = e.drafts_[0];
|
|
346
346
|
if (t !== void 0 && t !== i) {
|
|
347
|
-
i[
|
|
348
|
-
const { patchPlugin_:
|
|
349
|
-
|
|
350
|
-
i[
|
|
347
|
+
i[g].modified_ && (st(e), m(4)), P(t) && (t = St(e, t));
|
|
348
|
+
const { patchPlugin_: n } = e;
|
|
349
|
+
n && n.generateReplacementPatches_(
|
|
350
|
+
i[g].base_,
|
|
351
351
|
t,
|
|
352
352
|
e
|
|
353
353
|
);
|
|
354
354
|
} else
|
|
355
|
-
t =
|
|
356
|
-
return
|
|
355
|
+
t = St(e, i);
|
|
356
|
+
return Ut(e, t, !0), st(e), e.patches_ && e.patchListener_(e.patches_, e.inversePatches_), t !== Vt ? t : void 0;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function St(t, e) {
|
|
359
359
|
if (X(e))
|
|
360
360
|
return e;
|
|
361
|
-
const i = e[
|
|
361
|
+
const i = e[g];
|
|
362
362
|
if (!i)
|
|
363
363
|
return $(e, t.handledSet_, t);
|
|
364
364
|
if (!J(i, t))
|
|
@@ -366,94 +366,94 @@ function Vt(t, e) {
|
|
|
366
366
|
if (!i.modified_)
|
|
367
367
|
return i.base_;
|
|
368
368
|
if (!i.finalized_) {
|
|
369
|
-
const { callbacks_:
|
|
370
|
-
if (
|
|
371
|
-
for (;
|
|
372
|
-
|
|
373
|
-
|
|
369
|
+
const { callbacks_: r } = i;
|
|
370
|
+
if (r)
|
|
371
|
+
for (; r.length > 0; )
|
|
372
|
+
r.pop()(t);
|
|
373
|
+
bt(i, t);
|
|
374
374
|
}
|
|
375
375
|
return i.copy_;
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ &&
|
|
377
|
+
function Ut(t, e, i = !1) {
|
|
378
|
+
!t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && ct(e, i);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Et(t) {
|
|
381
381
|
t.finalized_ = !0, t.scope_.unfinalizedDrafts_--;
|
|
382
382
|
}
|
|
383
383
|
var J = (t, e) => t.scope_ === e, qt = [];
|
|
384
|
-
function
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
|
|
384
|
+
function kt(t, e, i, r) {
|
|
385
|
+
const n = D(t), s = t.type_;
|
|
386
|
+
if (r !== void 0 && it(n, r, s) === e) {
|
|
387
|
+
B(n, r, i, s);
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
390
|
if (!t.draftLocations_) {
|
|
391
|
-
const
|
|
392
|
-
G(
|
|
393
|
-
if (w(
|
|
394
|
-
const _ =
|
|
395
|
-
_.push(d),
|
|
391
|
+
const l = t.draftLocations_ = /* @__PURE__ */ new Map();
|
|
392
|
+
G(n, (d, c) => {
|
|
393
|
+
if (w(c)) {
|
|
394
|
+
const _ = l.get(c) || [];
|
|
395
|
+
_.push(d), l.set(c, _);
|
|
396
396
|
}
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
const o = t.draftLocations_.get(e) ?? qt;
|
|
400
|
-
for (const
|
|
401
|
-
|
|
400
|
+
for (const l of o)
|
|
401
|
+
B(n, l, i, s);
|
|
402
402
|
}
|
|
403
403
|
function Bt(t, e, i) {
|
|
404
|
-
t.callbacks_.push(function(
|
|
404
|
+
t.callbacks_.push(function(n) {
|
|
405
405
|
const s = e;
|
|
406
|
-
if (!s || !J(s,
|
|
406
|
+
if (!s || !J(s, n))
|
|
407
407
|
return;
|
|
408
|
-
|
|
409
|
-
const o =
|
|
410
|
-
|
|
408
|
+
n.mapSetPlugin_?.fixSetContents(s);
|
|
409
|
+
const o = ft(s);
|
|
410
|
+
kt(t, s.draft_ ?? s, o, i), bt(s, n);
|
|
411
411
|
});
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function bt(t, e) {
|
|
414
414
|
if (t.modified_ && !t.finalized_ && (t.type_ === 3 || t.type_ === 1 && t.allIndicesReassigned_ || (t.assigned_?.size ?? 0) > 0)) {
|
|
415
|
-
const { patchPlugin_:
|
|
416
|
-
if (
|
|
417
|
-
const
|
|
418
|
-
|
|
415
|
+
const { patchPlugin_: r } = e;
|
|
416
|
+
if (r) {
|
|
417
|
+
const n = r.getPath(t);
|
|
418
|
+
n && r.generatePatches_(t, n, e);
|
|
419
419
|
}
|
|
420
|
-
|
|
420
|
+
Et(t);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
const { scope_:
|
|
423
|
+
function jt(t, e, i) {
|
|
424
|
+
const { scope_: r } = t;
|
|
425
425
|
if (w(i)) {
|
|
426
|
-
const
|
|
427
|
-
J(
|
|
428
|
-
|
|
429
|
-
const o =
|
|
430
|
-
|
|
426
|
+
const n = i[g];
|
|
427
|
+
J(n, r) && n.callbacks_.push(function() {
|
|
428
|
+
M(t);
|
|
429
|
+
const o = ft(n);
|
|
430
|
+
kt(t, i, o, e);
|
|
431
431
|
});
|
|
432
|
-
} else
|
|
433
|
-
const s =
|
|
434
|
-
t.type_ === 3 ? s.has(i) && $(i,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
432
|
+
} else P(i) && t.callbacks_.push(function() {
|
|
433
|
+
const s = D(t);
|
|
434
|
+
t.type_ === 3 ? s.has(i) && $(i, r.handledSet_, r) : it(s, e, t.type_) === i && r.drafts_.length > 1 && (t.assigned_.get(e) ?? !1) === !0 && t.copy_ && $(
|
|
435
|
+
it(t.copy_, e, t.type_),
|
|
436
|
+
r.handledSet_,
|
|
437
|
+
r
|
|
438
438
|
);
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
function $(t, e, i) {
|
|
442
|
-
return !i.immer_.autoFreeze_ && i.unfinalizedDrafts_ < 1 || w(t) || e.has(t) || !
|
|
443
|
-
if (w(
|
|
444
|
-
const s =
|
|
442
|
+
return !i.immer_.autoFreeze_ && i.unfinalizedDrafts_ < 1 || w(t) || e.has(t) || !P(t) || X(t) || (e.add(t), G(t, (r, n) => {
|
|
443
|
+
if (w(n)) {
|
|
444
|
+
const s = n[g];
|
|
445
445
|
if (J(s, i)) {
|
|
446
|
-
const o =
|
|
447
|
-
|
|
446
|
+
const o = ft(s);
|
|
447
|
+
B(t, r, o, t.type_), Et(s);
|
|
448
448
|
}
|
|
449
|
-
} else
|
|
449
|
+
} else P(n) && $(n, e, i);
|
|
450
450
|
})), t;
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
const i = K(t),
|
|
452
|
+
function $t(t, e) {
|
|
453
|
+
const i = K(t), r = {
|
|
454
454
|
type_: i ? 1 : 0,
|
|
455
455
|
// Track which produce call this is associated with.
|
|
456
|
-
scope_: e ? e.scope_ :
|
|
456
|
+
scope_: e ? e.scope_ : wt(),
|
|
457
457
|
// True for both shallow and deep changes.
|
|
458
458
|
modified_: !1,
|
|
459
459
|
// Used during finalization.
|
|
@@ -476,177 +476,177 @@ function Lt(t, e) {
|
|
|
476
476
|
// `callbacks` actually gets assigned in `createProxy`
|
|
477
477
|
callbacks_: void 0
|
|
478
478
|
};
|
|
479
|
-
let
|
|
480
|
-
i && (
|
|
481
|
-
const { revoke: o, proxy:
|
|
482
|
-
return
|
|
479
|
+
let n = r, s = L;
|
|
480
|
+
i && (n = [r], s = O);
|
|
481
|
+
const { revoke: o, proxy: l } = Proxy.revocable(n, s);
|
|
482
|
+
return r.draft_ = l, r.revoke_ = o, [l, r];
|
|
483
483
|
}
|
|
484
484
|
var L = {
|
|
485
485
|
get(t, e) {
|
|
486
|
-
if (e ===
|
|
486
|
+
if (e === g)
|
|
487
487
|
return t;
|
|
488
488
|
let i = t.scope_.arrayMethodsPlugin_;
|
|
489
|
-
const
|
|
490
|
-
if (
|
|
489
|
+
const r = t.type_ === 1 && typeof e == "string";
|
|
490
|
+
if (r && i?.isArrayOperationMethod(e))
|
|
491
491
|
return i.createMethodInterceptor(t, e);
|
|
492
|
-
const
|
|
493
|
-
if (!
|
|
494
|
-
return
|
|
495
|
-
const s =
|
|
496
|
-
if (t.finalized_ || !
|
|
492
|
+
const n = D(t);
|
|
493
|
+
if (!_t(n, e, t.type_))
|
|
494
|
+
return Lt(t, n, e);
|
|
495
|
+
const s = n[e];
|
|
496
|
+
if (t.finalized_ || !P(s) || r && t.operationMethod && i?.isMutatingArrayMethod(
|
|
497
497
|
t.operationMethod
|
|
498
|
-
) &&
|
|
498
|
+
) && Mt(e))
|
|
499
499
|
return s;
|
|
500
500
|
if (s === tt(t.base_, e)) {
|
|
501
|
-
|
|
502
|
-
const o = t.type_ === 1 ? +e : e,
|
|
503
|
-
return t.copy_[o] =
|
|
501
|
+
M(t);
|
|
502
|
+
const o = t.type_ === 1 ? +e : e, l = ut(t.scope_, s, t, o);
|
|
503
|
+
return t.copy_[o] = l;
|
|
504
504
|
}
|
|
505
505
|
return s;
|
|
506
506
|
},
|
|
507
507
|
has(t, e) {
|
|
508
|
-
return e in
|
|
508
|
+
return e in D(t);
|
|
509
509
|
},
|
|
510
510
|
ownKeys(t) {
|
|
511
|
-
return Reflect.ownKeys(
|
|
511
|
+
return Reflect.ownKeys(D(t));
|
|
512
512
|
},
|
|
513
513
|
set(t, e, i) {
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
516
|
-
return
|
|
514
|
+
const r = Ft(D(t), e);
|
|
515
|
+
if (r?.set)
|
|
516
|
+
return r.set.call(t.draft_, i), !0;
|
|
517
517
|
if (!t.modified_) {
|
|
518
|
-
const
|
|
518
|
+
const n = tt(D(t), e), s = n?.[g];
|
|
519
519
|
if (s && s.base_ === i)
|
|
520
520
|
return t.copy_[e] = i, t.assigned_.set(e, !1), !0;
|
|
521
|
-
if (
|
|
521
|
+
if (At(i, n) && (i !== void 0 || _t(t.base_, e, t.type_)))
|
|
522
522
|
return !0;
|
|
523
|
-
|
|
523
|
+
M(t), at(t);
|
|
524
524
|
}
|
|
525
525
|
return t.copy_[e] === i && // special case: handle new props with value 'undefined'
|
|
526
526
|
(i !== void 0 || e in t.copy_) || // special case: NaN
|
|
527
|
-
Number.isNaN(i) && Number.isNaN(t.copy_[e]) || (t.copy_[e] = i, t.assigned_.set(e, !0),
|
|
527
|
+
Number.isNaN(i) && Number.isNaN(t.copy_[e]) || (t.copy_[e] = i, t.assigned_.set(e, !0), jt(t, e, i)), !0;
|
|
528
528
|
},
|
|
529
529
|
deleteProperty(t, e) {
|
|
530
|
-
return
|
|
530
|
+
return M(t), tt(t.base_, e) !== void 0 || e in t.base_ ? (t.assigned_.set(e, !1), at(t)) : t.assigned_.delete(e), t.copy_ && delete t.copy_[e], !0;
|
|
531
531
|
},
|
|
532
532
|
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
533
533
|
// the same guarantee in ES5 mode.
|
|
534
534
|
getOwnPropertyDescriptor(t, e) {
|
|
535
|
-
const i =
|
|
536
|
-
return
|
|
537
|
-
[
|
|
538
|
-
[
|
|
539
|
-
[
|
|
540
|
-
[
|
|
535
|
+
const i = D(t), r = Reflect.getOwnPropertyDescriptor(i, e);
|
|
536
|
+
return r && {
|
|
537
|
+
[A]: !0,
|
|
538
|
+
[et]: t.type_ !== 1 || e !== "length",
|
|
539
|
+
[q]: r[q],
|
|
540
|
+
[z]: i[e]
|
|
541
541
|
};
|
|
542
542
|
},
|
|
543
543
|
defineProperty() {
|
|
544
|
-
|
|
544
|
+
m(11);
|
|
545
545
|
},
|
|
546
546
|
getPrototypeOf(t) {
|
|
547
547
|
return F(t.base_);
|
|
548
548
|
},
|
|
549
549
|
setPrototypeOf() {
|
|
550
|
-
|
|
550
|
+
m(12);
|
|
551
551
|
}
|
|
552
|
-
},
|
|
552
|
+
}, O = {};
|
|
553
553
|
for (let t in L) {
|
|
554
554
|
let e = L[t];
|
|
555
|
-
|
|
555
|
+
O[t] = function() {
|
|
556
556
|
const i = arguments;
|
|
557
557
|
return i[0] = i[0][0], e.apply(this, i);
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
|
-
|
|
561
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) &&
|
|
560
|
+
O.deleteProperty = function(t, e) {
|
|
561
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(e)) && m(13), O.set.call(this, t, e, void 0);
|
|
562
562
|
};
|
|
563
|
-
|
|
564
|
-
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) &&
|
|
563
|
+
O.set = function(t, e, i) {
|
|
564
|
+
return process.env.NODE_ENV !== "production" && e !== "length" && isNaN(parseInt(e)) && m(14), L.set.call(this, t[0], e, i, t[0]);
|
|
565
565
|
};
|
|
566
566
|
function tt(t, e) {
|
|
567
|
-
const i = t[
|
|
568
|
-
return (i ?
|
|
567
|
+
const i = t[g];
|
|
568
|
+
return (i ? D(i) : t)[e];
|
|
569
569
|
}
|
|
570
|
-
function
|
|
571
|
-
const
|
|
572
|
-
return
|
|
570
|
+
function Lt(t, e, i) {
|
|
571
|
+
const r = Ft(e, i);
|
|
572
|
+
return r ? z in r ? r[z] : (
|
|
573
573
|
// This is a very special case, if the prop is a getter defined by the
|
|
574
574
|
// prototype, we should invoke it with the draft as context!
|
|
575
|
-
|
|
575
|
+
r.get?.call(t.draft_)
|
|
576
576
|
) : void 0;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Ft(t, e) {
|
|
579
579
|
if (!(e in t))
|
|
580
580
|
return;
|
|
581
581
|
let i = F(t);
|
|
582
582
|
for (; i; ) {
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
return
|
|
583
|
+
const r = Object.getOwnPropertyDescriptor(i, e);
|
|
584
|
+
if (r)
|
|
585
|
+
return r;
|
|
586
586
|
i = F(i);
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
function
|
|
590
|
-
t.modified_ || (t.modified_ = !0, t.parent_ &&
|
|
589
|
+
function at(t) {
|
|
590
|
+
t.modified_ || (t.modified_ = !0, t.parent_ && at(t.parent_));
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function M(t) {
|
|
593
593
|
t.copy_ || (t.assigned_ = /* @__PURE__ */ new Map(), t.copy_ = rt(
|
|
594
594
|
t.base_,
|
|
595
595
|
t.scope_.immer_.useStrictShallowCopy_
|
|
596
596
|
));
|
|
597
597
|
}
|
|
598
|
-
var
|
|
598
|
+
var Wt = class {
|
|
599
599
|
constructor(t) {
|
|
600
|
-
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !1, this.produce = (e, i,
|
|
601
|
-
if (
|
|
600
|
+
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !1, this.produce = (e, i, r) => {
|
|
601
|
+
if (E(e) && !E(i)) {
|
|
602
602
|
const s = i;
|
|
603
603
|
i = e;
|
|
604
604
|
const o = this;
|
|
605
|
-
return function(d = s, ...
|
|
606
|
-
return o.produce(d, (_) => i.call(this, _, ...
|
|
605
|
+
return function(d = s, ...c) {
|
|
606
|
+
return o.produce(d, (_) => i.call(this, _, ...c));
|
|
607
607
|
};
|
|
608
608
|
}
|
|
609
|
-
|
|
610
|
-
let
|
|
611
|
-
if (
|
|
612
|
-
const s =
|
|
613
|
-
let
|
|
609
|
+
E(i) || m(6), r !== void 0 && !E(r) && m(7);
|
|
610
|
+
let n;
|
|
611
|
+
if (P(e)) {
|
|
612
|
+
const s = pt(this), o = ut(s, e, void 0);
|
|
613
|
+
let l = !0;
|
|
614
614
|
try {
|
|
615
|
-
|
|
615
|
+
n = i(o), l = !1;
|
|
616
616
|
} finally {
|
|
617
|
-
|
|
617
|
+
l ? st(s) : ot(s);
|
|
618
618
|
}
|
|
619
|
-
return
|
|
620
|
-
} else if (!e || !
|
|
621
|
-
if (
|
|
619
|
+
return mt(s, r), vt(n, s);
|
|
620
|
+
} else if (!e || !lt(e)) {
|
|
621
|
+
if (n = i(e), n === void 0 && (n = e), n === Vt && (n = void 0), this.autoFreeze_ && ct(n, !0), r) {
|
|
622
622
|
const s = [], o = [];
|
|
623
|
-
|
|
623
|
+
k(nt).generateReplacementPatches_(e, n, {
|
|
624
624
|
patches_: s,
|
|
625
625
|
inversePatches_: o
|
|
626
|
-
}),
|
|
626
|
+
}), r(s, o);
|
|
627
627
|
}
|
|
628
|
-
return
|
|
628
|
+
return n;
|
|
629
629
|
} else
|
|
630
|
-
|
|
630
|
+
m(1, e);
|
|
631
631
|
}, this.produceWithPatches = (e, i) => {
|
|
632
|
-
if (
|
|
633
|
-
return (o, ...
|
|
634
|
-
let
|
|
635
|
-
return [this.produce(e, i, (o,
|
|
636
|
-
|
|
637
|
-
}),
|
|
632
|
+
if (E(e))
|
|
633
|
+
return (o, ...l) => this.produceWithPatches(o, (d) => e(d, ...l));
|
|
634
|
+
let r, n;
|
|
635
|
+
return [this.produce(e, i, (o, l) => {
|
|
636
|
+
r = o, n = l;
|
|
637
|
+
}), r, n];
|
|
638
638
|
}, Z(t?.autoFreeze) && this.setAutoFreeze(t.autoFreeze), Z(t?.useStrictShallowCopy) && this.setUseStrictShallowCopy(t.useStrictShallowCopy), Z(t?.useStrictIteration) && this.setUseStrictIteration(t.useStrictIteration);
|
|
639
639
|
}
|
|
640
640
|
createDraft(t) {
|
|
641
|
-
|
|
642
|
-
const e =
|
|
643
|
-
return i[
|
|
641
|
+
P(t) || m(8), w(t) && (t = Gt(t));
|
|
642
|
+
const e = pt(this), i = ut(e, t, void 0);
|
|
643
|
+
return i[g].isManual_ = !0, ot(e), i;
|
|
644
644
|
}
|
|
645
645
|
finishDraft(t, e) {
|
|
646
|
-
const i = t && t[
|
|
647
|
-
(!i || !i.isManual_) &&
|
|
648
|
-
const { scope_:
|
|
649
|
-
return
|
|
646
|
+
const i = t && t[g];
|
|
647
|
+
(!i || !i.isManual_) && m(9);
|
|
648
|
+
const { scope_: r } = i;
|
|
649
|
+
return mt(r, e), vt(void 0, r);
|
|
650
650
|
}
|
|
651
651
|
/**
|
|
652
652
|
* Pass true to automatically freeze all copies created by Immer.
|
|
@@ -679,55 +679,55 @@ var Gt = class {
|
|
|
679
679
|
applyPatches(t, e) {
|
|
680
680
|
let i;
|
|
681
681
|
for (i = e.length - 1; i >= 0; i--) {
|
|
682
|
-
const
|
|
683
|
-
if (
|
|
684
|
-
t =
|
|
682
|
+
const n = e[i];
|
|
683
|
+
if (n.path.length === 0 && n.op === "replace") {
|
|
684
|
+
t = n.value;
|
|
685
685
|
break;
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
i > -1 && (e = e.slice(i + 1));
|
|
689
|
-
const
|
|
690
|
-
return w(t) ?
|
|
689
|
+
const r = k(nt).applyPatches_;
|
|
690
|
+
return w(t) ? r(t, e) : this.produce(
|
|
691
691
|
t,
|
|
692
|
-
(
|
|
692
|
+
(n) => r(n, e)
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
695
|
};
|
|
696
|
-
function ut(t, e, i,
|
|
697
|
-
const [
|
|
698
|
-
return (i?.scope_ ??
|
|
696
|
+
function ut(t, e, i, r) {
|
|
697
|
+
const [n, s] = H(e) ? k(j).proxyMap_(e, i) : Y(e) ? k(j).proxySet_(e, i) : $t(e, i);
|
|
698
|
+
return (i?.scope_ ?? wt()).drafts_.push(n), s.callbacks_ = i?.callbacks_ ?? [], s.key_ = r, i && r !== void 0 ? Bt(i, s, r) : s.callbacks_.push(function(d) {
|
|
699
699
|
d.mapSetPlugin_?.fixSetContents(s);
|
|
700
|
-
const { patchPlugin_:
|
|
701
|
-
s.modified_ &&
|
|
702
|
-
}),
|
|
700
|
+
const { patchPlugin_: c } = d;
|
|
701
|
+
s.modified_ && c && c.generatePatches_(s, [], d);
|
|
702
|
+
}), n;
|
|
703
703
|
}
|
|
704
|
-
function
|
|
705
|
-
return w(t) ||
|
|
704
|
+
function Gt(t) {
|
|
705
|
+
return w(t) || m(10, t), zt(t);
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
if (!
|
|
707
|
+
function zt(t) {
|
|
708
|
+
if (!P(t) || X(t))
|
|
709
709
|
return t;
|
|
710
|
-
const e = t[
|
|
711
|
-
let i,
|
|
710
|
+
const e = t[g];
|
|
711
|
+
let i, r = !0;
|
|
712
712
|
if (e) {
|
|
713
713
|
if (!e.modified_)
|
|
714
714
|
return e.base_;
|
|
715
|
-
e.finalized_ = !0, i = rt(t, e.scope_.immer_.useStrictShallowCopy_),
|
|
715
|
+
e.finalized_ = !0, i = rt(t, e.scope_.immer_.useStrictShallowCopy_), r = e.scope_.immer_.shouldUseStrictIteration();
|
|
716
716
|
} else
|
|
717
717
|
i = rt(t, !0);
|
|
718
718
|
return G(
|
|
719
719
|
i,
|
|
720
|
-
(
|
|
721
|
-
|
|
720
|
+
(n, s) => {
|
|
721
|
+
B(i, n, zt(s));
|
|
722
722
|
},
|
|
723
|
-
|
|
723
|
+
r
|
|
724
724
|
), e && (e.finalized_ = !1), i;
|
|
725
725
|
}
|
|
726
|
-
var
|
|
727
|
-
let
|
|
726
|
+
var Kt = new Wt(), b = Kt.produce;
|
|
727
|
+
let Ht = () => ({
|
|
728
728
|
emit(t, ...e) {
|
|
729
|
-
for (let i = this.events[t] || [],
|
|
730
|
-
i[
|
|
729
|
+
for (let i = this.events[t] || [], r = 0, n = i.length; r < n; r++)
|
|
730
|
+
i[r](...e);
|
|
731
731
|
},
|
|
732
732
|
events: {},
|
|
733
733
|
on(t, e) {
|
|
@@ -736,32 +736,33 @@ let Yt = () => ({
|
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
738
|
});
|
|
739
|
-
function
|
|
739
|
+
function Ct(t) {
|
|
740
|
+
return typeof t == "function" ? t() : t;
|
|
741
|
+
}
|
|
742
|
+
function N(t) {
|
|
740
743
|
if (typeof t != "object" || t === null) return;
|
|
741
744
|
const e = Object.getPrototypeOf(t);
|
|
742
745
|
if (e === Object.prototype || e === null) return;
|
|
743
746
|
const i = e.constructor;
|
|
744
747
|
typeof i == "function" && (t instanceof Date || t instanceof RegExp || t instanceof Map || t instanceof Set || t instanceof WeakMap || t instanceof WeakSet || ArrayBuffer.isView(t) || i[x] !== !0 && (i[x] = !0));
|
|
745
748
|
}
|
|
746
|
-
let
|
|
747
|
-
function
|
|
748
|
-
return
|
|
749
|
+
let Yt = 0;
|
|
750
|
+
function Xt() {
|
|
751
|
+
return Yt++;
|
|
749
752
|
}
|
|
750
|
-
class
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
get canonicalPath() {
|
|
755
|
-
return h.toCanonicalPath(this.path);
|
|
753
|
+
class Jt {
|
|
754
|
+
/** @internal register via `FormController::registerField` instead */
|
|
755
|
+
constructor(e, i, r, n) {
|
|
756
|
+
this.controller = e, this.path = i, this.defaultValue = r, this.id = Xt(), this._isTouched = !1, this._isDirty = !1, n?.isTouched && this._setTouched(!0), n?.isDirty && this._setDirty(!0);
|
|
756
757
|
}
|
|
757
758
|
get stringPath() {
|
|
758
759
|
return h.toStringPath(this.path);
|
|
759
760
|
}
|
|
760
761
|
get value() {
|
|
761
|
-
return h.getValue(this.controller.
|
|
762
|
+
return h.getValue(this.controller.data, this.path);
|
|
762
763
|
}
|
|
763
764
|
get initialValue() {
|
|
764
|
-
return h.getValue(this.controller.
|
|
765
|
+
return h.getValue(this.controller.initialData, this.path);
|
|
765
766
|
}
|
|
766
767
|
get boundElement() {
|
|
767
768
|
return this.target;
|
|
@@ -780,12 +781,18 @@ class Qt {
|
|
|
780
781
|
get isValid() {
|
|
781
782
|
return this.issues.length === 0;
|
|
782
783
|
}
|
|
784
|
+
ensureDefault(e) {
|
|
785
|
+
if (this.value == null && this.defaultValue != null) {
|
|
786
|
+
const i = Ct(this.defaultValue);
|
|
787
|
+
i != null && this.setValue(i, e);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
783
790
|
_setTouched(e) {
|
|
784
791
|
const i = this._isTouched !== e;
|
|
785
792
|
if (this._isTouched = e, i) {
|
|
786
|
-
const
|
|
787
|
-
for (let
|
|
788
|
-
const s = n
|
|
793
|
+
const r = this.controller.getAscendantFields(this.path);
|
|
794
|
+
for (let n = r.length - 1; n >= 0; n--) {
|
|
795
|
+
const s = r[n];
|
|
789
796
|
s != null && this.controller.events.emit("fieldTouchUpdated", s.path);
|
|
790
797
|
}
|
|
791
798
|
}
|
|
@@ -793,87 +800,112 @@ class Qt {
|
|
|
793
800
|
_setDirty(e) {
|
|
794
801
|
const i = this._isDirty !== e;
|
|
795
802
|
if (this._isDirty = e, i) {
|
|
796
|
-
const
|
|
797
|
-
for (let
|
|
798
|
-
const s = n
|
|
803
|
+
const r = this.controller.getAscendantFields(this.path);
|
|
804
|
+
for (let n = r.length - 1; n >= 0; n--) {
|
|
805
|
+
const s = r[n];
|
|
799
806
|
s != null && this.controller.events.emit("fieldDirtyUpdated", s.path);
|
|
800
807
|
}
|
|
801
808
|
}
|
|
802
809
|
}
|
|
803
810
|
bindElement(e) {
|
|
804
|
-
this.target = e,
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
o.
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
811
|
+
e != null ? (this.target = e, this.controller.events.emit("elementBound", this.path, e)) : this.unbindElement();
|
|
812
|
+
}
|
|
813
|
+
unbindElement() {
|
|
814
|
+
this.target != null && (this.target = void 0, this.controller.events.emit("elementUnbound", this.path));
|
|
815
|
+
}
|
|
816
|
+
clearIssues() {
|
|
817
|
+
return this.controller.clearFieldIssues(this.path);
|
|
818
|
+
}
|
|
819
|
+
modifyData(e, i) {
|
|
820
|
+
(i?.shouldTouch == null || i?.shouldTouch === !0) && this.touch();
|
|
821
|
+
const r = this.controller.getAscendantFields(this.path), n = r.map((c) => c?.initialValue);
|
|
822
|
+
n.forEach((c) => N(c));
|
|
823
|
+
const s = r.map((c) => c?.value);
|
|
824
|
+
s.forEach((c) => N(c)), this.controller._data = b(this.controller._data, e);
|
|
825
|
+
const o = r.map((c) => c?.value);
|
|
826
|
+
o.forEach((c) => N(c));
|
|
827
|
+
const l = (c, _) => {
|
|
828
|
+
if (typeof c != "object" || typeof _ != "object") return;
|
|
829
|
+
const f = c.constructor, a = _.constructor;
|
|
830
|
+
if (f === a)
|
|
831
|
+
return this.controller.equalityComparators?.get(f)?.(c, _);
|
|
824
832
|
};
|
|
825
|
-
if (!
|
|
833
|
+
if (!v.deepEqual(
|
|
826
834
|
s[s.length - 1],
|
|
827
835
|
o[o.length - 1],
|
|
828
|
-
|
|
836
|
+
l
|
|
829
837
|
))
|
|
830
|
-
for (let
|
|
831
|
-
const _ =
|
|
838
|
+
for (let c = r.length - 1; c >= 0; c--) {
|
|
839
|
+
const _ = r[c];
|
|
832
840
|
this.controller.events.emit(
|
|
833
|
-
"
|
|
841
|
+
"fieldValueChanged",
|
|
834
842
|
_.path,
|
|
835
|
-
o[
|
|
836
|
-
s[
|
|
843
|
+
o[c],
|
|
844
|
+
s[c]
|
|
837
845
|
);
|
|
838
846
|
}
|
|
839
847
|
if (i?.shouldMarkDirty == null || i?.shouldMarkDirty) {
|
|
840
|
-
const
|
|
841
|
-
|
|
848
|
+
const c = !v.deepEqual(
|
|
849
|
+
n[n.length - 1],
|
|
842
850
|
o[o.length - 1],
|
|
843
|
-
|
|
851
|
+
l
|
|
844
852
|
);
|
|
845
|
-
this._setDirty(
|
|
853
|
+
this._setDirty(c);
|
|
846
854
|
}
|
|
847
855
|
}
|
|
856
|
+
setValue(e, i) {
|
|
857
|
+
return this.modifyData((r) => {
|
|
858
|
+
h.setValue(r, this.path, e);
|
|
859
|
+
}, i);
|
|
860
|
+
}
|
|
861
|
+
modifyValue(e, i) {
|
|
862
|
+
return this.modifyData((r) => {
|
|
863
|
+
h.modifyValue(r, this.path, (n) => {
|
|
864
|
+
e(n);
|
|
865
|
+
});
|
|
866
|
+
}, i);
|
|
867
|
+
}
|
|
848
868
|
reset() {
|
|
849
|
-
this._setTouched(!1), this._setDirty(!1);
|
|
869
|
+
this._setTouched(!1), this._setDirty(!1), this.controller.events.emit("fieldReset", this.path);
|
|
850
870
|
}
|
|
851
871
|
touch() {
|
|
852
872
|
this._setTouched(!0);
|
|
853
873
|
}
|
|
854
874
|
markDirty() {
|
|
855
|
-
this.
|
|
875
|
+
this._setDirty(!0);
|
|
856
876
|
}
|
|
857
|
-
|
|
877
|
+
validate() {
|
|
858
878
|
this.controller.validateField(this.path);
|
|
859
879
|
}
|
|
860
880
|
focus(e) {
|
|
861
881
|
(e?.shouldTouch == null || e.shouldTouch) && this.target?.addEventListener("focus", () => this.touch(), {
|
|
862
882
|
once: !0
|
|
863
|
-
}), this.target?.scrollIntoView(), this.target?.focus();
|
|
883
|
+
}), this.target?.scrollIntoView(e?.scrollOptions), this.target?.focus();
|
|
864
884
|
}
|
|
865
885
|
}
|
|
866
|
-
function
|
|
886
|
+
function Qt(t, e) {
|
|
867
887
|
let i = [];
|
|
868
|
-
for (let
|
|
869
|
-
e(t[
|
|
870
|
-
i.forEach((
|
|
888
|
+
for (let r = t.length - 1; r >= 0; r--)
|
|
889
|
+
e(t[r]) && i.push(r);
|
|
890
|
+
i.forEach((r) => t.splice(r, 1));
|
|
871
891
|
}
|
|
872
|
-
class
|
|
892
|
+
class Zt {
|
|
873
893
|
constructor(e) {
|
|
874
|
-
this._isValidating = !1, this._isSubmitting = !1, this._fields = /* @__PURE__ */ new Map(), this._issues = [], this.events =
|
|
894
|
+
this._isValidating = !1, this._isSubmitting = !1, this._triedSubmitting = !1, this.pathBuilder = new R(), this._fields = /* @__PURE__ */ new Map(), this._issues = [], this.events = Ht(), this.validationSchema = e.validationSchema, this.equalityComparators = e.equalityComparators, this._initialData = e.initialData ?? {}, this._data = b(this._initialData, () => {
|
|
875
895
|
});
|
|
876
896
|
}
|
|
897
|
+
get data() {
|
|
898
|
+
return this._data;
|
|
899
|
+
}
|
|
900
|
+
get initialData() {
|
|
901
|
+
return this._initialData;
|
|
902
|
+
}
|
|
903
|
+
get issues() {
|
|
904
|
+
return this._issues;
|
|
905
|
+
}
|
|
906
|
+
get path() {
|
|
907
|
+
return this.pathBuilder;
|
|
908
|
+
}
|
|
877
909
|
get isDirty() {
|
|
878
910
|
for (const e of this._fields.values())
|
|
879
911
|
if (e.isDirty) return !0;
|
|
@@ -888,72 +920,78 @@ class te {
|
|
|
888
920
|
get isSubmitting() {
|
|
889
921
|
return this._isSubmitting;
|
|
890
922
|
}
|
|
923
|
+
get triedSubmitting() {
|
|
924
|
+
return this._triedSubmitting;
|
|
925
|
+
}
|
|
891
926
|
setValidating(e) {
|
|
892
927
|
this._isValidating !== e && (this._isValidating = e, this.events.emit("validationStatusChange", e));
|
|
893
928
|
}
|
|
894
929
|
setSubmitting(e) {
|
|
895
930
|
this._isSubmitting !== e && (this._isSubmitting = e, this.events.emit("submissionStatusChange", e));
|
|
896
931
|
}
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
n
|
|
908
|
-
updateInitialValue: i.overrideInitialValue
|
|
909
|
-
}), n = h.getValue(this._data, e));
|
|
910
|
-
const r = h.getValue(this._initialData, e), s = !V.deepEqual(n, r), o = new Qt(this, e, {
|
|
932
|
+
registerField(e, i) {
|
|
933
|
+
let r = h.getValue(this._data, e);
|
|
934
|
+
if (r == null && i?.defaultValue != null) {
|
|
935
|
+
const l = Ct(i.defaultValue);
|
|
936
|
+
N(l), i?.overrideInitialValue === !0 && (this._initialData = b(this._initialData, (d) => {
|
|
937
|
+
h.setValue(d, e, l);
|
|
938
|
+
})), this._data = b(this._data, (d) => {
|
|
939
|
+
h.setValue(d, e, l);
|
|
940
|
+
}), r = h.getValue(this._data, e);
|
|
941
|
+
}
|
|
942
|
+
const n = h.getValue(this._initialData, e), s = !v.deepEqual(r, n), o = new Jt(this, e, i?.defaultValue, {
|
|
911
943
|
isDirty: s
|
|
912
944
|
});
|
|
913
|
-
return
|
|
945
|
+
return this._fields.set(o.stringPath, o), this.events.emit("fieldRegistered", o.path), s && this.events.emit(
|
|
946
|
+
"fieldValueChanged",
|
|
947
|
+
o.path,
|
|
948
|
+
r,
|
|
949
|
+
n
|
|
950
|
+
), o;
|
|
914
951
|
}
|
|
915
|
-
|
|
952
|
+
unregisterField(e) {
|
|
916
953
|
const i = h.toStringPath(e);
|
|
917
|
-
this._fields.delete(i), this.events.emit("
|
|
954
|
+
return this._fields.has(i) ? (this._fields.delete(i), this.events.emit("fieldUnregistered", e), !0) : !1;
|
|
918
955
|
}
|
|
919
|
-
// TODO: Add an option to keep dirty/touched fields as they are
|
|
920
956
|
reset(e) {
|
|
921
|
-
|
|
922
|
-
for (const
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
}
|
|
957
|
+
const i = e ?? this._initialData, r = [];
|
|
958
|
+
for (const n of this._fields.values()) {
|
|
959
|
+
const s = h.getValue(this._data, n.path), o = h.getValue(i, n.path);
|
|
960
|
+
v.deepEqual(s, o) || r.push([n.path, o, s]), n.reset();
|
|
961
|
+
}
|
|
962
|
+
e != null && (this._initialData = b(e, () => {
|
|
963
|
+
})), this._data = b(i, () => {
|
|
964
|
+
}), this._issues = [], this._triedSubmitting = !1, r.forEach(([n, s, o]) => {
|
|
965
|
+
this.events.emit("fieldValueChanged", n, s, o);
|
|
966
|
+
});
|
|
926
967
|
}
|
|
968
|
+
// TODO: resetGracefully(newInitialData?: DeepPartial<TOutput>)
|
|
969
|
+
// TODO: ^ Keeps dirty/touched fields as they are
|
|
927
970
|
getAscendantFields(e) {
|
|
928
|
-
return e.map((
|
|
971
|
+
return e.map((r, n) => e.slice(0, n + 1)).map((r) => this.getField(r)).filter((r) => !!r);
|
|
929
972
|
}
|
|
930
973
|
getField(e) {
|
|
931
974
|
const i = h.toStringPath(e);
|
|
932
975
|
return this._fields.get(i);
|
|
933
976
|
}
|
|
977
|
+
getFields() {
|
|
978
|
+
return this._fields.values();
|
|
979
|
+
}
|
|
934
980
|
clearFieldIssues(e) {
|
|
935
981
|
this._issues = this._issues.filter((i) => !h.equals(h.normalize(i.path), e));
|
|
936
982
|
}
|
|
937
983
|
async applyValidation(e, i) {
|
|
938
|
-
const
|
|
984
|
+
const r = v.arrayDiff(
|
|
939
985
|
this._issues,
|
|
940
986
|
e.issues ?? [],
|
|
941
|
-
|
|
942
|
-
(
|
|
943
|
-
if (
|
|
944
|
-
const s = h.normalize(
|
|
987
|
+
v.deepEqual,
|
|
988
|
+
(n) => {
|
|
989
|
+
if (n.path == null) return !1;
|
|
990
|
+
const s = h.normalize(n.path);
|
|
945
991
|
return h.equals(s, i) || h.isDescendant(i, s);
|
|
946
992
|
}
|
|
947
993
|
);
|
|
948
|
-
|
|
949
|
-
}
|
|
950
|
-
async validateField(e) {
|
|
951
|
-
if (this._isValidating || this.validationSchema == null) return;
|
|
952
|
-
this.setValidating(!0), this.getField(e) == null && this.bindField(e);
|
|
953
|
-
const i = await this.validationSchema["~standard"].validate(
|
|
954
|
-
this._data
|
|
955
|
-
);
|
|
956
|
-
this.events.emit("validationTriggered", e), this.applyValidation(i, e), this.setValidating(!1);
|
|
994
|
+
Qt(this._issues, (n) => r.removed.includes(n)), r.added.forEach((n) => this._issues.push(n)), (r.added.length !== 0 || r.removed.length !== 0) && this.events.emit("fieldIssuesUpdated", i);
|
|
957
995
|
}
|
|
958
996
|
async validateForm() {
|
|
959
997
|
if (this._isValidating || this.validationSchema == null) return;
|
|
@@ -961,37 +999,45 @@ class te {
|
|
|
961
999
|
const e = await this.validationSchema["~standard"].validate(
|
|
962
1000
|
this._data
|
|
963
1001
|
);
|
|
964
|
-
for (const
|
|
965
|
-
const
|
|
966
|
-
this.events.emit("
|
|
1002
|
+
for (const r of this._fields.keys()) {
|
|
1003
|
+
const n = h.fromStringPath(r);
|
|
1004
|
+
this.events.emit("fieldValidationTriggered", n), this.applyValidation(e, n);
|
|
967
1005
|
}
|
|
968
|
-
|
|
1006
|
+
v.arrayDiff(
|
|
969
1007
|
this._issues,
|
|
970
1008
|
e.issues ?? [],
|
|
971
|
-
|
|
972
|
-
).added.forEach((
|
|
1009
|
+
v.deepEqual
|
|
1010
|
+
).added.forEach((r) => this._issues.push(r)), this.setValidating(!1);
|
|
1011
|
+
}
|
|
1012
|
+
async validateField(e) {
|
|
1013
|
+
if (this._isValidating || this.validationSchema == null) return;
|
|
1014
|
+
this.setValidating(!0), this.getField(e) == null && this.registerField(e);
|
|
1015
|
+
const i = await this.validationSchema["~standard"].validate(
|
|
1016
|
+
this._data
|
|
1017
|
+
);
|
|
1018
|
+
this.events.emit("fieldValidationTriggered", e), this.applyValidation(i, e), this.setValidating(!1);
|
|
973
1019
|
}
|
|
974
1020
|
createSubmitHandler(e, i) {
|
|
975
|
-
return async (
|
|
976
|
-
if (
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1021
|
+
return async (r) => {
|
|
1022
|
+
if (r?.preventDefault(), !this._isValidating && !this._isSubmitting) {
|
|
1023
|
+
if (this._triedSubmitting = !0, await this.validateForm(), this._issues.length === 0) {
|
|
1024
|
+
this.setSubmitting(!0), await e?.(this._data, r), this.setSubmitting(!1);
|
|
1025
|
+
return;
|
|
1026
|
+
}
|
|
1027
|
+
for (const n of this._issues) {
|
|
1028
|
+
if (n.path == null) continue;
|
|
1029
|
+
const s = h.normalize(n.path), o = this.getField(s);
|
|
1030
|
+
if (o != null && o.boundElement != null) {
|
|
1031
|
+
o.focus();
|
|
1032
|
+
break;
|
|
1033
|
+
}
|
|
988
1034
|
}
|
|
1035
|
+
await i?.(this._issues, r), this.setSubmitting(!1);
|
|
989
1036
|
}
|
|
990
|
-
await i?.(this._issues, n, r.signal), this.setSubmitting(!1);
|
|
991
1037
|
};
|
|
992
1038
|
}
|
|
993
1039
|
}
|
|
994
|
-
function
|
|
1040
|
+
function te(t) {
|
|
995
1041
|
return {
|
|
996
1042
|
"~standard": {
|
|
997
1043
|
version: 1,
|
|
@@ -1000,9 +1046,9 @@ function ee(t) {
|
|
|
1000
1046
|
try {
|
|
1001
1047
|
const i = await t(e);
|
|
1002
1048
|
return i == null ? { value: e } : {
|
|
1003
|
-
issues: i.map((
|
|
1004
|
-
path: h.fromStringPath(
|
|
1005
|
-
message:
|
|
1049
|
+
issues: i.map((r) => ({
|
|
1050
|
+
path: h.fromStringPath(r.path),
|
|
1051
|
+
message: r.message
|
|
1006
1052
|
}))
|
|
1007
1053
|
};
|
|
1008
1054
|
} catch (i) {
|
|
@@ -1020,10 +1066,11 @@ function ee(t) {
|
|
|
1020
1066
|
}
|
|
1021
1067
|
export {
|
|
1022
1068
|
h as FieldPath,
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1069
|
+
R as FieldPathBuilder,
|
|
1070
|
+
Zt as FormController,
|
|
1071
|
+
Jt as FormField,
|
|
1072
|
+
v as Reconcile,
|
|
1073
|
+
te as customValidation,
|
|
1074
|
+
Ct as supply
|
|
1028
1075
|
};
|
|
1029
1076
|
//# sourceMappingURL=index.js.map
|