@qwanyx/stack 0.2.85 → 0.2.86
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/components/AnimatedCardFlip.d.ts +1 -1
- package/dist/index.cjs.js +27 -27
- package/dist/index.esm.js +988 -1021
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var _d = Object.defineProperty;
|
|
|
2
2
|
var vd = (r, e, t) => e in r ? _d(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Dt = (r, e, t) => vd(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as Ns from "react";
|
|
5
|
-
import Le, { createContext as nu, useState as
|
|
5
|
+
import Le, { createContext as nu, useState as I, useCallback as X, useEffect as Te, useContext as iu, useRef as be, useMemo as ct, useLayoutEffect as cn, Suspense as wd, forwardRef as su, memo as as } from "react";
|
|
6
6
|
import { flushSync as Cd, createPortal as Dd } from "react-dom";
|
|
7
7
|
class py {
|
|
8
8
|
constructor(e) {
|
|
@@ -3630,11 +3630,11 @@ class Wd {
|
|
|
3630
3630
|
for (const p of c.messages)
|
|
3631
3631
|
p.uid && d.set(p.uid, p);
|
|
3632
3632
|
const f = l.map((p) => {
|
|
3633
|
-
var
|
|
3633
|
+
var _, v, E, C, w;
|
|
3634
3634
|
const g = d.get(p);
|
|
3635
3635
|
if (!g) return null;
|
|
3636
|
-
const m = ((
|
|
3637
|
-
return { uid: p, from: x, subject:
|
|
3636
|
+
const m = ((_ = g.flags) == null ? void 0 : _.some((S) => S.includes("Seen"))) || !1, x = ((E = (v = g.envelope) == null ? void 0 : v.from) == null ? void 0 : E.email) || "Unknown", b = ((C = g.envelope) == null ? void 0 : C.subject) || "(No subject)", y = ((w = g.envelope) == null ? void 0 : w.date) || "";
|
|
3637
|
+
return { uid: p, from: x, subject: b, date: y, seen: m };
|
|
3638
3638
|
}).filter(Boolean);
|
|
3639
3639
|
return {
|
|
3640
3640
|
account: { id: e, label: "", email: "" },
|
|
@@ -3682,30 +3682,30 @@ class Wd {
|
|
|
3682
3682
|
* This handles CID embedded images by converting them to base64 data URIs
|
|
3683
3683
|
*/
|
|
3684
3684
|
async getEmailParsed(e, t, n = "INBOX") {
|
|
3685
|
-
var g, m, x,
|
|
3685
|
+
var g, m, x, b, y, _;
|
|
3686
3686
|
const s = (await this.imapExec(e, [
|
|
3687
3687
|
`SELECT "${n}"`,
|
|
3688
3688
|
`UID FETCH ${t} (FLAGS BODY[])`
|
|
3689
|
-
])).responses.find((
|
|
3689
|
+
])).responses.find((v) => v.command === "UID FETCH");
|
|
3690
3690
|
if (!(s != null && s.ok) || !((g = s.messages) != null && g[0]))
|
|
3691
3691
|
return console.error("Failed to fetch raw email:", s == null ? void 0 : s.error), null;
|
|
3692
3692
|
const o = s.messages[0], a = o.body || o.raw;
|
|
3693
3693
|
if (!a)
|
|
3694
3694
|
return console.error("No raw email content in response"), null;
|
|
3695
3695
|
const u = await new Fi().parse(a);
|
|
3696
|
-
console.log("[MailClient] Parsed email - attachments count:", ((m = u.attachments) == null ? void 0 : m.length) || 0), console.log("[MailClient] Parsed attachments:", (x = u.attachments) == null ? void 0 : x.map((
|
|
3696
|
+
console.log("[MailClient] Parsed email - attachments count:", ((m = u.attachments) == null ? void 0 : m.length) || 0), console.log("[MailClient] Parsed attachments:", (x = u.attachments) == null ? void 0 : x.map((v) => ({ filename: v.filename, mimeType: v.mimeType, contentId: v.contentId })));
|
|
3697
3697
|
const c = /* @__PURE__ */ new Map();
|
|
3698
|
-
for (const
|
|
3699
|
-
if (
|
|
3700
|
-
const E = this.contentToBase64(
|
|
3701
|
-
c.set(
|
|
3698
|
+
for (const v of u.attachments || [])
|
|
3699
|
+
if (v.contentId) {
|
|
3700
|
+
const E = this.contentToBase64(v.content), C = `data:${v.mimeType};base64,${E}`, w = v.contentId.replace(/^<|>$/g, "");
|
|
3701
|
+
c.set(w, C), c.set(`<${w}>`, C);
|
|
3702
3702
|
}
|
|
3703
3703
|
let d = u.html || "";
|
|
3704
|
-
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (
|
|
3704
|
+
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (v, E) => {
|
|
3705
3705
|
const C = c.get(E) || c.get(`<${E}>`);
|
|
3706
|
-
return C ? `src="${C}"` :
|
|
3706
|
+
return C ? `src="${C}"` : v;
|
|
3707
3707
|
}));
|
|
3708
|
-
const f = ((
|
|
3708
|
+
const f = ((b = o.flags) == null ? void 0 : b.some((v) => v.toLowerCase().includes("seen"))) || !1, p = ((y = u.from) == null ? void 0 : y.address) || ((_ = u.from) == null ? void 0 : _.name) || "Unknown";
|
|
3709
3709
|
return {
|
|
3710
3710
|
uid: t,
|
|
3711
3711
|
from: p,
|
|
@@ -3715,10 +3715,10 @@ class Wd {
|
|
|
3715
3715
|
html: d,
|
|
3716
3716
|
text: u.text || "",
|
|
3717
3717
|
seen: f,
|
|
3718
|
-
attachments: (u.attachments || []).map((
|
|
3719
|
-
filename:
|
|
3720
|
-
mimeType:
|
|
3721
|
-
size: this.getContentSize(
|
|
3718
|
+
attachments: (u.attachments || []).map((v) => ({
|
|
3719
|
+
filename: v.filename || "attachment",
|
|
3720
|
+
mimeType: v.mimeType || "application/octet-stream",
|
|
3721
|
+
size: this.getContentSize(v.content)
|
|
3722
3722
|
}))
|
|
3723
3723
|
};
|
|
3724
3724
|
}
|
|
@@ -4423,17 +4423,17 @@ function Gd() {
|
|
|
4423
4423
|
var $ = g && k[g] || k[m];
|
|
4424
4424
|
return typeof $ == "function" ? $ : null;
|
|
4425
4425
|
}
|
|
4426
|
-
var
|
|
4426
|
+
var b = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
4427
4427
|
function y(k) {
|
|
4428
4428
|
{
|
|
4429
4429
|
for (var $ = arguments.length, te = new Array($ > 1 ? $ - 1 : 0), pe = 1; pe < $; pe++)
|
|
4430
4430
|
te[pe - 1] = arguments[pe];
|
|
4431
|
-
|
|
4431
|
+
_("error", k, te);
|
|
4432
4432
|
}
|
|
4433
4433
|
}
|
|
4434
|
-
function
|
|
4434
|
+
function _(k, $, te) {
|
|
4435
4435
|
{
|
|
4436
|
-
var pe =
|
|
4436
|
+
var pe = b.ReactDebugCurrentFrame, je = pe.getStackAddendum();
|
|
4437
4437
|
je !== "" && ($ += "%s", te = te.concat([je]));
|
|
4438
4438
|
var $e = te.map(function(Fe) {
|
|
4439
4439
|
return String(Fe);
|
|
@@ -4441,10 +4441,10 @@ function Gd() {
|
|
|
4441
4441
|
$e.unshift("Warning: " + $), Function.prototype.apply.call(console[k], console, $e);
|
|
4442
4442
|
}
|
|
4443
4443
|
}
|
|
4444
|
-
var
|
|
4444
|
+
var v = !1, E = !1, C = !1, w = !1, S = !1, F;
|
|
4445
4445
|
F = Symbol.for("react.module.reference");
|
|
4446
4446
|
function T(k) {
|
|
4447
|
-
return !!(typeof k == "string" || typeof k == "function" || k === n || k === s || S || k === i || k === u || k === c ||
|
|
4447
|
+
return !!(typeof k == "string" || typeof k == "function" || k === n || k === s || S || k === i || k === u || k === c || w || k === p || v || E || C || typeof k == "object" && k !== null && (k.$$typeof === f || k.$$typeof === d || k.$$typeof === o || k.$$typeof === a || k.$$typeof === l || // This needs to include all possible module reference object
|
|
4448
4448
|
// types supported by any Flight configuration anywhere since
|
|
4449
4449
|
// we don't know which Flight build this will end up being used
|
|
4450
4450
|
// with.
|
|
@@ -4505,14 +4505,14 @@ function Gd() {
|
|
|
4505
4505
|
}
|
|
4506
4506
|
return null;
|
|
4507
4507
|
}
|
|
4508
|
-
var D = Object.assign, B = 0, M,
|
|
4508
|
+
var D = Object.assign, B = 0, M, O, V, U, re, q, J;
|
|
4509
4509
|
function W() {
|
|
4510
4510
|
}
|
|
4511
4511
|
W.__reactDisabledLog = !0;
|
|
4512
4512
|
function se() {
|
|
4513
4513
|
{
|
|
4514
4514
|
if (B === 0) {
|
|
4515
|
-
M = console.log,
|
|
4515
|
+
M = console.log, O = console.info, V = console.warn, U = console.error, re = console.group, q = console.groupCollapsed, J = console.groupEnd;
|
|
4516
4516
|
var k = {
|
|
4517
4517
|
configurable: !0,
|
|
4518
4518
|
enumerable: !0,
|
|
@@ -4545,7 +4545,7 @@ function Gd() {
|
|
|
4545
4545
|
value: M
|
|
4546
4546
|
}),
|
|
4547
4547
|
info: D({}, k, {
|
|
4548
|
-
value:
|
|
4548
|
+
value: O
|
|
4549
4549
|
}),
|
|
4550
4550
|
warn: D({}, k, {
|
|
4551
4551
|
value: V
|
|
@@ -4567,18 +4567,18 @@ function Gd() {
|
|
|
4567
4567
|
B < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
4568
4568
|
}
|
|
4569
4569
|
}
|
|
4570
|
-
var fe =
|
|
4570
|
+
var fe = b.ReactCurrentDispatcher, ge;
|
|
4571
4571
|
function Be(k, $, te) {
|
|
4572
4572
|
{
|
|
4573
|
-
if (
|
|
4573
|
+
if (ge === void 0)
|
|
4574
4574
|
try {
|
|
4575
4575
|
throw Error();
|
|
4576
4576
|
} catch (je) {
|
|
4577
4577
|
var pe = je.stack.trim().match(/\n( *(at )?)/);
|
|
4578
|
-
|
|
4578
|
+
ge = pe && pe[1] || "";
|
|
4579
4579
|
}
|
|
4580
4580
|
return `
|
|
4581
|
-
` +
|
|
4581
|
+
` + ge + k;
|
|
4582
4582
|
}
|
|
4583
4583
|
}
|
|
4584
4584
|
var _e = !1, Z;
|
|
@@ -4693,7 +4693,7 @@ function Gd() {
|
|
|
4693
4693
|
}
|
|
4694
4694
|
return "";
|
|
4695
4695
|
}
|
|
4696
|
-
var qe = Object.prototype.hasOwnProperty, ze = {}, He =
|
|
4696
|
+
var qe = Object.prototype.hasOwnProperty, ze = {}, He = b.ReactDebugCurrentFrame;
|
|
4697
4697
|
function Y(k) {
|
|
4698
4698
|
if (k) {
|
|
4699
4699
|
var $ = k._owner, te = ke(k.type, k._source, $ ? $.type : null);
|
|
@@ -4720,9 +4720,9 @@ function Gd() {
|
|
|
4720
4720
|
}
|
|
4721
4721
|
}
|
|
4722
4722
|
}
|
|
4723
|
-
var
|
|
4723
|
+
var ye = Array.isArray;
|
|
4724
4724
|
function Ke(k) {
|
|
4725
|
-
return
|
|
4725
|
+
return ye(k);
|
|
4726
4726
|
}
|
|
4727
4727
|
function z(k) {
|
|
4728
4728
|
{
|
|
@@ -4732,19 +4732,19 @@ function Gd() {
|
|
|
4732
4732
|
}
|
|
4733
4733
|
function ae(k) {
|
|
4734
4734
|
try {
|
|
4735
|
-
return
|
|
4735
|
+
return me(k), !1;
|
|
4736
4736
|
} catch {
|
|
4737
4737
|
return !0;
|
|
4738
4738
|
}
|
|
4739
4739
|
}
|
|
4740
|
-
function
|
|
4740
|
+
function me(k) {
|
|
4741
4741
|
return "" + k;
|
|
4742
4742
|
}
|
|
4743
|
-
function
|
|
4743
|
+
function xe(k) {
|
|
4744
4744
|
if (ae(k))
|
|
4745
|
-
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(k)),
|
|
4745
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(k)), me(k);
|
|
4746
4746
|
}
|
|
4747
|
-
var Ge =
|
|
4747
|
+
var Ge = b.ReactCurrentOwner, vt = {
|
|
4748
4748
|
key: !0,
|
|
4749
4749
|
ref: !0,
|
|
4750
4750
|
__self: !0,
|
|
@@ -4823,7 +4823,7 @@ function Gd() {
|
|
|
4823
4823
|
function j(k, $, te, pe, je) {
|
|
4824
4824
|
{
|
|
4825
4825
|
var $e, Fe = {}, Me = null, yt = null;
|
|
4826
|
-
te !== void 0 && (
|
|
4826
|
+
te !== void 0 && (xe(te), Me = "" + te), Ye($) && (xe($.key), Me = "" + $.key), de($) && (yt = $.ref, tt($, je));
|
|
4827
4827
|
for ($e in $)
|
|
4828
4828
|
qe.call($, $e) && !vt.hasOwnProperty($e) && (Fe[$e] = $[$e]);
|
|
4829
4829
|
if (k && k.defaultProps) {
|
|
@@ -4838,7 +4838,7 @@ function Gd() {
|
|
|
4838
4838
|
return ee(k, Me, yt, je, pe, Ge.current, Fe);
|
|
4839
4839
|
}
|
|
4840
4840
|
}
|
|
4841
|
-
var ue =
|
|
4841
|
+
var ue = b.ReactCurrentOwner, he = b.ReactDebugCurrentFrame;
|
|
4842
4842
|
function G(k) {
|
|
4843
4843
|
if (k) {
|
|
4844
4844
|
var $ = k._owner, te = ke(k.type, k._source, $ ? $.type : null);
|
|
@@ -5007,7 +5007,7 @@ process.env.NODE_ENV === "production" ? Zs.exports = Vd() : Zs.exports = Gd();
|
|
|
5007
5007
|
var h = Zs.exports;
|
|
5008
5008
|
const cu = nu(void 0);
|
|
5009
5009
|
function by({ apiUrl: r, systemId: e, children: t }) {
|
|
5010
|
-
const [n, i] =
|
|
5010
|
+
const [n, i] = I(null), [s, o] = I(null), [a, l] = I(!1), [u, c] = I(!0), [d] = I(() => new au({ apiUrl: r, systemId: e })), f = X(async (E) => {
|
|
5011
5011
|
const C = await d.isAdmin(E);
|
|
5012
5012
|
l(C);
|
|
5013
5013
|
}, [d]), p = X(() => {
|
|
@@ -5018,15 +5018,15 @@ function by({ apiUrl: r, systemId: e, children: t }) {
|
|
|
5018
5018
|
p();
|
|
5019
5019
|
}, [p]);
|
|
5020
5020
|
const g = X(async (E, C) => {
|
|
5021
|
-
const
|
|
5022
|
-
return
|
|
5023
|
-
}, [d, f]), m = X(async (E, C,
|
|
5024
|
-
const
|
|
5025
|
-
return
|
|
5026
|
-
}, [d, f]),
|
|
5027
|
-
const S = await d.setPasswordWithCode(E, C,
|
|
5021
|
+
const w = await d.login(E, C);
|
|
5022
|
+
return w.success && w.user && w.token && (o(w.token), i(w.user), await f(w.user._id)), w;
|
|
5023
|
+
}, [d, f]), m = X(async (E, C, w) => d.register(E, C, w), [d]), x = X(async (E, C) => {
|
|
5024
|
+
const w = await d.verifyEmail(E, C);
|
|
5025
|
+
return w.success && w.user && w.token && (o(w.token), i(w.user), await f(w.user._id)), w;
|
|
5026
|
+
}, [d, f]), b = X(async (E) => d.requestPasswordReset(E), [d]), y = X(async (E, C, w) => {
|
|
5027
|
+
const S = await d.setPasswordWithCode(E, C, w);
|
|
5028
5028
|
return S.success && S.user && S.token && (o(S.token), i(S.user), await f(S.user._id)), S;
|
|
5029
|
-
}, [d, f]),
|
|
5029
|
+
}, [d, f]), _ = X(async (E) => d.resendVerificationCode(E), [d]), v = X(() => {
|
|
5030
5030
|
d.logout(), i(null), o(null), l(!1);
|
|
5031
5031
|
}, [d]);
|
|
5032
5032
|
return /* @__PURE__ */ h.jsx(cu.Provider, { value: {
|
|
@@ -5037,10 +5037,10 @@ function by({ apiUrl: r, systemId: e, children: t }) {
|
|
|
5037
5037
|
login: g,
|
|
5038
5038
|
register: m,
|
|
5039
5039
|
verifyEmail: x,
|
|
5040
|
-
requestPasswordReset:
|
|
5040
|
+
requestPasswordReset: b,
|
|
5041
5041
|
setPasswordWithCode: y,
|
|
5042
|
-
resendVerificationCode:
|
|
5043
|
-
logout:
|
|
5042
|
+
resendVerificationCode: _,
|
|
5043
|
+
logout: v,
|
|
5044
5044
|
refreshUser: p
|
|
5045
5045
|
}, children: t });
|
|
5046
5046
|
}
|
|
@@ -5075,15 +5075,15 @@ function du({
|
|
|
5075
5075
|
className: u = "",
|
|
5076
5076
|
isModal: c = !1
|
|
5077
5077
|
}) {
|
|
5078
|
-
const [d, f] =
|
|
5079
|
-
async function
|
|
5078
|
+
const [d, f] = I(""), [p, g] = I(""), [m, x] = I(""), [b, y] = I(!1), _ = { ...Kd, ...l };
|
|
5079
|
+
async function v(T) {
|
|
5080
5080
|
T.preventDefault(), y(!0), x("");
|
|
5081
5081
|
const A = await r(d, p);
|
|
5082
5082
|
A.success ? e == null || e() : x(A.error || "Connexion impossible"), y(!1);
|
|
5083
5083
|
}
|
|
5084
5084
|
const E = {
|
|
5085
|
-
backgroundColor:
|
|
5086
|
-
borderRadius:
|
|
5085
|
+
backgroundColor: _.backgroundColor,
|
|
5086
|
+
borderRadius: _.borderRadius,
|
|
5087
5087
|
padding: "1.5rem",
|
|
5088
5088
|
width: "100%",
|
|
5089
5089
|
maxWidth: "24rem",
|
|
@@ -5093,34 +5093,34 @@ function du({
|
|
|
5093
5093
|
}, C = {
|
|
5094
5094
|
width: "100%",
|
|
5095
5095
|
padding: "0.5rem 1rem",
|
|
5096
|
-
border: `1px solid ${
|
|
5097
|
-
borderRadius:
|
|
5098
|
-
backgroundColor:
|
|
5099
|
-
color:
|
|
5096
|
+
border: `1px solid ${_.borderColor}`,
|
|
5097
|
+
borderRadius: _.borderRadius,
|
|
5098
|
+
backgroundColor: _.inputBackground,
|
|
5099
|
+
color: _.textColor,
|
|
5100
5100
|
fontSize: "1rem",
|
|
5101
5101
|
outline: "none"
|
|
5102
|
-
},
|
|
5102
|
+
}, w = {
|
|
5103
5103
|
display: "block",
|
|
5104
5104
|
fontSize: "0.875rem",
|
|
5105
5105
|
fontWeight: 500,
|
|
5106
|
-
color:
|
|
5106
|
+
color: _.textMutedColor,
|
|
5107
5107
|
marginBottom: "0.25rem"
|
|
5108
5108
|
}, S = {
|
|
5109
5109
|
width: "100%",
|
|
5110
5110
|
padding: "0.75rem",
|
|
5111
|
-
backgroundColor:
|
|
5111
|
+
backgroundColor: b ? _.textMutedColor : _.primaryColor,
|
|
5112
5112
|
color: "#ffffff",
|
|
5113
5113
|
border: "none",
|
|
5114
|
-
borderRadius:
|
|
5114
|
+
borderRadius: _.borderRadius,
|
|
5115
5115
|
fontSize: "1rem",
|
|
5116
5116
|
fontWeight: 500,
|
|
5117
|
-
cursor:
|
|
5117
|
+
cursor: b ? "not-allowed" : "pointer",
|
|
5118
5118
|
transition: "background-color 0.2s"
|
|
5119
5119
|
}, F = {
|
|
5120
5120
|
padding: "0.75rem",
|
|
5121
|
-
backgroundColor:
|
|
5122
|
-
border: `1px solid ${
|
|
5123
|
-
borderRadius:
|
|
5121
|
+
backgroundColor: _.errorBackgroundColor,
|
|
5122
|
+
border: `1px solid ${_.errorColor}20`,
|
|
5123
|
+
borderRadius: _.borderRadius,
|
|
5124
5124
|
marginBottom: "1rem"
|
|
5125
5125
|
};
|
|
5126
5126
|
return /* @__PURE__ */ h.jsxs("div", { style: E, className: u, children: [
|
|
@@ -5128,14 +5128,14 @@ function du({
|
|
|
5128
5128
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5129
5129
|
fontSize: "1.25rem",
|
|
5130
5130
|
fontWeight: 700,
|
|
5131
|
-
color:
|
|
5131
|
+
color: _.textColor,
|
|
5132
5132
|
marginBottom: "1rem",
|
|
5133
5133
|
textAlign: t ? "center" : "left"
|
|
5134
5134
|
}, children: n }),
|
|
5135
|
-
/* @__PURE__ */ h.jsxs("form", { onSubmit:
|
|
5136
|
-
m && /* @__PURE__ */ h.jsx("div", { style: F, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5135
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: v, children: [
|
|
5136
|
+
m && /* @__PURE__ */ h.jsx("div", { style: F, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: _.errorColor, margin: 0 }, children: m }) }),
|
|
5137
5137
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1rem" }, children: [
|
|
5138
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5138
|
+
/* @__PURE__ */ h.jsx("label", { style: w, children: o }),
|
|
5139
5139
|
/* @__PURE__ */ h.jsx(
|
|
5140
5140
|
"input",
|
|
5141
5141
|
{
|
|
@@ -5145,16 +5145,16 @@ function du({
|
|
|
5145
5145
|
required: !0,
|
|
5146
5146
|
style: C,
|
|
5147
5147
|
onFocus: (T) => {
|
|
5148
|
-
T.target.style.borderColor =
|
|
5148
|
+
T.target.style.borderColor = _.primaryColor, T.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5149
5149
|
},
|
|
5150
5150
|
onBlur: (T) => {
|
|
5151
|
-
T.target.style.borderColor =
|
|
5151
|
+
T.target.style.borderColor = _.borderColor, T.target.style.boxShadow = "none";
|
|
5152
5152
|
}
|
|
5153
5153
|
}
|
|
5154
5154
|
)
|
|
5155
5155
|
] }),
|
|
5156
5156
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
5157
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5157
|
+
/* @__PURE__ */ h.jsx("label", { style: w, children: a }),
|
|
5158
5158
|
/* @__PURE__ */ h.jsx(
|
|
5159
5159
|
"input",
|
|
5160
5160
|
{
|
|
@@ -5164,10 +5164,10 @@ function du({
|
|
|
5164
5164
|
required: !0,
|
|
5165
5165
|
style: C,
|
|
5166
5166
|
onFocus: (T) => {
|
|
5167
|
-
T.target.style.borderColor =
|
|
5167
|
+
T.target.style.borderColor = _.primaryColor, T.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5168
5168
|
},
|
|
5169
5169
|
onBlur: (T) => {
|
|
5170
|
-
T.target.style.borderColor =
|
|
5170
|
+
T.target.style.borderColor = _.borderColor, T.target.style.boxShadow = "none";
|
|
5171
5171
|
}
|
|
5172
5172
|
}
|
|
5173
5173
|
)
|
|
@@ -5176,15 +5176,15 @@ function du({
|
|
|
5176
5176
|
"button",
|
|
5177
5177
|
{
|
|
5178
5178
|
type: "submit",
|
|
5179
|
-
disabled:
|
|
5179
|
+
disabled: b,
|
|
5180
5180
|
style: S,
|
|
5181
5181
|
onMouseEnter: (T) => {
|
|
5182
|
-
|
|
5182
|
+
b || (T.target.style.backgroundColor = _.primaryHoverColor);
|
|
5183
5183
|
},
|
|
5184
5184
|
onMouseLeave: (T) => {
|
|
5185
|
-
|
|
5185
|
+
b || (T.target.style.backgroundColor = _.primaryColor);
|
|
5186
5186
|
},
|
|
5187
|
-
children:
|
|
5187
|
+
children: b ? s : i
|
|
5188
5188
|
}
|
|
5189
5189
|
)
|
|
5190
5190
|
] })
|
|
@@ -5290,21 +5290,21 @@ function Qd({
|
|
|
5290
5290
|
className: m = "",
|
|
5291
5291
|
isModal: x = !1
|
|
5292
5292
|
}) {
|
|
5293
|
-
const [
|
|
5293
|
+
const [b, y] = I(""), [_, v] = I(""), [E, C] = I(""), [w, S] = I(""), [F, T] = I(""), [A, N] = I(""), [R, D] = I(!1), B = { ...Yd, ...g };
|
|
5294
5294
|
async function M(W) {
|
|
5295
|
-
if (W.preventDefault(), N(""),
|
|
5295
|
+
if (W.preventDefault(), N(""), _ !== E) {
|
|
5296
5296
|
N("Les mots de passe ne correspondent pas");
|
|
5297
5297
|
return;
|
|
5298
5298
|
}
|
|
5299
|
-
if (
|
|
5299
|
+
if (_.length < 8) {
|
|
5300
5300
|
N("Le mot de passe doit contenir au moins 8 caractères");
|
|
5301
5301
|
return;
|
|
5302
5302
|
}
|
|
5303
5303
|
D(!0);
|
|
5304
|
-
const ce = await r(
|
|
5305
|
-
ce.success ? e == null || e(
|
|
5304
|
+
const ce = await r(b, _, p ? { firstName: w, lastName: F } : void 0);
|
|
5305
|
+
ce.success ? e == null || e(b) : N(ce.error || "Erreur lors de l'inscription"), D(!1);
|
|
5306
5306
|
}
|
|
5307
|
-
const
|
|
5307
|
+
const O = {
|
|
5308
5308
|
backgroundColor: B.backgroundColor,
|
|
5309
5309
|
borderRadius: B.borderRadius,
|
|
5310
5310
|
padding: "1.5rem",
|
|
@@ -5352,7 +5352,7 @@ function Qd({
|
|
|
5352
5352
|
fontSize: "0.875rem",
|
|
5353
5353
|
cursor: "pointer"
|
|
5354
5354
|
};
|
|
5355
|
-
return /* @__PURE__ */ h.jsxs("div", { style:
|
|
5355
|
+
return /* @__PURE__ */ h.jsxs("div", { style: O, className: m, children: [
|
|
5356
5356
|
n && /* @__PURE__ */ h.jsx("div", { style: { display: "flex", justifyContent: "center", marginBottom: "1.5rem" }, children: n }),
|
|
5357
5357
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5358
5358
|
fontSize: "1.25rem",
|
|
@@ -5370,7 +5370,7 @@ function Qd({
|
|
|
5370
5370
|
"input",
|
|
5371
5371
|
{
|
|
5372
5372
|
type: "text",
|
|
5373
|
-
value:
|
|
5373
|
+
value: w,
|
|
5374
5374
|
onChange: (W) => S(W.target.value),
|
|
5375
5375
|
style: V
|
|
5376
5376
|
}
|
|
@@ -5395,7 +5395,7 @@ function Qd({
|
|
|
5395
5395
|
"input",
|
|
5396
5396
|
{
|
|
5397
5397
|
type: "email",
|
|
5398
|
-
value:
|
|
5398
|
+
value: b,
|
|
5399
5399
|
onChange: (W) => y(W.target.value),
|
|
5400
5400
|
required: !0,
|
|
5401
5401
|
style: V
|
|
@@ -5408,8 +5408,8 @@ function Qd({
|
|
|
5408
5408
|
"input",
|
|
5409
5409
|
{
|
|
5410
5410
|
type: "password",
|
|
5411
|
-
value:
|
|
5412
|
-
onChange: (W) =>
|
|
5411
|
+
value: _,
|
|
5412
|
+
onChange: (W) => v(W.target.value),
|
|
5413
5413
|
required: !0,
|
|
5414
5414
|
minLength: 8,
|
|
5415
5415
|
style: V
|
|
@@ -5479,7 +5479,7 @@ function Sl({
|
|
|
5479
5479
|
className: g = "",
|
|
5480
5480
|
isModal: m = !1
|
|
5481
5481
|
}) {
|
|
5482
|
-
const [x,
|
|
5482
|
+
const [x, b] = I(Array(f).fill("")), [y, _] = I(""), [v, E] = I(!1), [C, w] = I(!1), [S, F] = I(!1), T = be([]), A = { ...Xd, ...p };
|
|
5483
5483
|
Te(() => {
|
|
5484
5484
|
var q;
|
|
5485
5485
|
(q = T.current[0]) == null || q.focus();
|
|
@@ -5487,7 +5487,7 @@ function Sl({
|
|
|
5487
5487
|
const N = (q, J) => {
|
|
5488
5488
|
var ce;
|
|
5489
5489
|
const W = J.replace(/\D/g, "").slice(-1), se = [...x];
|
|
5490
|
-
if (se[q] = W,
|
|
5490
|
+
if (se[q] = W, b(se), _(""), W && q < f - 1 && ((ce = T.current[q + 1]) == null || ce.focus()), W && q === f - 1) {
|
|
5491
5491
|
const fe = se.join("");
|
|
5492
5492
|
fe.length === f && B(fe);
|
|
5493
5493
|
}
|
|
@@ -5498,9 +5498,9 @@ function Sl({
|
|
|
5498
5498
|
var ce;
|
|
5499
5499
|
q.preventDefault();
|
|
5500
5500
|
const J = q.clipboardData.getData("text").replace(/\D/g, "").slice(0, f), W = [...x];
|
|
5501
|
-
J.split("").forEach((fe,
|
|
5502
|
-
|
|
5503
|
-
}),
|
|
5501
|
+
J.split("").forEach((fe, ge) => {
|
|
5502
|
+
ge < f && (W[ge] = fe);
|
|
5503
|
+
}), b(W);
|
|
5504
5504
|
const se = Math.min(J.length, f) - 1;
|
|
5505
5505
|
se >= 0 && ((ce = T.current[se]) == null || ce.focus()), J.length === f && B(J);
|
|
5506
5506
|
};
|
|
@@ -5508,20 +5508,20 @@ function Sl({
|
|
|
5508
5508
|
var se;
|
|
5509
5509
|
const J = q || x.join("");
|
|
5510
5510
|
if (J.length !== f) {
|
|
5511
|
-
|
|
5511
|
+
_("Veuillez entrer le code complet");
|
|
5512
5512
|
return;
|
|
5513
5513
|
}
|
|
5514
|
-
E(!0),
|
|
5514
|
+
E(!0), _("");
|
|
5515
5515
|
const W = await e(r, J);
|
|
5516
|
-
W.success ? t == null || t() : (
|
|
5516
|
+
W.success ? t == null || t() : (_(W.error || "Code invalide"), b(Array(f).fill("")), (se = T.current[0]) == null || se.focus()), E(!1);
|
|
5517
5517
|
}
|
|
5518
5518
|
async function M() {
|
|
5519
5519
|
if (!n) return;
|
|
5520
|
-
|
|
5520
|
+
w(!0), F(!1), _("");
|
|
5521
5521
|
const q = await n(r);
|
|
5522
|
-
q.success ? (F(!0), setTimeout(() => F(!1), 3e3)) :
|
|
5522
|
+
q.success ? (F(!0), setTimeout(() => F(!1), 3e3)) : _(q.error || "Erreur lors de l'envoi"), w(!1);
|
|
5523
5523
|
}
|
|
5524
|
-
const
|
|
5524
|
+
const O = {
|
|
5525
5525
|
backgroundColor: A.backgroundColor,
|
|
5526
5526
|
borderRadius: A.borderRadius,
|
|
5527
5527
|
padding: "1.5rem",
|
|
@@ -5545,13 +5545,13 @@ function Sl({
|
|
|
5545
5545
|
}, U = {
|
|
5546
5546
|
width: "100%",
|
|
5547
5547
|
padding: "0.75rem",
|
|
5548
|
-
backgroundColor:
|
|
5548
|
+
backgroundColor: v ? A.textMutedColor : A.primaryColor,
|
|
5549
5549
|
color: "#ffffff",
|
|
5550
5550
|
border: "none",
|
|
5551
5551
|
borderRadius: A.borderRadius,
|
|
5552
5552
|
fontSize: "1rem",
|
|
5553
5553
|
fontWeight: 500,
|
|
5554
|
-
cursor:
|
|
5554
|
+
cursor: v ? "not-allowed" : "pointer",
|
|
5555
5555
|
transition: "background-color 0.2s"
|
|
5556
5556
|
}, re = {
|
|
5557
5557
|
color: A.primaryColor,
|
|
@@ -5562,7 +5562,7 @@ function Sl({
|
|
|
5562
5562
|
border: "none",
|
|
5563
5563
|
padding: 0
|
|
5564
5564
|
};
|
|
5565
|
-
return /* @__PURE__ */ h.jsxs("div", { style:
|
|
5565
|
+
return /* @__PURE__ */ h.jsxs("div", { style: O, className: g, children: [
|
|
5566
5566
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5567
5567
|
fontSize: "1.25rem",
|
|
5568
5568
|
fontWeight: 700,
|
|
@@ -5608,7 +5608,7 @@ function Sl({
|
|
|
5608
5608
|
onChange: (W) => N(J, W.target.value),
|
|
5609
5609
|
onKeyDown: (W) => R(J, W),
|
|
5610
5610
|
onPaste: D,
|
|
5611
|
-
disabled:
|
|
5611
|
+
disabled: v,
|
|
5612
5612
|
style: {
|
|
5613
5613
|
...V,
|
|
5614
5614
|
borderColor: q ? A.primaryColor : A.borderColor
|
|
@@ -5627,12 +5627,12 @@ function Sl({
|
|
|
5627
5627
|
{
|
|
5628
5628
|
type: "button",
|
|
5629
5629
|
onClick: () => B(),
|
|
5630
|
-
disabled:
|
|
5630
|
+
disabled: v || x.join("").length !== f,
|
|
5631
5631
|
style: {
|
|
5632
5632
|
...U,
|
|
5633
5633
|
opacity: x.join("").length !== f ? 0.5 : 1
|
|
5634
5634
|
},
|
|
5635
|
-
children:
|
|
5635
|
+
children: v ? l : a
|
|
5636
5636
|
}
|
|
5637
5637
|
),
|
|
5638
5638
|
n && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx(
|
|
@@ -5679,13 +5679,13 @@ function Zd({
|
|
|
5679
5679
|
className: c = "",
|
|
5680
5680
|
isModal: d = !1
|
|
5681
5681
|
}) {
|
|
5682
|
-
const [f, p] =
|
|
5683
|
-
async function
|
|
5684
|
-
F.preventDefault(),
|
|
5682
|
+
const [f, p] = I(""), [g, m] = I(""), [x, b] = I(!1), y = { ...Jd, ...u };
|
|
5683
|
+
async function _(F) {
|
|
5684
|
+
F.preventDefault(), b(!0), m("");
|
|
5685
5685
|
const T = await r(f);
|
|
5686
|
-
T.success ? e == null || e(f) : m(T.error || "Erreur lors de l'envoi"),
|
|
5686
|
+
T.success ? e == null || e(f) : m(T.error || "Erreur lors de l'envoi"), b(!1);
|
|
5687
5687
|
}
|
|
5688
|
-
const
|
|
5688
|
+
const v = {
|
|
5689
5689
|
backgroundColor: y.backgroundColor,
|
|
5690
5690
|
borderRadius: y.borderRadius,
|
|
5691
5691
|
padding: "1.5rem",
|
|
@@ -5710,7 +5710,7 @@ function Zd({
|
|
|
5710
5710
|
fontWeight: 500,
|
|
5711
5711
|
color: y.textMutedColor,
|
|
5712
5712
|
marginBottom: "0.25rem"
|
|
5713
|
-
},
|
|
5713
|
+
}, w = {
|
|
5714
5714
|
width: "100%",
|
|
5715
5715
|
padding: "0.75rem",
|
|
5716
5716
|
backgroundColor: x ? y.textMutedColor : y.primaryColor,
|
|
@@ -5730,7 +5730,7 @@ function Zd({
|
|
|
5730
5730
|
border: "none",
|
|
5731
5731
|
padding: 0
|
|
5732
5732
|
};
|
|
5733
|
-
return /* @__PURE__ */ h.jsxs("div", { style:
|
|
5733
|
+
return /* @__PURE__ */ h.jsxs("div", { style: v, className: c, children: [
|
|
5734
5734
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5735
5735
|
fontSize: "1.25rem",
|
|
5736
5736
|
fontWeight: 700,
|
|
@@ -5744,7 +5744,7 @@ function Zd({
|
|
|
5744
5744
|
textAlign: "center",
|
|
5745
5745
|
marginBottom: "1.5rem"
|
|
5746
5746
|
}, children: i }),
|
|
5747
|
-
/* @__PURE__ */ h.jsxs("form", { onSubmit:
|
|
5747
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: _, children: [
|
|
5748
5748
|
g && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5749
5749
|
padding: "0.75rem",
|
|
5750
5750
|
backgroundColor: y.errorBackgroundColor,
|
|
@@ -5770,7 +5770,7 @@ function Zd({
|
|
|
5770
5770
|
{
|
|
5771
5771
|
type: "submit",
|
|
5772
5772
|
disabled: x,
|
|
5773
|
-
style:
|
|
5773
|
+
style: w,
|
|
5774
5774
|
onMouseEnter: (F) => {
|
|
5775
5775
|
x || (F.target.style.backgroundColor = y.primaryHoverColor);
|
|
5776
5776
|
},
|
|
@@ -5813,23 +5813,23 @@ function tf({
|
|
|
5813
5813
|
className: p = "",
|
|
5814
5814
|
isModal: g = !1
|
|
5815
5815
|
}) {
|
|
5816
|
-
const [m, x] =
|
|
5816
|
+
const [m, x] = I(""), [b, y] = I(""), [_, v] = I(""), [E, C] = I(!1), w = { ...ef, ...f };
|
|
5817
5817
|
async function S(D) {
|
|
5818
|
-
if (D.preventDefault(),
|
|
5819
|
-
|
|
5818
|
+
if (D.preventDefault(), v(""), m !== b) {
|
|
5819
|
+
v("Les mots de passe ne correspondent pas");
|
|
5820
5820
|
return;
|
|
5821
5821
|
}
|
|
5822
5822
|
if (m.length < 8) {
|
|
5823
|
-
|
|
5823
|
+
v("Le mot de passe doit contenir au moins 8 caractères");
|
|
5824
5824
|
return;
|
|
5825
5825
|
}
|
|
5826
5826
|
C(!0);
|
|
5827
5827
|
const B = await t(r, e, m);
|
|
5828
|
-
B.success ? n == null || n() :
|
|
5828
|
+
B.success ? n == null || n() : v(B.error || "Erreur lors de la réinitialisation"), C(!1);
|
|
5829
5829
|
}
|
|
5830
5830
|
const F = {
|
|
5831
|
-
backgroundColor:
|
|
5832
|
-
borderRadius:
|
|
5831
|
+
backgroundColor: w.backgroundColor,
|
|
5832
|
+
borderRadius: w.borderRadius,
|
|
5833
5833
|
padding: "1.5rem",
|
|
5834
5834
|
width: "100%",
|
|
5835
5835
|
maxWidth: "24rem",
|
|
@@ -5839,10 +5839,10 @@ function tf({
|
|
|
5839
5839
|
}, T = {
|
|
5840
5840
|
width: "100%",
|
|
5841
5841
|
padding: "0.5rem 1rem",
|
|
5842
|
-
border: `1px solid ${
|
|
5843
|
-
borderRadius:
|
|
5844
|
-
backgroundColor:
|
|
5845
|
-
color:
|
|
5842
|
+
border: `1px solid ${w.borderColor}`,
|
|
5843
|
+
borderRadius: w.borderRadius,
|
|
5844
|
+
backgroundColor: w.inputBackground,
|
|
5845
|
+
color: w.textColor,
|
|
5846
5846
|
fontSize: "1rem",
|
|
5847
5847
|
outline: "none",
|
|
5848
5848
|
boxSizing: "border-box"
|
|
@@ -5850,21 +5850,21 @@ function tf({
|
|
|
5850
5850
|
display: "block",
|
|
5851
5851
|
fontSize: "0.875rem",
|
|
5852
5852
|
fontWeight: 500,
|
|
5853
|
-
color:
|
|
5853
|
+
color: w.textMutedColor,
|
|
5854
5854
|
marginBottom: "0.25rem"
|
|
5855
5855
|
}, N = {
|
|
5856
5856
|
width: "100%",
|
|
5857
5857
|
padding: "0.75rem",
|
|
5858
|
-
backgroundColor: E ?
|
|
5858
|
+
backgroundColor: E ? w.textMutedColor : w.primaryColor,
|
|
5859
5859
|
color: "#ffffff",
|
|
5860
5860
|
border: "none",
|
|
5861
|
-
borderRadius:
|
|
5861
|
+
borderRadius: w.borderRadius,
|
|
5862
5862
|
fontSize: "1rem",
|
|
5863
5863
|
fontWeight: 500,
|
|
5864
5864
|
cursor: E ? "not-allowed" : "pointer",
|
|
5865
5865
|
transition: "background-color 0.2s"
|
|
5866
5866
|
}, R = {
|
|
5867
|
-
color:
|
|
5867
|
+
color: w.primaryColor,
|
|
5868
5868
|
textDecoration: "none",
|
|
5869
5869
|
fontSize: "0.875rem",
|
|
5870
5870
|
cursor: "pointer",
|
|
@@ -5876,24 +5876,24 @@ function tf({
|
|
|
5876
5876
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5877
5877
|
fontSize: "1.25rem",
|
|
5878
5878
|
fontWeight: 700,
|
|
5879
|
-
color:
|
|
5879
|
+
color: w.textColor,
|
|
5880
5880
|
marginBottom: "0.5rem",
|
|
5881
5881
|
textAlign: "center"
|
|
5882
5882
|
}, children: s }),
|
|
5883
5883
|
o && /* @__PURE__ */ h.jsx("p", { style: {
|
|
5884
5884
|
fontSize: "0.875rem",
|
|
5885
|
-
color:
|
|
5885
|
+
color: w.textMutedColor,
|
|
5886
5886
|
textAlign: "center",
|
|
5887
5887
|
marginBottom: "1.5rem"
|
|
5888
5888
|
}, children: o }),
|
|
5889
5889
|
/* @__PURE__ */ h.jsxs("form", { onSubmit: S, children: [
|
|
5890
|
-
|
|
5890
|
+
_ && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5891
5891
|
padding: "0.75rem",
|
|
5892
|
-
backgroundColor:
|
|
5893
|
-
border: `1px solid ${
|
|
5894
|
-
borderRadius:
|
|
5892
|
+
backgroundColor: w.errorBackgroundColor,
|
|
5893
|
+
border: `1px solid ${w.errorColor}20`,
|
|
5894
|
+
borderRadius: w.borderRadius,
|
|
5895
5895
|
marginBottom: "1rem"
|
|
5896
|
-
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5896
|
+
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: w.errorColor, margin: 0 }, children: _ }) }),
|
|
5897
5897
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1rem" }, children: [
|
|
5898
5898
|
/* @__PURE__ */ h.jsx("label", { style: A, children: u }),
|
|
5899
5899
|
/* @__PURE__ */ h.jsx(
|
|
@@ -5914,7 +5914,7 @@ function tf({
|
|
|
5914
5914
|
"input",
|
|
5915
5915
|
{
|
|
5916
5916
|
type: "password",
|
|
5917
|
-
value:
|
|
5917
|
+
value: b,
|
|
5918
5918
|
onChange: (D) => y(D.target.value),
|
|
5919
5919
|
required: !0,
|
|
5920
5920
|
style: T
|
|
@@ -5928,10 +5928,10 @@ function tf({
|
|
|
5928
5928
|
disabled: E,
|
|
5929
5929
|
style: N,
|
|
5930
5930
|
onMouseEnter: (D) => {
|
|
5931
|
-
E || (D.target.style.backgroundColor =
|
|
5931
|
+
E || (D.target.style.backgroundColor = w.primaryHoverColor);
|
|
5932
5932
|
},
|
|
5933
5933
|
onMouseLeave: (D) => {
|
|
5934
|
-
E || (D.target.style.backgroundColor =
|
|
5934
|
+
E || (D.target.style.backgroundColor = w.primaryColor);
|
|
5935
5935
|
},
|
|
5936
5936
|
children: E ? l : a
|
|
5937
5937
|
}
|
|
@@ -5956,21 +5956,21 @@ function rf({
|
|
|
5956
5956
|
isModal: f = !1,
|
|
5957
5957
|
labels: p = {}
|
|
5958
5958
|
}) {
|
|
5959
|
-
const [g, m] =
|
|
5960
|
-
async function
|
|
5959
|
+
const [g, m] = I(a), [x, b] = I(""), [y, _] = I("");
|
|
5960
|
+
async function v(T, A) {
|
|
5961
5961
|
const N = await r(T, A);
|
|
5962
|
-
return N.requiresVerification ? (
|
|
5962
|
+
return N.requiresVerification ? (b(T), m("verify-email"), { success: !1, error: "Veuillez vérifier votre email" }) : N;
|
|
5963
5963
|
}
|
|
5964
5964
|
async function E(T, A, N) {
|
|
5965
5965
|
const R = await e(T, A, N);
|
|
5966
|
-
return R.success && R.requiresVerification && (
|
|
5966
|
+
return R.success && R.requiresVerification && (b(T), m("verify-email")), R;
|
|
5967
5967
|
}
|
|
5968
5968
|
async function C(T) {
|
|
5969
5969
|
const A = await n(T);
|
|
5970
|
-
return A.success && (
|
|
5970
|
+
return A.success && (b(T), m("verify-reset-code")), A;
|
|
5971
5971
|
}
|
|
5972
|
-
async function
|
|
5973
|
-
return
|
|
5972
|
+
async function w(T, A) {
|
|
5973
|
+
return _(A), m("reset-password"), { success: !0 };
|
|
5974
5974
|
}
|
|
5975
5975
|
const S = () => {
|
|
5976
5976
|
switch (g) {
|
|
@@ -5978,7 +5978,7 @@ function rf({
|
|
|
5978
5978
|
return /* @__PURE__ */ h.jsx(
|
|
5979
5979
|
du,
|
|
5980
5980
|
{
|
|
5981
|
-
onLogin:
|
|
5981
|
+
onLogin: v,
|
|
5982
5982
|
onSuccess: o,
|
|
5983
5983
|
logo: l,
|
|
5984
5984
|
theme: u,
|
|
@@ -6035,7 +6035,7 @@ function rf({
|
|
|
6035
6035
|
Sl,
|
|
6036
6036
|
{
|
|
6037
6037
|
email: x,
|
|
6038
|
-
onVerify:
|
|
6038
|
+
onVerify: w,
|
|
6039
6039
|
onResendCode: s,
|
|
6040
6040
|
onBackClick: () => m("forgot-password"),
|
|
6041
6041
|
title: "Code de réinitialisation",
|
|
@@ -6163,7 +6163,7 @@ function nf(r, e, t = {}) {
|
|
|
6163
6163
|
refetchOnMount: i = !0,
|
|
6164
6164
|
onSuccess: s,
|
|
6165
6165
|
onError: o
|
|
6166
|
-
} = t, [a, l] =
|
|
6166
|
+
} = t, [a, l] = I(null), [u, c] = I(n), [d, f] = I(null), p = X(async () => {
|
|
6167
6167
|
if (n) {
|
|
6168
6168
|
c(!0), f(null);
|
|
6169
6169
|
try {
|
|
@@ -6187,7 +6187,7 @@ function nf(r, e, t = {}) {
|
|
|
6187
6187
|
};
|
|
6188
6188
|
}
|
|
6189
6189
|
function Cy(r, e = "POST", t = {}) {
|
|
6190
|
-
const { onSuccess: n, onError: i } = t, [s, o] =
|
|
6190
|
+
const { onSuccess: n, onError: i } = t, [s, o] = I(null), [a, l] = I(!1), [u, c] = I(null), d = X(
|
|
6191
6191
|
async (p) => {
|
|
6192
6192
|
l(!0), c(null);
|
|
6193
6193
|
try {
|
|
@@ -6331,16 +6331,16 @@ function Dy({
|
|
|
6331
6331
|
onRefresh: p,
|
|
6332
6332
|
theme: g = {}
|
|
6333
6333
|
}) {
|
|
6334
|
-
const { data: m, loading: x, error:
|
|
6334
|
+
const { data: m, loading: x, error: b, refetch: y } = nf(r, e), [_, v] = I(""), [E, C] = I({}), [w, S] = I(1), F = ct(() => {
|
|
6335
6335
|
if (!m) return { data: [], total: 0, totalPages: 0 };
|
|
6336
6336
|
let D = m;
|
|
6337
|
-
return a &&
|
|
6338
|
-
}, [m,
|
|
6337
|
+
return a && _ && l.length > 0 && (D = Ps.search(D, _, l)), Object.keys(E).length > 0 && (D = Ps.filterByFields(D, E)), Ps.paginate(D, w, d);
|
|
6338
|
+
}, [m, _, E, w, d, a, l]);
|
|
6339
6339
|
Te(() => {
|
|
6340
6340
|
S(1);
|
|
6341
|
-
}, [
|
|
6341
|
+
}, [_, E]);
|
|
6342
6342
|
const T = () => {
|
|
6343
|
-
|
|
6343
|
+
v(""), C({}), S(1), y(), p == null || p();
|
|
6344
6344
|
}, A = {
|
|
6345
6345
|
background: g.background || "#ffffff",
|
|
6346
6346
|
cardBackground: g.cardBackground || "#f9fafb",
|
|
@@ -6361,13 +6361,13 @@ function Dy({
|
|
|
6361
6361
|
justifyContent: "center",
|
|
6362
6362
|
padding: "48px",
|
|
6363
6363
|
color: A.textSecondary
|
|
6364
|
-
}, children: "Loading..." }) :
|
|
6364
|
+
}, children: "Loading..." }) : b ? /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6365
6365
|
padding: "24px",
|
|
6366
6366
|
textAlign: "center",
|
|
6367
6367
|
color: "#ef4444"
|
|
6368
6368
|
}, children: [
|
|
6369
6369
|
/* @__PURE__ */ h.jsx("div", { style: { fontWeight: 500, marginBottom: "8px" }, children: "Error" }),
|
|
6370
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px" }, children:
|
|
6370
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px" }, children: b.message }),
|
|
6371
6371
|
/* @__PURE__ */ h.jsx(
|
|
6372
6372
|
"button",
|
|
6373
6373
|
{
|
|
@@ -6427,8 +6427,8 @@ function Dy({
|
|
|
6427
6427
|
{
|
|
6428
6428
|
type: "text",
|
|
6429
6429
|
placeholder: u,
|
|
6430
|
-
value:
|
|
6431
|
-
onChange: (D) =>
|
|
6430
|
+
value: _,
|
|
6431
|
+
onChange: (D) => v(D.target.value),
|
|
6432
6432
|
style: {
|
|
6433
6433
|
width: "100%",
|
|
6434
6434
|
padding: "8px 12px",
|
|
@@ -6479,7 +6479,7 @@ function Dy({
|
|
|
6479
6479
|
}, children: [
|
|
6480
6480
|
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "13px", color: A.textSecondary }, children: [
|
|
6481
6481
|
"Page ",
|
|
6482
|
-
|
|
6482
|
+
w,
|
|
6483
6483
|
" of ",
|
|
6484
6484
|
F.totalPages
|
|
6485
6485
|
] }),
|
|
@@ -6488,14 +6488,14 @@ function Dy({
|
|
|
6488
6488
|
"button",
|
|
6489
6489
|
{
|
|
6490
6490
|
onClick: () => S((D) => Math.max(1, D - 1)),
|
|
6491
|
-
disabled:
|
|
6491
|
+
disabled: w === 1,
|
|
6492
6492
|
style: {
|
|
6493
6493
|
padding: "6px 12px",
|
|
6494
6494
|
border: `1px solid ${A.border}`,
|
|
6495
6495
|
borderRadius: "6px",
|
|
6496
6496
|
background: "white",
|
|
6497
|
-
cursor:
|
|
6498
|
-
opacity:
|
|
6497
|
+
cursor: w === 1 ? "not-allowed" : "pointer",
|
|
6498
|
+
opacity: w === 1 ? 0.5 : 1
|
|
6499
6499
|
},
|
|
6500
6500
|
children: "Previous"
|
|
6501
6501
|
}
|
|
@@ -6504,14 +6504,14 @@ function Dy({
|
|
|
6504
6504
|
"button",
|
|
6505
6505
|
{
|
|
6506
6506
|
onClick: () => S((D) => Math.min(F.totalPages, D + 1)),
|
|
6507
|
-
disabled:
|
|
6507
|
+
disabled: w === F.totalPages,
|
|
6508
6508
|
style: {
|
|
6509
6509
|
padding: "6px 12px",
|
|
6510
6510
|
border: `1px solid ${A.border}`,
|
|
6511
6511
|
borderRadius: "6px",
|
|
6512
6512
|
background: "white",
|
|
6513
|
-
cursor:
|
|
6514
|
-
opacity:
|
|
6513
|
+
cursor: w === F.totalPages ? "not-allowed" : "pointer",
|
|
6514
|
+
opacity: w === F.totalPages ? 0.5 : 1
|
|
6515
6515
|
},
|
|
6516
6516
|
children: "Next"
|
|
6517
6517
|
}
|
|
@@ -6623,106 +6623,73 @@ function of(r) {
|
|
|
6623
6623
|
}
|
|
6624
6624
|
function ky({
|
|
6625
6625
|
nodes: r,
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
className: o = ""
|
|
6626
|
+
minInterval: e = 3e3,
|
|
6627
|
+
maxInterval: t = 6e3,
|
|
6628
|
+
onCardClick: n,
|
|
6629
|
+
cardSize: i = "medium",
|
|
6630
|
+
className: s = ""
|
|
6632
6631
|
}) {
|
|
6633
|
-
|
|
6632
|
+
var y, _;
|
|
6633
|
+
const [o] = I(() => {
|
|
6634
|
+
if (r.length === 0) return [[], []];
|
|
6635
|
+
const v = of(r), E = Math.ceil(v.length / 2);
|
|
6636
|
+
return console.log("[AnimatedCardFlip] Pools:", {
|
|
6637
|
+
left: v.slice(0, E).map((C) => C.title),
|
|
6638
|
+
right: v.slice(E).map((C) => C.title)
|
|
6639
|
+
}), [v.slice(0, E), v.slice(E)];
|
|
6640
|
+
}), [a, l] = I(0), [u, c] = I(0), [d, f] = I(!1), [p, g] = I(!1);
|
|
6634
6641
|
Te(() => {
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
const F = a.current[S];
|
|
6653
|
-
!F || F.length <= 1 || (p((T) => {
|
|
6654
|
-
const A = [...T];
|
|
6655
|
-
return A[S] = !A[S], A;
|
|
6656
|
-
}), setTimeout(() => {
|
|
6657
|
-
var N, R;
|
|
6658
|
-
if (!c.current) return;
|
|
6659
|
-
const T = l.current[S], A = (T + 1) % F.length;
|
|
6660
|
-
l.current[S] = A, m([...l.current]), console.log(`[AnimatedCardFlip] Slot ${S}: ${(N = F[T]) == null ? void 0 : N.title} -> ${(R = F[A]) == null ? void 0 : R.title}`);
|
|
6661
|
-
}, 250));
|
|
6662
|
-
}, E = (S) => {
|
|
6663
|
-
if (!c.current) return;
|
|
6664
|
-
const F = setTimeout(() => {
|
|
6665
|
-
w(S), E(S);
|
|
6666
|
-
}, b());
|
|
6667
|
-
u.current[S] = F;
|
|
6668
|
-
};
|
|
6669
|
-
console.log("[AnimatedCardFlip] Starting flips...");
|
|
6670
|
-
const C = setTimeout(() => {
|
|
6671
|
-
console.log("[AnimatedCardFlip] Starting slot 0"), E(0);
|
|
6672
|
-
}, 500), v = setTimeout(() => {
|
|
6673
|
-
console.log("[AnimatedCardFlip] Starting slot 1"), E(1);
|
|
6674
|
-
}, 1e3);
|
|
6642
|
+
if (o[0].length <= 1) return;
|
|
6643
|
+
const v = setInterval(() => {
|
|
6644
|
+
f((E) => !E), setTimeout(() => {
|
|
6645
|
+
l((E) => (E + 1) % o[0].length);
|
|
6646
|
+
}, 250);
|
|
6647
|
+
}, e + Math.random() * (t - e));
|
|
6648
|
+
return () => clearInterval(v);
|
|
6649
|
+
}, [o, e, t]), Te(() => {
|
|
6650
|
+
if (o[1].length <= 1) return;
|
|
6651
|
+
const v = setTimeout(() => {
|
|
6652
|
+
const E = setInterval(() => {
|
|
6653
|
+
g((C) => !C), setTimeout(() => {
|
|
6654
|
+
c((C) => (C + 1) % o[1].length);
|
|
6655
|
+
}, 250);
|
|
6656
|
+
}, e + Math.random() * (t - e));
|
|
6657
|
+
v.intervalId = E;
|
|
6658
|
+
}, 500);
|
|
6675
6659
|
return () => {
|
|
6676
|
-
clearTimeout(
|
|
6660
|
+
clearTimeout(v), v.intervalId && clearInterval(v.intervalId);
|
|
6677
6661
|
};
|
|
6678
|
-
}, [
|
|
6679
|
-
const y = (
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
{
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
"
|
|
6692
|
-
{
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
},
|
|
6699
|
-
children: /* @__PURE__ */ h.
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
"img",
|
|
6710
|
-
{
|
|
6711
|
-
src: E.data.image,
|
|
6712
|
-
alt: E.title,
|
|
6713
|
-
className: "w-full h-full object-cover"
|
|
6714
|
-
}
|
|
6715
|
-
),
|
|
6716
|
-
/* @__PURE__ */ h.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ h.jsx("p", { className: "text-white text-sm font-medium truncate", children: E.title }) })
|
|
6717
|
-
]
|
|
6718
|
-
}
|
|
6719
|
-
)
|
|
6720
|
-
}
|
|
6721
|
-
)
|
|
6722
|
-
},
|
|
6723
|
-
`slot-${b}`
|
|
6724
|
-
) : null;
|
|
6725
|
-
}) });
|
|
6662
|
+
}, [o, e, t]);
|
|
6663
|
+
const m = (y = o[0]) == null ? void 0 : y[a], x = (_ = o[1]) == null ? void 0 : _[u];
|
|
6664
|
+
if (r.length === 0 || !m)
|
|
6665
|
+
return /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${s}`, children: /* @__PURE__ */ h.jsx("p", { className: "text-gray-500", children: "No images available" }) });
|
|
6666
|
+
const b = (v, E) => /* @__PURE__ */ h.jsx(
|
|
6667
|
+
"div",
|
|
6668
|
+
{
|
|
6669
|
+
className: `relative ${sf[i]}`,
|
|
6670
|
+
style: { perspective: "1000px" },
|
|
6671
|
+
onClick: () => n == null ? void 0 : n(v),
|
|
6672
|
+
children: /* @__PURE__ */ h.jsx(
|
|
6673
|
+
"div",
|
|
6674
|
+
{
|
|
6675
|
+
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
6676
|
+
style: {
|
|
6677
|
+
transform: `rotateY(${E ? 180 : 0}deg)`,
|
|
6678
|
+
transition: "transform 0.5s ease-in-out",
|
|
6679
|
+
transformStyle: "preserve-3d"
|
|
6680
|
+
},
|
|
6681
|
+
children: /* @__PURE__ */ h.jsxs("div", { style: { transform: E ? "scaleX(-1)" : "scaleX(1)", width: "100%", height: "100%" }, children: [
|
|
6682
|
+
/* @__PURE__ */ h.jsx("img", { src: v.data.image, alt: v.title, className: "w-full h-full object-cover" }),
|
|
6683
|
+
/* @__PURE__ */ h.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ h.jsx("p", { className: "text-white text-sm font-medium truncate", children: v.title }) })
|
|
6684
|
+
] })
|
|
6685
|
+
}
|
|
6686
|
+
)
|
|
6687
|
+
}
|
|
6688
|
+
);
|
|
6689
|
+
return /* @__PURE__ */ h.jsxs("div", { className: `flex gap-4 justify-center items-center ${s}`, children: [
|
|
6690
|
+
b(m, d),
|
|
6691
|
+
x && b(x, p)
|
|
6692
|
+
] });
|
|
6726
6693
|
}
|
|
6727
6694
|
function Vr(r) {
|
|
6728
6695
|
if (!r) return "";
|
|
@@ -6774,14 +6741,14 @@ function Ay({
|
|
|
6774
6741
|
onDelete: g,
|
|
6775
6742
|
onError: m,
|
|
6776
6743
|
onLoad: x,
|
|
6777
|
-
renderItem:
|
|
6744
|
+
renderItem: b,
|
|
6778
6745
|
renderDetail: y,
|
|
6779
|
-
renderActions:
|
|
6780
|
-
renderEmpty:
|
|
6746
|
+
renderActions: _,
|
|
6747
|
+
renderEmpty: v,
|
|
6781
6748
|
renderLoading: E,
|
|
6782
6749
|
theme: C = {}
|
|
6783
6750
|
}) {
|
|
6784
|
-
const
|
|
6751
|
+
const w = { ...lf, ...C }, [S, F] = I([]), [T, A] = I(!1), [N, R] = I(null), [D, B] = I(/* @__PURE__ */ new Set()), [M, O] = I(null), [V, U] = I(null), [re, q] = I(null), [J, W] = I(!1), [se, ce] = I(""), fe = l !== void 0 ? l : se, ge = (oe) => {
|
|
6785
6752
|
u ? u(oe) : ce(oe);
|
|
6786
6753
|
}, Be = ct(() => {
|
|
6787
6754
|
if (!fe.trim()) return S;
|
|
@@ -6831,10 +6798,10 @@ function Ay({
|
|
|
6831
6798
|
B((rt) => {
|
|
6832
6799
|
const Lt = new Set(rt);
|
|
6833
6800
|
return Lt.has(tt) ? Lt.delete(tt) : Lt.add(tt), p == null || p(Array.from(Lt)), Lt;
|
|
6834
|
-
}),
|
|
6801
|
+
}), O(de);
|
|
6835
6802
|
else {
|
|
6836
6803
|
const rt = /* @__PURE__ */ new Set([tt]);
|
|
6837
|
-
B(rt),
|
|
6804
|
+
B(rt), O(de), p == null || p(Array.from(rt));
|
|
6838
6805
|
}
|
|
6839
6806
|
}, [s, M, S, D, f, p, o]), Se = X(async () => {
|
|
6840
6807
|
if (!_e || D.size === 0) return;
|
|
@@ -6887,8 +6854,8 @@ function Ay({
|
|
|
6887
6854
|
return de.toDateString() === Ye.toDateString() ? de.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : de.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
6888
6855
|
}, L = (oe, de) => /* @__PURE__ */ h.jsx("div", { style: {
|
|
6889
6856
|
padding: "12px 16px",
|
|
6890
|
-
background: de ?
|
|
6891
|
-
borderBottom: `1px solid ${
|
|
6857
|
+
background: de ? w.selectedBackground : oe.seen ? w.cardBackground : w.unreadBackground,
|
|
6858
|
+
borderBottom: `1px solid ${w.border}`,
|
|
6892
6859
|
cursor: "pointer",
|
|
6893
6860
|
transition: "background 0.15s ease"
|
|
6894
6861
|
}, children: /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "12px" }, children: [
|
|
@@ -6896,7 +6863,7 @@ function Ay({
|
|
|
6896
6863
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6897
6864
|
fontSize: "14px",
|
|
6898
6865
|
fontWeight: oe.seen ? 400 : 600,
|
|
6899
|
-
color:
|
|
6866
|
+
color: w.text,
|
|
6900
6867
|
whiteSpace: "nowrap",
|
|
6901
6868
|
overflow: "hidden",
|
|
6902
6869
|
textOverflow: "ellipsis"
|
|
@@ -6904,7 +6871,7 @@ function Ay({
|
|
|
6904
6871
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6905
6872
|
fontSize: "14px",
|
|
6906
6873
|
fontWeight: oe.seen ? 400 : 500,
|
|
6907
|
-
color: oe.seen ?
|
|
6874
|
+
color: oe.seen ? w.textSecondary : w.text,
|
|
6908
6875
|
marginTop: "2px",
|
|
6909
6876
|
whiteSpace: "nowrap",
|
|
6910
6877
|
overflow: "hidden",
|
|
@@ -6913,31 +6880,31 @@ function Ay({
|
|
|
6913
6880
|
] }),
|
|
6914
6881
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6915
6882
|
fontSize: "12px",
|
|
6916
|
-
color:
|
|
6883
|
+
color: w.textSecondary,
|
|
6917
6884
|
flexShrink: 0
|
|
6918
6885
|
}, children: Y(oe.date) })
|
|
6919
|
-
] }) }),
|
|
6920
|
-
/* @__PURE__ */ h.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color:
|
|
6921
|
-
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "14px", color:
|
|
6886
|
+
] }) }), ye = (oe) => /* @__PURE__ */ h.jsxs("div", { style: { padding: "24px" }, children: [
|
|
6887
|
+
/* @__PURE__ */ h.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: w.text }, children: Vr(oe.subject) || "(No subject)" }),
|
|
6888
|
+
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "14px", color: w.textSecondary, marginBottom: "16px" }, children: [
|
|
6922
6889
|
"From: ",
|
|
6923
6890
|
Vr(oe.from),
|
|
6924
6891
|
" • ",
|
|
6925
6892
|
new Date(oe.date).toLocaleString()
|
|
6926
6893
|
] }),
|
|
6927
|
-
J ? /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color:
|
|
6894
|
+
J ? /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color: w.textSecondary }, children: "Loading..." }) : re ? /* @__PURE__ */ h.jsx(
|
|
6928
6895
|
"div",
|
|
6929
6896
|
{
|
|
6930
|
-
style: { fontSize: "14px", color:
|
|
6897
|
+
style: { fontSize: "14px", color: w.text },
|
|
6931
6898
|
dangerouslySetInnerHTML: { __html: re }
|
|
6932
6899
|
}
|
|
6933
|
-
) : /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color:
|
|
6900
|
+
) : /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color: w.textSecondary }, children: "No content available" })
|
|
6934
6901
|
] }), Ke = (oe, de) => /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6935
6902
|
display: "flex",
|
|
6936
6903
|
alignItems: "center",
|
|
6937
6904
|
gap: "8px",
|
|
6938
6905
|
padding: "8px 16px",
|
|
6939
|
-
background:
|
|
6940
|
-
borderBottom: `1px solid ${
|
|
6906
|
+
background: w.cardBackground,
|
|
6907
|
+
borderBottom: `1px solid ${w.border}`
|
|
6941
6908
|
}, children: [
|
|
6942
6909
|
/* @__PURE__ */ h.jsx(
|
|
6943
6910
|
"button",
|
|
@@ -6946,17 +6913,17 @@ function Ay({
|
|
|
6946
6913
|
style: {
|
|
6947
6914
|
padding: "6px 12px",
|
|
6948
6915
|
background: "transparent",
|
|
6949
|
-
border: `1px solid ${
|
|
6916
|
+
border: `1px solid ${w.border}`,
|
|
6950
6917
|
borderRadius: "6px",
|
|
6951
6918
|
fontSize: "13px",
|
|
6952
6919
|
cursor: "pointer",
|
|
6953
|
-
color:
|
|
6920
|
+
color: w.text
|
|
6954
6921
|
},
|
|
6955
6922
|
children: oe.length === S.length ? "Deselect All" : "Select All"
|
|
6956
6923
|
}
|
|
6957
6924
|
),
|
|
6958
6925
|
oe.length > 0 && /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
6959
|
-
/* @__PURE__ */ h.jsxs("span", { style: { fontSize: "13px", color:
|
|
6926
|
+
/* @__PURE__ */ h.jsxs("span", { style: { fontSize: "13px", color: w.textSecondary }, children: [
|
|
6960
6927
|
oe.length,
|
|
6961
6928
|
" selected"
|
|
6962
6929
|
] }),
|
|
@@ -6972,10 +6939,10 @@ function Ay({
|
|
|
6972
6939
|
width: "32px",
|
|
6973
6940
|
height: "32px",
|
|
6974
6941
|
background: "transparent",
|
|
6975
|
-
border: `1px solid ${
|
|
6942
|
+
border: `1px solid ${w.border}`,
|
|
6976
6943
|
borderRadius: "6px",
|
|
6977
6944
|
cursor: "pointer",
|
|
6978
|
-
color:
|
|
6945
|
+
color: w.textSecondary
|
|
6979
6946
|
},
|
|
6980
6947
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "archive" })
|
|
6981
6948
|
}
|
|
@@ -6992,10 +6959,10 @@ function Ay({
|
|
|
6992
6959
|
width: "32px",
|
|
6993
6960
|
height: "32px",
|
|
6994
6961
|
background: "transparent",
|
|
6995
|
-
border: `1px solid ${
|
|
6962
|
+
border: `1px solid ${w.border}`,
|
|
6996
6963
|
borderRadius: "6px",
|
|
6997
6964
|
cursor: "pointer",
|
|
6998
|
-
color:
|
|
6965
|
+
color: w.textSecondary
|
|
6999
6966
|
},
|
|
7000
6967
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "delete" })
|
|
7001
6968
|
}
|
|
@@ -7014,10 +6981,10 @@ function Ay({
|
|
|
7014
6981
|
width: "32px",
|
|
7015
6982
|
height: "32px",
|
|
7016
6983
|
background: "transparent",
|
|
7017
|
-
border: `1px solid ${
|
|
6984
|
+
border: `1px solid ${w.border}`,
|
|
7018
6985
|
borderRadius: "6px",
|
|
7019
6986
|
cursor: "pointer",
|
|
7020
|
-
color:
|
|
6987
|
+
color: w.textSecondary
|
|
7021
6988
|
},
|
|
7022
6989
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
7023
6990
|
}
|
|
@@ -7025,25 +6992,25 @@ function Ay({
|
|
|
7025
6992
|
] }), z = () => /* @__PURE__ */ h.jsx("div", { style: {
|
|
7026
6993
|
padding: "48px",
|
|
7027
6994
|
textAlign: "center",
|
|
7028
|
-
color:
|
|
6995
|
+
color: w.textSecondary
|
|
7029
6996
|
}, children: c }), ae = () => /* @__PURE__ */ h.jsx("div", { style: {
|
|
7030
6997
|
padding: "48px",
|
|
7031
6998
|
textAlign: "center",
|
|
7032
|
-
color:
|
|
7033
|
-
}, children: "Loading..." }),
|
|
7034
|
-
return T && S.length === 0 ? /* @__PURE__ */ h.jsx("div", { style: { background:
|
|
6999
|
+
color: w.textSecondary
|
|
7000
|
+
}, children: "Loading..." }), me = b || L, xe = y || ye, Ge = _ || Ke, vt = v || z, wt = E || ae;
|
|
7001
|
+
return T && S.length === 0 ? /* @__PURE__ */ h.jsx("div", { style: { background: w.background, width: "100%", height: "100%" }, children: wt() }) : /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", background: w.background, width: "100%", height: "100%" }, children: [
|
|
7035
7002
|
/* @__PURE__ */ h.jsxs("div", { style: {
|
|
7036
7003
|
flex: o && V ? "0 0 50%" : "1",
|
|
7037
7004
|
display: "flex",
|
|
7038
7005
|
flexDirection: "column",
|
|
7039
|
-
borderRight: o && V ? `1px solid ${
|
|
7006
|
+
borderRight: o && V ? `1px solid ${w.border}` : "none",
|
|
7040
7007
|
overflow: "hidden"
|
|
7041
7008
|
}, children: [
|
|
7042
7009
|
s && Ge(Array.from(D), He),
|
|
7043
7010
|
a && /* @__PURE__ */ h.jsx("div", { style: {
|
|
7044
7011
|
padding: "8px 12px",
|
|
7045
|
-
borderBottom: `1px solid ${
|
|
7046
|
-
background:
|
|
7012
|
+
borderBottom: `1px solid ${w.border}`,
|
|
7013
|
+
background: w.background
|
|
7047
7014
|
}, children: /* @__PURE__ */ h.jsxs("div", { style: {
|
|
7048
7015
|
display: "flex",
|
|
7049
7016
|
alignItems: "center",
|
|
@@ -7052,7 +7019,7 @@ function Ay({
|
|
|
7052
7019
|
background: "#f5f5f5",
|
|
7053
7020
|
borderRadius: "6px"
|
|
7054
7021
|
}, children: [
|
|
7055
|
-
/* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
7022
|
+
/* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: w.textSecondary, strokeWidth: "2", children: [
|
|
7056
7023
|
/* @__PURE__ */ h.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
7057
7024
|
/* @__PURE__ */ h.jsx("path", { d: "M21 21l-4.35-4.35" })
|
|
7058
7025
|
] }),
|
|
@@ -7062,21 +7029,21 @@ function Ay({
|
|
|
7062
7029
|
type: "text",
|
|
7063
7030
|
placeholder: "Search by email or subject...",
|
|
7064
7031
|
value: fe,
|
|
7065
|
-
onChange: (oe) =>
|
|
7032
|
+
onChange: (oe) => ge(oe.target.value),
|
|
7066
7033
|
style: {
|
|
7067
7034
|
flex: 1,
|
|
7068
7035
|
border: "none",
|
|
7069
7036
|
background: "transparent",
|
|
7070
7037
|
outline: "none",
|
|
7071
7038
|
fontSize: "13px",
|
|
7072
|
-
color:
|
|
7039
|
+
color: w.text
|
|
7073
7040
|
}
|
|
7074
7041
|
}
|
|
7075
7042
|
),
|
|
7076
7043
|
fe && /* @__PURE__ */ h.jsx(
|
|
7077
7044
|
"button",
|
|
7078
7045
|
{
|
|
7079
|
-
onClick: () =>
|
|
7046
|
+
onClick: () => ge(""),
|
|
7080
7047
|
style: {
|
|
7081
7048
|
border: "none",
|
|
7082
7049
|
background: "transparent",
|
|
@@ -7086,28 +7053,28 @@ function Ay({
|
|
|
7086
7053
|
alignItems: "center",
|
|
7087
7054
|
justifyContent: "center"
|
|
7088
7055
|
},
|
|
7089
|
-
children: /* @__PURE__ */ h.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
7056
|
+
children: /* @__PURE__ */ h.jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: w.textSecondary, strokeWidth: "2", children: /* @__PURE__ */ h.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) })
|
|
7090
7057
|
}
|
|
7091
7058
|
)
|
|
7092
7059
|
] }) }),
|
|
7093
7060
|
N && /* @__PURE__ */ h.jsx("div", { style: {
|
|
7094
7061
|
padding: "12px 16px",
|
|
7095
7062
|
background: "#fef2f2",
|
|
7096
|
-
color:
|
|
7063
|
+
color: w.danger,
|
|
7097
7064
|
fontSize: "14px",
|
|
7098
|
-
borderBottom: `1px solid ${
|
|
7065
|
+
borderBottom: `1px solid ${w.border}`
|
|
7099
7066
|
}, children: N }),
|
|
7100
7067
|
/* @__PURE__ */ h.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: Be.length === 0 ? vt() : Be.map((oe, de) => /* @__PURE__ */ h.jsx(
|
|
7101
7068
|
"div",
|
|
7102
7069
|
{
|
|
7103
7070
|
onClick: (Ye) => Re(oe, de, Ye),
|
|
7104
7071
|
onDoubleClick: () => ie(oe),
|
|
7105
|
-
children:
|
|
7072
|
+
children: me(oe, D.has(oe.uid))
|
|
7106
7073
|
},
|
|
7107
7074
|
oe.uid
|
|
7108
7075
|
)) })
|
|
7109
7076
|
] }),
|
|
7110
|
-
o && V && /* @__PURE__ */ h.jsx("div", { style: { flex: 1, overflowY: "auto" }, children:
|
|
7077
|
+
o && V && /* @__PURE__ */ h.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: xe(V) })
|
|
7111
7078
|
] });
|
|
7112
7079
|
}
|
|
7113
7080
|
function Ty({
|
|
@@ -7121,28 +7088,28 @@ function Ty({
|
|
|
7121
7088
|
showSelectAll: a = !0,
|
|
7122
7089
|
className: l = ""
|
|
7123
7090
|
}) {
|
|
7124
|
-
const [u, c] =
|
|
7091
|
+
const [u, c] = I(/* @__PURE__ */ new Set()), [d, f] = I(-1), p = r.filter((v) => u.has(v.id)), g = d >= 0 && d < p.length ? p[d] : null, m = X((v) => {
|
|
7125
7092
|
c((E) => {
|
|
7126
7093
|
const C = new Set(E);
|
|
7127
|
-
return C.has(
|
|
7094
|
+
return C.has(v) ? C.delete(v) : C.add(v), t == null || t(Array.from(C)), C;
|
|
7128
7095
|
});
|
|
7129
7096
|
}, [t]), x = X(() => {
|
|
7130
7097
|
if (u.size === r.length)
|
|
7131
7098
|
c(/* @__PURE__ */ new Set()), f(-1), t == null || t([]);
|
|
7132
7099
|
else {
|
|
7133
|
-
const
|
|
7134
|
-
c(
|
|
7100
|
+
const v = new Set(r.map((E) => E.id));
|
|
7101
|
+
c(v), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((E) => E.id));
|
|
7135
7102
|
}
|
|
7136
|
-
}, [r, u.size, t, n]),
|
|
7103
|
+
}, [r, u.size, t, n]), b = X(() => {
|
|
7137
7104
|
if (p.length === 0) return;
|
|
7138
|
-
const
|
|
7139
|
-
f(
|
|
7105
|
+
const v = d <= 0 ? p.length - 1 : d - 1;
|
|
7106
|
+
f(v), n == null || n(p[v], v);
|
|
7140
7107
|
}, [p, d, n]), y = X(() => {
|
|
7141
7108
|
if (p.length === 0) return;
|
|
7142
|
-
const
|
|
7143
|
-
f(
|
|
7144
|
-
}, [p, d, n]),
|
|
7145
|
-
i == null || i(
|
|
7109
|
+
const v = d >= p.length - 1 ? 0 : d + 1;
|
|
7110
|
+
f(v), n == null || n(p[v], v);
|
|
7111
|
+
}, [p, d, n]), _ = X((v) => {
|
|
7112
|
+
i == null || i(v, p, g);
|
|
7146
7113
|
}, [i, p, g]);
|
|
7147
7114
|
return Le.useEffect(() => {
|
|
7148
7115
|
p.length === 0 ? f(-1) : d >= p.length ? f(p.length - 1) : d < 0 && p.length > 0 && (f(0), n == null || n(p[0], 0));
|
|
@@ -7170,7 +7137,7 @@ function Ty({
|
|
|
7170
7137
|
/* @__PURE__ */ h.jsx(
|
|
7171
7138
|
"button",
|
|
7172
7139
|
{
|
|
7173
|
-
onClick:
|
|
7140
|
+
onClick: b,
|
|
7174
7141
|
className: "p-1 hover:bg-neutral-100 rounded transition-colors",
|
|
7175
7142
|
title: "Previous",
|
|
7176
7143
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: "chevron_left" })
|
|
@@ -7192,36 +7159,36 @@ function Ty({
|
|
|
7192
7159
|
)
|
|
7193
7160
|
] })
|
|
7194
7161
|
] }),
|
|
7195
|
-
/* @__PURE__ */ h.jsx("div", { className: "space-y-1", children: r.map((
|
|
7196
|
-
const E = u.has(
|
|
7162
|
+
/* @__PURE__ */ h.jsx("div", { className: "space-y-1", children: r.map((v) => {
|
|
7163
|
+
const E = u.has(v.id), C = (g == null ? void 0 : g.id) === v.id;
|
|
7197
7164
|
return /* @__PURE__ */ h.jsxs(
|
|
7198
7165
|
"div",
|
|
7199
7166
|
{
|
|
7200
7167
|
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${C ? "bg-blue-50 ring-1 ring-blue-200" : E ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
|
|
7201
|
-
onClick: () => m(
|
|
7168
|
+
onClick: () => m(v.id),
|
|
7202
7169
|
children: [
|
|
7203
7170
|
/* @__PURE__ */ h.jsx("span", { className: `material-icons text-lg ${E ? "text-blue-500" : "text-neutral-300"}`, children: E ? "check_box" : "check_box_outline_blank" }),
|
|
7204
|
-
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(
|
|
7171
|
+
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(v, E, C) })
|
|
7205
7172
|
]
|
|
7206
7173
|
},
|
|
7207
|
-
|
|
7174
|
+
v.id
|
|
7208
7175
|
);
|
|
7209
7176
|
}) }),
|
|
7210
|
-
s.length > 0 && u.size > 0 && /* @__PURE__ */ h.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: s.map((
|
|
7177
|
+
s.length > 0 && u.size > 0 && /* @__PURE__ */ h.jsx("div", { className: "flex items-center gap-2 pt-2 border-t border-neutral-100", children: s.map((v) => {
|
|
7211
7178
|
var C;
|
|
7212
|
-
const E = ((C =
|
|
7179
|
+
const E = ((C = v.disabled) == null ? void 0 : C.call(v, p)) ?? !1;
|
|
7213
7180
|
return /* @__PURE__ */ h.jsxs(
|
|
7214
7181
|
"button",
|
|
7215
7182
|
{
|
|
7216
|
-
onClick: () =>
|
|
7183
|
+
onClick: () => _(v.id),
|
|
7217
7184
|
disabled: E,
|
|
7218
7185
|
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${E ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
|
|
7219
7186
|
children: [
|
|
7220
|
-
|
|
7221
|
-
|
|
7187
|
+
v.icon && /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: v.icon }),
|
|
7188
|
+
v.label
|
|
7222
7189
|
]
|
|
7223
7190
|
},
|
|
7224
|
-
|
|
7191
|
+
v.id
|
|
7225
7192
|
);
|
|
7226
7193
|
}) })
|
|
7227
7194
|
] });
|
|
@@ -7312,29 +7279,29 @@ function Au(r, e, t) {
|
|
|
7312
7279
|
for (let f = 0; f < e.length; f++) {
|
|
7313
7280
|
const p = e[f], g = p.type, m = p.target, x = Hf(m, r, a, o);
|
|
7314
7281
|
if (!x) continue;
|
|
7315
|
-
const [
|
|
7282
|
+
const [b, y] = x;
|
|
7316
7283
|
if (g === "characterData") n && Q(y) && Wf(i, m, y) && Uf(m, y, r);
|
|
7317
7284
|
else if (g === "childList") {
|
|
7318
7285
|
u = !0;
|
|
7319
|
-
const
|
|
7320
|
-
for (let C = 0; C <
|
|
7321
|
-
const
|
|
7322
|
-
if (F != null &&
|
|
7286
|
+
const _ = p.addedNodes;
|
|
7287
|
+
for (let C = 0; C < _.length; C++) {
|
|
7288
|
+
const w = _[C], S = Ru(w), F = w.parentNode;
|
|
7289
|
+
if (F != null && w !== l && S === null && !Is(w, F, r)) {
|
|
7323
7290
|
if (vr) {
|
|
7324
|
-
const T =
|
|
7291
|
+
const T = w.innerText || w.nodeValue;
|
|
7325
7292
|
T && (c += T);
|
|
7326
7293
|
}
|
|
7327
|
-
F.removeChild(
|
|
7294
|
+
F.removeChild(w);
|
|
7328
7295
|
}
|
|
7329
7296
|
}
|
|
7330
|
-
const
|
|
7297
|
+
const v = p.removedNodes, E = v.length;
|
|
7331
7298
|
if (E > 0) {
|
|
7332
7299
|
let C = 0;
|
|
7333
|
-
for (let
|
|
7334
|
-
const S = w
|
|
7300
|
+
for (let w = 0; w < E; w++) {
|
|
7301
|
+
const S = v[w];
|
|
7335
7302
|
(Is(S, m, r) || l === S) && (m.appendChild(S), C++);
|
|
7336
7303
|
}
|
|
7337
|
-
E !== C && s.set(
|
|
7304
|
+
E !== C && s.set(b, y);
|
|
7338
7305
|
}
|
|
7339
7306
|
}
|
|
7340
7307
|
}
|
|
@@ -7344,8 +7311,8 @@ function Au(r, e, t) {
|
|
|
7344
7311
|
for (let f = 0; f < d.length; f++) {
|
|
7345
7312
|
const p = d[f], g = p.addedNodes, m = p.target;
|
|
7346
7313
|
for (let x = 0; x < g.length; x++) {
|
|
7347
|
-
const
|
|
7348
|
-
y == null ||
|
|
7314
|
+
const b = g[x], y = b.parentNode;
|
|
7315
|
+
y == null || b.nodeName !== "BR" || Is(b, m, r) || y.removeChild(b);
|
|
7349
7316
|
}
|
|
7350
7317
|
}
|
|
7351
7318
|
t.takeRecords();
|
|
@@ -8030,12 +7997,12 @@ function oh(r, e, t) {
|
|
|
8030
7997
|
const m = uo(f), x = Vi(p, null);
|
|
8031
7998
|
try {
|
|
8032
7999
|
d.replaceChild(x, m);
|
|
8033
|
-
} catch (
|
|
8034
|
-
if (typeof
|
|
8035
|
-
const y = `${
|
|
8000
|
+
} catch (b) {
|
|
8001
|
+
if (typeof b == "object" && b != null) {
|
|
8002
|
+
const y = `${b.toString()} Parent: ${d.tagName}, new child: {tag: ${x.tagName} key: ${p}}, old child: {tag: ${m.tagName}, key: ${f}}.`;
|
|
8036
8003
|
throw new Error(y);
|
|
8037
8004
|
}
|
|
8038
|
-
throw
|
|
8005
|
+
throw b;
|
|
8039
8006
|
}
|
|
8040
8007
|
Hi(f, null);
|
|
8041
8008
|
}
|
|
@@ -8049,29 +8016,29 @@ function oh(r, e, t) {
|
|
|
8049
8016
|
const g = a.after == null && a.before == null && a.element.__lexicalLineBreak == null;
|
|
8050
8017
|
lo(f, 0, u - 1, g ? null : d), g && (d.textContent = "");
|
|
8051
8018
|
}
|
|
8052
|
-
} else (function(g, m, x,
|
|
8053
|
-
const
|
|
8054
|
-
let C,
|
|
8055
|
-
for (; F <=
|
|
8019
|
+
} else (function(g, m, x, b, y, _) {
|
|
8020
|
+
const v = b - 1, E = y - 1;
|
|
8021
|
+
let C, w, S = _.getFirstChild(), F = 0, T = 0;
|
|
8022
|
+
for (; F <= v && T <= E; ) {
|
|
8056
8023
|
const R = m[F], D = x[T];
|
|
8057
|
-
if (R === D) S = $s(Sn(D,
|
|
8024
|
+
if (R === D) S = $s(Sn(D, _.element)), F++, T++;
|
|
8058
8025
|
else {
|
|
8059
|
-
C === void 0 && (C = new Set(m)),
|
|
8060
|
-
const M =
|
|
8061
|
-
if (M) if (
|
|
8026
|
+
C === void 0 && (C = new Set(m)), w === void 0 && (w = new Set(x));
|
|
8027
|
+
const M = w.has(R), O = C.has(D);
|
|
8028
|
+
if (M) if (O) {
|
|
8062
8029
|
const V = Ui(_t, D);
|
|
8063
|
-
V === S ? S = $s(Sn(D,
|
|
8064
|
-
} else Vi(D,
|
|
8065
|
-
else S = $s(uo(R)), Hi(R,
|
|
8030
|
+
V === S ? S = $s(Sn(D, _.element)) : (_.withBefore(S).insertChild(V), Sn(D, _.element)), F++, T++;
|
|
8031
|
+
} else Vi(D, _.withBefore(S)), T++;
|
|
8032
|
+
else S = $s(uo(R)), Hi(R, _.element), F++;
|
|
8066
8033
|
}
|
|
8067
8034
|
const B = Wt.get(D);
|
|
8068
8035
|
B !== null && Q(B) && (Kt === null && (Kt = B.getFormat()), Ot === "" && (Ot = B.getStyle()));
|
|
8069
8036
|
}
|
|
8070
|
-
const A = F >
|
|
8037
|
+
const A = F > v, N = T > E;
|
|
8071
8038
|
if (A && !N) {
|
|
8072
8039
|
const R = x[E + 1], D = R === void 0 ? null : _t.getElementByKey(R);
|
|
8073
|
-
ao(x, g, T, E,
|
|
8074
|
-
} else N && !A && lo(m, F,
|
|
8040
|
+
ao(x, g, T, E, _.withBefore(D));
|
|
8041
|
+
} else N && !A && lo(m, F, v, _.element);
|
|
8075
8042
|
})(o, f, p, u, c, a);
|
|
8076
8043
|
}
|
|
8077
8044
|
ms(o) && (ut += ur), d.__lexicalTextContent = ut, ut = l + ut;
|
|
@@ -8312,8 +8279,8 @@ Li && fo.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
8312
8279
|
}
|
|
8313
8280
|
} else {
|
|
8314
8281
|
ht(null), t.preventDefault();
|
|
8315
|
-
const g = o.anchor.getNode(), m = g.getTextContent(), x = g.canInsertTextAfter(),
|
|
8316
|
-
Af && p && !
|
|
8282
|
+
const g = o.anchor.getNode(), m = g.getTextContent(), x = g.canInsertTextAfter(), b = o.anchor.offset === 0 && o.focus.offset === m.length;
|
|
8283
|
+
Af && p && !b && x || ne(n, Nr, !0);
|
|
8317
8284
|
}
|
|
8318
8285
|
return;
|
|
8319
8286
|
}
|
|
@@ -8419,21 +8386,21 @@ function Wl(r, e, t) {
|
|
|
8419
8386
|
const l = a.anchor, u = l.getNode();
|
|
8420
8387
|
if (a.isCollapsed()) {
|
|
8421
8388
|
r.type === "Range" && r.anchorNode === r.focusNode && (a.dirty = !0);
|
|
8422
|
-
const c = ys(e).event, d = c ? c.timeStamp : performance.now(), [f, p, g, m, x] = Qu,
|
|
8389
|
+
const c = ys(e).event, d = c ? c.timeStamp : performance.now(), [f, p, g, m, x] = Qu, b = Xe(), y = e.isComposing() === !1 && b.getTextContent() === "";
|
|
8423
8390
|
if (d < x + 200 && l.offset === g && l.key === m) a.format = f, a.style = p;
|
|
8424
8391
|
else if (l.type === "text") Q(u) || K(141), a.format = u.getFormat(), a.style = u.getStyle();
|
|
8425
8392
|
else if (l.type === "element" && !y) {
|
|
8426
|
-
const
|
|
8427
|
-
a.style = "",
|
|
8393
|
+
const _ = l.getNode();
|
|
8394
|
+
a.style = "", _ instanceof fn && _.getChildrenSize() === 0 ? (a.format = _.getTextFormat(), a.style = _.getTextStyle()) : a.format = 0;
|
|
8428
8395
|
}
|
|
8429
8396
|
} else {
|
|
8430
|
-
const c = l.key, d = a.focus.key, f = a.getNodes(), p = f.length, g = a.isBackward(), m = g ? o : i, x = g ? i : o,
|
|
8431
|
-
let
|
|
8397
|
+
const c = l.key, d = a.focus.key, f = a.getNodes(), p = f.length, g = a.isBackward(), m = g ? o : i, x = g ? i : o, b = g ? d : c, y = g ? c : d;
|
|
8398
|
+
let _ = Ff, v = !1;
|
|
8432
8399
|
for (let E = 0; E < p; E++) {
|
|
8433
|
-
const C = f[E],
|
|
8434
|
-
if (Q(C) &&
|
|
8400
|
+
const C = f[E], w = C.getTextContentSize();
|
|
8401
|
+
if (Q(C) && w !== 0 && !(E === 0 && C.__key === b && m === w || E === p - 1 && C.__key === y && x === 0) && (v = !0, _ &= C.getFormat(), _ === 0)) break;
|
|
8435
8402
|
}
|
|
8436
|
-
a.format =
|
|
8403
|
+
a.format = v ? _ : 0;
|
|
8437
8404
|
}
|
|
8438
8405
|
}
|
|
8439
8406
|
ne(e, Ro, void 0);
|
|
@@ -9133,29 +9100,29 @@ class dn extends bs {
|
|
|
9133
9100
|
const d = a[0], f = t.getParent();
|
|
9134
9101
|
let p;
|
|
9135
9102
|
const g = t.getFormat(), m = t.getStyle(), x = t.__detail;
|
|
9136
|
-
let
|
|
9137
|
-
t.isSegmented() ? (p = at(d), p.__format = g, p.__style = m, p.__detail = x,
|
|
9138
|
-
const y = le(),
|
|
9139
|
-
let
|
|
9103
|
+
let b = !1;
|
|
9104
|
+
t.isSegmented() ? (p = at(d), p.__format = g, p.__style = m, p.__detail = x, b = !0) : (p = t.getWritable(), p.__text = d);
|
|
9105
|
+
const y = le(), _ = [p];
|
|
9106
|
+
let v = d.length;
|
|
9140
9107
|
for (let E = 1; E < c; E++) {
|
|
9141
|
-
const C = a[E],
|
|
9108
|
+
const C = a[E], w = C.length, S = at(C).getWritable();
|
|
9142
9109
|
S.__format = g, S.__style = m, S.__detail = x;
|
|
9143
|
-
const F = S.__key, T =
|
|
9110
|
+
const F = S.__key, T = v + w;
|
|
9144
9111
|
if (H(y)) {
|
|
9145
9112
|
const A = y.anchor, N = y.focus;
|
|
9146
|
-
A.key === i && A.type === "text" && A.offset >
|
|
9113
|
+
A.key === i && A.type === "text" && A.offset > v && A.offset <= T && (A.key = F, A.offset -= v, y.dirty = !0), N.key === i && N.type === "text" && N.offset > v && N.offset <= T && (N.key = F, N.offset -= v, y.dirty = !0);
|
|
9147
9114
|
}
|
|
9148
|
-
s === i && ht(F),
|
|
9115
|
+
s === i && ht(F), v = T, _.push(S);
|
|
9149
9116
|
}
|
|
9150
9117
|
if (f !== null) {
|
|
9151
|
-
(function(
|
|
9152
|
-
const S =
|
|
9118
|
+
(function(w) {
|
|
9119
|
+
const S = w.getPreviousSibling(), F = w.getNextSibling();
|
|
9153
9120
|
S !== null && qi(S), F !== null && qi(F);
|
|
9154
9121
|
})(this);
|
|
9155
9122
|
const E = f.getWritable(), C = this.getIndexWithinParent();
|
|
9156
|
-
|
|
9123
|
+
b ? (E.splice(C, 0, _), this.remove()) : E.splice(C, 1, _), H(y) && Yi(y, f, C, c - 1);
|
|
9157
9124
|
}
|
|
9158
|
-
return
|
|
9125
|
+
return _;
|
|
9159
9126
|
}
|
|
9160
9127
|
mergeWithSibling(e) {
|
|
9161
9128
|
const t = e === this.getPreviousSibling();
|
|
@@ -9529,9 +9496,9 @@ class Dr {
|
|
|
9529
9496
|
insertText(e) {
|
|
9530
9497
|
const t = this.anchor, n = this.focus, i = this.format, s = this.style;
|
|
9531
9498
|
let o = t, a = n;
|
|
9532
|
-
!this.isCollapsed() && n.isBefore(t) && (o = n, a = t), o.type === "element" && function(x,
|
|
9533
|
-
const
|
|
9534
|
-
C.setFormat(y), C.setStyle(
|
|
9499
|
+
!this.isCollapsed() && n.isBefore(t) && (o = n, a = t), o.type === "element" && function(x, b, y, _) {
|
|
9500
|
+
const v = x.getNode(), E = v.getChildAtIndex(x.offset), C = at(), w = bt(v) ? ot().append(C) : C;
|
|
9501
|
+
C.setFormat(y), C.setStyle(_), E === null ? v.append(w) : E.insertBefore(w), x.is(b) && b.set(C.__key, 0, "text"), x.set(C.__key, 0, "text");
|
|
9535
9502
|
}(o, a, i, s);
|
|
9536
9503
|
const l = o.offset;
|
|
9537
9504
|
let u = a.offset;
|
|
@@ -9555,34 +9522,34 @@ class Dr {
|
|
|
9555
9522
|
}
|
|
9556
9523
|
if (d === 1) {
|
|
9557
9524
|
if (f.isToken()) {
|
|
9558
|
-
const
|
|
9559
|
-
return
|
|
9525
|
+
const _ = at(e);
|
|
9526
|
+
return _.select(), void f.replace(_);
|
|
9560
9527
|
}
|
|
9561
|
-
const x = f.getFormat(),
|
|
9562
|
-
if (l !== u || x === i &&
|
|
9528
|
+
const x = f.getFormat(), b = f.getStyle();
|
|
9529
|
+
if (l !== u || x === i && b === s) {
|
|
9563
9530
|
if (gh(f)) {
|
|
9564
|
-
const
|
|
9565
|
-
return
|
|
9531
|
+
const _ = at(e);
|
|
9532
|
+
return _.setFormat(i), _.setStyle(s), _.select(), void f.replace(_);
|
|
9566
9533
|
}
|
|
9567
9534
|
} else {
|
|
9568
9535
|
if (f.getTextContent() !== "") {
|
|
9569
|
-
const
|
|
9570
|
-
if (
|
|
9536
|
+
const _ = at(e);
|
|
9537
|
+
if (_.setFormat(i), _.setStyle(s), _.select(), l === 0) f.insertBefore(_, !1);
|
|
9571
9538
|
else {
|
|
9572
|
-
const [
|
|
9573
|
-
|
|
9539
|
+
const [v] = f.splitText(l);
|
|
9540
|
+
v.insertAfter(_, !1);
|
|
9574
9541
|
}
|
|
9575
|
-
return void (
|
|
9542
|
+
return void (_.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
|
|
9576
9543
|
}
|
|
9577
9544
|
f.setFormat(i), f.setStyle(s);
|
|
9578
9545
|
}
|
|
9579
9546
|
const y = u - l;
|
|
9580
|
-
f = f.spliceText(l, y, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = x, this.style =
|
|
9547
|
+
f = f.spliceText(l, y, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = x, this.style = b));
|
|
9581
9548
|
} else {
|
|
9582
|
-
const x = /* @__PURE__ */ new Set([...f.getParentKeys(), ...m.getParentKeys()]),
|
|
9583
|
-
let y = P(m) ? m : m.getParentOrThrow(),
|
|
9584
|
-
if (!
|
|
9585
|
-
|
|
9549
|
+
const x = /* @__PURE__ */ new Set([...f.getParentKeys(), ...m.getParentKeys()]), b = P(f) ? f : f.getParentOrThrow();
|
|
9550
|
+
let y = P(m) ? m : m.getParentOrThrow(), _ = m;
|
|
9551
|
+
if (!b.is(y) && y.isInline()) do
|
|
9552
|
+
_ = y, y = y.getParentOrThrow();
|
|
9586
9553
|
while (y.isInline());
|
|
9587
9554
|
if (a.type === "text" && (u !== 0 || m.getTextContent() === "") || a.type === "element" && m.getIndexWithinParent() < u) if (Q(m) && !m.isToken() && u !== m.getTextContentSize()) {
|
|
9588
9555
|
if (m.isSegmented()) {
|
|
@@ -9595,11 +9562,11 @@ class Dr {
|
|
|
9595
9562
|
S.canBeEmpty() || S.getChildrenSize() !== 1 ? m.remove() : S.remove();
|
|
9596
9563
|
}
|
|
9597
9564
|
else x.add(m.__key);
|
|
9598
|
-
const
|
|
9599
|
-
for (let S =
|
|
9600
|
-
const F =
|
|
9565
|
+
const v = y.getChildren(), E = new Set(c), C = b.is(y), w = b.isInline() && f.getNextSibling() === null ? b : f;
|
|
9566
|
+
for (let S = v.length - 1; S >= 0; S--) {
|
|
9567
|
+
const F = v[S];
|
|
9601
9568
|
if (F.is(f) || P(F) && F.isParentOf(f)) break;
|
|
9602
|
-
F.isAttached() && (!E.has(F) || F.is(
|
|
9569
|
+
F.isAttached() && (!E.has(F) || F.is(_) ? C || w.insertAfter(F, !1) : F.remove());
|
|
9603
9570
|
}
|
|
9604
9571
|
if (!C) {
|
|
9605
9572
|
let S = y, F = null;
|
|
@@ -9648,11 +9615,11 @@ class Dr {
|
|
|
9648
9615
|
formatText(e, t = null) {
|
|
9649
9616
|
if (this.isCollapsed()) return this.toggleFormat(e), void ht(null);
|
|
9650
9617
|
const n = this.getNodes(), i = [];
|
|
9651
|
-
for (const
|
|
9652
|
-
const s = (
|
|
9618
|
+
for (const v of n) Q(v) && i.push(v);
|
|
9619
|
+
const s = (v) => {
|
|
9653
9620
|
n.forEach((E) => {
|
|
9654
9621
|
if (ln(E)) {
|
|
9655
|
-
const C = E.getFormatFlags(e,
|
|
9622
|
+
const C = E.getFormatFlags(e, v);
|
|
9656
9623
|
E.setTextFormat(C);
|
|
9657
9624
|
}
|
|
9658
9625
|
});
|
|
@@ -9664,25 +9631,25 @@ class Dr {
|
|
|
9664
9631
|
const m = p.getFormatFlags(e, t);
|
|
9665
9632
|
s(m);
|
|
9666
9633
|
const x = o - 1;
|
|
9667
|
-
let
|
|
9668
|
-
const y = d.type === "text" ? d.offset :
|
|
9669
|
-
if (p.is(
|
|
9634
|
+
let b = i[x];
|
|
9635
|
+
const y = d.type === "text" ? d.offset : b.getTextContentSize();
|
|
9636
|
+
if (p.is(b)) {
|
|
9670
9637
|
if (g === y) return;
|
|
9671
9638
|
if (Ar(p) || g === 0 && y === p.getTextContentSize()) p.setFormat(m);
|
|
9672
9639
|
else {
|
|
9673
|
-
const
|
|
9640
|
+
const v = p.splitText(g, y), E = g === 0 ? v[0] : v[1];
|
|
9674
9641
|
E.setFormat(m), c.type === "text" && c.set(E.__key, 0, "text"), d.type === "text" && d.set(E.__key, y - g, "text");
|
|
9675
9642
|
}
|
|
9676
9643
|
return void (this.format = m);
|
|
9677
9644
|
}
|
|
9678
9645
|
g === 0 || Ar(p) || ([, p] = p.splitText(g), g = 0), p.setFormat(m);
|
|
9679
|
-
const
|
|
9680
|
-
y > 0 && (y ===
|
|
9681
|
-
for (let
|
|
9682
|
-
const E = i[
|
|
9646
|
+
const _ = b.getFormatFlags(e, m);
|
|
9647
|
+
y > 0 && (y === b.getTextContentSize() || Ar(b) || ([b] = b.splitText(y)), b.setFormat(_));
|
|
9648
|
+
for (let v = f + 1; v < x; v++) {
|
|
9649
|
+
const E = i[v], C = E.getFormatFlags(e, _);
|
|
9683
9650
|
E.setFormat(C);
|
|
9684
9651
|
}
|
|
9685
|
-
c.type === "text" && c.set(p.__key, g, "text"), d.type === "text" && d.set(
|
|
9652
|
+
c.type === "text" && c.set(p.__key, g, "text"), d.type === "text" && d.set(b.__key, y, "text"), this.format = m | _;
|
|
9686
9653
|
}
|
|
9687
9654
|
insertNodes(e) {
|
|
9688
9655
|
if (e.length === 0) return;
|
|
@@ -9708,10 +9675,10 @@ class Dr {
|
|
|
9708
9675
|
const s = function(g) {
|
|
9709
9676
|
const m = ot();
|
|
9710
9677
|
let x = null;
|
|
9711
|
-
for (let
|
|
9712
|
-
const y = g[
|
|
9713
|
-
if (
|
|
9714
|
-
if (x === null && (x = y.createParentElementNode(), m.append(x),
|
|
9678
|
+
for (let b = 0; b < g.length; b++) {
|
|
9679
|
+
const y = g[b], _ = Mr(y);
|
|
9680
|
+
if (_ || We(y) && y.isInline() || P(y) && y.isInline() || Q(y) || y.isParentRequired()) {
|
|
9681
|
+
if (x === null && (x = y.createParentElementNode(), m.append(x), _)) continue;
|
|
9715
9682
|
x !== null && x.append(y);
|
|
9716
9683
|
} else m.append(y), x = null;
|
|
9717
9684
|
}
|
|
@@ -9720,12 +9687,12 @@ class Dr {
|
|
|
9720
9687
|
let c = a[0];
|
|
9721
9688
|
var d;
|
|
9722
9689
|
P(d = c) && gr(d) && !d.isEmpty() && P(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (P(n) || K(211, t.constructor.name, t.getType()), n.append(...c.getChildren()), c = a[1]), c && (n === null && K(212, t.constructor.name, t.getType()), function(g, m, x) {
|
|
9723
|
-
const
|
|
9690
|
+
const b = m.getParentOrThrow().getLastChild();
|
|
9724
9691
|
let y = m;
|
|
9725
|
-
const
|
|
9726
|
-
for (; y !==
|
|
9727
|
-
let
|
|
9728
|
-
for (const E of
|
|
9692
|
+
const _ = [m];
|
|
9693
|
+
for (; y !== b; ) y.getNextSibling() || K(140), y = y.getNextSibling(), _.push(y);
|
|
9694
|
+
let v = g;
|
|
9695
|
+
for (const E of _) v = v.insertAfter(E);
|
|
9729
9696
|
}(n, c));
|
|
9730
9697
|
const f = bn(o, gr);
|
|
9731
9698
|
l && P(f) && (l.canMergeWhenEmpty() || gr(u)) && (f.append(...l.getChildren()), l.remove()), P(n) && n.isEmpty() && n.remove(), o.selectEnd();
|
|
@@ -9799,12 +9766,12 @@ class Dr {
|
|
|
9799
9766
|
const f = u.getRangeAt(0), p = this.anchor.getNode(), g = bt(p) ? p : Jf(p);
|
|
9800
9767
|
if (this.applyDOMRange(f), this.dirty = !0, !o) {
|
|
9801
9768
|
const m = this.getNodes(), x = [];
|
|
9802
|
-
let
|
|
9769
|
+
let b = !1;
|
|
9803
9770
|
for (let y = 0; y < m.length; y++) {
|
|
9804
|
-
const
|
|
9805
|
-
Rn(
|
|
9771
|
+
const _ = m[y];
|
|
9772
|
+
Rn(_, g) ? x.push(_) : b = !0;
|
|
9806
9773
|
}
|
|
9807
|
-
if (
|
|
9774
|
+
if (b && x.length > 0) if (t) {
|
|
9808
9775
|
const y = x[0];
|
|
9809
9776
|
P(y) ? y.selectStart() : y.getParentOrThrow().selectStart();
|
|
9810
9777
|
} else {
|
|
@@ -9812,8 +9779,8 @@ class Dr {
|
|
|
9812
9779
|
P(y) ? y.selectEnd() : y.getParentOrThrow().selectEnd();
|
|
9813
9780
|
}
|
|
9814
9781
|
u.anchorNode === f.startContainer && u.anchorOffset === f.startOffset || function(y) {
|
|
9815
|
-
const
|
|
9816
|
-
mr(
|
|
9782
|
+
const _ = y.focus, v = y.anchor, E = v.key, C = v.offset, w = v.type;
|
|
9783
|
+
mr(v, _.key, _.offset, _.type), mr(_, E, C, w), y._cachedNodes = null;
|
|
9817
9784
|
}(this);
|
|
9818
9785
|
}
|
|
9819
9786
|
}
|
|
@@ -9857,8 +9824,8 @@ class Dr {
|
|
|
9857
9824
|
(function(l, u) {
|
|
9858
9825
|
const c = l.anchor, d = l.focus, f = c.getNode(), p = d.getNode();
|
|
9859
9826
|
if (f === p && c.type === "text" && d.type === "text") {
|
|
9860
|
-
const g = c.offset, m = d.offset, x = g < m,
|
|
9861
|
-
|
|
9827
|
+
const g = c.offset, m = d.offset, x = g < m, b = x ? g : m, y = x ? m : g, _ = y - 1;
|
|
9828
|
+
b !== _ && (Pu(f.getTextContent().slice(b, y)) || (u ? d.offset = _ : c.offset = _));
|
|
9862
9829
|
}
|
|
9863
9830
|
})(this, e);
|
|
9864
9831
|
}
|
|
@@ -9941,9 +9908,9 @@ function Zl(r, e, t, n) {
|
|
|
9941
9908
|
const p = n.getElementByKey(f.getKey());
|
|
9942
9909
|
p === null && K(214), [f, s] = f.getDOMSlot(p).resolveChildIndex(f, p, r, e), P(f) || K(215), o && s >= f.getChildrenSize() && (s = Math.max(0, f.getChildrenSize() - 1));
|
|
9943
9910
|
let m = f.getChildAtIndex(s);
|
|
9944
|
-
if (P(m) && function(x,
|
|
9945
|
-
const
|
|
9946
|
-
return y === null ||
|
|
9911
|
+
if (P(m) && function(x, b, y) {
|
|
9912
|
+
const _ = x.getParent();
|
|
9913
|
+
return y === null || _ === null || !_.canBeEmpty() || _ !== y.getNode();
|
|
9947
9914
|
}(m, 0, t)) {
|
|
9948
9915
|
const x = o ? m.getLastDescendant() : m.getFirstDescendant();
|
|
9949
9916
|
x === null ? f = m : (m = x, f = P(m) ? m : m.getParentOrThrow()), s = 0;
|
|
@@ -10093,47 +10060,47 @@ function xh(r, e, t, n, i, s, o) {
|
|
|
10093
10060
|
const a = n.anchorNode, l = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
|
|
10094
10061
|
if (i.has("collaboration") && d !== s || d !== null && Go(d)) return;
|
|
10095
10062
|
if (!H(e)) return void (r !== null && Zn(t, a, l) && n.removeAllRanges());
|
|
10096
|
-
const f = e.anchor, p = e.focus, g = f.key, m = p.key, x = Ui(t, g),
|
|
10097
|
-
let
|
|
10063
|
+
const f = e.anchor, p = e.focus, g = f.key, m = p.key, x = Ui(t, g), b = Ui(t, m), y = f.offset, _ = p.offset, v = e.format, E = e.style, C = e.isCollapsed();
|
|
10064
|
+
let w = x, S = b, F = !1;
|
|
10098
10065
|
if (f.type === "text") {
|
|
10099
|
-
|
|
10066
|
+
w = zi(x);
|
|
10100
10067
|
const B = f.getNode();
|
|
10101
|
-
F = B.getFormat() !==
|
|
10068
|
+
F = B.getFormat() !== v || B.getStyle() !== E;
|
|
10102
10069
|
} else H(r) && r.anchor.type === "text" && (F = !0);
|
|
10103
10070
|
var T, A, N, R, D;
|
|
10104
|
-
if (p.type === "text" && (S = zi(
|
|
10071
|
+
if (p.type === "text" && (S = zi(b)), w !== null && S !== null && (C && (r === null || F || H(r) && (r.format !== v || r.style !== E)) && (T = v, A = E, N = y, R = g, D = performance.now(), Qu = [T, A, N, R, D]), u !== y || c !== _ || a !== w || l !== S || n.type === "Range" && C || (d !== null && s.contains(d) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
10105
10072
|
try {
|
|
10106
|
-
n.setBaseAndExtent(
|
|
10073
|
+
n.setBaseAndExtent(w, y, S, _);
|
|
10107
10074
|
} catch {
|
|
10108
10075
|
}
|
|
10109
10076
|
if (!i.has("skip-scroll-into-view") && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
10110
|
-
const B = e instanceof Dr && e.anchor.type === "element" ?
|
|
10077
|
+
const B = e instanceof Dr && e.anchor.type === "element" ? w.childNodes[y] || null : n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
10111
10078
|
if (B !== null) {
|
|
10112
10079
|
let M;
|
|
10113
10080
|
if (B instanceof Text) {
|
|
10114
|
-
const
|
|
10115
|
-
|
|
10081
|
+
const O = document.createRange();
|
|
10082
|
+
O.selectNode(B), M = O.getBoundingClientRect();
|
|
10116
10083
|
} else M = B.getBoundingClientRect();
|
|
10117
|
-
(function(
|
|
10084
|
+
(function(O, V, U) {
|
|
10118
10085
|
const re = U.ownerDocument, q = re.defaultView;
|
|
10119
10086
|
if (q === null) return;
|
|
10120
10087
|
let { top: J, bottom: W } = V, se = 0, ce = 0, fe = U;
|
|
10121
10088
|
for (; fe !== null; ) {
|
|
10122
|
-
const
|
|
10123
|
-
if (
|
|
10089
|
+
const ge = fe === re.body;
|
|
10090
|
+
if (ge) se = 0, ce = ys(O).innerHeight;
|
|
10124
10091
|
else {
|
|
10125
10092
|
const _e = fe.getBoundingClientRect();
|
|
10126
10093
|
se = _e.top, ce = _e.bottom;
|
|
10127
10094
|
}
|
|
10128
10095
|
let Be = 0;
|
|
10129
|
-
if (J < se ? Be = -(se - J) : W > ce && (Be = W - ce), Be !== 0) if (
|
|
10096
|
+
if (J < se ? Be = -(se - J) : W > ce && (Be = W - ce), Be !== 0) if (ge) q.scrollBy(0, Be);
|
|
10130
10097
|
else {
|
|
10131
10098
|
const _e = fe.scrollTop;
|
|
10132
10099
|
fe.scrollTop += Be;
|
|
10133
10100
|
const Z = fe.scrollTop - _e;
|
|
10134
10101
|
J -= Z, W -= Z;
|
|
10135
10102
|
}
|
|
10136
|
-
if (
|
|
10103
|
+
if (ge) break;
|
|
10137
10104
|
fe = ei(fe);
|
|
10138
10105
|
}
|
|
10139
10106
|
})(t, M, s);
|
|
@@ -10262,8 +10229,8 @@ function br(r, e) {
|
|
|
10262
10229
|
if (r._pendingEditorState = null, r._editorState = t, !i && l && p !== null) {
|
|
10263
10230
|
ft = r, dt = t, kt = !1, r._updating = !0;
|
|
10264
10231
|
try {
|
|
10265
|
-
const C = r._dirtyType,
|
|
10266
|
-
p.disconnect(), g = lh(s, t, r, C,
|
|
10232
|
+
const C = r._dirtyType, w = r._dirtyElements, S = r._dirtyLeaves;
|
|
10233
|
+
p.disconnect(), g = lh(s, t, r, C, w, S);
|
|
10267
10234
|
} catch (C) {
|
|
10268
10235
|
if (C instanceof Error && r._onError(C), Gs) throw C;
|
|
10269
10236
|
return pc(r, null, n, t), Bu(r), r._dirtyType = sn, Gs = !0, br(r, s), void (Gs = !1);
|
|
@@ -10272,52 +10239,52 @@ function br(r, e) {
|
|
|
10272
10239
|
}
|
|
10273
10240
|
}
|
|
10274
10241
|
t._readOnly || (t._readOnly = !0);
|
|
10275
|
-
const m = r._dirtyLeaves, x = r._dirtyElements,
|
|
10276
|
-
l && (r._dirtyType = jr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(C,
|
|
10242
|
+
const m = r._dirtyLeaves, x = r._dirtyElements, b = r._normalizedNodes, y = r._updateTags, _ = r._deferred;
|
|
10243
|
+
l && (r._dirtyType = jr, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(C, w) {
|
|
10277
10244
|
const S = C._decorators;
|
|
10278
10245
|
let F = C._pendingDecorators || S;
|
|
10279
|
-
const T =
|
|
10246
|
+
const T = w._nodeMap;
|
|
10280
10247
|
let A;
|
|
10281
10248
|
for (A in F) T.has(A) || (F === S && (F = ju(C)), delete F[A]);
|
|
10282
10249
|
}(r, t);
|
|
10283
|
-
const
|
|
10284
|
-
if (r._editable &&
|
|
10250
|
+
const v = i ? null : jt(r._window);
|
|
10251
|
+
if (r._editable && v !== null && (l || a === null || a.dirty)) {
|
|
10285
10252
|
ft = r, dt = t;
|
|
10286
10253
|
try {
|
|
10287
10254
|
if (p !== null && p.disconnect(), l || a === null || a.dirty) {
|
|
10288
10255
|
const C = r._blockCursorElement;
|
|
10289
|
-
C !== null && Zo(C, r, n), xh(o, a, r,
|
|
10256
|
+
C !== null && Zo(C, r, n), xh(o, a, r, v, y, n);
|
|
10290
10257
|
}
|
|
10291
10258
|
Zf(r, n, a), p !== null && p.observe(n, ia);
|
|
10292
10259
|
} finally {
|
|
10293
10260
|
ft = d, dt = u;
|
|
10294
10261
|
}
|
|
10295
10262
|
}
|
|
10296
|
-
g !== null && function(C,
|
|
10263
|
+
g !== null && function(C, w, S, F, T) {
|
|
10297
10264
|
const A = Array.from(C._listeners.mutation), N = A.length;
|
|
10298
10265
|
for (let R = 0; R < N; R++) {
|
|
10299
|
-
const [D, B] = A[R], M =
|
|
10266
|
+
const [D, B] = A[R], M = w.get(B);
|
|
10300
10267
|
M !== void 0 && D(M, { dirtyLeaves: F, prevEditorState: T, updateTags: S });
|
|
10301
10268
|
}
|
|
10302
10269
|
}(r, g, y, m, s), H(a) || a === null || o !== null && o.is(a) || r.dispatchCommand(Ro, void 0);
|
|
10303
10270
|
const E = r._pendingDecorators;
|
|
10304
|
-
E !== null && (r._decorators = E, r._pendingDecorators = null, Pn("decorator", r, !0, E)), function(C,
|
|
10305
|
-
const F = Ml(
|
|
10271
|
+
E !== null && (r._decorators = E, r._pendingDecorators = null, Pn("decorator", r, !0, E)), function(C, w, S) {
|
|
10272
|
+
const F = Ml(w), T = Ml(S);
|
|
10306
10273
|
F !== T && Pn("textcontent", C, !0, T);
|
|
10307
|
-
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes:
|
|
10308
|
-
if (C._deferred = [],
|
|
10274
|
+
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes: b, prevEditorState: e || s, tags: y }), function(C, w) {
|
|
10275
|
+
if (C._deferred = [], w.length !== 0) {
|
|
10309
10276
|
const S = C._updating;
|
|
10310
10277
|
C._updating = !0;
|
|
10311
10278
|
try {
|
|
10312
|
-
for (let F = 0; F <
|
|
10279
|
+
for (let F = 0; F < w.length; F++) w[F]();
|
|
10313
10280
|
} finally {
|
|
10314
10281
|
C._updating = S;
|
|
10315
10282
|
}
|
|
10316
10283
|
}
|
|
10317
|
-
}(r,
|
|
10318
|
-
const
|
|
10319
|
-
if (
|
|
10320
|
-
const S =
|
|
10284
|
+
}(r, _), function(C) {
|
|
10285
|
+
const w = C._updates;
|
|
10286
|
+
if (w.length !== 0) {
|
|
10287
|
+
const S = w.shift();
|
|
10321
10288
|
if (S) {
|
|
10322
10289
|
const [F, T] = S;
|
|
10323
10290
|
dc(C, F, T);
|
|
@@ -10385,36 +10352,36 @@ function dc(r, e, t) {
|
|
|
10385
10352
|
const c = dt, d = kt, f = ft, p = r._updating;
|
|
10386
10353
|
dt = l, kt = !1, r._updating = !0, ft = r;
|
|
10387
10354
|
try {
|
|
10388
|
-
u && (r._headless ? a._selection !== null && (l._selection = a._selection.clone()) : l._selection = function(
|
|
10389
|
-
const y =
|
|
10390
|
-
return H(y) || y == null ? nl(y,
|
|
10355
|
+
u && (r._headless ? a._selection !== null && (l._selection = a._selection.clone()) : l._selection = function(b) {
|
|
10356
|
+
const y = b.getEditorState()._selection, _ = jt(b._window);
|
|
10357
|
+
return H(y) || y == null ? nl(y, _, b, null) : y.clone();
|
|
10391
10358
|
}(r));
|
|
10392
10359
|
const m = r._compositionKey;
|
|
10393
|
-
e(), s = aa(r, s), function(
|
|
10394
|
-
const
|
|
10395
|
-
if (H(
|
|
10396
|
-
const E =
|
|
10397
|
-
let
|
|
10398
|
-
if (E.type === "text" && (
|
|
10360
|
+
e(), s = aa(r, s), function(b, y) {
|
|
10361
|
+
const _ = y.getEditorState()._selection, v = b._selection;
|
|
10362
|
+
if (H(v)) {
|
|
10363
|
+
const E = v.anchor, C = v.focus;
|
|
10364
|
+
let w;
|
|
10365
|
+
if (E.type === "text" && (w = E.getNode(), w.selectionTransform(_, v)), C.type === "text") {
|
|
10399
10366
|
const S = C.getNode();
|
|
10400
|
-
|
|
10367
|
+
w !== S && S.selectionTransform(_, v);
|
|
10401
10368
|
}
|
|
10402
10369
|
}
|
|
10403
|
-
}(l, r), r._dirtyType !== jr && (s ? function(
|
|
10404
|
-
const
|
|
10405
|
-
for (const E of
|
|
10406
|
-
const C =
|
|
10370
|
+
}(l, r), r._dirtyType !== jr && (s ? function(b, y) {
|
|
10371
|
+
const _ = y._dirtyLeaves, v = b._nodeMap;
|
|
10372
|
+
for (const E of _) {
|
|
10373
|
+
const C = v.get(E);
|
|
10407
10374
|
Q(C) && C.isAttached() && C.isSimpleText() && !C.isUnmergeable() && Nl(C);
|
|
10408
10375
|
}
|
|
10409
|
-
}(l, r) : function(
|
|
10410
|
-
const
|
|
10411
|
-
let S =
|
|
10376
|
+
}(l, r) : function(b, y) {
|
|
10377
|
+
const _ = y._dirtyLeaves, v = y._dirtyElements, E = b._nodeMap, C = xr(), w = /* @__PURE__ */ new Map();
|
|
10378
|
+
let S = _, F = S.size, T = v, A = T.size;
|
|
10412
10379
|
for (; F > 0 || A > 0; ) {
|
|
10413
10380
|
if (F > 0) {
|
|
10414
10381
|
y._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
10415
10382
|
for (const N of S) {
|
|
10416
10383
|
const R = E.get(N);
|
|
10417
|
-
Q(R) && R.isAttached() && R.isSimpleText() && !R.isUnmergeable() && Nl(R), R !== void 0 && oa(R, C) && sa(y, R,
|
|
10384
|
+
Q(R) && R.isAttached() && R.isSimpleText() && !R.isUnmergeable() && Nl(R), R !== void 0 && oa(R, C) && sa(y, R, w), _.add(N);
|
|
10418
10385
|
}
|
|
10419
10386
|
if (S = y._dirtyLeaves, F = S.size, F > 0) {
|
|
10420
10387
|
ki++;
|
|
@@ -10426,27 +10393,27 @@ function dc(r, e, t) {
|
|
|
10426
10393
|
const R = N[0], D = N[1];
|
|
10427
10394
|
if (R !== "root" && !D) continue;
|
|
10428
10395
|
const B = E.get(R);
|
|
10429
|
-
B !== void 0 && oa(B, C) && sa(y, B,
|
|
10396
|
+
B !== void 0 && oa(B, C) && sa(y, B, w), v.set(R, D);
|
|
10430
10397
|
}
|
|
10431
10398
|
S = y._dirtyLeaves, F = S.size, T = y._dirtyElements, A = T.size, ki++;
|
|
10432
10399
|
}
|
|
10433
|
-
y._dirtyLeaves =
|
|
10434
|
-
}(l, r), aa(r), function(
|
|
10435
|
-
const E =
|
|
10436
|
-
for (const [S] of
|
|
10400
|
+
y._dirtyLeaves = _, y._dirtyElements = v;
|
|
10401
|
+
}(l, r), aa(r), function(b, y, _, v) {
|
|
10402
|
+
const E = b._nodeMap, C = y._nodeMap, w = [];
|
|
10403
|
+
for (const [S] of v) {
|
|
10437
10404
|
const F = C.get(S);
|
|
10438
|
-
F !== void 0 && (F.isAttached() || (P(F) && $u(F, S, E, C,
|
|
10405
|
+
F !== void 0 && (F.isAttached() || (P(F) && $u(F, S, E, C, w, v), E.has(S) || v.delete(S), w.push(S)));
|
|
10439
10406
|
}
|
|
10440
|
-
for (const S of
|
|
10441
|
-
for (const S of
|
|
10407
|
+
for (const S of w) C.delete(S);
|
|
10408
|
+
for (const S of _) {
|
|
10442
10409
|
const F = C.get(S);
|
|
10443
|
-
F === void 0 || F.isAttached() || (E.has(S) ||
|
|
10410
|
+
F === void 0 || F.isAttached() || (E.has(S) || _.delete(S), C.delete(S));
|
|
10444
10411
|
}
|
|
10445
10412
|
}(a, l, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (l._flushSync = !0);
|
|
10446
10413
|
const x = l._selection;
|
|
10447
10414
|
if (H(x)) {
|
|
10448
|
-
const
|
|
10449
|
-
|
|
10415
|
+
const b = l._nodeMap, y = x.anchor.key, _ = x.focus.key;
|
|
10416
|
+
b.get(y) !== void 0 && b.get(_) !== void 0 || K(19);
|
|
10450
10417
|
} else Yt(x) && x._nodes.size === 0 && (l._selection = null);
|
|
10451
10418
|
} catch (m) {
|
|
10452
10419
|
return m instanceof Error && r._onError(m), r._pendingEditorState = a, r._dirtyType = sn, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void br(r);
|
|
@@ -10454,10 +10421,10 @@ function dc(r, e, t) {
|
|
|
10454
10421
|
dt = c, kt = d, ft = f, r._updating = p, ki = 0;
|
|
10455
10422
|
}
|
|
10456
10423
|
r._dirtyType !== jr || function(m, x) {
|
|
10457
|
-
const
|
|
10424
|
+
const b = x.getEditorState()._selection, y = m._selection;
|
|
10458
10425
|
if (y !== null) {
|
|
10459
|
-
if (y.dirty || !y.is(
|
|
10460
|
-
} else if (
|
|
10426
|
+
if (y.dirty || !y.is(b)) return !0;
|
|
10427
|
+
} else if (b !== null) return !0;
|
|
10461
10428
|
return !1;
|
|
10462
10429
|
}(l, r) ? l._flushSync ? (l._flushSync = !1, br(r)) : u && Gf(() => {
|
|
10463
10430
|
br(r);
|
|
@@ -10762,8 +10729,8 @@ class hr extends bs {
|
|
|
10762
10729
|
let g = d === null ? this.getFirstChild() : d.getNextSibling();
|
|
10763
10730
|
for (let m = 0; m < t; m++) {
|
|
10764
10731
|
g === null && K(100);
|
|
10765
|
-
const x = g.getNextSibling(),
|
|
10766
|
-
Fr(g.getWritable()), u.push(
|
|
10732
|
+
const x = g.getNextSibling(), b = g.__key;
|
|
10733
|
+
Fr(g.getWritable()), u.push(b), g = x;
|
|
10767
10734
|
}
|
|
10768
10735
|
}
|
|
10769
10736
|
let p = d;
|
|
@@ -10772,13 +10739,13 @@ class hr extends bs {
|
|
|
10772
10739
|
p !== null && m.is(p) && (d = p = p.getPreviousSibling());
|
|
10773
10740
|
const x = m.getWritable();
|
|
10774
10741
|
x.__parent === a && f--, Fr(x);
|
|
10775
|
-
const
|
|
10776
|
-
if (p === null) o.__first =
|
|
10742
|
+
const b = m.__key;
|
|
10743
|
+
if (p === null) o.__first = b, x.__prev = null;
|
|
10777
10744
|
else {
|
|
10778
10745
|
const y = p.getWritable();
|
|
10779
|
-
y.__next =
|
|
10746
|
+
y.__next = b, x.__prev = y.__key;
|
|
10780
10747
|
}
|
|
10781
|
-
m.__key === a && K(76), x.__parent = a, l.push(
|
|
10748
|
+
m.__key === a && K(76), x.__parent = a, l.push(b), p = m;
|
|
10782
10749
|
}
|
|
10783
10750
|
if (e + t === s)
|
|
10784
10751
|
p !== null && (p.getWritable().__next = null, o.__last = p.__key);
|
|
@@ -10792,8 +10759,8 @@ class hr extends bs {
|
|
|
10792
10759
|
if (o.__size = f, u.length) {
|
|
10793
10760
|
const g = le();
|
|
10794
10761
|
if (H(g)) {
|
|
10795
|
-
const m = new Set(u), x = new Set(l), { anchor:
|
|
10796
|
-
ca(
|
|
10762
|
+
const m = new Set(u), x = new Set(l), { anchor: b, focus: y } = g;
|
|
10763
|
+
ca(b, m, x) && Qi(b, b.getNode(), this, d, c), ca(y, m, x) && Qi(y, y.getNode(), this, d, c), f !== 0 || this.canBeEmpty() || er(this) || this.remove();
|
|
10797
10764
|
}
|
|
10798
10765
|
}
|
|
10799
10766
|
return o;
|
|
@@ -11094,29 +11061,29 @@ function Dh(r) {
|
|
|
11094
11061
|
else {
|
|
11095
11062
|
p = /* @__PURE__ */ new Map();
|
|
11096
11063
|
for (let m = 0; m < u.length; m++) {
|
|
11097
|
-
let x = u[m],
|
|
11064
|
+
let x = u[m], b = null, y = null;
|
|
11098
11065
|
if (typeof x != "function") {
|
|
11099
11066
|
const C = x;
|
|
11100
|
-
x = C.replace,
|
|
11067
|
+
x = C.replace, b = C.with, y = C.withKlass || null;
|
|
11101
11068
|
}
|
|
11102
|
-
const
|
|
11103
|
-
|
|
11069
|
+
const _ = x.getType(), v = x.transform(), E = /* @__PURE__ */ new Set();
|
|
11070
|
+
v !== null && E.add(v), p.set(_, { exportDOM: d && d.export ? d.export.get(x) : void 0, klass: x, replace: b, replaceWithKlass: y, transforms: E });
|
|
11104
11071
|
}
|
|
11105
11072
|
}
|
|
11106
11073
|
const g = new ws(o, i, p, { disableEvents: s, namespace: a, theme: n }, c || console.error, function(m, x) {
|
|
11107
|
-
const
|
|
11108
|
-
Object.keys(
|
|
11109
|
-
let C =
|
|
11110
|
-
C === void 0 && (C = [],
|
|
11074
|
+
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), _ = (v) => {
|
|
11075
|
+
Object.keys(v).forEach((E) => {
|
|
11076
|
+
let C = b.get(E);
|
|
11077
|
+
C === void 0 && (C = [], b.set(E, C)), C.push(v[E]);
|
|
11111
11078
|
});
|
|
11112
11079
|
};
|
|
11113
|
-
return m.forEach((
|
|
11114
|
-
const E =
|
|
11080
|
+
return m.forEach((v) => {
|
|
11081
|
+
const E = v.klass.importDOM;
|
|
11115
11082
|
if (E == null || y.has(E)) return;
|
|
11116
11083
|
y.add(E);
|
|
11117
|
-
const C = E.call(
|
|
11118
|
-
C !== null &&
|
|
11119
|
-
}), x &&
|
|
11084
|
+
const C = E.call(v.klass);
|
|
11085
|
+
C !== null && _(C);
|
|
11086
|
+
}), x && _(x), b;
|
|
11120
11087
|
}(p, d ? d.import : void 0), f);
|
|
11121
11088
|
return l !== void 0 && (g._pendingEditorState = l, g._dirtyType = sn), g;
|
|
11122
11089
|
}
|
|
@@ -11249,26 +11216,26 @@ class ws {
|
|
|
11249
11216
|
} : (x) => {
|
|
11250
11217
|
if (Vl(x)) return;
|
|
11251
11218
|
Hl(x);
|
|
11252
|
-
const
|
|
11219
|
+
const b = l.isEditable();
|
|
11253
11220
|
switch (p) {
|
|
11254
11221
|
case "cut":
|
|
11255
|
-
return
|
|
11222
|
+
return b && ne(l, Po, x);
|
|
11256
11223
|
case "copy":
|
|
11257
11224
|
return ne(l, ds, x);
|
|
11258
11225
|
case "paste":
|
|
11259
|
-
return
|
|
11226
|
+
return b && ne(l, cs, x);
|
|
11260
11227
|
case "dragstart":
|
|
11261
|
-
return
|
|
11228
|
+
return b && ne(l, wu, x);
|
|
11262
11229
|
case "dragover":
|
|
11263
|
-
return
|
|
11230
|
+
return b && ne(l, Cu, x);
|
|
11264
11231
|
case "dragend":
|
|
11265
|
-
return
|
|
11232
|
+
return b && ne(l, _f, x);
|
|
11266
11233
|
case "focus":
|
|
11267
|
-
return
|
|
11234
|
+
return b && ne(l, Cf, x);
|
|
11268
11235
|
case "blur":
|
|
11269
|
-
return
|
|
11236
|
+
return b && ne(l, Df, x);
|
|
11270
11237
|
case "drop":
|
|
11271
|
-
return
|
|
11238
|
+
return b && ne(l, vu, x);
|
|
11272
11239
|
}
|
|
11273
11240
|
};
|
|
11274
11241
|
a.addEventListener(p, m), d.push(() => {
|
|
@@ -11383,7 +11350,7 @@ function Ah(r) {
|
|
|
11383
11350
|
}
|
|
11384
11351
|
function Th() {
|
|
11385
11352
|
return function(r) {
|
|
11386
|
-
const [e] = Ht(), t = ct(() => r(e), [e, r]), [n, i] =
|
|
11353
|
+
const [e] = Ht(), t = ct(() => r(e), [e, r]), [n, i] = I(() => t.initialValueFn()), s = be(n);
|
|
11387
11354
|
return kh(() => {
|
|
11388
11355
|
const { initialValueFn: o, subscribe: a } = t, l = o();
|
|
11389
11356
|
return s.current !== l && (s.current = l, i(l)), a((u) => {
|
|
@@ -11583,11 +11550,11 @@ function Gh(r) {
|
|
|
11583
11550
|
const m = le();
|
|
11584
11551
|
if (H(m)) {
|
|
11585
11552
|
const x = m.anchor;
|
|
11586
|
-
let
|
|
11587
|
-
if (Q(
|
|
11588
|
-
y = f,
|
|
11589
|
-
const
|
|
11590
|
-
y = y >
|
|
11553
|
+
let b = x.getNode(), y = 0, _ = 0;
|
|
11554
|
+
if (Q(b) && u >= 0 && c >= 0 && (y = u, _ = u + c, m.setTextNodeRange(b, y, b, _)), y === _ && d === "" || (m.insertRawText(d), b = x.getNode()), Q(b)) {
|
|
11555
|
+
y = f, _ = f + p;
|
|
11556
|
+
const v = b.getTextContentSize();
|
|
11557
|
+
y = y > v ? v : y, _ = _ > v ? v : _, m.setTextNodeRange(b, y, b, _);
|
|
11591
11558
|
}
|
|
11592
11559
|
n.stopImmediatePropagation();
|
|
11593
11560
|
}
|
|
@@ -11660,11 +11627,11 @@ function Ec(r, e, t, n, i = /* @__PURE__ */ new Map(), s) {
|
|
|
11660
11627
|
if (Dc.has(r.nodeName)) return o;
|
|
11661
11628
|
let a = null;
|
|
11662
11629
|
const l = function(g, m) {
|
|
11663
|
-
const { nodeName: x } = g,
|
|
11630
|
+
const { nodeName: x } = g, b = m._htmlConversions.get(x.toLowerCase());
|
|
11664
11631
|
let y = null;
|
|
11665
|
-
if (
|
|
11666
|
-
const
|
|
11667
|
-
|
|
11632
|
+
if (b !== void 0) for (const _ of b) {
|
|
11633
|
+
const v = _(g);
|
|
11634
|
+
v !== null && (y === null || (y.priority || 0) <= (v.priority || 0)) && (y = v);
|
|
11668
11635
|
}
|
|
11669
11636
|
return y !== null ? y.conversion : null;
|
|
11670
11637
|
}(r, e), u = l ? l(r) : null;
|
|
@@ -12190,7 +12157,7 @@ function Ca(r) {
|
|
|
12190
12157
|
}
|
|
12191
12158
|
function cp({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
12192
12159
|
const [n] = Ht(), i = function(s, o) {
|
|
12193
|
-
const [a, l] =
|
|
12160
|
+
const [a, l] = I(() => s.getDecorators());
|
|
12194
12161
|
return xo(() => s.registerDecoratorListener((u) => {
|
|
12195
12162
|
Cd(() => {
|
|
12196
12163
|
l(u);
|
|
@@ -12212,7 +12179,7 @@ function cp({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
|
|
|
12212
12179
|
}
|
|
12213
12180
|
function dp({ content: r }) {
|
|
12214
12181
|
const [e] = Ht(), t = function(i) {
|
|
12215
|
-
const [s, o] =
|
|
12182
|
+
const [s, o] = I(() => Ca(i));
|
|
12216
12183
|
return xo(() => {
|
|
12217
12184
|
function a() {
|
|
12218
12185
|
const l = Ca(i);
|
|
@@ -12228,8 +12195,8 @@ function dp({ content: r }) {
|
|
|
12228
12195
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
12229
12196
|
}
|
|
12230
12197
|
const kc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? cn : Te;
|
|
12231
|
-
function fp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: i, ariaErrorMessage: s, ariaExpanded: o, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: p, className: g, id: m, role: x = "textbox", spellCheck:
|
|
12232
|
-
const [
|
|
12198
|
+
function fp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: i, ariaErrorMessage: s, ariaExpanded: o, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: p, className: g, id: m, role: x = "textbox", spellCheck: b = !0, style: y, tabIndex: _, "data-testid": v, ...E }, C) {
|
|
12199
|
+
const [w, S] = I(r.isEditable()), F = X((A) => {
|
|
12233
12200
|
A && A.ownerDocument && A.ownerDocument.defaultView ? r.setRootElement(A) : r.setRootElement(null);
|
|
12234
12201
|
}, [r]), T = ct(() => /* @__PURE__ */ function(...A) {
|
|
12235
12202
|
return (N) => {
|
|
@@ -12240,7 +12207,7 @@ function fp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
|
|
|
12240
12207
|
}(C, F), [F, C]);
|
|
12241
12208
|
return kc(() => (S(r.isEditable()), r.registerEditableListener((A) => {
|
|
12242
12209
|
S(A);
|
|
12243
|
-
})), [r]), h.jsx("div", { "aria-activedescendant":
|
|
12210
|
+
})), [r]), h.jsx("div", { "aria-activedescendant": w ? e : void 0, "aria-autocomplete": w ? t : "none", "aria-controls": w ? n : void 0, "aria-describedby": i, ...s != null ? { "aria-errormessage": s } : {}, "aria-expanded": w && x === "combobox" ? !!o : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": w ? d : void 0, "aria-readonly": !w || void 0, "aria-required": f, autoCapitalize: p, className: g, contentEditable: w, "data-testid": v, id: m, ref: T, role: w ? x : void 0, spellCheck: b, style: y, tabIndex: _, ...E });
|
|
12244
12211
|
}
|
|
12245
12212
|
const hp = su(fp);
|
|
12246
12213
|
function Da(r) {
|
|
@@ -12253,7 +12220,7 @@ function gp(r, e) {
|
|
|
12253
12220
|
}
|
|
12254
12221
|
function mp({ content: r, editor: e }) {
|
|
12255
12222
|
const t = function(o) {
|
|
12256
|
-
const [a, l] =
|
|
12223
|
+
const [a, l] = I(() => Da(o));
|
|
12257
12224
|
return kc(() => {
|
|
12258
12225
|
function u() {
|
|
12259
12226
|
const c = Da(o);
|
|
@@ -12265,7 +12232,7 @@ function mp({ content: r, editor: e }) {
|
|
|
12265
12232
|
u();
|
|
12266
12233
|
}));
|
|
12267
12234
|
}, [o]), a;
|
|
12268
|
-
}(e), [n, i] =
|
|
12235
|
+
}(e), [n, i] = I(e.isEditable());
|
|
12269
12236
|
if (cn(() => (i(e.isEditable()), e.registerEditableListener((o) => {
|
|
12270
12237
|
i(o);
|
|
12271
12238
|
})), [e]), !t) return null;
|
|
@@ -12278,23 +12245,23 @@ function _p(r, e, t, n, i) {
|
|
|
12278
12245
|
const s = e._selection, o = r._selection;
|
|
12279
12246
|
if (i) return yp;
|
|
12280
12247
|
if (!(H(s) && H(o) && o.isCollapsed() && s.isCollapsed())) return zt;
|
|
12281
|
-
const a = function(
|
|
12282
|
-
const
|
|
12248
|
+
const a = function(b, y, _) {
|
|
12249
|
+
const v = b._nodeMap, E = [];
|
|
12283
12250
|
for (const C of y) {
|
|
12284
|
-
const
|
|
12285
|
-
|
|
12251
|
+
const w = v.get(C);
|
|
12252
|
+
w !== void 0 && E.push(w);
|
|
12286
12253
|
}
|
|
12287
|
-
for (const [C,
|
|
12288
|
-
if (!
|
|
12289
|
-
const S =
|
|
12254
|
+
for (const [C, w] of _) {
|
|
12255
|
+
if (!w) continue;
|
|
12256
|
+
const S = v.get(C);
|
|
12290
12257
|
S === void 0 || bt(S) || E.push(S);
|
|
12291
12258
|
}
|
|
12292
12259
|
return E;
|
|
12293
12260
|
}(e, t, n);
|
|
12294
12261
|
if (a.length === 0) return zt;
|
|
12295
12262
|
if (a.length > 1) {
|
|
12296
|
-
const
|
|
12297
|
-
return y &&
|
|
12263
|
+
const b = e._nodeMap, y = b.get(s.anchor.key), _ = b.get(o.anchor.key);
|
|
12264
|
+
return y && _ && !r._nodeMap.has(y.__key) && Q(y) && y.__text.length === 1 && s.anchor.offset === 1 ? Ea : zt;
|
|
12298
12265
|
}
|
|
12299
12266
|
const l = a[0], u = r._nodeMap.get(l.__key);
|
|
12300
12267
|
if (!Q(u) || !Q(l) || u.__mode !== l.__mode) return zt;
|
|
@@ -12315,9 +12282,9 @@ function vp(r, e) {
|
|
|
12315
12282
|
if (!g && p && u.has("history-merge")) return _i;
|
|
12316
12283
|
if (i === null) return bo;
|
|
12317
12284
|
const m = s._selection;
|
|
12318
|
-
return a.size > 0 || l.size > 0 ? g === !1 && d !== zt && d === n && c < t + e && p || a.size === 1 && function(x,
|
|
12319
|
-
const
|
|
12320
|
-
return !(H(E) && H(C) && E.anchor.type === "element" && E.focus.type === "element" && C.anchor.type === "text" && C.focus.type === "text" || !Q(
|
|
12285
|
+
return a.size > 0 || l.size > 0 ? g === !1 && d !== zt && d === n && c < t + e && p || a.size === 1 && function(x, b, y) {
|
|
12286
|
+
const _ = b._nodeMap.get(x), v = y._nodeMap.get(x), E = b._selection, C = y._selection;
|
|
12287
|
+
return !(H(E) && H(C) && E.anchor.type === "element" && E.focus.type === "element" && C.anchor.type === "text" && C.focus.type === "text" || !Q(_) || !Q(v) || _.__parent !== v.__parent) && JSON.stringify(b.read(() => _.exportJSON())) === JSON.stringify(y.read(() => v.exportJSON()));
|
|
12321
12288
|
}(Array.from(a)[0], i, s) ? _i : bo : m !== null ? _i : _o;
|
|
12322
12289
|
})();
|
|
12323
12290
|
return t = c, n = d, f;
|
|
@@ -13382,31 +13349,31 @@ var zr;
|
|
|
13382
13349
|
throw new RangeError("Invalid value");
|
|
13383
13350
|
let g, m;
|
|
13384
13351
|
for (g = c; ; g++) {
|
|
13385
|
-
const
|
|
13386
|
-
if (
|
|
13387
|
-
m =
|
|
13352
|
+
const _ = Ne.getNumDataCodewords(g, u) * 8, v = o.getTotalBits(l, g);
|
|
13353
|
+
if (v <= _) {
|
|
13354
|
+
m = v;
|
|
13388
13355
|
break;
|
|
13389
13356
|
}
|
|
13390
13357
|
if (g >= d)
|
|
13391
13358
|
throw new RangeError("Data too long");
|
|
13392
13359
|
}
|
|
13393
|
-
for (const
|
|
13394
|
-
p && m <= Ne.getNumDataCodewords(g,
|
|
13360
|
+
for (const _ of [Ne.Ecc.MEDIUM, Ne.Ecc.QUARTILE, Ne.Ecc.HIGH])
|
|
13361
|
+
p && m <= Ne.getNumDataCodewords(g, _) * 8 && (u = _);
|
|
13395
13362
|
let x = [];
|
|
13396
|
-
for (const
|
|
13397
|
-
t(
|
|
13398
|
-
for (const
|
|
13399
|
-
x.push(
|
|
13363
|
+
for (const _ of l) {
|
|
13364
|
+
t(_.mode.modeBits, 4, x), t(_.numChars, _.mode.numCharCountBits(g), x);
|
|
13365
|
+
for (const v of _.getData())
|
|
13366
|
+
x.push(v);
|
|
13400
13367
|
}
|
|
13401
13368
|
i(x.length == m);
|
|
13402
|
-
const
|
|
13403
|
-
i(x.length <=
|
|
13404
|
-
for (let
|
|
13405
|
-
t(
|
|
13369
|
+
const b = Ne.getNumDataCodewords(g, u) * 8;
|
|
13370
|
+
i(x.length <= b), t(0, Math.min(4, b - x.length), x), t(0, (8 - x.length % 8) % 8, x), i(x.length % 8 == 0);
|
|
13371
|
+
for (let _ = 236; x.length < b; _ ^= 253)
|
|
13372
|
+
t(_, 8, x);
|
|
13406
13373
|
let y = [];
|
|
13407
13374
|
for (; y.length * 8 < x.length; )
|
|
13408
13375
|
y.push(0);
|
|
13409
|
-
return x.forEach((
|
|
13376
|
+
return x.forEach((_, v) => y[v >>> 3] |= _ << 7 - (v & 7)), new Ne(g, u, y, f);
|
|
13410
13377
|
}
|
|
13411
13378
|
/*-- Accessor methods --*/
|
|
13412
13379
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
@@ -13496,17 +13463,17 @@ var zr;
|
|
|
13496
13463
|
throw new RangeError("Invalid argument");
|
|
13497
13464
|
const d = Ne.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][u], f = Ne.ECC_CODEWORDS_PER_BLOCK[c.ordinal][u], p = Math.floor(Ne.getNumRawDataModules(u) / 8), g = d - p % d, m = Math.floor(p / d);
|
|
13498
13465
|
let x = [];
|
|
13499
|
-
const
|
|
13500
|
-
for (let
|
|
13501
|
-
let E = l.slice(
|
|
13502
|
-
|
|
13503
|
-
const C = Ne.reedSolomonComputeRemainder(E,
|
|
13504
|
-
|
|
13466
|
+
const b = Ne.reedSolomonComputeDivisor(f);
|
|
13467
|
+
for (let _ = 0, v = 0; _ < d; _++) {
|
|
13468
|
+
let E = l.slice(v, v + m - f + (_ < g ? 0 : 1));
|
|
13469
|
+
v += E.length;
|
|
13470
|
+
const C = Ne.reedSolomonComputeRemainder(E, b);
|
|
13471
|
+
_ < g && E.push(0), x.push(E.concat(C));
|
|
13505
13472
|
}
|
|
13506
13473
|
let y = [];
|
|
13507
|
-
for (let
|
|
13508
|
-
x.forEach((
|
|
13509
|
-
(
|
|
13474
|
+
for (let _ = 0; _ < x[0].length; _++)
|
|
13475
|
+
x.forEach((v, E) => {
|
|
13476
|
+
(_ != m - f || E >= g) && y.push(v[_]);
|
|
13510
13477
|
});
|
|
13511
13478
|
return i(y.length == p), y;
|
|
13512
13479
|
}
|
|
@@ -13897,8 +13864,8 @@ function Jp(r, e, t, n) {
|
|
|
13897
13864
|
const i = r.length + t * 2, s = Math.floor(e * Xp), o = i / e, a = (n.width || s) * o, l = (n.height || s) * o, u = n.x == null ? r.length / 2 - a / 2 : n.x * o, c = n.y == null ? r.length / 2 - l / 2 : n.y * o, d = n.opacity == null ? 1 : n.opacity;
|
|
13898
13865
|
let f = null;
|
|
13899
13866
|
if (n.excavate) {
|
|
13900
|
-
let g = Math.floor(u), m = Math.floor(c), x = Math.ceil(a + u - g),
|
|
13901
|
-
f = { x: g, y: m, w: x, h:
|
|
13867
|
+
let g = Math.floor(u), m = Math.floor(c), x = Math.ceil(a + u - g), b = Math.ceil(l + c - m);
|
|
13868
|
+
f = { x: g, y: m, w: x, h: b };
|
|
13902
13869
|
}
|
|
13903
13870
|
const p = n.crossOrigin;
|
|
13904
13871
|
return { x: u, y: c, h: l, w: a, excavation: f, opacity: d, crossOrigin: p };
|
|
@@ -13981,12 +13948,12 @@ var eg = function() {
|
|
|
13981
13948
|
"boostLevel",
|
|
13982
13949
|
"marginSize",
|
|
13983
13950
|
"imageSettings"
|
|
13984
|
-
]), { style: x } = m,
|
|
13951
|
+
]), { style: x } = m, b = Do(m, ["style"]), y = p == null ? void 0 : p.src, _ = Le.useRef(null), v = Le.useRef(null), E = Le.useCallback(
|
|
13985
13952
|
(D) => {
|
|
13986
|
-
|
|
13953
|
+
_.current = D, typeof t == "function" ? t(D) : t && (t.current = D);
|
|
13987
13954
|
},
|
|
13988
13955
|
[t]
|
|
13989
|
-
), [C,
|
|
13956
|
+
), [C, w] = Le.useState(!1), { margin: S, cells: F, numCells: T, calculatedImageSettings: A } = Uc({
|
|
13990
13957
|
value: i,
|
|
13991
13958
|
level: o,
|
|
13992
13959
|
minVersion: c,
|
|
@@ -13997,12 +13964,12 @@ var eg = function() {
|
|
|
13997
13964
|
size: s
|
|
13998
13965
|
});
|
|
13999
13966
|
Le.useEffect(() => {
|
|
14000
|
-
if (
|
|
14001
|
-
const D =
|
|
13967
|
+
if (_.current != null) {
|
|
13968
|
+
const D = _.current, B = D.getContext("2d");
|
|
14002
13969
|
if (!B)
|
|
14003
13970
|
return;
|
|
14004
13971
|
let M = F;
|
|
14005
|
-
const
|
|
13972
|
+
const O = v.current, V = A != null && O !== null && O.complete && O.naturalHeight !== 0 && O.naturalWidth !== 0;
|
|
14006
13973
|
V && A.excavation != null && (M = qc(
|
|
14007
13974
|
F,
|
|
14008
13975
|
A.excavation
|
|
@@ -14015,7 +13982,7 @@ var eg = function() {
|
|
|
14015
13982
|
W && B.fillRect(se + S, J + S, 1, 1);
|
|
14016
13983
|
});
|
|
14017
13984
|
}), A && (B.globalAlpha = A.opacity), V && B.drawImage(
|
|
14018
|
-
|
|
13985
|
+
O,
|
|
14019
13986
|
A.x + S,
|
|
14020
13987
|
A.y + S,
|
|
14021
13988
|
A.w,
|
|
@@ -14023,7 +13990,7 @@ var eg = function() {
|
|
|
14023
13990
|
);
|
|
14024
13991
|
}
|
|
14025
13992
|
}), Le.useEffect(() => {
|
|
14026
|
-
|
|
13993
|
+
w(!1);
|
|
14027
13994
|
}, [y]);
|
|
14028
13995
|
const N = Co({ height: s, width: s }, x);
|
|
14029
13996
|
let R = null;
|
|
@@ -14034,9 +14001,9 @@ var eg = function() {
|
|
|
14034
14001
|
key: y,
|
|
14035
14002
|
style: { display: "none" },
|
|
14036
14003
|
onLoad: () => {
|
|
14037
|
-
|
|
14004
|
+
w(!0);
|
|
14038
14005
|
},
|
|
14039
|
-
ref:
|
|
14006
|
+
ref: v,
|
|
14040
14007
|
crossOrigin: A == null ? void 0 : A.crossOrigin
|
|
14041
14008
|
}
|
|
14042
14009
|
)), /* @__PURE__ */ Le.createElement(Le.Fragment, null, /* @__PURE__ */ Le.createElement(
|
|
@@ -14047,7 +14014,7 @@ var eg = function() {
|
|
|
14047
14014
|
width: s,
|
|
14048
14015
|
ref: E,
|
|
14049
14016
|
role: "img"
|
|
14050
|
-
},
|
|
14017
|
+
}, b)
|
|
14051
14018
|
), R);
|
|
14052
14019
|
}
|
|
14053
14020
|
);
|
|
@@ -14078,7 +14045,7 @@ var Wc = Le.forwardRef(
|
|
|
14078
14045
|
"title",
|
|
14079
14046
|
"marginSize",
|
|
14080
14047
|
"imageSettings"
|
|
14081
|
-
]), { margin: x, cells:
|
|
14048
|
+
]), { margin: x, cells: b, numCells: y, calculatedImageSettings: _ } = Uc({
|
|
14082
14049
|
value: i,
|
|
14083
14050
|
level: o,
|
|
14084
14051
|
minVersion: c,
|
|
@@ -14088,24 +14055,24 @@ var Wc = Le.forwardRef(
|
|
|
14088
14055
|
imageSettings: g,
|
|
14089
14056
|
size: s
|
|
14090
14057
|
});
|
|
14091
|
-
let
|
|
14092
|
-
g != null &&
|
|
14093
|
-
|
|
14094
|
-
|
|
14058
|
+
let v = b, E = null;
|
|
14059
|
+
g != null && _ != null && (_.excavation != null && (v = qc(
|
|
14060
|
+
b,
|
|
14061
|
+
_.excavation
|
|
14095
14062
|
)), E = /* @__PURE__ */ Le.createElement(
|
|
14096
14063
|
"image",
|
|
14097
14064
|
{
|
|
14098
14065
|
href: g.src,
|
|
14099
|
-
height:
|
|
14100
|
-
width:
|
|
14101
|
-
x:
|
|
14102
|
-
y:
|
|
14066
|
+
height: _.h,
|
|
14067
|
+
width: _.w,
|
|
14068
|
+
x: _.x + x,
|
|
14069
|
+
y: _.y + x,
|
|
14103
14070
|
preserveAspectRatio: "none",
|
|
14104
|
-
opacity:
|
|
14105
|
-
crossOrigin:
|
|
14071
|
+
opacity: _.opacity,
|
|
14072
|
+
crossOrigin: _.crossOrigin
|
|
14106
14073
|
}
|
|
14107
14074
|
));
|
|
14108
|
-
const C = $c(
|
|
14075
|
+
const C = $c(v, x);
|
|
14109
14076
|
return /* @__PURE__ */ Le.createElement(
|
|
14110
14077
|
"svg",
|
|
14111
14078
|
Co({
|
|
@@ -14242,16 +14209,16 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14242
14209
|
u.dispatchCommand(Ut, "italic");
|
|
14243
14210
|
}, [u]), x = X(() => {
|
|
14244
14211
|
u.dispatchCommand(Ut, "underline");
|
|
14245
|
-
}, [u]),
|
|
14212
|
+
}, [u]), b = X(() => {
|
|
14246
14213
|
u.dispatchCommand(Bc, void 0);
|
|
14247
14214
|
}, [u]), y = X(() => {
|
|
14248
14215
|
u.dispatchCommand(Nc, void 0);
|
|
14249
|
-
}, [u]),
|
|
14216
|
+
}, [u]), _ = X(() => {
|
|
14250
14217
|
u.update(() => {
|
|
14251
|
-
const
|
|
14252
|
-
H(
|
|
14218
|
+
const w = le();
|
|
14219
|
+
H(w) && Oh(w, () => al());
|
|
14253
14220
|
});
|
|
14254
|
-
}, [u]),
|
|
14221
|
+
}, [u]), v = {
|
|
14255
14222
|
display: "flex",
|
|
14256
14223
|
alignItems: "center",
|
|
14257
14224
|
justifyContent: "center",
|
|
@@ -14271,8 +14238,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14271
14238
|
}
|
|
14272
14239
|
`, C = () => {
|
|
14273
14240
|
setTimeout(() => {
|
|
14274
|
-
var
|
|
14275
|
-
(
|
|
14241
|
+
var w;
|
|
14242
|
+
(w = f.current) != null && w.contains(document.activeElement) || d(!1);
|
|
14276
14243
|
}, 150);
|
|
14277
14244
|
};
|
|
14278
14245
|
return /* @__PURE__ */ h.jsxs(
|
|
@@ -14296,7 +14263,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14296
14263
|
className: "mail-editor-toolbar-btn",
|
|
14297
14264
|
onClick: g,
|
|
14298
14265
|
disabled: e,
|
|
14299
|
-
style:
|
|
14266
|
+
style: v,
|
|
14300
14267
|
title: "Bold (Ctrl+B)",
|
|
14301
14268
|
children: "B"
|
|
14302
14269
|
}
|
|
@@ -14308,7 +14275,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14308
14275
|
className: "mail-editor-toolbar-btn",
|
|
14309
14276
|
onClick: m,
|
|
14310
14277
|
disabled: e,
|
|
14311
|
-
style: { ...
|
|
14278
|
+
style: { ...v, fontStyle: "italic" },
|
|
14312
14279
|
title: "Italic (Ctrl+I)",
|
|
14313
14280
|
children: "I"
|
|
14314
14281
|
}
|
|
@@ -14320,7 +14287,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14320
14287
|
className: "mail-editor-toolbar-btn",
|
|
14321
14288
|
onClick: x,
|
|
14322
14289
|
disabled: e,
|
|
14323
|
-
style: { ...
|
|
14290
|
+
style: { ...v, textDecoration: "underline" },
|
|
14324
14291
|
title: "Underline (Ctrl+U)",
|
|
14325
14292
|
children: "U"
|
|
14326
14293
|
}
|
|
@@ -14341,9 +14308,9 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14341
14308
|
{
|
|
14342
14309
|
type: "button",
|
|
14343
14310
|
className: "mail-editor-toolbar-btn",
|
|
14344
|
-
onClick:
|
|
14311
|
+
onClick: b,
|
|
14345
14312
|
disabled: e,
|
|
14346
|
-
style:
|
|
14313
|
+
style: v,
|
|
14347
14314
|
title: "Bullet List",
|
|
14348
14315
|
children: /* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
14349
14316
|
/* @__PURE__ */ h.jsx("circle", { cx: "4", cy: "6", r: "2" }),
|
|
@@ -14362,7 +14329,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14362
14329
|
className: "mail-editor-toolbar-btn",
|
|
14363
14330
|
onClick: y,
|
|
14364
14331
|
disabled: e,
|
|
14365
|
-
style:
|
|
14332
|
+
style: v,
|
|
14366
14333
|
title: "Numbered List",
|
|
14367
14334
|
children: /* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
14368
14335
|
/* @__PURE__ */ h.jsx("text", { x: "2", y: "8", fontSize: "8", fontFamily: "sans-serif", children: "1" }),
|
|
@@ -14390,9 +14357,9 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14390
14357
|
{
|
|
14391
14358
|
type: "button",
|
|
14392
14359
|
className: "mail-editor-toolbar-btn",
|
|
14393
|
-
onClick:
|
|
14360
|
+
onClick: _,
|
|
14394
14361
|
disabled: e,
|
|
14395
|
-
style:
|
|
14362
|
+
style: v,
|
|
14396
14363
|
title: "Quote",
|
|
14397
14364
|
children: /* @__PURE__ */ h.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ h.jsx("path", { d: "M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z" }) })
|
|
14398
14365
|
}
|
|
@@ -14467,8 +14434,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14467
14434
|
alignItems: "center",
|
|
14468
14435
|
gap: "8px"
|
|
14469
14436
|
},
|
|
14470
|
-
onMouseEnter: (
|
|
14471
|
-
onMouseLeave: (
|
|
14437
|
+
onMouseEnter: (w) => w.currentTarget.style.background = "#f3f4f6",
|
|
14438
|
+
onMouseLeave: (w) => w.currentTarget.style.background = "transparent",
|
|
14472
14439
|
children: [
|
|
14473
14440
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#3b82f6" }, children: "format_list_bulleted" }),
|
|
14474
14441
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14497,8 +14464,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14497
14464
|
alignItems: "center",
|
|
14498
14465
|
gap: "8px"
|
|
14499
14466
|
},
|
|
14500
|
-
onMouseEnter: (
|
|
14501
|
-
onMouseLeave: (
|
|
14467
|
+
onMouseEnter: (w) => w.currentTarget.style.background = "#f3f4f6",
|
|
14468
|
+
onMouseLeave: (w) => w.currentTarget.style.background = "transparent",
|
|
14502
14469
|
children: [
|
|
14503
14470
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#22c55e" }, children: "spellcheck" }),
|
|
14504
14471
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14527,8 +14494,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14527
14494
|
alignItems: "center",
|
|
14528
14495
|
gap: "8px"
|
|
14529
14496
|
},
|
|
14530
|
-
onMouseEnter: (
|
|
14531
|
-
onMouseLeave: (
|
|
14497
|
+
onMouseEnter: (w) => w.currentTarget.style.background = "#f3f4f6",
|
|
14498
|
+
onMouseLeave: (w) => w.currentTarget.style.background = "transparent",
|
|
14532
14499
|
children: [
|
|
14533
14500
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#9333ea" }, children: "brush" }),
|
|
14534
14501
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14663,12 +14630,12 @@ function cg({
|
|
|
14663
14630
|
aiProcessingAction: m,
|
|
14664
14631
|
renderAboveToolbar: x
|
|
14665
14632
|
}) {
|
|
14666
|
-
const
|
|
14633
|
+
const b = { ...ig, ...i }, [y, _] = Le.useState(!1), v = Le.useRef(void 0), [E, C] = Le.useState(r), [w, S] = Le.useState(!1), [F, T] = Le.useState(null), A = g ?? w, N = m ?? F;
|
|
14667
14634
|
Le.useEffect(() => {
|
|
14668
|
-
l !== void 0 && l !==
|
|
14635
|
+
l !== void 0 && l !== v.current && (v.current = l, _(!0));
|
|
14669
14636
|
}, [l]);
|
|
14670
14637
|
const R = X(() => {
|
|
14671
|
-
|
|
14638
|
+
_(!1);
|
|
14672
14639
|
}, []), D = (q) => q.replace(/<[^>]*>/g, "").trim(), B = (q) => q.split(`
|
|
14673
14640
|
`).map((J) => `<p>${J || "<br>"}</p>`).join(""), M = async (q) => {
|
|
14674
14641
|
const J = D(E);
|
|
@@ -14678,14 +14645,14 @@ function cg({
|
|
|
14678
14645
|
S(!0), T(q);
|
|
14679
14646
|
try {
|
|
14680
14647
|
const se = await W(J), ce = B(se);
|
|
14681
|
-
C(ce), e == null || e(ce),
|
|
14648
|
+
C(ce), e == null || e(ce), v.current = Date.now(), _(!0);
|
|
14682
14649
|
} catch (se) {
|
|
14683
14650
|
console.error(`AI ${q} failed:`, se);
|
|
14684
14651
|
} finally {
|
|
14685
14652
|
S(!1), T(null);
|
|
14686
14653
|
}
|
|
14687
14654
|
}
|
|
14688
|
-
},
|
|
14655
|
+
}, O = D(E).length > 0, V = {
|
|
14689
14656
|
namespace: "MailEditor",
|
|
14690
14657
|
theme: sg,
|
|
14691
14658
|
onError: (q) => {
|
|
@@ -14723,15 +14690,15 @@ function cg({
|
|
|
14723
14690
|
margin: 4px 0;
|
|
14724
14691
|
}
|
|
14725
14692
|
.mail-editor-link {
|
|
14726
|
-
color: ${
|
|
14693
|
+
color: ${b.primary};
|
|
14727
14694
|
text-decoration: underline;
|
|
14728
14695
|
}
|
|
14729
14696
|
.mail-editor-quote {
|
|
14730
14697
|
margin: 8px 0;
|
|
14731
14698
|
padding: 8px 16px;
|
|
14732
|
-
border-left: 3px solid ${
|
|
14733
|
-
background: ${
|
|
14734
|
-
color: ${
|
|
14699
|
+
border-left: 3px solid ${b.quoteBorder};
|
|
14700
|
+
background: ${b.quoteBackground};
|
|
14701
|
+
color: ${b.textSecondary};
|
|
14735
14702
|
}
|
|
14736
14703
|
.mail-editor-h1 {
|
|
14737
14704
|
font-size: 24px;
|
|
@@ -14754,7 +14721,7 @@ function cg({
|
|
|
14754
14721
|
padding: 16px;
|
|
14755
14722
|
font-size: 14px;
|
|
14756
14723
|
line-height: 1.6;
|
|
14757
|
-
color: ${
|
|
14724
|
+
color: ${b.text};
|
|
14758
14725
|
}
|
|
14759
14726
|
.mail-editor-content:focus {
|
|
14760
14727
|
outline: none;
|
|
@@ -14763,7 +14730,7 @@ function cg({
|
|
|
14763
14730
|
position: absolute;
|
|
14764
14731
|
top: 16px;
|
|
14765
14732
|
left: 16px;
|
|
14766
|
-
color: ${
|
|
14733
|
+
color: ${b.textSecondary};
|
|
14767
14734
|
pointer-events: none;
|
|
14768
14735
|
font-size: 14px;
|
|
14769
14736
|
}
|
|
@@ -14777,9 +14744,9 @@ function cg({
|
|
|
14777
14744
|
{
|
|
14778
14745
|
className: o,
|
|
14779
14746
|
style: {
|
|
14780
|
-
border: `1px solid ${
|
|
14747
|
+
border: `1px solid ${b.border}`,
|
|
14781
14748
|
borderRadius: "8px",
|
|
14782
|
-
background:
|
|
14749
|
+
background: b.background,
|
|
14783
14750
|
overflow: "hidden",
|
|
14784
14751
|
display: "flex",
|
|
14785
14752
|
flexDirection: "column",
|
|
@@ -14793,7 +14760,7 @@ function cg({
|
|
|
14793
14760
|
/* @__PURE__ */ h.jsx(
|
|
14794
14761
|
og,
|
|
14795
14762
|
{
|
|
14796
|
-
theme:
|
|
14763
|
+
theme: b,
|
|
14797
14764
|
disabled: s,
|
|
14798
14765
|
onAiRestructure: d,
|
|
14799
14766
|
onAiProofread: f,
|
|
@@ -14801,7 +14768,7 @@ function cg({
|
|
|
14801
14768
|
aiProcessing: A,
|
|
14802
14769
|
aiProcessingAction: N,
|
|
14803
14770
|
onAiAction: M,
|
|
14804
|
-
hasContent:
|
|
14771
|
+
hasContent: O
|
|
14805
14772
|
}
|
|
14806
14773
|
),
|
|
14807
14774
|
/* @__PURE__ */ h.jsx("div", { style: { position: "relative", flex: 1, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ h.jsx(
|
|
@@ -14818,7 +14785,7 @@ function cg({
|
|
|
14818
14785
|
padding: "16px",
|
|
14819
14786
|
fontSize: "14px",
|
|
14820
14787
|
lineHeight: 1.6,
|
|
14821
|
-
color:
|
|
14788
|
+
color: b.text
|
|
14822
14789
|
}
|
|
14823
14790
|
}
|
|
14824
14791
|
),
|
|
@@ -14846,7 +14813,7 @@ function cg({
|
|
|
14846
14813
|
}
|
|
14847
14814
|
)
|
|
14848
14815
|
] }),
|
|
14849
|
-
n && /* @__PURE__ */ h.jsx(ug, { replyTo: n, theme:
|
|
14816
|
+
n && /* @__PURE__ */ h.jsx(ug, { replyTo: n, theme: b })
|
|
14850
14817
|
]
|
|
14851
14818
|
}
|
|
14852
14819
|
);
|
|
@@ -14888,23 +14855,23 @@ function My({
|
|
|
14888
14855
|
className: g = "",
|
|
14889
14856
|
minHeight: m = "200px",
|
|
14890
14857
|
sendButtonText: x = "Send",
|
|
14891
|
-
hideCancelButton:
|
|
14858
|
+
hideCancelButton: b = !1,
|
|
14892
14859
|
onAiRestructure: y,
|
|
14893
|
-
onAiProofread:
|
|
14894
|
-
onAiRewrite:
|
|
14860
|
+
onAiProofread: _,
|
|
14861
|
+
onAiRewrite: v,
|
|
14895
14862
|
renderAboveToolbar: E
|
|
14896
14863
|
}) {
|
|
14897
|
-
const C = { ...dg, ...c }, [
|
|
14864
|
+
const C = { ...dg, ...c }, [w, S] = I(r), [F, T] = I(""), [A, N] = I(""), [R, D] = I(e), [B, M] = I(t), [O, V] = I([]), [U, re] = I(!1), [q, J] = I(""), [W, se] = I(f), [ce, fe] = I(!1), ge = Le.useRef(void 0);
|
|
14898
14865
|
Le.useEffect(() => {
|
|
14899
|
-
a !== void 0 && a !==
|
|
14866
|
+
a !== void 0 && a !== ge.current && (ge.current = a, M(t), fe(!0));
|
|
14900
14867
|
}, [a, t]);
|
|
14901
14868
|
const Be = (z) => {
|
|
14902
14869
|
M(z), fe(!1), o == null || o(z);
|
|
14903
|
-
}, _e =
|
|
14870
|
+
}, _e = be(null), [Z, Ee] = I(!1), ie = (z) => {
|
|
14904
14871
|
const ae = z.target.files;
|
|
14905
14872
|
if (ae) {
|
|
14906
|
-
const
|
|
14907
|
-
console.log("[MailComposer] Files selected:",
|
|
14873
|
+
const me = Array.from(ae);
|
|
14874
|
+
console.log("[MailComposer] Files selected:", me.map((xe) => ({ name: xe.name, size: xe.size, type: xe.type }))), V((xe) => [...xe, ...me]);
|
|
14908
14875
|
}
|
|
14909
14876
|
_e.current && (_e.current.value = "");
|
|
14910
14877
|
}, Re = (z) => {
|
|
@@ -14914,13 +14881,13 @@ function My({
|
|
|
14914
14881
|
}, ke = (z) => {
|
|
14915
14882
|
if (z.preventDefault(), z.stopPropagation(), Ee(!1), z.dataTransfer.files && z.dataTransfer.files.length > 0) {
|
|
14916
14883
|
const ae = Array.from(z.dataTransfer.files);
|
|
14917
|
-
console.log("[MailComposer] Files dropped:", ae.map((
|
|
14884
|
+
console.log("[MailComposer] Files dropped:", ae.map((me) => ({ name: me.name, size: me.size, type: me.type }))), V((me) => [...me, ...ae]);
|
|
14918
14885
|
} else
|
|
14919
14886
|
console.log("[MailComposer] Drop event but no files:", z.dataTransfer.types);
|
|
14920
14887
|
}, qe = (z) => z.type.startsWith("image/") ? "image" : z.type === "application/pdf" ? "picture_as_pdf" : z.type.includes("spreadsheet") || z.type.includes("excel") ? "table_chart" : z.type.includes("document") || z.type.includes("word") ? "description" : "attach_file", ze = (z) => {
|
|
14921
|
-
V((ae) => ae.filter((
|
|
14888
|
+
V((ae) => ae.filter((me, xe) => xe !== z));
|
|
14922
14889
|
}, He = (z) => z < 1024 ? `${z} B` : z < 1024 * 1024 ? `${(z / 1024).toFixed(1)} KB` : `${(z / (1024 * 1024)).toFixed(1)} MB`, Y = async () => {
|
|
14923
|
-
if (!
|
|
14890
|
+
if (!w.trim()) {
|
|
14924
14891
|
J("Recipient email is required");
|
|
14925
14892
|
return;
|
|
14926
14893
|
}
|
|
@@ -14931,19 +14898,19 @@ function My({
|
|
|
14931
14898
|
re(!0), J("");
|
|
14932
14899
|
try {
|
|
14933
14900
|
const z = await Promise.all(
|
|
14934
|
-
|
|
14935
|
-
const Ge = await
|
|
14901
|
+
O.map(async (xe) => {
|
|
14902
|
+
const Ge = await xe.arrayBuffer(), vt = btoa(
|
|
14936
14903
|
new Uint8Array(Ge).reduce((wt, oe) => wt + String.fromCharCode(oe), "")
|
|
14937
14904
|
);
|
|
14938
14905
|
return {
|
|
14939
|
-
filename:
|
|
14940
|
-
content_type:
|
|
14906
|
+
filename: xe.name,
|
|
14907
|
+
content_type: xe.type || "application/octet-stream",
|
|
14941
14908
|
data: vt,
|
|
14942
|
-
size:
|
|
14909
|
+
size: xe.size
|
|
14943
14910
|
};
|
|
14944
14911
|
})
|
|
14945
|
-
), ae = B.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(),
|
|
14946
|
-
to:
|
|
14912
|
+
), ae = B.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), me = {
|
|
14913
|
+
to: w.trim(),
|
|
14947
14914
|
cc: F.trim() || void 0,
|
|
14948
14915
|
bcc: A.trim() || void 0,
|
|
14949
14916
|
subject: R.trim(),
|
|
@@ -14951,10 +14918,10 @@ function My({
|
|
|
14951
14918
|
attachments: z,
|
|
14952
14919
|
inReplyTo: n == null ? void 0 : n.messageId
|
|
14953
14920
|
};
|
|
14954
|
-
console.log("[MailComposer] Sending email - to:",
|
|
14921
|
+
console.log("[MailComposer] Sending email - to:", me.to, "subject:", me.subject, "attachmentsCount:", me.attachments.length), me.attachments.length > 0 && me.attachments.forEach((xe, Ge) => {
|
|
14955
14922
|
var vt;
|
|
14956
|
-
console.log(`[MailComposer] Attachment ${Ge + 1}:`,
|
|
14957
|
-
}), await i(
|
|
14923
|
+
console.log(`[MailComposer] Attachment ${Ge + 1}:`, xe.filename, "size:", xe.size, "type:", xe.content_type, "data length:", ((vt = xe.data) == null ? void 0 : vt.length) || 0);
|
|
14924
|
+
}), await i(me), S(""), T(""), N(""), D(""), M(""), V([]);
|
|
14958
14925
|
} catch (z) {
|
|
14959
14926
|
J(z instanceof Error ? z.message : "Failed to send email");
|
|
14960
14927
|
} finally {
|
|
@@ -14969,7 +14936,7 @@ function My({
|
|
|
14969
14936
|
background: C.inputBackground,
|
|
14970
14937
|
color: C.text,
|
|
14971
14938
|
outline: "none"
|
|
14972
|
-
},
|
|
14939
|
+
}, ye = {
|
|
14973
14940
|
display: "block",
|
|
14974
14941
|
fontSize: "12px",
|
|
14975
14942
|
fontWeight: 500,
|
|
@@ -15017,12 +14984,12 @@ function My({
|
|
|
15017
14984
|
}
|
|
15018
14985
|
),
|
|
15019
14986
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
15020
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
14987
|
+
/* @__PURE__ */ h.jsx("label", { style: ye, children: "To" }),
|
|
15021
14988
|
/* @__PURE__ */ h.jsx(
|
|
15022
14989
|
"input",
|
|
15023
14990
|
{
|
|
15024
14991
|
type: "email",
|
|
15025
|
-
value:
|
|
14992
|
+
value: w,
|
|
15026
14993
|
onChange: (z) => S(z.target.value),
|
|
15027
14994
|
placeholder: "recipient@example.com",
|
|
15028
14995
|
disabled: d || U,
|
|
@@ -15050,7 +15017,7 @@ function My({
|
|
|
15050
15017
|
),
|
|
15051
15018
|
W && /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
15052
15019
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
15053
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
15020
|
+
/* @__PURE__ */ h.jsx("label", { style: ye, children: "CC" }),
|
|
15054
15021
|
/* @__PURE__ */ h.jsx(
|
|
15055
15022
|
"input",
|
|
15056
15023
|
{
|
|
@@ -15064,7 +15031,7 @@ function My({
|
|
|
15064
15031
|
)
|
|
15065
15032
|
] }),
|
|
15066
15033
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
15067
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
15034
|
+
/* @__PURE__ */ h.jsx("label", { style: ye, children: "BCC" }),
|
|
15068
15035
|
/* @__PURE__ */ h.jsx(
|
|
15069
15036
|
"input",
|
|
15070
15037
|
{
|
|
@@ -15079,7 +15046,7 @@ function My({
|
|
|
15079
15046
|
] })
|
|
15080
15047
|
] }),
|
|
15081
15048
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
15082
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
15049
|
+
/* @__PURE__ */ h.jsx("label", { style: ye, children: "Subject" }),
|
|
15083
15050
|
/* @__PURE__ */ h.jsx(
|
|
15084
15051
|
"input",
|
|
15085
15052
|
{
|
|
@@ -15106,13 +15073,13 @@ function My({
|
|
|
15106
15073
|
insertText: l,
|
|
15107
15074
|
insertTextTrigger: u,
|
|
15108
15075
|
onAiRestructure: y,
|
|
15109
|
-
onAiProofread:
|
|
15110
|
-
onAiRewrite:
|
|
15076
|
+
onAiProofread: _,
|
|
15077
|
+
onAiRewrite: v,
|
|
15111
15078
|
renderAboveToolbar: E
|
|
15112
15079
|
}
|
|
15113
15080
|
) }) }),
|
|
15114
15081
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
15115
|
-
/* @__PURE__ */ h.jsx("label", { style: { ...
|
|
15082
|
+
/* @__PURE__ */ h.jsx("label", { style: { ...ye, marginBottom: "8px" }, children: "Attachments" }),
|
|
15116
15083
|
/* @__PURE__ */ h.jsx(
|
|
15117
15084
|
"input",
|
|
15118
15085
|
{
|
|
@@ -15147,7 +15114,7 @@ function My({
|
|
|
15147
15114
|
justifyContent: "center",
|
|
15148
15115
|
gap: "8px",
|
|
15149
15116
|
transition: "all 0.2s",
|
|
15150
|
-
marginBottom:
|
|
15117
|
+
marginBottom: O.length > 0 ? "12px" : 0
|
|
15151
15118
|
},
|
|
15152
15119
|
children: [
|
|
15153
15120
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "24px" }, children: Z ? "file_download" : "attach_file" }),
|
|
@@ -15155,7 +15122,7 @@ function My({
|
|
|
15155
15122
|
]
|
|
15156
15123
|
}
|
|
15157
15124
|
),
|
|
15158
|
-
|
|
15125
|
+
O.length > 0 && /* @__PURE__ */ h.jsx("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: O.map((z, ae) => /* @__PURE__ */ h.jsxs(
|
|
15159
15126
|
"div",
|
|
15160
15127
|
{
|
|
15161
15128
|
style: {
|
|
@@ -15196,7 +15163,7 @@ function My({
|
|
|
15196
15163
|
)) })
|
|
15197
15164
|
] }),
|
|
15198
15165
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "12px" }, children: [
|
|
15199
|
-
!
|
|
15166
|
+
!b && s && /* @__PURE__ */ h.jsx(
|
|
15200
15167
|
"button",
|
|
15201
15168
|
{
|
|
15202
15169
|
type: "button",
|
|
@@ -15211,8 +15178,8 @@ function My({
|
|
|
15211
15178
|
{
|
|
15212
15179
|
type: "button",
|
|
15213
15180
|
onClick: Y,
|
|
15214
|
-
disabled: d || U || !
|
|
15215
|
-
style: Ke(!0, d || U || !
|
|
15181
|
+
disabled: d || U || !w.trim() || !R.trim(),
|
|
15182
|
+
style: Ke(!0, d || U || !w.trim() || !R.trim()),
|
|
15216
15183
|
children: [
|
|
15217
15184
|
/* @__PURE__ */ h.jsx(
|
|
15218
15185
|
"span",
|
|
@@ -15265,14 +15232,14 @@ function Ry({
|
|
|
15265
15232
|
theme: d = {},
|
|
15266
15233
|
className: f = ""
|
|
15267
15234
|
}) {
|
|
15268
|
-
const p = { ...fg, ...d }, [g, m] =
|
|
15235
|
+
const p = { ...fg, ...d }, [g, m] = I(!1), [x, b] = I(""), y = be(null), _ = be(null);
|
|
15269
15236
|
Te(() => {
|
|
15270
15237
|
function A(N) {
|
|
15271
|
-
y.current && !y.current.contains(N.target) && (m(!1),
|
|
15238
|
+
y.current && !y.current.contains(N.target) && (m(!1), b(""));
|
|
15272
15239
|
}
|
|
15273
15240
|
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
15274
15241
|
}, []);
|
|
15275
|
-
const
|
|
15242
|
+
const v = r.filter(
|
|
15276
15243
|
(A) => {
|
|
15277
15244
|
var N;
|
|
15278
15245
|
return ((N = A.label) == null ? void 0 : N.toLowerCase().includes(x.toLowerCase())) && !e.includes(A.id);
|
|
@@ -15280,18 +15247,18 @@ function Ry({
|
|
|
15280
15247
|
), E = i && x.trim() && !r.some((A) => {
|
|
15281
15248
|
var N;
|
|
15282
15249
|
return ((N = A.label) == null ? void 0 : N.toLowerCase()) === x.toLowerCase();
|
|
15283
|
-
}), C = e.map((A) => r.find((N) => N.id === A)).filter(Boolean),
|
|
15250
|
+
}), C = e.map((A) => r.find((N) => N.id === A)).filter(Boolean), w = X((A) => {
|
|
15284
15251
|
var N;
|
|
15285
|
-
c > 0 && e.length >= c || (t([...e, A]),
|
|
15252
|
+
c > 0 && e.length >= c || (t([...e, A]), b(""), c === 1 ? m(!1) : (N = _.current) == null || N.focus());
|
|
15286
15253
|
}, [e, t, c]), S = X((A) => {
|
|
15287
15254
|
t(e.filter((N) => N !== A));
|
|
15288
15255
|
}, [e, t]), F = X(async () => {
|
|
15289
15256
|
if (!E) return;
|
|
15290
15257
|
const A = await (s == null ? void 0 : s(x.trim()));
|
|
15291
|
-
A &&
|
|
15292
|
-
}, [E, x, s,
|
|
15293
|
-
A.key === "Enter" ? (A.preventDefault(), E ? F() :
|
|
15294
|
-
}, [E,
|
|
15258
|
+
A && w(A.id), b("");
|
|
15259
|
+
}, [E, x, s, w]), T = X((A) => {
|
|
15260
|
+
A.key === "Enter" ? (A.preventDefault(), E ? F() : v.length > 0 && w(v[0].id)) : A.key === "Backspace" && !x && e.length > 0 ? S(e[e.length - 1]) : A.key === "Escape" && (m(!1), b(""));
|
|
15261
|
+
}, [E, v, x, e, F, w, S]);
|
|
15295
15262
|
return /* @__PURE__ */ h.jsxs("div", { ref: y, className: f, style: { position: "relative" }, children: [
|
|
15296
15263
|
l && /* @__PURE__ */ h.jsx(
|
|
15297
15264
|
"label",
|
|
@@ -15364,11 +15331,11 @@ function Ry({
|
|
|
15364
15331
|
/* @__PURE__ */ h.jsx(
|
|
15365
15332
|
"input",
|
|
15366
15333
|
{
|
|
15367
|
-
ref:
|
|
15334
|
+
ref: _,
|
|
15368
15335
|
type: "text",
|
|
15369
15336
|
value: x,
|
|
15370
15337
|
onChange: (A) => {
|
|
15371
|
-
|
|
15338
|
+
b(A.target.value), g || m(!0);
|
|
15372
15339
|
},
|
|
15373
15340
|
onFocus: () => m(!0),
|
|
15374
15341
|
onKeyDown: T,
|
|
@@ -15405,7 +15372,7 @@ function Ry({
|
|
|
15405
15372
|
overflowY: "auto",
|
|
15406
15373
|
zIndex: 50
|
|
15407
15374
|
},
|
|
15408
|
-
children:
|
|
15375
|
+
children: v.length === 0 && !E ? /* @__PURE__ */ h.jsx(
|
|
15409
15376
|
"div",
|
|
15410
15377
|
{
|
|
15411
15378
|
style: {
|
|
@@ -15417,10 +15384,10 @@ function Ry({
|
|
|
15417
15384
|
children: x ? "No matches" : "No options available"
|
|
15418
15385
|
}
|
|
15419
15386
|
) : /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
15420
|
-
|
|
15387
|
+
v.map((A) => /* @__PURE__ */ h.jsxs(
|
|
15421
15388
|
"div",
|
|
15422
15389
|
{
|
|
15423
|
-
onClick: () =>
|
|
15390
|
+
onClick: () => w(A.id),
|
|
15424
15391
|
style: {
|
|
15425
15392
|
padding: "10px 12px",
|
|
15426
15393
|
fontSize: "14px",
|
|
@@ -15476,7 +15443,7 @@ function Ry({
|
|
|
15476
15443
|
fontSize: "14px",
|
|
15477
15444
|
cursor: "pointer",
|
|
15478
15445
|
color: p.primary,
|
|
15479
|
-
borderTop:
|
|
15446
|
+
borderTop: v.length > 0 ? `1px solid ${p.border}` : "none"
|
|
15480
15447
|
},
|
|
15481
15448
|
onMouseEnter: (A) => {
|
|
15482
15449
|
A.currentTarget.style.background = p.hoverBackground || "";
|
|
@@ -15517,7 +15484,7 @@ function jy({
|
|
|
15517
15484
|
className: l = "",
|
|
15518
15485
|
theme: u = {}
|
|
15519
15486
|
}) {
|
|
15520
|
-
const c = { ...hg, ...u }, [d, f] =
|
|
15487
|
+
const c = { ...hg, ...u }, [d, f] = I(""), [p, g] = I(!1), m = be(null), x = be(null), b = ct(() => e && r.find((S) => S.id === e) || null, [e, r]), y = ct(() => {
|
|
15521
15488
|
if (!d.trim()) return r;
|
|
15522
15489
|
const S = d.toLowerCase();
|
|
15523
15490
|
return r.filter(
|
|
@@ -15533,15 +15500,15 @@ function jy({
|
|
|
15533
15500
|
};
|
|
15534
15501
|
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
15535
15502
|
}, []);
|
|
15536
|
-
const
|
|
15503
|
+
const _ = (S) => {
|
|
15537
15504
|
i && i(S), g(!1), f("");
|
|
15538
|
-
},
|
|
15505
|
+
}, v = () => {
|
|
15539
15506
|
o && o(d.trim() || void 0), g(!1), f("");
|
|
15540
15507
|
}, E = () => {
|
|
15541
15508
|
g(!0);
|
|
15542
15509
|
}, C = (S) => {
|
|
15543
15510
|
f(S.target.value), p || g(!0);
|
|
15544
|
-
},
|
|
15511
|
+
}, w = (S) => {
|
|
15545
15512
|
S.key === "Enter" ? (S.preventDefault(), y.length > 0 && i ? (i(y[0]), g(!1), f("")) : o && d.trim() && (o(d.trim()), g(!1), f(""))) : S.key === "Escape" && (g(!1), f(""));
|
|
15546
15513
|
};
|
|
15547
15514
|
return /* @__PURE__ */ h.jsxs(
|
|
@@ -15552,7 +15519,7 @@ function jy({
|
|
|
15552
15519
|
style: { position: "relative", width: "100%" },
|
|
15553
15520
|
children: [
|
|
15554
15521
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
15555
|
-
/* @__PURE__ */ h.jsx("div", { style: { flex: 1, position: "relative" }, children:
|
|
15522
|
+
/* @__PURE__ */ h.jsx("div", { style: { flex: 1, position: "relative" }, children: b && !p ? (
|
|
15556
15523
|
// Show selected value as a chip/tag
|
|
15557
15524
|
/* @__PURE__ */ h.jsxs(
|
|
15558
15525
|
"div",
|
|
@@ -15574,8 +15541,8 @@ function jy({
|
|
|
15574
15541
|
onClick: () => g(!0),
|
|
15575
15542
|
children: [
|
|
15576
15543
|
/* @__PURE__ */ h.jsxs("div", { style: { overflow: "hidden" }, children: [
|
|
15577
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontWeight: 500, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children:
|
|
15578
|
-
|
|
15544
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontWeight: 500, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: b.label }),
|
|
15545
|
+
b.notes && /* @__PURE__ */ h.jsx("div", { style: { fontSize: "11px", color: c.textSecondary, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: b.notes })
|
|
15579
15546
|
] }),
|
|
15580
15547
|
s && /* @__PURE__ */ h.jsx(
|
|
15581
15548
|
"button",
|
|
@@ -15630,7 +15597,7 @@ function jy({
|
|
|
15630
15597
|
value: d,
|
|
15631
15598
|
onChange: C,
|
|
15632
15599
|
onFocus: E,
|
|
15633
|
-
onKeyDown:
|
|
15600
|
+
onKeyDown: w,
|
|
15634
15601
|
placeholder: n,
|
|
15635
15602
|
style: {
|
|
15636
15603
|
width: "100%",
|
|
@@ -15651,7 +15618,7 @@ function jy({
|
|
|
15651
15618
|
o && /* @__PURE__ */ h.jsx(
|
|
15652
15619
|
"button",
|
|
15653
15620
|
{
|
|
15654
|
-
onClick:
|
|
15621
|
+
onClick: v,
|
|
15655
15622
|
style: {
|
|
15656
15623
|
width: "36px",
|
|
15657
15624
|
height: "36px",
|
|
@@ -15700,7 +15667,7 @@ function jy({
|
|
|
15700
15667
|
}, children: d ? `No results for "${d}"` : "No items" }) : y.map((S, F) => /* @__PURE__ */ h.jsxs(
|
|
15701
15668
|
"div",
|
|
15702
15669
|
{
|
|
15703
|
-
onClick: () =>
|
|
15670
|
+
onClick: () => _(S),
|
|
15704
15671
|
style: {
|
|
15705
15672
|
padding: "10px 14px",
|
|
15706
15673
|
cursor: "pointer",
|
|
@@ -15752,27 +15719,27 @@ function Ly({
|
|
|
15752
15719
|
columnClassName: f = "",
|
|
15753
15720
|
itemClassName: p = ""
|
|
15754
15721
|
}) {
|
|
15755
|
-
const [g, m] =
|
|
15722
|
+
const [g, m] = I(null), [x, b] = I(null), [y, _] = I(null), v = be(null), E = e.reduce((N, R) => {
|
|
15756
15723
|
let D = r.filter((B) => n(B) === R.id);
|
|
15757
15724
|
return i && (D = D.sort((B, M) => i(B) - i(M))), N[R.id] = D, N;
|
|
15758
15725
|
}, {}), C = X((N, R) => {
|
|
15759
15726
|
const D = t(R), B = n(R);
|
|
15760
|
-
m(D),
|
|
15727
|
+
m(D), v.current = B, N.dataTransfer.effectAllowed = "move", N.dataTransfer.setData("text/plain", D), requestAnimationFrame(() => {
|
|
15761
15728
|
const M = N.target;
|
|
15762
15729
|
M.style.opacity = "0.5";
|
|
15763
15730
|
});
|
|
15764
|
-
}, [t, n]),
|
|
15731
|
+
}, [t, n]), w = X((N) => {
|
|
15765
15732
|
const R = N.target;
|
|
15766
|
-
R.style.opacity = "1", m(null),
|
|
15733
|
+
R.style.opacity = "1", m(null), b(null), _(null), v.current = null;
|
|
15767
15734
|
}, []), S = X((N, R, D) => {
|
|
15768
|
-
N.preventDefault(), N.dataTransfer.dropEffect = "move",
|
|
15735
|
+
N.preventDefault(), N.dataTransfer.dropEffect = "move", b(R), _(D);
|
|
15769
15736
|
}, []), F = X((N) => {
|
|
15770
15737
|
const R = N.relatedTarget;
|
|
15771
|
-
R != null && R.closest("[data-kanban-column]") || (
|
|
15738
|
+
R != null && R.closest("[data-kanban-column]") || (b(null), _(null));
|
|
15772
15739
|
}, []), T = X((N, R, D) => {
|
|
15773
15740
|
if (N.preventDefault(), !g) return;
|
|
15774
|
-
const B =
|
|
15775
|
-
B === R ? a == null || a(g, R, D) : B && o(g, B, R, D), m(null),
|
|
15741
|
+
const B = v.current;
|
|
15742
|
+
B === R ? a == null || a(g, R, D) : B && o(g, B, R, D), m(null), b(null), _(null), v.current = null;
|
|
15776
15743
|
}, [g, o, a]), A = (N, R) => /* @__PURE__ */ h.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
15777
15744
|
/* @__PURE__ */ h.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15778
15745
|
N.color && /* @__PURE__ */ h.jsx(
|
|
@@ -15799,7 +15766,7 @@ function Ly({
|
|
|
15799
15766
|
"data-kanban-column": N.id,
|
|
15800
15767
|
className: `flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,
|
|
15801
15768
|
onDragOver: (B) => {
|
|
15802
|
-
B.preventDefault(), g && !D &&
|
|
15769
|
+
B.preventDefault(), g && !D && b(N.id);
|
|
15803
15770
|
},
|
|
15804
15771
|
onDragLeave: F,
|
|
15805
15772
|
onDrop: (B) => T(B, N.id, y ?? R.length),
|
|
@@ -15811,7 +15778,7 @@ function Ly({
|
|
|
15811
15778
|
className: `flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${D ? "bg-blue-50" : ""}`,
|
|
15812
15779
|
children: [
|
|
15813
15780
|
R.map((B, M) => {
|
|
15814
|
-
const
|
|
15781
|
+
const O = t(B), V = g === O, U = D && y === M && !V;
|
|
15815
15782
|
return /* @__PURE__ */ h.jsxs("div", { children: [
|
|
15816
15783
|
U && /* @__PURE__ */ h.jsx("div", { className: "h-1 bg-blue-500 rounded-full mb-2 mx-1" }),
|
|
15817
15784
|
/* @__PURE__ */ h.jsx(
|
|
@@ -15819,14 +15786,14 @@ function Ly({
|
|
|
15819
15786
|
{
|
|
15820
15787
|
draggable: !0,
|
|
15821
15788
|
onDragStart: (re) => C(re, B),
|
|
15822
|
-
onDragEnd:
|
|
15789
|
+
onDragEnd: w,
|
|
15823
15790
|
onDragOver: (re) => S(re, N.id, M),
|
|
15824
15791
|
onClick: () => l == null ? void 0 : l(B),
|
|
15825
15792
|
className: `cursor-grab active:cursor-grabbing transition-all ${V ? "opacity-50 scale-95" : ""} ${p}`,
|
|
15826
15793
|
children: s(B, V)
|
|
15827
15794
|
}
|
|
15828
15795
|
)
|
|
15829
|
-
] },
|
|
15796
|
+
] }, O);
|
|
15830
15797
|
}),
|
|
15831
15798
|
/* @__PURE__ */ h.jsx(
|
|
15832
15799
|
"div",
|
|
@@ -15892,34 +15859,34 @@ function Py({
|
|
|
15892
15859
|
className: p = "",
|
|
15893
15860
|
theme: g = {}
|
|
15894
15861
|
}) {
|
|
15895
|
-
const m = { ...pg, ...g }, { allDayItems: x, timedItems:
|
|
15896
|
-
const
|
|
15862
|
+
const m = { ...pg, ...g }, { allDayItems: x, timedItems: b } = ct(() => {
|
|
15863
|
+
const w = [], S = [];
|
|
15897
15864
|
for (const F of r)
|
|
15898
|
-
a(F) ?
|
|
15899
|
-
return { allDayItems:
|
|
15865
|
+
a(F) ? w.push(F) : S.push(F);
|
|
15866
|
+
return { allDayItems: w, timedItems: S };
|
|
15900
15867
|
}, [r, a]), y = ct(() => {
|
|
15901
|
-
const
|
|
15868
|
+
const w = [];
|
|
15902
15869
|
for (let S = t; S <= n; S++)
|
|
15903
|
-
|
|
15904
|
-
return
|
|
15905
|
-
}, [t, n]),
|
|
15906
|
-
(
|
|
15907
|
-
const S = s(
|
|
15870
|
+
w.push(S);
|
|
15871
|
+
return w;
|
|
15872
|
+
}, [t, n]), _ = (n - t + 1) * i, v = X(
|
|
15873
|
+
(w) => {
|
|
15874
|
+
const S = s(w);
|
|
15908
15875
|
if (!S) return null;
|
|
15909
15876
|
const F = gg(S);
|
|
15910
15877
|
if (!F) return null;
|
|
15911
|
-
const { hours: T, minutes: A } = F, N = Math.max(t, Math.min(n, T)), R = T < t ? 0 : A, D = (N - t) * i + R / 60 * i, B = o(
|
|
15878
|
+
const { hours: T, minutes: A } = F, N = Math.max(t, Math.min(n, T)), R = T < t ? 0 : A, D = (N - t) * i + R / 60 * i, B = o(w), M = Math.max(20, B / 60 * i);
|
|
15912
15879
|
return { top: D, height: M };
|
|
15913
15880
|
},
|
|
15914
15881
|
[s, o, t, n, i]
|
|
15915
15882
|
), E = ct(() => {
|
|
15916
15883
|
if (!f || !yg(e)) return null;
|
|
15917
|
-
const
|
|
15884
|
+
const w = /* @__PURE__ */ new Date(), S = w.getHours(), F = w.getMinutes();
|
|
15918
15885
|
return S < t || S > n ? null : (S - t) * i + F / 60 * i;
|
|
15919
15886
|
}, [e, f, t, n, i]), C = X(
|
|
15920
|
-
(
|
|
15887
|
+
(w) => {
|
|
15921
15888
|
if (!d) return;
|
|
15922
|
-
const S =
|
|
15889
|
+
const S = w.currentTarget.getBoundingClientRect(), T = (w.clientY - S.top) / i * 60, A = Math.floor(T / 60) + t, N = Math.round(T % 60 / 15) * 15, R = Math.min(n, Math.max(t, A)), D = N >= 60 ? 0 : N, B = `${R.toString().padStart(2, "0")}:${D.toString().padStart(2, "0")}`;
|
|
15923
15890
|
d(B);
|
|
15924
15891
|
},
|
|
15925
15892
|
[d, i, t, n]
|
|
@@ -15947,20 +15914,20 @@ function Py({
|
|
|
15947
15914
|
children: "All Day"
|
|
15948
15915
|
}
|
|
15949
15916
|
),
|
|
15950
|
-
/* @__PURE__ */ h.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: x.map((
|
|
15917
|
+
/* @__PURE__ */ h.jsx("div", { style: { display: "flex", flexWrap: "wrap", gap: "4px" }, children: x.map((w) => /* @__PURE__ */ h.jsx(
|
|
15951
15918
|
"div",
|
|
15952
15919
|
{
|
|
15953
|
-
onClick: () => c == null ? void 0 : c(
|
|
15920
|
+
onClick: () => c == null ? void 0 : c(w),
|
|
15954
15921
|
style: { cursor: c ? "pointer" : "default" },
|
|
15955
|
-
children: u(
|
|
15922
|
+
children: u(w)
|
|
15956
15923
|
},
|
|
15957
|
-
l(
|
|
15924
|
+
l(w)
|
|
15958
15925
|
)) })
|
|
15959
15926
|
]
|
|
15960
15927
|
}
|
|
15961
15928
|
),
|
|
15962
|
-
/* @__PURE__ */ h.jsxs("div", { style: { position: "relative", height:
|
|
15963
|
-
y.map((
|
|
15929
|
+
/* @__PURE__ */ h.jsxs("div", { style: { position: "relative", height: _ }, children: [
|
|
15930
|
+
y.map((w, S) => /* @__PURE__ */ h.jsxs("div", { style: { position: "absolute", top: S * i, left: 0, right: 0 }, children: [
|
|
15964
15931
|
/* @__PURE__ */ h.jsx(
|
|
15965
15932
|
"div",
|
|
15966
15933
|
{
|
|
@@ -15974,7 +15941,7 @@ function Py({
|
|
|
15974
15941
|
fontSize: "11px",
|
|
15975
15942
|
color: m.hourTextColor
|
|
15976
15943
|
},
|
|
15977
|
-
children: mg(
|
|
15944
|
+
children: mg(w)
|
|
15978
15945
|
}
|
|
15979
15946
|
),
|
|
15980
15947
|
/* @__PURE__ */ h.jsx(
|
|
@@ -16003,7 +15970,7 @@ function Py({
|
|
|
16003
15970
|
}
|
|
16004
15971
|
}
|
|
16005
15972
|
)
|
|
16006
|
-
] },
|
|
15973
|
+
] }, w)),
|
|
16007
15974
|
/* @__PURE__ */ h.jsx(
|
|
16008
15975
|
"div",
|
|
16009
15976
|
{
|
|
@@ -16057,8 +16024,8 @@ function Py({
|
|
|
16057
16024
|
]
|
|
16058
16025
|
}
|
|
16059
16026
|
),
|
|
16060
|
-
|
|
16061
|
-
const S = w
|
|
16027
|
+
b.map((w) => {
|
|
16028
|
+
const S = v(w);
|
|
16062
16029
|
return S ? /* @__PURE__ */ h.jsx(
|
|
16063
16030
|
"div",
|
|
16064
16031
|
{
|
|
@@ -16072,22 +16039,22 @@ function Py({
|
|
|
16072
16039
|
cursor: c ? "pointer" : "default"
|
|
16073
16040
|
},
|
|
16074
16041
|
onClick: (F) => {
|
|
16075
|
-
F.stopPropagation(), c == null || c(
|
|
16042
|
+
F.stopPropagation(), c == null || c(w);
|
|
16076
16043
|
},
|
|
16077
|
-
children: u(
|
|
16044
|
+
children: u(w)
|
|
16078
16045
|
},
|
|
16079
|
-
l(
|
|
16046
|
+
l(w)
|
|
16080
16047
|
) : null;
|
|
16081
16048
|
})
|
|
16082
16049
|
] })
|
|
16083
16050
|
] });
|
|
16084
16051
|
}
|
|
16085
16052
|
function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComplete: n, variant: i = "widget", hideSaveButton: s = !1, maxDuration: o = 180 }) {
|
|
16086
|
-
const a = i === "widget", [l, u] =
|
|
16053
|
+
const a = i === "widget", [l, u] = I("idle"), [c, d] = I(0), [f, p] = I(0), [g, m] = I(!1), [x, b] = I(0), [y, _] = I(null), [v, E] = I(!1), [C, w] = I(null), [S, F] = I(!0), [T, A] = I([]), [N, R] = I({ completed: 0, total: 0 }), D = be(!1), B = be(!0);
|
|
16087
16054
|
Te(() => {
|
|
16088
16055
|
B.current = S;
|
|
16089
16056
|
}, [S]);
|
|
16090
|
-
const M =
|
|
16057
|
+
const M = be(null), O = be(null), V = be(null), U = be(null), re = be(null), q = be([]), J = be(null), W = be(null), se = be(null), ce = be(null), fe = be(!1), ge = be([]), Be = be(null), _e = be(null), Z = be([]), Ee = be([]), ie = be("insert"), Re = be(!1), Se = be(0), ke = be(0), qe = be(0), ze = (ee) => {
|
|
16091
16058
|
const j = Math.floor(ee / 60), ue = Math.floor(ee % 60);
|
|
16092
16059
|
return `${j.toString().padStart(2, "0")}:${ue.toString().padStart(2, "0")}`;
|
|
16093
16060
|
}, He = async (ee) => {
|
|
@@ -16123,12 +16090,12 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16123
16090
|
it[we + j.length + Ue] = lt[ue + Ue];
|
|
16124
16091
|
}
|
|
16125
16092
|
return await G.close(), Ce;
|
|
16126
|
-
},
|
|
16093
|
+
}, ye = X(() => {
|
|
16127
16094
|
const ee = M.current;
|
|
16128
16095
|
if (!ee) return;
|
|
16129
16096
|
const j = ee.getContext("2d");
|
|
16130
16097
|
if (!j) return;
|
|
16131
|
-
const ue = ee.getBoundingClientRect(), he = ue.width, G = ue.height, De =
|
|
16098
|
+
const ue = ee.getBoundingClientRect(), he = ue.width, G = ue.height, De = ge.current, ve = f || c || 1, we = l === "recording" ? c : x;
|
|
16132
16099
|
j.fillStyle = "#2d3b35", j.fillRect(0, 0, he, G);
|
|
16133
16100
|
const Ie = 8, Ve = "rgba(0, 0, 0, 0.4)", Ce = j.createLinearGradient(0, 0, 0, Ie);
|
|
16134
16101
|
Ce.addColorStop(0, Ve), Ce.addColorStop(1, "transparent"), j.fillStyle = Ce, j.fillRect(0, 0, he, Ie);
|
|
@@ -16168,10 +16135,10 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16168
16135
|
he += we * we;
|
|
16169
16136
|
}
|
|
16170
16137
|
const G = Math.sqrt(he / j), De = Math.min(1, G * 3);
|
|
16171
|
-
|
|
16138
|
+
ge.current.push(De), ye(), fe.current && (W.current = requestAnimationFrame(Ke));
|
|
16172
16139
|
}, z = async () => {
|
|
16173
16140
|
try {
|
|
16174
|
-
|
|
16141
|
+
_(null), E(!1), Be.current === null && (ge.current = []);
|
|
16175
16142
|
const ee = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
16176
16143
|
V.current = ee;
|
|
16177
16144
|
const j = new AudioContext();
|
|
@@ -16179,12 +16146,12 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16179
16146
|
const ue = j.createAnalyser();
|
|
16180
16147
|
ue.fftSize = 2048, re.current = ue, j.createMediaStreamSource(ee).connect(ue);
|
|
16181
16148
|
const G = new MediaRecorder(ee);
|
|
16182
|
-
|
|
16149
|
+
O.current = G, q.current = [], G.ondataavailable = (De) => {
|
|
16183
16150
|
De.data.size > 0 && q.current.push(De.data);
|
|
16184
16151
|
}, G.onstop = async () => {
|
|
16185
16152
|
try {
|
|
16186
16153
|
if (fe.current = !1, q.current.length === 0) {
|
|
16187
|
-
|
|
16154
|
+
_("No audio was recorded. Please try again."), u("idle"), ee.getTracks().forEach((Ce) => Ce.stop());
|
|
16188
16155
|
return;
|
|
16189
16156
|
}
|
|
16190
16157
|
const De = new Blob(q.current, { type: "audio/webm" });
|
|
@@ -16197,8 +16164,8 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16197
16164
|
it,
|
|
16198
16165
|
ie.current
|
|
16199
16166
|
);
|
|
16200
|
-
ve = Y(lt), we = lt.length / lt.sampleRate, ie.current === "insert" && (
|
|
16201
|
-
...
|
|
16167
|
+
ve = Y(lt), we = lt.length / lt.sampleRate, ie.current === "insert" && (ge.current = [
|
|
16168
|
+
...ge.current,
|
|
16202
16169
|
...Ee.current
|
|
16203
16170
|
]), Be.current = null, _e.current = null, Z.current = [], Ee.current = [];
|
|
16204
16171
|
} catch {
|
|
@@ -16207,45 +16174,45 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16207
16174
|
else
|
|
16208
16175
|
ve = De, we = Se.current > 0 ? Se.current : 1;
|
|
16209
16176
|
if (ce.current = ve, ee.getTracks().forEach((Ce) => Ce.stop()), B.current && t) {
|
|
16210
|
-
A((Ce) => [...Ce, ve]), R((Ce) => ({ ...Ce, total: Ce.total + 1 })), ce.current = null,
|
|
16177
|
+
A((Ce) => [...Ce, ve]), R((Ce) => ({ ...Ce, total: Ce.total + 1 })), ce.current = null, ge.current = [], b(0), p(0), d(0), u("idle");
|
|
16211
16178
|
return;
|
|
16212
16179
|
}
|
|
16213
16180
|
const Ie = URL.createObjectURL(ve), Ve = new Audio(Ie);
|
|
16214
16181
|
Ve.ontimeupdate = () => {
|
|
16215
|
-
|
|
16182
|
+
b(Ve.currentTime);
|
|
16216
16183
|
}, Ve.onended = () => {
|
|
16217
16184
|
m(!1);
|
|
16218
|
-
}, se.current = Ve, p(we),
|
|
16185
|
+
}, se.current = Ve, p(we), b(we), u("editing");
|
|
16219
16186
|
} catch {
|
|
16220
|
-
|
|
16187
|
+
_("Failed to process recording"), u("idle");
|
|
16221
16188
|
}
|
|
16222
16189
|
}, G.start(100), fe.current = !0, u("recording"), d(0), Se.current = 0, J.current = setInterval(() => {
|
|
16223
|
-
Se.current += 1, d(Se.current), Se.current >= o && (
|
|
16190
|
+
Se.current += 1, d(Se.current), Se.current >= o && (O.current && O.current.state !== "inactive" && O.current.stop(), fe.current = !1, w(null), J.current && (clearInterval(J.current), J.current = null), W.current && (cancelAnimationFrame(W.current), W.current = null), setTimeout(() => {
|
|
16224
16191
|
alert(`Maximum recording time of ${Math.floor(o / 60)} minutes reached.`);
|
|
16225
16192
|
}, 100));
|
|
16226
16193
|
}, 1e3);
|
|
16227
16194
|
} catch {
|
|
16228
|
-
|
|
16195
|
+
_("Could not access microphone. Please allow microphone access.");
|
|
16229
16196
|
}
|
|
16230
16197
|
}, ae = () => {
|
|
16231
|
-
fe.current = !1, E(!1),
|
|
16232
|
-
},
|
|
16198
|
+
fe.current = !1, E(!1), w(null), W.current && (cancelAnimationFrame(W.current), W.current = null), J.current && (clearInterval(J.current), J.current = null), O.current && O.current.state !== "inactive" && O.current.stop();
|
|
16199
|
+
}, me = (ee) => {
|
|
16233
16200
|
const j = M.current;
|
|
16234
16201
|
if (!j) return;
|
|
16235
16202
|
const ue = f || c;
|
|
16236
16203
|
if (ue <= 0) return;
|
|
16237
|
-
const he =
|
|
16204
|
+
const he = ge.current;
|
|
16238
16205
|
if (he.length === 0) return;
|
|
16239
16206
|
const G = j.getBoundingClientRect(), De = ee - ke.current, ve = 4, we = G.width / j.width, Ie = he.length / ue * ve, Ve = -De / (Ie * we), Ce = qe.current + Ve, Ae = Math.max(0, Math.min(Ce, ue));
|
|
16240
|
-
se.current && (se.current.currentTime = Ae),
|
|
16241
|
-
},
|
|
16242
|
-
se.current && (se.current.currentTime = 0),
|
|
16207
|
+
se.current && (se.current.currentTime = Ae), b(Ae);
|
|
16208
|
+
}, xe = () => {
|
|
16209
|
+
se.current && (se.current.currentTime = 0), b(0);
|
|
16243
16210
|
}, Ge = () => {
|
|
16244
16211
|
const ee = f || c;
|
|
16245
|
-
se.current && (se.current.currentTime = ee),
|
|
16212
|
+
se.current && (se.current.currentTime = ee), b(ee);
|
|
16246
16213
|
}, vt = () => {
|
|
16247
16214
|
const ee = se.current;
|
|
16248
|
-
ee && (g ? (ee.pause(),
|
|
16215
|
+
ee && (g ? (ee.pause(), b(ee.currentTime), m(!1)) : (ee.currentTime = x, ee.play().catch(() => {
|
|
16249
16216
|
}), m(!0)));
|
|
16250
16217
|
}, wt = async (ee) => {
|
|
16251
16218
|
if (!ce.current) {
|
|
@@ -16256,13 +16223,13 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16256
16223
|
se.current && (se.current.pause(), m(!1)), ie.current = ee, _e.current = await He(ce.current);
|
|
16257
16224
|
const j = f || c;
|
|
16258
16225
|
Be.current = x;
|
|
16259
|
-
const ue = j > 0 ? x / j : 0, he = Math.floor(ue *
|
|
16260
|
-
Z.current =
|
|
16226
|
+
const ue = j > 0 ? x / j : 0, he = Math.floor(ue * ge.current.length);
|
|
16227
|
+
Z.current = ge.current.slice(0, he), Ee.current = ge.current.slice(he), ge.current = [...Z.current], z();
|
|
16261
16228
|
} catch {
|
|
16262
|
-
|
|
16229
|
+
_("Failed to prepare recording. Please try again.");
|
|
16263
16230
|
}
|
|
16264
16231
|
}, oe = () => {
|
|
16265
|
-
se.current && (se.current.pause(), se.current = null), ce.current = null, _e.current = null, Be.current = null, Z.current = [], m(!1),
|
|
16232
|
+
se.current && (se.current.pause(), se.current = null), ce.current = null, _e.current = null, Be.current = null, Z.current = [], m(!1), b(0), p(0), d(0), z();
|
|
16266
16233
|
}, de = () => {
|
|
16267
16234
|
ce.current ? r(ce.current, f || c) : alert("No audio recorded yet!");
|
|
16268
16235
|
};
|
|
@@ -16327,7 +16294,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16327
16294
|
if (he) {
|
|
16328
16295
|
const G = he.getContext("2d");
|
|
16329
16296
|
if (G) {
|
|
16330
|
-
const De = he.getBoundingClientRect(), ve = De.width, we = De.height, Ie =
|
|
16297
|
+
const De = he.getBoundingClientRect(), ve = De.width, we = De.height, Ie = ge.current, Ve = f || c || 1, Ce = ue.currentTime;
|
|
16331
16298
|
G.fillStyle = "#2d3b35", G.fillRect(0, 0, ve, we);
|
|
16332
16299
|
const Ae = 8, it = "rgba(0, 0, 0, 0.4)", lt = G.createLinearGradient(0, 0, 0, Ae);
|
|
16333
16300
|
lt.addColorStop(0, it), lt.addColorStop(1, "transparent"), G.fillStyle = lt, G.fillRect(0, 0, ve, Ae);
|
|
@@ -16355,15 +16322,15 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16355
16322
|
return ee = requestAnimationFrame(j), () => cancelAnimationFrame(ee);
|
|
16356
16323
|
}
|
|
16357
16324
|
}, [l, g, f, c]), Te(() => {
|
|
16358
|
-
l === "editing" && !g &&
|
|
16359
|
-
}, [l, x, g,
|
|
16325
|
+
l === "editing" && !g && ye();
|
|
16326
|
+
}, [l, x, g, ye]), y)
|
|
16360
16327
|
return /* @__PURE__ */ h.jsxs("div", { style: { border: "1px solid #fecaca", borderRadius: "12px", padding: "16px", background: "#fef2f2" }, children: [
|
|
16361
16328
|
/* @__PURE__ */ h.jsx("p", { style: { fontSize: "14px", color: "#dc2626", marginBottom: "12px" }, children: y }),
|
|
16362
16329
|
/* @__PURE__ */ h.jsx(
|
|
16363
16330
|
"button",
|
|
16364
16331
|
{
|
|
16365
16332
|
onClick: () => {
|
|
16366
|
-
|
|
16333
|
+
_(null), z();
|
|
16367
16334
|
},
|
|
16368
16335
|
style: { padding: "8px 16px", fontSize: "14px", background: "#171717", color: "white", borderRadius: "8px", border: "none", cursor: "pointer" },
|
|
16369
16336
|
children: "Try Again"
|
|
@@ -16395,7 +16362,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16395
16362
|
if (l === "editing") {
|
|
16396
16363
|
Re.current = !0, ke.current = ee.clientX, qe.current = x;
|
|
16397
16364
|
const j = (he) => {
|
|
16398
|
-
Re.current &&
|
|
16365
|
+
Re.current && me(he.clientX);
|
|
16399
16366
|
}, ue = () => {
|
|
16400
16367
|
Re.current = !1, window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", ue);
|
|
16401
16368
|
};
|
|
@@ -16422,7 +16389,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16422
16389
|
/* @__PURE__ */ h.jsx(
|
|
16423
16390
|
"button",
|
|
16424
16391
|
{
|
|
16425
|
-
onClick:
|
|
16392
|
+
onClick: xe,
|
|
16426
16393
|
disabled: l === "idle" || l === "recording",
|
|
16427
16394
|
style: l === "idle" || l === "recording" ? rt : tt,
|
|
16428
16395
|
title: "Go to start",
|
|
@@ -16434,15 +16401,15 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16434
16401
|
{
|
|
16435
16402
|
onClick: () => {
|
|
16436
16403
|
if (l === "recording") {
|
|
16437
|
-
const ee =
|
|
16404
|
+
const ee = O.current;
|
|
16438
16405
|
ee && (ee.state === "recording" ? (ee.pause(), E(!0)) : ee.state === "paused" && (ee.resume(), E(!1)));
|
|
16439
16406
|
} else
|
|
16440
16407
|
vt();
|
|
16441
16408
|
},
|
|
16442
16409
|
disabled: l === "idle",
|
|
16443
16410
|
style: l === "idle" ? rt : tt,
|
|
16444
|
-
title: g || l === "recording" && !
|
|
16445
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !
|
|
16411
|
+
title: g || l === "recording" && !v ? "Pause" : "Play",
|
|
16412
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !v ? "pause" : "play_arrow" })
|
|
16446
16413
|
}
|
|
16447
16414
|
),
|
|
16448
16415
|
/* @__PURE__ */ h.jsx(
|
|
@@ -16460,7 +16427,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16460
16427
|
"button",
|
|
16461
16428
|
{
|
|
16462
16429
|
onClick: () => {
|
|
16463
|
-
C === "insert" ? ae() : l === "idle" ? (
|
|
16430
|
+
C === "insert" ? ae() : l === "idle" ? (w("insert"), z()) : l === "editing" && (w("insert"), wt("insert"));
|
|
16464
16431
|
},
|
|
16465
16432
|
disabled: l === "recording" && C !== "insert" || g,
|
|
16466
16433
|
style: l === "recording" && C !== "insert" || g ? rt : tt,
|
|
@@ -16472,10 +16439,10 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16472
16439
|
"button",
|
|
16473
16440
|
{
|
|
16474
16441
|
onClick: () => {
|
|
16475
|
-
B.current || (C === "mic" ? ae() : l === "idle" ? (
|
|
16442
|
+
B.current || (C === "mic" ? ae() : l === "idle" ? (w("mic"), z()) : l === "editing" && (w("mic"), wt("replace")));
|
|
16476
16443
|
},
|
|
16477
16444
|
onMouseDown: () => {
|
|
16478
|
-
B.current && l === "idle" && !g && (
|
|
16445
|
+
B.current && l === "idle" && !g && (w("mic"), z());
|
|
16479
16446
|
},
|
|
16480
16447
|
onMouseUp: () => {
|
|
16481
16448
|
B.current && l === "recording" && C === "mic" && ae();
|
|
@@ -16484,7 +16451,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16484
16451
|
B.current && l === "recording" && C === "mic" && ae();
|
|
16485
16452
|
},
|
|
16486
16453
|
onTouchStart: () => {
|
|
16487
|
-
B.current && l === "idle" && !g && (
|
|
16454
|
+
B.current && l === "idle" && !g && (w("mic"), z());
|
|
16488
16455
|
},
|
|
16489
16456
|
onTouchEnd: () => {
|
|
16490
16457
|
B.current && l === "recording" && C === "mic" && ae();
|
|
@@ -16499,7 +16466,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16499
16466
|
"button",
|
|
16500
16467
|
{
|
|
16501
16468
|
onClick: () => {
|
|
16502
|
-
C === "startover" ? ae() : l === "editing" && (
|
|
16469
|
+
C === "startover" ? ae() : l === "editing" && (w("startover"), oe());
|
|
16503
16470
|
},
|
|
16504
16471
|
disabled: l === "idle" || l === "recording" && C !== "startover" || g,
|
|
16505
16472
|
style: l === "idle" || l === "recording" && C !== "startover" || g ? rt : tt,
|
|
@@ -16606,7 +16573,7 @@ function Iy({
|
|
|
16606
16573
|
className: o = "",
|
|
16607
16574
|
rows: a
|
|
16608
16575
|
}) {
|
|
16609
|
-
const [l, u] =
|
|
16576
|
+
const [l, u] = I(!1), [c, d] = I(null), [f, p] = I(!1), g = be(null), m = (y) => {
|
|
16610
16577
|
t(e ? `${e}
|
|
16611
16578
|
|
|
16612
16579
|
${y}` : y);
|
|
@@ -16614,15 +16581,15 @@ ${y}` : y);
|
|
|
16614
16581
|
if (!(!e.trim() || l || !i)) {
|
|
16615
16582
|
u(!0), d(y), p(!1);
|
|
16616
16583
|
try {
|
|
16617
|
-
const
|
|
16618
|
-
t(
|
|
16619
|
-
} catch (
|
|
16620
|
-
console.error(`${y} failed:`,
|
|
16584
|
+
const _ = await i(y, e);
|
|
16585
|
+
t(_);
|
|
16586
|
+
} catch (_) {
|
|
16587
|
+
console.error(`${y} failed:`, _);
|
|
16621
16588
|
} finally {
|
|
16622
16589
|
u(!1), d(null);
|
|
16623
16590
|
}
|
|
16624
16591
|
}
|
|
16625
|
-
},
|
|
16592
|
+
}, b = () => {
|
|
16626
16593
|
setTimeout(() => {
|
|
16627
16594
|
var y;
|
|
16628
16595
|
(y = g.current) != null && y.contains(document.activeElement) || p(!1);
|
|
@@ -16677,7 +16644,7 @@ ${y}` : y);
|
|
|
16677
16644
|
"div",
|
|
16678
16645
|
{
|
|
16679
16646
|
className: "absolute right-0 top-full mt-1 bg-white border border-neutral-200 rounded-lg shadow-lg z-50 min-w-[180px] py-1",
|
|
16680
|
-
onBlur:
|
|
16647
|
+
onBlur: b,
|
|
16681
16648
|
children: [
|
|
16682
16649
|
/* @__PURE__ */ h.jsxs(
|
|
16683
16650
|
"button",
|
|
@@ -16761,7 +16728,7 @@ function Oy({
|
|
|
16761
16728
|
outputQuality: s = 0.9,
|
|
16762
16729
|
theme: o = "dark"
|
|
16763
16730
|
}) {
|
|
16764
|
-
const a =
|
|
16731
|
+
const a = be(null), l = be(null), u = be(null), [c, d] = I(!0), [f, p] = I(null), [g, m] = I(n), [x, b] = I(0), [y, _] = I({ x: 0, y: 0, width: 100, height: 100 }), [v, E] = I(!1), [C, w] = I(null), [S, F] = I({ x: 0, y: 0 }), [T, A] = I({ x: 0, y: 0, width: 100, height: 100 }), N = o === "dark", R = X(() => {
|
|
16765
16732
|
const Z = u.current;
|
|
16766
16733
|
return Z ? x === 90 || x === 270 ? { width: Z.height, height: Z.width } : { width: Z.width, height: Z.height } : { width: 100, height: 100 };
|
|
16767
16734
|
}, [x]), D = X((Z, Ee) => {
|
|
@@ -16784,14 +16751,14 @@ function Oy({
|
|
|
16784
16751
|
const B = X(() => {
|
|
16785
16752
|
const { width: Z, height: Ee } = R(), ie = vi[g];
|
|
16786
16753
|
if (ie === null) {
|
|
16787
|
-
|
|
16754
|
+
_({ x: 0, y: 0, width: 100, height: 100 });
|
|
16788
16755
|
return;
|
|
16789
16756
|
}
|
|
16790
16757
|
const Re = Z / Ee;
|
|
16791
16758
|
let Se, ke;
|
|
16792
16759
|
Re > ie ? (ke = 100, Se = ie / Re * 100) : (Se = 100, ke = Re / ie * 100);
|
|
16793
16760
|
const qe = (100 - Se) / 2, ze = (100 - ke) / 2;
|
|
16794
|
-
|
|
16761
|
+
_({ x: qe, y: ze, width: Se, height: ke });
|
|
16795
16762
|
}, [g, R]);
|
|
16796
16763
|
Te(() => {
|
|
16797
16764
|
u.current && B();
|
|
@@ -16805,16 +16772,16 @@ function Oy({
|
|
|
16805
16772
|
const Se = Re.clientWidth, ke = Re.clientHeight - 140, { width: qe, height: ze } = R(), He = qe / ze;
|
|
16806
16773
|
let Y, L;
|
|
16807
16774
|
Se / ke > He ? (L = Math.min(ke, ze), Y = L * He) : (Y = Math.min(Se, qe), L = Y / He), Y > Se && (Y = Se, L = Y / He), L > ke && (L = ke, Y = L * He), Z.width = Y, Z.height = L, ie.clearRect(0, 0, Y, L), ie.save(), ie.translate(Y / 2, L / 2), ie.rotate(x * Math.PI / 180);
|
|
16808
|
-
let
|
|
16809
|
-
x === 90 || x === 270 ? (
|
|
16810
|
-
const z = y.x / 100 * Y, ae = y.y / 100 * L,
|
|
16811
|
-
ie.fillRect(0, 0, Y, ae), ie.fillRect(0, ae +
|
|
16775
|
+
let ye, Ke;
|
|
16776
|
+
x === 90 || x === 270 ? (ye = L, Ke = Y) : (ye = Y, Ke = L), ie.drawImage(Ee, -ye / 2, -Ke / 2, ye, Ke), ie.restore(), ie.fillStyle = "rgba(0, 0, 0, 0.6)";
|
|
16777
|
+
const z = y.x / 100 * Y, ae = y.y / 100 * L, me = y.width / 100 * Y, xe = y.height / 100 * L;
|
|
16778
|
+
ie.fillRect(0, 0, Y, ae), ie.fillRect(0, ae + xe, Y, L - ae - xe), ie.fillRect(0, ae, z, xe), ie.fillRect(z + me, ae, Y - z - me, xe), ie.strokeStyle = "#fff", ie.lineWidth = 2, ie.strokeRect(z, ae, me, xe), ie.strokeStyle = "rgba(255, 255, 255, 0.3)", ie.lineWidth = 1, ie.beginPath(), ie.moveTo(z + me / 3, ae), ie.lineTo(z + me / 3, ae + xe), ie.moveTo(z + me * 2 / 3, ae), ie.lineTo(z + me * 2 / 3, ae + xe), ie.moveTo(z, ae + xe / 3), ie.lineTo(z + me, ae + xe / 3), ie.moveTo(z, ae + xe * 2 / 3), ie.lineTo(z + me, ae + xe * 2 / 3), ie.stroke();
|
|
16812
16779
|
const Ge = 14;
|
|
16813
16780
|
ie.fillStyle = "#fff", ie.strokeStyle = "#333", ie.lineWidth = 1, [
|
|
16814
16781
|
{ x: z, y: ae },
|
|
16815
|
-
{ x: z +
|
|
16816
|
-
{ x: z, y: ae +
|
|
16817
|
-
{ x: z +
|
|
16782
|
+
{ x: z + me, y: ae },
|
|
16783
|
+
{ x: z, y: ae + xe },
|
|
16784
|
+
{ x: z + me, y: ae + xe }
|
|
16818
16785
|
].forEach((wt) => {
|
|
16819
16786
|
ie.fillRect(wt.x - Ge / 2, wt.y - Ge / 2, Ge, Ge), ie.strokeRect(wt.x - Ge / 2, wt.y - Ge / 2, Ge, Ge);
|
|
16820
16787
|
});
|
|
@@ -16830,52 +16797,52 @@ function Oy({
|
|
|
16830
16797
|
];
|
|
16831
16798
|
for (const ze of qe)
|
|
16832
16799
|
if (Math.abs(Re - ze.x) < ke && Math.abs(Se - ze.y) < ke) {
|
|
16833
|
-
|
|
16800
|
+
w(ze.name), F({ x: Re, y: Se }), A({ ...y });
|
|
16834
16801
|
return;
|
|
16835
16802
|
}
|
|
16836
16803
|
Re >= y.x && Re <= y.x + y.width && Se >= y.y && Se <= y.y + y.height && (E(!0), F({ x: Re, y: Se }), A({ ...y }));
|
|
16837
|
-
},
|
|
16804
|
+
}, O = (Z) => {
|
|
16838
16805
|
const Ee = l.current;
|
|
16839
16806
|
if (!Ee) return;
|
|
16840
16807
|
const ie = Ee.getBoundingClientRect(), Re = (Z.clientX - ie.left) / ie.width * 100, Se = (Z.clientY - ie.top) / ie.height * 100;
|
|
16841
|
-
if (
|
|
16808
|
+
if (v) {
|
|
16842
16809
|
const ke = Re - S.x, qe = Se - S.y;
|
|
16843
16810
|
let ze = T.x + ke, He = T.y + qe;
|
|
16844
|
-
ze = Math.max(0, Math.min(ze, 100 - T.width)), He = Math.max(0, Math.min(He, 100 - T.height)),
|
|
16811
|
+
ze = Math.max(0, Math.min(ze, 100 - T.width)), He = Math.max(0, Math.min(He, 100 - T.height)), _({ ...T, x: ze, y: He });
|
|
16845
16812
|
} else if (C) {
|
|
16846
16813
|
const ke = vi[g], { width: qe, height: ze } = R(), He = qe / ze, Y = ke ? ke / He : null;
|
|
16847
16814
|
let L = { ...T };
|
|
16848
|
-
const
|
|
16815
|
+
const ye = Re - S.x, Ke = Se - S.y;
|
|
16849
16816
|
if (C === "se")
|
|
16850
|
-
L.width = Math.max(10, Math.min(100 - L.x, T.width +
|
|
16817
|
+
L.width = Math.max(10, Math.min(100 - L.x, T.width + ye)), Y ? (L.height = L.width / Y, L.y + L.height > 100 && (L.height = 100 - L.y, L.width = L.height * Y)) : L.height = Math.max(10, Math.min(100 - L.y, T.height + Ke));
|
|
16851
16818
|
else if (C === "sw") {
|
|
16852
|
-
const z = -
|
|
16853
|
-
|
|
16819
|
+
const z = -ye, ae = Math.max(10, T.width + z), me = T.x + T.width - ae;
|
|
16820
|
+
me >= 0 && (L.width = ae, L.x = me, Y ? (L.height = L.width / Y, L.y + L.height > 100 && (L.height = 100 - L.y, L.width = L.height * Y, L.x = T.x + T.width - L.width)) : L.height = Math.max(10, Math.min(100 - L.y, T.height + Ke)));
|
|
16854
16821
|
} else if (C === "ne")
|
|
16855
|
-
if (L.width = Math.max(10, Math.min(100 - L.x, T.width +
|
|
16822
|
+
if (L.width = Math.max(10, Math.min(100 - L.x, T.width + ye)), Y) {
|
|
16856
16823
|
const z = L.width / Y, ae = T.y + T.height - z;
|
|
16857
16824
|
ae >= 0 ? (L.height = z, L.y = ae) : (L.y = 0, L.height = T.y + T.height, L.width = L.height * Y);
|
|
16858
16825
|
} else {
|
|
16859
|
-
const z = -Ke, ae = Math.max(10, T.height + z),
|
|
16860
|
-
|
|
16826
|
+
const z = -Ke, ae = Math.max(10, T.height + z), me = T.y + T.height - ae;
|
|
16827
|
+
me >= 0 && (L.height = ae, L.y = me);
|
|
16861
16828
|
}
|
|
16862
16829
|
else if (C === "nw") {
|
|
16863
|
-
const z = -
|
|
16864
|
-
if (
|
|
16865
|
-
if (L.width = ae, L.x =
|
|
16866
|
-
const
|
|
16867
|
-
Ge >= 0 ? (L.height =
|
|
16830
|
+
const z = -ye, ae = Math.max(10, T.width + z), me = T.x + T.width - ae;
|
|
16831
|
+
if (me >= 0)
|
|
16832
|
+
if (L.width = ae, L.x = me, Y) {
|
|
16833
|
+
const xe = L.width / Y, Ge = T.y + T.height - xe;
|
|
16834
|
+
Ge >= 0 ? (L.height = xe, L.y = Ge) : (L.y = 0, L.height = T.y + T.height, L.width = L.height * Y, L.x = T.x + T.width - L.width);
|
|
16868
16835
|
} else {
|
|
16869
|
-
const
|
|
16836
|
+
const xe = -Ke, Ge = Math.max(10, T.height + xe), vt = T.y + T.height - Ge;
|
|
16870
16837
|
vt >= 0 && (L.height = Ge, L.y = vt);
|
|
16871
16838
|
}
|
|
16872
16839
|
}
|
|
16873
|
-
L.x = Math.max(0, L.x), L.y = Math.max(0, L.y), L.width = Math.min(L.width, 100 - L.x), L.height = Math.min(L.height, 100 - L.y),
|
|
16840
|
+
L.x = Math.max(0, L.x), L.y = Math.max(0, L.y), L.width = Math.min(L.width, 100 - L.x), L.height = Math.min(L.height, 100 - L.y), _(L);
|
|
16874
16841
|
}
|
|
16875
16842
|
}, V = () => {
|
|
16876
|
-
E(!1),
|
|
16843
|
+
E(!1), w(null);
|
|
16877
16844
|
}, U = (Z) => {
|
|
16878
|
-
|
|
16845
|
+
b((Ee) => Z === "right" ? (Ee + 90) % 360 : (Ee - 90 + 360) % 360);
|
|
16879
16846
|
}, re = () => {
|
|
16880
16847
|
const Z = u.current;
|
|
16881
16848
|
if (!Z) return;
|
|
@@ -16884,8 +16851,8 @@ function Oy({
|
|
|
16884
16851
|
ze.width = ke, ze.height = qe;
|
|
16885
16852
|
const Y = document.createElement("canvas"), L = Y.getContext("2d");
|
|
16886
16853
|
L && (Y.width = Ee, Y.height = ie, L.save(), L.translate(Ee / 2, ie / 2), L.rotate(x * Math.PI / 180), L.drawImage(Z, -Z.width / 2, -Z.height / 2, Z.width, Z.height), L.restore(), He.drawImage(Y, Re, Se, ke, qe, 0, 0, ke, qe), ze.toBlob(
|
|
16887
|
-
(
|
|
16888
|
-
|
|
16854
|
+
(ye) => {
|
|
16855
|
+
ye && e(ye);
|
|
16889
16856
|
},
|
|
16890
16857
|
i,
|
|
16891
16858
|
s
|
|
@@ -16930,7 +16897,7 @@ function Oy({
|
|
|
16930
16897
|
...ce,
|
|
16931
16898
|
background: "#E67E22",
|
|
16932
16899
|
color: "#fff"
|
|
16933
|
-
},
|
|
16900
|
+
}, ge = {
|
|
16934
16901
|
...ce,
|
|
16935
16902
|
background: N ? "#333" : "#e5e5e5",
|
|
16936
16903
|
color: N ? "#fff" : "#333"
|
|
@@ -16957,19 +16924,19 @@ function Oy({
|
|
|
16957
16924
|
});
|
|
16958
16925
|
return c ? /* @__PURE__ */ h.jsx("div", { style: { ...q, alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ h.jsx("div", { style: { color: N ? "#aaa" : "#666" }, children: "Loading image..." }) }) : f ? /* @__PURE__ */ h.jsxs("div", { style: { ...q, alignItems: "center", justifyContent: "center" }, children: [
|
|
16959
16926
|
/* @__PURE__ */ h.jsx("div", { style: { color: "#ef4444" }, children: f }),
|
|
16960
|
-
t && /* @__PURE__ */ h.jsx("button", { onClick: t, style: { ...
|
|
16927
|
+
t && /* @__PURE__ */ h.jsx("button", { onClick: t, style: { ...ge, marginTop: "16px" }, children: "Close" })
|
|
16961
16928
|
] }) : /* @__PURE__ */ h.jsxs("div", { ref: a, style: q, children: [
|
|
16962
16929
|
/* @__PURE__ */ h.jsx("div", { style: J, children: /* @__PURE__ */ h.jsx(
|
|
16963
16930
|
"canvas",
|
|
16964
16931
|
{
|
|
16965
16932
|
ref: l,
|
|
16966
16933
|
style: {
|
|
16967
|
-
cursor:
|
|
16934
|
+
cursor: v ? "grabbing" : C ? "nwse-resize" : "grab",
|
|
16968
16935
|
maxWidth: "100%",
|
|
16969
16936
|
maxHeight: "100%"
|
|
16970
16937
|
},
|
|
16971
16938
|
onMouseDown: M,
|
|
16972
|
-
onMouseMove:
|
|
16939
|
+
onMouseMove: O,
|
|
16973
16940
|
onMouseUp: V,
|
|
16974
16941
|
onMouseLeave: V
|
|
16975
16942
|
}
|
|
@@ -16990,7 +16957,7 @@ function Oy({
|
|
|
16990
16957
|
/* @__PURE__ */ h.jsx("button", { onClick: () => U("right"), style: Be, title: "Rotate right", children: /* @__PURE__ */ h.jsx("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ h.jsx("path", { d: "M21.5 2v6h-6M21.34 15.57a10 10 0 1 1-.57-8.38" }) }) })
|
|
16991
16958
|
] }),
|
|
16992
16959
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
16993
|
-
t && /* @__PURE__ */ h.jsx("button", { onClick: t, style:
|
|
16960
|
+
t && /* @__PURE__ */ h.jsx("button", { onClick: t, style: ge, children: "Annuler" }),
|
|
16994
16961
|
/* @__PURE__ */ h.jsx("button", { onClick: re, style: fe, children: "Enregistrer" })
|
|
16995
16962
|
] })
|
|
16996
16963
|
] })
|
|
@@ -17215,12 +17182,12 @@ function Wg(r, e) {
|
|
|
17215
17182
|
var t = e ? qg : $g, n = this._parents, i = this._groups;
|
|
17216
17183
|
typeof r != "function" && (r = zg(r));
|
|
17217
17184
|
for (var s = i.length, o = new Array(s), a = new Array(s), l = new Array(s), u = 0; u < s; ++u) {
|
|
17218
|
-
var c = n[u], d = i[u], f = d.length, p = Hg(r.call(c, c && c.__data__, u, n)), g = p.length, m = a[u] = new Array(g), x = o[u] = new Array(g),
|
|
17219
|
-
t(c, d, m, x,
|
|
17220
|
-
for (var y = 0,
|
|
17221
|
-
if (
|
|
17222
|
-
for (y >=
|
|
17223
|
-
|
|
17185
|
+
var c = n[u], d = i[u], f = d.length, p = Hg(r.call(c, c && c.__data__, u, n)), g = p.length, m = a[u] = new Array(g), x = o[u] = new Array(g), b = l[u] = new Array(f);
|
|
17186
|
+
t(c, d, m, x, b, p, e);
|
|
17187
|
+
for (var y = 0, _ = 0, v, E; y < g; ++y)
|
|
17188
|
+
if (v = m[y]) {
|
|
17189
|
+
for (y >= _ && (_ = y + 1); !(E = x[_]) && ++_ < g; ) ;
|
|
17190
|
+
v._next = E || null;
|
|
17224
17191
|
}
|
|
17225
17192
|
}
|
|
17226
17193
|
return o = new Ft(o, n), o._enter = a, o._exit = l, o;
|
|
@@ -18090,19 +18057,19 @@ function km(r) {
|
|
|
18090
18057
|
}
|
|
18091
18058
|
const Am = function r(e, t, n) {
|
|
18092
18059
|
function i(s, o) {
|
|
18093
|
-
var a = s[0], l = s[1], u = s[2], c = o[0], d = o[1], f = o[2], p = c - a, g = d - l, m = p * p + g * g, x,
|
|
18060
|
+
var a = s[0], l = s[1], u = s[2], c = o[0], d = o[1], f = o[2], p = c - a, g = d - l, m = p * p + g * g, x, b;
|
|
18094
18061
|
if (m < Em)
|
|
18095
|
-
|
|
18062
|
+
b = Math.log(f / u) / e, x = function(w) {
|
|
18096
18063
|
return [
|
|
18097
|
-
a +
|
|
18098
|
-
l +
|
|
18099
|
-
u * Math.exp(e *
|
|
18064
|
+
a + w * p,
|
|
18065
|
+
l + w * g,
|
|
18066
|
+
u * Math.exp(e * w * b)
|
|
18100
18067
|
];
|
|
18101
18068
|
};
|
|
18102
18069
|
else {
|
|
18103
|
-
var y = Math.sqrt(m),
|
|
18104
|
-
|
|
18105
|
-
var S =
|
|
18070
|
+
var y = Math.sqrt(m), _ = (f * f - u * u + n * m) / (2 * u * t * y), v = (f * f - u * u - n * m) / (2 * f * t * y), E = Math.log(Math.sqrt(_ * _ + 1) - _), C = Math.log(Math.sqrt(v * v + 1) - v);
|
|
18071
|
+
b = (C - E) / e, x = function(w) {
|
|
18072
|
+
var S = w * b, F = Xa(E), T = u / (t * y) * (F * km(e * S + E) - Sm(E));
|
|
18106
18073
|
return [
|
|
18107
18074
|
a + T * p,
|
|
18108
18075
|
l + T * g,
|
|
@@ -18110,7 +18077,7 @@ const Am = function r(e, t, n) {
|
|
|
18110
18077
|
];
|
|
18111
18078
|
};
|
|
18112
18079
|
}
|
|
18113
|
-
return x.duration =
|
|
18080
|
+
return x.duration = b * 1e3 * e / Math.SQRT2, x;
|
|
18114
18081
|
}
|
|
18115
18082
|
return i.rho = function(s) {
|
|
18116
18083
|
var o = Math.max(1e-3, +s), a = o * o, l = a * a;
|
|
@@ -18784,74 +18751,74 @@ function H2(r, e, t) {
|
|
|
18784
18751
|
}
|
|
18785
18752
|
function V2() {
|
|
18786
18753
|
var r = $2, e = q2, t = H2, n = U2, i = W2, s = [0, 1 / 0], o = [[-1 / 0, -1 / 0], [1 / 0, 1 / 0]], a = 250, l = Am, u = cl("start", "zoom", "end"), c, d, f, p = 500, g = 150, m = 0, x = 10;
|
|
18787
|
-
function
|
|
18754
|
+
function b(D) {
|
|
18788
18755
|
D.property("__zoom", ru).on("wheel.zoom", S, { passive: !1 }).on("mousedown.zoom", F).on("dblclick.zoom", T).filter(i).on("touchstart.zoom", A).on("touchmove.zoom", N).on("touchend.zoom touchcancel.zoom", R).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
18789
18756
|
}
|
|
18790
|
-
|
|
18757
|
+
b.transform = function(D, B, M, O) {
|
|
18791
18758
|
var V = D.selection ? D.selection() : D;
|
|
18792
|
-
V.property("__zoom", ru), D !== V ? E(D, B, M,
|
|
18793
|
-
C(this, arguments).event(
|
|
18759
|
+
V.property("__zoom", ru), D !== V ? E(D, B, M, O) : V.interrupt().each(function() {
|
|
18760
|
+
C(this, arguments).event(O).start().zoom(null, typeof B == "function" ? B.apply(this, arguments) : B).end();
|
|
18794
18761
|
});
|
|
18795
|
-
},
|
|
18796
|
-
|
|
18762
|
+
}, b.scaleBy = function(D, B, M, O) {
|
|
18763
|
+
b.scaleTo(D, function() {
|
|
18797
18764
|
var V = this.__zoom.k, U = typeof B == "function" ? B.apply(this, arguments) : B;
|
|
18798
18765
|
return V * U;
|
|
18799
|
-
}, M,
|
|
18800
|
-
},
|
|
18801
|
-
|
|
18802
|
-
var V = e.apply(this, arguments), U = this.__zoom, re = M == null ?
|
|
18803
|
-
return t(
|
|
18804
|
-
}, M,
|
|
18805
|
-
},
|
|
18806
|
-
|
|
18766
|
+
}, M, O);
|
|
18767
|
+
}, b.scaleTo = function(D, B, M, O) {
|
|
18768
|
+
b.transform(D, function() {
|
|
18769
|
+
var V = e.apply(this, arguments), U = this.__zoom, re = M == null ? v(V) : typeof M == "function" ? M.apply(this, arguments) : M, q = U.invert(re), J = typeof B == "function" ? B.apply(this, arguments) : B;
|
|
18770
|
+
return t(_(y(U, J), re, q), V, o);
|
|
18771
|
+
}, M, O);
|
|
18772
|
+
}, b.translateBy = function(D, B, M, O) {
|
|
18773
|
+
b.transform(D, function() {
|
|
18807
18774
|
return t(this.__zoom.translate(
|
|
18808
18775
|
typeof B == "function" ? B.apply(this, arguments) : B,
|
|
18809
18776
|
typeof M == "function" ? M.apply(this, arguments) : M
|
|
18810
18777
|
), e.apply(this, arguments), o);
|
|
18811
|
-
}, null,
|
|
18812
|
-
},
|
|
18813
|
-
|
|
18814
|
-
var U = e.apply(this, arguments), re = this.__zoom, q =
|
|
18778
|
+
}, null, O);
|
|
18779
|
+
}, b.translateTo = function(D, B, M, O, V) {
|
|
18780
|
+
b.transform(D, function() {
|
|
18781
|
+
var U = e.apply(this, arguments), re = this.__zoom, q = O == null ? v(U) : typeof O == "function" ? O.apply(this, arguments) : O;
|
|
18815
18782
|
return t(ls.translate(q[0], q[1]).scale(re.k).translate(
|
|
18816
18783
|
typeof B == "function" ? -B.apply(this, arguments) : -B,
|
|
18817
18784
|
typeof M == "function" ? -M.apply(this, arguments) : -M
|
|
18818
18785
|
), U, o);
|
|
18819
|
-
},
|
|
18786
|
+
}, O, V);
|
|
18820
18787
|
};
|
|
18821
18788
|
function y(D, B) {
|
|
18822
18789
|
return B = Math.max(s[0], Math.min(s[1], B)), B === D.k ? D : new ar(B, D.x, D.y);
|
|
18823
18790
|
}
|
|
18824
|
-
function
|
|
18825
|
-
var
|
|
18826
|
-
return
|
|
18791
|
+
function _(D, B, M) {
|
|
18792
|
+
var O = B[0] - M[0] * D.k, V = B[1] - M[1] * D.k;
|
|
18793
|
+
return O === D.x && V === D.y ? D : new ar(D.k, O, V);
|
|
18827
18794
|
}
|
|
18828
|
-
function
|
|
18795
|
+
function v(D) {
|
|
18829
18796
|
return [(+D[0][0] + +D[1][0]) / 2, (+D[0][1] + +D[1][1]) / 2];
|
|
18830
18797
|
}
|
|
18831
|
-
function E(D, B, M,
|
|
18798
|
+
function E(D, B, M, O) {
|
|
18832
18799
|
D.on("start.zoom", function() {
|
|
18833
|
-
C(this, arguments).event(
|
|
18800
|
+
C(this, arguments).event(O).start();
|
|
18834
18801
|
}).on("interrupt.zoom end.zoom", function() {
|
|
18835
|
-
C(this, arguments).event(
|
|
18802
|
+
C(this, arguments).event(O).end();
|
|
18836
18803
|
}).tween("zoom", function() {
|
|
18837
|
-
var V = this, U = arguments, re = C(V, U).event(
|
|
18838
|
-
return function(
|
|
18839
|
-
if (
|
|
18804
|
+
var V = this, U = arguments, re = C(V, U).event(O), q = e.apply(V, U), J = M == null ? v(q) : typeof M == "function" ? M.apply(V, U) : M, W = Math.max(q[1][0] - q[0][0], q[1][1] - q[0][1]), se = V.__zoom, ce = typeof B == "function" ? B.apply(V, U) : B, fe = l(se.invert(J).concat(W / se.k), ce.invert(J).concat(W / ce.k));
|
|
18805
|
+
return function(ge) {
|
|
18806
|
+
if (ge === 1) ge = ce;
|
|
18840
18807
|
else {
|
|
18841
|
-
var Be = fe(
|
|
18842
|
-
|
|
18808
|
+
var Be = fe(ge), _e = W / Be[2];
|
|
18809
|
+
ge = new ar(_e, J[0] - Be[0] * _e, J[1] - Be[1] * _e);
|
|
18843
18810
|
}
|
|
18844
|
-
re.zoom(null,
|
|
18811
|
+
re.zoom(null, ge);
|
|
18845
18812
|
};
|
|
18846
18813
|
});
|
|
18847
18814
|
}
|
|
18848
18815
|
function C(D, B, M) {
|
|
18849
|
-
return !M && D.__zooming || new
|
|
18816
|
+
return !M && D.__zooming || new w(D, B);
|
|
18850
18817
|
}
|
|
18851
|
-
function
|
|
18818
|
+
function w(D, B) {
|
|
18852
18819
|
this.that = D, this.args = B, this.active = 0, this.sourceEvent = null, this.extent = e.apply(D, B), this.taps = 0;
|
|
18853
18820
|
}
|
|
18854
|
-
|
|
18821
|
+
w.prototype = {
|
|
18855
18822
|
event: function(D) {
|
|
18856
18823
|
return D && (this.sourceEvent = D), this;
|
|
18857
18824
|
},
|
|
@@ -18871,7 +18838,7 @@ function V2() {
|
|
|
18871
18838
|
this.that,
|
|
18872
18839
|
new z2(D, {
|
|
18873
18840
|
sourceEvent: this.sourceEvent,
|
|
18874
|
-
target:
|
|
18841
|
+
target: b,
|
|
18875
18842
|
transform: this.that.__zoom,
|
|
18876
18843
|
dispatch: u
|
|
18877
18844
|
}),
|
|
@@ -18881,43 +18848,43 @@ function V2() {
|
|
|
18881
18848
|
};
|
|
18882
18849
|
function S(D, ...B) {
|
|
18883
18850
|
if (!r.apply(this, arguments)) return;
|
|
18884
|
-
var M = C(this, B).event(D),
|
|
18851
|
+
var M = C(this, B).event(D), O = this.__zoom, V = Math.max(s[0], Math.min(s[1], O.k * Math.pow(2, n.apply(this, arguments)))), U = kr(D);
|
|
18885
18852
|
if (M.wheel)
|
|
18886
|
-
(M.mouse[0][0] !== U[0] || M.mouse[0][1] !== U[1]) && (M.mouse[1] =
|
|
18853
|
+
(M.mouse[0][0] !== U[0] || M.mouse[0][1] !== U[1]) && (M.mouse[1] = O.invert(M.mouse[0] = U)), clearTimeout(M.wheel);
|
|
18887
18854
|
else {
|
|
18888
|
-
if (
|
|
18889
|
-
M.mouse = [U,
|
|
18855
|
+
if (O.k === V) return;
|
|
18856
|
+
M.mouse = [U, O.invert(U)], Ni(this), M.start();
|
|
18890
18857
|
}
|
|
18891
|
-
Cn(D), M.wheel = setTimeout(re, g), M.zoom("mouse", t(
|
|
18858
|
+
Cn(D), M.wheel = setTimeout(re, g), M.zoom("mouse", t(_(y(O, V), M.mouse[0], M.mouse[1]), M.extent, o));
|
|
18892
18859
|
function re() {
|
|
18893
18860
|
M.wheel = null, M.end();
|
|
18894
18861
|
}
|
|
18895
18862
|
}
|
|
18896
18863
|
function F(D, ...B) {
|
|
18897
18864
|
if (f || !r.apply(this, arguments)) return;
|
|
18898
|
-
var M = D.currentTarget,
|
|
18899
|
-
tm(D.view), Xs(D),
|
|
18865
|
+
var M = D.currentTarget, O = C(this, B, !0).event(D), V = $t(D.view).on("mousemove.zoom", J, !0).on("mouseup.zoom", W, !0), U = kr(D, M), re = D.clientX, q = D.clientY;
|
|
18866
|
+
tm(D.view), Xs(D), O.mouse = [U, this.__zoom.invert(U)], Ni(this), O.start();
|
|
18900
18867
|
function J(se) {
|
|
18901
|
-
if (Cn(se), !
|
|
18868
|
+
if (Cn(se), !O.moved) {
|
|
18902
18869
|
var ce = se.clientX - re, fe = se.clientY - q;
|
|
18903
|
-
|
|
18870
|
+
O.moved = ce * ce + fe * fe > m;
|
|
18904
18871
|
}
|
|
18905
|
-
|
|
18872
|
+
O.event(se).zoom("mouse", t(_(O.that.__zoom, O.mouse[0] = kr(se, M), O.mouse[1]), O.extent, o));
|
|
18906
18873
|
}
|
|
18907
18874
|
function W(se) {
|
|
18908
|
-
V.on("mousemove.zoom mouseup.zoom", null), rm(se.view,
|
|
18875
|
+
V.on("mousemove.zoom mouseup.zoom", null), rm(se.view, O.moved), Cn(se), O.event(se).end();
|
|
18909
18876
|
}
|
|
18910
18877
|
}
|
|
18911
18878
|
function T(D, ...B) {
|
|
18912
18879
|
if (r.apply(this, arguments)) {
|
|
18913
|
-
var M = this.__zoom,
|
|
18914
|
-
Cn(D), a > 0 ? $t(this).transition().duration(a).call(E, re,
|
|
18880
|
+
var M = this.__zoom, O = kr(D.changedTouches ? D.changedTouches[0] : D, this), V = M.invert(O), U = M.k * (D.shiftKey ? 0.5 : 2), re = t(_(y(M, U), O, V), e.apply(this, B), o);
|
|
18881
|
+
Cn(D), a > 0 ? $t(this).transition().duration(a).call(E, re, O, D) : $t(this).call(b.transform, re, O, D);
|
|
18915
18882
|
}
|
|
18916
18883
|
}
|
|
18917
18884
|
function A(D, ...B) {
|
|
18918
18885
|
if (r.apply(this, arguments)) {
|
|
18919
|
-
var M = D.touches,
|
|
18920
|
-
for (Xs(D), re = 0; re <
|
|
18886
|
+
var M = D.touches, O = M.length, V = C(this, B, D.changedTouches.length === O).event(D), U, re, q, J;
|
|
18887
|
+
for (Xs(D), re = 0; re < O; ++re)
|
|
18921
18888
|
q = M[re], J = kr(q, this), J = [J, this.__zoom.invert(J), q.identifier], V.touch0 ? !V.touch1 && V.touch0[2] !== J[2] && (V.touch1 = J, V.taps = 0) : (V.touch0 = J, U = !0, V.taps = 1 + !!c);
|
|
18922
18889
|
c && (c = clearTimeout(c)), U && (V.taps < 2 && (d = J[0], c = setTimeout(function() {
|
|
18923
18890
|
c = null;
|
|
@@ -18926,24 +18893,24 @@ function V2() {
|
|
|
18926
18893
|
}
|
|
18927
18894
|
function N(D, ...B) {
|
|
18928
18895
|
if (this.__zooming) {
|
|
18929
|
-
var M = C(this, B).event(D),
|
|
18896
|
+
var M = C(this, B).event(D), O = D.changedTouches, V = O.length, U, re, q, J;
|
|
18930
18897
|
for (Cn(D), U = 0; U < V; ++U)
|
|
18931
|
-
re =
|
|
18898
|
+
re = O[U], q = kr(re, this), M.touch0 && M.touch0[2] === re.identifier ? M.touch0[0] = q : M.touch1 && M.touch1[2] === re.identifier && (M.touch1[0] = q);
|
|
18932
18899
|
if (re = M.that.__zoom, M.touch1) {
|
|
18933
|
-
var W = M.touch0[0], se = M.touch0[1], ce = M.touch1[0], fe = M.touch1[1],
|
|
18934
|
-
re = y(re, Math.sqrt(
|
|
18900
|
+
var W = M.touch0[0], se = M.touch0[1], ce = M.touch1[0], fe = M.touch1[1], ge = (ge = ce[0] - W[0]) * ge + (ge = ce[1] - W[1]) * ge, Be = (Be = fe[0] - se[0]) * Be + (Be = fe[1] - se[1]) * Be;
|
|
18901
|
+
re = y(re, Math.sqrt(ge / Be)), q = [(W[0] + ce[0]) / 2, (W[1] + ce[1]) / 2], J = [(se[0] + fe[0]) / 2, (se[1] + fe[1]) / 2];
|
|
18935
18902
|
} else if (M.touch0) q = M.touch0[0], J = M.touch0[1];
|
|
18936
18903
|
else return;
|
|
18937
|
-
M.zoom("touch", t(
|
|
18904
|
+
M.zoom("touch", t(_(re, q, J), M.extent, o));
|
|
18938
18905
|
}
|
|
18939
18906
|
}
|
|
18940
18907
|
function R(D, ...B) {
|
|
18941
18908
|
if (this.__zooming) {
|
|
18942
|
-
var M = C(this, B).event(D),
|
|
18909
|
+
var M = C(this, B).event(D), O = D.changedTouches, V = O.length, U, re;
|
|
18943
18910
|
for (Xs(D), f && clearTimeout(f), f = setTimeout(function() {
|
|
18944
18911
|
f = null;
|
|
18945
18912
|
}, p), U = 0; U < V; ++U)
|
|
18946
|
-
re =
|
|
18913
|
+
re = O[U], M.touch0 && M.touch0[2] === re.identifier ? delete M.touch0 : M.touch1 && M.touch1[2] === re.identifier && delete M.touch1;
|
|
18947
18914
|
if (M.touch1 && !M.touch0 && (M.touch0 = M.touch1, delete M.touch1), M.touch0) M.touch0[1] = this.__zoom.invert(M.touch0[0]);
|
|
18948
18915
|
else if (M.end(), M.taps === 2 && (re = kr(re, this), Math.hypot(d[0] - re[0], d[1] - re[1]) < x)) {
|
|
18949
18916
|
var q = $t(this).on("dblclick.zoom");
|
|
@@ -18951,32 +18918,32 @@ function V2() {
|
|
|
18951
18918
|
}
|
|
18952
18919
|
}
|
|
18953
18920
|
}
|
|
18954
|
-
return
|
|
18955
|
-
return arguments.length ? (n = typeof D == "function" ? D : Ei(+D),
|
|
18956
|
-
},
|
|
18957
|
-
return arguments.length ? (r = typeof D == "function" ? D : Ei(!!D),
|
|
18958
|
-
},
|
|
18959
|
-
return arguments.length ? (i = typeof D == "function" ? D : Ei(!!D),
|
|
18960
|
-
},
|
|
18961
|
-
return arguments.length ? (e = typeof D == "function" ? D : Ei([[+D[0][0], +D[0][1]], [+D[1][0], +D[1][1]]]),
|
|
18962
|
-
},
|
|
18963
|
-
return arguments.length ? (s[0] = +D[0], s[1] = +D[1],
|
|
18964
|
-
},
|
|
18965
|
-
return arguments.length ? (o[0][0] = +D[0][0], o[1][0] = +D[1][0], o[0][1] = +D[0][1], o[1][1] = +D[1][1],
|
|
18966
|
-
},
|
|
18967
|
-
return arguments.length ? (t = D,
|
|
18968
|
-
},
|
|
18969
|
-
return arguments.length ? (a = +D,
|
|
18970
|
-
},
|
|
18971
|
-
return arguments.length ? (l = D,
|
|
18972
|
-
},
|
|
18921
|
+
return b.wheelDelta = function(D) {
|
|
18922
|
+
return arguments.length ? (n = typeof D == "function" ? D : Ei(+D), b) : n;
|
|
18923
|
+
}, b.filter = function(D) {
|
|
18924
|
+
return arguments.length ? (r = typeof D == "function" ? D : Ei(!!D), b) : r;
|
|
18925
|
+
}, b.touchable = function(D) {
|
|
18926
|
+
return arguments.length ? (i = typeof D == "function" ? D : Ei(!!D), b) : i;
|
|
18927
|
+
}, b.extent = function(D) {
|
|
18928
|
+
return arguments.length ? (e = typeof D == "function" ? D : Ei([[+D[0][0], +D[0][1]], [+D[1][0], +D[1][1]]]), b) : e;
|
|
18929
|
+
}, b.scaleExtent = function(D) {
|
|
18930
|
+
return arguments.length ? (s[0] = +D[0], s[1] = +D[1], b) : [s[0], s[1]];
|
|
18931
|
+
}, b.translateExtent = function(D) {
|
|
18932
|
+
return arguments.length ? (o[0][0] = +D[0][0], o[1][0] = +D[1][0], o[0][1] = +D[0][1], o[1][1] = +D[1][1], b) : [[o[0][0], o[0][1]], [o[1][0], o[1][1]]];
|
|
18933
|
+
}, b.constrain = function(D) {
|
|
18934
|
+
return arguments.length ? (t = D, b) : t;
|
|
18935
|
+
}, b.duration = function(D) {
|
|
18936
|
+
return arguments.length ? (a = +D, b) : a;
|
|
18937
|
+
}, b.interpolate = function(D) {
|
|
18938
|
+
return arguments.length ? (l = D, b) : l;
|
|
18939
|
+
}, b.on = function() {
|
|
18973
18940
|
var D = u.on.apply(u, arguments);
|
|
18974
|
-
return D === u ?
|
|
18975
|
-
},
|
|
18976
|
-
return arguments.length ? (m = (D = +D) * D,
|
|
18977
|
-
},
|
|
18978
|
-
return arguments.length ? (x = +D,
|
|
18979
|
-
},
|
|
18941
|
+
return D === u ? b : D;
|
|
18942
|
+
}, b.clickDistance = function(D) {
|
|
18943
|
+
return arguments.length ? (m = (D = +D) * D, b) : Math.sqrt(m);
|
|
18944
|
+
}, b.tapDistance = function(D) {
|
|
18945
|
+
return arguments.length ? (x = +D, b) : x;
|
|
18946
|
+
}, b;
|
|
18980
18947
|
}
|
|
18981
18948
|
function G2(r = {}) {
|
|
18982
18949
|
const {
|
|
@@ -18986,56 +18953,56 @@ function G2(r = {}) {
|
|
|
18986
18953
|
zoomable: i = !0,
|
|
18987
18954
|
pannable: s = !0,
|
|
18988
18955
|
onTransformChange: o
|
|
18989
|
-
} = r, a =
|
|
18956
|
+
} = r, a = be(null), l = be(), [u, c] = I(
|
|
18990
18957
|
n || { x: 0, y: 0, k: 1 }
|
|
18991
18958
|
);
|
|
18992
18959
|
Te(() => {
|
|
18993
18960
|
if (!a.current) return;
|
|
18994
18961
|
const x = V2().scaleExtent([e, t]).filter((y) => !i && y.type === "wheel" || !s && (y.type === "mousedown" || y.type === "touchstart") ? !1 : y.type === "wheel" ? i : y.type === "mousedown" || y.type === "touchstart" ? y.target.closest("[data-qmap-node]") ? !1 : s : !0).on("zoom", (y) => {
|
|
18995
|
-
const
|
|
18962
|
+
const _ = {
|
|
18996
18963
|
x: y.transform.x,
|
|
18997
18964
|
y: y.transform.y,
|
|
18998
18965
|
k: y.transform.k
|
|
18999
18966
|
};
|
|
19000
|
-
c(
|
|
18967
|
+
c(_), o == null || o(_);
|
|
19001
18968
|
});
|
|
19002
18969
|
l.current = x;
|
|
19003
|
-
const
|
|
19004
|
-
return
|
|
18970
|
+
const b = $t(a.current);
|
|
18971
|
+
return b.call(x), b.on("dblclick.zoom", null), n && b.call(
|
|
19005
18972
|
x.transform,
|
|
19006
18973
|
ls.translate(n.x, n.y).scale(n.k)
|
|
19007
18974
|
), () => {
|
|
19008
|
-
|
|
18975
|
+
b.on(".zoom", null);
|
|
19009
18976
|
};
|
|
19010
18977
|
}, [e, t, i, s]), Te(() => {
|
|
19011
18978
|
l.current && l.current.on("zoom", (x) => {
|
|
19012
|
-
const
|
|
18979
|
+
const b = {
|
|
19013
18980
|
x: x.transform.x,
|
|
19014
18981
|
y: x.transform.y,
|
|
19015
18982
|
k: x.transform.k
|
|
19016
18983
|
};
|
|
19017
|
-
c(
|
|
18984
|
+
c(b), o == null || o(b);
|
|
19018
18985
|
});
|
|
19019
18986
|
}, [o]);
|
|
19020
|
-
const d = X((x,
|
|
18987
|
+
const d = X((x, b, y, _ = !0) => {
|
|
19021
18988
|
if (!a.current || !l.current) return;
|
|
19022
|
-
const
|
|
19023
|
-
|
|
18989
|
+
const v = $t(a.current), E = ls.translate(x, b).scale(y);
|
|
18990
|
+
v.call(l.current.transform, E);
|
|
19024
18991
|
}, []), f = X(() => {
|
|
19025
18992
|
!a.current || !l.current || $t(a.current).call(l.current.scaleBy, 1.3);
|
|
19026
18993
|
}, []), p = X(() => {
|
|
19027
18994
|
!a.current || !l.current || $t(a.current).call(l.current.scaleBy, 0.7);
|
|
19028
18995
|
}, []), g = X(() => {
|
|
19029
18996
|
d(0, 0, 1, !0);
|
|
19030
|
-
}, [d]), m = X((x,
|
|
18997
|
+
}, [d]), m = X((x, b = 50) => {
|
|
19031
18998
|
if (!a.current || !l.current || x.length === 0) return;
|
|
19032
|
-
const
|
|
19033
|
-
let
|
|
19034
|
-
for (const
|
|
19035
|
-
const V =
|
|
19036
|
-
|
|
18999
|
+
const _ = a.current.getBoundingClientRect();
|
|
19000
|
+
let v = 1 / 0, E = 1 / 0, C = -1 / 0, w = -1 / 0;
|
|
19001
|
+
for (const O of x) {
|
|
19002
|
+
const V = O.width || 200, U = O.height || 100;
|
|
19003
|
+
v = Math.min(v, O.x), E = Math.min(E, O.y), C = Math.max(C, O.x + V), w = Math.max(w, O.y + U);
|
|
19037
19004
|
}
|
|
19038
|
-
const S = C -
|
|
19005
|
+
const S = C - v, F = w - E, T = (_.width - b * 2) / S, A = (_.height - b * 2) / F, N = Math.min(T, A, t), R = (v + C) / 2, D = (E + w) / 2, B = _.width / 2 - R * N, M = _.height / 2 - D * N;
|
|
19039
19006
|
d(B, M, N, !0);
|
|
19040
19007
|
}, [t, d]);
|
|
19041
19008
|
return {
|
|
@@ -19055,51 +19022,51 @@ function K2(r) {
|
|
|
19055
19022
|
onDragMove: n,
|
|
19056
19023
|
onDragEnd: i,
|
|
19057
19024
|
disabled: s = !1
|
|
19058
|
-
} = r, [o, a] =
|
|
19025
|
+
} = r, [o, a] = I(null), [l, u] = I(!1), [c, d] = I({ x: 0, y: 0 }), f = be(null), p = be({ x: 0, y: 0 }), g = be(e);
|
|
19059
19026
|
Te(() => {
|
|
19060
19027
|
g.current = e;
|
|
19061
19028
|
}, [e]);
|
|
19062
|
-
const m = X((
|
|
19029
|
+
const m = X((_, v) => {
|
|
19063
19030
|
const E = g.current;
|
|
19064
19031
|
return {
|
|
19065
|
-
x: (
|
|
19066
|
-
y: (
|
|
19032
|
+
x: (_ - E.x) / E.k,
|
|
19033
|
+
y: (v - E.y) / E.k
|
|
19067
19034
|
};
|
|
19068
|
-
}, []), x = X((
|
|
19035
|
+
}, []), x = X((_, v) => {
|
|
19069
19036
|
if (s) return;
|
|
19070
|
-
|
|
19071
|
-
const E =
|
|
19037
|
+
v.preventDefault(), v.stopPropagation();
|
|
19038
|
+
const E = v.currentTarget, C = parseFloat(E.dataset.x || "0"), w = parseFloat(E.dataset.y || "0");
|
|
19072
19039
|
f.current = {
|
|
19073
|
-
x:
|
|
19074
|
-
y:
|
|
19040
|
+
x: v.clientX,
|
|
19041
|
+
y: v.clientY,
|
|
19075
19042
|
nodeX: C,
|
|
19076
|
-
nodeY:
|
|
19077
|
-
}, p.current = { x: C, y:
|
|
19078
|
-
}, [s, m, t]),
|
|
19043
|
+
nodeY: w
|
|
19044
|
+
}, p.current = { x: C, y: w }, a(_), u(!0), d({ x: 0, y: 0 }), t == null || t(_);
|
|
19045
|
+
}, [s, m, t]), b = X((_) => {
|
|
19079
19046
|
if (!l || !o || !f.current) return;
|
|
19080
|
-
const
|
|
19047
|
+
const v = g.current, E = f.current, C = _.clientX - E.x, w = _.clientY - E.y, S = C / v.k, F = w / v.k, T = E.nodeX + S, A = E.nodeY + F;
|
|
19081
19048
|
p.current = { x: T, y: A }, d({ x: S, y: F }), n == null || n(o, T, A, S, F);
|
|
19082
19049
|
}, [l, o, n]), y = X(() => {
|
|
19083
19050
|
if (!l || !o) return;
|
|
19084
|
-
const
|
|
19085
|
-
i == null || i(o,
|
|
19051
|
+
const _ = p.current;
|
|
19052
|
+
i == null || i(o, _.x, _.y), a(null), u(!1), d({ x: 0, y: 0 }), f.current = null;
|
|
19086
19053
|
}, [l, o, i]);
|
|
19087
19054
|
return Te(() => {
|
|
19088
19055
|
if (!l) return;
|
|
19089
|
-
const
|
|
19090
|
-
|
|
19091
|
-
},
|
|
19056
|
+
const _ = (E) => {
|
|
19057
|
+
b(E);
|
|
19058
|
+
}, v = () => {
|
|
19092
19059
|
y();
|
|
19093
19060
|
};
|
|
19094
|
-
return window.addEventListener("mousemove",
|
|
19095
|
-
window.removeEventListener("mousemove",
|
|
19061
|
+
return window.addEventListener("mousemove", _), window.addEventListener("mouseup", v), () => {
|
|
19062
|
+
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", v);
|
|
19096
19063
|
};
|
|
19097
|
-
}, [l,
|
|
19064
|
+
}, [l, b, y]), {
|
|
19098
19065
|
draggedNodeId: o,
|
|
19099
19066
|
isDragging: l,
|
|
19100
19067
|
dragOffset: c,
|
|
19101
19068
|
startDrag: x,
|
|
19102
|
-
updateDrag:
|
|
19069
|
+
updateDrag: b,
|
|
19103
19070
|
endDrag: y
|
|
19104
19071
|
};
|
|
19105
19072
|
}
|
|
@@ -19110,14 +19077,14 @@ function Y2(r) {
|
|
|
19110
19077
|
disabled: n = !1,
|
|
19111
19078
|
controlledSelectedIds: i,
|
|
19112
19079
|
onSelectionChange: s
|
|
19113
|
-
} = r, [o, a] =
|
|
19080
|
+
} = r, [o, a] = I(/* @__PURE__ */ new Set()), l = i !== void 0, u = l ? new Set(i) : o, c = l ? (T) => {
|
|
19114
19081
|
const A = typeof T == "function" ? T(u) : T;
|
|
19115
19082
|
s == null || s(Array.from(A));
|
|
19116
|
-
} : a, [d, f] =
|
|
19083
|
+
} : a, [d, f] = I(null), [p, g] = I(!1), m = be(null), x = be(e), b = be(t);
|
|
19117
19084
|
Te(() => {
|
|
19118
19085
|
x.current = e;
|
|
19119
19086
|
}, [e]), Te(() => {
|
|
19120
|
-
|
|
19087
|
+
b.current = t;
|
|
19121
19088
|
}, [t]);
|
|
19122
19089
|
const y = X((T, A) => {
|
|
19123
19090
|
const N = x.current;
|
|
@@ -19125,12 +19092,12 @@ function Y2(r) {
|
|
|
19125
19092
|
x: (T - N.x) / N.k,
|
|
19126
19093
|
y: (A - N.y) / N.k
|
|
19127
19094
|
};
|
|
19128
|
-
}, []),
|
|
19129
|
-
const N =
|
|
19095
|
+
}, []), _ = X((T, A) => {
|
|
19096
|
+
const N = b.current.get(T);
|
|
19130
19097
|
if (!N) return !1;
|
|
19131
19098
|
const R = N.width || 200, D = N.height || 100;
|
|
19132
19099
|
return N.x < A.x + A.width && N.x + R > A.x && N.y < A.y + A.height && N.y + D > A.y;
|
|
19133
|
-
}, []),
|
|
19100
|
+
}, []), v = X((T) => {
|
|
19134
19101
|
if (n || T.target.closest("[data-qmap-node]")) return;
|
|
19135
19102
|
T.preventDefault();
|
|
19136
19103
|
const N = y(T.clientX, T.clientY);
|
|
@@ -19150,10 +19117,10 @@ function Y2(r) {
|
|
|
19150
19117
|
};
|
|
19151
19118
|
f(R);
|
|
19152
19119
|
const D = /* @__PURE__ */ new Set();
|
|
19153
|
-
for (const [B] of
|
|
19154
|
-
|
|
19120
|
+
for (const [B] of b.current)
|
|
19121
|
+
_(B, R) && D.add(B);
|
|
19155
19122
|
c(D);
|
|
19156
|
-
}, [p, y,
|
|
19123
|
+
}, [p, y, _]), C = X(() => {
|
|
19157
19124
|
p && (s == null || s(Array.from(u)), g(!1), f(null), m.current = null);
|
|
19158
19125
|
}, [p, u, s]);
|
|
19159
19126
|
Te(() => {
|
|
@@ -19167,13 +19134,13 @@ function Y2(r) {
|
|
|
19167
19134
|
window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", A);
|
|
19168
19135
|
};
|
|
19169
19136
|
}, [p, E, C]);
|
|
19170
|
-
const
|
|
19137
|
+
const w = X((T, A = !1) => {
|
|
19171
19138
|
c((N) => {
|
|
19172
19139
|
const R = new Set(A ? N : []);
|
|
19173
19140
|
return N.has(T) && A ? R.delete(T) : R.add(T), s == null || s(Array.from(R)), R;
|
|
19174
19141
|
});
|
|
19175
19142
|
}, [s]), S = X(() => {
|
|
19176
|
-
const T = new Set(
|
|
19143
|
+
const T = new Set(b.current.keys());
|
|
19177
19144
|
c(T), s == null || s(Array.from(T));
|
|
19178
19145
|
}, [s]), F = X(() => {
|
|
19179
19146
|
c(/* @__PURE__ */ new Set()), s == null || s([]);
|
|
@@ -19183,10 +19150,10 @@ function Y2(r) {
|
|
|
19183
19150
|
setSelectedIds: c,
|
|
19184
19151
|
selectionBox: d,
|
|
19185
19152
|
isSelecting: p,
|
|
19186
|
-
startSelection:
|
|
19153
|
+
startSelection: v,
|
|
19187
19154
|
updateSelection: E,
|
|
19188
19155
|
endSelection: C,
|
|
19189
|
-
toggleSelect:
|
|
19156
|
+
toggleSelect: w,
|
|
19190
19157
|
selectAll: S,
|
|
19191
19158
|
clearSelection: F
|
|
19192
19159
|
};
|
|
@@ -19211,7 +19178,7 @@ const Q2 = as(function({
|
|
|
19211
19178
|
y.stopPropagation(), l == null || l(y);
|
|
19212
19179
|
}, [l]), g = X((y) => {
|
|
19213
19180
|
y.preventDefault(), y.stopPropagation(), u == null || u(y);
|
|
19214
|
-
}, [u]), m = t.width || 200, x = t.height || 100,
|
|
19181
|
+
}, [u]), m = t.width || 200, x = t.height || 100, b = t.rotation || 0;
|
|
19215
19182
|
return /* @__PURE__ */ h.jsx(
|
|
19216
19183
|
"div",
|
|
19217
19184
|
{
|
|
@@ -19224,7 +19191,7 @@ const Q2 = as(function({
|
|
|
19224
19191
|
top: t.y,
|
|
19225
19192
|
width: m,
|
|
19226
19193
|
height: x,
|
|
19227
|
-
transform:
|
|
19194
|
+
transform: b !== 0 ? `rotate(${b}deg)` : void 0,
|
|
19228
19195
|
transformOrigin: "center center",
|
|
19229
19196
|
cursor: s ? i ? "grabbing" : "grab" : "pointer",
|
|
19230
19197
|
userSelect: "none",
|
|
@@ -19345,7 +19312,7 @@ const ey = as(function({
|
|
|
19345
19312
|
width: o,
|
|
19346
19313
|
onClick: a
|
|
19347
19314
|
}) {
|
|
19348
|
-
const [l, u] =
|
|
19315
|
+
const [l, u] = I(!1), c = ct(() => X2(t, n, i), [t, n, i]), d = X((x) => {
|
|
19349
19316
|
x.stopPropagation(), a == null || a(e, x);
|
|
19350
19317
|
}, [e, a]), f = X(() => {
|
|
19351
19318
|
u(!0);
|
|
@@ -19503,13 +19470,13 @@ function Gy({
|
|
|
19503
19470
|
onTransformChange: g,
|
|
19504
19471
|
minZoom: m = uy,
|
|
19505
19472
|
maxZoom: x = cy,
|
|
19506
|
-
initialTransform:
|
|
19473
|
+
initialTransform: b,
|
|
19507
19474
|
defaultEdgeStyle: y = oy,
|
|
19508
|
-
defaultEdgeColor:
|
|
19509
|
-
defaultEdgeWidth:
|
|
19475
|
+
defaultEdgeColor: _ = ly,
|
|
19476
|
+
defaultEdgeWidth: v = ay,
|
|
19510
19477
|
draggable: E = !0,
|
|
19511
19478
|
selectable: C = !0,
|
|
19512
|
-
zoomable:
|
|
19479
|
+
zoomable: w = !0,
|
|
19513
19480
|
pannable: S = !0,
|
|
19514
19481
|
className: F = "",
|
|
19515
19482
|
style: T,
|
|
@@ -19520,18 +19487,18 @@ function Gy({
|
|
|
19520
19487
|
const D = r.data || { positions: {} }, B = D.positions || {}, M = ct(() => {
|
|
19521
19488
|
const Y = /* @__PURE__ */ new Map();
|
|
19522
19489
|
for (const L of e) {
|
|
19523
|
-
const
|
|
19490
|
+
const ye = B[L._id] || { x: 0, y: 0 };
|
|
19524
19491
|
Y.set(L._id, {
|
|
19525
|
-
x:
|
|
19526
|
-
y:
|
|
19527
|
-
width:
|
|
19528
|
-
height:
|
|
19529
|
-
rotation:
|
|
19492
|
+
x: ye.x,
|
|
19493
|
+
y: ye.y,
|
|
19494
|
+
width: ye.width || i,
|
|
19495
|
+
height: ye.height || s,
|
|
19496
|
+
rotation: ye.rotation || 0
|
|
19530
19497
|
});
|
|
19531
19498
|
}
|
|
19532
19499
|
return Y;
|
|
19533
19500
|
}, [e, B, i, s]), {
|
|
19534
|
-
transform:
|
|
19501
|
+
transform: O,
|
|
19535
19502
|
containerRef: V,
|
|
19536
19503
|
// zoomTo - available for programmatic zoom
|
|
19537
19504
|
zoomIn: U,
|
|
@@ -19541,8 +19508,8 @@ function Gy({
|
|
|
19541
19508
|
} = G2({
|
|
19542
19509
|
minZoom: m,
|
|
19543
19510
|
maxZoom: x,
|
|
19544
|
-
initialTransform:
|
|
19545
|
-
zoomable:
|
|
19511
|
+
initialTransform: b || D.transform,
|
|
19512
|
+
zoomable: w,
|
|
19546
19513
|
pannable: S,
|
|
19547
19514
|
onTransformChange: (Y) => {
|
|
19548
19515
|
g == null || g(Y);
|
|
@@ -19552,26 +19519,26 @@ function Gy({
|
|
|
19552
19519
|
};
|
|
19553
19520
|
p == null || p(L);
|
|
19554
19521
|
}
|
|
19555
|
-
}), [W, se] =
|
|
19522
|
+
}), [W, se] = I(/* @__PURE__ */ new Map()), {
|
|
19556
19523
|
draggedNodeId: ce,
|
|
19557
19524
|
// isDragging - available for external use
|
|
19558
19525
|
startDrag: fe
|
|
19559
19526
|
// endDrag - handled internally by hook
|
|
19560
19527
|
} = K2({
|
|
19561
|
-
transform:
|
|
19528
|
+
transform: O,
|
|
19562
19529
|
disabled: !E,
|
|
19563
19530
|
onDragStart: (Y) => {
|
|
19564
19531
|
const L = M.get(Y);
|
|
19565
19532
|
L && se(/* @__PURE__ */ new Map([[Y, { x: L.x, y: L.y }]]));
|
|
19566
19533
|
},
|
|
19567
|
-
onDragMove: (Y, L,
|
|
19568
|
-
se(/* @__PURE__ */ new Map([[Y, { x: L, y:
|
|
19534
|
+
onDragMove: (Y, L, ye) => {
|
|
19535
|
+
se(/* @__PURE__ */ new Map([[Y, { x: L, y: ye }]]));
|
|
19569
19536
|
},
|
|
19570
|
-
onDragEnd: (Y, L,
|
|
19571
|
-
se(/* @__PURE__ */ new Map()), o == null || o(Y, L,
|
|
19537
|
+
onDragEnd: (Y, L, ye) => {
|
|
19538
|
+
se(/* @__PURE__ */ new Map()), o == null || o(Y, L, ye);
|
|
19572
19539
|
}
|
|
19573
19540
|
}), {
|
|
19574
|
-
selectedIds:
|
|
19541
|
+
selectedIds: ge,
|
|
19575
19542
|
selectionBox: Be,
|
|
19576
19543
|
isSelecting: _e,
|
|
19577
19544
|
startSelection: Z,
|
|
@@ -19579,14 +19546,14 @@ function Gy({
|
|
|
19579
19546
|
toggleSelect: Ee,
|
|
19580
19547
|
clearSelection: ie
|
|
19581
19548
|
} = Y2({
|
|
19582
|
-
transform:
|
|
19549
|
+
transform: O,
|
|
19583
19550
|
nodePositions: M,
|
|
19584
19551
|
disabled: !C,
|
|
19585
19552
|
controlledSelectedIds: c,
|
|
19586
19553
|
onSelectionChange: d
|
|
19587
19554
|
}), Re = X((Y) => {
|
|
19588
|
-
const L = M.get(Y) || { x: 0, y: 0, width: i, height: s },
|
|
19589
|
-
return
|
|
19555
|
+
const L = M.get(Y) || { x: 0, y: 0, width: i, height: s }, ye = W.get(Y);
|
|
19556
|
+
return ye ? { ...L, x: ye.x, y: ye.y } : L;
|
|
19590
19557
|
}, [M, W, i, s]), Se = ct(() => {
|
|
19591
19558
|
const Y = /* @__PURE__ */ new Map();
|
|
19592
19559
|
for (const L of M.keys())
|
|
@@ -19628,7 +19595,7 @@ function Gy({
|
|
|
19628
19595
|
style: {
|
|
19629
19596
|
position: "absolute",
|
|
19630
19597
|
transformOrigin: "0 0",
|
|
19631
|
-
transform: `translate(${
|
|
19598
|
+
transform: `translate(${O.x}px, ${O.y}px) scale(${O.k})`,
|
|
19632
19599
|
willChange: "transform"
|
|
19633
19600
|
},
|
|
19634
19601
|
children: [
|
|
@@ -19638,26 +19605,26 @@ function Gy({
|
|
|
19638
19605
|
edges: t,
|
|
19639
19606
|
nodePositions: Se,
|
|
19640
19607
|
defaultStyle: y,
|
|
19641
|
-
defaultColor:
|
|
19642
|
-
defaultWidth:
|
|
19608
|
+
defaultColor: _,
|
|
19609
|
+
defaultWidth: v,
|
|
19643
19610
|
onEdgeClick: f
|
|
19644
19611
|
}
|
|
19645
19612
|
),
|
|
19646
19613
|
e.map((Y) => {
|
|
19647
|
-
const L = Re(Y._id),
|
|
19614
|
+
const L = Re(Y._id), ye = ge.has(Y._id), Ke = ce === Y._id;
|
|
19648
19615
|
return /* @__PURE__ */ h.jsx(
|
|
19649
19616
|
Q2,
|
|
19650
19617
|
{
|
|
19651
19618
|
nodeId: Y._id,
|
|
19652
19619
|
position: L,
|
|
19653
|
-
isSelected:
|
|
19620
|
+
isSelected: ye,
|
|
19654
19621
|
isDragging: Ke,
|
|
19655
19622
|
draggable: E,
|
|
19656
19623
|
onDragStart: fe,
|
|
19657
19624
|
onClick: (z) => ke(Y, z),
|
|
19658
19625
|
onDoubleClick: (z) => l == null ? void 0 : l(Y, z),
|
|
19659
19626
|
onContextMenu: (z) => u == null ? void 0 : u(Y, z),
|
|
19660
|
-
children: n(Y,
|
|
19627
|
+
children: n(Y, ye, L)
|
|
19661
19628
|
},
|
|
19662
19629
|
Y._id
|
|
19663
19630
|
);
|
|
@@ -19669,7 +19636,7 @@ function Gy({
|
|
|
19669
19636
|
ny,
|
|
19670
19637
|
{
|
|
19671
19638
|
box: Be,
|
|
19672
|
-
transform:
|
|
19639
|
+
transform: O
|
|
19673
19640
|
}
|
|
19674
19641
|
),
|
|
19675
19642
|
/* @__PURE__ */ h.jsxs(
|