@qwanyx/stack 0.2.113 → 0.2.114
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.cjs.js +22 -22
- package/dist/index.esm.js +495 -470
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3648,10 +3648,10 @@ class Gd {
|
|
|
3648
3648
|
for (const p of c.messages)
|
|
3649
3649
|
p.uid && d.set(p.uid, p);
|
|
3650
3650
|
const h = a.map((p) => {
|
|
3651
|
-
var w, C,
|
|
3651
|
+
var w, C, k, S, v;
|
|
3652
3652
|
const g = d.get(p);
|
|
3653
3653
|
if (!g) return null;
|
|
3654
|
-
const m = ((w = g.flags) == null ? void 0 : w.some((D) => D.includes("Seen"))) || !1, y = ((
|
|
3654
|
+
const m = ((w = g.flags) == null ? void 0 : w.some((D) => D.includes("Seen"))) || !1, y = ((k = (C = g.envelope) == null ? void 0 : C.from) == null ? void 0 : k.email) || "Unknown", _ = ((S = g.envelope) == null ? void 0 : S.subject) || "(No subject)", x = ((v = g.envelope) == null ? void 0 : v.date) || "";
|
|
3655
3655
|
return { uid: p, from: y, subject: _, date: x, seen: m };
|
|
3656
3656
|
}).filter(Boolean);
|
|
3657
3657
|
return {
|
|
@@ -3720,13 +3720,13 @@ class Gd {
|
|
|
3720
3720
|
const c = /* @__PURE__ */ new Map();
|
|
3721
3721
|
for (const C of u.attachments || [])
|
|
3722
3722
|
if (C.contentId) {
|
|
3723
|
-
const
|
|
3724
|
-
c.set(v,
|
|
3723
|
+
const k = this.contentToBase64(C.content), S = `data:${C.mimeType};base64,${k}`, v = C.contentId.replace(/^<|>$/g, "");
|
|
3724
|
+
c.set(v, S), c.set(`<${v}>`, S);
|
|
3725
3725
|
}
|
|
3726
3726
|
let d = u.html || "";
|
|
3727
|
-
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (C,
|
|
3728
|
-
const
|
|
3729
|
-
return
|
|
3727
|
+
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (C, k) => {
|
|
3728
|
+
const S = c.get(k) || c.get(`<${k}>`);
|
|
3729
|
+
return S ? `src="${S}"` : C;
|
|
3730
3730
|
}));
|
|
3731
3731
|
const h = ((_ = o.flags) == null ? void 0 : _.some((C) => C.toLowerCase().includes("seen"))) || !1, p = ((x = u.from) == null ? void 0 : x.address) || ((w = u.from) == null ? void 0 : w.name) || "Unknown";
|
|
3732
3732
|
return {
|
|
@@ -4886,10 +4886,10 @@ function Jd() {
|
|
|
4886
4886
|
Ke.unshift("Warning: " + W), Function.prototype.apply.call(console[A], console, Ke);
|
|
4887
4887
|
}
|
|
4888
4888
|
}
|
|
4889
|
-
var C = !1,
|
|
4889
|
+
var C = !1, k = !1, S = !1, v = !1, D = !1, N;
|
|
4890
4890
|
N = Symbol.for("react.module.reference");
|
|
4891
4891
|
function B(A) {
|
|
4892
|
-
return !!(typeof A == "string" || typeof A == "function" || A === n || A === i || D || A === s || A === u || A === c || v || A === p || C ||
|
|
4892
|
+
return !!(typeof A == "string" || typeof A == "function" || A === n || A === i || D || A === s || A === u || A === c || v || A === p || C || k || S || typeof A == "object" && A !== null && (A.$$typeof === h || A.$$typeof === d || A.$$typeof === o || A.$$typeof === l || A.$$typeof === a || // This needs to include all possible module reference object
|
|
4893
4893
|
// types supported by any Flight configuration anywhere since
|
|
4894
4894
|
// we don't know which Flight build this will end up being used
|
|
4895
4895
|
// with.
|
|
@@ -5169,7 +5169,7 @@ function Jd() {
|
|
|
5169
5169
|
function et(A) {
|
|
5170
5170
|
return Ye(A);
|
|
5171
5171
|
}
|
|
5172
|
-
function
|
|
5172
|
+
function K(A) {
|
|
5173
5173
|
{
|
|
5174
5174
|
var W = typeof Symbol == "function" && Symbol.toStringTag, se = W && A[Symbol.toStringTag] || A.constructor.name || "Object";
|
|
5175
5175
|
return se;
|
|
@@ -5187,7 +5187,7 @@ function Jd() {
|
|
|
5187
5187
|
}
|
|
5188
5188
|
function Be(A) {
|
|
5189
5189
|
if (te(A))
|
|
5190
|
-
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
5190
|
+
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", K(A)), pe(A);
|
|
5191
5191
|
}
|
|
5192
5192
|
var Fe = _.ReactCurrentOwner, rt = {
|
|
5193
5193
|
key: !0,
|
|
@@ -5452,26 +5452,26 @@ process.env.NODE_ENV === "production" ? Zi.exports = Qd() : Zi.exports = Jd();
|
|
|
5452
5452
|
var f = Zi.exports;
|
|
5453
5453
|
const du = iu(void 0);
|
|
5454
5454
|
function T2({ apiUrl: r, systemId: e, children: t }) {
|
|
5455
|
-
const [n, s] = R(null), [i, o] = R(null), [l, a] = R(!1), [u, c] = R(!0), [d] = R(() => new uu({ apiUrl: r, systemId: e })), h = re(async (
|
|
5456
|
-
const
|
|
5457
|
-
a(
|
|
5455
|
+
const [n, s] = R(null), [i, o] = R(null), [l, a] = R(!1), [u, c] = R(!0), [d] = R(() => new uu({ apiUrl: r, systemId: e })), h = re(async (k) => {
|
|
5456
|
+
const S = await d.isAdmin(k);
|
|
5457
|
+
a(S);
|
|
5458
5458
|
}, [d]), p = re(() => {
|
|
5459
|
-
const
|
|
5460
|
-
|
|
5459
|
+
const k = nt.getToken(), S = nt.getUser();
|
|
5460
|
+
k && S ? (o(k), s(S), h(S._id).finally(() => c(!1))) : c(!1);
|
|
5461
5461
|
}, [h]);
|
|
5462
5462
|
Ce(() => {
|
|
5463
5463
|
p();
|
|
5464
5464
|
}, [p]);
|
|
5465
|
-
const g = re(async (
|
|
5466
|
-
const v = await d.login(
|
|
5465
|
+
const g = re(async (k, S) => {
|
|
5466
|
+
const v = await d.login(k, S);
|
|
5467
5467
|
return v.success && v.user && v.token && (o(v.token), s(v.user), await h(v.user._id)), v;
|
|
5468
|
-
}, [d, h]), m = re(async (
|
|
5469
|
-
const v = await d.verifyEmail(
|
|
5468
|
+
}, [d, h]), m = re(async (k, S, v) => d.register(k, S, v), [d]), y = re(async (k, S) => {
|
|
5469
|
+
const v = await d.verifyEmail(k, S);
|
|
5470
5470
|
return v.success && v.user && v.token && (o(v.token), s(v.user), await h(v.user._id)), v;
|
|
5471
|
-
}, [d, h]), _ = re(async (
|
|
5472
|
-
const D = await d.setPasswordWithCode(
|
|
5471
|
+
}, [d, h]), _ = re(async (k) => d.requestPasswordReset(k), [d]), x = re(async (k, S, v) => {
|
|
5472
|
+
const D = await d.setPasswordWithCode(k, S, v);
|
|
5473
5473
|
return D.success && D.user && D.token && (o(D.token), s(D.user), await h(D.user._id)), D;
|
|
5474
|
-
}, [d, h]), w = re(async (
|
|
5474
|
+
}, [d, h]), w = re(async (k) => d.resendVerificationCode(k), [d]), C = re(() => {
|
|
5475
5475
|
d.logout(), s(null), o(null), a(!1);
|
|
5476
5476
|
}, [d]);
|
|
5477
5477
|
return /* @__PURE__ */ f.jsx(du.Provider, { value: {
|
|
@@ -5524,11 +5524,11 @@ function fu({
|
|
|
5524
5524
|
className: p = "",
|
|
5525
5525
|
isModal: g = !1
|
|
5526
5526
|
}) {
|
|
5527
|
-
const [m, y] = R(""), [_, x] = R(""), [w, C] = R(""), [
|
|
5527
|
+
const [m, y] = R(""), [_, x] = R(""), [w, C] = R(""), [k, S] = R(!1), v = { ...Xd, ...h };
|
|
5528
5528
|
async function D(b) {
|
|
5529
|
-
b.preventDefault(),
|
|
5529
|
+
b.preventDefault(), S(!0), C("");
|
|
5530
5530
|
const E = await r(m, _);
|
|
5531
|
-
E.success ? e == null || e() : C(E.error || "Connexion impossible"),
|
|
5531
|
+
E.success ? e == null || e() : C(E.error || "Connexion impossible"), S(!1);
|
|
5532
5532
|
}
|
|
5533
5533
|
const N = {
|
|
5534
5534
|
backgroundColor: v.backgroundColor,
|
|
@@ -5557,13 +5557,13 @@ function fu({
|
|
|
5557
5557
|
}, j = {
|
|
5558
5558
|
width: "100%",
|
|
5559
5559
|
padding: "0.75rem",
|
|
5560
|
-
backgroundColor:
|
|
5560
|
+
backgroundColor: k ? v.textMutedColor : v.primaryColor,
|
|
5561
5561
|
color: "#ffffff",
|
|
5562
5562
|
border: "none",
|
|
5563
5563
|
borderRadius: v.borderRadius,
|
|
5564
5564
|
fontSize: "1rem",
|
|
5565
5565
|
fontWeight: 500,
|
|
5566
|
-
cursor:
|
|
5566
|
+
cursor: k ? "not-allowed" : "pointer",
|
|
5567
5567
|
transition: "background-color 0.2s"
|
|
5568
5568
|
}, M = {
|
|
5569
5569
|
padding: "0.75rem",
|
|
@@ -5625,15 +5625,15 @@ function fu({
|
|
|
5625
5625
|
"button",
|
|
5626
5626
|
{
|
|
5627
5627
|
type: "submit",
|
|
5628
|
-
disabled:
|
|
5628
|
+
disabled: k,
|
|
5629
5629
|
style: j,
|
|
5630
5630
|
onMouseEnter: (b) => {
|
|
5631
|
-
|
|
5631
|
+
k || (b.target.style.backgroundColor = v.primaryHoverColor);
|
|
5632
5632
|
},
|
|
5633
5633
|
onMouseLeave: (b) => {
|
|
5634
|
-
|
|
5634
|
+
k || (b.target.style.backgroundColor = v.primaryColor);
|
|
5635
5635
|
},
|
|
5636
|
-
children:
|
|
5636
|
+
children: k ? i : s
|
|
5637
5637
|
}
|
|
5638
5638
|
),
|
|
5639
5639
|
(a || u) && /* @__PURE__ */ f.jsxs("div", { style: {
|
|
@@ -5779,9 +5779,9 @@ function ef({
|
|
|
5779
5779
|
className: m = "",
|
|
5780
5780
|
isModal: y = !1
|
|
5781
5781
|
}) {
|
|
5782
|
-
const [_, x] = R(""), [w, C] = R(""), [
|
|
5782
|
+
const [_, x] = R(""), [w, C] = R(""), [k, S] = R(""), [v, D] = R(""), [N, B] = R(""), [T, j] = R(""), [M, b] = R(!1), E = { ...Zd, ...g };
|
|
5783
5783
|
async function F(V) {
|
|
5784
|
-
if (V.preventDefault(), j(""), w !==
|
|
5784
|
+
if (V.preventDefault(), j(""), w !== k) {
|
|
5785
5785
|
j("Les mots de passe ne correspondent pas");
|
|
5786
5786
|
return;
|
|
5787
5787
|
}
|
|
@@ -5911,8 +5911,8 @@ function ef({
|
|
|
5911
5911
|
"input",
|
|
5912
5912
|
{
|
|
5913
5913
|
type: "password",
|
|
5914
|
-
value:
|
|
5915
|
-
onChange: (V) =>
|
|
5914
|
+
value: k,
|
|
5915
|
+
onChange: (V) => S(V.target.value),
|
|
5916
5916
|
required: !0,
|
|
5917
5917
|
style: q
|
|
5918
5918
|
}
|
|
@@ -5968,7 +5968,7 @@ function Da({
|
|
|
5968
5968
|
className: g = "",
|
|
5969
5969
|
isModal: m = !1
|
|
5970
5970
|
}) {
|
|
5971
|
-
const [y, _] = R(Array(h).fill("")), [x, w] = R(""), [C,
|
|
5971
|
+
const [y, _] = R(Array(h).fill("")), [x, w] = R(""), [C, k] = R(!1), [S, v] = R(!1), [D, N] = R(!1), B = we([]), T = { ...tf, ...p };
|
|
5972
5972
|
Ce(() => {
|
|
5973
5973
|
var U;
|
|
5974
5974
|
(U = B.current[0]) == null || U.focus();
|
|
@@ -6000,9 +6000,9 @@ function Da({
|
|
|
6000
6000
|
w("Veuillez entrer le code complet");
|
|
6001
6001
|
return;
|
|
6002
6002
|
}
|
|
6003
|
-
|
|
6003
|
+
k(!0), w("");
|
|
6004
6004
|
const V = await e(r, H);
|
|
6005
|
-
V.success ? t == null || t() : (w(V.error || "Code invalide"), _(Array(h).fill("")), (ie = B.current[0]) == null || ie.focus()),
|
|
6005
|
+
V.success ? t == null || t() : (w(V.error || "Code invalide"), _(Array(h).fill("")), (ie = B.current[0]) == null || ie.focus()), k(!1);
|
|
6006
6006
|
}
|
|
6007
6007
|
async function F() {
|
|
6008
6008
|
if (!n) return;
|
|
@@ -6129,12 +6129,12 @@ function Da({
|
|
|
6129
6129
|
{
|
|
6130
6130
|
type: "button",
|
|
6131
6131
|
onClick: F,
|
|
6132
|
-
disabled:
|
|
6132
|
+
disabled: S,
|
|
6133
6133
|
style: {
|
|
6134
6134
|
...ne,
|
|
6135
|
-
opacity:
|
|
6135
|
+
opacity: S ? 0.5 : 1
|
|
6136
6136
|
},
|
|
6137
|
-
children:
|
|
6137
|
+
children: S ? c : u
|
|
6138
6138
|
}
|
|
6139
6139
|
) }),
|
|
6140
6140
|
s && /* @__PURE__ */ f.jsx("p", { style: { textAlign: "center", marginTop: "0.75rem", marginBottom: 0 }, children: /* @__PURE__ */ f.jsx("button", { type: "button", onClick: s, style: ne, children: d }) })
|
|
@@ -6183,7 +6183,7 @@ function nf({
|
|
|
6183
6183
|
...d && {
|
|
6184
6184
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
|
|
6185
6185
|
}
|
|
6186
|
-
},
|
|
6186
|
+
}, k = {
|
|
6187
6187
|
width: "100%",
|
|
6188
6188
|
padding: "0.5rem 1rem",
|
|
6189
6189
|
border: `1px solid ${x.borderColor}`,
|
|
@@ -6193,7 +6193,7 @@ function nf({
|
|
|
6193
6193
|
fontSize: "1rem",
|
|
6194
6194
|
outline: "none",
|
|
6195
6195
|
boxSizing: "border-box"
|
|
6196
|
-
},
|
|
6196
|
+
}, S = {
|
|
6197
6197
|
display: "block",
|
|
6198
6198
|
fontSize: "0.875rem",
|
|
6199
6199
|
fontWeight: 500,
|
|
@@ -6242,7 +6242,7 @@ function nf({
|
|
|
6242
6242
|
marginBottom: "1rem"
|
|
6243
6243
|
}, children: /* @__PURE__ */ f.jsx("p", { style: { fontSize: "0.875rem", color: x.errorColor, margin: 0 }, children: g }) }),
|
|
6244
6244
|
/* @__PURE__ */ f.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
6245
|
-
/* @__PURE__ */ f.jsx("label", { style:
|
|
6245
|
+
/* @__PURE__ */ f.jsx("label", { style: S, children: l }),
|
|
6246
6246
|
/* @__PURE__ */ f.jsx(
|
|
6247
6247
|
"input",
|
|
6248
6248
|
{
|
|
@@ -6250,7 +6250,7 @@ function nf({
|
|
|
6250
6250
|
value: h,
|
|
6251
6251
|
onChange: (N) => p(N.target.value),
|
|
6252
6252
|
required: !0,
|
|
6253
|
-
style:
|
|
6253
|
+
style: k
|
|
6254
6254
|
}
|
|
6255
6255
|
)
|
|
6256
6256
|
] }),
|
|
@@ -6302,7 +6302,7 @@ function of({
|
|
|
6302
6302
|
className: p = "",
|
|
6303
6303
|
isModal: g = !1
|
|
6304
6304
|
}) {
|
|
6305
|
-
const [m, y] = R(""), [_, x] = R(""), [w, C] = R(""), [
|
|
6305
|
+
const [m, y] = R(""), [_, x] = R(""), [w, C] = R(""), [k, S] = R(!1), v = { ...sf, ...h };
|
|
6306
6306
|
async function D(b) {
|
|
6307
6307
|
if (b.preventDefault(), C(""), m !== _) {
|
|
6308
6308
|
C("Les mots de passe ne correspondent pas");
|
|
@@ -6312,9 +6312,9 @@ function of({
|
|
|
6312
6312
|
C("Le mot de passe doit contenir au moins 8 caractères");
|
|
6313
6313
|
return;
|
|
6314
6314
|
}
|
|
6315
|
-
|
|
6315
|
+
S(!0);
|
|
6316
6316
|
const E = await t(r, e, m);
|
|
6317
|
-
E.success ? n == null || n() : C(E.error || "Erreur lors de la réinitialisation"),
|
|
6317
|
+
E.success ? n == null || n() : C(E.error || "Erreur lors de la réinitialisation"), S(!1);
|
|
6318
6318
|
}
|
|
6319
6319
|
const N = {
|
|
6320
6320
|
backgroundColor: v.backgroundColor,
|
|
@@ -6344,13 +6344,13 @@ function of({
|
|
|
6344
6344
|
}, j = {
|
|
6345
6345
|
width: "100%",
|
|
6346
6346
|
padding: "0.75rem",
|
|
6347
|
-
backgroundColor:
|
|
6347
|
+
backgroundColor: k ? v.textMutedColor : v.primaryColor,
|
|
6348
6348
|
color: "#ffffff",
|
|
6349
6349
|
border: "none",
|
|
6350
6350
|
borderRadius: v.borderRadius,
|
|
6351
6351
|
fontSize: "1rem",
|
|
6352
6352
|
fontWeight: 500,
|
|
6353
|
-
cursor:
|
|
6353
|
+
cursor: k ? "not-allowed" : "pointer",
|
|
6354
6354
|
transition: "background-color 0.2s"
|
|
6355
6355
|
}, M = {
|
|
6356
6356
|
color: v.primaryColor,
|
|
@@ -6414,15 +6414,15 @@ function of({
|
|
|
6414
6414
|
"button",
|
|
6415
6415
|
{
|
|
6416
6416
|
type: "submit",
|
|
6417
|
-
disabled:
|
|
6417
|
+
disabled: k,
|
|
6418
6418
|
style: j,
|
|
6419
6419
|
onMouseEnter: (b) => {
|
|
6420
|
-
|
|
6420
|
+
k || (b.target.style.backgroundColor = v.primaryHoverColor);
|
|
6421
6421
|
},
|
|
6422
6422
|
onMouseLeave: (b) => {
|
|
6423
|
-
|
|
6423
|
+
k || (b.target.style.backgroundColor = v.primaryColor);
|
|
6424
6424
|
},
|
|
6425
|
-
children:
|
|
6425
|
+
children: k ? a : l
|
|
6426
6426
|
}
|
|
6427
6427
|
),
|
|
6428
6428
|
s && /* @__PURE__ */ f.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ f.jsx("button", { type: "button", onClick: s, style: M, children: d }) })
|
|
@@ -6450,11 +6450,11 @@ function af({
|
|
|
6450
6450
|
const T = await r(N, B);
|
|
6451
6451
|
return T.requiresVerification ? (_(N), m("verify-email"), { success: !1, error: "Veuillez vérifier votre email" }) : T;
|
|
6452
6452
|
}
|
|
6453
|
-
async function
|
|
6453
|
+
async function k(N, B, T) {
|
|
6454
6454
|
const j = await e(N, B, T);
|
|
6455
6455
|
return j.success && (j.requiresVerification ? (_(N), m("verify-email")) : o == null || o()), j;
|
|
6456
6456
|
}
|
|
6457
|
-
async function
|
|
6457
|
+
async function S(N) {
|
|
6458
6458
|
const B = await n(N);
|
|
6459
6459
|
return B.success && (_(N), m("verify-reset-code")), B;
|
|
6460
6460
|
}
|
|
@@ -6482,7 +6482,7 @@ function af({
|
|
|
6482
6482
|
return /* @__PURE__ */ f.jsx(
|
|
6483
6483
|
ef,
|
|
6484
6484
|
{
|
|
6485
|
-
onRegister:
|
|
6485
|
+
onRegister: k,
|
|
6486
6486
|
onSuccess: () => {
|
|
6487
6487
|
},
|
|
6488
6488
|
onLoginClick: () => m("login"),
|
|
@@ -6513,7 +6513,7 @@ function af({
|
|
|
6513
6513
|
return /* @__PURE__ */ f.jsx(
|
|
6514
6514
|
nf,
|
|
6515
6515
|
{
|
|
6516
|
-
onRequestReset:
|
|
6516
|
+
onRequestReset: S,
|
|
6517
6517
|
onBackClick: () => m("login"),
|
|
6518
6518
|
title: p.forgotPasswordTitle,
|
|
6519
6519
|
theme: u,
|
|
@@ -6798,16 +6798,16 @@ function F2({
|
|
|
6798
6798
|
onRefresh: p,
|
|
6799
6799
|
theme: g = {}
|
|
6800
6800
|
}) {
|
|
6801
|
-
const { data: m, loading: y, error: _, refetch: x } = lf(r, e), [w, C] = R(""), [
|
|
6801
|
+
const { data: m, loading: y, error: _, refetch: x } = lf(r, e), [w, C] = R(""), [k, S] = R({}), [v, D] = R(1), N = dt(() => {
|
|
6802
6802
|
if (!m) return { data: [], total: 0, totalPages: 0 };
|
|
6803
6803
|
let b = m;
|
|
6804
|
-
return l && w && a.length > 0 && (b = Pi.search(b, w, a)), Object.keys(
|
|
6805
|
-
}, [m, w,
|
|
6804
|
+
return l && w && a.length > 0 && (b = Pi.search(b, w, a)), Object.keys(k).length > 0 && (b = Pi.filterByFields(b, k)), Pi.paginate(b, v, d);
|
|
6805
|
+
}, [m, w, k, v, d, l, a]);
|
|
6806
6806
|
Ce(() => {
|
|
6807
6807
|
D(1);
|
|
6808
|
-
}, [w,
|
|
6808
|
+
}, [w, k]);
|
|
6809
6809
|
const B = () => {
|
|
6810
|
-
C(""),
|
|
6810
|
+
C(""), S({}), D(1), x(), p == null || p();
|
|
6811
6811
|
}, T = {
|
|
6812
6812
|
background: g.background || "#ffffff",
|
|
6813
6813
|
cardBackground: g.cardBackground || "#f9fafb",
|
|
@@ -7121,7 +7121,7 @@ function P2({
|
|
|
7121
7121
|
};
|
|
7122
7122
|
return window.addEventListener("resize", j), j(), () => window.removeEventListener("resize", j);
|
|
7123
7123
|
}, [s]);
|
|
7124
|
-
const [c, d] = R(0), [h, p] = R(0), [g, m] = R(!1), [y, _] = R(!1), [x, w] = R(!1), [C,
|
|
7124
|
+
const [c, d] = R(0), [h, p] = R(0), [g, m] = R(!1), [y, _] = R(!1), [x, w] = R(!1), [C, k] = R(!1);
|
|
7125
7125
|
Ce(() => {
|
|
7126
7126
|
if (l[0].length <= 1) return;
|
|
7127
7127
|
const j = setInterval(() => {
|
|
@@ -7136,7 +7136,7 @@ function P2({
|
|
|
7136
7136
|
const M = setTimeout(() => {
|
|
7137
7137
|
j = setInterval(() => {
|
|
7138
7138
|
_((b) => !b), setTimeout(() => {
|
|
7139
|
-
p((b) => (b + 1) % l[1].length),
|
|
7139
|
+
p((b) => (b + 1) % l[1].length), k((b) => !b);
|
|
7140
7140
|
}, 250);
|
|
7141
7141
|
}, e + Math.random() * (t - e));
|
|
7142
7142
|
}, 500);
|
|
@@ -7144,8 +7144,8 @@ function P2({
|
|
|
7144
7144
|
clearTimeout(M), j && clearInterval(j);
|
|
7145
7145
|
};
|
|
7146
7146
|
}, [l, e, t]);
|
|
7147
|
-
const
|
|
7148
|
-
if (r.length === 0 || !
|
|
7147
|
+
const S = (B = l[0]) == null ? void 0 : B[c], v = (T = l[1]) == null ? void 0 : T[h];
|
|
7148
|
+
if (r.length === 0 || !S)
|
|
7149
7149
|
return /* @__PURE__ */ f.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ f.jsx("p", { className: "text-gray-500", children: "No images available" }) });
|
|
7150
7150
|
const D = i === "2:3" ? a * 1.5 : a, N = (j, M, b) => /* @__PURE__ */ f.jsx(
|
|
7151
7151
|
"div",
|
|
@@ -7184,7 +7184,7 @@ function P2({
|
|
|
7184
7184
|
}
|
|
7185
7185
|
);
|
|
7186
7186
|
return /* @__PURE__ */ f.jsxs("div", { className: `flex gap-4 justify-center items-center ${o}`, children: [
|
|
7187
|
-
N(
|
|
7187
|
+
N(S, g, x),
|
|
7188
7188
|
v && N(v, y, C)
|
|
7189
7189
|
] });
|
|
7190
7190
|
}
|
|
@@ -7242,10 +7242,10 @@ function I2({
|
|
|
7242
7242
|
renderDetail: x,
|
|
7243
7243
|
renderActions: w,
|
|
7244
7244
|
renderEmpty: C,
|
|
7245
|
-
renderLoading:
|
|
7246
|
-
theme:
|
|
7245
|
+
renderLoading: k,
|
|
7246
|
+
theme: S = {}
|
|
7247
7247
|
}) {
|
|
7248
|
-
const v = { ...cf, ...
|
|
7248
|
+
const v = { ...cf, ...S }, [D, N] = R([]), [B, T] = R(!1), [j, M] = R(null), [b, E] = R(/* @__PURE__ */ new Set()), [F, P] = R(null), [q, Z] = R(null), [ne, U] = R(null), [H, V] = R(!1), [ie, ce] = R(""), de = a !== void 0 ? a : ie, ye = (le) => {
|
|
7249
7249
|
u ? u(le) : ce(le);
|
|
7250
7250
|
}, ve = dt(() => {
|
|
7251
7251
|
if (!de.trim()) return D;
|
|
@@ -7486,7 +7486,7 @@ function I2({
|
|
|
7486
7486
|
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
7487
7487
|
}
|
|
7488
7488
|
)
|
|
7489
|
-
] }),
|
|
7489
|
+
] }), K = () => /* @__PURE__ */ f.jsx("div", { style: {
|
|
7490
7490
|
padding: "48px",
|
|
7491
7491
|
textAlign: "center",
|
|
7492
7492
|
color: v.textSecondary
|
|
@@ -7494,7 +7494,7 @@ function I2({
|
|
|
7494
7494
|
padding: "48px",
|
|
7495
7495
|
textAlign: "center",
|
|
7496
7496
|
color: v.textSecondary
|
|
7497
|
-
}, children: "Loading..." }), pe = _ || I, Be = x || Ye, Fe = w || et, rt = C ||
|
|
7497
|
+
}, children: "Loading..." }), pe = _ || I, Be = x || Ye, Fe = w || et, rt = C || K, St = k || te;
|
|
7498
7498
|
return B && D.length === 0 ? /* @__PURE__ */ f.jsx("div", { style: { background: v.background, width: "100%", height: "100%" }, children: St() }) : /* @__PURE__ */ f.jsxs("div", { style: { display: "flex", background: v.background, width: "100%", height: "100%" }, children: [
|
|
7499
7499
|
/* @__PURE__ */ f.jsxs("div", { style: {
|
|
7500
7500
|
flex: o && q ? "0 0 50%" : "1",
|
|
@@ -7586,16 +7586,16 @@ function z2({
|
|
|
7586
7586
|
className: a = ""
|
|
7587
7587
|
}) {
|
|
7588
7588
|
const [u, c] = R(/* @__PURE__ */ new Set()), [d, h] = R(-1), p = r.filter((C) => u.has(C.id)), g = d >= 0 && d < p.length ? p[d] : null, m = re((C) => {
|
|
7589
|
-
c((
|
|
7590
|
-
const
|
|
7591
|
-
return
|
|
7589
|
+
c((k) => {
|
|
7590
|
+
const S = new Set(k);
|
|
7591
|
+
return S.has(C) ? S.delete(C) : S.add(C), t == null || t(Array.from(S)), S;
|
|
7592
7592
|
});
|
|
7593
7593
|
}, [t]), y = re(() => {
|
|
7594
7594
|
if (u.size === r.length)
|
|
7595
7595
|
c(/* @__PURE__ */ new Set()), h(-1), t == null || t([]);
|
|
7596
7596
|
else {
|
|
7597
|
-
const C = new Set(r.map((
|
|
7598
|
-
c(C), r.length > 0 && (h(0), n == null || n(r[0], 0)), t == null || t(r.map((
|
|
7597
|
+
const C = new Set(r.map((k) => k.id));
|
|
7598
|
+
c(C), r.length > 0 && (h(0), n == null || n(r[0], 0)), t == null || t(r.map((k) => k.id));
|
|
7599
7599
|
}
|
|
7600
7600
|
}, [r, u.size, t, n]), _ = re(() => {
|
|
7601
7601
|
if (p.length === 0) return;
|
|
@@ -7657,29 +7657,29 @@ function z2({
|
|
|
7657
7657
|
] })
|
|
7658
7658
|
] }),
|
|
7659
7659
|
/* @__PURE__ */ f.jsx("div", { className: "space-y-1", children: r.map((C) => {
|
|
7660
|
-
const
|
|
7660
|
+
const k = u.has(C.id), S = (g == null ? void 0 : g.id) === C.id;
|
|
7661
7661
|
return /* @__PURE__ */ f.jsxs(
|
|
7662
7662
|
"div",
|
|
7663
7663
|
{
|
|
7664
|
-
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${
|
|
7664
|
+
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${S ? "bg-blue-50 ring-1 ring-blue-200" : k ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
|
|
7665
7665
|
onClick: () => m(C.id),
|
|
7666
7666
|
children: [
|
|
7667
|
-
/* @__PURE__ */ f.jsx("span", { className: `material-icons text-lg ${
|
|
7668
|
-
/* @__PURE__ */ f.jsx("div", { className: "flex-1 min-w-0", children: e(C,
|
|
7667
|
+
/* @__PURE__ */ f.jsx("span", { className: `material-icons text-lg ${k ? "text-blue-500" : "text-neutral-300"}`, children: k ? "check_box" : "check_box_outline_blank" }),
|
|
7668
|
+
/* @__PURE__ */ f.jsx("div", { className: "flex-1 min-w-0", children: e(C, k, S) })
|
|
7669
7669
|
]
|
|
7670
7670
|
},
|
|
7671
7671
|
C.id
|
|
7672
7672
|
);
|
|
7673
7673
|
}) }),
|
|
7674
7674
|
i.length > 0 && u.size > 0 && /* @__PURE__ */ f.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: i.map((C) => {
|
|
7675
|
-
var
|
|
7676
|
-
const
|
|
7675
|
+
var S;
|
|
7676
|
+
const k = ((S = C.disabled) == null ? void 0 : S.call(C, p)) ?? !1;
|
|
7677
7677
|
return /* @__PURE__ */ f.jsxs(
|
|
7678
7678
|
"button",
|
|
7679
7679
|
{
|
|
7680
7680
|
onClick: () => w(C.id),
|
|
7681
|
-
disabled:
|
|
7682
|
-
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${
|
|
7681
|
+
disabled: k,
|
|
7682
|
+
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${k ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
|
|
7683
7683
|
children: [
|
|
7684
7684
|
C.icon && /* @__PURE__ */ f.jsx("span", { className: "material-icons text-sm", children: C.icon }),
|
|
7685
7685
|
C.label
|
|
@@ -7746,7 +7746,7 @@ function Vf(r, e, t) {
|
|
|
7746
7746
|
o !== null && Xo(e, o, s, i, !1);
|
|
7747
7747
|
}
|
|
7748
7748
|
function Gf(r, e, t) {
|
|
7749
|
-
if (
|
|
7749
|
+
if (Y(r)) {
|
|
7750
7750
|
const n = r.anchor.getNode();
|
|
7751
7751
|
if (n.is(t) && r.format !== n.getFormat()) return !1;
|
|
7752
7752
|
}
|
|
@@ -7781,8 +7781,8 @@ function Tu(r, e, t) {
|
|
|
7781
7781
|
else if (g === "childList") {
|
|
7782
7782
|
u = !0;
|
|
7783
7783
|
const w = p.addedNodes;
|
|
7784
|
-
for (let
|
|
7785
|
-
const v = w[
|
|
7784
|
+
for (let S = 0; S < w.length; S++) {
|
|
7785
|
+
const v = w[S], D = Ru(v), N = v.parentNode;
|
|
7786
7786
|
if (N != null && v !== a && D === null && !Ii(v, N, r)) {
|
|
7787
7787
|
if (_r) {
|
|
7788
7788
|
const B = v.innerText || v.nodeValue;
|
|
@@ -7791,14 +7791,14 @@ function Tu(r, e, t) {
|
|
|
7791
7791
|
N.removeChild(v);
|
|
7792
7792
|
}
|
|
7793
7793
|
}
|
|
7794
|
-
const C = p.removedNodes,
|
|
7795
|
-
if (
|
|
7796
|
-
let
|
|
7797
|
-
for (let v = 0; v <
|
|
7794
|
+
const C = p.removedNodes, k = C.length;
|
|
7795
|
+
if (k > 0) {
|
|
7796
|
+
let S = 0;
|
|
7797
|
+
for (let v = 0; v < k; v++) {
|
|
7798
7798
|
const D = C[v];
|
|
7799
|
-
(Ii(D, m, r) || a === D) && (m.appendChild(D),
|
|
7799
|
+
(Ii(D, m, r) || a === D) && (m.appendChild(D), S++);
|
|
7800
7800
|
}
|
|
7801
|
-
|
|
7801
|
+
k !== S && i.set(_, x);
|
|
7802
7802
|
}
|
|
7803
7803
|
}
|
|
7804
7804
|
}
|
|
@@ -8110,9 +8110,9 @@ function Xo(r, e, t, n, s) {
|
|
|
8110
8110
|
return;
|
|
8111
8111
|
}
|
|
8112
8112
|
const u = i.getParent(), c = ss(), d = i.getTextContentSize(), h = xr(), p = i.getKey();
|
|
8113
|
-
if (i.isToken() || h !== null && p === h && !o ||
|
|
8113
|
+
if (i.isToken() || h !== null && p === h && !o || Y(c) && (u !== null && !u.canInsertTextBefore() && c.anchor.offset === 0 || c.anchor.key === r.__key && c.anchor.offset === 0 && !i.canInsertTextBefore() && !o || c.focus.key === r.__key && c.focus.offset === d && !i.canInsertTextAfter() && !o)) return void i.markDirty();
|
|
8114
8114
|
const g = ue();
|
|
8115
|
-
if (!
|
|
8115
|
+
if (!Y(g) || t === null || n === null) return void i.setTextContent(l);
|
|
8116
8116
|
if (g.setTextNodeRange(i, t, i, n), i.isSegmented()) {
|
|
8117
8117
|
const m = ht(i.getTextContent());
|
|
8118
8118
|
i.replace(m), i = m;
|
|
@@ -8258,7 +8258,7 @@ function ea(r, e, t) {
|
|
|
8258
8258
|
}
|
|
8259
8259
|
function rh(r, e, t) {
|
|
8260
8260
|
let n = r._blockCursorElement;
|
|
8261
|
-
if (
|
|
8261
|
+
if (Y(t) && t.isCollapsed() && t.anchor.type === "element" && e.contains(document.activeElement)) {
|
|
8262
8262
|
const s = t.anchor, i = s.getNode(), o = s.offset;
|
|
8263
8263
|
let l = !1, a = null;
|
|
8264
8264
|
if (o === i.getChildrenSize())
|
|
@@ -8514,14 +8514,14 @@ function uh(r, e, t) {
|
|
|
8514
8514
|
ao(h, 0, u - 1, g ? null : d), g && (d.textContent = "");
|
|
8515
8515
|
}
|
|
8516
8516
|
} else (function(g, m, y, _, x, w) {
|
|
8517
|
-
const C = _ - 1,
|
|
8518
|
-
let
|
|
8519
|
-
for (; N <= C && B <=
|
|
8517
|
+
const C = _ - 1, k = x - 1;
|
|
8518
|
+
let S, v, D = w.getFirstChild(), N = 0, B = 0;
|
|
8519
|
+
for (; N <= C && B <= k; ) {
|
|
8520
8520
|
const M = m[N], b = y[B];
|
|
8521
8521
|
if (M === b) D = $i(En(b, w.element)), N++, B++;
|
|
8522
8522
|
else {
|
|
8523
|
-
|
|
8524
|
-
const F = v.has(M), P =
|
|
8523
|
+
S === void 0 && (S = new Set(m)), v === void 0 && (v = new Set(y));
|
|
8524
|
+
const F = v.has(M), P = S.has(b);
|
|
8525
8525
|
if (F) if (P) {
|
|
8526
8526
|
const q = Us(Ct, b);
|
|
8527
8527
|
q === D ? D = $i(En(b, w.element)) : (w.withBefore(D).insertChild(q), En(b, w.element)), N++, B++;
|
|
@@ -8531,10 +8531,10 @@ function uh(r, e, t) {
|
|
|
8531
8531
|
const E = Ht.get(b);
|
|
8532
8532
|
E !== null && ee(E) && (Yt === null && (Yt = E.getFormat()), Ot === "" && (Ot = E.getStyle()));
|
|
8533
8533
|
}
|
|
8534
|
-
const T = N > C, j = B >
|
|
8534
|
+
const T = N > C, j = B > k;
|
|
8535
8535
|
if (T && !j) {
|
|
8536
|
-
const M = y[
|
|
8537
|
-
lo(y, g, B,
|
|
8536
|
+
const M = y[k + 1], b = M === void 0 ? null : Ct.getElementByKey(M);
|
|
8537
|
+
lo(y, g, B, k, w.withBefore(b));
|
|
8538
8538
|
} else j && !T && ao(m, N, C, w.element);
|
|
8539
8539
|
})(o, h, p, u, c, l);
|
|
8540
8540
|
}
|
|
@@ -8693,7 +8693,7 @@ const ir = Object.freeze({}), co = 30, fo = [["keydown", function(r, e) {
|
|
|
8693
8693
|
}(t, n, i, s)) r.preventDefault(), ae(e, Po, void 0);
|
|
8694
8694
|
else {
|
|
8695
8695
|
const l = e._editorState._selection;
|
|
8696
|
-
l === null ||
|
|
8696
|
+
l === null || Y(l) ? !_r && Oa(t, i, s) && (r.preventDefault(), ae(e, to, r)) : function(a, u, c, d) {
|
|
8697
8697
|
return !u && a.toLowerCase() === "c" && (zt ? c : d);
|
|
8698
8698
|
}(t, n, i, s) ? (r.preventDefault(), ae(e, di, r)) : function(a, u, c, d) {
|
|
8699
8699
|
return !u && a.toLowerCase() === "x" && (zt ? c : d);
|
|
@@ -8711,7 +8711,7 @@ const ir = Object.freeze({}), co = 30, fo = [["keydown", function(r, e) {
|
|
|
8711
8711
|
}], ["compositionstart", function(r, e) {
|
|
8712
8712
|
jt(e, () => {
|
|
8713
8713
|
const t = ue();
|
|
8714
|
-
if (
|
|
8714
|
+
if (Y(t) && !e.isComposing()) {
|
|
8715
8715
|
const n = t.anchor, s = t.anchor.getNode();
|
|
8716
8716
|
yt(n.key), (r.timeStamp < Rn + co || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || ee(s) && s.getStyle() !== t.style) && ae(e, en, Lf);
|
|
8717
8717
|
}
|
|
@@ -8723,7 +8723,7 @@ const ir = Object.freeze({}), co = 30, fo = [["keydown", function(r, e) {
|
|
|
8723
8723
|
}], ["input", function(r, e) {
|
|
8724
8724
|
r.stopPropagation(), jt(e, () => {
|
|
8725
8725
|
const t = ue(), n = r.data, s = Zu(r);
|
|
8726
|
-
if (n != null &&
|
|
8726
|
+
if (n != null && Y(t) && Xu(t, s, n, r.timeStamp, !1)) {
|
|
8727
8727
|
vn && (qi(e, n), vn = !1);
|
|
8728
8728
|
const i = t.anchor.getNode(), o = Lt(e._window);
|
|
8729
8729
|
if (o === null) return;
|
|
@@ -8739,7 +8739,7 @@ const ir = Object.freeze({}), co = 30, fo = [["keydown", function(r, e) {
|
|
|
8739
8739
|
jt(e, () => {
|
|
8740
8740
|
const t = ue(), n = Lt(e._window), s = ss();
|
|
8741
8741
|
if (n) {
|
|
8742
|
-
if (
|
|
8742
|
+
if (Y(t)) {
|
|
8743
8743
|
const i = t.anchor, o = i.getNode();
|
|
8744
8744
|
i.type === "element" && i.offset === 0 && t.isCollapsed() && !wt(o) && st().getChildrenSize() === 1 && o.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (n.removeAllRanges(), t.dirty = !0) : r.detail === 3 && !t.isCollapsed() && o !== t.focus.getNode() && (O(o) ? o.select(0) : o.getParentOrThrow().select(0));
|
|
8745
8745
|
} else if (r.pointerType === "touch") {
|
|
@@ -8760,17 +8760,17 @@ Ls && fo.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
8760
8760
|
if (s === "deleteContentBackward") {
|
|
8761
8761
|
if (o === null) {
|
|
8762
8762
|
const p = ss();
|
|
8763
|
-
if (!
|
|
8763
|
+
if (!Y(p)) return;
|
|
8764
8764
|
er(p.clone());
|
|
8765
8765
|
}
|
|
8766
|
-
if (
|
|
8766
|
+
if (Y(o)) {
|
|
8767
8767
|
const p = o.anchor.key === o.focus.key;
|
|
8768
8768
|
if (l = t.timeStamp, Yu === "MediaLast" && l < Rn + co && n.isComposing() && p) {
|
|
8769
8769
|
if (yt(null), Rn = 0, setTimeout(() => {
|
|
8770
8770
|
jt(n, () => {
|
|
8771
8771
|
yt(null);
|
|
8772
8772
|
});
|
|
8773
|
-
}, co),
|
|
8773
|
+
}, co), Y(o)) {
|
|
8774
8774
|
const g = o.anchor.getNode();
|
|
8775
8775
|
g.markDirty(), o.format = g.getFormat(), ee(g) || J(142), o.style = g.getStyle();
|
|
8776
8776
|
}
|
|
@@ -8783,7 +8783,7 @@ Ls && fo.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
8783
8783
|
}
|
|
8784
8784
|
}
|
|
8785
8785
|
var l;
|
|
8786
|
-
if (!
|
|
8786
|
+
if (!Y(o)) return;
|
|
8787
8787
|
const a = t.data;
|
|
8788
8788
|
Yr !== null && Jo(!1, n, Yr), o.dirty && Yr === null || !o.isCollapsed() || wt(o.anchor.getNode()) || i === null || o.applyDOMRange(i), Yr = null;
|
|
8789
8789
|
const u = o.anchor, c = o.focus, d = u.getNode(), h = c.getNode();
|
|
@@ -8879,7 +8879,7 @@ function Va(r, e, t) {
|
|
|
8879
8879
|
if (!t) return void er(null);
|
|
8880
8880
|
if (!Zn(e, n, i)) return;
|
|
8881
8881
|
const l = ue();
|
|
8882
|
-
if (
|
|
8882
|
+
if (Y(l)) {
|
|
8883
8883
|
const a = l.anchor, u = a.getNode();
|
|
8884
8884
|
if (l.isCollapsed()) {
|
|
8885
8885
|
r.type === "Range" && r.anchorNode === r.focusNode && (l.dirty = !0);
|
|
@@ -8893,9 +8893,9 @@ function Va(r, e, t) {
|
|
|
8893
8893
|
} else {
|
|
8894
8894
|
const c = a.key, d = l.focus.key, h = l.getNodes(), p = h.length, g = l.isBackward(), m = g ? o : s, y = g ? s : o, _ = g ? d : c, x = g ? c : d;
|
|
8895
8895
|
let w = Rf, C = !1;
|
|
8896
|
-
for (let
|
|
8897
|
-
const
|
|
8898
|
-
if (ee(
|
|
8896
|
+
for (let k = 0; k < p; k++) {
|
|
8897
|
+
const S = h[k], v = S.getTextContentSize();
|
|
8898
|
+
if (ee(S) && v !== 0 && !(k === 0 && S.__key === _ && m === v || k === p - 1 && S.__key === x && y === 0) && (C = !0, w &= S.getFormat(), w === 0)) break;
|
|
8899
8899
|
}
|
|
8900
8900
|
l.format = C ? w : 0;
|
|
8901
8901
|
}
|
|
@@ -8918,7 +8918,7 @@ function qi(r, e) {
|
|
|
8918
8918
|
if (e[e.length - 1] === `
|
|
8919
8919
|
`) {
|
|
8920
8920
|
const n = ue();
|
|
8921
|
-
if (
|
|
8921
|
+
if (Y(n)) {
|
|
8922
8922
|
const s = n.focus;
|
|
8923
8923
|
return n.anchor.set(s.key, s.offset, s.type), void ae(r, Rs, null);
|
|
8924
8924
|
}
|
|
@@ -8973,16 +8973,16 @@ function go(r, e, t) {
|
|
|
8973
8973
|
if (s === null) return;
|
|
8974
8974
|
const i = function(l) {
|
|
8975
8975
|
const a = ue();
|
|
8976
|
-
if (!
|
|
8976
|
+
if (!Y(a) || !O(l)) return a;
|
|
8977
8977
|
const { anchor: u, focus: c } = a, d = u.getNode(), h = c.getNode();
|
|
8978
8978
|
return Fn(d, l) && u.set(l.__key, 0, "element"), Fn(h, l) && c.set(l.__key, 0, "element"), a;
|
|
8979
8979
|
}(r);
|
|
8980
8980
|
let o = !1;
|
|
8981
|
-
if (
|
|
8981
|
+
if (Y(i) && e) {
|
|
8982
8982
|
const l = i.anchor, a = i.focus;
|
|
8983
8983
|
l.key === n && (Qs(l, r, s, r.getPreviousSibling(), r.getNextSibling()), o = !0), a.key === n && (Qs(a, r, s, r.getPreviousSibling(), r.getNextSibling()), o = !0);
|
|
8984
8984
|
} else Qt(i) && e && r.isSelected() && r.selectPrevious();
|
|
8985
|
-
if (
|
|
8985
|
+
if (Y(i) && e && !o) {
|
|
8986
8986
|
const l = r.getIndexWithinParent();
|
|
8987
8987
|
jr(r), Ys(i, s, l, -1);
|
|
8988
8988
|
} else jr(r);
|
|
@@ -9022,7 +9022,7 @@ class bi {
|
|
|
9022
9022
|
if (t == null) return !1;
|
|
9023
9023
|
const n = t.getNodes().some((s) => s.__key === this.__key);
|
|
9024
9024
|
if (ee(this)) return n;
|
|
9025
|
-
if (
|
|
9025
|
+
if (Y(t) && t.anchor.type === "element" && t.focus.type === "element") {
|
|
9026
9026
|
if (t.isCollapsed()) return !1;
|
|
9027
9027
|
const s = this.getParent();
|
|
9028
9028
|
if (Je(this) && this.isInline() && s) {
|
|
@@ -9226,7 +9226,7 @@ class bi {
|
|
|
9226
9226
|
const c = s.getPreviousSibling(), d = s.getNextSibling(), h = s.__prev, p = s.__next, g = s.__parent;
|
|
9227
9227
|
if (go(s, !1, !0), c === null ? a.__first = o : c.getWritable().__next = o, l.__prev = h, d === null ? a.__last = o : d.getWritable().__prev = o, l.__next = p, l.__parent = g, a.__size = u, t && (O(this) && O(l) || J(139), this.getChildren().forEach((m) => {
|
|
9228
9228
|
l.append(m);
|
|
9229
|
-
})),
|
|
9229
|
+
})), Y(n)) {
|
|
9230
9230
|
er(n);
|
|
9231
9231
|
const m = n.anchor, y = n.focus;
|
|
9232
9232
|
m.key === i && Xa(m, l), y.key === i && Xa(y, l);
|
|
@@ -9239,13 +9239,13 @@ class bi {
|
|
|
9239
9239
|
let l = !1, a = !1;
|
|
9240
9240
|
if (i !== null) {
|
|
9241
9241
|
const p = e.getIndexWithinParent();
|
|
9242
|
-
if (jr(s),
|
|
9242
|
+
if (jr(s), Y(o)) {
|
|
9243
9243
|
const g = i.__key, m = o.anchor, y = o.focus;
|
|
9244
9244
|
l = m.type === "element" && m.key === g && m.offset === p + 1, a = y.type === "element" && y.key === g && y.offset === p + 1;
|
|
9245
9245
|
}
|
|
9246
9246
|
}
|
|
9247
9247
|
const u = this.getNextSibling(), c = this.getParentOrThrow().getWritable(), d = s.__key, h = n.__next;
|
|
9248
|
-
if (u === null ? c.__last = d : u.getWritable().__prev = d, c.__size++, n.__next = d, s.__next = h, s.__prev = n.__key, s.__parent = n.__parent, t &&
|
|
9248
|
+
if (u === null ? c.__last = d : u.getWritable().__prev = d, c.__size++, n.__next = d, s.__next = h, s.__prev = n.__key, s.__parent = n.__parent, t && Y(o)) {
|
|
9249
9249
|
const p = this.getIndexWithinParent();
|
|
9250
9250
|
Ys(o, c, p + 1);
|
|
9251
9251
|
const g = c.__key;
|
|
@@ -9260,7 +9260,7 @@ class bi {
|
|
|
9260
9260
|
const o = this.getPreviousSibling(), l = this.getParentOrThrow().getWritable(), a = n.__prev, u = this.getIndexWithinParent();
|
|
9261
9261
|
o === null ? l.__first = i : o.getWritable().__next = i, l.__size++, n.__prev = i, s.__prev = a, s.__next = n.__key, s.__parent = n.__parent;
|
|
9262
9262
|
const c = ue();
|
|
9263
|
-
return t &&
|
|
9263
|
+
return t && Y(c) && Ys(c, this.getParentOrThrow(), u), e;
|
|
9264
9264
|
}
|
|
9265
9265
|
isParentRequired() {
|
|
9266
9266
|
return !1;
|
|
@@ -9553,7 +9553,7 @@ class dn extends bi {
|
|
|
9553
9553
|
const a = o.length;
|
|
9554
9554
|
n === void 0 && (n = a), s === void 0 && (s = a);
|
|
9555
9555
|
} else n = 0, s = 0;
|
|
9556
|
-
if (!
|
|
9556
|
+
if (!Y(i)) return oc(l, n, l, s, "text", "text");
|
|
9557
9557
|
{
|
|
9558
9558
|
const a = xr();
|
|
9559
9559
|
a !== i.anchor.key && a !== i.focus.key || yt(l), i.setTextNodeRange(this, n, this, s);
|
|
@@ -9572,7 +9572,7 @@ class dn extends bi {
|
|
|
9572
9572
|
let a = e;
|
|
9573
9573
|
a < 0 && (a = l + a, a < 0 && (a = 0));
|
|
9574
9574
|
const u = ue();
|
|
9575
|
-
if (s &&
|
|
9575
|
+
if (s && Y(u)) {
|
|
9576
9576
|
const d = e + l;
|
|
9577
9577
|
u.setTextNodeRange(i, d, i, d);
|
|
9578
9578
|
}
|
|
@@ -9589,7 +9589,7 @@ class dn extends bi {
|
|
|
9589
9589
|
At();
|
|
9590
9590
|
const t = this.getLatest(), n = t.getTextContent(), s = t.__key, i = xr(), o = new Set(e), l = [], a = n.length;
|
|
9591
9591
|
let u = "";
|
|
9592
|
-
for (let
|
|
9592
|
+
for (let k = 0; k < a; k++) u !== "" && o.has(k) && (l.push(u), u = ""), u += n[k];
|
|
9593
9593
|
u !== "" && l.push(u);
|
|
9594
9594
|
const c = l.length;
|
|
9595
9595
|
if (c === 0) return [];
|
|
@@ -9601,11 +9601,11 @@ class dn extends bi {
|
|
|
9601
9601
|
t.isSegmented() ? (p = ht(d), p.__format = g, p.__style = m, p.__detail = y, _ = !0) : (p = t.getWritable(), p.__text = d);
|
|
9602
9602
|
const x = ue(), w = [p];
|
|
9603
9603
|
let C = d.length;
|
|
9604
|
-
for (let
|
|
9605
|
-
const
|
|
9604
|
+
for (let k = 1; k < c; k++) {
|
|
9605
|
+
const S = l[k], v = S.length, D = ht(S).getWritable();
|
|
9606
9606
|
D.__format = g, D.__style = m, D.__detail = y;
|
|
9607
9607
|
const N = D.__key, B = C + v;
|
|
9608
|
-
if (
|
|
9608
|
+
if (Y(x)) {
|
|
9609
9609
|
const T = x.anchor, j = x.focus;
|
|
9610
9610
|
T.key === s && T.type === "text" && T.offset > C && T.offset <= B && (T.key = N, T.offset -= C, x.dirty = !0), j.key === s && j.type === "text" && j.offset > C && j.offset <= B && (j.key = N, j.offset -= C, x.dirty = !0);
|
|
9611
9611
|
}
|
|
@@ -9616,8 +9616,8 @@ class dn extends bi {
|
|
|
9616
9616
|
const D = v.getPreviousSibling(), N = v.getNextSibling();
|
|
9617
9617
|
D !== null && qs(D), N !== null && qs(N);
|
|
9618
9618
|
})(this);
|
|
9619
|
-
const
|
|
9620
|
-
_ ? (
|
|
9619
|
+
const k = h.getWritable(), S = this.getIndexWithinParent();
|
|
9620
|
+
_ ? (k.splice(S, 0, w), this.remove()) : k.splice(S, 1, w), Y(x) && Ys(x, h, S, c - 1);
|
|
9621
9621
|
}
|
|
9622
9622
|
return w;
|
|
9623
9623
|
}
|
|
@@ -9627,7 +9627,7 @@ class dn extends bi {
|
|
|
9627
9627
|
const n = this.__key, s = e.__key, i = this.__text, o = i.length;
|
|
9628
9628
|
xr() === s && yt(n);
|
|
9629
9629
|
const l = ue();
|
|
9630
|
-
if (
|
|
9630
|
+
if (Y(l)) {
|
|
9631
9631
|
const d = l.anchor, h = l.focus;
|
|
9632
9632
|
d !== null && d.key === s && (il(d, t, n, e, o), l.dirty = !0), h !== null && h.key === s && (il(h, t, n, e, o), l.dirty = !0);
|
|
9633
9633
|
}
|
|
@@ -9905,7 +9905,7 @@ class vi {
|
|
|
9905
9905
|
return t;
|
|
9906
9906
|
}
|
|
9907
9907
|
}
|
|
9908
|
-
function
|
|
9908
|
+
function Y(r) {
|
|
9909
9909
|
return r instanceof Sr;
|
|
9910
9910
|
}
|
|
9911
9911
|
class Sr {
|
|
@@ -9919,7 +9919,7 @@ class Sr {
|
|
|
9919
9919
|
this._cachedNodes = e;
|
|
9920
9920
|
}
|
|
9921
9921
|
is(e) {
|
|
9922
|
-
return !!
|
|
9922
|
+
return !!Y(e) && this.anchor.is(e.anchor) && this.focus.is(e.focus) && this.format === e.format && this.style === e.style;
|
|
9923
9923
|
}
|
|
9924
9924
|
isCollapsed() {
|
|
9925
9925
|
return this.anchor.is(this.focus);
|
|
@@ -9994,8 +9994,8 @@ class Sr {
|
|
|
9994
9994
|
const t = this.anchor, n = this.focus, s = this.format, i = this.style;
|
|
9995
9995
|
let o = t, l = n;
|
|
9996
9996
|
!this.isCollapsed() && n.isBefore(t) && (o = n, l = t), o.type === "element" && function(y, _, x, w) {
|
|
9997
|
-
const C = y.getNode(),
|
|
9998
|
-
|
|
9997
|
+
const C = y.getNode(), k = C.getChildAtIndex(y.offset), S = ht(), v = wt(C) ? ft().append(S) : S;
|
|
9998
|
+
S.setFormat(x), S.setStyle(w), k === null ? C.append(v) : k.insertBefore(v), y.is(_) && _.set(S.__key, 0, "text"), y.set(S.__key, 0, "text");
|
|
9999
9999
|
}(o, l, s, i);
|
|
10000
10000
|
const a = o.offset;
|
|
10001
10001
|
let u = l.offset;
|
|
@@ -10059,13 +10059,13 @@ class Sr {
|
|
|
10059
10059
|
D.canBeEmpty() || D.getChildrenSize() !== 1 ? m.remove() : D.remove();
|
|
10060
10060
|
}
|
|
10061
10061
|
else y.add(m.__key);
|
|
10062
|
-
const C = x.getChildren(),
|
|
10062
|
+
const C = x.getChildren(), k = new Set(c), S = _.is(x), v = _.isInline() && h.getNextSibling() === null ? _ : h;
|
|
10063
10063
|
for (let D = C.length - 1; D >= 0; D--) {
|
|
10064
10064
|
const N = C[D];
|
|
10065
10065
|
if (N.is(h) || O(N) && N.isParentOf(h)) break;
|
|
10066
|
-
N.isAttached() && (!
|
|
10066
|
+
N.isAttached() && (!k.has(N) || N.is(w) ? S || v.insertAfter(N, !1) : N.remove());
|
|
10067
10067
|
}
|
|
10068
|
-
if (!
|
|
10068
|
+
if (!S) {
|
|
10069
10069
|
let D = x, N = null;
|
|
10070
10070
|
for (; D !== null; ) {
|
|
10071
10071
|
const B = D.getChildren(), T = B.length;
|
|
@@ -10114,10 +10114,10 @@ class Sr {
|
|
|
10114
10114
|
const n = this.getNodes(), s = [];
|
|
10115
10115
|
for (const C of n) ee(C) && s.push(C);
|
|
10116
10116
|
const i = (C) => {
|
|
10117
|
-
n.forEach((
|
|
10118
|
-
if (an(
|
|
10119
|
-
const
|
|
10120
|
-
|
|
10117
|
+
n.forEach((k) => {
|
|
10118
|
+
if (an(k)) {
|
|
10119
|
+
const S = k.getFormatFlags(e, C);
|
|
10120
|
+
k.setTextFormat(S);
|
|
10121
10121
|
}
|
|
10122
10122
|
});
|
|
10123
10123
|
}, o = s.length;
|
|
@@ -10134,8 +10134,8 @@ class Sr {
|
|
|
10134
10134
|
if (g === x) return;
|
|
10135
10135
|
if (Ar(p) || g === 0 && x === p.getTextContentSize()) p.setFormat(m);
|
|
10136
10136
|
else {
|
|
10137
|
-
const C = p.splitText(g, x),
|
|
10138
|
-
|
|
10137
|
+
const C = p.splitText(g, x), k = g === 0 ? C[0] : C[1];
|
|
10138
|
+
k.setFormat(m), c.type === "text" && c.set(k.__key, 0, "text"), d.type === "text" && d.set(k.__key, x - g, "text");
|
|
10139
10139
|
}
|
|
10140
10140
|
return void (this.format = m);
|
|
10141
10141
|
}
|
|
@@ -10143,8 +10143,8 @@ class Sr {
|
|
|
10143
10143
|
const w = _.getFormatFlags(e, m);
|
|
10144
10144
|
x > 0 && (x === _.getTextContentSize() || Ar(_) || ([_] = _.splitText(x)), _.setFormat(w));
|
|
10145
10145
|
for (let C = h + 1; C < y; C++) {
|
|
10146
|
-
const
|
|
10147
|
-
|
|
10146
|
+
const k = s[C], S = k.getFormatFlags(e, w);
|
|
10147
|
+
k.setFormat(S);
|
|
10148
10148
|
}
|
|
10149
10149
|
c.type === "text" && c.set(p.__key, g, "text"), d.type === "text" && d.set(_.__key, x, "text"), this.format = m | w;
|
|
10150
10150
|
}
|
|
@@ -10153,7 +10153,7 @@ class Sr {
|
|
|
10153
10153
|
if (this.anchor.key === "root") {
|
|
10154
10154
|
this.insertParagraph();
|
|
10155
10155
|
const g = ue();
|
|
10156
|
-
return
|
|
10156
|
+
return Y(g) || J(134), g.insertNodes(e);
|
|
10157
10157
|
}
|
|
10158
10158
|
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), n = bn(t, gr), s = e[e.length - 1];
|
|
10159
10159
|
if (O(n) && "__language" in n) {
|
|
@@ -10189,7 +10189,7 @@ class Sr {
|
|
|
10189
10189
|
const w = [m];
|
|
10190
10190
|
for (; x !== _; ) x.getNextSibling() || J(140), x = x.getNextSibling(), w.push(x);
|
|
10191
10191
|
let C = g;
|
|
10192
|
-
for (const
|
|
10192
|
+
for (const k of w) C = C.insertAfter(k);
|
|
10193
10193
|
}(n, c));
|
|
10194
10194
|
const h = bn(o, gr);
|
|
10195
10195
|
a && O(h) && (a.canMergeWhenEmpty() || gr(u)) && (h.append(...a.getChildren()), a.remove()), O(n) && n.isEmpty() && n.remove(), o.selectEnd();
|
|
@@ -10276,8 +10276,8 @@ class Sr {
|
|
|
10276
10276
|
O(x) ? x.selectEnd() : x.getParentOrThrow().selectEnd();
|
|
10277
10277
|
}
|
|
10278
10278
|
u.anchorNode === h.startContainer && u.anchorOffset === h.startOffset || function(x) {
|
|
10279
|
-
const w = x.focus, C = x.anchor,
|
|
10280
|
-
mr(C, w.key, w.offset, w.type), mr(w,
|
|
10279
|
+
const w = x.focus, C = x.anchor, k = C.key, S = C.offset, v = C.type;
|
|
10280
|
+
mr(C, w.key, w.offset, w.type), mr(w, k, S, v), x._cachedNodes = null;
|
|
10281
10281
|
}(this);
|
|
10282
10282
|
}
|
|
10283
10283
|
}
|
|
@@ -10446,7 +10446,7 @@ function sc(r, e, t) {
|
|
|
10446
10446
|
const n = r.isBefore(e), s = r.is(e);
|
|
10447
10447
|
rl(r, n, s), rl(e, !n, s), s && (e.key = r.key, e.offset = r.offset, e.type = r.type);
|
|
10448
10448
|
const i = at();
|
|
10449
|
-
if (i.isComposing() && i._compositionKey !== r.key &&
|
|
10449
|
+
if (i.isComposing() && i._compositionKey !== r.key && Y(t)) {
|
|
10450
10450
|
const o = t.anchor, l = t.focus;
|
|
10451
10451
|
mr(r, o.key, o.offset, o.type), mr(e, l.key, l.offset, l.type);
|
|
10452
10452
|
}
|
|
@@ -10454,9 +10454,9 @@ function sc(r, e, t) {
|
|
|
10454
10454
|
}
|
|
10455
10455
|
function ic(r, e, t, n, s, i) {
|
|
10456
10456
|
if (r === null || t === null || !Zn(s, r, t)) return null;
|
|
10457
|
-
const o = tl(r, e,
|
|
10457
|
+
const o = tl(r, e, Y(i) ? i.anchor : null, s);
|
|
10458
10458
|
if (o === null) return null;
|
|
10459
|
-
const l = tl(t, n,
|
|
10459
|
+
const l = tl(t, n, Y(i) ? i.focus : null, s);
|
|
10460
10460
|
if (l === null) return null;
|
|
10461
10461
|
if (o.type === "element" && l.type === "element") {
|
|
10462
10462
|
const a = Qr(r), u = Qr(t);
|
|
@@ -10483,13 +10483,13 @@ function sa(r, e, t, n) {
|
|
|
10483
10483
|
if (s === null) return null;
|
|
10484
10484
|
const i = n || s.event, o = i ? i.type : void 0, l = o === "selectionchange", a = !ro && (l || o === "beforeinput" || o === "compositionstart" || o === "compositionend" || o === "click" && i && i.detail === 3 || o === "drop" || o === void 0);
|
|
10485
10485
|
let u, c, d, h;
|
|
10486
|
-
if (
|
|
10486
|
+
if (Y(r) && !a) return r.clone();
|
|
10487
10487
|
if (e === null) return null;
|
|
10488
|
-
if (u = e.anchorNode, c = e.focusNode, d = e.anchorOffset, h = e.focusOffset, l &&
|
|
10488
|
+
if (u = e.anchorNode, c = e.focusNode, d = e.anchorOffset, h = e.focusOffset, l && Y(r) && !Zn(t, u, c)) return r.clone();
|
|
10489
10489
|
const p = ic(u, d, c, h, t, r);
|
|
10490
10490
|
if (p === null) return null;
|
|
10491
10491
|
const [g, m] = p;
|
|
10492
|
-
return new Sr(g, m,
|
|
10492
|
+
return new Sr(g, m, Y(r) ? r.format : 0, Y(r) ? r.style : "");
|
|
10493
10493
|
}
|
|
10494
10494
|
function ue() {
|
|
10495
10495
|
return fr()._selection;
|
|
@@ -10556,16 +10556,16 @@ function il(r, e, t, n, s) {
|
|
|
10556
10556
|
function _h(r, e, t, n, s, i, o) {
|
|
10557
10557
|
const l = n.anchorNode, a = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
|
|
10558
10558
|
if (s.has("collaboration") && d !== i || d !== null && Ko(d)) return;
|
|
10559
|
-
if (!
|
|
10560
|
-
const h = e.anchor, p = e.focus, g = h.key, m = p.key, y = Us(t, g), _ = Us(t, m), x = h.offset, w = p.offset, C = e.format,
|
|
10559
|
+
if (!Y(e)) return void (r !== null && Zn(t, l, a) && n.removeAllRanges());
|
|
10560
|
+
const h = e.anchor, p = e.focus, g = h.key, m = p.key, y = Us(t, g), _ = Us(t, m), x = h.offset, w = p.offset, C = e.format, k = e.style, S = e.isCollapsed();
|
|
10561
10561
|
let v = y, D = _, N = !1;
|
|
10562
10562
|
if (h.type === "text") {
|
|
10563
10563
|
v = Os(y);
|
|
10564
10564
|
const E = h.getNode();
|
|
10565
|
-
N = E.getFormat() !== C || E.getStyle() !==
|
|
10566
|
-
} else
|
|
10565
|
+
N = E.getFormat() !== C || E.getStyle() !== k;
|
|
10566
|
+
} else Y(r) && r.anchor.type === "text" && (N = !0);
|
|
10567
10567
|
var B, T, j, M, b;
|
|
10568
|
-
if (p.type === "text" && (D = Os(_)), v !== null && D !== null && (
|
|
10568
|
+
if (p.type === "text" && (D = Os(_)), v !== null && D !== null && (S && (r === null || N || Y(r) && (r.format !== C || r.style !== k)) && (B = C, T = k, j = x, M = g, b = performance.now(), Ju = [B, T, j, M, b]), u !== x || c !== w || l !== v || a !== D || n.type === "Range" && S || (d !== null && i.contains(d) || i.focus({ preventScroll: !0 }), h.type === "element"))) {
|
|
10569
10569
|
try {
|
|
10570
10570
|
n.setBaseAndExtent(v, x, D, w);
|
|
10571
10571
|
} catch {
|
|
@@ -10614,7 +10614,7 @@ function Vi(r) {
|
|
|
10614
10614
|
let e = r;
|
|
10615
10615
|
r.isCollapsed() || e.removeText();
|
|
10616
10616
|
const t = ue();
|
|
10617
|
-
|
|
10617
|
+
Y(t) && (e = t), Y(e) || J(161);
|
|
10618
10618
|
const n = e.anchor;
|
|
10619
10619
|
let s = n.getNode(), i = n.offset;
|
|
10620
10620
|
for (; !gr(s); ) [s, i] = wh(s, i);
|
|
@@ -10726,10 +10726,10 @@ function br(r, e) {
|
|
|
10726
10726
|
if (r._pendingEditorState = null, r._editorState = t, !s && a && p !== null) {
|
|
10727
10727
|
mt = r, gt = t, Nt = !1, r._updating = !0;
|
|
10728
10728
|
try {
|
|
10729
|
-
const
|
|
10730
|
-
p.disconnect(), g = ch(i, t, r,
|
|
10731
|
-
} catch (
|
|
10732
|
-
if (
|
|
10729
|
+
const S = r._dirtyType, v = r._dirtyElements, D = r._dirtyLeaves;
|
|
10730
|
+
p.disconnect(), g = ch(i, t, r, S, v, D);
|
|
10731
|
+
} catch (S) {
|
|
10732
|
+
if (S instanceof Error && r._onError(S), Gi) throw S;
|
|
10733
10733
|
return gc(r, null, n, t), Bu(r), r._dirtyType = sn, Gi = !0, br(r, i), void (Gi = !1);
|
|
10734
10734
|
} finally {
|
|
10735
10735
|
p.observe(n, ol), r._updating = h, gt = u, Nt = c, mt = d;
|
|
@@ -10737,54 +10737,54 @@ function br(r, e) {
|
|
|
10737
10737
|
}
|
|
10738
10738
|
t._readOnly || (t._readOnly = !0);
|
|
10739
10739
|
const m = r._dirtyLeaves, y = r._dirtyElements, _ = r._normalizedNodes, x = r._updateTags, w = r._deferred;
|
|
10740
|
-
a && (r._dirtyType = Rr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(
|
|
10741
|
-
const D =
|
|
10742
|
-
let N =
|
|
10740
|
+
a && (r._dirtyType = Rr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(S, v) {
|
|
10741
|
+
const D = S._decorators;
|
|
10742
|
+
let N = S._pendingDecorators || D;
|
|
10743
10743
|
const B = v._nodeMap;
|
|
10744
10744
|
let T;
|
|
10745
|
-
for (T in N) B.has(T) || (N === D && (N = Lu(
|
|
10745
|
+
for (T in N) B.has(T) || (N === D && (N = Lu(S)), delete N[T]);
|
|
10746
10746
|
}(r, t);
|
|
10747
10747
|
const C = s ? null : Lt(r._window);
|
|
10748
10748
|
if (r._editable && C !== null && (a || l === null || l.dirty)) {
|
|
10749
10749
|
mt = r, gt = t;
|
|
10750
10750
|
try {
|
|
10751
10751
|
if (p !== null && p.disconnect(), a || l === null || l.dirty) {
|
|
10752
|
-
const
|
|
10753
|
-
|
|
10752
|
+
const S = r._blockCursorElement;
|
|
10753
|
+
S !== null && ea(S, r, n), _h(o, l, r, C, x, n);
|
|
10754
10754
|
}
|
|
10755
10755
|
rh(r, n, l), p !== null && p.observe(n, ol);
|
|
10756
10756
|
} finally {
|
|
10757
10757
|
mt = d, gt = u;
|
|
10758
10758
|
}
|
|
10759
10759
|
}
|
|
10760
|
-
g !== null && function(
|
|
10761
|
-
const T = Array.from(
|
|
10760
|
+
g !== null && function(S, v, D, N, B) {
|
|
10761
|
+
const T = Array.from(S._listeners.mutation), j = T.length;
|
|
10762
10762
|
for (let M = 0; M < j; M++) {
|
|
10763
10763
|
const [b, E] = T[M], F = v.get(E);
|
|
10764
10764
|
F !== void 0 && b(F, { dirtyLeaves: N, prevEditorState: B, updateTags: D });
|
|
10765
10765
|
}
|
|
10766
|
-
}(r, g, x, m, i),
|
|
10767
|
-
const
|
|
10768
|
-
|
|
10766
|
+
}(r, g, x, m, i), Y(l) || l === null || o !== null && o.is(l) || r.dispatchCommand(Ro, void 0);
|
|
10767
|
+
const k = r._pendingDecorators;
|
|
10768
|
+
k !== null && (r._decorators = k, r._pendingDecorators = null, Pn("decorator", r, !0, k)), function(S, v, D) {
|
|
10769
10769
|
const N = Ra(v), B = Ra(D);
|
|
10770
|
-
N !== B && Pn("textcontent",
|
|
10771
|
-
}(r, e || i, t), Pn("update", r, !0, { dirtyElements: y, dirtyLeaves: m, editorState: t, normalizedNodes: _, prevEditorState: e || i, tags: x }), function(
|
|
10772
|
-
if (
|
|
10773
|
-
const D =
|
|
10774
|
-
|
|
10770
|
+
N !== B && Pn("textcontent", S, !0, B);
|
|
10771
|
+
}(r, e || i, t), Pn("update", r, !0, { dirtyElements: y, dirtyLeaves: m, editorState: t, normalizedNodes: _, prevEditorState: e || i, tags: x }), function(S, v) {
|
|
10772
|
+
if (S._deferred = [], v.length !== 0) {
|
|
10773
|
+
const D = S._updating;
|
|
10774
|
+
S._updating = !0;
|
|
10775
10775
|
try {
|
|
10776
10776
|
for (let N = 0; N < v.length; N++) v[N]();
|
|
10777
10777
|
} finally {
|
|
10778
|
-
|
|
10778
|
+
S._updating = D;
|
|
10779
10779
|
}
|
|
10780
10780
|
}
|
|
10781
|
-
}(r, w), function(
|
|
10782
|
-
const v =
|
|
10781
|
+
}(r, w), function(S) {
|
|
10782
|
+
const v = S._updates;
|
|
10783
10783
|
if (v.length !== 0) {
|
|
10784
10784
|
const D = v.shift();
|
|
10785
10785
|
if (D) {
|
|
10786
10786
|
const [N, B] = D;
|
|
10787
|
-
fc(
|
|
10787
|
+
fc(S, N, B);
|
|
10788
10788
|
}
|
|
10789
10789
|
}
|
|
10790
10790
|
}(r);
|
|
@@ -10851,34 +10851,34 @@ function fc(r, e, t) {
|
|
|
10851
10851
|
try {
|
|
10852
10852
|
u && (r._headless ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = function(_) {
|
|
10853
10853
|
const x = _.getEditorState()._selection, w = Lt(_._window);
|
|
10854
|
-
return
|
|
10854
|
+
return Y(x) || x == null ? sa(x, w, _, null) : x.clone();
|
|
10855
10855
|
}(r));
|
|
10856
10856
|
const m = r._compositionKey;
|
|
10857
10857
|
e(), i = cl(r, i), function(_, x) {
|
|
10858
10858
|
const w = x.getEditorState()._selection, C = _._selection;
|
|
10859
|
-
if (
|
|
10860
|
-
const
|
|
10859
|
+
if (Y(C)) {
|
|
10860
|
+
const k = C.anchor, S = C.focus;
|
|
10861
10861
|
let v;
|
|
10862
|
-
if (
|
|
10863
|
-
const D =
|
|
10862
|
+
if (k.type === "text" && (v = k.getNode(), v.selectionTransform(w, C)), S.type === "text") {
|
|
10863
|
+
const D = S.getNode();
|
|
10864
10864
|
v !== D && D.selectionTransform(w, C);
|
|
10865
10865
|
}
|
|
10866
10866
|
}
|
|
10867
10867
|
}(a, r), r._dirtyType !== Rr && (i ? function(_, x) {
|
|
10868
10868
|
const w = x._dirtyLeaves, C = _._nodeMap;
|
|
10869
|
-
for (const
|
|
10870
|
-
const
|
|
10871
|
-
ee(
|
|
10869
|
+
for (const k of w) {
|
|
10870
|
+
const S = C.get(k);
|
|
10871
|
+
ee(S) && S.isAttached() && S.isSimpleText() && !S.isUnmergeable() && Ma(S);
|
|
10872
10872
|
}
|
|
10873
10873
|
}(a, r) : function(_, x) {
|
|
10874
|
-
const w = x._dirtyLeaves, C = x._dirtyElements,
|
|
10874
|
+
const w = x._dirtyLeaves, C = x._dirtyElements, k = _._nodeMap, S = xr(), v = /* @__PURE__ */ new Map();
|
|
10875
10875
|
let D = w, N = D.size, B = C, T = B.size;
|
|
10876
10876
|
for (; N > 0 || T > 0; ) {
|
|
10877
10877
|
if (N > 0) {
|
|
10878
10878
|
x._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
10879
10879
|
for (const j of D) {
|
|
10880
|
-
const M =
|
|
10881
|
-
ee(M) && M.isAttached() && M.isSimpleText() && !M.isUnmergeable() && Ma(M), M !== void 0 && ll(M,
|
|
10880
|
+
const M = k.get(j);
|
|
10881
|
+
ee(M) && M.isAttached() && M.isSimpleText() && !M.isUnmergeable() && Ma(M), M !== void 0 && ll(M, S) && al(x, M, v), w.add(j);
|
|
10882
10882
|
}
|
|
10883
10883
|
if (D = x._dirtyLeaves, N = D.size, N > 0) {
|
|
10884
10884
|
Ds++;
|
|
@@ -10889,26 +10889,26 @@ function fc(r, e, t) {
|
|
|
10889
10889
|
for (const j of B) {
|
|
10890
10890
|
const M = j[0], b = j[1];
|
|
10891
10891
|
if (M !== "root" && !b) continue;
|
|
10892
|
-
const E =
|
|
10893
|
-
E !== void 0 && ll(E,
|
|
10892
|
+
const E = k.get(M);
|
|
10893
|
+
E !== void 0 && ll(E, S) && al(x, E, v), C.set(M, b);
|
|
10894
10894
|
}
|
|
10895
10895
|
D = x._dirtyLeaves, N = D.size, B = x._dirtyElements, T = B.size, Ds++;
|
|
10896
10896
|
}
|
|
10897
10897
|
x._dirtyLeaves = w, x._dirtyElements = C;
|
|
10898
10898
|
}(a, r), cl(r), function(_, x, w, C) {
|
|
10899
|
-
const
|
|
10899
|
+
const k = _._nodeMap, S = x._nodeMap, v = [];
|
|
10900
10900
|
for (const [D] of C) {
|
|
10901
|
-
const N =
|
|
10902
|
-
N !== void 0 && (N.isAttached() || (O(N) && qu(N, D,
|
|
10901
|
+
const N = S.get(D);
|
|
10902
|
+
N !== void 0 && (N.isAttached() || (O(N) && qu(N, D, k, S, v, C), k.has(D) || C.delete(D), v.push(D)));
|
|
10903
10903
|
}
|
|
10904
|
-
for (const D of v)
|
|
10904
|
+
for (const D of v) S.delete(D);
|
|
10905
10905
|
for (const D of w) {
|
|
10906
|
-
const N =
|
|
10907
|
-
N === void 0 || N.isAttached() || (
|
|
10906
|
+
const N = S.get(D);
|
|
10907
|
+
N === void 0 || N.isAttached() || (k.has(D) || w.delete(D), S.delete(D));
|
|
10908
10908
|
}
|
|
10909
10909
|
}(l, a, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (a._flushSync = !0);
|
|
10910
10910
|
const y = a._selection;
|
|
10911
|
-
if (
|
|
10911
|
+
if (Y(y)) {
|
|
10912
10912
|
const _ = a._nodeMap, x = y.anchor.key, w = y.focus.key;
|
|
10913
10913
|
_.get(x) !== void 0 && _.get(w) !== void 0 || J(19);
|
|
10914
10914
|
} else Qt(y) && y._nodes.size === 0 && (a._selection = null);
|
|
@@ -11182,7 +11182,7 @@ class hr extends bi {
|
|
|
11182
11182
|
}
|
|
11183
11183
|
s === void 0 && (s = o), i === void 0 && (i = o);
|
|
11184
11184
|
const l = this.__key;
|
|
11185
|
-
return
|
|
11185
|
+
return Y(n) ? (n.anchor.set(l, s, "element"), n.focus.set(l, i, "element"), n.dirty = !0, n) : oc(l, s, l, i, "element", "element");
|
|
11186
11186
|
}
|
|
11187
11187
|
selectStart() {
|
|
11188
11188
|
const e = this.getFirstDescendant();
|
|
@@ -11255,7 +11255,7 @@ class hr extends bi {
|
|
|
11255
11255
|
}
|
|
11256
11256
|
if (o.__size = h, u.length) {
|
|
11257
11257
|
const g = ue();
|
|
11258
|
-
if (
|
|
11258
|
+
if (Y(g)) {
|
|
11259
11259
|
const m = new Set(u), y = new Set(a), { anchor: _, focus: x } = g;
|
|
11260
11260
|
fl(_, m, y) && Qs(_, _.getNode(), this, d, c), fl(x, m, y) && Qs(x, x.getNode(), this, d, c), h !== 0 || this.canBeEmpty() || tr(this) || this.remove();
|
|
11261
11261
|
}
|
|
@@ -11560,26 +11560,26 @@ function Dh(r) {
|
|
|
11560
11560
|
for (let m = 0; m < u.length; m++) {
|
|
11561
11561
|
let y = u[m], _ = null, x = null;
|
|
11562
11562
|
if (typeof y != "function") {
|
|
11563
|
-
const
|
|
11564
|
-
y =
|
|
11563
|
+
const S = y;
|
|
11564
|
+
y = S.replace, _ = S.with, x = S.withKlass || null;
|
|
11565
11565
|
}
|
|
11566
|
-
const w = y.getType(), C = y.transform(),
|
|
11567
|
-
C !== null &&
|
|
11566
|
+
const w = y.getType(), C = y.transform(), k = /* @__PURE__ */ new Set();
|
|
11567
|
+
C !== null && k.add(C), p.set(w, { exportDOM: d && d.export ? d.export.get(y) : void 0, klass: y, replace: _, replaceWithKlass: x, transforms: k });
|
|
11568
11568
|
}
|
|
11569
11569
|
}
|
|
11570
11570
|
const g = new wi(o, s, p, { disableEvents: i, namespace: l, theme: n }, c || console.error, function(m, y) {
|
|
11571
11571
|
const _ = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Set(), w = (C) => {
|
|
11572
|
-
Object.keys(C).forEach((
|
|
11573
|
-
let
|
|
11574
|
-
|
|
11572
|
+
Object.keys(C).forEach((k) => {
|
|
11573
|
+
let S = _.get(k);
|
|
11574
|
+
S === void 0 && (S = [], _.set(k, S)), S.push(C[k]);
|
|
11575
11575
|
});
|
|
11576
11576
|
};
|
|
11577
11577
|
return m.forEach((C) => {
|
|
11578
|
-
const
|
|
11579
|
-
if (
|
|
11580
|
-
x.add(
|
|
11581
|
-
const
|
|
11582
|
-
|
|
11578
|
+
const k = C.klass.importDOM;
|
|
11579
|
+
if (k == null || x.has(k)) return;
|
|
11580
|
+
x.add(k);
|
|
11581
|
+
const S = k.call(C.klass);
|
|
11582
|
+
S !== null && w(S);
|
|
11583
11583
|
}), y && w(y), _;
|
|
11584
11584
|
}(p, d ? d.import : void 0), h);
|
|
11585
11585
|
return a !== void 0 && (g._pendingEditorState = a, g._dirtyType = sn), g;
|
|
@@ -12045,7 +12045,7 @@ function Qh(r) {
|
|
|
12045
12045
|
const [u, c, d, h, p, g] = a;
|
|
12046
12046
|
r.update(() => {
|
|
12047
12047
|
const m = ue();
|
|
12048
|
-
if (
|
|
12048
|
+
if (Y(m)) {
|
|
12049
12049
|
const y = m.anchor;
|
|
12050
12050
|
let _ = y.getNode(), x = 0, w = 0;
|
|
12051
12051
|
if (ee(_) && u >= 0 && c >= 0 && (x = u, w = u + c, m.setTextNodeRange(_, x, _, w)), x === w && d === "" || (m.insertRawText(d), _ = y.getNode()), ee(_)) {
|
|
@@ -12176,10 +12176,10 @@ var Js = Xh(function(r) {
|
|
|
12176
12176
|
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
12177
12177
|
});
|
|
12178
12178
|
function Zh(r, e = ue()) {
|
|
12179
|
-
return e == null && Js(166),
|
|
12179
|
+
return e == null && Js(166), Y(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : Cc(r, e);
|
|
12180
12180
|
}
|
|
12181
12181
|
function ep(r, e = ue()) {
|
|
12182
|
-
return e == null && Js(166),
|
|
12182
|
+
return e == null && Js(166), Y(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(tp(r, e));
|
|
12183
12183
|
}
|
|
12184
12184
|
function ml(r, e, t) {
|
|
12185
12185
|
const n = r.getData("application/x-lexical-editor");
|
|
@@ -12198,12 +12198,12 @@ function ml(r, e, t) {
|
|
|
12198
12198
|
} catch {
|
|
12199
12199
|
}
|
|
12200
12200
|
const i = r.getData("text/plain") || r.getData("text/uri-list");
|
|
12201
|
-
if (i != null) if (
|
|
12201
|
+
if (i != null) if (Y(e)) {
|
|
12202
12202
|
const o = i.split(/(\r?\n|\t)/);
|
|
12203
12203
|
o[o.length - 1] === "" && o.pop();
|
|
12204
12204
|
for (let l = 0; l < o.length; l++) {
|
|
12205
12205
|
const a = ue();
|
|
12206
|
-
if (
|
|
12206
|
+
if (Y(a)) {
|
|
12207
12207
|
const u = o[l];
|
|
12208
12208
|
u === `
|
|
12209
12209
|
` || u === `\r
|
|
@@ -12464,7 +12464,7 @@ function xs(r) {
|
|
|
12464
12464
|
}
|
|
12465
12465
|
function Sl(r) {
|
|
12466
12466
|
const e = ue();
|
|
12467
|
-
if (!
|
|
12467
|
+
if (!Y(e)) return !1;
|
|
12468
12468
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes();
|
|
12469
12469
|
for (let s = 0; s < n.length; s++) {
|
|
12470
12470
|
const i = n[s], o = i.getKey();
|
|
@@ -12486,13 +12486,13 @@ function fp(r) {
|
|
|
12486
12486
|
return !!Qt(t) && (t.clear(), !0);
|
|
12487
12487
|
}, 0), r.registerCommand(Br, (e) => {
|
|
12488
12488
|
const t = ue();
|
|
12489
|
-
return !!
|
|
12489
|
+
return !!Y(t) && (t.deleteCharacter(e), !0);
|
|
12490
12490
|
}, Ge), r.registerCommand(On, (e) => {
|
|
12491
12491
|
const t = ue();
|
|
12492
|
-
return !!
|
|
12492
|
+
return !!Y(t) && (t.deleteWord(e), !0);
|
|
12493
12493
|
}, Ge), r.registerCommand($n, (e) => {
|
|
12494
12494
|
const t = ue();
|
|
12495
|
-
return !!
|
|
12495
|
+
return !!Y(t) && (t.deleteLine(e), !0);
|
|
12496
12496
|
}, Ge), r.registerCommand(en, (e) => {
|
|
12497
12497
|
const t = ue();
|
|
12498
12498
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
@@ -12500,7 +12500,7 @@ function fp(r) {
|
|
|
12500
12500
|
if (t === null) return !1;
|
|
12501
12501
|
const n = e.dataTransfer;
|
|
12502
12502
|
if (n != null) ml(n, t, r);
|
|
12503
|
-
else if (
|
|
12503
|
+
else if (Y(t)) {
|
|
12504
12504
|
const s = e.data;
|
|
12505
12505
|
return s && t.insertText(s), !0;
|
|
12506
12506
|
}
|
|
@@ -12508,13 +12508,13 @@ function fp(r) {
|
|
|
12508
12508
|
return !0;
|
|
12509
12509
|
}, Ge), r.registerCommand(eo, () => {
|
|
12510
12510
|
const e = ue();
|
|
12511
|
-
return !!
|
|
12511
|
+
return !!Y(e) && (e.removeText(), !0);
|
|
12512
12512
|
}, Ge), r.registerCommand(Wt, (e) => {
|
|
12513
12513
|
const t = ue();
|
|
12514
|
-
return !!
|
|
12514
|
+
return !!Y(t) && (t.formatText(e), !0);
|
|
12515
12515
|
}, Ge), r.registerCommand(wf, (e) => {
|
|
12516
12516
|
const t = ue();
|
|
12517
|
-
if (!
|
|
12517
|
+
if (!Y(t) && !Qt(t)) return !1;
|
|
12518
12518
|
const n = t.getNodes();
|
|
12519
12519
|
for (const s of n) {
|
|
12520
12520
|
const i = Ci(s, (o) => O(o) && !o.isInline());
|
|
@@ -12523,10 +12523,10 @@ function fp(r) {
|
|
|
12523
12523
|
return !0;
|
|
12524
12524
|
}, Ge), r.registerCommand(Zr, (e) => {
|
|
12525
12525
|
const t = ue();
|
|
12526
|
-
return !!
|
|
12526
|
+
return !!Y(t) && (t.insertLineBreak(e), !0);
|
|
12527
12527
|
}, Ge), r.registerCommand(zn, () => {
|
|
12528
12528
|
const e = ue();
|
|
12529
|
-
return !!
|
|
12529
|
+
return !!Y(e) && (e.insertParagraph(), !0);
|
|
12530
12530
|
}, Ge), r.registerCommand(vf, () => (ac([ns()]), !0), Ge), r.registerCommand(_f, () => Sl((e) => {
|
|
12531
12531
|
const t = e.getIndent();
|
|
12532
12532
|
e.setIndent(t + 1);
|
|
@@ -12538,7 +12538,7 @@ function fp(r) {
|
|
|
12538
12538
|
if (Qt(t) && !bs(e.target)) {
|
|
12539
12539
|
const n = t.getNodes();
|
|
12540
12540
|
if (n.length > 0) return n[0].selectPrevious(), !0;
|
|
12541
|
-
} else if (
|
|
12541
|
+
} else if (Y(t)) {
|
|
12542
12542
|
const n = qn(t.focus, !0);
|
|
12543
12543
|
if (!e.shiftKey && Je(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
|
|
12544
12544
|
}
|
|
@@ -12548,7 +12548,7 @@ function fp(r) {
|
|
|
12548
12548
|
if (Qt(t)) {
|
|
12549
12549
|
const n = t.getNodes();
|
|
12550
12550
|
if (n.length > 0) return n[0].selectNext(0, 0), !0;
|
|
12551
|
-
} else if (
|
|
12551
|
+
} else if (Y(t)) {
|
|
12552
12552
|
if (function(s) {
|
|
12553
12553
|
const i = s.focus;
|
|
12554
12554
|
return i.key === "root" && i.offset === st().getChildrenSize();
|
|
@@ -12563,7 +12563,7 @@ function fp(r) {
|
|
|
12563
12563
|
const n = t.getNodes();
|
|
12564
12564
|
if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
|
|
12565
12565
|
}
|
|
12566
|
-
if (!
|
|
12566
|
+
if (!Y(t)) return !1;
|
|
12567
12567
|
if (hl(t, !0)) {
|
|
12568
12568
|
const n = e.shiftKey;
|
|
12569
12569
|
return e.preventDefault(), pl(t, n, !0), !0;
|
|
@@ -12575,22 +12575,22 @@ function fp(r) {
|
|
|
12575
12575
|
const s = t.getNodes();
|
|
12576
12576
|
if (s.length > 0) return e.preventDefault(), s[0].selectNext(0, 0), !0;
|
|
12577
12577
|
}
|
|
12578
|
-
if (!
|
|
12578
|
+
if (!Y(t)) return !1;
|
|
12579
12579
|
const n = e.shiftKey;
|
|
12580
12580
|
return !!hl(t, !1) && (e.preventDefault(), pl(t, n, !1), !0);
|
|
12581
12581
|
}, Ge), r.registerCommand(bu, (e) => {
|
|
12582
12582
|
if (bs(e.target)) return !1;
|
|
12583
12583
|
const t = ue();
|
|
12584
|
-
if (!
|
|
12584
|
+
if (!Y(t)) return !1;
|
|
12585
12585
|
const { anchor: n } = t, s = n.getNode();
|
|
12586
12586
|
return t.isCollapsed() && n.offset === 0 && !wt(s) && Yh(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(Ta, void 0)) : (!_l || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(Br, !0));
|
|
12587
12587
|
}, Ge), r.registerCommand(_u, (e) => {
|
|
12588
12588
|
if (bs(e.target)) return !1;
|
|
12589
12589
|
const t = ue();
|
|
12590
|
-
return !!
|
|
12590
|
+
return !!Y(t) && (e.preventDefault(), r.dispatchCommand(Br, !1));
|
|
12591
12591
|
}, Ge), r.registerCommand(Rs, (e) => {
|
|
12592
12592
|
const t = ue();
|
|
12593
|
-
if (!
|
|
12593
|
+
if (!Y(t)) return !1;
|
|
12594
12594
|
if (e !== null) {
|
|
12595
12595
|
if ((_l || lp || cp) && ap) return !1;
|
|
12596
12596
|
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(Zr, !1);
|
|
@@ -12598,7 +12598,7 @@ function fp(r) {
|
|
|
12598
12598
|
return r.dispatchCommand(zn, void 0);
|
|
12599
12599
|
}, Ge), r.registerCommand(vu, () => {
|
|
12600
12600
|
const e = ue();
|
|
12601
|
-
return !!
|
|
12601
|
+
return !!Y(e) && (r.blur(), !0);
|
|
12602
12602
|
}, Ge), r.registerCommand(wu, (e) => {
|
|
12603
12603
|
const [, t] = xs(e);
|
|
12604
12604
|
if (t.length > 0) {
|
|
@@ -12620,13 +12620,13 @@ function fp(r) {
|
|
|
12620
12620
|
return e.preventDefault(), !0;
|
|
12621
12621
|
}
|
|
12622
12622
|
const n = ue();
|
|
12623
|
-
return !!
|
|
12623
|
+
return !!Y(n);
|
|
12624
12624
|
}, Ge), r.registerCommand(Cu, (e) => {
|
|
12625
12625
|
const [t] = xs(e), n = ue();
|
|
12626
|
-
return !(t && !
|
|
12626
|
+
return !(t && !Y(n));
|
|
12627
12627
|
}, Ge), r.registerCommand(Su, (e) => {
|
|
12628
12628
|
const [t] = xs(e), n = ue();
|
|
12629
|
-
if (t && !
|
|
12629
|
+
if (t && !Y(n)) return !1;
|
|
12630
12630
|
const s = vl(e.clientX, e.clientY);
|
|
12631
12631
|
if (s !== null) {
|
|
12632
12632
|
const i = on(s.node);
|
|
@@ -12636,7 +12636,7 @@ function fp(r) {
|
|
|
12636
12636
|
}, Ge), r.registerCommand(to, () => (eh(), !0), Ge), r.registerCommand(di, (e) => (xl(r, vr(e, ClipboardEvent) ? e : null), !0), Ge), r.registerCommand(Io, (e) => (async function(t, n) {
|
|
12637
12637
|
await xl(n, vr(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
12638
12638
|
const s = ue();
|
|
12639
|
-
|
|
12639
|
+
Y(s) ? s.removeText() : Qt(s) && s.getNodes().forEach((i) => i.remove());
|
|
12640
12640
|
});
|
|
12641
12641
|
}(e, r), !0), Ge), r.registerCommand(ci, (e) => {
|
|
12642
12642
|
const [, t, n] = xs(e);
|
|
@@ -12692,7 +12692,7 @@ function pp({ content: r }) {
|
|
|
12692
12692
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
12693
12693
|
}
|
|
12694
12694
|
const Ac = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? cn : Ce;
|
|
12695
|
-
function gp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: i, ariaExpanded: o, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: h, autoCapitalize: p, className: g, id: m, role: y = "textbox", spellCheck: _ = !0, style: x, tabIndex: w, "data-testid": C, ...
|
|
12695
|
+
function gp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: i, ariaExpanded: o, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: h, autoCapitalize: p, className: g, id: m, role: y = "textbox", spellCheck: _ = !0, style: x, tabIndex: w, "data-testid": C, ...k }, S) {
|
|
12696
12696
|
const [v, D] = R(r.isEditable()), N = re((T) => {
|
|
12697
12697
|
T && T.ownerDocument && T.ownerDocument.defaultView ? r.setRootElement(T) : r.setRootElement(null);
|
|
12698
12698
|
}, [r]), B = dt(() => /* @__PURE__ */ function(...T) {
|
|
@@ -12701,10 +12701,10 @@ function gp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
|
|
|
12701
12701
|
typeof M == "function" ? M(j) : M != null && (M.current = j);
|
|
12702
12702
|
});
|
|
12703
12703
|
};
|
|
12704
|
-
}(
|
|
12704
|
+
}(S, N), [N, S]);
|
|
12705
12705
|
return Ac(() => (D(r.isEditable()), r.registerEditableListener((T) => {
|
|
12706
12706
|
D(T);
|
|
12707
|
-
})), [r]), f.jsx("div", { "aria-activedescendant": v ? e : void 0, "aria-autocomplete": v ? t : "none", "aria-controls": v ? n : void 0, "aria-describedby": s, ...i != null ? { "aria-errormessage": i } : {}, "aria-expanded": v && y === "combobox" ? !!o : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": v ? d : void 0, "aria-readonly": !v || void 0, "aria-required": h, autoCapitalize: p, className: g, contentEditable: v, "data-testid": C, id: m, ref: B, role: v ? y : void 0, spellCheck: _, style: x, tabIndex: w, ...
|
|
12707
|
+
})), [r]), f.jsx("div", { "aria-activedescendant": v ? e : void 0, "aria-autocomplete": v ? t : "none", "aria-controls": v ? n : void 0, "aria-describedby": s, ...i != null ? { "aria-errormessage": i } : {}, "aria-expanded": v && y === "combobox" ? !!o : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": v ? d : void 0, "aria-readonly": !v || void 0, "aria-required": h, autoCapitalize: p, className: g, contentEditable: v, "data-testid": C, id: m, ref: B, role: v ? y : void 0, spellCheck: _, style: x, tabIndex: w, ...k });
|
|
12708
12708
|
}
|
|
12709
12709
|
const mp = Fo(gp);
|
|
12710
12710
|
function El(r) {
|
|
@@ -12741,19 +12741,19 @@ function Cp(r, e, t, n, s) {
|
|
|
12741
12741
|
if (r === null || t.size === 0 && n.size === 0 && !s) return $t;
|
|
12742
12742
|
const i = e._selection, o = r._selection;
|
|
12743
12743
|
if (s) return vp;
|
|
12744
|
-
if (!(
|
|
12744
|
+
if (!(Y(i) && Y(o) && o.isCollapsed() && i.isCollapsed())) return $t;
|
|
12745
12745
|
const l = function(_, x, w) {
|
|
12746
|
-
const C = _._nodeMap,
|
|
12747
|
-
for (const
|
|
12748
|
-
const v = C.get(
|
|
12749
|
-
v !== void 0 &&
|
|
12746
|
+
const C = _._nodeMap, k = [];
|
|
12747
|
+
for (const S of x) {
|
|
12748
|
+
const v = C.get(S);
|
|
12749
|
+
v !== void 0 && k.push(v);
|
|
12750
12750
|
}
|
|
12751
|
-
for (const [
|
|
12751
|
+
for (const [S, v] of w) {
|
|
12752
12752
|
if (!v) continue;
|
|
12753
|
-
const D = C.get(
|
|
12754
|
-
D === void 0 || wt(D) ||
|
|
12753
|
+
const D = C.get(S);
|
|
12754
|
+
D === void 0 || wt(D) || k.push(D);
|
|
12755
12755
|
}
|
|
12756
|
-
return
|
|
12756
|
+
return k;
|
|
12757
12757
|
}(e, t, n);
|
|
12758
12758
|
if (l.length === 0) return $t;
|
|
12759
12759
|
if (l.length > 1) {
|
|
@@ -12780,8 +12780,8 @@ function Sp(r, e) {
|
|
|
12780
12780
|
if (s === null) return bo;
|
|
12781
12781
|
const m = i._selection;
|
|
12782
12782
|
return l.size > 0 || a.size > 0 ? g === !1 && d !== $t && d === n && c < t + e && p || l.size === 1 && function(y, _, x) {
|
|
12783
|
-
const w = _._nodeMap.get(y), C = x._nodeMap.get(y),
|
|
12784
|
-
return !(
|
|
12783
|
+
const w = _._nodeMap.get(y), C = x._nodeMap.get(y), k = _._selection, S = x._selection;
|
|
12784
|
+
return !(Y(k) && Y(S) && k.anchor.type === "element" && k.focus.type === "element" && S.anchor.type === "text" && S.focus.type === "text" || !ee(w) || !ee(C) || w.__parent !== C.__parent) && JSON.stringify(_.read(() => w.exportJSON())) === JSON.stringify(x.read(() => C.exportJSON()));
|
|
12785
12785
|
}(Array.from(l)[0], s, i) ? vs : bo : m !== null ? vs : vo;
|
|
12786
12786
|
})();
|
|
12787
12787
|
return t = c, n = d, h;
|
|
@@ -12931,7 +12931,7 @@ function Bl(r, e) {
|
|
|
12931
12931
|
const t = ue();
|
|
12932
12932
|
if (t !== null) {
|
|
12933
12933
|
const n = t.getNodes();
|
|
12934
|
-
if (
|
|
12934
|
+
if (Y(t)) {
|
|
12935
12935
|
const i = t.getStartEndPoints();
|
|
12936
12936
|
i === null && Jt(143);
|
|
12937
12937
|
const [o] = i, l = o.getNode(), a = l.getParent();
|
|
@@ -13002,7 +13002,7 @@ function ca(r, e) {
|
|
|
13002
13002
|
function Fp(r) {
|
|
13003
13003
|
r.update(() => {
|
|
13004
13004
|
const e = ue();
|
|
13005
|
-
if (
|
|
13005
|
+
if (Y(e)) {
|
|
13006
13006
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes(), s = e.anchor.getNode();
|
|
13007
13007
|
if (Nc(s, n)) t.add(wo(s));
|
|
13008
13008
|
else for (let i = 0; i < n.length; i++) {
|
|
@@ -13066,7 +13066,7 @@ function Lp(r) {
|
|
|
13066
13066
|
}
|
|
13067
13067
|
function Pp() {
|
|
13068
13068
|
const r = ue();
|
|
13069
|
-
if (!
|
|
13069
|
+
if (!Y(r) || !r.isCollapsed()) return !1;
|
|
13070
13070
|
const e = r.anchor.getNode();
|
|
13071
13071
|
if (!ot(e) || e.getChildrenSize() !== 0) return !1;
|
|
13072
13072
|
const t = wo(e), n = e.getParent();
|
|
@@ -13247,7 +13247,7 @@ class Ur extends hr {
|
|
|
13247
13247
|
return an(e) || ot(e);
|
|
13248
13248
|
}
|
|
13249
13249
|
extractWithChild(e, t) {
|
|
13250
|
-
if (!
|
|
13250
|
+
if (!Y(t)) return !1;
|
|
13251
13251
|
const n = t.anchor.getNode(), s = t.focus.getNode();
|
|
13252
13252
|
return this.isParentOf(n) && this.isParentOf(s) && this.getTextContent().length === t.getTextContent().length;
|
|
13253
13253
|
}
|
|
@@ -13523,7 +13523,7 @@ class Wr extends hr {
|
|
|
13523
13523
|
return !0;
|
|
13524
13524
|
}
|
|
13525
13525
|
extractWithChild(e, t, n) {
|
|
13526
|
-
if (!
|
|
13526
|
+
if (!Y(t)) return !1;
|
|
13527
13527
|
const s = t.anchor.getNode(), i = t.focus.getNode();
|
|
13528
13528
|
return this.isParentOf(s) && this.isParentOf(i) && t.getTextContent().length > 0;
|
|
13529
13529
|
}
|
|
@@ -13599,7 +13599,7 @@ function Vp(r) {
|
|
|
13599
13599
|
const zl = Qn();
|
|
13600
13600
|
function Ki(r, e = {}) {
|
|
13601
13601
|
const { target: t, title: n } = e, s = e.rel === void 0 ? "noreferrer" : e.rel, i = ue();
|
|
13602
|
-
if (!
|
|
13602
|
+
if (!Y(i)) return;
|
|
13603
13603
|
const o = i.extract();
|
|
13604
13604
|
if (r === null) o.forEach((l) => {
|
|
13605
13605
|
const a = Ci(l, (u) => !Vp(u) && _n(u));
|
|
@@ -13648,7 +13648,7 @@ function Gp({ validateUrl: r, attributes: e }) {
|
|
|
13648
13648
|
}
|
|
13649
13649
|
}, Jr), r !== void 0 ? t.registerCommand(ci, (n) => {
|
|
13650
13650
|
const s = ue();
|
|
13651
|
-
if (!
|
|
13651
|
+
if (!Y(s) || s.isCollapsed() || !vr(n, ClipboardEvent)) return !1;
|
|
13652
13652
|
const i = n;
|
|
13653
13653
|
if (i.clipboardData === null) return !1;
|
|
13654
13654
|
const o = i.clipboardData.getData("text");
|
|
@@ -13962,15 +13962,15 @@ var Or;
|
|
|
13962
13962
|
let y = [];
|
|
13963
13963
|
const _ = ze.reedSolomonComputeDivisor(h);
|
|
13964
13964
|
for (let w = 0, C = 0; w < d; w++) {
|
|
13965
|
-
let
|
|
13966
|
-
C +=
|
|
13967
|
-
const
|
|
13968
|
-
w < g &&
|
|
13965
|
+
let k = a.slice(C, C + m - h + (w < g ? 0 : 1));
|
|
13966
|
+
C += k.length;
|
|
13967
|
+
const S = ze.reedSolomonComputeRemainder(k, _);
|
|
13968
|
+
w < g && k.push(0), y.push(k.concat(S));
|
|
13969
13969
|
}
|
|
13970
13970
|
let x = [];
|
|
13971
13971
|
for (let w = 0; w < y[0].length; w++)
|
|
13972
|
-
y.forEach((C,
|
|
13973
|
-
(w != m - h ||
|
|
13972
|
+
y.forEach((C, k) => {
|
|
13973
|
+
(w != m - h || k >= g) && x.push(C[w]);
|
|
13974
13974
|
});
|
|
13975
13975
|
return s(x.length == p), x;
|
|
13976
13976
|
}
|
|
@@ -14445,12 +14445,12 @@ var ng = function() {
|
|
|
14445
14445
|
"boostLevel",
|
|
14446
14446
|
"marginSize",
|
|
14447
14447
|
"imageSettings"
|
|
14448
|
-
]), { style: y } = m, _ = So(m, ["style"]), x = p == null ? void 0 : p.src, w = Le.useRef(null), C = Le.useRef(null),
|
|
14448
|
+
]), { style: y } = m, _ = So(m, ["style"]), x = p == null ? void 0 : p.src, w = Le.useRef(null), C = Le.useRef(null), k = Le.useCallback(
|
|
14449
14449
|
(b) => {
|
|
14450
14450
|
w.current = b, typeof t == "function" ? t(b) : t && (t.current = b);
|
|
14451
14451
|
},
|
|
14452
14452
|
[t]
|
|
14453
|
-
), [
|
|
14453
|
+
), [S, v] = Le.useState(!1), { margin: D, cells: N, numCells: B, calculatedImageSettings: T } = Wc({
|
|
14454
14454
|
value: s,
|
|
14455
14455
|
level: o,
|
|
14456
14456
|
minVersion: c,
|
|
@@ -14509,7 +14509,7 @@ var ng = function() {
|
|
|
14509
14509
|
style: j,
|
|
14510
14510
|
height: i,
|
|
14511
14511
|
width: i,
|
|
14512
|
-
ref:
|
|
14512
|
+
ref: k,
|
|
14513
14513
|
role: "img"
|
|
14514
14514
|
}, _)
|
|
14515
14515
|
), M);
|
|
@@ -14552,11 +14552,11 @@ var Hc = Le.forwardRef(
|
|
|
14552
14552
|
imageSettings: g,
|
|
14553
14553
|
size: i
|
|
14554
14554
|
});
|
|
14555
|
-
let C = _,
|
|
14555
|
+
let C = _, k = null;
|
|
14556
14556
|
g != null && w != null && (w.excavation != null && (C = Uc(
|
|
14557
14557
|
_,
|
|
14558
14558
|
w.excavation
|
|
14559
|
-
)),
|
|
14559
|
+
)), k = /* @__PURE__ */ Le.createElement(
|
|
14560
14560
|
"image",
|
|
14561
14561
|
{
|
|
14562
14562
|
href: g.src,
|
|
@@ -14569,7 +14569,7 @@ var Hc = Le.forwardRef(
|
|
|
14569
14569
|
crossOrigin: w.crossOrigin
|
|
14570
14570
|
}
|
|
14571
14571
|
));
|
|
14572
|
-
const
|
|
14572
|
+
const S = qc(C, y);
|
|
14573
14573
|
return /* @__PURE__ */ Le.createElement(
|
|
14574
14574
|
"svg",
|
|
14575
14575
|
Co({
|
|
@@ -14588,8 +14588,8 @@ var Hc = Le.forwardRef(
|
|
|
14588
14588
|
shapeRendering: "crispEdges"
|
|
14589
14589
|
}
|
|
14590
14590
|
),
|
|
14591
|
-
/* @__PURE__ */ Le.createElement("path", { fill: a, d:
|
|
14592
|
-
|
|
14591
|
+
/* @__PURE__ */ Le.createElement("path", { fill: a, d: S, shapeRendering: "crispEdges" }),
|
|
14592
|
+
k
|
|
14593
14593
|
);
|
|
14594
14594
|
}
|
|
14595
14595
|
);
|
|
@@ -14713,7 +14713,7 @@ function ug({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14713
14713
|
}, [u]), w = re(() => {
|
|
14714
14714
|
u.update(() => {
|
|
14715
14715
|
const v = ue();
|
|
14716
|
-
|
|
14716
|
+
Y(v) && qh(v, () => ua());
|
|
14717
14717
|
});
|
|
14718
14718
|
}, [u]), C = {
|
|
14719
14719
|
display: "flex",
|
|
@@ -14729,11 +14729,11 @@ function ug({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14729
14729
|
fontSize: "14px",
|
|
14730
14730
|
fontWeight: 600,
|
|
14731
14731
|
opacity: e ? 0.5 : 1
|
|
14732
|
-
},
|
|
14732
|
+
}, k = `
|
|
14733
14733
|
.mail-editor-toolbar-btn:hover:not(:disabled) {
|
|
14734
14734
|
background: ${r.border};
|
|
14735
14735
|
}
|
|
14736
|
-
`,
|
|
14736
|
+
`, S = () => {
|
|
14737
14737
|
setTimeout(() => {
|
|
14738
14738
|
var v;
|
|
14739
14739
|
(v = h.current) != null && v.contains(document.activeElement) || d(!1);
|
|
@@ -14751,7 +14751,7 @@ function ug({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14751
14751
|
background: r.toolbarBackground
|
|
14752
14752
|
},
|
|
14753
14753
|
children: [
|
|
14754
|
-
/* @__PURE__ */ f.jsx("style", { children:
|
|
14754
|
+
/* @__PURE__ */ f.jsx("style", { children: k }),
|
|
14755
14755
|
/* @__PURE__ */ f.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px" }, children: [
|
|
14756
14756
|
/* @__PURE__ */ f.jsx(
|
|
14757
14757
|
"button",
|
|
@@ -14869,7 +14869,7 @@ function ug({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14869
14869
|
type: "button",
|
|
14870
14870
|
onClick: () => d(!c),
|
|
14871
14871
|
disabled: i || !a || e,
|
|
14872
|
-
onBlur:
|
|
14872
|
+
onBlur: S,
|
|
14873
14873
|
style: {
|
|
14874
14874
|
display: "flex",
|
|
14875
14875
|
alignItems: "center",
|
|
@@ -15036,14 +15036,14 @@ function dg({ text: r, trigger: e }) {
|
|
|
15036
15036
|
const s = r.trim();
|
|
15037
15037
|
s && (t.update(() => {
|
|
15038
15038
|
const i = ue();
|
|
15039
|
-
if (
|
|
15039
|
+
if (Y(i))
|
|
15040
15040
|
i.insertText(s);
|
|
15041
15041
|
else {
|
|
15042
15042
|
const o = st(), l = o.getLastChild();
|
|
15043
15043
|
if (l) {
|
|
15044
15044
|
l.selectEnd();
|
|
15045
15045
|
const a = ue();
|
|
15046
|
-
|
|
15046
|
+
Y(a) && a.insertText(s);
|
|
15047
15047
|
} else {
|
|
15048
15048
|
const a = ft(), u = ht(s);
|
|
15049
15049
|
a.append(u), o.append(a);
|
|
@@ -15127,7 +15127,7 @@ function hg({
|
|
|
15127
15127
|
aiProcessingAction: m,
|
|
15128
15128
|
renderAboveToolbar: y
|
|
15129
15129
|
}) {
|
|
15130
|
-
const _ = { ...ag, ...s }, [x, w] = Le.useState(!1), C = Le.useRef(void 0), [
|
|
15130
|
+
const _ = { ...ag, ...s }, [x, w] = Le.useState(!1), C = Le.useRef(void 0), [k, S] = Le.useState(r), [v, D] = Le.useState(!1), [N, B] = Le.useState(null), T = g ?? v, j = m ?? N;
|
|
15131
15131
|
Le.useEffect(() => {
|
|
15132
15132
|
a !== void 0 && a !== C.current && (C.current = a, w(!0));
|
|
15133
15133
|
}, [a]);
|
|
@@ -15135,21 +15135,21 @@ function hg({
|
|
|
15135
15135
|
w(!1);
|
|
15136
15136
|
}, []), b = (U) => U.replace(/<[^>]*>/g, "").trim(), E = (U) => U.split(`
|
|
15137
15137
|
`).map((H) => `<p>${H || "<br>"}</p>`).join(""), F = async (U) => {
|
|
15138
|
-
const H = b(
|
|
15138
|
+
const H = b(k);
|
|
15139
15139
|
if (!H) return;
|
|
15140
15140
|
const V = U === "restructure" ? d : U === "proofread" ? h : p;
|
|
15141
15141
|
if (V) {
|
|
15142
15142
|
D(!0), B(U);
|
|
15143
15143
|
try {
|
|
15144
15144
|
const ie = await V(H), ce = E(ie);
|
|
15145
|
-
|
|
15145
|
+
S(ce), e == null || e(ce), C.current = Date.now(), w(!0);
|
|
15146
15146
|
} catch (ie) {
|
|
15147
15147
|
console.error(`AI ${U} failed:`, ie);
|
|
15148
15148
|
} finally {
|
|
15149
15149
|
D(!1), B(null);
|
|
15150
15150
|
}
|
|
15151
15151
|
}
|
|
15152
|
-
}, P = b(
|
|
15152
|
+
}, P = b(k).length > 0, q = {
|
|
15153
15153
|
namespace: "MailEditor",
|
|
15154
15154
|
theme: lg,
|
|
15155
15155
|
onError: (U) => {
|
|
@@ -15161,7 +15161,7 @@ function hg({
|
|
|
15161
15161
|
(U, H) => {
|
|
15162
15162
|
U.read(() => {
|
|
15163
15163
|
const V = Cc(H, null);
|
|
15164
|
-
|
|
15164
|
+
S(V), e == null || e(V);
|
|
15165
15165
|
});
|
|
15166
15166
|
},
|
|
15167
15167
|
[e]
|
|
@@ -15297,7 +15297,7 @@ function hg({
|
|
|
15297
15297
|
/* @__PURE__ */ f.jsx(
|
|
15298
15298
|
cg,
|
|
15299
15299
|
{
|
|
15300
|
-
html: x ?
|
|
15300
|
+
html: x ? k : r,
|
|
15301
15301
|
isExternalUpdate: x,
|
|
15302
15302
|
onImportComplete: M
|
|
15303
15303
|
}
|
|
@@ -15356,8 +15356,8 @@ function U2({
|
|
|
15356
15356
|
hideSubjectField: x = !1,
|
|
15357
15357
|
minHeight: w = "200px",
|
|
15358
15358
|
hideCancelButton: C = !1,
|
|
15359
|
-
onAiRestructure:
|
|
15360
|
-
onAiProofread:
|
|
15359
|
+
onAiRestructure: k,
|
|
15360
|
+
onAiProofread: S,
|
|
15361
15361
|
onAiRewrite: v,
|
|
15362
15362
|
onAiGenerate: D,
|
|
15363
15363
|
renderAboveToolbar: N,
|
|
@@ -15367,7 +15367,7 @@ function U2({
|
|
|
15367
15367
|
initialAttachments: M,
|
|
15368
15368
|
onAttachmentsChange: b
|
|
15369
15369
|
}) {
|
|
15370
|
-
const E = { ...pg, ...h }, [F, P] = R(r), [q, Z] = R(e), [ne, U] = R(t), [H, V] = R(n), [ie, ce] = R(s), [de, ye] = R([]), [ve, Se] = R(M || []), [$, Me] = R(!1), [oe, Pe] = R(""), [Te, Ee] = R(g || !!e || !!t), [De, Ie] = R("message"), [qe, G] = R(T), [I, Ye] = R(!1), [et,
|
|
15370
|
+
const E = { ...pg, ...h }, [F, P] = R(r), [q, Z] = R(e), [ne, U] = R(t), [H, V] = R(n), [ie, ce] = R(s), [de, ye] = R([]), [ve, Se] = R(M || []), [$, Me] = R(!1), [oe, Pe] = R(""), [Te, Ee] = R(g || !!e || !!t), [De, Ie] = R("message"), [qe, G] = R(T), [I, Ye] = R(!1), [et, K] = R(!0), [te, pe] = R(!0);
|
|
15371
15371
|
Le.useEffect(() => {
|
|
15372
15372
|
P(r);
|
|
15373
15373
|
}, [r]), Le.useEffect(() => {
|
|
@@ -15810,8 +15810,8 @@ function U2({
|
|
|
15810
15810
|
externalUpdate: St ? u : void 0,
|
|
15811
15811
|
insertText: c,
|
|
15812
15812
|
insertTextTrigger: d,
|
|
15813
|
-
onAiRestructure:
|
|
15814
|
-
onAiProofread:
|
|
15813
|
+
onAiRestructure: k,
|
|
15814
|
+
onAiProofread: S,
|
|
15815
15815
|
onAiRewrite: v,
|
|
15816
15816
|
renderAboveToolbar: N
|
|
15817
15817
|
}
|
|
@@ -15961,7 +15961,7 @@ function U2({
|
|
|
15961
15961
|
{
|
|
15962
15962
|
type: "checkbox",
|
|
15963
15963
|
checked: et,
|
|
15964
|
-
onChange: (z) =>
|
|
15964
|
+
onChange: (z) => K(z.target.checked),
|
|
15965
15965
|
disabled: p || $ || I,
|
|
15966
15966
|
style: { width: "16px", height: "16px", cursor: "pointer" }
|
|
15967
15967
|
}
|
|
@@ -16110,21 +16110,21 @@ function W2({
|
|
|
16110
16110
|
var j;
|
|
16111
16111
|
return ((j = T.label) == null ? void 0 : j.toLowerCase().includes(y.toLowerCase())) && !e.includes(T.id);
|
|
16112
16112
|
}
|
|
16113
|
-
),
|
|
16113
|
+
), k = s && y.trim() && !r.some((T) => {
|
|
16114
16114
|
var j;
|
|
16115
16115
|
return ((j = T.label) == null ? void 0 : j.toLowerCase()) === y.toLowerCase();
|
|
16116
|
-
}),
|
|
16116
|
+
}), S = e.map((T) => r.find((j) => j.id === T)).filter(Boolean), v = re((T) => {
|
|
16117
16117
|
var j;
|
|
16118
16118
|
c > 0 && e.length >= c || (t([...e, T]), _(""), c === 1 ? m(!1) : (j = w.current) == null || j.focus());
|
|
16119
16119
|
}, [e, t, c]), D = re((T) => {
|
|
16120
16120
|
t(e.filter((j) => j !== T));
|
|
16121
16121
|
}, [e, t]), N = re(async () => {
|
|
16122
|
-
if (!
|
|
16122
|
+
if (!k) return;
|
|
16123
16123
|
const T = await (i == null ? void 0 : i(y.trim()));
|
|
16124
16124
|
T && v(T.id), _("");
|
|
16125
|
-
}, [
|
|
16126
|
-
T.key === "Enter" ? (T.preventDefault(),
|
|
16127
|
-
}, [
|
|
16125
|
+
}, [k, y, i, v]), B = re((T) => {
|
|
16126
|
+
T.key === "Enter" ? (T.preventDefault(), k ? N() : C.length > 0 && v(C[0].id)) : T.key === "Backspace" && !y && e.length > 0 ? D(e[e.length - 1]) : T.key === "Escape" && (m(!1), _(""));
|
|
16127
|
+
}, [k, C, y, e, N, v, D]);
|
|
16128
16128
|
return /* @__PURE__ */ f.jsxs("div", { ref: x, className: h, style: { position: "relative" }, children: [
|
|
16129
16129
|
a && /* @__PURE__ */ f.jsx(
|
|
16130
16130
|
"label",
|
|
@@ -16156,7 +16156,7 @@ function W2({
|
|
|
16156
16156
|
alignItems: "center"
|
|
16157
16157
|
},
|
|
16158
16158
|
children: [
|
|
16159
|
-
|
|
16159
|
+
S.map((T) => /* @__PURE__ */ f.jsxs(
|
|
16160
16160
|
"span",
|
|
16161
16161
|
{
|
|
16162
16162
|
style: {
|
|
@@ -16205,7 +16205,7 @@ function W2({
|
|
|
16205
16205
|
},
|
|
16206
16206
|
onFocus: () => m(!0),
|
|
16207
16207
|
onKeyDown: B,
|
|
16208
|
-
placeholder:
|
|
16208
|
+
placeholder: S.length === 0 ? n : "",
|
|
16209
16209
|
disabled: u || c > 0 && e.length >= c,
|
|
16210
16210
|
style: {
|
|
16211
16211
|
flex: 1,
|
|
@@ -16238,7 +16238,7 @@ function W2({
|
|
|
16238
16238
|
overflowY: "auto",
|
|
16239
16239
|
zIndex: 50
|
|
16240
16240
|
},
|
|
16241
|
-
children: C.length === 0 && !
|
|
16241
|
+
children: C.length === 0 && !k ? /* @__PURE__ */ f.jsx(
|
|
16242
16242
|
"div",
|
|
16243
16243
|
{
|
|
16244
16244
|
style: {
|
|
@@ -16300,7 +16300,7 @@ function W2({
|
|
|
16300
16300
|
},
|
|
16301
16301
|
T.id
|
|
16302
16302
|
)),
|
|
16303
|
-
|
|
16303
|
+
k && /* @__PURE__ */ f.jsxs(
|
|
16304
16304
|
"div",
|
|
16305
16305
|
{
|
|
16306
16306
|
onClick: N,
|
|
@@ -16460,9 +16460,9 @@ function H2({
|
|
|
16460
16460
|
}, []);
|
|
16461
16461
|
const C = (N) => {
|
|
16462
16462
|
s && s(N), g(!1), h("");
|
|
16463
|
-
}, S = () => {
|
|
16464
|
-
o && o(d.trim() || void 0), g(!1), h("");
|
|
16465
16463
|
}, k = () => {
|
|
16464
|
+
o && o(d.trim() || void 0), g(!1), h("");
|
|
16465
|
+
}, S = () => {
|
|
16466
16466
|
g(!0);
|
|
16467
16467
|
}, v = (N) => {
|
|
16468
16468
|
h(N.target.value), p || g(!0);
|
|
@@ -16554,7 +16554,7 @@ function H2({
|
|
|
16554
16554
|
type: "text",
|
|
16555
16555
|
value: d,
|
|
16556
16556
|
onChange: v,
|
|
16557
|
-
onFocus:
|
|
16557
|
+
onFocus: S,
|
|
16558
16558
|
onKeyDown: D,
|
|
16559
16559
|
placeholder: n,
|
|
16560
16560
|
style: {
|
|
@@ -16577,7 +16577,7 @@ function H2({
|
|
|
16577
16577
|
o && /* @__PURE__ */ f.jsx(
|
|
16578
16578
|
"button",
|
|
16579
16579
|
{
|
|
16580
|
-
onClick:
|
|
16580
|
+
onClick: k,
|
|
16581
16581
|
style: {
|
|
16582
16582
|
display: "flex",
|
|
16583
16583
|
alignItems: "center",
|
|
@@ -16635,18 +16635,18 @@ function V2({
|
|
|
16635
16635
|
columnStyle: p,
|
|
16636
16636
|
itemClassName: g = ""
|
|
16637
16637
|
}) {
|
|
16638
|
-
const [m, y] = R(null), [_, x] = R(null), [w, C] = R(null),
|
|
16638
|
+
const [m, y] = R(null), [_, x] = R(null), [w, C] = R(null), k = we(null), S = e.reduce((M, b) => {
|
|
16639
16639
|
let E = r.filter((F) => n(F) === b.id);
|
|
16640
16640
|
return s && (E = E.sort((F, P) => s(F) - s(P))), M[b.id] = E, M;
|
|
16641
16641
|
}, {}), v = re((M, b) => {
|
|
16642
16642
|
const E = t(b), F = n(b);
|
|
16643
|
-
y(E),
|
|
16643
|
+
y(E), k.current = F, M.dataTransfer.effectAllowed = "move", M.dataTransfer.setData("text/plain", E), requestAnimationFrame(() => {
|
|
16644
16644
|
const P = M.target;
|
|
16645
16645
|
P.style.opacity = "0.5";
|
|
16646
16646
|
});
|
|
16647
16647
|
}, [t, n]), D = re((M) => {
|
|
16648
16648
|
const b = M.target;
|
|
16649
|
-
b.style.opacity = "1", y(null), x(null), C(null),
|
|
16649
|
+
b.style.opacity = "1", y(null), x(null), C(null), k.current = null;
|
|
16650
16650
|
}, []), N = re((M, b, E) => {
|
|
16651
16651
|
M.preventDefault(), M.dataTransfer.dropEffect = "move", x(b), C(E);
|
|
16652
16652
|
}, []), B = re((M) => {
|
|
@@ -16654,8 +16654,8 @@ function V2({
|
|
|
16654
16654
|
b != null && b.closest("[data-kanban-column]") || (x(null), C(null));
|
|
16655
16655
|
}, []), T = re((M, b, E) => {
|
|
16656
16656
|
if (M.preventDefault(), !m) return;
|
|
16657
|
-
const F =
|
|
16658
|
-
F === b ? l == null || l(m, b, E) : F && o(m, F, b, E), y(null), x(null), C(null),
|
|
16657
|
+
const F = k.current;
|
|
16658
|
+
F === b ? l == null || l(m, b, E) : F && o(m, F, b, E), y(null), x(null), C(null), k.current = null;
|
|
16659
16659
|
}, [m, o, l]), j = (M, b) => /* @__PURE__ */ f.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
16660
16660
|
/* @__PURE__ */ f.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
16661
16661
|
M.color && /* @__PURE__ */ f.jsx(
|
|
@@ -16675,7 +16675,7 @@ function V2({
|
|
|
16675
16675
|
className: `flex gap-4 overflow-x-auto pb-4 h-full ${d}`,
|
|
16676
16676
|
style: { alignItems: "flex-start" },
|
|
16677
16677
|
children: e.map((M) => {
|
|
16678
|
-
const b =
|
|
16678
|
+
const b = S[M.id] || [], E = _ === M.id, F = b.length > 0 || E;
|
|
16679
16679
|
return /* @__PURE__ */ f.jsxs(
|
|
16680
16680
|
"div",
|
|
16681
16681
|
{
|
|
@@ -17279,11 +17279,11 @@ function K2({
|
|
|
17279
17279
|
return { top: b, height: F };
|
|
17280
17280
|
},
|
|
17281
17281
|
[i, o, t, n, s]
|
|
17282
|
-
),
|
|
17282
|
+
), k = dt(() => {
|
|
17283
17283
|
if (!h || !Dg(e)) return null;
|
|
17284
17284
|
const v = /* @__PURE__ */ new Date(), D = v.getHours(), N = v.getMinutes();
|
|
17285
17285
|
return D < t || D > n ? null : (D - t) * s + N / 60 * s;
|
|
17286
|
-
}, [e, h, t, n, s]),
|
|
17286
|
+
}, [e, h, t, n, s]), S = re(
|
|
17287
17287
|
(v) => {
|
|
17288
17288
|
if (!d) return;
|
|
17289
17289
|
const D = v.currentTarget.getBoundingClientRect(), B = (v.clientY - D.top) / s * 60, T = Math.floor(B / 60) + t, j = Math.round(B % 60 / 15) * 15, M = Math.min(n, Math.max(t, T)), b = j >= 60 ? 0 : j, E = `${M.toString().padStart(2, "0")}:${b.toString().padStart(2, "0")}`;
|
|
@@ -17382,17 +17382,17 @@ function K2({
|
|
|
17382
17382
|
bottom: 0,
|
|
17383
17383
|
cursor: d ? "pointer" : "default"
|
|
17384
17384
|
},
|
|
17385
|
-
onClick:
|
|
17385
|
+
onClick: S
|
|
17386
17386
|
}
|
|
17387
17387
|
),
|
|
17388
|
-
|
|
17388
|
+
k !== null && /* @__PURE__ */ f.jsxs(
|
|
17389
17389
|
"div",
|
|
17390
17390
|
{
|
|
17391
17391
|
style: {
|
|
17392
17392
|
position: "absolute",
|
|
17393
17393
|
left: "55px",
|
|
17394
17394
|
right: 0,
|
|
17395
|
-
top:
|
|
17395
|
+
top: k,
|
|
17396
17396
|
zIndex: 20,
|
|
17397
17397
|
pointerEvents: "none"
|
|
17398
17398
|
},
|
|
@@ -17450,7 +17450,7 @@ function K2({
|
|
|
17450
17450
|
] });
|
|
17451
17451
|
}
|
|
17452
17452
|
function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComplete: n, variant: s = "widget", hideSaveButton: i = !1, maxDuration: o = 180 }) {
|
|
17453
|
-
const l = s === "widget", [a, u] = R("idle"), [c, d] = R(0), [h, p] = R(0), [g, m] = R(!1), [y, _] = R(0), [x, w] = R(null), [C,
|
|
17453
|
+
const l = s === "widget", [a, u] = R("idle"), [c, d] = R(0), [h, p] = R(0), [g, m] = R(!1), [y, _] = R(0), [x, w] = R(null), [C, k] = R(!1), [S, v] = R(null), [D, N] = R(!0), [B, T] = R([]), [j, M] = R({ completed: 0, total: 0 }), b = we(!1), E = we(!0);
|
|
17454
17454
|
Ce(() => {
|
|
17455
17455
|
E.current = D;
|
|
17456
17456
|
}, [D]);
|
|
@@ -17536,9 +17536,9 @@ function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
17536
17536
|
}
|
|
17537
17537
|
const Q = Math.sqrt(xe / L), je = Math.min(1, Q * 3);
|
|
17538
17538
|
ye.current.push(je), Ye(), de.current && (V.current = requestAnimationFrame(et));
|
|
17539
|
-
},
|
|
17539
|
+
}, K = async () => {
|
|
17540
17540
|
try {
|
|
17541
|
-
w(null),
|
|
17541
|
+
w(null), k(!1), ve.current === null && (ye.current = []);
|
|
17542
17542
|
const X = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
17543
17543
|
q.current = X;
|
|
17544
17544
|
const L = new AudioContext();
|
|
@@ -17595,7 +17595,7 @@ function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
17595
17595
|
w("Could not access microphone. Please allow microphone access.");
|
|
17596
17596
|
}
|
|
17597
17597
|
}, te = () => {
|
|
17598
|
-
de.current = !1,
|
|
17598
|
+
de.current = !1, k(!1), v(null), V.current && (cancelAnimationFrame(V.current), V.current = null), H.current && (clearInterval(H.current), H.current = null), P.current && P.current.state !== "inactive" && P.current.stop();
|
|
17599
17599
|
}, pe = (X) => {
|
|
17600
17600
|
const L = F.current;
|
|
17601
17601
|
if (!L) return;
|
|
@@ -17616,7 +17616,7 @@ function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
17616
17616
|
}), m(!0)));
|
|
17617
17617
|
}, St = async (X) => {
|
|
17618
17618
|
if (!ce.current) {
|
|
17619
|
-
|
|
17619
|
+
K();
|
|
17620
17620
|
return;
|
|
17621
17621
|
}
|
|
17622
17622
|
try {
|
|
@@ -17624,12 +17624,12 @@ function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
17624
17624
|
const L = h || c;
|
|
17625
17625
|
ve.current = y;
|
|
17626
17626
|
const fe = L > 0 ? y / L : 0, xe = Math.floor(fe * ye.current.length);
|
|
17627
|
-
$.current = ye.current.slice(0, xe), Me.current = ye.current.slice(xe), ye.current = [...$.current],
|
|
17627
|
+
$.current = ye.current.slice(0, xe), Me.current = ye.current.slice(xe), ye.current = [...$.current], K();
|
|
17628
17628
|
} catch {
|
|
17629
17629
|
w("Failed to prepare recording. Please try again.");
|
|
17630
17630
|
}
|
|
17631
17631
|
}, le = () => {
|
|
17632
|
-
ie.current && (ie.current.pause(), ie.current = null), ce.current = null, Se.current = null, ve.current = null, $.current = [], m(!1), _(0), p(0), d(0),
|
|
17632
|
+
ie.current && (ie.current.pause(), ie.current = null), ce.current = null, Se.current = null, ve.current = null, $.current = [], m(!1), _(0), p(0), d(0), K();
|
|
17633
17633
|
}, ge = () => {
|
|
17634
17634
|
ce.current ? r(ce.current, h || c) : alert("No audio recorded yet!");
|
|
17635
17635
|
};
|
|
@@ -17730,7 +17730,7 @@ function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
17730
17730
|
"button",
|
|
17731
17731
|
{
|
|
17732
17732
|
onClick: () => {
|
|
17733
|
-
w(null),
|
|
17733
|
+
w(null), K();
|
|
17734
17734
|
},
|
|
17735
17735
|
style: { padding: "8px 16px", fontSize: "14px", background: "#171717", color: "white", borderRadius: "8px", border: "none", cursor: "pointer" },
|
|
17736
17736
|
children: "Try Again"
|
|
@@ -17802,7 +17802,7 @@ function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
17802
17802
|
onClick: () => {
|
|
17803
17803
|
if (a === "recording") {
|
|
17804
17804
|
const X = P.current;
|
|
17805
|
-
X && (X.state === "recording" ? (X.pause(),
|
|
17805
|
+
X && (X.state === "recording" ? (X.pause(), k(!0)) : X.state === "paused" && (X.resume(), k(!1)));
|
|
17806
17806
|
} else
|
|
17807
17807
|
rt();
|
|
17808
17808
|
},
|
|
@@ -17827,51 +17827,76 @@ function Ag({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
17827
17827
|
"button",
|
|
17828
17828
|
{
|
|
17829
17829
|
onClick: () => {
|
|
17830
|
-
|
|
17830
|
+
S === "insert" ? te() : a === "idle" ? (v("insert"), K()) : a === "editing" && (v("insert"), St("insert"));
|
|
17831
17831
|
},
|
|
17832
|
-
disabled: a === "recording" &&
|
|
17833
|
-
style: a === "recording" &&
|
|
17834
|
-
title:
|
|
17835
|
-
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
17832
|
+
disabled: a === "recording" && S !== "insert" || g,
|
|
17833
|
+
style: a === "recording" && S !== "insert" || g ? Ze : Xe,
|
|
17834
|
+
title: S === "insert" ? "Stop recording" : "Insert recording",
|
|
17835
|
+
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: S === "insert" ? "#ef4444" : "#171717" }, children: "add" })
|
|
17836
17836
|
}
|
|
17837
17837
|
),
|
|
17838
17838
|
/* @__PURE__ */ f.jsx(
|
|
17839
17839
|
"button",
|
|
17840
17840
|
{
|
|
17841
17841
|
onClick: () => {
|
|
17842
|
-
E.current || (
|
|
17842
|
+
E.current || (S === "mic" ? te() : a === "idle" ? (v("mic"), K()) : a === "editing" && (v("mic"), St("replace")));
|
|
17843
17843
|
},
|
|
17844
17844
|
onMouseDown: () => {
|
|
17845
|
-
E.current && a === "idle" && !g && (v("mic"),
|
|
17845
|
+
E.current && a === "idle" && !g && (v("mic"), K());
|
|
17846
17846
|
},
|
|
17847
17847
|
onMouseUp: () => {
|
|
17848
|
-
E.current && a === "recording" &&
|
|
17848
|
+
E.current && a === "recording" && S === "mic" && te();
|
|
17849
17849
|
},
|
|
17850
17850
|
onMouseLeave: () => {
|
|
17851
|
-
E.current && a === "recording" &&
|
|
17851
|
+
E.current && a === "recording" && S === "mic" && te();
|
|
17852
17852
|
},
|
|
17853
17853
|
onTouchStart: (X) => {
|
|
17854
|
-
X.preventDefault(), E.current && a === "idle" && !g && (v("mic"),
|
|
17854
|
+
X.preventDefault(), E.current && a === "idle" && !g && (v("mic"), K());
|
|
17855
17855
|
},
|
|
17856
17856
|
onTouchEnd: (X) => {
|
|
17857
|
-
X.preventDefault(), E.current && a === "recording" &&
|
|
17857
|
+
X.preventDefault(), E.current && a === "recording" && S === "mic" && te();
|
|
17858
|
+
},
|
|
17859
|
+
disabled: a === "recording" && S !== "mic" || g,
|
|
17860
|
+
style: a === "recording" && S !== "mic" || g ? Ze : Xe,
|
|
17861
|
+
title: D ? "Hold to record (walkie-talkie)" : S === "mic" ? "Stop recording" : "Record",
|
|
17862
|
+
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: S === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
|
|
17863
|
+
}
|
|
17864
|
+
),
|
|
17865
|
+
/* @__PURE__ */ f.jsx(
|
|
17866
|
+
"button",
|
|
17867
|
+
{
|
|
17868
|
+
onClick: () => {
|
|
17869
|
+
a === "idle" && !g ? (v("round"), K()) : a === "recording" && S === "round" && te();
|
|
17870
|
+
},
|
|
17871
|
+
disabled: a === "editing" || a === "recording" && S !== "round" || g,
|
|
17872
|
+
style: a === "editing" || a === "recording" && S !== "round" || g ? Ze : {
|
|
17873
|
+
...Xe,
|
|
17874
|
+
width: "28px",
|
|
17875
|
+
height: "28px",
|
|
17876
|
+
borderRadius: "50%",
|
|
17877
|
+
padding: 0
|
|
17858
17878
|
},
|
|
17859
|
-
|
|
17860
|
-
|
|
17861
|
-
|
|
17862
|
-
|
|
17879
|
+
title: "Click to record / click to stop",
|
|
17880
|
+
children: /* @__PURE__ */ f.jsx("span", { style: {
|
|
17881
|
+
display: "block",
|
|
17882
|
+
width: "14px",
|
|
17883
|
+
height: "14px",
|
|
17884
|
+
borderRadius: "50%",
|
|
17885
|
+
background: a === "recording" && S === "round" ? "#171717" : "#ef4444",
|
|
17886
|
+
transition: "background 0.15s"
|
|
17887
|
+
} })
|
|
17863
17888
|
}
|
|
17864
17889
|
),
|
|
17865
17890
|
/* @__PURE__ */ f.jsx(
|
|
17866
17891
|
"button",
|
|
17867
17892
|
{
|
|
17868
17893
|
onClick: () => {
|
|
17869
|
-
|
|
17894
|
+
S === "startover" ? te() : a === "editing" && (v("startover"), le());
|
|
17870
17895
|
},
|
|
17871
|
-
disabled: a === "idle" || a === "recording" &&
|
|
17872
|
-
style: a === "idle" || a === "recording" &&
|
|
17873
|
-
title:
|
|
17874
|
-
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
17896
|
+
disabled: a === "idle" || a === "recording" && S !== "startover" || g,
|
|
17897
|
+
style: a === "idle" || a === "recording" && S !== "startover" || g ? Ze : Xe,
|
|
17898
|
+
title: S === "startover" ? "Stop recording" : "Start over",
|
|
17899
|
+
children: /* @__PURE__ */ f.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: S === "startover" ? "#ef4444" : "#171717" }, children: "refresh" })
|
|
17875
17900
|
}
|
|
17876
17901
|
)
|
|
17877
17902
|
] }),
|
|
@@ -17988,8 +18013,8 @@ function Y2({
|
|
|
17988
18013
|
onVoiceChange: w,
|
|
17989
18014
|
// Generate button props
|
|
17990
18015
|
generateButton: C,
|
|
17991
|
-
generatePrompt:
|
|
17992
|
-
generateSourceText:
|
|
18016
|
+
generatePrompt: k,
|
|
18017
|
+
generateSourceText: S,
|
|
17993
18018
|
generateSourceError: v
|
|
17994
18019
|
}) {
|
|
17995
18020
|
const [D, N] = R(!1), [B, T] = R(null), [j, M] = R(!1), [b, E] = R(""), [F, P] = R(!1), [q, Z] = R(!1), [ne, U] = R(null), [H, V] = R(g || x), [ie, ce] = R(p), [de, ye] = R(Date.now()), ve = we(null), Se = we(null), $ = !!(u && c && d && h);
|
|
@@ -18053,7 +18078,7 @@ ${G}` : G);
|
|
|
18053
18078
|
const Ye = atob(I), et = new Uint8Array(Ye.length);
|
|
18054
18079
|
for (let pe = 0; pe < Ye.length; pe++)
|
|
18055
18080
|
et[pe] = Ye.charCodeAt(pe);
|
|
18056
|
-
const
|
|
18081
|
+
const K = new Blob([et], { type: "audio/mpeg" }), te = new File([K], h, { type: "audio/mpeg" });
|
|
18057
18082
|
await c.uploadFile(d, h, te), console.log("TTS: Upload complete", { nodeId: d, audioFilename: h }), ye(Date.now()), ce(h), m == null || m(h, H);
|
|
18058
18083
|
} else y && (await y(e, H), ye(Date.now()));
|
|
18059
18084
|
} catch (I) {
|
|
@@ -18062,16 +18087,16 @@ ${G}` : G);
|
|
|
18062
18087
|
P(!1);
|
|
18063
18088
|
}
|
|
18064
18089
|
}, Ie = async () => {
|
|
18065
|
-
if (!(!u || !
|
|
18066
|
-
if (!(
|
|
18090
|
+
if (!(!u || !k || q)) {
|
|
18091
|
+
if (!(S != null && S.trim())) {
|
|
18067
18092
|
U(v || "Le texte source est requis pour la génération.");
|
|
18068
18093
|
return;
|
|
18069
18094
|
}
|
|
18070
18095
|
Z(!0), U(null);
|
|
18071
18096
|
try {
|
|
18072
18097
|
const G = await u.chat([
|
|
18073
|
-
{ role: "system", content:
|
|
18074
|
-
{ role: "user", content:
|
|
18098
|
+
{ role: "system", content: k },
|
|
18099
|
+
{ role: "user", content: S }
|
|
18075
18100
|
]);
|
|
18076
18101
|
t(G);
|
|
18077
18102
|
} catch (G) {
|
|
@@ -18125,7 +18150,7 @@ ${G}` : G);
|
|
|
18125
18150
|
(r || s || (typeof e == "string" ? e : "").trim() || $ || y || C) && /* @__PURE__ */ f.jsxs("div", { className: "flex items-center justify-between px-2 py-1", children: [
|
|
18126
18151
|
/* @__PURE__ */ f.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
18127
18152
|
r && /* @__PURE__ */ f.jsx("label", { className: "text-sm font-medium text-neutral-700", children: r }),
|
|
18128
|
-
C && u &&
|
|
18153
|
+
C && u && k && /* @__PURE__ */ f.jsxs(
|
|
18129
18154
|
"button",
|
|
18130
18155
|
{
|
|
18131
18156
|
type: "button",
|
|
@@ -18336,7 +18361,7 @@ function Q2({
|
|
|
18336
18361
|
outputQuality: i = 0.9,
|
|
18337
18362
|
theme: o = "dark"
|
|
18338
18363
|
}) {
|
|
18339
|
-
const l = we(null), a = we(null), u = we(null), [c, d] = R(!0), [h, p] = R(null), [g, m] = R(n), [y, _] = R(0), [x, w] = R({ x: 0, y: 0, width: 100, height: 100 }), [C,
|
|
18364
|
+
const l = we(null), a = we(null), u = we(null), [c, d] = R(!0), [h, p] = R(null), [g, m] = R(n), [y, _] = R(0), [x, w] = R({ x: 0, y: 0, width: 100, height: 100 }), [C, k] = R(!1), [S, v] = R(null), [D, N] = R({ x: 0, y: 0 }), [B, T] = R({ x: 0, y: 0, width: 100, height: 100 }), j = o === "dark", M = re(() => {
|
|
18340
18365
|
const $ = u.current;
|
|
18341
18366
|
return $ ? y === 90 || y === 270 ? { width: $.height, height: $.width } : { width: $.width, height: $.height } : { width: 100, height: 100 };
|
|
18342
18367
|
}, [y]), b = re(($, Me) => {
|
|
@@ -18382,14 +18407,14 @@ function Q2({
|
|
|
18382
18407
|
Te / Ee > qe ? (I = Math.min(Ee, Ie), G = I * qe) : (G = Math.min(Te, De), I = G / qe), G > Te && (G = Te, I = G / qe), I > Ee && (I = Ee, G = I * qe), $.width = G, $.height = I, oe.clearRect(0, 0, G, I), oe.save(), oe.translate(G / 2, I / 2), oe.rotate(y * Math.PI / 180);
|
|
18383
18408
|
let Ye, et;
|
|
18384
18409
|
y === 90 || y === 270 ? (Ye = I, et = G) : (Ye = G, et = I), oe.drawImage(Me, -Ye / 2, -et / 2, Ye, et), oe.restore(), oe.fillStyle = "rgba(0, 0, 0, 0.6)";
|
|
18385
|
-
const
|
|
18386
|
-
oe.fillRect(0, 0, G, te), oe.fillRect(0, te + Be, G, I - te - Be), oe.fillRect(0, te,
|
|
18410
|
+
const K = x.x / 100 * G, te = x.y / 100 * I, pe = x.width / 100 * G, Be = x.height / 100 * I;
|
|
18411
|
+
oe.fillRect(0, 0, G, te), oe.fillRect(0, te + Be, G, I - te - Be), oe.fillRect(0, te, K, Be), oe.fillRect(K + pe, te, G - K - pe, Be), oe.strokeStyle = "#fff", oe.lineWidth = 2, oe.strokeRect(K, te, pe, Be), oe.strokeStyle = "rgba(255, 255, 255, 0.3)", oe.lineWidth = 1, oe.beginPath(), oe.moveTo(K + pe / 3, te), oe.lineTo(K + pe / 3, te + Be), oe.moveTo(K + pe * 2 / 3, te), oe.lineTo(K + pe * 2 / 3, te + Be), oe.moveTo(K, te + Be / 3), oe.lineTo(K + pe, te + Be / 3), oe.moveTo(K, te + Be * 2 / 3), oe.lineTo(K + pe, te + Be * 2 / 3), oe.stroke();
|
|
18387
18412
|
const Fe = 14;
|
|
18388
18413
|
oe.fillStyle = "#fff", oe.strokeStyle = "#333", oe.lineWidth = 1, [
|
|
18389
|
-
{ x:
|
|
18390
|
-
{ x:
|
|
18391
|
-
{ x:
|
|
18392
|
-
{ x:
|
|
18414
|
+
{ x: K, y: te },
|
|
18415
|
+
{ x: K + pe, y: te },
|
|
18416
|
+
{ x: K, y: te + Be },
|
|
18417
|
+
{ x: K + pe, y: te + Be }
|
|
18393
18418
|
].forEach((St) => {
|
|
18394
18419
|
oe.fillRect(St.x - Fe / 2, St.y - Fe / 2, Fe, Fe), oe.strokeRect(St.x - Fe / 2, St.y - Fe / 2, Fe, Fe);
|
|
18395
18420
|
});
|
|
@@ -18408,7 +18433,7 @@ function Q2({
|
|
|
18408
18433
|
v(Ie.name), N({ x: Pe, y: Te }), T({ ...x });
|
|
18409
18434
|
return;
|
|
18410
18435
|
}
|
|
18411
|
-
Pe >= x.x && Pe <= x.x + x.width && Te >= x.y && Te <= x.y + x.height && (
|
|
18436
|
+
Pe >= x.x && Pe <= x.x + x.width && Te >= x.y && Te <= x.y + x.height && (k(!0), N({ x: Pe, y: Te }), T({ ...x }));
|
|
18412
18437
|
}, P = ($) => {
|
|
18413
18438
|
const Me = a.current;
|
|
18414
18439
|
if (!Me) return;
|
|
@@ -18417,25 +18442,25 @@ function Q2({
|
|
|
18417
18442
|
const Ee = Pe - D.x, De = Te - D.y;
|
|
18418
18443
|
let Ie = B.x + Ee, qe = B.y + De;
|
|
18419
18444
|
Ie = Math.max(0, Math.min(Ie, 100 - B.width)), qe = Math.max(0, Math.min(qe, 100 - B.height)), w({ ...B, x: Ie, y: qe });
|
|
18420
|
-
} else if (
|
|
18445
|
+
} else if (S) {
|
|
18421
18446
|
const Ee = _s[g], { width: De, height: Ie } = M(), qe = De / Ie, G = Ee ? Ee / qe : null;
|
|
18422
18447
|
let I = { ...B };
|
|
18423
18448
|
const Ye = Pe - D.x, et = Te - D.y;
|
|
18424
|
-
if (
|
|
18449
|
+
if (S === "se")
|
|
18425
18450
|
I.width = Math.max(10, Math.min(100 - I.x, B.width + Ye)), G ? (I.height = I.width / G, I.y + I.height > 100 && (I.height = 100 - I.y, I.width = I.height * G)) : I.height = Math.max(10, Math.min(100 - I.y, B.height + et));
|
|
18426
|
-
else if (
|
|
18427
|
-
const
|
|
18451
|
+
else if (S === "sw") {
|
|
18452
|
+
const K = -Ye, te = Math.max(10, B.width + K), pe = B.x + B.width - te;
|
|
18428
18453
|
pe >= 0 && (I.width = te, I.x = pe, G ? (I.height = I.width / G, I.y + I.height > 100 && (I.height = 100 - I.y, I.width = I.height * G, I.x = B.x + B.width - I.width)) : I.height = Math.max(10, Math.min(100 - I.y, B.height + et)));
|
|
18429
|
-
} else if (
|
|
18454
|
+
} else if (S === "ne")
|
|
18430
18455
|
if (I.width = Math.max(10, Math.min(100 - I.x, B.width + Ye)), G) {
|
|
18431
|
-
const
|
|
18432
|
-
te >= 0 ? (I.height =
|
|
18456
|
+
const K = I.width / G, te = B.y + B.height - K;
|
|
18457
|
+
te >= 0 ? (I.height = K, I.y = te) : (I.y = 0, I.height = B.y + B.height, I.width = I.height * G);
|
|
18433
18458
|
} else {
|
|
18434
|
-
const
|
|
18459
|
+
const K = -et, te = Math.max(10, B.height + K), pe = B.y + B.height - te;
|
|
18435
18460
|
pe >= 0 && (I.height = te, I.y = pe);
|
|
18436
18461
|
}
|
|
18437
|
-
else if (
|
|
18438
|
-
const
|
|
18462
|
+
else if (S === "nw") {
|
|
18463
|
+
const K = -Ye, te = Math.max(10, B.width + K), pe = B.x + B.width - te;
|
|
18439
18464
|
if (pe >= 0)
|
|
18440
18465
|
if (I.width = te, I.x = pe, G) {
|
|
18441
18466
|
const Be = I.width / G, Fe = B.y + B.height - Be;
|
|
@@ -18448,7 +18473,7 @@ function Q2({
|
|
|
18448
18473
|
I.x = Math.max(0, I.x), I.y = Math.max(0, I.y), I.width = Math.min(I.width, 100 - I.x), I.height = Math.min(I.height, 100 - I.y), w(I);
|
|
18449
18474
|
}
|
|
18450
18475
|
}, q = () => {
|
|
18451
|
-
|
|
18476
|
+
k(!1), v(null);
|
|
18452
18477
|
}, Z = ($) => {
|
|
18453
18478
|
_((Me) => $ === "right" ? (Me + 90) % 360 : (Me - 90 + 360) % 360);
|
|
18454
18479
|
}, ne = () => {
|
|
@@ -18539,7 +18564,7 @@ function Q2({
|
|
|
18539
18564
|
{
|
|
18540
18565
|
ref: a,
|
|
18541
18566
|
style: {
|
|
18542
|
-
cursor: C ? "grabbing" :
|
|
18567
|
+
cursor: C ? "grabbing" : S ? "nwse-resize" : "grab",
|
|
18543
18568
|
maxWidth: "100%",
|
|
18544
18569
|
maxHeight: "100%"
|
|
18545
18570
|
},
|
|
@@ -18792,10 +18817,10 @@ function e0(r, e) {
|
|
|
18792
18817
|
for (var i = s.length, o = new Array(i), l = new Array(i), a = new Array(i), u = 0; u < i; ++u) {
|
|
18793
18818
|
var c = n[u], d = s[u], h = d.length, p = t0(r.call(c, c && c.__data__, u, n)), g = p.length, m = l[u] = new Array(g), y = o[u] = new Array(g), _ = a[u] = new Array(h);
|
|
18794
18819
|
t(c, d, m, y, _, p, e);
|
|
18795
|
-
for (var x = 0, w = 0, C,
|
|
18820
|
+
for (var x = 0, w = 0, C, k; x < g; ++x)
|
|
18796
18821
|
if (C = m[x]) {
|
|
18797
|
-
for (x >= w && (w = x + 1); !(
|
|
18798
|
-
C._next =
|
|
18822
|
+
for (x >= w && (w = x + 1); !(k = y[w]) && ++w < g; ) ;
|
|
18823
|
+
C._next = k || null;
|
|
18799
18824
|
}
|
|
18800
18825
|
}
|
|
18801
18826
|
return o = new Ft(o, n), o._enter = l, o._exit = a, o;
|
|
@@ -19675,13 +19700,13 @@ const Im = function r(e, t, n) {
|
|
|
19675
19700
|
];
|
|
19676
19701
|
};
|
|
19677
19702
|
else {
|
|
19678
|
-
var x = Math.sqrt(m), w = (h * h - u * u + n * m) / (2 * u * t * x), C = (h * h - u * u - n * m) / (2 * h * t * x),
|
|
19679
|
-
_ = (
|
|
19680
|
-
var D = v * _, N = Zl(
|
|
19703
|
+
var x = Math.sqrt(m), w = (h * h - u * u + n * m) / (2 * u * t * x), C = (h * h - u * u - n * m) / (2 * h * t * x), k = Math.log(Math.sqrt(w * w + 1) - w), S = Math.log(Math.sqrt(C * C + 1) - C);
|
|
19704
|
+
_ = (S - k) / e, y = function(v) {
|
|
19705
|
+
var D = v * _, N = Zl(k), B = u / (t * x) * (N * Pm(e * D + k) - Lm(k));
|
|
19681
19706
|
return [
|
|
19682
19707
|
l + B * p,
|
|
19683
19708
|
a + B * g,
|
|
19684
|
-
u * N / Zl(e * D +
|
|
19709
|
+
u * N / Zl(e * D + k)
|
|
19685
19710
|
];
|
|
19686
19711
|
};
|
|
19687
19712
|
}
|
|
@@ -20364,8 +20389,8 @@ function r2() {
|
|
|
20364
20389
|
}
|
|
20365
20390
|
_.transform = function(b, E, F, P) {
|
|
20366
20391
|
var q = b.selection ? b.selection() : b;
|
|
20367
|
-
q.property("__zoom", su), b !== q ?
|
|
20368
|
-
|
|
20392
|
+
q.property("__zoom", su), b !== q ? k(b, E, F, P) : q.interrupt().each(function() {
|
|
20393
|
+
S(this, arguments).event(P).start().zoom(null, typeof E == "function" ? E.apply(this, arguments) : E).end();
|
|
20369
20394
|
});
|
|
20370
20395
|
}, _.scaleBy = function(b, E, F, P) {
|
|
20371
20396
|
_.scaleTo(b, function() {
|
|
@@ -20403,13 +20428,13 @@ function r2() {
|
|
|
20403
20428
|
function C(b) {
|
|
20404
20429
|
return [(+b[0][0] + +b[1][0]) / 2, (+b[0][1] + +b[1][1]) / 2];
|
|
20405
20430
|
}
|
|
20406
|
-
function
|
|
20431
|
+
function k(b, E, F, P) {
|
|
20407
20432
|
b.on("start.zoom", function() {
|
|
20408
|
-
|
|
20433
|
+
S(this, arguments).event(P).start();
|
|
20409
20434
|
}).on("interrupt.zoom end.zoom", function() {
|
|
20410
|
-
|
|
20435
|
+
S(this, arguments).event(P).end();
|
|
20411
20436
|
}).tween("zoom", function() {
|
|
20412
|
-
var q = this, Z = arguments, ne =
|
|
20437
|
+
var q = this, Z = arguments, ne = S(q, Z).event(P), U = e.apply(q, Z), H = F == null ? C(U) : typeof F == "function" ? F.apply(q, Z) : F, V = Math.max(U[1][0] - U[0][0], U[1][1] - U[0][1]), ie = q.__zoom, ce = typeof E == "function" ? E.apply(q, Z) : E, de = a(ie.invert(H).concat(V / ie.k), ce.invert(H).concat(V / ce.k));
|
|
20413
20438
|
return function(ye) {
|
|
20414
20439
|
if (ye === 1) ye = ce;
|
|
20415
20440
|
else {
|
|
@@ -20420,7 +20445,7 @@ function r2() {
|
|
|
20420
20445
|
};
|
|
20421
20446
|
});
|
|
20422
20447
|
}
|
|
20423
|
-
function
|
|
20448
|
+
function S(b, E, F) {
|
|
20424
20449
|
return !F && b.__zooming || new v(b, E);
|
|
20425
20450
|
}
|
|
20426
20451
|
function v(b, E) {
|
|
@@ -20456,7 +20481,7 @@ function r2() {
|
|
|
20456
20481
|
};
|
|
20457
20482
|
function D(b, ...E) {
|
|
20458
20483
|
if (!r.apply(this, arguments)) return;
|
|
20459
|
-
var F =
|
|
20484
|
+
var F = S(this, E).event(b), P = this.__zoom, q = Math.max(i[0], Math.min(i[1], P.k * Math.pow(2, n.apply(this, arguments)))), Z = Dr(b);
|
|
20460
20485
|
if (F.wheel)
|
|
20461
20486
|
(F.mouse[0][0] !== Z[0] || F.mouse[0][1] !== Z[1]) && (F.mouse[1] = P.invert(F.mouse[0] = Z)), clearTimeout(F.wheel);
|
|
20462
20487
|
else {
|
|
@@ -20470,7 +20495,7 @@ function r2() {
|
|
|
20470
20495
|
}
|
|
20471
20496
|
function N(b, ...E) {
|
|
20472
20497
|
if (h || !r.apply(this, arguments)) return;
|
|
20473
|
-
var F = b.currentTarget, P =
|
|
20498
|
+
var F = b.currentTarget, P = S(this, E, !0).event(b), q = qt(b.view).on("mousemove.zoom", H, !0).on("mouseup.zoom", V, !0), Z = Dr(b, F), ne = b.clientX, U = b.clientY;
|
|
20474
20499
|
dm(b.view), Ji(b), P.mouse = [Z, this.__zoom.invert(Z)], Bs(this), P.start();
|
|
20475
20500
|
function H(ie) {
|
|
20476
20501
|
if (Cn(ie), !P.moved) {
|
|
@@ -20486,12 +20511,12 @@ function r2() {
|
|
|
20486
20511
|
function B(b, ...E) {
|
|
20487
20512
|
if (r.apply(this, arguments)) {
|
|
20488
20513
|
var F = this.__zoom, P = Dr(b.changedTouches ? b.changedTouches[0] : b, this), q = F.invert(P), Z = F.k * (b.shiftKey ? 0.5 : 2), ne = t(w(x(F, Z), P, q), e.apply(this, E), o);
|
|
20489
|
-
Cn(b), l > 0 ? qt(this).transition().duration(l).call(
|
|
20514
|
+
Cn(b), l > 0 ? qt(this).transition().duration(l).call(k, ne, P, b) : qt(this).call(_.transform, ne, P, b);
|
|
20490
20515
|
}
|
|
20491
20516
|
}
|
|
20492
20517
|
function T(b, ...E) {
|
|
20493
20518
|
if (r.apply(this, arguments)) {
|
|
20494
|
-
var F = b.touches, P = F.length, q =
|
|
20519
|
+
var F = b.touches, P = F.length, q = S(this, E, b.changedTouches.length === P).event(b), Z, ne, U, H;
|
|
20495
20520
|
for (Ji(b), ne = 0; ne < P; ++ne)
|
|
20496
20521
|
U = F[ne], H = Dr(U, this), H = [H, this.__zoom.invert(H), U.identifier], q.touch0 ? !q.touch1 && q.touch0[2] !== H[2] && (q.touch1 = H, q.taps = 0) : (q.touch0 = H, Z = !0, q.taps = 1 + !!c);
|
|
20497
20522
|
c && (c = clearTimeout(c)), Z && (q.taps < 2 && (d = H[0], c = setTimeout(function() {
|
|
@@ -20501,7 +20526,7 @@ function r2() {
|
|
|
20501
20526
|
}
|
|
20502
20527
|
function j(b, ...E) {
|
|
20503
20528
|
if (this.__zooming) {
|
|
20504
|
-
var F =
|
|
20529
|
+
var F = S(this, E).event(b), P = b.changedTouches, q = P.length, Z, ne, U, H;
|
|
20505
20530
|
for (Cn(b), Z = 0; Z < q; ++Z)
|
|
20506
20531
|
ne = P[Z], U = Dr(ne, this), F.touch0 && F.touch0[2] === ne.identifier ? F.touch0[0] = U : F.touch1 && F.touch1[2] === ne.identifier && (F.touch1[0] = U);
|
|
20507
20532
|
if (ne = F.that.__zoom, F.touch1) {
|
|
@@ -20514,7 +20539,7 @@ function r2() {
|
|
|
20514
20539
|
}
|
|
20515
20540
|
function M(b, ...E) {
|
|
20516
20541
|
if (this.__zooming) {
|
|
20517
|
-
var F =
|
|
20542
|
+
var F = S(this, E).event(b), P = b.changedTouches, q = P.length, Z, ne;
|
|
20518
20543
|
for (Ji(b), h && clearTimeout(h), h = setTimeout(function() {
|
|
20519
20544
|
h = null;
|
|
20520
20545
|
}, p), Z = 0; Z < q; ++Z)
|
|
@@ -20594,8 +20619,8 @@ function n2(r = {}) {
|
|
|
20594
20619
|
}, [o]);
|
|
20595
20620
|
const d = re((y, _, x, w = !0) => {
|
|
20596
20621
|
if (!l.current || !a.current) return;
|
|
20597
|
-
const C = qt(l.current),
|
|
20598
|
-
C.call(a.current.transform,
|
|
20622
|
+
const C = qt(l.current), k = ai.translate(y, _).scale(x);
|
|
20623
|
+
C.call(a.current.transform, k);
|
|
20599
20624
|
}, []), h = re(() => {
|
|
20600
20625
|
!l.current || !a.current || qt(l.current).call(a.current.scaleBy, 1.3);
|
|
20601
20626
|
}, []), p = re(() => {
|
|
@@ -20605,12 +20630,12 @@ function n2(r = {}) {
|
|
|
20605
20630
|
}, [d]), m = re((y, _ = 50) => {
|
|
20606
20631
|
if (!l.current || !a.current || y.length === 0) return;
|
|
20607
20632
|
const x = l.current, w = x.clientWidth, C = x.clientHeight;
|
|
20608
|
-
let
|
|
20633
|
+
let k = 1 / 0, S = 1 / 0, v = -1 / 0, D = -1 / 0;
|
|
20609
20634
|
for (const q of y) {
|
|
20610
20635
|
const Z = q.width || 200, ne = q.height || 100;
|
|
20611
|
-
|
|
20636
|
+
k = Math.min(k, q.x), S = Math.min(S, q.y), v = Math.max(v, q.x + Z), D = Math.max(D, q.y + ne);
|
|
20612
20637
|
}
|
|
20613
|
-
const N = v -
|
|
20638
|
+
const N = v - k, B = D - S, T = (w - _ * 2) / N, j = (C - _ * 2) / B, M = Math.min(T, j, t), b = (k + v) / 2, E = (S + D) / 2, F = w / 2 - b * M, P = C / 2 - E * M;
|
|
20614
20639
|
d(F, P, M, !0);
|
|
20615
20640
|
}, [t, d]);
|
|
20616
20641
|
return {
|
|
@@ -20635,24 +20660,24 @@ function s2(r) {
|
|
|
20635
20660
|
g.current = e;
|
|
20636
20661
|
}, [e]);
|
|
20637
20662
|
const m = re((w, C) => {
|
|
20638
|
-
const
|
|
20663
|
+
const k = g.current;
|
|
20639
20664
|
return {
|
|
20640
|
-
x: (w -
|
|
20641
|
-
y: (C -
|
|
20665
|
+
x: (w - k.x) / k.k,
|
|
20666
|
+
y: (C - k.y) / k.k
|
|
20642
20667
|
};
|
|
20643
20668
|
}, []), y = re((w, C) => {
|
|
20644
20669
|
if (i) return;
|
|
20645
20670
|
C.preventDefault(), C.stopPropagation();
|
|
20646
|
-
const
|
|
20671
|
+
const k = C.currentTarget, S = parseFloat(k.dataset.x || "0"), v = parseFloat(k.dataset.y || "0");
|
|
20647
20672
|
h.current = {
|
|
20648
20673
|
x: C.clientX,
|
|
20649
20674
|
y: C.clientY,
|
|
20650
|
-
nodeX:
|
|
20675
|
+
nodeX: S,
|
|
20651
20676
|
nodeY: v
|
|
20652
|
-
}, p.current = { x:
|
|
20677
|
+
}, p.current = { x: S, y: v }, l(w), u(!0), d({ x: 0, y: 0 }), t == null || t(w);
|
|
20653
20678
|
}, [i, m, t]), _ = re((w) => {
|
|
20654
20679
|
if (!a || !o || !h.current) return;
|
|
20655
|
-
const C = g.current,
|
|
20680
|
+
const C = g.current, k = h.current, S = w.clientX - k.x, v = w.clientY - k.y, D = S / C.k, N = v / C.k, B = k.nodeX + D, T = k.nodeY + N;
|
|
20656
20681
|
p.current = { x: B, y: T }, d({ x: D, y: N }), n == null || n(o, B, T, D, N);
|
|
20657
20682
|
}, [a, o, n]), x = re(() => {
|
|
20658
20683
|
if (!a || !o) return;
|
|
@@ -20661,8 +20686,8 @@ function s2(r) {
|
|
|
20661
20686
|
}, [a, o, s]);
|
|
20662
20687
|
return Ce(() => {
|
|
20663
20688
|
if (!a) return;
|
|
20664
|
-
const w = (
|
|
20665
|
-
_(
|
|
20689
|
+
const w = (k) => {
|
|
20690
|
+
_(k);
|
|
20666
20691
|
}, C = () => {
|
|
20667
20692
|
x();
|
|
20668
20693
|
};
|
|
@@ -20715,7 +20740,7 @@ function i2(r) {
|
|
|
20715
20740
|
width: 0,
|
|
20716
20741
|
height: 0
|
|
20717
20742
|
}), g(!0), B.shiftKey || c(/* @__PURE__ */ new Set());
|
|
20718
|
-
}, [n, x]),
|
|
20743
|
+
}, [n, x]), k = re((B) => {
|
|
20719
20744
|
if (!p || !m.current) return;
|
|
20720
20745
|
const T = m.current, j = x(B.clientX, B.clientY), M = {
|
|
20721
20746
|
x: Math.min(T.x, j.x),
|
|
@@ -20728,20 +20753,20 @@ function i2(r) {
|
|
|
20728
20753
|
for (const [E] of _.current)
|
|
20729
20754
|
w(E, M) && b.add(E);
|
|
20730
20755
|
c(b);
|
|
20731
|
-
}, [p, x, w]),
|
|
20756
|
+
}, [p, x, w]), S = re(() => {
|
|
20732
20757
|
p && (i == null || i(Array.from(u)), g(!1), h(null), m.current = null);
|
|
20733
20758
|
}, [p, u, i]);
|
|
20734
20759
|
Ce(() => {
|
|
20735
20760
|
if (!p) return;
|
|
20736
20761
|
const B = (j) => {
|
|
20737
|
-
|
|
20762
|
+
k(j);
|
|
20738
20763
|
}, T = () => {
|
|
20739
|
-
|
|
20764
|
+
S();
|
|
20740
20765
|
};
|
|
20741
20766
|
return window.addEventListener("mousemove", B), window.addEventListener("mouseup", T), () => {
|
|
20742
20767
|
window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", T);
|
|
20743
20768
|
};
|
|
20744
|
-
}, [p,
|
|
20769
|
+
}, [p, k, S]);
|
|
20745
20770
|
const v = re((B, T = !1) => {
|
|
20746
20771
|
c((j) => {
|
|
20747
20772
|
const M = new Set(T ? j : []);
|
|
@@ -20759,8 +20784,8 @@ function i2(r) {
|
|
|
20759
20784
|
selectionBox: d,
|
|
20760
20785
|
isSelecting: p,
|
|
20761
20786
|
startSelection: C,
|
|
20762
|
-
updateSelection:
|
|
20763
|
-
endSelection:
|
|
20787
|
+
updateSelection: k,
|
|
20788
|
+
endSelection: S,
|
|
20764
20789
|
toggleSelect: v,
|
|
20765
20790
|
selectAll: D,
|
|
20766
20791
|
clearSelection: N
|
|
@@ -21084,8 +21109,8 @@ function sx({
|
|
|
21084
21109
|
initialTransform: x,
|
|
21085
21110
|
defaultEdgeStyle: w = m2,
|
|
21086
21111
|
defaultEdgeColor: C = y2,
|
|
21087
|
-
defaultEdgeWidth:
|
|
21088
|
-
draggable:
|
|
21112
|
+
defaultEdgeWidth: k = x2,
|
|
21113
|
+
draggable: S = !0,
|
|
21089
21114
|
selectable: v = !0,
|
|
21090
21115
|
zoomable: D = !0,
|
|
21091
21116
|
pannable: N = !0,
|
|
@@ -21096,10 +21121,10 @@ function sx({
|
|
|
21096
21121
|
gridSize: b = 20
|
|
21097
21122
|
}) {
|
|
21098
21123
|
const E = r.data || { positions: {} }, F = E.positions || {}, P = dt(() => {
|
|
21099
|
-
const
|
|
21124
|
+
const K = /* @__PURE__ */ new Map();
|
|
21100
21125
|
for (const te of e) {
|
|
21101
21126
|
const pe = F[te._id] || { x: 0, y: 0 };
|
|
21102
|
-
|
|
21127
|
+
K.set(te._id, {
|
|
21103
21128
|
x: pe.x,
|
|
21104
21129
|
y: pe.y,
|
|
21105
21130
|
width: pe.width || s,
|
|
@@ -21107,7 +21132,7 @@ function sx({
|
|
|
21107
21132
|
rotation: pe.rotation || 0
|
|
21108
21133
|
});
|
|
21109
21134
|
}
|
|
21110
|
-
return
|
|
21135
|
+
return K;
|
|
21111
21136
|
}, [e, F, s, i]), {
|
|
21112
21137
|
transform: q,
|
|
21113
21138
|
containerRef: Z,
|
|
@@ -21122,21 +21147,21 @@ function sx({
|
|
|
21122
21147
|
initialTransform: x || E.transform,
|
|
21123
21148
|
zoomable: D,
|
|
21124
21149
|
pannable: N,
|
|
21125
|
-
onTransformChange: (
|
|
21126
|
-
m == null || m(
|
|
21150
|
+
onTransformChange: (K) => {
|
|
21151
|
+
m == null || m(K);
|
|
21127
21152
|
const te = {
|
|
21128
21153
|
...E,
|
|
21129
|
-
transform:
|
|
21154
|
+
transform: K
|
|
21130
21155
|
};
|
|
21131
21156
|
g == null || g(te);
|
|
21132
21157
|
}
|
|
21133
21158
|
}), [ie, ce] = R(/* @__PURE__ */ new Map()), [de, ye] = R(/* @__PURE__ */ new Map()), ve = we(/* @__PURE__ */ new Map());
|
|
21134
21159
|
Ce(() => {
|
|
21135
|
-
const
|
|
21160
|
+
const K = q.k || 1, te = /* @__PURE__ */ new Map();
|
|
21136
21161
|
ve.current.forEach((Be, Fe) => {
|
|
21137
21162
|
if (Be) {
|
|
21138
21163
|
const rt = Be.getBoundingClientRect();
|
|
21139
|
-
te.set(Fe, { width: Math.round(rt.width /
|
|
21164
|
+
te.set(Fe, { width: Math.round(rt.width / K), height: Math.round(rt.height / K) });
|
|
21140
21165
|
}
|
|
21141
21166
|
}), e.some((Be) => {
|
|
21142
21167
|
const Fe = te.get(Be._id), rt = de.get(Be._id);
|
|
@@ -21150,16 +21175,16 @@ function sx({
|
|
|
21150
21175
|
// endDrag - handled internally by hook
|
|
21151
21176
|
} = s2({
|
|
21152
21177
|
transform: q,
|
|
21153
|
-
disabled: !
|
|
21154
|
-
onDragStart: (
|
|
21155
|
-
const te = P.get(
|
|
21156
|
-
te && ce(/* @__PURE__ */ new Map([[
|
|
21178
|
+
disabled: !S,
|
|
21179
|
+
onDragStart: (K) => {
|
|
21180
|
+
const te = P.get(K);
|
|
21181
|
+
te && ce(/* @__PURE__ */ new Map([[K, { x: te.x, y: te.y }]]));
|
|
21157
21182
|
},
|
|
21158
|
-
onDragMove: (
|
|
21159
|
-
ce(/* @__PURE__ */ new Map([[
|
|
21183
|
+
onDragMove: (K, te, pe) => {
|
|
21184
|
+
ce(/* @__PURE__ */ new Map([[K, { x: te, y: pe }]])), l == null || l(K, te, pe);
|
|
21160
21185
|
},
|
|
21161
|
-
onDragEnd: (
|
|
21162
|
-
ce(/* @__PURE__ */ new Map()), o == null || o(
|
|
21186
|
+
onDragEnd: (K, te, pe) => {
|
|
21187
|
+
ce(/* @__PURE__ */ new Map()), o == null || o(K, te, pe);
|
|
21163
21188
|
}
|
|
21164
21189
|
}), {
|
|
21165
21190
|
selectedIds: Me,
|
|
@@ -21175,20 +21200,20 @@ function sx({
|
|
|
21175
21200
|
disabled: !v,
|
|
21176
21201
|
controlledSelectedIds: d,
|
|
21177
21202
|
onSelectionChange: h
|
|
21178
|
-
}), Ie = re((
|
|
21179
|
-
const te = P.get(
|
|
21203
|
+
}), Ie = re((K) => {
|
|
21204
|
+
const te = P.get(K) || { x: 0, y: 0, width: s, height: i }, pe = ie.get(K), Be = de.get(K), Fe = (Be == null ? void 0 : Be.width) || te.width || s, rt = (Be == null ? void 0 : Be.height) || te.height || i;
|
|
21180
21205
|
return pe ? { ...te, x: pe.x, y: pe.y, width: Fe, height: rt } : { ...te, width: Fe, height: rt };
|
|
21181
21206
|
}, [P, ie, de, s, i]), qe = dt(() => {
|
|
21182
|
-
const
|
|
21207
|
+
const K = /* @__PURE__ */ new Map();
|
|
21183
21208
|
for (const te of P.keys())
|
|
21184
|
-
|
|
21185
|
-
return
|
|
21186
|
-
}, [P, Ie]), G = re((
|
|
21187
|
-
Ee(
|
|
21188
|
-
}, [Ee, a]), I = re((
|
|
21189
|
-
|
|
21190
|
-
}, [De]), Ye = re((
|
|
21191
|
-
|
|
21209
|
+
K.set(te, Ie(te));
|
|
21210
|
+
return K;
|
|
21211
|
+
}, [P, Ie]), G = re((K, te) => {
|
|
21212
|
+
Ee(K._id, te.shiftKey), a == null || a(K, te);
|
|
21213
|
+
}, [Ee, a]), I = re((K) => {
|
|
21214
|
+
K.target.closest("[data-qmap-node]") || De();
|
|
21215
|
+
}, [De]), Ye = re((K) => {
|
|
21216
|
+
K.button === 0 && (K.target.closest("[data-qmap-node]") || Te(K));
|
|
21192
21217
|
}, [Te]), et = M ? `
|
|
21193
21218
|
linear-gradient(to right, rgba(0,0,0,0.05) 1px, transparent 1px),
|
|
21194
21219
|
linear-gradient(to bottom, rgba(0,0,0,0.05) 1px, transparent 1px)
|
|
@@ -21230,30 +21255,30 @@ function sx({
|
|
|
21230
21255
|
nodePositions: qe,
|
|
21231
21256
|
defaultStyle: w,
|
|
21232
21257
|
defaultColor: C,
|
|
21233
|
-
defaultWidth:
|
|
21258
|
+
defaultWidth: k,
|
|
21234
21259
|
onEdgeClick: p
|
|
21235
21260
|
}
|
|
21236
21261
|
),
|
|
21237
|
-
e.map((
|
|
21238
|
-
const te = Ie(
|
|
21262
|
+
e.map((K) => {
|
|
21263
|
+
const te = Ie(K._id), pe = Me.has(K._id), Be = Se === K._id;
|
|
21239
21264
|
return /* @__PURE__ */ f.jsx(
|
|
21240
21265
|
o2,
|
|
21241
21266
|
{
|
|
21242
|
-
nodeId:
|
|
21267
|
+
nodeId: K._id,
|
|
21243
21268
|
position: te,
|
|
21244
21269
|
isSelected: pe,
|
|
21245
21270
|
isDragging: Be,
|
|
21246
|
-
draggable:
|
|
21271
|
+
draggable: S,
|
|
21247
21272
|
onDragStart: $,
|
|
21248
|
-
onClick: (Fe) => G(
|
|
21249
|
-
onDoubleClick: (Fe) => u == null ? void 0 : u(
|
|
21250
|
-
onContextMenu: (Fe) => c == null ? void 0 : c(
|
|
21273
|
+
onClick: (Fe) => G(K, Fe),
|
|
21274
|
+
onDoubleClick: (Fe) => u == null ? void 0 : u(K, Fe),
|
|
21275
|
+
onContextMenu: (Fe) => c == null ? void 0 : c(K, Fe),
|
|
21251
21276
|
nodeRef: (Fe) => {
|
|
21252
|
-
Fe ? ve.current.set(
|
|
21277
|
+
Fe ? ve.current.set(K._id, Fe) : ve.current.delete(K._id);
|
|
21253
21278
|
},
|
|
21254
|
-
children: n(
|
|
21279
|
+
children: n(K, pe, te)
|
|
21255
21280
|
},
|
|
21256
|
-
|
|
21281
|
+
K._id
|
|
21257
21282
|
);
|
|
21258
21283
|
})
|
|
21259
21284
|
]
|