@golemui/core 1.3.0 → 1.4.0-rc.0
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/CHANGELOG.md +4 -0
- package/index.d.ts +3 -1
- package/index.js +1249 -1128
- package/index.umd.cjs +8 -8
- package/lib/context/form.context.d.ts +0 -1
- package/lib/errors.d.ts +2 -0
- package/lib/shared.d.ts +5 -0
- package/lib/store/actions.d.ts +1 -25
- package/lib/store/model.d.ts +21 -21
- package/lib/store/reducers/apply-default-values.d.ts +14 -0
- package/lib/store/reducers/calculate-current-state.d.ts +7 -1
- package/lib/store/reducers/calculate-widget-flags.d.ts +7 -1
- package/lib/store/reducers/calculate-widget-props.d.ts +7 -1
- package/lib/store/reducers/drop-removed-widget-entries.d.ts +13 -0
- package/lib/store/reducers/fill-calculated-widgets.d.ts +12 -0
- package/lib/store/reducers/index.d.ts +3 -3
- package/lib/store/reducers/override-widget-prop.d.ts +6 -0
- package/lib/store/reducers/set-widget-data.d.ts +2 -2
- package/lib/store/reducers/utils.d.ts +5 -27
- package/lib/store/selectors.d.ts +0 -22
- package/lib/store/view-model.d.ts +92 -0
- package/lib/utils/form.d.ts +19 -6
- package/lib/utils/justin.d.ts +10 -0
- package/lib/utils/object.d.ts +37 -18
- package/lib/utils/repeater.d.ts +43 -2
- package/package.json +1 -1
- package/lib/store/reducers/add-widget.d.ts +0 -3
- package/lib/store/reducers/materialize-repeater-items.d.ts +0 -10
- package/lib/store/reducers/remove-widget.d.ts +0 -3
- package/lib/utils/function.d.ts +0 -71
package/index.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { BehaviorSubject as
|
|
1
|
+
import { BehaviorSubject as hr, distinctUntilChanged as _e, Subject as it, pipe as mr, map as Ct } from "rxjs";
|
|
2
2
|
import "@standard-schema/spec";
|
|
3
|
-
function
|
|
3
|
+
function gr(e, t) {
|
|
4
4
|
const r = e["~standard"].validate(t);
|
|
5
5
|
if (r instanceof Promise)
|
|
6
6
|
throw new TypeError("Schema validation must be synchronous");
|
|
7
7
|
return r;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function yr(e) {
|
|
10
10
|
return e.issues === void 0;
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var vr = class {
|
|
13
13
|
value;
|
|
14
14
|
constructor(e) {
|
|
15
15
|
this.value = e;
|
|
16
16
|
}
|
|
17
17
|
map(e) {
|
|
18
|
-
return
|
|
18
|
+
return k(e(this.value));
|
|
19
19
|
}
|
|
20
20
|
isOk() {
|
|
21
21
|
return !0;
|
|
22
22
|
}
|
|
23
|
-
},
|
|
23
|
+
}, $r = class It {
|
|
24
24
|
issues;
|
|
25
25
|
constructor(t) {
|
|
26
26
|
this.issues = t;
|
|
27
27
|
}
|
|
28
28
|
map(t) {
|
|
29
|
-
return new
|
|
29
|
+
return new It(this.issues);
|
|
30
30
|
}
|
|
31
31
|
isOk() {
|
|
32
32
|
return !1;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
function
|
|
36
|
-
return new
|
|
35
|
+
function k(e) {
|
|
36
|
+
return new vr(e);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return new
|
|
38
|
+
function E(e) {
|
|
39
|
+
return new $r(e);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function kt(e) {
|
|
42
42
|
return e.reduce((t, r) => typeof r == "number" ? `${t}[${r}]` : t.length === 0 ? String(r) : `${t}.${r}`, "");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return e.map((t) => t.path.length === 0 ? t.message : `${
|
|
44
|
+
function ut(e) {
|
|
45
|
+
return e.map((t) => t.path.length === 0 ? t.message : `${kt(t.path)}: ${t.message}`).join("; ");
|
|
46
46
|
}
|
|
47
|
-
var
|
|
47
|
+
var C = class je {
|
|
48
48
|
decodeFn;
|
|
49
49
|
constructor(t) {
|
|
50
50
|
this.decodeFn = t;
|
|
@@ -54,7 +54,7 @@ var O = class Te {
|
|
|
54
54
|
if (r.isOk()) return r.value;
|
|
55
55
|
{
|
|
56
56
|
let n = r;
|
|
57
|
-
throw Error(
|
|
57
|
+
throw Error(ut(n.issues), { cause: n.issues });
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
decode(t) {
|
|
@@ -77,93 +77,93 @@ var O = class Te {
|
|
|
77
77
|
if (o.isOk()) return r(o.value);
|
|
78
78
|
{
|
|
79
79
|
let s = o;
|
|
80
|
-
return n(Error(
|
|
80
|
+
return n(Error(ut(s.issues), { cause: s.issues }));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
map(t) {
|
|
85
|
-
return new
|
|
85
|
+
return new je((r) => {
|
|
86
86
|
let n = this.decodeFn(r);
|
|
87
|
-
return n.isOk() ?
|
|
87
|
+
return n.isOk() ? k(t(n.value)) : E(n.issues);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
flatMap(t) {
|
|
91
|
-
return new
|
|
91
|
+
return new je((r) => {
|
|
92
92
|
let n = this.decodeFn(r);
|
|
93
|
-
return n.isOk() ? t(n.value).decode(r) :
|
|
93
|
+
return n.isOk() ? t(n.value).decode(r) : E(n.issues);
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
},
|
|
96
|
+
}, b = (e, t) => [{
|
|
97
97
|
message: `${JSON.stringify(e)} is not a valid ${t}`,
|
|
98
98
|
path: []
|
|
99
|
-
}],
|
|
99
|
+
}], Le = (e, t) => e.map((r) => ({
|
|
100
100
|
...r,
|
|
101
101
|
path: [t, ...r.path]
|
|
102
102
|
}));
|
|
103
103
|
function Me(e) {
|
|
104
|
-
return new
|
|
104
|
+
return new C((t) => {
|
|
105
105
|
if (t instanceof Array) {
|
|
106
106
|
let r = [], n = [];
|
|
107
107
|
for (let o = 0; o < t.length; o++) {
|
|
108
108
|
let s = e.decode(t[o]);
|
|
109
|
-
s.isOk() ? r.push(s.value) : n.push(...
|
|
109
|
+
s.isOk() ? r.push(s.value) : n.push(...Le(s.issues, o));
|
|
110
110
|
}
|
|
111
|
-
return n.length > 0 ?
|
|
112
|
-
} else return
|
|
111
|
+
return n.length > 0 ? E(n) : k(r);
|
|
112
|
+
} else return E(b(t, "array"));
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return new
|
|
115
|
+
function Sr() {
|
|
116
|
+
return new C((e) => typeof e == "boolean" ? k(e) : E(b(e, "boolean")));
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
return new
|
|
120
|
-
if (typeof r != "object" || !r) return
|
|
118
|
+
function Ar(e, t) {
|
|
119
|
+
return new C((r) => {
|
|
120
|
+
if (typeof r != "object" || !r) return E(b(r, "object"));
|
|
121
121
|
let n = r[e];
|
|
122
|
-
return Object.prototype.hasOwnProperty.call(t, n) ? t[n].decode(r) :
|
|
122
|
+
return Object.prototype.hasOwnProperty.call(t, n) ? t[n].decode(r) : E([{
|
|
123
123
|
message: `"${e}" must be one of ${Object.keys(t).map((o) => JSON.stringify(o)).join(", ")}, but got ${JSON.stringify(n)}`,
|
|
124
124
|
path: [e]
|
|
125
125
|
}]);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
return new
|
|
128
|
+
function jt(e) {
|
|
129
|
+
return new C((t) => e().decode(t));
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
return new
|
|
131
|
+
function G(e) {
|
|
132
|
+
return new C((t) => t === e ? k(e) : E([{
|
|
133
133
|
message: `${JSON.stringify(t)} is not exactly ${JSON.stringify(e)}`,
|
|
134
134
|
path: []
|
|
135
135
|
}]));
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return new
|
|
137
|
+
function ge() {
|
|
138
|
+
return new C((e) => typeof e == "number" ? k(e) : E(b(e, "number")));
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return new
|
|
140
|
+
function Y(e) {
|
|
141
|
+
return new C((t) => {
|
|
142
142
|
if (typeof t == "object" && t) {
|
|
143
143
|
let r = {}, n = [];
|
|
144
144
|
for (let o in e) if (Object.prototype.hasOwnProperty.call(e, o)) {
|
|
145
145
|
let s, i = e[o];
|
|
146
|
-
s = i instanceof
|
|
146
|
+
s = i instanceof C ? i.decode(t[o]) : i.decoder.decode(t[i.fromKey]), s.isOk() ? r[o] = s.value : n.push(...Le(s.issues, o));
|
|
147
147
|
}
|
|
148
|
-
return n.length > 0 ?
|
|
149
|
-
} else return
|
|
148
|
+
return n.length > 0 ? E(n) : k(r);
|
|
149
|
+
} else return E(b(t, "object"));
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return new
|
|
152
|
+
function K(e) {
|
|
153
|
+
return new C((t) => {
|
|
154
154
|
let r = [];
|
|
155
155
|
for (let n = 0; n < e.length; n++) {
|
|
156
156
|
let o = e[n].decode(t);
|
|
157
157
|
if (o.isOk()) return o;
|
|
158
158
|
r.push(o.issues);
|
|
159
159
|
}
|
|
160
|
-
return
|
|
160
|
+
return E([{
|
|
161
161
|
message: `no alternative matched (tried ${e.length})`,
|
|
162
162
|
path: []
|
|
163
|
-
}, ...
|
|
163
|
+
}, ...Er(r)]);
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Er(e) {
|
|
167
167
|
let t = /* @__PURE__ */ new Map();
|
|
168
168
|
for (let r of e) for (let n of r) {
|
|
169
169
|
let o = JSON.stringify(n.path), s = t.get(o);
|
|
@@ -178,35 +178,35 @@ function pr(e) {
|
|
|
178
178
|
}));
|
|
179
179
|
}
|
|
180
180
|
function y(e) {
|
|
181
|
-
return new
|
|
181
|
+
return new C((t) => t === void 0 ? k(void 0) : e.decode(t));
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
return new
|
|
183
|
+
function wr(e) {
|
|
184
|
+
return new C((t) => {
|
|
185
185
|
if (typeof t == "object" && t) {
|
|
186
186
|
let r = {}, n = [];
|
|
187
187
|
for (let o in t) if (Object.prototype.hasOwnProperty.call(t, o)) {
|
|
188
188
|
let s = e.decode(t[o]);
|
|
189
|
-
s.isOk() ? r[o] = s.value : n.push(...
|
|
189
|
+
s.isOk() ? r[o] = s.value : n.push(...Le(s.issues, o));
|
|
190
190
|
}
|
|
191
|
-
return n.length > 0 ?
|
|
192
|
-
} else return
|
|
191
|
+
return n.length > 0 ? E(n) : k(r);
|
|
192
|
+
} else return E(b(t, "object"));
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
function
|
|
196
|
-
return new
|
|
195
|
+
function w() {
|
|
196
|
+
return new C((e) => typeof e == "string" ? k(e) : E(b(e, "string")));
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return new
|
|
198
|
+
function U() {
|
|
199
|
+
return new C((e) => k(e));
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
return new
|
|
201
|
+
function ee(e) {
|
|
202
|
+
return new C((t) => {
|
|
203
203
|
if (typeof t != "object" || t === null)
|
|
204
|
-
return
|
|
204
|
+
return E([{ message: `Expected object literal, got "${typeof t}"`, path: [] }]);
|
|
205
205
|
const r = {};
|
|
206
206
|
for (const [n, o] of Object.entries(e)) {
|
|
207
207
|
const s = o.decoder.decode(t[n]);
|
|
208
208
|
if (!s.isOk())
|
|
209
|
-
return
|
|
209
|
+
return E(
|
|
210
210
|
s.issues.map((i) => ({
|
|
211
211
|
message: i.message,
|
|
212
212
|
path: [n, ...i.path]
|
|
@@ -215,60 +215,60 @@ function ue(e) {
|
|
|
215
215
|
if (r[n] = s.value, o.suffixed) {
|
|
216
216
|
for (const [i, u] of Object.entries(t))
|
|
217
217
|
if (i.startsWith(n + ".")) {
|
|
218
|
-
const
|
|
219
|
-
if (!
|
|
220
|
-
return
|
|
221
|
-
|
|
218
|
+
const d = o.decoder.decode(u);
|
|
219
|
+
if (!d.isOk())
|
|
220
|
+
return E(
|
|
221
|
+
d.issues.map((l) => ({
|
|
222
222
|
message: l.message,
|
|
223
223
|
path: [i, ...l.path]
|
|
224
224
|
}))
|
|
225
225
|
);
|
|
226
|
-
r[i] =
|
|
226
|
+
r[i] = d.value;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
return
|
|
230
|
+
return k(r);
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const Or = () => crypto.randomUUID().slice(0, 8), Cr = (e) => typeof e != "function" && e.kind === "display", ue = (e) => typeof e != "function" && e.kind === "action", j = (e) => typeof e != "function" && e.kind === "input", H = (e) => typeof e != "function" && e.kind === "layout", W = (e) => typeof e == "function", Ir = Y({ in: Me(w()) }), Ue = Y({ when: w() }), ye = K([Ir, Ue]), kr = Y({ from: Me(w()) }), ve = K([kr, Ue]), Pe = K([Sr(), Ue]), jr = new C((e) => {
|
|
234
234
|
const t = typeof e;
|
|
235
|
-
return t === "function" ?
|
|
236
|
-
}),
|
|
237
|
-
load: { suffixed: !0, decoder:
|
|
238
|
-
click: { suffixed: !0, decoder:
|
|
239
|
-
change: { suffixed: !0, decoder:
|
|
240
|
-
filter: { suffixed: !0, decoder:
|
|
241
|
-
blur: { suffixed: !0, decoder:
|
|
242
|
-
}),
|
|
243
|
-
key:
|
|
244
|
-
default: y(
|
|
245
|
-
params: y(
|
|
246
|
-
}),
|
|
247
|
-
kind: { decoder:
|
|
248
|
-
uid: { decoder:
|
|
249
|
-
type: { decoder:
|
|
250
|
-
size: { suffixed: !0, decoder: y(
|
|
251
|
-
include: { decoder: y(
|
|
235
|
+
return t === "function" ? k(e) : E([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
236
|
+
}), N = (e) => K([e, jr]), He = ee({
|
|
237
|
+
load: { suffixed: !0, decoder: N(y(w())) },
|
|
238
|
+
click: { suffixed: !0, decoder: N(y(w())) },
|
|
239
|
+
change: { suffixed: !0, decoder: N(y(w())) },
|
|
240
|
+
filter: { suffixed: !0, decoder: N(y(w())) },
|
|
241
|
+
blur: { suffixed: !0, decoder: N(y(w())) }
|
|
242
|
+
}), Pr = Y({
|
|
243
|
+
key: w(),
|
|
244
|
+
default: y(w()),
|
|
245
|
+
params: y(U())
|
|
246
|
+
}), Pt = K([w(), Pr]), be = y(w()), Fr = ee({
|
|
247
|
+
kind: { decoder: G("display") },
|
|
248
|
+
uid: { decoder: be },
|
|
249
|
+
type: { decoder: w() },
|
|
250
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
251
|
+
include: { decoder: y(ye) },
|
|
252
252
|
exclude: { decoder: y(ve) },
|
|
253
|
-
props: { decoder: y(
|
|
254
|
-
}),
|
|
255
|
-
kind: { decoder:
|
|
256
|
-
uid: { decoder:
|
|
257
|
-
type: { decoder:
|
|
253
|
+
props: { decoder: y(U()) }
|
|
254
|
+
}), Dr = ee({
|
|
255
|
+
kind: { decoder: G("action") },
|
|
256
|
+
uid: { decoder: be },
|
|
257
|
+
type: { decoder: w() },
|
|
258
258
|
actionType: {
|
|
259
|
-
decoder: y(
|
|
259
|
+
decoder: y(K([G("button"), G("submit")]))
|
|
260
260
|
},
|
|
261
|
-
size: { suffixed: !0, decoder: y(
|
|
262
|
-
include: { decoder: y(
|
|
261
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
262
|
+
include: { decoder: y(ye) },
|
|
263
263
|
exclude: { decoder: y(ve) },
|
|
264
264
|
label: {
|
|
265
265
|
suffixed: !0,
|
|
266
|
-
decoder:
|
|
266
|
+
decoder: N(y(Pt))
|
|
267
267
|
},
|
|
268
|
-
disabled: { suffixed: !0, decoder: y(
|
|
269
|
-
on: { decoder: y(
|
|
270
|
-
props: { decoder: y(
|
|
271
|
-
}),
|
|
268
|
+
disabled: { suffixed: !0, decoder: y(Pe) },
|
|
269
|
+
on: { decoder: y(He) },
|
|
270
|
+
props: { decoder: y(U()) }
|
|
271
|
+
}), Wr = new C((e) => {
|
|
272
272
|
const t = typeof e;
|
|
273
273
|
if (t === "function") {
|
|
274
274
|
const r = e, n = r({
|
|
@@ -277,58 +277,58 @@ const mr = () => crypto.randomUUID().slice(0, 8), gr = (e) => typeof e != "funct
|
|
|
277
277
|
touched: void 0,
|
|
278
278
|
translate: void 0
|
|
279
279
|
});
|
|
280
|
-
return r.uid = r.uid || n.uid ||
|
|
280
|
+
return r.uid = r.uid || n.uid || Or(), r.type = n.type, r.path = n.path, k(r);
|
|
281
281
|
} else
|
|
282
|
-
return
|
|
283
|
-
}),
|
|
284
|
-
kind: { decoder:
|
|
285
|
-
uid: { decoder: y(
|
|
286
|
-
type: { decoder:
|
|
287
|
-
size: { suffixed: !0, decoder: y(
|
|
288
|
-
include: { decoder: y(
|
|
282
|
+
return E([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
283
|
+
}), Nr = ee({
|
|
284
|
+
kind: { decoder: G("input") },
|
|
285
|
+
uid: { decoder: y(w()) },
|
|
286
|
+
type: { decoder: w() },
|
|
287
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
288
|
+
include: { decoder: y(ye) },
|
|
289
289
|
exclude: { decoder: y(ve) },
|
|
290
|
-
disabled: { suffixed: !0, decoder: y(
|
|
291
|
-
readonly: { suffixed: !0, decoder: y(
|
|
292
|
-
on: { decoder: y(
|
|
293
|
-
props: { decoder: y(
|
|
290
|
+
disabled: { suffixed: !0, decoder: y(Pe) },
|
|
291
|
+
readonly: { suffixed: !0, decoder: y(Pe) },
|
|
292
|
+
on: { decoder: y(He) },
|
|
293
|
+
props: { decoder: y(U()) },
|
|
294
294
|
label: {
|
|
295
295
|
suffixed: !0,
|
|
296
|
-
decoder:
|
|
296
|
+
decoder: N(y(Pt))
|
|
297
297
|
},
|
|
298
|
-
path: { decoder:
|
|
299
|
-
defaultValue: { decoder: y(
|
|
298
|
+
path: { decoder: w() },
|
|
299
|
+
defaultValue: { decoder: y(U()) },
|
|
300
300
|
validator: {
|
|
301
301
|
suffixed: !0,
|
|
302
|
-
decoder:
|
|
302
|
+
decoder: N(y(U()))
|
|
303
303
|
}
|
|
304
304
|
}).map((e) => {
|
|
305
305
|
const t = { ...e };
|
|
306
306
|
if (e.uid || (t.uid = `${e.path}-${e.type}`), e.type === "repeater") {
|
|
307
307
|
const r = e.props;
|
|
308
|
-
t.props = { ...r, template:
|
|
308
|
+
t.props = { ...r, template: ze.parse(r.template) };
|
|
309
309
|
}
|
|
310
310
|
return t;
|
|
311
|
-
}),
|
|
312
|
-
const e =
|
|
313
|
-
input:
|
|
314
|
-
layout:
|
|
315
|
-
display:
|
|
316
|
-
action:
|
|
311
|
+
}), Tr = jt(() => {
|
|
312
|
+
const e = Ar("kind", {
|
|
313
|
+
input: Nr,
|
|
314
|
+
layout: ze,
|
|
315
|
+
display: Fr,
|
|
316
|
+
action: Dr
|
|
317
317
|
});
|
|
318
|
-
return new
|
|
319
|
-
(t) => typeof t == "function" ?
|
|
318
|
+
return new C(
|
|
319
|
+
(t) => typeof t == "function" ? Wr.decode(t) : e.decode(t)
|
|
320
320
|
);
|
|
321
|
-
}),
|
|
322
|
-
kind: { decoder:
|
|
323
|
-
uid: { decoder:
|
|
324
|
-
type: { decoder:
|
|
325
|
-
size: { suffixed: !0, decoder: y(
|
|
326
|
-
include: { decoder: y(
|
|
321
|
+
}), ze = ee({
|
|
322
|
+
kind: { decoder: G("layout") },
|
|
323
|
+
uid: { decoder: be },
|
|
324
|
+
type: { decoder: w() },
|
|
325
|
+
size: { suffixed: !0, decoder: y(ge()) },
|
|
326
|
+
include: { decoder: y(ye) },
|
|
327
327
|
exclude: { decoder: y(ve) },
|
|
328
|
-
props: { decoder: y(
|
|
329
|
-
on: { decoder: y(
|
|
330
|
-
children: { decoder: Me(
|
|
331
|
-
}),
|
|
328
|
+
props: { decoder: y(U()) },
|
|
329
|
+
on: { decoder: y(He) },
|
|
330
|
+
children: { decoder: Me(Tr) }
|
|
331
|
+
}), M = class M {
|
|
332
332
|
constructor() {
|
|
333
333
|
this.widgetLoaders = {}, this._ready = !1;
|
|
334
334
|
}
|
|
@@ -343,27 +343,27 @@ const mr = () => crypto.randomUUID().slice(0, 8), gr = (e) => typeof e != "funct
|
|
|
343
343
|
}
|
|
344
344
|
async loadWidget(t) {
|
|
345
345
|
const r = this.widgetLoaders[t];
|
|
346
|
-
if (!
|
|
347
|
-
const n = r().catch((o) => (
|
|
348
|
-
|
|
346
|
+
if (!M.sharedCache.has(r)) {
|
|
347
|
+
const n = r().catch((o) => (M.sharedCache.delete(r), Promise.reject(o)));
|
|
348
|
+
M.sharedCache.set(r, n);
|
|
349
349
|
}
|
|
350
|
-
return
|
|
350
|
+
return M.sharedCache.get(r);
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
function
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
function
|
|
359
|
-
if (!
|
|
360
|
-
|
|
361
|
-
}),
|
|
353
|
+
M.sharedCache = /* @__PURE__ */ new Map();
|
|
354
|
+
let Fe = M;
|
|
355
|
+
function Vr(e) {
|
|
356
|
+
De(e, "#0");
|
|
357
|
+
}
|
|
358
|
+
function De(e, t) {
|
|
359
|
+
if (!W(e) && (e.uid || (e.uid = t), H(e) && e.children.forEach((r, n) => {
|
|
360
|
+
De(r, `${t}.${n}`);
|
|
361
|
+
}), j(e) && e.type === "repeater")) {
|
|
362
362
|
const r = e.props?.template;
|
|
363
|
-
r &&
|
|
363
|
+
r && De(r, `${t}.t`);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function us(e) {
|
|
367
367
|
return {
|
|
368
368
|
...e,
|
|
369
369
|
form: {
|
|
@@ -374,12 +374,12 @@ function Uo(e) {
|
|
|
374
374
|
}
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
const
|
|
378
|
-
states: y(
|
|
379
|
-
form:
|
|
380
|
-
}).map((e) => (
|
|
377
|
+
const Ft = Y({
|
|
378
|
+
states: y(wr(w())),
|
|
379
|
+
form: jt(() => ze)
|
|
380
|
+
}).map((e) => (Vr(e.form), e)), Dt = (e) => ({
|
|
381
381
|
formName: "",
|
|
382
|
-
formDef:
|
|
382
|
+
formDef: Ft.parse({
|
|
383
383
|
form: {
|
|
384
384
|
kind: "layout",
|
|
385
385
|
type: "flex",
|
|
@@ -387,6 +387,7 @@ const It = ie({
|
|
|
387
387
|
}
|
|
388
388
|
}),
|
|
389
389
|
flatForm: {},
|
|
390
|
+
resolvedSources: {},
|
|
390
391
|
currentStates: [],
|
|
391
392
|
calculatedWidgets: {},
|
|
392
393
|
validations: {},
|
|
@@ -395,7 +396,6 @@ const It = ie({
|
|
|
395
396
|
isFormValid: !0,
|
|
396
397
|
widgetFlags: {},
|
|
397
398
|
repeaterItemScopes: {},
|
|
398
|
-
materializedRepeaterWidgets: {},
|
|
399
399
|
widgetPropOverrides: {},
|
|
400
400
|
data: {},
|
|
401
401
|
meta: {},
|
|
@@ -403,16 +403,16 @@ const It = ie({
|
|
|
403
403
|
touched: !1,
|
|
404
404
|
allControlsValidated: !1,
|
|
405
405
|
lang: e
|
|
406
|
-
}),
|
|
406
|
+
}), cs = {
|
|
407
407
|
submit: "formSubmit",
|
|
408
408
|
health: "formHealth",
|
|
409
409
|
event: "formEvent"
|
|
410
|
-
},
|
|
411
|
-
function
|
|
410
|
+
}, Rr = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
|
|
411
|
+
function ds(e) {
|
|
412
412
|
const t = new Intl.Locale(e).maximize().script;
|
|
413
413
|
return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(t || "") ? "rtl" : "ltr";
|
|
414
414
|
}
|
|
415
|
-
const
|
|
415
|
+
const _r = (e = navigator.language || "en-US") => {
|
|
416
416
|
const t = /* @__PURE__ */ new Set();
|
|
417
417
|
return {
|
|
418
418
|
get lang() {
|
|
@@ -430,17 +430,42 @@ const Wr = (e = navigator.language || "en-US") => {
|
|
|
430
430
|
e = n, t.forEach((o) => o(e));
|
|
431
431
|
}
|
|
432
432
|
};
|
|
433
|
-
},
|
|
433
|
+
}, F = {
|
|
434
|
+
calculateCurrentStateError: 10,
|
|
435
|
+
calculateWidgetFlagsError: 11,
|
|
436
|
+
calculateWidgetPropsError: 12,
|
|
437
|
+
initializeParseError: 20,
|
|
438
|
+
initializeUidCollisionError: 21,
|
|
439
|
+
initializeUnknownError: 22,
|
|
440
|
+
initializeMalformedFormShapeError: 23,
|
|
441
|
+
widgetCouldNotBeLoaded: 30,
|
|
442
|
+
resolveStringInterpolationError: 40
|
|
443
|
+
}, Lr = (e) => {
|
|
434
444
|
throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
|
|
435
|
-
}
|
|
436
|
-
function P(e, ...t) {
|
|
437
|
-
return t.reduce((r, n) => n(r), e);
|
|
438
|
-
}
|
|
439
|
-
const V = (e, t) => {
|
|
445
|
+
}, _ = (e, t) => {
|
|
440
446
|
if (e === void 0)
|
|
441
447
|
throw new Error("obj is undefined");
|
|
442
448
|
return t.split(".").reduce((r, n) => r === void 0 || n === "" ? r : Array.isArray(r) ? r[parseInt(n, 10)] : r[n], e);
|
|
443
|
-
},
|
|
449
|
+
}, Mr = (e, t) => {
|
|
450
|
+
if (t === "")
|
|
451
|
+
return !1;
|
|
452
|
+
let r = e;
|
|
453
|
+
for (const n of t.split(".")) {
|
|
454
|
+
if (r === null || typeof r != "object")
|
|
455
|
+
return !1;
|
|
456
|
+
if (Array.isArray(r)) {
|
|
457
|
+
const o = parseInt(n, 10);
|
|
458
|
+
if (!(o in r))
|
|
459
|
+
return !1;
|
|
460
|
+
r = r[o];
|
|
461
|
+
} else {
|
|
462
|
+
if (!(n in r))
|
|
463
|
+
return !1;
|
|
464
|
+
r = r[n];
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
return !0;
|
|
468
|
+
}, We = (e, t, r) => {
|
|
444
469
|
if (e === null)
|
|
445
470
|
throw new Error("object is null");
|
|
446
471
|
if (e === void 0)
|
|
@@ -450,12 +475,26 @@ const V = (e, t) => {
|
|
|
450
475
|
const n = t.split(".");
|
|
451
476
|
let o = e;
|
|
452
477
|
for (let i = 0; i < n.length - 1; i++) {
|
|
453
|
-
const u = n[i],
|
|
454
|
-
(o[u] == null || typeof o[u] != "object") && (o[u] =
|
|
478
|
+
const u = n[i], d = n[i + 1];
|
|
479
|
+
(o[u] == null || typeof o[u] != "object") && (o[u] = Nt(d) ? [] : {}), o = o[u];
|
|
455
480
|
}
|
|
456
481
|
const s = n[n.length - 1];
|
|
457
482
|
return o[s] = r, e;
|
|
458
|
-
},
|
|
483
|
+
}, Wt = (e, t, r) => {
|
|
484
|
+
if (e === null)
|
|
485
|
+
throw new Error("object is null");
|
|
486
|
+
if (e === void 0)
|
|
487
|
+
throw new Error("object is undefined");
|
|
488
|
+
if (t === "")
|
|
489
|
+
throw new Error("path cannot be empty");
|
|
490
|
+
const n = t.split("."), o = ct(e);
|
|
491
|
+
let s = o;
|
|
492
|
+
for (let i = 0; i < n.length - 1; i++) {
|
|
493
|
+
const u = n[i], d = n[i + 1];
|
|
494
|
+
s[u] == null || typeof s[u] != "object" ? s[u] = Nt(d) ? [] : {} : s[u] = ct(s[u]), s = s[u];
|
|
495
|
+
}
|
|
496
|
+
return s[n[n.length - 1]] = r, o;
|
|
497
|
+
}, ct = (e) => Array.isArray(e) ? e.slice() : { ...e }, Ur = (e, t) => {
|
|
459
498
|
if (t === "")
|
|
460
499
|
return e;
|
|
461
500
|
const r = t.split("."), n = [e];
|
|
@@ -463,7 +502,7 @@ const V = (e, t) => {
|
|
|
463
502
|
const u = n[i];
|
|
464
503
|
if (u == null || typeof u != "object")
|
|
465
504
|
return e;
|
|
466
|
-
const
|
|
505
|
+
const d = r[i], l = Array.isArray(u) ? u[parseInt(d, 10)] : u[d];
|
|
467
506
|
if (l == null || typeof l != "object")
|
|
468
507
|
return e;
|
|
469
508
|
n.push(l);
|
|
@@ -472,160 +511,250 @@ const V = (e, t) => {
|
|
|
472
511
|
Array.isArray(o) ? o.splice(parseInt(s, 10), 1) : delete o[s];
|
|
473
512
|
for (let i = n.length - 1; i >= 1; i--) {
|
|
474
513
|
const u = n[i];
|
|
475
|
-
if (Array.isArray(u) || !
|
|
514
|
+
if (Array.isArray(u) || !Hr(u))
|
|
476
515
|
break;
|
|
477
|
-
const
|
|
478
|
-
if (Array.isArray(
|
|
516
|
+
const d = n[i - 1], l = r[i - 1];
|
|
517
|
+
if (Array.isArray(d))
|
|
479
518
|
break;
|
|
480
|
-
delete
|
|
519
|
+
delete d[l];
|
|
481
520
|
}
|
|
482
521
|
return e;
|
|
483
522
|
};
|
|
484
|
-
function
|
|
523
|
+
function Nt(e) {
|
|
485
524
|
const t = Number(e);
|
|
486
525
|
return Number.isInteger(t) && t >= 0 && t.toString() === e;
|
|
487
526
|
}
|
|
488
|
-
function
|
|
527
|
+
function Hr(e) {
|
|
489
528
|
return e != null && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0;
|
|
490
529
|
}
|
|
491
|
-
|
|
492
|
-
function _e(e) {
|
|
530
|
+
function ce(e) {
|
|
493
531
|
if (e === null || typeof e != "object")
|
|
494
532
|
return e;
|
|
495
533
|
if (Array.isArray(e))
|
|
496
|
-
return e.map((r) =>
|
|
534
|
+
return e.map((r) => ce(r));
|
|
497
535
|
const t = {};
|
|
498
536
|
for (const r of Object.keys(e))
|
|
499
|
-
t[r] =
|
|
537
|
+
t[r] = ce(e[r]);
|
|
500
538
|
return t;
|
|
501
539
|
}
|
|
502
|
-
function
|
|
503
|
-
const r = t.payload.widget.uid;
|
|
504
|
-
if (!r)
|
|
505
|
-
throw new Error("addWidget: widget must have a uid");
|
|
506
|
-
const n = t.payload.widget, o = e.allControlsValidated && D(n) ? { ...e.touchedControls, [n.path]: !0 } : e.touchedControls;
|
|
507
|
-
return {
|
|
508
|
-
...e,
|
|
509
|
-
touchedControls: o,
|
|
510
|
-
calculatedWidgets: {
|
|
511
|
-
...e.calculatedWidgets,
|
|
512
|
-
[r]: {
|
|
513
|
-
source: n,
|
|
514
|
-
current: {}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
};
|
|
518
|
-
}
|
|
519
|
-
const Q = {
|
|
520
|
-
calculateCurrentStateError: 10,
|
|
521
|
-
initializeParseError: 20,
|
|
522
|
-
initializeUidCollisionError: 21,
|
|
523
|
-
initializeUnknownError: 22,
|
|
524
|
-
initializeMalformedFormShapeError: 23,
|
|
525
|
-
widgetCouldNotBeLoaded: 30,
|
|
526
|
-
resolveStringInterpolationError: 40
|
|
527
|
-
};
|
|
528
|
-
function be(e) {
|
|
540
|
+
function Be(e) {
|
|
529
541
|
return e.flatMap((t) => [
|
|
530
542
|
t,
|
|
531
|
-
...
|
|
543
|
+
...H(t) ? Be(t.children) : []
|
|
532
544
|
]);
|
|
533
545
|
}
|
|
534
|
-
function
|
|
535
|
-
return Object.entries(e.validations).
|
|
536
|
-
(
|
|
546
|
+
function $e(e) {
|
|
547
|
+
return Object.entries(e.validations).sort(
|
|
548
|
+
([n], [o]) => n.split(".").length - o.split(".").length
|
|
549
|
+
).reduce(
|
|
550
|
+
(n, [o, s]) => (s !== null && (n.$formIsInvalid = !0, We(n.$errors, o, [...s])), n),
|
|
537
551
|
{ $formIsInvalid: !1, $errors: {} }
|
|
538
552
|
);
|
|
539
553
|
}
|
|
540
|
-
function
|
|
541
|
-
|
|
554
|
+
function V(e) {
|
|
555
|
+
if (e !== void 0)
|
|
556
|
+
return j(e) || W(e) ? e.path : void 0;
|
|
557
|
+
}
|
|
558
|
+
function Ce(e) {
|
|
559
|
+
const t = ce(e.data);
|
|
542
560
|
for (const [r, n] of Object.entries(e.widgetFlags))
|
|
543
561
|
if (n.hidden === !0) {
|
|
544
|
-
const o = e.
|
|
545
|
-
o
|
|
562
|
+
const o = V(e.resolvedSources[r]);
|
|
563
|
+
o !== void 0 && Ur(t, o);
|
|
546
564
|
}
|
|
547
565
|
return t;
|
|
548
566
|
}
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
|
|
567
|
+
const Se = (e) => !W(e) && e.type === "repeater", te = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((t) => parseInt(t[1], 10));
|
|
568
|
+
function Ne(e, t) {
|
|
569
|
+
const r = { resolvedSources: {}, repeaterItemScopes: {} };
|
|
570
|
+
for (const n of Object.values(e))
|
|
571
|
+
r.resolvedSources[n.uid] = n, Se(n) && Tt(n, [], t, r);
|
|
572
|
+
return r;
|
|
573
|
+
}
|
|
574
|
+
function Tt(e, t, r, n) {
|
|
575
|
+
const o = _(r, e.path);
|
|
576
|
+
if (!Array.isArray(o))
|
|
577
|
+
return;
|
|
578
|
+
const s = Be([e.props.template]);
|
|
579
|
+
o.forEach((i, u) => {
|
|
580
|
+
const d = [...t, u], l = {
|
|
581
|
+
itemPath: `${e.path}.${u}`,
|
|
582
|
+
index: u
|
|
583
|
+
};
|
|
584
|
+
for (const a of s) {
|
|
585
|
+
const p = Vt(a, d);
|
|
586
|
+
n.resolvedSources[p.uid] = p, n.repeaterItemScopes[p.uid] = l;
|
|
587
|
+
const g = br(a, p, d, r, i, u);
|
|
588
|
+
g && Tt(g, d, r, n);
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
function br(e, t, r, n, o, s) {
|
|
593
|
+
if (Se(t))
|
|
594
|
+
return t;
|
|
595
|
+
if (!W(e))
|
|
596
|
+
return;
|
|
597
|
+
const i = e({
|
|
598
|
+
$form: n,
|
|
599
|
+
$item: o,
|
|
600
|
+
$index: s,
|
|
601
|
+
errors: void 0,
|
|
602
|
+
touched: void 0,
|
|
603
|
+
translate: void 0
|
|
604
|
+
});
|
|
605
|
+
if (i.type !== "repeater")
|
|
606
|
+
return;
|
|
607
|
+
const u = { ...i, uid: e.uid };
|
|
608
|
+
return Vt(u, r);
|
|
609
|
+
}
|
|
610
|
+
function Vt(e, t) {
|
|
611
|
+
const r = Ge(e.uid, t);
|
|
612
|
+
if (W(e)) {
|
|
613
|
+
const n = (o) => e(o);
|
|
614
|
+
return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path = dt(e.path, t)), n;
|
|
615
|
+
}
|
|
616
|
+
return j(e) ? {
|
|
617
|
+
...e,
|
|
618
|
+
uid: r,
|
|
619
|
+
path: dt(e.path, t)
|
|
620
|
+
} : {
|
|
621
|
+
...e,
|
|
622
|
+
uid: r
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
function Ge(e, t) {
|
|
626
|
+
if (t.length === 0)
|
|
627
|
+
throw new Error("Repeater indexes cannot be an empty array");
|
|
628
|
+
const r = t.reduce((n, o) => `${n}[${o}]`, "");
|
|
629
|
+
return `${e}${r}`;
|
|
630
|
+
}
|
|
631
|
+
function dt(e, t) {
|
|
632
|
+
if (t.length === 0)
|
|
633
|
+
throw new Error("Repeater indexes cannot be an empty array");
|
|
634
|
+
const r = "items", n = e.split(`.${r}`), o = n.length - 1;
|
|
635
|
+
if (o !== t.length)
|
|
636
|
+
throw new Error(
|
|
637
|
+
`Path contains ${o} '${r}' occurrences, but ${t.length} indexes were provided.`
|
|
638
|
+
);
|
|
639
|
+
return n.reduce((s, i, u) => u === 0 ? i : `${s}.${t[u - 1]}${i}`);
|
|
640
|
+
}
|
|
641
|
+
function zr(e, t) {
|
|
642
|
+
let r = 0;
|
|
643
|
+
return e.replace(/\.items(\??)\./g, (n, o) => {
|
|
644
|
+
const s = t[r++];
|
|
645
|
+
return s === void 0 ? n : `.${s}${o}.`;
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
const lt = ["include", "exclude", "disabled", "readonly"];
|
|
649
|
+
function Br(e, t) {
|
|
650
|
+
if (!lt.some(
|
|
651
|
+
(o) => at(e[o])
|
|
652
|
+
))
|
|
653
|
+
return e;
|
|
654
|
+
const n = { ...e };
|
|
655
|
+
for (const o of lt) {
|
|
656
|
+
const s = n[o];
|
|
657
|
+
at(s) && (n[o] = {
|
|
658
|
+
...s,
|
|
659
|
+
when: zr(s.when, t)
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
return n;
|
|
663
|
+
}
|
|
664
|
+
function at(e) {
|
|
665
|
+
return e !== null && typeof e == "object" && "when" in e && typeof e.when == "string";
|
|
666
|
+
}
|
|
667
|
+
const Gr = 50, Kr = (e) => {
|
|
668
|
+
let t = e.data, r = Ne(e.flatForm, t);
|
|
669
|
+
for (let n = 0; n < Gr; n++) {
|
|
670
|
+
let o = !1;
|
|
671
|
+
for (const s of Object.values(r.resolvedSources))
|
|
672
|
+
!j(s) || Mr(t, s.path) || (t = Wt(t, s.path, ce(s.defaultValue)), s.defaultValue !== void 0 && (o = !0));
|
|
673
|
+
if (!o)
|
|
674
|
+
break;
|
|
675
|
+
r = Ne(e.flatForm, t);
|
|
676
|
+
}
|
|
677
|
+
return { ...e, data: t, ...r };
|
|
678
|
+
}, Ke = 32;
|
|
679
|
+
let Te, h, m, v = (e) => (h = 0, m = e, v.newline = !1, e = S(), m[h] ? z() : e || ""), z = (e = "Unexpected token", t = h, r = m.slice(0, t).split(`
|
|
680
|
+
`), n = r.pop(), o = m.slice(Math.max(0, t - 40), t), s = "̭", i = (m[t] || " ") + s, u = m.slice(t + 1, t + 20)) => {
|
|
552
681
|
throw SyntaxError(`${e} at ${r.length + 1}:${n.length + 1}
|
|
553
|
-
${
|
|
682
|
+
${m[t - 41] !== `
|
|
554
683
|
`, "" + o}${i}${u}`);
|
|
555
|
-
},
|
|
556
|
-
for (; r = e(
|
|
557
|
-
return
|
|
558
|
-
},
|
|
684
|
+
}, Rt = (e, t = h) => (Array.isArray(e) && (e.loc = t), e), x = (e, t = h, r) => {
|
|
685
|
+
for (; r = e(m.charCodeAt(h)); ) h += r;
|
|
686
|
+
return m.slice(t, h);
|
|
687
|
+
}, O = (e = 1) => m[h += e], Ve = (e) => h = e, S = (e = 0, t) => {
|
|
559
688
|
let r, n, o, s, i;
|
|
560
|
-
for (t &&
|
|
561
|
-
(n && r === 91 &&
|
|
562
|
-
return t && (r == t ? (
|
|
563
|
-
},
|
|
564
|
-
for (
|
|
565
|
-
|
|
689
|
+
for (t && v.asi && (v.newline = !1); (r = v.space()) && (i = v.newline, 1) && r !== t && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
|
|
690
|
+
(n && r === 91 && Te && v.asi?.(n, e, S) || null) ?? ((s = D[r]) && s(n, e)) ?? (n && i && v.asi?.(n, e, S)) ?? (!n && x(v.id))); ) n = o;
|
|
691
|
+
return t && (r == t ? (h++, t === 125 && v.asi && (v.newline = !0)) : z("Unclosed " + String.fromCharCode(t - (t > 42 ? 2 : 1)))), n;
|
|
692
|
+
}, R = (e, t = h) => {
|
|
693
|
+
for (Te = !1; (e = m.charCodeAt(h)) <= Ke; )
|
|
694
|
+
v.asi && e === 10 && (v.newline = Te = !0), h++;
|
|
566
695
|
return e;
|
|
567
|
-
},
|
|
568
|
-
for (;
|
|
569
|
-
return
|
|
696
|
+
}, xr = (e = h) => {
|
|
697
|
+
for (; m.charCodeAt(e) <= Ke; ) e++;
|
|
698
|
+
return m.charCodeAt(e);
|
|
570
699
|
};
|
|
571
|
-
|
|
572
|
-
let
|
|
700
|
+
v.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
|
|
701
|
+
let Xr = (e, t = e.length) => m.substr(h, t) === e && !v.id(m.charCodeAt(h + t)), D = [], ft = {}, P = (e, t = Ke, r, n = e.charCodeAt(0), o = e.length, s = D[n], i = e.toUpperCase() !== e, u, d) => (t = ft[e] = !s && ft[e] || t, D[n] = (l, a, p, g = h) => (u = p, (p ? e == p : (o < 2 || e.charCodeAt(1) === m.charCodeAt(h + 1) && (o < 3 || m.substr(h, o) == e)) && (!i || !v.id(m.charCodeAt(h + o))) && (u = p = e)) && a < t && (h += o, (d = r(l)) ? Rt(d, g) : (h = g, u = 0, !i && !s && !l && z()), d) || s?.(l, a, u))), $ = (e, t, r = !1) => P(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), L = (e, t, r) => P(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), re = (e, t) => P(e, 200, (r) => !r && [, t]), _t = (e, t, r) => P(
|
|
573
702
|
e,
|
|
574
703
|
t,
|
|
575
704
|
(n, o) => (o = S(t - (r ? 0.5 : 0)), n?.[0] !== e && (n = [e, n || null]), o?.[0] === e ? n.push(...o.slice(1)) : n.push(o || null), n)
|
|
576
|
-
),
|
|
577
|
-
Object.defineProperty(
|
|
705
|
+
), xe = (e, t) => P(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Lt = (e, t) => P(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), ne = (e, t, r, n = e.charCodeAt(0), o = e.length, s = D[n], i) => D[n] = (u, d, l, a = h) => !u && (l ? e == l : (o < 2 || m.substr(h, o) == e) && (l = e)) && d < t && !v.id(m.charCodeAt(h + o)) && (!v.prop || v.prop(h + o)) && (Ve(h + o), (i = r()) ? Rt(i, a) : Ve(a), i) || s?.(u, d, l);
|
|
706
|
+
Object.defineProperty(v, "space", {
|
|
578
707
|
configurable: !0,
|
|
579
708
|
enumerable: !0,
|
|
580
|
-
get: () =>
|
|
581
|
-
set: (e) =>
|
|
709
|
+
get: () => R,
|
|
710
|
+
set: (e) => R = e
|
|
582
711
|
});
|
|
583
|
-
const
|
|
712
|
+
const Re = {}, f = (e, t, r = Re[e]) => Re[e] = (...n) => t(...n) || r?.(...n), c = (e) => Array.isArray(e) ? e[0] == null ? /* @__PURE__ */ ((t) => () => t)(e[1]) : (
|
|
584
713
|
// == catches both undefined and null
|
|
585
|
-
|
|
714
|
+
Re[e[0]]?.(...e.slice(1)) ?? z(`Unknown operator: ${e[0]}`, e?.loc)
|
|
586
715
|
) : e === void 0 ? () => {
|
|
587
|
-
} : (t) => t?.[e],
|
|
588
|
-
let t =
|
|
716
|
+
} : (t) => t?.[e], de = 46, Q = 48, le = 57, Jr = 69, Qr = 101, qr = 43, Zr = 45, ie = 95, Mt = 110, Yr = 97, en = 102, tn = 65, rn = 70, Ut = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Xe = (e) => {
|
|
717
|
+
let t = Ut(x(
|
|
589
718
|
(r) => (
|
|
590
719
|
// . is decimal only if NOT followed by another . (range operator)
|
|
591
|
-
r ===
|
|
720
|
+
r === de && m.charCodeAt(h + 1) !== de || r >= Q && r <= le || r === ie || ((r === Jr || r === Qr) && ((r = m.charCodeAt(h + 1)) >= Q && r <= le || r === qr || r === Zr) ? 2 : 0)
|
|
592
721
|
)
|
|
593
722
|
));
|
|
594
|
-
return
|
|
595
|
-
},
|
|
596
|
-
2: (e) => e === 48 || e === 49 || e ===
|
|
597
|
-
8: (e) => e >= 48 && e <= 55 || e ===
|
|
598
|
-
16: (e) => e >=
|
|
723
|
+
return m.charCodeAt(h) === Mt ? (O(), [, BigInt(t)]) : (e = +t) != e ? z() : [, e];
|
|
724
|
+
}, nn = {
|
|
725
|
+
2: (e) => e === 48 || e === 49 || e === ie,
|
|
726
|
+
8: (e) => e >= 48 && e <= 55 || e === ie,
|
|
727
|
+
16: (e) => e >= Q && e <= le || e >= Yr && e <= en || e >= tn && e <= rn || e === ie
|
|
599
728
|
};
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
for (let e =
|
|
603
|
-
|
|
729
|
+
v.number = null;
|
|
730
|
+
D[de] = (e) => !e && m.charCodeAt(h + 1) !== de && Xe();
|
|
731
|
+
for (let e = Q; e <= le; e++) D[e] = (t) => t ? void 0 : Xe();
|
|
732
|
+
D[Q] = (e) => {
|
|
604
733
|
if (e) return;
|
|
605
|
-
const t =
|
|
734
|
+
const t = v.number;
|
|
606
735
|
if (t) {
|
|
607
736
|
for (const [r, n] of Object.entries(t))
|
|
608
|
-
if (r[0] === "0" &&
|
|
609
|
-
|
|
610
|
-
const o =
|
|
611
|
-
return
|
|
737
|
+
if (r[0] === "0" && m[h + 1]?.toLowerCase() === r[1]) {
|
|
738
|
+
O(2);
|
|
739
|
+
const o = Ut(x(nn[n]));
|
|
740
|
+
return m.charCodeAt(h) === Mt ? (O(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
|
|
612
741
|
}
|
|
613
742
|
}
|
|
614
|
-
return
|
|
743
|
+
return Xe();
|
|
615
744
|
};
|
|
616
|
-
const
|
|
617
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
618
|
-
if (!(t ||
|
|
619
|
-
return
|
|
745
|
+
const on = 92, pt = 34, ht = 39, sn = { n: `
|
|
746
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Ht = (e) => (t, r, n = "") => {
|
|
747
|
+
if (!(t || !v.string?.[String.fromCharCode(e)]))
|
|
748
|
+
return O(), x((o) => o - e && (o === on ? (n += sn[m[h + 1]] || m[h + 1], 2) : (n += m[h], 1))), m[h] === String.fromCharCode(e) ? O() : z("Bad string"), [, n];
|
|
620
749
|
};
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
const
|
|
625
|
-
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) =>
|
|
626
|
-
const
|
|
750
|
+
D[pt] = Ht(pt);
|
|
751
|
+
D[ht] = Ht(ht);
|
|
752
|
+
v.string = { '"': !0 };
|
|
753
|
+
const un = 20;
|
|
754
|
+
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e, un, !0));
|
|
755
|
+
const bt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "()" && e.length === 2 ? bt(e[1], t) : (() => {
|
|
627
756
|
throw Error("Invalid assignment target");
|
|
628
|
-
})(),
|
|
757
|
+
})(), mt = {
|
|
629
758
|
"=": (e, t, r) => e[t] = r,
|
|
630
759
|
"+=": (e, t, r) => e[t] += r,
|
|
631
760
|
"-=": (e, t, r) => e[t] -= r,
|
|
@@ -638,173 +767,173 @@ const Tt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "
|
|
|
638
767
|
">>=": (e, t, r) => e[t] >>= r,
|
|
639
768
|
"<<=": (e, t, r) => e[t] <<= r
|
|
640
769
|
};
|
|
641
|
-
for (const e in
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
const
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
const
|
|
770
|
+
for (const e in mt) f(e, (t, r) => (r = c(r), bt(t, (n, o, s) => mt[e](n, o, r(s)))));
|
|
771
|
+
const cn = 30, dn = 40, ln = 140;
|
|
772
|
+
L("!", ln);
|
|
773
|
+
$("||", cn);
|
|
774
|
+
$("&&", dn);
|
|
775
|
+
f("!", (e) => (e = c(e), (t) => !e(t)));
|
|
776
|
+
f("||", (e, t) => (e = c(e), t = c(t), (r) => e(r) || t(r)));
|
|
777
|
+
f("&&", (e, t) => (e = c(e), t = c(t), (r) => e(r) && t(r)));
|
|
778
|
+
const an = 50, fn = 60, pn = 70, zt = 100, hn = 140;
|
|
779
|
+
$("|", an);
|
|
780
|
+
$("&", pn);
|
|
781
|
+
$("^", fn);
|
|
782
|
+
$(">>", zt);
|
|
783
|
+
$("<<", zt);
|
|
784
|
+
L("~", hn);
|
|
785
|
+
f("~", (e) => (e = c(e), (t) => ~e(t)));
|
|
786
|
+
f("|", (e, t) => (e = c(e), t = c(t), (r) => e(r) | t(r)));
|
|
787
|
+
f("&", (e, t) => (e = c(e), t = c(t), (r) => e(r) & t(r)));
|
|
788
|
+
f("^", (e, t) => (e = c(e), t = c(t), (r) => e(r) ^ t(r)));
|
|
789
|
+
f(">>", (e, t) => (e = c(e), t = c(t), (r) => e(r) >> t(r)));
|
|
790
|
+
f("<<", (e, t) => (e = c(e), t = c(t), (r) => e(r) << t(r)));
|
|
791
|
+
const Ae = 90;
|
|
792
|
+
$("<", Ae);
|
|
793
|
+
$(">", Ae);
|
|
794
|
+
$("<=", Ae);
|
|
795
|
+
$(">=", Ae);
|
|
796
|
+
f(">", (e, t) => (e = c(e), t = c(t), (r) => e(r) > t(r)));
|
|
797
|
+
f("<", (e, t) => (e = c(e), t = c(t), (r) => e(r) < t(r)));
|
|
798
|
+
f(">=", (e, t) => (e = c(e), t = c(t), (r) => e(r) >= t(r)));
|
|
799
|
+
f("<=", (e, t) => (e = c(e), t = c(t), (r) => e(r) <= t(r)));
|
|
800
|
+
const Bt = 80;
|
|
801
|
+
$("==", Bt);
|
|
802
|
+
$("!=", Bt);
|
|
803
|
+
f("==", (e, t) => (e = c(e), t = c(t), (r) => e(r) == t(r)));
|
|
804
|
+
f("!=", (e, t) => (e = c(e), t = c(t), (r) => e(r) != t(r)));
|
|
805
|
+
const Gt = 110, Je = 120, Kt = 140;
|
|
806
|
+
$("+", Gt);
|
|
807
|
+
$("-", Gt);
|
|
808
|
+
$("*", Je);
|
|
809
|
+
$("/", Je);
|
|
810
|
+
$("%", Je);
|
|
811
|
+
L("+", Kt);
|
|
812
|
+
L("-", Kt);
|
|
813
|
+
f("+", (e, t) => t !== void 0 ? (e = c(e), t = c(t), (r) => e(r) + t(r)) : (e = c(e), (r) => +e(r)));
|
|
814
|
+
f("-", (e, t) => t !== void 0 ? (e = c(e), t = c(t), (r) => e(r) - t(r)) : (e = c(e), (r) => -e(r)));
|
|
815
|
+
f("*", (e, t) => (e = c(e), t = c(t), (r) => e(r) * t(r)));
|
|
816
|
+
f("/", (e, t) => (e = c(e), t = c(t), (r) => e(r) / t(r)));
|
|
817
|
+
f("%", (e, t) => (e = c(e), t = c(t), (r) => e(r) % t(r)));
|
|
818
|
+
const ae = 150;
|
|
819
|
+
P("++", ae, (e) => e ? ["++", e, null] : ["++", S(ae - 1)]);
|
|
820
|
+
P("--", ae, (e) => e ? ["--", e, null] : ["--", S(ae - 1)]);
|
|
821
|
+
const Qe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n)) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o))) : e[0] === "()" && e.length === 2 ? Qe(e[1], t) : (
|
|
693
822
|
// unwrap parens: (x)++
|
|
694
823
|
(() => {
|
|
695
824
|
throw Error("Invalid increment target");
|
|
696
825
|
})()
|
|
697
826
|
);
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
const
|
|
827
|
+
f("++", (e, t) => Qe(e, t === null ? (r, n) => r[n]++ : (r, n) => ++r[n]));
|
|
828
|
+
f("--", (e, t) => Qe(e, t === null ? (r, n) => r[n]-- : (r, n) => --r[n]));
|
|
829
|
+
const mn = 5, gn = 10;
|
|
830
|
+
_t(",", gn);
|
|
831
|
+
_t(";", mn, !0);
|
|
832
|
+
const xt = (...e) => (e = e.map(c), (t) => {
|
|
704
833
|
let r;
|
|
705
834
|
for (const n of e) r = n(t);
|
|
706
835
|
return r;
|
|
707
836
|
});
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
const
|
|
711
|
-
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
const
|
|
837
|
+
f(",", xt);
|
|
838
|
+
f(";", xt);
|
|
839
|
+
const yn = 170;
|
|
840
|
+
xe("()", yn);
|
|
841
|
+
const T = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", qe = 170;
|
|
842
|
+
Lt("[]", qe);
|
|
843
|
+
$(".", qe);
|
|
844
|
+
Lt("()", qe);
|
|
845
|
+
const fe = (e) => {
|
|
717
846
|
throw Error(e);
|
|
718
847
|
};
|
|
719
|
-
|
|
720
|
-
}) : r[0] === "..." ? (r =
|
|
848
|
+
f("[]", (e, t) => t === void 0 ? (e = e ? e[0] === "," ? e.slice(1) : [e] : [], e = e.map((r) => r == null ? (() => {
|
|
849
|
+
}) : r[0] === "..." ? (r = c(r[1]), (n) => r(n)) : (r = c(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null && fe("Missing index"), e = c(e), t = c(t), (r) => {
|
|
721
850
|
const n = t(r);
|
|
722
|
-
return
|
|
851
|
+
return T(n) ? void 0 : e(r)[n];
|
|
723
852
|
}));
|
|
724
|
-
|
|
853
|
+
f(".", (e, t) => (e = c(e), t = t[0] ? t : t[1], T(t) ? () => {
|
|
725
854
|
} : (r) => e(r)[t]));
|
|
726
|
-
|
|
727
|
-
if (t === void 0) return e == null ?
|
|
855
|
+
f("()", (e, t) => {
|
|
856
|
+
if (t === void 0) return e == null ? fe("Empty ()") : c(e);
|
|
728
857
|
const r = (o) => o?.[0] === "," && o.slice(1).some((s) => s == null || r(s));
|
|
729
|
-
r(t) &&
|
|
730
|
-
const n = t ? t[0] === "," ? (t = t.slice(1).map(
|
|
731
|
-
return
|
|
858
|
+
r(t) && fe("Empty argument");
|
|
859
|
+
const n = t ? t[0] === "," ? (t = t.slice(1).map(c), (o) => t.map((s) => s(o))) : (t = c(t), (o) => [t(o)]) : () => [];
|
|
860
|
+
return Ze(e, (o, s, i) => o[s](...n(i)));
|
|
732
861
|
});
|
|
733
|
-
const
|
|
862
|
+
const B = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && B(e[1]) || e[0] === "{}"), Ze = (e, t, r, n) => e == null ? fe("Empty ()") : e[0] === "()" && e.length == 2 ? Ze(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = c(e[1]), n = e[2], (o) => {
|
|
734
863
|
const s = r(o);
|
|
735
864
|
return s == null ? void 0 : t(s, n, o);
|
|
736
|
-
}) : e[0] === "[]" && e.length === 3 ? (r =
|
|
865
|
+
}) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "?.[]" ? (r = c(e[1]), n = c(e[2]), (o) => {
|
|
737
866
|
const s = r(o);
|
|
738
867
|
return s == null ? void 0 : t(s, n(o), o);
|
|
739
|
-
}) : (e =
|
|
740
|
-
|
|
868
|
+
}) : (e = c(e), (o) => t([e(o)], 0, o)), X = Ze, vn = 32, $n = v.space;
|
|
869
|
+
v.comment ??= { "//": `
|
|
741
870
|
`, "/*": "*/" };
|
|
742
|
-
let
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
for (var e; e =
|
|
746
|
-
for (var t = 0, r; r =
|
|
747
|
-
if (e === r[2] &&
|
|
748
|
-
var n =
|
|
871
|
+
let Ie;
|
|
872
|
+
v.space = () => {
|
|
873
|
+
Ie || (Ie = Object.entries(v.comment).map(([o, s]) => [o, s, o.charCodeAt(0)]));
|
|
874
|
+
for (var e; e = $n(); ) {
|
|
875
|
+
for (var t = 0, r; r = Ie[t++]; )
|
|
876
|
+
if (e === r[2] && m.substr(h, r[0].length) === r[0]) {
|
|
877
|
+
var n = h + r[0].length;
|
|
749
878
|
if (r[1] === `
|
|
750
|
-
`) for (;
|
|
879
|
+
`) for (; m.charCodeAt(n) >= vn; ) n++;
|
|
751
880
|
else {
|
|
752
|
-
for (;
|
|
753
|
-
|
|
881
|
+
for (; m[n] && m.substr(n, r[1].length) !== r[1]; ) n++;
|
|
882
|
+
m[n] && (n += r[1].length);
|
|
754
883
|
}
|
|
755
|
-
|
|
884
|
+
Ve(n), e = 0;
|
|
756
885
|
break;
|
|
757
886
|
}
|
|
758
887
|
if (e) return e;
|
|
759
888
|
}
|
|
760
889
|
return e;
|
|
761
890
|
};
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
const
|
|
891
|
+
const Xt = 80;
|
|
892
|
+
$("===", Xt);
|
|
893
|
+
$("!==", Xt);
|
|
894
|
+
f("===", (e, t) => (e = c(e), t = c(t), (r) => e(r) === t(r)));
|
|
895
|
+
f("!==", (e, t) => (e = c(e), t = c(t), (r) => e(r) !== t(r)));
|
|
896
|
+
const Sn = 30;
|
|
897
|
+
$("??", Sn);
|
|
898
|
+
f("??", (e, t) => (e = c(e), t = c(t), (r) => e(r) ?? t(r)));
|
|
899
|
+
const An = 130, En = 20;
|
|
900
|
+
$("**", An, !0);
|
|
901
|
+
$("**=", En, !0);
|
|
902
|
+
f("**", (e, t) => (e = c(e), t = c(t), (r) => e(r) ** t(r)));
|
|
903
|
+
const wn = (e) => {
|
|
775
904
|
throw Error(e);
|
|
776
905
|
};
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
const
|
|
906
|
+
f("**=", (e, t) => (B(e) || wn("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] **= t(o))));
|
|
907
|
+
const Jt = 90;
|
|
908
|
+
$("in", Jt);
|
|
909
|
+
$("of", Jt);
|
|
910
|
+
f("in", (e, t) => (e = c(e), t = c(t), (r) => e(r) in t(r)));
|
|
911
|
+
const On = 20, Cn = 100, In = (e) => {
|
|
783
912
|
throw Error(e);
|
|
784
913
|
};
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
const
|
|
914
|
+
$(">>>", Cn);
|
|
915
|
+
$(">>>=", On, !0);
|
|
916
|
+
f(">>>", (e, t) => (e = c(e), t = c(t), (r) => e(r) >>> t(r)));
|
|
917
|
+
f(">>>=", (e, t) => (B(e) || In("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] >>>= t(o))));
|
|
918
|
+
const Ye = 5, kn = 10, jn = 20, Pn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, pe = (e, t, r) => {
|
|
790
919
|
if (typeof e == "string") {
|
|
791
920
|
r[e] = t;
|
|
792
921
|
return;
|
|
793
922
|
}
|
|
794
|
-
const [n, ...o] = e, s =
|
|
923
|
+
const [n, ...o] = e, s = Pn(o);
|
|
795
924
|
if (n === "{}") {
|
|
796
925
|
const i = [];
|
|
797
926
|
for (const u of s) {
|
|
798
927
|
if (Array.isArray(u) && u[0] === "...") {
|
|
799
|
-
const
|
|
800
|
-
for (const
|
|
801
|
-
r[u[1]] =
|
|
928
|
+
const g = {};
|
|
929
|
+
for (const I in t) i.includes(I) || (g[I] = t[I]);
|
|
930
|
+
r[u[1]] = g;
|
|
802
931
|
break;
|
|
803
932
|
}
|
|
804
|
-
let
|
|
805
|
-
typeof u == "string" ?
|
|
806
|
-
let
|
|
807
|
-
|
|
933
|
+
let d, l, a;
|
|
934
|
+
typeof u == "string" ? d = l = u : u[0] === "=" ? (typeof u[1] == "string" ? d = l = u[1] : [, d, l] = u[1], a = u[2]) : [, d, l] = u, i.push(d);
|
|
935
|
+
let p = t[d];
|
|
936
|
+
p === void 0 && a && (p = c(a)(r)), pe(l, p, r);
|
|
808
937
|
}
|
|
809
938
|
} else if (n === "[]") {
|
|
810
939
|
let i = 0;
|
|
@@ -817,265 +946,271 @@ const tt = 5, hn = 10, mn = 20, gn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
|
|
|
817
946
|
r[u[1]] = t.slice(i);
|
|
818
947
|
break;
|
|
819
948
|
}
|
|
820
|
-
let
|
|
821
|
-
Array.isArray(u) && u[0] === "=" && ([,
|
|
822
|
-
let
|
|
823
|
-
|
|
949
|
+
let d = u, l;
|
|
950
|
+
Array.isArray(u) && u[0] === "=" && ([, d, l] = u);
|
|
951
|
+
let a = t[i++];
|
|
952
|
+
a === void 0 && l && (a = c(l)(r)), pe(d, a, r);
|
|
824
953
|
}
|
|
825
954
|
}
|
|
826
|
-
},
|
|
827
|
-
let t = S(
|
|
955
|
+
}, Qt = (e) => {
|
|
956
|
+
let t = S(kn - 1);
|
|
828
957
|
return t?.[0] === "in" || t?.[0] === "of" ? [t[0], [e, t[1]], t[2]] : t?.[0] === "," ? [e, ...t.slice(1)] : [e, t];
|
|
829
958
|
};
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
const
|
|
959
|
+
ne("let", Ye + 1, () => Qt("let"));
|
|
960
|
+
ne("const", Ye + 1, () => Qt("const"));
|
|
961
|
+
ne("var", Ye, () => (R(), ["var", S(jn)]));
|
|
962
|
+
const qt = (...e) => (e = e.map((t) => {
|
|
834
963
|
if (typeof t == "string") return (r) => {
|
|
835
964
|
r[t] = void 0;
|
|
836
965
|
};
|
|
837
966
|
if (t[0] === "=") {
|
|
838
|
-
const [, r, n] = t, o =
|
|
967
|
+
const [, r, n] = t, o = c(n);
|
|
839
968
|
return typeof r == "string" ? (s) => {
|
|
840
969
|
s[r] = o(s);
|
|
841
|
-
} : (s) =>
|
|
970
|
+
} : (s) => pe(r, o(s), s);
|
|
842
971
|
}
|
|
843
|
-
return
|
|
972
|
+
return c(t);
|
|
844
973
|
}), (t) => {
|
|
845
974
|
for (const r of e) r(t);
|
|
846
975
|
});
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
976
|
+
f("let", qt);
|
|
977
|
+
f("const", qt);
|
|
978
|
+
f("var", (e) => typeof e == "string" ? (t) => {
|
|
850
979
|
t[e] = void 0;
|
|
851
980
|
} : () => {
|
|
852
981
|
});
|
|
853
|
-
const
|
|
982
|
+
const et = 20, Ee = (e) => {
|
|
854
983
|
throw Error(e);
|
|
855
984
|
};
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
985
|
+
$("||=", et, !0);
|
|
986
|
+
$("&&=", et, !0);
|
|
987
|
+
$("??=", et, !0);
|
|
988
|
+
f("=", (e, t) => {
|
|
860
989
|
if (Array.isArray(e) && (e[0] === "let" || e[0] === "const" || e[0] === "var")) {
|
|
861
990
|
const r = e[1];
|
|
862
|
-
return t =
|
|
991
|
+
return t = c(t), typeof r == "string" ? (n) => {
|
|
863
992
|
n[r] = t(n);
|
|
864
|
-
} : (n) =>
|
|
993
|
+
} : (n) => pe(r, t(n), n);
|
|
865
994
|
}
|
|
866
|
-
return
|
|
995
|
+
return B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] = t(o));
|
|
867
996
|
});
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
997
|
+
f("||=", (e, t) => (B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ||= t(o))));
|
|
998
|
+
f("&&=", (e, t) => (B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] &&= t(o))));
|
|
999
|
+
f("??=", (e, t) => (B(e) || Ee("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ??= t(o))));
|
|
1000
|
+
re("true", !0);
|
|
1001
|
+
re("false", !1);
|
|
1002
|
+
re("null", null);
|
|
1003
|
+
ne("undefined", 200, () => []);
|
|
1004
|
+
re("NaN", NaN);
|
|
1005
|
+
re("Infinity", 1 / 0);
|
|
877
1006
|
const ke = 20;
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
const
|
|
881
|
-
|
|
882
|
-
|
|
1007
|
+
P("?", ke, (e, t, r) => e && (t = S(ke - 1)) && x((n) => n === 58) && (r = S(ke - 1), ["?", e, t, r]));
|
|
1008
|
+
f("?", (e, t, r) => (e = c(e), t = c(t), r = c(r), (n) => e(n) ? t(n) : r(n)));
|
|
1009
|
+
const Fn = [], Dn = 20;
|
|
1010
|
+
$("=>", Dn, !0);
|
|
1011
|
+
f("=>", (e, t) => {
|
|
883
1012
|
e = e?.[0] === "()" ? e[1] : e;
|
|
884
1013
|
const r = e ? e[0] === "," ? e.slice(1) : [e] : [];
|
|
885
1014
|
let n = -1, o = null;
|
|
886
1015
|
const s = r[r.length - 1];
|
|
887
1016
|
Array.isArray(s) && s[0] === "..." && (n = r.length - 1, o = s[1], r.length--);
|
|
888
1017
|
const i = t?.[0] === "{}";
|
|
889
|
-
return t =
|
|
1018
|
+
return t = c(i ? ["{", t[1]] : t), (u) => (...d) => {
|
|
890
1019
|
const l = {};
|
|
891
|
-
r.forEach((
|
|
892
|
-
const
|
|
893
|
-
get: (
|
|
894
|
-
set: (
|
|
895
|
-
has: (
|
|
1020
|
+
r.forEach((p, g) => l[p] = d[g]), o && (l[o] = d.slice(n));
|
|
1021
|
+
const a = new Proxy(l, {
|
|
1022
|
+
get: (p, g) => g in p ? p[g] : u?.[g],
|
|
1023
|
+
set: (p, g, I) => ((g in p ? p : u)[g] = I, !0),
|
|
1024
|
+
has: (p, g) => g in p || (u ? g in u : !1)
|
|
896
1025
|
});
|
|
897
1026
|
try {
|
|
898
|
-
const
|
|
899
|
-
return i ? void 0 :
|
|
900
|
-
} catch (
|
|
901
|
-
if (
|
|
902
|
-
throw
|
|
1027
|
+
const p = t(a);
|
|
1028
|
+
return i ? void 0 : p;
|
|
1029
|
+
} catch (p) {
|
|
1030
|
+
if (p === Fn) return p[0];
|
|
1031
|
+
throw p;
|
|
903
1032
|
}
|
|
904
1033
|
};
|
|
905
1034
|
});
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
const
|
|
910
|
-
|
|
1035
|
+
const Wn = 140;
|
|
1036
|
+
L("...", Wn);
|
|
1037
|
+
f("...", (e) => (e = c(e), (t) => Object.entries(e(t))));
|
|
1038
|
+
const gt = 170;
|
|
1039
|
+
P("?.", gt, (e, t) => {
|
|
911
1040
|
if (!e) return;
|
|
912
|
-
const r =
|
|
913
|
-
return r === 40 ? (
|
|
1041
|
+
const r = R();
|
|
1042
|
+
return r === 40 ? (O(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (O(), ["?.[]", e, S(0, 93)]) : (t = S(gt), t ? ["?.", e, t] : void 0);
|
|
914
1043
|
});
|
|
915
|
-
|
|
1044
|
+
f("?.", (e, t) => (e = c(e), T(t) ? () => {
|
|
916
1045
|
} : (r) => e(r)?.[t]));
|
|
917
|
-
|
|
1046
|
+
f("?.[]", (e, t) => (e = c(e), t = c(t), (r) => {
|
|
918
1047
|
const n = t(r);
|
|
919
|
-
return
|
|
1048
|
+
return T(n) ? void 0 : e(r)?.[n];
|
|
920
1049
|
}));
|
|
921
|
-
|
|
922
|
-
const r = t ? t[0] === "," ? (t = t.slice(1).map(
|
|
1050
|
+
f("?.()", (e, t) => {
|
|
1051
|
+
const r = t ? t[0] === "," ? (t = t.slice(1).map(c), (o) => t.map((s) => s(o))) : (t = c(t), (o) => [t(o)]) : () => [];
|
|
923
1052
|
if (e[0] === "?.") {
|
|
924
|
-
const o =
|
|
925
|
-
return
|
|
1053
|
+
const o = c(e[1]), s = e[2];
|
|
1054
|
+
return T(s) ? () => {
|
|
926
1055
|
} : (i) => o(i)?.[s]?.(...r(i));
|
|
927
1056
|
}
|
|
928
1057
|
if (e[0] === "?.[]") {
|
|
929
|
-
const o =
|
|
1058
|
+
const o = c(e[1]), s = c(e[2]);
|
|
930
1059
|
return (i) => {
|
|
931
|
-
const u = o(i),
|
|
932
|
-
return
|
|
1060
|
+
const u = o(i), d = s(i);
|
|
1061
|
+
return T(d) ? void 0 : u?.[d]?.(...r(i));
|
|
933
1062
|
};
|
|
934
1063
|
}
|
|
935
1064
|
if (e[0] === ".") {
|
|
936
|
-
const o =
|
|
937
|
-
return
|
|
1065
|
+
const o = c(e[1]), s = e[2];
|
|
1066
|
+
return T(s) ? () => {
|
|
938
1067
|
} : (i) => o(i)?.[s]?.(...r(i));
|
|
939
1068
|
}
|
|
940
1069
|
if (e[0] === "[]" && e.length === 3) {
|
|
941
|
-
const o =
|
|
1070
|
+
const o = c(e[1]), s = c(e[2]);
|
|
942
1071
|
return (i) => {
|
|
943
|
-
const u = o(i),
|
|
944
|
-
return
|
|
1072
|
+
const u = o(i), d = s(i);
|
|
1073
|
+
return T(d) ? void 0 : u?.[d]?.(...r(i));
|
|
945
1074
|
};
|
|
946
1075
|
}
|
|
947
|
-
const n =
|
|
1076
|
+
const n = c(e);
|
|
948
1077
|
return (o) => n(o)?.(...r(o));
|
|
949
1078
|
});
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1079
|
+
const q = 140;
|
|
1080
|
+
L("typeof", q);
|
|
1081
|
+
L("void", q);
|
|
1082
|
+
L("delete", q);
|
|
1083
|
+
ne(
|
|
955
1084
|
"new",
|
|
956
|
-
|
|
957
|
-
() =>
|
|
1085
|
+
q,
|
|
1086
|
+
() => Xr(".target") ? (O(7), ["new.target"]) : ["new", S(q)]
|
|
958
1087
|
);
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
1088
|
+
f("typeof", (e) => (e = c(e), (t) => typeof e(t)));
|
|
1089
|
+
f("void", (e) => (e = c(e), (t) => (e(t), void 0)));
|
|
1090
|
+
f("delete", (e) => {
|
|
962
1091
|
if (e[0] === ".") {
|
|
963
|
-
const t =
|
|
1092
|
+
const t = c(e[1]), r = e[2];
|
|
964
1093
|
return (n) => delete t(n)[r];
|
|
965
1094
|
}
|
|
966
1095
|
if (e[0] === "[]") {
|
|
967
|
-
const t =
|
|
1096
|
+
const t = c(e[1]), r = c(e[2]);
|
|
968
1097
|
return (n) => delete t(n)[r(n)];
|
|
969
1098
|
}
|
|
970
1099
|
return () => !0;
|
|
971
1100
|
});
|
|
972
|
-
|
|
973
|
-
const t =
|
|
1101
|
+
f("new", (e) => {
|
|
1102
|
+
const t = c(e?.[0] === "()" ? e[1] : e), r = e?.[0] === "()" ? e[2] : null, n = r ? r[0] === "," ? /* @__PURE__ */ ((o) => (s) => o.map((i) => i(s)))(r.slice(1).map(c)) : /* @__PURE__ */ ((o) => (s) => [o(s)])(c(r)) : () => [];
|
|
974
1103
|
return (o) => new (t(o))(...n(o));
|
|
975
1104
|
});
|
|
976
|
-
const
|
|
1105
|
+
const tt = /* @__PURE__ */ Symbol("accessor"), rt = 20, Nn = 40, Zt = 41, Yt = 123, er = 125, tr = (e) => (t) => {
|
|
977
1106
|
if (t) return;
|
|
978
|
-
|
|
979
|
-
const r =
|
|
980
|
-
if (!r || (
|
|
981
|
-
|
|
982
|
-
const n = S(0,
|
|
983
|
-
return
|
|
1107
|
+
R();
|
|
1108
|
+
const r = x(v.id);
|
|
1109
|
+
if (!r || (R(), m.charCodeAt(h) !== Nn)) return !1;
|
|
1110
|
+
O();
|
|
1111
|
+
const n = S(0, Zt);
|
|
1112
|
+
return R(), m.charCodeAt(h) !== Yt ? !1 : (O(), [e, r, n, S(0, er)]);
|
|
984
1113
|
};
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1114
|
+
P("get", rt - 1, tr("get"));
|
|
1115
|
+
P("set", rt - 1, tr("set"));
|
|
1116
|
+
P("(", rt - 1, (e) => {
|
|
988
1117
|
if (!e || typeof e != "string") return;
|
|
989
|
-
const t = S(0,
|
|
990
|
-
if (
|
|
991
|
-
return
|
|
1118
|
+
const t = S(0, Zt) || null;
|
|
1119
|
+
if (R(), m.charCodeAt(h) === Yt)
|
|
1120
|
+
return O(), [":", e, ["=>", ["()", t], S(0, er) || null]];
|
|
992
1121
|
});
|
|
993
|
-
|
|
994
|
-
}, (r) => [[
|
|
1122
|
+
f("get", (e, t) => (t = t ? c(t) : () => {
|
|
1123
|
+
}, (r) => [[tt, e, {
|
|
995
1124
|
get: function() {
|
|
996
1125
|
const n = Object.create(r || {});
|
|
997
1126
|
return n.this = this, t(n);
|
|
998
1127
|
}
|
|
999
1128
|
}]]));
|
|
1000
|
-
|
|
1001
|
-
}, (n) => [[
|
|
1129
|
+
f("set", (e, t, r) => (r = r ? c(r) : () => {
|
|
1130
|
+
}, (n) => [[tt, e, {
|
|
1002
1131
|
set: function(o) {
|
|
1003
1132
|
const s = Object.create(n || {});
|
|
1004
1133
|
s.this = this, s[t] = o, r(s);
|
|
1005
1134
|
}
|
|
1006
1135
|
}]]));
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1009
|
-
const
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1136
|
+
const Tn = 20, rr = 200;
|
|
1137
|
+
v.prop = (e) => xr(e) !== 58;
|
|
1138
|
+
const Vn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
|
|
1139
|
+
xe("[]", rr);
|
|
1140
|
+
xe("{}", rr);
|
|
1141
|
+
$(":", Tn - 1, !0);
|
|
1142
|
+
f("{}", (e, t) => {
|
|
1014
1143
|
if (t !== void 0) return;
|
|
1015
|
-
if (!
|
|
1144
|
+
if (!Vn(e)) return c(["{", e]);
|
|
1016
1145
|
e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
|
|
1017
|
-
const r = e.map((n) =>
|
|
1146
|
+
const r = e.map((n) => c(typeof n == "string" ? [":", n, n] : n));
|
|
1018
1147
|
return (n) => {
|
|
1019
1148
|
const o = {}, s = {};
|
|
1020
1149
|
for (const i of r.flatMap((u) => u(n)))
|
|
1021
|
-
if (i[0] ===
|
|
1022
|
-
const [, u,
|
|
1023
|
-
s[u] = { ...s[u], ...
|
|
1150
|
+
if (i[0] === tt) {
|
|
1151
|
+
const [, u, d] = i;
|
|
1152
|
+
s[u] = { ...s[u], ...d, configurable: !0, enumerable: !0 };
|
|
1024
1153
|
} else o[i[0]] = i[1];
|
|
1025
1154
|
for (const i in s) Object.defineProperty(o, i, s[i]);
|
|
1026
1155
|
return o;
|
|
1027
1156
|
};
|
|
1028
1157
|
});
|
|
1029
|
-
|
|
1158
|
+
f("{", (e) => (e = e ? c(e) : () => {
|
|
1030
1159
|
}, (t) => e(Object.create(t))));
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
1160
|
+
f(":", (e, t) => (t = c(t), Array.isArray(e) ? (e = c(e), (r) => [[e(r), t(r)]]) : (r) => [[e, t(r)]]));
|
|
1161
|
+
const Rn = 170, he = 96, _n = 36, Ln = 123, Mn = 92, Un = { n: `
|
|
1162
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, yt = () => {
|
|
1034
1163
|
const e = [];
|
|
1035
|
-
for (let t = "", r; (r =
|
|
1036
|
-
r ? r ===
|
|
1037
|
-
return
|
|
1038
|
-
},
|
|
1039
|
-
|
|
1164
|
+
for (let t = "", r; (r = m.charCodeAt(h)) !== he; )
|
|
1165
|
+
r ? r === Mn ? (O(), t += Un[m[h]] || m[h], O()) : r === _n && m.charCodeAt(h + 1) === Ln ? (t && e.push([, t]), t = "", O(2), e.push(S(0, 125))) : (t += m[h], O(), r = m.charCodeAt(h), r === he && t && e.push([, t])) : z("Unterminated template");
|
|
1166
|
+
return O(), e;
|
|
1167
|
+
}, Hn = D[he];
|
|
1168
|
+
D[he] = (e, t) => e && t < Rn ? v.asi && v.newline ? void 0 : (O(), ["``", e, ...yt()]) : (
|
|
1040
1169
|
// tagged
|
|
1041
1170
|
e ? (
|
|
1042
1171
|
// plain
|
|
1043
|
-
|
|
1044
|
-
) : (
|
|
1172
|
+
Hn?.(e, t)
|
|
1173
|
+
) : (O(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(yt()))
|
|
1045
1174
|
);
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
e =
|
|
1175
|
+
f("`", (...e) => (e = e.map(c), (t) => e.map((r) => r(t)).join("")));
|
|
1176
|
+
f("``", (e, ...t) => {
|
|
1177
|
+
e = c(e);
|
|
1049
1178
|
const r = [], n = [];
|
|
1050
1179
|
for (const s of t)
|
|
1051
|
-
Array.isArray(s) && s[0] === void 0 ? r.push(s[1]) : n.push(
|
|
1180
|
+
Array.isArray(s) && s[0] === void 0 ? r.push(s[1]) : n.push(c(s));
|
|
1052
1181
|
const o = Object.assign([...r], { raw: r });
|
|
1053
1182
|
return (s) => e(s)(o, ...n.map((i) => i(s)));
|
|
1054
1183
|
});
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1184
|
+
v.string["'"] = !0;
|
|
1185
|
+
v.number = { "0x": 16, "0b": 2, "0o": 8 };
|
|
1186
|
+
const bn = {
|
|
1058
1187
|
log: (e, t) => (t ? console.log(t, e) : console.log(e), e)
|
|
1059
|
-
};
|
|
1060
|
-
function
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1188
|
+
}, zn = 2e3, oe = /* @__PURE__ */ new Map();
|
|
1189
|
+
function nt(e) {
|
|
1190
|
+
const t = oe.get(e);
|
|
1191
|
+
if (t !== void 0)
|
|
1192
|
+
return t;
|
|
1193
|
+
const r = c(v(Bn(e)));
|
|
1194
|
+
return oe.size >= zn && oe.clear(), oe.set(e, r), r;
|
|
1195
|
+
}
|
|
1196
|
+
function J(e, t, r, n, o, s) {
|
|
1197
|
+
return nt(e)({
|
|
1063
1198
|
$form: t,
|
|
1064
1199
|
$meta: r,
|
|
1065
1200
|
$errors: n,
|
|
1066
1201
|
$formIsInvalid: o,
|
|
1067
|
-
$log:
|
|
1202
|
+
$log: bn.log,
|
|
1068
1203
|
$fn: {},
|
|
1069
1204
|
...s
|
|
1070
1205
|
}) === !0;
|
|
1071
1206
|
}
|
|
1072
|
-
function
|
|
1207
|
+
function Bn(e) {
|
|
1073
1208
|
return e.replace(
|
|
1074
1209
|
/(\?\.|\.)(\d+)/g,
|
|
1075
|
-
(t, r, n, o) => r === "." &&
|
|
1210
|
+
(t, r, n, o) => r === "." && Gn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
|
|
1076
1211
|
);
|
|
1077
1212
|
}
|
|
1078
|
-
function
|
|
1213
|
+
function Gn(e, t) {
|
|
1079
1214
|
let r = t - 1, n = !1;
|
|
1080
1215
|
for (; r >= 0 && e[r] >= "0" && e[r] <= "9"; )
|
|
1081
1216
|
n = !0, r--;
|
|
@@ -1084,37 +1219,37 @@ function Fn(e, t) {
|
|
|
1084
1219
|
const o = e[r];
|
|
1085
1220
|
return n ? !/[\w$.\]]/.test(o) : !/[\w$)\]]/.test(o);
|
|
1086
1221
|
}
|
|
1087
|
-
const
|
|
1088
|
-
let
|
|
1089
|
-
if (!
|
|
1222
|
+
const Kn = (e) => (t, r) => {
|
|
1223
|
+
let n = t.formDef.states;
|
|
1224
|
+
if (!n || Object.keys(n).length === 0 || t.formHealth.status === "errored")
|
|
1090
1225
|
return t;
|
|
1091
|
-
const { $formIsInvalid:
|
|
1092
|
-
|
|
1093
|
-
let
|
|
1226
|
+
const { $formIsInvalid: o, $errors: s } = r ?? $e(t);
|
|
1227
|
+
n = xn(n);
|
|
1228
|
+
let i = [], u = { status: "ok" };
|
|
1094
1229
|
try {
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1097
|
-
let
|
|
1230
|
+
i = Object.keys(n).map((d) => {
|
|
1231
|
+
const l = n[d];
|
|
1232
|
+
let a;
|
|
1098
1233
|
try {
|
|
1099
|
-
|
|
1234
|
+
a = J(l, t.data, t.meta, s, o, {
|
|
1100
1235
|
$fn: e
|
|
1101
1236
|
});
|
|
1102
1237
|
} catch {
|
|
1103
|
-
|
|
1238
|
+
a = !1;
|
|
1104
1239
|
}
|
|
1105
|
-
return
|
|
1106
|
-
}).filter((
|
|
1107
|
-
} catch (
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1240
|
+
return a === !0 ? d : void 0;
|
|
1241
|
+
}).filter((d) => d !== void 0);
|
|
1242
|
+
} catch (d) {
|
|
1243
|
+
const l = d, a = F.calculateCurrentStateError;
|
|
1244
|
+
u = {
|
|
1110
1245
|
status: "errored",
|
|
1111
|
-
message: `[${
|
|
1112
|
-
code:
|
|
1246
|
+
message: `[${a}] ${l.message}`,
|
|
1247
|
+
code: a
|
|
1113
1248
|
};
|
|
1114
1249
|
}
|
|
1115
|
-
return { ...t, currentStates:
|
|
1250
|
+
return { ...t, currentStates: i, formHealth: u };
|
|
1116
1251
|
};
|
|
1117
|
-
function
|
|
1252
|
+
function xn(e) {
|
|
1118
1253
|
const t = {};
|
|
1119
1254
|
function r(n) {
|
|
1120
1255
|
const o = n.split(":"), s = [];
|
|
@@ -1130,33 +1265,45 @@ function jn(e) {
|
|
|
1130
1265
|
}
|
|
1131
1266
|
return t;
|
|
1132
1267
|
}
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1268
|
+
const Z = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e;
|
|
1269
|
+
function vt(e) {
|
|
1270
|
+
if (typeof e != "object" || e === null)
|
|
1271
|
+
return !1;
|
|
1272
|
+
const t = Object.getPrototypeOf(e);
|
|
1273
|
+
return t === Object.prototype || t === null;
|
|
1274
|
+
}
|
|
1275
|
+
function me(e, t) {
|
|
1276
|
+
if (e === t)
|
|
1277
|
+
return !0;
|
|
1278
|
+
if (Array.isArray(e) && Array.isArray(t))
|
|
1279
|
+
return e.length === t.length && e.every((r, n) => me(r, t[n]));
|
|
1280
|
+
if (vt(e) && vt(t)) {
|
|
1281
|
+
const r = Object.keys(e);
|
|
1282
|
+
return r.length !== Object.keys(t).length ? !1 : r.every((n) => n in t && me(e[n], t[n]));
|
|
1283
|
+
}
|
|
1284
|
+
return !1;
|
|
1285
|
+
}
|
|
1286
|
+
const Xn = (e) => (t, r) => {
|
|
1287
|
+
const { $formIsInvalid: n, $errors: o } = r ?? $e(t);
|
|
1135
1288
|
return {
|
|
1136
1289
|
...t,
|
|
1137
|
-
widgetFlags:
|
|
1290
|
+
widgetFlags: Jn(t, o, n, e)
|
|
1138
1291
|
};
|
|
1139
1292
|
};
|
|
1140
|
-
function
|
|
1141
|
-
const o =
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
});
|
|
1149
|
-
return u.uid = i.uid, u;
|
|
1150
|
-
}
|
|
1151
|
-
return i;
|
|
1152
|
-
}), s = Object.values(e.materializedRepeaterWidgets);
|
|
1153
|
-
return [...o, ...s].filter((i) => !!(i.include && ("in" in i.include || "when" in i.include) || i.exclude && ("from" in i.exclude || "when" in i.exclude) || (D(i) || fe(i)) && re(i.disabled) || D(i) && re(i.readonly))).reduce(
|
|
1293
|
+
function Jn(e, t, r, n) {
|
|
1294
|
+
const o = [];
|
|
1295
|
+
for (const [i, u] of Object.entries(e.resolvedSources))
|
|
1296
|
+
if (W(u)) {
|
|
1297
|
+
const d = At(i, u, e);
|
|
1298
|
+
$t(d) && o.push(d);
|
|
1299
|
+
} else $t(u) && o.push(At(i, u, e));
|
|
1300
|
+
const s = o.reduce(
|
|
1154
1301
|
(i, u) => {
|
|
1155
1302
|
i[u.uid] = i[u.uid] || {};
|
|
1156
|
-
const
|
|
1303
|
+
const d = e.repeaterItemScopes[u.uid], l = d ? { $item: _(e.data, d.itemPath), $index: d.index, $fn: n } : { $fn: n };
|
|
1157
1304
|
return u.include && "in" in u.include ? i[u.uid].hidden = !u.include.in.some(
|
|
1158
|
-
(
|
|
1159
|
-
) : u.include && "when" in u.include && (i[u.uid].hidden = !
|
|
1305
|
+
(a) => e.currentStates.includes(a)
|
|
1306
|
+
) : u.include && "when" in u.include && (i[u.uid].hidden = !J(
|
|
1160
1307
|
u.include.when,
|
|
1161
1308
|
e.data,
|
|
1162
1309
|
e.meta,
|
|
@@ -1164,22 +1311,22 @@ function Nn(e, t, r, n) {
|
|
|
1164
1311
|
r,
|
|
1165
1312
|
l
|
|
1166
1313
|
)), u.exclude && "from" in u.exclude ? i[u.uid].hidden = u.exclude.from.some(
|
|
1167
|
-
(
|
|
1168
|
-
) : u.exclude && "when" in u.exclude && (i[u.uid].hidden =
|
|
1314
|
+
(a) => e.currentStates.includes(a)
|
|
1315
|
+
) : u.exclude && "when" in u.exclude && (i[u.uid].hidden = J(
|
|
1169
1316
|
u.exclude.when,
|
|
1170
1317
|
e.data,
|
|
1171
1318
|
e.meta,
|
|
1172
1319
|
t,
|
|
1173
1320
|
r,
|
|
1174
1321
|
l
|
|
1175
|
-
)), (
|
|
1322
|
+
)), (j(u) || ue(u)) && Z(u.disabled) && (i[u.uid].disabled = J(
|
|
1176
1323
|
u.disabled.when,
|
|
1177
1324
|
e.data,
|
|
1178
1325
|
e.meta,
|
|
1179
1326
|
t,
|
|
1180
1327
|
r,
|
|
1181
1328
|
l
|
|
1182
|
-
)),
|
|
1329
|
+
)), j(u) && Z(u.readonly) && (i[u.uid].readonly = J(
|
|
1183
1330
|
u.readonly.when,
|
|
1184
1331
|
e.data,
|
|
1185
1332
|
e.meta,
|
|
@@ -1190,119 +1337,171 @@ function Nn(e, t, r, n) {
|
|
|
1190
1337
|
},
|
|
1191
1338
|
{}
|
|
1192
1339
|
);
|
|
1340
|
+
return Qn(e, s), s;
|
|
1341
|
+
}
|
|
1342
|
+
function $t(e) {
|
|
1343
|
+
return !!(e.include && ("in" in e.include || "when" in e.include) || e.exclude && ("from" in e.exclude || "when" in e.exclude) || (j(e) || ue(e)) && Z(e.disabled) || j(e) && Z(e.readonly));
|
|
1344
|
+
}
|
|
1345
|
+
function Qn(e, t) {
|
|
1346
|
+
const r = Object.keys(t).filter((n) => t[n].hidden === !0);
|
|
1347
|
+
for (const n of r)
|
|
1348
|
+
nr(n, e, t);
|
|
1349
|
+
}
|
|
1350
|
+
function nr(e, t, r) {
|
|
1351
|
+
const n = t.resolvedSources[e];
|
|
1352
|
+
if (n !== void 0) {
|
|
1353
|
+
if (Se(n) || W(n) && n.path !== void 0) {
|
|
1354
|
+
const o = `${n.path}.`;
|
|
1355
|
+
for (const [s, i] of Object.entries(t.repeaterItemScopes))
|
|
1356
|
+
i.itemPath.startsWith(o) && St(s, r);
|
|
1357
|
+
}
|
|
1358
|
+
if (H(n)) {
|
|
1359
|
+
const o = te(e);
|
|
1360
|
+
for (const s of n.children) {
|
|
1361
|
+
const i = o.length > 0 ? Ge(s.uid, o) : s.uid;
|
|
1362
|
+
if (t.resolvedSources[i] === void 0)
|
|
1363
|
+
continue;
|
|
1364
|
+
const u = r[i]?.hidden === !0;
|
|
1365
|
+
St(i, r), u || nr(i, t, r);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
function St(e, t) {
|
|
1371
|
+
t[e] = t[e] || {}, t[e].hidden = !0;
|
|
1193
1372
|
}
|
|
1194
|
-
|
|
1373
|
+
function At(e, t, r) {
|
|
1374
|
+
const n = r.repeaterItemScopes[e];
|
|
1375
|
+
let o;
|
|
1376
|
+
W(t) ? (o = {
|
|
1377
|
+
...t({
|
|
1378
|
+
$form: r.data,
|
|
1379
|
+
$item: n ? _(r.data, n.itemPath) : void 0,
|
|
1380
|
+
$index: n?.index,
|
|
1381
|
+
errors: void 0,
|
|
1382
|
+
touched: void 0,
|
|
1383
|
+
translate: void 0
|
|
1384
|
+
})
|
|
1385
|
+
}, o.uid = e) : o = t;
|
|
1386
|
+
const s = te(e);
|
|
1387
|
+
return s.length > 0 && (o = Br(o, s)), o;
|
|
1388
|
+
}
|
|
1389
|
+
const or = (e, t) => (r, n) => {
|
|
1195
1390
|
try {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1391
|
+
const o = n ?? $e(r);
|
|
1392
|
+
return {
|
|
1393
|
+
...r,
|
|
1394
|
+
calculatedWidgets: qn(r, e, t, o)
|
|
1395
|
+
};
|
|
1396
|
+
} catch (o) {
|
|
1397
|
+
const s = o, i = s.code ?? F.calculateWidgetPropsError;
|
|
1199
1398
|
return {
|
|
1200
1399
|
...r,
|
|
1201
1400
|
formHealth: {
|
|
1202
1401
|
status: "errored",
|
|
1203
|
-
message: `[${
|
|
1204
|
-
code:
|
|
1402
|
+
message: `[${i}] ${s.message}`,
|
|
1403
|
+
code: i
|
|
1205
1404
|
}
|
|
1206
1405
|
};
|
|
1207
1406
|
}
|
|
1208
1407
|
};
|
|
1209
|
-
function
|
|
1210
|
-
const
|
|
1408
|
+
function qn(e, t, r, { $formIsInvalid: n, $errors: o }) {
|
|
1409
|
+
const s = yo(e, t, n, o, r), i = {};
|
|
1211
1410
|
for (const u of Object.keys(e.calculatedWidgets)) {
|
|
1212
1411
|
if (e.widgetFlags[u]?.hidden)
|
|
1213
1412
|
continue;
|
|
1214
|
-
const
|
|
1215
|
-
if (
|
|
1216
|
-
i[u] =
|
|
1413
|
+
const d = e.calculatedWidgets[u], l = d.source, a = e.repeaterItemScopes[u];
|
|
1414
|
+
if (W(l)) {
|
|
1415
|
+
i[u] = Zn(d, u, l, e, t, a);
|
|
1217
1416
|
continue;
|
|
1218
1417
|
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
}
|
|
1223
|
-
const m = f ? { ...s, $item: V(s.$form, f.itemPath), $index: f.index } : s;
|
|
1224
|
-
i[u] = Ln(
|
|
1225
|
-
c,
|
|
1418
|
+
const p = a ? { ...s, $item: _(s.$form, a.itemPath), $index: a.index } : s;
|
|
1419
|
+
i[u] = Yn(
|
|
1420
|
+
d,
|
|
1226
1421
|
l,
|
|
1227
1422
|
e,
|
|
1228
|
-
|
|
1423
|
+
p
|
|
1229
1424
|
);
|
|
1230
1425
|
}
|
|
1231
1426
|
return i;
|
|
1232
1427
|
}
|
|
1233
|
-
function
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1428
|
+
function Zn(e, t, r, n, o, s) {
|
|
1429
|
+
const i = {
|
|
1430
|
+
...r({
|
|
1431
|
+
$form: n.data,
|
|
1432
|
+
errors: r.path ? n.validations[r.path] : void 0,
|
|
1433
|
+
touched: r.path ? n.touchedControls[r.path] : void 0,
|
|
1434
|
+
translate: o.translate,
|
|
1435
|
+
$item: s ? _(n.data, s.itemPath) : void 0,
|
|
1436
|
+
$index: s?.index
|
|
1437
|
+
})
|
|
1438
|
+
};
|
|
1439
|
+
i.uid = t, r.path !== void 0 && (i.path = r.path);
|
|
1440
|
+
const u = n.widgetPropOverrides[t];
|
|
1441
|
+
return u !== void 0 && (i.props = { ...i.props, ...u }), e.current && me(e.current, i) ? e : { source: r, current: i };
|
|
1243
1442
|
}
|
|
1244
|
-
function
|
|
1245
|
-
const o = new
|
|
1246
|
-
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind),
|
|
1443
|
+
function Yn(e, t, r, n) {
|
|
1444
|
+
const o = new go(t, e.current);
|
|
1445
|
+
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), Cr(t) ? eo(o, n) : ue(t) ? to(o, n) : j(t) ? ro(o, n) : H(t) && no(o, n), oo(t, o, n, r), (ue(t) || j(t)) && so(t, o, n), H(t) && io(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
|
|
1247
1446
|
}
|
|
1248
|
-
function
|
|
1249
|
-
|
|
1447
|
+
function eo(e, t) {
|
|
1448
|
+
A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude");
|
|
1250
1449
|
}
|
|
1251
|
-
function
|
|
1252
|
-
|
|
1450
|
+
function to(e, t) {
|
|
1451
|
+
A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude"), A(e, t, "label"), A(e, t, "disabled"), A(e, t, "actionType");
|
|
1253
1452
|
}
|
|
1254
|
-
function
|
|
1255
|
-
|
|
1453
|
+
function ro(e, t) {
|
|
1454
|
+
A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude"), A(e, t, "label"), A(e, t, "disabled"), A(e, t, "readonly"), A(e, t, "validator"), A(e, t, "path"), A(e, t, "defaultValue");
|
|
1256
1455
|
}
|
|
1257
|
-
function
|
|
1258
|
-
|
|
1456
|
+
function no(e, t) {
|
|
1457
|
+
A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude");
|
|
1259
1458
|
}
|
|
1260
|
-
function
|
|
1459
|
+
function oo(e, t, r, n) {
|
|
1261
1460
|
const o = n.widgetPropOverrides[e.uid] ?? {}, s = { ...e.props ?? {}, ...o };
|
|
1262
|
-
for (const i of
|
|
1263
|
-
|
|
1461
|
+
for (const i of ur(Object.keys(s)))
|
|
1462
|
+
uo(t, r, i);
|
|
1264
1463
|
}
|
|
1265
|
-
function
|
|
1464
|
+
function so(e, t, r) {
|
|
1266
1465
|
const n = e.on ?? {};
|
|
1267
|
-
for (const o of
|
|
1268
|
-
|
|
1466
|
+
for (const o of ur(Object.keys(n)))
|
|
1467
|
+
co(t, r, o);
|
|
1269
1468
|
}
|
|
1270
|
-
function
|
|
1271
|
-
const n =
|
|
1469
|
+
function io(e, t, r) {
|
|
1470
|
+
const n = te(e.uid), o = $o(e.children, n, r.widgetFlags);
|
|
1272
1471
|
t.current.children = o;
|
|
1273
1472
|
const s = t.previous.children ?? [];
|
|
1274
|
-
s.length === o.length && o.every((u,
|
|
1473
|
+
s.length === o.length && o.every((u, d) => s[d] && s[d].uid === o[d].uid) || t.markChanged();
|
|
1275
1474
|
}
|
|
1276
|
-
function
|
|
1475
|
+
function A(e, t, r) {
|
|
1277
1476
|
const n = e.source;
|
|
1278
|
-
if (!
|
|
1477
|
+
if (!vo(n, r))
|
|
1279
1478
|
return;
|
|
1280
|
-
const o =
|
|
1479
|
+
const o = st(n, r, t.sortedStates);
|
|
1281
1480
|
let s;
|
|
1282
1481
|
switch (r) {
|
|
1283
1482
|
case "disabled":
|
|
1284
1483
|
case "readonly":
|
|
1285
|
-
s =
|
|
1484
|
+
s = fo(o, t, e.source.uid, r);
|
|
1286
1485
|
break;
|
|
1287
1486
|
case "defaultValue":
|
|
1288
1487
|
s = o;
|
|
1289
1488
|
break;
|
|
1290
1489
|
default:
|
|
1291
|
-
s =
|
|
1490
|
+
s = ir(o, t);
|
|
1292
1491
|
}
|
|
1293
1492
|
e.write(r, s);
|
|
1294
1493
|
}
|
|
1295
|
-
function
|
|
1296
|
-
const n = e.source.props, o =
|
|
1297
|
-
let s =
|
|
1494
|
+
function uo(e, t, r) {
|
|
1495
|
+
const n = e.source.props, o = st(n, r, t.sortedStates);
|
|
1496
|
+
let s = ir(o, t);
|
|
1298
1497
|
const i = t.widgetPropOverrides[e.source.uid]?.[r];
|
|
1299
1498
|
i !== void 0 && (s = i), e.write(`props.${r}`, s);
|
|
1300
1499
|
}
|
|
1301
|
-
function
|
|
1302
|
-
const n = e.source.on, o =
|
|
1303
|
-
e.write(`on.${r}`,
|
|
1500
|
+
function co(e, t, r) {
|
|
1501
|
+
const n = e.source.on, o = st(n, r, t.sortedStates);
|
|
1502
|
+
e.write(`on.${r}`, po(o, t));
|
|
1304
1503
|
}
|
|
1305
|
-
function
|
|
1504
|
+
function ot(e, t) {
|
|
1306
1505
|
return e({
|
|
1307
1506
|
$form: t.$form,
|
|
1308
1507
|
translate: t.localization.translate,
|
|
@@ -1310,15 +1509,14 @@ function it(e, t) {
|
|
|
1310
1509
|
$index: t.$index
|
|
1311
1510
|
});
|
|
1312
1511
|
}
|
|
1313
|
-
function
|
|
1314
|
-
return t.localization.translate(e.key,
|
|
1512
|
+
function lo(e, t) {
|
|
1513
|
+
return t.localization.translate(e.key, mo(e.params, t), e.default);
|
|
1315
1514
|
}
|
|
1316
|
-
const
|
|
1317
|
-
function
|
|
1318
|
-
return e.includes("{{") ? e.replace(
|
|
1319
|
-
const o = st(n.trim());
|
|
1515
|
+
const ao = /\{\{([^}]+)\}\}/g;
|
|
1516
|
+
function sr(e, t) {
|
|
1517
|
+
return e.includes("{{") ? e.replace(ao, (r, n) => {
|
|
1320
1518
|
try {
|
|
1321
|
-
const
|
|
1519
|
+
const o = nt(n.trim())({
|
|
1322
1520
|
$form: t.$form,
|
|
1323
1521
|
$meta: t.$meta,
|
|
1324
1522
|
$errors: t.$errors,
|
|
@@ -1327,23 +1525,23 @@ function bt(e, t) {
|
|
|
1327
1525
|
$index: t.$index,
|
|
1328
1526
|
$fn: t.$fn
|
|
1329
1527
|
});
|
|
1330
|
-
return
|
|
1331
|
-
} catch (
|
|
1332
|
-
const
|
|
1333
|
-
throw new
|
|
1528
|
+
return o == null ? "" : String(o);
|
|
1529
|
+
} catch (o) {
|
|
1530
|
+
const s = o instanceof Error ? o.message : String(o);
|
|
1531
|
+
throw new cr(`Failed to evaluate '{{${n.trim()}}}': ${s}`);
|
|
1334
1532
|
}
|
|
1335
1533
|
}) : e;
|
|
1336
1534
|
}
|
|
1337
|
-
function
|
|
1338
|
-
return typeof e == "function" ?
|
|
1535
|
+
function ir(e, t) {
|
|
1536
|
+
return typeof e == "function" ? ot(e, t) : Rr(e) ? lo(e, t) : typeof e == "string" ? sr(e, t) : e;
|
|
1339
1537
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return typeof e == "function" ?
|
|
1538
|
+
function fo(e, t, r, n) {
|
|
1539
|
+
return typeof e == "function" ? ot(e, t) : Z(e) ? t.widgetFlags[r]?.[n] : typeof e == "string" ? sr(e, t) : e;
|
|
1342
1540
|
}
|
|
1343
|
-
function
|
|
1344
|
-
return typeof e == "function" ?
|
|
1541
|
+
function po(e, t) {
|
|
1542
|
+
return typeof e == "function" ? ot(e, t) : e;
|
|
1345
1543
|
}
|
|
1346
|
-
function
|
|
1544
|
+
function st(e, t, r) {
|
|
1347
1545
|
if (e) {
|
|
1348
1546
|
for (const n of r) {
|
|
1349
1547
|
const o = e[`${t}.${n}`];
|
|
@@ -1353,15 +1551,15 @@ function ut(e, t, r) {
|
|
|
1353
1551
|
return e[t];
|
|
1354
1552
|
}
|
|
1355
1553
|
}
|
|
1356
|
-
function
|
|
1554
|
+
function ho(e) {
|
|
1357
1555
|
return e.startsWith("$form") || e.startsWith("$meta") || e.startsWith("$errors") || e.startsWith("$item") || e.startsWith("$index") || e.startsWith("$fn") || e === "$formIsInvalid";
|
|
1358
1556
|
}
|
|
1359
|
-
function
|
|
1557
|
+
function mo(e, t) {
|
|
1360
1558
|
return e && Object.keys(e).reduce((r, n) => {
|
|
1361
1559
|
const o = String(e[n]);
|
|
1362
|
-
if (
|
|
1560
|
+
if (ho(o))
|
|
1363
1561
|
try {
|
|
1364
|
-
const s =
|
|
1562
|
+
const s = nt(o)({
|
|
1365
1563
|
$form: t.$form,
|
|
1366
1564
|
$meta: t.$meta,
|
|
1367
1565
|
$errors: t.$errors,
|
|
@@ -1373,14 +1571,14 @@ function Yn(e, t) {
|
|
|
1373
1571
|
r[n] = s ?? o;
|
|
1374
1572
|
} catch (s) {
|
|
1375
1573
|
const i = s instanceof Error ? s.message : String(s);
|
|
1376
|
-
throw new
|
|
1574
|
+
throw new cr(`Failed to evaluate i18n param '${o}': ${i}`);
|
|
1377
1575
|
}
|
|
1378
1576
|
else
|
|
1379
1577
|
r[n] = o;
|
|
1380
1578
|
return r;
|
|
1381
1579
|
}, {});
|
|
1382
1580
|
}
|
|
1383
|
-
class
|
|
1581
|
+
class go {
|
|
1384
1582
|
constructor(t, r) {
|
|
1385
1583
|
this._changed = !1, this.source = t, this.previous = r, this.current = {};
|
|
1386
1584
|
}
|
|
@@ -1391,10 +1589,15 @@ class eo {
|
|
|
1391
1589
|
this._changed = !0;
|
|
1392
1590
|
}
|
|
1393
1591
|
write(t, r) {
|
|
1394
|
-
|
|
1592
|
+
const n = _(this.previous, t);
|
|
1593
|
+
if (me(n, r)) {
|
|
1594
|
+
We(this.current, t, n);
|
|
1595
|
+
return;
|
|
1596
|
+
}
|
|
1597
|
+
We(this.current, t, r), this._changed = !0;
|
|
1395
1598
|
}
|
|
1396
1599
|
}
|
|
1397
|
-
function
|
|
1600
|
+
function yo(e, t, r, n, o) {
|
|
1398
1601
|
return {
|
|
1399
1602
|
sortedStates: [...e.currentStates].sort((s, i) => i.length - s.length),
|
|
1400
1603
|
widgetPropOverrides: e.widgetPropOverrides,
|
|
@@ -1407,122 +1610,164 @@ function to(e, t, r, n, o) {
|
|
|
1407
1610
|
$fn: o
|
|
1408
1611
|
};
|
|
1409
1612
|
}
|
|
1410
|
-
function
|
|
1613
|
+
function vo(e, t) {
|
|
1411
1614
|
if (t in e)
|
|
1412
1615
|
return !0;
|
|
1413
1616
|
const r = `${t}.`;
|
|
1414
1617
|
return Object.keys(e).some((n) => n.startsWith(r));
|
|
1415
1618
|
}
|
|
1416
|
-
function
|
|
1619
|
+
function ur(e) {
|
|
1417
1620
|
return Array.from(new Set(e.map((t) => t.split(".")[0])));
|
|
1418
1621
|
}
|
|
1419
|
-
function
|
|
1622
|
+
function $o(e, t, r) {
|
|
1420
1623
|
const n = t.map((o) => `[${o}]`).join("");
|
|
1421
1624
|
return e.filter((o) => {
|
|
1422
1625
|
const s = o.uid + n, i = r[s];
|
|
1423
1626
|
return !i || i.hidden !== !0;
|
|
1424
1627
|
});
|
|
1425
1628
|
}
|
|
1426
|
-
|
|
1427
|
-
class xt extends Error {
|
|
1629
|
+
class cr extends Error {
|
|
1428
1630
|
constructor() {
|
|
1429
|
-
super(...arguments), this.code =
|
|
1631
|
+
super(...arguments), this.code = F.resolveStringInterpolationError, this.name = "StringInterpolationError";
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
const So = (e) => {
|
|
1635
|
+
const t = Ao(e.resolvedSources), r = se(
|
|
1636
|
+
e.widgetPropOverrides,
|
|
1637
|
+
(i) => i in e.resolvedSources
|
|
1638
|
+
), n = se(e.touchedControls, (i) => t.has(i)), o = se(e.validations, (i) => t.has(i)), s = se(
|
|
1639
|
+
e.injectedValidations,
|
|
1640
|
+
(i) => t.has(i)
|
|
1641
|
+
);
|
|
1642
|
+
return r === e.widgetPropOverrides && n === e.touchedControls && o === e.validations && s === e.injectedValidations ? e : { ...e, widgetPropOverrides: r, touchedControls: n, validations: o, injectedValidations: s };
|
|
1643
|
+
};
|
|
1644
|
+
function Ao(e) {
|
|
1645
|
+
const t = /* @__PURE__ */ new Set();
|
|
1646
|
+
for (const r of Object.values(e)) {
|
|
1647
|
+
const n = V(r);
|
|
1648
|
+
n !== void 0 && t.add(n);
|
|
1430
1649
|
}
|
|
1650
|
+
return t;
|
|
1431
1651
|
}
|
|
1432
|
-
|
|
1652
|
+
function se(e, t) {
|
|
1653
|
+
const r = Object.keys(e).filter(t);
|
|
1654
|
+
if (r.length === Object.keys(e).length)
|
|
1655
|
+
return e;
|
|
1656
|
+
const n = {};
|
|
1657
|
+
for (const o of r)
|
|
1658
|
+
n[o] = e[o];
|
|
1659
|
+
return n;
|
|
1660
|
+
}
|
|
1661
|
+
const Eo = (e) => {
|
|
1662
|
+
const t = Object.keys(e.resolvedSources), r = {};
|
|
1663
|
+
let n = t.length !== Object.keys(e.calculatedWidgets).length;
|
|
1664
|
+
for (const o of t) {
|
|
1665
|
+
const s = e.calculatedWidgets[o];
|
|
1666
|
+
s ? r[o] = s : (r[o] = {
|
|
1667
|
+
source: e.resolvedSources[o],
|
|
1668
|
+
current: {}
|
|
1669
|
+
}, n = !0);
|
|
1670
|
+
}
|
|
1671
|
+
return n ? { ...e, calculatedWidgets: r } : e;
|
|
1672
|
+
}, wo = ({ lang: e }, t) => {
|
|
1433
1673
|
const r = {
|
|
1434
|
-
...
|
|
1674
|
+
...Dt(e),
|
|
1435
1675
|
formName: t.payload.formName
|
|
1436
1676
|
};
|
|
1437
1677
|
let n = t.payload.formDef, o = { status: "ok" };
|
|
1438
1678
|
if (typeof n == "string") {
|
|
1439
1679
|
try {
|
|
1440
1680
|
n = JSON.parse(n);
|
|
1441
|
-
} catch (
|
|
1442
|
-
const
|
|
1681
|
+
} catch (a) {
|
|
1682
|
+
const p = a, g = F.initializeParseError;
|
|
1443
1683
|
o = {
|
|
1444
1684
|
status: "errored",
|
|
1445
|
-
message: `[${
|
|
1446
|
-
code:
|
|
1685
|
+
message: `[${g}] ${p.message}`,
|
|
1686
|
+
code: g
|
|
1447
1687
|
};
|
|
1448
1688
|
}
|
|
1449
1689
|
if (o.status === "errored")
|
|
1450
1690
|
return { ...r, formHealth: o };
|
|
1451
1691
|
}
|
|
1692
|
+
let s = n;
|
|
1452
1693
|
if (Array.isArray(n.form)) {
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1694
|
+
const a = n.form;
|
|
1695
|
+
s = {
|
|
1696
|
+
...n,
|
|
1697
|
+
form: {
|
|
1698
|
+
uid: "",
|
|
1699
|
+
type: "flex",
|
|
1700
|
+
kind: "layout",
|
|
1701
|
+
children: a
|
|
1702
|
+
}
|
|
1459
1703
|
};
|
|
1460
1704
|
}
|
|
1461
|
-
const
|
|
1462
|
-
if (
|
|
1705
|
+
const i = Ft.decode(s);
|
|
1706
|
+
if (i.isOk()) {
|
|
1463
1707
|
o = { status: "ok" };
|
|
1464
|
-
let
|
|
1708
|
+
let a = {};
|
|
1465
1709
|
try {
|
|
1466
|
-
|
|
1467
|
-
(
|
|
1468
|
-
const
|
|
1469
|
-
if (
|
|
1470
|
-
throw { existingWidget:
|
|
1471
|
-
return
|
|
1710
|
+
a = Be([i.value.form]).reduce(
|
|
1711
|
+
(p, g) => {
|
|
1712
|
+
const I = g.uid;
|
|
1713
|
+
if (p[I])
|
|
1714
|
+
throw { existingWidget: p[I], newWidget: g };
|
|
1715
|
+
return p[I] = g, p;
|
|
1472
1716
|
},
|
|
1473
1717
|
{}
|
|
1474
1718
|
);
|
|
1475
|
-
} catch (
|
|
1476
|
-
o =
|
|
1719
|
+
} catch (p) {
|
|
1720
|
+
o = Io(p.existingWidget, p.newWidget), a = {};
|
|
1477
1721
|
}
|
|
1478
|
-
return
|
|
1722
|
+
return ko(a, i.value.states), {
|
|
1479
1723
|
...r,
|
|
1480
|
-
formDef:
|
|
1481
|
-
flatForm:
|
|
1724
|
+
formDef: i.value,
|
|
1725
|
+
flatForm: a,
|
|
1726
|
+
...Ne(a, {}),
|
|
1482
1727
|
formHealth: o
|
|
1483
1728
|
};
|
|
1484
1729
|
}
|
|
1485
|
-
const
|
|
1486
|
-
if (
|
|
1487
|
-
return { ...r, formHealth:
|
|
1488
|
-
const
|
|
1730
|
+
const u = Co(n);
|
|
1731
|
+
if (u)
|
|
1732
|
+
return { ...r, formHealth: u };
|
|
1733
|
+
const d = F.initializeUnknownError, l = i.issues.map((a) => `${a.path.length > 0 ? kt(a.path) : "root"}: ${a.message}`).join("; ");
|
|
1489
1734
|
return {
|
|
1490
1735
|
...r,
|
|
1491
1736
|
formHealth: {
|
|
1492
1737
|
status: "errored",
|
|
1493
|
-
message: `[${
|
|
1494
|
-
code:
|
|
1738
|
+
message: `[${d}] ${l}`,
|
|
1739
|
+
code: d
|
|
1495
1740
|
}
|
|
1496
1741
|
};
|
|
1497
1742
|
};
|
|
1498
|
-
function
|
|
1743
|
+
function dr(e, t) {
|
|
1499
1744
|
return { status: "errored", code: e, message: `[${e}] ${t}` };
|
|
1500
1745
|
}
|
|
1501
|
-
function
|
|
1746
|
+
function Oo() {
|
|
1502
1747
|
return "Malformed form definition. Pass it directly as formDef - `config={{ formDef: { states, form: [...] } }}`. Do NOT wrap it in an extra `{ form: ... }`.";
|
|
1503
1748
|
}
|
|
1504
|
-
function
|
|
1749
|
+
function Co(e) {
|
|
1505
1750
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1506
1751
|
return null;
|
|
1507
1752
|
const t = e.form;
|
|
1508
|
-
return t && typeof t == "object" && !Array.isArray(t) && !
|
|
1753
|
+
return t && typeof t == "object" && !Array.isArray(t) && !H(t) ? dr(F.initializeMalformedFormShapeError, Oo()) : null;
|
|
1509
1754
|
}
|
|
1510
|
-
function
|
|
1511
|
-
const r = (o) =>
|
|
1512
|
-
return
|
|
1755
|
+
function Io(e, t) {
|
|
1756
|
+
const r = (o) => j(o) ? ` at "${o.path}"` : "", n = `Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`;
|
|
1757
|
+
return dr(F.initializeUidCollisionError, n);
|
|
1513
1758
|
}
|
|
1514
|
-
function
|
|
1759
|
+
function ko(e, t) {
|
|
1515
1760
|
const r = new Set(Object.keys(t ?? {})), n = /* @__PURE__ */ new Map();
|
|
1516
1761
|
for (const s of Object.values(e)) {
|
|
1517
1762
|
const i = [], u = s.include;
|
|
1518
1763
|
u && Array.isArray(u.in) && i.push(...u.in);
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1764
|
+
const d = s.exclude;
|
|
1765
|
+
d && Array.isArray(d.from) && i.push(...d.from);
|
|
1521
1766
|
for (const l of i) {
|
|
1522
1767
|
if (r.has(l))
|
|
1523
1768
|
continue;
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1769
|
+
const a = n.get(l) ?? [];
|
|
1770
|
+
a.push(s.uid || "(unknown)"), n.set(l, a);
|
|
1526
1771
|
}
|
|
1527
1772
|
}
|
|
1528
1773
|
if (n.size === 0)
|
|
@@ -1533,7 +1778,7 @@ function co(e, t) {
|
|
|
1533
1778
|
`[GolemUI] include/exclude references undefined state "${s}" (on ${i.join(", ")}); these widgets will stay hidden. Declared states: ${o}. Fix: declare "${s}" in formConfig.states, or correct the name.`
|
|
1534
1779
|
);
|
|
1535
1780
|
}
|
|
1536
|
-
function
|
|
1781
|
+
function jo(e, t) {
|
|
1537
1782
|
const { path: r, issues: n } = t.payload, o = n?.length ? {
|
|
1538
1783
|
touched: !0,
|
|
1539
1784
|
touchedControls: { ...e.touchedControls, [r]: !0 }
|
|
@@ -1547,177 +1792,66 @@ function lo(e, t) {
|
|
|
1547
1792
|
}
|
|
1548
1793
|
};
|
|
1549
1794
|
}
|
|
1550
|
-
|
|
1551
|
-
const r =
|
|
1552
|
-
if (
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
}
|
|
1556
|
-
return D(e) ? {
|
|
1557
|
-
...e,
|
|
1558
|
-
uid: r,
|
|
1559
|
-
path: $t(e.path, t)
|
|
1560
|
-
} : {
|
|
1561
|
-
...e,
|
|
1562
|
-
uid: r
|
|
1563
|
-
};
|
|
1564
|
-
}
|
|
1565
|
-
function Zt(e, t) {
|
|
1566
|
-
if (t.length === 0)
|
|
1567
|
-
throw new Error("Repeater indexes cannot be an empty array");
|
|
1568
|
-
const r = t.reduce((n, o) => `${n}[${o}]`, "");
|
|
1569
|
-
return `${e}${r}`;
|
|
1570
|
-
}
|
|
1571
|
-
function $t(e, t) {
|
|
1572
|
-
if (t.length === 0)
|
|
1573
|
-
throw new Error("Repeater indexes cannot be an empty array");
|
|
1574
|
-
const r = "items", n = e.split(`.${r}`), o = n.length - 1;
|
|
1575
|
-
if (o !== t.length)
|
|
1576
|
-
throw new Error(
|
|
1577
|
-
`Path contains ${o} '${r}' occurrences, but ${t.length} indexes were provided.`
|
|
1578
|
-
);
|
|
1579
|
-
return n.reduce((s, i, u) => u === 0 ? i : `${s}.${t[u - 1]}${i}`);
|
|
1580
|
-
}
|
|
1581
|
-
function ao(e, t) {
|
|
1582
|
-
let r = 0;
|
|
1583
|
-
return e.replace(/\.items(\??)\./g, (n, o) => {
|
|
1584
|
-
const s = t[r++];
|
|
1585
|
-
return s === void 0 ? n : `.${s}${o}.`;
|
|
1586
|
-
});
|
|
1587
|
-
}
|
|
1588
|
-
const fo = ["include", "exclude", "disabled", "readonly"];
|
|
1589
|
-
function po(e, t) {
|
|
1590
|
-
const r = { ...e };
|
|
1591
|
-
for (const n of fo) {
|
|
1592
|
-
const o = r[n];
|
|
1593
|
-
ho(o) && (r[n] = {
|
|
1594
|
-
...o,
|
|
1595
|
-
when: ao(o.when, t)
|
|
1596
|
-
});
|
|
1597
|
-
}
|
|
1598
|
-
return r;
|
|
1599
|
-
}
|
|
1600
|
-
function ho(e) {
|
|
1601
|
-
return e !== null && typeof e == "object" && "when" in e && typeof e.when == "string";
|
|
1602
|
-
}
|
|
1603
|
-
const _ = (e) => {
|
|
1604
|
-
const t = {}, r = {}, n = Object.values(e.flatForm).filter(
|
|
1605
|
-
(o) => !G(o) && o.type === "repeater"
|
|
1606
|
-
);
|
|
1607
|
-
for (const o of n)
|
|
1608
|
-
Yt(e, o, [], t, r);
|
|
1609
|
-
return { ...e, repeaterItemScopes: t, materializedRepeaterWidgets: r };
|
|
1610
|
-
};
|
|
1611
|
-
function Yt(e, t, r, n, o) {
|
|
1612
|
-
const s = t.props.template, i = V(e.data, t.path);
|
|
1613
|
-
Array.isArray(i) && i.forEach((u, c) => {
|
|
1614
|
-
const l = [...r, c], f = { itemPath: `${t.path}.${c}`, index: c };
|
|
1615
|
-
be([s]).forEach((m) => {
|
|
1616
|
-
let h;
|
|
1617
|
-
if (G(m) ? (h = m({
|
|
1618
|
-
$form: e.data,
|
|
1619
|
-
$item: u,
|
|
1620
|
-
$index: c,
|
|
1621
|
-
errors: void 0,
|
|
1622
|
-
touched: void 0,
|
|
1623
|
-
translate: void 0
|
|
1624
|
-
}), h.uid = m.uid) : h = m, h.type === "repeater") {
|
|
1625
|
-
const X = yt(
|
|
1626
|
-
h,
|
|
1627
|
-
l
|
|
1628
|
-
);
|
|
1629
|
-
n[Zt(h.uid, l)] = f, Yt(e, X, l, n, o);
|
|
1630
|
-
return;
|
|
1631
|
-
}
|
|
1632
|
-
const w = po(
|
|
1633
|
-
yt(h, l),
|
|
1634
|
-
l
|
|
1635
|
-
);
|
|
1636
|
-
n[w.uid] = f, o[w.uid] = w;
|
|
1637
|
-
});
|
|
1638
|
-
});
|
|
1639
|
-
}
|
|
1640
|
-
const mo = (e, { payload: t }) => {
|
|
1641
|
-
let r;
|
|
1642
|
-
if ("path" in t) {
|
|
1643
|
-
if (r = Object.values(e.calculatedWidgets).find(
|
|
1644
|
-
({ source: s }) => D(s) && s.path === t.path
|
|
1645
|
-
), !r)
|
|
1646
|
-
return console.warn(`Input with path "${t.path}" not found`), e;
|
|
1647
|
-
} else if (r = e.calculatedWidgets[t.uid], !r)
|
|
1648
|
-
return console.warn(`Widget with uid "${t.uid}" not found`), e;
|
|
1649
|
-
const n = r.source.uid, o = e.widgetPropOverrides[n] || {};
|
|
1795
|
+
const Po = (e, { payload: t }) => {
|
|
1796
|
+
const r = "path" in t ? Do(e, t.path) : Fo(e, t.uid);
|
|
1797
|
+
if (r === void 0)
|
|
1798
|
+
return e;
|
|
1799
|
+
const n = e.widgetPropOverrides[r] || {};
|
|
1650
1800
|
return {
|
|
1651
1801
|
...e,
|
|
1652
1802
|
widgetPropOverrides: {
|
|
1653
1803
|
...e.widgetPropOverrides,
|
|
1654
|
-
[
|
|
1804
|
+
[r]: { ...n, [t.prop]: t.value }
|
|
1655
1805
|
}
|
|
1656
1806
|
};
|
|
1657
1807
|
};
|
|
1658
|
-
function
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1808
|
+
function Fo(e, t) {
|
|
1809
|
+
if (t in e.resolvedSources)
|
|
1810
|
+
return t;
|
|
1811
|
+
console.warn(`Widget with uid "${t}" not found`);
|
|
1812
|
+
}
|
|
1813
|
+
function Do(e, t) {
|
|
1814
|
+
const r = Object.values(e.calculatedWidgets).find(
|
|
1815
|
+
({ source: o, current: s }) => (V(s) ?? V(o)) === t
|
|
1665
1816
|
);
|
|
1817
|
+
if (r)
|
|
1818
|
+
return r.source.uid;
|
|
1819
|
+
const n = Object.keys(e.resolvedSources).find(
|
|
1820
|
+
(o) => V(e.resolvedSources[o]) === t
|
|
1821
|
+
);
|
|
1822
|
+
if (n !== void 0)
|
|
1823
|
+
return n;
|
|
1824
|
+
console.warn(`Input with path "${t}" not found`);
|
|
1666
1825
|
}
|
|
1667
|
-
const
|
|
1668
|
-
...t,
|
|
1669
|
-
widgetFlags: {
|
|
1670
|
-
...Ie(t.widgetFlags, e.payload.uid)
|
|
1671
|
-
}
|
|
1672
|
-
}), $o = (e) => (t) => ({
|
|
1673
|
-
...t,
|
|
1674
|
-
// TODO: has this already been removed in calculate-widget-props??? Do we need this at all?
|
|
1675
|
-
calculatedWidgets: {
|
|
1676
|
-
...Ie(t.calculatedWidgets, e.payload.uid)
|
|
1677
|
-
}
|
|
1678
|
-
}), Ao = (e) => (t) => ({
|
|
1679
|
-
...t,
|
|
1680
|
-
widgetPropOverrides: {
|
|
1681
|
-
...Ie(t.widgetPropOverrides, e.payload.uid)
|
|
1682
|
-
}
|
|
1683
|
-
}), So = (e) => (t) => ({
|
|
1684
|
-
...t,
|
|
1685
|
-
touchedControls: P(t.touchedControls, (r) => {
|
|
1686
|
-
const n = t.flatForm[e.payload.uid];
|
|
1687
|
-
return n && D(n) ? Ie(r, n.path) : r;
|
|
1688
|
-
})
|
|
1689
|
-
}), Eo = (e, t) => ({
|
|
1826
|
+
const Wo = (e, t) => ({
|
|
1690
1827
|
...e,
|
|
1691
1828
|
data: { ...t.payload.data }
|
|
1692
|
-
}),
|
|
1829
|
+
}), No = (e, t) => ({
|
|
1693
1830
|
...e,
|
|
1694
1831
|
formHealth: t.payload.formHealth
|
|
1695
|
-
}),
|
|
1832
|
+
}), To = (e, t) => ({
|
|
1696
1833
|
...e,
|
|
1697
1834
|
lang: t.payload.lang
|
|
1698
|
-
}),
|
|
1835
|
+
}), Vo = (e, t) => ({
|
|
1699
1836
|
...e,
|
|
1700
1837
|
meta: { ...t.payload.meta }
|
|
1701
|
-
}),
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
} : e;
|
|
1707
|
-
}, er = /* @__PURE__ */ Symbol("filterMap.skip");
|
|
1708
|
-
function Oo(e, t) {
|
|
1838
|
+
}), Ro = (e, t) => ({
|
|
1839
|
+
...e,
|
|
1840
|
+
data: Wt(e.data, t.payload.path, t.payload.data)
|
|
1841
|
+
}), lr = /* @__PURE__ */ Symbol("filterMap.skip");
|
|
1842
|
+
function _o(e, t) {
|
|
1709
1843
|
const r = [];
|
|
1710
1844
|
for (let n = 0; n < e.length; n++) {
|
|
1711
1845
|
const o = t(e[n], n, e);
|
|
1712
|
-
o !==
|
|
1846
|
+
o !== lr && r.push(o);
|
|
1713
1847
|
}
|
|
1714
1848
|
return r;
|
|
1715
1849
|
}
|
|
1716
|
-
function
|
|
1850
|
+
function ls(e, t, r) {
|
|
1717
1851
|
for (let n = 0; n < e.length; n++)
|
|
1718
1852
|
t(e[n], n, e) && r(e[n], n, e);
|
|
1719
1853
|
}
|
|
1720
|
-
function
|
|
1854
|
+
function Lo(e, t, r) {
|
|
1721
1855
|
if (e.length !== t.length)
|
|
1722
1856
|
return !1;
|
|
1723
1857
|
for (let n = 0; n < e.length; n++)
|
|
@@ -1725,243 +1859,208 @@ function Do(e, t, r) {
|
|
|
1725
1859
|
return !1;
|
|
1726
1860
|
return !0;
|
|
1727
1861
|
}
|
|
1728
|
-
const
|
|
1729
|
-
const n =
|
|
1862
|
+
const Mo = (e, t) => (r) => {
|
|
1863
|
+
const n = _o(
|
|
1730
1864
|
Object.values(r.calculatedWidgets),
|
|
1731
|
-
({ current: s }) =>
|
|
1865
|
+
({ current: s }) => j(s) ? s : lr
|
|
1732
1866
|
), o = r.validations;
|
|
1733
1867
|
return {
|
|
1734
1868
|
...r,
|
|
1735
1869
|
validations: n.reduce(
|
|
1736
1870
|
(s, i) => {
|
|
1737
1871
|
if (s[i.path] = null, i.validator) {
|
|
1738
|
-
const u = e(i.validator, t),
|
|
1872
|
+
const u = e(i.validator, t), d = _(r.data, i.path), l = gr(
|
|
1739
1873
|
u,
|
|
1740
|
-
|
|
1874
|
+
d
|
|
1741
1875
|
);
|
|
1742
|
-
s[i.path] =
|
|
1876
|
+
s[i.path] = yr(l) ? null : l.issues.map((a) => a.message);
|
|
1743
1877
|
}
|
|
1744
|
-
return Array.isArray(s[i.path]) && Array.isArray(o[i.path]) &&
|
|
1878
|
+
return Array.isArray(s[i.path]) && Array.isArray(o[i.path]) && Lo(
|
|
1745
1879
|
s[i.path],
|
|
1746
1880
|
o[i.path],
|
|
1747
|
-
(u,
|
|
1881
|
+
(u, d) => u === d
|
|
1748
1882
|
) && (s[i.path] = o[i.path]), s;
|
|
1749
1883
|
},
|
|
1750
1884
|
{}
|
|
1751
1885
|
)
|
|
1752
1886
|
};
|
|
1753
|
-
},
|
|
1887
|
+
}, Uo = ({
|
|
1754
1888
|
validators: e,
|
|
1755
1889
|
validateOn: t,
|
|
1756
1890
|
localization: r,
|
|
1757
1891
|
functions: n
|
|
1758
1892
|
}) => {
|
|
1759
|
-
const o =
|
|
1760
|
-
return (
|
|
1761
|
-
switch (
|
|
1893
|
+
const o = zo(r, n), s = Mo(e, r), i = or(r, n), u = (l) => Et(l, o, s, !1), d = (l) => Et(l, o, s, !0);
|
|
1894
|
+
return (l, a) => {
|
|
1895
|
+
switch (a.type) {
|
|
1762
1896
|
case "INITIALIZE":
|
|
1763
|
-
return
|
|
1897
|
+
return wo(l, a);
|
|
1764
1898
|
case "SET_DATA":
|
|
1765
|
-
return
|
|
1766
|
-
Eo(u, c),
|
|
1767
|
-
o,
|
|
1768
|
-
_,
|
|
1769
|
-
s,
|
|
1770
|
-
i
|
|
1771
|
-
);
|
|
1899
|
+
return u(Wo(l, a));
|
|
1772
1900
|
case "SET_META":
|
|
1773
|
-
return
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
_,
|
|
1777
|
-
s,
|
|
1778
|
-
i
|
|
1779
|
-
);
|
|
1901
|
+
return u(Vo(l, a));
|
|
1902
|
+
case "SET_WIDGET_DATA":
|
|
1903
|
+
return u(Ro(l, a));
|
|
1780
1904
|
case "SET_LANGUAGE":
|
|
1781
|
-
return
|
|
1782
|
-
case "
|
|
1783
|
-
const
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
Y(ee, i)
|
|
1789
|
-
);
|
|
1790
|
-
return ee(l) && l.allControlsValidated ? P(
|
|
1791
|
-
l,
|
|
1792
|
-
le(e, r),
|
|
1793
|
-
o,
|
|
1794
|
-
_,
|
|
1795
|
-
s,
|
|
1796
|
-
i,
|
|
1797
|
-
Fe
|
|
1798
|
-
) : l;
|
|
1905
|
+
return i(To(l, a));
|
|
1906
|
+
case "OVERRIDE_WIDGET_PROP": {
|
|
1907
|
+
const p = Po(l, a);
|
|
1908
|
+
if (p === l)
|
|
1909
|
+
return l;
|
|
1910
|
+
const g = u(p);
|
|
1911
|
+
return xo(g, a) ? s(g) : g;
|
|
1799
1912
|
}
|
|
1800
|
-
case "REMOVE_WIDGET":
|
|
1801
|
-
return P(
|
|
1802
|
-
go(u, c),
|
|
1803
|
-
o,
|
|
1804
|
-
_,
|
|
1805
|
-
s,
|
|
1806
|
-
i
|
|
1807
|
-
);
|
|
1808
|
-
case "SET_WIDGET_INITIAL_DATA":
|
|
1809
|
-
case "SET_WIDGET_DATA":
|
|
1810
|
-
return P(
|
|
1811
|
-
wo(u, c),
|
|
1812
|
-
o,
|
|
1813
|
-
_,
|
|
1814
|
-
s,
|
|
1815
|
-
i
|
|
1816
|
-
);
|
|
1817
|
-
case "OVERRIDE_WIDGET_PROP":
|
|
1818
|
-
return P(
|
|
1819
|
-
mo(u, c),
|
|
1820
|
-
o,
|
|
1821
|
-
_,
|
|
1822
|
-
s,
|
|
1823
|
-
i,
|
|
1824
|
-
// Apply validation here because this action can be dispatched from the form's event handlers callback
|
|
1825
|
-
// Apply only when the action is related to an input
|
|
1826
|
-
Y(
|
|
1827
|
-
(l) => {
|
|
1828
|
-
let f = !1, m = "";
|
|
1829
|
-
"path" in c.payload ? (f = !0, m = c.payload.path) : D(l.calculatedWidgets[c.payload.uid].current) && (f = !0, m = l.calculatedWidgets[c.payload.uid].current.path);
|
|
1830
|
-
const h = f && l.touchedControls[m];
|
|
1831
|
-
return l.touched && h;
|
|
1832
|
-
},
|
|
1833
|
-
le(e, r)
|
|
1834
|
-
)
|
|
1835
|
-
);
|
|
1836
1913
|
case "SET_FORM_HEALTH":
|
|
1837
|
-
return
|
|
1914
|
+
return No(l, a);
|
|
1838
1915
|
case "VALIDATE_ALL":
|
|
1839
|
-
return
|
|
1840
|
-
{
|
|
1841
|
-
...u,
|
|
1842
|
-
touched: !0,
|
|
1843
|
-
allControlsValidated: !0,
|
|
1844
|
-
touchedControls: Object.keys(u.calculatedWidgets).reduce(
|
|
1845
|
-
(l, f) => {
|
|
1846
|
-
const m = u.calculatedWidgets[f].source;
|
|
1847
|
-
return D(m) && (l[m.path] = !0), l;
|
|
1848
|
-
},
|
|
1849
|
-
{}
|
|
1850
|
-
)
|
|
1851
|
-
},
|
|
1852
|
-
le(e, r),
|
|
1853
|
-
// This handles $errors and $formIsValid expressions variables
|
|
1854
|
-
o,
|
|
1855
|
-
_,
|
|
1856
|
-
s,
|
|
1857
|
-
i,
|
|
1858
|
-
Fe
|
|
1859
|
-
);
|
|
1916
|
+
return d(s(Go(l)));
|
|
1860
1917
|
case "ATTEMPT_VALIDATION": {
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
// This handles $errors and $formIsValid expressions variables
|
|
1870
|
-
o,
|
|
1871
|
-
_,
|
|
1872
|
-
s,
|
|
1873
|
-
i,
|
|
1874
|
-
// TODO: extract this into a separate function
|
|
1875
|
-
// When the widget is a Widget Function, we propagate the validation result immediately
|
|
1876
|
-
(h) => {
|
|
1877
|
-
const w = c.payload.uid, X = h.calculatedWidgets[w], dt = X.source;
|
|
1878
|
-
if (G(dt)) {
|
|
1879
|
-
const Oe = h.repeaterItemScopes[w], nr = dt({
|
|
1880
|
-
$form: h.data,
|
|
1881
|
-
errors: h.validations[f],
|
|
1882
|
-
touched: !0,
|
|
1883
|
-
translate: r.translate,
|
|
1884
|
-
$item: Oe ? V(h.data, Oe.itemPath) : void 0,
|
|
1885
|
-
$index: Oe?.index
|
|
1886
|
-
});
|
|
1887
|
-
return {
|
|
1888
|
-
...h,
|
|
1889
|
-
calculatedWidgets: {
|
|
1890
|
-
...h.calculatedWidgets,
|
|
1891
|
-
[w]: {
|
|
1892
|
-
source: X.source,
|
|
1893
|
-
current: nr
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
};
|
|
1897
|
-
}
|
|
1898
|
-
return h;
|
|
1899
|
-
},
|
|
1900
|
-
Fe
|
|
1901
|
-
) : u;
|
|
1918
|
+
if (!Ko(t, a.payload.reason))
|
|
1919
|
+
return l;
|
|
1920
|
+
const p = {
|
|
1921
|
+
...l,
|
|
1922
|
+
touched: !0,
|
|
1923
|
+
touchedControls: { ...l.touchedControls, [a.payload.path]: !0 }
|
|
1924
|
+
};
|
|
1925
|
+
return d(s(p));
|
|
1902
1926
|
}
|
|
1903
1927
|
case "INJECT_VALIDATION_ISSUES":
|
|
1904
|
-
return
|
|
1928
|
+
return jo(l, a);
|
|
1905
1929
|
default:
|
|
1906
|
-
return
|
|
1930
|
+
return Lr(a);
|
|
1907
1931
|
}
|
|
1908
1932
|
};
|
|
1909
|
-
},
|
|
1910
|
-
|
|
1933
|
+
}, Ho = /* @__PURE__ */ new Set([
|
|
1934
|
+
F.calculateCurrentStateError,
|
|
1935
|
+
F.calculateWidgetFlagsError,
|
|
1936
|
+
F.calculateWidgetPropsError,
|
|
1937
|
+
F.resolveStringInterpolationError
|
|
1938
|
+
]), bo = (e) => e.formHealth.status === "errored" && !Ho.has(e.formHealth.code);
|
|
1939
|
+
function zo(e, t) {
|
|
1940
|
+
const r = Kn(t), n = Xn(t), o = or(e, t);
|
|
1941
|
+
return function(i) {
|
|
1942
|
+
if (bo(i))
|
|
1943
|
+
return i;
|
|
1944
|
+
const u = (d) => ({ ...i, formHealth: d });
|
|
1945
|
+
try {
|
|
1946
|
+
let d = i.formHealth.status === "ok" ? i : { ...i, formHealth: { status: "ok" } };
|
|
1947
|
+
d = Kr(d), d = So(d);
|
|
1948
|
+
const l = $e(d);
|
|
1949
|
+
return d = r(d, l), d.formHealth.status !== "ok" ? u(d.formHealth) : (d = n(d, l), d = Eo(d), d = o(d, l), d.formHealth.status === "ok" ? d : u(d.formHealth));
|
|
1950
|
+
} catch (d) {
|
|
1951
|
+
const l = F.calculateWidgetFlagsError;
|
|
1952
|
+
return u({
|
|
1953
|
+
status: "errored",
|
|
1954
|
+
code: l,
|
|
1955
|
+
message: `[${l}] ${d.message}`
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
function Et(e, t, r, n) {
|
|
1961
|
+
const o = (a) => n ? wt(a) : a, s = e.resolvedSources, i = e.widgetFlags;
|
|
1962
|
+
let u = t(e);
|
|
1963
|
+
if (!u.allControlsValidated || u.formHealth.status !== "ok")
|
|
1964
|
+
return o(u);
|
|
1965
|
+
const d = Bo(u, s, i);
|
|
1966
|
+
if (d.length === 0)
|
|
1967
|
+
return o(u);
|
|
1968
|
+
const l = { ...u.touchedControls };
|
|
1969
|
+
for (const a of d)
|
|
1970
|
+
l[a] = !0;
|
|
1971
|
+
return u = { ...u, touchedControls: l }, wt(t(r(u)));
|
|
1972
|
+
}
|
|
1973
|
+
function Bo(e, t, r) {
|
|
1974
|
+
const n = [];
|
|
1975
|
+
for (const [o, s] of Object.entries(e.resolvedSources)) {
|
|
1976
|
+
const i = V(s);
|
|
1977
|
+
if (i === void 0 || e.widgetFlags[o]?.hidden === !0 || e.touchedControls[i] === !0)
|
|
1978
|
+
continue;
|
|
1979
|
+
const u = t[o] === void 0, d = r[o]?.hidden === !0;
|
|
1980
|
+
(u || d) && n.push(i);
|
|
1981
|
+
}
|
|
1982
|
+
return n;
|
|
1983
|
+
}
|
|
1984
|
+
function Go(e) {
|
|
1985
|
+
const t = {};
|
|
1986
|
+
for (const { source: r, current: n } of Object.values(e.calculatedWidgets)) {
|
|
1987
|
+
const o = V(n) ?? V(r);
|
|
1988
|
+
o !== void 0 && (t[o] = !0);
|
|
1989
|
+
}
|
|
1990
|
+
return { ...e, touched: !0, allControlsValidated: !0, touchedControls: t };
|
|
1991
|
+
}
|
|
1992
|
+
function Ko(e, t) {
|
|
1993
|
+
return e === "eager" || t === e || Array.isArray(e) && e.includes(t);
|
|
1994
|
+
}
|
|
1995
|
+
function xo(e, t) {
|
|
1996
|
+
if (!e.touched)
|
|
1997
|
+
return !1;
|
|
1998
|
+
let r;
|
|
1999
|
+
if ("path" in t.payload)
|
|
2000
|
+
r = t.payload.path;
|
|
2001
|
+
else {
|
|
2002
|
+
const n = e.calculatedWidgets[t.payload.uid]?.current;
|
|
2003
|
+
n && j(n) && (r = n.path);
|
|
2004
|
+
}
|
|
2005
|
+
return r !== void 0 && e.touchedControls[r] === !0;
|
|
2006
|
+
}
|
|
2007
|
+
function wt(e) {
|
|
1911
2008
|
const t = Object.keys(e.injectedValidations), r = Object.keys(e.validations);
|
|
1912
2009
|
if (t.length === 0 && r.length === 0)
|
|
1913
2010
|
return { ...e, isFormValid: !0 };
|
|
1914
|
-
let n = t.find(
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2011
|
+
let n = t.find((o) => {
|
|
2012
|
+
const s = e.injectedValidations[o];
|
|
2013
|
+
return Array.isArray(s) && s.length > 0;
|
|
2014
|
+
});
|
|
2015
|
+
return n !== void 0 ? { ...e, isFormValid: !1 } : (n = r.find((o) => {
|
|
2016
|
+
const s = e.validations[o];
|
|
2017
|
+
return Array.isArray(s) && s.length > 0;
|
|
2018
|
+
}), n !== void 0 ? { ...e, isFormValid: !1 } : { ...e, isFormValid: !0 });
|
|
2019
|
+
}
|
|
2020
|
+
function Xo(e = [], t, r, n, o = {}) {
|
|
2021
|
+
const s = new hr(Dt(n.lang)), i = s.asObservable().pipe(_e()), u = Uo({ validators: t, validateOn: r, localization: n, functions: o });
|
|
2022
|
+
function d(g) {
|
|
2023
|
+
const I = s.getValue(), we = u(I, g);
|
|
2024
|
+
s.next(we);
|
|
2025
|
+
}
|
|
2026
|
+
let l = d;
|
|
2027
|
+
const a = {
|
|
1929
2028
|
getState: () => s.getValue(),
|
|
1930
|
-
dispatch: (
|
|
2029
|
+
dispatch: (g) => l(g)
|
|
1931
2030
|
// reference is updated later
|
|
1932
2031
|
};
|
|
1933
|
-
return l = e.map((
|
|
2032
|
+
return l = e.map((g) => g(a)).reduceRight((g, I) => I(g), d), {
|
|
1934
2033
|
state$: i,
|
|
1935
2034
|
dispatch: l,
|
|
1936
2035
|
getState: () => s.getValue()
|
|
1937
2036
|
};
|
|
1938
2037
|
}
|
|
1939
|
-
class
|
|
2038
|
+
class as {
|
|
1940
2039
|
constructor() {
|
|
1941
|
-
this.widgetRegistry = new
|
|
2040
|
+
this.widgetRegistry = new Fe(), this.store = {}, this.events$ = new it(), this.submit$ = new it(), this.itemRenderers = {}, this.dependencies = {};
|
|
1942
2041
|
}
|
|
1943
|
-
initialize(t, r = [], n, o, s, i =
|
|
1944
|
-
this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store =
|
|
2042
|
+
initialize(t, r = [], n, o, s, i = _r(), u, d = {}) {
|
|
2043
|
+
this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store = Xo(r, n, o, i, d);
|
|
1945
2044
|
}
|
|
1946
2045
|
emitEvent(t, r, n) {
|
|
1947
2046
|
const s = this.store.getState().currentStates.filter((i) => r.on?.[`${t}.${i}`] !== void 0);
|
|
1948
|
-
if (s.length > 0)
|
|
2047
|
+
if (this.attemptValidation(t, r), s.length > 0)
|
|
1949
2048
|
s.forEach((i) => {
|
|
1950
2049
|
const u = r.on?.[`${t}.${i}`];
|
|
1951
|
-
|
|
2050
|
+
u && this.events$.next({
|
|
1952
2051
|
name: u,
|
|
1953
|
-
data:
|
|
2052
|
+
data: Ce(this.store.getState()),
|
|
1954
2053
|
detail: n ?? void 0,
|
|
1955
|
-
callback: (
|
|
1956
|
-
this.store.dispatch(
|
|
2054
|
+
callback: (d) => {
|
|
2055
|
+
this.store.dispatch(d);
|
|
1957
2056
|
}
|
|
1958
2057
|
});
|
|
1959
2058
|
});
|
|
1960
2059
|
else {
|
|
1961
2060
|
const i = r.on?.[t];
|
|
1962
|
-
|
|
2061
|
+
i && this.events$.next({
|
|
1963
2062
|
name: i,
|
|
1964
|
-
data:
|
|
2063
|
+
data: Ce(this.store.getState()),
|
|
1965
2064
|
detail: n,
|
|
1966
2065
|
callback: (u) => {
|
|
1967
2066
|
this.store.dispatch(u);
|
|
@@ -1973,7 +2072,7 @@ class Bo {
|
|
|
1973
2072
|
this.store.dispatch({
|
|
1974
2073
|
type: "VALIDATE_ALL"
|
|
1975
2074
|
}), this.store.getState().isFormValid && this.submit$.next({
|
|
1976
|
-
data:
|
|
2075
|
+
data: Ce(this.store.getState()),
|
|
1977
2076
|
callback: (t) => {
|
|
1978
2077
|
this.store.dispatch(t);
|
|
1979
2078
|
}
|
|
@@ -1992,7 +2091,7 @@ class Bo {
|
|
|
1992
2091
|
}));
|
|
1993
2092
|
}
|
|
1994
2093
|
}
|
|
1995
|
-
function
|
|
2094
|
+
function fs(e = "GolemUI Form Store") {
|
|
1996
2095
|
return (t) => {
|
|
1997
2096
|
const n = (typeof window < "u" ? window.__REDUX_DEVTOOLS_EXTENSION__ : void 0)?.connect({ name: e });
|
|
1998
2097
|
return n?.init(t.getState()), (o) => (s) => {
|
|
@@ -2000,73 +2099,98 @@ function Go(e = "GolemUI Form Store") {
|
|
|
2000
2099
|
};
|
|
2001
2100
|
};
|
|
2002
2101
|
}
|
|
2003
|
-
const
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
),
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
)
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
);
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
)
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
function
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2102
|
+
const Jo = mr(
|
|
2103
|
+
Ct((e) => e.formHealth),
|
|
2104
|
+
_e((e, t) => e.status !== t.status ? !1 : e.status === "errored" && t.status === "errored" ? e.message === t.message && e.code === t.code : !0)
|
|
2105
|
+
), ps = (e) => e.pipe(Jo);
|
|
2106
|
+
function hs(e, t) {
|
|
2107
|
+
return fr(e, t, ar(e, t), void 0);
|
|
2108
|
+
}
|
|
2109
|
+
function Qo() {
|
|
2110
|
+
const e = /* @__PURE__ */ new Map();
|
|
2111
|
+
return (t, r) => {
|
|
2112
|
+
const n = ar(t, r), o = e.get(r);
|
|
2113
|
+
if (o && Yo(o.slices, n))
|
|
2114
|
+
return o.viewModel;
|
|
2115
|
+
const s = fr(t, r, n, o);
|
|
2116
|
+
return e.set(r, { slices: n, viewModel: s }), s;
|
|
2117
|
+
};
|
|
2118
|
+
}
|
|
2119
|
+
const ms = (e) => (t) => {
|
|
2120
|
+
const r = Qo();
|
|
2121
|
+
return t.pipe(
|
|
2122
|
+
Ct((n) => r(n, e)),
|
|
2123
|
+
// The reader returns the same object while nothing changed, so reference equality is enough.
|
|
2124
|
+
_e()
|
|
2125
|
+
);
|
|
2126
|
+
}, qo = [], Ot = [], Zo = [];
|
|
2127
|
+
function ar(e, t) {
|
|
2128
|
+
const r = es(e, t);
|
|
2129
|
+
return [
|
|
2130
|
+
e.calculatedWidgets[t],
|
|
2131
|
+
e.lang,
|
|
2132
|
+
r === void 0 ? void 0 : _(e.data, r),
|
|
2133
|
+
r !== void 0 && e.touched ? e.validations[r] : null,
|
|
2134
|
+
r !== void 0 && e.touched ? e.injectedValidations[r] : null,
|
|
2135
|
+
r !== void 0 && e.touchedControls[r] === !0,
|
|
2136
|
+
e.touched && !e.isFormValid,
|
|
2137
|
+
e.widgetFlags[t]?.hidden === !0
|
|
2138
|
+
];
|
|
2139
|
+
}
|
|
2140
|
+
function Yo(e, t) {
|
|
2141
|
+
return e.every((r, n) => Object.is(r, t[n]));
|
|
2142
|
+
}
|
|
2143
|
+
function fr(e, t, r, n) {
|
|
2144
|
+
const [o, s, i, u, d, l, a, p] = r, g = n === void 0 || !Object.is(n.slices[0], o), I = n === void 0 || !Object.is(n.slices[2], i), we = n === void 0 || !Object.is(n.slices[3], u) || !Object.is(n.slices[4], d), Oe = o?.current;
|
|
2145
|
+
return {
|
|
2146
|
+
uid: t,
|
|
2147
|
+
widget: Oe,
|
|
2148
|
+
children: g ? ts(e, t, Oe) : n.viewModel.children,
|
|
2149
|
+
rows: g || I ? rs(e, t, Oe, i) : n.viewModel.rows,
|
|
2150
|
+
lang: s,
|
|
2151
|
+
value: i,
|
|
2152
|
+
errors: we ? ns(u, d) : n.viewModel.errors,
|
|
2153
|
+
touched: l,
|
|
2154
|
+
formInvalid: a,
|
|
2155
|
+
hidden: p
|
|
2156
|
+
};
|
|
2157
|
+
}
|
|
2158
|
+
function es(e, t) {
|
|
2159
|
+
return e.resolvedSources[t]?.path;
|
|
2160
|
+
}
|
|
2161
|
+
function ts(e, t, r) {
|
|
2162
|
+
if (r === void 0 || !H(r))
|
|
2163
|
+
return qo;
|
|
2164
|
+
const n = r.children, o = te(t);
|
|
2165
|
+
if (o.length === 0)
|
|
2166
|
+
return n;
|
|
2167
|
+
const s = o.map((i) => `[${i}]`).join("");
|
|
2168
|
+
return n.map((i) => e.resolvedSources[`${i.uid}${s}`] ?? i);
|
|
2169
|
+
}
|
|
2170
|
+
function rs(e, t, r, n) {
|
|
2171
|
+
if (r === void 0 || !Array.isArray(n))
|
|
2172
|
+
return Ot;
|
|
2173
|
+
const o = e.resolvedSources[t];
|
|
2174
|
+
if (o === void 0 || !Se(o))
|
|
2175
|
+
return Ot;
|
|
2176
|
+
const s = o.props.template.uid, i = te(t);
|
|
2177
|
+
return n.map((u, d) => {
|
|
2178
|
+
const l = Ge(s, [...i, d]);
|
|
2179
|
+
return e.resolvedSources[l];
|
|
2180
|
+
}).filter((u) => u !== void 0);
|
|
2181
|
+
}
|
|
2182
|
+
function ns(e, t) {
|
|
2183
|
+
return (e?.length ?? 0) + (t?.length ?? 0) === 0 ? Zo : [...e ?? [], ...t ?? []];
|
|
2184
|
+
}
|
|
2185
|
+
let pr = !1;
|
|
2186
|
+
function gs() {
|
|
2187
|
+
pr = !0;
|
|
2188
|
+
}
|
|
2189
|
+
function os() {
|
|
2190
|
+
return pr;
|
|
2191
|
+
}
|
|
2192
|
+
function ys(e, t, r) {
|
|
2193
|
+
if (!os())
|
|
2070
2194
|
return;
|
|
2071
2195
|
const n = Object.keys(t ?? {}).filter((o) => o in r);
|
|
2072
2196
|
if (n.length > 0)
|
|
@@ -2075,26 +2199,23 @@ function Yo(e, t, r) {
|
|
|
2075
2199
|
);
|
|
2076
2200
|
}
|
|
2077
2201
|
export {
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
ur as standardValidate,
|
|
2098
|
-
xo as touchedControlsByPath$,
|
|
2099
|
-
bo as validationByPath$
|
|
2202
|
+
as as FormContext,
|
|
2203
|
+
ys as assertNoPropCollisions,
|
|
2204
|
+
ce as cloneObject,
|
|
2205
|
+
Qo as createWidgetViewModelReader,
|
|
2206
|
+
us as defineForm,
|
|
2207
|
+
fs as devToolsMiddleware,
|
|
2208
|
+
gs as enableDevMode,
|
|
2209
|
+
F as errorCodes,
|
|
2210
|
+
ls as filterTap,
|
|
2211
|
+
cs as formEventNames,
|
|
2212
|
+
ps as formHealth,
|
|
2213
|
+
ds as getDirectionFromLanguage,
|
|
2214
|
+
_r as identityTranslator,
|
|
2215
|
+
yr as isStandardValidateSuccess,
|
|
2216
|
+
Vt as makeRepeaterItemConfig,
|
|
2217
|
+
Or as shortUUID,
|
|
2218
|
+
gr as standardValidate,
|
|
2219
|
+
hs as widgetViewModel,
|
|
2220
|
+
ms as widgetViewModel$
|
|
2100
2221
|
};
|