@arkyn/components 3.0.1-beta.51 → 3.0.1-beta.53
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/bundle.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as f, jsxs as k, Fragment as Ce } from "react/jsx-runtime";
|
2
2
|
import * as ee from "react";
|
3
|
-
import Tr, { createContext as Se, useContext as Re, useState as
|
3
|
+
import Tr, { createContext as Se, useContext as Re, useState as S, useRef as ie, useEffect as be, cloneElement as $a, useId as Me, useSyncExternalStore as La, forwardRef as gn, Children as ja, useCallback as nt } from "react";
|
4
4
|
import { Info as Ba, AlertTriangle as za, XCircle as Ha, CheckCircle2 as Ga, Pause as Va, Play as Ua, Loader2 as Ae, RefreshCw as hn, Check as pn, X as yn, FileImage as qa, FileAudio as Wa, FileArchive as Ka, File as Xa, ChevronDown as Or, Search as Ya } from "lucide-react";
|
5
5
|
import { AnimatePresence as Pr, motion as dt } from "framer-motion";
|
6
6
|
import { InputMask as Ar } from "@react-input/mask";
|
@@ -47,7 +47,7 @@ function Qa(e) {
|
|
47
47
|
function t() {
|
48
48
|
return !e || e <= 0 ? 0 : e >= 100 ? 100 : e;
|
49
49
|
}
|
50
|
-
const [n, r] =
|
50
|
+
const [n, r] = S(t());
|
51
51
|
function a(s) {
|
52
52
|
return s <= 0 ? r(0) : s >= 100 ? r(100) : r(s);
|
53
53
|
}
|
@@ -61,13 +61,13 @@ function es(e) {
|
|
61
61
|
onDragging: a,
|
62
62
|
className: s = "",
|
63
63
|
...o
|
64
|
-
} = e, [i, c] =
|
64
|
+
} = e, [i, c] = S(!1), l = ie(null), u = () => c(!0), d = () => c(!1), _ = (C) => {
|
65
65
|
if (r || !i || !l.current) return;
|
66
|
-
const
|
66
|
+
const E = l.current.getBoundingClientRect(), v = C.clientX - E.left, w = Math.min(Math.max(v / E.width * 100, 0), 100);
|
67
67
|
t(w);
|
68
68
|
}, h = (C) => {
|
69
69
|
if (r || !l.current) return;
|
70
|
-
const
|
70
|
+
const E = l.current.getBoundingClientRect(), v = C.clientX - E.left, w = Math.min(Math.max(v / E.width * 100, 0), 100);
|
71
71
|
t(w);
|
72
72
|
};
|
73
73
|
be(() => (i ? (a && a(!0), document.addEventListener("mousemove", _), document.addEventListener("mouseup", d)) : (a && a(!1), document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", d)), () => {
|
@@ -90,8 +90,8 @@ function es(e) {
|
|
90
90
|
);
|
91
91
|
}
|
92
92
|
function ts(e) {
|
93
|
-
var
|
94
|
-
const { onPlayAudio: t, onPauseAudio: n, disabled: r, ...a } = e, [s, o] = Qa(0), [i, c] =
|
93
|
+
var D, T, j, A;
|
94
|
+
const { onPlayAudio: t, onPauseAudio: n, disabled: r, ...a } = e, [s, o] = Qa(0), [i, c] = S(!1), [l, u] = S(!1), d = ie(null), _ = (D = d.current) == null ? void 0 : D.currentTime, h = (T = d.current) == null ? void 0 : T.duration, m = C(_), g = C(h), y = {
|
95
95
|
totalTime: h,
|
96
96
|
currentTime: _,
|
97
97
|
formattedCurrentTime: m,
|
@@ -99,10 +99,10 @@ function ts(e) {
|
|
99
99
|
};
|
100
100
|
function C(b) {
|
101
101
|
if (!b) return "00:00";
|
102
|
-
const
|
103
|
-
return `${I}:${
|
102
|
+
const O = Math.floor(b / 60), $ = Math.floor(b % 60), I = String(O).padStart(2, "0"), z = String($).padStart(2, "0");
|
103
|
+
return `${I}:${z}`;
|
104
104
|
}
|
105
|
-
function
|
105
|
+
function E() {
|
106
106
|
const b = d.current;
|
107
107
|
b && (e.onPlayAudio && e.onPlayAudio(y), b.play(), c(!0));
|
108
108
|
}
|
@@ -111,23 +111,23 @@ function ts(e) {
|
|
111
111
|
b && (e.onPauseAudio && e.onPauseAudio(y), b.pause(), c(!1));
|
112
112
|
}
|
113
113
|
function w() {
|
114
|
-
i ? v() :
|
114
|
+
i ? v() : E();
|
115
115
|
}
|
116
|
-
function
|
117
|
-
const
|
118
|
-
if (!
|
119
|
-
const
|
120
|
-
|
116
|
+
function H(b) {
|
117
|
+
const O = d.current;
|
118
|
+
if (!O) return;
|
119
|
+
const $ = O.duration, I = b / 100 * $;
|
120
|
+
O.currentTime = I;
|
121
121
|
}
|
122
|
-
return l || !i ? (
|
122
|
+
return l || !i ? (j = d.current) == null || j.pause() : i && ((A = d.current) == null || A.play()), be(() => {
|
123
123
|
const b = d.current;
|
124
124
|
if (!b) return;
|
125
|
-
const
|
126
|
-
const
|
127
|
-
o(
|
125
|
+
const O = () => {
|
126
|
+
const $ = b.duration, z = b.currentTime / $ * 100;
|
127
|
+
o(z);
|
128
128
|
};
|
129
|
-
return b.addEventListener("timeupdate",
|
130
|
-
b.removeEventListener("timeupdate",
|
129
|
+
return b.addEventListener("timeupdate", O), () => {
|
130
|
+
b.removeEventListener("timeupdate", O);
|
131
131
|
};
|
132
132
|
}, []), /* @__PURE__ */ k("div", { className: "arkynAudioPlayer", children: [
|
133
133
|
/* @__PURE__ */ f(
|
@@ -148,7 +148,7 @@ function ts(e) {
|
|
148
148
|
es,
|
149
149
|
{
|
150
150
|
value: s,
|
151
|
-
onChange:
|
151
|
+
onChange: H,
|
152
152
|
onDragging: u,
|
153
153
|
disabled: r
|
154
154
|
}
|
@@ -258,15 +258,15 @@ function Cn(e) {
|
|
258
258
|
orientation: a = "top",
|
259
259
|
className: s = "",
|
260
260
|
...o
|
261
|
-
} = e, i = Me(), c = ie(null), [l, u] =
|
261
|
+
} = e, i = Me(), c = ie(null), [l, u] = S(a);
|
262
262
|
be(() => {
|
263
263
|
const _ = () => {
|
264
264
|
if (!c.current) return;
|
265
265
|
const g = document.getElementById(i);
|
266
266
|
g && (u(a), requestAnimationFrame(() => {
|
267
|
-
const y = g.getBoundingClientRect(), C = window.innerWidth,
|
267
|
+
const y = g.getBoundingClientRect(), C = window.innerWidth, E = window.innerHeight;
|
268
268
|
let v = a;
|
269
|
-
a === "left" && y.left < 0 ? v = "right" : a === "right" && y.right > C ? v = "left" : a === "top" && y.top < 0 ? v = "bottom" : a === "bottom" && y.bottom >
|
269
|
+
a === "left" && y.left < 0 ? v = "right" : a === "right" && y.right > C ? v = "left" : a === "top" && y.top < 0 ? v = "bottom" : a === "bottom" && y.bottom > E && (v = "top"), v === "right" && y.right > C ? v = "left" : v === "left" && y.left < 0 ? v = "right" : v === "bottom" && y.bottom > E ? v = "top" : v === "top" && y.top < 0 && (v = "bottom"), u(v);
|
270
270
|
}));
|
271
271
|
}, h = c.current;
|
272
272
|
if (!h) return;
|
@@ -398,52 +398,52 @@ function xc(e) {
|
|
398
398
|
defaultValue: _ = "",
|
399
399
|
showAsterisk: h = !1,
|
400
400
|
disabled: m = !1
|
401
|
-
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [C,
|
402
|
-
async function
|
401
|
+
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [C, E] = S(_), [v, w] = S(""), [H, D] = S(null), [T, j] = S(_), [A, b] = S(!1);
|
402
|
+
async function O(N) {
|
403
403
|
if (m) return;
|
404
|
-
b(!0),
|
404
|
+
b(!0), D(N), w("");
|
405
405
|
const Y = new FormData();
|
406
|
-
Y.append(r,
|
407
|
-
|
408
|
-
}).catch((
|
409
|
-
console.error(
|
406
|
+
Y.append(r, N), await fetch(d, { method: a, body: Y }).then(async (x) => await x.json()).then((x) => {
|
407
|
+
x != null && x.error ? w(x.error) : E(x == null ? void 0 : x[o]), s && s(x == null ? void 0 : x[o]);
|
408
|
+
}).catch((x) => {
|
409
|
+
console.error(x), w("Erro ao enviar audio");
|
410
410
|
}).finally(() => b(!1));
|
411
411
|
}
|
412
|
-
function
|
412
|
+
function $(N) {
|
413
413
|
if (!m) {
|
414
|
-
if (
|
414
|
+
if (N.type.indexOf("audio") === -1) {
|
415
415
|
w("O arquivo selecionado não é um arquivo de áudio");
|
416
416
|
return;
|
417
417
|
}
|
418
|
-
|
418
|
+
j(URL.createObjectURL(N)), O(N);
|
419
419
|
}
|
420
420
|
}
|
421
421
|
const I = y || v;
|
422
422
|
return /* @__PURE__ */ k(ve, { children: [
|
423
423
|
n && /* @__PURE__ */ f(ye, { showAsterisk: h, children: n }),
|
424
|
-
/* @__PURE__ */ k("div", { className: `arkynAudioUpload ${I ? "hasError" : "noHasError"} ${
|
424
|
+
/* @__PURE__ */ k("div", { className: `arkynAudioUpload ${I ? "hasError" : "noHasError"} ${T ? "hasAudio" : "noHasAudio"}`, children: [
|
425
425
|
/* @__PURE__ */ f("input", { type: "hidden", name: t, value: C || "" }),
|
426
|
-
!
|
426
|
+
!T && /* @__PURE__ */ f(
|
427
427
|
rs,
|
428
428
|
{
|
429
429
|
disabled: m,
|
430
430
|
isLoading: A,
|
431
431
|
acceptAudio: u,
|
432
432
|
dropAudioText: c,
|
433
|
-
handleSelectFile:
|
433
|
+
handleSelectFile: $,
|
434
434
|
selectAudioButtonText: i
|
435
435
|
}
|
436
436
|
),
|
437
|
-
|
437
|
+
T && /* @__PURE__ */ f(
|
438
438
|
ns,
|
439
439
|
{
|
440
|
-
filePath:
|
440
|
+
filePath: T,
|
441
441
|
acceptAudio: u,
|
442
442
|
changeAudioButtonText: l,
|
443
443
|
disabled: m,
|
444
|
-
handleSelectFile:
|
444
|
+
handleSelectFile: $,
|
445
445
|
isLoading: A,
|
446
|
-
reSendAudio: I &&
|
446
|
+
reSendAudio: I && H ? () => O(H) : void 0
|
447
447
|
}
|
448
448
|
)
|
449
449
|
] }),
|
@@ -506,7 +506,7 @@ function Nc(e) {
|
|
506
506
|
disabled: a = !1,
|
507
507
|
className: s,
|
508
508
|
...o
|
509
|
-
} = e, [i, c] =
|
509
|
+
} = e, [i, c] = S(r || ""), l = `arkynCardTabContainer ${s || ""}`;
|
510
510
|
function u(d) {
|
511
511
|
c(d), n && n(d);
|
512
512
|
}
|
@@ -534,9 +534,9 @@ function Fc(e) {
|
|
534
534
|
orientation: u,
|
535
535
|
value: d,
|
536
536
|
..._
|
537
|
-
} = e, { fieldErrors: h } = xe(), m = ie(null), g = t || Me(), y = s || (h == null ? void 0 : h[n]), C = !!y, [
|
538
|
-
function
|
539
|
-
const A =
|
537
|
+
} = e, { fieldErrors: h } = xe(), m = ie(null), g = t || Me(), y = s || (h == null ? void 0 : h[n]), C = !!y, [E, v] = S(o || !1), w = typeof c == "boolean" ? c : E, T = `arkynCheckbox ${a} ${C ? "errorTrue" : "errorFalse"} ${w ? "checkedTrue" : "checkedFalse"} ${r}`;
|
538
|
+
function j() {
|
539
|
+
const A = E;
|
540
540
|
v(!A), l && l(A ? "" : d || "checked");
|
541
541
|
}
|
542
542
|
return /* @__PURE__ */ k(ve, { orientation: u, children: [
|
@@ -546,8 +546,8 @@ function Fc(e) {
|
|
546
546
|
{
|
547
547
|
id: g,
|
548
548
|
type: "button",
|
549
|
-
className:
|
550
|
-
onClick:
|
549
|
+
className: T,
|
550
|
+
onClick: j,
|
551
551
|
..._,
|
552
552
|
children: [
|
553
553
|
/* @__PURE__ */ f(
|
@@ -2597,30 +2597,30 @@ function Tc(e) {
|
|
2597
2597
|
isLoading: g = !1,
|
2598
2598
|
leftIcon: y,
|
2599
2599
|
readOnly: C,
|
2600
|
-
onFocus:
|
2600
|
+
onFocus: E,
|
2601
2601
|
onBlur: v,
|
2602
2602
|
errorMessage: w,
|
2603
|
-
showAsterisk:
|
2604
|
-
rightIcon:
|
2605
|
-
size:
|
2606
|
-
id:
|
2603
|
+
showAsterisk: H,
|
2604
|
+
rightIcon: D,
|
2605
|
+
size: T = "md",
|
2606
|
+
id: j,
|
2607
2607
|
...A
|
2608
|
-
} = e, { fieldErrors: b } = xe(), [
|
2608
|
+
} = e, { fieldErrors: b } = xe(), [O, $] = S(!1), [I, z] = S("0"), R = ie(null), B = j || Me(), N = w || (b == null ? void 0 : b[t]), Y = !!N, x = n || g, X = { md: 20, lg: 20 }[T], Z = D ? "right" : "left", he = Z === "left" && g, ce = Z === "right" && g;
|
2609
2609
|
function se() {
|
2610
|
-
|
2610
|
+
x || !(R != null && R.current) || ($(!0), R.current.focus());
|
2611
2611
|
}
|
2612
2612
|
function te(ue) {
|
2613
|
-
|
2613
|
+
$(!0), E && E(ue);
|
2614
2614
|
}
|
2615
|
-
function
|
2616
|
-
|
2615
|
+
function L(ue) {
|
2616
|
+
$(!1), v && v(ue);
|
2617
2617
|
}
|
2618
2618
|
const ne = (ue) => {
|
2619
2619
|
const [Le, Ve] = Yt(
|
2620
2620
|
ue,
|
2621
2621
|
d
|
2622
2622
|
);
|
2623
|
-
return !u || Le <= u ? (
|
2623
|
+
return !u || Le <= u ? (z(Ve), [Le, Ve]) : Yt(ue, d);
|
2624
2624
|
}, Te = (ue) => {
|
2625
2625
|
ue.preventDefault();
|
2626
2626
|
const [Le, Ve] = ne(ue.target.value);
|
@@ -2628,11 +2628,11 @@ function Tc(e) {
|
|
2628
2628
|
};
|
2629
2629
|
be(() => {
|
2630
2630
|
const ue = c || +l || void 0, [, Le] = Yt(ue, d);
|
2631
|
-
|
2631
|
+
z(Le);
|
2632
2632
|
}, [d, l, c]);
|
2633
|
-
const qt = `arkynCurrencyInput ${h ? "hasPrefix" : ""} ${m ? "hasSuffix" : ""} ${s} ${
|
2633
|
+
const qt = `arkynCurrencyInput ${h ? "hasPrefix" : ""} ${m ? "hasSuffix" : ""} ${s} ${T} ${x || C || g ? "opacity" : ""} ${Y ? "errored" : ""} ${O ? "focused" : ""} ${i}`;
|
2634
2634
|
return /* @__PURE__ */ k(ve, { children: [
|
2635
|
-
o && /* @__PURE__ */ f(ye, { showAsterisk:
|
2635
|
+
o && /* @__PURE__ */ f(ye, { showAsterisk: H, htmlFor: B, children: o }),
|
2636
2636
|
/* @__PURE__ */ k(
|
2637
2637
|
"section",
|
2638
2638
|
{
|
@@ -2655,15 +2655,15 @@ function Tc(e) {
|
|
2655
2655
|
/* @__PURE__ */ f(
|
2656
2656
|
"input",
|
2657
2657
|
{
|
2658
|
-
disabled:
|
2658
|
+
disabled: x,
|
2659
2659
|
readOnly: C,
|
2660
|
-
ref:
|
2660
|
+
ref: R,
|
2661
2661
|
onFocus: te,
|
2662
|
-
onBlur:
|
2662
|
+
onBlur: L,
|
2663
2663
|
onChange: Te,
|
2664
2664
|
id: B,
|
2665
|
-
placeholder:
|
2666
|
-
value:
|
2665
|
+
placeholder: x ? I : void 0,
|
2666
|
+
value: x ? void 0 : I,
|
2667
2667
|
...A
|
2668
2668
|
}
|
2669
2669
|
),
|
@@ -2676,7 +2676,7 @@ function Tc(e) {
|
|
2676
2676
|
readOnly: !0
|
2677
2677
|
}
|
2678
2678
|
),
|
2679
|
-
/* @__PURE__ */ f(K, { show: !g, icon:
|
2679
|
+
/* @__PURE__ */ f(K, { show: !g, icon: D, iconSize: X }),
|
2680
2680
|
/* @__PURE__ */ f(
|
2681
2681
|
K,
|
2682
2682
|
{
|
@@ -2690,7 +2690,7 @@ function Tc(e) {
|
|
2690
2690
|
]
|
2691
2691
|
}
|
2692
2692
|
),
|
2693
|
-
|
2693
|
+
N && /* @__PURE__ */ f(Ee, { children: N })
|
2694
2694
|
] });
|
2695
2695
|
}
|
2696
2696
|
function us() {
|
@@ -2887,21 +2887,21 @@ function Ac(e) {
|
|
2887
2887
|
dropFileText: d = "Ou arraste e solte o arquivo aqui",
|
2888
2888
|
onChange: _,
|
2889
2889
|
disabled: h = !1
|
2890
|
-
} = e, { fieldErrors: m } = xe(), g = m == null ? void 0 : m[t], [y, C] =
|
2891
|
-
async function
|
2890
|
+
} = e, { fieldErrors: m } = xe(), g = m == null ? void 0 : m[t], [y, C] = S(""), [E, v] = S(""), [w, H] = S(null), [D, T] = S(!1);
|
2891
|
+
async function j(z) {
|
2892
2892
|
if (h) return;
|
2893
|
-
|
2894
|
-
const
|
2895
|
-
|
2893
|
+
T(!0), H(z), v("");
|
2894
|
+
const R = new FormData();
|
2895
|
+
R.append(s, z), await fetch(a, { method: o, body: R }).then(async (B) => await B.json()).then((B) => {
|
2896
2896
|
B != null && B.error ? v(B.error) : C(B == null ? void 0 : B[c]), _ && _(B == null ? void 0 : B[c]);
|
2897
2897
|
}).catch((B) => {
|
2898
2898
|
console.error(B), v("Erro ao enviar o arquivo");
|
2899
|
-
}).finally(() =>
|
2899
|
+
}).finally(() => T(!1));
|
2900
2900
|
}
|
2901
|
-
function A(
|
2902
|
-
h ||
|
2901
|
+
function A(z) {
|
2902
|
+
h || j(z);
|
2903
2903
|
}
|
2904
|
-
const b = g ||
|
2904
|
+
const b = g || E;
|
2905
2905
|
return /* @__PURE__ */ k(ve, { children: [
|
2906
2906
|
n && /* @__PURE__ */ f(ye, { showAsterisk: r, children: n }),
|
2907
2907
|
/* @__PURE__ */ k("div", { className: `arkynFileUpload ${b ? "hasError" : "noHasError"} ${w ? "hasFile" : "noHasFile"}`, children: [
|
@@ -2910,7 +2910,7 @@ function Ac(e) {
|
|
2910
2910
|
ms,
|
2911
2911
|
{
|
2912
2912
|
disabled: h,
|
2913
|
-
isLoading:
|
2913
|
+
isLoading: D,
|
2914
2914
|
acceptFile: i,
|
2915
2915
|
dropFileText: d,
|
2916
2916
|
handleSelectFile: A,
|
@@ -2921,12 +2921,12 @@ function Ac(e) {
|
|
2921
2921
|
_s,
|
2922
2922
|
{
|
2923
2923
|
disabled: h,
|
2924
|
-
isLoading:
|
2924
|
+
isLoading: D,
|
2925
2925
|
acceptFile: i,
|
2926
2926
|
file: w,
|
2927
2927
|
handleSelectFile: A,
|
2928
2928
|
changeFileButtonText: l,
|
2929
|
-
reSendFile: b && w ? () =>
|
2929
|
+
reSendFile: b && w ? () => j(w) : void 0
|
2930
2930
|
}
|
2931
2931
|
)
|
2932
2932
|
] }),
|
@@ -3044,46 +3044,46 @@ function Ic(e) {
|
|
3044
3044
|
dropImageText: _ = "Ou arraste e solte a imagem aqui",
|
3045
3045
|
onChange: h,
|
3046
3046
|
disabled: m = !1
|
3047
|
-
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [C,
|
3048
|
-
async function
|
3047
|
+
} = e, { fieldErrors: g } = xe(), y = g == null ? void 0 : g[t], [C, E] = S(n), [v, w] = S(""), [H, D] = S(null), [T, j] = S(n), [A, b] = S(!1);
|
3048
|
+
async function O(N) {
|
3049
3049
|
if (m) return;
|
3050
|
-
b(!0),
|
3050
|
+
b(!0), D(N), w("");
|
3051
3051
|
const Y = new FormData();
|
3052
|
-
Y.append(o,
|
3053
|
-
|
3054
|
-
}).catch((
|
3055
|
-
console.error(
|
3052
|
+
Y.append(o, N), await fetch(s, { method: i, body: Y }).then(async (x) => await x.json()).then((x) => {
|
3053
|
+
x != null && x.error ? w(x.error) : E(x == null ? void 0 : x[l]), h && h(x == null ? void 0 : x[l]);
|
3054
|
+
}).catch((x) => {
|
3055
|
+
console.error(x), w("Erro ao enviar imagem");
|
3056
3056
|
}).finally(() => b(!1));
|
3057
3057
|
}
|
3058
|
-
function
|
3059
|
-
m || (
|
3058
|
+
function $(N) {
|
3059
|
+
m || (j(URL.createObjectURL(N)), O(N));
|
3060
3060
|
}
|
3061
3061
|
const I = y || v;
|
3062
3062
|
return /* @__PURE__ */ k(ve, { children: [
|
3063
3063
|
r && /* @__PURE__ */ f(ye, { showAsterisk: a, children: r }),
|
3064
|
-
/* @__PURE__ */ k("div", { className: `arkynImageUpload ${I ? "hasError" : "noHasError"} ${
|
3064
|
+
/* @__PURE__ */ k("div", { className: `arkynImageUpload ${I ? "hasError" : "noHasError"} ${T ? "hasImage" : "noHasImage"}`, children: [
|
3065
3065
|
/* @__PURE__ */ f("input", { type: "hidden", name: t, value: C || "" }),
|
3066
|
-
!
|
3066
|
+
!T && /* @__PURE__ */ f(
|
3067
3067
|
hs,
|
3068
3068
|
{
|
3069
3069
|
disabled: m,
|
3070
3070
|
isLoading: A,
|
3071
3071
|
acceptImage: c,
|
3072
3072
|
dropImageText: _,
|
3073
|
-
handleSelectFile:
|
3073
|
+
handleSelectFile: $,
|
3074
3074
|
selectImageButtonText: d
|
3075
3075
|
}
|
3076
3076
|
),
|
3077
|
-
|
3077
|
+
T && /* @__PURE__ */ f(
|
3078
3078
|
gs,
|
3079
3079
|
{
|
3080
3080
|
disabled: m,
|
3081
3081
|
isLoading: A,
|
3082
3082
|
acceptImage: c,
|
3083
|
-
filePath:
|
3084
|
-
handleSelectFile:
|
3083
|
+
filePath: T,
|
3084
|
+
handleSelectFile: $,
|
3085
3085
|
changeImageButtonText: u,
|
3086
|
-
reSendImage: I &&
|
3086
|
+
reSendImage: I && H ? () => O(H) : void 0
|
3087
3087
|
}
|
3088
3088
|
)
|
3089
3089
|
] }),
|
@@ -3109,15 +3109,15 @@ function ps(e) {
|
|
3109
3109
|
errorMessage: g,
|
3110
3110
|
showAsterisk: y,
|
3111
3111
|
rightIcon: C,
|
3112
|
-
type:
|
3112
|
+
type: E = "text",
|
3113
3113
|
size: v = "md",
|
3114
3114
|
id: w,
|
3115
|
-
value:
|
3116
|
-
placeholder:
|
3117
|
-
...
|
3118
|
-
} = e, { fieldErrors:
|
3115
|
+
value: H,
|
3116
|
+
placeholder: D,
|
3117
|
+
...T
|
3118
|
+
} = e, { fieldErrors: j } = xe(), [A, b] = S(!1), O = ie(null), $ = w || Me(), I = g || (j == null ? void 0 : j[t]), z = !!I, R = n || u, N = { md: 20, lg: 20 }[v], Y = C ? "right" : "left", x = Y === "left" && u, _e = Y === "right" && u;
|
3119
3119
|
function X() {
|
3120
|
-
|
3120
|
+
R || !(O != null && O.current) || (b(!0), O.current.focus());
|
3121
3121
|
}
|
3122
3122
|
function Z(ke) {
|
3123
3123
|
b(!0), h && h(ke);
|
@@ -3125,20 +3125,20 @@ function ps(e) {
|
|
3125
3125
|
function he(ke) {
|
3126
3126
|
b(!1), m && m(ke);
|
3127
3127
|
}
|
3128
|
-
if (
|
3128
|
+
if (E === "hidden")
|
3129
3129
|
return /* @__PURE__ */ f(
|
3130
3130
|
"input",
|
3131
3131
|
{
|
3132
3132
|
style: { display: "none" },
|
3133
3133
|
readOnly: !0,
|
3134
3134
|
type: "text",
|
3135
|
-
ref:
|
3136
|
-
...
|
3135
|
+
ref: O,
|
3136
|
+
...T
|
3137
3137
|
}
|
3138
3138
|
);
|
3139
|
-
const De = `arkynInput ${c ? "hasPrefix" : ""} ${n ? "disabled" : ""} ${l ? "hasSuffix" : ""} ${s} ${v} ${
|
3139
|
+
const De = `arkynInput ${c ? "hasPrefix" : ""} ${n ? "disabled" : ""} ${l ? "hasSuffix" : ""} ${s} ${v} ${R || _ || u ? "opacity" : ""} ${z ? "errored" : ""} ${A ? "focused" : ""} ${i}`;
|
3140
3140
|
return /* @__PURE__ */ k(ve, { children: [
|
3141
|
-
o && /* @__PURE__ */ f(ye, { showAsterisk: y, htmlFor:
|
3141
|
+
o && /* @__PURE__ */ f(ye, { showAsterisk: y, htmlFor: $, children: o }),
|
3142
3142
|
/* @__PURE__ */ k(
|
3143
3143
|
"section",
|
3144
3144
|
{
|
@@ -3147,44 +3147,44 @@ function ps(e) {
|
|
3147
3147
|
onClick: X,
|
3148
3148
|
className: De,
|
3149
3149
|
children: [
|
3150
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3150
|
+
/* @__PURE__ */ f(K, { iconSize: N, icon: c, className: "prefix" }),
|
3151
3151
|
/* @__PURE__ */ f(
|
3152
3152
|
K,
|
3153
3153
|
{
|
3154
|
-
show:
|
3155
|
-
iconSize:
|
3154
|
+
show: x,
|
3155
|
+
iconSize: N,
|
3156
3156
|
className: "spinner",
|
3157
3157
|
icon: Ae
|
3158
3158
|
}
|
3159
3159
|
),
|
3160
|
-
/* @__PURE__ */ f(K, { show: !u, icon: d, iconSize:
|
3160
|
+
/* @__PURE__ */ f(K, { show: !u, icon: d, iconSize: N }),
|
3161
3161
|
/* @__PURE__ */ f(
|
3162
3162
|
"input",
|
3163
3163
|
{
|
3164
|
-
disabled:
|
3164
|
+
disabled: R,
|
3165
3165
|
readOnly: _,
|
3166
|
-
ref:
|
3166
|
+
ref: O,
|
3167
3167
|
onFocus: Z,
|
3168
3168
|
onBlur: he,
|
3169
|
-
type:
|
3170
|
-
id:
|
3169
|
+
type: E,
|
3170
|
+
id: $,
|
3171
3171
|
name: t,
|
3172
|
-
placeholder:
|
3173
|
-
value:
|
3174
|
-
...
|
3172
|
+
placeholder: R && H || D,
|
3173
|
+
value: R ? void 0 : H,
|
3174
|
+
...T
|
3175
3175
|
}
|
3176
3176
|
),
|
3177
|
-
/* @__PURE__ */ f(K, { show: !u, icon: C, iconSize:
|
3177
|
+
/* @__PURE__ */ f(K, { show: !u, icon: C, iconSize: N }),
|
3178
3178
|
/* @__PURE__ */ f(
|
3179
3179
|
K,
|
3180
3180
|
{
|
3181
3181
|
show: _e,
|
3182
|
-
iconSize:
|
3182
|
+
iconSize: N,
|
3183
3183
|
className: "spinner",
|
3184
3184
|
icon: Ae
|
3185
3185
|
}
|
3186
3186
|
),
|
3187
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3187
|
+
/* @__PURE__ */ f(K, { iconSize: N, icon: l, className: "suffix" })
|
3188
3188
|
]
|
3189
3189
|
}
|
3190
3190
|
),
|
@@ -3211,29 +3211,29 @@ function Rc(e) {
|
|
3211
3211
|
leftIcon: g,
|
3212
3212
|
readOnly: y,
|
3213
3213
|
onFocus: C,
|
3214
|
-
onBlur:
|
3214
|
+
onBlur: E,
|
3215
3215
|
errorMessage: v,
|
3216
3216
|
defaultValue: w,
|
3217
|
-
showAsterisk:
|
3218
|
-
rightIcon:
|
3219
|
-
size:
|
3220
|
-
id:
|
3217
|
+
showAsterisk: H,
|
3218
|
+
rightIcon: D,
|
3219
|
+
size: T = "md",
|
3220
|
+
id: j,
|
3221
3221
|
value: A,
|
3222
3222
|
placeholder: b,
|
3223
|
-
...
|
3224
|
-
} = e, { fieldErrors:
|
3223
|
+
...O
|
3224
|
+
} = e, { fieldErrors: $ } = xe(), [I, z] = S(!1), R = ie(null), B = j || Me(), N = v || ($ == null ? void 0 : $[t]), Y = !!N, x = n || m, X = { md: 20, lg: 20 }[T], Z = D ? "right" : "left", he = Z === "left" && m, ce = Z === "right" && m;
|
3225
3225
|
function se() {
|
3226
|
-
|
3226
|
+
x || !(R != null && R.current) || (z(!0), R.current.focus());
|
3227
3227
|
}
|
3228
3228
|
function te($e) {
|
3229
|
-
|
3229
|
+
z(!0), C && C($e);
|
3230
3230
|
}
|
3231
|
-
function
|
3232
|
-
|
3231
|
+
function L($e) {
|
3232
|
+
z(!1), E && E($e);
|
3233
3233
|
}
|
3234
|
-
const re = `arkynMaskedInput ${_ ? "hasPrefix" : ""} ${h ? "hasSuffix" : ""} ${s} ${
|
3234
|
+
const re = `arkynMaskedInput ${_ ? "hasPrefix" : ""} ${h ? "hasSuffix" : ""} ${s} ${T} ${x || y || m ? "opacity" : ""} ${Y ? "errored" : ""} ${I ? "focused" : ""} ${d}`;
|
3235
3235
|
return /* @__PURE__ */ k(ve, { children: [
|
3236
|
-
u && /* @__PURE__ */ f(ye, { showAsterisk:
|
3236
|
+
u && /* @__PURE__ */ f(ye, { showAsterisk: H, htmlFor: B, children: u }),
|
3237
3237
|
/* @__PURE__ */ k(
|
3238
3238
|
"section",
|
3239
3239
|
{
|
@@ -3261,19 +3261,19 @@ function Rc(e) {
|
|
3261
3261
|
replacement: l,
|
3262
3262
|
separate: o,
|
3263
3263
|
showMask: c,
|
3264
|
-
ref:
|
3264
|
+
ref: R,
|
3265
3265
|
onFocus: te,
|
3266
|
-
onBlur:
|
3267
|
-
disabled:
|
3266
|
+
onBlur: L,
|
3267
|
+
disabled: x,
|
3268
3268
|
readOnly: y,
|
3269
3269
|
id: B,
|
3270
3270
|
name: t,
|
3271
|
-
placeholder:
|
3272
|
-
value:
|
3273
|
-
...
|
3271
|
+
placeholder: x && A || b,
|
3272
|
+
value: x ? void 0 : A,
|
3273
|
+
...O
|
3274
3274
|
}
|
3275
3275
|
),
|
3276
|
-
/* @__PURE__ */ f(K, { show: !m, icon:
|
3276
|
+
/* @__PURE__ */ f(K, { show: !m, icon: D, iconSize: X }),
|
3277
3277
|
/* @__PURE__ */ f(
|
3278
3278
|
K,
|
3279
3279
|
{
|
@@ -3287,7 +3287,7 @@ function Rc(e) {
|
|
3287
3287
|
]
|
3288
3288
|
}
|
3289
3289
|
),
|
3290
|
-
|
3290
|
+
N && /* @__PURE__ */ f(Ee, { children: N })
|
3291
3291
|
] });
|
3292
3292
|
}
|
3293
3293
|
const Lr = Se({});
|
@@ -3416,7 +3416,7 @@ function ws(e) {
|
|
3416
3416
|
] });
|
3417
3417
|
}
|
3418
3418
|
function Ns(e) {
|
3419
|
-
const { children: t, isFocused: n, isSearchable: r, search: a, onSearch: s } = e, o = ie(null), [i, c] =
|
3419
|
+
const { children: t, isFocused: n, isSearchable: r, search: a, onSearch: s } = e, o = ie(null), [i, c] = S("bottom");
|
3420
3420
|
yt(n), be(() => {
|
3421
3421
|
if (!n) return;
|
3422
3422
|
(() => {
|
@@ -3486,15 +3486,15 @@ function Lc(e) {
|
|
3486
3486
|
leftIcon: g,
|
3487
3487
|
onSearch: y,
|
3488
3488
|
onChange: C,
|
3489
|
-
onBlur:
|
3489
|
+
onBlur: E,
|
3490
3490
|
notFoundText: v = "Sem opções disponíveis",
|
3491
3491
|
onFocus: w,
|
3492
|
-
disabled:
|
3493
|
-
prefix:
|
3494
|
-
size:
|
3495
|
-
value:
|
3492
|
+
disabled: H = !1,
|
3493
|
+
prefix: D,
|
3494
|
+
size: T = "md",
|
3495
|
+
value: j,
|
3496
3496
|
variant: A = "solid"
|
3497
|
-
} = e, { fieldErrors: b } = xe(),
|
3497
|
+
} = e, { fieldErrors: b } = xe(), O = ie(null), $ = d || Me(), I = i || (b == null ? void 0 : b[t]), z = !!I, R = H || c || l, N = { md: 20, lg: 20 }[T], [Y, x] = S(""), [_e, X] = S(!1), [Z, he] = S(o), ce = j || Z;
|
3498
3498
|
function se(G) {
|
3499
3499
|
return ce.includes(G);
|
3500
3500
|
}
|
@@ -3502,14 +3502,14 @@ function Lc(e) {
|
|
3502
3502
|
const re = n.find(($e) => $e.value === G);
|
3503
3503
|
return (re == null ? void 0 : re.label) || "";
|
3504
3504
|
}
|
3505
|
-
function
|
3506
|
-
|
3505
|
+
function L() {
|
3506
|
+
R || !(O != null && O.current) || _e || (X(!0), O.current.focus(), w && w());
|
3507
3507
|
}
|
3508
3508
|
function ne() {
|
3509
|
-
X(!1),
|
3509
|
+
X(!1), E && O.current && O.current.blur();
|
3510
3510
|
}
|
3511
3511
|
function Te(G) {
|
3512
|
-
|
3512
|
+
x(G), y && y(G);
|
3513
3513
|
}
|
3514
3514
|
function De(G) {
|
3515
3515
|
se(G) ? (he(Z.filter((re) => re !== G)), C && C(Z.filter((re) => re !== G))) : (he([...Z, G]), C && C([...Z, G])), s && ne();
|
@@ -3520,37 +3520,37 @@ function Lc(e) {
|
|
3520
3520
|
/* @__PURE__ */ k(
|
3521
3521
|
bs,
|
3522
3522
|
{
|
3523
|
-
handleContainerFocus:
|
3524
|
-
disabled:
|
3525
|
-
isError:
|
3523
|
+
handleContainerFocus: L,
|
3524
|
+
disabled: R,
|
3525
|
+
isError: z,
|
3526
3526
|
isFocused: _e,
|
3527
3527
|
isLoading: c,
|
3528
3528
|
readOnly: l,
|
3529
|
-
size:
|
3529
|
+
size: T,
|
3530
3530
|
variant: A,
|
3531
3531
|
className: r,
|
3532
|
-
prefixExists: !!
|
3533
|
-
id:
|
3532
|
+
prefixExists: !!D,
|
3533
|
+
id: $,
|
3534
3534
|
children: [
|
3535
3535
|
/* @__PURE__ */ f(
|
3536
3536
|
"input",
|
3537
3537
|
{
|
3538
|
-
ref:
|
3538
|
+
ref: O,
|
3539
3539
|
name: t,
|
3540
3540
|
value: JSON.stringify(ce),
|
3541
3541
|
type: "hidden"
|
3542
3542
|
}
|
3543
3543
|
),
|
3544
|
-
/* @__PURE__ */ f(K, { iconSize:
|
3545
|
-
g && /* @__PURE__ */ f(g, { size:
|
3546
|
-
/* @__PURE__ */ k(xs, { size:
|
3544
|
+
/* @__PURE__ */ f(K, { iconSize: N, icon: D, className: "prefix" }),
|
3545
|
+
g && /* @__PURE__ */ f(g, { size: N, strokeWidth: 2.5 }),
|
3546
|
+
/* @__PURE__ */ k(xs, { size: T, children: [
|
3547
3547
|
ce.map((G) => /* @__PURE__ */ f(
|
3548
3548
|
Es,
|
3549
3549
|
{
|
3550
3550
|
label: te(G),
|
3551
3551
|
value: G,
|
3552
3552
|
handleChangeValue: De,
|
3553
|
-
disabled:
|
3553
|
+
disabled: R
|
3554
3554
|
},
|
3555
3555
|
G
|
3556
3556
|
)),
|
@@ -3569,7 +3569,7 @@ function Lc(e) {
|
|
3569
3569
|
{
|
3570
3570
|
label: G,
|
3571
3571
|
value: re,
|
3572
|
-
size:
|
3572
|
+
size: T,
|
3573
3573
|
handleChangeValue: De,
|
3574
3574
|
optionHasSelected: se
|
3575
3575
|
},
|
@@ -3582,14 +3582,14 @@ function Lc(e) {
|
|
3582
3582
|
/* @__PURE__ */ f(
|
3583
3583
|
Cs,
|
3584
3584
|
{
|
3585
|
-
disabled:
|
3585
|
+
disabled: R,
|
3586
3586
|
isFocused: _e,
|
3587
3587
|
readOnly: l,
|
3588
|
-
iconSize:
|
3588
|
+
iconSize: N,
|
3589
3589
|
isLoading: c
|
3590
3590
|
}
|
3591
3591
|
),
|
3592
|
-
/* @__PURE__ */ f(Ss, { iconSize:
|
3592
|
+
/* @__PURE__ */ f(Ss, { iconSize: N, isLoading: c }),
|
3593
3593
|
/* @__PURE__ */ f(Fs, { handleBlur: ne, isFocused: _e })
|
3594
3594
|
]
|
3595
3595
|
}
|
@@ -3693,7 +3693,7 @@ function Rs(e) {
|
|
3693
3693
|
] });
|
3694
3694
|
}
|
3695
3695
|
function Ms(e) {
|
3696
|
-
const { children: t, isOpen: n, onSearch: r, search: a, placeholder: s } = e, o = ie(null), [i, c] =
|
3696
|
+
const { children: t, isOpen: n, onSearch: r, search: a, placeholder: s } = e, o = ie(null), [i, c] = S("bottom");
|
3697
3697
|
function l(u) {
|
3698
3698
|
r(u.target.value);
|
3699
3699
|
}
|
@@ -3755,7 +3755,7 @@ const $s = gn((e, t) => /* @__PURE__ */ f("input", { ref: t, ...e })), Ls = gn(
|
|
3755
3755
|
value: i,
|
3756
3756
|
currentCountry: c,
|
3757
3757
|
disabled: l
|
3758
|
-
} = e, [u, d] =
|
3758
|
+
} = e, [u, d] = S(!1);
|
3759
3759
|
be(() => {
|
3760
3760
|
u ? o(c.mask) : d(!0);
|
3761
3761
|
}, [c]);
|
@@ -3813,19 +3813,19 @@ function jc(e) {
|
|
3813
3813
|
searchCountryPlaceholder: m = "Pesquisar país",
|
3814
3814
|
notFoundCountryText: g = "Nenhum país encontrado",
|
3815
3815
|
id: y
|
3816
|
-
} = e, C = Ps(l), [
|
3816
|
+
} = e, C = Ps(l), [E, v] = S(!1), [w, H] = S(""), [D, T] = S(!1), [j, A] = S(C.formattedNumber || ""), [b, O] = S(() => {
|
3817
3817
|
if (C.country) return C.country;
|
3818
|
-
const
|
3819
|
-
return
|
3820
|
-
}), { fieldErrors:
|
3821
|
-
function
|
3822
|
-
|
3818
|
+
const L = rt.find((ne) => ne.iso === t);
|
3819
|
+
return L || rt[30];
|
3820
|
+
}), { fieldErrors: $ } = xe(), I = ie(null), z = y || Me(), R = s || ($ == null ? void 0 : $[_]), B = !!R, N = a || o, Y = ie(null);
|
3821
|
+
function x() {
|
3822
|
+
N || E || D || (v(!0), Y.current && Y.current.focus());
|
3823
3823
|
}
|
3824
3824
|
function _e() {
|
3825
|
-
|
3825
|
+
T(!0), v(!0);
|
3826
3826
|
}
|
3827
3827
|
function X() {
|
3828
|
-
|
3828
|
+
T(!1), v(!1);
|
3829
3829
|
}
|
3830
3830
|
function Z() {
|
3831
3831
|
v(!0);
|
@@ -3833,31 +3833,31 @@ function jc(e) {
|
|
3833
3833
|
function he() {
|
3834
3834
|
v(!1);
|
3835
3835
|
}
|
3836
|
-
function ce(
|
3837
|
-
return
|
3836
|
+
function ce(L) {
|
3837
|
+
return L.name.toLowerCase().includes(w.toLowerCase());
|
3838
3838
|
}
|
3839
|
-
function se(
|
3840
|
-
return b.prefix ?
|
3839
|
+
function se(L) {
|
3840
|
+
return b.prefix ? L.replace(b.prefix, "").replaceAll(" ", "").replaceAll("-", "").replaceAll("(", "").replaceAll(")", "").trim() : L.replaceAll(" ", "").replaceAll("-", "").replaceAll("(", "").replaceAll(")", "").trim();
|
3841
3841
|
}
|
3842
|
-
function te(
|
3842
|
+
function te(L) {
|
3843
3843
|
let ne = b.code;
|
3844
|
-
return b.prefix && (ne += `-${b.prefix}`), ne += " ", ne += se(
|
3844
|
+
return b.prefix && (ne += `-${b.prefix}`), ne += " ", ne += se(L || j), ne;
|
3845
3845
|
}
|
3846
3846
|
return /* @__PURE__ */ k(ve, { children: [
|
3847
3847
|
n && /* @__PURE__ */ f(ye, { showAsterisk: d, children: n }),
|
3848
3848
|
/* @__PURE__ */ k(
|
3849
3849
|
As,
|
3850
3850
|
{
|
3851
|
-
id:
|
3852
|
-
disabled:
|
3851
|
+
id: z,
|
3852
|
+
disabled: N,
|
3853
3853
|
isError: B,
|
3854
3854
|
isLoading: o,
|
3855
|
-
isFocused:
|
3855
|
+
isFocused: E,
|
3856
3856
|
readOnly: i,
|
3857
3857
|
size: c,
|
3858
3858
|
variant: u,
|
3859
3859
|
className: r,
|
3860
|
-
onFocus:
|
3860
|
+
onFocus: x,
|
3861
3861
|
children: [
|
3862
3862
|
/* @__PURE__ */ f(
|
3863
3863
|
Ds,
|
@@ -3870,31 +3870,31 @@ function jc(e) {
|
|
3870
3870
|
/* @__PURE__ */ k(
|
3871
3871
|
Ms,
|
3872
3872
|
{
|
3873
|
-
isOpen:
|
3873
|
+
isOpen: N || i ? !1 : D,
|
3874
3874
|
search: w,
|
3875
3875
|
placeholder: m,
|
3876
|
-
onSearch:
|
3876
|
+
onSearch: H,
|
3877
3877
|
children: [
|
3878
|
-
rt.filter((
|
3878
|
+
rt.filter((L) => ce(L)).map((L) => /* @__PURE__ */ f(
|
3879
3879
|
Rs,
|
3880
3880
|
{
|
3881
|
-
country:
|
3881
|
+
country: L,
|
3882
3882
|
handleChangeValue: () => {
|
3883
|
-
|
3883
|
+
O(L), T(!1), A(L.mask);
|
3884
3884
|
},
|
3885
|
-
isActive:
|
3885
|
+
isActive: L.iso === b.iso,
|
3886
3886
|
size: c
|
3887
3887
|
},
|
3888
|
-
|
3888
|
+
L.iso
|
3889
3889
|
)),
|
3890
|
-
rt.filter((
|
3890
|
+
rt.filter((L) => ce(L)).length === 0 && /* @__PURE__ */ f("p", { children: g })
|
3891
3891
|
]
|
3892
3892
|
}
|
3893
3893
|
),
|
3894
3894
|
/* @__PURE__ */ f(
|
3895
3895
|
Is,
|
3896
3896
|
{
|
3897
|
-
isOpen:
|
3897
|
+
isOpen: N || i ? !1 : D,
|
3898
3898
|
onClick: X
|
3899
3899
|
}
|
3900
3900
|
),
|
@@ -3904,13 +3904,13 @@ function jc(e) {
|
|
3904
3904
|
ref: Y,
|
3905
3905
|
readonly: i,
|
3906
3906
|
currentCountry: b,
|
3907
|
-
value:
|
3908
|
-
disabled:
|
3907
|
+
value: j,
|
3908
|
+
disabled: N,
|
3909
3909
|
onBlur: he,
|
3910
3910
|
onFocus: Z,
|
3911
3911
|
size: c,
|
3912
|
-
onChange: (
|
3913
|
-
A(
|
3912
|
+
onChange: (L) => {
|
3913
|
+
A(L), h && h(te(L));
|
3914
3914
|
}
|
3915
3915
|
}
|
3916
3916
|
),
|
@@ -3926,7 +3926,7 @@ function jc(e) {
|
|
3926
3926
|
]
|
3927
3927
|
}
|
3928
3928
|
),
|
3929
|
-
|
3929
|
+
R && /* @__PURE__ */ f(Ee, { children: R })
|
3930
3930
|
] });
|
3931
3931
|
}
|
3932
3932
|
function Bc(e) {
|
@@ -3936,7 +3936,7 @@ function Bc(e) {
|
|
3936
3936
|
closeOnClick: r,
|
3937
3937
|
className: a = "",
|
3938
3938
|
orientation: s = "bottomLeft"
|
3939
|
-
} = e, [o, i] =
|
3939
|
+
} = e, [o, i] = S(!1), l = `arkynPopover ${s} ${o ? "visibleTrue" : "visibleFalse"} ${a}`;
|
3940
3940
|
function u() {
|
3941
3941
|
o || i(!0);
|
3942
3942
|
}
|
@@ -4001,9 +4001,9 @@ function Hc(e) {
|
|
4001
4001
|
size: c = "md",
|
4002
4002
|
className: l = "",
|
4003
4003
|
...u
|
4004
|
-
} = e, [d, _] =
|
4005
|
-
function m(
|
4006
|
-
_(
|
4004
|
+
} = e, [d, _] = S(t), { fieldErrors: h } = xe();
|
4005
|
+
function m(E) {
|
4006
|
+
_(E), i && i(E);
|
4007
4007
|
}
|
4008
4008
|
const g = s || (h == null ? void 0 : h[n]), y = !!g, C = `arkynRadioGroup ${c} ${l}`;
|
4009
4009
|
return /* @__PURE__ */ k(ve, { children: [
|
@@ -4047,8 +4047,8 @@ function Gc(e) {
|
|
4047
4047
|
id: u,
|
4048
4048
|
orientation: d,
|
4049
4049
|
..._
|
4050
|
-
} = e, h = ie(null), m = u || Me(), [g, y] =
|
4051
|
-
function
|
4050
|
+
} = e, h = ie(null), m = u || Me(), [g, y] = S(r), C = typeof a == "boolean" ? a : g;
|
4051
|
+
function E() {
|
4052
4052
|
y(!g), l && l(C ? o : s || "checked");
|
4053
4053
|
}
|
4054
4054
|
const w = `arkynSwitch ${C ? "checkedTrue" : "checkedFalse"} ${n} ${c}`;
|
@@ -4058,7 +4058,7 @@ function Gc(e) {
|
|
4058
4058
|
"button",
|
4059
4059
|
{
|
4060
4060
|
type: "button",
|
4061
|
-
onClick:
|
4061
|
+
onClick: E,
|
4062
4062
|
className: w,
|
4063
4063
|
..._,
|
4064
4064
|
children: /* @__PURE__ */ f(
|
@@ -4068,7 +4068,7 @@ function Gc(e) {
|
|
4068
4068
|
type: "hidden",
|
4069
4069
|
name: i,
|
4070
4070
|
ref: h,
|
4071
|
-
onClick:
|
4071
|
+
onClick: E,
|
4072
4072
|
value: C ? s || "checked" : o
|
4073
4073
|
}
|
4074
4074
|
)
|
@@ -4115,7 +4115,7 @@ function Uc(e) {
|
|
4115
4115
|
disabled: a = !1,
|
4116
4116
|
className: s,
|
4117
4117
|
...o
|
4118
|
-
} = e, [i, c] =
|
4118
|
+
} = e, [i, c] = S(r || ""), l = `arkynTabContainer ${s || ""}`;
|
4119
4119
|
function u(d) {
|
4120
4120
|
c(d), n && n(d);
|
4121
4121
|
}
|
@@ -4175,17 +4175,20 @@ function Zc(e) {
|
|
4175
4175
|
onBlur: d,
|
4176
4176
|
title: _,
|
4177
4177
|
style: h,
|
4178
|
-
|
4179
|
-
|
4180
|
-
|
4181
|
-
|
4182
|
-
|
4178
|
+
value: m,
|
4179
|
+
defaultValue: g,
|
4180
|
+
placeholder: y,
|
4181
|
+
id: C,
|
4182
|
+
...E
|
4183
|
+
} = e, { fieldErrors: v } = xe(), [w, H] = S(!1), D = ie(null), T = C || Me(), j = a || (v == null ? void 0 : v[l]), I = `arkynTextarea ${t} ${n} ${s || o ? "opacityTrue" : "opacityFalse"} ${!!j ? "errorTrue" : "errorFalse"} ${w ? "focusedTrue" : "focusedFalse"} ${r}`;
|
4184
|
+
function z() {
|
4185
|
+
s || !(D != null && D.current) || (H(!0), D.current.focus());
|
4183
4186
|
}
|
4184
|
-
function
|
4185
|
-
|
4187
|
+
function R(N) {
|
4188
|
+
H(!0), u && u(N);
|
4186
4189
|
}
|
4187
|
-
function
|
4188
|
-
|
4190
|
+
function B(N) {
|
4191
|
+
H(!1), d && d(N);
|
4189
4192
|
}
|
4190
4193
|
return /* @__PURE__ */ k(ve, { children: [
|
4191
4194
|
i && /* @__PURE__ */ f(ye, { showAsterisk: c, children: i }),
|
@@ -4194,28 +4197,30 @@ function Zc(e) {
|
|
4194
4197
|
{
|
4195
4198
|
title: _,
|
4196
4199
|
style: h,
|
4197
|
-
onClick:
|
4198
|
-
className:
|
4200
|
+
onClick: z,
|
4201
|
+
className: I,
|
4199
4202
|
children: /* @__PURE__ */ f(
|
4200
4203
|
"textarea",
|
4201
4204
|
{
|
4202
|
-
id:
|
4205
|
+
id: T,
|
4203
4206
|
disabled: s,
|
4204
4207
|
readOnly: o,
|
4205
|
-
ref:
|
4206
|
-
onFocus:
|
4207
|
-
onBlur:
|
4208
|
-
|
4208
|
+
ref: D,
|
4209
|
+
onFocus: R,
|
4210
|
+
onBlur: B,
|
4211
|
+
placeholder: s && m || y,
|
4212
|
+
value: s ? void 0 : m,
|
4213
|
+
...E
|
4209
4214
|
}
|
4210
4215
|
)
|
4211
4216
|
}
|
4212
4217
|
),
|
4213
|
-
|
4218
|
+
j && /* @__PURE__ */ f(Ee, { children: j })
|
4214
4219
|
] });
|
4215
4220
|
}
|
4216
4221
|
const Vr = Se({});
|
4217
4222
|
function Jc(e) {
|
4218
|
-
const { children: t = !1 } = e, [n, r] =
|
4223
|
+
const { children: t = !1 } = e, [n, r] = S([]);
|
4219
4224
|
function a(c) {
|
4220
4225
|
return !!n.some((l) => l.key === c);
|
4221
4226
|
}
|
@@ -4255,7 +4260,7 @@ function Qc(e) {
|
|
4255
4260
|
}
|
4256
4261
|
const Ur = Se({});
|
4257
4262
|
function el(e) {
|
4258
|
-
const { children: t = !1 } = e, [n, r] =
|
4263
|
+
const { children: t = !1 } = e, [n, r] = S([]);
|
4259
4264
|
function a(l) {
|
4260
4265
|
return !!n.some((u) => u.key === l);
|
4261
4266
|
}
|
@@ -4414,7 +4419,7 @@ var Ys = (e) => typeof e == "function", St = (e, t) => Ys(e) ? e(t) : e, Zs = /*
|
|
4414
4419
|
}, Jr = (e) => Object.keys(Fe).forEach((t) => Zr(e, t)), Qs = (e) => Object.keys(Fe).find((t) => Fe[t].toasts.some((n) => n.id === e)), Rt = (e = En) => (t) => {
|
4415
4420
|
Zr(t, e);
|
4416
4421
|
}, eo = { blank: 4e3, error: 4e3, success: 2e3, loading: 1 / 0, custom: 4e3 }, to = (e = {}, t = En) => {
|
4417
|
-
let [n, r] =
|
4422
|
+
let [n, r] = S(Fe[t] || Yr), a = ie(Fe[t]);
|
4418
4423
|
be(() => (a.current !== Fe[t] && r(Fe[t]), Ft.push([t, r]), () => {
|
4419
4424
|
let o = Ft.findIndex(([i]) => i === t);
|
4420
4425
|
o > -1 && Ft.splice(o, 1);
|
@@ -4482,8 +4487,8 @@ var ro = 1e3, ao = (e, t = "default") => {
|
|
4482
4487
|
}, [o]), l = nt(() => {
|
4483
4488
|
r && o({ type: 6, time: Date.now() });
|
4484
4489
|
}, [r, o]), u = nt((d, _) => {
|
4485
|
-
let { reverseOrder: h = !1, gutter: m = 8, defaultPosition: g } = _ || {}, y = n.filter((v) => (v.position || g) === (d.position || g) && v.height), C = y.findIndex((v) => v.id === d.id),
|
4486
|
-
return y.filter((v) => v.visible).slice(...h ? [
|
4490
|
+
let { reverseOrder: h = !1, gutter: m = 8, defaultPosition: g } = _ || {}, y = n.filter((v) => (v.position || g) === (d.position || g) && v.height), C = y.findIndex((v) => v.id === d.id), E = y.filter((v, w) => w < C && v.visible).length;
|
4491
|
+
return y.filter((v) => v.visible).slice(...h ? [E + 1] : [0, E]).reduce((v, w) => v + (w.height || 0) + m, 0);
|
4487
4492
|
}, [n]);
|
4488
4493
|
return be(() => {
|
4489
4494
|
n.forEach((d) => {
|
@@ -5453,11 +5458,11 @@ var qo = (e, t, n) => {
|
|
5453
5458
|
var {
|
5454
5459
|
path: r,
|
5455
5460
|
node: a
|
5456
|
-
} = n, s =
|
5461
|
+
} = n, s = F.parent(e, r), o = r[r.length - 1];
|
5457
5462
|
if (o > s.children.length)
|
5458
5463
|
throw new Error('Cannot apply an "insert_node" operation at path ['.concat(r, "] because the destination is past the end of the node."));
|
5459
5464
|
if (s.children.splice(o, 0, a), t)
|
5460
|
-
for (var [i, c] of
|
5465
|
+
for (var [i, c] of M.points(t))
|
5461
5466
|
t[c] = U.transform(i, n);
|
5462
5467
|
break;
|
5463
5468
|
}
|
@@ -5468,25 +5473,25 @@ var qo = (e, t, n) => {
|
|
5468
5473
|
text: d
|
5469
5474
|
} = n;
|
5470
5475
|
if (d.length === 0) break;
|
5471
|
-
var _ =
|
5476
|
+
var _ = F.leaf(e, l), h = _.text.slice(0, u), m = _.text.slice(u);
|
5472
5477
|
if (_.text = h + d + m, t)
|
5473
|
-
for (var [g, y] of
|
5478
|
+
for (var [g, y] of M.points(t))
|
5474
5479
|
t[y] = U.transform(g, n);
|
5475
5480
|
break;
|
5476
5481
|
}
|
5477
5482
|
case "merge_node": {
|
5478
5483
|
var {
|
5479
5484
|
path: C
|
5480
|
-
} = n,
|
5481
|
-
if (W.isText(
|
5482
|
-
w.text +=
|
5483
|
-
else if (!W.isText(
|
5484
|
-
w.children.push(...
|
5485
|
+
} = n, E = F.get(e, C), v = p.previous(C), w = F.get(e, v), H = F.parent(e, C), D = C[C.length - 1];
|
5486
|
+
if (W.isText(E) && W.isText(w))
|
5487
|
+
w.text += E.text;
|
5488
|
+
else if (!W.isText(E) && !W.isText(w))
|
5489
|
+
w.children.push(...E.children);
|
5485
5490
|
else
|
5486
|
-
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(C, "] to nodes of different interfaces: ").concat(Ne.stringify(
|
5487
|
-
if (
|
5488
|
-
for (var [
|
5489
|
-
t[
|
5491
|
+
throw new Error('Cannot apply a "merge_node" operation at path ['.concat(C, "] to nodes of different interfaces: ").concat(Ne.stringify(E), " ").concat(Ne.stringify(w)));
|
5492
|
+
if (H.children.splice(D, 1), t)
|
5493
|
+
for (var [T, j] of M.points(t))
|
5494
|
+
t[j] = U.transform(T, n);
|
5490
5495
|
break;
|
5491
5496
|
}
|
5492
5497
|
case "move_node": {
|
@@ -5496,34 +5501,34 @@ var qo = (e, t, n) => {
|
|
5496
5501
|
} = n;
|
5497
5502
|
if (p.isAncestor(A, b))
|
5498
5503
|
throw new Error("Cannot move a path [".concat(A, "] to new path [").concat(b, "] because the destination is inside itself."));
|
5499
|
-
var
|
5500
|
-
|
5501
|
-
var
|
5502
|
-
if (
|
5503
|
-
for (var [
|
5504
|
-
t[Y] = U.transform(
|
5504
|
+
var O = F.get(e, A), $ = F.parent(e, A), I = A[A.length - 1];
|
5505
|
+
$.children.splice(I, 1);
|
5506
|
+
var z = p.transform(A, n), R = F.get(e, p.parent(z)), B = z[z.length - 1];
|
5507
|
+
if (R.children.splice(B, 0, O), t)
|
5508
|
+
for (var [N, Y] of M.points(t))
|
5509
|
+
t[Y] = U.transform(N, n);
|
5505
5510
|
break;
|
5506
5511
|
}
|
5507
5512
|
case "remove_node": {
|
5508
5513
|
var {
|
5509
|
-
path:
|
5510
|
-
} = n, _e =
|
5514
|
+
path: x
|
5515
|
+
} = n, _e = x[x.length - 1], X = F.parent(e, x);
|
5511
5516
|
if (X.children.splice(_e, 1), t)
|
5512
|
-
for (var [Z, he] of
|
5517
|
+
for (var [Z, he] of M.points(t)) {
|
5513
5518
|
var ce = U.transform(Z, n);
|
5514
5519
|
if (t != null && ce != null)
|
5515
5520
|
t[he] = ce;
|
5516
5521
|
else {
|
5517
5522
|
var se = void 0, te = void 0;
|
5518
|
-
for (var [
|
5519
|
-
if (p.compare(ne,
|
5520
|
-
se = [
|
5523
|
+
for (var [L, ne] of F.texts(e))
|
5524
|
+
if (p.compare(ne, x) === -1)
|
5525
|
+
se = [L, ne];
|
5521
5526
|
else {
|
5522
|
-
te = [
|
5527
|
+
te = [L, ne];
|
5523
5528
|
break;
|
5524
5529
|
}
|
5525
5530
|
var Te = !1;
|
5526
|
-
se && te && (p.equals(te[1],
|
5531
|
+
se && te && (p.equals(te[1], x) ? Te = !p.hasPrevious(te[1]) : Te = p.common(se[1], x).length < p.common(te[1], x).length), se && !Te ? (Z.path = se[1], Z.offset = se[0].text.length) : te ? (Z.path = te[1], Z.offset = 0) : t = null;
|
5527
5532
|
}
|
5528
5533
|
}
|
5529
5534
|
break;
|
@@ -5535,9 +5540,9 @@ var qo = (e, t, n) => {
|
|
5535
5540
|
text: G
|
5536
5541
|
} = n;
|
5537
5542
|
if (G.length === 0) break;
|
5538
|
-
var re =
|
5543
|
+
var re = F.leaf(e, De), $e = re.text.slice(0, ke), qt = re.text.slice(ke + G.length);
|
5539
5544
|
if (re.text = $e + qt, t)
|
5540
|
-
for (var [ue, Le] of
|
5545
|
+
for (var [ue, Le] of M.points(t))
|
5541
5546
|
t[Le] = U.transform(ue, n);
|
5542
5547
|
break;
|
5543
5548
|
}
|
@@ -5549,7 +5554,7 @@ var qo = (e, t, n) => {
|
|
5549
5554
|
} = n;
|
5550
5555
|
if (Ve.length === 0)
|
5551
5556
|
throw new Error("Cannot set properties on the root node!");
|
5552
|
-
var Kt =
|
5557
|
+
var Kt = F.get(e, Ve);
|
5553
5558
|
for (var Qe in Wt) {
|
5554
5559
|
if (Qe === "children" || Qe === "text")
|
5555
5560
|
throw new Error('Cannot set the "'.concat(Qe, '" property of nodes!'));
|
@@ -5568,7 +5573,7 @@ var qo = (e, t, n) => {
|
|
5568
5573
|
t = Ue;
|
5569
5574
|
else {
|
5570
5575
|
if (t == null) {
|
5571
|
-
if (!
|
5576
|
+
if (!M.isRange(Ue))
|
5572
5577
|
throw new Error('Cannot apply an incomplete "set_selection" operation properties '.concat(Ne.stringify(Ue), " when there is no current selection."));
|
5573
5578
|
t = it({}, Ue);
|
5574
5579
|
}
|
@@ -5592,7 +5597,7 @@ var qo = (e, t, n) => {
|
|
5592
5597
|
} = n;
|
5593
5598
|
if (tt.length === 0)
|
5594
5599
|
throw new Error('Cannot apply a "split_node" operation at path ['.concat(tt, "] because the root node cannot be split."));
|
5595
|
-
var qe =
|
5600
|
+
var qe = F.get(e, tt), Ta = F.parent(e, tt), Oa = tt[tt.length - 1], Xt;
|
5596
5601
|
if (W.isText(qe)) {
|
5597
5602
|
var Pa = qe.text.slice(0, kt), Aa = qe.text.slice(kt);
|
5598
5603
|
qe.text = Pa, Xt = it(it({}, Gn), {}, {
|
@@ -5605,7 +5610,7 @@ var qo = (e, t, n) => {
|
|
5605
5610
|
});
|
5606
5611
|
}
|
5607
5612
|
if (Ta.children.splice(Oa + 1, 0, Xt), t)
|
5608
|
-
for (var [Ma, Da] of
|
5613
|
+
for (var [Ma, Da] of M.points(t))
|
5609
5614
|
t[Da] = U.transform(Ma, n);
|
5610
5615
|
break;
|
5611
5616
|
}
|
@@ -5727,7 +5732,7 @@ function Jo(e) {
|
|
5727
5732
|
}
|
5728
5733
|
return e;
|
5729
5734
|
}
|
5730
|
-
var
|
5735
|
+
var M = {
|
5731
5736
|
edges(e) {
|
5732
5737
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, {
|
5733
5738
|
reverse: n = !1
|
@@ -5735,27 +5740,27 @@ var R = {
|
|
5735
5740
|
anchor: r,
|
5736
5741
|
focus: a
|
5737
5742
|
} = e;
|
5738
|
-
return
|
5743
|
+
return M.isBackward(e) === n ? [r, a] : [a, r];
|
5739
5744
|
},
|
5740
5745
|
end(e) {
|
5741
|
-
var [, t] =
|
5746
|
+
var [, t] = M.edges(e);
|
5742
5747
|
return t;
|
5743
5748
|
},
|
5744
5749
|
equals(e, t) {
|
5745
5750
|
return U.equals(e.anchor, t.anchor) && U.equals(e.focus, t.focus);
|
5746
5751
|
},
|
5747
5752
|
includes(e, t) {
|
5748
|
-
if (
|
5749
|
-
if (
|
5753
|
+
if (M.isRange(t)) {
|
5754
|
+
if (M.includes(e, t.anchor) || M.includes(e, t.focus))
|
5750
5755
|
return !0;
|
5751
|
-
var [n, r] =
|
5756
|
+
var [n, r] = M.edges(e), [a, s] = M.edges(t);
|
5752
5757
|
return U.isBefore(n, a) && U.isAfter(r, s);
|
5753
5758
|
}
|
5754
|
-
var [o, i] =
|
5759
|
+
var [o, i] = M.edges(e), c = !1, l = !1;
|
5755
5760
|
return U.isPoint(t) ? (c = U.compare(t, o) >= 0, l = U.compare(t, i) <= 0) : (c = p.compare(t, o.path) >= 0, l = p.compare(t, i.path) <= 0), c && l;
|
5756
5761
|
},
|
5757
5762
|
intersection(e, t) {
|
5758
|
-
var n = ht(e, Zo), [r, a] =
|
5763
|
+
var n = ht(e, Zo), [r, a] = M.edges(e), [s, o] = M.edges(t), i = U.isBefore(r, s) ? s : r, c = U.isBefore(a, o) ? a : o;
|
5759
5764
|
return U.isBefore(c, i) ? null : Jo({
|
5760
5765
|
anchor: i,
|
5761
5766
|
focus: c
|
@@ -5776,10 +5781,10 @@ var R = {
|
|
5776
5781
|
return U.equals(t, n);
|
5777
5782
|
},
|
5778
5783
|
isExpanded(e) {
|
5779
|
-
return !
|
5784
|
+
return !M.isCollapsed(e);
|
5780
5785
|
},
|
5781
5786
|
isForward(e) {
|
5782
|
-
return !
|
5787
|
+
return !M.isBackward(e);
|
5783
5788
|
},
|
5784
5789
|
isRange(e) {
|
5785
5790
|
return oe(e) && U.isPoint(e.anchor) && U.isPoint(e.focus);
|
@@ -5788,7 +5793,7 @@ var R = {
|
|
5788
5793
|
yield [e.anchor, "anchor"], yield [e.focus, "focus"];
|
5789
5794
|
},
|
5790
5795
|
start(e) {
|
5791
|
-
var [t] =
|
5796
|
+
var [t] = M.edges(e);
|
5792
5797
|
return t;
|
5793
5798
|
},
|
5794
5799
|
transform(e, t) {
|
@@ -5800,9 +5805,9 @@ var R = {
|
|
5800
5805
|
affinity: a = "inward"
|
5801
5806
|
} = n, s, o;
|
5802
5807
|
if (a === "inward") {
|
5803
|
-
var i =
|
5804
|
-
|
5805
|
-
} else a === "outward" ?
|
5808
|
+
var i = M.isCollapsed(r);
|
5809
|
+
M.isForward(r) ? (s = "forward", o = i ? s : "backward") : (s = "backward", o = i ? s : "forward");
|
5810
|
+
} else a === "outward" ? M.isForward(r) ? (s = "backward", o = "forward") : (s = "forward", o = "backward") : (s = a, o = a);
|
5806
5811
|
var c = U.transform(r.anchor, t, {
|
5807
5812
|
affinity: s
|
5808
5813
|
}), l = U.transform(r.focus, t, {
|
@@ -5813,9 +5818,9 @@ var R = {
|
|
5813
5818
|
r.anchor = c, r.focus = l;
|
5814
5819
|
});
|
5815
5820
|
}
|
5816
|
-
}, sr = (e) => oe(e) &&
|
5821
|
+
}, sr = (e) => oe(e) && F.isNodeList(e.children) && !pe.isEditor(e), je = {
|
5817
5822
|
isAncestor(e) {
|
5818
|
-
return oe(e) &&
|
5823
|
+
return oe(e) && F.isNodeList(e.children);
|
5819
5824
|
},
|
5820
5825
|
isElement: sr,
|
5821
5826
|
isElementList(e) {
|
@@ -5834,9 +5839,9 @@ var R = {
|
|
5834
5839
|
return !1;
|
5835
5840
|
return !0;
|
5836
5841
|
}
|
5837
|
-
}, Qo = ["children"], ei = ["text"], or = /* @__PURE__ */ new WeakMap(),
|
5842
|
+
}, Qo = ["children"], ei = ["text"], or = /* @__PURE__ */ new WeakMap(), F = {
|
5838
5843
|
ancestor(e, t) {
|
5839
|
-
var n =
|
5844
|
+
var n = F.get(e, t);
|
5840
5845
|
if (W.isText(n))
|
5841
5846
|
throw new Error("Cannot get the ancestor node at path [".concat(t, "] because it refers to a text node instead: ").concat(Ne.stringify(n)));
|
5842
5847
|
return n;
|
@@ -5845,7 +5850,7 @@ var R = {
|
|
5845
5850
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
5846
5851
|
return function* () {
|
5847
5852
|
for (var r of p.ancestors(t, n)) {
|
5848
|
-
var a =
|
5853
|
+
var a = F.ancestor(e, r), s = [a, r];
|
5849
5854
|
yield s;
|
5850
5855
|
}
|
5851
5856
|
}();
|
@@ -5863,20 +5868,20 @@ var R = {
|
|
5863
5868
|
return function* () {
|
5864
5869
|
for (var {
|
5865
5870
|
reverse: r = !1
|
5866
|
-
} = n, a =
|
5871
|
+
} = n, a = F.ancestor(e, t), {
|
5867
5872
|
children: s
|
5868
5873
|
} = a, o = r ? s.length - 1 : 0; r ? o >= 0 : o < s.length; ) {
|
5869
|
-
var i =
|
5874
|
+
var i = F.child(a, o), c = t.concat(o);
|
5870
5875
|
yield [i, c], o = r ? o - 1 : o + 1;
|
5871
5876
|
}
|
5872
5877
|
}();
|
5873
5878
|
},
|
5874
5879
|
common(e, t, n) {
|
5875
|
-
var r = p.common(t, n), a =
|
5880
|
+
var r = p.common(t, n), a = F.get(e, r);
|
5876
5881
|
return [a, r];
|
5877
5882
|
},
|
5878
5883
|
descendant(e, t) {
|
5879
|
-
var n =
|
5884
|
+
var n = F.get(e, t);
|
5880
5885
|
if (pe.isEditor(n))
|
5881
5886
|
throw new Error("Cannot get the descendant node at path [".concat(t, "] because it refers to the root editor node instead: ").concat(Ne.stringify(n)));
|
5882
5887
|
return n;
|
@@ -5884,14 +5889,14 @@ var R = {
|
|
5884
5889
|
descendants(e) {
|
5885
5890
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
5886
5891
|
return function* () {
|
5887
|
-
for (var [n, r] of
|
5892
|
+
for (var [n, r] of F.nodes(e, t))
|
5888
5893
|
r.length !== 0 && (yield [n, r]);
|
5889
5894
|
}();
|
5890
5895
|
},
|
5891
5896
|
elements(e) {
|
5892
5897
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
5893
5898
|
return function* () {
|
5894
|
-
for (var [n, r] of
|
5899
|
+
for (var [n, r] of F.nodes(e, t))
|
5895
5900
|
je.isElement(n) && (yield [n, r]);
|
5896
5901
|
}();
|
5897
5902
|
},
|
@@ -5905,7 +5910,7 @@ var R = {
|
|
5905
5910
|
}
|
5906
5911
|
},
|
5907
5912
|
first(e, t) {
|
5908
|
-
for (var n = t.slice(), r =
|
5913
|
+
for (var n = t.slice(), r = F.get(e, n); r && !(W.isText(r) || r.children.length === 0); )
|
5909
5914
|
r = r.children[0], n.push(0);
|
5910
5915
|
return [r, n];
|
5911
5916
|
},
|
@@ -5915,24 +5920,24 @@ var R = {
|
|
5915
5920
|
var n = Fn({
|
5916
5921
|
children: e.children
|
5917
5922
|
}, (r) => {
|
5918
|
-
var [a, s] =
|
5923
|
+
var [a, s] = M.edges(t), o = F.nodes(r, {
|
5919
5924
|
reverse: !0,
|
5920
5925
|
pass: (_) => {
|
5921
5926
|
var [, h] = _;
|
5922
|
-
return !
|
5927
|
+
return !M.includes(t, h);
|
5923
5928
|
}
|
5924
5929
|
});
|
5925
5930
|
for (var [, i] of o) {
|
5926
|
-
if (!
|
5927
|
-
var c =
|
5931
|
+
if (!M.includes(t, i)) {
|
5932
|
+
var c = F.parent(r, i), l = i[i.length - 1];
|
5928
5933
|
c.children.splice(l, 1);
|
5929
5934
|
}
|
5930
5935
|
if (p.equals(i, s.path)) {
|
5931
|
-
var u =
|
5936
|
+
var u = F.leaf(r, i);
|
5932
5937
|
u.text = u.text.slice(0, s.offset);
|
5933
5938
|
}
|
5934
5939
|
if (p.equals(i, a.path)) {
|
5935
|
-
var d =
|
5940
|
+
var d = F.leaf(r, i);
|
5936
5941
|
d.text = d.text.slice(a.offset);
|
5937
5942
|
}
|
5938
5943
|
}
|
@@ -5967,18 +5972,18 @@ var R = {
|
|
5967
5972
|
var t = or.get(e);
|
5968
5973
|
if (t !== void 0)
|
5969
5974
|
return t;
|
5970
|
-
var n = e.every((r) =>
|
5975
|
+
var n = e.every((r) => F.isNode(r));
|
5971
5976
|
return or.set(e, n), n;
|
5972
5977
|
},
|
5973
5978
|
last(e, t) {
|
5974
|
-
for (var n = t.slice(), r =
|
5979
|
+
for (var n = t.slice(), r = F.get(e, n); r && !(W.isText(r) || r.children.length === 0); ) {
|
5975
5980
|
var a = r.children.length - 1;
|
5976
5981
|
r = r.children[a], n.push(a);
|
5977
5982
|
}
|
5978
5983
|
return [r, n];
|
5979
5984
|
},
|
5980
5985
|
leaf(e, t) {
|
5981
|
-
var n =
|
5986
|
+
var n = F.get(e, t);
|
5982
5987
|
if (!W.isText(n))
|
5983
5988
|
throw new Error("Cannot get the leaf node at path [".concat(t, "] because it refers to a non-leaf node: ").concat(Ne.stringify(n)));
|
5984
5989
|
return n;
|
@@ -5987,7 +5992,7 @@ var R = {
|
|
5987
5992
|
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
5988
5993
|
return function* () {
|
5989
5994
|
for (var r of p.levels(t, n)) {
|
5990
|
-
var a =
|
5995
|
+
var a = F.get(e, r);
|
5991
5996
|
yield [a, r];
|
5992
5997
|
}
|
5993
5998
|
}();
|
@@ -6008,40 +6013,40 @@ var R = {
|
|
6008
6013
|
if (o.has(c) || (yield [c, i]), !o.has(c) && !W.isText(c) && c.children.length !== 0 && (n == null || n([c, i]) === !1)) {
|
6009
6014
|
o.add(c);
|
6010
6015
|
var l = r ? c.children.length - 1 : 0;
|
6011
|
-
p.isAncestor(i, a) && (l = a[i.length]), i = i.concat(l), c =
|
6016
|
+
p.isAncestor(i, a) && (l = a[i.length]), i = i.concat(l), c = F.get(e, i);
|
6012
6017
|
continue;
|
6013
6018
|
}
|
6014
6019
|
if (i.length === 0)
|
6015
6020
|
break;
|
6016
6021
|
if (!r) {
|
6017
6022
|
var u = p.next(i);
|
6018
|
-
if (
|
6019
|
-
i = u, c =
|
6023
|
+
if (F.has(e, u)) {
|
6024
|
+
i = u, c = F.get(e, i);
|
6020
6025
|
continue;
|
6021
6026
|
}
|
6022
6027
|
}
|
6023
6028
|
if (r && i[i.length - 1] !== 0) {
|
6024
6029
|
var d = p.previous(i);
|
6025
|
-
i = d, c =
|
6030
|
+
i = d, c = F.get(e, i);
|
6026
6031
|
continue;
|
6027
6032
|
}
|
6028
|
-
i = p.parent(i), c =
|
6033
|
+
i = p.parent(i), c = F.get(e, i), o.add(c);
|
6029
6034
|
}
|
6030
6035
|
}();
|
6031
6036
|
},
|
6032
6037
|
parent(e, t) {
|
6033
|
-
var n = p.parent(t), r =
|
6038
|
+
var n = p.parent(t), r = F.get(e, n);
|
6034
6039
|
if (W.isText(r))
|
6035
6040
|
throw new Error("Cannot get the parent of path [".concat(t, "] because it does not exist in the root."));
|
6036
6041
|
return r;
|
6037
6042
|
},
|
6038
6043
|
string(e) {
|
6039
|
-
return W.isText(e) ? e.text : e.children.map(
|
6044
|
+
return W.isText(e) ? e.text : e.children.map(F.string).join("");
|
6040
6045
|
},
|
6041
6046
|
texts(e) {
|
6042
6047
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
6043
6048
|
return function* () {
|
6044
|
-
for (var [n, r] of
|
6049
|
+
for (var [n, r] of F.nodes(e, t))
|
6045
6050
|
W.isText(n) && (yield [n, r]);
|
6046
6051
|
}();
|
6047
6052
|
}
|
@@ -6076,7 +6081,7 @@ var ct = {
|
|
6076
6081
|
return !1;
|
6077
6082
|
switch (e.type) {
|
6078
6083
|
case "insert_node":
|
6079
|
-
return p.isPath(e.path) &&
|
6084
|
+
return p.isPath(e.path) && F.isNode(e.node);
|
6080
6085
|
case "insert_text":
|
6081
6086
|
return typeof e.offset == "number" && typeof e.text == "string" && p.isPath(e.path);
|
6082
6087
|
case "merge_node":
|
@@ -6084,13 +6089,13 @@ var ct = {
|
|
6084
6089
|
case "move_node":
|
6085
6090
|
return p.isPath(e.path) && p.isPath(e.newPath);
|
6086
6091
|
case "remove_node":
|
6087
|
-
return p.isPath(e.path) &&
|
6092
|
+
return p.isPath(e.path) && F.isNode(e.node);
|
6088
6093
|
case "remove_text":
|
6089
6094
|
return typeof e.offset == "number" && typeof e.text == "string" && p.isPath(e.path);
|
6090
6095
|
case "set_node":
|
6091
6096
|
return p.isPath(e.path) && oe(e.properties) && oe(e.newProperties);
|
6092
6097
|
case "set_selection":
|
6093
|
-
return e.properties === null &&
|
6098
|
+
return e.properties === null && M.isRange(e.newProperties) || e.newProperties === null && M.isRange(e.properties) || oe(e.properties) && oe(e.newProperties);
|
6094
6099
|
case "split_node":
|
6095
6100
|
return p.isPath(e.path) && typeof e.position == "number" && oe(e.properties);
|
6096
6101
|
default:
|
@@ -6186,7 +6191,7 @@ var ct = {
|
|
6186
6191
|
return t;
|
6187
6192
|
if (!oe(e))
|
6188
6193
|
return !1;
|
6189
|
-
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || oe(e.marks)) && (e.selection === null ||
|
6194
|
+
var n = typeof e.addMark == "function" && typeof e.apply == "function" && typeof e.deleteFragment == "function" && typeof e.insertBreak == "function" && typeof e.insertSoftBreak == "function" && typeof e.insertFragment == "function" && typeof e.insertNode == "function" && typeof e.insertText == "function" && typeof e.isElementReadOnly == "function" && typeof e.isInline == "function" && typeof e.isSelectable == "function" && typeof e.isVoid == "function" && typeof e.normalizeNode == "function" && typeof e.onChange == "function" && typeof e.removeMark == "function" && typeof e.getDirtyPaths == "function" && (e.marks === null || oe(e.marks)) && (e.selection === null || M.isRange(e.selection)) && F.isNodeList(e.children) && ct.isOperationList(e.operations);
|
6190
6195
|
return cr.set(e, n), n;
|
6191
6196
|
}, pe = {
|
6192
6197
|
above(e, t) {
|
@@ -6520,7 +6525,7 @@ var W = {
|
|
6520
6525
|
decorations(e, t) {
|
6521
6526
|
var n = [Pe({}, e)];
|
6522
6527
|
for (var r of t) {
|
6523
|
-
var a = ht(r, ri), [s, o] =
|
6528
|
+
var a = ht(r, ri), [s, o] = M.edges(r), i = [], c = 0, l = s.offset, u = o.offset;
|
6524
6529
|
for (var d of n) {
|
6525
6530
|
var {
|
6526
6531
|
length: _
|
@@ -6543,11 +6548,11 @@ var W = {
|
|
6543
6548
|
});
|
6544
6549
|
}
|
6545
6550
|
if (l > h) {
|
6546
|
-
var
|
6551
|
+
var E = l - h;
|
6547
6552
|
g = Pe(Pe({}, m), {}, {
|
6548
|
-
text: m.text.slice(0,
|
6553
|
+
text: m.text.slice(0, E)
|
6549
6554
|
}), m = Pe(Pe({}, m), {}, {
|
6550
|
-
text: m.text.slice(
|
6555
|
+
text: m.text.slice(E)
|
6551
6556
|
});
|
6552
6557
|
}
|
6553
6558
|
Object.assign(m, a), g && i.push(g), i.push(m), y && i.push(y);
|
@@ -6576,16 +6581,16 @@ var si = {
|
|
6576
6581
|
} = n, {
|
6577
6582
|
at: a = ai(e)
|
6578
6583
|
} = n;
|
6579
|
-
if (p.isPath(a) && (a = pe.range(e, a)),
|
6580
|
-
if (
|
6584
|
+
if (p.isPath(a) && (a = pe.range(e, a)), M.isRange(a))
|
6585
|
+
if (M.isCollapsed(a))
|
6581
6586
|
a = a.anchor;
|
6582
6587
|
else {
|
6583
|
-
var s =
|
6588
|
+
var s = M.end(a);
|
6584
6589
|
if (!r && pe.void(e, {
|
6585
6590
|
at: s
|
6586
6591
|
}))
|
6587
6592
|
return;
|
6588
|
-
var o =
|
6593
|
+
var o = M.start(a), i = pe.pointRef(e, o), c = pe.pointRef(e, s);
|
6589
6594
|
mr.delete(e, {
|
6590
6595
|
at: a,
|
6591
6596
|
voids: r
|