@golemui/core 1.1.1-rc.3 → 1.2.1-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 +19 -0
- package/index.js +384 -367
- package/index.umd.cjs +6 -6
- package/lib/store/model.d.ts +5 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BehaviorSubject as or, distinctUntilChanged as k, Subject as
|
|
1
|
+
import { BehaviorSubject as or, distinctUntilChanged as k, Subject as ct, pipe as T, map as W, filter as Ae, combineLatest as sr, startWith as ir } from "rxjs";
|
|
2
2
|
import "@standard-schema/spec";
|
|
3
3
|
function ur(e, t) {
|
|
4
4
|
const r = e["~standard"].validate(t);
|
|
@@ -35,16 +35,16 @@ var cr = class {
|
|
|
35
35
|
function F(e) {
|
|
36
36
|
return new cr(e);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function v(e) {
|
|
39
39
|
return new lr(e);
|
|
40
40
|
}
|
|
41
41
|
function St(e) {
|
|
42
42
|
return e.reduce((t, r) => typeof r == "number" ? `${t}[${r}]` : t.length === 0 ? String(r) : `${t}.${r}`, "");
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function lt(e) {
|
|
45
45
|
return e.map((t) => t.path.length === 0 ? t.message : `${St(t.path)}: ${t.message}`).join("; ");
|
|
46
46
|
}
|
|
47
|
-
var
|
|
47
|
+
var O = class Te {
|
|
48
48
|
decodeFn;
|
|
49
49
|
constructor(t) {
|
|
50
50
|
this.decodeFn = t;
|
|
@@ -54,7 +54,7 @@ var C = class Fe {
|
|
|
54
54
|
if (r.isOk()) return r.value;
|
|
55
55
|
{
|
|
56
56
|
let n = r;
|
|
57
|
-
throw Error(
|
|
57
|
+
throw Error(lt(n.issues), { cause: n.issues });
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
decode(t) {
|
|
@@ -77,87 +77,87 @@ var C = class Fe {
|
|
|
77
77
|
if (o.isOk()) return r(o.value);
|
|
78
78
|
{
|
|
79
79
|
let s = o;
|
|
80
|
-
return n(Error(
|
|
80
|
+
return n(Error(lt(s.issues), { cause: s.issues }));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
map(t) {
|
|
85
|
-
return new
|
|
85
|
+
return new Te((r) => {
|
|
86
86
|
let n = this.decodeFn(r);
|
|
87
|
-
return n.isOk() ? F(t(n.value)) :
|
|
87
|
+
return n.isOk() ? F(t(n.value)) : v(n.issues);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
flatMap(t) {
|
|
91
|
-
return new
|
|
91
|
+
return new Te((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) : v(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
|
+
}], Ue = (e, t) => e.map((r) => ({
|
|
100
100
|
...r,
|
|
101
101
|
path: [t, ...r.path]
|
|
102
102
|
}));
|
|
103
|
-
function
|
|
104
|
-
return new
|
|
103
|
+
function Me(e) {
|
|
104
|
+
return new O((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(...Ue(s.issues, o));
|
|
110
110
|
}
|
|
111
|
-
return n.length > 0 ?
|
|
112
|
-
} else return
|
|
111
|
+
return n.length > 0 ? v(n) : F(r);
|
|
112
|
+
} else return v(B(t, "array"));
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
function ar() {
|
|
116
|
-
return new
|
|
116
|
+
return new O((e) => typeof e == "boolean" ? F(e) : v(B(e, "boolean")));
|
|
117
117
|
}
|
|
118
118
|
function fr(e, t) {
|
|
119
|
-
return new
|
|
120
|
-
if (typeof r != "object" || !r) return
|
|
119
|
+
return new O((r) => {
|
|
120
|
+
if (typeof r != "object" || !r) return v(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) : v([{
|
|
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 Et(e) {
|
|
129
|
+
return new O((t) => e().decode(t));
|
|
130
130
|
}
|
|
131
131
|
function J(e) {
|
|
132
|
-
return new
|
|
132
|
+
return new O((t) => t === e ? F(e) : v([{
|
|
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 Se() {
|
|
138
|
+
return new O((e) => typeof e == "number" ? F(e) : v(B(e, "number")));
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return new
|
|
140
|
+
function ie(e) {
|
|
141
|
+
return new O((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 O ? i.decode(t[o]) : i.decoder.decode(t[i.fromKey]), s.isOk() ? r[o] = s.value : n.push(...Ue(s.issues, o));
|
|
147
147
|
}
|
|
148
|
-
return n.length > 0 ?
|
|
149
|
-
} else return
|
|
148
|
+
return n.length > 0 ? v(n) : F(r);
|
|
149
|
+
} else return v(B(t, "object"));
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function x(e) {
|
|
153
|
-
return new
|
|
153
|
+
return new O((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 v([{
|
|
161
161
|
message: `no alternative matched (tried ${e.length})`,
|
|
162
162
|
path: []
|
|
163
163
|
}, ...pr(r)]);
|
|
@@ -178,35 +178,35 @@ function pr(e) {
|
|
|
178
178
|
}));
|
|
179
179
|
}
|
|
180
180
|
function y(e) {
|
|
181
|
-
return new
|
|
181
|
+
return new O((t) => t === void 0 ? F(void 0) : e.decode(t));
|
|
182
182
|
}
|
|
183
183
|
function hr(e) {
|
|
184
|
-
return new
|
|
184
|
+
return new O((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(...Ue(s.issues, o));
|
|
190
190
|
}
|
|
191
|
-
return n.length > 0 ?
|
|
192
|
-
} else return
|
|
191
|
+
return n.length > 0 ? v(n) : F(r);
|
|
192
|
+
} else return v(B(t, "object"));
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
function I() {
|
|
196
|
-
return new
|
|
196
|
+
return new O((e) => typeof e == "string" ? F(e) : v(B(e, "string")));
|
|
197
197
|
}
|
|
198
198
|
function z() {
|
|
199
|
-
return new
|
|
199
|
+
return new O((e) => F(e));
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
return new
|
|
201
|
+
function ue(e) {
|
|
202
|
+
return new O((t) => {
|
|
203
203
|
if (typeof t != "object" || t === null)
|
|
204
|
-
return
|
|
204
|
+
return v([{ 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 v(
|
|
210
210
|
s.issues.map((i) => ({
|
|
211
211
|
message: i.message,
|
|
212
212
|
path: [n, ...i.path]
|
|
@@ -217,7 +217,7 @@ function ie(e) {
|
|
|
217
217
|
if (i.startsWith(n + ".")) {
|
|
218
218
|
const c = o.decoder.decode(u);
|
|
219
219
|
if (!c.isOk())
|
|
220
|
-
return
|
|
220
|
+
return v(
|
|
221
221
|
c.issues.map((l) => ({
|
|
222
222
|
message: l.message,
|
|
223
223
|
path: [i, ...l.path]
|
|
@@ -230,45 +230,45 @@ function ie(e) {
|
|
|
230
230
|
return F(r);
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
|
-
const mr = () => crypto.randomUUID().slice(0, 8), gr = (e) => typeof e != "function" && e.kind === "display",
|
|
233
|
+
const mr = () => crypto.randomUUID().slice(0, 8), gr = (e) => typeof e != "function" && e.kind === "display", fe = (e) => typeof e != "function" && e.kind === "action", D = (e) => typeof e != "function" && e.kind === "input", ne = (e) => typeof e != "function" && e.kind === "layout", G = (e) => typeof e == "function", yr = ie({ in: Me(I()) }), He = ie({ when: I() }), Ee = x([yr, He]), $r = ie({ from: Me(I()) }), ve = x([$r, He]), je = x([ar(), He]), Ar = new O((e) => {
|
|
234
234
|
const t = typeof e;
|
|
235
|
-
return t === "function" ? F(e) :
|
|
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
|
-
}), Sr =
|
|
235
|
+
return t === "function" ? F(e) : v([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
236
|
+
}), R = (e) => x([e, Ar]), ze = ue({
|
|
237
|
+
load: { suffixed: !0, decoder: R(y(I())) },
|
|
238
|
+
click: { suffixed: !0, decoder: R(y(I())) },
|
|
239
|
+
change: { suffixed: !0, decoder: R(y(I())) },
|
|
240
|
+
filter: { suffixed: !0, decoder: R(y(I())) },
|
|
241
|
+
blur: { suffixed: !0, decoder: R(y(I())) }
|
|
242
|
+
}), Sr = ie({
|
|
243
243
|
key: I(),
|
|
244
244
|
default: y(I()),
|
|
245
245
|
params: y(z())
|
|
246
|
-
}),
|
|
246
|
+
}), vt = x([I(), Sr]), Be = y(I()), Er = ue({
|
|
247
247
|
kind: { decoder: J("display") },
|
|
248
|
-
uid: { decoder:
|
|
248
|
+
uid: { decoder: Be },
|
|
249
249
|
type: { decoder: I() },
|
|
250
|
-
size: { suffixed: !0, decoder: y(
|
|
251
|
-
include: { decoder: y(
|
|
250
|
+
size: { suffixed: !0, decoder: y(Se()) },
|
|
251
|
+
include: { decoder: y(Ee) },
|
|
252
252
|
exclude: { decoder: y(ve) },
|
|
253
253
|
props: { decoder: y(z()) }
|
|
254
|
-
}),
|
|
254
|
+
}), vr = ue({
|
|
255
255
|
kind: { decoder: J("action") },
|
|
256
|
-
uid: { decoder:
|
|
256
|
+
uid: { decoder: Be },
|
|
257
257
|
type: { decoder: I() },
|
|
258
258
|
actionType: {
|
|
259
259
|
decoder: y(x([J("button"), J("submit")]))
|
|
260
260
|
},
|
|
261
|
-
size: { suffixed: !0, decoder: y(
|
|
262
|
-
include: { decoder: y(
|
|
261
|
+
size: { suffixed: !0, decoder: y(Se()) },
|
|
262
|
+
include: { decoder: y(Ee) },
|
|
263
263
|
exclude: { decoder: y(ve) },
|
|
264
264
|
label: {
|
|
265
265
|
suffixed: !0,
|
|
266
|
-
decoder:
|
|
266
|
+
decoder: R(y(vt))
|
|
267
267
|
},
|
|
268
|
-
disabled: { suffixed: !0, decoder: y(
|
|
269
|
-
on: { decoder: y(
|
|
268
|
+
disabled: { suffixed: !0, decoder: y(je) },
|
|
269
|
+
on: { decoder: y(ze) },
|
|
270
270
|
props: { decoder: y(z()) }
|
|
271
|
-
}), Ir = new
|
|
271
|
+
}), Ir = new O((e) => {
|
|
272
272
|
const t = typeof e;
|
|
273
273
|
if (t === "function") {
|
|
274
274
|
const r = e, n = r({
|
|
@@ -279,55 +279,55 @@ const mr = () => crypto.randomUUID().slice(0, 8), gr = (e) => typeof e != "funct
|
|
|
279
279
|
});
|
|
280
280
|
return r.uid = r.uid || n.uid || mr(), r.type = n.type, r.path = n.path, F(r);
|
|
281
281
|
} else
|
|
282
|
-
return
|
|
283
|
-
}),
|
|
282
|
+
return v([{ message: `Expected a function, got '${t}'`, path: [] }]);
|
|
283
|
+
}), Cr = ue({
|
|
284
284
|
kind: { decoder: J("input") },
|
|
285
285
|
uid: { decoder: y(I()) },
|
|
286
286
|
type: { decoder: I() },
|
|
287
|
-
size: { suffixed: !0, decoder: y(
|
|
288
|
-
include: { decoder: y(
|
|
287
|
+
size: { suffixed: !0, decoder: y(Se()) },
|
|
288
|
+
include: { decoder: y(Ee) },
|
|
289
289
|
exclude: { decoder: y(ve) },
|
|
290
|
-
disabled: { suffixed: !0, decoder: y(
|
|
291
|
-
readonly: { suffixed: !0, decoder: y(
|
|
292
|
-
on: { decoder: y(
|
|
290
|
+
disabled: { suffixed: !0, decoder: y(je) },
|
|
291
|
+
readonly: { suffixed: !0, decoder: y(je) },
|
|
292
|
+
on: { decoder: y(ze) },
|
|
293
293
|
props: { decoder: y(z()) },
|
|
294
294
|
label: {
|
|
295
295
|
suffixed: !0,
|
|
296
|
-
decoder:
|
|
296
|
+
decoder: R(y(vt))
|
|
297
297
|
},
|
|
298
298
|
path: { decoder: I() },
|
|
299
299
|
defaultValue: { decoder: y(z()) },
|
|
300
300
|
validator: {
|
|
301
301
|
suffixed: !0,
|
|
302
|
-
decoder:
|
|
302
|
+
decoder: R(y(z()))
|
|
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: Ge.parse(r.template) };
|
|
309
309
|
}
|
|
310
310
|
return t;
|
|
311
|
-
}),
|
|
311
|
+
}), wr = Et(() => {
|
|
312
312
|
const e = fr("kind", {
|
|
313
|
-
input:
|
|
314
|
-
layout:
|
|
315
|
-
display:
|
|
316
|
-
action:
|
|
313
|
+
input: Cr,
|
|
314
|
+
layout: Ge,
|
|
315
|
+
display: Er,
|
|
316
|
+
action: vr
|
|
317
317
|
});
|
|
318
|
-
return new
|
|
318
|
+
return new O(
|
|
319
319
|
(t) => typeof t == "function" ? Ir.decode(t) : e.decode(t)
|
|
320
320
|
);
|
|
321
|
-
}),
|
|
321
|
+
}), Ge = ue({
|
|
322
322
|
kind: { decoder: J("layout") },
|
|
323
|
-
uid: { decoder:
|
|
323
|
+
uid: { decoder: Be },
|
|
324
324
|
type: { decoder: I() },
|
|
325
|
-
size: { suffixed: !0, decoder: y(
|
|
326
|
-
include: { decoder: y(
|
|
325
|
+
size: { suffixed: !0, decoder: y(Se()) },
|
|
326
|
+
include: { decoder: y(Ee) },
|
|
327
327
|
exclude: { decoder: y(ve) },
|
|
328
328
|
props: { decoder: y(z()) },
|
|
329
|
-
on: { decoder: y(
|
|
330
|
-
children: { decoder:
|
|
329
|
+
on: { decoder: y(ze) },
|
|
330
|
+
children: { decoder: Me(wr) }
|
|
331
331
|
}), H = class H {
|
|
332
332
|
constructor() {
|
|
333
333
|
this.widgetLoaders = {}, this._ready = !1;
|
|
@@ -351,16 +351,16 @@ const mr = () => crypto.randomUUID().slice(0, 8), gr = (e) => typeof e != "funct
|
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
353
|
H.sharedCache = /* @__PURE__ */ new Map();
|
|
354
|
-
let
|
|
355
|
-
function
|
|
356
|
-
|
|
354
|
+
let Pe = H;
|
|
355
|
+
function Or(e) {
|
|
356
|
+
Ne(e, "#0");
|
|
357
357
|
}
|
|
358
|
-
function
|
|
359
|
-
if (!G(e) && (e.uid || (e.uid = t),
|
|
360
|
-
|
|
358
|
+
function Ne(e, t) {
|
|
359
|
+
if (!G(e) && (e.uid || (e.uid = t), ne(e) && e.children.forEach((r, n) => {
|
|
360
|
+
Ne(r, `${t}.${n}`);
|
|
361
361
|
}), D(e) && e.type === "repeater")) {
|
|
362
362
|
const r = e.props?.template;
|
|
363
|
-
r &&
|
|
363
|
+
r && Ne(r, `${t}.t`);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
function Uo(e) {
|
|
@@ -374,10 +374,10 @@ function Uo(e) {
|
|
|
374
374
|
}
|
|
375
375
|
};
|
|
376
376
|
}
|
|
377
|
-
const It =
|
|
377
|
+
const It = ie({
|
|
378
378
|
states: y(hr(I())),
|
|
379
|
-
form:
|
|
380
|
-
}).map((e) => (
|
|
379
|
+
form: Et(() => Ge)
|
|
380
|
+
}).map((e) => (Or(e.form), e)), Ct = (e) => ({
|
|
381
381
|
formName: "",
|
|
382
382
|
formDef: It.parse({
|
|
383
383
|
form: {
|
|
@@ -401,6 +401,7 @@ const It = se({
|
|
|
401
401
|
meta: {},
|
|
402
402
|
formHealth: { status: "ok" },
|
|
403
403
|
touched: !1,
|
|
404
|
+
allControlsValidated: !1,
|
|
404
405
|
lang: e
|
|
405
406
|
}), Mo = {
|
|
406
407
|
submit: "formSubmit",
|
|
@@ -432,14 +433,14 @@ const Wr = (e = navigator.language || "en-US") => {
|
|
|
432
433
|
}, kr = (e) => {
|
|
433
434
|
throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
|
|
434
435
|
};
|
|
435
|
-
function
|
|
436
|
+
function P(e, ...t) {
|
|
436
437
|
return t.reduce((r, n) => n(r), e);
|
|
437
438
|
}
|
|
438
|
-
const
|
|
439
|
+
const V = (e, t) => {
|
|
439
440
|
if (e === void 0)
|
|
440
441
|
throw new Error("obj is undefined");
|
|
441
442
|
return t.split(".").reduce((r, n) => r === void 0 || n === "" ? r : Array.isArray(r) ? r[parseInt(n, 10)] : r[n], e);
|
|
442
|
-
},
|
|
443
|
+
}, Ke = (e, t, r) => {
|
|
443
444
|
if (e === null)
|
|
444
445
|
throw new Error("object is null");
|
|
445
446
|
if (e === void 0)
|
|
@@ -487,22 +488,22 @@ function Tr(e) {
|
|
|
487
488
|
function jr(e) {
|
|
488
489
|
return e != null && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0;
|
|
489
490
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
491
|
+
const Ie = (e, t) => (delete e[t], e);
|
|
492
|
+
function _e(e) {
|
|
492
493
|
if (e === null || typeof e != "object")
|
|
493
494
|
return e;
|
|
494
495
|
if (Array.isArray(e))
|
|
495
|
-
return e.map((r) =>
|
|
496
|
+
return e.map((r) => _e(r));
|
|
496
497
|
const t = {};
|
|
497
498
|
for (const r of Object.keys(e))
|
|
498
|
-
t[r] =
|
|
499
|
+
t[r] = _e(e[r]);
|
|
499
500
|
return t;
|
|
500
501
|
}
|
|
501
502
|
function Pr(e, t) {
|
|
502
503
|
const r = t.payload.widget.uid;
|
|
503
504
|
if (!r)
|
|
504
505
|
throw new Error("addWidget: widget must have a uid");
|
|
505
|
-
const n = t.payload.widget, o = e.
|
|
506
|
+
const n = t.payload.widget, o = e.allControlsValidated && D(n) ? { ...e.touchedControls, [n.path]: !0 } : e.touchedControls;
|
|
506
507
|
return {
|
|
507
508
|
...e,
|
|
508
509
|
touchedControls: o,
|
|
@@ -524,20 +525,20 @@ const Q = {
|
|
|
524
525
|
widgetCouldNotBeLoaded: 30,
|
|
525
526
|
resolveStringInterpolationError: 40
|
|
526
527
|
};
|
|
527
|
-
function
|
|
528
|
+
function be(e) {
|
|
528
529
|
return e.flatMap((t) => [
|
|
529
530
|
t,
|
|
530
|
-
...
|
|
531
|
+
...ne(t) ? be(t.children) : []
|
|
531
532
|
]);
|
|
532
533
|
}
|
|
533
|
-
function
|
|
534
|
+
function Xe(e) {
|
|
534
535
|
return Object.entries(e.validations).reduce(
|
|
535
|
-
(r, [n, o]) => (o !== null && (r.$formIsInvalid = !0,
|
|
536
|
+
(r, [n, o]) => (o !== null && (r.$formIsInvalid = !0, Ke(r.$errors, n, [...o])), r),
|
|
536
537
|
{ $formIsInvalid: !1, $errors: {} }
|
|
537
538
|
);
|
|
538
539
|
}
|
|
539
|
-
function
|
|
540
|
-
const t =
|
|
540
|
+
function De(e) {
|
|
541
|
+
const t = _e(e.data);
|
|
541
542
|
for (const [r, n] of Object.entries(e.widgetFlags))
|
|
542
543
|
if (n.hidden === !0) {
|
|
543
544
|
const o = e.flatForm[r];
|
|
@@ -545,34 +546,34 @@ function Ce(e) {
|
|
|
545
546
|
}
|
|
546
547
|
return t;
|
|
547
548
|
}
|
|
548
|
-
const
|
|
549
|
-
let
|
|
549
|
+
const Je = 32;
|
|
550
|
+
let Ve, p, g, $ = (e) => (p = 0, g = e, $.newline = !1, e = S(), g[p] ? K() : e || ""), K = (e = "Unexpected token", t = p, r = g.slice(0, t).split(`
|
|
550
551
|
`), n = r.pop(), o = g.slice(Math.max(0, t - 40), t), s = "̭", i = (g[t] || " ") + s, u = g.slice(t + 1, t + 20)) => {
|
|
551
552
|
throw SyntaxError(`${e} at ${r.length + 1}:${n.length + 1}
|
|
552
553
|
${g[t - 41] !== `
|
|
553
554
|
`, "" + o}${i}${u}`);
|
|
554
|
-
},
|
|
555
|
+
}, wt = (e, t = p) => (Array.isArray(e) && (e.loc = t), e), q = (e, t = p, r) => {
|
|
555
556
|
for (; r = e(g.charCodeAt(p)); ) p += r;
|
|
556
557
|
return g.slice(t, p);
|
|
557
|
-
},
|
|
558
|
+
}, C = (e = 1) => g[p += e], Re = (e) => p = e, S = (e = 0, t) => {
|
|
558
559
|
let r, n, o, s, i;
|
|
559
560
|
for (t && $.asi && ($.newline = !1); (r = $.space()) && (i = $.newline, 1) && r !== t && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
|
|
560
|
-
(n && r === 91 &&
|
|
561
|
+
(n && r === 91 && Ve && $.asi?.(n, e, S) || null) ?? ((s = N[r]) && s(n, e)) ?? (n && i && $.asi?.(n, e, S)) ?? (!n && q($.id))); ) n = o;
|
|
561
562
|
return t && (r == t ? (p++, t === 125 && $.asi && ($.newline = !0)) : K("Unclosed " + String.fromCharCode(t - (t > 42 ? 2 : 1)))), n;
|
|
562
563
|
}, U = (e, t = p) => {
|
|
563
|
-
for (
|
|
564
|
-
$.asi && e === 10 && ($.newline =
|
|
564
|
+
for (Ve = !1; (e = g.charCodeAt(p)) <= Je; )
|
|
565
|
+
$.asi && e === 10 && ($.newline = Ve = !0), p++;
|
|
565
566
|
return e;
|
|
566
567
|
}, Nr = (e = p) => {
|
|
567
|
-
for (; g.charCodeAt(e) <=
|
|
568
|
+
for (; g.charCodeAt(e) <= Je; ) e++;
|
|
568
569
|
return g.charCodeAt(e);
|
|
569
570
|
};
|
|
570
571
|
$.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
|
|
571
|
-
let _r = (e, t = e.length) => g.substr(p, t) === e && !$.id(g.charCodeAt(p + t)),
|
|
572
|
+
let _r = (e, t = e.length) => g.substr(p, t) === e && !$.id(g.charCodeAt(p + t)), N = [], at = {}, j = (e, t = Je, r, n = e.charCodeAt(0), o = e.length, s = N[n], i = e.toUpperCase() !== e, u, c) => (t = at[e] = !s && at[e] || t, N[n] = (l, f, m, h = p) => (u = m, (m ? e == m : (o < 2 || e.charCodeAt(1) === g.charCodeAt(p + 1) && (o < 3 || g.substr(p, o) == e)) && (!i || !$.id(g.charCodeAt(p + o))) && (u = m = e)) && f < t && (p += o, (c = r(l)) ? wt(c, h) : (p = h, u = 0, !i && !s && !l && K()), c) || s?.(l, f, u))), A = (e, t, r = !1) => j(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), M = (e, t, r) => j(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), de = (e, t) => j(e, 200, (r) => !r && [, t]), Ot = (e, t, r) => j(
|
|
572
573
|
e,
|
|
573
574
|
t,
|
|
574
575
|
(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)
|
|
575
|
-
),
|
|
576
|
+
), Qe = (e, t) => j(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Dt = (e, t) => j(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), ce = (e, t, r, n = e.charCodeAt(0), o = e.length, s = N[n], i) => N[n] = (u, c, l, f = p) => !u && (l ? e == l : (o < 2 || g.substr(p, o) == e) && (l = e)) && c < t && !$.id(g.charCodeAt(p + o)) && (!$.prop || $.prop(p + o)) && (Re(p + o), (i = r()) ? wt(i, f) : Re(f), i) || s?.(u, c, l);
|
|
576
577
|
Object.defineProperty($, "space", {
|
|
577
578
|
configurable: !0,
|
|
578
579
|
enumerable: !0,
|
|
@@ -583,48 +584,48 @@ const Le = {}, a = (e, t, r = Le[e]) => Le[e] = (...n) => t(...n) || r?.(...n),
|
|
|
583
584
|
// == catches both undefined and null
|
|
584
585
|
Le[e[0]]?.(...e.slice(1)) ?? K(`Unknown operator: ${e[0]}`, e?.loc)
|
|
585
586
|
) : e === void 0 ? () => {
|
|
586
|
-
} : (t) => t?.[e],
|
|
587
|
+
} : (t) => t?.[e], pe = 46, oe = 48, he = 57, Vr = 69, Rr = 101, Lr = 43, Ur = 45, ae = 95, Wt = 110, Mr = 97, Hr = 102, zr = 65, Br = 70, kt = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), xe = (e) => {
|
|
587
588
|
let t = kt(q(
|
|
588
589
|
(r) => (
|
|
589
590
|
// . is decimal only if NOT followed by another . (range operator)
|
|
590
|
-
r ===
|
|
591
|
+
r === pe && g.charCodeAt(p + 1) !== pe || r >= oe && r <= he || r === ae || ((r === Vr || r === Rr) && ((r = g.charCodeAt(p + 1)) >= oe && r <= he || r === Lr || r === Ur) ? 2 : 0)
|
|
591
592
|
)
|
|
592
593
|
));
|
|
593
|
-
return g.charCodeAt(p) === Wt ? (
|
|
594
|
+
return g.charCodeAt(p) === Wt ? (C(), [, BigInt(t)]) : (e = +t) != e ? K() : [, e];
|
|
594
595
|
}, Gr = {
|
|
595
|
-
2: (e) => e === 48 || e === 49 || e ===
|
|
596
|
-
8: (e) => e >= 48 && e <= 55 || e ===
|
|
597
|
-
16: (e) => e >=
|
|
596
|
+
2: (e) => e === 48 || e === 49 || e === ae,
|
|
597
|
+
8: (e) => e >= 48 && e <= 55 || e === ae,
|
|
598
|
+
16: (e) => e >= oe && e <= he || e >= Mr && e <= Hr || e >= zr && e <= Br || e === ae
|
|
598
599
|
};
|
|
599
600
|
$.number = null;
|
|
600
|
-
|
|
601
|
-
for (let e =
|
|
602
|
-
|
|
601
|
+
N[pe] = (e) => !e && g.charCodeAt(p + 1) !== pe && xe();
|
|
602
|
+
for (let e = oe; e <= he; e++) N[e] = (t) => t ? void 0 : xe();
|
|
603
|
+
N[oe] = (e) => {
|
|
603
604
|
if (e) return;
|
|
604
605
|
const t = $.number;
|
|
605
606
|
if (t) {
|
|
606
607
|
for (const [r, n] of Object.entries(t))
|
|
607
608
|
if (r[0] === "0" && g[p + 1]?.toLowerCase() === r[1]) {
|
|
608
|
-
|
|
609
|
+
C(2);
|
|
609
610
|
const o = kt(q(Gr[n]));
|
|
610
|
-
return g.charCodeAt(p) === Wt ? (
|
|
611
|
+
return g.charCodeAt(p) === Wt ? (C(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
|
|
611
612
|
}
|
|
612
613
|
}
|
|
613
|
-
return
|
|
614
|
+
return xe();
|
|
614
615
|
};
|
|
615
|
-
const Kr = 92,
|
|
616
|
+
const Kr = 92, ft = 34, pt = 39, br = { n: `
|
|
616
617
|
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Ft = (e) => (t, r, n = "") => {
|
|
617
618
|
if (!(t || !$.string?.[String.fromCharCode(e)]))
|
|
618
|
-
return
|
|
619
|
+
return C(), q((o) => o - e && (o === Kr ? (n += br[g[p + 1]] || g[p + 1], 2) : (n += g[p], 1))), g[p] === String.fromCharCode(e) ? C() : K("Bad string"), [, n];
|
|
619
620
|
};
|
|
620
|
-
|
|
621
|
-
|
|
621
|
+
N[ft] = Ft(ft);
|
|
622
|
+
N[pt] = Ft(pt);
|
|
622
623
|
$.string = { '"': !0 };
|
|
623
624
|
const Xr = 20;
|
|
624
625
|
"= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => A(e, Xr, !0));
|
|
625
626
|
const Tt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "()" && e.length === 2 ? Tt(e[1], t) : (() => {
|
|
626
627
|
throw Error("Invalid assignment target");
|
|
627
|
-
})(),
|
|
628
|
+
})(), ht = {
|
|
628
629
|
"=": (e, t, r) => e[t] = r,
|
|
629
630
|
"+=": (e, t, r) => e[t] += r,
|
|
630
631
|
"-=": (e, t, r) => e[t] -= r,
|
|
@@ -637,7 +638,7 @@ const Tt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "
|
|
|
637
638
|
">>=": (e, t, r) => e[t] >>= r,
|
|
638
639
|
"<<=": (e, t, r) => e[t] <<= r
|
|
639
640
|
};
|
|
640
|
-
for (const e in
|
|
641
|
+
for (const e in ht) a(e, (t, r) => (r = d(r), Tt(t, (n, o, s) => ht[e](n, o, r(s)))));
|
|
641
642
|
const Jr = 30, Qr = 40, xr = 140;
|
|
642
643
|
M("!", xr);
|
|
643
644
|
A("||", Jr);
|
|
@@ -658,11 +659,11 @@ a("&", (e, t) => (e = d(e), t = d(t), (r) => e(r) & t(r)));
|
|
|
658
659
|
a("^", (e, t) => (e = d(e), t = d(t), (r) => e(r) ^ t(r)));
|
|
659
660
|
a(">>", (e, t) => (e = d(e), t = d(t), (r) => e(r) >> t(r)));
|
|
660
661
|
a("<<", (e, t) => (e = d(e), t = d(t), (r) => e(r) << t(r)));
|
|
661
|
-
const
|
|
662
|
-
A("<",
|
|
663
|
-
A(">",
|
|
664
|
-
A("<=",
|
|
665
|
-
A(">=",
|
|
662
|
+
const Ce = 90;
|
|
663
|
+
A("<", Ce);
|
|
664
|
+
A(">", Ce);
|
|
665
|
+
A("<=", Ce);
|
|
666
|
+
A(">=", Ce);
|
|
666
667
|
a(">", (e, t) => (e = d(e), t = d(t), (r) => e(r) > t(r)));
|
|
667
668
|
a("<", (e, t) => (e = d(e), t = d(t), (r) => e(r) < t(r)));
|
|
668
669
|
a(">=", (e, t) => (e = d(e), t = d(t), (r) => e(r) >= t(r)));
|
|
@@ -672,12 +673,12 @@ A("==", Pt);
|
|
|
672
673
|
A("!=", Pt);
|
|
673
674
|
a("==", (e, t) => (e = d(e), t = d(t), (r) => e(r) == t(r)));
|
|
674
675
|
a("!=", (e, t) => (e = d(e), t = d(t), (r) => e(r) != t(r)));
|
|
675
|
-
const Nt = 110,
|
|
676
|
+
const Nt = 110, qe = 120, _t = 140;
|
|
676
677
|
A("+", Nt);
|
|
677
678
|
A("-", Nt);
|
|
678
|
-
A("*",
|
|
679
|
-
A("/",
|
|
680
|
-
A("%",
|
|
679
|
+
A("*", qe);
|
|
680
|
+
A("/", qe);
|
|
681
|
+
A("%", qe);
|
|
681
682
|
M("+", _t);
|
|
682
683
|
M("-", _t);
|
|
683
684
|
a("+", (e, t) => t !== void 0 ? (e = d(e), t = d(t), (r) => e(r) + t(r)) : (e = d(e), (r) => +e(r)));
|
|
@@ -685,64 +686,64 @@ a("-", (e, t) => t !== void 0 ? (e = d(e), t = d(t), (r) => e(r) - t(r)) : (e =
|
|
|
685
686
|
a("*", (e, t) => (e = d(e), t = d(t), (r) => e(r) * t(r)));
|
|
686
687
|
a("/", (e, t) => (e = d(e), t = d(t), (r) => e(r) / t(r)));
|
|
687
688
|
a("%", (e, t) => (e = d(e), t = d(t), (r) => e(r) % t(r)));
|
|
688
|
-
const
|
|
689
|
-
j("++",
|
|
690
|
-
j("--",
|
|
691
|
-
const
|
|
689
|
+
const me = 150;
|
|
690
|
+
j("++", me, (e) => e ? ["++", e, null] : ["++", S(me - 1)]);
|
|
691
|
+
j("--", me, (e) => e ? ["--", e, null] : ["--", S(me - 1)]);
|
|
692
|
+
const Ze = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n)) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o))) : e[0] === "()" && e.length === 2 ? Ze(e[1], t) : (
|
|
692
693
|
// unwrap parens: (x)++
|
|
693
694
|
(() => {
|
|
694
695
|
throw Error("Invalid increment target");
|
|
695
696
|
})()
|
|
696
697
|
);
|
|
697
|
-
a("++", (e, t) =>
|
|
698
|
-
a("--", (e, t) =>
|
|
698
|
+
a("++", (e, t) => Ze(e, t === null ? (r, n) => r[n]++ : (r, n) => ++r[n]));
|
|
699
|
+
a("--", (e, t) => Ze(e, t === null ? (r, n) => r[n]-- : (r, n) => --r[n]));
|
|
699
700
|
const tn = 5, rn = 10;
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
const
|
|
701
|
+
Ot(",", rn);
|
|
702
|
+
Ot(";", tn, !0);
|
|
703
|
+
const Vt = (...e) => (e = e.map(d), (t) => {
|
|
703
704
|
let r;
|
|
704
705
|
for (const n of e) r = n(t);
|
|
705
706
|
return r;
|
|
706
707
|
});
|
|
707
|
-
a(",",
|
|
708
|
-
a(";",
|
|
708
|
+
a(",", Vt);
|
|
709
|
+
a(";", Vt);
|
|
709
710
|
const nn = 170;
|
|
710
|
-
|
|
711
|
-
const
|
|
712
|
-
Dt("[]",
|
|
713
|
-
A(".",
|
|
714
|
-
Dt("()",
|
|
715
|
-
const
|
|
711
|
+
Qe("()", nn);
|
|
712
|
+
const L = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", Ye = 170;
|
|
713
|
+
Dt("[]", Ye);
|
|
714
|
+
A(".", Ye);
|
|
715
|
+
Dt("()", Ye);
|
|
716
|
+
const ge = (e) => {
|
|
716
717
|
throw Error(e);
|
|
717
718
|
};
|
|
718
719
|
a("[]", (e, t) => t === void 0 ? (e = e ? e[0] === "," ? e.slice(1) : [e] : [], e = e.map((r) => r == null ? (() => {
|
|
719
|
-
}) : r[0] === "..." ? (r = d(r[1]), (n) => r(n)) : (r = d(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null &&
|
|
720
|
+
}) : r[0] === "..." ? (r = d(r[1]), (n) => r(n)) : (r = d(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null && ge("Missing index"), e = d(e), t = d(t), (r) => {
|
|
720
721
|
const n = t(r);
|
|
721
|
-
return
|
|
722
|
+
return L(n) ? void 0 : e(r)[n];
|
|
722
723
|
}));
|
|
723
|
-
a(".", (e, t) => (e = d(e), t = t[0] ? t : t[1],
|
|
724
|
+
a(".", (e, t) => (e = d(e), t = t[0] ? t : t[1], L(t) ? () => {
|
|
724
725
|
} : (r) => e(r)[t]));
|
|
725
726
|
a("()", (e, t) => {
|
|
726
|
-
if (t === void 0) return e == null ?
|
|
727
|
+
if (t === void 0) return e == null ? ge("Empty ()") : d(e);
|
|
727
728
|
const r = (o) => o?.[0] === "," && o.slice(1).some((s) => s == null || r(s));
|
|
728
|
-
r(t) &&
|
|
729
|
+
r(t) && ge("Empty argument");
|
|
729
730
|
const n = t ? t[0] === "," ? (t = t.slice(1).map(d), (o) => t.map((s) => s(o))) : (t = d(t), (o) => [t(o)]) : () => [];
|
|
730
|
-
return
|
|
731
|
+
return et(e, (o, s, i) => o[s](...n(i)));
|
|
731
732
|
});
|
|
732
|
-
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] === "{}"),
|
|
733
|
+
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] === "{}"), et = (e, t, r, n) => e == null ? ge("Empty ()") : e[0] === "()" && e.length == 2 ? et(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = d(e[1]), n = e[2], (o) => {
|
|
733
734
|
const s = r(o);
|
|
734
735
|
return s == null ? void 0 : t(s, n, o);
|
|
735
736
|
}) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "?.[]" ? (r = d(e[1]), n = d(e[2]), (o) => {
|
|
736
737
|
const s = r(o);
|
|
737
738
|
return s == null ? void 0 : t(s, n(o), o);
|
|
738
|
-
}) : (e = d(e), (o) => t([e(o)], 0, o)), Z =
|
|
739
|
+
}) : (e = d(e), (o) => t([e(o)], 0, o)), Z = et, on = 32, sn = $.space;
|
|
739
740
|
$.comment ??= { "//": `
|
|
740
741
|
`, "/*": "*/" };
|
|
741
|
-
let
|
|
742
|
+
let We;
|
|
742
743
|
$.space = () => {
|
|
743
|
-
|
|
744
|
+
We || (We = Object.entries($.comment).map(([o, s]) => [o, s, o.charCodeAt(0)]));
|
|
744
745
|
for (var e; e = sn(); ) {
|
|
745
|
-
for (var t = 0, r; r =
|
|
746
|
+
for (var t = 0, r; r = We[t++]; )
|
|
746
747
|
if (e === r[2] && g.substr(p, r[0].length) === r[0]) {
|
|
747
748
|
var n = p + r[0].length;
|
|
748
749
|
if (r[1] === `
|
|
@@ -758,9 +759,9 @@ $.space = () => {
|
|
|
758
759
|
}
|
|
759
760
|
return e;
|
|
760
761
|
};
|
|
761
|
-
const
|
|
762
|
-
A("===",
|
|
763
|
-
A("!==",
|
|
762
|
+
const Rt = 80;
|
|
763
|
+
A("===", Rt);
|
|
764
|
+
A("!==", Rt);
|
|
764
765
|
a("===", (e, t) => (e = d(e), t = d(t), (r) => e(r) === t(r)));
|
|
765
766
|
a("!==", (e, t) => (e = d(e), t = d(t), (r) => e(r) !== t(r)));
|
|
766
767
|
const un = 30;
|
|
@@ -774,9 +775,9 @@ const ln = (e) => {
|
|
|
774
775
|
throw Error(e);
|
|
775
776
|
};
|
|
776
777
|
a("**=", (e, t) => (b(e) || ln("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] **= t(o))));
|
|
777
|
-
const
|
|
778
|
-
A("in",
|
|
779
|
-
A("of",
|
|
778
|
+
const Lt = 90;
|
|
779
|
+
A("in", Lt);
|
|
780
|
+
A("of", Lt);
|
|
780
781
|
a("in", (e, t) => (e = d(e), t = d(t), (r) => e(r) in t(r)));
|
|
781
782
|
const an = 20, fn = 100, pn = (e) => {
|
|
782
783
|
throw Error(e);
|
|
@@ -785,7 +786,7 @@ A(">>>", fn);
|
|
|
785
786
|
A(">>>=", an, !0);
|
|
786
787
|
a(">>>", (e, t) => (e = d(e), t = d(t), (r) => e(r) >>> t(r)));
|
|
787
788
|
a(">>>=", (e, t) => (b(e) || pn("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] >>>= t(o))));
|
|
788
|
-
const
|
|
789
|
+
const tt = 5, hn = 10, mn = 20, gn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, ye = (e, t, r) => {
|
|
789
790
|
if (typeof e == "string") {
|
|
790
791
|
r[e] = t;
|
|
791
792
|
return;
|
|
@@ -796,14 +797,14 @@ const et = 5, hn = 10, mn = 20, gn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
|
|
|
796
797
|
for (const u of s) {
|
|
797
798
|
if (Array.isArray(u) && u[0] === "...") {
|
|
798
799
|
const h = {};
|
|
799
|
-
for (const
|
|
800
|
+
for (const w in t) i.includes(w) || (h[w] = t[w]);
|
|
800
801
|
r[u[1]] = h;
|
|
801
802
|
break;
|
|
802
803
|
}
|
|
803
804
|
let c, l, f;
|
|
804
805
|
typeof u == "string" ? c = l = u : u[0] === "=" ? (typeof u[1] == "string" ? c = l = u[1] : [, c, l] = u[1], f = u[2]) : [, c, l] = u, i.push(c);
|
|
805
806
|
let m = t[c];
|
|
806
|
-
m === void 0 && f && (m = d(f)(r)),
|
|
807
|
+
m === void 0 && f && (m = d(f)(r)), ye(l, m, r);
|
|
807
808
|
}
|
|
808
809
|
} else if (n === "[]") {
|
|
809
810
|
let i = 0;
|
|
@@ -819,16 +820,16 @@ const et = 5, hn = 10, mn = 20, gn = (e) => e[0]?.[0] === "," ? e[0].slice(1) :
|
|
|
819
820
|
let c = u, l;
|
|
820
821
|
Array.isArray(u) && u[0] === "=" && ([, c, l] = u);
|
|
821
822
|
let f = t[i++];
|
|
822
|
-
f === void 0 && l && (f = d(l)(r)),
|
|
823
|
+
f === void 0 && l && (f = d(l)(r)), ye(c, f, r);
|
|
823
824
|
}
|
|
824
825
|
}
|
|
825
826
|
}, Ut = (e) => {
|
|
826
827
|
let t = S(hn - 1);
|
|
827
828
|
return t?.[0] === "in" || t?.[0] === "of" ? [t[0], [e, t[1]], t[2]] : t?.[0] === "," ? [e, ...t.slice(1)] : [e, t];
|
|
828
829
|
};
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
ce("let", tt + 1, () => Ut("let"));
|
|
831
|
+
ce("const", tt + 1, () => Ut("const"));
|
|
832
|
+
ce("var", tt, () => (U(), ["var", S(mn)]));
|
|
832
833
|
const Mt = (...e) => (e = e.map((t) => {
|
|
833
834
|
if (typeof t == "string") return (r) => {
|
|
834
835
|
r[t] = void 0;
|
|
@@ -837,7 +838,7 @@ const Mt = (...e) => (e = e.map((t) => {
|
|
|
837
838
|
const [, r, n] = t, o = d(n);
|
|
838
839
|
return typeof r == "string" ? (s) => {
|
|
839
840
|
s[r] = o(s);
|
|
840
|
-
} : (s) =>
|
|
841
|
+
} : (s) => ye(r, o(s), s);
|
|
841
842
|
}
|
|
842
843
|
return d(t);
|
|
843
844
|
}), (t) => {
|
|
@@ -849,32 +850,32 @@ a("var", (e) => typeof e == "string" ? (t) => {
|
|
|
849
850
|
t[e] = void 0;
|
|
850
851
|
} : () => {
|
|
851
852
|
});
|
|
852
|
-
const
|
|
853
|
+
const rt = 20, we = (e) => {
|
|
853
854
|
throw Error(e);
|
|
854
855
|
};
|
|
855
|
-
A("||=",
|
|
856
|
-
A("&&=",
|
|
857
|
-
A("??=",
|
|
856
|
+
A("||=", rt, !0);
|
|
857
|
+
A("&&=", rt, !0);
|
|
858
|
+
A("??=", rt, !0);
|
|
858
859
|
a("=", (e, t) => {
|
|
859
860
|
if (Array.isArray(e) && (e[0] === "let" || e[0] === "const" || e[0] === "var")) {
|
|
860
861
|
const r = e[1];
|
|
861
862
|
return t = d(t), typeof r == "string" ? (n) => {
|
|
862
863
|
n[r] = t(n);
|
|
863
|
-
} : (n) =>
|
|
864
|
+
} : (n) => ye(r, t(n), n);
|
|
864
865
|
}
|
|
865
866
|
return b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] = t(o));
|
|
866
867
|
});
|
|
867
868
|
a("||=", (e, t) => (b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] ||= t(o))));
|
|
868
869
|
a("&&=", (e, t) => (b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] &&= t(o))));
|
|
869
870
|
a("??=", (e, t) => (b(e) || we("Invalid assignment target"), t = d(t), Z(e, (r, n, o) => r[n] ??= t(o))));
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
const
|
|
877
|
-
j("?",
|
|
871
|
+
de("true", !0);
|
|
872
|
+
de("false", !1);
|
|
873
|
+
de("null", null);
|
|
874
|
+
ce("undefined", 200, () => []);
|
|
875
|
+
de("NaN", NaN);
|
|
876
|
+
de("Infinity", 1 / 0);
|
|
877
|
+
const ke = 20;
|
|
878
|
+
j("?", ke, (e, t, r) => e && (t = S(ke - 1)) && q((n) => n === 58) && (r = S(ke - 1), ["?", e, t, r]));
|
|
878
879
|
a("?", (e, t, r) => (e = d(e), t = d(t), r = d(r), (n) => e(n) ? t(n) : r(n)));
|
|
879
880
|
const yn = [], $n = 20;
|
|
880
881
|
A("=>", $n, !0);
|
|
@@ -890,7 +891,7 @@ a("=>", (e, t) => {
|
|
|
890
891
|
r.forEach((m, h) => l[m] = c[h]), o && (l[o] = c.slice(n));
|
|
891
892
|
const f = new Proxy(l, {
|
|
892
893
|
get: (m, h) => h in m ? m[h] : u?.[h],
|
|
893
|
-
set: (m, h,
|
|
894
|
+
set: (m, h, w) => ((h in m ? m : u)[h] = w, !0),
|
|
894
895
|
has: (m, h) => h in m || (u ? h in u : !1)
|
|
895
896
|
});
|
|
896
897
|
try {
|
|
@@ -905,55 +906,55 @@ a("=>", (e, t) => {
|
|
|
905
906
|
const An = 140;
|
|
906
907
|
M("...", An);
|
|
907
908
|
a("...", (e) => (e = d(e), (t) => Object.entries(e(t))));
|
|
908
|
-
const
|
|
909
|
-
j("?.",
|
|
909
|
+
const mt = 170;
|
|
910
|
+
j("?.", mt, (e, t) => {
|
|
910
911
|
if (!e) return;
|
|
911
912
|
const r = U();
|
|
912
|
-
return r === 40 ? (
|
|
913
|
+
return r === 40 ? (C(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (C(), ["?.[]", e, S(0, 93)]) : (t = S(mt), t ? ["?.", e, t] : void 0);
|
|
913
914
|
});
|
|
914
|
-
a("?.", (e, t) => (e = d(e),
|
|
915
|
+
a("?.", (e, t) => (e = d(e), L(t) ? () => {
|
|
915
916
|
} : (r) => e(r)?.[t]));
|
|
916
917
|
a("?.[]", (e, t) => (e = d(e), t = d(t), (r) => {
|
|
917
918
|
const n = t(r);
|
|
918
|
-
return
|
|
919
|
+
return L(n) ? void 0 : e(r)?.[n];
|
|
919
920
|
}));
|
|
920
921
|
a("?.()", (e, t) => {
|
|
921
922
|
const r = t ? t[0] === "," ? (t = t.slice(1).map(d), (o) => t.map((s) => s(o))) : (t = d(t), (o) => [t(o)]) : () => [];
|
|
922
923
|
if (e[0] === "?.") {
|
|
923
924
|
const o = d(e[1]), s = e[2];
|
|
924
|
-
return
|
|
925
|
+
return L(s) ? () => {
|
|
925
926
|
} : (i) => o(i)?.[s]?.(...r(i));
|
|
926
927
|
}
|
|
927
928
|
if (e[0] === "?.[]") {
|
|
928
929
|
const o = d(e[1]), s = d(e[2]);
|
|
929
930
|
return (i) => {
|
|
930
931
|
const u = o(i), c = s(i);
|
|
931
|
-
return
|
|
932
|
+
return L(c) ? void 0 : u?.[c]?.(...r(i));
|
|
932
933
|
};
|
|
933
934
|
}
|
|
934
935
|
if (e[0] === ".") {
|
|
935
936
|
const o = d(e[1]), s = e[2];
|
|
936
|
-
return
|
|
937
|
+
return L(s) ? () => {
|
|
937
938
|
} : (i) => o(i)?.[s]?.(...r(i));
|
|
938
939
|
}
|
|
939
940
|
if (e[0] === "[]" && e.length === 3) {
|
|
940
941
|
const o = d(e[1]), s = d(e[2]);
|
|
941
942
|
return (i) => {
|
|
942
943
|
const u = o(i), c = s(i);
|
|
943
|
-
return
|
|
944
|
+
return L(c) ? void 0 : u?.[c]?.(...r(i));
|
|
944
945
|
};
|
|
945
946
|
}
|
|
946
947
|
const n = d(e);
|
|
947
948
|
return (o) => n(o)?.(...r(o));
|
|
948
949
|
});
|
|
949
|
-
const
|
|
950
|
-
M("typeof",
|
|
951
|
-
M("void",
|
|
952
|
-
M("delete",
|
|
953
|
-
|
|
950
|
+
const se = 140;
|
|
951
|
+
M("typeof", se);
|
|
952
|
+
M("void", se);
|
|
953
|
+
M("delete", se);
|
|
954
|
+
ce(
|
|
954
955
|
"new",
|
|
955
|
-
|
|
956
|
-
() => _r(".target") ? (
|
|
956
|
+
se,
|
|
957
|
+
() => _r(".target") ? (C(7), ["new.target"]) : ["new", S(se)]
|
|
957
958
|
);
|
|
958
959
|
a("typeof", (e) => (e = d(e), (t) => typeof e(t)));
|
|
959
960
|
a("void", (e) => (e = d(e), (t) => (e(t), void 0)));
|
|
@@ -972,52 +973,52 @@ a("new", (e) => {
|
|
|
972
973
|
const t = d(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(d)) : /* @__PURE__ */ ((o) => (s) => [o(s)])(d(r)) : () => [];
|
|
973
974
|
return (o) => new (t(o))(...n(o));
|
|
974
975
|
});
|
|
975
|
-
const
|
|
976
|
+
const nt = /* @__PURE__ */ Symbol("accessor"), ot = 20, Sn = 40, Ht = 41, zt = 123, Bt = 125, Gt = (e) => (t) => {
|
|
976
977
|
if (t) return;
|
|
977
978
|
U();
|
|
978
979
|
const r = q($.id);
|
|
979
980
|
if (!r || (U(), g.charCodeAt(p) !== Sn)) return !1;
|
|
980
|
-
|
|
981
|
+
C();
|
|
981
982
|
const n = S(0, Ht);
|
|
982
|
-
return U(), g.charCodeAt(p) !== zt ? !1 : (
|
|
983
|
+
return U(), g.charCodeAt(p) !== zt ? !1 : (C(), [e, r, n, S(0, Bt)]);
|
|
983
984
|
};
|
|
984
|
-
j("get",
|
|
985
|
-
j("set",
|
|
986
|
-
j("(",
|
|
985
|
+
j("get", ot - 1, Gt("get"));
|
|
986
|
+
j("set", ot - 1, Gt("set"));
|
|
987
|
+
j("(", ot - 1, (e) => {
|
|
987
988
|
if (!e || typeof e != "string") return;
|
|
988
989
|
const t = S(0, Ht) || null;
|
|
989
990
|
if (U(), g.charCodeAt(p) === zt)
|
|
990
|
-
return
|
|
991
|
+
return C(), [":", e, ["=>", ["()", t], S(0, Bt) || null]];
|
|
991
992
|
});
|
|
992
993
|
a("get", (e, t) => (t = t ? d(t) : () => {
|
|
993
|
-
}, (r) => [[
|
|
994
|
+
}, (r) => [[nt, e, {
|
|
994
995
|
get: function() {
|
|
995
996
|
const n = Object.create(r || {});
|
|
996
997
|
return n.this = this, t(n);
|
|
997
998
|
}
|
|
998
999
|
}]]));
|
|
999
1000
|
a("set", (e, t, r) => (r = r ? d(r) : () => {
|
|
1000
|
-
}, (n) => [[
|
|
1001
|
+
}, (n) => [[nt, e, {
|
|
1001
1002
|
set: function(o) {
|
|
1002
1003
|
const s = Object.create(n || {});
|
|
1003
1004
|
s.this = this, s[t] = o, r(s);
|
|
1004
1005
|
}
|
|
1005
1006
|
}]]));
|
|
1006
|
-
const
|
|
1007
|
+
const En = 20, Kt = 200;
|
|
1007
1008
|
$.prop = (e) => Nr(e) !== 58;
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
A(":",
|
|
1009
|
+
const vn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
|
|
1010
|
+
Qe("[]", Kt);
|
|
1011
|
+
Qe("{}", Kt);
|
|
1012
|
+
A(":", En - 1, !0);
|
|
1012
1013
|
a("{}", (e, t) => {
|
|
1013
1014
|
if (t !== void 0) return;
|
|
1014
|
-
if (!
|
|
1015
|
+
if (!vn(e)) return d(["{", e]);
|
|
1015
1016
|
e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
|
|
1016
1017
|
const r = e.map((n) => d(typeof n == "string" ? [":", n, n] : n));
|
|
1017
1018
|
return (n) => {
|
|
1018
1019
|
const o = {}, s = {};
|
|
1019
1020
|
for (const i of r.flatMap((u) => u(n)))
|
|
1020
|
-
if (i[0] ===
|
|
1021
|
+
if (i[0] === nt) {
|
|
1021
1022
|
const [, u, c] = i;
|
|
1022
1023
|
s[u] = { ...s[u], ...c, configurable: !0, enumerable: !0 };
|
|
1023
1024
|
} else o[i[0]] = i[1];
|
|
@@ -1028,19 +1029,19 @@ a("{}", (e, t) => {
|
|
|
1028
1029
|
a("{", (e) => (e = e ? d(e) : () => {
|
|
1029
1030
|
}, (t) => e(Object.create(t))));
|
|
1030
1031
|
a(":", (e, t) => (t = d(t), Array.isArray(e) ? (e = d(e), (r) => [[e(r), t(r)]]) : (r) => [[e, t(r)]]));
|
|
1031
|
-
const In = 170,
|
|
1032
|
-
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" },
|
|
1032
|
+
const In = 170, $e = 96, Cn = 36, wn = 123, On = 92, Dn = { n: `
|
|
1033
|
+
`, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, gt = () => {
|
|
1033
1034
|
const e = [];
|
|
1034
|
-
for (let t = "", r; (r = g.charCodeAt(p)) !==
|
|
1035
|
-
r ? r ===
|
|
1036
|
-
return
|
|
1037
|
-
}, Wn =
|
|
1038
|
-
|
|
1035
|
+
for (let t = "", r; (r = g.charCodeAt(p)) !== $e; )
|
|
1036
|
+
r ? r === On ? (C(), t += Dn[g[p]] || g[p], C()) : r === Cn && g.charCodeAt(p + 1) === wn ? (t && e.push([, t]), t = "", C(2), e.push(S(0, 125))) : (t += g[p], C(), r = g.charCodeAt(p), r === $e && t && e.push([, t])) : K("Unterminated template");
|
|
1037
|
+
return C(), e;
|
|
1038
|
+
}, Wn = N[$e];
|
|
1039
|
+
N[$e] = (e, t) => e && t < In ? $.asi && $.newline ? void 0 : (C(), ["``", e, ...gt()]) : (
|
|
1039
1040
|
// tagged
|
|
1040
1041
|
e ? (
|
|
1041
1042
|
// plain
|
|
1042
1043
|
Wn?.(e, t)
|
|
1043
|
-
) : (
|
|
1044
|
+
) : (C(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(gt()))
|
|
1044
1045
|
);
|
|
1045
1046
|
a("`", (...e) => (e = e.map(d), (t) => e.map((r) => r(t)).join("")));
|
|
1046
1047
|
a("``", (e, ...t) => {
|
|
@@ -1056,8 +1057,8 @@ $.number = { "0x": 16, "0b": 2, "0o": 8 };
|
|
|
1056
1057
|
const kn = {
|
|
1057
1058
|
log: (e, t) => (t ? console.log(t, e) : console.log(e), e)
|
|
1058
1059
|
};
|
|
1059
|
-
function
|
|
1060
|
-
const i = $(
|
|
1060
|
+
function te(e, t, r, n, o, s) {
|
|
1061
|
+
const i = $(st(e));
|
|
1061
1062
|
return d(i)({
|
|
1062
1063
|
$form: t,
|
|
1063
1064
|
$meta: r,
|
|
@@ -1068,7 +1069,7 @@ function ee(e, t, r, n, o, s) {
|
|
|
1068
1069
|
...s
|
|
1069
1070
|
}) === !0;
|
|
1070
1071
|
}
|
|
1071
|
-
function
|
|
1072
|
+
function st(e) {
|
|
1072
1073
|
return e.replace(
|
|
1073
1074
|
/(\?\.|\.)(\d+)/g,
|
|
1074
1075
|
(t, r, n, o) => r === "." && Fn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
|
|
@@ -1087,7 +1088,7 @@ const Tn = (e) => (t) => {
|
|
|
1087
1088
|
let r = t.formDef.states;
|
|
1088
1089
|
if (!r || Object.keys(r).length === 0 || t.formHealth.status === "errored")
|
|
1089
1090
|
return t;
|
|
1090
|
-
const { $formIsInvalid: n, $errors: o } =
|
|
1091
|
+
const { $formIsInvalid: n, $errors: o } = Xe(t);
|
|
1091
1092
|
r = jn(r);
|
|
1092
1093
|
let s = [], i = { status: "ok" };
|
|
1093
1094
|
try {
|
|
@@ -1095,7 +1096,7 @@ const Tn = (e) => (t) => {
|
|
|
1095
1096
|
const c = r[u];
|
|
1096
1097
|
let l;
|
|
1097
1098
|
try {
|
|
1098
|
-
l =
|
|
1099
|
+
l = te(c, t.data, t.meta, o, n, {
|
|
1099
1100
|
$fn: e
|
|
1100
1101
|
});
|
|
1101
1102
|
} catch {
|
|
@@ -1129,8 +1130,8 @@ function jn(e) {
|
|
|
1129
1130
|
}
|
|
1130
1131
|
return t;
|
|
1131
1132
|
}
|
|
1132
|
-
const Y = (e, t) => (r) => e(r) ? t(r) : r,
|
|
1133
|
-
const { $formIsInvalid: r, $errors: n } =
|
|
1133
|
+
const Y = (e, t) => (r) => e(r) ? t(r) : r, re = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e, Pn = (e) => (t) => {
|
|
1134
|
+
const { $formIsInvalid: r, $errors: n } = Xe(t);
|
|
1134
1135
|
return {
|
|
1135
1136
|
...t,
|
|
1136
1137
|
widgetFlags: Nn(t, n, r, e)
|
|
@@ -1149,13 +1150,13 @@ function Nn(e, t, r, n) {
|
|
|
1149
1150
|
}
|
|
1150
1151
|
return i;
|
|
1151
1152
|
}), s = Object.values(e.materializedRepeaterWidgets);
|
|
1152
|
-
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) ||
|
|
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(
|
|
1153
1154
|
(i, u) => {
|
|
1154
1155
|
i[u.uid] = i[u.uid] || {};
|
|
1155
|
-
const c = e.repeaterItemScopes[u.uid], l = c ? { $item:
|
|
1156
|
+
const c = e.repeaterItemScopes[u.uid], l = c ? { $item: V(e.data, c.itemPath), $index: c.index, $fn: n } : { $fn: n };
|
|
1156
1157
|
return u.include && "in" in u.include ? i[u.uid].hidden = !u.include.in.some(
|
|
1157
1158
|
(f) => e.currentStates.includes(f)
|
|
1158
|
-
) : u.include && "when" in u.include && (i[u.uid].hidden = !
|
|
1159
|
+
) : u.include && "when" in u.include && (i[u.uid].hidden = !te(
|
|
1159
1160
|
u.include.when,
|
|
1160
1161
|
e.data,
|
|
1161
1162
|
e.meta,
|
|
@@ -1164,21 +1165,21 @@ function Nn(e, t, r, n) {
|
|
|
1164
1165
|
l
|
|
1165
1166
|
)), u.exclude && "from" in u.exclude ? i[u.uid].hidden = u.exclude.from.some(
|
|
1166
1167
|
(f) => e.currentStates.includes(f)
|
|
1167
|
-
) : u.exclude && "when" in u.exclude && (i[u.uid].hidden =
|
|
1168
|
+
) : u.exclude && "when" in u.exclude && (i[u.uid].hidden = te(
|
|
1168
1169
|
u.exclude.when,
|
|
1169
1170
|
e.data,
|
|
1170
1171
|
e.meta,
|
|
1171
1172
|
t,
|
|
1172
1173
|
r,
|
|
1173
1174
|
l
|
|
1174
|
-
)), (D(u) ||
|
|
1175
|
+
)), (D(u) || fe(u)) && re(u.disabled) && (i[u.uid].disabled = te(
|
|
1175
1176
|
u.disabled.when,
|
|
1176
1177
|
e.data,
|
|
1177
1178
|
e.meta,
|
|
1178
1179
|
t,
|
|
1179
1180
|
r,
|
|
1180
1181
|
l
|
|
1181
|
-
)), D(u) &&
|
|
1182
|
+
)), D(u) && re(u.readonly) && (i[u.uid].readonly = te(
|
|
1182
1183
|
u.readonly.when,
|
|
1183
1184
|
e.data,
|
|
1184
1185
|
e.meta,
|
|
@@ -1192,7 +1193,7 @@ function Nn(e, t, r, n) {
|
|
|
1192
1193
|
}
|
|
1193
1194
|
const _n = (e, t) => (r) => {
|
|
1194
1195
|
try {
|
|
1195
|
-
return { ...r, calculatedWidgets:
|
|
1196
|
+
return { ...r, calculatedWidgets: Vn(r, e, t) };
|
|
1196
1197
|
} catch (n) {
|
|
1197
1198
|
const o = n;
|
|
1198
1199
|
return {
|
|
@@ -1205,8 +1206,8 @@ const _n = (e, t) => (r) => {
|
|
|
1205
1206
|
};
|
|
1206
1207
|
}
|
|
1207
1208
|
};
|
|
1208
|
-
function
|
|
1209
|
-
const { $formIsInvalid: n, $errors: o } =
|
|
1209
|
+
function Vn(e, t, r) {
|
|
1210
|
+
const { $formIsInvalid: n, $errors: o } = Xe(e), s = to(e, t, n, o, r), i = {};
|
|
1210
1211
|
for (const u of Object.keys(e.calculatedWidgets)) {
|
|
1211
1212
|
if (e.widgetFlags[u]?.hidden)
|
|
1212
1213
|
continue;
|
|
@@ -1216,11 +1217,11 @@ function Rn(e, t, r) {
|
|
|
1216
1217
|
continue;
|
|
1217
1218
|
}
|
|
1218
1219
|
if (G(l)) {
|
|
1219
|
-
i[u] =
|
|
1220
|
+
i[u] = Rn(u, l, e, t, f);
|
|
1220
1221
|
continue;
|
|
1221
1222
|
}
|
|
1222
|
-
const m = f ? { ...s, $item:
|
|
1223
|
-
i[u] =
|
|
1223
|
+
const m = f ? { ...s, $item: V(s.$form, f.itemPath), $index: f.index } : s;
|
|
1224
|
+
i[u] = Ln(
|
|
1224
1225
|
c,
|
|
1225
1226
|
l,
|
|
1226
1227
|
e,
|
|
@@ -1229,32 +1230,32 @@ function Rn(e, t, r) {
|
|
|
1229
1230
|
}
|
|
1230
1231
|
return i;
|
|
1231
1232
|
}
|
|
1232
|
-
function
|
|
1233
|
+
function Rn(e, t, r, n, o) {
|
|
1233
1234
|
const s = t({
|
|
1234
1235
|
$form: r.data,
|
|
1235
1236
|
errors: t.path ? r.validations[t.path] : void 0,
|
|
1236
1237
|
touched: t.path ? r.touchedControls[t.path] : void 0,
|
|
1237
1238
|
translate: n.translate,
|
|
1238
|
-
$item: o ?
|
|
1239
|
+
$item: o ? V(r.data, o.itemPath) : void 0,
|
|
1239
1240
|
$index: o?.index
|
|
1240
1241
|
});
|
|
1241
1242
|
return s.uid = e, { source: t, current: s };
|
|
1242
1243
|
}
|
|
1243
|
-
function
|
|
1244
|
+
function Ln(e, t, r, n) {
|
|
1244
1245
|
const o = new eo(t, e.current);
|
|
1245
|
-
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), gr(t) ? Un(o, n) :
|
|
1246
|
+
return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), gr(t) ? Un(o, n) : fe(t) ? Mn(o, n) : D(t) ? Hn(o, n) : ne(t) && zn(o, n), Bn(t, o, n, r), (fe(t) || D(t)) && Gn(t, o, n), ne(t) && Kn(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
|
|
1246
1247
|
}
|
|
1247
1248
|
function Un(e, t) {
|
|
1248
|
-
|
|
1249
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude");
|
|
1249
1250
|
}
|
|
1250
1251
|
function Mn(e, t) {
|
|
1251
|
-
|
|
1252
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude"), E(e, t, "label"), E(e, t, "disabled"), E(e, t, "actionType");
|
|
1252
1253
|
}
|
|
1253
1254
|
function Hn(e, t) {
|
|
1254
|
-
|
|
1255
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude"), E(e, t, "label"), E(e, t, "disabled"), E(e, t, "readonly"), E(e, t, "validator"), E(e, t, "path"), E(e, t, "defaultValue");
|
|
1255
1256
|
}
|
|
1256
1257
|
function zn(e, t) {
|
|
1257
|
-
|
|
1258
|
+
E(e, t, "size"), E(e, t, "include"), E(e, t, "exclude");
|
|
1258
1259
|
}
|
|
1259
1260
|
function Bn(e, t, r, n) {
|
|
1260
1261
|
const o = n.widgetPropOverrides[e.uid] ?? {}, s = { ...e.props ?? {}, ...o };
|
|
@@ -1272,11 +1273,11 @@ function Kn(e, t, r) {
|
|
|
1272
1273
|
const s = t.previous.children ?? [];
|
|
1273
1274
|
s.length === o.length && o.every((u, c) => s[c] && s[c].uid === o[c].uid) || t.markChanged();
|
|
1274
1275
|
}
|
|
1275
|
-
function
|
|
1276
|
+
function E(e, t, r) {
|
|
1276
1277
|
const n = e.source;
|
|
1277
1278
|
if (!ro(n, r))
|
|
1278
1279
|
return;
|
|
1279
|
-
const o =
|
|
1280
|
+
const o = ut(n, r, t.sortedStates);
|
|
1280
1281
|
let s;
|
|
1281
1282
|
switch (r) {
|
|
1282
1283
|
case "disabled":
|
|
@@ -1292,16 +1293,16 @@ function v(e, t, r) {
|
|
|
1292
1293
|
e.write(r, s);
|
|
1293
1294
|
}
|
|
1294
1295
|
function bn(e, t, r) {
|
|
1295
|
-
const n = e.source.props, o =
|
|
1296
|
+
const n = e.source.props, o = ut(n, r, t.sortedStates);
|
|
1296
1297
|
let s = Xt(o, t);
|
|
1297
1298
|
const i = t.widgetPropOverrides[e.source.uid]?.[r];
|
|
1298
1299
|
i !== void 0 && (s = i), e.write(`props.${r}`, s);
|
|
1299
1300
|
}
|
|
1300
1301
|
function Xn(e, t, r) {
|
|
1301
|
-
const n = e.source.on, o =
|
|
1302
|
+
const n = e.source.on, o = ut(n, r, t.sortedStates);
|
|
1302
1303
|
e.write(`on.${r}`, qn(o, t));
|
|
1303
1304
|
}
|
|
1304
|
-
function
|
|
1305
|
+
function it(e, t) {
|
|
1305
1306
|
return e({
|
|
1306
1307
|
$form: t.$form,
|
|
1307
1308
|
translate: t.localization.translate,
|
|
@@ -1315,7 +1316,7 @@ function Jn(e, t) {
|
|
|
1315
1316
|
const Qn = /\{\{([^}]+)\}\}/g;
|
|
1316
1317
|
function bt(e, t) {
|
|
1317
1318
|
return e.includes("{{") ? e.replace(Qn, (r, n) => {
|
|
1318
|
-
const o =
|
|
1319
|
+
const o = st(n.trim());
|
|
1319
1320
|
try {
|
|
1320
1321
|
const s = d($(o))({
|
|
1321
1322
|
$form: t.$form,
|
|
@@ -1334,15 +1335,15 @@ function bt(e, t) {
|
|
|
1334
1335
|
}) : e;
|
|
1335
1336
|
}
|
|
1336
1337
|
function Xt(e, t) {
|
|
1337
|
-
return typeof e == "function" ?
|
|
1338
|
+
return typeof e == "function" ? it(e, t) : Dr(e) ? Jn(e, t) : typeof e == "string" ? bt(e, t) : e;
|
|
1338
1339
|
}
|
|
1339
1340
|
function xn(e, t, r, n) {
|
|
1340
|
-
return typeof e == "function" ?
|
|
1341
|
+
return typeof e == "function" ? it(e, t) : re(e) ? t.widgetFlags[r]?.[n] : typeof e == "string" ? bt(e, t) : e;
|
|
1341
1342
|
}
|
|
1342
1343
|
function qn(e, t) {
|
|
1343
|
-
return typeof e == "function" ?
|
|
1344
|
+
return typeof e == "function" ? it(e, t) : e;
|
|
1344
1345
|
}
|
|
1345
|
-
function
|
|
1346
|
+
function ut(e, t, r) {
|
|
1346
1347
|
if (e) {
|
|
1347
1348
|
for (const n of r) {
|
|
1348
1349
|
const o = e[`${t}.${n}`];
|
|
@@ -1360,7 +1361,7 @@ function Yn(e, t) {
|
|
|
1360
1361
|
const o = String(e[n]);
|
|
1361
1362
|
if (Zn(o))
|
|
1362
1363
|
try {
|
|
1363
|
-
const s = d($(
|
|
1364
|
+
const s = d($(st(o)))({
|
|
1364
1365
|
$form: t.$form,
|
|
1365
1366
|
$meta: t.$meta,
|
|
1366
1367
|
$errors: t.$errors,
|
|
@@ -1390,7 +1391,7 @@ class eo {
|
|
|
1390
1391
|
this._changed = !0;
|
|
1391
1392
|
}
|
|
1392
1393
|
write(t, r) {
|
|
1393
|
-
|
|
1394
|
+
Ke(this.current, t, r), V(this.previous, t) !== r && (this._changed = !0);
|
|
1394
1395
|
}
|
|
1395
1396
|
}
|
|
1396
1397
|
function to(e, t, r, n, o) {
|
|
@@ -1430,7 +1431,7 @@ class xt extends Error {
|
|
|
1430
1431
|
}
|
|
1431
1432
|
const oo = ({ lang: e }, t) => {
|
|
1432
1433
|
const r = {
|
|
1433
|
-
...
|
|
1434
|
+
...Ct(e),
|
|
1434
1435
|
formName: t.payload.formName
|
|
1435
1436
|
};
|
|
1436
1437
|
let n = t.payload.formDef, o = { status: "ok" };
|
|
@@ -1462,7 +1463,7 @@ const oo = ({ lang: e }, t) => {
|
|
|
1462
1463
|
o = { status: "ok" };
|
|
1463
1464
|
let l = {};
|
|
1464
1465
|
try {
|
|
1465
|
-
l =
|
|
1466
|
+
l = be([s.value.form]).reduce(
|
|
1466
1467
|
(f, m) => {
|
|
1467
1468
|
const h = m.uid;
|
|
1468
1469
|
if (f[h])
|
|
@@ -1504,7 +1505,7 @@ function io(e) {
|
|
|
1504
1505
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1505
1506
|
return null;
|
|
1506
1507
|
const t = e.form;
|
|
1507
|
-
return t && typeof t == "object" && !Array.isArray(t) && !
|
|
1508
|
+
return t && typeof t == "object" && !Array.isArray(t) && !ne(t) ? qt(Q.initializeMalformedFormShapeError, so()) : null;
|
|
1508
1509
|
}
|
|
1509
1510
|
function uo(e, t) {
|
|
1510
1511
|
const r = (o) => D(o) ? ` at "${o.path}"` : "", n = `Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`;
|
|
@@ -1533,24 +1534,29 @@ function co(e, t) {
|
|
|
1533
1534
|
);
|
|
1534
1535
|
}
|
|
1535
1536
|
function lo(e, t) {
|
|
1537
|
+
const { path: r, issues: n } = t.payload, o = n?.length ? {
|
|
1538
|
+
touched: !0,
|
|
1539
|
+
touchedControls: { ...e.touchedControls, [r]: !0 }
|
|
1540
|
+
} : {};
|
|
1536
1541
|
return {
|
|
1537
1542
|
...e,
|
|
1543
|
+
...o,
|
|
1538
1544
|
injectedValidations: {
|
|
1539
1545
|
...e.injectedValidations,
|
|
1540
|
-
[
|
|
1546
|
+
[r]: n
|
|
1541
1547
|
}
|
|
1542
1548
|
};
|
|
1543
1549
|
}
|
|
1544
|
-
function
|
|
1550
|
+
function yt(e, t) {
|
|
1545
1551
|
const r = Zt(e.uid, t);
|
|
1546
1552
|
if (G(e)) {
|
|
1547
1553
|
const n = (o) => e(o);
|
|
1548
|
-
return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path =
|
|
1554
|
+
return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path = $t(e.path, t)), n;
|
|
1549
1555
|
}
|
|
1550
1556
|
return D(e) ? {
|
|
1551
1557
|
...e,
|
|
1552
1558
|
uid: r,
|
|
1553
|
-
path:
|
|
1559
|
+
path: $t(e.path, t)
|
|
1554
1560
|
} : {
|
|
1555
1561
|
...e,
|
|
1556
1562
|
uid: r
|
|
@@ -1562,7 +1568,7 @@ function Zt(e, t) {
|
|
|
1562
1568
|
const r = t.reduce((n, o) => `${n}[${o}]`, "");
|
|
1563
1569
|
return `${e}${r}`;
|
|
1564
1570
|
}
|
|
1565
|
-
function
|
|
1571
|
+
function $t(e, t) {
|
|
1566
1572
|
if (t.length === 0)
|
|
1567
1573
|
throw new Error("Repeater indexes cannot be an empty array");
|
|
1568
1574
|
const r = "items", n = e.split(`.${r}`), o = n.length - 1;
|
|
@@ -1594,7 +1600,7 @@ function po(e, t) {
|
|
|
1594
1600
|
function ho(e) {
|
|
1595
1601
|
return e !== null && typeof e == "object" && "when" in e && typeof e.when == "string";
|
|
1596
1602
|
}
|
|
1597
|
-
const
|
|
1603
|
+
const _ = (e) => {
|
|
1598
1604
|
const t = {}, r = {}, n = Object.values(e.flatForm).filter(
|
|
1599
1605
|
(o) => !G(o) && o.type === "repeater"
|
|
1600
1606
|
);
|
|
@@ -1603,10 +1609,10 @@ const R = (e) => {
|
|
|
1603
1609
|
return { ...e, repeaterItemScopes: t, materializedRepeaterWidgets: r };
|
|
1604
1610
|
};
|
|
1605
1611
|
function Yt(e, t, r, n, o) {
|
|
1606
|
-
const s = t.props.template, i =
|
|
1612
|
+
const s = t.props.template, i = V(e.data, t.path);
|
|
1607
1613
|
Array.isArray(i) && i.forEach((u, c) => {
|
|
1608
1614
|
const l = [...r, c], f = { itemPath: `${t.path}.${c}`, index: c };
|
|
1609
|
-
|
|
1615
|
+
be([s]).forEach((m) => {
|
|
1610
1616
|
let h;
|
|
1611
1617
|
if (G(m) ? (h = m({
|
|
1612
1618
|
$form: e.data,
|
|
@@ -1616,18 +1622,18 @@ function Yt(e, t, r, n, o) {
|
|
|
1616
1622
|
touched: void 0,
|
|
1617
1623
|
translate: void 0
|
|
1618
1624
|
}), h.uid = m.uid) : h = m, h.type === "repeater") {
|
|
1619
|
-
const X =
|
|
1625
|
+
const X = yt(
|
|
1620
1626
|
h,
|
|
1621
1627
|
l
|
|
1622
1628
|
);
|
|
1623
1629
|
n[Zt(h.uid, l)] = f, Yt(e, X, l, n, o);
|
|
1624
1630
|
return;
|
|
1625
1631
|
}
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1632
|
+
const w = po(
|
|
1633
|
+
yt(h, l),
|
|
1628
1634
|
l
|
|
1629
1635
|
);
|
|
1630
|
-
n[
|
|
1636
|
+
n[w.uid] = f, o[w.uid] = w;
|
|
1631
1637
|
});
|
|
1632
1638
|
});
|
|
1633
1639
|
}
|
|
@@ -1650,7 +1656,7 @@ const mo = (e, { payload: t }) => {
|
|
|
1650
1656
|
};
|
|
1651
1657
|
};
|
|
1652
1658
|
function go(e, t) {
|
|
1653
|
-
return
|
|
1659
|
+
return P(
|
|
1654
1660
|
e,
|
|
1655
1661
|
yo(t),
|
|
1656
1662
|
$o(t),
|
|
@@ -1661,45 +1667,45 @@ function go(e, t) {
|
|
|
1661
1667
|
const yo = (e) => (t) => ({
|
|
1662
1668
|
...t,
|
|
1663
1669
|
widgetFlags: {
|
|
1664
|
-
...
|
|
1670
|
+
...Ie(t.widgetFlags, e.payload.uid)
|
|
1665
1671
|
}
|
|
1666
1672
|
}), $o = (e) => (t) => ({
|
|
1667
1673
|
...t,
|
|
1668
1674
|
// TODO: has this already been removed in calculate-widget-props??? Do we need this at all?
|
|
1669
1675
|
calculatedWidgets: {
|
|
1670
|
-
...
|
|
1676
|
+
...Ie(t.calculatedWidgets, e.payload.uid)
|
|
1671
1677
|
}
|
|
1672
1678
|
}), Ao = (e) => (t) => ({
|
|
1673
1679
|
...t,
|
|
1674
1680
|
widgetPropOverrides: {
|
|
1675
|
-
...
|
|
1681
|
+
...Ie(t.widgetPropOverrides, e.payload.uid)
|
|
1676
1682
|
}
|
|
1677
1683
|
}), So = (e) => (t) => ({
|
|
1678
1684
|
...t,
|
|
1679
|
-
touchedControls:
|
|
1685
|
+
touchedControls: P(t.touchedControls, (r) => {
|
|
1680
1686
|
const n = t.flatForm[e.payload.uid];
|
|
1681
|
-
return n && D(n) ?
|
|
1687
|
+
return n && D(n) ? Ie(r, n.path) : r;
|
|
1682
1688
|
})
|
|
1683
|
-
}),
|
|
1689
|
+
}), Eo = (e, t) => ({
|
|
1684
1690
|
...e,
|
|
1685
1691
|
data: { ...t.payload.data }
|
|
1686
|
-
}),
|
|
1692
|
+
}), vo = (e, t) => ({
|
|
1687
1693
|
...e,
|
|
1688
1694
|
formHealth: t.payload.formHealth
|
|
1689
1695
|
}), Io = (e, t) => ({
|
|
1690
1696
|
...e,
|
|
1691
1697
|
lang: t.payload.lang
|
|
1692
|
-
}),
|
|
1698
|
+
}), Co = (e, t) => ({
|
|
1693
1699
|
...e,
|
|
1694
1700
|
meta: { ...t.payload.meta }
|
|
1695
|
-
}),
|
|
1696
|
-
const r =
|
|
1701
|
+
}), wo = (e, t) => {
|
|
1702
|
+
const r = V(e.data, t.payload.path);
|
|
1697
1703
|
return t.type === "SET_WIDGET_DATA" || t.type === "SET_WIDGET_INITIAL_DATA" && r === void 0 ? {
|
|
1698
1704
|
...e,
|
|
1699
|
-
data: { ...
|
|
1705
|
+
data: { ...Ke(e.data, t.payload.path, t.payload.data) }
|
|
1700
1706
|
} : e;
|
|
1701
1707
|
}, er = /* @__PURE__ */ Symbol("filterMap.skip");
|
|
1702
|
-
function
|
|
1708
|
+
function Oo(e, t) {
|
|
1703
1709
|
const r = [];
|
|
1704
1710
|
for (let n = 0; n < e.length; n++) {
|
|
1705
1711
|
const o = t(e[n], n, e);
|
|
@@ -1719,8 +1725,8 @@ function Do(e, t, r) {
|
|
|
1719
1725
|
return !1;
|
|
1720
1726
|
return !0;
|
|
1721
1727
|
}
|
|
1722
|
-
const
|
|
1723
|
-
const n =
|
|
1728
|
+
const le = (e, t) => (r) => {
|
|
1729
|
+
const n = Oo(
|
|
1724
1730
|
Object.values(r.calculatedWidgets),
|
|
1725
1731
|
({ current: s }) => D(s) ? s : er
|
|
1726
1732
|
), o = r.validations;
|
|
@@ -1729,7 +1735,7 @@ const ke = (e, t) => (r) => {
|
|
|
1729
1735
|
validations: n.reduce(
|
|
1730
1736
|
(s, i) => {
|
|
1731
1737
|
if (s[i.path] = null, i.validator) {
|
|
1732
|
-
const u = e(i.validator, t), c =
|
|
1738
|
+
const u = e(i.validator, t), c = V(r.data, i.path), l = ur(
|
|
1733
1739
|
u,
|
|
1734
1740
|
c
|
|
1735
1741
|
);
|
|
@@ -1756,53 +1762,63 @@ const ke = (e, t) => (r) => {
|
|
|
1756
1762
|
case "INITIALIZE":
|
|
1757
1763
|
return oo(u, c);
|
|
1758
1764
|
case "SET_DATA":
|
|
1759
|
-
return
|
|
1760
|
-
|
|
1765
|
+
return P(
|
|
1766
|
+
Eo(u, c),
|
|
1761
1767
|
o,
|
|
1762
|
-
|
|
1768
|
+
_,
|
|
1763
1769
|
s,
|
|
1764
1770
|
i
|
|
1765
1771
|
);
|
|
1766
1772
|
case "SET_META":
|
|
1767
|
-
return
|
|
1768
|
-
|
|
1773
|
+
return P(
|
|
1774
|
+
Co(u, c),
|
|
1769
1775
|
o,
|
|
1770
|
-
|
|
1776
|
+
_,
|
|
1771
1777
|
s,
|
|
1772
1778
|
i
|
|
1773
1779
|
);
|
|
1774
1780
|
case "SET_LANGUAGE":
|
|
1775
|
-
return
|
|
1776
|
-
case "ADD_WIDGET":
|
|
1777
|
-
|
|
1781
|
+
return P(Io(u, c), i);
|
|
1782
|
+
case "ADD_WIDGET": {
|
|
1783
|
+
const l = P(
|
|
1778
1784
|
Pr(u, c),
|
|
1779
|
-
Y(
|
|
1780
|
-
Y(
|
|
1781
|
-
Y(
|
|
1782
|
-
Y(
|
|
1785
|
+
Y(ee, o),
|
|
1786
|
+
Y(ee, _),
|
|
1787
|
+
Y(ee, s),
|
|
1788
|
+
Y(ee, i)
|
|
1783
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;
|
|
1799
|
+
}
|
|
1784
1800
|
case "REMOVE_WIDGET":
|
|
1785
|
-
return
|
|
1801
|
+
return P(
|
|
1786
1802
|
go(u, c),
|
|
1787
1803
|
o,
|
|
1788
|
-
|
|
1804
|
+
_,
|
|
1789
1805
|
s,
|
|
1790
1806
|
i
|
|
1791
1807
|
);
|
|
1792
1808
|
case "SET_WIDGET_INITIAL_DATA":
|
|
1793
1809
|
case "SET_WIDGET_DATA":
|
|
1794
|
-
return
|
|
1795
|
-
|
|
1810
|
+
return P(
|
|
1811
|
+
wo(u, c),
|
|
1796
1812
|
o,
|
|
1797
|
-
|
|
1813
|
+
_,
|
|
1798
1814
|
s,
|
|
1799
1815
|
i
|
|
1800
1816
|
);
|
|
1801
1817
|
case "OVERRIDE_WIDGET_PROP":
|
|
1802
|
-
return
|
|
1818
|
+
return P(
|
|
1803
1819
|
mo(u, c),
|
|
1804
1820
|
o,
|
|
1805
|
-
|
|
1821
|
+
_,
|
|
1806
1822
|
s,
|
|
1807
1823
|
i,
|
|
1808
1824
|
// Apply validation here because this action can be dispatched from the form's event handlers callback
|
|
@@ -1814,16 +1830,17 @@ const ke = (e, t) => (r) => {
|
|
|
1814
1830
|
const h = f && l.touchedControls[m];
|
|
1815
1831
|
return l.touched && h;
|
|
1816
1832
|
},
|
|
1817
|
-
|
|
1833
|
+
le(e, r)
|
|
1818
1834
|
)
|
|
1819
1835
|
);
|
|
1820
1836
|
case "SET_FORM_HEALTH":
|
|
1821
|
-
return
|
|
1837
|
+
return vo(u, c);
|
|
1822
1838
|
case "VALIDATE_ALL":
|
|
1823
|
-
return
|
|
1839
|
+
return P(
|
|
1824
1840
|
{
|
|
1825
1841
|
...u,
|
|
1826
1842
|
touched: !0,
|
|
1843
|
+
allControlsValidated: !0,
|
|
1827
1844
|
touchedControls: Object.keys(u.calculatedWidgets).reduce(
|
|
1828
1845
|
(l, f) => {
|
|
1829
1846
|
const m = u.calculatedWidgets[f].source;
|
|
@@ -1832,46 +1849,46 @@ const ke = (e, t) => (r) => {
|
|
|
1832
1849
|
{}
|
|
1833
1850
|
)
|
|
1834
1851
|
},
|
|
1835
|
-
|
|
1852
|
+
le(e, r),
|
|
1836
1853
|
// This handles $errors and $formIsValid expressions variables
|
|
1837
1854
|
o,
|
|
1838
|
-
|
|
1855
|
+
_,
|
|
1839
1856
|
s,
|
|
1840
1857
|
i,
|
|
1841
|
-
|
|
1858
|
+
Fe
|
|
1842
1859
|
);
|
|
1843
1860
|
case "ATTEMPT_VALIDATION": {
|
|
1844
1861
|
const l = c.payload.reason, f = c.payload.path;
|
|
1845
|
-
return t === "eager" || l === t || t.includes(l) ?
|
|
1862
|
+
return t === "eager" || l === t || t.includes(l) ? P(
|
|
1846
1863
|
{
|
|
1847
1864
|
...u,
|
|
1848
1865
|
touched: !0,
|
|
1849
1866
|
touchedControls: { ...u.touchedControls, [f]: !0 }
|
|
1850
1867
|
},
|
|
1851
|
-
|
|
1868
|
+
le(e, r),
|
|
1852
1869
|
// This handles $errors and $formIsValid expressions variables
|
|
1853
1870
|
o,
|
|
1854
|
-
|
|
1871
|
+
_,
|
|
1855
1872
|
s,
|
|
1856
1873
|
i,
|
|
1857
1874
|
// TODO: extract this into a separate function
|
|
1858
1875
|
// When the widget is a Widget Function, we propagate the validation result immediately
|
|
1859
1876
|
(h) => {
|
|
1860
|
-
const
|
|
1861
|
-
if (G(
|
|
1862
|
-
const Oe = h.repeaterItemScopes[
|
|
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({
|
|
1863
1880
|
$form: h.data,
|
|
1864
1881
|
errors: h.validations[f],
|
|
1865
1882
|
touched: !0,
|
|
1866
1883
|
translate: r.translate,
|
|
1867
|
-
$item: Oe ?
|
|
1884
|
+
$item: Oe ? V(h.data, Oe.itemPath) : void 0,
|
|
1868
1885
|
$index: Oe?.index
|
|
1869
1886
|
});
|
|
1870
1887
|
return {
|
|
1871
1888
|
...h,
|
|
1872
1889
|
calculatedWidgets: {
|
|
1873
1890
|
...h.calculatedWidgets,
|
|
1874
|
-
[
|
|
1891
|
+
[w]: {
|
|
1875
1892
|
source: X.source,
|
|
1876
1893
|
current: nr
|
|
1877
1894
|
}
|
|
@@ -1880,7 +1897,7 @@ const ke = (e, t) => (r) => {
|
|
|
1880
1897
|
}
|
|
1881
1898
|
return h;
|
|
1882
1899
|
},
|
|
1883
|
-
|
|
1900
|
+
Fe
|
|
1884
1901
|
) : u;
|
|
1885
1902
|
}
|
|
1886
1903
|
case "INJECT_VALIDATION_ISSUES":
|
|
@@ -1889,8 +1906,8 @@ const ke = (e, t) => (r) => {
|
|
|
1889
1906
|
return kr(c);
|
|
1890
1907
|
}
|
|
1891
1908
|
};
|
|
1892
|
-
},
|
|
1893
|
-
function
|
|
1909
|
+
}, ee = (e) => e.formHealth.status === "ok";
|
|
1910
|
+
function Fe(e) {
|
|
1894
1911
|
const t = Object.keys(e.injectedValidations), r = Object.keys(e.validations);
|
|
1895
1912
|
if (t.length === 0 && r.length === 0)
|
|
1896
1913
|
return { ...e, isFormValid: !0 };
|
|
@@ -1902,9 +1919,9 @@ function $t(e) {
|
|
|
1902
1919
|
), n !== void 0 ? { ...e, isFormValid: !1 } : { ...e, isFormValid: !0 });
|
|
1903
1920
|
}
|
|
1904
1921
|
function ko(e = [], t, r, n, o = {}) {
|
|
1905
|
-
const s = new or(
|
|
1922
|
+
const s = new or(Ct(n.lang)), i = s.asObservable().pipe(k()), u = Wo({ validators: t, validateOn: r, localization: n, functions: o });
|
|
1906
1923
|
function c(h) {
|
|
1907
|
-
const
|
|
1924
|
+
const w = s.getValue(), X = u(w, h);
|
|
1908
1925
|
s.next(X);
|
|
1909
1926
|
}
|
|
1910
1927
|
let l = c;
|
|
@@ -1913,7 +1930,7 @@ function ko(e = [], t, r, n, o = {}) {
|
|
|
1913
1930
|
dispatch: (h) => l(h)
|
|
1914
1931
|
// reference is updated later
|
|
1915
1932
|
};
|
|
1916
|
-
return l = e.map((h) => h(f)).reduceRight((h,
|
|
1933
|
+
return l = e.map((h) => h(f)).reduceRight((h, w) => w(h), c), {
|
|
1917
1934
|
state$: i,
|
|
1918
1935
|
dispatch: l,
|
|
1919
1936
|
getState: () => s.getValue()
|
|
@@ -1921,7 +1938,7 @@ function ko(e = [], t, r, n, o = {}) {
|
|
|
1921
1938
|
}
|
|
1922
1939
|
class Bo {
|
|
1923
1940
|
constructor() {
|
|
1924
|
-
this.widgetRegistry = new
|
|
1941
|
+
this.widgetRegistry = new Pe(), this.store = {}, this.events$ = new ct(), this.submit$ = new ct(), this.uuid = crypto.randomUUID(), this.itemRenderers = {}, this.dependencies = {};
|
|
1925
1942
|
}
|
|
1926
1943
|
initialize(t, r = [], n, o, s, i = Wr(), u, c = {}) {
|
|
1927
1944
|
this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store = ko(r, n, o, i, c);
|
|
@@ -1933,7 +1950,7 @@ class Bo {
|
|
|
1933
1950
|
const u = r.on?.[`${t}.${i}`];
|
|
1934
1951
|
this.attemptValidation(t, r), u && this.events$.next({
|
|
1935
1952
|
name: u,
|
|
1936
|
-
data:
|
|
1953
|
+
data: De(this.store.getState()),
|
|
1937
1954
|
detail: n ?? void 0,
|
|
1938
1955
|
callback: (c) => {
|
|
1939
1956
|
this.store.dispatch(c);
|
|
@@ -1944,7 +1961,7 @@ class Bo {
|
|
|
1944
1961
|
const i = r.on?.[t];
|
|
1945
1962
|
this.attemptValidation(t, r), i && this.events$.next({
|
|
1946
1963
|
name: i,
|
|
1947
|
-
data:
|
|
1964
|
+
data: De(this.store.getState()),
|
|
1948
1965
|
detail: n,
|
|
1949
1966
|
callback: (u) => {
|
|
1950
1967
|
this.store.dispatch(u);
|
|
@@ -1956,7 +1973,7 @@ class Bo {
|
|
|
1956
1973
|
this.store.dispatch({
|
|
1957
1974
|
type: "VALIDATE_ALL"
|
|
1958
1975
|
}), this.store.getState().isFormValid && this.submit$.next({
|
|
1959
|
-
data:
|
|
1976
|
+
data: De(this.store.getState()),
|
|
1960
1977
|
callback: (t) => {
|
|
1961
1978
|
this.store.dispatch(t);
|
|
1962
1979
|
}
|
|
@@ -1988,10 +2005,10 @@ const Fo = T(
|
|
|
1988
2005
|
k()
|
|
1989
2006
|
), Ko = (e) => T(
|
|
1990
2007
|
Fo,
|
|
1991
|
-
W((t) =>
|
|
2008
|
+
W((t) => V(t, e)),
|
|
1992
2009
|
k()
|
|
1993
2010
|
), To = T(
|
|
1994
|
-
|
|
2011
|
+
Ae((e) => e.touched === !0),
|
|
1995
2012
|
W((e) => e.validations),
|
|
1996
2013
|
k()
|
|
1997
2014
|
), bo = (e) => T(
|
|
@@ -1999,7 +2016,7 @@ const Fo = T(
|
|
|
1999
2016
|
W((t) => t[e]),
|
|
2000
2017
|
k()
|
|
2001
2018
|
), jo = T(
|
|
2002
|
-
|
|
2019
|
+
Ae((e) => e.touched === !0),
|
|
2003
2020
|
W((e) => e.injectedValidations),
|
|
2004
2021
|
k()
|
|
2005
2022
|
), Xo = (e) => T(
|
|
@@ -2016,13 +2033,13 @@ const Fo = T(
|
|
|
2016
2033
|
k()
|
|
2017
2034
|
), Jo = (e) => (t) => sr([t.pipe(Po), t.pipe(tr)]).pipe(
|
|
2018
2035
|
W(([r, n]) => ({ lang: r, widget: n[e] })),
|
|
2019
|
-
|
|
2036
|
+
Ae((r) => r.widget !== void 0),
|
|
2020
2037
|
k((r, n) => r.lang === n.lang && r.widget === n.widget),
|
|
2021
2038
|
W((r) => r.widget.current)
|
|
2022
2039
|
), Qo = (e) => T(
|
|
2023
2040
|
tr,
|
|
2024
2041
|
W((t) => t[e]),
|
|
2025
|
-
|
|
2042
|
+
Ae((t) => t !== void 0),
|
|
2026
2043
|
W((t) => t.current.children),
|
|
2027
2044
|
k()
|
|
2028
2045
|
);
|
|
@@ -2045,11 +2062,11 @@ let rr = !1;
|
|
|
2045
2062
|
function Zo() {
|
|
2046
2063
|
rr = !0;
|
|
2047
2064
|
}
|
|
2048
|
-
function
|
|
2065
|
+
function Vo() {
|
|
2049
2066
|
return rr;
|
|
2050
2067
|
}
|
|
2051
2068
|
function Yo(e, t, r) {
|
|
2052
|
-
if (!
|
|
2069
|
+
if (!Vo())
|
|
2053
2070
|
return;
|
|
2054
2071
|
const n = Object.keys(t ?? {}).filter((o) => o in r);
|
|
2055
2072
|
if (n.length > 0)
|
|
@@ -2062,7 +2079,7 @@ export {
|
|
|
2062
2079
|
Yo as assertNoPropCollisions,
|
|
2063
2080
|
Qo as calculatedLayoutChildrenByUid$,
|
|
2064
2081
|
Jo as calculatedWidgetsByUid$,
|
|
2065
|
-
|
|
2082
|
+
_e as cloneObject,
|
|
2066
2083
|
Ko as dataByPath$,
|
|
2067
2084
|
Uo as defineForm,
|
|
2068
2085
|
Go as devToolsMiddleware,
|
|
@@ -2075,7 +2092,7 @@ export {
|
|
|
2075
2092
|
Wr as identityTranslator,
|
|
2076
2093
|
Xo as injectedValidationByPath$,
|
|
2077
2094
|
dr as isStandardValidateSuccess,
|
|
2078
|
-
|
|
2095
|
+
yt as makeRepeaterItemConfig,
|
|
2079
2096
|
mr as shortUUID,
|
|
2080
2097
|
ur as standardValidate,
|
|
2081
2098
|
xo as touchedControlsByPath$,
|