@qwanyx/stack 0.2.86 → 0.2.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +33 -33
- package/dist/index.esm.js +969 -969
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3630,10 +3630,10 @@ 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 _, w, S, C, v;
|
|
3634
3634
|
const g = d.get(p);
|
|
3635
3635
|
if (!g) return null;
|
|
3636
|
-
const m = ((_ = g.flags) == null ? void 0 : _.some((
|
|
3636
|
+
const m = ((_ = g.flags) == null ? void 0 : _.some((E) => E.includes("Seen"))) || !1, x = ((S = (w = g.envelope) == null ? void 0 : w.from) == null ? void 0 : S.email) || "Unknown", b = ((C = g.envelope) == null ? void 0 : C.subject) || "(No subject)", y = ((v = g.envelope) == null ? void 0 : v.date) || "";
|
|
3637
3637
|
return { uid: p, from: x, subject: b, date: y, seen: m };
|
|
3638
3638
|
}).filter(Boolean);
|
|
3639
3639
|
return {
|
|
@@ -3686,26 +3686,26 @@ class Wd {
|
|
|
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((w) => w.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((w) => ({ filename: w.filename, mimeType: w.mimeType, contentId: w.contentId })));
|
|
3697
3697
|
const c = /* @__PURE__ */ new Map();
|
|
3698
|
-
for (const
|
|
3699
|
-
if (
|
|
3700
|
-
const
|
|
3701
|
-
c.set(
|
|
3698
|
+
for (const w of u.attachments || [])
|
|
3699
|
+
if (w.contentId) {
|
|
3700
|
+
const S = this.contentToBase64(w.content), C = `data:${w.mimeType};base64,${S}`, v = w.contentId.replace(/^<|>$/g, "");
|
|
3701
|
+
c.set(v, C), c.set(`<${v}>`, C);
|
|
3702
3702
|
}
|
|
3703
3703
|
let d = u.html || "";
|
|
3704
|
-
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (
|
|
3705
|
-
const C = c.get(
|
|
3706
|
-
return C ? `src="${C}"` :
|
|
3704
|
+
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (w, S) => {
|
|
3705
|
+
const C = c.get(S) || c.get(`<${S}>`);
|
|
3706
|
+
return C ? `src="${C}"` : w;
|
|
3707
3707
|
}));
|
|
3708
|
-
const f = ((b = o.flags) == null ? void 0 : b.some((
|
|
3708
|
+
const f = ((b = o.flags) == null ? void 0 : b.some((w) => w.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((w) => ({
|
|
3719
|
+
filename: w.filename || "attachment",
|
|
3720
|
+
mimeType: w.mimeType || "application/octet-stream",
|
|
3721
|
+
size: this.getContentSize(w.content)
|
|
3722
3722
|
}))
|
|
3723
3723
|
};
|
|
3724
3724
|
}
|
|
@@ -4441,23 +4441,23 @@ function Gd() {
|
|
|
4441
4441
|
$e.unshift("Warning: " + $), Function.prototype.apply.call(console[k], console, $e);
|
|
4442
4442
|
}
|
|
4443
4443
|
}
|
|
4444
|
-
var
|
|
4445
|
-
|
|
4446
|
-
function
|
|
4447
|
-
return !!(typeof k == "string" || typeof k == "function" || k === n || k === s ||
|
|
4444
|
+
var w = !1, S = !1, C = !1, v = !1, E = !1, N;
|
|
4445
|
+
N = Symbol.for("react.module.reference");
|
|
4446
|
+
function A(k) {
|
|
4447
|
+
return !!(typeof k == "string" || typeof k == "function" || k === n || k === s || E || k === i || k === u || k === c || v || k === p || w || S || 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.
|
|
4451
|
-
k.$$typeof ===
|
|
4451
|
+
k.$$typeof === N || k.getModuleId !== void 0));
|
|
4452
4452
|
}
|
|
4453
|
-
function
|
|
4453
|
+
function T(k, $, te) {
|
|
4454
4454
|
var pe = k.displayName;
|
|
4455
4455
|
if (pe)
|
|
4456
4456
|
return pe;
|
|
4457
4457
|
var je = $.displayName || $.name || "";
|
|
4458
4458
|
return je !== "" ? te + "(" + je + ")" : te;
|
|
4459
4459
|
}
|
|
4460
|
-
function
|
|
4460
|
+
function F(k) {
|
|
4461
4461
|
return k.displayName || "Context";
|
|
4462
4462
|
}
|
|
4463
4463
|
function R(k) {
|
|
@@ -4485,12 +4485,12 @@ function Gd() {
|
|
|
4485
4485
|
switch (k.$$typeof) {
|
|
4486
4486
|
case a:
|
|
4487
4487
|
var $ = k;
|
|
4488
|
-
return
|
|
4488
|
+
return F($) + ".Consumer";
|
|
4489
4489
|
case o:
|
|
4490
4490
|
var te = k;
|
|
4491
|
-
return
|
|
4491
|
+
return F(te._context) + ".Provider";
|
|
4492
4492
|
case l:
|
|
4493
|
-
return
|
|
4493
|
+
return T(k, k.render, "ForwardRef");
|
|
4494
4494
|
case d:
|
|
4495
4495
|
var pe = k.displayName || null;
|
|
4496
4496
|
return pe !== null ? pe : R(k.type) || "Memo";
|
|
@@ -4951,7 +4951,7 @@ Check the top-level render call using <` + te + ">.");
|
|
|
4951
4951
|
var Ue = {};
|
|
4952
4952
|
function pt(k, $, te, pe, je, $e) {
|
|
4953
4953
|
{
|
|
4954
|
-
var Fe =
|
|
4954
|
+
var Fe = A(k);
|
|
4955
4955
|
if (!Fe) {
|
|
4956
4956
|
var Me = "";
|
|
4957
4957
|
(k === void 0 || typeof k == "object" && k !== null && Object.keys(k).length === 0) && (Me += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
@@ -5007,26 +5007,26 @@ 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] = 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 (
|
|
5011
|
-
const C = await d.isAdmin(
|
|
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 (S) => {
|
|
5011
|
+
const C = await d.isAdmin(S);
|
|
5012
5012
|
l(C);
|
|
5013
5013
|
}, [d]), p = X(() => {
|
|
5014
|
-
const
|
|
5015
|
-
|
|
5014
|
+
const S = Tt.getToken(), C = Tt.getUser();
|
|
5015
|
+
S && C ? (o(S), i(C), f(C._id).finally(() => c(!1))) : c(!1);
|
|
5016
5016
|
}, [f]);
|
|
5017
5017
|
Te(() => {
|
|
5018
5018
|
p();
|
|
5019
5019
|
}, [p]);
|
|
5020
|
-
const g = X(async (
|
|
5021
|
-
const
|
|
5022
|
-
return
|
|
5023
|
-
}, [d, f]), m = X(async (
|
|
5024
|
-
const
|
|
5025
|
-
return
|
|
5026
|
-
}, [d, f]), b = X(async (
|
|
5027
|
-
const
|
|
5028
|
-
return
|
|
5029
|
-
}, [d, f]), _ = X(async (
|
|
5020
|
+
const g = X(async (S, C) => {
|
|
5021
|
+
const v = await d.login(S, C);
|
|
5022
|
+
return v.success && v.user && v.token && (o(v.token), i(v.user), await f(v.user._id)), v;
|
|
5023
|
+
}, [d, f]), m = X(async (S, C, v) => d.register(S, C, v), [d]), x = X(async (S, C) => {
|
|
5024
|
+
const v = await d.verifyEmail(S, C);
|
|
5025
|
+
return v.success && v.user && v.token && (o(v.token), i(v.user), await f(v.user._id)), v;
|
|
5026
|
+
}, [d, f]), b = X(async (S) => d.requestPasswordReset(S), [d]), y = X(async (S, C, v) => {
|
|
5027
|
+
const E = await d.setPasswordWithCode(S, C, v);
|
|
5028
|
+
return E.success && E.user && E.token && (o(E.token), i(E.user), await f(E.user._id)), E;
|
|
5029
|
+
}, [d, f]), _ = X(async (S) => d.resendVerificationCode(S), [d]), w = X(() => {
|
|
5030
5030
|
d.logout(), i(null), o(null), l(!1);
|
|
5031
5031
|
}, [d]);
|
|
5032
5032
|
return /* @__PURE__ */ h.jsx(cu.Provider, { value: {
|
|
@@ -5040,7 +5040,7 @@ function by({ apiUrl: r, systemId: e, children: t }) {
|
|
|
5040
5040
|
requestPasswordReset: b,
|
|
5041
5041
|
setPasswordWithCode: y,
|
|
5042
5042
|
resendVerificationCode: _,
|
|
5043
|
-
logout:
|
|
5043
|
+
logout: w,
|
|
5044
5044
|
refreshUser: p
|
|
5045
5045
|
}, children: t });
|
|
5046
5046
|
}
|
|
@@ -5076,12 +5076,12 @@ function du({
|
|
|
5076
5076
|
isModal: c = !1
|
|
5077
5077
|
}) {
|
|
5078
5078
|
const [d, f] = I(""), [p, g] = I(""), [m, x] = I(""), [b, y] = I(!1), _ = { ...Kd, ...l };
|
|
5079
|
-
async function
|
|
5080
|
-
|
|
5081
|
-
const
|
|
5082
|
-
|
|
5079
|
+
async function w(A) {
|
|
5080
|
+
A.preventDefault(), y(!0), x("");
|
|
5081
|
+
const T = await r(d, p);
|
|
5082
|
+
T.success ? e == null || e() : x(T.error || "Connexion impossible"), y(!1);
|
|
5083
5083
|
}
|
|
5084
|
-
const
|
|
5084
|
+
const S = {
|
|
5085
5085
|
backgroundColor: _.backgroundColor,
|
|
5086
5086
|
borderRadius: _.borderRadius,
|
|
5087
5087
|
padding: "1.5rem",
|
|
@@ -5099,13 +5099,13 @@ function du({
|
|
|
5099
5099
|
color: _.textColor,
|
|
5100
5100
|
fontSize: "1rem",
|
|
5101
5101
|
outline: "none"
|
|
5102
|
-
},
|
|
5102
|
+
}, v = {
|
|
5103
5103
|
display: "block",
|
|
5104
5104
|
fontSize: "0.875rem",
|
|
5105
5105
|
fontWeight: 500,
|
|
5106
5106
|
color: _.textMutedColor,
|
|
5107
5107
|
marginBottom: "0.25rem"
|
|
5108
|
-
},
|
|
5108
|
+
}, E = {
|
|
5109
5109
|
width: "100%",
|
|
5110
5110
|
padding: "0.75rem",
|
|
5111
5111
|
backgroundColor: b ? _.textMutedColor : _.primaryColor,
|
|
@@ -5116,14 +5116,14 @@ function du({
|
|
|
5116
5116
|
fontWeight: 500,
|
|
5117
5117
|
cursor: b ? "not-allowed" : "pointer",
|
|
5118
5118
|
transition: "background-color 0.2s"
|
|
5119
|
-
},
|
|
5119
|
+
}, N = {
|
|
5120
5120
|
padding: "0.75rem",
|
|
5121
5121
|
backgroundColor: _.errorBackgroundColor,
|
|
5122
5122
|
border: `1px solid ${_.errorColor}20`,
|
|
5123
5123
|
borderRadius: _.borderRadius,
|
|
5124
5124
|
marginBottom: "1rem"
|
|
5125
5125
|
};
|
|
5126
|
-
return /* @__PURE__ */ h.jsxs("div", { style:
|
|
5126
|
+
return /* @__PURE__ */ h.jsxs("div", { style: S, className: u, children: [
|
|
5127
5127
|
t && /* @__PURE__ */ h.jsx("div", { style: { display: "flex", justifyContent: "center", marginBottom: "1.5rem" }, children: t }),
|
|
5128
5128
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5129
5129
|
fontSize: "1.25rem",
|
|
@@ -5132,42 +5132,42 @@ function du({
|
|
|
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:
|
|
5135
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: w, children: [
|
|
5136
|
+
m && /* @__PURE__ */ h.jsx("div", { style: N, 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: v, children: o }),
|
|
5139
5139
|
/* @__PURE__ */ h.jsx(
|
|
5140
5140
|
"input",
|
|
5141
5141
|
{
|
|
5142
5142
|
type: "email",
|
|
5143
5143
|
value: d,
|
|
5144
|
-
onChange: (
|
|
5144
|
+
onChange: (A) => f(A.target.value),
|
|
5145
5145
|
required: !0,
|
|
5146
5146
|
style: C,
|
|
5147
|
-
onFocus: (
|
|
5148
|
-
|
|
5147
|
+
onFocus: (A) => {
|
|
5148
|
+
A.target.style.borderColor = _.primaryColor, A.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5149
5149
|
},
|
|
5150
|
-
onBlur: (
|
|
5151
|
-
|
|
5150
|
+
onBlur: (A) => {
|
|
5151
|
+
A.target.style.borderColor = _.borderColor, A.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: v, children: a }),
|
|
5158
5158
|
/* @__PURE__ */ h.jsx(
|
|
5159
5159
|
"input",
|
|
5160
5160
|
{
|
|
5161
5161
|
type: "password",
|
|
5162
5162
|
value: p,
|
|
5163
|
-
onChange: (
|
|
5163
|
+
onChange: (A) => g(A.target.value),
|
|
5164
5164
|
required: !0,
|
|
5165
5165
|
style: C,
|
|
5166
|
-
onFocus: (
|
|
5167
|
-
|
|
5166
|
+
onFocus: (A) => {
|
|
5167
|
+
A.target.style.borderColor = _.primaryColor, A.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5168
5168
|
},
|
|
5169
|
-
onBlur: (
|
|
5170
|
-
|
|
5169
|
+
onBlur: (A) => {
|
|
5170
|
+
A.target.style.borderColor = _.borderColor, A.target.style.boxShadow = "none";
|
|
5171
5171
|
}
|
|
5172
5172
|
}
|
|
5173
5173
|
)
|
|
@@ -5177,12 +5177,12 @@ function du({
|
|
|
5177
5177
|
{
|
|
5178
5178
|
type: "submit",
|
|
5179
5179
|
disabled: b,
|
|
5180
|
-
style:
|
|
5181
|
-
onMouseEnter: (
|
|
5182
|
-
b || (
|
|
5180
|
+
style: E,
|
|
5181
|
+
onMouseEnter: (A) => {
|
|
5182
|
+
b || (A.target.style.backgroundColor = _.primaryHoverColor);
|
|
5183
5183
|
},
|
|
5184
|
-
onMouseLeave: (
|
|
5185
|
-
b || (
|
|
5184
|
+
onMouseLeave: (A) => {
|
|
5185
|
+
b || (A.target.style.backgroundColor = _.primaryColor);
|
|
5186
5186
|
},
|
|
5187
5187
|
children: b ? s : i
|
|
5188
5188
|
}
|
|
@@ -5290,19 +5290,19 @@ function Qd({
|
|
|
5290
5290
|
className: m = "",
|
|
5291
5291
|
isModal: x = !1
|
|
5292
5292
|
}) {
|
|
5293
|
-
const [b, y] = I(""), [_,
|
|
5293
|
+
const [b, y] = I(""), [_, w] = I(""), [S, C] = I(""), [v, E] = I(""), [N, A] = I(""), [T, F] = I(""), [R, D] = I(!1), B = { ...Yd, ...g };
|
|
5294
5294
|
async function M(W) {
|
|
5295
|
-
if (W.preventDefault(),
|
|
5296
|
-
|
|
5295
|
+
if (W.preventDefault(), F(""), _ !== S) {
|
|
5296
|
+
F("Les mots de passe ne correspondent pas");
|
|
5297
5297
|
return;
|
|
5298
5298
|
}
|
|
5299
5299
|
if (_.length < 8) {
|
|
5300
|
-
|
|
5300
|
+
F("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(b, _, p ? { firstName:
|
|
5305
|
-
ce.success ? e == null || e(b) :
|
|
5304
|
+
const ce = await r(b, _, p ? { firstName: v, lastName: N } : void 0);
|
|
5305
|
+
ce.success ? e == null || e(b) : F(ce.error || "Erreur lors de l'inscription"), D(!1);
|
|
5306
5306
|
}
|
|
5307
5307
|
const O = {
|
|
5308
5308
|
backgroundColor: B.backgroundColor,
|
|
@@ -5362,7 +5362,7 @@ function Qd({
|
|
|
5362
5362
|
textAlign: n ? "center" : "left"
|
|
5363
5363
|
}, children: i }),
|
|
5364
5364
|
/* @__PURE__ */ h.jsxs("form", { onSubmit: M, children: [
|
|
5365
|
-
|
|
5365
|
+
T && /* @__PURE__ */ h.jsx("div", { style: q, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: B.errorColor, margin: 0 }, children: T }) }),
|
|
5366
5366
|
p && /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", gap: "0.75rem", marginBottom: "1rem" }, children: [
|
|
5367
5367
|
/* @__PURE__ */ h.jsxs("div", { style: { flex: 1 }, children: [
|
|
5368
5368
|
/* @__PURE__ */ h.jsx("label", { style: U, children: c }),
|
|
@@ -5370,8 +5370,8 @@ function Qd({
|
|
|
5370
5370
|
"input",
|
|
5371
5371
|
{
|
|
5372
5372
|
type: "text",
|
|
5373
|
-
value:
|
|
5374
|
-
onChange: (W) =>
|
|
5373
|
+
value: v,
|
|
5374
|
+
onChange: (W) => E(W.target.value),
|
|
5375
5375
|
style: V
|
|
5376
5376
|
}
|
|
5377
5377
|
)
|
|
@@ -5382,8 +5382,8 @@ function Qd({
|
|
|
5382
5382
|
"input",
|
|
5383
5383
|
{
|
|
5384
5384
|
type: "text",
|
|
5385
|
-
value:
|
|
5386
|
-
onChange: (W) =>
|
|
5385
|
+
value: N,
|
|
5386
|
+
onChange: (W) => A(W.target.value),
|
|
5387
5387
|
style: V
|
|
5388
5388
|
}
|
|
5389
5389
|
)
|
|
@@ -5409,7 +5409,7 @@ function Qd({
|
|
|
5409
5409
|
{
|
|
5410
5410
|
type: "password",
|
|
5411
5411
|
value: _,
|
|
5412
|
-
onChange: (W) =>
|
|
5412
|
+
onChange: (W) => w(W.target.value),
|
|
5413
5413
|
required: !0,
|
|
5414
5414
|
minLength: 8,
|
|
5415
5415
|
style: V
|
|
@@ -5422,7 +5422,7 @@ function Qd({
|
|
|
5422
5422
|
"input",
|
|
5423
5423
|
{
|
|
5424
5424
|
type: "password",
|
|
5425
|
-
value:
|
|
5425
|
+
value: S,
|
|
5426
5426
|
onChange: (W) => C(W.target.value),
|
|
5427
5427
|
required: !0,
|
|
5428
5428
|
style: V
|
|
@@ -5479,21 +5479,21 @@ function Sl({
|
|
|
5479
5479
|
className: g = "",
|
|
5480
5480
|
isModal: m = !1
|
|
5481
5481
|
}) {
|
|
5482
|
-
const [x, b] = I(Array(f).fill("")), [y, _] = I(""), [
|
|
5482
|
+
const [x, b] = I(Array(f).fill("")), [y, _] = I(""), [w, S] = I(!1), [C, v] = I(!1), [E, N] = I(!1), A = be([]), T = { ...Xd, ...p };
|
|
5483
5483
|
Te(() => {
|
|
5484
5484
|
var q;
|
|
5485
|
-
(q =
|
|
5485
|
+
(q = A.current[0]) == null || q.focus();
|
|
5486
5486
|
}, []);
|
|
5487
|
-
const
|
|
5487
|
+
const F = (q, J) => {
|
|
5488
5488
|
var ce;
|
|
5489
5489
|
const W = J.replace(/\D/g, "").slice(-1), se = [...x];
|
|
5490
|
-
if (se[q] = W, b(se), _(""), W && q < f - 1 && ((ce =
|
|
5490
|
+
if (se[q] = W, b(se), _(""), W && q < f - 1 && ((ce = A.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
|
}
|
|
5494
5494
|
}, R = (q, J) => {
|
|
5495
5495
|
var W;
|
|
5496
|
-
J.key === "Backspace" && !x[q] && q > 0 && ((W =
|
|
5496
|
+
J.key === "Backspace" && !x[q] && q > 0 && ((W = A.current[q - 1]) == null || W.focus());
|
|
5497
5497
|
}, D = (q) => {
|
|
5498
5498
|
var ce;
|
|
5499
5499
|
q.preventDefault();
|
|
@@ -5502,7 +5502,7 @@ function Sl({
|
|
|
5502
5502
|
ge < f && (W[ge] = fe);
|
|
5503
5503
|
}), b(W);
|
|
5504
5504
|
const se = Math.min(J.length, f) - 1;
|
|
5505
|
-
se >= 0 && ((ce =
|
|
5505
|
+
se >= 0 && ((ce = A.current[se]) == null || ce.focus()), J.length === f && B(J);
|
|
5506
5506
|
};
|
|
5507
5507
|
async function B(q) {
|
|
5508
5508
|
var se;
|
|
@@ -5511,19 +5511,19 @@ function Sl({
|
|
|
5511
5511
|
_("Veuillez entrer le code complet");
|
|
5512
5512
|
return;
|
|
5513
5513
|
}
|
|
5514
|
-
|
|
5514
|
+
S(!0), _("");
|
|
5515
5515
|
const W = await e(r, J);
|
|
5516
|
-
W.success ? t == null || t() : (_(W.error || "Code invalide"), b(Array(f).fill("")), (se =
|
|
5516
|
+
W.success ? t == null || t() : (_(W.error || "Code invalide"), b(Array(f).fill("")), (se = A.current[0]) == null || se.focus()), S(!1);
|
|
5517
5517
|
}
|
|
5518
5518
|
async function M() {
|
|
5519
5519
|
if (!n) return;
|
|
5520
|
-
|
|
5520
|
+
v(!0), N(!1), _("");
|
|
5521
5521
|
const q = await n(r);
|
|
5522
|
-
q.success ? (
|
|
5522
|
+
q.success ? (N(!0), setTimeout(() => N(!1), 3e3)) : _(q.error || "Erreur lors de l'envoi"), v(!1);
|
|
5523
5523
|
}
|
|
5524
5524
|
const O = {
|
|
5525
|
-
backgroundColor:
|
|
5526
|
-
borderRadius:
|
|
5525
|
+
backgroundColor: T.backgroundColor,
|
|
5526
|
+
borderRadius: T.borderRadius,
|
|
5527
5527
|
padding: "1.5rem",
|
|
5528
5528
|
width: "100%",
|
|
5529
5529
|
maxWidth: "24rem",
|
|
@@ -5536,25 +5536,25 @@ function Sl({
|
|
|
5536
5536
|
textAlign: "center",
|
|
5537
5537
|
fontSize: "1.5rem",
|
|
5538
5538
|
fontWeight: 600,
|
|
5539
|
-
border: `2px solid ${
|
|
5540
|
-
borderRadius:
|
|
5541
|
-
backgroundColor:
|
|
5542
|
-
color:
|
|
5539
|
+
border: `2px solid ${T.borderColor}`,
|
|
5540
|
+
borderRadius: T.borderRadius,
|
|
5541
|
+
backgroundColor: T.inputBackground,
|
|
5542
|
+
color: T.textColor,
|
|
5543
5543
|
outline: "none",
|
|
5544
5544
|
transition: "border-color 0.2s, box-shadow 0.2s"
|
|
5545
5545
|
}, U = {
|
|
5546
5546
|
width: "100%",
|
|
5547
5547
|
padding: "0.75rem",
|
|
5548
|
-
backgroundColor:
|
|
5548
|
+
backgroundColor: w ? T.textMutedColor : T.primaryColor,
|
|
5549
5549
|
color: "#ffffff",
|
|
5550
5550
|
border: "none",
|
|
5551
|
-
borderRadius:
|
|
5551
|
+
borderRadius: T.borderRadius,
|
|
5552
5552
|
fontSize: "1rem",
|
|
5553
5553
|
fontWeight: 500,
|
|
5554
|
-
cursor:
|
|
5554
|
+
cursor: w ? "not-allowed" : "pointer",
|
|
5555
5555
|
transition: "background-color 0.2s"
|
|
5556
5556
|
}, re = {
|
|
5557
|
-
color:
|
|
5557
|
+
color: T.primaryColor,
|
|
5558
5558
|
textDecoration: "none",
|
|
5559
5559
|
fontSize: "0.875rem",
|
|
5560
5560
|
cursor: "pointer",
|
|
@@ -5566,30 +5566,30 @@ function Sl({
|
|
|
5566
5566
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5567
5567
|
fontSize: "1.25rem",
|
|
5568
5568
|
fontWeight: 700,
|
|
5569
|
-
color:
|
|
5569
|
+
color: T.textColor,
|
|
5570
5570
|
marginBottom: "0.5rem",
|
|
5571
5571
|
textAlign: "center"
|
|
5572
5572
|
}, children: s }),
|
|
5573
5573
|
/* @__PURE__ */ h.jsx("p", { style: {
|
|
5574
5574
|
fontSize: "0.875rem",
|
|
5575
|
-
color:
|
|
5575
|
+
color: T.textMutedColor,
|
|
5576
5576
|
textAlign: "center",
|
|
5577
5577
|
marginBottom: "1.5rem"
|
|
5578
5578
|
}, children: o || `Un code a été envoyé à ${r}` }),
|
|
5579
5579
|
y && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5580
5580
|
padding: "0.75rem",
|
|
5581
|
-
backgroundColor:
|
|
5582
|
-
border: `1px solid ${
|
|
5583
|
-
borderRadius:
|
|
5581
|
+
backgroundColor: T.errorBackgroundColor,
|
|
5582
|
+
border: `1px solid ${T.errorColor}20`,
|
|
5583
|
+
borderRadius: T.borderRadius,
|
|
5584
5584
|
marginBottom: "1rem"
|
|
5585
|
-
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5586
|
-
|
|
5585
|
+
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: T.errorColor, margin: 0, textAlign: "center" }, children: y }) }),
|
|
5586
|
+
E && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5587
5587
|
padding: "0.75rem",
|
|
5588
5588
|
backgroundColor: "#ECFDF5",
|
|
5589
|
-
border: `1px solid ${
|
|
5590
|
-
borderRadius:
|
|
5589
|
+
border: `1px solid ${T.successColor}20`,
|
|
5590
|
+
borderRadius: T.borderRadius,
|
|
5591
5591
|
marginBottom: "1rem"
|
|
5592
|
-
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5592
|
+
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: T.successColor, margin: 0, textAlign: "center" }, children: "Code renvoyé !" }) }),
|
|
5593
5593
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
5594
5594
|
display: "flex",
|
|
5595
5595
|
justifyContent: "center",
|
|
@@ -5599,25 +5599,25 @@ function Sl({
|
|
|
5599
5599
|
"input",
|
|
5600
5600
|
{
|
|
5601
5601
|
ref: (W) => {
|
|
5602
|
-
|
|
5602
|
+
A.current[J] = W;
|
|
5603
5603
|
},
|
|
5604
5604
|
type: "text",
|
|
5605
5605
|
inputMode: "numeric",
|
|
5606
5606
|
maxLength: 1,
|
|
5607
5607
|
value: q,
|
|
5608
|
-
onChange: (W) =>
|
|
5608
|
+
onChange: (W) => F(J, W.target.value),
|
|
5609
5609
|
onKeyDown: (W) => R(J, W),
|
|
5610
5610
|
onPaste: D,
|
|
5611
|
-
disabled:
|
|
5611
|
+
disabled: w,
|
|
5612
5612
|
style: {
|
|
5613
5613
|
...V,
|
|
5614
|
-
borderColor: q ?
|
|
5614
|
+
borderColor: q ? T.primaryColor : T.borderColor
|
|
5615
5615
|
},
|
|
5616
5616
|
onFocus: (W) => {
|
|
5617
|
-
W.target.style.borderColor =
|
|
5617
|
+
W.target.style.borderColor = T.primaryColor, W.target.style.boxShadow = `0 0 0 3px ${T.primaryColor}20`;
|
|
5618
5618
|
},
|
|
5619
5619
|
onBlur: (W) => {
|
|
5620
|
-
W.target.style.borderColor = q ?
|
|
5620
|
+
W.target.style.borderColor = q ? T.primaryColor : T.borderColor, W.target.style.boxShadow = "none";
|
|
5621
5621
|
}
|
|
5622
5622
|
},
|
|
5623
5623
|
J
|
|
@@ -5627,12 +5627,12 @@ function Sl({
|
|
|
5627
5627
|
{
|
|
5628
5628
|
type: "button",
|
|
5629
5629
|
onClick: () => B(),
|
|
5630
|
-
disabled:
|
|
5630
|
+
disabled: w || 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: w ? l : a
|
|
5636
5636
|
}
|
|
5637
5637
|
),
|
|
5638
5638
|
n && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx(
|
|
@@ -5680,12 +5680,12 @@ function Zd({
|
|
|
5680
5680
|
isModal: d = !1
|
|
5681
5681
|
}) {
|
|
5682
5682
|
const [f, p] = I(""), [g, m] = I(""), [x, b] = I(!1), y = { ...Jd, ...u };
|
|
5683
|
-
async function _(
|
|
5684
|
-
|
|
5685
|
-
const
|
|
5686
|
-
|
|
5683
|
+
async function _(N) {
|
|
5684
|
+
N.preventDefault(), b(!0), m("");
|
|
5685
|
+
const A = await r(f);
|
|
5686
|
+
A.success ? e == null || e(f) : m(A.error || "Erreur lors de l'envoi"), b(!1);
|
|
5687
5687
|
}
|
|
5688
|
-
const
|
|
5688
|
+
const w = {
|
|
5689
5689
|
backgroundColor: y.backgroundColor,
|
|
5690
5690
|
borderRadius: y.borderRadius,
|
|
5691
5691
|
padding: "1.5rem",
|
|
@@ -5694,7 +5694,7 @@ function Zd({
|
|
|
5694
5694
|
...d && {
|
|
5695
5695
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
|
|
5696
5696
|
}
|
|
5697
|
-
},
|
|
5697
|
+
}, S = {
|
|
5698
5698
|
width: "100%",
|
|
5699
5699
|
padding: "0.5rem 1rem",
|
|
5700
5700
|
border: `1px solid ${y.borderColor}`,
|
|
@@ -5710,7 +5710,7 @@ function Zd({
|
|
|
5710
5710
|
fontWeight: 500,
|
|
5711
5711
|
color: y.textMutedColor,
|
|
5712
5712
|
marginBottom: "0.25rem"
|
|
5713
|
-
},
|
|
5713
|
+
}, v = {
|
|
5714
5714
|
width: "100%",
|
|
5715
5715
|
padding: "0.75rem",
|
|
5716
5716
|
backgroundColor: x ? y.textMutedColor : y.primaryColor,
|
|
@@ -5721,7 +5721,7 @@ function Zd({
|
|
|
5721
5721
|
fontWeight: 500,
|
|
5722
5722
|
cursor: x ? "not-allowed" : "pointer",
|
|
5723
5723
|
transition: "background-color 0.2s"
|
|
5724
|
-
},
|
|
5724
|
+
}, E = {
|
|
5725
5725
|
color: y.primaryColor,
|
|
5726
5726
|
textDecoration: "none",
|
|
5727
5727
|
fontSize: "0.875rem",
|
|
@@ -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: w, className: c, children: [
|
|
5734
5734
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5735
5735
|
fontSize: "1.25rem",
|
|
5736
5736
|
fontWeight: 700,
|
|
@@ -5759,9 +5759,9 @@ function Zd({
|
|
|
5759
5759
|
{
|
|
5760
5760
|
type: "email",
|
|
5761
5761
|
value: f,
|
|
5762
|
-
onChange: (
|
|
5762
|
+
onChange: (N) => p(N.target.value),
|
|
5763
5763
|
required: !0,
|
|
5764
|
-
style:
|
|
5764
|
+
style: S
|
|
5765
5765
|
}
|
|
5766
5766
|
)
|
|
5767
5767
|
] }),
|
|
@@ -5770,17 +5770,17 @@ function Zd({
|
|
|
5770
5770
|
{
|
|
5771
5771
|
type: "submit",
|
|
5772
5772
|
disabled: x,
|
|
5773
|
-
style:
|
|
5774
|
-
onMouseEnter: (
|
|
5775
|
-
x || (
|
|
5773
|
+
style: v,
|
|
5774
|
+
onMouseEnter: (N) => {
|
|
5775
|
+
x || (N.target.style.backgroundColor = y.primaryHoverColor);
|
|
5776
5776
|
},
|
|
5777
|
-
onMouseLeave: (
|
|
5778
|
-
x || (
|
|
5777
|
+
onMouseLeave: (N) => {
|
|
5778
|
+
x || (N.target.style.backgroundColor = y.primaryColor);
|
|
5779
5779
|
},
|
|
5780
5780
|
children: x ? o : s
|
|
5781
5781
|
}
|
|
5782
5782
|
),
|
|
5783
|
-
t && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: t, style:
|
|
5783
|
+
t && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: t, style: E, children: l }) })
|
|
5784
5784
|
] })
|
|
5785
5785
|
] });
|
|
5786
5786
|
}
|
|
@@ -5813,58 +5813,58 @@ function tf({
|
|
|
5813
5813
|
className: p = "",
|
|
5814
5814
|
isModal: g = !1
|
|
5815
5815
|
}) {
|
|
5816
|
-
const [m, x] = I(""), [b, y] = I(""), [_,
|
|
5817
|
-
async function
|
|
5818
|
-
if (D.preventDefault(),
|
|
5819
|
-
|
|
5816
|
+
const [m, x] = I(""), [b, y] = I(""), [_, w] = I(""), [S, C] = I(!1), v = { ...ef, ...f };
|
|
5817
|
+
async function E(D) {
|
|
5818
|
+
if (D.preventDefault(), w(""), m !== b) {
|
|
5819
|
+
w("Les mots de passe ne correspondent pas");
|
|
5820
5820
|
return;
|
|
5821
5821
|
}
|
|
5822
5822
|
if (m.length < 8) {
|
|
5823
|
-
|
|
5823
|
+
w("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() : w(B.error || "Erreur lors de la réinitialisation"), C(!1);
|
|
5829
5829
|
}
|
|
5830
|
-
const
|
|
5831
|
-
backgroundColor:
|
|
5832
|
-
borderRadius:
|
|
5830
|
+
const N = {
|
|
5831
|
+
backgroundColor: v.backgroundColor,
|
|
5832
|
+
borderRadius: v.borderRadius,
|
|
5833
5833
|
padding: "1.5rem",
|
|
5834
5834
|
width: "100%",
|
|
5835
5835
|
maxWidth: "24rem",
|
|
5836
5836
|
...g && {
|
|
5837
5837
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
|
|
5838
5838
|
}
|
|
5839
|
-
},
|
|
5839
|
+
}, A = {
|
|
5840
5840
|
width: "100%",
|
|
5841
5841
|
padding: "0.5rem 1rem",
|
|
5842
|
-
border: `1px solid ${
|
|
5843
|
-
borderRadius:
|
|
5844
|
-
backgroundColor:
|
|
5845
|
-
color:
|
|
5842
|
+
border: `1px solid ${v.borderColor}`,
|
|
5843
|
+
borderRadius: v.borderRadius,
|
|
5844
|
+
backgroundColor: v.inputBackground,
|
|
5845
|
+
color: v.textColor,
|
|
5846
5846
|
fontSize: "1rem",
|
|
5847
5847
|
outline: "none",
|
|
5848
5848
|
boxSizing: "border-box"
|
|
5849
|
-
},
|
|
5849
|
+
}, T = {
|
|
5850
5850
|
display: "block",
|
|
5851
5851
|
fontSize: "0.875rem",
|
|
5852
5852
|
fontWeight: 500,
|
|
5853
|
-
color:
|
|
5853
|
+
color: v.textMutedColor,
|
|
5854
5854
|
marginBottom: "0.25rem"
|
|
5855
|
-
},
|
|
5855
|
+
}, F = {
|
|
5856
5856
|
width: "100%",
|
|
5857
5857
|
padding: "0.75rem",
|
|
5858
|
-
backgroundColor:
|
|
5858
|
+
backgroundColor: S ? v.textMutedColor : v.primaryColor,
|
|
5859
5859
|
color: "#ffffff",
|
|
5860
5860
|
border: "none",
|
|
5861
|
-
borderRadius:
|
|
5861
|
+
borderRadius: v.borderRadius,
|
|
5862
5862
|
fontSize: "1rem",
|
|
5863
5863
|
fontWeight: 500,
|
|
5864
|
-
cursor:
|
|
5864
|
+
cursor: S ? "not-allowed" : "pointer",
|
|
5865
5865
|
transition: "background-color 0.2s"
|
|
5866
5866
|
}, R = {
|
|
5867
|
-
color:
|
|
5867
|
+
color: v.primaryColor,
|
|
5868
5868
|
textDecoration: "none",
|
|
5869
5869
|
fontSize: "0.875rem",
|
|
5870
5870
|
cursor: "pointer",
|
|
@@ -5872,30 +5872,30 @@ function tf({
|
|
|
5872
5872
|
border: "none",
|
|
5873
5873
|
padding: 0
|
|
5874
5874
|
};
|
|
5875
|
-
return /* @__PURE__ */ h.jsxs("div", { style:
|
|
5875
|
+
return /* @__PURE__ */ h.jsxs("div", { style: N, className: p, children: [
|
|
5876
5876
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5877
5877
|
fontSize: "1.25rem",
|
|
5878
5878
|
fontWeight: 700,
|
|
5879
|
-
color:
|
|
5879
|
+
color: v.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: v.textMutedColor,
|
|
5886
5886
|
textAlign: "center",
|
|
5887
5887
|
marginBottom: "1.5rem"
|
|
5888
5888
|
}, children: o }),
|
|
5889
|
-
/* @__PURE__ */ h.jsxs("form", { onSubmit:
|
|
5889
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: E, children: [
|
|
5890
5890
|
_ && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5891
5891
|
padding: "0.75rem",
|
|
5892
|
-
backgroundColor:
|
|
5893
|
-
border: `1px solid ${
|
|
5894
|
-
borderRadius:
|
|
5892
|
+
backgroundColor: v.errorBackgroundColor,
|
|
5893
|
+
border: `1px solid ${v.errorColor}20`,
|
|
5894
|
+
borderRadius: v.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: v.errorColor, margin: 0 }, children: _ }) }),
|
|
5897
5897
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1rem" }, children: [
|
|
5898
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5898
|
+
/* @__PURE__ */ h.jsx("label", { style: T, children: u }),
|
|
5899
5899
|
/* @__PURE__ */ h.jsx(
|
|
5900
5900
|
"input",
|
|
5901
5901
|
{
|
|
@@ -5904,12 +5904,12 @@ function tf({
|
|
|
5904
5904
|
onChange: (D) => x(D.target.value),
|
|
5905
5905
|
required: !0,
|
|
5906
5906
|
minLength: 8,
|
|
5907
|
-
style:
|
|
5907
|
+
style: A
|
|
5908
5908
|
}
|
|
5909
5909
|
)
|
|
5910
5910
|
] }),
|
|
5911
5911
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
5912
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5912
|
+
/* @__PURE__ */ h.jsx("label", { style: T, children: c }),
|
|
5913
5913
|
/* @__PURE__ */ h.jsx(
|
|
5914
5914
|
"input",
|
|
5915
5915
|
{
|
|
@@ -5917,7 +5917,7 @@ function tf({
|
|
|
5917
5917
|
value: b,
|
|
5918
5918
|
onChange: (D) => y(D.target.value),
|
|
5919
5919
|
required: !0,
|
|
5920
|
-
style:
|
|
5920
|
+
style: A
|
|
5921
5921
|
}
|
|
5922
5922
|
)
|
|
5923
5923
|
] }),
|
|
@@ -5925,15 +5925,15 @@ function tf({
|
|
|
5925
5925
|
"button",
|
|
5926
5926
|
{
|
|
5927
5927
|
type: "submit",
|
|
5928
|
-
disabled:
|
|
5929
|
-
style:
|
|
5928
|
+
disabled: S,
|
|
5929
|
+
style: F,
|
|
5930
5930
|
onMouseEnter: (D) => {
|
|
5931
|
-
|
|
5931
|
+
S || (D.target.style.backgroundColor = v.primaryHoverColor);
|
|
5932
5932
|
},
|
|
5933
5933
|
onMouseLeave: (D) => {
|
|
5934
|
-
|
|
5934
|
+
S || (D.target.style.backgroundColor = v.primaryColor);
|
|
5935
5935
|
},
|
|
5936
|
-
children:
|
|
5936
|
+
children: S ? l : a
|
|
5937
5937
|
}
|
|
5938
5938
|
),
|
|
5939
5939
|
i && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: i, style: R, children: d }) })
|
|
@@ -5957,28 +5957,28 @@ function rf({
|
|
|
5957
5957
|
labels: p = {}
|
|
5958
5958
|
}) {
|
|
5959
5959
|
const [g, m] = I(a), [x, b] = I(""), [y, _] = I("");
|
|
5960
|
-
async function
|
|
5961
|
-
const
|
|
5962
|
-
return
|
|
5960
|
+
async function w(A, T) {
|
|
5961
|
+
const F = await r(A, T);
|
|
5962
|
+
return F.requiresVerification ? (b(A), m("verify-email"), { success: !1, error: "Veuillez vérifier votre email" }) : F;
|
|
5963
5963
|
}
|
|
5964
|
-
async function
|
|
5965
|
-
const R = await e(
|
|
5966
|
-
return R.success && R.requiresVerification && (b(
|
|
5964
|
+
async function S(A, T, F) {
|
|
5965
|
+
const R = await e(A, T, F);
|
|
5966
|
+
return R.success && R.requiresVerification && (b(A), m("verify-email")), R;
|
|
5967
5967
|
}
|
|
5968
|
-
async function C(
|
|
5969
|
-
const
|
|
5970
|
-
return
|
|
5968
|
+
async function C(A) {
|
|
5969
|
+
const T = await n(A);
|
|
5970
|
+
return T.success && (b(A), m("verify-reset-code")), T;
|
|
5971
5971
|
}
|
|
5972
|
-
async function
|
|
5973
|
-
return _(
|
|
5972
|
+
async function v(A, T) {
|
|
5973
|
+
return _(T), m("reset-password"), { success: !0 };
|
|
5974
5974
|
}
|
|
5975
|
-
const
|
|
5975
|
+
const E = () => {
|
|
5976
5976
|
switch (g) {
|
|
5977
5977
|
case "login":
|
|
5978
5978
|
return /* @__PURE__ */ h.jsx(
|
|
5979
5979
|
du,
|
|
5980
5980
|
{
|
|
5981
|
-
onLogin:
|
|
5981
|
+
onLogin: w,
|
|
5982
5982
|
onSuccess: o,
|
|
5983
5983
|
logo: l,
|
|
5984
5984
|
theme: u,
|
|
@@ -5991,7 +5991,7 @@ function rf({
|
|
|
5991
5991
|
return /* @__PURE__ */ h.jsx(
|
|
5992
5992
|
Qd,
|
|
5993
5993
|
{
|
|
5994
|
-
onRegister:
|
|
5994
|
+
onRegister: S,
|
|
5995
5995
|
onSuccess: () => {
|
|
5996
5996
|
},
|
|
5997
5997
|
onLoginClick: () => m("login"),
|
|
@@ -6035,7 +6035,7 @@ function rf({
|
|
|
6035
6035
|
Sl,
|
|
6036
6036
|
{
|
|
6037
6037
|
email: x,
|
|
6038
|
-
onVerify:
|
|
6038
|
+
onVerify: v,
|
|
6039
6039
|
onResendCode: s,
|
|
6040
6040
|
onBackClick: () => m("forgot-password"),
|
|
6041
6041
|
title: "Code de réinitialisation",
|
|
@@ -6060,8 +6060,8 @@ function rf({
|
|
|
6060
6060
|
}
|
|
6061
6061
|
);
|
|
6062
6062
|
}
|
|
6063
|
-
},
|
|
6064
|
-
const
|
|
6063
|
+
}, N = () => {
|
|
6064
|
+
const A = {
|
|
6065
6065
|
color: (u == null ? void 0 : u.primaryColor) || "#1877F2",
|
|
6066
6066
|
textDecoration: "none",
|
|
6067
6067
|
fontSize: "0.875rem",
|
|
@@ -6078,8 +6078,8 @@ function rf({
|
|
|
6078
6078
|
maxWidth: "24rem",
|
|
6079
6079
|
width: "100%"
|
|
6080
6080
|
}, children: [
|
|
6081
|
-
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("forgot-password"), style:
|
|
6082
|
-
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("register"), style:
|
|
6081
|
+
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("forgot-password"), style: A, children: "Mot de passe oublié ?" }),
|
|
6082
|
+
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("register"), style: A, children: "Créer un compte" })
|
|
6083
6083
|
] }) : null;
|
|
6084
6084
|
};
|
|
6085
6085
|
return /* @__PURE__ */ h.jsxs("div", { style: {
|
|
@@ -6088,8 +6088,8 @@ function rf({
|
|
|
6088
6088
|
alignItems: "center",
|
|
6089
6089
|
width: "100%"
|
|
6090
6090
|
}, children: [
|
|
6091
|
-
|
|
6092
|
-
|
|
6091
|
+
E(),
|
|
6092
|
+
N()
|
|
6093
6093
|
] });
|
|
6094
6094
|
}
|
|
6095
6095
|
function wy({
|
|
@@ -6331,17 +6331,17 @@ function Dy({
|
|
|
6331
6331
|
onRefresh: p,
|
|
6332
6332
|
theme: g = {}
|
|
6333
6333
|
}) {
|
|
6334
|
-
const { data: m, loading: x, error: b, refetch: y } = nf(r, e), [_,
|
|
6334
|
+
const { data: m, loading: x, error: b, refetch: y } = nf(r, e), [_, w] = I(""), [S, C] = I({}), [v, E] = I(1), N = ct(() => {
|
|
6335
6335
|
if (!m) return { data: [], total: 0, totalPages: 0 };
|
|
6336
6336
|
let D = m;
|
|
6337
|
-
return a && _ && l.length > 0 && (D = Ps.search(D, _, l)), Object.keys(
|
|
6338
|
-
}, [m, _,
|
|
6337
|
+
return a && _ && l.length > 0 && (D = Ps.search(D, _, l)), Object.keys(S).length > 0 && (D = Ps.filterByFields(D, S)), Ps.paginate(D, v, d);
|
|
6338
|
+
}, [m, _, S, v, d, a, l]);
|
|
6339
6339
|
Te(() => {
|
|
6340
|
-
|
|
6341
|
-
}, [_,
|
|
6342
|
-
const
|
|
6343
|
-
|
|
6344
|
-
},
|
|
6340
|
+
E(1);
|
|
6341
|
+
}, [_, S]);
|
|
6342
|
+
const A = () => {
|
|
6343
|
+
w(""), C({}), E(1), y(), p == null || p();
|
|
6344
|
+
}, T = {
|
|
6345
6345
|
background: g.background || "#ffffff",
|
|
6346
6346
|
cardBackground: g.cardBackground || "#f9fafb",
|
|
6347
6347
|
text: g.text || "#111827",
|
|
@@ -6352,15 +6352,15 @@ function Dy({
|
|
|
6352
6352
|
padding: "16px",
|
|
6353
6353
|
cursor: f ? "pointer" : "default"
|
|
6354
6354
|
}, children: [
|
|
6355
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color:
|
|
6356
|
-
D.description && /* @__PURE__ */ h.jsx("div", { style: { fontSize: "13px", color:
|
|
6355
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: T.text }, children: D.title || D.name || D.label || "Untitled" }),
|
|
6356
|
+
D.description && /* @__PURE__ */ h.jsx("div", { style: { fontSize: "13px", color: T.textSecondary, marginTop: "4px" }, children: D.description })
|
|
6357
6357
|
] }));
|
|
6358
6358
|
return x && !m ? /* @__PURE__ */ h.jsx("div", { style: {
|
|
6359
6359
|
display: "flex",
|
|
6360
6360
|
alignItems: "center",
|
|
6361
6361
|
justifyContent: "center",
|
|
6362
6362
|
padding: "48px",
|
|
6363
|
-
color:
|
|
6363
|
+
color: T.textSecondary
|
|
6364
6364
|
}, children: "Loading..." }) : b ? /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6365
6365
|
padding: "24px",
|
|
6366
6366
|
textAlign: "center",
|
|
@@ -6371,11 +6371,11 @@ function Dy({
|
|
|
6371
6371
|
/* @__PURE__ */ h.jsx(
|
|
6372
6372
|
"button",
|
|
6373
6373
|
{
|
|
6374
|
-
onClick:
|
|
6374
|
+
onClick: A,
|
|
6375
6375
|
style: {
|
|
6376
6376
|
marginTop: "16px",
|
|
6377
6377
|
padding: "8px 16px",
|
|
6378
|
-
background:
|
|
6378
|
+
background: T.primary,
|
|
6379
6379
|
color: "white",
|
|
6380
6380
|
border: "none",
|
|
6381
6381
|
borderRadius: "6px",
|
|
@@ -6385,13 +6385,13 @@ function Dy({
|
|
|
6385
6385
|
}
|
|
6386
6386
|
)
|
|
6387
6387
|
] }) : /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6388
|
-
background:
|
|
6388
|
+
background: T.background,
|
|
6389
6389
|
borderRadius: "12px",
|
|
6390
6390
|
overflow: "hidden"
|
|
6391
6391
|
}, children: [
|
|
6392
6392
|
(n || a || c.length > 0) && /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6393
6393
|
padding: "16px",
|
|
6394
|
-
borderBottom: `1px solid ${
|
|
6394
|
+
borderBottom: `1px solid ${T.border}`
|
|
6395
6395
|
}, children: [
|
|
6396
6396
|
/* @__PURE__ */ h.jsxs("div", { style: {
|
|
6397
6397
|
display: "flex",
|
|
@@ -6403,18 +6403,18 @@ function Dy({
|
|
|
6403
6403
|
margin: 0,
|
|
6404
6404
|
fontSize: "18px",
|
|
6405
6405
|
fontWeight: 600,
|
|
6406
|
-
color:
|
|
6406
|
+
color: T.text
|
|
6407
6407
|
}, children: n }),
|
|
6408
6408
|
/* @__PURE__ */ h.jsx(
|
|
6409
6409
|
"button",
|
|
6410
6410
|
{
|
|
6411
|
-
onClick:
|
|
6411
|
+
onClick: A,
|
|
6412
6412
|
style: {
|
|
6413
6413
|
padding: "6px 12px",
|
|
6414
6414
|
background: "transparent",
|
|
6415
|
-
border: `1px solid ${
|
|
6415
|
+
border: `1px solid ${T.border}`,
|
|
6416
6416
|
borderRadius: "6px",
|
|
6417
|
-
color:
|
|
6417
|
+
color: T.textSecondary,
|
|
6418
6418
|
cursor: "pointer",
|
|
6419
6419
|
fontSize: "13px"
|
|
6420
6420
|
},
|
|
@@ -6428,11 +6428,11 @@ function Dy({
|
|
|
6428
6428
|
type: "text",
|
|
6429
6429
|
placeholder: u,
|
|
6430
6430
|
value: _,
|
|
6431
|
-
onChange: (D) =>
|
|
6431
|
+
onChange: (D) => w(D.target.value),
|
|
6432
6432
|
style: {
|
|
6433
6433
|
width: "100%",
|
|
6434
6434
|
padding: "8px 12px",
|
|
6435
|
-
border: `1px solid ${
|
|
6435
|
+
border: `1px solid ${T.border}`,
|
|
6436
6436
|
borderRadius: "8px",
|
|
6437
6437
|
fontSize: "14px",
|
|
6438
6438
|
outline: "none"
|
|
@@ -6446,56 +6446,56 @@ function Dy({
|
|
|
6446
6446
|
gridTemplateColumns: t === "grid" ? "repeat(auto-fill, minmax(250px, 1fr))" : void 0,
|
|
6447
6447
|
gap: t === "list" ? "0" : "16px",
|
|
6448
6448
|
padding: t === "list" ? "0" : "16px"
|
|
6449
|
-
}, children:
|
|
6449
|
+
}, children: N.data.length === 0 ? /* @__PURE__ */ h.jsx("div", { style: {
|
|
6450
6450
|
padding: "48px",
|
|
6451
6451
|
textAlign: "center",
|
|
6452
|
-
color:
|
|
6453
|
-
}, children: i }) :
|
|
6452
|
+
color: T.textSecondary
|
|
6453
|
+
}, children: i }) : N.data.map((D, B) => /* @__PURE__ */ h.jsx(
|
|
6454
6454
|
"div",
|
|
6455
6455
|
{
|
|
6456
6456
|
onClick: () => f == null ? void 0 : f(D),
|
|
6457
6457
|
style: {
|
|
6458
|
-
background:
|
|
6458
|
+
background: T.cardBackground,
|
|
6459
6459
|
borderRadius: t === "list" ? "0" : "8px",
|
|
6460
|
-
borderBottom: t === "list" ? `1px solid ${
|
|
6460
|
+
borderBottom: t === "list" ? `1px solid ${T.border}` : "none",
|
|
6461
6461
|
transition: "all 0.15s ease"
|
|
6462
6462
|
},
|
|
6463
6463
|
onMouseEnter: (M) => {
|
|
6464
|
-
f && (M.currentTarget.style.background =
|
|
6464
|
+
f && (M.currentTarget.style.background = T.border);
|
|
6465
6465
|
},
|
|
6466
6466
|
onMouseLeave: (M) => {
|
|
6467
|
-
M.currentTarget.style.background =
|
|
6467
|
+
M.currentTarget.style.background = T.cardBackground;
|
|
6468
6468
|
},
|
|
6469
6469
|
children: R(D, B)
|
|
6470
6470
|
},
|
|
6471
6471
|
o(D, B)
|
|
6472
6472
|
)) }),
|
|
6473
|
-
|
|
6473
|
+
N.totalPages > 1 && /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6474
6474
|
padding: "16px",
|
|
6475
|
-
borderTop: `1px solid ${
|
|
6475
|
+
borderTop: `1px solid ${T.border}`,
|
|
6476
6476
|
display: "flex",
|
|
6477
6477
|
alignItems: "center",
|
|
6478
6478
|
justifyContent: "space-between"
|
|
6479
6479
|
}, children: [
|
|
6480
|
-
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "13px", color:
|
|
6480
|
+
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "13px", color: T.textSecondary }, children: [
|
|
6481
6481
|
"Page ",
|
|
6482
|
-
|
|
6482
|
+
v,
|
|
6483
6483
|
" of ",
|
|
6484
|
-
|
|
6484
|
+
N.totalPages
|
|
6485
6485
|
] }),
|
|
6486
6486
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
6487
6487
|
/* @__PURE__ */ h.jsx(
|
|
6488
6488
|
"button",
|
|
6489
6489
|
{
|
|
6490
|
-
onClick: () =>
|
|
6491
|
-
disabled:
|
|
6490
|
+
onClick: () => E((D) => Math.max(1, D - 1)),
|
|
6491
|
+
disabled: v === 1,
|
|
6492
6492
|
style: {
|
|
6493
6493
|
padding: "6px 12px",
|
|
6494
|
-
border: `1px solid ${
|
|
6494
|
+
border: `1px solid ${T.border}`,
|
|
6495
6495
|
borderRadius: "6px",
|
|
6496
6496
|
background: "white",
|
|
6497
|
-
cursor:
|
|
6498
|
-
opacity:
|
|
6497
|
+
cursor: v === 1 ? "not-allowed" : "pointer",
|
|
6498
|
+
opacity: v === 1 ? 0.5 : 1
|
|
6499
6499
|
},
|
|
6500
6500
|
children: "Previous"
|
|
6501
6501
|
}
|
|
@@ -6503,15 +6503,15 @@ function Dy({
|
|
|
6503
6503
|
/* @__PURE__ */ h.jsx(
|
|
6504
6504
|
"button",
|
|
6505
6505
|
{
|
|
6506
|
-
onClick: () =>
|
|
6507
|
-
disabled:
|
|
6506
|
+
onClick: () => E((D) => Math.min(N.totalPages, D + 1)),
|
|
6507
|
+
disabled: v === N.totalPages,
|
|
6508
6508
|
style: {
|
|
6509
6509
|
padding: "6px 12px",
|
|
6510
|
-
border: `1px solid ${
|
|
6510
|
+
border: `1px solid ${T.border}`,
|
|
6511
6511
|
borderRadius: "6px",
|
|
6512
6512
|
background: "white",
|
|
6513
|
-
cursor:
|
|
6514
|
-
opacity:
|
|
6513
|
+
cursor: v === N.totalPages ? "not-allowed" : "pointer",
|
|
6514
|
+
opacity: v === N.totalPages ? 0.5 : 1
|
|
6515
6515
|
},
|
|
6516
6516
|
children: "Next"
|
|
6517
6517
|
}
|
|
@@ -6629,66 +6629,66 @@ function ky({
|
|
|
6629
6629
|
cardSize: i = "medium",
|
|
6630
6630
|
className: s = ""
|
|
6631
6631
|
}) {
|
|
6632
|
-
var
|
|
6632
|
+
var C, v;
|
|
6633
6633
|
const [o] = I(() => {
|
|
6634
6634
|
if (r.length === 0) return [[], []];
|
|
6635
|
-
const
|
|
6635
|
+
const E = of(r), N = Math.ceil(E.length / 2);
|
|
6636
6636
|
return console.log("[AnimatedCardFlip] Pools:", {
|
|
6637
|
-
left:
|
|
6638
|
-
right:
|
|
6639
|
-
}), [
|
|
6640
|
-
}), [a, l] = I(0), [u, c] = I(0), [d, f] = I(!1), [p, g] = I(!1);
|
|
6637
|
+
left: E.slice(0, N).map((A) => A.title),
|
|
6638
|
+
right: E.slice(N).map((A) => A.title)
|
|
6639
|
+
}), [E.slice(0, N), E.slice(N)];
|
|
6640
|
+
}), [a, l] = I(0), [u, c] = I(0), [d, f] = I(!1), [p, g] = I(!1), [m, x] = I(!1), [b, y] = I(!1);
|
|
6641
6641
|
Te(() => {
|
|
6642
6642
|
if (o[0].length <= 1) return;
|
|
6643
|
-
const
|
|
6644
|
-
f((
|
|
6645
|
-
l((
|
|
6643
|
+
const E = setInterval(() => {
|
|
6644
|
+
f((N) => !N), setTimeout(() => {
|
|
6645
|
+
l((N) => (N + 1) % o[0].length), x((N) => !N);
|
|
6646
6646
|
}, 250);
|
|
6647
6647
|
}, e + Math.random() * (t - e));
|
|
6648
|
-
return () => clearInterval(
|
|
6648
|
+
return () => clearInterval(E);
|
|
6649
6649
|
}, [o, e, t]), Te(() => {
|
|
6650
6650
|
if (o[1].length <= 1) return;
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6651
|
+
let E = null;
|
|
6652
|
+
const N = setTimeout(() => {
|
|
6653
|
+
E = setInterval(() => {
|
|
6654
|
+
g((A) => !A), setTimeout(() => {
|
|
6655
|
+
c((A) => (A + 1) % o[1].length), y((A) => !A);
|
|
6655
6656
|
}, 250);
|
|
6656
6657
|
}, e + Math.random() * (t - e));
|
|
6657
|
-
v.intervalId = E;
|
|
6658
6658
|
}, 500);
|
|
6659
6659
|
return () => {
|
|
6660
|
-
clearTimeout(
|
|
6660
|
+
clearTimeout(N), E && clearInterval(E);
|
|
6661
6661
|
};
|
|
6662
6662
|
}, [o, e, t]);
|
|
6663
|
-
const
|
|
6664
|
-
if (r.length === 0 || !
|
|
6663
|
+
const _ = (C = o[0]) == null ? void 0 : C[a], w = (v = o[1]) == null ? void 0 : v[u];
|
|
6664
|
+
if (r.length === 0 || !_)
|
|
6665
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
|
|
6666
|
+
const S = (E, N, A) => /* @__PURE__ */ h.jsx(
|
|
6667
6667
|
"div",
|
|
6668
6668
|
{
|
|
6669
6669
|
className: `relative ${sf[i]}`,
|
|
6670
6670
|
style: { perspective: "1000px" },
|
|
6671
|
-
onClick: () => n == null ? void 0 : n(
|
|
6671
|
+
onClick: () => n == null ? void 0 : n(E),
|
|
6672
6672
|
children: /* @__PURE__ */ h.jsx(
|
|
6673
6673
|
"div",
|
|
6674
6674
|
{
|
|
6675
6675
|
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
6676
6676
|
style: {
|
|
6677
|
-
transform: `rotateY(${
|
|
6677
|
+
transform: `rotateY(${N ? 180 : 0}deg)`,
|
|
6678
6678
|
transition: "transform 0.5s ease-in-out",
|
|
6679
6679
|
transformStyle: "preserve-3d"
|
|
6680
6680
|
},
|
|
6681
|
-
children: /* @__PURE__ */ h.jsxs("div", { style: { transform:
|
|
6682
|
-
/* @__PURE__ */ h.jsx("img", { src:
|
|
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:
|
|
6681
|
+
children: /* @__PURE__ */ h.jsxs("div", { style: { transform: A ? "scaleX(-1)" : "scaleX(1)", width: "100%", height: "100%" }, children: [
|
|
6682
|
+
/* @__PURE__ */ h.jsx("img", { src: E.data.image, alt: E.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: E.title }) })
|
|
6684
6684
|
] })
|
|
6685
6685
|
}
|
|
6686
6686
|
)
|
|
6687
6687
|
}
|
|
6688
6688
|
);
|
|
6689
6689
|
return /* @__PURE__ */ h.jsxs("div", { className: `flex gap-4 justify-center items-center ${s}`, children: [
|
|
6690
|
-
|
|
6691
|
-
|
|
6690
|
+
S(_, d, m),
|
|
6691
|
+
w && S(w, p, b)
|
|
6692
6692
|
] });
|
|
6693
6693
|
}
|
|
6694
6694
|
function Vr(r) {
|
|
@@ -6744,33 +6744,33 @@ function Ay({
|
|
|
6744
6744
|
renderItem: b,
|
|
6745
6745
|
renderDetail: y,
|
|
6746
6746
|
renderActions: _,
|
|
6747
|
-
renderEmpty:
|
|
6748
|
-
renderLoading:
|
|
6747
|
+
renderEmpty: w,
|
|
6748
|
+
renderLoading: S,
|
|
6749
6749
|
theme: C = {}
|
|
6750
6750
|
}) {
|
|
6751
|
-
const
|
|
6751
|
+
const v = { ...lf, ...C }, [E, N] = I([]), [A, T] = I(!1), [F, 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) => {
|
|
6752
6752
|
u ? u(oe) : ce(oe);
|
|
6753
6753
|
}, Be = ct(() => {
|
|
6754
|
-
if (!fe.trim()) return
|
|
6754
|
+
if (!fe.trim()) return E;
|
|
6755
6755
|
const oe = fe.toLowerCase();
|
|
6756
|
-
return
|
|
6756
|
+
return E.filter(
|
|
6757
6757
|
(de) => Vr(de.from).toLowerCase().includes(oe) || Vr(de.subject).toLowerCase().includes(oe)
|
|
6758
6758
|
);
|
|
6759
|
-
}, [
|
|
6759
|
+
}, [E, fe]), _e = ct(() => e ? new Wd({ baseUrl: r, system_id: e }) : null, [r, e]), Z = X(async () => {
|
|
6760
6760
|
if (_e) {
|
|
6761
|
-
|
|
6761
|
+
T(!0), R(null);
|
|
6762
6762
|
try {
|
|
6763
6763
|
const oe = await _e.listEmails(t, n, i);
|
|
6764
|
-
oe != null && oe.messages && (
|
|
6764
|
+
oe != null && oe.messages && (N(oe.messages), x == null || x(oe.messages));
|
|
6765
6765
|
} catch (oe) {
|
|
6766
6766
|
const de = oe instanceof Error ? oe : new Error("Failed to fetch emails");
|
|
6767
6767
|
R(de.message), m == null || m(de);
|
|
6768
6768
|
}
|
|
6769
|
-
|
|
6769
|
+
T(!1);
|
|
6770
6770
|
}
|
|
6771
6771
|
}, [_e, t, n, i, m, x]);
|
|
6772
6772
|
Te(() => {
|
|
6773
|
-
|
|
6773
|
+
N([]), B(/* @__PURE__ */ new Set()), U(null), R(null), l === void 0 && ce(""), d && Z();
|
|
6774
6774
|
}, [i, d]);
|
|
6775
6775
|
const Ee = X(async (oe) => {
|
|
6776
6776
|
if (_e) {
|
|
@@ -6792,7 +6792,7 @@ function Ay({
|
|
|
6792
6792
|
}
|
|
6793
6793
|
const tt = oe.uid;
|
|
6794
6794
|
if (Ye.shiftKey && M !== null) {
|
|
6795
|
-
const rt = Math.min(M, de), Lt = Math.max(M, de), ee =
|
|
6795
|
+
const rt = Math.min(M, de), Lt = Math.max(M, de), ee = E.slice(rt, Lt + 1).map((ue) => ue.uid), j = new Set(ee);
|
|
6796
6796
|
B(j), p == null || p(Array.from(j));
|
|
6797
6797
|
} else if (Ye.ctrlKey || Ye.metaKey)
|
|
6798
6798
|
B((rt) => {
|
|
@@ -6803,13 +6803,13 @@ function Ay({
|
|
|
6803
6803
|
const rt = /* @__PURE__ */ new Set([tt]);
|
|
6804
6804
|
B(rt), O(de), p == null || p(Array.from(rt));
|
|
6805
6805
|
}
|
|
6806
|
-
}, [s, M,
|
|
6806
|
+
}, [s, M, E, D, f, p, o]), Se = X(async () => {
|
|
6807
6807
|
if (!_e || D.size === 0) return;
|
|
6808
6808
|
const oe = i || "INBOX";
|
|
6809
6809
|
try {
|
|
6810
6810
|
const de = await _e.trashEmails(t, Array.from(D), oe);
|
|
6811
6811
|
if (console.log("Trash result:", de), de.success && de.moved > 0) {
|
|
6812
|
-
|
|
6812
|
+
N((tt) => tt.filter((rt) => !D.has(rt.uid)));
|
|
6813
6813
|
const Ye = Array.from(D);
|
|
6814
6814
|
B(/* @__PURE__ */ new Set()), g == null || g(Ye);
|
|
6815
6815
|
} else
|
|
@@ -6824,7 +6824,7 @@ function Ay({
|
|
|
6824
6824
|
try {
|
|
6825
6825
|
const de = await _e.archiveEmails(t, Array.from(D), oe);
|
|
6826
6826
|
if (console.log("Archive result:", de), de.success && de.archived > 0) {
|
|
6827
|
-
|
|
6827
|
+
N((tt) => tt.filter((rt) => !D.has(rt.uid)));
|
|
6828
6828
|
const Ye = Array.from(D);
|
|
6829
6829
|
B(/* @__PURE__ */ new Set()), g == null || g(Ye);
|
|
6830
6830
|
} else
|
|
@@ -6834,13 +6834,13 @@ function Ay({
|
|
|
6834
6834
|
console.error("Archive error:", Ye), R(Ye.message), m == null || m(Ye);
|
|
6835
6835
|
}
|
|
6836
6836
|
}, [_e, t, D, i, g, m]), qe = X(() => {
|
|
6837
|
-
if (D.size ===
|
|
6837
|
+
if (D.size === E.length)
|
|
6838
6838
|
B(/* @__PURE__ */ new Set()), p == null || p([]);
|
|
6839
6839
|
else {
|
|
6840
|
-
const oe = new Set(
|
|
6840
|
+
const oe = new Set(E.map((de) => de.uid));
|
|
6841
6841
|
B(oe), p == null || p(Array.from(oe));
|
|
6842
6842
|
}
|
|
6843
|
-
}, [
|
|
6843
|
+
}, [E, D.size, p]), ze = X(() => {
|
|
6844
6844
|
B(/* @__PURE__ */ new Set()), p == null || p([]);
|
|
6845
6845
|
}, [p]), He = {
|
|
6846
6846
|
delete: Se,
|
|
@@ -6854,8 +6854,8 @@ function Ay({
|
|
|
6854
6854
|
return de.toDateString() === Ye.toDateString() ? de.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : de.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
6855
6855
|
}, L = (oe, de) => /* @__PURE__ */ h.jsx("div", { style: {
|
|
6856
6856
|
padding: "12px 16px",
|
|
6857
|
-
background: de ?
|
|
6858
|
-
borderBottom: `1px solid ${
|
|
6857
|
+
background: de ? v.selectedBackground : oe.seen ? v.cardBackground : v.unreadBackground,
|
|
6858
|
+
borderBottom: `1px solid ${v.border}`,
|
|
6859
6859
|
cursor: "pointer",
|
|
6860
6860
|
transition: "background 0.15s ease"
|
|
6861
6861
|
}, children: /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", gap: "12px" }, children: [
|
|
@@ -6863,7 +6863,7 @@ function Ay({
|
|
|
6863
6863
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6864
6864
|
fontSize: "14px",
|
|
6865
6865
|
fontWeight: oe.seen ? 400 : 600,
|
|
6866
|
-
color:
|
|
6866
|
+
color: v.text,
|
|
6867
6867
|
whiteSpace: "nowrap",
|
|
6868
6868
|
overflow: "hidden",
|
|
6869
6869
|
textOverflow: "ellipsis"
|
|
@@ -6871,7 +6871,7 @@ function Ay({
|
|
|
6871
6871
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6872
6872
|
fontSize: "14px",
|
|
6873
6873
|
fontWeight: oe.seen ? 400 : 500,
|
|
6874
|
-
color: oe.seen ?
|
|
6874
|
+
color: oe.seen ? v.textSecondary : v.text,
|
|
6875
6875
|
marginTop: "2px",
|
|
6876
6876
|
whiteSpace: "nowrap",
|
|
6877
6877
|
overflow: "hidden",
|
|
@@ -6880,31 +6880,31 @@ function Ay({
|
|
|
6880
6880
|
] }),
|
|
6881
6881
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
6882
6882
|
fontSize: "12px",
|
|
6883
|
-
color:
|
|
6883
|
+
color: v.textSecondary,
|
|
6884
6884
|
flexShrink: 0
|
|
6885
6885
|
}, children: Y(oe.date) })
|
|
6886
6886
|
] }) }), ye = (oe) => /* @__PURE__ */ h.jsxs("div", { style: { padding: "24px" }, children: [
|
|
6887
|
-
/* @__PURE__ */ h.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color:
|
|
6888
|
-
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "14px", color:
|
|
6887
|
+
/* @__PURE__ */ h.jsx("h2", { style: { margin: "0 0 8px", fontSize: "20px", color: v.text }, children: Vr(oe.subject) || "(No subject)" }),
|
|
6888
|
+
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "14px", color: v.textSecondary, marginBottom: "16px" }, children: [
|
|
6889
6889
|
"From: ",
|
|
6890
6890
|
Vr(oe.from),
|
|
6891
6891
|
" • ",
|
|
6892
6892
|
new Date(oe.date).toLocaleString()
|
|
6893
6893
|
] }),
|
|
6894
|
-
J ? /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color:
|
|
6894
|
+
J ? /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color: v.textSecondary }, children: "Loading..." }) : re ? /* @__PURE__ */ h.jsx(
|
|
6895
6895
|
"div",
|
|
6896
6896
|
{
|
|
6897
|
-
style: { fontSize: "14px", color:
|
|
6897
|
+
style: { fontSize: "14px", color: v.text },
|
|
6898
6898
|
dangerouslySetInnerHTML: { __html: re }
|
|
6899
6899
|
}
|
|
6900
|
-
) : /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color:
|
|
6900
|
+
) : /* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", color: v.textSecondary }, children: "No content available" })
|
|
6901
6901
|
] }), Ke = (oe, de) => /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6902
6902
|
display: "flex",
|
|
6903
6903
|
alignItems: "center",
|
|
6904
6904
|
gap: "8px",
|
|
6905
6905
|
padding: "8px 16px",
|
|
6906
|
-
background:
|
|
6907
|
-
borderBottom: `1px solid ${
|
|
6906
|
+
background: v.cardBackground,
|
|
6907
|
+
borderBottom: `1px solid ${v.border}`
|
|
6908
6908
|
}, children: [
|
|
6909
6909
|
/* @__PURE__ */ h.jsx(
|
|
6910
6910
|
"button",
|
|
@@ -6913,17 +6913,17 @@ function Ay({
|
|
|
6913
6913
|
style: {
|
|
6914
6914
|
padding: "6px 12px",
|
|
6915
6915
|
background: "transparent",
|
|
6916
|
-
border: `1px solid ${
|
|
6916
|
+
border: `1px solid ${v.border}`,
|
|
6917
6917
|
borderRadius: "6px",
|
|
6918
6918
|
fontSize: "13px",
|
|
6919
6919
|
cursor: "pointer",
|
|
6920
|
-
color:
|
|
6920
|
+
color: v.text
|
|
6921
6921
|
},
|
|
6922
|
-
children: oe.length ===
|
|
6922
|
+
children: oe.length === E.length ? "Deselect All" : "Select All"
|
|
6923
6923
|
}
|
|
6924
6924
|
),
|
|
6925
6925
|
oe.length > 0 && /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
6926
|
-
/* @__PURE__ */ h.jsxs("span", { style: { fontSize: "13px", color:
|
|
6926
|
+
/* @__PURE__ */ h.jsxs("span", { style: { fontSize: "13px", color: v.textSecondary }, children: [
|
|
6927
6927
|
oe.length,
|
|
6928
6928
|
" selected"
|
|
6929
6929
|
] }),
|
|
@@ -6939,10 +6939,10 @@ function Ay({
|
|
|
6939
6939
|
width: "32px",
|
|
6940
6940
|
height: "32px",
|
|
6941
6941
|
background: "transparent",
|
|
6942
|
-
border: `1px solid ${
|
|
6942
|
+
border: `1px solid ${v.border}`,
|
|
6943
6943
|
borderRadius: "6px",
|
|
6944
6944
|
cursor: "pointer",
|
|
6945
|
-
color:
|
|
6945
|
+
color: v.textSecondary
|
|
6946
6946
|
},
|
|
6947
6947
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "archive" })
|
|
6948
6948
|
}
|
|
@@ -6959,10 +6959,10 @@ function Ay({
|
|
|
6959
6959
|
width: "32px",
|
|
6960
6960
|
height: "32px",
|
|
6961
6961
|
background: "transparent",
|
|
6962
|
-
border: `1px solid ${
|
|
6962
|
+
border: `1px solid ${v.border}`,
|
|
6963
6963
|
borderRadius: "6px",
|
|
6964
6964
|
cursor: "pointer",
|
|
6965
|
-
color:
|
|
6965
|
+
color: v.textSecondary
|
|
6966
6966
|
},
|
|
6967
6967
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "delete" })
|
|
6968
6968
|
}
|
|
@@ -6981,10 +6981,10 @@ function Ay({
|
|
|
6981
6981
|
width: "32px",
|
|
6982
6982
|
height: "32px",
|
|
6983
6983
|
background: "transparent",
|
|
6984
|
-
border: `1px solid ${
|
|
6984
|
+
border: `1px solid ${v.border}`,
|
|
6985
6985
|
borderRadius: "6px",
|
|
6986
6986
|
cursor: "pointer",
|
|
6987
|
-
color:
|
|
6987
|
+
color: v.textSecondary
|
|
6988
6988
|
},
|
|
6989
6989
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px" }, children: "refresh" })
|
|
6990
6990
|
}
|
|
@@ -6992,25 +6992,25 @@ function Ay({
|
|
|
6992
6992
|
] }), z = () => /* @__PURE__ */ h.jsx("div", { style: {
|
|
6993
6993
|
padding: "48px",
|
|
6994
6994
|
textAlign: "center",
|
|
6995
|
-
color:
|
|
6995
|
+
color: v.textSecondary
|
|
6996
6996
|
}, children: c }), ae = () => /* @__PURE__ */ h.jsx("div", { style: {
|
|
6997
6997
|
padding: "48px",
|
|
6998
6998
|
textAlign: "center",
|
|
6999
|
-
color:
|
|
7000
|
-
}, children: "Loading..." }), me = b || L, xe = y || ye, Ge = _ || Ke, vt =
|
|
7001
|
-
return
|
|
6999
|
+
color: v.textSecondary
|
|
7000
|
+
}, children: "Loading..." }), me = b || L, xe = y || ye, Ge = _ || Ke, vt = w || z, wt = S || ae;
|
|
7001
|
+
return A && E.length === 0 ? /* @__PURE__ */ h.jsx("div", { style: { background: v.background, width: "100%", height: "100%" }, children: wt() }) : /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", background: v.background, width: "100%", height: "100%" }, children: [
|
|
7002
7002
|
/* @__PURE__ */ h.jsxs("div", { style: {
|
|
7003
7003
|
flex: o && V ? "0 0 50%" : "1",
|
|
7004
7004
|
display: "flex",
|
|
7005
7005
|
flexDirection: "column",
|
|
7006
|
-
borderRight: o && V ? `1px solid ${
|
|
7006
|
+
borderRight: o && V ? `1px solid ${v.border}` : "none",
|
|
7007
7007
|
overflow: "hidden"
|
|
7008
7008
|
}, children: [
|
|
7009
7009
|
s && Ge(Array.from(D), He),
|
|
7010
7010
|
a && /* @__PURE__ */ h.jsx("div", { style: {
|
|
7011
7011
|
padding: "8px 12px",
|
|
7012
|
-
borderBottom: `1px solid ${
|
|
7013
|
-
background:
|
|
7012
|
+
borderBottom: `1px solid ${v.border}`,
|
|
7013
|
+
background: v.background
|
|
7014
7014
|
}, children: /* @__PURE__ */ h.jsxs("div", { style: {
|
|
7015
7015
|
display: "flex",
|
|
7016
7016
|
alignItems: "center",
|
|
@@ -7019,7 +7019,7 @@ function Ay({
|
|
|
7019
7019
|
background: "#f5f5f5",
|
|
7020
7020
|
borderRadius: "6px"
|
|
7021
7021
|
}, children: [
|
|
7022
|
-
/* @__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: v.textSecondary, strokeWidth: "2", children: [
|
|
7023
7023
|
/* @__PURE__ */ h.jsx("circle", { cx: "11", cy: "11", r: "8" }),
|
|
7024
7024
|
/* @__PURE__ */ h.jsx("path", { d: "M21 21l-4.35-4.35" })
|
|
7025
7025
|
] }),
|
|
@@ -7036,7 +7036,7 @@ function Ay({
|
|
|
7036
7036
|
background: "transparent",
|
|
7037
7037
|
outline: "none",
|
|
7038
7038
|
fontSize: "13px",
|
|
7039
|
-
color:
|
|
7039
|
+
color: v.text
|
|
7040
7040
|
}
|
|
7041
7041
|
}
|
|
7042
7042
|
),
|
|
@@ -7053,17 +7053,17 @@ function Ay({
|
|
|
7053
7053
|
alignItems: "center",
|
|
7054
7054
|
justifyContent: "center"
|
|
7055
7055
|
},
|
|
7056
|
-
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: v.textSecondary, strokeWidth: "2", children: /* @__PURE__ */ h.jsx("path", { d: "M18 6L6 18M6 6l12 12" }) })
|
|
7057
7057
|
}
|
|
7058
7058
|
)
|
|
7059
7059
|
] }) }),
|
|
7060
|
-
|
|
7060
|
+
F && /* @__PURE__ */ h.jsx("div", { style: {
|
|
7061
7061
|
padding: "12px 16px",
|
|
7062
7062
|
background: "#fef2f2",
|
|
7063
|
-
color:
|
|
7063
|
+
color: v.danger,
|
|
7064
7064
|
fontSize: "14px",
|
|
7065
|
-
borderBottom: `1px solid ${
|
|
7066
|
-
}, children:
|
|
7065
|
+
borderBottom: `1px solid ${v.border}`
|
|
7066
|
+
}, children: F }),
|
|
7067
7067
|
/* @__PURE__ */ h.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: Be.length === 0 ? vt() : Be.map((oe, de) => /* @__PURE__ */ h.jsx(
|
|
7068
7068
|
"div",
|
|
7069
7069
|
{
|
|
@@ -7088,28 +7088,28 @@ function Ty({
|
|
|
7088
7088
|
showSelectAll: a = !0,
|
|
7089
7089
|
className: l = ""
|
|
7090
7090
|
}) {
|
|
7091
|
-
const [u, c] = I(/* @__PURE__ */ new Set()), [d, f] = I(-1), p = r.filter((
|
|
7092
|
-
c((
|
|
7093
|
-
const C = new Set(
|
|
7094
|
-
return C.has(
|
|
7091
|
+
const [u, c] = I(/* @__PURE__ */ new Set()), [d, f] = I(-1), p = r.filter((w) => u.has(w.id)), g = d >= 0 && d < p.length ? p[d] : null, m = X((w) => {
|
|
7092
|
+
c((S) => {
|
|
7093
|
+
const C = new Set(S);
|
|
7094
|
+
return C.has(w) ? C.delete(w) : C.add(w), t == null || t(Array.from(C)), C;
|
|
7095
7095
|
});
|
|
7096
7096
|
}, [t]), x = X(() => {
|
|
7097
7097
|
if (u.size === r.length)
|
|
7098
7098
|
c(/* @__PURE__ */ new Set()), f(-1), t == null || t([]);
|
|
7099
7099
|
else {
|
|
7100
|
-
const
|
|
7101
|
-
c(
|
|
7100
|
+
const w = new Set(r.map((S) => S.id));
|
|
7101
|
+
c(w), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((S) => S.id));
|
|
7102
7102
|
}
|
|
7103
7103
|
}, [r, u.size, t, n]), b = X(() => {
|
|
7104
7104
|
if (p.length === 0) return;
|
|
7105
|
-
const
|
|
7106
|
-
f(
|
|
7105
|
+
const w = d <= 0 ? p.length - 1 : d - 1;
|
|
7106
|
+
f(w), n == null || n(p[w], w);
|
|
7107
7107
|
}, [p, d, n]), y = X(() => {
|
|
7108
7108
|
if (p.length === 0) return;
|
|
7109
|
-
const
|
|
7110
|
-
f(
|
|
7111
|
-
}, [p, d, n]), _ = X((
|
|
7112
|
-
i == null || i(
|
|
7109
|
+
const w = d >= p.length - 1 ? 0 : d + 1;
|
|
7110
|
+
f(w), n == null || n(p[w], w);
|
|
7111
|
+
}, [p, d, n]), _ = X((w) => {
|
|
7112
|
+
i == null || i(w, p, g);
|
|
7113
7113
|
}, [i, p, g]);
|
|
7114
7114
|
return Le.useEffect(() => {
|
|
7115
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));
|
|
@@ -7159,36 +7159,36 @@ function Ty({
|
|
|
7159
7159
|
)
|
|
7160
7160
|
] })
|
|
7161
7161
|
] }),
|
|
7162
|
-
/* @__PURE__ */ h.jsx("div", { className: "space-y-1", children: r.map((
|
|
7163
|
-
const
|
|
7162
|
+
/* @__PURE__ */ h.jsx("div", { className: "space-y-1", children: r.map((w) => {
|
|
7163
|
+
const S = u.has(w.id), C = (g == null ? void 0 : g.id) === w.id;
|
|
7164
7164
|
return /* @__PURE__ */ h.jsxs(
|
|
7165
7165
|
"div",
|
|
7166
7166
|
{
|
|
7167
|
-
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${C ? "bg-blue-50 ring-1 ring-blue-200" :
|
|
7168
|
-
onClick: () => m(
|
|
7167
|
+
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${C ? "bg-blue-50 ring-1 ring-blue-200" : S ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
|
|
7168
|
+
onClick: () => m(w.id),
|
|
7169
7169
|
children: [
|
|
7170
|
-
/* @__PURE__ */ h.jsx("span", { className: `material-icons text-lg ${
|
|
7171
|
-
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(
|
|
7170
|
+
/* @__PURE__ */ h.jsx("span", { className: `material-icons text-lg ${S ? "text-blue-500" : "text-neutral-300"}`, children: S ? "check_box" : "check_box_outline_blank" }),
|
|
7171
|
+
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(w, S, C) })
|
|
7172
7172
|
]
|
|
7173
7173
|
},
|
|
7174
|
-
|
|
7174
|
+
w.id
|
|
7175
7175
|
);
|
|
7176
7176
|
}) }),
|
|
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((
|
|
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((w) => {
|
|
7178
7178
|
var C;
|
|
7179
|
-
const
|
|
7179
|
+
const S = ((C = w.disabled) == null ? void 0 : C.call(w, p)) ?? !1;
|
|
7180
7180
|
return /* @__PURE__ */ h.jsxs(
|
|
7181
7181
|
"button",
|
|
7182
7182
|
{
|
|
7183
|
-
onClick: () => _(
|
|
7184
|
-
disabled:
|
|
7185
|
-
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${
|
|
7183
|
+
onClick: () => _(w.id),
|
|
7184
|
+
disabled: S,
|
|
7185
|
+
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${S ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
|
|
7186
7186
|
children: [
|
|
7187
|
-
|
|
7188
|
-
|
|
7187
|
+
w.icon && /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: w.icon }),
|
|
7188
|
+
w.label
|
|
7189
7189
|
]
|
|
7190
7190
|
},
|
|
7191
|
-
|
|
7191
|
+
w.id
|
|
7192
7192
|
);
|
|
7193
7193
|
}) })
|
|
7194
7194
|
] });
|
|
@@ -7285,23 +7285,23 @@ function Au(r, e, t) {
|
|
|
7285
7285
|
u = !0;
|
|
7286
7286
|
const _ = p.addedNodes;
|
|
7287
7287
|
for (let C = 0; C < _.length; C++) {
|
|
7288
|
-
const
|
|
7289
|
-
if (
|
|
7288
|
+
const v = _[C], E = Ru(v), N = v.parentNode;
|
|
7289
|
+
if (N != null && v !== l && E === null && !Is(v, N, r)) {
|
|
7290
7290
|
if (vr) {
|
|
7291
|
-
const
|
|
7292
|
-
|
|
7291
|
+
const A = v.innerText || v.nodeValue;
|
|
7292
|
+
A && (c += A);
|
|
7293
7293
|
}
|
|
7294
|
-
|
|
7294
|
+
N.removeChild(v);
|
|
7295
7295
|
}
|
|
7296
7296
|
}
|
|
7297
|
-
const
|
|
7298
|
-
if (
|
|
7297
|
+
const w = p.removedNodes, S = w.length;
|
|
7298
|
+
if (S > 0) {
|
|
7299
7299
|
let C = 0;
|
|
7300
|
-
for (let
|
|
7301
|
-
const
|
|
7302
|
-
(Is(
|
|
7300
|
+
for (let v = 0; v < S; v++) {
|
|
7301
|
+
const E = w[v];
|
|
7302
|
+
(Is(E, m, r) || l === E) && (m.appendChild(E), C++);
|
|
7303
7303
|
}
|
|
7304
|
-
|
|
7304
|
+
S !== C && s.set(b, y);
|
|
7305
7305
|
}
|
|
7306
7306
|
}
|
|
7307
7307
|
}
|
|
@@ -8017,28 +8017,28 @@ function oh(r, e, t) {
|
|
|
8017
8017
|
lo(f, 0, u - 1, g ? null : d), g && (d.textContent = "");
|
|
8018
8018
|
}
|
|
8019
8019
|
} else (function(g, m, x, b, y, _) {
|
|
8020
|
-
const
|
|
8021
|
-
let C,
|
|
8022
|
-
for (;
|
|
8023
|
-
const R = m[
|
|
8024
|
-
if (R === D)
|
|
8020
|
+
const w = b - 1, S = y - 1;
|
|
8021
|
+
let C, v, E = _.getFirstChild(), N = 0, A = 0;
|
|
8022
|
+
for (; N <= w && A <= S; ) {
|
|
8023
|
+
const R = m[N], D = x[A];
|
|
8024
|
+
if (R === D) E = $s(Sn(D, _.element)), N++, A++;
|
|
8025
8025
|
else {
|
|
8026
|
-
C === void 0 && (C = new Set(m)),
|
|
8027
|
-
const M =
|
|
8026
|
+
C === void 0 && (C = new Set(m)), v === void 0 && (v = new Set(x));
|
|
8027
|
+
const M = v.has(R), O = C.has(D);
|
|
8028
8028
|
if (M) if (O) {
|
|
8029
8029
|
const V = Ui(_t, D);
|
|
8030
|
-
V ===
|
|
8031
|
-
} else Vi(D, _.withBefore(
|
|
8032
|
-
else
|
|
8030
|
+
V === E ? E = $s(Sn(D, _.element)) : (_.withBefore(E).insertChild(V), Sn(D, _.element)), N++, A++;
|
|
8031
|
+
} else Vi(D, _.withBefore(E)), A++;
|
|
8032
|
+
else E = $s(uo(R)), Hi(R, _.element), N++;
|
|
8033
8033
|
}
|
|
8034
8034
|
const B = Wt.get(D);
|
|
8035
8035
|
B !== null && Q(B) && (Kt === null && (Kt = B.getFormat()), Ot === "" && (Ot = B.getStyle()));
|
|
8036
8036
|
}
|
|
8037
|
-
const
|
|
8038
|
-
if (
|
|
8039
|
-
const R = x[
|
|
8040
|
-
ao(x, g,
|
|
8041
|
-
} else
|
|
8037
|
+
const T = N > w, F = A > S;
|
|
8038
|
+
if (T && !F) {
|
|
8039
|
+
const R = x[S + 1], D = R === void 0 ? null : _t.getElementByKey(R);
|
|
8040
|
+
ao(x, g, A, S, _.withBefore(D));
|
|
8041
|
+
} else F && !T && lo(m, N, w, _.element);
|
|
8042
8042
|
})(o, f, p, u, c, a);
|
|
8043
8043
|
}
|
|
8044
8044
|
ms(o) && (ut += ur), d.__lexicalTextContent = ut, ut = l + ut;
|
|
@@ -8395,12 +8395,12 @@ function Wl(r, e, t) {
|
|
|
8395
8395
|
}
|
|
8396
8396
|
} else {
|
|
8397
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,
|
|
8399
|
-
for (let
|
|
8400
|
-
const C = f[
|
|
8401
|
-
if (Q(C) &&
|
|
8398
|
+
let _ = Ff, w = !1;
|
|
8399
|
+
for (let S = 0; S < p; S++) {
|
|
8400
|
+
const C = f[S], v = C.getTextContentSize();
|
|
8401
|
+
if (Q(C) && v !== 0 && !(S === 0 && C.__key === b && m === v || S === p - 1 && C.__key === y && x === 0) && (w = !0, _ &= C.getFormat(), _ === 0)) break;
|
|
8402
8402
|
}
|
|
8403
|
-
a.format =
|
|
8403
|
+
a.format = w ? _ : 0;
|
|
8404
8404
|
}
|
|
8405
8405
|
}
|
|
8406
8406
|
ne(e, Ro, void 0);
|
|
@@ -9092,7 +9092,7 @@ class dn extends bs {
|
|
|
9092
9092
|
Et();
|
|
9093
9093
|
const t = this.getLatest(), n = t.getTextContent(), i = t.__key, s = xr(), o = new Set(e), a = [], l = n.length;
|
|
9094
9094
|
let u = "";
|
|
9095
|
-
for (let
|
|
9095
|
+
for (let S = 0; S < l; S++) u !== "" && o.has(S) && (a.push(u), u = ""), u += n[S];
|
|
9096
9096
|
u !== "" && a.push(u);
|
|
9097
9097
|
const c = a.length;
|
|
9098
9098
|
if (c === 0) return [];
|
|
@@ -9103,24 +9103,24 @@ class dn extends bs {
|
|
|
9103
9103
|
let b = !1;
|
|
9104
9104
|
t.isSegmented() ? (p = at(d), p.__format = g, p.__style = m, p.__detail = x, b = !0) : (p = t.getWritable(), p.__text = d);
|
|
9105
9105
|
const y = le(), _ = [p];
|
|
9106
|
-
let
|
|
9107
|
-
for (let
|
|
9108
|
-
const C = a[
|
|
9109
|
-
|
|
9110
|
-
const
|
|
9106
|
+
let w = d.length;
|
|
9107
|
+
for (let S = 1; S < c; S++) {
|
|
9108
|
+
const C = a[S], v = C.length, E = at(C).getWritable();
|
|
9109
|
+
E.__format = g, E.__style = m, E.__detail = x;
|
|
9110
|
+
const N = E.__key, A = w + v;
|
|
9111
9111
|
if (H(y)) {
|
|
9112
|
-
const
|
|
9113
|
-
|
|
9112
|
+
const T = y.anchor, F = y.focus;
|
|
9113
|
+
T.key === i && T.type === "text" && T.offset > w && T.offset <= A && (T.key = N, T.offset -= w, y.dirty = !0), F.key === i && F.type === "text" && F.offset > w && F.offset <= A && (F.key = N, F.offset -= w, y.dirty = !0);
|
|
9114
9114
|
}
|
|
9115
|
-
s === i && ht(
|
|
9115
|
+
s === i && ht(N), w = A, _.push(E);
|
|
9116
9116
|
}
|
|
9117
9117
|
if (f !== null) {
|
|
9118
|
-
(function(
|
|
9119
|
-
const
|
|
9120
|
-
|
|
9118
|
+
(function(v) {
|
|
9119
|
+
const E = v.getPreviousSibling(), N = v.getNextSibling();
|
|
9120
|
+
E !== null && qi(E), N !== null && qi(N);
|
|
9121
9121
|
})(this);
|
|
9122
|
-
const
|
|
9123
|
-
b ? (
|
|
9122
|
+
const S = f.getWritable(), C = this.getIndexWithinParent();
|
|
9123
|
+
b ? (S.splice(C, 0, _), this.remove()) : S.splice(C, 1, _), H(y) && Yi(y, f, C, c - 1);
|
|
9124
9124
|
}
|
|
9125
9125
|
return _;
|
|
9126
9126
|
}
|
|
@@ -9497,8 +9497,8 @@ class Dr {
|
|
|
9497
9497
|
const t = this.anchor, n = this.focus, i = this.format, s = this.style;
|
|
9498
9498
|
let o = t, a = n;
|
|
9499
9499
|
!this.isCollapsed() && n.isBefore(t) && (o = n, a = t), o.type === "element" && function(x, b, y, _) {
|
|
9500
|
-
const
|
|
9501
|
-
C.setFormat(y), C.setStyle(_),
|
|
9500
|
+
const w = x.getNode(), S = w.getChildAtIndex(x.offset), C = at(), v = bt(w) ? ot().append(C) : C;
|
|
9501
|
+
C.setFormat(y), C.setStyle(_), S === null ? w.append(v) : S.insertBefore(v), x.is(b) && b.set(C.__key, 0, "text"), x.set(C.__key, 0, "text");
|
|
9502
9502
|
}(o, a, i, s);
|
|
9503
9503
|
const l = o.offset;
|
|
9504
9504
|
let u = a.offset;
|
|
@@ -9536,8 +9536,8 @@ class Dr {
|
|
|
9536
9536
|
const _ = at(e);
|
|
9537
9537
|
if (_.setFormat(i), _.setStyle(s), _.select(), l === 0) f.insertBefore(_, !1);
|
|
9538
9538
|
else {
|
|
9539
|
-
const [
|
|
9540
|
-
|
|
9539
|
+
const [w] = f.splitText(l);
|
|
9540
|
+
w.insertAfter(_, !1);
|
|
9541
9541
|
}
|
|
9542
9542
|
return void (_.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
|
|
9543
9543
|
}
|
|
@@ -9553,37 +9553,37 @@ class Dr {
|
|
|
9553
9553
|
while (y.isInline());
|
|
9554
9554
|
if (a.type === "text" && (u !== 0 || m.getTextContent() === "") || a.type === "element" && m.getIndexWithinParent() < u) if (Q(m) && !m.isToken() && u !== m.getTextContentSize()) {
|
|
9555
9555
|
if (m.isSegmented()) {
|
|
9556
|
-
const
|
|
9557
|
-
m.replace(
|
|
9556
|
+
const E = at(m.getTextContent());
|
|
9557
|
+
m.replace(E), m = E;
|
|
9558
9558
|
}
|
|
9559
9559
|
bt(a.getNode()) || a.type !== "text" || (m = m.spliceText(0, u, "")), x.add(m.__key);
|
|
9560
9560
|
} else {
|
|
9561
|
-
const
|
|
9562
|
-
|
|
9561
|
+
const E = m.getParentOrThrow();
|
|
9562
|
+
E.canBeEmpty() || E.getChildrenSize() !== 1 ? m.remove() : E.remove();
|
|
9563
9563
|
}
|
|
9564
9564
|
else x.add(m.__key);
|
|
9565
|
-
const
|
|
9566
|
-
for (let
|
|
9567
|
-
const
|
|
9568
|
-
if (
|
|
9569
|
-
|
|
9565
|
+
const w = y.getChildren(), S = new Set(c), C = b.is(y), v = b.isInline() && f.getNextSibling() === null ? b : f;
|
|
9566
|
+
for (let E = w.length - 1; E >= 0; E--) {
|
|
9567
|
+
const N = w[E];
|
|
9568
|
+
if (N.is(f) || P(N) && N.isParentOf(f)) break;
|
|
9569
|
+
N.isAttached() && (!S.has(N) || N.is(_) ? C || v.insertAfter(N, !1) : N.remove());
|
|
9570
9570
|
}
|
|
9571
9571
|
if (!C) {
|
|
9572
|
-
let
|
|
9573
|
-
for (;
|
|
9574
|
-
const
|
|
9575
|
-
(
|
|
9572
|
+
let E = y, N = null;
|
|
9573
|
+
for (; E !== null; ) {
|
|
9574
|
+
const A = E.getChildren(), T = A.length;
|
|
9575
|
+
(T === 0 || A[T - 1].is(N)) && (x.delete(E.__key), N = E), E = E.getParent();
|
|
9576
9576
|
}
|
|
9577
9577
|
}
|
|
9578
9578
|
if (f.isToken()) if (l === p) f.select();
|
|
9579
9579
|
else {
|
|
9580
|
-
const
|
|
9581
|
-
|
|
9580
|
+
const E = at(e);
|
|
9581
|
+
E.select(), f.replace(E);
|
|
9582
9582
|
}
|
|
9583
9583
|
else f = f.spliceText(l, p - l, e, !0), f.getTextContent() === "" ? f.remove() : f.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
9584
|
-
for (let
|
|
9585
|
-
const
|
|
9586
|
-
x.has(
|
|
9584
|
+
for (let E = 1; E < d; E++) {
|
|
9585
|
+
const N = c[E], A = N.__key;
|
|
9586
|
+
x.has(A) || N.remove();
|
|
9587
9587
|
}
|
|
9588
9588
|
}
|
|
9589
9589
|
}
|
|
@@ -9615,12 +9615,12 @@ class Dr {
|
|
|
9615
9615
|
formatText(e, t = null) {
|
|
9616
9616
|
if (this.isCollapsed()) return this.toggleFormat(e), void ht(null);
|
|
9617
9617
|
const n = this.getNodes(), i = [];
|
|
9618
|
-
for (const
|
|
9619
|
-
const s = (
|
|
9620
|
-
n.forEach((
|
|
9621
|
-
if (ln(
|
|
9622
|
-
const C =
|
|
9623
|
-
|
|
9618
|
+
for (const w of n) Q(w) && i.push(w);
|
|
9619
|
+
const s = (w) => {
|
|
9620
|
+
n.forEach((S) => {
|
|
9621
|
+
if (ln(S)) {
|
|
9622
|
+
const C = S.getFormatFlags(e, w);
|
|
9623
|
+
S.setTextFormat(C);
|
|
9624
9624
|
}
|
|
9625
9625
|
});
|
|
9626
9626
|
}, o = i.length;
|
|
@@ -9637,17 +9637,17 @@ class Dr {
|
|
|
9637
9637
|
if (g === y) return;
|
|
9638
9638
|
if (Ar(p) || g === 0 && y === p.getTextContentSize()) p.setFormat(m);
|
|
9639
9639
|
else {
|
|
9640
|
-
const
|
|
9641
|
-
|
|
9640
|
+
const w = p.splitText(g, y), S = g === 0 ? w[0] : w[1];
|
|
9641
|
+
S.setFormat(m), c.type === "text" && c.set(S.__key, 0, "text"), d.type === "text" && d.set(S.__key, y - g, "text");
|
|
9642
9642
|
}
|
|
9643
9643
|
return void (this.format = m);
|
|
9644
9644
|
}
|
|
9645
9645
|
g === 0 || Ar(p) || ([, p] = p.splitText(g), g = 0), p.setFormat(m);
|
|
9646
9646
|
const _ = b.getFormatFlags(e, m);
|
|
9647
9647
|
y > 0 && (y === b.getTextContentSize() || Ar(b) || ([b] = b.splitText(y)), b.setFormat(_));
|
|
9648
|
-
for (let
|
|
9649
|
-
const
|
|
9650
|
-
|
|
9648
|
+
for (let w = f + 1; w < x; w++) {
|
|
9649
|
+
const S = i[w], C = S.getFormatFlags(e, _);
|
|
9650
|
+
S.setFormat(C);
|
|
9651
9651
|
}
|
|
9652
9652
|
c.type === "text" && c.set(p.__key, g, "text"), d.type === "text" && d.set(b.__key, y, "text"), this.format = m | _;
|
|
9653
9653
|
}
|
|
@@ -9691,8 +9691,8 @@ class Dr {
|
|
|
9691
9691
|
let y = m;
|
|
9692
9692
|
const _ = [m];
|
|
9693
9693
|
for (; y !== b; ) y.getNextSibling() || K(140), y = y.getNextSibling(), _.push(y);
|
|
9694
|
-
let
|
|
9695
|
-
for (const
|
|
9694
|
+
let w = g;
|
|
9695
|
+
for (const S of _) w = w.insertAfter(S);
|
|
9696
9696
|
}(n, c));
|
|
9697
9697
|
const f = bn(o, gr);
|
|
9698
9698
|
l && P(f) && (l.canMergeWhenEmpty() || gr(u)) && (f.append(...l.getChildren()), l.remove()), P(n) && n.isEmpty() && n.remove(), o.selectEnd();
|
|
@@ -9779,8 +9779,8 @@ class Dr {
|
|
|
9779
9779
|
P(y) ? y.selectEnd() : y.getParentOrThrow().selectEnd();
|
|
9780
9780
|
}
|
|
9781
9781
|
u.anchorNode === f.startContainer && u.anchorOffset === f.startOffset || function(y) {
|
|
9782
|
-
const _ = y.focus,
|
|
9783
|
-
mr(
|
|
9782
|
+
const _ = y.focus, w = y.anchor, S = w.key, C = w.offset, v = w.type;
|
|
9783
|
+
mr(w, _.key, _.offset, _.type), mr(_, S, C, v), y._cachedNodes = null;
|
|
9784
9784
|
}(this);
|
|
9785
9785
|
}
|
|
9786
9786
|
}
|
|
@@ -10060,21 +10060,21 @@ function xh(r, e, t, n, i, s, o) {
|
|
|
10060
10060
|
const a = n.anchorNode, l = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
|
|
10061
10061
|
if (i.has("collaboration") && d !== s || d !== null && Go(d)) return;
|
|
10062
10062
|
if (!H(e)) return void (r !== null && Zn(t, a, l) && n.removeAllRanges());
|
|
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,
|
|
10064
|
-
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, w = e.format, S = e.style, C = e.isCollapsed();
|
|
10064
|
+
let v = x, E = b, N = !1;
|
|
10065
10065
|
if (f.type === "text") {
|
|
10066
|
-
|
|
10066
|
+
v = zi(x);
|
|
10067
10067
|
const B = f.getNode();
|
|
10068
|
-
|
|
10069
|
-
} else H(r) && r.anchor.type === "text" && (
|
|
10070
|
-
var
|
|
10071
|
-
if (p.type === "text" && (
|
|
10068
|
+
N = B.getFormat() !== w || B.getStyle() !== S;
|
|
10069
|
+
} else H(r) && r.anchor.type === "text" && (N = !0);
|
|
10070
|
+
var A, T, F, R, D;
|
|
10071
|
+
if (p.type === "text" && (E = zi(b)), v !== null && E !== null && (C && (r === null || N || H(r) && (r.format !== w || r.style !== S)) && (A = w, T = S, F = y, R = g, D = performance.now(), Qu = [A, T, F, R, D]), u !== y || c !== _ || a !== v || l !== E || n.type === "Range" && C || (d !== null && s.contains(d) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
10072
10072
|
try {
|
|
10073
|
-
n.setBaseAndExtent(
|
|
10073
|
+
n.setBaseAndExtent(v, y, E, _);
|
|
10074
10074
|
} catch {
|
|
10075
10075
|
}
|
|
10076
10076
|
if (!i.has("skip-scroll-into-view") && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
10077
|
-
const B = e instanceof Dr && e.anchor.type === "element" ?
|
|
10077
|
+
const B = e instanceof Dr && e.anchor.type === "element" ? v.childNodes[y] || null : n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
10078
10078
|
if (B !== null) {
|
|
10079
10079
|
let M;
|
|
10080
10080
|
if (B instanceof Text) {
|
|
@@ -10229,8 +10229,8 @@ function br(r, e) {
|
|
|
10229
10229
|
if (r._pendingEditorState = null, r._editorState = t, !i && l && p !== null) {
|
|
10230
10230
|
ft = r, dt = t, kt = !1, r._updating = !0;
|
|
10231
10231
|
try {
|
|
10232
|
-
const C = r._dirtyType,
|
|
10233
|
-
p.disconnect(), g = lh(s, t, r, C,
|
|
10232
|
+
const C = r._dirtyType, v = r._dirtyElements, E = r._dirtyLeaves;
|
|
10233
|
+
p.disconnect(), g = lh(s, t, r, C, v, E);
|
|
10234
10234
|
} catch (C) {
|
|
10235
10235
|
if (C instanceof Error && r._onError(C), Gs) throw C;
|
|
10236
10236
|
return pc(r, null, n, t), Bu(r), r._dirtyType = sn, Gs = !0, br(r, s), void (Gs = !1);
|
|
@@ -10240,54 +10240,54 @@ function br(r, e) {
|
|
|
10240
10240
|
}
|
|
10241
10241
|
t._readOnly || (t._readOnly = !0);
|
|
10242
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,
|
|
10244
|
-
const
|
|
10245
|
-
let
|
|
10246
|
-
const
|
|
10247
|
-
let
|
|
10248
|
-
for (
|
|
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, v) {
|
|
10244
|
+
const E = C._decorators;
|
|
10245
|
+
let N = C._pendingDecorators || E;
|
|
10246
|
+
const A = v._nodeMap;
|
|
10247
|
+
let T;
|
|
10248
|
+
for (T in N) A.has(T) || (N === E && (N = ju(C)), delete N[T]);
|
|
10249
10249
|
}(r, t);
|
|
10250
|
-
const
|
|
10251
|
-
if (r._editable &&
|
|
10250
|
+
const w = i ? null : jt(r._window);
|
|
10251
|
+
if (r._editable && w !== null && (l || a === null || a.dirty)) {
|
|
10252
10252
|
ft = r, dt = t;
|
|
10253
10253
|
try {
|
|
10254
10254
|
if (p !== null && p.disconnect(), l || a === null || a.dirty) {
|
|
10255
10255
|
const C = r._blockCursorElement;
|
|
10256
|
-
C !== null && Zo(C, r, n), xh(o, a, r,
|
|
10256
|
+
C !== null && Zo(C, r, n), xh(o, a, r, w, y, n);
|
|
10257
10257
|
}
|
|
10258
10258
|
Zf(r, n, a), p !== null && p.observe(n, ia);
|
|
10259
10259
|
} finally {
|
|
10260
10260
|
ft = d, dt = u;
|
|
10261
10261
|
}
|
|
10262
10262
|
}
|
|
10263
|
-
g !== null && function(C,
|
|
10264
|
-
const
|
|
10265
|
-
for (let R = 0; R <
|
|
10266
|
-
const [D, B] =
|
|
10267
|
-
M !== void 0 && D(M, { dirtyLeaves:
|
|
10263
|
+
g !== null && function(C, v, E, N, A) {
|
|
10264
|
+
const T = Array.from(C._listeners.mutation), F = T.length;
|
|
10265
|
+
for (let R = 0; R < F; R++) {
|
|
10266
|
+
const [D, B] = T[R], M = v.get(B);
|
|
10267
|
+
M !== void 0 && D(M, { dirtyLeaves: N, prevEditorState: A, updateTags: E });
|
|
10268
10268
|
}
|
|
10269
10269
|
}(r, g, y, m, s), H(a) || a === null || o !== null && o.is(a) || r.dispatchCommand(Ro, void 0);
|
|
10270
|
-
const
|
|
10271
|
-
|
|
10272
|
-
const
|
|
10273
|
-
|
|
10274
|
-
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes: b, prevEditorState: e || s, tags: y }), function(C,
|
|
10275
|
-
if (C._deferred = [],
|
|
10276
|
-
const
|
|
10270
|
+
const S = r._pendingDecorators;
|
|
10271
|
+
S !== null && (r._decorators = S, r._pendingDecorators = null, Pn("decorator", r, !0, S)), function(C, v, E) {
|
|
10272
|
+
const N = Ml(v), A = Ml(E);
|
|
10273
|
+
N !== A && Pn("textcontent", C, !0, A);
|
|
10274
|
+
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes: b, prevEditorState: e || s, tags: y }), function(C, v) {
|
|
10275
|
+
if (C._deferred = [], v.length !== 0) {
|
|
10276
|
+
const E = C._updating;
|
|
10277
10277
|
C._updating = !0;
|
|
10278
10278
|
try {
|
|
10279
|
-
for (let
|
|
10279
|
+
for (let N = 0; N < v.length; N++) v[N]();
|
|
10280
10280
|
} finally {
|
|
10281
|
-
C._updating =
|
|
10281
|
+
C._updating = E;
|
|
10282
10282
|
}
|
|
10283
10283
|
}
|
|
10284
10284
|
}(r, _), function(C) {
|
|
10285
|
-
const
|
|
10286
|
-
if (
|
|
10287
|
-
const
|
|
10288
|
-
if (
|
|
10289
|
-
const [
|
|
10290
|
-
dc(C,
|
|
10285
|
+
const v = C._updates;
|
|
10286
|
+
if (v.length !== 0) {
|
|
10287
|
+
const E = v.shift();
|
|
10288
|
+
if (E) {
|
|
10289
|
+
const [N, A] = E;
|
|
10290
|
+
dc(C, N, A);
|
|
10291
10291
|
}
|
|
10292
10292
|
}
|
|
10293
10293
|
}(r);
|
|
@@ -10358,56 +10358,56 @@ function dc(r, e, t) {
|
|
|
10358
10358
|
}(r));
|
|
10359
10359
|
const m = r._compositionKey;
|
|
10360
10360
|
e(), s = aa(r, s), function(b, y) {
|
|
10361
|
-
const _ = y.getEditorState()._selection,
|
|
10362
|
-
if (H(
|
|
10363
|
-
const
|
|
10364
|
-
let
|
|
10365
|
-
if (
|
|
10366
|
-
const
|
|
10367
|
-
|
|
10361
|
+
const _ = y.getEditorState()._selection, w = b._selection;
|
|
10362
|
+
if (H(w)) {
|
|
10363
|
+
const S = w.anchor, C = w.focus;
|
|
10364
|
+
let v;
|
|
10365
|
+
if (S.type === "text" && (v = S.getNode(), v.selectionTransform(_, w)), C.type === "text") {
|
|
10366
|
+
const E = C.getNode();
|
|
10367
|
+
v !== E && E.selectionTransform(_, w);
|
|
10368
10368
|
}
|
|
10369
10369
|
}
|
|
10370
10370
|
}(l, r), r._dirtyType !== jr && (s ? function(b, y) {
|
|
10371
|
-
const _ = y._dirtyLeaves,
|
|
10372
|
-
for (const
|
|
10373
|
-
const C =
|
|
10371
|
+
const _ = y._dirtyLeaves, w = b._nodeMap;
|
|
10372
|
+
for (const S of _) {
|
|
10373
|
+
const C = w.get(S);
|
|
10374
10374
|
Q(C) && C.isAttached() && C.isSimpleText() && !C.isUnmergeable() && Nl(C);
|
|
10375
10375
|
}
|
|
10376
10376
|
}(l, r) : function(b, y) {
|
|
10377
|
-
const _ = y._dirtyLeaves,
|
|
10378
|
-
let
|
|
10379
|
-
for (;
|
|
10380
|
-
if (
|
|
10377
|
+
const _ = y._dirtyLeaves, w = y._dirtyElements, S = b._nodeMap, C = xr(), v = /* @__PURE__ */ new Map();
|
|
10378
|
+
let E = _, N = E.size, A = w, T = A.size;
|
|
10379
|
+
for (; N > 0 || T > 0; ) {
|
|
10380
|
+
if (N > 0) {
|
|
10381
10381
|
y._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
10382
|
-
for (const
|
|
10383
|
-
const R =
|
|
10384
|
-
Q(R) && R.isAttached() && R.isSimpleText() && !R.isUnmergeable() && Nl(R), R !== void 0 && oa(R, C) && sa(y, R,
|
|
10382
|
+
for (const F of E) {
|
|
10383
|
+
const R = S.get(F);
|
|
10384
|
+
Q(R) && R.isAttached() && R.isSimpleText() && !R.isUnmergeable() && Nl(R), R !== void 0 && oa(R, C) && sa(y, R, v), _.add(F);
|
|
10385
10385
|
}
|
|
10386
|
-
if (
|
|
10386
|
+
if (E = y._dirtyLeaves, N = E.size, N > 0) {
|
|
10387
10387
|
ki++;
|
|
10388
10388
|
continue;
|
|
10389
10389
|
}
|
|
10390
10390
|
}
|
|
10391
10391
|
y._dirtyLeaves = /* @__PURE__ */ new Set(), y._dirtyElements = /* @__PURE__ */ new Map();
|
|
10392
|
-
for (const
|
|
10393
|
-
const R =
|
|
10392
|
+
for (const F of A) {
|
|
10393
|
+
const R = F[0], D = F[1];
|
|
10394
10394
|
if (R !== "root" && !D) continue;
|
|
10395
|
-
const B =
|
|
10396
|
-
B !== void 0 && oa(B, C) && sa(y, B,
|
|
10395
|
+
const B = S.get(R);
|
|
10396
|
+
B !== void 0 && oa(B, C) && sa(y, B, v), w.set(R, D);
|
|
10397
10397
|
}
|
|
10398
|
-
|
|
10398
|
+
E = y._dirtyLeaves, N = E.size, A = y._dirtyElements, T = A.size, ki++;
|
|
10399
10399
|
}
|
|
10400
|
-
y._dirtyLeaves = _, y._dirtyElements =
|
|
10401
|
-
}(l, r), aa(r), function(b, y, _,
|
|
10402
|
-
const
|
|
10403
|
-
for (const [
|
|
10404
|
-
const
|
|
10405
|
-
|
|
10400
|
+
y._dirtyLeaves = _, y._dirtyElements = w;
|
|
10401
|
+
}(l, r), aa(r), function(b, y, _, w) {
|
|
10402
|
+
const S = b._nodeMap, C = y._nodeMap, v = [];
|
|
10403
|
+
for (const [E] of w) {
|
|
10404
|
+
const N = C.get(E);
|
|
10405
|
+
N !== void 0 && (N.isAttached() || (P(N) && $u(N, E, S, C, v, w), S.has(E) || w.delete(E), v.push(E)));
|
|
10406
10406
|
}
|
|
10407
|
-
for (const
|
|
10408
|
-
for (const
|
|
10409
|
-
const
|
|
10410
|
-
|
|
10407
|
+
for (const E of v) C.delete(E);
|
|
10408
|
+
for (const E of _) {
|
|
10409
|
+
const N = C.get(E);
|
|
10410
|
+
N === void 0 || N.isAttached() || (S.has(E) || _.delete(E), C.delete(E));
|
|
10411
10411
|
}
|
|
10412
10412
|
}(a, l, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (l._flushSync = !0);
|
|
10413
10413
|
const x = l._selection;
|
|
@@ -11066,22 +11066,22 @@ function Dh(r) {
|
|
|
11066
11066
|
const C = x;
|
|
11067
11067
|
x = C.replace, b = C.with, y = C.withKlass || null;
|
|
11068
11068
|
}
|
|
11069
|
-
const _ = x.getType(),
|
|
11070
|
-
|
|
11069
|
+
const _ = x.getType(), w = x.transform(), S = /* @__PURE__ */ new Set();
|
|
11070
|
+
w !== null && S.add(w), p.set(_, { exportDOM: d && d.export ? d.export.get(x) : void 0, klass: x, replace: b, replaceWithKlass: y, transforms: S });
|
|
11071
11071
|
}
|
|
11072
11072
|
}
|
|
11073
11073
|
const g = new ws(o, i, p, { disableEvents: s, namespace: a, theme: n }, c || console.error, function(m, x) {
|
|
11074
|
-
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), _ = (
|
|
11075
|
-
Object.keys(
|
|
11076
|
-
let C = b.get(
|
|
11077
|
-
C === void 0 && (C = [], b.set(
|
|
11074
|
+
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), _ = (w) => {
|
|
11075
|
+
Object.keys(w).forEach((S) => {
|
|
11076
|
+
let C = b.get(S);
|
|
11077
|
+
C === void 0 && (C = [], b.set(S, C)), C.push(w[S]);
|
|
11078
11078
|
});
|
|
11079
11079
|
};
|
|
11080
|
-
return m.forEach((
|
|
11081
|
-
const
|
|
11082
|
-
if (
|
|
11083
|
-
y.add(
|
|
11084
|
-
const C =
|
|
11080
|
+
return m.forEach((w) => {
|
|
11081
|
+
const S = w.klass.importDOM;
|
|
11082
|
+
if (S == null || y.has(S)) return;
|
|
11083
|
+
y.add(S);
|
|
11084
|
+
const C = S.call(w.klass);
|
|
11085
11085
|
C !== null && _(C);
|
|
11086
11086
|
}), x && _(x), b;
|
|
11087
11087
|
}(p, d ? d.import : void 0), f);
|
|
@@ -11553,8 +11553,8 @@ function Gh(r) {
|
|
|
11553
11553
|
let b = x.getNode(), y = 0, _ = 0;
|
|
11554
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
11555
|
y = f, _ = f + p;
|
|
11556
|
-
const
|
|
11557
|
-
y = y >
|
|
11556
|
+
const w = b.getTextContentSize();
|
|
11557
|
+
y = y > w ? w : y, _ = _ > w ? w : _, m.setTextNodeRange(b, y, b, _);
|
|
11558
11558
|
}
|
|
11559
11559
|
n.stopImmediatePropagation();
|
|
11560
11560
|
}
|
|
@@ -11630,8 +11630,8 @@ function Ec(r, e, t, n, i = /* @__PURE__ */ new Map(), s) {
|
|
|
11630
11630
|
const { nodeName: x } = g, b = m._htmlConversions.get(x.toLowerCase());
|
|
11631
11631
|
let y = null;
|
|
11632
11632
|
if (b !== void 0) for (const _ of b) {
|
|
11633
|
-
const
|
|
11634
|
-
|
|
11633
|
+
const w = _(g);
|
|
11634
|
+
w !== null && (y === null || (y.priority || 0) <= (w.priority || 0)) && (y = w);
|
|
11635
11635
|
}
|
|
11636
11636
|
return y !== null ? y.conversion : null;
|
|
11637
11637
|
}(r, e), u = l ? l(r) : null;
|
|
@@ -12195,19 +12195,19 @@ function dp({ content: r }) {
|
|
|
12195
12195
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
12196
12196
|
}
|
|
12197
12197
|
const kc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? cn : Te;
|
|
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":
|
|
12199
|
-
const [
|
|
12200
|
-
|
|
12201
|
-
}, [r]),
|
|
12202
|
-
return (
|
|
12203
|
-
|
|
12204
|
-
typeof R == "function" ? R(
|
|
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": w, ...S }, C) {
|
|
12199
|
+
const [v, E] = I(r.isEditable()), N = X((T) => {
|
|
12200
|
+
T && T.ownerDocument && T.ownerDocument.defaultView ? r.setRootElement(T) : r.setRootElement(null);
|
|
12201
|
+
}, [r]), A = ct(() => /* @__PURE__ */ function(...T) {
|
|
12202
|
+
return (F) => {
|
|
12203
|
+
T.forEach((R) => {
|
|
12204
|
+
typeof R == "function" ? R(F) : R != null && (R.current = F);
|
|
12205
12205
|
});
|
|
12206
12206
|
};
|
|
12207
|
-
}(C,
|
|
12208
|
-
return kc(() => (
|
|
12209
|
-
|
|
12210
|
-
})), [r]), h.jsx("div", { "aria-activedescendant":
|
|
12207
|
+
}(C, N), [N, C]);
|
|
12208
|
+
return kc(() => (E(r.isEditable()), r.registerEditableListener((T) => {
|
|
12209
|
+
E(T);
|
|
12210
|
+
})), [r]), h.jsx("div", { "aria-activedescendant": v ? e : void 0, "aria-autocomplete": v ? t : "none", "aria-controls": v ? n : void 0, "aria-describedby": i, ...s != null ? { "aria-errormessage": s } : {}, "aria-expanded": v && x === "combobox" ? !!o : void 0, ...a != null ? { "aria-invalid": a } : {}, "aria-label": l, "aria-labelledby": u, "aria-multiline": c, "aria-owns": v ? d : void 0, "aria-readonly": !v || void 0, "aria-required": f, autoCapitalize: p, className: g, contentEditable: v, "data-testid": w, id: m, ref: A, role: v ? x : void 0, spellCheck: b, style: y, tabIndex: _, ...S });
|
|
12211
12211
|
}
|
|
12212
12212
|
const hp = su(fp);
|
|
12213
12213
|
function Da(r) {
|
|
@@ -12246,17 +12246,17 @@ function _p(r, e, t, n, i) {
|
|
|
12246
12246
|
if (i) return yp;
|
|
12247
12247
|
if (!(H(s) && H(o) && o.isCollapsed() && s.isCollapsed())) return zt;
|
|
12248
12248
|
const a = function(b, y, _) {
|
|
12249
|
-
const
|
|
12249
|
+
const w = b._nodeMap, S = [];
|
|
12250
12250
|
for (const C of y) {
|
|
12251
|
-
const
|
|
12252
|
-
|
|
12251
|
+
const v = w.get(C);
|
|
12252
|
+
v !== void 0 && S.push(v);
|
|
12253
12253
|
}
|
|
12254
|
-
for (const [C,
|
|
12255
|
-
if (!
|
|
12256
|
-
const
|
|
12257
|
-
|
|
12254
|
+
for (const [C, v] of _) {
|
|
12255
|
+
if (!v) continue;
|
|
12256
|
+
const E = w.get(C);
|
|
12257
|
+
E === void 0 || bt(E) || S.push(E);
|
|
12258
12258
|
}
|
|
12259
|
-
return
|
|
12259
|
+
return S;
|
|
12260
12260
|
}(e, t, n);
|
|
12261
12261
|
if (a.length === 0) return zt;
|
|
12262
12262
|
if (a.length > 1) {
|
|
@@ -12283,8 +12283,8 @@ function vp(r, e) {
|
|
|
12283
12283
|
if (i === null) return bo;
|
|
12284
12284
|
const m = s._selection;
|
|
12285
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),
|
|
12287
|
-
return !(H(
|
|
12286
|
+
const _ = b._nodeMap.get(x), w = y._nodeMap.get(x), S = b._selection, C = y._selection;
|
|
12287
|
+
return !(H(S) && H(C) && S.anchor.type === "element" && S.focus.type === "element" && C.anchor.type === "text" && C.focus.type === "text" || !Q(_) || !Q(w) || _.__parent !== w.__parent) && JSON.stringify(b.read(() => _.exportJSON())) === JSON.stringify(y.read(() => w.exportJSON()));
|
|
12288
12288
|
}(Array.from(a)[0], i, s) ? _i : bo : m !== null ? _i : _o;
|
|
12289
12289
|
})();
|
|
12290
12290
|
return t = c, n = d, f;
|
|
@@ -13349,9 +13349,9 @@ var zr;
|
|
|
13349
13349
|
throw new RangeError("Invalid value");
|
|
13350
13350
|
let g, m;
|
|
13351
13351
|
for (g = c; ; g++) {
|
|
13352
|
-
const _ = Ne.getNumDataCodewords(g, u) * 8,
|
|
13353
|
-
if (
|
|
13354
|
-
m =
|
|
13352
|
+
const _ = Ne.getNumDataCodewords(g, u) * 8, w = o.getTotalBits(l, g);
|
|
13353
|
+
if (w <= _) {
|
|
13354
|
+
m = w;
|
|
13355
13355
|
break;
|
|
13356
13356
|
}
|
|
13357
13357
|
if (g >= d)
|
|
@@ -13362,8 +13362,8 @@ var zr;
|
|
|
13362
13362
|
let x = [];
|
|
13363
13363
|
for (const _ of l) {
|
|
13364
13364
|
t(_.mode.modeBits, 4, x), t(_.numChars, _.mode.numCharCountBits(g), x);
|
|
13365
|
-
for (const
|
|
13366
|
-
x.push(
|
|
13365
|
+
for (const w of _.getData())
|
|
13366
|
+
x.push(w);
|
|
13367
13367
|
}
|
|
13368
13368
|
i(x.length == m);
|
|
13369
13369
|
const b = Ne.getNumDataCodewords(g, u) * 8;
|
|
@@ -13373,7 +13373,7 @@ var zr;
|
|
|
13373
13373
|
let y = [];
|
|
13374
13374
|
for (; y.length * 8 < x.length; )
|
|
13375
13375
|
y.push(0);
|
|
13376
|
-
return x.forEach((_,
|
|
13376
|
+
return x.forEach((_, w) => y[w >>> 3] |= _ << 7 - (w & 7)), new Ne(g, u, y, f);
|
|
13377
13377
|
}
|
|
13378
13378
|
/*-- Accessor methods --*/
|
|
13379
13379
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
@@ -13464,16 +13464,16 @@ var zr;
|
|
|
13464
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);
|
|
13465
13465
|
let x = [];
|
|
13466
13466
|
const b = Ne.reedSolomonComputeDivisor(f);
|
|
13467
|
-
for (let _ = 0,
|
|
13468
|
-
let
|
|
13469
|
-
|
|
13470
|
-
const C = Ne.reedSolomonComputeRemainder(
|
|
13471
|
-
_ < g &&
|
|
13467
|
+
for (let _ = 0, w = 0; _ < d; _++) {
|
|
13468
|
+
let S = l.slice(w, w + m - f + (_ < g ? 0 : 1));
|
|
13469
|
+
w += S.length;
|
|
13470
|
+
const C = Ne.reedSolomonComputeRemainder(S, b);
|
|
13471
|
+
_ < g && S.push(0), x.push(S.concat(C));
|
|
13472
13472
|
}
|
|
13473
13473
|
let y = [];
|
|
13474
13474
|
for (let _ = 0; _ < x[0].length; _++)
|
|
13475
|
-
x.forEach((
|
|
13476
|
-
(_ != m - f ||
|
|
13475
|
+
x.forEach((w, S) => {
|
|
13476
|
+
(_ != m - f || S >= g) && y.push(w[_]);
|
|
13477
13477
|
});
|
|
13478
13478
|
return i(y.length == p), y;
|
|
13479
13479
|
}
|
|
@@ -13948,12 +13948,12 @@ var eg = function() {
|
|
|
13948
13948
|
"boostLevel",
|
|
13949
13949
|
"marginSize",
|
|
13950
13950
|
"imageSettings"
|
|
13951
|
-
]), { style: x } = m, b = Do(m, ["style"]), y = p == null ? void 0 : p.src, _ = Le.useRef(null),
|
|
13951
|
+
]), { style: x } = m, b = Do(m, ["style"]), y = p == null ? void 0 : p.src, _ = Le.useRef(null), w = Le.useRef(null), S = Le.useCallback(
|
|
13952
13952
|
(D) => {
|
|
13953
13953
|
_.current = D, typeof t == "function" ? t(D) : t && (t.current = D);
|
|
13954
13954
|
},
|
|
13955
13955
|
[t]
|
|
13956
|
-
), [C,
|
|
13956
|
+
), [C, v] = Le.useState(!1), { margin: E, cells: N, numCells: A, calculatedImageSettings: T } = Uc({
|
|
13957
13957
|
value: i,
|
|
13958
13958
|
level: o,
|
|
13959
13959
|
minVersion: c,
|
|
@@ -13968,31 +13968,31 @@ var eg = function() {
|
|
|
13968
13968
|
const D = _.current, B = D.getContext("2d");
|
|
13969
13969
|
if (!B)
|
|
13970
13970
|
return;
|
|
13971
|
-
let M =
|
|
13972
|
-
const O =
|
|
13973
|
-
V &&
|
|
13974
|
-
|
|
13975
|
-
|
|
13971
|
+
let M = N;
|
|
13972
|
+
const O = w.current, V = T != null && O !== null && O.complete && O.naturalHeight !== 0 && O.naturalWidth !== 0;
|
|
13973
|
+
V && T.excavation != null && (M = qc(
|
|
13974
|
+
N,
|
|
13975
|
+
T.excavation
|
|
13976
13976
|
));
|
|
13977
13977
|
const U = window.devicePixelRatio || 1;
|
|
13978
13978
|
D.height = D.width = s * U;
|
|
13979
|
-
const re = s /
|
|
13980
|
-
B.scale(re, re), B.fillStyle = a, B.fillRect(0, 0,
|
|
13979
|
+
const re = s / A * U;
|
|
13980
|
+
B.scale(re, re), B.fillStyle = a, B.fillRect(0, 0, A, A), B.fillStyle = l, eg ? B.fill(new Path2D($c(M, E))) : N.forEach(function(q, J) {
|
|
13981
13981
|
q.forEach(function(W, se) {
|
|
13982
|
-
W && B.fillRect(se +
|
|
13982
|
+
W && B.fillRect(se + E, J + E, 1, 1);
|
|
13983
13983
|
});
|
|
13984
|
-
}),
|
|
13984
|
+
}), T && (B.globalAlpha = T.opacity), V && B.drawImage(
|
|
13985
13985
|
O,
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
|
|
13989
|
-
|
|
13986
|
+
T.x + E,
|
|
13987
|
+
T.y + E,
|
|
13988
|
+
T.w,
|
|
13989
|
+
T.h
|
|
13990
13990
|
);
|
|
13991
13991
|
}
|
|
13992
13992
|
}), Le.useEffect(() => {
|
|
13993
|
-
|
|
13993
|
+
v(!1);
|
|
13994
13994
|
}, [y]);
|
|
13995
|
-
const
|
|
13995
|
+
const F = Co({ height: s, width: s }, x);
|
|
13996
13996
|
let R = null;
|
|
13997
13997
|
return y != null && (R = /* @__PURE__ */ Le.createElement(
|
|
13998
13998
|
"img",
|
|
@@ -14001,18 +14001,18 @@ var eg = function() {
|
|
|
14001
14001
|
key: y,
|
|
14002
14002
|
style: { display: "none" },
|
|
14003
14003
|
onLoad: () => {
|
|
14004
|
-
|
|
14004
|
+
v(!0);
|
|
14005
14005
|
},
|
|
14006
|
-
ref:
|
|
14007
|
-
crossOrigin:
|
|
14006
|
+
ref: w,
|
|
14007
|
+
crossOrigin: T == null ? void 0 : T.crossOrigin
|
|
14008
14008
|
}
|
|
14009
14009
|
)), /* @__PURE__ */ Le.createElement(Le.Fragment, null, /* @__PURE__ */ Le.createElement(
|
|
14010
14010
|
"canvas",
|
|
14011
14011
|
Co({
|
|
14012
|
-
style:
|
|
14012
|
+
style: F,
|
|
14013
14013
|
height: s,
|
|
14014
14014
|
width: s,
|
|
14015
|
-
ref:
|
|
14015
|
+
ref: S,
|
|
14016
14016
|
role: "img"
|
|
14017
14017
|
}, b)
|
|
14018
14018
|
), R);
|
|
@@ -14055,11 +14055,11 @@ var Wc = Le.forwardRef(
|
|
|
14055
14055
|
imageSettings: g,
|
|
14056
14056
|
size: s
|
|
14057
14057
|
});
|
|
14058
|
-
let
|
|
14059
|
-
g != null && _ != null && (_.excavation != null && (
|
|
14058
|
+
let w = b, S = null;
|
|
14059
|
+
g != null && _ != null && (_.excavation != null && (w = qc(
|
|
14060
14060
|
b,
|
|
14061
14061
|
_.excavation
|
|
14062
|
-
)),
|
|
14062
|
+
)), S = /* @__PURE__ */ Le.createElement(
|
|
14063
14063
|
"image",
|
|
14064
14064
|
{
|
|
14065
14065
|
href: g.src,
|
|
@@ -14072,7 +14072,7 @@ var Wc = Le.forwardRef(
|
|
|
14072
14072
|
crossOrigin: _.crossOrigin
|
|
14073
14073
|
}
|
|
14074
14074
|
));
|
|
14075
|
-
const C = $c(
|
|
14075
|
+
const C = $c(w, x);
|
|
14076
14076
|
return /* @__PURE__ */ Le.createElement(
|
|
14077
14077
|
"svg",
|
|
14078
14078
|
Co({
|
|
@@ -14092,7 +14092,7 @@ var Wc = Le.forwardRef(
|
|
|
14092
14092
|
}
|
|
14093
14093
|
),
|
|
14094
14094
|
/* @__PURE__ */ Le.createElement("path", { fill: l, d: C, shapeRendering: "crispEdges" }),
|
|
14095
|
-
|
|
14095
|
+
S
|
|
14096
14096
|
);
|
|
14097
14097
|
}
|
|
14098
14098
|
);
|
|
@@ -14215,10 +14215,10 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14215
14215
|
u.dispatchCommand(Nc, void 0);
|
|
14216
14216
|
}, [u]), _ = X(() => {
|
|
14217
14217
|
u.update(() => {
|
|
14218
|
-
const
|
|
14219
|
-
H(
|
|
14218
|
+
const v = le();
|
|
14219
|
+
H(v) && Oh(v, () => al());
|
|
14220
14220
|
});
|
|
14221
|
-
}, [u]),
|
|
14221
|
+
}, [u]), w = {
|
|
14222
14222
|
display: "flex",
|
|
14223
14223
|
alignItems: "center",
|
|
14224
14224
|
justifyContent: "center",
|
|
@@ -14232,14 +14232,14 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14232
14232
|
fontSize: "14px",
|
|
14233
14233
|
fontWeight: 600,
|
|
14234
14234
|
opacity: e ? 0.5 : 1
|
|
14235
|
-
},
|
|
14235
|
+
}, S = `
|
|
14236
14236
|
.mail-editor-toolbar-btn:hover:not(:disabled) {
|
|
14237
14237
|
background: ${r.border};
|
|
14238
14238
|
}
|
|
14239
14239
|
`, C = () => {
|
|
14240
14240
|
setTimeout(() => {
|
|
14241
|
-
var
|
|
14242
|
-
(
|
|
14241
|
+
var v;
|
|
14242
|
+
(v = f.current) != null && v.contains(document.activeElement) || d(!1);
|
|
14243
14243
|
}, 150);
|
|
14244
14244
|
};
|
|
14245
14245
|
return /* @__PURE__ */ h.jsxs(
|
|
@@ -14254,7 +14254,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14254
14254
|
background: r.toolbarBackground
|
|
14255
14255
|
},
|
|
14256
14256
|
children: [
|
|
14257
|
-
/* @__PURE__ */ h.jsx("style", { children:
|
|
14257
|
+
/* @__PURE__ */ h.jsx("style", { children: S }),
|
|
14258
14258
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px" }, children: [
|
|
14259
14259
|
/* @__PURE__ */ h.jsx(
|
|
14260
14260
|
"button",
|
|
@@ -14263,7 +14263,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14263
14263
|
className: "mail-editor-toolbar-btn",
|
|
14264
14264
|
onClick: g,
|
|
14265
14265
|
disabled: e,
|
|
14266
|
-
style:
|
|
14266
|
+
style: w,
|
|
14267
14267
|
title: "Bold (Ctrl+B)",
|
|
14268
14268
|
children: "B"
|
|
14269
14269
|
}
|
|
@@ -14275,7 +14275,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14275
14275
|
className: "mail-editor-toolbar-btn",
|
|
14276
14276
|
onClick: m,
|
|
14277
14277
|
disabled: e,
|
|
14278
|
-
style: { ...
|
|
14278
|
+
style: { ...w, fontStyle: "italic" },
|
|
14279
14279
|
title: "Italic (Ctrl+I)",
|
|
14280
14280
|
children: "I"
|
|
14281
14281
|
}
|
|
@@ -14287,7 +14287,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14287
14287
|
className: "mail-editor-toolbar-btn",
|
|
14288
14288
|
onClick: x,
|
|
14289
14289
|
disabled: e,
|
|
14290
|
-
style: { ...
|
|
14290
|
+
style: { ...w, textDecoration: "underline" },
|
|
14291
14291
|
title: "Underline (Ctrl+U)",
|
|
14292
14292
|
children: "U"
|
|
14293
14293
|
}
|
|
@@ -14310,7 +14310,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14310
14310
|
className: "mail-editor-toolbar-btn",
|
|
14311
14311
|
onClick: b,
|
|
14312
14312
|
disabled: e,
|
|
14313
|
-
style:
|
|
14313
|
+
style: w,
|
|
14314
14314
|
title: "Bullet List",
|
|
14315
14315
|
children: /* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
14316
14316
|
/* @__PURE__ */ h.jsx("circle", { cx: "4", cy: "6", r: "2" }),
|
|
@@ -14329,7 +14329,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14329
14329
|
className: "mail-editor-toolbar-btn",
|
|
14330
14330
|
onClick: y,
|
|
14331
14331
|
disabled: e,
|
|
14332
|
-
style:
|
|
14332
|
+
style: w,
|
|
14333
14333
|
title: "Numbered List",
|
|
14334
14334
|
children: /* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
14335
14335
|
/* @__PURE__ */ h.jsx("text", { x: "2", y: "8", fontSize: "8", fontFamily: "sans-serif", children: "1" }),
|
|
@@ -14359,7 +14359,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14359
14359
|
className: "mail-editor-toolbar-btn",
|
|
14360
14360
|
onClick: _,
|
|
14361
14361
|
disabled: e,
|
|
14362
|
-
style:
|
|
14362
|
+
style: w,
|
|
14363
14363
|
title: "Quote",
|
|
14364
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" }) })
|
|
14365
14365
|
}
|
|
@@ -14434,8 +14434,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14434
14434
|
alignItems: "center",
|
|
14435
14435
|
gap: "8px"
|
|
14436
14436
|
},
|
|
14437
|
-
onMouseEnter: (
|
|
14438
|
-
onMouseLeave: (
|
|
14437
|
+
onMouseEnter: (v) => v.currentTarget.style.background = "#f3f4f6",
|
|
14438
|
+
onMouseLeave: (v) => v.currentTarget.style.background = "transparent",
|
|
14439
14439
|
children: [
|
|
14440
14440
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#3b82f6" }, children: "format_list_bulleted" }),
|
|
14441
14441
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14464,8 +14464,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14464
14464
|
alignItems: "center",
|
|
14465
14465
|
gap: "8px"
|
|
14466
14466
|
},
|
|
14467
|
-
onMouseEnter: (
|
|
14468
|
-
onMouseLeave: (
|
|
14467
|
+
onMouseEnter: (v) => v.currentTarget.style.background = "#f3f4f6",
|
|
14468
|
+
onMouseLeave: (v) => v.currentTarget.style.background = "transparent",
|
|
14469
14469
|
children: [
|
|
14470
14470
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#22c55e" }, children: "spellcheck" }),
|
|
14471
14471
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14494,8 +14494,8 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14494
14494
|
alignItems: "center",
|
|
14495
14495
|
gap: "8px"
|
|
14496
14496
|
},
|
|
14497
|
-
onMouseEnter: (
|
|
14498
|
-
onMouseLeave: (
|
|
14497
|
+
onMouseEnter: (v) => v.currentTarget.style.background = "#f3f4f6",
|
|
14498
|
+
onMouseLeave: (v) => v.currentTarget.style.background = "transparent",
|
|
14499
14499
|
children: [
|
|
14500
14500
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "18px", color: "#9333ea" }, children: "brush" }),
|
|
14501
14501
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -14630,29 +14630,29 @@ function cg({
|
|
|
14630
14630
|
aiProcessingAction: m,
|
|
14631
14631
|
renderAboveToolbar: x
|
|
14632
14632
|
}) {
|
|
14633
|
-
const b = { ...ig, ...i }, [y, _] = Le.useState(!1),
|
|
14633
|
+
const b = { ...ig, ...i }, [y, _] = Le.useState(!1), w = Le.useRef(void 0), [S, C] = Le.useState(r), [v, E] = Le.useState(!1), [N, A] = Le.useState(null), T = g ?? v, F = m ?? N;
|
|
14634
14634
|
Le.useEffect(() => {
|
|
14635
|
-
l !== void 0 && l !==
|
|
14635
|
+
l !== void 0 && l !== w.current && (w.current = l, _(!0));
|
|
14636
14636
|
}, [l]);
|
|
14637
14637
|
const R = X(() => {
|
|
14638
14638
|
_(!1);
|
|
14639
14639
|
}, []), D = (q) => q.replace(/<[^>]*>/g, "").trim(), B = (q) => q.split(`
|
|
14640
14640
|
`).map((J) => `<p>${J || "<br>"}</p>`).join(""), M = async (q) => {
|
|
14641
|
-
const J = D(
|
|
14641
|
+
const J = D(S);
|
|
14642
14642
|
if (!J) return;
|
|
14643
14643
|
const W = q === "restructure" ? d : q === "proofread" ? f : p;
|
|
14644
14644
|
if (W) {
|
|
14645
|
-
|
|
14645
|
+
E(!0), A(q);
|
|
14646
14646
|
try {
|
|
14647
14647
|
const se = await W(J), ce = B(se);
|
|
14648
|
-
C(ce), e == null || e(ce),
|
|
14648
|
+
C(ce), e == null || e(ce), w.current = Date.now(), _(!0);
|
|
14649
14649
|
} catch (se) {
|
|
14650
14650
|
console.error(`AI ${q} failed:`, se);
|
|
14651
14651
|
} finally {
|
|
14652
|
-
|
|
14652
|
+
E(!1), A(null);
|
|
14653
14653
|
}
|
|
14654
14654
|
}
|
|
14655
|
-
}, O = D(
|
|
14655
|
+
}, O = D(S).length > 0, V = {
|
|
14656
14656
|
namespace: "MailEditor",
|
|
14657
14657
|
theme: sg,
|
|
14658
14658
|
onError: (q) => {
|
|
@@ -14765,8 +14765,8 @@ function cg({
|
|
|
14765
14765
|
onAiRestructure: d,
|
|
14766
14766
|
onAiProofread: f,
|
|
14767
14767
|
onAiRewrite: p,
|
|
14768
|
-
aiProcessing:
|
|
14769
|
-
aiProcessingAction:
|
|
14768
|
+
aiProcessing: T,
|
|
14769
|
+
aiProcessingAction: F,
|
|
14770
14770
|
onAiAction: M,
|
|
14771
14771
|
hasContent: O
|
|
14772
14772
|
}
|
|
@@ -14800,7 +14800,7 @@ function cg({
|
|
|
14800
14800
|
/* @__PURE__ */ h.jsx(
|
|
14801
14801
|
lg,
|
|
14802
14802
|
{
|
|
14803
|
-
html: y ?
|
|
14803
|
+
html: y ? S : r,
|
|
14804
14804
|
isExternalUpdate: y,
|
|
14805
14805
|
onImportComplete: R
|
|
14806
14806
|
}
|
|
@@ -14858,10 +14858,10 @@ function My({
|
|
|
14858
14858
|
hideCancelButton: b = !1,
|
|
14859
14859
|
onAiRestructure: y,
|
|
14860
14860
|
onAiProofread: _,
|
|
14861
|
-
onAiRewrite:
|
|
14862
|
-
renderAboveToolbar:
|
|
14861
|
+
onAiRewrite: w,
|
|
14862
|
+
renderAboveToolbar: S
|
|
14863
14863
|
}) {
|
|
14864
|
-
const C = { ...dg, ...c }, [
|
|
14864
|
+
const C = { ...dg, ...c }, [v, E] = I(r), [N, A] = I(""), [T, F] = 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);
|
|
14865
14865
|
Le.useEffect(() => {
|
|
14866
14866
|
a !== void 0 && a !== ge.current && (ge.current = a, M(t), fe(!0));
|
|
14867
14867
|
}, [a, t]);
|
|
@@ -14887,7 +14887,7 @@ function My({
|
|
|
14887
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) => {
|
|
14888
14888
|
V((ae) => ae.filter((me, xe) => xe !== z));
|
|
14889
14889
|
}, He = (z) => z < 1024 ? `${z} B` : z < 1024 * 1024 ? `${(z / 1024).toFixed(1)} KB` : `${(z / (1024 * 1024)).toFixed(1)} MB`, Y = async () => {
|
|
14890
|
-
if (!
|
|
14890
|
+
if (!v.trim()) {
|
|
14891
14891
|
J("Recipient email is required");
|
|
14892
14892
|
return;
|
|
14893
14893
|
}
|
|
@@ -14910,9 +14910,9 @@ function My({
|
|
|
14910
14910
|
};
|
|
14911
14911
|
})
|
|
14912
14912
|
), ae = B.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), me = {
|
|
14913
|
-
to:
|
|
14914
|
-
cc:
|
|
14915
|
-
bcc:
|
|
14913
|
+
to: v.trim(),
|
|
14914
|
+
cc: N.trim() || void 0,
|
|
14915
|
+
bcc: T.trim() || void 0,
|
|
14916
14916
|
subject: R.trim(),
|
|
14917
14917
|
html: ae,
|
|
14918
14918
|
attachments: z,
|
|
@@ -14921,7 +14921,7 @@ function My({
|
|
|
14921
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) => {
|
|
14922
14922
|
var vt;
|
|
14923
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),
|
|
14924
|
+
}), await i(me), E(""), A(""), F(""), D(""), M(""), V([]);
|
|
14925
14925
|
} catch (z) {
|
|
14926
14926
|
J(z instanceof Error ? z.message : "Failed to send email");
|
|
14927
14927
|
} finally {
|
|
@@ -14989,8 +14989,8 @@ function My({
|
|
|
14989
14989
|
"input",
|
|
14990
14990
|
{
|
|
14991
14991
|
type: "email",
|
|
14992
|
-
value:
|
|
14993
|
-
onChange: (z) =>
|
|
14992
|
+
value: v,
|
|
14993
|
+
onChange: (z) => E(z.target.value),
|
|
14994
14994
|
placeholder: "recipient@example.com",
|
|
14995
14995
|
disabled: d || U,
|
|
14996
14996
|
style: L
|
|
@@ -15022,8 +15022,8 @@ function My({
|
|
|
15022
15022
|
"input",
|
|
15023
15023
|
{
|
|
15024
15024
|
type: "email",
|
|
15025
|
-
value:
|
|
15026
|
-
onChange: (z) =>
|
|
15025
|
+
value: N,
|
|
15026
|
+
onChange: (z) => A(z.target.value),
|
|
15027
15027
|
placeholder: "cc@example.com",
|
|
15028
15028
|
disabled: d || U,
|
|
15029
15029
|
style: L
|
|
@@ -15036,8 +15036,8 @@ function My({
|
|
|
15036
15036
|
"input",
|
|
15037
15037
|
{
|
|
15038
15038
|
type: "email",
|
|
15039
|
-
value:
|
|
15040
|
-
onChange: (z) =>
|
|
15039
|
+
value: T,
|
|
15040
|
+
onChange: (z) => F(z.target.value),
|
|
15041
15041
|
placeholder: "bcc@example.com",
|
|
15042
15042
|
disabled: d || U,
|
|
15043
15043
|
style: L
|
|
@@ -15074,8 +15074,8 @@ function My({
|
|
|
15074
15074
|
insertTextTrigger: u,
|
|
15075
15075
|
onAiRestructure: y,
|
|
15076
15076
|
onAiProofread: _,
|
|
15077
|
-
onAiRewrite:
|
|
15078
|
-
renderAboveToolbar:
|
|
15077
|
+
onAiRewrite: w,
|
|
15078
|
+
renderAboveToolbar: S
|
|
15079
15079
|
}
|
|
15080
15080
|
) }) }),
|
|
15081
15081
|
/* @__PURE__ */ h.jsxs("div", { children: [
|
|
@@ -15178,8 +15178,8 @@ function My({
|
|
|
15178
15178
|
{
|
|
15179
15179
|
type: "button",
|
|
15180
15180
|
onClick: Y,
|
|
15181
|
-
disabled: d || U || !
|
|
15182
|
-
style: Ke(!0, d || U || !
|
|
15181
|
+
disabled: d || U || !v.trim() || !R.trim(),
|
|
15182
|
+
style: Ke(!0, d || U || !v.trim() || !R.trim()),
|
|
15183
15183
|
children: [
|
|
15184
15184
|
/* @__PURE__ */ h.jsx(
|
|
15185
15185
|
"span",
|
|
@@ -15234,31 +15234,31 @@ function Ry({
|
|
|
15234
15234
|
}) {
|
|
15235
15235
|
const p = { ...fg, ...d }, [g, m] = I(!1), [x, b] = I(""), y = be(null), _ = be(null);
|
|
15236
15236
|
Te(() => {
|
|
15237
|
-
function
|
|
15238
|
-
y.current && !y.current.contains(
|
|
15237
|
+
function T(F) {
|
|
15238
|
+
y.current && !y.current.contains(F.target) && (m(!1), b(""));
|
|
15239
15239
|
}
|
|
15240
|
-
return document.addEventListener("mousedown",
|
|
15240
|
+
return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
|
|
15241
15241
|
}, []);
|
|
15242
|
-
const
|
|
15243
|
-
(
|
|
15244
|
-
var
|
|
15245
|
-
return ((
|
|
15246
|
-
}
|
|
15247
|
-
),
|
|
15248
|
-
var
|
|
15249
|
-
return ((
|
|
15250
|
-
}), C = e.map((
|
|
15251
|
-
var
|
|
15252
|
-
c > 0 && e.length >= c || (t([...e,
|
|
15253
|
-
}, [e, t, c]),
|
|
15254
|
-
t(e.filter((
|
|
15255
|
-
}, [e, t]),
|
|
15256
|
-
if (!
|
|
15257
|
-
const
|
|
15258
|
-
|
|
15259
|
-
}, [
|
|
15260
|
-
|
|
15261
|
-
}, [
|
|
15242
|
+
const w = r.filter(
|
|
15243
|
+
(T) => {
|
|
15244
|
+
var F;
|
|
15245
|
+
return ((F = T.label) == null ? void 0 : F.toLowerCase().includes(x.toLowerCase())) && !e.includes(T.id);
|
|
15246
|
+
}
|
|
15247
|
+
), S = i && x.trim() && !r.some((T) => {
|
|
15248
|
+
var F;
|
|
15249
|
+
return ((F = T.label) == null ? void 0 : F.toLowerCase()) === x.toLowerCase();
|
|
15250
|
+
}), C = e.map((T) => r.find((F) => F.id === T)).filter(Boolean), v = X((T) => {
|
|
15251
|
+
var F;
|
|
15252
|
+
c > 0 && e.length >= c || (t([...e, T]), b(""), c === 1 ? m(!1) : (F = _.current) == null || F.focus());
|
|
15253
|
+
}, [e, t, c]), E = X((T) => {
|
|
15254
|
+
t(e.filter((F) => F !== T));
|
|
15255
|
+
}, [e, t]), N = X(async () => {
|
|
15256
|
+
if (!S) return;
|
|
15257
|
+
const T = await (s == null ? void 0 : s(x.trim()));
|
|
15258
|
+
T && v(T.id), b("");
|
|
15259
|
+
}, [S, x, s, v]), A = X((T) => {
|
|
15260
|
+
T.key === "Enter" ? (T.preventDefault(), S ? N() : w.length > 0 && v(w[0].id)) : T.key === "Backspace" && !x && e.length > 0 ? E(e[e.length - 1]) : T.key === "Escape" && (m(!1), b(""));
|
|
15261
|
+
}, [S, w, x, e, N, v, E]);
|
|
15262
15262
|
return /* @__PURE__ */ h.jsxs("div", { ref: y, className: f, style: { position: "relative" }, children: [
|
|
15263
15263
|
l && /* @__PURE__ */ h.jsx(
|
|
15264
15264
|
"label",
|
|
@@ -15290,7 +15290,7 @@ function Ry({
|
|
|
15290
15290
|
alignItems: "center"
|
|
15291
15291
|
},
|
|
15292
15292
|
children: [
|
|
15293
|
-
C.map((
|
|
15293
|
+
C.map((T) => /* @__PURE__ */ h.jsxs(
|
|
15294
15294
|
"span",
|
|
15295
15295
|
{
|
|
15296
15296
|
style: {
|
|
@@ -15300,17 +15300,17 @@ function Ry({
|
|
|
15300
15300
|
padding: "2px 8px",
|
|
15301
15301
|
borderRadius: "4px",
|
|
15302
15302
|
fontSize: "13px",
|
|
15303
|
-
background:
|
|
15304
|
-
color:
|
|
15303
|
+
background: T.color || p.chipBackground,
|
|
15304
|
+
color: T.color ? "#fff" : p.chipText
|
|
15305
15305
|
},
|
|
15306
15306
|
children: [
|
|
15307
|
-
|
|
15307
|
+
T.label,
|
|
15308
15308
|
!u && /* @__PURE__ */ h.jsx(
|
|
15309
15309
|
"button",
|
|
15310
15310
|
{
|
|
15311
15311
|
type: "button",
|
|
15312
|
-
onClick: (
|
|
15313
|
-
|
|
15312
|
+
onClick: (F) => {
|
|
15313
|
+
F.stopPropagation(), E(T.id);
|
|
15314
15314
|
},
|
|
15315
15315
|
style: {
|
|
15316
15316
|
border: "none",
|
|
@@ -15326,7 +15326,7 @@ function Ry({
|
|
|
15326
15326
|
)
|
|
15327
15327
|
]
|
|
15328
15328
|
},
|
|
15329
|
-
|
|
15329
|
+
T.id
|
|
15330
15330
|
)),
|
|
15331
15331
|
/* @__PURE__ */ h.jsx(
|
|
15332
15332
|
"input",
|
|
@@ -15334,11 +15334,11 @@ function Ry({
|
|
|
15334
15334
|
ref: _,
|
|
15335
15335
|
type: "text",
|
|
15336
15336
|
value: x,
|
|
15337
|
-
onChange: (
|
|
15338
|
-
b(
|
|
15337
|
+
onChange: (T) => {
|
|
15338
|
+
b(T.target.value), g || m(!0);
|
|
15339
15339
|
},
|
|
15340
15340
|
onFocus: () => m(!0),
|
|
15341
|
-
onKeyDown:
|
|
15341
|
+
onKeyDown: A,
|
|
15342
15342
|
placeholder: C.length === 0 ? n : "",
|
|
15343
15343
|
disabled: u || c > 0 && e.length >= c,
|
|
15344
15344
|
style: {
|
|
@@ -15372,7 +15372,7 @@ function Ry({
|
|
|
15372
15372
|
overflowY: "auto",
|
|
15373
15373
|
zIndex: 50
|
|
15374
15374
|
},
|
|
15375
|
-
children:
|
|
15375
|
+
children: w.length === 0 && !S ? /* @__PURE__ */ h.jsx(
|
|
15376
15376
|
"div",
|
|
15377
15377
|
{
|
|
15378
15378
|
style: {
|
|
@@ -15384,10 +15384,10 @@ function Ry({
|
|
|
15384
15384
|
children: x ? "No matches" : "No options available"
|
|
15385
15385
|
}
|
|
15386
15386
|
) : /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
15387
|
-
|
|
15387
|
+
w.map((T) => /* @__PURE__ */ h.jsxs(
|
|
15388
15388
|
"div",
|
|
15389
15389
|
{
|
|
15390
|
-
onClick: () =>
|
|
15390
|
+
onClick: () => v(T.id),
|
|
15391
15391
|
style: {
|
|
15392
15392
|
padding: "10px 12px",
|
|
15393
15393
|
fontSize: "14px",
|
|
@@ -15397,20 +15397,20 @@ function Ry({
|
|
|
15397
15397
|
alignItems: "center",
|
|
15398
15398
|
justifyContent: "space-between"
|
|
15399
15399
|
},
|
|
15400
|
-
onMouseEnter: (
|
|
15401
|
-
|
|
15400
|
+
onMouseEnter: (F) => {
|
|
15401
|
+
F.currentTarget.style.background = p.hoverBackground || "";
|
|
15402
15402
|
},
|
|
15403
|
-
onMouseLeave: (
|
|
15404
|
-
|
|
15403
|
+
onMouseLeave: (F) => {
|
|
15404
|
+
F.currentTarget.style.background = "";
|
|
15405
15405
|
},
|
|
15406
15406
|
children: [
|
|
15407
|
-
|
|
15407
|
+
T.label,
|
|
15408
15408
|
o && a && /* @__PURE__ */ h.jsx(
|
|
15409
15409
|
"button",
|
|
15410
15410
|
{
|
|
15411
15411
|
type: "button",
|
|
15412
|
-
onClick: (
|
|
15413
|
-
|
|
15412
|
+
onClick: (F) => {
|
|
15413
|
+
F.stopPropagation(), a(T.id);
|
|
15414
15414
|
},
|
|
15415
15415
|
style: {
|
|
15416
15416
|
border: "none",
|
|
@@ -15421,35 +15421,35 @@ function Ry({
|
|
|
15421
15421
|
color: p.textSecondary,
|
|
15422
15422
|
opacity: 0.5
|
|
15423
15423
|
},
|
|
15424
|
-
onMouseEnter: (
|
|
15425
|
-
|
|
15424
|
+
onMouseEnter: (F) => {
|
|
15425
|
+
F.currentTarget.style.opacity = "1", F.currentTarget.style.color = "#ef4444";
|
|
15426
15426
|
},
|
|
15427
|
-
onMouseLeave: (
|
|
15428
|
-
|
|
15427
|
+
onMouseLeave: (F) => {
|
|
15428
|
+
F.currentTarget.style.opacity = "0.5", F.currentTarget.style.color = p.textSecondary || "";
|
|
15429
15429
|
},
|
|
15430
15430
|
children: "×"
|
|
15431
15431
|
}
|
|
15432
15432
|
)
|
|
15433
15433
|
]
|
|
15434
15434
|
},
|
|
15435
|
-
|
|
15435
|
+
T.id
|
|
15436
15436
|
)),
|
|
15437
|
-
|
|
15437
|
+
S && /* @__PURE__ */ h.jsxs(
|
|
15438
15438
|
"div",
|
|
15439
15439
|
{
|
|
15440
|
-
onClick:
|
|
15440
|
+
onClick: N,
|
|
15441
15441
|
style: {
|
|
15442
15442
|
padding: "10px 12px",
|
|
15443
15443
|
fontSize: "14px",
|
|
15444
15444
|
cursor: "pointer",
|
|
15445
15445
|
color: p.primary,
|
|
15446
|
-
borderTop:
|
|
15446
|
+
borderTop: w.length > 0 ? `1px solid ${p.border}` : "none"
|
|
15447
15447
|
},
|
|
15448
|
-
onMouseEnter: (
|
|
15449
|
-
|
|
15448
|
+
onMouseEnter: (T) => {
|
|
15449
|
+
T.currentTarget.style.background = p.hoverBackground || "";
|
|
15450
15450
|
},
|
|
15451
|
-
onMouseLeave: (
|
|
15452
|
-
|
|
15451
|
+
onMouseLeave: (T) => {
|
|
15452
|
+
T.currentTarget.style.background = "";
|
|
15453
15453
|
},
|
|
15454
15454
|
children: [
|
|
15455
15455
|
'+ Create "',
|
|
@@ -15484,32 +15484,32 @@ function jy({
|
|
|
15484
15484
|
className: l = "",
|
|
15485
15485
|
theme: u = {}
|
|
15486
15486
|
}) {
|
|
15487
|
-
const c = { ...hg, ...u }, [d, f] = I(""), [p, g] = I(!1), m = be(null), x = be(null), b = ct(() => e && r.find((
|
|
15487
|
+
const c = { ...hg, ...u }, [d, f] = I(""), [p, g] = I(!1), m = be(null), x = be(null), b = ct(() => e && r.find((E) => E.id === e) || null, [e, r]), y = ct(() => {
|
|
15488
15488
|
if (!d.trim()) return r;
|
|
15489
|
-
const
|
|
15489
|
+
const E = d.toLowerCase();
|
|
15490
15490
|
return r.filter(
|
|
15491
|
-
(
|
|
15492
|
-
var
|
|
15493
|
-
return ((
|
|
15491
|
+
(N) => {
|
|
15492
|
+
var A, T;
|
|
15493
|
+
return ((A = N.label) == null ? void 0 : A.toLowerCase().includes(E)) || ((T = N.notes) == null ? void 0 : T.toLowerCase().includes(E));
|
|
15494
15494
|
}
|
|
15495
15495
|
);
|
|
15496
15496
|
}, [r, d]);
|
|
15497
15497
|
Te(() => {
|
|
15498
|
-
const
|
|
15499
|
-
m.current && !m.current.contains(
|
|
15498
|
+
const E = (N) => {
|
|
15499
|
+
m.current && !m.current.contains(N.target) && g(!1);
|
|
15500
15500
|
};
|
|
15501
|
-
return document.addEventListener("mousedown",
|
|
15501
|
+
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
15502
15502
|
}, []);
|
|
15503
|
-
const _ = (
|
|
15504
|
-
i && i(
|
|
15505
|
-
},
|
|
15503
|
+
const _ = (E) => {
|
|
15504
|
+
i && i(E), g(!1), f("");
|
|
15505
|
+
}, w = () => {
|
|
15506
15506
|
o && o(d.trim() || void 0), g(!1), f("");
|
|
15507
|
-
},
|
|
15507
|
+
}, S = () => {
|
|
15508
15508
|
g(!0);
|
|
15509
|
-
}, C = (
|
|
15510
|
-
f(
|
|
15511
|
-
},
|
|
15512
|
-
|
|
15509
|
+
}, C = (E) => {
|
|
15510
|
+
f(E.target.value), p || g(!0);
|
|
15511
|
+
}, v = (E) => {
|
|
15512
|
+
E.key === "Enter" ? (E.preventDefault(), y.length > 0 && i ? (i(y[0]), g(!1), f("")) : o && d.trim() && (o(d.trim()), g(!1), f(""))) : E.key === "Escape" && (g(!1), f(""));
|
|
15513
15513
|
};
|
|
15514
15514
|
return /* @__PURE__ */ h.jsxs(
|
|
15515
15515
|
"div",
|
|
@@ -15547,8 +15547,8 @@ function jy({
|
|
|
15547
15547
|
s && /* @__PURE__ */ h.jsx(
|
|
15548
15548
|
"button",
|
|
15549
15549
|
{
|
|
15550
|
-
onClick: (
|
|
15551
|
-
|
|
15550
|
+
onClick: (E) => {
|
|
15551
|
+
E.stopPropagation(), s();
|
|
15552
15552
|
},
|
|
15553
15553
|
style: {
|
|
15554
15554
|
marginLeft: "8px",
|
|
@@ -15596,8 +15596,8 @@ function jy({
|
|
|
15596
15596
|
type: "text",
|
|
15597
15597
|
value: d,
|
|
15598
15598
|
onChange: C,
|
|
15599
|
-
onFocus:
|
|
15600
|
-
onKeyDown:
|
|
15599
|
+
onFocus: S,
|
|
15600
|
+
onKeyDown: v,
|
|
15601
15601
|
placeholder: n,
|
|
15602
15602
|
style: {
|
|
15603
15603
|
width: "100%",
|
|
@@ -15618,7 +15618,7 @@ function jy({
|
|
|
15618
15618
|
o && /* @__PURE__ */ h.jsx(
|
|
15619
15619
|
"button",
|
|
15620
15620
|
{
|
|
15621
|
-
onClick:
|
|
15621
|
+
onClick: w,
|
|
15622
15622
|
style: {
|
|
15623
15623
|
width: "36px",
|
|
15624
15624
|
height: "36px",
|
|
@@ -15635,11 +15635,11 @@ function jy({
|
|
|
15635
15635
|
transition: "background 0.15s",
|
|
15636
15636
|
flexShrink: 0
|
|
15637
15637
|
},
|
|
15638
|
-
onMouseEnter: (
|
|
15639
|
-
|
|
15638
|
+
onMouseEnter: (E) => {
|
|
15639
|
+
E.currentTarget.style.background = c.cardHover || "#f3f4f6";
|
|
15640
15640
|
},
|
|
15641
|
-
onMouseLeave: (
|
|
15642
|
-
|
|
15641
|
+
onMouseLeave: (E) => {
|
|
15642
|
+
E.currentTarget.style.background = c.background || "#ffffff";
|
|
15643
15643
|
},
|
|
15644
15644
|
title: `Create ${t || "item"}`,
|
|
15645
15645
|
children: "+"
|
|
@@ -15664,40 +15664,40 @@ function jy({
|
|
|
15664
15664
|
textAlign: "center",
|
|
15665
15665
|
color: c.textSecondary,
|
|
15666
15666
|
fontSize: "14px"
|
|
15667
|
-
}, children: d ? `No results for "${d}"` : "No items" }) : y.map((
|
|
15667
|
+
}, children: d ? `No results for "${d}"` : "No items" }) : y.map((E, N) => /* @__PURE__ */ h.jsxs(
|
|
15668
15668
|
"div",
|
|
15669
15669
|
{
|
|
15670
|
-
onClick: () => _(
|
|
15670
|
+
onClick: () => _(E),
|
|
15671
15671
|
style: {
|
|
15672
15672
|
padding: "10px 14px",
|
|
15673
15673
|
cursor: "pointer",
|
|
15674
|
-
borderBottom:
|
|
15674
|
+
borderBottom: N < y.length - 1 ? `1px solid ${c.border}` : "none",
|
|
15675
15675
|
background: c.cardBackground,
|
|
15676
15676
|
transition: "background 0.15s"
|
|
15677
15677
|
},
|
|
15678
|
-
onMouseEnter: (
|
|
15679
|
-
|
|
15678
|
+
onMouseEnter: (A) => {
|
|
15679
|
+
A.currentTarget.style.background = c.cardHover || "#f3f4f6";
|
|
15680
15680
|
},
|
|
15681
|
-
onMouseLeave: (
|
|
15682
|
-
|
|
15681
|
+
onMouseLeave: (A) => {
|
|
15682
|
+
A.currentTarget.style.background = c.cardBackground || "#f9fafb";
|
|
15683
15683
|
},
|
|
15684
15684
|
children: [
|
|
15685
15685
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
15686
15686
|
fontSize: "14px",
|
|
15687
15687
|
fontWeight: 500,
|
|
15688
|
-
color:
|
|
15689
|
-
marginBottom:
|
|
15690
|
-
}, children:
|
|
15691
|
-
|
|
15688
|
+
color: E.color || c.text,
|
|
15689
|
+
marginBottom: E.notes ? "2px" : 0
|
|
15690
|
+
}, children: E.label }),
|
|
15691
|
+
E.notes && /* @__PURE__ */ h.jsx("div", { style: {
|
|
15692
15692
|
fontSize: "12px",
|
|
15693
15693
|
color: c.textSecondary,
|
|
15694
15694
|
whiteSpace: "nowrap",
|
|
15695
15695
|
overflow: "hidden",
|
|
15696
15696
|
textOverflow: "ellipsis"
|
|
15697
|
-
}, children:
|
|
15697
|
+
}, children: E.notes })
|
|
15698
15698
|
]
|
|
15699
15699
|
},
|
|
15700
|
-
|
|
15700
|
+
E.id
|
|
15701
15701
|
)) })
|
|
15702
15702
|
]
|
|
15703
15703
|
}
|
|
@@ -15719,37 +15719,37 @@ function Ly({
|
|
|
15719
15719
|
columnClassName: f = "",
|
|
15720
15720
|
itemClassName: p = ""
|
|
15721
15721
|
}) {
|
|
15722
|
-
const [g, m] = I(null), [x, b] = I(null), [y, _] = I(null),
|
|
15722
|
+
const [g, m] = I(null), [x, b] = I(null), [y, _] = I(null), w = be(null), S = e.reduce((F, R) => {
|
|
15723
15723
|
let D = r.filter((B) => n(B) === R.id);
|
|
15724
|
-
return i && (D = D.sort((B, M) => i(B) - i(M))),
|
|
15725
|
-
}, {}), C = X((
|
|
15724
|
+
return i && (D = D.sort((B, M) => i(B) - i(M))), F[R.id] = D, F;
|
|
15725
|
+
}, {}), C = X((F, R) => {
|
|
15726
15726
|
const D = t(R), B = n(R);
|
|
15727
|
-
m(D),
|
|
15728
|
-
const M =
|
|
15727
|
+
m(D), w.current = B, F.dataTransfer.effectAllowed = "move", F.dataTransfer.setData("text/plain", D), requestAnimationFrame(() => {
|
|
15728
|
+
const M = F.target;
|
|
15729
15729
|
M.style.opacity = "0.5";
|
|
15730
15730
|
});
|
|
15731
|
-
}, [t, n]),
|
|
15732
|
-
const R =
|
|
15733
|
-
R.style.opacity = "1", m(null), b(null), _(null),
|
|
15734
|
-
}, []),
|
|
15735
|
-
|
|
15736
|
-
}, []),
|
|
15737
|
-
const R =
|
|
15731
|
+
}, [t, n]), v = X((F) => {
|
|
15732
|
+
const R = F.target;
|
|
15733
|
+
R.style.opacity = "1", m(null), b(null), _(null), w.current = null;
|
|
15734
|
+
}, []), E = X((F, R, D) => {
|
|
15735
|
+
F.preventDefault(), F.dataTransfer.dropEffect = "move", b(R), _(D);
|
|
15736
|
+
}, []), N = X((F) => {
|
|
15737
|
+
const R = F.relatedTarget;
|
|
15738
15738
|
R != null && R.closest("[data-kanban-column]") || (b(null), _(null));
|
|
15739
|
-
}, []),
|
|
15740
|
-
if (
|
|
15741
|
-
const B =
|
|
15742
|
-
B === R ? a == null || a(g, R, D) : B && o(g, B, R, D), m(null), b(null), _(null),
|
|
15743
|
-
}, [g, o, a]),
|
|
15739
|
+
}, []), A = X((F, R, D) => {
|
|
15740
|
+
if (F.preventDefault(), !g) return;
|
|
15741
|
+
const B = w.current;
|
|
15742
|
+
B === R ? a == null || a(g, R, D) : B && o(g, B, R, D), m(null), b(null), _(null), w.current = null;
|
|
15743
|
+
}, [g, o, a]), T = (F, R) => /* @__PURE__ */ h.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
15744
15744
|
/* @__PURE__ */ h.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15745
|
-
|
|
15745
|
+
F.color && /* @__PURE__ */ h.jsx(
|
|
15746
15746
|
"div",
|
|
15747
15747
|
{
|
|
15748
15748
|
className: "w-2 h-2 rounded-full",
|
|
15749
|
-
style: { backgroundColor:
|
|
15749
|
+
style: { backgroundColor: F.color }
|
|
15750
15750
|
}
|
|
15751
15751
|
),
|
|
15752
|
-
/* @__PURE__ */ h.jsx("span", { className: "font-medium text-sm text-neutral-700", children:
|
|
15752
|
+
/* @__PURE__ */ h.jsx("span", { className: "font-medium text-sm text-neutral-700", children: F.label })
|
|
15753
15753
|
] }),
|
|
15754
15754
|
/* @__PURE__ */ h.jsx("span", { className: "text-xs text-neutral-400 bg-neutral-100 px-2 py-0.5 rounded-full", children: R })
|
|
15755
15755
|
] });
|
|
@@ -15758,20 +15758,20 @@ function Ly({
|
|
|
15758
15758
|
{
|
|
15759
15759
|
className: `flex gap-4 overflow-x-auto pb-4 ${d}`,
|
|
15760
15760
|
style: { minHeight: "400px" },
|
|
15761
|
-
children: e.map((
|
|
15762
|
-
const R =
|
|
15761
|
+
children: e.map((F) => {
|
|
15762
|
+
const R = S[F.id] || [], D = x === F.id;
|
|
15763
15763
|
return /* @__PURE__ */ h.jsxs(
|
|
15764
15764
|
"div",
|
|
15765
15765
|
{
|
|
15766
|
-
"data-kanban-column":
|
|
15766
|
+
"data-kanban-column": F.id,
|
|
15767
15767
|
className: `flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,
|
|
15768
15768
|
onDragOver: (B) => {
|
|
15769
|
-
B.preventDefault(), g && !D && b(
|
|
15769
|
+
B.preventDefault(), g && !D && b(F.id);
|
|
15770
15770
|
},
|
|
15771
|
-
onDragLeave:
|
|
15772
|
-
onDrop: (B) =>
|
|
15771
|
+
onDragLeave: N,
|
|
15772
|
+
onDrop: (B) => A(B, F.id, y ?? R.length),
|
|
15773
15773
|
children: [
|
|
15774
|
-
/* @__PURE__ */ h.jsx("div", { className: "flex-shrink-0 border-b border-neutral-200", children: u ? u(
|
|
15774
|
+
/* @__PURE__ */ h.jsx("div", { className: "flex-shrink-0 border-b border-neutral-200", children: u ? u(F, R.length) : T(F, R.length) }),
|
|
15775
15775
|
/* @__PURE__ */ h.jsxs(
|
|
15776
15776
|
"div",
|
|
15777
15777
|
{
|
|
@@ -15786,8 +15786,8 @@ function Ly({
|
|
|
15786
15786
|
{
|
|
15787
15787
|
draggable: !0,
|
|
15788
15788
|
onDragStart: (re) => C(re, B),
|
|
15789
|
-
onDragEnd:
|
|
15790
|
-
onDragOver: (re) =>
|
|
15789
|
+
onDragEnd: v,
|
|
15790
|
+
onDragOver: (re) => E(re, F.id, M),
|
|
15791
15791
|
onClick: () => l == null ? void 0 : l(B),
|
|
15792
15792
|
className: `cursor-grab active:cursor-grabbing transition-all ${V ? "opacity-50 scale-95" : ""} ${p}`,
|
|
15793
15793
|
children: s(B, V)
|
|
@@ -15800,7 +15800,7 @@ function Ly({
|
|
|
15800
15800
|
{
|
|
15801
15801
|
className: "min-h-[40px] flex-1",
|
|
15802
15802
|
onDragOver: (B) => {
|
|
15803
|
-
B.preventDefault(),
|
|
15803
|
+
B.preventDefault(), E(B, F.id, R.length);
|
|
15804
15804
|
},
|
|
15805
15805
|
children: D && y === R.length && /* @__PURE__ */ h.jsx("div", { className: "h-1 bg-blue-500 rounded-full mx-1 mt-1" })
|
|
15806
15806
|
}
|
|
@@ -15809,10 +15809,10 @@ function Ly({
|
|
|
15809
15809
|
]
|
|
15810
15810
|
}
|
|
15811
15811
|
),
|
|
15812
|
-
c && /* @__PURE__ */ h.jsx("div", { className: "flex-shrink-0 border-t border-neutral-200 p-2", children: c(
|
|
15812
|
+
c && /* @__PURE__ */ h.jsx("div", { className: "flex-shrink-0 border-t border-neutral-200 p-2", children: c(F) })
|
|
15813
15813
|
]
|
|
15814
15814
|
},
|
|
15815
|
-
|
|
15815
|
+
F.id
|
|
15816
15816
|
);
|
|
15817
15817
|
})
|
|
15818
15818
|
}
|
|
@@ -15860,33 +15860,33 @@ function Py({
|
|
|
15860
15860
|
theme: g = {}
|
|
15861
15861
|
}) {
|
|
15862
15862
|
const m = { ...pg, ...g }, { allDayItems: x, timedItems: b } = ct(() => {
|
|
15863
|
-
const
|
|
15864
|
-
for (const
|
|
15865
|
-
a(
|
|
15866
|
-
return { allDayItems:
|
|
15863
|
+
const v = [], E = [];
|
|
15864
|
+
for (const N of r)
|
|
15865
|
+
a(N) ? v.push(N) : E.push(N);
|
|
15866
|
+
return { allDayItems: v, timedItems: E };
|
|
15867
15867
|
}, [r, a]), y = ct(() => {
|
|
15868
|
-
const
|
|
15869
|
-
for (let
|
|
15870
|
-
|
|
15871
|
-
return
|
|
15872
|
-
}, [t, n]), _ = (n - t + 1) * i,
|
|
15873
|
-
(
|
|
15874
|
-
const
|
|
15875
|
-
if (!
|
|
15876
|
-
const
|
|
15877
|
-
if (!
|
|
15878
|
-
const { hours:
|
|
15868
|
+
const v = [];
|
|
15869
|
+
for (let E = t; E <= n; E++)
|
|
15870
|
+
v.push(E);
|
|
15871
|
+
return v;
|
|
15872
|
+
}, [t, n]), _ = (n - t + 1) * i, w = X(
|
|
15873
|
+
(v) => {
|
|
15874
|
+
const E = s(v);
|
|
15875
|
+
if (!E) return null;
|
|
15876
|
+
const N = gg(E);
|
|
15877
|
+
if (!N) return null;
|
|
15878
|
+
const { hours: A, minutes: T } = N, F = Math.max(t, Math.min(n, A)), R = A < t ? 0 : T, D = (F - t) * i + R / 60 * i, B = o(v), M = Math.max(20, B / 60 * i);
|
|
15879
15879
|
return { top: D, height: M };
|
|
15880
15880
|
},
|
|
15881
15881
|
[s, o, t, n, i]
|
|
15882
|
-
),
|
|
15882
|
+
), S = ct(() => {
|
|
15883
15883
|
if (!f || !yg(e)) return null;
|
|
15884
|
-
const
|
|
15885
|
-
return
|
|
15884
|
+
const v = /* @__PURE__ */ new Date(), E = v.getHours(), N = v.getMinutes();
|
|
15885
|
+
return E < t || E > n ? null : (E - t) * i + N / 60 * i;
|
|
15886
15886
|
}, [e, f, t, n, i]), C = X(
|
|
15887
|
-
(
|
|
15887
|
+
(v) => {
|
|
15888
15888
|
if (!d) return;
|
|
15889
|
-
const
|
|
15889
|
+
const E = v.currentTarget.getBoundingClientRect(), A = (v.clientY - E.top) / i * 60, T = Math.floor(A / 60) + t, F = Math.round(A % 60 / 15) * 15, R = Math.min(n, Math.max(t, T)), D = F >= 60 ? 0 : F, B = `${R.toString().padStart(2, "0")}:${D.toString().padStart(2, "0")}`;
|
|
15890
15890
|
d(B);
|
|
15891
15891
|
},
|
|
15892
15892
|
[d, i, t, n]
|
|
@@ -15914,20 +15914,20 @@ function Py({
|
|
|
15914
15914
|
children: "All Day"
|
|
15915
15915
|
}
|
|
15916
15916
|
),
|
|
15917
|
-
/* @__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((v) => /* @__PURE__ */ h.jsx(
|
|
15918
15918
|
"div",
|
|
15919
15919
|
{
|
|
15920
|
-
onClick: () => c == null ? void 0 : c(
|
|
15920
|
+
onClick: () => c == null ? void 0 : c(v),
|
|
15921
15921
|
style: { cursor: c ? "pointer" : "default" },
|
|
15922
|
-
children: u(
|
|
15922
|
+
children: u(v)
|
|
15923
15923
|
},
|
|
15924
|
-
l(
|
|
15924
|
+
l(v)
|
|
15925
15925
|
)) })
|
|
15926
15926
|
]
|
|
15927
15927
|
}
|
|
15928
15928
|
),
|
|
15929
15929
|
/* @__PURE__ */ h.jsxs("div", { style: { position: "relative", height: _ }, children: [
|
|
15930
|
-
y.map((
|
|
15930
|
+
y.map((v, E) => /* @__PURE__ */ h.jsxs("div", { style: { position: "absolute", top: E * i, left: 0, right: 0 }, children: [
|
|
15931
15931
|
/* @__PURE__ */ h.jsx(
|
|
15932
15932
|
"div",
|
|
15933
15933
|
{
|
|
@@ -15941,7 +15941,7 @@ function Py({
|
|
|
15941
15941
|
fontSize: "11px",
|
|
15942
15942
|
color: m.hourTextColor
|
|
15943
15943
|
},
|
|
15944
|
-
children: mg(
|
|
15944
|
+
children: mg(v)
|
|
15945
15945
|
}
|
|
15946
15946
|
),
|
|
15947
15947
|
/* @__PURE__ */ h.jsx(
|
|
@@ -15957,7 +15957,7 @@ function Py({
|
|
|
15957
15957
|
}
|
|
15958
15958
|
}
|
|
15959
15959
|
),
|
|
15960
|
-
|
|
15960
|
+
E < y.length - 1 && /* @__PURE__ */ h.jsx(
|
|
15961
15961
|
"div",
|
|
15962
15962
|
{
|
|
15963
15963
|
style: {
|
|
@@ -15970,7 +15970,7 @@ function Py({
|
|
|
15970
15970
|
}
|
|
15971
15971
|
}
|
|
15972
15972
|
)
|
|
15973
|
-
] },
|
|
15973
|
+
] }, v)),
|
|
15974
15974
|
/* @__PURE__ */ h.jsx(
|
|
15975
15975
|
"div",
|
|
15976
15976
|
{
|
|
@@ -15985,14 +15985,14 @@ function Py({
|
|
|
15985
15985
|
onClick: C
|
|
15986
15986
|
}
|
|
15987
15987
|
),
|
|
15988
|
-
|
|
15988
|
+
S !== null && /* @__PURE__ */ h.jsxs(
|
|
15989
15989
|
"div",
|
|
15990
15990
|
{
|
|
15991
15991
|
style: {
|
|
15992
15992
|
position: "absolute",
|
|
15993
15993
|
left: "55px",
|
|
15994
15994
|
right: 0,
|
|
15995
|
-
top:
|
|
15995
|
+
top: S,
|
|
15996
15996
|
zIndex: 20,
|
|
15997
15997
|
pointerEvents: "none"
|
|
15998
15998
|
},
|
|
@@ -16024,36 +16024,36 @@ function Py({
|
|
|
16024
16024
|
]
|
|
16025
16025
|
}
|
|
16026
16026
|
),
|
|
16027
|
-
b.map((
|
|
16028
|
-
const
|
|
16029
|
-
return
|
|
16027
|
+
b.map((v) => {
|
|
16028
|
+
const E = w(v);
|
|
16029
|
+
return E ? /* @__PURE__ */ h.jsx(
|
|
16030
16030
|
"div",
|
|
16031
16031
|
{
|
|
16032
16032
|
style: {
|
|
16033
16033
|
position: "absolute",
|
|
16034
16034
|
left: "64px",
|
|
16035
16035
|
right: "8px",
|
|
16036
|
-
top:
|
|
16037
|
-
height:
|
|
16036
|
+
top: E.top,
|
|
16037
|
+
height: E.height,
|
|
16038
16038
|
zIndex: 10,
|
|
16039
16039
|
cursor: c ? "pointer" : "default"
|
|
16040
16040
|
},
|
|
16041
|
-
onClick: (
|
|
16042
|
-
|
|
16041
|
+
onClick: (N) => {
|
|
16042
|
+
N.stopPropagation(), c == null || c(v);
|
|
16043
16043
|
},
|
|
16044
|
-
children: u(
|
|
16044
|
+
children: u(v)
|
|
16045
16045
|
},
|
|
16046
|
-
l(
|
|
16046
|
+
l(v)
|
|
16047
16047
|
) : null;
|
|
16048
16048
|
})
|
|
16049
16049
|
] })
|
|
16050
16050
|
] });
|
|
16051
16051
|
}
|
|
16052
16052
|
function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComplete: n, variant: i = "widget", hideSaveButton: s = !1, maxDuration: o = 180 }) {
|
|
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), [
|
|
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), [w, S] = I(!1), [C, v] = I(null), [E, N] = I(!0), [A, T] = I([]), [F, R] = I({ completed: 0, total: 0 }), D = be(!1), B = be(!0);
|
|
16054
16054
|
Te(() => {
|
|
16055
|
-
B.current =
|
|
16056
|
-
}, [
|
|
16055
|
+
B.current = E;
|
|
16056
|
+
}, [E]);
|
|
16057
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) => {
|
|
16058
16058
|
const j = Math.floor(ee / 60), ue = Math.floor(ee % 60);
|
|
16059
16059
|
return `${j.toString().padStart(2, "0")}:${ue.toString().padStart(2, "0")}`;
|
|
@@ -16138,7 +16138,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16138
16138
|
ge.current.push(De), ye(), fe.current && (W.current = requestAnimationFrame(Ke));
|
|
16139
16139
|
}, z = async () => {
|
|
16140
16140
|
try {
|
|
16141
|
-
_(null),
|
|
16141
|
+
_(null), S(!1), Be.current === null && (ge.current = []);
|
|
16142
16142
|
const ee = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
16143
16143
|
V.current = ee;
|
|
16144
16144
|
const j = new AudioContext();
|
|
@@ -16174,7 +16174,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16174
16174
|
else
|
|
16175
16175
|
ve = De, we = Se.current > 0 ? Se.current : 1;
|
|
16176
16176
|
if (ce.current = ve, ee.getTracks().forEach((Ce) => Ce.stop()), B.current && t) {
|
|
16177
|
-
|
|
16177
|
+
T((Ce) => [...Ce, ve]), R((Ce) => ({ ...Ce, total: Ce.total + 1 })), ce.current = null, ge.current = [], b(0), p(0), d(0), u("idle");
|
|
16178
16178
|
return;
|
|
16179
16179
|
}
|
|
16180
16180
|
const Ie = URL.createObjectURL(ve), Ve = new Audio(Ie);
|
|
@@ -16187,7 +16187,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16187
16187
|
_("Failed to process recording"), u("idle");
|
|
16188
16188
|
}
|
|
16189
16189
|
}, G.start(100), fe.current = !0, u("recording"), d(0), Se.current = 0, J.current = setInterval(() => {
|
|
16190
|
-
Se.current += 1, d(Se.current), Se.current >= o && (O.current && O.current.state !== "inactive" && O.current.stop(), fe.current = !1,
|
|
16190
|
+
Se.current += 1, d(Se.current), Se.current >= o && (O.current && O.current.state !== "inactive" && O.current.stop(), fe.current = !1, v(null), J.current && (clearInterval(J.current), J.current = null), W.current && (cancelAnimationFrame(W.current), W.current = null), setTimeout(() => {
|
|
16191
16191
|
alert(`Maximum recording time of ${Math.floor(o / 60)} minutes reached.`);
|
|
16192
16192
|
}, 100));
|
|
16193
16193
|
}, 1e3);
|
|
@@ -16195,7 +16195,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16195
16195
|
_("Could not access microphone. Please allow microphone access.");
|
|
16196
16196
|
}
|
|
16197
16197
|
}, ae = () => {
|
|
16198
|
-
fe.current = !1,
|
|
16198
|
+
fe.current = !1, S(!1), v(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
16199
|
}, me = (ee) => {
|
|
16200
16200
|
const j = M.current;
|
|
16201
16201
|
if (!j) return;
|
|
@@ -16266,23 +16266,23 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16266
16266
|
}
|
|
16267
16267
|
}, [l]);
|
|
16268
16268
|
const Ye = X((ee) => {
|
|
16269
|
-
|
|
16269
|
+
T((j) => [...j, ee]), R((j) => ({ ...j, total: j.total + 1 }));
|
|
16270
16270
|
}, []);
|
|
16271
16271
|
if (Te(() => {
|
|
16272
16272
|
(async () => {
|
|
16273
|
-
if (D.current ||
|
|
16273
|
+
if (D.current || A.length === 0 || !t) return;
|
|
16274
16274
|
D.current = !0;
|
|
16275
|
-
const j =
|
|
16275
|
+
const j = A[0];
|
|
16276
16276
|
try {
|
|
16277
16277
|
const ue = await t(j);
|
|
16278
16278
|
ue && n && n(ue);
|
|
16279
16279
|
} catch (ue) {
|
|
16280
16280
|
console.error("Transcription failed:", ue);
|
|
16281
16281
|
} finally {
|
|
16282
|
-
|
|
16282
|
+
T((ue) => ue.slice(1)), R((ue) => ({ ...ue, completed: ue.completed + 1 })), D.current = !1;
|
|
16283
16283
|
}
|
|
16284
16284
|
})();
|
|
16285
|
-
}, [
|
|
16285
|
+
}, [A, t, n]), Te(() => () => {
|
|
16286
16286
|
fe.current = !1, J.current && clearInterval(J.current), W.current && cancelAnimationFrame(W.current), V.current && V.current.getTracks().forEach((ee) => ee.stop()), U.current && U.current.state !== "closed" && U.current.close();
|
|
16287
16287
|
}, []), Te(() => {
|
|
16288
16288
|
if (l === "editing" && g) {
|
|
@@ -16402,14 +16402,14 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16402
16402
|
onClick: () => {
|
|
16403
16403
|
if (l === "recording") {
|
|
16404
16404
|
const ee = O.current;
|
|
16405
|
-
ee && (ee.state === "recording" ? (ee.pause(),
|
|
16405
|
+
ee && (ee.state === "recording" ? (ee.pause(), S(!0)) : ee.state === "paused" && (ee.resume(), S(!1)));
|
|
16406
16406
|
} else
|
|
16407
16407
|
vt();
|
|
16408
16408
|
},
|
|
16409
16409
|
disabled: l === "idle",
|
|
16410
16410
|
style: l === "idle" ? rt : tt,
|
|
16411
|
-
title: g || l === "recording" && !
|
|
16412
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !
|
|
16411
|
+
title: g || l === "recording" && !w ? "Pause" : "Play",
|
|
16412
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !w ? "pause" : "play_arrow" })
|
|
16413
16413
|
}
|
|
16414
16414
|
),
|
|
16415
16415
|
/* @__PURE__ */ h.jsx(
|
|
@@ -16427,7 +16427,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16427
16427
|
"button",
|
|
16428
16428
|
{
|
|
16429
16429
|
onClick: () => {
|
|
16430
|
-
C === "insert" ? ae() : l === "idle" ? (
|
|
16430
|
+
C === "insert" ? ae() : l === "idle" ? (v("insert"), z()) : l === "editing" && (v("insert"), wt("insert"));
|
|
16431
16431
|
},
|
|
16432
16432
|
disabled: l === "recording" && C !== "insert" || g,
|
|
16433
16433
|
style: l === "recording" && C !== "insert" || g ? rt : tt,
|
|
@@ -16439,10 +16439,10 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16439
16439
|
"button",
|
|
16440
16440
|
{
|
|
16441
16441
|
onClick: () => {
|
|
16442
|
-
B.current || (C === "mic" ? ae() : l === "idle" ? (
|
|
16442
|
+
B.current || (C === "mic" ? ae() : l === "idle" ? (v("mic"), z()) : l === "editing" && (v("mic"), wt("replace")));
|
|
16443
16443
|
},
|
|
16444
16444
|
onMouseDown: () => {
|
|
16445
|
-
B.current && l === "idle" && !g && (
|
|
16445
|
+
B.current && l === "idle" && !g && (v("mic"), z());
|
|
16446
16446
|
},
|
|
16447
16447
|
onMouseUp: () => {
|
|
16448
16448
|
B.current && l === "recording" && C === "mic" && ae();
|
|
@@ -16451,14 +16451,14 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16451
16451
|
B.current && l === "recording" && C === "mic" && ae();
|
|
16452
16452
|
},
|
|
16453
16453
|
onTouchStart: () => {
|
|
16454
|
-
B.current && l === "idle" && !g && (
|
|
16454
|
+
B.current && l === "idle" && !g && (v("mic"), z());
|
|
16455
16455
|
},
|
|
16456
16456
|
onTouchEnd: () => {
|
|
16457
16457
|
B.current && l === "recording" && C === "mic" && ae();
|
|
16458
16458
|
},
|
|
16459
16459
|
disabled: l === "recording" && C !== "mic" || g,
|
|
16460
16460
|
style: l === "recording" && C !== "mic" || g ? rt : tt,
|
|
16461
|
-
title:
|
|
16461
|
+
title: E ? "Hold to record (walkie-talkie)" : C === "mic" ? "Stop recording" : "Record",
|
|
16462
16462
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: C === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
|
|
16463
16463
|
}
|
|
16464
16464
|
),
|
|
@@ -16466,7 +16466,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16466
16466
|
"button",
|
|
16467
16467
|
{
|
|
16468
16468
|
onClick: () => {
|
|
16469
|
-
C === "startover" ? ae() : l === "editing" && (
|
|
16469
|
+
C === "startover" ? ae() : l === "editing" && (v("startover"), oe());
|
|
16470
16470
|
},
|
|
16471
16471
|
disabled: l === "idle" || l === "recording" && C !== "startover" || g,
|
|
16472
16472
|
style: l === "idle" || l === "recording" && C !== "startover" || g ? rt : tt,
|
|
@@ -16476,7 +16476,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16476
16476
|
)
|
|
16477
16477
|
] }),
|
|
16478
16478
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
16479
|
-
|
|
16479
|
+
F.total > 0 && F.completed < F.total && /* @__PURE__ */ h.jsxs("div", { style: {
|
|
16480
16480
|
display: "flex",
|
|
16481
16481
|
alignItems: "center",
|
|
16482
16482
|
gap: "4px",
|
|
@@ -16487,28 +16487,28 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16487
16487
|
color: "#10b981"
|
|
16488
16488
|
}, children: [
|
|
16489
16489
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "14px", animation: "spin 1s linear infinite" }, children: "sync" }),
|
|
16490
|
-
|
|
16490
|
+
F.completed,
|
|
16491
16491
|
"/",
|
|
16492
|
-
|
|
16492
|
+
F.total
|
|
16493
16493
|
] }),
|
|
16494
16494
|
t && /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
16495
16495
|
/* @__PURE__ */ h.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px", marginRight: "4px" }, children: [
|
|
16496
16496
|
/* @__PURE__ */ h.jsx(
|
|
16497
16497
|
"button",
|
|
16498
16498
|
{
|
|
16499
|
-
onClick: () =>
|
|
16499
|
+
onClick: () => N(!E),
|
|
16500
16500
|
style: {
|
|
16501
16501
|
width: "28px",
|
|
16502
16502
|
height: "16px",
|
|
16503
16503
|
borderRadius: "8px",
|
|
16504
16504
|
border: "none",
|
|
16505
|
-
background:
|
|
16505
|
+
background: E ? "#10b981" : "#9ca3af",
|
|
16506
16506
|
cursor: "pointer",
|
|
16507
16507
|
position: "relative",
|
|
16508
16508
|
transition: "background 0.2s",
|
|
16509
16509
|
padding: 0
|
|
16510
16510
|
},
|
|
16511
|
-
title:
|
|
16511
|
+
title: E ? "Auto-transcribe ON" : "Auto-transcribe OFF",
|
|
16512
16512
|
children: /* @__PURE__ */ h.jsx("div", { style: {
|
|
16513
16513
|
width: "12px",
|
|
16514
16514
|
height: "12px",
|
|
@@ -16516,7 +16516,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16516
16516
|
background: "white",
|
|
16517
16517
|
position: "absolute",
|
|
16518
16518
|
top: "2px",
|
|
16519
|
-
left:
|
|
16519
|
+
left: E ? "14px" : "2px",
|
|
16520
16520
|
transition: "left 0.2s",
|
|
16521
16521
|
boxShadow: "0 1px 2px rgba(0,0,0,0.2)"
|
|
16522
16522
|
} })
|
|
@@ -16533,7 +16533,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16533
16533
|
disabled: l !== "editing",
|
|
16534
16534
|
style: l !== "editing" ? rt : tt,
|
|
16535
16535
|
title: "Transcribe audio",
|
|
16536
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
16536
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E ? "#10b981" : "#171717" }, children: "subtitles" })
|
|
16537
16537
|
}
|
|
16538
16538
|
)
|
|
16539
16539
|
] }),
|
|
@@ -16551,14 +16551,14 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16551
16551
|
]
|
|
16552
16552
|
}
|
|
16553
16553
|
),
|
|
16554
|
-
|
|
16554
|
+
F.total > 0 && F.completed < F.total && /* @__PURE__ */ h.jsx("div", { style: {
|
|
16555
16555
|
height: "3px",
|
|
16556
16556
|
background: "#e5e5e5",
|
|
16557
16557
|
overflow: "hidden"
|
|
16558
16558
|
}, children: /* @__PURE__ */ h.jsx("div", { style: {
|
|
16559
16559
|
height: "100%",
|
|
16560
16560
|
background: "#10b981",
|
|
16561
|
-
width: `${
|
|
16561
|
+
width: `${F.completed / F.total * 100}%`,
|
|
16562
16562
|
transition: "width 0.3s ease"
|
|
16563
16563
|
} }) })
|
|
16564
16564
|
] });
|
|
@@ -16728,7 +16728,7 @@ function Oy({
|
|
|
16728
16728
|
outputQuality: s = 0.9,
|
|
16729
16729
|
theme: o = "dark"
|
|
16730
16730
|
}) {
|
|
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 }), [
|
|
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 }), [w, S] = I(!1), [C, v] = I(null), [E, N] = I({ x: 0, y: 0 }), [A, T] = I({ x: 0, y: 0, width: 100, height: 100 }), F = o === "dark", R = X(() => {
|
|
16732
16732
|
const Z = u.current;
|
|
16733
16733
|
return Z ? x === 90 || x === 270 ? { width: Z.height, height: Z.width } : { width: Z.width, height: Z.height } : { width: 100, height: 100 };
|
|
16734
16734
|
}, [x]), D = X((Z, Ee) => {
|
|
@@ -16797,50 +16797,50 @@ function Oy({
|
|
|
16797
16797
|
];
|
|
16798
16798
|
for (const ze of qe)
|
|
16799
16799
|
if (Math.abs(Re - ze.x) < ke && Math.abs(Se - ze.y) < ke) {
|
|
16800
|
-
|
|
16800
|
+
v(ze.name), N({ x: Re, y: Se }), T({ ...y });
|
|
16801
16801
|
return;
|
|
16802
16802
|
}
|
|
16803
|
-
Re >= y.x && Re <= y.x + y.width && Se >= y.y && Se <= y.y + y.height && (
|
|
16803
|
+
Re >= y.x && Re <= y.x + y.width && Se >= y.y && Se <= y.y + y.height && (S(!0), N({ x: Re, y: Se }), T({ ...y }));
|
|
16804
16804
|
}, O = (Z) => {
|
|
16805
16805
|
const Ee = l.current;
|
|
16806
16806
|
if (!Ee) return;
|
|
16807
16807
|
const ie = Ee.getBoundingClientRect(), Re = (Z.clientX - ie.left) / ie.width * 100, Se = (Z.clientY - ie.top) / ie.height * 100;
|
|
16808
|
-
if (
|
|
16809
|
-
const ke = Re -
|
|
16810
|
-
let ze =
|
|
16811
|
-
ze = Math.max(0, Math.min(ze, 100 -
|
|
16808
|
+
if (w) {
|
|
16809
|
+
const ke = Re - E.x, qe = Se - E.y;
|
|
16810
|
+
let ze = A.x + ke, He = A.y + qe;
|
|
16811
|
+
ze = Math.max(0, Math.min(ze, 100 - A.width)), He = Math.max(0, Math.min(He, 100 - A.height)), _({ ...A, x: ze, y: He });
|
|
16812
16812
|
} else if (C) {
|
|
16813
16813
|
const ke = vi[g], { width: qe, height: ze } = R(), He = qe / ze, Y = ke ? ke / He : null;
|
|
16814
|
-
let L = { ...
|
|
16815
|
-
const ye = Re -
|
|
16814
|
+
let L = { ...A };
|
|
16815
|
+
const ye = Re - E.x, Ke = Se - E.y;
|
|
16816
16816
|
if (C === "se")
|
|
16817
|
-
L.width = Math.max(10, Math.min(100 - L.x,
|
|
16817
|
+
L.width = Math.max(10, Math.min(100 - L.x, A.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, A.height + Ke));
|
|
16818
16818
|
else if (C === "sw") {
|
|
16819
|
-
const z = -ye, ae = Math.max(10,
|
|
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 =
|
|
16819
|
+
const z = -ye, ae = Math.max(10, A.width + z), me = A.x + A.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 = A.x + A.width - L.width)) : L.height = Math.max(10, Math.min(100 - L.y, A.height + Ke)));
|
|
16821
16821
|
} else if (C === "ne")
|
|
16822
|
-
if (L.width = Math.max(10, Math.min(100 - L.x,
|
|
16823
|
-
const z = L.width / Y, ae =
|
|
16824
|
-
ae >= 0 ? (L.height = z, L.y = ae) : (L.y = 0, L.height =
|
|
16822
|
+
if (L.width = Math.max(10, Math.min(100 - L.x, A.width + ye)), Y) {
|
|
16823
|
+
const z = L.width / Y, ae = A.y + A.height - z;
|
|
16824
|
+
ae >= 0 ? (L.height = z, L.y = ae) : (L.y = 0, L.height = A.y + A.height, L.width = L.height * Y);
|
|
16825
16825
|
} else {
|
|
16826
|
-
const z = -Ke, ae = Math.max(10,
|
|
16826
|
+
const z = -Ke, ae = Math.max(10, A.height + z), me = A.y + A.height - ae;
|
|
16827
16827
|
me >= 0 && (L.height = ae, L.y = me);
|
|
16828
16828
|
}
|
|
16829
16829
|
else if (C === "nw") {
|
|
16830
|
-
const z = -ye, ae = Math.max(10,
|
|
16830
|
+
const z = -ye, ae = Math.max(10, A.width + z), me = A.x + A.width - ae;
|
|
16831
16831
|
if (me >= 0)
|
|
16832
16832
|
if (L.width = ae, L.x = me, Y) {
|
|
16833
|
-
const xe = L.width / Y, Ge =
|
|
16834
|
-
Ge >= 0 ? (L.height = xe, L.y = Ge) : (L.y = 0, L.height =
|
|
16833
|
+
const xe = L.width / Y, Ge = A.y + A.height - xe;
|
|
16834
|
+
Ge >= 0 ? (L.height = xe, L.y = Ge) : (L.y = 0, L.height = A.y + A.height, L.width = L.height * Y, L.x = A.x + A.width - L.width);
|
|
16835
16835
|
} else {
|
|
16836
|
-
const xe = -Ke, Ge = Math.max(10,
|
|
16836
|
+
const xe = -Ke, Ge = Math.max(10, A.height + xe), vt = A.y + A.height - Ge;
|
|
16837
16837
|
vt >= 0 && (L.height = Ge, L.y = vt);
|
|
16838
16838
|
}
|
|
16839
16839
|
}
|
|
16840
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);
|
|
16841
16841
|
}
|
|
16842
16842
|
}, V = () => {
|
|
16843
|
-
|
|
16843
|
+
S(!1), v(null);
|
|
16844
16844
|
}, U = (Z) => {
|
|
16845
16845
|
b((Ee) => Z === "right" ? (Ee + 90) % 360 : (Ee - 90 + 360) % 360);
|
|
16846
16846
|
}, re = () => {
|
|
@@ -16862,7 +16862,7 @@ function Oy({
|
|
|
16862
16862
|
flexDirection: "column",
|
|
16863
16863
|
width: "100%",
|
|
16864
16864
|
height: "100%",
|
|
16865
|
-
background:
|
|
16865
|
+
background: F ? "#1a1a1a" : "#f5f5f5",
|
|
16866
16866
|
overflow: "hidden"
|
|
16867
16867
|
}, J = {
|
|
16868
16868
|
flex: 1,
|
|
@@ -16877,8 +16877,8 @@ function Oy({
|
|
|
16877
16877
|
flexDirection: "column",
|
|
16878
16878
|
gap: "12px",
|
|
16879
16879
|
padding: "16px",
|
|
16880
|
-
borderTop: `1px solid ${
|
|
16881
|
-
background:
|
|
16880
|
+
borderTop: `1px solid ${F ? "#333" : "#ddd"}`,
|
|
16881
|
+
background: F ? "#242424" : "#fff",
|
|
16882
16882
|
flexShrink: 0
|
|
16883
16883
|
}, se = {
|
|
16884
16884
|
display: "flex",
|
|
@@ -16899,14 +16899,14 @@ function Oy({
|
|
|
16899
16899
|
color: "#fff"
|
|
16900
16900
|
}, ge = {
|
|
16901
16901
|
...ce,
|
|
16902
|
-
background:
|
|
16903
|
-
color:
|
|
16902
|
+
background: F ? "#333" : "#e5e5e5",
|
|
16903
|
+
color: F ? "#fff" : "#333"
|
|
16904
16904
|
}, Be = {
|
|
16905
16905
|
padding: "10px",
|
|
16906
16906
|
borderRadius: "8px",
|
|
16907
16907
|
border: "none",
|
|
16908
|
-
background:
|
|
16909
|
-
color:
|
|
16908
|
+
background: F ? "#333" : "#e5e5e5",
|
|
16909
|
+
color: F ? "#fff" : "#333",
|
|
16910
16910
|
cursor: "pointer",
|
|
16911
16911
|
display: "flex",
|
|
16912
16912
|
alignItems: "center",
|
|
@@ -16915,14 +16915,14 @@ function Oy({
|
|
|
16915
16915
|
padding: "8px 14px",
|
|
16916
16916
|
borderRadius: "6px",
|
|
16917
16917
|
border: Z ? "2px solid #E67E22" : "2px solid transparent",
|
|
16918
|
-
background: Z ? "#E67E22" :
|
|
16919
|
-
color: Z ? "#fff" :
|
|
16918
|
+
background: Z ? "#E67E22" : F ? "#333" : "#e5e5e5",
|
|
16919
|
+
color: Z ? "#fff" : F ? "#ccc" : "#666",
|
|
16920
16920
|
cursor: "pointer",
|
|
16921
16921
|
fontSize: "13px",
|
|
16922
16922
|
fontWeight: 600,
|
|
16923
16923
|
transition: "all 0.15s"
|
|
16924
16924
|
});
|
|
16925
|
-
return c ? /* @__PURE__ */ h.jsx("div", { style: { ...q, alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ h.jsx("div", { style: { color:
|
|
16925
|
+
return c ? /* @__PURE__ */ h.jsx("div", { style: { ...q, alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ h.jsx("div", { style: { color: F ? "#aaa" : "#666" }, children: "Loading image..." }) }) : f ? /* @__PURE__ */ h.jsxs("div", { style: { ...q, alignItems: "center", justifyContent: "center" }, children: [
|
|
16926
16926
|
/* @__PURE__ */ h.jsx("div", { style: { color: "#ef4444" }, children: f }),
|
|
16927
16927
|
t && /* @__PURE__ */ h.jsx("button", { onClick: t, style: { ...ge, marginTop: "16px" }, children: "Close" })
|
|
16928
16928
|
] }) : /* @__PURE__ */ h.jsxs("div", { ref: a, style: q, children: [
|
|
@@ -16931,7 +16931,7 @@ function Oy({
|
|
|
16931
16931
|
{
|
|
16932
16932
|
ref: l,
|
|
16933
16933
|
style: {
|
|
16934
|
-
cursor:
|
|
16934
|
+
cursor: w ? "grabbing" : C ? "nwse-resize" : "grab",
|
|
16935
16935
|
maxWidth: "100%",
|
|
16936
16936
|
maxHeight: "100%"
|
|
16937
16937
|
},
|
|
@@ -17184,10 +17184,10 @@ function Wg(r, e) {
|
|
|
17184
17184
|
for (var s = i.length, o = new Array(s), a = new Array(s), l = new Array(s), u = 0; u < s; ++u) {
|
|
17185
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
17186
|
t(c, d, m, x, b, p, e);
|
|
17187
|
-
for (var y = 0, _ = 0,
|
|
17188
|
-
if (
|
|
17189
|
-
for (y >= _ && (_ = y + 1); !(
|
|
17190
|
-
|
|
17187
|
+
for (var y = 0, _ = 0, w, S; y < g; ++y)
|
|
17188
|
+
if (w = m[y]) {
|
|
17189
|
+
for (y >= _ && (_ = y + 1); !(S = x[_]) && ++_ < g; ) ;
|
|
17190
|
+
w._next = S || null;
|
|
17191
17191
|
}
|
|
17192
17192
|
}
|
|
17193
17193
|
return o = new Ft(o, n), o._enter = a, o._exit = l, o;
|
|
@@ -18059,21 +18059,21 @@ const Am = function r(e, t, n) {
|
|
|
18059
18059
|
function i(s, o) {
|
|
18060
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;
|
|
18061
18061
|
if (m < Em)
|
|
18062
|
-
b = Math.log(f / u) / e, x = function(
|
|
18062
|
+
b = Math.log(f / u) / e, x = function(v) {
|
|
18063
18063
|
return [
|
|
18064
|
-
a +
|
|
18065
|
-
l +
|
|
18066
|
-
u * Math.exp(e *
|
|
18064
|
+
a + v * p,
|
|
18065
|
+
l + v * g,
|
|
18066
|
+
u * Math.exp(e * v * b)
|
|
18067
18067
|
];
|
|
18068
18068
|
};
|
|
18069
18069
|
else {
|
|
18070
|
-
var y = Math.sqrt(m), _ = (f * f - u * u + n * m) / (2 * u * t * y),
|
|
18071
|
-
b = (C -
|
|
18072
|
-
var
|
|
18070
|
+
var y = Math.sqrt(m), _ = (f * f - u * u + n * m) / (2 * u * t * y), w = (f * f - u * u - n * m) / (2 * f * t * y), S = Math.log(Math.sqrt(_ * _ + 1) - _), C = Math.log(Math.sqrt(w * w + 1) - w);
|
|
18071
|
+
b = (C - S) / e, x = function(v) {
|
|
18072
|
+
var E = v * b, N = Xa(S), A = u / (t * y) * (N * km(e * E + S) - Sm(S));
|
|
18073
18073
|
return [
|
|
18074
|
-
a +
|
|
18075
|
-
l +
|
|
18076
|
-
u *
|
|
18074
|
+
a + A * p,
|
|
18075
|
+
l + A * g,
|
|
18076
|
+
u * N / Xa(e * E + S)
|
|
18077
18077
|
];
|
|
18078
18078
|
};
|
|
18079
18079
|
}
|
|
@@ -18752,11 +18752,11 @@ function H2(r, e, t) {
|
|
|
18752
18752
|
function V2() {
|
|
18753
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;
|
|
18754
18754
|
function b(D) {
|
|
18755
|
-
D.property("__zoom", ru).on("wheel.zoom",
|
|
18755
|
+
D.property("__zoom", ru).on("wheel.zoom", E, { passive: !1 }).on("mousedown.zoom", N).on("dblclick.zoom", A).filter(i).on("touchstart.zoom", T).on("touchmove.zoom", F).on("touchend.zoom touchcancel.zoom", R).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
18756
18756
|
}
|
|
18757
18757
|
b.transform = function(D, B, M, O) {
|
|
18758
18758
|
var V = D.selection ? D.selection() : D;
|
|
18759
|
-
V.property("__zoom", ru), D !== V ?
|
|
18759
|
+
V.property("__zoom", ru), D !== V ? S(D, B, M, O) : V.interrupt().each(function() {
|
|
18760
18760
|
C(this, arguments).event(O).start().zoom(null, typeof B == "function" ? B.apply(this, arguments) : B).end();
|
|
18761
18761
|
});
|
|
18762
18762
|
}, b.scaleBy = function(D, B, M, O) {
|
|
@@ -18766,7 +18766,7 @@ function V2() {
|
|
|
18766
18766
|
}, M, O);
|
|
18767
18767
|
}, b.scaleTo = function(D, B, M, O) {
|
|
18768
18768
|
b.transform(D, function() {
|
|
18769
|
-
var V = e.apply(this, arguments), U = this.__zoom, re = M == null ?
|
|
18769
|
+
var V = e.apply(this, arguments), U = this.__zoom, re = M == null ? w(V) : typeof M == "function" ? M.apply(this, arguments) : M, q = U.invert(re), J = typeof B == "function" ? B.apply(this, arguments) : B;
|
|
18770
18770
|
return t(_(y(U, J), re, q), V, o);
|
|
18771
18771
|
}, M, O);
|
|
18772
18772
|
}, b.translateBy = function(D, B, M, O) {
|
|
@@ -18778,7 +18778,7 @@ function V2() {
|
|
|
18778
18778
|
}, null, O);
|
|
18779
18779
|
}, b.translateTo = function(D, B, M, O, V) {
|
|
18780
18780
|
b.transform(D, function() {
|
|
18781
|
-
var U = e.apply(this, arguments), re = this.__zoom, q = O == null ?
|
|
18781
|
+
var U = e.apply(this, arguments), re = this.__zoom, q = O == null ? w(U) : typeof O == "function" ? O.apply(this, arguments) : O;
|
|
18782
18782
|
return t(ls.translate(q[0], q[1]).scale(re.k).translate(
|
|
18783
18783
|
typeof B == "function" ? -B.apply(this, arguments) : -B,
|
|
18784
18784
|
typeof M == "function" ? -M.apply(this, arguments) : -M
|
|
@@ -18792,16 +18792,16 @@ function V2() {
|
|
|
18792
18792
|
var O = B[0] - M[0] * D.k, V = B[1] - M[1] * D.k;
|
|
18793
18793
|
return O === D.x && V === D.y ? D : new ar(D.k, O, V);
|
|
18794
18794
|
}
|
|
18795
|
-
function
|
|
18795
|
+
function w(D) {
|
|
18796
18796
|
return [(+D[0][0] + +D[1][0]) / 2, (+D[0][1] + +D[1][1]) / 2];
|
|
18797
18797
|
}
|
|
18798
|
-
function
|
|
18798
|
+
function S(D, B, M, O) {
|
|
18799
18799
|
D.on("start.zoom", function() {
|
|
18800
18800
|
C(this, arguments).event(O).start();
|
|
18801
18801
|
}).on("interrupt.zoom end.zoom", function() {
|
|
18802
18802
|
C(this, arguments).event(O).end();
|
|
18803
18803
|
}).tween("zoom", function() {
|
|
18804
|
-
var V = this, U = arguments, re = C(V, U).event(O), q = e.apply(V, U), J = M == null ?
|
|
18804
|
+
var V = this, U = arguments, re = C(V, U).event(O), q = e.apply(V, U), J = M == null ? w(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
18805
|
return function(ge) {
|
|
18806
18806
|
if (ge === 1) ge = ce;
|
|
18807
18807
|
else {
|
|
@@ -18813,12 +18813,12 @@ function V2() {
|
|
|
18813
18813
|
});
|
|
18814
18814
|
}
|
|
18815
18815
|
function C(D, B, M) {
|
|
18816
|
-
return !M && D.__zooming || new
|
|
18816
|
+
return !M && D.__zooming || new v(D, B);
|
|
18817
18817
|
}
|
|
18818
|
-
function
|
|
18818
|
+
function v(D, B) {
|
|
18819
18819
|
this.that = D, this.args = B, this.active = 0, this.sourceEvent = null, this.extent = e.apply(D, B), this.taps = 0;
|
|
18820
18820
|
}
|
|
18821
|
-
|
|
18821
|
+
v.prototype = {
|
|
18822
18822
|
event: function(D) {
|
|
18823
18823
|
return D && (this.sourceEvent = D), this;
|
|
18824
18824
|
},
|
|
@@ -18846,7 +18846,7 @@ function V2() {
|
|
|
18846
18846
|
);
|
|
18847
18847
|
}
|
|
18848
18848
|
};
|
|
18849
|
-
function
|
|
18849
|
+
function E(D, ...B) {
|
|
18850
18850
|
if (!r.apply(this, arguments)) return;
|
|
18851
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);
|
|
18852
18852
|
if (M.wheel)
|
|
@@ -18860,7 +18860,7 @@ function V2() {
|
|
|
18860
18860
|
M.wheel = null, M.end();
|
|
18861
18861
|
}
|
|
18862
18862
|
}
|
|
18863
|
-
function
|
|
18863
|
+
function N(D, ...B) {
|
|
18864
18864
|
if (f || !r.apply(this, arguments)) return;
|
|
18865
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
18866
|
tm(D.view), Xs(D), O.mouse = [U, this.__zoom.invert(U)], Ni(this), O.start();
|
|
@@ -18875,13 +18875,13 @@ function V2() {
|
|
|
18875
18875
|
V.on("mousemove.zoom mouseup.zoom", null), rm(se.view, O.moved), Cn(se), O.event(se).end();
|
|
18876
18876
|
}
|
|
18877
18877
|
}
|
|
18878
|
-
function
|
|
18878
|
+
function A(D, ...B) {
|
|
18879
18879
|
if (r.apply(this, arguments)) {
|
|
18880
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(
|
|
18881
|
+
Cn(D), a > 0 ? $t(this).transition().duration(a).call(S, re, O, D) : $t(this).call(b.transform, re, O, D);
|
|
18882
18882
|
}
|
|
18883
18883
|
}
|
|
18884
|
-
function
|
|
18884
|
+
function T(D, ...B) {
|
|
18885
18885
|
if (r.apply(this, arguments)) {
|
|
18886
18886
|
var M = D.touches, O = M.length, V = C(this, B, D.changedTouches.length === O).event(D), U, re, q, J;
|
|
18887
18887
|
for (Xs(D), re = 0; re < O; ++re)
|
|
@@ -18891,7 +18891,7 @@ function V2() {
|
|
|
18891
18891
|
}, p)), Ni(this), V.start());
|
|
18892
18892
|
}
|
|
18893
18893
|
}
|
|
18894
|
-
function
|
|
18894
|
+
function F(D, ...B) {
|
|
18895
18895
|
if (this.__zooming) {
|
|
18896
18896
|
var M = C(this, B).event(D), O = D.changedTouches, V = O.length, U, re, q, J;
|
|
18897
18897
|
for (Cn(D), U = 0; U < V; ++U)
|
|
@@ -18986,8 +18986,8 @@ function G2(r = {}) {
|
|
|
18986
18986
|
}, [o]);
|
|
18987
18987
|
const d = X((x, b, y, _ = !0) => {
|
|
18988
18988
|
if (!a.current || !l.current) return;
|
|
18989
|
-
const
|
|
18990
|
-
|
|
18989
|
+
const w = $t(a.current), S = ls.translate(x, b).scale(y);
|
|
18990
|
+
w.call(l.current.transform, S);
|
|
18991
18991
|
}, []), f = X(() => {
|
|
18992
18992
|
!a.current || !l.current || $t(a.current).call(l.current.scaleBy, 1.3);
|
|
18993
18993
|
}, []), p = X(() => {
|
|
@@ -18997,13 +18997,13 @@ function G2(r = {}) {
|
|
|
18997
18997
|
}, [d]), m = X((x, b = 50) => {
|
|
18998
18998
|
if (!a.current || !l.current || x.length === 0) return;
|
|
18999
18999
|
const _ = a.current.getBoundingClientRect();
|
|
19000
|
-
let
|
|
19000
|
+
let w = 1 / 0, S = 1 / 0, C = -1 / 0, v = -1 / 0;
|
|
19001
19001
|
for (const O of x) {
|
|
19002
19002
|
const V = O.width || 200, U = O.height || 100;
|
|
19003
|
-
|
|
19003
|
+
w = Math.min(w, O.x), S = Math.min(S, O.y), C = Math.max(C, O.x + V), v = Math.max(v, O.y + U);
|
|
19004
19004
|
}
|
|
19005
|
-
const
|
|
19006
|
-
d(B, M,
|
|
19005
|
+
const E = C - w, N = v - S, A = (_.width - b * 2) / E, T = (_.height - b * 2) / N, F = Math.min(A, T, t), R = (w + C) / 2, D = (S + v) / 2, B = _.width / 2 - R * F, M = _.height / 2 - D * F;
|
|
19006
|
+
d(B, M, F, !0);
|
|
19007
19007
|
}, [t, d]);
|
|
19008
19008
|
return {
|
|
19009
19009
|
transform: u,
|
|
@@ -19026,26 +19026,26 @@ function K2(r) {
|
|
|
19026
19026
|
Te(() => {
|
|
19027
19027
|
g.current = e;
|
|
19028
19028
|
}, [e]);
|
|
19029
|
-
const m = X((_,
|
|
19030
|
-
const
|
|
19029
|
+
const m = X((_, w) => {
|
|
19030
|
+
const S = g.current;
|
|
19031
19031
|
return {
|
|
19032
|
-
x: (_ -
|
|
19033
|
-
y: (
|
|
19032
|
+
x: (_ - S.x) / S.k,
|
|
19033
|
+
y: (w - S.y) / S.k
|
|
19034
19034
|
};
|
|
19035
|
-
}, []), x = X((_,
|
|
19035
|
+
}, []), x = X((_, w) => {
|
|
19036
19036
|
if (s) return;
|
|
19037
|
-
|
|
19038
|
-
const
|
|
19037
|
+
w.preventDefault(), w.stopPropagation();
|
|
19038
|
+
const S = w.currentTarget, C = parseFloat(S.dataset.x || "0"), v = parseFloat(S.dataset.y || "0");
|
|
19039
19039
|
f.current = {
|
|
19040
|
-
x:
|
|
19041
|
-
y:
|
|
19040
|
+
x: w.clientX,
|
|
19041
|
+
y: w.clientY,
|
|
19042
19042
|
nodeX: C,
|
|
19043
|
-
nodeY:
|
|
19044
|
-
}, p.current = { x: C, y:
|
|
19043
|
+
nodeY: v
|
|
19044
|
+
}, p.current = { x: C, y: v }, a(_), u(!0), d({ x: 0, y: 0 }), t == null || t(_);
|
|
19045
19045
|
}, [s, m, t]), b = X((_) => {
|
|
19046
19046
|
if (!l || !o || !f.current) return;
|
|
19047
|
-
const
|
|
19048
|
-
p.current = { x:
|
|
19047
|
+
const w = g.current, S = f.current, C = _.clientX - S.x, v = _.clientY - S.y, E = C / w.k, N = v / w.k, A = S.nodeX + E, T = S.nodeY + N;
|
|
19048
|
+
p.current = { x: A, y: T }, d({ x: E, y: N }), n == null || n(o, A, T, E, N);
|
|
19049
19049
|
}, [l, o, n]), y = X(() => {
|
|
19050
19050
|
if (!l || !o) return;
|
|
19051
19051
|
const _ = p.current;
|
|
@@ -19053,13 +19053,13 @@ function K2(r) {
|
|
|
19053
19053
|
}, [l, o, i]);
|
|
19054
19054
|
return Te(() => {
|
|
19055
19055
|
if (!l) return;
|
|
19056
|
-
const _ = (
|
|
19057
|
-
b(
|
|
19058
|
-
},
|
|
19056
|
+
const _ = (S) => {
|
|
19057
|
+
b(S);
|
|
19058
|
+
}, w = () => {
|
|
19059
19059
|
y();
|
|
19060
19060
|
};
|
|
19061
|
-
return window.addEventListener("mousemove", _), window.addEventListener("mouseup",
|
|
19062
|
-
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup",
|
|
19061
|
+
return window.addEventListener("mousemove", _), window.addEventListener("mouseup", w), () => {
|
|
19062
|
+
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", w);
|
|
19063
19063
|
};
|
|
19064
19064
|
}, [l, b, y]), {
|
|
19065
19065
|
draggedNodeId: o,
|
|
@@ -19077,43 +19077,43 @@ function Y2(r) {
|
|
|
19077
19077
|
disabled: n = !1,
|
|
19078
19078
|
controlledSelectedIds: i,
|
|
19079
19079
|
onSelectionChange: s
|
|
19080
|
-
} = r, [o, a] = I(/* @__PURE__ */ new Set()), l = i !== void 0, u = l ? new Set(i) : o, c = l ? (
|
|
19081
|
-
const
|
|
19082
|
-
s == null || s(Array.from(
|
|
19080
|
+
} = r, [o, a] = I(/* @__PURE__ */ new Set()), l = i !== void 0, u = l ? new Set(i) : o, c = l ? (A) => {
|
|
19081
|
+
const T = typeof A == "function" ? A(u) : A;
|
|
19082
|
+
s == null || s(Array.from(T));
|
|
19083
19083
|
} : a, [d, f] = I(null), [p, g] = I(!1), m = be(null), x = be(e), b = be(t);
|
|
19084
19084
|
Te(() => {
|
|
19085
19085
|
x.current = e;
|
|
19086
19086
|
}, [e]), Te(() => {
|
|
19087
19087
|
b.current = t;
|
|
19088
19088
|
}, [t]);
|
|
19089
|
-
const y = X((
|
|
19090
|
-
const
|
|
19089
|
+
const y = X((A, T) => {
|
|
19090
|
+
const F = x.current;
|
|
19091
19091
|
return {
|
|
19092
|
-
x: (
|
|
19093
|
-
y: (
|
|
19092
|
+
x: (A - F.x) / F.k,
|
|
19093
|
+
y: (T - F.y) / F.k
|
|
19094
19094
|
};
|
|
19095
|
-
}, []), _ = X((
|
|
19096
|
-
const
|
|
19097
|
-
if (!
|
|
19098
|
-
const R =
|
|
19099
|
-
return
|
|
19100
|
-
}, []),
|
|
19101
|
-
if (n ||
|
|
19102
|
-
|
|
19103
|
-
const
|
|
19104
|
-
m.current =
|
|
19105
|
-
x:
|
|
19106
|
-
y:
|
|
19095
|
+
}, []), _ = X((A, T) => {
|
|
19096
|
+
const F = b.current.get(A);
|
|
19097
|
+
if (!F) return !1;
|
|
19098
|
+
const R = F.width || 200, D = F.height || 100;
|
|
19099
|
+
return F.x < T.x + T.width && F.x + R > T.x && F.y < T.y + T.height && F.y + D > T.y;
|
|
19100
|
+
}, []), w = X((A) => {
|
|
19101
|
+
if (n || A.target.closest("[data-qmap-node]")) return;
|
|
19102
|
+
A.preventDefault();
|
|
19103
|
+
const F = y(A.clientX, A.clientY);
|
|
19104
|
+
m.current = F, f({
|
|
19105
|
+
x: F.x,
|
|
19106
|
+
y: F.y,
|
|
19107
19107
|
width: 0,
|
|
19108
19108
|
height: 0
|
|
19109
|
-
}), g(!0),
|
|
19110
|
-
}, [n, y]),
|
|
19109
|
+
}), g(!0), A.shiftKey || c(/* @__PURE__ */ new Set());
|
|
19110
|
+
}, [n, y]), S = X((A) => {
|
|
19111
19111
|
if (!p || !m.current) return;
|
|
19112
|
-
const
|
|
19113
|
-
x: Math.min(
|
|
19114
|
-
y: Math.min(
|
|
19115
|
-
width: Math.abs(
|
|
19116
|
-
height: Math.abs(
|
|
19112
|
+
const T = m.current, F = y(A.clientX, A.clientY), R = {
|
|
19113
|
+
x: Math.min(T.x, F.x),
|
|
19114
|
+
y: Math.min(T.y, F.y),
|
|
19115
|
+
width: Math.abs(F.x - T.x),
|
|
19116
|
+
height: Math.abs(F.y - T.y)
|
|
19117
19117
|
};
|
|
19118
19118
|
f(R);
|
|
19119
19119
|
const D = /* @__PURE__ */ new Set();
|
|
@@ -19125,24 +19125,24 @@ function Y2(r) {
|
|
|
19125
19125
|
}, [p, u, s]);
|
|
19126
19126
|
Te(() => {
|
|
19127
19127
|
if (!p) return;
|
|
19128
|
-
const
|
|
19129
|
-
|
|
19130
|
-
},
|
|
19128
|
+
const A = (F) => {
|
|
19129
|
+
S(F);
|
|
19130
|
+
}, T = () => {
|
|
19131
19131
|
C();
|
|
19132
19132
|
};
|
|
19133
|
-
return window.addEventListener("mousemove",
|
|
19134
|
-
window.removeEventListener("mousemove",
|
|
19133
|
+
return window.addEventListener("mousemove", A), window.addEventListener("mouseup", T), () => {
|
|
19134
|
+
window.removeEventListener("mousemove", A), window.removeEventListener("mouseup", T);
|
|
19135
19135
|
};
|
|
19136
|
-
}, [p,
|
|
19137
|
-
const
|
|
19138
|
-
c((
|
|
19139
|
-
const R = new Set(
|
|
19140
|
-
return
|
|
19136
|
+
}, [p, S, C]);
|
|
19137
|
+
const v = X((A, T = !1) => {
|
|
19138
|
+
c((F) => {
|
|
19139
|
+
const R = new Set(T ? F : []);
|
|
19140
|
+
return F.has(A) && T ? R.delete(A) : R.add(A), s == null || s(Array.from(R)), R;
|
|
19141
19141
|
});
|
|
19142
|
-
}, [s]),
|
|
19143
|
-
const
|
|
19144
|
-
c(
|
|
19145
|
-
}, [s]),
|
|
19142
|
+
}, [s]), E = X(() => {
|
|
19143
|
+
const A = new Set(b.current.keys());
|
|
19144
|
+
c(A), s == null || s(Array.from(A));
|
|
19145
|
+
}, [s]), N = X(() => {
|
|
19146
19146
|
c(/* @__PURE__ */ new Set()), s == null || s([]);
|
|
19147
19147
|
}, [s]);
|
|
19148
19148
|
return {
|
|
@@ -19150,12 +19150,12 @@ function Y2(r) {
|
|
|
19150
19150
|
setSelectedIds: c,
|
|
19151
19151
|
selectionBox: d,
|
|
19152
19152
|
isSelecting: p,
|
|
19153
|
-
startSelection:
|
|
19154
|
-
updateSelection:
|
|
19153
|
+
startSelection: w,
|
|
19154
|
+
updateSelection: S,
|
|
19155
19155
|
endSelection: C,
|
|
19156
|
-
toggleSelect:
|
|
19157
|
-
selectAll:
|
|
19158
|
-
clearSelection:
|
|
19156
|
+
toggleSelect: v,
|
|
19157
|
+
selectAll: E,
|
|
19158
|
+
clearSelection: N
|
|
19159
19159
|
};
|
|
19160
19160
|
}
|
|
19161
19161
|
const Q2 = as(function({
|
|
@@ -19473,15 +19473,15 @@ function Gy({
|
|
|
19473
19473
|
initialTransform: b,
|
|
19474
19474
|
defaultEdgeStyle: y = oy,
|
|
19475
19475
|
defaultEdgeColor: _ = ly,
|
|
19476
|
-
defaultEdgeWidth:
|
|
19477
|
-
draggable:
|
|
19476
|
+
defaultEdgeWidth: w = ay,
|
|
19477
|
+
draggable: S = !0,
|
|
19478
19478
|
selectable: C = !0,
|
|
19479
|
-
zoomable:
|
|
19480
|
-
pannable:
|
|
19481
|
-
className:
|
|
19482
|
-
style:
|
|
19483
|
-
background:
|
|
19484
|
-
showGrid:
|
|
19479
|
+
zoomable: v = !0,
|
|
19480
|
+
pannable: E = !0,
|
|
19481
|
+
className: N = "",
|
|
19482
|
+
style: A,
|
|
19483
|
+
background: T = "#f8fafc",
|
|
19484
|
+
showGrid: F = !1,
|
|
19485
19485
|
gridSize: R = 20
|
|
19486
19486
|
}) {
|
|
19487
19487
|
const D = r.data || { positions: {} }, B = D.positions || {}, M = ct(() => {
|
|
@@ -19509,8 +19509,8 @@ function Gy({
|
|
|
19509
19509
|
minZoom: m,
|
|
19510
19510
|
maxZoom: x,
|
|
19511
19511
|
initialTransform: b || D.transform,
|
|
19512
|
-
zoomable:
|
|
19513
|
-
pannable:
|
|
19512
|
+
zoomable: v,
|
|
19513
|
+
pannable: E,
|
|
19514
19514
|
onTransformChange: (Y) => {
|
|
19515
19515
|
g == null || g(Y);
|
|
19516
19516
|
const L = {
|
|
@@ -19526,7 +19526,7 @@ function Gy({
|
|
|
19526
19526
|
// endDrag - handled internally by hook
|
|
19527
19527
|
} = K2({
|
|
19528
19528
|
transform: O,
|
|
19529
|
-
disabled: !
|
|
19529
|
+
disabled: !S,
|
|
19530
19530
|
onDragStart: (Y) => {
|
|
19531
19531
|
const L = M.get(Y);
|
|
19532
19532
|
L && se(/* @__PURE__ */ new Map([[Y, { x: L.x, y: L.y }]]));
|
|
@@ -19565,7 +19565,7 @@ function Gy({
|
|
|
19565
19565
|
Y.target.closest("[data-qmap-node]") || ie();
|
|
19566
19566
|
}, [ie]), ze = X((Y) => {
|
|
19567
19567
|
Y.button === 0 && (Y.target.closest("[data-qmap-node]") || Z(Y));
|
|
19568
|
-
}, [Z]), He =
|
|
19568
|
+
}, [Z]), He = F ? `
|
|
19569
19569
|
linear-gradient(to right, rgba(0,0,0,0.05) 1px, transparent 1px),
|
|
19570
19570
|
linear-gradient(to bottom, rgba(0,0,0,0.05) 1px, transparent 1px)
|
|
19571
19571
|
` : void 0;
|
|
@@ -19573,17 +19573,17 @@ function Gy({
|
|
|
19573
19573
|
"div",
|
|
19574
19574
|
{
|
|
19575
19575
|
ref: V,
|
|
19576
|
-
className: `qmap-container ${
|
|
19576
|
+
className: `qmap-container ${N}`,
|
|
19577
19577
|
style: {
|
|
19578
19578
|
position: "relative",
|
|
19579
19579
|
width: "100%",
|
|
19580
19580
|
height: "100%",
|
|
19581
19581
|
overflow: "hidden",
|
|
19582
|
-
background:
|
|
19582
|
+
background: T,
|
|
19583
19583
|
backgroundImage: He,
|
|
19584
|
-
backgroundSize:
|
|
19585
|
-
cursor: _e ? "crosshair" :
|
|
19586
|
-
...
|
|
19584
|
+
backgroundSize: F ? `${R}px ${R}px` : void 0,
|
|
19585
|
+
cursor: _e ? "crosshair" : E ? "grab" : "default",
|
|
19586
|
+
...A
|
|
19587
19587
|
},
|
|
19588
19588
|
onMouseDown: ze,
|
|
19589
19589
|
onClick: qe,
|
|
@@ -19606,7 +19606,7 @@ function Gy({
|
|
|
19606
19606
|
nodePositions: Se,
|
|
19607
19607
|
defaultStyle: y,
|
|
19608
19608
|
defaultColor: _,
|
|
19609
|
-
defaultWidth:
|
|
19609
|
+
defaultWidth: w,
|
|
19610
19610
|
onEdgeClick: f
|
|
19611
19611
|
}
|
|
19612
19612
|
),
|
|
@@ -19619,7 +19619,7 @@ function Gy({
|
|
|
19619
19619
|
position: L,
|
|
19620
19620
|
isSelected: ye,
|
|
19621
19621
|
isDragging: Ke,
|
|
19622
|
-
draggable:
|
|
19622
|
+
draggable: S,
|
|
19623
19623
|
onDragStart: fe,
|
|
19624
19624
|
onClick: (z) => ke(Y, z),
|
|
19625
19625
|
onDoubleClick: (z) => l == null ? void 0 : l(Y, z),
|