@regulaforensics/idv-gui 3.10.568-nightly → 3.10.569-nightly
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +15 -11
- package/dist/main.iife.js +2 -2
- package/dist/main.js +926 -804
- package/dist/main.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -988,23 +988,16 @@ function U(e) {
|
|
|
988
988
|
if (e) return /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e) ? e : void 0;
|
|
989
989
|
}
|
|
990
990
|
var sn = (e, t) => e.reduce((e, n) => {
|
|
991
|
-
if (n.answerType === Zt.text) {
|
|
991
|
+
if (n.answerType === Zt.text || n.answerType === Zt.selector) {
|
|
992
992
|
var r;
|
|
993
993
|
if ((r = n.property) != null && r.id) {
|
|
994
994
|
let r = t.find((e) => e.name === n.property.id);
|
|
995
995
|
if (r != null && r.string) return z(z({}, e), {}, { [n.id]: r.string });
|
|
996
996
|
}
|
|
997
997
|
}
|
|
998
|
-
if (n.answerType === Zt.
|
|
998
|
+
if (n.answerType === Zt.multiSelector) {
|
|
999
999
|
var i;
|
|
1000
1000
|
if ((i = n.property) != null && i.id) {
|
|
1001
|
-
let r = t.find((e) => e.name === n.property.id);
|
|
1002
|
-
if (r != null && r.string) return z(z({}, e), {}, { [n.id]: r.string });
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
if (n.answerType === Zt.multiSelector) {
|
|
1006
|
-
var a;
|
|
1007
|
-
if ((a = n.property) != null && a.id) {
|
|
1008
1001
|
let r = t.find((e) => e.name === n.property.id);
|
|
1009
1002
|
if (r != null && r.array) return z(z({}, e), {}, { [n.id]: r.array });
|
|
1010
1003
|
}
|
|
@@ -2319,7 +2312,46 @@ function gi(e) {
|
|
|
2319
2312
|
}
|
|
2320
2313
|
var _i = (e) => e.render(gi(e)), vi = K.createContext(null);
|
|
2321
2314
|
vi.displayName = "HookFormContext";
|
|
2322
|
-
var yi = (
|
|
2315
|
+
var yi = () => K.useContext(vi), bi = ({ children: e, watch: t, getValues: n, getFieldState: r, setError: i, clearErrors: a, setValue: o, setValues: s, trigger: c, formState: l, resetField: u, reset: d, handleSubmit: f, unregister: p, control: m, register: h, setFocus: g, subscribe: _ }) => {
|
|
2316
|
+
let v = K.useMemo(() => ({
|
|
2317
|
+
watch: t,
|
|
2318
|
+
getValues: n,
|
|
2319
|
+
getFieldState: r,
|
|
2320
|
+
setError: i,
|
|
2321
|
+
clearErrors: a,
|
|
2322
|
+
setValue: o,
|
|
2323
|
+
setValues: s,
|
|
2324
|
+
trigger: c,
|
|
2325
|
+
formState: l,
|
|
2326
|
+
resetField: u,
|
|
2327
|
+
reset: d,
|
|
2328
|
+
handleSubmit: f,
|
|
2329
|
+
unregister: p,
|
|
2330
|
+
control: m,
|
|
2331
|
+
register: h,
|
|
2332
|
+
setFocus: g,
|
|
2333
|
+
subscribe: _
|
|
2334
|
+
}), [
|
|
2335
|
+
a,
|
|
2336
|
+
m,
|
|
2337
|
+
l,
|
|
2338
|
+
r,
|
|
2339
|
+
n,
|
|
2340
|
+
f,
|
|
2341
|
+
h,
|
|
2342
|
+
d,
|
|
2343
|
+
u,
|
|
2344
|
+
i,
|
|
2345
|
+
g,
|
|
2346
|
+
o,
|
|
2347
|
+
s,
|
|
2348
|
+
_,
|
|
2349
|
+
c,
|
|
2350
|
+
p,
|
|
2351
|
+
t
|
|
2352
|
+
]);
|
|
2353
|
+
return K.createElement(vi.Provider, { value: v }, K.createElement(ai.Provider, { value: v.control }, e));
|
|
2354
|
+
}, xi = (e, t, n, r, i) => t ? z(z({}, n[e]), {}, { types: z(z({}, n[e] && n[e].types ? n[e].types : {}), {}, { [r]: i || !0 }) }) : {}, Si = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Ci = (e) => Array.isArray(e) ? e : [e], wi = () => {
|
|
2323
2355
|
let e = [];
|
|
2324
2356
|
return {
|
|
2325
2357
|
get observers() {
|
|
@@ -2336,23 +2368,23 @@ var yi = (e, t, n, r, i) => t ? z(z({}, n[e]), {}, { types: z(z({}, n[e] && n[e]
|
|
|
2336
2368
|
}
|
|
2337
2369
|
};
|
|
2338
2370
|
};
|
|
2339
|
-
function
|
|
2371
|
+
function Ti(e, t) {
|
|
2340
2372
|
let n = {};
|
|
2341
2373
|
for (let r in e) if (e.hasOwnProperty(r)) {
|
|
2342
2374
|
let i = e[r], a = t[r];
|
|
2343
2375
|
if (i && q(i) && a) {
|
|
2344
|
-
let e =
|
|
2376
|
+
let e = Ti(i, a);
|
|
2345
2377
|
q(e) && (n[r] = e);
|
|
2346
2378
|
} else e[r] && (n[r] = a);
|
|
2347
2379
|
}
|
|
2348
2380
|
return n;
|
|
2349
2381
|
}
|
|
2350
|
-
var
|
|
2382
|
+
var Ei = (e) => q(e) && !Object.keys(e).length, Di = (e) => e.type === "file", Oi = (e) => {
|
|
2351
2383
|
if (!Jr) return !1;
|
|
2352
2384
|
let t = e ? e.ownerDocument : 0;
|
|
2353
2385
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
2354
|
-
},
|
|
2355
|
-
function
|
|
2386
|
+
}, ki = (e) => e.type === "select-multiple", Ai = (e) => e.type === "radio", ji = (e) => Ai(e) || Vr(e), Mi = (e) => Oi(e) && e.isConnected;
|
|
2387
|
+
function Ni(e, t) {
|
|
2356
2388
|
let n = t.slice(0, -1).length, r = 0;
|
|
2357
2389
|
for (; r < n;) {
|
|
2358
2390
|
if (Ur(e)) {
|
|
@@ -2363,65 +2395,65 @@ function ji(e, t) {
|
|
|
2363
2395
|
}
|
|
2364
2396
|
return e;
|
|
2365
2397
|
}
|
|
2366
|
-
function
|
|
2398
|
+
function Pi(e) {
|
|
2367
2399
|
for (let t in e) if (e.hasOwnProperty(t) && !Y(e[t])) return !1;
|
|
2368
2400
|
return !0;
|
|
2369
2401
|
}
|
|
2370
2402
|
function Q(e, t) {
|
|
2371
2403
|
if (ui(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
|
|
2372
|
-
let n = Array.isArray(t) ? t : ti(t) ? [t] : ni(t), r = n.length === 1 ? e :
|
|
2373
|
-
return r && delete r[a], i !== 0 && (q(r) &&
|
|
2404
|
+
let n = Array.isArray(t) ? t : ti(t) ? [t] : ni(t), r = n.length === 1 ? e : Ni(e, n), i = n.length - 1, a = n[i];
|
|
2405
|
+
return r && delete r[a], i !== 0 && (q(r) && Ei(r) || Array.isArray(r) && Pi(r)) && Q(e, n.slice(0, -1)), e;
|
|
2374
2406
|
}
|
|
2375
|
-
var
|
|
2407
|
+
var Fi = (e) => {
|
|
2376
2408
|
for (let t in e) if (ii(e[t])) return !0;
|
|
2377
2409
|
return !1;
|
|
2378
2410
|
};
|
|
2379
|
-
function
|
|
2380
|
-
return Array.isArray(e) || q(e) && !
|
|
2411
|
+
function Ii(e) {
|
|
2412
|
+
return Array.isArray(e) || q(e) && !Fi(e);
|
|
2381
2413
|
}
|
|
2382
|
-
function
|
|
2414
|
+
function Li(e, t = {}) {
|
|
2383
2415
|
for (let n in e) {
|
|
2384
2416
|
let r = e[n];
|
|
2385
|
-
|
|
2417
|
+
Ii(r) ? (t[n] = Array.isArray(r) ? [] : {}, Li(r, t[n])) : Y(r) || (t[n] = !0);
|
|
2386
2418
|
}
|
|
2387
2419
|
return t;
|
|
2388
2420
|
}
|
|
2389
|
-
function
|
|
2421
|
+
function Ri(e) {
|
|
2390
2422
|
if (e !== !1) {
|
|
2391
2423
|
if (e === !0) return !0;
|
|
2392
2424
|
if (Array.isArray(e)) {
|
|
2393
|
-
let t = e.map((e) =>
|
|
2425
|
+
let t = e.map((e) => Ri(e));
|
|
2394
2426
|
return t.some((e) => e !== void 0) ? t : void 0;
|
|
2395
2427
|
}
|
|
2396
2428
|
if (q(e)) {
|
|
2397
2429
|
let t = {};
|
|
2398
2430
|
for (let n in e) {
|
|
2399
|
-
let r =
|
|
2431
|
+
let r = Ri(e[n]);
|
|
2400
2432
|
Y(r) || (t[n] = r);
|
|
2401
2433
|
}
|
|
2402
2434
|
return Object.keys(t).length ? t : void 0;
|
|
2403
2435
|
}
|
|
2404
2436
|
}
|
|
2405
2437
|
}
|
|
2406
|
-
function
|
|
2407
|
-
n || (n =
|
|
2438
|
+
function zi(e, t, n) {
|
|
2439
|
+
n || (n = Li(t));
|
|
2408
2440
|
for (let r in e) {
|
|
2409
2441
|
let i = e[r];
|
|
2410
|
-
if (
|
|
2442
|
+
if (Ii(i)) Y(t) || fi(n[r]) ? n[r] = Li(i, Array.isArray(i) ? [] : {}) : zi(i, Ur(t) ? {} : t[r], n[r]);
|
|
2411
2443
|
else {
|
|
2412
2444
|
let e = t[r];
|
|
2413
2445
|
n[r] = !mi(i, e);
|
|
2414
2446
|
}
|
|
2415
2447
|
}
|
|
2416
|
-
return
|
|
2448
|
+
return Ri(n) || {};
|
|
2417
2449
|
}
|
|
2418
|
-
var
|
|
2450
|
+
var Bi = {
|
|
2419
2451
|
value: !1,
|
|
2420
2452
|
isValid: !1
|
|
2421
|
-
},
|
|
2453
|
+
}, Vi = {
|
|
2422
2454
|
value: !0,
|
|
2423
2455
|
isValid: !0
|
|
2424
|
-
},
|
|
2456
|
+
}, Hi = (e) => {
|
|
2425
2457
|
if (Array.isArray(e)) {
|
|
2426
2458
|
if (e.length > 1) {
|
|
2427
2459
|
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
@@ -2430,24 +2462,24 @@ var Ri = {
|
|
|
2430
2462
|
isValid: !!t.length
|
|
2431
2463
|
};
|
|
2432
2464
|
}
|
|
2433
|
-
return e[0].checked && !e[0].disabled ? e[0].attributes && !Y(e[0].attributes.value) ? Y(e[0].value) || e[0].value === "" ?
|
|
2465
|
+
return e[0].checked && !e[0].disabled ? e[0].attributes && !Y(e[0].attributes.value) ? Y(e[0].value) || e[0].value === "" ? Vi : {
|
|
2434
2466
|
value: e[0].value,
|
|
2435
2467
|
isValid: !0
|
|
2436
|
-
} :
|
|
2468
|
+
} : Vi : Bi;
|
|
2437
2469
|
}
|
|
2438
|
-
return
|
|
2439
|
-
},
|
|
2470
|
+
return Bi;
|
|
2471
|
+
}, Ui = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => Y(e) ? e : t ? e === "" ? NaN : e && +e : n && ui(e) ? new Date(e) : r ? r(e) : e, Wi = {
|
|
2440
2472
|
isValid: !1,
|
|
2441
2473
|
value: null
|
|
2442
|
-
},
|
|
2474
|
+
}, Gi = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
2443
2475
|
isValid: !0,
|
|
2444
2476
|
value: t.value
|
|
2445
|
-
} : e,
|
|
2446
|
-
function
|
|
2477
|
+
} : e, Wi) : Wi;
|
|
2478
|
+
function Ki(e) {
|
|
2447
2479
|
let t = e.ref;
|
|
2448
|
-
return
|
|
2480
|
+
return Di(t) ? t.files : Ai(t) ? Gi(e.refs).value : ki(t) ? [...t.selectedOptions].map(({ value: e }) => e) : Vr(t) ? Hi(e.refs).value : Ui(Y(t.value) ? e.ref.value : t.value, e);
|
|
2449
2481
|
}
|
|
2450
|
-
var
|
|
2482
|
+
var qi = (e, t, n, r) => {
|
|
2451
2483
|
let i = {};
|
|
2452
2484
|
for (let n of e) {
|
|
2453
2485
|
let e = X(t, n);
|
|
@@ -2459,25 +2491,25 @@ var Gi = (e, t, n, r) => {
|
|
|
2459
2491
|
fields: i,
|
|
2460
2492
|
shouldUseNativeValidation: r
|
|
2461
2493
|
};
|
|
2462
|
-
},
|
|
2494
|
+
}, Ji = (e) => e instanceof RegExp, Yi = (e) => Y(e) ? e : Ji(e) ? e.source : q(e) ? Ji(e.value) ? e.value.source : e.value : e, Xi = (e) => ({
|
|
2463
2495
|
isOnSubmit: !e || e === Xr.onSubmit,
|
|
2464
2496
|
isOnBlur: e === Xr.onBlur,
|
|
2465
2497
|
isOnChange: e === Xr.onChange,
|
|
2466
2498
|
isOnAll: e === Xr.all,
|
|
2467
2499
|
isOnTouch: e === Xr.onTouched
|
|
2468
|
-
}),
|
|
2500
|
+
}), Zi = "AsyncFunction", Qi = (e) => !!e && !!e.validate && !!(ii(e.validate) && e.validate.constructor.name === Zi || q(e.validate) && Object.values(e.validate).find((e) => e.constructor.name === Zi)), $i = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), ea = (e, t, n) => !n && (t.watchAll || t.watch.has(e) || [...t.watch].some((t) => e.startsWith(`${t}.`))), ta = (e, t, n, r) => {
|
|
2469
2501
|
for (let i of n || Object.keys(e)) {
|
|
2470
2502
|
let n = X(e, i);
|
|
2471
2503
|
if (n) {
|
|
2472
2504
|
let { _f: e } = n, a = fn(n, Ir);
|
|
2473
2505
|
if (e) {
|
|
2474
2506
|
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
2475
|
-
if (
|
|
2476
|
-
} else if (q(a) &&
|
|
2507
|
+
if (ta(a, t)) break;
|
|
2508
|
+
} else if (q(a) && ta(a, t)) break;
|
|
2477
2509
|
}
|
|
2478
2510
|
}
|
|
2479
2511
|
};
|
|
2480
|
-
function
|
|
2512
|
+
function na(e, t, n) {
|
|
2481
2513
|
let r = X(e, n);
|
|
2482
2514
|
if (r || ti(n)) return {
|
|
2483
2515
|
error: r,
|
|
@@ -2499,25 +2531,25 @@ function ea(e, t, n) {
|
|
|
2499
2531
|
}
|
|
2500
2532
|
return { name: n };
|
|
2501
2533
|
}
|
|
2502
|
-
var
|
|
2534
|
+
var ra = (e, t, n, r) => {
|
|
2503
2535
|
n(e);
|
|
2504
2536
|
let { name: i } = e, a = fn(e, Lr);
|
|
2505
|
-
return
|
|
2506
|
-
},
|
|
2537
|
+
return Ei(a) || r && Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((e) => t[e] === (!r || Xr.all));
|
|
2538
|
+
}, ia = (e, t, n) => !e || !t || e === t || Ci(e).some((e) => e && (n ? e === t : e.startsWith(t) || t.startsWith(e))), aa = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, oa = (e, t) => !Si(X(e, t)).length && Q(e, t), sa = (e, t, n) => {
|
|
2507
2539
|
let r = X(e, n), i = Array.isArray(r) ? r : [];
|
|
2508
2540
|
return Z(i, $r, t[n]), Z(e, n, i), e;
|
|
2509
2541
|
};
|
|
2510
|
-
function
|
|
2542
|
+
function ca(e, t, n = "validate") {
|
|
2511
2543
|
if (ui(e) || Array.isArray(e) && e.every(ui) || ri(e) && !e) return {
|
|
2512
2544
|
type: n,
|
|
2513
2545
|
message: ui(e) ? e : "",
|
|
2514
2546
|
ref: t
|
|
2515
2547
|
};
|
|
2516
2548
|
}
|
|
2517
|
-
var
|
|
2549
|
+
var la = (e) => q(e) && !Ji(e) ? e : {
|
|
2518
2550
|
value: e,
|
|
2519
2551
|
message: ""
|
|
2520
|
-
},
|
|
2552
|
+
}, ua = function() {
|
|
2521
2553
|
var e = H(function* (e, t, n, r, i, a) {
|
|
2522
2554
|
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = X(n, h);
|
|
2523
2555
|
if (!_ || t.has(h)) return {};
|
|
@@ -2526,7 +2558,7 @@ var sa = (e) => q(e) && !Ki(e) ? e : {
|
|
|
2526
2558
|
let t = ri(e) ? "" : e || "";
|
|
2527
2559
|
s ? s.forEach((e) => e.setCustomValidity(t)) : y.setCustomValidity(t), y.reportValidity();
|
|
2528
2560
|
}
|
|
2529
|
-
}, x = {}, S =
|
|
2561
|
+
}, x = {}, S = Ai(o), C = Vr(o), w = S || C, T = (g || Di(o)) && Y(o.value) && Y(v) || Oi(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length, E = xi.bind(null, h, r, x), D = (e, t, n, r = Zr.maxLength, i = Zr.minLength) => {
|
|
2530
2562
|
let a = e ? t : n;
|
|
2531
2563
|
x[h] = z({
|
|
2532
2564
|
type: e ? r : i,
|
|
@@ -2534,11 +2566,11 @@ var sa = (e) => q(e) && !Ki(e) ? e : {
|
|
|
2534
2566
|
ref: o
|
|
2535
2567
|
}, E(e ? r : i, a));
|
|
2536
2568
|
};
|
|
2537
|
-
if (a ? !Array.isArray(v) || !v.length : c && (!w && (T || Ur(v)) || ri(v) && !v || C && !
|
|
2569
|
+
if (a ? !Array.isArray(v) || !v.length : c && (!w && (T || Ur(v)) || ri(v) && !v || C && !Hi(s).isValid || S && !Gi(s).isValid)) {
|
|
2538
2570
|
let { value: e, message: t } = ui(c) ? {
|
|
2539
2571
|
value: !!c,
|
|
2540
2572
|
message: c
|
|
2541
|
-
} :
|
|
2573
|
+
} : la(c);
|
|
2542
2574
|
if (e && (x[h] = z({
|
|
2543
2575
|
type: Zr.required,
|
|
2544
2576
|
message: t,
|
|
@@ -2546,7 +2578,7 @@ var sa = (e) => q(e) && !Ki(e) ? e : {
|
|
|
2546
2578
|
}, E(Zr.required, t)), !r)) return b(t), x;
|
|
2547
2579
|
}
|
|
2548
2580
|
if (!T && (!Ur(d) || !Ur(f))) {
|
|
2549
|
-
let e, t, n =
|
|
2581
|
+
let e, t, n = la(f), i = la(d);
|
|
2550
2582
|
if (!Ur(v) && !isNaN(v)) {
|
|
2551
2583
|
let r = o.valueAsNumber || v && +v;
|
|
2552
2584
|
Ur(n.value) || (e = r > n.value), Ur(i.value) || (t = r < i.value);
|
|
@@ -2557,12 +2589,12 @@ var sa = (e) => q(e) && !Ki(e) ? e : {
|
|
|
2557
2589
|
if ((e || t) && (D(!!e, n.message, i.message, Zr.max, Zr.min), !r)) return b(x[h].message), x;
|
|
2558
2590
|
}
|
|
2559
2591
|
if ((l || u) && !T && (ui(v) || a && Array.isArray(v))) {
|
|
2560
|
-
let e =
|
|
2592
|
+
let e = la(l), t = la(u), n = !Ur(e.value) && v.length > +e.value, i = !Ur(t.value) && v.length < +t.value;
|
|
2561
2593
|
if ((n || i) && (D(n, e.message, t.message), !r)) return b(x[h].message), x;
|
|
2562
2594
|
}
|
|
2563
2595
|
if (p && !T && ui(v)) {
|
|
2564
|
-
let { value: e, message: t } =
|
|
2565
|
-
if (
|
|
2596
|
+
let { value: e, message: t } = la(p);
|
|
2597
|
+
if (Ji(e) && !v.match(e) && (x[h] = z({
|
|
2566
2598
|
type: Zr.pattern,
|
|
2567
2599
|
message: t,
|
|
2568
2600
|
ref: o
|
|
@@ -2570,16 +2602,16 @@ var sa = (e) => q(e) && !Ki(e) ? e : {
|
|
|
2570
2602
|
}
|
|
2571
2603
|
if (m) {
|
|
2572
2604
|
if (ii(m)) {
|
|
2573
|
-
let e =
|
|
2605
|
+
let e = ca(yield m(v, n), y);
|
|
2574
2606
|
if (e && (x[h] = z(z({}, e), E(Zr.validate, e.message)), !r)) return b(e.message), x;
|
|
2575
2607
|
} else if (q(m)) {
|
|
2576
2608
|
let e = {};
|
|
2577
2609
|
for (let t in m) {
|
|
2578
|
-
if (!
|
|
2579
|
-
let i =
|
|
2610
|
+
if (!Ei(e) && !r) break;
|
|
2611
|
+
let i = ca(yield m[t](v, n), y, t);
|
|
2580
2612
|
i && (e = z(z({}, i), E(t, i.message)), b(i.message), r && (x[h] = e));
|
|
2581
2613
|
}
|
|
2582
|
-
if (!
|
|
2614
|
+
if (!Ei(e) && (x[h] = z({ ref: y }, e), !r)) return x;
|
|
2583
2615
|
}
|
|
2584
2616
|
}
|
|
2585
2617
|
return b(!0), x;
|
|
@@ -2587,11 +2619,11 @@ var sa = (e) => q(e) && !Ki(e) ? e : {
|
|
|
2587
2619
|
return function(t, n, r, i, a, o) {
|
|
2588
2620
|
return e.apply(this, arguments);
|
|
2589
2621
|
};
|
|
2590
|
-
}(),
|
|
2622
|
+
}(), da = {
|
|
2591
2623
|
mode: Xr.onSubmit,
|
|
2592
2624
|
reValidateMode: Xr.onChange,
|
|
2593
2625
|
shouldFocusError: !0
|
|
2594
|
-
},
|
|
2626
|
+
}, fa = {
|
|
2595
2627
|
submitCount: 0,
|
|
2596
2628
|
isDirty: !1,
|
|
2597
2629
|
isReady: !1,
|
|
@@ -2604,8 +2636,8 @@ var sa = (e) => q(e) && !Ki(e) ? e : {
|
|
|
2604
2636
|
dirtyFields: {},
|
|
2605
2637
|
validatingFields: {}
|
|
2606
2638
|
};
|
|
2607
|
-
function
|
|
2608
|
-
let t = z(z({},
|
|
2639
|
+
function pa(e = {}) {
|
|
2640
|
+
let t = z(z({}, da), e), n = z(z({}, J(fa)), {}, {
|
|
2609
2641
|
isLoading: ii(t.defaultValues),
|
|
2610
2642
|
errors: t.errors || {},
|
|
2611
2643
|
disabled: t.disabled || !1
|
|
@@ -2630,15 +2662,15 @@ function da(e = {}) {
|
|
|
2630
2662
|
isValid: !1,
|
|
2631
2663
|
errors: !1
|
|
2632
2664
|
}, d = z({}, u), f = z({}, d), p = {
|
|
2633
|
-
array:
|
|
2634
|
-
state:
|
|
2665
|
+
array: wi(),
|
|
2666
|
+
state: wi()
|
|
2635
2667
|
}, m = t.criteriaMode === Xr.all, h = (e) => (t) => {
|
|
2636
2668
|
clearTimeout(l), l = setTimeout(e, t);
|
|
2637
2669
|
}, g = function() {
|
|
2638
2670
|
var e = H(function* (e) {
|
|
2639
2671
|
if (!o.keepIsValid && !t.disabled && (d.isValid || f.isValid || e)) {
|
|
2640
2672
|
let e;
|
|
2641
|
-
t.resolver ? (e =
|
|
2673
|
+
t.resolver ? (e = Ei((yield E()).errors), _()) : e = yield O({
|
|
2642
2674
|
fields: r,
|
|
2643
2675
|
onlyCheckValid: !0,
|
|
2644
2676
|
eventType: Yr.VALID
|
|
@@ -2653,10 +2685,10 @@ function da(e = {}) {
|
|
|
2653
2685
|
e && (r ? Z(n.validatingFields, e, r) : Q(n.validatingFields, e));
|
|
2654
2686
|
}), p.state.next({
|
|
2655
2687
|
validatingFields: n.validatingFields,
|
|
2656
|
-
isValidating: !
|
|
2688
|
+
isValidating: !Ei(n.validatingFields)
|
|
2657
2689
|
}));
|
|
2658
2690
|
}, v = () => {
|
|
2659
|
-
n.dirtyFields =
|
|
2691
|
+
n.dirtyFields = zi(i, a);
|
|
2660
2692
|
}, y = (e, i = [], s, c, l = !0, u = !0) => {
|
|
2661
2693
|
if (c && s && !t.disabled) {
|
|
2662
2694
|
if (o.action = !0, u && Array.isArray(X(r, e))) {
|
|
@@ -2665,7 +2697,7 @@ function da(e = {}) {
|
|
|
2665
2697
|
}
|
|
2666
2698
|
if (u && Array.isArray(X(n.errors, e))) {
|
|
2667
2699
|
let t = s(X(n.errors, e), c.argA, c.argB);
|
|
2668
|
-
l && Z(n.errors, e, t),
|
|
2700
|
+
l && Z(n.errors, e, t), oa(n.errors, e);
|
|
2669
2701
|
}
|
|
2670
2702
|
if ((d.touchedFields || f.touchedFields) && u && Array.isArray(X(n.touchedFields, e))) {
|
|
2671
2703
|
let t = s(X(n.touchedFields, e), c.argA, c.argB);
|
|
@@ -2698,7 +2730,7 @@ function da(e = {}) {
|
|
|
2698
2730
|
if (m) {
|
|
2699
2731
|
if (S(t)) return;
|
|
2700
2732
|
let r = Y(X(a, t)), h = X(a, t, Y(l) ? X(i, t) : l);
|
|
2701
|
-
Y(h) || u && u.defaultChecked || c ? Z(a, t, c ? h :
|
|
2733
|
+
Y(h) || u && u.defaultChecked || c ? Z(a, t, c ? h : Ki(m._f)) : re(t, h), o.mount && !o.action && (g(), r && n.isDirty && (d.isDirty || f.isDirty) && (k() || (n.isDirty = !1, p.state.next(z({}, n)))), e.shouldUnregister && r && !Y(X(a, t)) && ea(t, s) && (o.watch = !0));
|
|
2702
2734
|
}
|
|
2703
2735
|
}, w = (e, r, o, s, c) => {
|
|
2704
2736
|
let l = !1, u = !1, m = { name: e };
|
|
@@ -2706,7 +2738,7 @@ function da(e = {}) {
|
|
|
2706
2738
|
if (!o || s) {
|
|
2707
2739
|
(d.isDirty || f.isDirty) && (u = n.isDirty, n.isDirty = m.isDirty = k(), l = u !== m.isDirty);
|
|
2708
2740
|
let t = mi(X(i, e), r);
|
|
2709
|
-
u = !!X(n.dirtyFields, e), t === n.isDirty ? t ? Q(n.dirtyFields, e) : Z(n.dirtyFields, e, !0) : n.dirtyFields =
|
|
2741
|
+
u = !!X(n.dirtyFields, e), t === n.isDirty ? t ? Q(n.dirtyFields, e) : Z(n.dirtyFields, e, !0) : n.dirtyFields = zi(i, a), m.dirtyFields = n.dirtyFields, l = l || (d.dirtyFields || f.dirtyFields) && u !== !t;
|
|
2710
2742
|
}
|
|
2711
2743
|
if (o) {
|
|
2712
2744
|
let t = X(n.touchedFields, e);
|
|
@@ -2717,7 +2749,7 @@ function da(e = {}) {
|
|
|
2717
2749
|
return l ? m : {};
|
|
2718
2750
|
}, T = (e, r, i, a) => {
|
|
2719
2751
|
let o = X(n.errors, e), s = (d.isValid || f.isValid) && ri(r) && n.isValid !== r;
|
|
2720
|
-
if (t.delayError && i ? (c = h(() => b(e, i)), c(t.delayError)) : (clearTimeout(l), c = null, i ? Z(n.errors, e, i) : Q(n.errors, e), n.errors = z({}, n.errors)), (i ? !mi(o, i) : o) || !
|
|
2752
|
+
if (t.delayError && i ? (c = h(() => b(e, i)), c(t.delayError)) : (clearTimeout(l), c = null, i ? Z(n.errors, e, i) : Q(n.errors, e), n.errors = z({}, n.errors)), (i ? !mi(o, i) : o) || !Ei(a) || s) {
|
|
2721
2753
|
let t = z(z(z({}, a), s && ri(r) ? { isValid: r } : {}), {}, {
|
|
2722
2754
|
errors: n.errors,
|
|
2723
2755
|
name: e
|
|
@@ -2726,7 +2758,7 @@ function da(e = {}) {
|
|
|
2726
2758
|
}
|
|
2727
2759
|
}, E = function() {
|
|
2728
2760
|
var e = H(function* (e) {
|
|
2729
|
-
return _(e, !0), yield t.resolver(a, t.context,
|
|
2761
|
+
return _(e, !0), yield t.resolver(a, t.context, qi(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation));
|
|
2730
2762
|
});
|
|
2731
2763
|
return function(t) {
|
|
2732
2764
|
return e.apply(this, arguments);
|
|
@@ -2737,7 +2769,7 @@ function da(e = {}) {
|
|
|
2737
2769
|
if (_(e), e) {
|
|
2738
2770
|
for (let r of e) {
|
|
2739
2771
|
let e = X(t, r);
|
|
2740
|
-
e ? s.array.has(r) && q(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ?
|
|
2772
|
+
e ? s.array.has(r) && q(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? sa(n.errors, { [r]: e }, r) : Z(n.errors, r, e) : Q(n.errors, r);
|
|
2741
2773
|
}
|
|
2742
2774
|
n.errors = z({}, n.errors);
|
|
2743
2775
|
} else n.errors = t;
|
|
@@ -2787,12 +2819,12 @@ function da(e = {}) {
|
|
|
2787
2819
|
if (u) {
|
|
2788
2820
|
let { _f: r } = u, p = fn(u, Rr);
|
|
2789
2821
|
if (r) {
|
|
2790
|
-
let o = s.array.has(r.name), c = u._f &&
|
|
2822
|
+
let o = s.array.has(r.name), c = u._f && Qi(u._f), p = d.validatingFields || d.isValidating || f.validatingFields || f.isValidating;
|
|
2791
2823
|
c && p && _([r.name], !0);
|
|
2792
|
-
let h = yield
|
|
2793
|
-
if (c && p && _([r.name]), h[r.name] && (l.valid = !1, i) || (!i && (X(h, r.name) ? o ?
|
|
2824
|
+
let h = yield ua(u, s.disabled, a, m, t.shouldUseNativeValidation && !i, o);
|
|
2825
|
+
if (c && p && _([r.name]), h[r.name] && (l.valid = !1, i) || (!i && (X(h, r.name) ? o ? sa(n.errors, h, r.name) : Z(n.errors, r.name, h[r.name]) : Q(n.errors, r.name)), e.shouldUseNativeValidation && h[r.name])) break;
|
|
2794
2826
|
}
|
|
2795
|
-
!
|
|
2827
|
+
!Ei(p) && (yield O({
|
|
2796
2828
|
context: l,
|
|
2797
2829
|
onlyCheckValid: i,
|
|
2798
2830
|
fields: p,
|
|
@@ -2809,16 +2841,16 @@ function da(e = {}) {
|
|
|
2809
2841
|
}(), te = () => {
|
|
2810
2842
|
for (let e of s.unMount) {
|
|
2811
2843
|
let t = X(r, e);
|
|
2812
|
-
t && (t._f.refs ? t._f.refs.every((e) => !
|
|
2844
|
+
t && (t._f.refs ? t._f.refs.every((e) => !Mi(e)) : !Mi(t._f.ref)) && ge(e);
|
|
2813
2845
|
}
|
|
2814
2846
|
s.unMount = /* @__PURE__ */ new Set();
|
|
2815
|
-
}, k = (e, n) => !t.disabled && (e && n && Z(a, e, n), !mi(M(), i)), A = (e, t, n) => di(e, s, z({}, o.mount ? a : Y(t) ? i : ui(e) ? { [e]: t } : t), n, t), ne = (e) =>
|
|
2847
|
+
}, k = (e, n) => !t.disabled && (e && n && Z(a, e, n), !mi(M(), i)), A = (e, t, n) => di(e, s, z({}, o.mount ? a : Y(t) ? i : ui(e) ? { [e]: t } : t), n, t), ne = (e) => Si(X(o.mount ? a : i, e, t.shouldUnregister ? X(i, e, []) : [])), re = (e, t, n = {}, i = !1) => {
|
|
2816
2848
|
let o = X(r, e), s = t;
|
|
2817
2849
|
if (o) {
|
|
2818
2850
|
let n = o._f;
|
|
2819
|
-
n && (!n.disabled && Z(a, e,
|
|
2851
|
+
n && (!n.disabled && Z(a, e, Ui(t, n)), s = Oi(n.ref) && Ur(t) ? "" : t, ki(n.ref) ? [...n.ref.options].forEach((e) => e.selected = s.includes(e.value)) : n.refs ? Vr(n.ref) ? n.refs.forEach((e) => {
|
|
2820
2852
|
(!e.defaultChecked || !e.disabled) && (Array.isArray(s) ? e.checked = !!s.find((t) => t === e.value) : e.checked = s === e.value || !!s);
|
|
2821
|
-
}) : n.refs.forEach((e) => e.checked = e.value === s) :
|
|
2853
|
+
}) : n.refs.forEach((e) => e.checked = e.value === s) : Di(n.ref) ? n.ref.value = "" : (n.ref.value = s, n.ref.type || p.state.next({
|
|
2822
2854
|
name: e,
|
|
2823
2855
|
values: i ? a : J(a)
|
|
2824
2856
|
})));
|
|
@@ -2841,11 +2873,11 @@ function da(e = {}) {
|
|
|
2841
2873
|
isDirty: k(e, m)
|
|
2842
2874
|
}));
|
|
2843
2875
|
else {
|
|
2844
|
-
let t = Array.isArray(m) && !m.length ||
|
|
2876
|
+
let t = Array.isArray(m) && !m.length || Ei(m);
|
|
2845
2877
|
!l || l._f || Ur(m) || t ? re(e, m, i, c) : ie(e, m, i, c);
|
|
2846
2878
|
}
|
|
2847
2879
|
if (!h) {
|
|
2848
|
-
let t =
|
|
2880
|
+
let t = ea(e, s), r = c ? a : J(a);
|
|
2849
2881
|
p.state.next(z(z({}, t && n), {}, {
|
|
2850
2882
|
name: o.mount || t ? e : void 0,
|
|
2851
2883
|
values: r
|
|
@@ -2867,11 +2899,11 @@ function da(e = {}) {
|
|
|
2867
2899
|
o.mount = !0;
|
|
2868
2900
|
let l = i.target, u = l.name, h = !0, v = X(r, u), y = (e) => {
|
|
2869
2901
|
h = Number.isNaN(e) || Hr(e) && isNaN(e.getTime()) || mi(e, X(a, u, e));
|
|
2870
|
-
}, b =
|
|
2902
|
+
}, b = Xi(t.mode), x = Xi(t.reValidateMode);
|
|
2871
2903
|
if (v) {
|
|
2872
|
-
let o, S, C = l.type ?
|
|
2904
|
+
let o, S, C = l.type ? Ki(v._f) : Gr(i), D = i.type === Yr.BLUR || i.type === Yr.FOCUS_OUT, te = !$i(v._f) && !e.validate && !t.resolver && !X(n.errors, u) && !v._f.deps || aa(D, X(n.touchedFields, u), n.isSubmitted, x, b), k = ea(u, s, D);
|
|
2873
2905
|
Z(a, u, C), D ? (!l || !l.readOnly) && (v._f.onBlur && v._f.onBlur(i), c && c(0)) : v._f.onChange && v._f.onChange(i);
|
|
2874
|
-
let A = w(u, C, D), ne = !
|
|
2906
|
+
let A = w(u, C, D), ne = !Ei(A) || k;
|
|
2875
2907
|
if (!D && p.state.next({
|
|
2876
2908
|
name: u,
|
|
2877
2909
|
type: i.type,
|
|
@@ -2883,12 +2915,12 @@ function da(e = {}) {
|
|
|
2883
2915
|
})), !D && k && p.state.next(z({}, n)), t.resolver) {
|
|
2884
2916
|
let { errors: e } = yield E([u]);
|
|
2885
2917
|
if (_([u]), y(C), !h) {
|
|
2886
|
-
!
|
|
2918
|
+
!Ei(A) && p.state.next(A);
|
|
2887
2919
|
return;
|
|
2888
2920
|
}
|
|
2889
|
-
let t =
|
|
2890
|
-
o = i.error, u = i.name, S =
|
|
2891
|
-
} else _([u], !0), o = (yield
|
|
2921
|
+
let t = na(n.errors, r, u), i = na(e, r, t.name || u);
|
|
2922
|
+
o = i.error, u = i.name, S = Ei(e);
|
|
2923
|
+
} else _([u], !0), o = (yield ua(v, s.disabled, a, m, t.shouldUseNativeValidation))[u], _([u]), y(C), h && (o ? S = !1 : (d.isValid || f.isValid) && (S = yield O({
|
|
2892
2924
|
fields: r,
|
|
2893
2925
|
onlyCheckValid: !0,
|
|
2894
2926
|
name: u,
|
|
@@ -2904,10 +2936,10 @@ function da(e = {}) {
|
|
|
2904
2936
|
if (X(n.errors, t) && e.focus) return e.focus(), 1;
|
|
2905
2937
|
}, le = function() {
|
|
2906
2938
|
var e = H(function* (e, i = {}) {
|
|
2907
|
-
let a, o, c =
|
|
2939
|
+
let a, o, c = Ci(e);
|
|
2908
2940
|
if (t.resolver) {
|
|
2909
2941
|
let t = yield D(Y(e) ? e : c);
|
|
2910
|
-
a =
|
|
2942
|
+
a = Ei(t), o = e ? !c.some((e) => X(t, e)) : a;
|
|
2911
2943
|
} else e ? (o = (yield Promise.all(c.map(function() {
|
|
2912
2944
|
var e = H(function* (e) {
|
|
2913
2945
|
let t = X(r, e);
|
|
@@ -2924,14 +2956,14 @@ function da(e = {}) {
|
|
|
2924
2956
|
name: e,
|
|
2925
2957
|
eventType: Yr.TRIGGER
|
|
2926
2958
|
});
|
|
2927
|
-
return p.state.next(z(z(z({}, !ui(e) || (d.isValid || f.isValid) && a !== n.isValid ? {} : { name: e }), t.resolver || !e ? { isValid: a } : {}), {}, { errors: n.errors })), i.shouldFocus && !o &&
|
|
2959
|
+
return p.state.next(z(z(z({}, !ui(e) || (d.isValid || f.isValid) && a !== n.isValid ? {} : { name: e }), t.resolver || !e ? { isValid: a } : {}), {}, { errors: n.errors })), i.shouldFocus && !o && ta(r, ce, e ? c : s.mount), o;
|
|
2928
2960
|
});
|
|
2929
2961
|
return function(t) {
|
|
2930
2962
|
return e.apply(this, arguments);
|
|
2931
2963
|
};
|
|
2932
2964
|
}(), M = (e, t) => {
|
|
2933
2965
|
let r = z({}, o.mount ? a : i);
|
|
2934
|
-
return t && (r =
|
|
2966
|
+
return t && (r = Ti(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), Y(e) ? r : ui(e) ? X(r, e) : e.map((e) => X(r, e));
|
|
2935
2967
|
}, ue = (e, t) => ({
|
|
2936
2968
|
invalid: !!X((t || n).errors, e),
|
|
2937
2969
|
isDirty: !!X((t || n).dirtyFields, e),
|
|
@@ -2939,7 +2971,7 @@ function da(e = {}) {
|
|
|
2939
2971
|
isValidating: !!X(n.validatingFields, e),
|
|
2940
2972
|
isTouched: !!X((t || n).touchedFields, e)
|
|
2941
2973
|
}), de = (e) => {
|
|
2942
|
-
let t = e ?
|
|
2974
|
+
let t = e ? Ci(e) : void 0;
|
|
2943
2975
|
t == null || t.forEach((e) => Q(n.errors, e)), t ? t.forEach((e) => {
|
|
2944
2976
|
p.state.next({
|
|
2945
2977
|
name: e,
|
|
@@ -2954,12 +2986,12 @@ function da(e = {}) {
|
|
|
2954
2986
|
isValid: !1
|
|
2955
2987
|
}), i && i.shouldFocus && a && a.focus && a.focus();
|
|
2956
2988
|
}, pe = (e, t) => ii(e) ? p.state.subscribe({ next: (n) => "values" in n && e(n.values || A(void 0, t), n) }) : A(e, t, !0), me = (e) => p.state.subscribe({ next: (t) => {
|
|
2957
|
-
if (
|
|
2989
|
+
if (ia(e.name, t.name, e.exact) && ra(t, e.formState || d, Ee, e.reRenderRoot)) {
|
|
2958
2990
|
let r = z({}, a);
|
|
2959
2991
|
e.callback(z(z(z({ values: r }, n), t), {}, { defaultValues: i }));
|
|
2960
2992
|
}
|
|
2961
2993
|
} }).unsubscribe, he = (e) => (o.mount = !0, f = z(z({}, f), e.formState), me(z(z({}, e), {}, { formState: z(z({}, u), e.formState) }))), ge = (e, o = {}) => {
|
|
2962
|
-
for (let c of e ?
|
|
2994
|
+
for (let c of e ? Ci(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || (Q(r, c), Q(a, c)), !o.keepError && Q(n.errors, c), !o.keepDirty && Q(n.dirtyFields, c), !o.keepTouched && Q(n.touchedFields, c), !o.keepIsValidating && Q(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && Q(i, c);
|
|
2963
2995
|
p.state.next({ values: J(a) }), p.state.next(z(z({}, n), o.keepDirty ? { isDirty: k() } : {})), !o.keepIsValid && g();
|
|
2964
2996
|
}, _e = ({ disabled: e, name: t }) => {
|
|
2965
2997
|
if (ri(e) && o.mount || e || s.disabled.has(t)) {
|
|
@@ -2976,11 +3008,11 @@ function da(e = {}) {
|
|
|
2976
3008
|
name: e
|
|
2977
3009
|
}) : C(e, !0, n.value), z(z(z({}, c ? { disabled: n.disabled || t.disabled } : {}), t.progressive ? {
|
|
2978
3010
|
required: !!n.required,
|
|
2979
|
-
min:
|
|
2980
|
-
max:
|
|
2981
|
-
minLength:
|
|
2982
|
-
maxLength:
|
|
2983
|
-
pattern:
|
|
3011
|
+
min: Yi(n.min),
|
|
3012
|
+
max: Yi(n.max),
|
|
3013
|
+
minLength: Yi(n.minLength),
|
|
3014
|
+
maxLength: Yi(n.maxLength),
|
|
3015
|
+
pattern: Yi(n.pattern)
|
|
2984
3016
|
} : {}), {}, {
|
|
2985
3017
|
name: e,
|
|
2986
3018
|
onChange: se,
|
|
@@ -2988,11 +3020,11 @@ function da(e = {}) {
|
|
|
2988
3020
|
ref: (c) => {
|
|
2989
3021
|
if (c) {
|
|
2990
3022
|
s.registerName.add(e), ve(e, n), s.registerName.delete(e), a = X(r, e);
|
|
2991
|
-
let t = Y(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o =
|
|
3023
|
+
let t = Y(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = ji(t), l = a._f.refs || [];
|
|
2992
3024
|
if (o ? l.find((e) => e === t) : t === a._f.ref) return;
|
|
2993
3025
|
Z(r, e, { _f: z(z({}, a._f), o ? {
|
|
2994
3026
|
refs: [
|
|
2995
|
-
...l.filter(
|
|
3027
|
+
...l.filter(Mi),
|
|
2996
3028
|
t,
|
|
2997
3029
|
...Array.isArray(X(i, e)) ? [{}] : []
|
|
2998
3030
|
],
|
|
@@ -3004,8 +3036,8 @@ function da(e = {}) {
|
|
|
3004
3036
|
} else a = X(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(Kr(s.array, e) && o.action) && s.unMount.add(e);
|
|
3005
3037
|
}
|
|
3006
3038
|
});
|
|
3007
|
-
}, ye = () => t.shouldFocusError && !t.shouldUseNativeValidation &&
|
|
3008
|
-
ri(e) && (p.state.next({ disabled: e }),
|
|
3039
|
+
}, ye = () => t.shouldFocusError && !t.shouldUseNativeValidation && ta(r, ce, s.mount), be = (e) => {
|
|
3040
|
+
ri(e) && (p.state.next({ disabled: e }), ta(r, (t, n) => {
|
|
3009
3041
|
let i = X(r, n);
|
|
3010
3042
|
i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
|
|
3011
3043
|
t.disabled = i._f.disabled || e;
|
|
@@ -3024,7 +3056,7 @@ function da(e = {}) {
|
|
|
3024
3056
|
eventType: Yr.SUBMIT
|
|
3025
3057
|
});
|
|
3026
3058
|
if (s.disabled.size) for (let e of s.disabled) Q(l, e);
|
|
3027
|
-
if (Q(n.errors, $r),
|
|
3059
|
+
if (Q(n.errors, $r), Ei(n.errors)) {
|
|
3028
3060
|
p.state.next({ errors: {} });
|
|
3029
3061
|
try {
|
|
3030
3062
|
yield e(l, o);
|
|
@@ -3035,7 +3067,7 @@ function da(e = {}) {
|
|
|
3035
3067
|
if (p.state.next({
|
|
3036
3068
|
isSubmitted: !0,
|
|
3037
3069
|
isSubmitting: !1,
|
|
3038
|
-
isSubmitSuccessful:
|
|
3070
|
+
isSubmitSuccessful: Ei(n.errors) && !c,
|
|
3039
3071
|
submitCount: n.submitCount + 1,
|
|
3040
3072
|
errors: n.errors
|
|
3041
3073
|
}), c) throw c;
|
|
@@ -3046,10 +3078,10 @@ function da(e = {}) {
|
|
|
3046
3078
|
}(), Se = (e, t = {}) => {
|
|
3047
3079
|
X(r, e) && (Y(t.defaultValue) ? j(e, J(X(i, e))) : (j(e, t.defaultValue), Z(i, e, J(t.defaultValue))), t.keepTouched || Q(n.touchedFields, e), t.keepDirty || (Q(n.dirtyFields, e), n.isDirty = t.defaultValue ? k(e, J(X(i, e))) : k()), t.keepError || (Q(n.errors, e), d.isValid && g()), p.state.next(z({}, n)));
|
|
3048
3080
|
}, Ce = (e, c = {}) => {
|
|
3049
|
-
let l = e ? J(e) : i, u = J(l), f =
|
|
3081
|
+
let l = e ? J(e) : i, u = J(l), f = Ei(e), m = u;
|
|
3050
3082
|
if (c.keepDefaultValues || (i = l), !c.keepValues) {
|
|
3051
3083
|
if (c.keepDirtyValues) {
|
|
3052
|
-
let e = new Set([...s.mount, ...Object.keys(
|
|
3084
|
+
let e = new Set([...s.mount, ...Object.keys(zi(i, a))]);
|
|
3053
3085
|
for (let t of Array.from(e)) {
|
|
3054
3086
|
let e = X(n.dirtyFields, t), r = X(a, t), i = X(m, t);
|
|
3055
3087
|
e && !Y(r) ? Z(m, t, r) : !e && !Y(i) && j(t, i);
|
|
@@ -3059,7 +3091,7 @@ function da(e = {}) {
|
|
|
3059
3091
|
let t = X(r, e);
|
|
3060
3092
|
if (t && t._f) {
|
|
3061
3093
|
let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
|
|
3062
|
-
if (
|
|
3094
|
+
if (Oi(e)) {
|
|
3063
3095
|
let t = e.closest("form");
|
|
3064
3096
|
if (t) {
|
|
3065
3097
|
t.reset();
|
|
@@ -3085,11 +3117,11 @@ function da(e = {}) {
|
|
|
3085
3117
|
watch: /* @__PURE__ */ new Set(),
|
|
3086
3118
|
watchAll: !1,
|
|
3087
3119
|
focus: ""
|
|
3088
|
-
}, o.mount = !d.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !t.shouldUnregister && !
|
|
3120
|
+
}, o.mount = !d.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !t.shouldUnregister && !Ei(m), o.watch = !!t.shouldUnregister, o.keepIsValid = !!c.keepIsValid, o.action = !1, c.keepErrors || (n.errors = {}), p.state.next({
|
|
3089
3121
|
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
3090
3122
|
isDirty: f ? !1 : c.keepDirty ? n.isDirty : c.keepValues ? k() : !!(c.keepDefaultValues && !mi(e, i)),
|
|
3091
3123
|
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
3092
|
-
dirtyFields: f ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ?
|
|
3124
|
+
dirtyFields: f ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? zi(i, a) : n.dirtyFields : c.keepDefaultValues && e ? zi(i, e) : c.keepDirty ? n.dirtyFields : {},
|
|
3093
3125
|
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
3094
3126
|
errors: c.keepErrors ? n.errors : {},
|
|
3095
3127
|
isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
@@ -3175,8 +3207,8 @@ function da(e = {}) {
|
|
|
3175
3207
|
resetField: Se,
|
|
3176
3208
|
resetDefaultValues: (e, t = {}) => {
|
|
3177
3209
|
if (i = J(e), !t.keepDirty) {
|
|
3178
|
-
let e =
|
|
3179
|
-
n.dirtyFields = e, n.isDirty = !
|
|
3210
|
+
let e = zi(i, a);
|
|
3211
|
+
n.dirtyFields = e, n.isDirty = !Ei(e);
|
|
3180
3212
|
}
|
|
3181
3213
|
t.keepIsValid || g(), p.state.next(z(z({}, n), {}, { defaultValues: i }));
|
|
3182
3214
|
},
|
|
@@ -3188,8 +3220,8 @@ function da(e = {}) {
|
|
|
3188
3220
|
};
|
|
3189
3221
|
return z(z({}, De), {}, { formControl: De });
|
|
3190
3222
|
}
|
|
3191
|
-
function
|
|
3192
|
-
let t = K.useRef(void 0), n = K.useRef(void 0), r = K.useRef(e.formControl), [i, a] = K.useState(() => z(z({}, J(
|
|
3223
|
+
function ma(e = {}) {
|
|
3224
|
+
let t = K.useRef(void 0), n = K.useRef(void 0), r = K.useRef(e.formControl), [i, a] = K.useState(() => z(z({}, J(fa)), {}, {
|
|
3193
3225
|
isLoading: ii(e.defaultValues),
|
|
3194
3226
|
errors: e.errors || {},
|
|
3195
3227
|
disabled: e.disabled || !1,
|
|
@@ -3197,7 +3229,7 @@ function fa(e = {}) {
|
|
|
3197
3229
|
}));
|
|
3198
3230
|
if (!t.current || e.formControl && r.current !== e.formControl) if (r.current = e.formControl, e.formControl) t.current = z(z({}, e.formControl), {}, { formState: i }), e.defaultValues && !ii(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3199
3231
|
else {
|
|
3200
|
-
let n =
|
|
3232
|
+
let n = pa(e), { formControl: r } = n;
|
|
3201
3233
|
t.current = z(z({}, fn(n, Br)), {}, { formState: i });
|
|
3202
3234
|
}
|
|
3203
3235
|
let o = t.current.control;
|
|
@@ -3232,19 +3264,342 @@ function fa(e = {}) {
|
|
|
3232
3264
|
}
|
|
3233
3265
|
//#endregion
|
|
3234
3266
|
//#region src/utils/getValidateObjectHelper.ts
|
|
3235
|
-
var
|
|
3236
|
-
let
|
|
3237
|
-
return e.forEach((e,
|
|
3238
|
-
if (e.type === Qt.NOT_EMPTY && (
|
|
3239
|
-
let
|
|
3240
|
-
|
|
3267
|
+
var ha = (e, t, n) => {
|
|
3268
|
+
let r = {};
|
|
3269
|
+
return e.forEach((e, i) => {
|
|
3270
|
+
if (e.type === Qt.NOT_EMPTY && (r.required = (n) => t && on(n) ? e.message : !0), e.type === Qt.REGEX && "regex" in e) {
|
|
3271
|
+
let n = new RegExp(e.regex);
|
|
3272
|
+
r[`regex_${i}`] = (r) => !t && !r ? !0 : typeof r == "string" && n.test(r) || e.message;
|
|
3241
3273
|
}
|
|
3242
|
-
|
|
3274
|
+
"passed" in e && e.passed === !1 && (r[`remote_${i}`] = () => n != null && n() ? !0 : e.message);
|
|
3275
|
+
}), r;
|
|
3243
3276
|
};
|
|
3244
3277
|
//#endregion
|
|
3278
|
+
//#region src/hooks/useFormFieldValidation.ts
|
|
3279
|
+
R();
|
|
3280
|
+
var ga = (e) => e.filter((e) => "passed" in e && e.passed === !1), _a = (e) => {
|
|
3281
|
+
if (!e) return [];
|
|
3282
|
+
if (e.types) {
|
|
3283
|
+
let t = Object.values(e.types).filter((e) => typeof e == "string" && !!e);
|
|
3284
|
+
if (t.length) return t;
|
|
3285
|
+
}
|
|
3286
|
+
return typeof e.message == "string" ? [e.message] : [];
|
|
3287
|
+
}, va = ({ name: e, validators: t, required: n, form: r }) => {
|
|
3288
|
+
let { control: i, clearErrors: a, formState: o, getFieldState: s, setError: c } = r, l = ha(t, n, () => s(e, o).isDirty), u = () => {
|
|
3289
|
+
let n = ga(t);
|
|
3290
|
+
if (!n.length) return;
|
|
3291
|
+
let r = n.reduce((e, t, n) => (e[`remote_${n}`] = t.message, e), {});
|
|
3292
|
+
c(e, {
|
|
3293
|
+
type: "remote",
|
|
3294
|
+
message: n[0].message,
|
|
3295
|
+
types: r
|
|
3296
|
+
});
|
|
3297
|
+
};
|
|
3298
|
+
return P(() => {
|
|
3299
|
+
u();
|
|
3300
|
+
}, [
|
|
3301
|
+
t,
|
|
3302
|
+
e,
|
|
3303
|
+
c
|
|
3304
|
+
]), {
|
|
3305
|
+
control: i,
|
|
3306
|
+
validate: l,
|
|
3307
|
+
clearFieldErrors: () => {
|
|
3308
|
+
a(e);
|
|
3309
|
+
},
|
|
3310
|
+
getErrorMessages: _a
|
|
3311
|
+
};
|
|
3312
|
+
}, ya = ({ children: e, backgroundColor: t, cornerRadius: n = 0, isError: r, isRequired: i, validationBorderColor: a, validationBorderWidth: o }) => /* @__PURE__ */ B("div", {
|
|
3313
|
+
style: z({
|
|
3314
|
+
position: "relative",
|
|
3315
|
+
flexShrink: 0,
|
|
3316
|
+
width: "100%",
|
|
3317
|
+
fontWeight: 300,
|
|
3318
|
+
lineHeight: "140%",
|
|
3319
|
+
backgroundColor: U(t) || "transparent",
|
|
3320
|
+
borderRadius: n,
|
|
3321
|
+
padding: "16px",
|
|
3322
|
+
boxSizing: "border-box",
|
|
3323
|
+
height: "auto"
|
|
3324
|
+
}, r && z(z({}, U(a) && {
|
|
3325
|
+
borderColor: a,
|
|
3326
|
+
borderStyle: "solid"
|
|
3327
|
+
}), o && { borderWidth: o })),
|
|
3328
|
+
children: [i && /* @__PURE__ */ B("span", {
|
|
3329
|
+
style: {
|
|
3330
|
+
color: U(a),
|
|
3331
|
+
position: "absolute",
|
|
3332
|
+
insetInlineStart: "6px",
|
|
3333
|
+
top: "18px"
|
|
3334
|
+
},
|
|
3335
|
+
children: "*"
|
|
3336
|
+
}), e]
|
|
3337
|
+
}), ba = ({ validationErrorsTypes: e, title: t }) => e ? /* @__PURE__ */ B("div", {
|
|
3338
|
+
style: {
|
|
3339
|
+
width: "100%",
|
|
3340
|
+
fontSize: 12
|
|
3341
|
+
},
|
|
3342
|
+
children: Object.entries(e).map(([e, n]) => /* @__PURE__ */ B(G, z(z({}, t), {}, { text: n }), e))
|
|
3343
|
+
}) : null, xa = ({ layout: e, dataSourceQuestion: t, register: n, validate: r, clearFieldErrors: i }) => {
|
|
3344
|
+
var a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b;
|
|
3345
|
+
let x = String(t.id), S = n(x, {
|
|
3346
|
+
required: !!t.required,
|
|
3347
|
+
validate: r
|
|
3348
|
+
});
|
|
3349
|
+
return /* @__PURE__ */ B("div", {
|
|
3350
|
+
style: {
|
|
3351
|
+
display: "flex",
|
|
3352
|
+
flexDirection: "column",
|
|
3353
|
+
gap: "16px"
|
|
3354
|
+
},
|
|
3355
|
+
children: [/* @__PURE__ */ B(G, z(z({}, e.title), {}, {
|
|
3356
|
+
text: t.text,
|
|
3357
|
+
htmlFor: x
|
|
3358
|
+
})), /* @__PURE__ */ B("input", z(z({}, S), {}, {
|
|
3359
|
+
onChange: (e) => {
|
|
3360
|
+
S.onChange(e), i();
|
|
3361
|
+
},
|
|
3362
|
+
id: x,
|
|
3363
|
+
type: ((e) => e ? e === kt.EMAIL ? "email" : e === kt.FREE_TEXT ? "text" : e === kt.NUMBER ? "number" : e === kt.SECURE ? "password" : "text" : "text")((a = e.textField) == null ? void 0 : a.inputType),
|
|
3364
|
+
style: {
|
|
3365
|
+
fontFamily: (o = e == null || (s = e.textField) == null ? void 0 : s.fontName) == null ? "sans-serif" : o,
|
|
3366
|
+
fontSize: (c = e == null || (l = e.textField) == null ? void 0 : l.fontSize) == null ? 15 : c,
|
|
3367
|
+
color: (u = U(e == null || (d = e.textField) == null ? void 0 : d.fontColor)) == null ? "#000000" : u,
|
|
3368
|
+
height: "42px",
|
|
3369
|
+
borderWidth: (f = e == null || (p = e.textField) == null ? void 0 : p.borderWidth) == null ? 1 : f,
|
|
3370
|
+
borderColor: (m = U(e == null || (h = e.textField) == null ? void 0 : h.borderColor)) == null ? "#d9d9d9" : m,
|
|
3371
|
+
borderStyle: "solid",
|
|
3372
|
+
borderRadius: (g = e == null || (_ = e.textField) == null ? void 0 : _.cornerRadius) == null ? 8 : g,
|
|
3373
|
+
padding: "11px",
|
|
3374
|
+
boxSizing: "border-box",
|
|
3375
|
+
backgroundColor: (v = U(e == null || (y = e.textField) == null ? void 0 : y.backgroundColor)) == null ? "#FFFFFF" : v,
|
|
3376
|
+
outlineColor: Jt
|
|
3377
|
+
},
|
|
3378
|
+
placeholder: (b = t.placeholder) == null ? "" : b,
|
|
3379
|
+
"data-id": x
|
|
3380
|
+
}))]
|
|
3381
|
+
});
|
|
3382
|
+
}, Sa = ({ layout: e, dataSourceQuestion: t, register: n, validate: r, clearFieldErrors: i }) => {
|
|
3383
|
+
var a, o, s, c, l, u, d, f, p, m, h, g, _;
|
|
3384
|
+
let v = String(t.id), y = n(v, {
|
|
3385
|
+
required: !!t.required,
|
|
3386
|
+
validate: r
|
|
3387
|
+
});
|
|
3388
|
+
return /* @__PURE__ */ B("div", {
|
|
3389
|
+
style: {
|
|
3390
|
+
display: "flex",
|
|
3391
|
+
flexDirection: "column",
|
|
3392
|
+
gap: "16px"
|
|
3393
|
+
},
|
|
3394
|
+
children: [/* @__PURE__ */ B(G, z(z({}, e.title), {}, {
|
|
3395
|
+
text: t.text,
|
|
3396
|
+
htmlFor: v
|
|
3397
|
+
})), /* @__PURE__ */ B("textarea", z(z({}, y), {}, {
|
|
3398
|
+
onChange: (e) => {
|
|
3399
|
+
y.onChange(e), i();
|
|
3400
|
+
},
|
|
3401
|
+
id: v,
|
|
3402
|
+
placeholder: (a = t.placeholder) == null ? "" : a,
|
|
3403
|
+
onInput: (e) => {
|
|
3404
|
+
e.currentTarget.style.height = "auto", e.currentTarget.style.height = `${e.currentTarget.scrollHeight - 15}px`;
|
|
3405
|
+
},
|
|
3406
|
+
"data-id": v,
|
|
3407
|
+
style: {
|
|
3408
|
+
fontFamily: "sans-serif",
|
|
3409
|
+
fontSize: (o = e == null || (s = e.textField) == null ? void 0 : s.fontSize) == null ? 15 : o,
|
|
3410
|
+
color: (c = U(e == null || (l = e.textField) == null ? void 0 : l.fontColor)) == null ? "#000000" : c,
|
|
3411
|
+
resize: "none",
|
|
3412
|
+
overflow: "hidden",
|
|
3413
|
+
height: "42px",
|
|
3414
|
+
minHeight: "42px",
|
|
3415
|
+
borderWidth: (u = e == null || (d = e.textField) == null ? void 0 : d.borderWidth) == null ? 1 : u,
|
|
3416
|
+
borderColor: (f = U(e == null || (p = e.textField) == null ? void 0 : p.borderColor)) == null ? "#d9d9d9" : f,
|
|
3417
|
+
borderStyle: "solid",
|
|
3418
|
+
borderRadius: (m = e == null || (h = e.textField) == null ? void 0 : h.cornerRadius) == null ? 8 : m,
|
|
3419
|
+
padding: "11px",
|
|
3420
|
+
boxSizing: "border-box",
|
|
3421
|
+
backgroundColor: (g = U(e == null || (_ = e.textField) == null ? void 0 : _.backgroundColor)) == null ? "#FFFFFF" : g,
|
|
3422
|
+
outlineColor: Jt
|
|
3423
|
+
}
|
|
3424
|
+
}))]
|
|
3425
|
+
});
|
|
3426
|
+
};
|
|
3427
|
+
//#endregion
|
|
3428
|
+
//#region src/hooks/useIsKeyboard.ts
|
|
3429
|
+
R();
|
|
3430
|
+
var Ca = () => {
|
|
3431
|
+
let [e, t] = N(!1);
|
|
3432
|
+
return P(() => {
|
|
3433
|
+
let e = () => t(!0), n = () => t(!1);
|
|
3434
|
+
return window.addEventListener("keydown", e), window.addEventListener("mousedown", n), () => {
|
|
3435
|
+
window.removeEventListener("keydown", e), window.removeEventListener("mousedown", n);
|
|
3436
|
+
};
|
|
3437
|
+
}, []), e;
|
|
3438
|
+
};
|
|
3439
|
+
//#endregion
|
|
3440
|
+
//#region src/screens/questions-screen/components/questions/selector-options-question/SelectorOptionsOption.tsx
|
|
3441
|
+
R();
|
|
3442
|
+
var wa = ({ option: e, layout: t, dataSourceQuestion: n, register: r, watch: i, validate: a, clearFieldErrors: o }) => {
|
|
3443
|
+
let [s, c] = N(!1), l = Ca(), u = String(n.id), d = i(u) === String(e.id), f = r(u, {
|
|
3444
|
+
required: !!n.required,
|
|
3445
|
+
validate: a
|
|
3446
|
+
}), p = (e) => {
|
|
3447
|
+
f.onChange(e), o();
|
|
3448
|
+
}, m = t.option, h = t.optionSelected, g = {
|
|
3449
|
+
backgroundColor: U(h == null ? void 0 : h.backgroundColor),
|
|
3450
|
+
borderRadius: h.cornerRadius
|
|
3451
|
+
}, _ = {
|
|
3452
|
+
backgroundColor: U(m == null ? void 0 : m.backgroundColor),
|
|
3453
|
+
borderRadius: m.cornerRadius
|
|
3454
|
+
}, v = s && l ? { filter: `drop-shadow(0 0 1px ${Jt})` } : {};
|
|
3455
|
+
return /* @__PURE__ */ B("div", { children: /* @__PURE__ */ B("label", {
|
|
3456
|
+
style: z({
|
|
3457
|
+
display: "flex",
|
|
3458
|
+
alignItems: "center",
|
|
3459
|
+
alignContent: "center",
|
|
3460
|
+
gap: 8,
|
|
3461
|
+
cursor: "pointer"
|
|
3462
|
+
}, d ? g : _),
|
|
3463
|
+
children: [
|
|
3464
|
+
/* @__PURE__ */ B("div", {
|
|
3465
|
+
style: z({
|
|
3466
|
+
display: "flex",
|
|
3467
|
+
alignItems: "center",
|
|
3468
|
+
alignContent: "center",
|
|
3469
|
+
flexShrink: 0
|
|
3470
|
+
}, v),
|
|
3471
|
+
children: /* @__PURE__ */ B(W, z({}, d ? h.image : m.image))
|
|
3472
|
+
}),
|
|
3473
|
+
/* @__PURE__ */ B(G, z(z({}, d ? h.title : m.title), {}, { text: e.text })),
|
|
3474
|
+
/* @__PURE__ */ B("input", z(z({ style: {
|
|
3475
|
+
width: 1,
|
|
3476
|
+
height: 1,
|
|
3477
|
+
opacity: 0,
|
|
3478
|
+
position: "absolute",
|
|
3479
|
+
left: "50%"
|
|
3480
|
+
} }, f), {}, {
|
|
3481
|
+
onChange: p,
|
|
3482
|
+
value: e.id,
|
|
3483
|
+
type: "radio",
|
|
3484
|
+
onFocus: () => c(!0),
|
|
3485
|
+
onBlur: () => c(!1)
|
|
3486
|
+
}))
|
|
3487
|
+
]
|
|
3488
|
+
}) }, e.id);
|
|
3489
|
+
}, Ta = ({ layout: e, register: t, watch: n, dataSourceQuestion: r, validate: i, clearFieldErrors: a }) => /* @__PURE__ */ B("div", {
|
|
3490
|
+
style: { boxSizing: "border-box" },
|
|
3491
|
+
children: /* @__PURE__ */ B("fieldset", {
|
|
3492
|
+
style: {
|
|
3493
|
+
margin: 0,
|
|
3494
|
+
padding: 0,
|
|
3495
|
+
border: "none",
|
|
3496
|
+
display: "flex",
|
|
3497
|
+
flexDirection: "column",
|
|
3498
|
+
gap: "16px"
|
|
3499
|
+
},
|
|
3500
|
+
children: [e.title && /* @__PURE__ */ B("legend", {
|
|
3501
|
+
style: {
|
|
3502
|
+
margin: 0,
|
|
3503
|
+
padding: 0,
|
|
3504
|
+
marginBottom: "16px"
|
|
3505
|
+
},
|
|
3506
|
+
children: /* @__PURE__ */ B(G, z(z({}, e.title), {}, { text: r.text }))
|
|
3507
|
+
}), r.options.map((o) => /* @__PURE__ */ B(wa, {
|
|
3508
|
+
register: t,
|
|
3509
|
+
watch: n,
|
|
3510
|
+
layout: e,
|
|
3511
|
+
option: o,
|
|
3512
|
+
dataSourceQuestion: r,
|
|
3513
|
+
validate: i,
|
|
3514
|
+
clearFieldErrors: a
|
|
3515
|
+
}, o.id))]
|
|
3516
|
+
})
|
|
3517
|
+
});
|
|
3518
|
+
//#endregion
|
|
3519
|
+
//#region src/screens/questions-screen/components/questions/selector-buttons-question/SelectorButtonsOption.tsx
|
|
3520
|
+
R();
|
|
3521
|
+
var Ea = ({ option: e, layout: t, dataSourceQuestion: n, register: r, watch: i, validate: a, clearFieldErrors: o }) => {
|
|
3522
|
+
let [s, c] = N(!1), l = Ca(), u = String(n.id), d = i(u) === String(e.id), f = r(u, {
|
|
3523
|
+
required: !!n.required,
|
|
3524
|
+
validate: a
|
|
3525
|
+
}), p = (e) => {
|
|
3526
|
+
f.onChange(e), o();
|
|
3527
|
+
}, m = t.option, h = t.optionSelected, g = {
|
|
3528
|
+
borderRadius: m == null ? void 0 : m.cornerRadius,
|
|
3529
|
+
background: U(m == null ? void 0 : m.backgroundColor),
|
|
3530
|
+
borderColor: U(m == null ? void 0 : m.borderColor),
|
|
3531
|
+
borderWidth: m == null ? void 0 : m.borderWidth
|
|
3532
|
+
}, _ = {
|
|
3533
|
+
borderRadius: h == null ? void 0 : h.cornerRadius,
|
|
3534
|
+
background: U(h == null ? void 0 : h.backgroundColor),
|
|
3535
|
+
borderColor: U(h == null ? void 0 : h.borderColor),
|
|
3536
|
+
borderWidth: h == null ? void 0 : h.borderWidth
|
|
3537
|
+
}, v = s && l ? { outline: `2px solid ${Jt}` } : {};
|
|
3538
|
+
return /* @__PURE__ */ B("div", {
|
|
3539
|
+
style: {
|
|
3540
|
+
display: "flex",
|
|
3541
|
+
flexGrow: 1
|
|
3542
|
+
},
|
|
3543
|
+
children: /* @__PURE__ */ B("label", {
|
|
3544
|
+
style: z(z({
|
|
3545
|
+
width: "100%",
|
|
3546
|
+
padding: "8px 16px",
|
|
3547
|
+
cursor: "pointer",
|
|
3548
|
+
borderStyle: "solid",
|
|
3549
|
+
position: "relative"
|
|
3550
|
+
}, d ? _ : g), v),
|
|
3551
|
+
children: [/* @__PURE__ */ B("input", z(z({ style: {
|
|
3552
|
+
width: 1,
|
|
3553
|
+
height: 1,
|
|
3554
|
+
opacity: 0,
|
|
3555
|
+
position: "absolute",
|
|
3556
|
+
left: "50%"
|
|
3557
|
+
} }, f), {}, {
|
|
3558
|
+
onChange: p,
|
|
3559
|
+
value: e.id,
|
|
3560
|
+
type: "radio",
|
|
3561
|
+
onFocus: () => c(!0),
|
|
3562
|
+
onBlur: () => c(!1)
|
|
3563
|
+
})), /* @__PURE__ */ B(G, z(z({}, d ? h.title : m.title), {}, { text: e.text }))]
|
|
3564
|
+
})
|
|
3565
|
+
}, e.id);
|
|
3566
|
+
}, Da = ({ layout: e, watch: t, register: n, dataSourceQuestion: r, validate: i, clearFieldErrors: a }) => /* @__PURE__ */ B("div", {
|
|
3567
|
+
style: { boxSizing: "border-box" },
|
|
3568
|
+
children: /* @__PURE__ */ B("fieldset", {
|
|
3569
|
+
style: {
|
|
3570
|
+
margin: 0,
|
|
3571
|
+
padding: 0,
|
|
3572
|
+
border: "none"
|
|
3573
|
+
},
|
|
3574
|
+
children: [e.title && /* @__PURE__ */ B("legend", {
|
|
3575
|
+
style: {
|
|
3576
|
+
margin: 0,
|
|
3577
|
+
padding: 0,
|
|
3578
|
+
marginBottom: "16px"
|
|
3579
|
+
},
|
|
3580
|
+
children: /* @__PURE__ */ B(G, z(z({}, e.title), {}, { text: r.text }))
|
|
3581
|
+
}), /* @__PURE__ */ B("div", {
|
|
3582
|
+
style: {
|
|
3583
|
+
display: "flex",
|
|
3584
|
+
justifyContent: "center",
|
|
3585
|
+
gap: 5
|
|
3586
|
+
},
|
|
3587
|
+
children: r.options.map((o) => /* @__PURE__ */ B(Ea, {
|
|
3588
|
+
register: n,
|
|
3589
|
+
watch: t,
|
|
3590
|
+
layout: e,
|
|
3591
|
+
option: o,
|
|
3592
|
+
dataSourceQuestion: r,
|
|
3593
|
+
validate: i,
|
|
3594
|
+
clearFieldErrors: a
|
|
3595
|
+
}, o.id))
|
|
3596
|
+
})]
|
|
3597
|
+
})
|
|
3598
|
+
});
|
|
3599
|
+
//#endregion
|
|
3245
3600
|
//#region src/screens/questions-screen/components/questions/select-input-custom/SelectInputCustom.tsx
|
|
3246
3601
|
R();
|
|
3247
|
-
var
|
|
3602
|
+
var Oa = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
3248
3603
|
"data-ui": "gui-custom-select-chevron",
|
|
3249
3604
|
style: {
|
|
3250
3605
|
width: "16px",
|
|
@@ -3258,7 +3613,7 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3258
3613
|
flexShrink: 0
|
|
3259
3614
|
},
|
|
3260
3615
|
children: t ? /* @__PURE__ */ B(W, z({}, t)) : /* @__PURE__ */ B(W, { imageId: "chevronDown" })
|
|
3261
|
-
}),
|
|
3616
|
+
}), ka = ({ isChosen: e, option: t, onOptionClickCallback: n, isHovered: r, onHover: i, onHoverEnd: a }) => {
|
|
3262
3617
|
let o = e ? t.layoutSelected.image : t.layout.image;
|
|
3263
3618
|
return /* @__PURE__ */ B("div", {
|
|
3264
3619
|
style: {
|
|
@@ -3290,7 +3645,7 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3290
3645
|
children: /* @__PURE__ */ B(W, z({}, o))
|
|
3291
3646
|
})]
|
|
3292
3647
|
}, t.value);
|
|
3293
|
-
},
|
|
3648
|
+
}, Aa = ({ name: e, options: t, isMulti: n = !1, isClearable: r = !1, value: i, onChange: a, placeholder: o, closeMenuOnSelect: s = !0, onBlur: c, parentElementRef: l, controlLayout: u, pickerLayout: d }) => {
|
|
3294
3649
|
var f, p, m, h, g, _, v, y;
|
|
3295
3650
|
let [b, x] = N(!1), [S, C] = N(i), [w, T] = N("down"), [E, D] = N(null), ee = F(null), O = F(null);
|
|
3296
3651
|
Ae(() => {
|
|
@@ -3422,7 +3777,7 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3422
3777
|
alignSelf: "stretch",
|
|
3423
3778
|
backgroundColor: "#D9D9D9"
|
|
3424
3779
|
} }) : null,
|
|
3425
|
-
/* @__PURE__ */ B(
|
|
3780
|
+
/* @__PURE__ */ B(Oa, {
|
|
3426
3781
|
isOpen: b,
|
|
3427
3782
|
image: u == null ? void 0 : u.expandButton
|
|
3428
3783
|
}),
|
|
@@ -3449,7 +3804,7 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3449
3804
|
cursor: "default"
|
|
3450
3805
|
}),
|
|
3451
3806
|
onClick: (e) => e.stopPropagation(),
|
|
3452
|
-
children: t.map((e) => /* @__PURE__ */ B(
|
|
3807
|
+
children: t.map((e) => /* @__PURE__ */ B(ka, {
|
|
3453
3808
|
isChosen: S.some((t) => t.value === e.value),
|
|
3454
3809
|
option: e,
|
|
3455
3810
|
onOptionClickCallback: te,
|
|
@@ -3461,13 +3816,13 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3461
3816
|
]
|
|
3462
3817
|
})
|
|
3463
3818
|
});
|
|
3464
|
-
},
|
|
3465
|
-
let
|
|
3819
|
+
}, ja = ({ control: e, layout: t, dataSourceQuestion: n, parentElementRef: r, validate: i, clearFieldErrors: a }) => {
|
|
3820
|
+
let o = n.options.map((e) => ({
|
|
3466
3821
|
value: String(e.id),
|
|
3467
3822
|
label: e.text,
|
|
3468
3823
|
layout: t.option,
|
|
3469
3824
|
layoutSelected: t.optionSelected
|
|
3470
|
-
})),
|
|
3825
|
+
})), s = String(n.id);
|
|
3471
3826
|
return /* @__PURE__ */ B("div", {
|
|
3472
3827
|
style: {
|
|
3473
3828
|
display: "flex",
|
|
@@ -3477,25 +3832,25 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3477
3832
|
},
|
|
3478
3833
|
children: [t.title && /* @__PURE__ */ B(G, z(z({}, t.title), {}, {
|
|
3479
3834
|
text: n.text,
|
|
3480
|
-
htmlFor:
|
|
3835
|
+
htmlFor: s
|
|
3481
3836
|
})), /* @__PURE__ */ B(_i, {
|
|
3482
|
-
name:
|
|
3837
|
+
name: s,
|
|
3483
3838
|
control: e,
|
|
3484
3839
|
rules: {
|
|
3485
3840
|
required: !!n.required,
|
|
3486
|
-
validate:
|
|
3841
|
+
validate: i
|
|
3487
3842
|
},
|
|
3488
3843
|
render: ({ field: e }) => {
|
|
3489
|
-
let
|
|
3490
|
-
return /* @__PURE__ */ B(
|
|
3491
|
-
options:
|
|
3844
|
+
let i = o.find((t) => t.value === e.value);
|
|
3845
|
+
return /* @__PURE__ */ B(Aa, {
|
|
3846
|
+
options: o,
|
|
3492
3847
|
placeholder: n.placeholder,
|
|
3493
3848
|
closeMenuOnSelect: !0,
|
|
3494
3849
|
name: e.name,
|
|
3495
|
-
value:
|
|
3850
|
+
value: i ? [i] : [],
|
|
3496
3851
|
onChange: (t) => {
|
|
3497
3852
|
let n = t && Array.isArray(t) && t.length ? t[0].value : null;
|
|
3498
|
-
e.onChange(n);
|
|
3853
|
+
e.onChange(n), a();
|
|
3499
3854
|
},
|
|
3500
3855
|
parentElementRef: r,
|
|
3501
3856
|
isMulti: !1,
|
|
@@ -3506,13 +3861,13 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3506
3861
|
}
|
|
3507
3862
|
})]
|
|
3508
3863
|
});
|
|
3509
|
-
},
|
|
3510
|
-
let
|
|
3864
|
+
}, Ma = ({ control: e, layout: t, dataSourceQuestion: n, parentElementRef: r, validate: i, clearFieldErrors: a }) => {
|
|
3865
|
+
let o = n.options.map((e) => ({
|
|
3511
3866
|
value: String(e.id),
|
|
3512
3867
|
label: e.text,
|
|
3513
3868
|
layout: t.option,
|
|
3514
3869
|
layoutSelected: t.optionSelected
|
|
3515
|
-
})),
|
|
3870
|
+
})), s = String(n.id);
|
|
3516
3871
|
return /* @__PURE__ */ B("div", {
|
|
3517
3872
|
style: {
|
|
3518
3873
|
display: "flex",
|
|
@@ -3522,28 +3877,28 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3522
3877
|
},
|
|
3523
3878
|
children: [t.title && /* @__PURE__ */ B(G, z(z({}, t.title), {}, {
|
|
3524
3879
|
text: n.text,
|
|
3525
|
-
htmlFor:
|
|
3880
|
+
htmlFor: s
|
|
3526
3881
|
})), /* @__PURE__ */ B(_i, {
|
|
3527
|
-
name:
|
|
3882
|
+
name: s,
|
|
3528
3883
|
control: e,
|
|
3529
3884
|
rules: {
|
|
3530
3885
|
required: !!n.required,
|
|
3531
|
-
validate:
|
|
3886
|
+
validate: i
|
|
3532
3887
|
},
|
|
3533
3888
|
render: ({ field: e }) => {
|
|
3534
|
-
let
|
|
3889
|
+
let i = o.filter((t) => {
|
|
3535
3890
|
var n;
|
|
3536
3891
|
return (n = e.value) == null ? void 0 : n.includes(t.value);
|
|
3537
3892
|
});
|
|
3538
|
-
return /* @__PURE__ */ B(
|
|
3539
|
-
name:
|
|
3540
|
-
options:
|
|
3893
|
+
return /* @__PURE__ */ B(Aa, {
|
|
3894
|
+
name: s,
|
|
3895
|
+
options: o,
|
|
3541
3896
|
placeholder: n.placeholder,
|
|
3542
3897
|
closeMenuOnSelect: !1,
|
|
3543
|
-
value:
|
|
3898
|
+
value: i,
|
|
3544
3899
|
onChange: (t) => {
|
|
3545
3900
|
let n = t.map((e) => e.value);
|
|
3546
|
-
e.onChange(n);
|
|
3901
|
+
e.onChange(n), a();
|
|
3547
3902
|
},
|
|
3548
3903
|
parentElementRef: r,
|
|
3549
3904
|
isMulti: !0,
|
|
@@ -3556,22 +3911,10 @@ var ma = ({ isOpen: e, image: t }) => /* @__PURE__ */ B("div", {
|
|
|
3556
3911
|
});
|
|
3557
3912
|
};
|
|
3558
3913
|
//#endregion
|
|
3559
|
-
//#region src/hooks/useIsKeyboard.ts
|
|
3560
|
-
R();
|
|
3561
|
-
var ya = () => {
|
|
3562
|
-
let [e, t] = N(!1);
|
|
3563
|
-
return P(() => {
|
|
3564
|
-
let e = () => t(!0), n = () => t(!1);
|
|
3565
|
-
return window.addEventListener("keydown", e), window.addEventListener("mousedown", n), () => {
|
|
3566
|
-
window.removeEventListener("keydown", e), window.removeEventListener("mousedown", n);
|
|
3567
|
-
};
|
|
3568
|
-
}, []), e;
|
|
3569
|
-
};
|
|
3570
|
-
//#endregion
|
|
3571
3914
|
//#region src/screens/questions-screen/components/questions/multi-selector-options-question/MultiSelectorOptionsOption.tsx
|
|
3572
3915
|
R();
|
|
3573
|
-
var
|
|
3574
|
-
let [a, o] = N(!1), s =
|
|
3916
|
+
var Na = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle: i }) => {
|
|
3917
|
+
let [a, o] = N(!1), s = Ca(), c = String(n.id), l = t.option, u = t.optionSelected, d = {
|
|
3575
3918
|
backgroundColor: U(u == null ? void 0 : u.backgroundColor),
|
|
3576
3919
|
borderRadius: u.cornerRadius
|
|
3577
3920
|
}, f = {
|
|
@@ -3615,8 +3958,8 @@ var ba = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle:
|
|
|
3615
3958
|
})
|
|
3616
3959
|
]
|
|
3617
3960
|
}) }, e.id);
|
|
3618
|
-
},
|
|
3619
|
-
let
|
|
3961
|
+
}, Pa = ({ control: e, layout: t, dataSourceQuestion: n, validate: r, clearFieldErrors: i }) => {
|
|
3962
|
+
let a = String(n.id);
|
|
3620
3963
|
return /* @__PURE__ */ B("div", {
|
|
3621
3964
|
style: { boxSizing: "border-box" },
|
|
3622
3965
|
children: /* @__PURE__ */ B("fieldset", {
|
|
@@ -3636,25 +3979,25 @@ var ba = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle:
|
|
|
3636
3979
|
},
|
|
3637
3980
|
children: /* @__PURE__ */ B(G, z(z({}, t.title), {}, { text: n.text }))
|
|
3638
3981
|
}), /* @__PURE__ */ B(_i, {
|
|
3639
|
-
name:
|
|
3982
|
+
name: a,
|
|
3640
3983
|
control: e,
|
|
3641
3984
|
rules: {
|
|
3642
3985
|
required: !!n.required,
|
|
3643
|
-
validate:
|
|
3986
|
+
validate: r
|
|
3644
3987
|
},
|
|
3645
3988
|
render: ({ field: e }) => {
|
|
3646
3989
|
var r;
|
|
3647
|
-
let
|
|
3990
|
+
let a = (r = e.value) == null ? [] : r;
|
|
3648
3991
|
return /* @__PURE__ */ B(m, { children: n.options.map((r) => {
|
|
3649
|
-
let
|
|
3650
|
-
return /* @__PURE__ */ B(
|
|
3992
|
+
let o = String(r.id), s = a.includes(o);
|
|
3993
|
+
return /* @__PURE__ */ B(Na, {
|
|
3651
3994
|
dataSourceQuestion: n,
|
|
3652
3995
|
layout: t,
|
|
3653
3996
|
option: r,
|
|
3654
|
-
isChosen:
|
|
3997
|
+
isChosen: s,
|
|
3655
3998
|
onToggle: () => {
|
|
3656
|
-
let t =
|
|
3657
|
-
e.onChange(t);
|
|
3999
|
+
let t = s ? a.filter((e) => e !== o) : [...a, o];
|
|
4000
|
+
e.onChange(t), i();
|
|
3658
4001
|
}
|
|
3659
4002
|
}, r.id);
|
|
3660
4003
|
}) });
|
|
@@ -3666,8 +4009,8 @@ var ba = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle:
|
|
|
3666
4009
|
//#endregion
|
|
3667
4010
|
//#region src/screens/questions-screen/components/questions/multi-selector-buttons-question/MultiSelectorButtonsOption.tsx
|
|
3668
4011
|
R();
|
|
3669
|
-
var
|
|
3670
|
-
let [a, o] = N(!1), s =
|
|
4012
|
+
var Fa = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle: i }) => {
|
|
4013
|
+
let [a, o] = N(!1), s = Ca(), c = String(n.id), l = t.option, u = t.optionSelected, d = {
|
|
3671
4014
|
borderRadius: l == null ? void 0 : l.cornerRadius,
|
|
3672
4015
|
background: U(l == null ? void 0 : l.backgroundColor),
|
|
3673
4016
|
borderColor: U(l == null ? void 0 : l.borderColor),
|
|
@@ -3709,8 +4052,8 @@ var Sa = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle:
|
|
|
3709
4052
|
}), /* @__PURE__ */ B(G, z(z({}, r ? u.title : l.title), {}, { text: e.text }))]
|
|
3710
4053
|
})
|
|
3711
4054
|
});
|
|
3712
|
-
},
|
|
3713
|
-
let
|
|
4055
|
+
}, Ia = ({ control: e, layout: t, dataSourceQuestion: n, validate: r, clearFieldErrors: i }) => {
|
|
4056
|
+
let a = String(n.id);
|
|
3714
4057
|
return /* @__PURE__ */ B("div", {
|
|
3715
4058
|
style: { boxSizing: "border-box" },
|
|
3716
4059
|
children: /* @__PURE__ */ B("fieldset", {
|
|
@@ -3727,15 +4070,15 @@ var Sa = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle:
|
|
|
3727
4070
|
},
|
|
3728
4071
|
children: /* @__PURE__ */ B(G, z(z({}, t.title), {}, { text: n.text }))
|
|
3729
4072
|
}), /* @__PURE__ */ B(_i, {
|
|
3730
|
-
name:
|
|
4073
|
+
name: a,
|
|
3731
4074
|
control: e,
|
|
3732
4075
|
rules: {
|
|
3733
4076
|
required: !!n.required,
|
|
3734
|
-
validate:
|
|
4077
|
+
validate: r
|
|
3735
4078
|
},
|
|
3736
4079
|
render: ({ field: e }) => {
|
|
3737
4080
|
var r;
|
|
3738
|
-
let
|
|
4081
|
+
let a = (r = e.value) == null ? [] : r;
|
|
3739
4082
|
return /* @__PURE__ */ B("div", {
|
|
3740
4083
|
style: {
|
|
3741
4084
|
display: "flex",
|
|
@@ -3743,15 +4086,15 @@ var Sa = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle:
|
|
|
3743
4086
|
gap: 5
|
|
3744
4087
|
},
|
|
3745
4088
|
children: n.options.map((r) => {
|
|
3746
|
-
let
|
|
3747
|
-
return /* @__PURE__ */ B(
|
|
4089
|
+
let o = String(r.id), s = a.includes(o);
|
|
4090
|
+
return /* @__PURE__ */ B(Fa, {
|
|
3748
4091
|
dataSourceQuestion: n,
|
|
3749
4092
|
layout: t,
|
|
3750
4093
|
option: r,
|
|
3751
|
-
isChosen:
|
|
4094
|
+
isChosen: s,
|
|
3752
4095
|
onToggle: () => {
|
|
3753
|
-
let t =
|
|
3754
|
-
e.onChange(t);
|
|
4096
|
+
let t = s ? a.filter((e) => e !== o) : [...a, o];
|
|
4097
|
+
e.onChange(t), i();
|
|
3755
4098
|
}
|
|
3756
4099
|
}, r.id);
|
|
3757
4100
|
})
|
|
@@ -3762,263 +4105,96 @@ var Sa = ({ option: e, layout: t, dataSourceQuestion: n, isChosen: r, onToggle:
|
|
|
3762
4105
|
});
|
|
3763
4106
|
};
|
|
3764
4107
|
//#endregion
|
|
3765
|
-
//#region src/screens/questions-screen/components/
|
|
3766
|
-
R();
|
|
3767
|
-
var wa = ({ option: e, layout: t, dataSourceQuestion: n, register: r, watch: i }) => {
|
|
3768
|
-
let [a, o] = N(!1), s = ya(), c = String(n.id), l = i(c) === String(e.id), u = t.option, d = t.optionSelected, f = {
|
|
3769
|
-
backgroundColor: U(d == null ? void 0 : d.backgroundColor),
|
|
3770
|
-
borderRadius: d.cornerRadius
|
|
3771
|
-
}, p = {
|
|
3772
|
-
backgroundColor: U(u == null ? void 0 : u.backgroundColor),
|
|
3773
|
-
borderRadius: u.cornerRadius
|
|
3774
|
-
}, m = a && s ? { filter: `drop-shadow(0 0 1px ${Jt})` } : {};
|
|
3775
|
-
return /* @__PURE__ */ B("div", { children: /* @__PURE__ */ B("label", {
|
|
3776
|
-
style: z({
|
|
3777
|
-
display: "flex",
|
|
3778
|
-
alignItems: "center",
|
|
3779
|
-
alignContent: "center",
|
|
3780
|
-
gap: 8,
|
|
3781
|
-
cursor: "pointer"
|
|
3782
|
-
}, l ? f : p),
|
|
3783
|
-
children: [
|
|
3784
|
-
/* @__PURE__ */ B("div", {
|
|
3785
|
-
style: z({
|
|
3786
|
-
display: "flex",
|
|
3787
|
-
alignItems: "center",
|
|
3788
|
-
alignContent: "center",
|
|
3789
|
-
flexShrink: 0
|
|
3790
|
-
}, m),
|
|
3791
|
-
children: /* @__PURE__ */ B(W, z({}, l ? d.image : u.image))
|
|
3792
|
-
}),
|
|
3793
|
-
/* @__PURE__ */ B(G, z(z({}, l ? d.title : u.title), {}, { text: e.text })),
|
|
3794
|
-
/* @__PURE__ */ B("input", z(z({ style: {
|
|
3795
|
-
width: 1,
|
|
3796
|
-
height: 1,
|
|
3797
|
-
opacity: 0,
|
|
3798
|
-
position: "absolute",
|
|
3799
|
-
left: "50%"
|
|
3800
|
-
} }, r(c, {
|
|
3801
|
-
required: !!n.required,
|
|
3802
|
-
validate: pa(n.validators, !!n.required)
|
|
3803
|
-
})), {}, {
|
|
3804
|
-
value: e.id,
|
|
3805
|
-
type: "radio",
|
|
3806
|
-
onFocus: () => o(!0),
|
|
3807
|
-
onBlur: () => o(!1)
|
|
3808
|
-
}))
|
|
3809
|
-
]
|
|
3810
|
-
}) }, e.id);
|
|
3811
|
-
}, Ta = ({ layout: e, register: t, watch: n, dataSourceQuestion: r }) => /* @__PURE__ */ B("div", {
|
|
3812
|
-
style: { boxSizing: "border-box" },
|
|
3813
|
-
children: /* @__PURE__ */ B("fieldset", {
|
|
3814
|
-
style: {
|
|
3815
|
-
margin: 0,
|
|
3816
|
-
padding: 0,
|
|
3817
|
-
border: "none",
|
|
3818
|
-
display: "flex",
|
|
3819
|
-
flexDirection: "column",
|
|
3820
|
-
gap: "16px"
|
|
3821
|
-
},
|
|
3822
|
-
children: [e.title && /* @__PURE__ */ B("legend", {
|
|
3823
|
-
style: {
|
|
3824
|
-
margin: 0,
|
|
3825
|
-
padding: 0,
|
|
3826
|
-
marginBottom: "16px"
|
|
3827
|
-
},
|
|
3828
|
-
children: /* @__PURE__ */ B(G, z(z({}, e.title), {}, { text: r.text }))
|
|
3829
|
-
}), r.options.map((i) => /* @__PURE__ */ B(wa, {
|
|
3830
|
-
register: t,
|
|
3831
|
-
watch: n,
|
|
3832
|
-
layout: e,
|
|
3833
|
-
option: i,
|
|
3834
|
-
dataSourceQuestion: r
|
|
3835
|
-
}, i.id))]
|
|
3836
|
-
})
|
|
3837
|
-
});
|
|
3838
|
-
//#endregion
|
|
3839
|
-
//#region src/screens/questions-screen/components/questions/selector-buttons-question/SelectorButtonsOption.tsx
|
|
4108
|
+
//#region src/screens/questions-screen/components/question/index.tsx
|
|
3840
4109
|
R();
|
|
3841
|
-
var
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
background: U(d == null ? void 0 : d.backgroundColor),
|
|
3850
|
-
borderColor: U(d == null ? void 0 : d.borderColor),
|
|
3851
|
-
borderWidth: d == null ? void 0 : d.borderWidth
|
|
3852
|
-
}, m = a && s ? { outline: `2px solid ${Jt}` } : {};
|
|
4110
|
+
var La = ({ layout: e, dataSourceQuestion: t, parentElementRef: n, shouldClearErrorsOnChange: r = !0 }) => {
|
|
4111
|
+
var i;
|
|
4112
|
+
let a = F(null), o = n == null ? a : n, s = yi(), { register: c, watch: l, control: u, formState: d } = s, { errors: f } = d, p = String(t.id), m = p in f && ((i = f[p]) == null ? void 0 : i.types), { validate: h, clearFieldErrors: g } = va({
|
|
4113
|
+
name: p,
|
|
4114
|
+
validators: t.validators,
|
|
4115
|
+
required: !!t.required,
|
|
4116
|
+
form: s
|
|
4117
|
+
}), _ = r ? g : () => {};
|
|
3853
4118
|
return /* @__PURE__ */ B("div", {
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
4119
|
+
ref: a,
|
|
4120
|
+
children: [/* @__PURE__ */ B(ya, {
|
|
4121
|
+
backgroundColor: e.backgroundColor,
|
|
4122
|
+
cornerRadius: e.cornerRadius,
|
|
4123
|
+
isError: !!m,
|
|
4124
|
+
isRequired: t.required,
|
|
4125
|
+
validationBorderColor: e.validationBorderColor,
|
|
4126
|
+
validationBorderWidth: e.validationBorderWidth,
|
|
4127
|
+
children: [
|
|
4128
|
+
e.displayType === Ot.TEXT_EXPANDABLE && /* @__PURE__ */ B(Sa, {
|
|
4129
|
+
layout: e,
|
|
4130
|
+
dataSourceQuestion: t,
|
|
4131
|
+
register: c,
|
|
4132
|
+
validate: h,
|
|
4133
|
+
clearFieldErrors: _
|
|
4134
|
+
}),
|
|
4135
|
+
e.displayType === Ot.TEXT_SINGLE_LINE && /* @__PURE__ */ B(xa, {
|
|
4136
|
+
layout: e,
|
|
4137
|
+
dataSourceQuestion: t,
|
|
4138
|
+
register: c,
|
|
4139
|
+
validate: h,
|
|
4140
|
+
clearFieldErrors: _
|
|
4141
|
+
}),
|
|
4142
|
+
e.displayType === Ot.SELECTOR_OPTIONS && /* @__PURE__ */ B(Ta, {
|
|
4143
|
+
layout: e,
|
|
4144
|
+
dataSourceQuestion: t,
|
|
4145
|
+
watch: l,
|
|
4146
|
+
register: c,
|
|
4147
|
+
validate: h,
|
|
4148
|
+
clearFieldErrors: _
|
|
4149
|
+
}),
|
|
4150
|
+
e.displayType === Ot.SELECTOR_BUTTONS && /* @__PURE__ */ B(Da, {
|
|
4151
|
+
layout: e,
|
|
4152
|
+
dataSourceQuestion: t,
|
|
4153
|
+
watch: l,
|
|
4154
|
+
register: c,
|
|
4155
|
+
validate: h,
|
|
4156
|
+
clearFieldErrors: _
|
|
4157
|
+
}),
|
|
4158
|
+
e.displayType === Ot.SELECTOR_DROPDOWN && /* @__PURE__ */ B(ja, {
|
|
4159
|
+
control: u,
|
|
4160
|
+
layout: e,
|
|
4161
|
+
dataSourceQuestion: t,
|
|
4162
|
+
parentElementRef: o,
|
|
4163
|
+
validate: h,
|
|
4164
|
+
clearFieldErrors: _
|
|
4165
|
+
}),
|
|
4166
|
+
e.displayType === Ot.MULTI_SELECTOR_DROPDOWN && /* @__PURE__ */ B(Ma, {
|
|
4167
|
+
control: u,
|
|
4168
|
+
layout: e,
|
|
4169
|
+
dataSourceQuestion: t,
|
|
4170
|
+
parentElementRef: o,
|
|
4171
|
+
validate: h,
|
|
4172
|
+
clearFieldErrors: _
|
|
4173
|
+
}),
|
|
4174
|
+
e.displayType === Ot.MULTI_SELECTOR_OPTIONS && /* @__PURE__ */ B(Pa, {
|
|
4175
|
+
control: u,
|
|
4176
|
+
layout: e,
|
|
4177
|
+
dataSourceQuestion: t,
|
|
4178
|
+
validate: h,
|
|
4179
|
+
clearFieldErrors: _
|
|
4180
|
+
}),
|
|
4181
|
+
e.displayType === Ot.MULTI_SELECTOR_BUTTONS && /* @__PURE__ */ B(Ia, {
|
|
4182
|
+
control: u,
|
|
4183
|
+
layout: e,
|
|
4184
|
+
dataSourceQuestion: t,
|
|
4185
|
+
validate: h,
|
|
4186
|
+
clearFieldErrors: _
|
|
4187
|
+
})
|
|
4188
|
+
]
|
|
4189
|
+
}), m && /* @__PURE__ */ B(ba, {
|
|
4190
|
+
validationErrorsTypes: m,
|
|
4191
|
+
title: e.validationMessage
|
|
3911
4192
|
})]
|
|
3912
|
-
})
|
|
3913
|
-
}), Oa = ({ children: e, backgroundColor: t, cornerRadius: n = 0, isError: r, isRequired: i, validationBorderColor: a, validationBorderWidth: o }) => /* @__PURE__ */ B("div", {
|
|
3914
|
-
style: z({
|
|
3915
|
-
position: "relative",
|
|
3916
|
-
flexShrink: 0,
|
|
3917
|
-
width: "100%",
|
|
3918
|
-
fontWeight: 300,
|
|
3919
|
-
lineHeight: "140%",
|
|
3920
|
-
backgroundColor: U(t) || "transparent",
|
|
3921
|
-
borderRadius: n,
|
|
3922
|
-
padding: "16px",
|
|
3923
|
-
boxSizing: "border-box",
|
|
3924
|
-
height: "auto"
|
|
3925
|
-
}, r && z(z({}, U(a) && {
|
|
3926
|
-
borderColor: a,
|
|
3927
|
-
borderStyle: "solid"
|
|
3928
|
-
}), o && { borderWidth: o })),
|
|
3929
|
-
children: [i && /* @__PURE__ */ B("span", {
|
|
3930
|
-
style: {
|
|
3931
|
-
color: U(a),
|
|
3932
|
-
position: "absolute",
|
|
3933
|
-
insetInlineStart: "6px",
|
|
3934
|
-
top: "18px"
|
|
3935
|
-
},
|
|
3936
|
-
children: "*"
|
|
3937
|
-
}), e]
|
|
3938
|
-
}), ka = ({ validationErrorsTypes: e, title: t }) => e ? /* @__PURE__ */ B("div", {
|
|
3939
|
-
style: {
|
|
3940
|
-
width: "100%",
|
|
3941
|
-
fontSize: 12
|
|
3942
|
-
},
|
|
3943
|
-
children: Object.entries(e).map(([e, n]) => /* @__PURE__ */ B(G, z(z({}, t), {}, { text: n }), e))
|
|
3944
|
-
}) : null, Aa = ({ layout: e, dataSourceQuestion: t, register: n }) => {
|
|
3945
|
-
var r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v;
|
|
3946
|
-
let y = String(t.id);
|
|
3947
|
-
return /* @__PURE__ */ B("div", {
|
|
3948
|
-
style: {
|
|
3949
|
-
display: "flex",
|
|
3950
|
-
flexDirection: "column",
|
|
3951
|
-
gap: "16px"
|
|
3952
|
-
},
|
|
3953
|
-
children: [/* @__PURE__ */ B(G, z(z({}, e.title), {}, {
|
|
3954
|
-
text: t.text,
|
|
3955
|
-
htmlFor: y
|
|
3956
|
-
})), /* @__PURE__ */ B("input", z(z({}, n(y, {
|
|
3957
|
-
required: !!t.required,
|
|
3958
|
-
validate: pa(t.validators, !!t.required)
|
|
3959
|
-
})), {}, {
|
|
3960
|
-
id: y,
|
|
3961
|
-
type: ((e) => e ? e === kt.EMAIL ? "email" : e === kt.FREE_TEXT ? "text" : e === kt.NUMBER ? "number" : e === kt.SECURE ? "password" : "text" : "text")((r = e.textField) == null ? void 0 : r.inputType),
|
|
3962
|
-
style: {
|
|
3963
|
-
fontFamily: (i = e == null || (a = e.textField) == null ? void 0 : a.fontName) == null ? "sans-serif" : i,
|
|
3964
|
-
fontSize: (o = e == null || (s = e.textField) == null ? void 0 : s.fontSize) == null ? 15 : o,
|
|
3965
|
-
color: (c = U(e == null || (l = e.textField) == null ? void 0 : l.fontColor)) == null ? "#000000" : c,
|
|
3966
|
-
height: "42px",
|
|
3967
|
-
borderWidth: (u = e == null || (d = e.textField) == null ? void 0 : d.borderWidth) == null ? 1 : u,
|
|
3968
|
-
borderColor: (f = U(e == null || (p = e.textField) == null ? void 0 : p.borderColor)) == null ? "#d9d9d9" : f,
|
|
3969
|
-
borderStyle: "solid",
|
|
3970
|
-
borderRadius: (m = e == null || (h = e.textField) == null ? void 0 : h.cornerRadius) == null ? 8 : m,
|
|
3971
|
-
padding: "11px",
|
|
3972
|
-
boxSizing: "border-box",
|
|
3973
|
-
backgroundColor: (g = U(e == null || (_ = e.textField) == null ? void 0 : _.backgroundColor)) == null ? "#FFFFFF" : g,
|
|
3974
|
-
outlineColor: Jt
|
|
3975
|
-
},
|
|
3976
|
-
placeholder: (v = t.placeholder) == null ? "" : v,
|
|
3977
|
-
"data-id": y
|
|
3978
|
-
}))]
|
|
3979
|
-
});
|
|
3980
|
-
}, ja = ({ layout: e, dataSourceQuestion: t, register: n }) => {
|
|
3981
|
-
var r, i, a, o, s, c, l, u, d, f, p, m, h;
|
|
3982
|
-
let g = String(t.id);
|
|
3983
|
-
return /* @__PURE__ */ B("div", {
|
|
3984
|
-
style: {
|
|
3985
|
-
display: "flex",
|
|
3986
|
-
flexDirection: "column",
|
|
3987
|
-
gap: "16px"
|
|
3988
|
-
},
|
|
3989
|
-
children: [/* @__PURE__ */ B(G, z(z({}, e.title), {}, {
|
|
3990
|
-
text: t.text,
|
|
3991
|
-
htmlFor: g
|
|
3992
|
-
})), /* @__PURE__ */ B("textarea", z(z({}, n(g, {
|
|
3993
|
-
required: !!t.required,
|
|
3994
|
-
validate: pa(t.validators, !!t.required)
|
|
3995
|
-
})), {}, {
|
|
3996
|
-
id: g,
|
|
3997
|
-
placeholder: (r = t.placeholder) == null ? "" : r,
|
|
3998
|
-
onInput: (e) => {
|
|
3999
|
-
e.currentTarget.style.height = "auto", e.currentTarget.style.height = `${e.currentTarget.scrollHeight - 15}px`;
|
|
4000
|
-
},
|
|
4001
|
-
"data-id": g,
|
|
4002
|
-
style: {
|
|
4003
|
-
fontFamily: "sans-serif",
|
|
4004
|
-
fontSize: (i = e == null || (a = e.textField) == null ? void 0 : a.fontSize) == null ? 15 : i,
|
|
4005
|
-
color: (o = U(e == null || (s = e.textField) == null ? void 0 : s.fontColor)) == null ? "#000000" : o,
|
|
4006
|
-
resize: "none",
|
|
4007
|
-
overflow: "hidden",
|
|
4008
|
-
height: "42px",
|
|
4009
|
-
minHeight: "42px",
|
|
4010
|
-
borderWidth: (c = e == null || (l = e.textField) == null ? void 0 : l.borderWidth) == null ? 1 : c,
|
|
4011
|
-
borderColor: (u = U(e == null || (d = e.textField) == null ? void 0 : d.borderColor)) == null ? "#d9d9d9" : u,
|
|
4012
|
-
borderStyle: "solid",
|
|
4013
|
-
borderRadius: (f = e == null || (p = e.textField) == null ? void 0 : p.cornerRadius) == null ? 8 : f,
|
|
4014
|
-
padding: "11px",
|
|
4015
|
-
boxSizing: "border-box",
|
|
4016
|
-
backgroundColor: (m = U(e == null || (h = e.textField) == null ? void 0 : h.backgroundColor)) == null ? "#FFFFFF" : m,
|
|
4017
|
-
outlineColor: Jt
|
|
4018
|
-
}
|
|
4019
|
-
}))]
|
|
4020
4193
|
});
|
|
4021
|
-
},
|
|
4194
|
+
}, Ra = (e, t) => t.find((t) => {
|
|
4195
|
+
var n;
|
|
4196
|
+
return (n = t.questionIds) == null ? void 0 : n.some((t) => t === e);
|
|
4197
|
+
}), za = (e, t) => t.find((t) => !t.questionIds && t.answerType === e), Ba = (e, t, n) => n ? Ra(String(e.id), t) || za(e.answerType, t) : t.find((t) => t.answerType === e.answerType), Va, Ha = class e extends st {
|
|
4022
4198
|
constructor({ errorCode: t, message: n, underlyingError: r, underlyingBaseError: i }) {
|
|
4023
4199
|
let a = st.getErrorKey(t, Xt);
|
|
4024
4200
|
super({
|
|
@@ -4034,32 +4210,34 @@ var Ea = ({ option: e, layout: t, dataSourceQuestion: n, register: r, watch: i }
|
|
|
4034
4210
|
});
|
|
4035
4211
|
}
|
|
4036
4212
|
};
|
|
4037
|
-
|
|
4038
|
-
|
|
4213
|
+
//#endregion
|
|
4214
|
+
//#region src/screens/questions-screen/index.tsx
|
|
4215
|
+
Va = Ha, Va.MODULE = Yt, Va.ERROR_ENUM_NAME = "GuiModuleError", Va.SHORT_CODE = "GM", R();
|
|
4216
|
+
var Ua = ({ header: e, title: t, buttons: n, footer: r, questions: i, dataSource: a, properties: o, backgroundColor: s, backgroundImage: c }) => {
|
|
4039
4217
|
var l;
|
|
4040
|
-
let u = ut.FORM, { perform:
|
|
4041
|
-
if (!a || (a == null ? void 0 : a.questions.length) === 0) return
|
|
4218
|
+
let u = F(null), d = ut.FORM, { perform: f } = vt();
|
|
4219
|
+
if (!a || (a == null ? void 0 : a.questions.length) === 0) return f(new Ha({
|
|
4042
4220
|
errorCode: Xt.DECODING_FAILED,
|
|
4043
4221
|
message: "No dataSource or no data for questions in the dataSource"
|
|
4044
4222
|
})), null;
|
|
4045
|
-
if (!(i != null && i.itemTypes) || Array.isArray(i == null ? void 0 : i.itemTypes) && (i == null || (l = i.itemTypes) == null ? void 0 : l.length) === 0) return
|
|
4223
|
+
if (!(i != null && i.itemTypes) || Array.isArray(i == null ? void 0 : i.itemTypes) && (i == null || (l = i.itemTypes) == null ? void 0 : l.length) === 0) return f(new Ha({
|
|
4046
4224
|
errorCode: Xt.DECODING_FAILED,
|
|
4047
4225
|
message: "No questions in the itemTypes field or itemTypes is not an array"
|
|
4048
4226
|
})), null;
|
|
4049
|
-
let
|
|
4227
|
+
let p = ma({
|
|
4050
4228
|
mode: "onSubmit",
|
|
4051
4229
|
reValidateMode: "onSubmit",
|
|
4052
4230
|
criteriaMode: "all",
|
|
4053
|
-
defaultValues:
|
|
4054
|
-
});
|
|
4231
|
+
defaultValues: o ? sn(a.questions, o) : {}
|
|
4232
|
+
}), { handleSubmit: m, reset: h } = p;
|
|
4055
4233
|
return /* @__PURE__ */ B(Cn, {
|
|
4056
4234
|
header: e,
|
|
4057
4235
|
footer: r,
|
|
4058
4236
|
backgroundColor: s,
|
|
4059
4237
|
backgroundImage: c,
|
|
4060
|
-
children: /* @__PURE__ */ B("form", {
|
|
4061
|
-
onSubmit:
|
|
4062
|
-
|
|
4238
|
+
children: /* @__PURE__ */ B(bi, z(z({}, p), {}, { children: /* @__PURE__ */ B("form", {
|
|
4239
|
+
onSubmit: m((e) => {
|
|
4240
|
+
f(an(e), d), h();
|
|
4063
4241
|
}),
|
|
4064
4242
|
style: {
|
|
4065
4243
|
height: "100%",
|
|
@@ -4084,7 +4262,7 @@ var Pa = ({ header: e, title: t, buttons: n, footer: r, questions: i, dataSource
|
|
|
4084
4262
|
position: "relative",
|
|
4085
4263
|
backgroundColor: U(i == null ? void 0 : i.backgroundColor) || "transparent"
|
|
4086
4264
|
},
|
|
4087
|
-
ref:
|
|
4265
|
+
ref: u,
|
|
4088
4266
|
children: [t && /* @__PURE__ */ B("div", {
|
|
4089
4267
|
style: {
|
|
4090
4268
|
lineHeight: "39.2px",
|
|
@@ -4101,76 +4279,20 @@ var Pa = ({ header: e, title: t, buttons: n, footer: r, questions: i, dataSource
|
|
|
4101
4279
|
flexDirection: "column"
|
|
4102
4280
|
},
|
|
4103
4281
|
children: a.questions.map((e) => {
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
if ((n = t.questionIds) != null && n.length) return t.questionIds.find((t) => e === t);
|
|
4108
|
-
}))(String(e.id), i.itemTypes) || ((e, t) => t.find((t) => !t.questionIds && t.answerType === e))(e.answerType, i.itemTypes) : i.itemTypes.find((t) => t.answerType === e.answerType);
|
|
4109
|
-
if (!n) {
|
|
4110
|
-
d(new Na({
|
|
4282
|
+
let t = Ba(e, i.itemTypes, a.static);
|
|
4283
|
+
if (!t) {
|
|
4284
|
+
f(new Ha({
|
|
4111
4285
|
errorCode: Xt.DECODING_FAILED,
|
|
4112
4286
|
message: "The question template has not been found"
|
|
4113
4287
|
}));
|
|
4114
4288
|
return;
|
|
4115
4289
|
}
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
validationBorderColor: n == null ? void 0 : n.validationBorderColor,
|
|
4123
|
-
validationBorderWidth: n == null ? void 0 : n.validationBorderWidth,
|
|
4124
|
-
children: [
|
|
4125
|
-
r === Ot.TEXT_EXPANDABLE && /* @__PURE__ */ B(ja, {
|
|
4126
|
-
layout: n,
|
|
4127
|
-
dataSourceQuestion: e,
|
|
4128
|
-
register: h
|
|
4129
|
-
}),
|
|
4130
|
-
r === Ot.TEXT_SINGLE_LINE && /* @__PURE__ */ B(Aa, {
|
|
4131
|
-
layout: n,
|
|
4132
|
-
dataSourceQuestion: e,
|
|
4133
|
-
register: h
|
|
4134
|
-
}),
|
|
4135
|
-
r === Ot.SELECTOR_OPTIONS && /* @__PURE__ */ B(Ta, {
|
|
4136
|
-
layout: n,
|
|
4137
|
-
dataSourceQuestion: e,
|
|
4138
|
-
watch: y,
|
|
4139
|
-
register: h
|
|
4140
|
-
}),
|
|
4141
|
-
r === Ot.SELECTOR_BUTTONS && /* @__PURE__ */ B(Da, {
|
|
4142
|
-
layout: n,
|
|
4143
|
-
dataSourceQuestion: e,
|
|
4144
|
-
watch: y,
|
|
4145
|
-
register: h
|
|
4146
|
-
}),
|
|
4147
|
-
r === Ot.SELECTOR_DROPDOWN && /* @__PURE__ */ B(_a, {
|
|
4148
|
-
control: b,
|
|
4149
|
-
layout: n,
|
|
4150
|
-
dataSourceQuestion: e,
|
|
4151
|
-
parentElementRef: p
|
|
4152
|
-
}),
|
|
4153
|
-
r === Ot.MULTI_SELECTOR_DROPDOWN && /* @__PURE__ */ B(va, {
|
|
4154
|
-
control: b,
|
|
4155
|
-
layout: n,
|
|
4156
|
-
dataSourceQuestion: e,
|
|
4157
|
-
parentElementRef: p
|
|
4158
|
-
}),
|
|
4159
|
-
r === Ot.MULTI_SELECTOR_OPTIONS && /* @__PURE__ */ B(xa, {
|
|
4160
|
-
control: b,
|
|
4161
|
-
layout: n,
|
|
4162
|
-
dataSourceQuestion: e
|
|
4163
|
-
}),
|
|
4164
|
-
r === Ot.MULTI_SELECTOR_BUTTONS && /* @__PURE__ */ B(Ca, {
|
|
4165
|
-
control: b,
|
|
4166
|
-
layout: n,
|
|
4167
|
-
dataSourceQuestion: e
|
|
4168
|
-
})
|
|
4169
|
-
]
|
|
4170
|
-
}), o && /* @__PURE__ */ B(ka, {
|
|
4171
|
-
validationErrorsTypes: o,
|
|
4172
|
-
title: n.validationMessage
|
|
4173
|
-
})] }, e.id);
|
|
4290
|
+
return /* @__PURE__ */ B(La, {
|
|
4291
|
+
layout: t,
|
|
4292
|
+
dataSourceQuestion: e,
|
|
4293
|
+
parentElementRef: u,
|
|
4294
|
+
shouldClearErrorsOnChange: !1
|
|
4295
|
+
}, e.id);
|
|
4174
4296
|
})
|
|
4175
4297
|
})]
|
|
4176
4298
|
}), !!(n != null && n.length) && /* @__PURE__ */ B("div", {
|
|
@@ -4185,9 +4307,9 @@ var Pa = ({ header: e, title: t, buttons: n, footer: r, questions: i, dataSource
|
|
|
4185
4307
|
},
|
|
4186
4308
|
children: n.map((e, t) => /* @__PURE__ */ B(bn, z({ dataTestId: "question-button" }, e), t))
|
|
4187
4309
|
})]
|
|
4188
|
-
})
|
|
4310
|
+
}) }))
|
|
4189
4311
|
});
|
|
4190
|
-
},
|
|
4312
|
+
}, Wa = { display: "none" }, Ga = {
|
|
4191
4313
|
display: "flex",
|
|
4192
4314
|
alignItems: "center",
|
|
4193
4315
|
justifyContent: "center",
|
|
@@ -4197,7 +4319,7 @@ var Pa = ({ header: e, title: t, buttons: n, footer: r, questions: i, dataSource
|
|
|
4197
4319
|
borderRadius: "16px",
|
|
4198
4320
|
backgroundColor: "#7e57c5",
|
|
4199
4321
|
cursor: "pointer"
|
|
4200
|
-
},
|
|
4322
|
+
}, Ka = {
|
|
4201
4323
|
position: "relative",
|
|
4202
4324
|
display: "flex",
|
|
4203
4325
|
flexGrow: 1,
|
|
@@ -4213,7 +4335,7 @@ var Pa = ({ header: e, title: t, buttons: n, footer: r, questions: i, dataSource
|
|
|
4213
4335
|
//#endregion
|
|
4214
4336
|
//#region src/screens/gallery-screen/index.tsx
|
|
4215
4337
|
R();
|
|
4216
|
-
var
|
|
4338
|
+
var qa = ({ header: e, footer: t, buttons: n, backgroundColor: r, backgroundImage: i, selectionLimit: a }) => {
|
|
4217
4339
|
var o;
|
|
4218
4340
|
let { perform: s } = vt(), c = F(null), l = typeof a == "number" && (a === 0 || a > 1), u = function() {
|
|
4219
4341
|
var e = H(function* (e) {
|
|
@@ -4254,14 +4376,14 @@ var Ra = ({ header: e, footer: t, buttons: n, backgroundColor: r, backgroundImag
|
|
|
4254
4376
|
backgroundColor: r,
|
|
4255
4377
|
backgroundImage: i,
|
|
4256
4378
|
children: /* @__PURE__ */ B(m, { children: /* @__PURE__ */ B("div", {
|
|
4257
|
-
style: z(z({},
|
|
4379
|
+
style: z(z({}, Ka), {}, { justifyContent: "center" }),
|
|
4258
4380
|
children: [/* @__PURE__ */ B("input", z(z({
|
|
4259
|
-
style:
|
|
4381
|
+
style: Wa,
|
|
4260
4382
|
ref: c,
|
|
4261
4383
|
type: "file",
|
|
4262
4384
|
accept: "image/*"
|
|
4263
4385
|
}, l ? { multiple: !0 } : {}), {}, { onInput: u })), /* @__PURE__ */ B("button", {
|
|
4264
|
-
style:
|
|
4386
|
+
style: Ga,
|
|
4265
4387
|
onClick: () => {
|
|
4266
4388
|
var e;
|
|
4267
4389
|
(e = c.current) == null || e.showPicker();
|
|
@@ -4270,7 +4392,7 @@ var Ra = ({ header: e, footer: t, buttons: n, backgroundColor: r, backgroundImag
|
|
|
4270
4392
|
})]
|
|
4271
4393
|
}) })
|
|
4272
4394
|
});
|
|
4273
|
-
},
|
|
4395
|
+
}, Ja = /* @__PURE__ */ a(((e, t) => {
|
|
4274
4396
|
(function(n, r) {
|
|
4275
4397
|
var i = "1.0.41", a = "", o = "?", s = "function", c = "undefined", l = "object", u = "string", d = "major", f = "model", p = "name", m = "type", h = "vendor", g = "version", _ = "architecture", v = "console", y = "mobile", b = "tablet", x = "smarttv", S = "wearable", C = "embedded", w = 500, T = "Amazon", E = "Apple", D = "ASUS", ee = "BlackBerry", O = "Browser", te = "Chrome", k = "Edge", A = "Firefox", ne = "Google", re = "Honor", ie = "Huawei", ae = "Lenovo", j = "LG", oe = "Microsoft", se = "Motorola", ce = "Nvidia", le = "OnePlus", M = "Opera", ue = "OPPO", de = "Samsung", fe = "Sharp", pe = "Sony", me = "Xiaomi", he = "Zebra", ge = "Facebook", _e = "Chromium OS", ve = "Mac OS", ye = " Browser", be = function(e, t) {
|
|
4276
4398
|
var n = {};
|
|
@@ -5429,13 +5551,13 @@ var Ra = ({ header: e, footer: t, buttons: n, backgroundColor: r, backgroundImag
|
|
|
5429
5551
|
};
|
|
5430
5552
|
}
|
|
5431
5553
|
})(typeof window == "object" ? window : e);
|
|
5432
|
-
})),
|
|
5554
|
+
})), Ya = (/* @__PURE__ */ a(((e) => {
|
|
5433
5555
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
5434
5556
|
function t(e) {
|
|
5435
5557
|
return e && typeof e == "object" && "default" in e ? e.default : e;
|
|
5436
5558
|
}
|
|
5437
5559
|
t((Fr(), c(Fn)));
|
|
5438
|
-
var n = new (
|
|
5560
|
+
var n = new (Ja())(), r = n.getBrowser();
|
|
5439
5561
|
n.getCPU();
|
|
5440
5562
|
var i = n.getDevice(), a = n.getEngine(), o = n.getOS(), s = n.getUA(), l = {
|
|
5441
5563
|
Mobile: "mobile",
|
|
@@ -5576,7 +5698,7 @@ var Ra = ({ header: e, footer: t, buttons: n, backgroundColor: r, backgroundImag
|
|
|
5576
5698
|
E(o), O(o), te(o) || ye(), ne(r), re(r);
|
|
5577
5699
|
var we = oe(r);
|
|
5578
5700
|
ce(r), le(r), k(o), A(o), de(r), fe(r), pe(r), C(i), w(i), me(a), he(a), Se(s), ae(r) || _e(s), j(r), T(i), ve(), ye(), be(), xe(), ge(), _e(s), ae(r) && _e(s), D(o), ee(o), M(r), ue(r), e.isDesktop = Ce, e.isSafari = we;
|
|
5579
|
-
})))(),
|
|
5701
|
+
})))(), Xa = { display: "none" }, Za = {
|
|
5580
5702
|
display: "flex",
|
|
5581
5703
|
alignItems: "center",
|
|
5582
5704
|
justifyContent: "center",
|
|
@@ -5586,7 +5708,7 @@ var Ra = ({ header: e, footer: t, buttons: n, backgroundColor: r, backgroundImag
|
|
|
5586
5708
|
borderRadius: "16px",
|
|
5587
5709
|
background: "#7e57c5",
|
|
5588
5710
|
cursor: "pointer"
|
|
5589
|
-
},
|
|
5711
|
+
}, Qa = {
|
|
5590
5712
|
position: "relative",
|
|
5591
5713
|
display: "flex",
|
|
5592
5714
|
alignItems: "center",
|
|
@@ -5599,7 +5721,7 @@ var Ra = ({ header: e, footer: t, buttons: n, backgroundColor: r, backgroundImag
|
|
|
5599
5721
|
//#endregion
|
|
5600
5722
|
//#region src/screens/camera-screen/index.tsx
|
|
5601
5723
|
R();
|
|
5602
|
-
var
|
|
5724
|
+
var $a = ({ header: e, footer: t, backgroundColor: n, backgroundImage: r, buttons: i, selectionLimit: a }) => {
|
|
5603
5725
|
var o;
|
|
5604
5726
|
let { perform: s } = vt(), c = F(null), l = typeof a == "number" && (a === 0 || a > 1), u = function() {
|
|
5605
5727
|
var e = H(function* (e) {
|
|
@@ -5644,7 +5766,7 @@ var Wa = ({ header: e, footer: t, backgroundColor: n, backgroundImage: r, button
|
|
|
5644
5766
|
}();
|
|
5645
5767
|
return P(() => {
|
|
5646
5768
|
H(function* () {
|
|
5647
|
-
if (
|
|
5769
|
+
if (Ya.isDesktop) return;
|
|
5648
5770
|
let e = yield ln();
|
|
5649
5771
|
(e === "denied" || e === "error") && s({
|
|
5650
5772
|
cancel: !1,
|
|
@@ -5658,21 +5780,21 @@ var Wa = ({ header: e, footer: t, backgroundColor: n, backgroundImage: r, button
|
|
|
5658
5780
|
backgroundColor: n,
|
|
5659
5781
|
backgroundImage: r,
|
|
5660
5782
|
children: /* @__PURE__ */ B(m, { children: /* @__PURE__ */ B("div", {
|
|
5661
|
-
style: z(z({},
|
|
5783
|
+
style: z(z({}, Qa), {}, { justifyContent: "center" }),
|
|
5662
5784
|
children: [/* @__PURE__ */ B("input", z(z({
|
|
5663
|
-
style:
|
|
5785
|
+
style: Xa,
|
|
5664
5786
|
ref: c,
|
|
5665
5787
|
type: "file",
|
|
5666
5788
|
accept: "image/*",
|
|
5667
5789
|
capture: "user"
|
|
5668
5790
|
}, l ? { multiple: !0 } : {}), {}, { onInput: u })), /* @__PURE__ */ B("button", {
|
|
5669
|
-
style:
|
|
5791
|
+
style: Za,
|
|
5670
5792
|
onClick: d,
|
|
5671
5793
|
children: /* @__PURE__ */ B(W, { imageId: i == null || (o = i[0]) == null || (o = o.image) == null ? void 0 : o.imageId })
|
|
5672
5794
|
})]
|
|
5673
5795
|
}) })
|
|
5674
5796
|
});
|
|
5675
|
-
},
|
|
5797
|
+
}, eo = function() {
|
|
5676
5798
|
var e = H(function* () {
|
|
5677
5799
|
try {
|
|
5678
5800
|
var e;
|
|
@@ -5685,7 +5807,7 @@ var Wa = ({ header: e, footer: t, backgroundColor: n, backgroundImage: r, button
|
|
|
5685
5807
|
return function() {
|
|
5686
5808
|
return e.apply(this, arguments);
|
|
5687
5809
|
};
|
|
5688
|
-
}(),
|
|
5810
|
+
}(), to = function() {
|
|
5689
5811
|
var e = H(function* () {
|
|
5690
5812
|
try {
|
|
5691
5813
|
return yield navigator.permissions.query({ name: "geolocation" });
|
|
@@ -5696,7 +5818,7 @@ var Wa = ({ header: e, footer: t, backgroundColor: n, backgroundImage: r, button
|
|
|
5696
5818
|
return function() {
|
|
5697
5819
|
return e.apply(this, arguments);
|
|
5698
5820
|
};
|
|
5699
|
-
}(),
|
|
5821
|
+
}(), no = function() {
|
|
5700
5822
|
var e = H(function* (e) {
|
|
5701
5823
|
return new Promise((t) => {
|
|
5702
5824
|
if (!navigator.geolocation) return t({ location: {
|
|
@@ -5728,31 +5850,31 @@ var Wa = ({ header: e, footer: t, backgroundColor: n, backgroundImage: r, button
|
|
|
5728
5850
|
return function(t) {
|
|
5729
5851
|
return e.apply(this, arguments);
|
|
5730
5852
|
};
|
|
5731
|
-
}(),
|
|
5853
|
+
}(), ro = (e, t) => typeof t == "number" && t > 0 ? t * 1e3 : e;
|
|
5732
5854
|
//#endregion
|
|
5733
5855
|
//#region src/hooks/useGeolocationLogic.ts
|
|
5734
5856
|
R();
|
|
5735
|
-
var
|
|
5857
|
+
var io = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
5736
5858
|
var r;
|
|
5737
5859
|
let i = {
|
|
5738
5860
|
[At.HIGH]: {
|
|
5739
5861
|
enableHighAccuracy: !0,
|
|
5740
|
-
timeout:
|
|
5862
|
+
timeout: ro(15e3, t),
|
|
5741
5863
|
maximumAge: 0
|
|
5742
5864
|
},
|
|
5743
5865
|
[At.BALANCED]: {
|
|
5744
5866
|
enableHighAccuracy: !1,
|
|
5745
|
-
timeout:
|
|
5867
|
+
timeout: ro(12e3, t),
|
|
5746
5868
|
maximumAge: 3e4
|
|
5747
5869
|
},
|
|
5748
5870
|
[At.LOW]: {
|
|
5749
5871
|
enableHighAccuracy: !1,
|
|
5750
|
-
timeout:
|
|
5872
|
+
timeout: ro(8e3, t),
|
|
5751
5873
|
maximumAge: 6e4
|
|
5752
5874
|
},
|
|
5753
5875
|
[At.PASSIVE]: {
|
|
5754
5876
|
enableHighAccuracy: !1,
|
|
5755
|
-
timeout:
|
|
5877
|
+
timeout: ro(5e3, t),
|
|
5756
5878
|
maximumAge: 3e5
|
|
5757
5879
|
}
|
|
5758
5880
|
}[n || At.PASSIVE], a = ut.FORM, { perform: o } = vt(), { setIsProcessingCallback: s } = yt(), [c, l] = N(!1), { devSettings: u } = _t(), d = !!(!(u == null || (r = u.popups) == null || (r = r.system_restricted) == null) && r.isOpen);
|
|
@@ -5767,25 +5889,25 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5767
5889
|
!(u == null || (e = u.popups) == null) && e.system_restricted || l(!1);
|
|
5768
5890
|
};
|
|
5769
5891
|
Ae(() => {
|
|
5770
|
-
|
|
5892
|
+
Ya.isSafari || e || s == null || s(!0);
|
|
5771
5893
|
}, []), P(() => {
|
|
5772
|
-
if (
|
|
5894
|
+
if (Ya.isSafari || e) return;
|
|
5773
5895
|
let t = !0;
|
|
5774
5896
|
return H(function* () {
|
|
5775
|
-
if ((yield
|
|
5897
|
+
if ((yield eo()) !== "granted") {
|
|
5776
5898
|
s == null || s(!1);
|
|
5777
5899
|
return;
|
|
5778
5900
|
}
|
|
5779
|
-
let e = yield
|
|
5901
|
+
let e = yield no(i);
|
|
5780
5902
|
t && o(e, a);
|
|
5781
5903
|
})(), () => {
|
|
5782
|
-
|
|
5904
|
+
Ya.isSafari || e || (t = !1);
|
|
5783
5905
|
};
|
|
5784
5906
|
}, []), P(() => {
|
|
5785
|
-
if (
|
|
5907
|
+
if (Ya.isSafari) return;
|
|
5786
5908
|
let e = !0, t = null;
|
|
5787
5909
|
return H(function* () {
|
|
5788
|
-
let n = yield
|
|
5910
|
+
let n = yield to();
|
|
5789
5911
|
n && (t = n, n.onchange = H(function* () {
|
|
5790
5912
|
if (n.state === "denied" && (s == null || s(!0), o({ location: {
|
|
5791
5913
|
locationState: "application_location_restricted",
|
|
@@ -5794,35 +5916,35 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5794
5916
|
error: "Application location services restricted or unavailable"
|
|
5795
5917
|
} }, a)), n.state === "granted") {
|
|
5796
5918
|
s == null || s(!0);
|
|
5797
|
-
let t = yield
|
|
5919
|
+
let t = yield no(i);
|
|
5798
5920
|
if (!e) return;
|
|
5799
5921
|
o(t, a);
|
|
5800
5922
|
}
|
|
5801
5923
|
}));
|
|
5802
5924
|
})(), () => {
|
|
5803
|
-
|
|
5925
|
+
Ya.isSafari || (e = !1, t && (t.onchange = null));
|
|
5804
5926
|
};
|
|
5805
5927
|
}, []);
|
|
5806
5928
|
let m = function() {
|
|
5807
5929
|
var e = H(function* (e) {
|
|
5808
5930
|
e.preventDefault();
|
|
5809
|
-
let t = yield
|
|
5931
|
+
let t = yield eo();
|
|
5810
5932
|
if (t === "denied") {
|
|
5811
5933
|
f();
|
|
5812
5934
|
return;
|
|
5813
5935
|
}
|
|
5814
|
-
t === "prompt" && (yield
|
|
5936
|
+
t === "prompt" && (yield no()), t === "granted" && o(yield no(i), a);
|
|
5815
5937
|
});
|
|
5816
5938
|
return function(t) {
|
|
5817
5939
|
return e.apply(this, arguments);
|
|
5818
5940
|
};
|
|
5819
5941
|
}(), h = function() {
|
|
5820
5942
|
var e = H(function* (e) {
|
|
5821
|
-
if (e.preventDefault(), (yield
|
|
5943
|
+
if (e.preventDefault(), (yield eo()) === "denied") {
|
|
5822
5944
|
f();
|
|
5823
5945
|
return;
|
|
5824
5946
|
}
|
|
5825
|
-
s == null || s(!0), o(yield
|
|
5947
|
+
s == null || s(!0), o(yield no(i), a);
|
|
5826
5948
|
});
|
|
5827
5949
|
return function(t) {
|
|
5828
5950
|
return e.apply(this, arguments);
|
|
@@ -5830,16 +5952,16 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5830
5952
|
}();
|
|
5831
5953
|
return {
|
|
5832
5954
|
isPopupOpen: c,
|
|
5833
|
-
handleAllowButtonClick:
|
|
5955
|
+
handleAllowButtonClick: Ya.isSafari ? h : m,
|
|
5834
5956
|
closePopup: p
|
|
5835
5957
|
};
|
|
5836
|
-
},
|
|
5958
|
+
}, ao = {
|
|
5837
5959
|
height: "100%",
|
|
5838
5960
|
fontFamily: "sans-serif",
|
|
5839
5961
|
display: "flex",
|
|
5840
5962
|
flexDirection: "column",
|
|
5841
5963
|
gap: "15px"
|
|
5842
|
-
},
|
|
5964
|
+
}, oo = {
|
|
5843
5965
|
flex: "1 1 100%",
|
|
5844
5966
|
display: "flex",
|
|
5845
5967
|
justifyContent: "flex-start",
|
|
@@ -5851,7 +5973,7 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5851
5973
|
width: "100%",
|
|
5852
5974
|
overflow: "auto",
|
|
5853
5975
|
position: "relative"
|
|
5854
|
-
},
|
|
5976
|
+
}, so = {
|
|
5855
5977
|
position: "absolute",
|
|
5856
5978
|
width: "100%",
|
|
5857
5979
|
height: "100%",
|
|
@@ -5865,25 +5987,25 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5865
5987
|
zIndex: 1e3,
|
|
5866
5988
|
pointerEvents: "auto",
|
|
5867
5989
|
cursor: "default"
|
|
5868
|
-
},
|
|
5990
|
+
}, co = {
|
|
5869
5991
|
width: "100%",
|
|
5870
5992
|
height: "auto",
|
|
5871
5993
|
marginBottom: "32px",
|
|
5872
5994
|
aspectRatio: "1.61"
|
|
5873
|
-
},
|
|
5995
|
+
}, lo = {
|
|
5874
5996
|
marginBottom: 20,
|
|
5875
5997
|
lineHeight: "39.2px",
|
|
5876
5998
|
width: "100%"
|
|
5877
|
-
},
|
|
5999
|
+
}, uo = {
|
|
5878
6000
|
lineHeight: "28px",
|
|
5879
6001
|
fontWeight: "400",
|
|
5880
6002
|
width: "100%"
|
|
5881
|
-
},
|
|
6003
|
+
}, fo = {
|
|
5882
6004
|
position: "relative",
|
|
5883
6005
|
padding: "32px 24px 0",
|
|
5884
6006
|
border: "1px solid rgba(0, 0, 0, 0.06)",
|
|
5885
6007
|
width: "min(400px, calc(100vw - 32px))"
|
|
5886
|
-
},
|
|
6008
|
+
}, po = {
|
|
5887
6009
|
marginBottom: "10px",
|
|
5888
6010
|
fontWeight: 500,
|
|
5889
6011
|
display: "-webkit-box",
|
|
@@ -5892,21 +6014,21 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5892
6014
|
overflow: "hidden",
|
|
5893
6015
|
textOverflow: "ellipsis",
|
|
5894
6016
|
lineClamp: 2
|
|
5895
|
-
},
|
|
6017
|
+
}, mo = {
|
|
5896
6018
|
marginBottom: "84px",
|
|
5897
6019
|
fontWeight: 400
|
|
5898
|
-
},
|
|
6020
|
+
}, ho = {
|
|
5899
6021
|
height: "100%",
|
|
5900
6022
|
overflow: "scroll",
|
|
5901
6023
|
maxHeight: "calc(100dvh - 190px)"
|
|
5902
|
-
},
|
|
6024
|
+
}, go = {
|
|
5903
6025
|
position: "absolute",
|
|
5904
6026
|
bottom: 0,
|
|
5905
6027
|
insetInline: 0,
|
|
5906
6028
|
padding: "24px",
|
|
5907
6029
|
width: "100%"
|
|
5908
|
-
},
|
|
5909
|
-
let f = c == null ? void 0 : c.find((e) => e.reason === $t.SYSTEM_RESTRICTED), { isPopupOpen: p, handleAllowButtonClick: m, closePopup: h } =
|
|
6030
|
+
}, _o = ({ title: e, header: t, footer: n, image: r, description: i, buttons: a, backgroundColor: o, backgroundImage: s, popups: c, askEveryTime: l, getLocationTimeout: u, locationAccuracy: d }) => {
|
|
6031
|
+
let f = c == null ? void 0 : c.find((e) => e.reason === $t.SYSTEM_RESTRICTED), { isPopupOpen: p, handleAllowButtonClick: m, closePopup: h } = io({
|
|
5910
6032
|
askEveryTime: l,
|
|
5911
6033
|
getLocationTimeout: u,
|
|
5912
6034
|
locationAccuracy: d
|
|
@@ -5917,23 +6039,23 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5917
6039
|
backgroundColor: o,
|
|
5918
6040
|
backgroundImage: s,
|
|
5919
6041
|
children: [/* @__PURE__ */ B("div", {
|
|
5920
|
-
style:
|
|
6042
|
+
style: ao,
|
|
5921
6043
|
children: [/* @__PURE__ */ B("div", {
|
|
5922
6044
|
part: "gui-geolocation-screen-container",
|
|
5923
6045
|
"data-ui": "gui-geolocation-screen-container",
|
|
5924
6046
|
id: "geolocation-screen-container",
|
|
5925
|
-
style:
|
|
6047
|
+
style: oo,
|
|
5926
6048
|
children: [
|
|
5927
6049
|
r && /* @__PURE__ */ B("div", {
|
|
5928
|
-
style:
|
|
6050
|
+
style: co,
|
|
5929
6051
|
children: /* @__PURE__ */ B(W, z({}, r))
|
|
5930
6052
|
}),
|
|
5931
6053
|
e && /* @__PURE__ */ B("div", {
|
|
5932
|
-
style:
|
|
6054
|
+
style: lo,
|
|
5933
6055
|
children: /* @__PURE__ */ B(G, z({}, e))
|
|
5934
6056
|
}),
|
|
5935
6057
|
i && /* @__PURE__ */ B("div", {
|
|
5936
|
-
style:
|
|
6058
|
+
style: uo,
|
|
5937
6059
|
children: /* @__PURE__ */ B(wn, z({}, i))
|
|
5938
6060
|
})
|
|
5939
6061
|
]
|
|
@@ -5948,12 +6070,12 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5948
6070
|
}, t))
|
|
5949
6071
|
})]
|
|
5950
6072
|
}), f && p && /* @__PURE__ */ B("div", {
|
|
5951
|
-
style:
|
|
6073
|
+
style: so,
|
|
5952
6074
|
onPointerDown: (e) => {
|
|
5953
6075
|
e.preventDefault(), e.stopPropagation(), h();
|
|
5954
6076
|
},
|
|
5955
6077
|
children: /* @__PURE__ */ B("div", {
|
|
5956
|
-
style: z(z({},
|
|
6078
|
+
style: z(z({}, fo), {}, {
|
|
5957
6079
|
borderRadius: (f == null ? void 0 : f.cornerRadius) || "27px",
|
|
5958
6080
|
backgroundColor: (f == null ? void 0 : f.backgroundColor) || "#ffffff"
|
|
5959
6081
|
}),
|
|
@@ -5962,18 +6084,18 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5962
6084
|
},
|
|
5963
6085
|
children: [
|
|
5964
6086
|
/* @__PURE__ */ B("div", {
|
|
5965
|
-
style:
|
|
6087
|
+
style: po,
|
|
5966
6088
|
children: /* @__PURE__ */ B(G, z({ fontSize: "24px" }, f.title))
|
|
5967
6089
|
}),
|
|
5968
6090
|
/* @__PURE__ */ B("div", {
|
|
5969
|
-
style:
|
|
6091
|
+
style: mo,
|
|
5970
6092
|
children: /* @__PURE__ */ B("div", {
|
|
5971
|
-
style:
|
|
6093
|
+
style: ho,
|
|
5972
6094
|
children: /* @__PURE__ */ B(G, z({ fontSize: "17px" }, f.message))
|
|
5973
6095
|
})
|
|
5974
6096
|
}),
|
|
5975
6097
|
f.actionButton1 && /* @__PURE__ */ B("div", {
|
|
5976
|
-
style:
|
|
6098
|
+
style: go,
|
|
5977
6099
|
children: /* @__PURE__ */ B(bn, z(z({ dataTestId: "question-button" }, f.actionButton1), f.actionButton1.type === "FORM" ? { onClick: h } : {}))
|
|
5978
6100
|
})
|
|
5979
6101
|
]
|
|
@@ -5982,11 +6104,11 @@ var Ya = ({ askEveryTime: e, getLocationTimeout: t, locationAccuracy: n }) => {
|
|
|
5982
6104
|
});
|
|
5983
6105
|
};
|
|
5984
6106
|
De(), R();
|
|
5985
|
-
var
|
|
6107
|
+
var vo = ce(void 0), yo = ({ children: e, handlers: t }) => /* @__PURE__ */ B(vo.Provider, {
|
|
5986
6108
|
value: { handlers: t },
|
|
5987
6109
|
children: e
|
|
5988
|
-
}),
|
|
5989
|
-
let t =
|
|
6110
|
+
}), bo = () => Pe(vo), xo = (e) => {
|
|
6111
|
+
let t = bo(), n = t == null ? void 0 : t.handlers, r;
|
|
5990
6112
|
return e.type === "FORM" && e.actionId && n && n[e.actionId] && (r = n[e.actionId]), /* @__PURE__ */ B(bn, z({
|
|
5991
6113
|
title: e.title,
|
|
5992
6114
|
image: e.image,
|
|
@@ -6001,17 +6123,17 @@ var co = ce(void 0), lo = ({ children: e, handlers: t }) => /* @__PURE__ */ B(co
|
|
|
6001
6123
|
paddings: e.paddings,
|
|
6002
6124
|
isGenericTemplate: !0
|
|
6003
6125
|
}, r && { onClick: r }));
|
|
6004
|
-
},
|
|
6126
|
+
}, So = ({ isPressed: e, isHovered: t, backgroundColor: n, highlightColor: r, hoverColor: i }) => {
|
|
6005
6127
|
let a = U(n) || "transparent", o = U(r), s = U(i);
|
|
6006
6128
|
return e ? o || a : t && s || a;
|
|
6007
6129
|
};
|
|
6008
6130
|
//#endregion
|
|
6009
6131
|
//#region src/components/imageButton/index.tsx
|
|
6010
6132
|
R();
|
|
6011
|
-
var
|
|
6133
|
+
var Co = (e) => {
|
|
6012
6134
|
let { image: t, responseBody: n, paddings: r, backgroundColor: i, highlightColor: a, hoverColor: o, cornerRadius: s, onClick: c } = e, { perform: l } = vt(), [u, d] = N(!0), [f, p] = N(0), { failedAssets: h } = bt(), { isHovered: g, isPressed: _, interactionHandlers: v } = vn(), y = Vt(t, h)[f];
|
|
6013
6135
|
if (!y) return null;
|
|
6014
|
-
let { imageId: b, imageURL: x, base64: S, contentMode: C = Et.ASPECT_FILL, cornerRadius: w, backgroundColor: T } = y, E =
|
|
6136
|
+
let { imageId: b, imageURL: x, base64: S, contentMode: C = Et.ASPECT_FILL, cornerRadius: w, backgroundColor: T } = y, E = So({
|
|
6015
6137
|
isPressed: _,
|
|
6016
6138
|
isHovered: g,
|
|
6017
6139
|
backgroundColor: i,
|
|
@@ -6078,9 +6200,9 @@ var mo = (e) => {
|
|
|
6078
6200
|
onClick: te,
|
|
6079
6201
|
children: A
|
|
6080
6202
|
}));
|
|
6081
|
-
},
|
|
6082
|
-
let t =
|
|
6083
|
-
return e.type === "FORM" && e.actionId && n && n[e.actionId] && (r = n[e.actionId]), /* @__PURE__ */ B(
|
|
6203
|
+
}, wo = (e) => {
|
|
6204
|
+
let t = bo(), n = t == null ? void 0 : t.handlers, r;
|
|
6205
|
+
return e.type === "FORM" && e.actionId && n && n[e.actionId] && (r = n[e.actionId]), /* @__PURE__ */ B(Co, z({
|
|
6084
6206
|
image: {
|
|
6085
6207
|
imageId: e.image.imageId,
|
|
6086
6208
|
imageURL: e.image.imageURL,
|
|
@@ -6100,18 +6222,18 @@ var mo = (e) => {
|
|
|
6100
6222
|
highlightColor: e.highlightColor,
|
|
6101
6223
|
hoverColor: e.hoverColor
|
|
6102
6224
|
}, r && { onClick: r }));
|
|
6103
|
-
},
|
|
6225
|
+
}, To = {
|
|
6104
6226
|
[Nt.TOP]: "flex-start",
|
|
6105
6227
|
[Nt.CENTER]: "center",
|
|
6106
6228
|
[Nt.BOTTOM]: "flex-end"
|
|
6107
|
-
},
|
|
6229
|
+
}, Eo = To[Nt.TOP], Do = To[Nt.TOP], Oo = (e) => ({
|
|
6108
6230
|
[Pt.START]: "flex-start",
|
|
6109
6231
|
[Pt.LEFT]: e === dt.RTL ? "flex-end" : "flex-start",
|
|
6110
6232
|
[Pt.CENTER]: "center",
|
|
6111
6233
|
[Pt.RIGHT]: e === dt.RTL ? "flex-start" : "flex-end",
|
|
6112
6234
|
[Pt.END]: "flex-end"
|
|
6113
|
-
}),
|
|
6114
|
-
let { layoutDirection: o } = xt(), s =
|
|
6235
|
+
}), ko = ({ elements: e, verticalAlignment: t, horizontalAlignment: n, backgroundColor: r, cornerRadius: i, paddings: a }) => {
|
|
6236
|
+
let { layoutDirection: o } = xt(), s = Oo(o), c = s[Pt.START];
|
|
6115
6237
|
return /* @__PURE__ */ B("div", {
|
|
6116
6238
|
"data-ui": "gui-row",
|
|
6117
6239
|
part: "gui-row",
|
|
@@ -6119,7 +6241,7 @@ var mo = (e) => {
|
|
|
6119
6241
|
width: "100%",
|
|
6120
6242
|
display: "flex",
|
|
6121
6243
|
flexDirection: "row",
|
|
6122
|
-
alignItems: t &&
|
|
6244
|
+
alignItems: t && To[t] || Do,
|
|
6123
6245
|
justifyContent: n && s[n] || c,
|
|
6124
6246
|
backgroundColor: U(r) || "transparent",
|
|
6125
6247
|
borderRadius: i
|
|
@@ -6130,11 +6252,11 @@ var mo = (e) => {
|
|
|
6130
6252
|
"data-ui": "gui-row-item",
|
|
6131
6253
|
part: "gui-row-item",
|
|
6132
6254
|
style: z(z(z(z(z({ flex: a ? "0 0 auto" : `${e.content.weight || 1} 1 0` }, a && !i && { width: e.content.width }), i && { width: e.content.width || e.content.height || 60 }), r && e.content.height && { height: e.content.height }), (t || n) && { height: e.content.height || 120 }), i && { height: e.content.height || e.content.width || 60 }),
|
|
6133
|
-
children:
|
|
6255
|
+
children: Mo(e)
|
|
6134
6256
|
});
|
|
6135
6257
|
})
|
|
6136
6258
|
});
|
|
6137
|
-
},
|
|
6259
|
+
}, Ao = ({ backgroundColor: e, cornerRadius: t }) => /* @__PURE__ */ B("div", {
|
|
6138
6260
|
"data-ui": "gui-spacer",
|
|
6139
6261
|
part: "gui-spacer",
|
|
6140
6262
|
style: {
|
|
@@ -6143,7 +6265,7 @@ var mo = (e) => {
|
|
|
6143
6265
|
backgroundColor: U(e) || "transparent",
|
|
6144
6266
|
borderRadius: t
|
|
6145
6267
|
}
|
|
6146
|
-
}),
|
|
6268
|
+
}), jo = {
|
|
6147
6269
|
[Mt.LABEL]: (e) => /* @__PURE__ */ B(G, {
|
|
6148
6270
|
text: e.content.text,
|
|
6149
6271
|
fontName: e.content.fontName,
|
|
@@ -6169,7 +6291,7 @@ var mo = (e) => {
|
|
|
6169
6291
|
timeout: e.content.timeout,
|
|
6170
6292
|
placeholderImage: e.content.placeholderImage
|
|
6171
6293
|
}),
|
|
6172
|
-
[Mt.IMAGE_BUTTON]: (e) => /* @__PURE__ */ B(
|
|
6294
|
+
[Mt.IMAGE_BUTTON]: (e) => /* @__PURE__ */ B(wo, {
|
|
6173
6295
|
type: e.content.type,
|
|
6174
6296
|
actionId: e.content.actionId,
|
|
6175
6297
|
image: {
|
|
@@ -6191,7 +6313,7 @@ var mo = (e) => {
|
|
|
6191
6313
|
hoverColor: e.content.hoverColor,
|
|
6192
6314
|
paddings: e.content.paddings
|
|
6193
6315
|
}),
|
|
6194
|
-
[Mt.BUTTON]: (e) => /* @__PURE__ */ B(
|
|
6316
|
+
[Mt.BUTTON]: (e) => /* @__PURE__ */ B(xo, {
|
|
6195
6317
|
actionId: e.content.actionId,
|
|
6196
6318
|
title: e.content.title,
|
|
6197
6319
|
image: e.content.image,
|
|
@@ -6205,14 +6327,14 @@ var mo = (e) => {
|
|
|
6205
6327
|
hoverColor: e.content.hoverColor,
|
|
6206
6328
|
paddings: e.content.paddings
|
|
6207
6329
|
}),
|
|
6208
|
-
[Mt.COLUMN]: (e) => /* @__PURE__ */ B(
|
|
6330
|
+
[Mt.COLUMN]: (e) => /* @__PURE__ */ B(No, {
|
|
6209
6331
|
elements: e.content.elements,
|
|
6210
6332
|
horizontalAlignment: e.content.horizontalAlignment,
|
|
6211
6333
|
cornerRadius: e.content.cornerRadius,
|
|
6212
6334
|
backgroundColor: e.content.backgroundColor,
|
|
6213
6335
|
paddings: e.content.paddings
|
|
6214
6336
|
}),
|
|
6215
|
-
[Mt.ROW]: (e) => /* @__PURE__ */ B(
|
|
6337
|
+
[Mt.ROW]: (e) => /* @__PURE__ */ B(ko, {
|
|
6216
6338
|
elements: e.content.elements,
|
|
6217
6339
|
horizontalAlignment: e.content.horizontalAlignment,
|
|
6218
6340
|
verticalAlignment: e.content.verticalAlignment,
|
|
@@ -6220,7 +6342,7 @@ var mo = (e) => {
|
|
|
6220
6342
|
backgroundColor: e.content.backgroundColor,
|
|
6221
6343
|
paddings: e.content.paddings
|
|
6222
6344
|
}),
|
|
6223
|
-
[Mt.SPACER]: (e) => /* @__PURE__ */ B(
|
|
6345
|
+
[Mt.SPACER]: (e) => /* @__PURE__ */ B(Ao, {
|
|
6224
6346
|
backgroundColor: e.content.backgroundColor,
|
|
6225
6347
|
cornerRadius: e.content.cornerRadius
|
|
6226
6348
|
}),
|
|
@@ -6229,14 +6351,14 @@ var mo = (e) => {
|
|
|
6229
6351
|
indicatorColor: e.content.indicatorColor
|
|
6230
6352
|
})
|
|
6231
6353
|
};
|
|
6232
|
-
function
|
|
6233
|
-
let t =
|
|
6354
|
+
function Mo(e) {
|
|
6355
|
+
let t = jo[e.type];
|
|
6234
6356
|
return t ? t(e) : null;
|
|
6235
6357
|
}
|
|
6236
6358
|
//#endregion
|
|
6237
6359
|
//#region src/screens/generic/components/column/index.tsx
|
|
6238
|
-
var
|
|
6239
|
-
let { layoutDirection: a } = xt(), o =
|
|
6360
|
+
var No = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadius: r, paddings: i }) => {
|
|
6361
|
+
let { layoutDirection: a } = xt(), o = Oo(a), s = o[Pt.START];
|
|
6240
6362
|
return /* @__PURE__ */ B("div", {
|
|
6241
6363
|
"data-ui": "gui-column",
|
|
6242
6364
|
part: "gui-column",
|
|
@@ -6253,11 +6375,11 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6253
6375
|
"data-ui": "gui-column-item",
|
|
6254
6376
|
part: "gui-column-item",
|
|
6255
6377
|
style: z(z(z(z(z(z({}, !a && { alignSelf: "stretch" }), a && !i && { width: e.content.width }), i && { width: e.content.width || e.content.height || 60 }), r && e.content.height && { height: e.content.height }), (t || n) && { height: e.content.height || 120 }), i && { height: e.content.height || e.content.width || 60 }),
|
|
6256
|
-
children:
|
|
6378
|
+
children: Mo(e)
|
|
6257
6379
|
});
|
|
6258
6380
|
})
|
|
6259
6381
|
});
|
|
6260
|
-
},
|
|
6382
|
+
}, Po = ({ topColumn: e, mainColumn: t, bottomColumn: n, backgroundColor: r = "#ffffff00", backgroundImage: i, cornerRadius: a, isInModal: o = !1 }) => {
|
|
6261
6383
|
let { failedAssets: s } = bt();
|
|
6262
6384
|
return /* @__PURE__ */ B("div", {
|
|
6263
6385
|
"data-ui": "gui-scaffold-container",
|
|
@@ -6276,7 +6398,7 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6276
6398
|
"data-ui": "gui-top-column",
|
|
6277
6399
|
part: "gui-top-column",
|
|
6278
6400
|
style: { flex: "0 0 auto" },
|
|
6279
|
-
children: /* @__PURE__ */ B(
|
|
6401
|
+
children: /* @__PURE__ */ B(No, z({}, e))
|
|
6280
6402
|
}),
|
|
6281
6403
|
t && /* @__PURE__ */ B("div", {
|
|
6282
6404
|
"data-ui": "gui-main-column-container",
|
|
@@ -6295,24 +6417,24 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6295
6417
|
display: "flex",
|
|
6296
6418
|
flexDirection: "column",
|
|
6297
6419
|
minHeight: "100%",
|
|
6298
|
-
justifyContent: t.verticalAlignment &&
|
|
6420
|
+
justifyContent: t.verticalAlignment && To[t.verticalAlignment] || Eo
|
|
6299
6421
|
},
|
|
6300
|
-
children: /* @__PURE__ */ B(
|
|
6422
|
+
children: /* @__PURE__ */ B(No, z(z({}, t), {}, { backgroundColor: "transparent" }))
|
|
6301
6423
|
})
|
|
6302
6424
|
}),
|
|
6303
6425
|
n && /* @__PURE__ */ B("div", {
|
|
6304
6426
|
"data-ui": "gui-bottom-column",
|
|
6305
6427
|
part: "gui-bottom-column",
|
|
6306
6428
|
style: { flex: "0 0 auto" },
|
|
6307
|
-
children: /* @__PURE__ */ B(
|
|
6429
|
+
children: /* @__PURE__ */ B(No, z({}, n))
|
|
6308
6430
|
})
|
|
6309
6431
|
]
|
|
6310
6432
|
});
|
|
6311
|
-
},
|
|
6433
|
+
}, Fo = ({ rootElement: e }) => {
|
|
6312
6434
|
let { type: t, content: n } = e;
|
|
6313
6435
|
if (t === jt.SCAFFOLD) {
|
|
6314
6436
|
let { topColumn: e, mainColumn: t, bottomColumn: r, backgroundColor: i, backgroundImage: a, cornerRadius: o } = n;
|
|
6315
|
-
return /* @__PURE__ */ B(
|
|
6437
|
+
return /* @__PURE__ */ B(Po, {
|
|
6316
6438
|
topColumn: e,
|
|
6317
6439
|
mainColumn: t,
|
|
6318
6440
|
bottomColumn: r,
|
|
@@ -6322,7 +6444,7 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6322
6444
|
});
|
|
6323
6445
|
}
|
|
6324
6446
|
return null;
|
|
6325
|
-
},
|
|
6447
|
+
}, Io = ({ width: e = 400, shouldCloseOnClickOutside: t = !1, close: n, children: r }) => /* @__PURE__ */ B("div", {
|
|
6326
6448
|
style: {
|
|
6327
6449
|
position: "absolute",
|
|
6328
6450
|
width: "100%",
|
|
@@ -6355,8 +6477,8 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6355
6477
|
},
|
|
6356
6478
|
children: r
|
|
6357
6479
|
})
|
|
6358
|
-
}),
|
|
6359
|
-
let r = e == null ? void 0 : e.find((e) => e.reason === $t.SYSTEM_RESTRICTED), { isPopupOpen: i, handleAllowButtonClick: a, closePopup: o } =
|
|
6480
|
+
}), Lo = ({ popups: e, rootElement: t, settings: n }) => {
|
|
6481
|
+
let r = e == null ? void 0 : e.find((e) => e.reason === $t.SYSTEM_RESTRICTED), { isPopupOpen: i, handleAllowButtonClick: a, closePopup: o } = io({
|
|
6360
6482
|
askEveryTime: n == null ? void 0 : n.askEveryTime,
|
|
6361
6483
|
getLocationTimeout: n == null ? void 0 : n.getLocationTimeout,
|
|
6362
6484
|
locationAccuracy: n == null ? void 0 : n.locationAccuracy
|
|
@@ -6371,20 +6493,20 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6371
6493
|
position: "relative",
|
|
6372
6494
|
height: "100%"
|
|
6373
6495
|
},
|
|
6374
|
-
children: /* @__PURE__ */ B(
|
|
6496
|
+
children: /* @__PURE__ */ B(yo, {
|
|
6375
6497
|
handlers: s,
|
|
6376
|
-
children: [/* @__PURE__ */ B(
|
|
6498
|
+
children: [/* @__PURE__ */ B(Po, {
|
|
6377
6499
|
topColumn: u,
|
|
6378
6500
|
mainColumn: d,
|
|
6379
6501
|
bottomColumn: f,
|
|
6380
6502
|
backgroundColor: p,
|
|
6381
6503
|
cornerRadius: m,
|
|
6382
6504
|
backgroundImage: h
|
|
6383
|
-
}), r && i && /* @__PURE__ */ B(
|
|
6505
|
+
}), r && i && /* @__PURE__ */ B(Io, {
|
|
6384
6506
|
width: 400,
|
|
6385
6507
|
close: o,
|
|
6386
6508
|
shouldCloseOnClickOutside: !0,
|
|
6387
|
-
children: /* @__PURE__ */ B(
|
|
6509
|
+
children: /* @__PURE__ */ B(Po, {
|
|
6388
6510
|
isInModal: !0,
|
|
6389
6511
|
topColumn: r.rootElement.content.topColumn,
|
|
6390
6512
|
mainColumn: r.rootElement.content.mainColumn,
|
|
@@ -6396,11 +6518,11 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6396
6518
|
})]
|
|
6397
6519
|
})
|
|
6398
6520
|
});
|
|
6399
|
-
},
|
|
6521
|
+
}, Ro = ({ rootElement: e }) => {
|
|
6400
6522
|
let { type: t, content: n } = e;
|
|
6401
6523
|
if (t === jt.SCAFFOLD) {
|
|
6402
6524
|
let { topColumn: e, mainColumn: t, bottomColumn: r, backgroundColor: i, cornerRadius: a, backgroundImage: o } = n;
|
|
6403
|
-
return /* @__PURE__ */ B(
|
|
6525
|
+
return /* @__PURE__ */ B(Po, {
|
|
6404
6526
|
topColumn: e,
|
|
6405
6527
|
mainColumn: t,
|
|
6406
6528
|
bottomColumn: r,
|
|
@@ -6414,21 +6536,21 @@ var wo = ({ elements: e, horizontalAlignment: t, backgroundColor: n, cornerRadiu
|
|
|
6414
6536
|
//#endregion
|
|
6415
6537
|
//#region ../../node_modules/qrcode.react/lib/esm/index.js
|
|
6416
6538
|
Fr();
|
|
6417
|
-
var
|
|
6539
|
+
var zo = Object.defineProperty, Bo = Object.getOwnPropertySymbols, Vo = Object.prototype.hasOwnProperty, Ho = Object.prototype.propertyIsEnumerable, Uo = (e, t, n) => t in e ? zo(e, t, {
|
|
6418
6540
|
enumerable: !0,
|
|
6419
6541
|
configurable: !0,
|
|
6420
6542
|
writable: !0,
|
|
6421
6543
|
value: n
|
|
6422
|
-
}) : e[t] = n,
|
|
6423
|
-
for (var n in t || (t = {}))
|
|
6424
|
-
if (
|
|
6544
|
+
}) : e[t] = n, Wo = (e, t) => {
|
|
6545
|
+
for (var n in t || (t = {})) Vo.call(t, n) && Uo(e, n, t[n]);
|
|
6546
|
+
if (Bo) for (var n of Bo(t)) Ho.call(t, n) && Uo(e, n, t[n]);
|
|
6425
6547
|
return e;
|
|
6426
|
-
},
|
|
6548
|
+
}, Go = (e, t) => {
|
|
6427
6549
|
var n = {};
|
|
6428
|
-
for (var r in e)
|
|
6429
|
-
if (e != null &&
|
|
6550
|
+
for (var r in e) Vo.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
6551
|
+
if (e != null && Bo) for (var r of Bo(e)) t.indexOf(r) < 0 && Ho.call(e, r) && (n[r] = e[r]);
|
|
6430
6552
|
return n;
|
|
6431
|
-
},
|
|
6553
|
+
}, Ko;
|
|
6432
6554
|
((e) => {
|
|
6433
6555
|
let t = class t {
|
|
6434
6556
|
constructor(e, n, r, a) {
|
|
@@ -7118,7 +7240,7 @@ var Ao = Object.defineProperty, jo = Object.getOwnPropertySymbols, Mo = Object.p
|
|
|
7118
7240
|
a.NUMERIC_REGEX = /^[0-9]*$/, a.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, a.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
7119
7241
|
let o = a;
|
|
7120
7242
|
e.QrSegment = a;
|
|
7121
|
-
})(
|
|
7243
|
+
})(Ko || (Ko = {})), ((e) => {
|
|
7122
7244
|
((e) => {
|
|
7123
7245
|
let t = class {
|
|
7124
7246
|
constructor(e, t) {
|
|
@@ -7127,7 +7249,7 @@ var Ao = Object.defineProperty, jo = Object.getOwnPropertySymbols, Mo = Object.p
|
|
|
7127
7249
|
};
|
|
7128
7250
|
t.LOW = new t(0, 1), t.MEDIUM = new t(1, 0), t.QUARTILE = new t(2, 3), t.HIGH = new t(3, 2), e.Ecc = t;
|
|
7129
7251
|
})(e.QrCode || (e.QrCode = {}));
|
|
7130
|
-
})(
|
|
7252
|
+
})(Ko || (Ko = {})), ((e) => {
|
|
7131
7253
|
((e) => {
|
|
7132
7254
|
let t = class {
|
|
7133
7255
|
constructor(e, t) {
|
|
@@ -7159,14 +7281,14 @@ var Ao = Object.defineProperty, jo = Object.getOwnPropertySymbols, Mo = Object.p
|
|
|
7159
7281
|
0
|
|
7160
7282
|
]), e.Mode = t;
|
|
7161
7283
|
})(e.QrSegment || (e.QrSegment = {}));
|
|
7162
|
-
})(
|
|
7163
|
-
var
|
|
7164
|
-
L:
|
|
7165
|
-
M:
|
|
7166
|
-
Q:
|
|
7167
|
-
H:
|
|
7168
|
-
},
|
|
7169
|
-
function
|
|
7284
|
+
})(Ko || (Ko = {}));
|
|
7285
|
+
var qo = Ko, Jo = {
|
|
7286
|
+
L: qo.QrCode.Ecc.LOW,
|
|
7287
|
+
M: qo.QrCode.Ecc.MEDIUM,
|
|
7288
|
+
Q: qo.QrCode.Ecc.QUARTILE,
|
|
7289
|
+
H: qo.QrCode.Ecc.HIGH
|
|
7290
|
+
}, Yo = 128, Xo = "L", Zo = "#FFFFFF", Qo = "#000000", $o = !1, es = 1, ts = 4, ns = 0, rs = .1;
|
|
7291
|
+
function is(e, t = 0) {
|
|
7170
7292
|
let n = [];
|
|
7171
7293
|
return e.forEach(function(e, r) {
|
|
7172
7294
|
let i = null;
|
|
@@ -7184,12 +7306,12 @@ function Yo(e, t = 0) {
|
|
|
7184
7306
|
});
|
|
7185
7307
|
}), n.join("");
|
|
7186
7308
|
}
|
|
7187
|
-
function
|
|
7309
|
+
function as(e, t) {
|
|
7188
7310
|
return e.slice().map((e, n) => n < t.y || n >= t.y + t.h ? e : e.map((e, n) => n < t.x || n >= t.x + t.w ? e : !1));
|
|
7189
7311
|
}
|
|
7190
|
-
function
|
|
7312
|
+
function os(e, t, n, r) {
|
|
7191
7313
|
if (r == null) return null;
|
|
7192
|
-
let i = e.length + n * 2, a = Math.floor(t *
|
|
7314
|
+
let i = e.length + n * 2, a = Math.floor(t * rs), o = i / t, s = (r.width || a) * o, c = (r.height || a) * o, l = r.x == null ? e.length / 2 - s / 2 : r.x * o, u = r.y == null ? e.length / 2 - c / 2 : r.y * o, d = r.opacity == null ? 1 : r.opacity, f = null;
|
|
7193
7315
|
if (r.excavate) {
|
|
7194
7316
|
let e = Math.floor(l), t = Math.floor(u);
|
|
7195
7317
|
f = {
|
|
@@ -7210,25 +7332,25 @@ function Zo(e, t, n, r) {
|
|
|
7210
7332
|
crossOrigin: p
|
|
7211
7333
|
};
|
|
7212
7334
|
}
|
|
7213
|
-
function
|
|
7214
|
-
return t == null ? e ?
|
|
7335
|
+
function ss(e, t) {
|
|
7336
|
+
return t == null ? e ? ts : ns : Math.max(Math.floor(t), 0);
|
|
7215
7337
|
}
|
|
7216
|
-
function
|
|
7338
|
+
function cs({ value: e, level: t, minVersion: n, includeMargin: r, marginSize: i, imageSettings: a, size: o, boostLevel: s }) {
|
|
7217
7339
|
let c = K.useMemo(() => {
|
|
7218
|
-
let r = (Array.isArray(e) ? e : [e]).reduce((e, t) => (e.push(...
|
|
7219
|
-
return
|
|
7340
|
+
let r = (Array.isArray(e) ? e : [e]).reduce((e, t) => (e.push(...qo.QrSegment.makeSegments(t)), e), []);
|
|
7341
|
+
return qo.QrCode.encodeSegments(r, Jo[t], n, void 0, void 0, s);
|
|
7220
7342
|
}, [
|
|
7221
7343
|
e,
|
|
7222
7344
|
t,
|
|
7223
7345
|
n,
|
|
7224
7346
|
s
|
|
7225
7347
|
]), { cells: l, margin: u, numCells: d, calculatedImageSettings: f } = K.useMemo(() => {
|
|
7226
|
-
let e = c.getModules(), t =
|
|
7348
|
+
let e = c.getModules(), t = ss(r, i);
|
|
7227
7349
|
return {
|
|
7228
7350
|
cells: e,
|
|
7229
7351
|
margin: t,
|
|
7230
7352
|
numCells: e.length + t * 2,
|
|
7231
|
-
calculatedImageSettings:
|
|
7353
|
+
calculatedImageSettings: os(e, o, t, a)
|
|
7232
7354
|
};
|
|
7233
7355
|
}, [
|
|
7234
7356
|
c,
|
|
@@ -7245,15 +7367,15 @@ function $o({ value: e, level: t, minVersion: n, includeMargin: r, marginSize: i
|
|
|
7245
7367
|
calculatedImageSettings: f
|
|
7246
7368
|
};
|
|
7247
7369
|
}
|
|
7248
|
-
var
|
|
7370
|
+
var ls = function() {
|
|
7249
7371
|
try {
|
|
7250
7372
|
new Path2D().addPath(new Path2D());
|
|
7251
7373
|
} catch (e) {
|
|
7252
7374
|
return !1;
|
|
7253
7375
|
}
|
|
7254
7376
|
return !0;
|
|
7255
|
-
}(),
|
|
7256
|
-
let n = e, { value: r, size: i =
|
|
7377
|
+
}(), us = K.forwardRef(function(e, t) {
|
|
7378
|
+
let n = e, { value: r, size: i = Yo, level: a = Xo, bgColor: o = Zo, fgColor: s = Qo, includeMargin: c = $o, minVersion: l = es, boostLevel: u, marginSize: d, imageSettings: f } = n, p = Go(n, [
|
|
7257
7379
|
"value",
|
|
7258
7380
|
"size",
|
|
7259
7381
|
"level",
|
|
@@ -7264,9 +7386,9 @@ var es = function() {
|
|
|
7264
7386
|
"boostLevel",
|
|
7265
7387
|
"marginSize",
|
|
7266
7388
|
"imageSettings"
|
|
7267
|
-
]), { style: m } = p, h =
|
|
7389
|
+
]), { style: m } = p, h = Go(p, ["style"]), g = f == null ? void 0 : f.src, _ = K.useRef(null), v = K.useRef(null), y = K.useCallback((e) => {
|
|
7268
7390
|
_.current = e, typeof t == "function" ? t(e) : t && (t.current = e);
|
|
7269
|
-
}, [t]), [b, x] = K.useState(!1), { margin: S, cells: C, numCells: w, calculatedImageSettings: T } =
|
|
7391
|
+
}, [t]), [b, x] = K.useState(!1), { margin: S, cells: C, numCells: w, calculatedImageSettings: T } = cs({
|
|
7270
7392
|
value: r,
|
|
7271
7393
|
level: a,
|
|
7272
7394
|
minVersion: l,
|
|
@@ -7281,11 +7403,11 @@ var es = function() {
|
|
|
7281
7403
|
let e = _.current, t = e.getContext("2d");
|
|
7282
7404
|
if (!t) return;
|
|
7283
7405
|
let n = C, r = v.current, a = T != null && r !== null && r.complete && r.naturalHeight !== 0 && r.naturalWidth !== 0;
|
|
7284
|
-
a && T.excavation != null && (n =
|
|
7406
|
+
a && T.excavation != null && (n = as(C, T.excavation));
|
|
7285
7407
|
let c = window.devicePixelRatio || 1;
|
|
7286
7408
|
e.height = e.width = i * c;
|
|
7287
7409
|
let l = i / w * c;
|
|
7288
|
-
t.scale(l, l), t.fillStyle = o, t.fillRect(0, 0, w, w), t.fillStyle = s,
|
|
7410
|
+
t.scale(l, l), t.fillStyle = o, t.fillRect(0, 0, w, w), t.fillStyle = s, ls ? t.fill(new Path2D(is(n, S))) : C.forEach(function(e, n) {
|
|
7289
7411
|
e.forEach(function(e, r) {
|
|
7290
7412
|
e && t.fillRect(r + S, n + S, 1, 1);
|
|
7291
7413
|
});
|
|
@@ -7294,7 +7416,7 @@ var es = function() {
|
|
|
7294
7416
|
}), K.useEffect(() => {
|
|
7295
7417
|
x(!1);
|
|
7296
7418
|
}, [g]);
|
|
7297
|
-
let E =
|
|
7419
|
+
let E = Wo({
|
|
7298
7420
|
height: i,
|
|
7299
7421
|
width: i
|
|
7300
7422
|
}, m), D = null;
|
|
@@ -7307,7 +7429,7 @@ var es = function() {
|
|
|
7307
7429
|
},
|
|
7308
7430
|
ref: v,
|
|
7309
7431
|
crossOrigin: T == null ? void 0 : T.crossOrigin
|
|
7310
|
-
})), /* @__PURE__ */ K.createElement(K.Fragment, null, /* @__PURE__ */ K.createElement("canvas",
|
|
7432
|
+
})), /* @__PURE__ */ K.createElement(K.Fragment, null, /* @__PURE__ */ K.createElement("canvas", Wo({
|
|
7311
7433
|
style: E,
|
|
7312
7434
|
height: i,
|
|
7313
7435
|
width: i,
|
|
@@ -7315,9 +7437,9 @@ var es = function() {
|
|
|
7315
7437
|
role: "img"
|
|
7316
7438
|
}, h)), D);
|
|
7317
7439
|
});
|
|
7318
|
-
|
|
7319
|
-
var
|
|
7320
|
-
let n = e, { value: r, size: i =
|
|
7440
|
+
us.displayName = "QRCodeCanvas";
|
|
7441
|
+
var ds = K.forwardRef(function(e, t) {
|
|
7442
|
+
let n = e, { value: r, size: i = Yo, level: a = Xo, bgColor: o = Zo, fgColor: s = Qo, includeMargin: c = $o, minVersion: l = es, boostLevel: u, title: d, marginSize: f, imageSettings: p } = n, m = Go(n, [
|
|
7321
7443
|
"value",
|
|
7322
7444
|
"size",
|
|
7323
7445
|
"level",
|
|
@@ -7329,7 +7451,7 @@ var ns = K.forwardRef(function(e, t) {
|
|
|
7329
7451
|
"title",
|
|
7330
7452
|
"marginSize",
|
|
7331
7453
|
"imageSettings"
|
|
7332
|
-
]), { margin: h, cells: g, numCells: _, calculatedImageSettings: v } =
|
|
7454
|
+
]), { margin: h, cells: g, numCells: _, calculatedImageSettings: v } = cs({
|
|
7333
7455
|
value: r,
|
|
7334
7456
|
level: a,
|
|
7335
7457
|
minVersion: l,
|
|
@@ -7339,7 +7461,7 @@ var ns = K.forwardRef(function(e, t) {
|
|
|
7339
7461
|
imageSettings: p,
|
|
7340
7462
|
size: i
|
|
7341
7463
|
}), y = g, b = null;
|
|
7342
|
-
p != null && v != null && (v.excavation != null && (y =
|
|
7464
|
+
p != null && v != null && (v.excavation != null && (y = as(g, v.excavation)), b = /* @__PURE__ */ K.createElement("image", {
|
|
7343
7465
|
href: p.src,
|
|
7344
7466
|
height: v.h,
|
|
7345
7467
|
width: v.w,
|
|
@@ -7349,8 +7471,8 @@ var ns = K.forwardRef(function(e, t) {
|
|
|
7349
7471
|
opacity: v.opacity,
|
|
7350
7472
|
crossOrigin: v.crossOrigin
|
|
7351
7473
|
}));
|
|
7352
|
-
let x =
|
|
7353
|
-
return /* @__PURE__ */ K.createElement("svg",
|
|
7474
|
+
let x = is(y, h);
|
|
7475
|
+
return /* @__PURE__ */ K.createElement("svg", Wo({
|
|
7354
7476
|
height: i,
|
|
7355
7477
|
width: i,
|
|
7356
7478
|
viewBox: `0 0 ${_} ${_}`,
|
|
@@ -7366,10 +7488,10 @@ var ns = K.forwardRef(function(e, t) {
|
|
|
7366
7488
|
shapeRendering: "crispEdges"
|
|
7367
7489
|
}), b);
|
|
7368
7490
|
});
|
|
7369
|
-
|
|
7491
|
+
ds.displayName = "QRCodeSVG";
|
|
7370
7492
|
//#endregion
|
|
7371
7493
|
//#region src/screens/device-transfer/styles.ts
|
|
7372
|
-
var
|
|
7494
|
+
var fs = {
|
|
7373
7495
|
width: "100%",
|
|
7374
7496
|
height: "auto",
|
|
7375
7497
|
display: "flex",
|
|
@@ -7377,7 +7499,7 @@ var rs = {
|
|
|
7377
7499
|
justifyContent: "center",
|
|
7378
7500
|
alignItems: "center",
|
|
7379
7501
|
marginBottom: "40px"
|
|
7380
|
-
},
|
|
7502
|
+
}, ps = {
|
|
7381
7503
|
position: "relative",
|
|
7382
7504
|
display: "flex",
|
|
7383
7505
|
flexDirection: "column",
|
|
@@ -7388,15 +7510,15 @@ var rs = {
|
|
|
7388
7510
|
width: "100%",
|
|
7389
7511
|
minHeight: "100%",
|
|
7390
7512
|
overflow: "auto"
|
|
7391
|
-
},
|
|
7513
|
+
}, ms = {
|
|
7392
7514
|
marginBottom: 20,
|
|
7393
7515
|
lineHeight: "140%"
|
|
7394
|
-
},
|
|
7516
|
+
}, hs = {
|
|
7395
7517
|
fontWeight: "400",
|
|
7396
7518
|
lineHeight: "140%"
|
|
7397
|
-
},
|
|
7519
|
+
}, gs = ({ header: e, footer: t, buttons: n, title: r, description: i, qr: a, url: o, backgroundColor: s, backgroundImage: c }) => {
|
|
7398
7520
|
let { perform: l } = vt();
|
|
7399
|
-
return !o && typeof o != "string" ? (l(new
|
|
7521
|
+
return !o && typeof o != "string" ? (l(new Ha({
|
|
7400
7522
|
errorCode: Xt.DECODING_FAILED,
|
|
7401
7523
|
message: "No QR URL in the client config"
|
|
7402
7524
|
})), null) : /* @__PURE__ */ B(Cn, {
|
|
@@ -7409,88 +7531,88 @@ var rs = {
|
|
|
7409
7531
|
part: "gui-device-transfer-screen-container",
|
|
7410
7532
|
"data-ui": "gui-device-transfer-screen-container",
|
|
7411
7533
|
id: "device-transfer-screen-container",
|
|
7412
|
-
style: z(z({},
|
|
7534
|
+
style: z(z({}, ps), {}, { justifyContent: "flex-start" }),
|
|
7413
7535
|
children: [
|
|
7414
7536
|
/* @__PURE__ */ B("div", {
|
|
7415
7537
|
part: "gui-device-transfer-qr-container",
|
|
7416
|
-
style:
|
|
7417
|
-
children: /* @__PURE__ */ B(
|
|
7538
|
+
style: fs,
|
|
7539
|
+
children: /* @__PURE__ */ B(ds, {
|
|
7418
7540
|
value: o,
|
|
7419
7541
|
size: 300,
|
|
7420
7542
|
fgColor: a == null ? void 0 : a.color
|
|
7421
7543
|
})
|
|
7422
7544
|
}),
|
|
7423
7545
|
r && /* @__PURE__ */ B("div", {
|
|
7424
|
-
style:
|
|
7546
|
+
style: ms,
|
|
7425
7547
|
children: /* @__PURE__ */ B(G, z({}, r))
|
|
7426
7548
|
}),
|
|
7427
7549
|
i && /* @__PURE__ */ B("div", {
|
|
7428
|
-
style:
|
|
7550
|
+
style: hs,
|
|
7429
7551
|
children: /* @__PURE__ */ B(wn, z({}, i))
|
|
7430
7552
|
})
|
|
7431
7553
|
]
|
|
7432
7554
|
})
|
|
7433
7555
|
});
|
|
7434
|
-
},
|
|
7556
|
+
}, _s = /* @__PURE__ */ function(e) {
|
|
7435
7557
|
return e.IDLE = "idle", e.UPLOADING = "uploading", e.DONE = "done", e;
|
|
7436
7558
|
}({}), $ = /* @__PURE__ */ function(e) {
|
|
7437
7559
|
return e.IDLE = "idle", e.UPLOADING = "uploading", e.SUCCESS = "success", e.ERROR = "error", e;
|
|
7438
|
-
}({}),
|
|
7560
|
+
}({}), vs = /* @__PURE__ */ function(e) {
|
|
7439
7561
|
return e.OK = "ok", e.SIZE = "size", e.FORMAT = "format", e;
|
|
7440
7562
|
}({});
|
|
7441
7563
|
//#endregion
|
|
7442
7564
|
//#region src/screens/upload-files/utils.ts
|
|
7443
|
-
function
|
|
7565
|
+
function ys(e) {
|
|
7444
7566
|
if (e < 1024) return `${e} B`;
|
|
7445
7567
|
let t = e / 1024;
|
|
7446
7568
|
if (t < 1024) return `${t < 10 ? t.toFixed(1) : Math.round(t)} kB`;
|
|
7447
7569
|
let n = t / 1024;
|
|
7448
7570
|
return `${n < 10 ? n.toFixed(1) : Math.round(n)} MB`;
|
|
7449
7571
|
}
|
|
7450
|
-
function
|
|
7572
|
+
function bs(e) {
|
|
7451
7573
|
let t = e.lastIndexOf(".");
|
|
7452
7574
|
return t < 0 ? "" : e.slice(t).toLowerCase();
|
|
7453
7575
|
}
|
|
7454
|
-
function
|
|
7455
|
-
let n =
|
|
7576
|
+
function xs(e, t) {
|
|
7577
|
+
let n = bs(e);
|
|
7456
7578
|
return n ? new Set(t.map((e) => e.startsWith(".") ? e.toLowerCase() : `.${e.toLowerCase()}`)).has(n) : !1;
|
|
7457
7579
|
}
|
|
7458
|
-
function
|
|
7459
|
-
return e.size > t ?
|
|
7580
|
+
function Ss(e, t, n) {
|
|
7581
|
+
return e.size > t ? vs.SIZE : xs(e.name, n) ? vs.OK : vs.FORMAT;
|
|
7460
7582
|
}
|
|
7461
|
-
function
|
|
7583
|
+
function Cs(e) {
|
|
7462
7584
|
return `${e.name}\0${e.size}\0${e.lastModified}`;
|
|
7463
7585
|
}
|
|
7464
|
-
var
|
|
7586
|
+
var ws = (e) => {
|
|
7465
7587
|
let t = getComputedStyle(e), n = parseFloat(t.lineHeight);
|
|
7466
7588
|
if (!Number.isFinite(n) || n <= 0) {
|
|
7467
7589
|
let e = parseFloat(t.fontSize);
|
|
7468
7590
|
n = Number.isFinite(e) ? e * 1.35 : 20;
|
|
7469
7591
|
}
|
|
7470
7592
|
return e.scrollHeight > n + 2;
|
|
7471
|
-
},
|
|
7593
|
+
}, Ts = {
|
|
7472
7594
|
display: "grid",
|
|
7473
7595
|
gridTemplateColumns: "auto minmax(0, 1fr) auto auto",
|
|
7474
7596
|
columnGap: "8px",
|
|
7475
7597
|
minWidth: 0,
|
|
7476
7598
|
width: "100%"
|
|
7477
|
-
},
|
|
7599
|
+
}, Es = {
|
|
7478
7600
|
width: "20px",
|
|
7479
7601
|
height: "20px",
|
|
7480
7602
|
color: "#555"
|
|
7481
|
-
},
|
|
7603
|
+
}, Ds = {
|
|
7482
7604
|
fontSize: "15px",
|
|
7483
7605
|
wordBreak: "break-all"
|
|
7484
|
-
},
|
|
7606
|
+
}, Os = {
|
|
7485
7607
|
display: "flex",
|
|
7486
7608
|
gap: 3
|
|
7487
|
-
},
|
|
7609
|
+
}, ks = {
|
|
7488
7610
|
display: "flex",
|
|
7489
7611
|
alignItems: "center",
|
|
7490
7612
|
justifyContent: "center",
|
|
7491
7613
|
height: "36px",
|
|
7492
7614
|
width: "36px"
|
|
7493
|
-
},
|
|
7615
|
+
}, As = {
|
|
7494
7616
|
border: "none",
|
|
7495
7617
|
background: "none",
|
|
7496
7618
|
cursor: "pointer",
|
|
@@ -7499,10 +7621,10 @@ var hs = (e) => {
|
|
|
7499
7621
|
//#endregion
|
|
7500
7622
|
//#region src/screens/upload-files/components/upload-file-row/UploadFileRow.tsx
|
|
7501
7623
|
R();
|
|
7502
|
-
var
|
|
7624
|
+
var js = ({ uploadFile: e, uploadPhase: t, onRetryFile: n, onRemoveFile: r }) => {
|
|
7503
7625
|
let [i, a] = N(!1), o = F(null), s = Ne(() => {
|
|
7504
7626
|
let e = o.current;
|
|
7505
|
-
e && a(
|
|
7627
|
+
e && a(ws(e));
|
|
7506
7628
|
}, []);
|
|
7507
7629
|
return Ae(() => {
|
|
7508
7630
|
s();
|
|
@@ -7517,48 +7639,48 @@ var Ss = ({ uploadFile: e, uploadPhase: t, onRetryFile: n, onRemoveFile: r }) =>
|
|
|
7517
7639
|
t,
|
|
7518
7640
|
s
|
|
7519
7641
|
]), /* @__PURE__ */ B("div", {
|
|
7520
|
-
style: z(z({},
|
|
7642
|
+
style: z(z({}, Ts), {}, { alignItems: i ? "start" : "center" }),
|
|
7521
7643
|
children: [
|
|
7522
7644
|
/* @__PURE__ */ B("div", {
|
|
7523
|
-
style:
|
|
7645
|
+
style: Es,
|
|
7524
7646
|
children: /* @__PURE__ */ B(qt, { type: "file" })
|
|
7525
7647
|
}),
|
|
7526
7648
|
/* @__PURE__ */ B("div", {
|
|
7527
7649
|
ref: o,
|
|
7528
7650
|
children: /* @__PURE__ */ B("span", {
|
|
7529
|
-
style:
|
|
7651
|
+
style: Ds,
|
|
7530
7652
|
children: e.file.name
|
|
7531
7653
|
})
|
|
7532
7654
|
}),
|
|
7533
7655
|
/* @__PURE__ */ B("div", { children: /* @__PURE__ */ B("span", {
|
|
7534
|
-
style:
|
|
7656
|
+
style: Ds,
|
|
7535
7657
|
children: [
|
|
7536
7658
|
" (",
|
|
7537
|
-
|
|
7659
|
+
ys(e.file.size),
|
|
7538
7660
|
")"
|
|
7539
7661
|
]
|
|
7540
7662
|
}) }),
|
|
7541
7663
|
/* @__PURE__ */ B("div", {
|
|
7542
|
-
style:
|
|
7664
|
+
style: Os,
|
|
7543
7665
|
children: [/* @__PURE__ */ B("div", {
|
|
7544
|
-
style:
|
|
7545
|
-
children: e.uploadState === $.ERROR && t ===
|
|
7666
|
+
style: ks,
|
|
7667
|
+
children: e.uploadState === $.ERROR && t === _s.DONE && /* @__PURE__ */ B("button", {
|
|
7546
7668
|
type: "button",
|
|
7547
7669
|
"aria-label": "Retry",
|
|
7548
7670
|
onClick: () => n(e.id),
|
|
7549
|
-
style:
|
|
7671
|
+
style: As,
|
|
7550
7672
|
children: /* @__PURE__ */ B(qt, { type: "reload" })
|
|
7551
7673
|
})
|
|
7552
7674
|
}), /* @__PURE__ */ B("div", {
|
|
7553
|
-
style:
|
|
7675
|
+
style: ks,
|
|
7554
7676
|
children: [
|
|
7555
|
-
(t ===
|
|
7677
|
+
(t === _s.UPLOADING || e.uploadState === $.UPLOADING) && e.uploadState !== $.SUCCESS && /* @__PURE__ */ B(qt, { type: "loader" }),
|
|
7556
7678
|
e.uploadState === $.SUCCESS && /* @__PURE__ */ B(qt, { type: "ok" }),
|
|
7557
|
-
t !==
|
|
7679
|
+
t !== _s.UPLOADING && (e.uploadState === $.IDLE || e.uploadState === $.ERROR) && /* @__PURE__ */ B("button", {
|
|
7558
7680
|
type: "button",
|
|
7559
7681
|
"aria-label": "Remove",
|
|
7560
7682
|
onClick: () => r(e.id),
|
|
7561
|
-
style:
|
|
7683
|
+
style: As,
|
|
7562
7684
|
children: /* @__PURE__ */ B(qt, { type: "close_icon" })
|
|
7563
7685
|
})
|
|
7564
7686
|
]
|
|
@@ -7566,7 +7688,7 @@ var Ss = ({ uploadFile: e, uploadPhase: t, onRetryFile: n, onRemoveFile: r }) =>
|
|
|
7566
7688
|
})
|
|
7567
7689
|
]
|
|
7568
7690
|
});
|
|
7569
|
-
},
|
|
7691
|
+
}, Ms = ({ range: e, color: t = "#00A028" }) => /* @__PURE__ */ B("div", {
|
|
7570
7692
|
style: {
|
|
7571
7693
|
position: "absolute",
|
|
7572
7694
|
bottom: "2px",
|
|
@@ -7583,42 +7705,42 @@ var Ss = ({ uploadFile: e, uploadPhase: t, onRetryFile: n, onRemoveFile: r }) =>
|
|
|
7583
7705
|
backgroundColor: t,
|
|
7584
7706
|
transition: "width 0.15s ease-out"
|
|
7585
7707
|
} })
|
|
7586
|
-
}),
|
|
7587
|
-
for (let e = 0; e < 256; ++e)
|
|
7588
|
-
function
|
|
7589
|
-
return (
|
|
7708
|
+
}), Ns = [];
|
|
7709
|
+
for (let e = 0; e < 256; ++e) Ns.push((e + 256).toString(16).slice(1));
|
|
7710
|
+
function Ps(e, t = 0) {
|
|
7711
|
+
return (Ns[e[t + 0]] + Ns[e[t + 1]] + Ns[e[t + 2]] + Ns[e[t + 3]] + "-" + Ns[e[t + 4]] + Ns[e[t + 5]] + "-" + Ns[e[t + 6]] + Ns[e[t + 7]] + "-" + Ns[e[t + 8]] + Ns[e[t + 9]] + "-" + Ns[e[t + 10]] + Ns[e[t + 11]] + Ns[e[t + 12]] + Ns[e[t + 13]] + Ns[e[t + 14]] + Ns[e[t + 15]]).toLowerCase();
|
|
7590
7712
|
}
|
|
7591
7713
|
//#endregion
|
|
7592
7714
|
//#region ../../node_modules/uuid/dist/rng.js
|
|
7593
|
-
var
|
|
7594
|
-
function
|
|
7595
|
-
return crypto.getRandomValues(
|
|
7715
|
+
var Fs = new Uint8Array(16);
|
|
7716
|
+
function Is() {
|
|
7717
|
+
return crypto.getRandomValues(Fs);
|
|
7596
7718
|
}
|
|
7597
7719
|
//#endregion
|
|
7598
7720
|
//#region ../../node_modules/uuid/dist/v4.js
|
|
7599
|
-
function
|
|
7600
|
-
return !t && !e && crypto.randomUUID ? crypto.randomUUID() :
|
|
7721
|
+
function Ls(e, t, n) {
|
|
7722
|
+
return !t && !e && crypto.randomUUID ? crypto.randomUUID() : Rs(e, t, n);
|
|
7601
7723
|
}
|
|
7602
|
-
function
|
|
7724
|
+
function Rs(e, t, n) {
|
|
7603
7725
|
var r, i, a;
|
|
7604
7726
|
e = e || {};
|
|
7605
|
-
let o = (r = (i = e.random) == null ? (a = e.rng) == null ? void 0 : a.call(e) : i) == null ?
|
|
7727
|
+
let o = (r = (i = e.random) == null ? (a = e.rng) == null ? void 0 : a.call(e) : i) == null ? Is() : r;
|
|
7606
7728
|
if (o.length < 16) throw Error("Random bytes length must be >= 16");
|
|
7607
7729
|
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, t) {
|
|
7608
7730
|
if (n = n || 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
|
|
7609
7731
|
for (let e = 0; e < 16; ++e) t[n + e] = o[e];
|
|
7610
7732
|
return t;
|
|
7611
7733
|
}
|
|
7612
|
-
return
|
|
7734
|
+
return Ps(o);
|
|
7613
7735
|
}
|
|
7614
7736
|
//#endregion
|
|
7615
7737
|
//#region src/screens/upload-files/hooks/useUploadFiles.ts
|
|
7616
7738
|
R();
|
|
7617
|
-
var
|
|
7739
|
+
var zs = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r, abortRequest: i }) => {
|
|
7618
7740
|
var a;
|
|
7619
|
-
let { perform: o } = vt(), [s, c] = N([]), [l, u] = N(
|
|
7741
|
+
let { perform: o } = vt(), [s, c] = N([]), [l, u] = N(_s.IDLE), d = F([]), f = F(!1);
|
|
7620
7742
|
d.current = s;
|
|
7621
|
-
let p = s.some((e) => e.clientValidation !==
|
|
7743
|
+
let p = s.some((e) => e.clientValidation !== vs.OK), m = s.filter((e) => e.clientValidation === vs.OK), h = m.length > 0 && m.every((e) => e.uploadState === $.SUCCESS && e.tempFileId), g = l === _s.UPLOADING, _ = l === _s.DONE && h && !p, { devSettings: v } = _t(), y = v == null || (a = v.screens) == null || (a = a[wt.UPLOAD_FILES]) == null ? void 0 : a.files, b = !!y, x = (e) => {
|
|
7622
7744
|
b || g || c((t) => {
|
|
7623
7745
|
let n = t.find((t) => t.id === e);
|
|
7624
7746
|
return !n || n.uploadState === $.UPLOADING || n.uploadState === $.SUCCESS ? t : t.filter((t) => t.id !== e);
|
|
@@ -7677,20 +7799,20 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7677
7799
|
if (t.currentTarget.value = "", !r.length) return;
|
|
7678
7800
|
let i = [];
|
|
7679
7801
|
c((t) => {
|
|
7680
|
-
let n = new Set(t.map((e) =>
|
|
7802
|
+
let n = new Set(t.map((e) => Cs(e.file))), a = Math.max(0, e.selectionLimit - t.length), o = [...t];
|
|
7681
7803
|
for (let t of r) {
|
|
7682
7804
|
if (a <= 0) break;
|
|
7683
|
-
let r =
|
|
7805
|
+
let r = Cs(t);
|
|
7684
7806
|
if (n.has(r)) continue;
|
|
7685
7807
|
n.add(r);
|
|
7686
|
-
let s =
|
|
7687
|
-
id:
|
|
7808
|
+
let s = Ss(t, e.fileMaxSize, e.supportedFileFormats), c = {
|
|
7809
|
+
id: Ls(),
|
|
7688
7810
|
file: t,
|
|
7689
7811
|
clientValidation: s,
|
|
7690
7812
|
uploadState: $.IDLE,
|
|
7691
7813
|
progressBarRange: 0
|
|
7692
7814
|
};
|
|
7693
|
-
o.push(c), s ===
|
|
7815
|
+
o.push(c), s === vs.OK && i.push(c), --a;
|
|
7694
7816
|
}
|
|
7695
7817
|
return o;
|
|
7696
7818
|
}), i.length;
|
|
@@ -7702,14 +7824,14 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7702
7824
|
var e = H(function* (e) {
|
|
7703
7825
|
if (b || g || _ || p) return;
|
|
7704
7826
|
c((e) => e.map((e) => z(z({}, e), {}, { serverError: void 0 })));
|
|
7705
|
-
let t = d.current.filter((e) => e.clientValidation ===
|
|
7827
|
+
let t = d.current.filter((e) => e.clientValidation === vs.OK).map((e) => e.id);
|
|
7706
7828
|
if (!t.length) return;
|
|
7707
|
-
u(
|
|
7829
|
+
u(_s.UPLOADING), f.current = !1;
|
|
7708
7830
|
let n = [], r = !1;
|
|
7709
7831
|
for (let e of t) {
|
|
7710
7832
|
if (f.current) break;
|
|
7711
7833
|
let t = d.current.find((t) => t.id === e);
|
|
7712
|
-
if (!t || t.clientValidation !==
|
|
7834
|
+
if (!t || t.clientValidation !== vs.OK) continue;
|
|
7713
7835
|
if (t.uploadState === $.SUCCESS && t.tempFileId) {
|
|
7714
7836
|
n.push(t.tempFileId);
|
|
7715
7837
|
continue;
|
|
@@ -7721,14 +7843,14 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7721
7843
|
!r && n.length === t.length && o({
|
|
7722
7844
|
files: n,
|
|
7723
7845
|
upload_complete: !0
|
|
7724
|
-
}, e), u(
|
|
7846
|
+
}, e), u(_s.DONE);
|
|
7725
7847
|
});
|
|
7726
7848
|
return function(t) {
|
|
7727
7849
|
return e.apply(this, arguments);
|
|
7728
7850
|
};
|
|
7729
7851
|
}(), T = function() {
|
|
7730
7852
|
var e = H(function* (e) {
|
|
7731
|
-
if (b || l ===
|
|
7853
|
+
if (b || l === _s.UPLOADING || _) return;
|
|
7732
7854
|
f.current = !1;
|
|
7733
7855
|
let t;
|
|
7734
7856
|
c((n) => {
|
|
@@ -7738,13 +7860,13 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7738
7860
|
progressBarRange: 0
|
|
7739
7861
|
}) : t);
|
|
7740
7862
|
return t = r.find((t) => t.id === e), r;
|
|
7741
|
-
}), !(!t || t.clientValidation !==
|
|
7742
|
-
let t = e.filter((e) => e.clientValidation ===
|
|
7863
|
+
}), !(!t || t.clientValidation !== vs.OK) && ((yield S(t)) && !f.current && c((e) => {
|
|
7864
|
+
let t = e.filter((e) => e.clientValidation === vs.OK);
|
|
7743
7865
|
return t.length > 0 && t.every((e) => e.uploadState === $.SUCCESS && e.tempFileId) && o({
|
|
7744
7866
|
files: t.map((e) => e.tempFileId),
|
|
7745
7867
|
upload_complete: !0
|
|
7746
7868
|
}, ut.FORM), e;
|
|
7747
|
-
}), u(
|
|
7869
|
+
}), u(_s.DONE));
|
|
7748
7870
|
});
|
|
7749
7871
|
return function(t) {
|
|
7750
7872
|
return e.apply(this, arguments);
|
|
@@ -7763,7 +7885,7 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7763
7885
|
uploadState: e.uploadState,
|
|
7764
7886
|
progressBarRange: (i = e.progressBarRange) == null ? 0 : i
|
|
7765
7887
|
};
|
|
7766
|
-
})), u(
|
|
7888
|
+
})), u(_s.DONE));
|
|
7767
7889
|
}, [v, y]), {
|
|
7768
7890
|
uploadFileRows: s,
|
|
7769
7891
|
uploadPhase: l,
|
|
@@ -7775,7 +7897,7 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7775
7897
|
submit: w,
|
|
7776
7898
|
retryFile: T
|
|
7777
7899
|
};
|
|
7778
|
-
},
|
|
7900
|
+
}, Bs = {
|
|
7779
7901
|
position: "relative",
|
|
7780
7902
|
display: "flex",
|
|
7781
7903
|
flexDirection: "column",
|
|
@@ -7783,7 +7905,7 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7783
7905
|
width: "100%",
|
|
7784
7906
|
minHeight: 0,
|
|
7785
7907
|
fontFamily: "-apple-system, sans-serif"
|
|
7786
|
-
},
|
|
7908
|
+
}, Vs = {
|
|
7787
7909
|
flex: "1 1 auto",
|
|
7788
7910
|
minHeight: 0,
|
|
7789
7911
|
overflowY: "auto",
|
|
@@ -7791,20 +7913,20 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7791
7913
|
display: "flex",
|
|
7792
7914
|
flexDirection: "column",
|
|
7793
7915
|
alignItems: "stretch"
|
|
7794
|
-
},
|
|
7916
|
+
}, Hs = { marginBottom: "8px" }, Us = {
|
|
7795
7917
|
minHeight: "54px",
|
|
7796
7918
|
position: "relative",
|
|
7797
7919
|
backgroundColor: "#fff",
|
|
7798
7920
|
borderRadius: "12px",
|
|
7799
7921
|
padding: "8px 16px",
|
|
7800
7922
|
marginBottom: "2px"
|
|
7801
|
-
},
|
|
7923
|
+
}, Ws = { boxShadow: "inset 0 0 0 2px #d32f2f" }, Gs = {
|
|
7802
7924
|
fontSize: "13px",
|
|
7803
7925
|
color: "#d32f2f",
|
|
7804
7926
|
marginTop: "4px",
|
|
7805
7927
|
marginBottom: "4px",
|
|
7806
7928
|
marginLeft: "2px"
|
|
7807
|
-
},
|
|
7929
|
+
}, Ks = {
|
|
7808
7930
|
position: "absolute",
|
|
7809
7931
|
width: "100%",
|
|
7810
7932
|
height: "100%",
|
|
@@ -7818,18 +7940,18 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7818
7940
|
zIndex: 1e3,
|
|
7819
7941
|
pointerEvents: "auto",
|
|
7820
7942
|
cursor: "default"
|
|
7821
|
-
},
|
|
7943
|
+
}, qs = {
|
|
7822
7944
|
position: "relative",
|
|
7823
7945
|
padding: "32px 24px 0",
|
|
7824
7946
|
border: "1px solid rgba(0, 0, 0, 0.06)",
|
|
7825
7947
|
width: "min(400px, calc(100vw - 32px))"
|
|
7826
|
-
},
|
|
7948
|
+
}, Js = {
|
|
7827
7949
|
marginBottom: "10px",
|
|
7828
7950
|
fontWeight: 600
|
|
7829
|
-
},
|
|
7951
|
+
}, Ys = { marginBottom: "84px" }, Xs = {
|
|
7830
7952
|
maxHeight: "calc(100dvh - 190px)",
|
|
7831
7953
|
overflow: "auto"
|
|
7832
|
-
},
|
|
7954
|
+
}, Zs = {
|
|
7833
7955
|
position: "absolute",
|
|
7834
7956
|
bottom: 0,
|
|
7835
7957
|
insetInline: 0,
|
|
@@ -7839,9 +7961,9 @@ var As = ({ settings: e, errorMessages: t, serviceToken: n, uploadFileToTemp: r,
|
|
|
7839
7961
|
//#endregion
|
|
7840
7962
|
//#region src/screens/upload-files/index.tsx
|
|
7841
7963
|
R();
|
|
7842
|
-
var
|
|
7964
|
+
var Qs = (e) => {
|
|
7843
7965
|
var t, n, r, i, a;
|
|
7844
|
-
let { title: o, description: s, header: c, buttons: l, footer: u, backgroundColor: d, backgroundImage: f, popups: p, settings: m, errorMessages: h, serviceToken: g, uploadFileToTemp: _, abortRequest: v } = e, y = F(null), [b, x] = N(!1), [S, C] = N(!1), { uploadFileRows: w, uploadPhase: T, pickFiles: E, removeFile: D, onChangeFileInput: ee, submit: O, retryFile: te } =
|
|
7966
|
+
let { title: o, description: s, header: c, buttons: l, footer: u, backgroundColor: d, backgroundImage: f, popups: p, settings: m, errorMessages: h, serviceToken: g, uploadFileToTemp: _, abortRequest: v } = e, y = F(null), [b, x] = N(!1), [S, C] = N(!1), { uploadFileRows: w, uploadPhase: T, pickFiles: E, removeFile: D, onChangeFileInput: ee, submit: O, retryFile: te } = zs({
|
|
7845
7967
|
serviceToken: g,
|
|
7846
7968
|
settings: m,
|
|
7847
7969
|
errorMessages: h,
|
|
@@ -7878,43 +8000,43 @@ var Us = (e) => {
|
|
|
7878
8000
|
backgroundImage: f,
|
|
7879
8001
|
children: [
|
|
7880
8002
|
/* @__PURE__ */ B("div", {
|
|
7881
|
-
style:
|
|
8003
|
+
style: Bs,
|
|
7882
8004
|
part: "gui-file-upload-root",
|
|
7883
8005
|
"data-ui": "gui-file-upload",
|
|
7884
8006
|
children: [/* @__PURE__ */ B("div", {
|
|
7885
|
-
style:
|
|
8007
|
+
style: Vs,
|
|
7886
8008
|
children: [
|
|
7887
8009
|
/* @__PURE__ */ B("div", {
|
|
7888
|
-
style:
|
|
8010
|
+
style: Hs,
|
|
7889
8011
|
children: /* @__PURE__ */ B(G, z({}, o))
|
|
7890
8012
|
}),
|
|
7891
8013
|
w.length === 0 && /* @__PURE__ */ B(G, z({}, s)),
|
|
7892
8014
|
w.length > 0 && w.map((e) => {
|
|
7893
8015
|
var t;
|
|
7894
|
-
let n = e.clientValidation !==
|
|
8016
|
+
let n = e.clientValidation !== vs.OK || e.uploadState === $.ERROR && T !== _s.UPLOADING;
|
|
7895
8017
|
return /* @__PURE__ */ B("div", {
|
|
7896
8018
|
style: { width: "100%" },
|
|
7897
8019
|
children: [
|
|
7898
8020
|
/* @__PURE__ */ B("div", {
|
|
7899
8021
|
"data-ui": "gui-file-card",
|
|
7900
|
-
style: z(z({},
|
|
7901
|
-
children: [/* @__PURE__ */ B(
|
|
8022
|
+
style: z(z({}, Us), n ? Ws : {}),
|
|
8023
|
+
children: [/* @__PURE__ */ B(js, {
|
|
7902
8024
|
uploadFile: e,
|
|
7903
8025
|
uploadPhase: T,
|
|
7904
8026
|
onRetryFile: te,
|
|
7905
8027
|
onRemoveFile: D
|
|
7906
|
-
}), e.uploadState === $.UPLOADING && /* @__PURE__ */ B(
|
|
8028
|
+
}), e.uploadState === $.UPLOADING && /* @__PURE__ */ B(Ms, { range: e.progressBarRange })]
|
|
7907
8029
|
}),
|
|
7908
|
-
e.clientValidation !==
|
|
7909
|
-
style:
|
|
8030
|
+
e.clientValidation !== vs.OK && /* @__PURE__ */ B("div", {
|
|
8031
|
+
style: Gs,
|
|
7910
8032
|
children: /* @__PURE__ */ B(G, {
|
|
7911
8033
|
text: le(e.clientValidation),
|
|
7912
8034
|
fontSize: "13px",
|
|
7913
8035
|
fontColor: "#d32f2f"
|
|
7914
8036
|
})
|
|
7915
8037
|
}),
|
|
7916
|
-
T !==
|
|
7917
|
-
style:
|
|
8038
|
+
T !== _s.UPLOADING && e.uploadState === $.ERROR && e.clientValidation === vs.OK && /* @__PURE__ */ B("div", {
|
|
8039
|
+
style: Gs,
|
|
7918
8040
|
children: /* @__PURE__ */ B(G, {
|
|
7919
8041
|
text: (t = e.serverError) == null ? h.fileNotLoaded : t,
|
|
7920
8042
|
fontSize: "13px",
|
|
@@ -7944,58 +8066,58 @@ var Us = (e) => {
|
|
|
7944
8066
|
})]
|
|
7945
8067
|
}),
|
|
7946
8068
|
S && oe && /* @__PURE__ */ B("div", {
|
|
7947
|
-
style:
|
|
8069
|
+
style: Ks,
|
|
7948
8070
|
onPointerDown: (e) => {
|
|
7949
8071
|
e.preventDefault(), e.stopPropagation(), ce();
|
|
7950
8072
|
},
|
|
7951
8073
|
children: /* @__PURE__ */ B("div", {
|
|
7952
|
-
style: z(z({},
|
|
8074
|
+
style: z(z({}, qs), {}, {
|
|
7953
8075
|
borderRadius: (j == null ? void 0 : j.cornerRadius) || "27px",
|
|
7954
8076
|
backgroundColor: (j == null ? void 0 : j.backgroundColor) || "#ffffff"
|
|
7955
8077
|
}),
|
|
7956
8078
|
children: [
|
|
7957
8079
|
/* @__PURE__ */ B("div", {
|
|
7958
|
-
style:
|
|
8080
|
+
style: Js,
|
|
7959
8081
|
children: /* @__PURE__ */ B(G, z({ fontSize: "24px" }, oe.title))
|
|
7960
8082
|
}),
|
|
7961
8083
|
/* @__PURE__ */ B("div", {
|
|
7962
|
-
style:
|
|
8084
|
+
style: Ys,
|
|
7963
8085
|
children: /* @__PURE__ */ B("div", {
|
|
7964
|
-
style:
|
|
8086
|
+
style: Xs,
|
|
7965
8087
|
children: /* @__PURE__ */ B(G, z({ fontSize: "17px" }, oe.message))
|
|
7966
8088
|
})
|
|
7967
8089
|
}),
|
|
7968
8090
|
oe.actionButton1 && /* @__PURE__ */ B("div", {
|
|
7969
|
-
style:
|
|
8091
|
+
style: Zs,
|
|
7970
8092
|
children: /* @__PURE__ */ B(bn, z(z({ dataTestId: "files-limit-exceeded-modal-ok-button" }, oe.actionButton1), (oe == null || (i = oe.actionButton1) == null ? void 0 : i.type) === "FORM" ? { onClick: ce } : {}))
|
|
7971
8093
|
})
|
|
7972
8094
|
]
|
|
7973
8095
|
})
|
|
7974
8096
|
}),
|
|
7975
8097
|
b && j && /* @__PURE__ */ B("div", {
|
|
7976
|
-
style:
|
|
8098
|
+
style: Ks,
|
|
7977
8099
|
onPointerDown: (e) => {
|
|
7978
8100
|
e.preventDefault(), e.stopPropagation(), se();
|
|
7979
8101
|
},
|
|
7980
8102
|
children: /* @__PURE__ */ B("div", {
|
|
7981
|
-
style: z(z({},
|
|
8103
|
+
style: z(z({}, qs), {}, {
|
|
7982
8104
|
borderRadius: (j == null ? void 0 : j.cornerRadius) || "27px",
|
|
7983
8105
|
backgroundColor: (j == null ? void 0 : j.backgroundColor) || "#ffffff"
|
|
7984
8106
|
}),
|
|
7985
8107
|
children: [
|
|
7986
8108
|
/* @__PURE__ */ B("div", {
|
|
7987
|
-
style:
|
|
8109
|
+
style: Js,
|
|
7988
8110
|
children: /* @__PURE__ */ B(G, z({ fontSize: "24px" }, j.title))
|
|
7989
8111
|
}),
|
|
7990
8112
|
/* @__PURE__ */ B("div", {
|
|
7991
|
-
style:
|
|
8113
|
+
style: Ys,
|
|
7992
8114
|
children: /* @__PURE__ */ B("div", {
|
|
7993
|
-
style:
|
|
8115
|
+
style: Xs,
|
|
7994
8116
|
children: /* @__PURE__ */ B(G, z({ fontSize: "17px" }, j.message))
|
|
7995
8117
|
})
|
|
7996
8118
|
}),
|
|
7997
8119
|
j.actionButton1 && /* @__PURE__ */ B("div", {
|
|
7998
|
-
style:
|
|
8120
|
+
style: Zs,
|
|
7999
8121
|
children: /* @__PURE__ */ B(bn, z(z({ dataTestId: "no-files-modal-ok-button" }, j.actionButton1), (j == null || (a = j.actionButton1) == null ? void 0 : a.type) === "FORM" ? { onClick: se } : {}))
|
|
8000
8122
|
})
|
|
8001
8123
|
]
|
|
@@ -8003,7 +8125,7 @@ var Us = (e) => {
|
|
|
8003
8125
|
})
|
|
8004
8126
|
]
|
|
8005
8127
|
});
|
|
8006
|
-
},
|
|
8128
|
+
}, $s = ({ moduleProps: e }) => {
|
|
8007
8129
|
let { templateId: t, templateLayout: n } = e, { perform: r } = vt();
|
|
8008
8130
|
if (!t || !n) return /* @__PURE__ */ B(An, {});
|
|
8009
8131
|
if (t === wt.STATUS) return /* @__PURE__ */ B(Tn, {
|
|
@@ -8026,7 +8148,7 @@ var Us = (e) => {
|
|
|
8026
8148
|
backgroundColor: n == null ? void 0 : n.backgroundColor,
|
|
8027
8149
|
backgroundImage: n == null ? void 0 : n.backgroundImage
|
|
8028
8150
|
});
|
|
8029
|
-
if (t === wt.GEOLOCATION) return /* @__PURE__ */ B(
|
|
8151
|
+
if (t === wt.GEOLOCATION) return /* @__PURE__ */ B(_o, {
|
|
8030
8152
|
header: n == null ? void 0 : n.header,
|
|
8031
8153
|
footer: n == null ? void 0 : n.footer,
|
|
8032
8154
|
image: n == null ? void 0 : n.image,
|
|
@@ -8040,7 +8162,7 @@ var Us = (e) => {
|
|
|
8040
8162
|
getLocationTimeout: e.getLocationTimeout,
|
|
8041
8163
|
locationAccuracy: e.locationAccuracy
|
|
8042
8164
|
});
|
|
8043
|
-
if (t === wt.GENERIC_LOCATION) return /* @__PURE__ */ B(
|
|
8165
|
+
if (t === wt.GENERIC_LOCATION) return /* @__PURE__ */ B(Lo, {
|
|
8044
8166
|
rootElement: n.rootElement,
|
|
8045
8167
|
popups: n.popups,
|
|
8046
8168
|
settings: n.settings
|
|
@@ -8061,7 +8183,7 @@ var Us = (e) => {
|
|
|
8061
8183
|
backgroundColor: n == null ? void 0 : n.backgroundColor,
|
|
8062
8184
|
backgroundImage: n == null ? void 0 : n.backgroundImage
|
|
8063
8185
|
});
|
|
8064
|
-
if (t === wt.CAMERA) return /* @__PURE__ */ B(
|
|
8186
|
+
if (t === wt.CAMERA) return /* @__PURE__ */ B($a, {
|
|
8065
8187
|
header: n == null ? void 0 : n.header,
|
|
8066
8188
|
buttons: n == null ? void 0 : n.buttons,
|
|
8067
8189
|
footer: n == null ? void 0 : n.footer,
|
|
@@ -8069,7 +8191,7 @@ var Us = (e) => {
|
|
|
8069
8191
|
selectionLimit: e.selectionLimit,
|
|
8070
8192
|
backgroundImage: n == null ? void 0 : n.backgroundImage
|
|
8071
8193
|
});
|
|
8072
|
-
if (t === wt.GALLERY) return /* @__PURE__ */ B(
|
|
8194
|
+
if (t === wt.GALLERY) return /* @__PURE__ */ B(qa, {
|
|
8073
8195
|
header: n == null ? void 0 : n.header,
|
|
8074
8196
|
buttons: n == null ? void 0 : n.buttons,
|
|
8075
8197
|
footer: n == null ? void 0 : n.footer,
|
|
@@ -8080,7 +8202,7 @@ var Us = (e) => {
|
|
|
8080
8202
|
if (t === wt.QUESTIONS) {
|
|
8081
8203
|
var i;
|
|
8082
8204
|
let t = (i = e.properties) != null && i.length ? JSON.stringify(e.properties) : "default-key";
|
|
8083
|
-
return /* @__PURE__ */ B(
|
|
8205
|
+
return /* @__PURE__ */ B(Ua, {
|
|
8084
8206
|
dataSource: e.dataSource,
|
|
8085
8207
|
properties: e.properties,
|
|
8086
8208
|
questions: n == null ? void 0 : n.questions,
|
|
@@ -8092,7 +8214,7 @@ var Us = (e) => {
|
|
|
8092
8214
|
backgroundImage: n == null ? void 0 : n.backgroundImage
|
|
8093
8215
|
}, t);
|
|
8094
8216
|
}
|
|
8095
|
-
return t === wt.DEVICE_TRANSFER ? /* @__PURE__ */ B(
|
|
8217
|
+
return t === wt.DEVICE_TRANSFER ? /* @__PURE__ */ B(gs, {
|
|
8096
8218
|
header: n == null ? void 0 : n.header,
|
|
8097
8219
|
buttons: n == null ? void 0 : n.buttons,
|
|
8098
8220
|
footer: n == null ? void 0 : n.footer,
|
|
@@ -8102,7 +8224,7 @@ var Us = (e) => {
|
|
|
8102
8224
|
backgroundImage: n == null ? void 0 : n.backgroundImage,
|
|
8103
8225
|
qr: n == null ? void 0 : n.qr,
|
|
8104
8226
|
url: e == null ? void 0 : e.url
|
|
8105
|
-
}) : t === wt.GENERIC ? /* @__PURE__ */ B(
|
|
8227
|
+
}) : t === wt.GENERIC ? /* @__PURE__ */ B(Fo, { rootElement: n.rootElement }) : t === wt.GENERIC_PROGRESS ? /* @__PURE__ */ B(Ro, { rootElement: n.rootElement }) : t === wt.UPLOAD_FILES ? /* @__PURE__ */ B(Qs, {
|
|
8106
8228
|
title: n.title,
|
|
8107
8229
|
description: n.description,
|
|
8108
8230
|
header: n.header,
|
|
@@ -8116,13 +8238,13 @@ var Us = (e) => {
|
|
|
8116
8238
|
serviceToken: e.serviceToken,
|
|
8117
8239
|
uploadFileToTemp: e.uploadFileToTemp,
|
|
8118
8240
|
abortRequest: e.abortRequest
|
|
8119
|
-
}) : (r(new
|
|
8241
|
+
}) : (r(new Ha({
|
|
8120
8242
|
errorCode: Xt.DECODING_FAILED,
|
|
8121
8243
|
message: "Unsupported step template id"
|
|
8122
8244
|
})), null);
|
|
8123
8245
|
};
|
|
8124
8246
|
De(), R();
|
|
8125
|
-
var
|
|
8247
|
+
var ec, tc = !1, nc = ({ children: e }) => /* @__PURE__ */ B(m, { children: [/* @__PURE__ */ B("style", { children: "#gui-idv-web-c *, #gui-idv-web-c *::before, #gui-idv-web-c *::after {box-sizing: border-box;}" }), e] }), rc = ({ children: e, locale: t, direction: n }) => /* @__PURE__ */ B("div", {
|
|
8126
8248
|
part: "gui-idv",
|
|
8127
8249
|
id: "gui-idv-web-c",
|
|
8128
8250
|
dir: n,
|
|
@@ -8133,7 +8255,7 @@ var Gs, Ks = !1, qs = ({ children: e }) => /* @__PURE__ */ B(m, { children: [/*
|
|
|
8133
8255
|
width: "100%"
|
|
8134
8256
|
},
|
|
8135
8257
|
children: e
|
|
8136
|
-
}),
|
|
8258
|
+
}), ic = ({ isProcessing: e, moduleProps: t, perform: n, devSettings: r, idvEventListener: i }) => {
|
|
8137
8259
|
let a = pt(t.locale);
|
|
8138
8260
|
return P(() => {
|
|
8139
8261
|
i == null || i("idv-gui", "Gui component was rendered");
|
|
@@ -8143,13 +8265,13 @@ var Gs, Ks = !1, qs = ({ children: e }) => /* @__PURE__ */ B(m, { children: [/*
|
|
|
8143
8265
|
devSettings: r,
|
|
8144
8266
|
failedAssets: t.failedAssets,
|
|
8145
8267
|
layoutDirection: a,
|
|
8146
|
-
children: /* @__PURE__ */ B(
|
|
8268
|
+
children: /* @__PURE__ */ B(rc, {
|
|
8147
8269
|
locale: t.locale,
|
|
8148
8270
|
direction: a,
|
|
8149
|
-
children: /* @__PURE__ */ B(
|
|
8271
|
+
children: /* @__PURE__ */ B($s, { moduleProps: t })
|
|
8150
8272
|
})
|
|
8151
8273
|
});
|
|
8152
|
-
},
|
|
8274
|
+
}, ac = class extends ct {
|
|
8153
8275
|
constructor() {
|
|
8154
8276
|
super(), this._mounted = !1, this._shadowRoot = this.attachShadow({ mode: "open" }), this._renderVersion = 0, this.props = null;
|
|
8155
8277
|
}
|
|
@@ -8157,7 +8279,7 @@ var Gs, Ks = !1, qs = ({ children: e }) => /* @__PURE__ */ B(m, { children: [/*
|
|
|
8157
8279
|
let t = e.moduleProps.failedAssets;
|
|
8158
8280
|
if (t && t.blockingAssets.size > 0) {
|
|
8159
8281
|
var n;
|
|
8160
|
-
let r = new
|
|
8282
|
+
let r = new Ha({
|
|
8161
8283
|
errorCode: Xt.IMAGE_LOADING_FAILED,
|
|
8162
8284
|
message: `Failed to load image asset${t.blockingAssets.size > 1 ? "s" : ""}: ${[...t.blockingAssets].join(", ")}`
|
|
8163
8285
|
});
|
|
@@ -8180,7 +8302,7 @@ var Gs, Ks = !1, qs = ({ children: e }) => /* @__PURE__ */ B(m, { children: [/*
|
|
|
8180
8302
|
let e = document.createElement("style");
|
|
8181
8303
|
e.id = "idv-gui-styles", e.textContent = "\n *, *::before, *::after {\n box-sizing: border-box;\n }\n h1, h2, h3, h4, p, ul {\n margin: 0;\n padding: 0;\n }\n li {\n list-style: none;\n }\n :host {\n display: block;\n container-type: inline-size;\n container-name: host;\n width: 100%;\n height: 100%;\n }\n ", this.shadowRoot.querySelector("#idv-gui-styles") || this.shadowRoot.appendChild(e);
|
|
8182
8304
|
}
|
|
8183
|
-
j(/* @__PURE__ */ B(
|
|
8305
|
+
j(/* @__PURE__ */ B(ic, {
|
|
8184
8306
|
moduleProps: this.props.moduleProps,
|
|
8185
8307
|
perform: this.props.perform,
|
|
8186
8308
|
idvEventListener: this.props.idvEventListener,
|
|
@@ -8194,15 +8316,15 @@ var Gs, Ks = !1, qs = ({ children: e }) => /* @__PURE__ */ B(m, { children: [/*
|
|
|
8194
8316
|
});
|
|
8195
8317
|
}
|
|
8196
8318
|
static isReady() {
|
|
8197
|
-
return
|
|
8319
|
+
return tc;
|
|
8198
8320
|
}
|
|
8199
8321
|
static initialize(e) {
|
|
8200
|
-
|
|
8322
|
+
tc = !0;
|
|
8201
8323
|
}
|
|
8202
8324
|
static deinitialize() {
|
|
8203
|
-
|
|
8325
|
+
tc = !1;
|
|
8204
8326
|
}
|
|
8205
8327
|
};
|
|
8206
|
-
|
|
8328
|
+
ec = ac, ec.displayName = Yt, ec.getSupportedTemplates = () => Object.values(wt), ec.getIdentifier = () => Yt, lt(Yt, ac);
|
|
8207
8329
|
//#endregion
|
|
8208
|
-
export {
|
|
8330
|
+
export { ac as GuiIdv, ic as GuiIdvReactComponent, wt as GuiIdvSteps, nc as GuiIdvStyleInjectionWrapper, Xt as GuiModuleError, V as IDV_UI_ICONS, $t as PopupReason, Kt as idvIconDataUrlMap };
|