@qwanyx/stack 0.2.92 → 0.2.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AnimatedCardFlip.d.ts +2 -1
- package/dist/components/VoiceTextEditor.d.ts +3 -1
- package/dist/index.cjs.js +23 -23
- package/dist/index.esm.js +1136 -1095
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3631,10 +3631,10 @@ class Hd {
|
|
|
3631
3631
|
for (const p of c.messages)
|
|
3632
3632
|
p.uid && d.set(p.uid, p);
|
|
3633
3633
|
const f = l.map((p) => {
|
|
3634
|
-
var _,
|
|
3634
|
+
var _, D, E, w, v;
|
|
3635
3635
|
const g = d.get(p);
|
|
3636
3636
|
if (!g) return null;
|
|
3637
|
-
const m = ((_ = g.flags) == null ? void 0 : _.some((S) => S.includes("Seen"))) || !1, x = ((E = (
|
|
3637
|
+
const m = ((_ = g.flags) == null ? void 0 : _.some((S) => S.includes("Seen"))) || !1, x = ((E = (D = g.envelope) == null ? void 0 : D.from) == null ? void 0 : E.email) || "Unknown", b = ((w = g.envelope) == null ? void 0 : w.subject) || "(No subject)", y = ((v = g.envelope) == null ? void 0 : v.date) || "";
|
|
3638
3638
|
return { uid: p, from: x, subject: b, date: y, seen: m };
|
|
3639
3639
|
}).filter(Boolean);
|
|
3640
3640
|
return {
|
|
@@ -3687,26 +3687,26 @@ class Hd {
|
|
|
3687
3687
|
const s = (await this.imapExec(e, [
|
|
3688
3688
|
`SELECT "${n}"`,
|
|
3689
3689
|
`UID FETCH ${t} (FLAGS BODY[])`
|
|
3690
|
-
])).responses.find((
|
|
3690
|
+
])).responses.find((D) => D.command === "UID FETCH");
|
|
3691
3691
|
if (!(s != null && s.ok) || !((g = s.messages) != null && g[0]))
|
|
3692
3692
|
return console.error("Failed to fetch raw email:", s == null ? void 0 : s.error), null;
|
|
3693
3693
|
const o = s.messages[0], a = o.body || o.raw;
|
|
3694
3694
|
if (!a)
|
|
3695
3695
|
return console.error("No raw email content in response"), null;
|
|
3696
3696
|
const u = await new Fi().parse(a);
|
|
3697
|
-
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((
|
|
3697
|
+
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((D) => ({ filename: D.filename, mimeType: D.mimeType, contentId: D.contentId })));
|
|
3698
3698
|
const c = /* @__PURE__ */ new Map();
|
|
3699
|
-
for (const
|
|
3700
|
-
if (
|
|
3701
|
-
const E = this.contentToBase64(
|
|
3702
|
-
c.set(v,
|
|
3699
|
+
for (const D of u.attachments || [])
|
|
3700
|
+
if (D.contentId) {
|
|
3701
|
+
const E = this.contentToBase64(D.content), w = `data:${D.mimeType};base64,${E}`, v = D.contentId.replace(/^<|>$/g, "");
|
|
3702
|
+
c.set(v, w), c.set(`<${v}>`, w);
|
|
3703
3703
|
}
|
|
3704
3704
|
let d = u.html || "";
|
|
3705
|
-
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (
|
|
3706
|
-
const
|
|
3707
|
-
return
|
|
3705
|
+
d && c.size > 0 && (d = d.replace(/src=["']cid:([^"']+)["']/gi, (D, E) => {
|
|
3706
|
+
const w = c.get(E) || c.get(`<${E}>`);
|
|
3707
|
+
return w ? `src="${w}"` : D;
|
|
3708
3708
|
}));
|
|
3709
|
-
const f = ((b = o.flags) == null ? void 0 : b.some((
|
|
3709
|
+
const f = ((b = o.flags) == null ? void 0 : b.some((D) => D.toLowerCase().includes("seen"))) || !1, p = ((y = u.from) == null ? void 0 : y.address) || ((_ = u.from) == null ? void 0 : _.name) || "Unknown";
|
|
3710
3710
|
return {
|
|
3711
3711
|
uid: t,
|
|
3712
3712
|
from: p,
|
|
@@ -3716,10 +3716,10 @@ class Hd {
|
|
|
3716
3716
|
html: d,
|
|
3717
3717
|
text: u.text || "",
|
|
3718
3718
|
seen: f,
|
|
3719
|
-
attachments: (u.attachments || []).map((
|
|
3720
|
-
filename:
|
|
3721
|
-
mimeType:
|
|
3722
|
-
size: this.getContentSize(
|
|
3719
|
+
attachments: (u.attachments || []).map((D) => ({
|
|
3720
|
+
filename: D.filename || "attachment",
|
|
3721
|
+
mimeType: D.mimeType || "application/octet-stream",
|
|
3722
|
+
size: this.getContentSize(D.content)
|
|
3723
3723
|
}))
|
|
3724
3724
|
};
|
|
3725
3725
|
}
|
|
@@ -4418,57 +4418,57 @@ var El;
|
|
|
4418
4418
|
function Kd() {
|
|
4419
4419
|
return El || (El = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4420
4420
|
var r = Le, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), g = Symbol.iterator, m = "@@iterator";
|
|
4421
|
-
function x(
|
|
4422
|
-
if (
|
|
4421
|
+
function x(k) {
|
|
4422
|
+
if (k === null || typeof k != "object")
|
|
4423
4423
|
return null;
|
|
4424
|
-
var $ = g &&
|
|
4424
|
+
var $ = g && k[g] || k[m];
|
|
4425
4425
|
return typeof $ == "function" ? $ : null;
|
|
4426
4426
|
}
|
|
4427
4427
|
var b = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
4428
|
-
function y(
|
|
4428
|
+
function y(k) {
|
|
4429
4429
|
{
|
|
4430
4430
|
for (var $ = arguments.length, te = new Array($ > 1 ? $ - 1 : 0), pe = 1; pe < $; pe++)
|
|
4431
4431
|
te[pe - 1] = arguments[pe];
|
|
4432
|
-
_("error",
|
|
4432
|
+
_("error", k, te);
|
|
4433
4433
|
}
|
|
4434
4434
|
}
|
|
4435
|
-
function _(
|
|
4435
|
+
function _(k, $, te) {
|
|
4436
4436
|
{
|
|
4437
4437
|
var pe = b.ReactDebugCurrentFrame, je = pe.getStackAddendum();
|
|
4438
4438
|
je !== "" && ($ += "%s", te = te.concat([je]));
|
|
4439
4439
|
var $e = te.map(function(Fe) {
|
|
4440
4440
|
return String(Fe);
|
|
4441
4441
|
});
|
|
4442
|
-
$e.unshift("Warning: " + $), Function.prototype.apply.call(console[
|
|
4442
|
+
$e.unshift("Warning: " + $), Function.prototype.apply.call(console[k], console, $e);
|
|
4443
4443
|
}
|
|
4444
4444
|
}
|
|
4445
|
-
var
|
|
4445
|
+
var D = !1, E = !1, w = !1, v = !1, S = !1, F;
|
|
4446
4446
|
F = Symbol.for("react.module.reference");
|
|
4447
|
-
function
|
|
4448
|
-
return !!(typeof
|
|
4447
|
+
function T(k) {
|
|
4448
|
+
return !!(typeof k == "string" || typeof k == "function" || k === n || k === s || S || k === i || k === u || k === c || v || k === p || D || E || w || 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
|
|
4449
4449
|
// types supported by any Flight configuration anywhere since
|
|
4450
4450
|
// we don't know which Flight build this will end up being used
|
|
4451
4451
|
// with.
|
|
4452
|
-
|
|
4452
|
+
k.$$typeof === F || k.getModuleId !== void 0));
|
|
4453
4453
|
}
|
|
4454
|
-
function k
|
|
4455
|
-
var pe =
|
|
4454
|
+
function A(k, $, te) {
|
|
4455
|
+
var pe = k.displayName;
|
|
4456
4456
|
if (pe)
|
|
4457
4457
|
return pe;
|
|
4458
4458
|
var je = $.displayName || $.name || "";
|
|
4459
4459
|
return je !== "" ? te + "(" + je + ")" : te;
|
|
4460
4460
|
}
|
|
4461
|
-
function B(
|
|
4462
|
-
return
|
|
4461
|
+
function B(k) {
|
|
4462
|
+
return k.displayName || "Context";
|
|
4463
4463
|
}
|
|
4464
|
-
function
|
|
4465
|
-
if (
|
|
4464
|
+
function M(k) {
|
|
4465
|
+
if (k == null)
|
|
4466
4466
|
return null;
|
|
4467
|
-
if (typeof
|
|
4468
|
-
return
|
|
4469
|
-
if (typeof
|
|
4470
|
-
return
|
|
4471
|
-
switch (
|
|
4467
|
+
if (typeof k.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof k == "function")
|
|
4468
|
+
return k.displayName || k.name || null;
|
|
4469
|
+
if (typeof k == "string")
|
|
4470
|
+
return k;
|
|
4471
|
+
switch (k) {
|
|
4472
4472
|
case n:
|
|
4473
4473
|
return "Fragment";
|
|
4474
4474
|
case t:
|
|
@@ -4482,23 +4482,23 @@ function Kd() {
|
|
|
4482
4482
|
case c:
|
|
4483
4483
|
return "SuspenseList";
|
|
4484
4484
|
}
|
|
4485
|
-
if (typeof
|
|
4486
|
-
switch (
|
|
4485
|
+
if (typeof k == "object")
|
|
4486
|
+
switch (k.$$typeof) {
|
|
4487
4487
|
case a:
|
|
4488
|
-
var $ =
|
|
4488
|
+
var $ = k;
|
|
4489
4489
|
return B($) + ".Consumer";
|
|
4490
4490
|
case o:
|
|
4491
|
-
var te =
|
|
4491
|
+
var te = k;
|
|
4492
4492
|
return B(te._context) + ".Provider";
|
|
4493
4493
|
case l:
|
|
4494
|
-
return k
|
|
4494
|
+
return A(k, k.render, "ForwardRef");
|
|
4495
4495
|
case d:
|
|
4496
|
-
var pe =
|
|
4497
|
-
return pe !== null ? pe :
|
|
4496
|
+
var pe = k.displayName || null;
|
|
4497
|
+
return pe !== null ? pe : M(k.type) || "Memo";
|
|
4498
4498
|
case f: {
|
|
4499
|
-
var je =
|
|
4499
|
+
var je = k, $e = je._payload, Fe = je._init;
|
|
4500
4500
|
try {
|
|
4501
|
-
return
|
|
4501
|
+
return M(Fe($e));
|
|
4502
4502
|
} catch {
|
|
4503
4503
|
return null;
|
|
4504
4504
|
}
|
|
@@ -4506,28 +4506,28 @@ function Kd() {
|
|
|
4506
4506
|
}
|
|
4507
4507
|
return null;
|
|
4508
4508
|
}
|
|
4509
|
-
var
|
|
4509
|
+
var C = Object.assign, N = 0, R, O, V, U, re, q, Z;
|
|
4510
4510
|
function W() {
|
|
4511
4511
|
}
|
|
4512
4512
|
W.__reactDisabledLog = !0;
|
|
4513
4513
|
function se() {
|
|
4514
4514
|
{
|
|
4515
4515
|
if (N === 0) {
|
|
4516
|
-
|
|
4517
|
-
var
|
|
4516
|
+
R = console.log, O = console.info, V = console.warn, U = console.error, re = console.group, q = console.groupCollapsed, Z = console.groupEnd;
|
|
4517
|
+
var k = {
|
|
4518
4518
|
configurable: !0,
|
|
4519
4519
|
enumerable: !0,
|
|
4520
4520
|
value: W,
|
|
4521
4521
|
writable: !0
|
|
4522
4522
|
};
|
|
4523
4523
|
Object.defineProperties(console, {
|
|
4524
|
-
info:
|
|
4525
|
-
log:
|
|
4526
|
-
warn:
|
|
4527
|
-
error:
|
|
4528
|
-
group:
|
|
4529
|
-
groupCollapsed:
|
|
4530
|
-
groupEnd:
|
|
4524
|
+
info: k,
|
|
4525
|
+
log: k,
|
|
4526
|
+
warn: k,
|
|
4527
|
+
error: k,
|
|
4528
|
+
group: k,
|
|
4529
|
+
groupCollapsed: k,
|
|
4530
|
+
groupEnd: k
|
|
4531
4531
|
});
|
|
4532
4532
|
}
|
|
4533
4533
|
N++;
|
|
@@ -4536,31 +4536,31 @@ function Kd() {
|
|
|
4536
4536
|
function ce() {
|
|
4537
4537
|
{
|
|
4538
4538
|
if (N--, N === 0) {
|
|
4539
|
-
var
|
|
4539
|
+
var k = {
|
|
4540
4540
|
configurable: !0,
|
|
4541
4541
|
enumerable: !0,
|
|
4542
4542
|
writable: !0
|
|
4543
4543
|
};
|
|
4544
4544
|
Object.defineProperties(console, {
|
|
4545
|
-
log:
|
|
4546
|
-
value:
|
|
4545
|
+
log: C({}, k, {
|
|
4546
|
+
value: R
|
|
4547
4547
|
}),
|
|
4548
|
-
info:
|
|
4548
|
+
info: C({}, k, {
|
|
4549
4549
|
value: O
|
|
4550
4550
|
}),
|
|
4551
|
-
warn:
|
|
4551
|
+
warn: C({}, k, {
|
|
4552
4552
|
value: V
|
|
4553
4553
|
}),
|
|
4554
|
-
error:
|
|
4554
|
+
error: C({}, k, {
|
|
4555
4555
|
value: U
|
|
4556
4556
|
}),
|
|
4557
|
-
group:
|
|
4557
|
+
group: C({}, k, {
|
|
4558
4558
|
value: re
|
|
4559
4559
|
}),
|
|
4560
|
-
groupCollapsed:
|
|
4560
|
+
groupCollapsed: C({}, k, {
|
|
4561
4561
|
value: q
|
|
4562
4562
|
}),
|
|
4563
|
-
groupEnd:
|
|
4563
|
+
groupEnd: C({}, k, {
|
|
4564
4564
|
value: Z
|
|
4565
4565
|
})
|
|
4566
4566
|
});
|
|
@@ -4569,7 +4569,7 @@ function Kd() {
|
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
4571
4571
|
var fe = b.ReactCurrentDispatcher, ge;
|
|
4572
|
-
function Be(
|
|
4572
|
+
function Be(k, $, te) {
|
|
4573
4573
|
{
|
|
4574
4574
|
if (ge === void 0)
|
|
4575
4575
|
try {
|
|
@@ -4579,7 +4579,7 @@ function Kd() {
|
|
|
4579
4579
|
ge = pe && pe[1] || "";
|
|
4580
4580
|
}
|
|
4581
4581
|
return `
|
|
4582
|
-
` + ge +
|
|
4582
|
+
` + ge + k;
|
|
4583
4583
|
}
|
|
4584
4584
|
}
|
|
4585
4585
|
var _e = !1, ee;
|
|
@@ -4587,11 +4587,11 @@ function Kd() {
|
|
|
4587
4587
|
var Se = typeof WeakMap == "function" ? WeakMap : Map;
|
|
4588
4588
|
ee = new Se();
|
|
4589
4589
|
}
|
|
4590
|
-
function ie(
|
|
4591
|
-
if (!
|
|
4590
|
+
function ie(k, $) {
|
|
4591
|
+
if (!k || _e)
|
|
4592
4592
|
return "";
|
|
4593
4593
|
{
|
|
4594
|
-
var te = ee.get(
|
|
4594
|
+
var te = ee.get(k);
|
|
4595
4595
|
if (te !== void 0)
|
|
4596
4596
|
return te;
|
|
4597
4597
|
}
|
|
@@ -4616,14 +4616,14 @@ function Kd() {
|
|
|
4616
4616
|
} catch (Ct) {
|
|
4617
4617
|
pe = Ct;
|
|
4618
4618
|
}
|
|
4619
|
-
Reflect.construct(
|
|
4619
|
+
Reflect.construct(k, [], Fe);
|
|
4620
4620
|
} else {
|
|
4621
4621
|
try {
|
|
4622
4622
|
Fe.call();
|
|
4623
4623
|
} catch (Ct) {
|
|
4624
4624
|
pe = Ct;
|
|
4625
4625
|
}
|
|
4626
|
-
|
|
4626
|
+
k.call(Fe.prototype);
|
|
4627
4627
|
}
|
|
4628
4628
|
} else {
|
|
4629
4629
|
try {
|
|
@@ -4631,7 +4631,7 @@ function Kd() {
|
|
|
4631
4631
|
} catch (Ct) {
|
|
4632
4632
|
pe = Ct;
|
|
4633
4633
|
}
|
|
4634
|
-
|
|
4634
|
+
k();
|
|
4635
4635
|
}
|
|
4636
4636
|
} catch (Ct) {
|
|
4637
4637
|
if (Ct && pe && typeof Ct.stack == "string") {
|
|
@@ -4646,7 +4646,7 @@ function Kd() {
|
|
|
4646
4646
|
if (nt--, st--, st < 0 || Me[nt] !== yt[st]) {
|
|
4647
4647
|
var Rt = `
|
|
4648
4648
|
` + Me[nt].replace(" at new ", " at ");
|
|
4649
|
-
return
|
|
4649
|
+
return k.displayName && Rt.includes("<anonymous>") && (Rt = Rt.replace("<anonymous>", k.displayName)), typeof k == "function" && ee.set(k, Rt), Rt;
|
|
4650
4650
|
}
|
|
4651
4651
|
while (nt >= 1 && st >= 0);
|
|
4652
4652
|
break;
|
|
@@ -4655,37 +4655,37 @@ function Kd() {
|
|
|
4655
4655
|
} finally {
|
|
4656
4656
|
_e = !1, fe.current = $e, ce(), Error.prepareStackTrace = je;
|
|
4657
4657
|
}
|
|
4658
|
-
var Hr =
|
|
4659
|
-
return typeof
|
|
4658
|
+
var Hr = k ? k.displayName || k.name : "", Er = Hr ? Be(Hr) : "";
|
|
4659
|
+
return typeof k == "function" && ee.set(k, Er), Er;
|
|
4660
4660
|
}
|
|
4661
|
-
function Re(
|
|
4662
|
-
return ie(
|
|
4661
|
+
function Re(k, $, te) {
|
|
4662
|
+
return ie(k, !1);
|
|
4663
4663
|
}
|
|
4664
|
-
function ke(
|
|
4665
|
-
var $ =
|
|
4664
|
+
function ke(k) {
|
|
4665
|
+
var $ = k.prototype;
|
|
4666
4666
|
return !!($ && $.isReactComponent);
|
|
4667
4667
|
}
|
|
4668
|
-
function Ae(
|
|
4669
|
-
if (
|
|
4668
|
+
function Ae(k, $, te) {
|
|
4669
|
+
if (k == null)
|
|
4670
4670
|
return "";
|
|
4671
|
-
if (typeof
|
|
4672
|
-
return ie(
|
|
4673
|
-
if (typeof
|
|
4674
|
-
return Be(
|
|
4675
|
-
switch (
|
|
4671
|
+
if (typeof k == "function")
|
|
4672
|
+
return ie(k, ke(k));
|
|
4673
|
+
if (typeof k == "string")
|
|
4674
|
+
return Be(k);
|
|
4675
|
+
switch (k) {
|
|
4676
4676
|
case u:
|
|
4677
4677
|
return Be("Suspense");
|
|
4678
4678
|
case c:
|
|
4679
4679
|
return Be("SuspenseList");
|
|
4680
4680
|
}
|
|
4681
|
-
if (typeof
|
|
4682
|
-
switch (
|
|
4681
|
+
if (typeof k == "object")
|
|
4682
|
+
switch (k.$$typeof) {
|
|
4683
4683
|
case l:
|
|
4684
|
-
return Re(
|
|
4684
|
+
return Re(k.render);
|
|
4685
4685
|
case d:
|
|
4686
|
-
return Ae(
|
|
4686
|
+
return Ae(k.type, $, te);
|
|
4687
4687
|
case f: {
|
|
4688
|
-
var pe =
|
|
4688
|
+
var pe = k, je = pe._payload, $e = pe._init;
|
|
4689
4689
|
try {
|
|
4690
4690
|
return Ae($e(je), $, te);
|
|
4691
4691
|
} catch {
|
|
@@ -4695,25 +4695,25 @@ function Kd() {
|
|
|
4695
4695
|
return "";
|
|
4696
4696
|
}
|
|
4697
4697
|
var qe = Object.prototype.hasOwnProperty, ze = {}, He = b.ReactDebugCurrentFrame;
|
|
4698
|
-
function Y(
|
|
4699
|
-
if (
|
|
4700
|
-
var $ =
|
|
4698
|
+
function Y(k) {
|
|
4699
|
+
if (k) {
|
|
4700
|
+
var $ = k._owner, te = Ae(k.type, k._source, $ ? $.type : null);
|
|
4701
4701
|
He.setExtraStackFrame(te);
|
|
4702
4702
|
} else
|
|
4703
4703
|
He.setExtraStackFrame(null);
|
|
4704
4704
|
}
|
|
4705
|
-
function L(
|
|
4705
|
+
function L(k, $, te, pe, je) {
|
|
4706
4706
|
{
|
|
4707
4707
|
var $e = Function.call.bind(qe);
|
|
4708
|
-
for (var Fe in
|
|
4709
|
-
if ($e(
|
|
4708
|
+
for (var Fe in k)
|
|
4709
|
+
if ($e(k, Fe)) {
|
|
4710
4710
|
var Me = void 0;
|
|
4711
4711
|
try {
|
|
4712
|
-
if (typeof
|
|
4713
|
-
var yt = Error((pe || "React class") + ": " + te + " type `" + Fe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof
|
|
4712
|
+
if (typeof k[Fe] != "function") {
|
|
4713
|
+
var yt = Error((pe || "React class") + ": " + te + " type `" + Fe + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof k[Fe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4714
4714
|
throw yt.name = "Invariant Violation", yt;
|
|
4715
4715
|
}
|
|
4716
|
-
Me =
|
|
4716
|
+
Me = k[Fe]($, Fe, pe, te, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4717
4717
|
} catch (nt) {
|
|
4718
4718
|
Me = nt;
|
|
4719
4719
|
}
|
|
@@ -4722,28 +4722,28 @@ function Kd() {
|
|
|
4722
4722
|
}
|
|
4723
4723
|
}
|
|
4724
4724
|
var ye = Array.isArray;
|
|
4725
|
-
function Ke(
|
|
4726
|
-
return ye(
|
|
4725
|
+
function Ke(k) {
|
|
4726
|
+
return ye(k);
|
|
4727
4727
|
}
|
|
4728
|
-
function z(
|
|
4728
|
+
function z(k) {
|
|
4729
4729
|
{
|
|
4730
|
-
var $ = typeof Symbol == "function" && Symbol.toStringTag, te = $ &&
|
|
4730
|
+
var $ = typeof Symbol == "function" && Symbol.toStringTag, te = $ && k[Symbol.toStringTag] || k.constructor.name || "Object";
|
|
4731
4731
|
return te;
|
|
4732
4732
|
}
|
|
4733
4733
|
}
|
|
4734
|
-
function ae(
|
|
4734
|
+
function ae(k) {
|
|
4735
4735
|
try {
|
|
4736
|
-
return me(
|
|
4736
|
+
return me(k), !1;
|
|
4737
4737
|
} catch {
|
|
4738
4738
|
return !0;
|
|
4739
4739
|
}
|
|
4740
4740
|
}
|
|
4741
|
-
function me(
|
|
4742
|
-
return "" +
|
|
4741
|
+
function me(k) {
|
|
4742
|
+
return "" + k;
|
|
4743
4743
|
}
|
|
4744
|
-
function xe(
|
|
4745
|
-
if (ae(
|
|
4746
|
-
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(
|
|
4744
|
+
function xe(k) {
|
|
4745
|
+
if (ae(k))
|
|
4746
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", z(k)), me(k);
|
|
4747
4747
|
}
|
|
4748
4748
|
var Ge = b.ReactCurrentOwner, vt = {
|
|
4749
4749
|
key: !0,
|
|
@@ -4751,53 +4751,53 @@ function Kd() {
|
|
|
4751
4751
|
__self: !0,
|
|
4752
4752
|
__source: !0
|
|
4753
4753
|
}, wt, oe;
|
|
4754
|
-
function de(
|
|
4755
|
-
if (qe.call(
|
|
4756
|
-
var $ = Object.getOwnPropertyDescriptor(
|
|
4754
|
+
function de(k) {
|
|
4755
|
+
if (qe.call(k, "ref")) {
|
|
4756
|
+
var $ = Object.getOwnPropertyDescriptor(k, "ref").get;
|
|
4757
4757
|
if ($ && $.isReactWarning)
|
|
4758
4758
|
return !1;
|
|
4759
4759
|
}
|
|
4760
|
-
return
|
|
4760
|
+
return k.ref !== void 0;
|
|
4761
4761
|
}
|
|
4762
|
-
function Ye(
|
|
4763
|
-
if (qe.call(
|
|
4764
|
-
var $ = Object.getOwnPropertyDescriptor(
|
|
4762
|
+
function Ye(k) {
|
|
4763
|
+
if (qe.call(k, "key")) {
|
|
4764
|
+
var $ = Object.getOwnPropertyDescriptor(k, "key").get;
|
|
4765
4765
|
if ($ && $.isReactWarning)
|
|
4766
4766
|
return !1;
|
|
4767
4767
|
}
|
|
4768
|
-
return
|
|
4768
|
+
return k.key !== void 0;
|
|
4769
4769
|
}
|
|
4770
|
-
function tt(
|
|
4771
|
-
typeof
|
|
4770
|
+
function tt(k, $) {
|
|
4771
|
+
typeof k.ref == "string" && Ge.current;
|
|
4772
4772
|
}
|
|
4773
|
-
function rt(
|
|
4773
|
+
function rt(k, $) {
|
|
4774
4774
|
{
|
|
4775
4775
|
var te = function() {
|
|
4776
4776
|
wt || (wt = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", $));
|
|
4777
4777
|
};
|
|
4778
|
-
te.isReactWarning = !0, Object.defineProperty(
|
|
4778
|
+
te.isReactWarning = !0, Object.defineProperty(k, "key", {
|
|
4779
4779
|
get: te,
|
|
4780
4780
|
configurable: !0
|
|
4781
4781
|
});
|
|
4782
4782
|
}
|
|
4783
4783
|
}
|
|
4784
|
-
function Lt(
|
|
4784
|
+
function Lt(k, $) {
|
|
4785
4785
|
{
|
|
4786
4786
|
var te = function() {
|
|
4787
4787
|
oe || (oe = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", $));
|
|
4788
4788
|
};
|
|
4789
|
-
te.isReactWarning = !0, Object.defineProperty(
|
|
4789
|
+
te.isReactWarning = !0, Object.defineProperty(k, "ref", {
|
|
4790
4790
|
get: te,
|
|
4791
4791
|
configurable: !0
|
|
4792
4792
|
});
|
|
4793
4793
|
}
|
|
4794
4794
|
}
|
|
4795
|
-
var Q = function(
|
|
4795
|
+
var Q = function(k, $, te, pe, je, $e, Fe) {
|
|
4796
4796
|
var Me = {
|
|
4797
4797
|
// This tag allows us to uniquely identify this as a React Element
|
|
4798
4798
|
$$typeof: e,
|
|
4799
4799
|
// Built-in properties that belong on the element
|
|
4800
|
-
type:
|
|
4800
|
+
type: k,
|
|
4801
4801
|
key: $,
|
|
4802
4802
|
ref: te,
|
|
4803
4803
|
props: Fe,
|
|
@@ -4821,58 +4821,58 @@ function Kd() {
|
|
|
4821
4821
|
value: je
|
|
4822
4822
|
}), Object.freeze && (Object.freeze(Me.props), Object.freeze(Me)), Me;
|
|
4823
4823
|
};
|
|
4824
|
-
function j(
|
|
4824
|
+
function j(k, $, te, pe, je) {
|
|
4825
4825
|
{
|
|
4826
4826
|
var $e, Fe = {}, Me = null, yt = null;
|
|
4827
4827
|
te !== void 0 && (xe(te), Me = "" + te), Ye($) && (xe($.key), Me = "" + $.key), de($) && (yt = $.ref, tt($, je));
|
|
4828
4828
|
for ($e in $)
|
|
4829
4829
|
qe.call($, $e) && !vt.hasOwnProperty($e) && (Fe[$e] = $[$e]);
|
|
4830
|
-
if (
|
|
4831
|
-
var nt =
|
|
4830
|
+
if (k && k.defaultProps) {
|
|
4831
|
+
var nt = k.defaultProps;
|
|
4832
4832
|
for ($e in nt)
|
|
4833
4833
|
Fe[$e] === void 0 && (Fe[$e] = nt[$e]);
|
|
4834
4834
|
}
|
|
4835
4835
|
if (Me || yt) {
|
|
4836
|
-
var st = typeof
|
|
4836
|
+
var st = typeof k == "function" ? k.displayName || k.name || "Unknown" : k;
|
|
4837
4837
|
Me && rt(Fe, st), yt && Lt(Fe, st);
|
|
4838
4838
|
}
|
|
4839
|
-
return Q(
|
|
4839
|
+
return Q(k, Me, yt, je, pe, Ge.current, Fe);
|
|
4840
4840
|
}
|
|
4841
4841
|
}
|
|
4842
4842
|
var ue = b.ReactCurrentOwner, he = b.ReactDebugCurrentFrame;
|
|
4843
|
-
function G(
|
|
4844
|
-
if (
|
|
4845
|
-
var $ =
|
|
4843
|
+
function G(k) {
|
|
4844
|
+
if (k) {
|
|
4845
|
+
var $ = k._owner, te = Ae(k.type, k._source, $ ? $.type : null);
|
|
4846
4846
|
he.setExtraStackFrame(te);
|
|
4847
4847
|
} else
|
|
4848
4848
|
he.setExtraStackFrame(null);
|
|
4849
4849
|
}
|
|
4850
4850
|
var De;
|
|
4851
4851
|
De = !1;
|
|
4852
|
-
function ve(
|
|
4853
|
-
return typeof
|
|
4852
|
+
function ve(k) {
|
|
4853
|
+
return typeof k == "object" && k !== null && k.$$typeof === e;
|
|
4854
4854
|
}
|
|
4855
4855
|
function we() {
|
|
4856
4856
|
{
|
|
4857
4857
|
if (ue.current) {
|
|
4858
|
-
var
|
|
4859
|
-
if (
|
|
4858
|
+
var k = M(ue.current.type);
|
|
4859
|
+
if (k)
|
|
4860
4860
|
return `
|
|
4861
4861
|
|
|
4862
|
-
Check the render method of \`` +
|
|
4862
|
+
Check the render method of \`` + k + "`.";
|
|
4863
4863
|
}
|
|
4864
4864
|
return "";
|
|
4865
4865
|
}
|
|
4866
4866
|
}
|
|
4867
|
-
function Ie(
|
|
4867
|
+
function Ie(k) {
|
|
4868
4868
|
return "";
|
|
4869
4869
|
}
|
|
4870
4870
|
var Ve = {};
|
|
4871
|
-
function Ce(
|
|
4871
|
+
function Ce(k) {
|
|
4872
4872
|
{
|
|
4873
4873
|
var $ = we();
|
|
4874
4874
|
if (!$) {
|
|
4875
|
-
var te = typeof
|
|
4875
|
+
var te = typeof k == "string" ? k : k.displayName || k.name;
|
|
4876
4876
|
te && ($ = `
|
|
4877
4877
|
|
|
4878
4878
|
Check the top-level render call using <` + te + ">.");
|
|
@@ -4880,41 +4880,41 @@ Check the top-level render call using <` + te + ">.");
|
|
|
4880
4880
|
return $;
|
|
4881
4881
|
}
|
|
4882
4882
|
}
|
|
4883
|
-
function Te(
|
|
4883
|
+
function Te(k, $) {
|
|
4884
4884
|
{
|
|
4885
|
-
if (!
|
|
4885
|
+
if (!k._store || k._store.validated || k.key != null)
|
|
4886
4886
|
return;
|
|
4887
|
-
|
|
4887
|
+
k._store.validated = !0;
|
|
4888
4888
|
var te = Ce($);
|
|
4889
4889
|
if (Ve[te])
|
|
4890
4890
|
return;
|
|
4891
4891
|
Ve[te] = !0;
|
|
4892
4892
|
var pe = "";
|
|
4893
|
-
|
|
4893
|
+
k && k._owner && k._owner !== ue.current && (pe = " It was passed a child from " + M(k._owner.type) + "."), G(k), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', te, pe), G(null);
|
|
4894
4894
|
}
|
|
4895
4895
|
}
|
|
4896
|
-
function it(
|
|
4896
|
+
function it(k, $) {
|
|
4897
4897
|
{
|
|
4898
|
-
if (typeof
|
|
4898
|
+
if (typeof k != "object")
|
|
4899
4899
|
return;
|
|
4900
|
-
if (Ke(
|
|
4901
|
-
for (var te = 0; te <
|
|
4902
|
-
var pe =
|
|
4900
|
+
if (Ke(k))
|
|
4901
|
+
for (var te = 0; te < k.length; te++) {
|
|
4902
|
+
var pe = k[te];
|
|
4903
4903
|
ve(pe) && Te(pe, $);
|
|
4904
4904
|
}
|
|
4905
|
-
else if (ve(
|
|
4906
|
-
|
|
4907
|
-
else if (
|
|
4908
|
-
var je = x(
|
|
4909
|
-
if (typeof je == "function" && je !==
|
|
4910
|
-
for (var $e = je.call(
|
|
4905
|
+
else if (ve(k))
|
|
4906
|
+
k._store && (k._store.validated = !0);
|
|
4907
|
+
else if (k) {
|
|
4908
|
+
var je = x(k);
|
|
4909
|
+
if (typeof je == "function" && je !== k.entries)
|
|
4910
|
+
for (var $e = je.call(k), Fe; !(Fe = $e.next()).done; )
|
|
4911
4911
|
ve(Fe.value) && Te(Fe.value, $);
|
|
4912
4912
|
}
|
|
4913
4913
|
}
|
|
4914
4914
|
}
|
|
4915
|
-
function lt(
|
|
4915
|
+
function lt(k) {
|
|
4916
4916
|
{
|
|
4917
|
-
var $ =
|
|
4917
|
+
var $ = k.type;
|
|
4918
4918
|
if ($ == null || typeof $ == "string")
|
|
4919
4919
|
return;
|
|
4920
4920
|
var te;
|
|
@@ -4927,41 +4927,41 @@ Check the top-level render call using <` + te + ">.");
|
|
|
4927
4927
|
else
|
|
4928
4928
|
return;
|
|
4929
4929
|
if (te) {
|
|
4930
|
-
var pe =
|
|
4931
|
-
L(te,
|
|
4930
|
+
var pe = M($);
|
|
4931
|
+
L(te, k.props, "prop", pe, k);
|
|
4932
4932
|
} else if ($.PropTypes !== void 0 && !De) {
|
|
4933
4933
|
De = !0;
|
|
4934
|
-
var je =
|
|
4934
|
+
var je = M($);
|
|
4935
4935
|
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", je || "Unknown");
|
|
4936
4936
|
}
|
|
4937
4937
|
typeof $.getDefaultProps == "function" && !$.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
4938
4938
|
}
|
|
4939
4939
|
}
|
|
4940
|
-
function Qe(
|
|
4940
|
+
function Qe(k) {
|
|
4941
4941
|
{
|
|
4942
|
-
for (var $ = Object.keys(
|
|
4942
|
+
for (var $ = Object.keys(k.props), te = 0; te < $.length; te++) {
|
|
4943
4943
|
var pe = $[te];
|
|
4944
4944
|
if (pe !== "children" && pe !== "key") {
|
|
4945
|
-
G(
|
|
4945
|
+
G(k), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", pe), G(null);
|
|
4946
4946
|
break;
|
|
4947
4947
|
}
|
|
4948
4948
|
}
|
|
4949
|
-
|
|
4949
|
+
k.ref !== null && (G(k), y("Invalid attribute `ref` supplied to `React.Fragment`."), G(null));
|
|
4950
4950
|
}
|
|
4951
4951
|
}
|
|
4952
4952
|
var Ue = {};
|
|
4953
|
-
function pt(
|
|
4953
|
+
function pt(k, $, te, pe, je, $e) {
|
|
4954
4954
|
{
|
|
4955
|
-
var Fe =
|
|
4955
|
+
var Fe = T(k);
|
|
4956
4956
|
if (!Fe) {
|
|
4957
4957
|
var Me = "";
|
|
4958
|
-
(
|
|
4958
|
+
(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.");
|
|
4959
4959
|
var yt = Ie();
|
|
4960
4960
|
yt ? Me += yt : Me += we();
|
|
4961
4961
|
var nt;
|
|
4962
|
-
|
|
4962
|
+
k === null ? nt = "null" : Ke(k) ? nt = "array" : k !== void 0 && k.$$typeof === e ? (nt = "<" + (M(k.type) || "Unknown") + " />", Me = " Did you accidentally export a JSX literal instead of a component?") : nt = typeof k, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", nt, Me);
|
|
4963
4963
|
}
|
|
4964
|
-
var st = j(
|
|
4964
|
+
var st = j(k, $, te, je, $e);
|
|
4965
4965
|
if (st == null)
|
|
4966
4966
|
return st;
|
|
4967
4967
|
if (Fe) {
|
|
@@ -4970,15 +4970,15 @@ Check the top-level render call using <` + te + ">.");
|
|
|
4970
4970
|
if (pe)
|
|
4971
4971
|
if (Ke(Rt)) {
|
|
4972
4972
|
for (var Hr = 0; Hr < Rt.length; Hr++)
|
|
4973
|
-
it(Rt[Hr],
|
|
4973
|
+
it(Rt[Hr], k);
|
|
4974
4974
|
Object.freeze && Object.freeze(Rt);
|
|
4975
4975
|
} else
|
|
4976
4976
|
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
4977
4977
|
else
|
|
4978
|
-
it(Rt,
|
|
4978
|
+
it(Rt, k);
|
|
4979
4979
|
}
|
|
4980
4980
|
if (qe.call($, "key")) {
|
|
4981
|
-
var Er =
|
|
4981
|
+
var Er = M(k), Ct = Object.keys($).filter(function(_d) {
|
|
4982
4982
|
return _d !== "key";
|
|
4983
4983
|
}), Bs = Ct.length > 0 ? "{key: someKey, " + Ct.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
4984
4984
|
if (!Ue[Er + Bs]) {
|
|
@@ -4991,14 +4991,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
4991
4991
|
<%s key={someKey} {...props} />`, Bs, Er, bd, Er), Ue[Er + Bs] = !0;
|
|
4992
4992
|
}
|
|
4993
4993
|
}
|
|
4994
|
-
return
|
|
4994
|
+
return k === n ? Qe(st) : lt(st), st;
|
|
4995
4995
|
}
|
|
4996
4996
|
}
|
|
4997
|
-
function gt(
|
|
4998
|
-
return pt(
|
|
4997
|
+
function gt(k, $, te) {
|
|
4998
|
+
return pt(k, $, te, !0);
|
|
4999
4999
|
}
|
|
5000
|
-
function Mt(
|
|
5001
|
-
return pt(
|
|
5000
|
+
function Mt(k, $, te) {
|
|
5001
|
+
return pt(k, $, te, !1);
|
|
5002
5002
|
}
|
|
5003
5003
|
var ir = Mt, Pt = gt;
|
|
5004
5004
|
mn.Fragment = n, mn.jsx = ir, mn.jsxs = Pt;
|
|
@@ -5009,25 +5009,25 @@ var h = Zs.exports;
|
|
|
5009
5009
|
const du = iu(void 0);
|
|
5010
5010
|
function by({ apiUrl: r, systemId: e, children: t }) {
|
|
5011
5011
|
const [n, i] = I(null), [s, o] = I(null), [a, l] = I(!1), [u, c] = I(!0), [d] = I(() => new uu({ apiUrl: r, systemId: e })), f = J(async (E) => {
|
|
5012
|
-
const
|
|
5013
|
-
l(
|
|
5012
|
+
const w = await d.isAdmin(E);
|
|
5013
|
+
l(w);
|
|
5014
5014
|
}, [d]), p = J(() => {
|
|
5015
|
-
const E = Tt.getToken(),
|
|
5016
|
-
E &&
|
|
5015
|
+
const E = Tt.getToken(), w = Tt.getUser();
|
|
5016
|
+
E && w ? (o(E), i(w), f(w._id).finally(() => c(!1))) : c(!1);
|
|
5017
5017
|
}, [f]);
|
|
5018
5018
|
Ee(() => {
|
|
5019
5019
|
p();
|
|
5020
5020
|
}, [p]);
|
|
5021
|
-
const g = J(async (E,
|
|
5022
|
-
const v = await d.login(E,
|
|
5021
|
+
const g = J(async (E, w) => {
|
|
5022
|
+
const v = await d.login(E, w);
|
|
5023
5023
|
return v.success && v.user && v.token && (o(v.token), i(v.user), await f(v.user._id)), v;
|
|
5024
|
-
}, [d, f]), m = J(async (E,
|
|
5025
|
-
const v = await d.verifyEmail(E,
|
|
5024
|
+
}, [d, f]), m = J(async (E, w, v) => d.register(E, w, v), [d]), x = J(async (E, w) => {
|
|
5025
|
+
const v = await d.verifyEmail(E, w);
|
|
5026
5026
|
return v.success && v.user && v.token && (o(v.token), i(v.user), await f(v.user._id)), v;
|
|
5027
|
-
}, [d, f]), b = J(async (E) => d.requestPasswordReset(E), [d]), y = J(async (E,
|
|
5028
|
-
const S = await d.setPasswordWithCode(E,
|
|
5027
|
+
}, [d, f]), b = J(async (E) => d.requestPasswordReset(E), [d]), y = J(async (E, w, v) => {
|
|
5028
|
+
const S = await d.setPasswordWithCode(E, w, v);
|
|
5029
5029
|
return S.success && S.user && S.token && (o(S.token), i(S.user), await f(S.user._id)), S;
|
|
5030
|
-
}, [d, f]), _ = J(async (E) => d.resendVerificationCode(E), [d]),
|
|
5030
|
+
}, [d, f]), _ = J(async (E) => d.resendVerificationCode(E), [d]), D = J(() => {
|
|
5031
5031
|
d.logout(), i(null), o(null), l(!1);
|
|
5032
5032
|
}, [d]);
|
|
5033
5033
|
return /* @__PURE__ */ h.jsx(du.Provider, { value: {
|
|
@@ -5041,7 +5041,7 @@ function by({ apiUrl: r, systemId: e, children: t }) {
|
|
|
5041
5041
|
requestPasswordReset: b,
|
|
5042
5042
|
setPasswordWithCode: y,
|
|
5043
5043
|
resendVerificationCode: _,
|
|
5044
|
-
logout:
|
|
5044
|
+
logout: D,
|
|
5045
5045
|
refreshUser: p
|
|
5046
5046
|
}, children: t });
|
|
5047
5047
|
}
|
|
@@ -5077,10 +5077,10 @@ function fu({
|
|
|
5077
5077
|
isModal: c = !1
|
|
5078
5078
|
}) {
|
|
5079
5079
|
const [d, f] = I(""), [p, g] = I(""), [m, x] = I(""), [b, y] = I(!1), _ = { ...Yd, ...l };
|
|
5080
|
-
async function
|
|
5081
|
-
|
|
5082
|
-
const
|
|
5083
|
-
|
|
5080
|
+
async function D(T) {
|
|
5081
|
+
T.preventDefault(), y(!0), x("");
|
|
5082
|
+
const A = await r(d, p);
|
|
5083
|
+
A.success ? e == null || e() : x(A.error || "Connexion impossible"), y(!1);
|
|
5084
5084
|
}
|
|
5085
5085
|
const E = {
|
|
5086
5086
|
backgroundColor: _.backgroundColor,
|
|
@@ -5091,7 +5091,7 @@ function fu({
|
|
|
5091
5091
|
...c && {
|
|
5092
5092
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
|
|
5093
5093
|
}
|
|
5094
|
-
},
|
|
5094
|
+
}, w = {
|
|
5095
5095
|
width: "100%",
|
|
5096
5096
|
padding: "0.5rem 1rem",
|
|
5097
5097
|
border: `1px solid ${_.borderColor}`,
|
|
@@ -5133,7 +5133,7 @@ function fu({
|
|
|
5133
5133
|
marginBottom: "1rem",
|
|
5134
5134
|
textAlign: t ? "center" : "left"
|
|
5135
5135
|
}, children: n }),
|
|
5136
|
-
/* @__PURE__ */ h.jsxs("form", { onSubmit:
|
|
5136
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: D, children: [
|
|
5137
5137
|
m && /* @__PURE__ */ h.jsx("div", { style: F, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: _.errorColor, margin: 0 }, children: m }) }),
|
|
5138
5138
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1rem" }, children: [
|
|
5139
5139
|
/* @__PURE__ */ h.jsx("label", { style: v, children: o }),
|
|
@@ -5142,14 +5142,14 @@ function fu({
|
|
|
5142
5142
|
{
|
|
5143
5143
|
type: "email",
|
|
5144
5144
|
value: d,
|
|
5145
|
-
onChange: (
|
|
5145
|
+
onChange: (T) => f(T.target.value),
|
|
5146
5146
|
required: !0,
|
|
5147
|
-
style:
|
|
5148
|
-
onFocus: (
|
|
5149
|
-
|
|
5147
|
+
style: w,
|
|
5148
|
+
onFocus: (T) => {
|
|
5149
|
+
T.target.style.borderColor = _.primaryColor, T.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5150
5150
|
},
|
|
5151
|
-
onBlur: (
|
|
5152
|
-
|
|
5151
|
+
onBlur: (T) => {
|
|
5152
|
+
T.target.style.borderColor = _.borderColor, T.target.style.boxShadow = "none";
|
|
5153
5153
|
}
|
|
5154
5154
|
}
|
|
5155
5155
|
)
|
|
@@ -5161,14 +5161,14 @@ function fu({
|
|
|
5161
5161
|
{
|
|
5162
5162
|
type: "password",
|
|
5163
5163
|
value: p,
|
|
5164
|
-
onChange: (
|
|
5164
|
+
onChange: (T) => g(T.target.value),
|
|
5165
5165
|
required: !0,
|
|
5166
|
-
style:
|
|
5167
|
-
onFocus: (
|
|
5168
|
-
|
|
5166
|
+
style: w,
|
|
5167
|
+
onFocus: (T) => {
|
|
5168
|
+
T.target.style.borderColor = _.primaryColor, T.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
|
|
5169
5169
|
},
|
|
5170
|
-
onBlur: (
|
|
5171
|
-
|
|
5170
|
+
onBlur: (T) => {
|
|
5171
|
+
T.target.style.borderColor = _.borderColor, T.target.style.boxShadow = "none";
|
|
5172
5172
|
}
|
|
5173
5173
|
}
|
|
5174
5174
|
)
|
|
@@ -5179,11 +5179,11 @@ function fu({
|
|
|
5179
5179
|
type: "submit",
|
|
5180
5180
|
disabled: b,
|
|
5181
5181
|
style: S,
|
|
5182
|
-
onMouseEnter: (
|
|
5183
|
-
b || (
|
|
5182
|
+
onMouseEnter: (T) => {
|
|
5183
|
+
b || (T.target.style.backgroundColor = _.primaryHoverColor);
|
|
5184
5184
|
},
|
|
5185
|
-
onMouseLeave: (
|
|
5186
|
-
b || (
|
|
5185
|
+
onMouseLeave: (T) => {
|
|
5186
|
+
b || (T.target.style.backgroundColor = _.primaryColor);
|
|
5187
5187
|
},
|
|
5188
5188
|
children: b ? s : i
|
|
5189
5189
|
}
|
|
@@ -5291,8 +5291,8 @@ function Xd({
|
|
|
5291
5291
|
className: m = "",
|
|
5292
5292
|
isModal: x = !1
|
|
5293
5293
|
}) {
|
|
5294
|
-
const [b, y] = I(""), [_,
|
|
5295
|
-
async function
|
|
5294
|
+
const [b, y] = I(""), [_, D] = I(""), [E, w] = I(""), [v, S] = I(""), [F, T] = I(""), [A, B] = I(""), [M, C] = I(!1), N = { ...Qd, ...g };
|
|
5295
|
+
async function R(W) {
|
|
5296
5296
|
if (W.preventDefault(), B(""), _ !== E) {
|
|
5297
5297
|
B("Les mots de passe ne correspondent pas");
|
|
5298
5298
|
return;
|
|
@@ -5301,9 +5301,9 @@ function Xd({
|
|
|
5301
5301
|
B("Le mot de passe doit contenir au moins 8 caractères");
|
|
5302
5302
|
return;
|
|
5303
5303
|
}
|
|
5304
|
-
|
|
5304
|
+
C(!0);
|
|
5305
5305
|
const ce = await r(b, _, p ? { firstName: v, lastName: F } : void 0);
|
|
5306
|
-
ce.success ? e == null || e(b) : B(ce.error || "Erreur lors de l'inscription"),
|
|
5306
|
+
ce.success ? e == null || e(b) : B(ce.error || "Erreur lors de l'inscription"), C(!1);
|
|
5307
5307
|
}
|
|
5308
5308
|
const O = {
|
|
5309
5309
|
backgroundColor: N.backgroundColor,
|
|
@@ -5333,13 +5333,13 @@ function Xd({
|
|
|
5333
5333
|
}, re = {
|
|
5334
5334
|
width: "100%",
|
|
5335
5335
|
padding: "0.75rem",
|
|
5336
|
-
backgroundColor:
|
|
5336
|
+
backgroundColor: M ? N.textMutedColor : N.primaryColor,
|
|
5337
5337
|
color: "#ffffff",
|
|
5338
5338
|
border: "none",
|
|
5339
5339
|
borderRadius: N.borderRadius,
|
|
5340
5340
|
fontSize: "1rem",
|
|
5341
5341
|
fontWeight: 500,
|
|
5342
|
-
cursor:
|
|
5342
|
+
cursor: M ? "not-allowed" : "pointer",
|
|
5343
5343
|
transition: "background-color 0.2s"
|
|
5344
5344
|
}, q = {
|
|
5345
5345
|
padding: "0.75rem",
|
|
@@ -5362,8 +5362,8 @@ function Xd({
|
|
|
5362
5362
|
marginBottom: "1rem",
|
|
5363
5363
|
textAlign: n ? "center" : "left"
|
|
5364
5364
|
}, children: i }),
|
|
5365
|
-
/* @__PURE__ */ h.jsxs("form", { onSubmit:
|
|
5366
|
-
|
|
5365
|
+
/* @__PURE__ */ h.jsxs("form", { onSubmit: R, children: [
|
|
5366
|
+
A && /* @__PURE__ */ h.jsx("div", { style: q, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: N.errorColor, margin: 0 }, children: A }) }),
|
|
5367
5367
|
p && /* @__PURE__ */ h.jsxs("div", { style: { display: "flex", gap: "0.75rem", marginBottom: "1rem" }, children: [
|
|
5368
5368
|
/* @__PURE__ */ h.jsxs("div", { style: { flex: 1 }, children: [
|
|
5369
5369
|
/* @__PURE__ */ h.jsx("label", { style: U, children: c }),
|
|
@@ -5384,7 +5384,7 @@ function Xd({
|
|
|
5384
5384
|
{
|
|
5385
5385
|
type: "text",
|
|
5386
5386
|
value: F,
|
|
5387
|
-
onChange: (W) =>
|
|
5387
|
+
onChange: (W) => T(W.target.value),
|
|
5388
5388
|
style: V
|
|
5389
5389
|
}
|
|
5390
5390
|
)
|
|
@@ -5410,7 +5410,7 @@ function Xd({
|
|
|
5410
5410
|
{
|
|
5411
5411
|
type: "password",
|
|
5412
5412
|
value: _,
|
|
5413
|
-
onChange: (W) =>
|
|
5413
|
+
onChange: (W) => D(W.target.value),
|
|
5414
5414
|
required: !0,
|
|
5415
5415
|
minLength: 8,
|
|
5416
5416
|
style: V
|
|
@@ -5424,7 +5424,7 @@ function Xd({
|
|
|
5424
5424
|
{
|
|
5425
5425
|
type: "password",
|
|
5426
5426
|
value: E,
|
|
5427
|
-
onChange: (W) =>
|
|
5427
|
+
onChange: (W) => w(W.target.value),
|
|
5428
5428
|
required: !0,
|
|
5429
5429
|
style: V
|
|
5430
5430
|
}
|
|
@@ -5434,15 +5434,15 @@ function Xd({
|
|
|
5434
5434
|
"button",
|
|
5435
5435
|
{
|
|
5436
5436
|
type: "submit",
|
|
5437
|
-
disabled:
|
|
5437
|
+
disabled: M,
|
|
5438
5438
|
style: re,
|
|
5439
5439
|
onMouseEnter: (W) => {
|
|
5440
|
-
|
|
5440
|
+
M || (W.target.style.backgroundColor = N.primaryHoverColor);
|
|
5441
5441
|
},
|
|
5442
5442
|
onMouseLeave: (W) => {
|
|
5443
|
-
|
|
5443
|
+
M || (W.target.style.backgroundColor = N.primaryColor);
|
|
5444
5444
|
},
|
|
5445
|
-
children:
|
|
5445
|
+
children: M ? o : s
|
|
5446
5446
|
}
|
|
5447
5447
|
),
|
|
5448
5448
|
t && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("span", { style: Z, onClick: t, children: f }) })
|
|
@@ -5480,22 +5480,22 @@ function Sl({
|
|
|
5480
5480
|
className: g = "",
|
|
5481
5481
|
isModal: m = !1
|
|
5482
5482
|
}) {
|
|
5483
|
-
const [x, b] = I(Array(f).fill("")), [y, _] = I(""), [
|
|
5483
|
+
const [x, b] = I(Array(f).fill("")), [y, _] = I(""), [D, E] = I(!1), [w, v] = I(!1), [S, F] = I(!1), T = be([]), A = { ...Jd, ...p };
|
|
5484
5484
|
Ee(() => {
|
|
5485
5485
|
var q;
|
|
5486
|
-
(q =
|
|
5486
|
+
(q = T.current[0]) == null || q.focus();
|
|
5487
5487
|
}, []);
|
|
5488
5488
|
const B = (q, Z) => {
|
|
5489
5489
|
var ce;
|
|
5490
5490
|
const W = Z.replace(/\D/g, "").slice(-1), se = [...x];
|
|
5491
|
-
if (se[q] = W, b(se), _(""), W && q < f - 1 && ((ce =
|
|
5491
|
+
if (se[q] = W, b(se), _(""), W && q < f - 1 && ((ce = T.current[q + 1]) == null || ce.focus()), W && q === f - 1) {
|
|
5492
5492
|
const fe = se.join("");
|
|
5493
5493
|
fe.length === f && N(fe);
|
|
5494
5494
|
}
|
|
5495
|
-
},
|
|
5495
|
+
}, M = (q, Z) => {
|
|
5496
5496
|
var W;
|
|
5497
|
-
Z.key === "Backspace" && !x[q] && q > 0 && ((W =
|
|
5498
|
-
},
|
|
5497
|
+
Z.key === "Backspace" && !x[q] && q > 0 && ((W = T.current[q - 1]) == null || W.focus());
|
|
5498
|
+
}, C = (q) => {
|
|
5499
5499
|
var ce;
|
|
5500
5500
|
q.preventDefault();
|
|
5501
5501
|
const Z = q.clipboardData.getData("text").replace(/\D/g, "").slice(0, f), W = [...x];
|
|
@@ -5503,7 +5503,7 @@ function Sl({
|
|
|
5503
5503
|
ge < f && (W[ge] = fe);
|
|
5504
5504
|
}), b(W);
|
|
5505
5505
|
const se = Math.min(Z.length, f) - 1;
|
|
5506
|
-
se >= 0 && ((ce =
|
|
5506
|
+
se >= 0 && ((ce = T.current[se]) == null || ce.focus()), Z.length === f && N(Z);
|
|
5507
5507
|
};
|
|
5508
5508
|
async function N(q) {
|
|
5509
5509
|
var se;
|
|
@@ -5514,17 +5514,17 @@ function Sl({
|
|
|
5514
5514
|
}
|
|
5515
5515
|
E(!0), _("");
|
|
5516
5516
|
const W = await e(r, Z);
|
|
5517
|
-
W.success ? t == null || t() : (_(W.error || "Code invalide"), b(Array(f).fill("")), (se =
|
|
5517
|
+
W.success ? t == null || t() : (_(W.error || "Code invalide"), b(Array(f).fill("")), (se = T.current[0]) == null || se.focus()), E(!1);
|
|
5518
5518
|
}
|
|
5519
|
-
async function
|
|
5519
|
+
async function R() {
|
|
5520
5520
|
if (!n) return;
|
|
5521
5521
|
v(!0), F(!1), _("");
|
|
5522
5522
|
const q = await n(r);
|
|
5523
5523
|
q.success ? (F(!0), setTimeout(() => F(!1), 3e3)) : _(q.error || "Erreur lors de l'envoi"), v(!1);
|
|
5524
5524
|
}
|
|
5525
5525
|
const O = {
|
|
5526
|
-
backgroundColor:
|
|
5527
|
-
borderRadius:
|
|
5526
|
+
backgroundColor: A.backgroundColor,
|
|
5527
|
+
borderRadius: A.borderRadius,
|
|
5528
5528
|
padding: "1.5rem",
|
|
5529
5529
|
width: "100%",
|
|
5530
5530
|
maxWidth: "24rem",
|
|
@@ -5537,25 +5537,25 @@ function Sl({
|
|
|
5537
5537
|
textAlign: "center",
|
|
5538
5538
|
fontSize: "1.5rem",
|
|
5539
5539
|
fontWeight: 600,
|
|
5540
|
-
border: `2px solid ${
|
|
5541
|
-
borderRadius:
|
|
5542
|
-
backgroundColor:
|
|
5543
|
-
color:
|
|
5540
|
+
border: `2px solid ${A.borderColor}`,
|
|
5541
|
+
borderRadius: A.borderRadius,
|
|
5542
|
+
backgroundColor: A.inputBackground,
|
|
5543
|
+
color: A.textColor,
|
|
5544
5544
|
outline: "none",
|
|
5545
5545
|
transition: "border-color 0.2s, box-shadow 0.2s"
|
|
5546
5546
|
}, U = {
|
|
5547
5547
|
width: "100%",
|
|
5548
5548
|
padding: "0.75rem",
|
|
5549
|
-
backgroundColor:
|
|
5549
|
+
backgroundColor: D ? A.textMutedColor : A.primaryColor,
|
|
5550
5550
|
color: "#ffffff",
|
|
5551
5551
|
border: "none",
|
|
5552
|
-
borderRadius:
|
|
5552
|
+
borderRadius: A.borderRadius,
|
|
5553
5553
|
fontSize: "1rem",
|
|
5554
5554
|
fontWeight: 500,
|
|
5555
|
-
cursor:
|
|
5555
|
+
cursor: D ? "not-allowed" : "pointer",
|
|
5556
5556
|
transition: "background-color 0.2s"
|
|
5557
5557
|
}, re = {
|
|
5558
|
-
color:
|
|
5558
|
+
color: A.primaryColor,
|
|
5559
5559
|
textDecoration: "none",
|
|
5560
5560
|
fontSize: "0.875rem",
|
|
5561
5561
|
cursor: "pointer",
|
|
@@ -5567,30 +5567,30 @@ function Sl({
|
|
|
5567
5567
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5568
5568
|
fontSize: "1.25rem",
|
|
5569
5569
|
fontWeight: 700,
|
|
5570
|
-
color:
|
|
5570
|
+
color: A.textColor,
|
|
5571
5571
|
marginBottom: "0.5rem",
|
|
5572
5572
|
textAlign: "center"
|
|
5573
5573
|
}, children: s }),
|
|
5574
5574
|
/* @__PURE__ */ h.jsx("p", { style: {
|
|
5575
5575
|
fontSize: "0.875rem",
|
|
5576
|
-
color:
|
|
5576
|
+
color: A.textMutedColor,
|
|
5577
5577
|
textAlign: "center",
|
|
5578
5578
|
marginBottom: "1.5rem"
|
|
5579
5579
|
}, children: o || `Un code a été envoyé à ${r}` }),
|
|
5580
5580
|
y && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5581
5581
|
padding: "0.75rem",
|
|
5582
|
-
backgroundColor:
|
|
5583
|
-
border: `1px solid ${
|
|
5584
|
-
borderRadius:
|
|
5582
|
+
backgroundColor: A.errorBackgroundColor,
|
|
5583
|
+
border: `1px solid ${A.errorColor}20`,
|
|
5584
|
+
borderRadius: A.borderRadius,
|
|
5585
5585
|
marginBottom: "1rem"
|
|
5586
|
-
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5586
|
+
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: A.errorColor, margin: 0, textAlign: "center" }, children: y }) }),
|
|
5587
5587
|
S && /* @__PURE__ */ h.jsx("div", { style: {
|
|
5588
5588
|
padding: "0.75rem",
|
|
5589
5589
|
backgroundColor: "#ECFDF5",
|
|
5590
|
-
border: `1px solid ${
|
|
5591
|
-
borderRadius:
|
|
5590
|
+
border: `1px solid ${A.successColor}20`,
|
|
5591
|
+
borderRadius: A.borderRadius,
|
|
5592
5592
|
marginBottom: "1rem"
|
|
5593
|
-
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color:
|
|
5593
|
+
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: A.successColor, margin: 0, textAlign: "center" }, children: "Code renvoyé !" }) }),
|
|
5594
5594
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
5595
5595
|
display: "flex",
|
|
5596
5596
|
justifyContent: "center",
|
|
@@ -5600,25 +5600,25 @@ function Sl({
|
|
|
5600
5600
|
"input",
|
|
5601
5601
|
{
|
|
5602
5602
|
ref: (W) => {
|
|
5603
|
-
|
|
5603
|
+
T.current[Z] = W;
|
|
5604
5604
|
},
|
|
5605
5605
|
type: "text",
|
|
5606
5606
|
inputMode: "numeric",
|
|
5607
5607
|
maxLength: 1,
|
|
5608
5608
|
value: q,
|
|
5609
5609
|
onChange: (W) => B(Z, W.target.value),
|
|
5610
|
-
onKeyDown: (W) =>
|
|
5611
|
-
onPaste:
|
|
5612
|
-
disabled:
|
|
5610
|
+
onKeyDown: (W) => M(Z, W),
|
|
5611
|
+
onPaste: C,
|
|
5612
|
+
disabled: D,
|
|
5613
5613
|
style: {
|
|
5614
5614
|
...V,
|
|
5615
|
-
borderColor: q ?
|
|
5615
|
+
borderColor: q ? A.primaryColor : A.borderColor
|
|
5616
5616
|
},
|
|
5617
5617
|
onFocus: (W) => {
|
|
5618
|
-
W.target.style.borderColor =
|
|
5618
|
+
W.target.style.borderColor = A.primaryColor, W.target.style.boxShadow = `0 0 0 3px ${A.primaryColor}20`;
|
|
5619
5619
|
},
|
|
5620
5620
|
onBlur: (W) => {
|
|
5621
|
-
W.target.style.borderColor = q ?
|
|
5621
|
+
W.target.style.borderColor = q ? A.primaryColor : A.borderColor, W.target.style.boxShadow = "none";
|
|
5622
5622
|
}
|
|
5623
5623
|
},
|
|
5624
5624
|
Z
|
|
@@ -5628,25 +5628,25 @@ function Sl({
|
|
|
5628
5628
|
{
|
|
5629
5629
|
type: "button",
|
|
5630
5630
|
onClick: () => N(),
|
|
5631
|
-
disabled:
|
|
5631
|
+
disabled: D || x.join("").length !== f,
|
|
5632
5632
|
style: {
|
|
5633
5633
|
...U,
|
|
5634
5634
|
opacity: x.join("").length !== f ? 0.5 : 1
|
|
5635
5635
|
},
|
|
5636
|
-
children:
|
|
5636
|
+
children: D ? l : a
|
|
5637
5637
|
}
|
|
5638
5638
|
),
|
|
5639
5639
|
n && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx(
|
|
5640
5640
|
"button",
|
|
5641
5641
|
{
|
|
5642
5642
|
type: "button",
|
|
5643
|
-
onClick:
|
|
5644
|
-
disabled:
|
|
5643
|
+
onClick: R,
|
|
5644
|
+
disabled: w,
|
|
5645
5645
|
style: {
|
|
5646
5646
|
...re,
|
|
5647
|
-
opacity:
|
|
5647
|
+
opacity: w ? 0.5 : 1
|
|
5648
5648
|
},
|
|
5649
|
-
children:
|
|
5649
|
+
children: w ? c : u
|
|
5650
5650
|
}
|
|
5651
5651
|
) }),
|
|
5652
5652
|
i && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "0.75rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: i, style: re, children: d }) })
|
|
@@ -5683,10 +5683,10 @@ function ef({
|
|
|
5683
5683
|
const [f, p] = I(""), [g, m] = I(""), [x, b] = I(!1), y = { ...Zd, ...u };
|
|
5684
5684
|
async function _(F) {
|
|
5685
5685
|
F.preventDefault(), b(!0), m("");
|
|
5686
|
-
const
|
|
5687
|
-
|
|
5686
|
+
const T = await r(f);
|
|
5687
|
+
T.success ? e == null || e(f) : m(T.error || "Erreur lors de l'envoi"), b(!1);
|
|
5688
5688
|
}
|
|
5689
|
-
const
|
|
5689
|
+
const D = {
|
|
5690
5690
|
backgroundColor: y.backgroundColor,
|
|
5691
5691
|
borderRadius: y.borderRadius,
|
|
5692
5692
|
padding: "1.5rem",
|
|
@@ -5705,7 +5705,7 @@ function ef({
|
|
|
5705
5705
|
fontSize: "1rem",
|
|
5706
5706
|
outline: "none",
|
|
5707
5707
|
boxSizing: "border-box"
|
|
5708
|
-
},
|
|
5708
|
+
}, w = {
|
|
5709
5709
|
display: "block",
|
|
5710
5710
|
fontSize: "0.875rem",
|
|
5711
5711
|
fontWeight: 500,
|
|
@@ -5731,7 +5731,7 @@ function ef({
|
|
|
5731
5731
|
border: "none",
|
|
5732
5732
|
padding: 0
|
|
5733
5733
|
};
|
|
5734
|
-
return /* @__PURE__ */ h.jsxs("div", { style:
|
|
5734
|
+
return /* @__PURE__ */ h.jsxs("div", { style: D, className: c, children: [
|
|
5735
5735
|
/* @__PURE__ */ h.jsx("h2", { style: {
|
|
5736
5736
|
fontSize: "1.25rem",
|
|
5737
5737
|
fontWeight: 700,
|
|
@@ -5754,7 +5754,7 @@ function ef({
|
|
|
5754
5754
|
marginBottom: "1rem"
|
|
5755
5755
|
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: y.errorColor, margin: 0 }, children: g }) }),
|
|
5756
5756
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
5757
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5757
|
+
/* @__PURE__ */ h.jsx("label", { style: w, children: a }),
|
|
5758
5758
|
/* @__PURE__ */ h.jsx(
|
|
5759
5759
|
"input",
|
|
5760
5760
|
{
|
|
@@ -5814,19 +5814,19 @@ function rf({
|
|
|
5814
5814
|
className: p = "",
|
|
5815
5815
|
isModal: g = !1
|
|
5816
5816
|
}) {
|
|
5817
|
-
const [m, x] = I(""), [b, y] = I(""), [_,
|
|
5818
|
-
async function S(
|
|
5819
|
-
if (
|
|
5820
|
-
|
|
5817
|
+
const [m, x] = I(""), [b, y] = I(""), [_, D] = I(""), [E, w] = I(!1), v = { ...tf, ...f };
|
|
5818
|
+
async function S(C) {
|
|
5819
|
+
if (C.preventDefault(), D(""), m !== b) {
|
|
5820
|
+
D("Les mots de passe ne correspondent pas");
|
|
5821
5821
|
return;
|
|
5822
5822
|
}
|
|
5823
5823
|
if (m.length < 8) {
|
|
5824
|
-
|
|
5824
|
+
D("Le mot de passe doit contenir au moins 8 caractères");
|
|
5825
5825
|
return;
|
|
5826
5826
|
}
|
|
5827
|
-
|
|
5827
|
+
w(!0);
|
|
5828
5828
|
const N = await t(r, e, m);
|
|
5829
|
-
N.success ? n == null || n() :
|
|
5829
|
+
N.success ? n == null || n() : D(N.error || "Erreur lors de la réinitialisation"), w(!1);
|
|
5830
5830
|
}
|
|
5831
5831
|
const F = {
|
|
5832
5832
|
backgroundColor: v.backgroundColor,
|
|
@@ -5837,7 +5837,7 @@ function rf({
|
|
|
5837
5837
|
...g && {
|
|
5838
5838
|
boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)"
|
|
5839
5839
|
}
|
|
5840
|
-
},
|
|
5840
|
+
}, T = {
|
|
5841
5841
|
width: "100%",
|
|
5842
5842
|
padding: "0.5rem 1rem",
|
|
5843
5843
|
border: `1px solid ${v.borderColor}`,
|
|
@@ -5847,7 +5847,7 @@ function rf({
|
|
|
5847
5847
|
fontSize: "1rem",
|
|
5848
5848
|
outline: "none",
|
|
5849
5849
|
boxSizing: "border-box"
|
|
5850
|
-
},
|
|
5850
|
+
}, A = {
|
|
5851
5851
|
display: "block",
|
|
5852
5852
|
fontSize: "0.875rem",
|
|
5853
5853
|
fontWeight: 500,
|
|
@@ -5864,7 +5864,7 @@ function rf({
|
|
|
5864
5864
|
fontWeight: 500,
|
|
5865
5865
|
cursor: E ? "not-allowed" : "pointer",
|
|
5866
5866
|
transition: "background-color 0.2s"
|
|
5867
|
-
},
|
|
5867
|
+
}, M = {
|
|
5868
5868
|
color: v.primaryColor,
|
|
5869
5869
|
textDecoration: "none",
|
|
5870
5870
|
fontSize: "0.875rem",
|
|
@@ -5896,29 +5896,29 @@ function rf({
|
|
|
5896
5896
|
marginBottom: "1rem"
|
|
5897
5897
|
}, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: v.errorColor, margin: 0 }, children: _ }) }),
|
|
5898
5898
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1rem" }, children: [
|
|
5899
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5899
|
+
/* @__PURE__ */ h.jsx("label", { style: A, children: u }),
|
|
5900
5900
|
/* @__PURE__ */ h.jsx(
|
|
5901
5901
|
"input",
|
|
5902
5902
|
{
|
|
5903
5903
|
type: "password",
|
|
5904
5904
|
value: m,
|
|
5905
|
-
onChange: (
|
|
5905
|
+
onChange: (C) => x(C.target.value),
|
|
5906
5906
|
required: !0,
|
|
5907
5907
|
minLength: 8,
|
|
5908
|
-
style:
|
|
5908
|
+
style: T
|
|
5909
5909
|
}
|
|
5910
5910
|
)
|
|
5911
5911
|
] }),
|
|
5912
5912
|
/* @__PURE__ */ h.jsxs("div", { style: { marginBottom: "1.5rem" }, children: [
|
|
5913
|
-
/* @__PURE__ */ h.jsx("label", { style:
|
|
5913
|
+
/* @__PURE__ */ h.jsx("label", { style: A, children: c }),
|
|
5914
5914
|
/* @__PURE__ */ h.jsx(
|
|
5915
5915
|
"input",
|
|
5916
5916
|
{
|
|
5917
5917
|
type: "password",
|
|
5918
5918
|
value: b,
|
|
5919
|
-
onChange: (
|
|
5919
|
+
onChange: (C) => y(C.target.value),
|
|
5920
5920
|
required: !0,
|
|
5921
|
-
style:
|
|
5921
|
+
style: T
|
|
5922
5922
|
}
|
|
5923
5923
|
)
|
|
5924
5924
|
] }),
|
|
@@ -5928,16 +5928,16 @@ function rf({
|
|
|
5928
5928
|
type: "submit",
|
|
5929
5929
|
disabled: E,
|
|
5930
5930
|
style: B,
|
|
5931
|
-
onMouseEnter: (
|
|
5932
|
-
E || (
|
|
5931
|
+
onMouseEnter: (C) => {
|
|
5932
|
+
E || (C.target.style.backgroundColor = v.primaryHoverColor);
|
|
5933
5933
|
},
|
|
5934
|
-
onMouseLeave: (
|
|
5935
|
-
E || (
|
|
5934
|
+
onMouseLeave: (C) => {
|
|
5935
|
+
E || (C.target.style.backgroundColor = v.primaryColor);
|
|
5936
5936
|
},
|
|
5937
5937
|
children: E ? l : a
|
|
5938
5938
|
}
|
|
5939
5939
|
),
|
|
5940
|
-
i && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: i, style:
|
|
5940
|
+
i && /* @__PURE__ */ h.jsx("p", { style: { textAlign: "center", marginTop: "1rem", marginBottom: 0 }, children: /* @__PURE__ */ h.jsx("button", { type: "button", onClick: i, style: M, children: d }) })
|
|
5941
5941
|
] })
|
|
5942
5942
|
] });
|
|
5943
5943
|
}
|
|
@@ -5958,20 +5958,20 @@ function nf({
|
|
|
5958
5958
|
labels: p = {}
|
|
5959
5959
|
}) {
|
|
5960
5960
|
const [g, m] = I(a), [x, b] = I(""), [y, _] = I("");
|
|
5961
|
-
async function
|
|
5962
|
-
const B = await r(
|
|
5963
|
-
return B.requiresVerification ? (b(
|
|
5961
|
+
async function D(T, A) {
|
|
5962
|
+
const B = await r(T, A);
|
|
5963
|
+
return B.requiresVerification ? (b(T), m("verify-email"), { success: !1, error: "Veuillez vérifier votre email" }) : B;
|
|
5964
5964
|
}
|
|
5965
|
-
async function E(
|
|
5966
|
-
const
|
|
5967
|
-
return
|
|
5965
|
+
async function E(T, A, B) {
|
|
5966
|
+
const M = await e(T, A, B);
|
|
5967
|
+
return M.success && M.requiresVerification && (b(T), m("verify-email")), M;
|
|
5968
5968
|
}
|
|
5969
|
-
async function
|
|
5970
|
-
const
|
|
5971
|
-
return
|
|
5969
|
+
async function w(T) {
|
|
5970
|
+
const A = await n(T);
|
|
5971
|
+
return A.success && (b(T), m("verify-reset-code")), A;
|
|
5972
5972
|
}
|
|
5973
|
-
async function v(
|
|
5974
|
-
return _(
|
|
5973
|
+
async function v(T, A) {
|
|
5974
|
+
return _(A), m("reset-password"), { success: !0 };
|
|
5975
5975
|
}
|
|
5976
5976
|
const S = () => {
|
|
5977
5977
|
switch (g) {
|
|
@@ -5979,7 +5979,7 @@ function nf({
|
|
|
5979
5979
|
return /* @__PURE__ */ h.jsx(
|
|
5980
5980
|
fu,
|
|
5981
5981
|
{
|
|
5982
|
-
onLogin:
|
|
5982
|
+
onLogin: D,
|
|
5983
5983
|
onSuccess: o,
|
|
5984
5984
|
logo: l,
|
|
5985
5985
|
theme: u,
|
|
@@ -6023,7 +6023,7 @@ function nf({
|
|
|
6023
6023
|
return /* @__PURE__ */ h.jsx(
|
|
6024
6024
|
ef,
|
|
6025
6025
|
{
|
|
6026
|
-
onRequestReset:
|
|
6026
|
+
onRequestReset: w,
|
|
6027
6027
|
onBackClick: () => m("login"),
|
|
6028
6028
|
title: p.forgotPasswordTitle,
|
|
6029
6029
|
theme: u,
|
|
@@ -6062,7 +6062,7 @@ function nf({
|
|
|
6062
6062
|
);
|
|
6063
6063
|
}
|
|
6064
6064
|
}, F = () => {
|
|
6065
|
-
const
|
|
6065
|
+
const T = {
|
|
6066
6066
|
color: (u == null ? void 0 : u.primaryColor) || "#1877F2",
|
|
6067
6067
|
textDecoration: "none",
|
|
6068
6068
|
fontSize: "0.875rem",
|
|
@@ -6079,8 +6079,8 @@ function nf({
|
|
|
6079
6079
|
maxWidth: "24rem",
|
|
6080
6080
|
width: "100%"
|
|
6081
6081
|
}, children: [
|
|
6082
|
-
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("forgot-password"), style:
|
|
6083
|
-
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("register"), style:
|
|
6082
|
+
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("forgot-password"), style: T, children: "Mot de passe oublié ?" }),
|
|
6083
|
+
/* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("register"), style: T, children: "Créer un compte" })
|
|
6084
6084
|
] }) : null;
|
|
6085
6085
|
};
|
|
6086
6086
|
return /* @__PURE__ */ h.jsxs("div", { style: {
|
|
@@ -6332,36 +6332,36 @@ function Dy({
|
|
|
6332
6332
|
onRefresh: p,
|
|
6333
6333
|
theme: g = {}
|
|
6334
6334
|
}) {
|
|
6335
|
-
const { data: m, loading: x, error: b, refetch: y } = sf(r, e), [_,
|
|
6335
|
+
const { data: m, loading: x, error: b, refetch: y } = sf(r, e), [_, D] = I(""), [E, w] = I({}), [v, S] = I(1), F = ct(() => {
|
|
6336
6336
|
if (!m) return { data: [], total: 0, totalPages: 0 };
|
|
6337
|
-
let
|
|
6338
|
-
return a && _ && l.length > 0 && (
|
|
6337
|
+
let C = m;
|
|
6338
|
+
return a && _ && l.length > 0 && (C = Ps.search(C, _, l)), Object.keys(E).length > 0 && (C = Ps.filterByFields(C, E)), Ps.paginate(C, v, d);
|
|
6339
6339
|
}, [m, _, E, v, d, a, l]);
|
|
6340
6340
|
Ee(() => {
|
|
6341
6341
|
S(1);
|
|
6342
6342
|
}, [_, E]);
|
|
6343
|
-
const
|
|
6344
|
-
|
|
6345
|
-
},
|
|
6343
|
+
const T = () => {
|
|
6344
|
+
D(""), w({}), S(1), y(), p == null || p();
|
|
6345
|
+
}, A = {
|
|
6346
6346
|
background: g.background || "#ffffff",
|
|
6347
6347
|
cardBackground: g.cardBackground || "#f9fafb",
|
|
6348
6348
|
text: g.text || "#111827",
|
|
6349
6349
|
textSecondary: g.textSecondary || "#6b7280",
|
|
6350
6350
|
border: g.border || "#e5e7eb",
|
|
6351
6351
|
primary: g.primary || "#3b82f6"
|
|
6352
|
-
},
|
|
6352
|
+
}, M = s || ((C) => /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6353
6353
|
padding: "16px",
|
|
6354
6354
|
cursor: f ? "pointer" : "default"
|
|
6355
6355
|
}, children: [
|
|
6356
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color:
|
|
6357
|
-
|
|
6356
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: A.text }, children: C.title || C.name || C.label || "Untitled" }),
|
|
6357
|
+
C.description && /* @__PURE__ */ h.jsx("div", { style: { fontSize: "13px", color: A.textSecondary, marginTop: "4px" }, children: C.description })
|
|
6358
6358
|
] }));
|
|
6359
6359
|
return x && !m ? /* @__PURE__ */ h.jsx("div", { style: {
|
|
6360
6360
|
display: "flex",
|
|
6361
6361
|
alignItems: "center",
|
|
6362
6362
|
justifyContent: "center",
|
|
6363
6363
|
padding: "48px",
|
|
6364
|
-
color:
|
|
6364
|
+
color: A.textSecondary
|
|
6365
6365
|
}, children: "Loading..." }) : b ? /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6366
6366
|
padding: "24px",
|
|
6367
6367
|
textAlign: "center",
|
|
@@ -6372,11 +6372,11 @@ function Dy({
|
|
|
6372
6372
|
/* @__PURE__ */ h.jsx(
|
|
6373
6373
|
"button",
|
|
6374
6374
|
{
|
|
6375
|
-
onClick:
|
|
6375
|
+
onClick: T,
|
|
6376
6376
|
style: {
|
|
6377
6377
|
marginTop: "16px",
|
|
6378
6378
|
padding: "8px 16px",
|
|
6379
|
-
background:
|
|
6379
|
+
background: A.primary,
|
|
6380
6380
|
color: "white",
|
|
6381
6381
|
border: "none",
|
|
6382
6382
|
borderRadius: "6px",
|
|
@@ -6386,13 +6386,13 @@ function Dy({
|
|
|
6386
6386
|
}
|
|
6387
6387
|
)
|
|
6388
6388
|
] }) : /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6389
|
-
background:
|
|
6389
|
+
background: A.background,
|
|
6390
6390
|
borderRadius: "12px",
|
|
6391
6391
|
overflow: "hidden"
|
|
6392
6392
|
}, children: [
|
|
6393
6393
|
(n || a || c.length > 0) && /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6394
6394
|
padding: "16px",
|
|
6395
|
-
borderBottom: `1px solid ${
|
|
6395
|
+
borderBottom: `1px solid ${A.border}`
|
|
6396
6396
|
}, children: [
|
|
6397
6397
|
/* @__PURE__ */ h.jsxs("div", { style: {
|
|
6398
6398
|
display: "flex",
|
|
@@ -6404,18 +6404,18 @@ function Dy({
|
|
|
6404
6404
|
margin: 0,
|
|
6405
6405
|
fontSize: "18px",
|
|
6406
6406
|
fontWeight: 600,
|
|
6407
|
-
color:
|
|
6407
|
+
color: A.text
|
|
6408
6408
|
}, children: n }),
|
|
6409
6409
|
/* @__PURE__ */ h.jsx(
|
|
6410
6410
|
"button",
|
|
6411
6411
|
{
|
|
6412
|
-
onClick:
|
|
6412
|
+
onClick: T,
|
|
6413
6413
|
style: {
|
|
6414
6414
|
padding: "6px 12px",
|
|
6415
6415
|
background: "transparent",
|
|
6416
|
-
border: `1px solid ${
|
|
6416
|
+
border: `1px solid ${A.border}`,
|
|
6417
6417
|
borderRadius: "6px",
|
|
6418
|
-
color:
|
|
6418
|
+
color: A.textSecondary,
|
|
6419
6419
|
cursor: "pointer",
|
|
6420
6420
|
fontSize: "13px"
|
|
6421
6421
|
},
|
|
@@ -6429,11 +6429,11 @@ function Dy({
|
|
|
6429
6429
|
type: "text",
|
|
6430
6430
|
placeholder: u,
|
|
6431
6431
|
value: _,
|
|
6432
|
-
onChange: (
|
|
6432
|
+
onChange: (C) => D(C.target.value),
|
|
6433
6433
|
style: {
|
|
6434
6434
|
width: "100%",
|
|
6435
6435
|
padding: "8px 12px",
|
|
6436
|
-
border: `1px solid ${
|
|
6436
|
+
border: `1px solid ${A.border}`,
|
|
6437
6437
|
borderRadius: "8px",
|
|
6438
6438
|
fontSize: "14px",
|
|
6439
6439
|
outline: "none"
|
|
@@ -6450,35 +6450,35 @@ function Dy({
|
|
|
6450
6450
|
}, children: F.data.length === 0 ? /* @__PURE__ */ h.jsx("div", { style: {
|
|
6451
6451
|
padding: "48px",
|
|
6452
6452
|
textAlign: "center",
|
|
6453
|
-
color:
|
|
6454
|
-
}, children: i }) : F.data.map((
|
|
6453
|
+
color: A.textSecondary
|
|
6454
|
+
}, children: i }) : F.data.map((C, N) => /* @__PURE__ */ h.jsx(
|
|
6455
6455
|
"div",
|
|
6456
6456
|
{
|
|
6457
|
-
onClick: () => f == null ? void 0 : f(
|
|
6457
|
+
onClick: () => f == null ? void 0 : f(C),
|
|
6458
6458
|
style: {
|
|
6459
|
-
background:
|
|
6459
|
+
background: A.cardBackground,
|
|
6460
6460
|
borderRadius: t === "list" ? "0" : "8px",
|
|
6461
|
-
borderBottom: t === "list" ? `1px solid ${
|
|
6461
|
+
borderBottom: t === "list" ? `1px solid ${A.border}` : "none",
|
|
6462
6462
|
transition: "all 0.15s ease"
|
|
6463
6463
|
},
|
|
6464
|
-
onMouseEnter: (
|
|
6465
|
-
f && (
|
|
6464
|
+
onMouseEnter: (R) => {
|
|
6465
|
+
f && (R.currentTarget.style.background = A.border);
|
|
6466
6466
|
},
|
|
6467
|
-
onMouseLeave: (
|
|
6468
|
-
|
|
6467
|
+
onMouseLeave: (R) => {
|
|
6468
|
+
R.currentTarget.style.background = A.cardBackground;
|
|
6469
6469
|
},
|
|
6470
|
-
children:
|
|
6470
|
+
children: M(C, N)
|
|
6471
6471
|
},
|
|
6472
|
-
o(
|
|
6472
|
+
o(C, N)
|
|
6473
6473
|
)) }),
|
|
6474
6474
|
F.totalPages > 1 && /* @__PURE__ */ h.jsxs("div", { style: {
|
|
6475
6475
|
padding: "16px",
|
|
6476
|
-
borderTop: `1px solid ${
|
|
6476
|
+
borderTop: `1px solid ${A.border}`,
|
|
6477
6477
|
display: "flex",
|
|
6478
6478
|
alignItems: "center",
|
|
6479
6479
|
justifyContent: "space-between"
|
|
6480
6480
|
}, children: [
|
|
6481
|
-
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "13px", color:
|
|
6481
|
+
/* @__PURE__ */ h.jsxs("div", { style: { fontSize: "13px", color: A.textSecondary }, children: [
|
|
6482
6482
|
"Page ",
|
|
6483
6483
|
v,
|
|
6484
6484
|
" of ",
|
|
@@ -6488,11 +6488,11 @@ function Dy({
|
|
|
6488
6488
|
/* @__PURE__ */ h.jsx(
|
|
6489
6489
|
"button",
|
|
6490
6490
|
{
|
|
6491
|
-
onClick: () => S((
|
|
6491
|
+
onClick: () => S((C) => Math.max(1, C - 1)),
|
|
6492
6492
|
disabled: v === 1,
|
|
6493
6493
|
style: {
|
|
6494
6494
|
padding: "6px 12px",
|
|
6495
|
-
border: `1px solid ${
|
|
6495
|
+
border: `1px solid ${A.border}`,
|
|
6496
6496
|
borderRadius: "6px",
|
|
6497
6497
|
background: "white",
|
|
6498
6498
|
cursor: v === 1 ? "not-allowed" : "pointer",
|
|
@@ -6504,11 +6504,11 @@ function Dy({
|
|
|
6504
6504
|
/* @__PURE__ */ h.jsx(
|
|
6505
6505
|
"button",
|
|
6506
6506
|
{
|
|
6507
|
-
onClick: () => S((
|
|
6507
|
+
onClick: () => S((C) => Math.min(F.totalPages, C + 1)),
|
|
6508
6508
|
disabled: v === F.totalPages,
|
|
6509
6509
|
style: {
|
|
6510
6510
|
padding: "6px 12px",
|
|
6511
|
-
border: `1px solid ${
|
|
6511
|
+
border: `1px solid ${A.border}`,
|
|
6512
6512
|
borderRadius: "6px",
|
|
6513
6513
|
background: "white",
|
|
6514
6514
|
cursor: v === F.totalPages ? "not-allowed" : "pointer",
|
|
@@ -6631,71 +6631,72 @@ function ky({
|
|
|
6631
6631
|
maxInterval: t = 6e3,
|
|
6632
6632
|
onCardClick: n,
|
|
6633
6633
|
cardSize: i = "medium",
|
|
6634
|
-
|
|
6634
|
+
aspectRatio: s = "1:1",
|
|
6635
|
+
className: o = ""
|
|
6635
6636
|
}) {
|
|
6636
|
-
var
|
|
6637
|
-
const [
|
|
6637
|
+
var T, A;
|
|
6638
|
+
const [a] = I(() => {
|
|
6638
6639
|
if (r.length === 0) return [[], []];
|
|
6639
|
-
const
|
|
6640
|
+
const B = of(r), M = Math.ceil(B.length / 2);
|
|
6640
6641
|
return console.log("[AnimatedCardFlip] Pools:", {
|
|
6641
|
-
left:
|
|
6642
|
-
right:
|
|
6643
|
-
}), [
|
|
6644
|
-
}), [
|
|
6645
|
-
const
|
|
6646
|
-
if (typeof window > "u") return
|
|
6647
|
-
const
|
|
6648
|
-
return "lg" in
|
|
6642
|
+
left: B.slice(0, M).map((C) => C.title),
|
|
6643
|
+
right: B.slice(M).map((C) => C.title)
|
|
6644
|
+
}), [B.slice(0, M), B.slice(M)];
|
|
6645
|
+
}), [l, u] = I(() => {
|
|
6646
|
+
const B = kl[i];
|
|
6647
|
+
if (typeof window > "u") return B.base;
|
|
6648
|
+
const M = window.innerWidth;
|
|
6649
|
+
return "lg" in B && M >= 1024 ? B.lg : M >= 768 ? B.md : M >= 640 ? B.sm : B.base;
|
|
6649
6650
|
});
|
|
6650
6651
|
Ee(() => {
|
|
6651
|
-
const
|
|
6652
|
-
const
|
|
6653
|
-
"lg" in
|
|
6652
|
+
const B = () => {
|
|
6653
|
+
const M = kl[i], C = window.innerWidth;
|
|
6654
|
+
"lg" in M && C >= 1024 ? u(M.lg) : C >= 768 ? u(M.md) : C >= 640 ? u(M.sm) : u(M.base);
|
|
6654
6655
|
};
|
|
6655
|
-
return window.addEventListener("resize",
|
|
6656
|
+
return window.addEventListener("resize", B), B(), () => window.removeEventListener("resize", B);
|
|
6656
6657
|
}, [i]);
|
|
6657
|
-
const [
|
|
6658
|
+
const [c, d] = I(0), [f, p] = I(0), [g, m] = I(!1), [x, b] = I(!1), [y, _] = I(!1), [D, E] = I(!1);
|
|
6658
6659
|
Ee(() => {
|
|
6659
|
-
if (
|
|
6660
|
-
const
|
|
6661
|
-
|
|
6662
|
-
|
|
6660
|
+
if (a[0].length <= 1) return;
|
|
6661
|
+
const B = setInterval(() => {
|
|
6662
|
+
m((M) => !M), setTimeout(() => {
|
|
6663
|
+
d((M) => (M + 1) % a[0].length), _((M) => !M);
|
|
6663
6664
|
}, 250);
|
|
6664
6665
|
}, e + Math.random() * (t - e));
|
|
6665
|
-
return () => clearInterval(
|
|
6666
|
-
}, [
|
|
6667
|
-
if (
|
|
6668
|
-
let
|
|
6669
|
-
const
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6666
|
+
return () => clearInterval(B);
|
|
6667
|
+
}, [a, e, t]), Ee(() => {
|
|
6668
|
+
if (a[1].length <= 1) return;
|
|
6669
|
+
let B = null;
|
|
6670
|
+
const M = setTimeout(() => {
|
|
6671
|
+
B = setInterval(() => {
|
|
6672
|
+
b((C) => !C), setTimeout(() => {
|
|
6673
|
+
p((C) => (C + 1) % a[1].length), E((C) => !C);
|
|
6673
6674
|
}, 250);
|
|
6674
6675
|
}, e + Math.random() * (t - e));
|
|
6675
6676
|
}, 500);
|
|
6676
6677
|
return () => {
|
|
6677
|
-
clearTimeout(
|
|
6678
|
+
clearTimeout(M), B && clearInterval(B);
|
|
6678
6679
|
};
|
|
6679
|
-
}, [
|
|
6680
|
-
const
|
|
6681
|
-
if (r.length === 0 || !
|
|
6682
|
-
return /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${
|
|
6683
|
-
const
|
|
6680
|
+
}, [a, e, t]);
|
|
6681
|
+
const w = (T = a[0]) == null ? void 0 : T[c], v = (A = a[1]) == null ? void 0 : A[f];
|
|
6682
|
+
if (r.length === 0 || !w)
|
|
6683
|
+
return /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${o}`, children: /* @__PURE__ */ h.jsx("p", { className: "text-gray-500", children: "No images available" }) });
|
|
6684
|
+
const S = s === "2:3" ? l * 1.5 : l, F = (B, M, C) => /* @__PURE__ */ h.jsx(
|
|
6684
6685
|
"div",
|
|
6685
6686
|
{
|
|
6686
6687
|
className: "relative",
|
|
6687
6688
|
style: {
|
|
6688
|
-
width:
|
|
6689
|
-
height:
|
|
6689
|
+
width: l,
|
|
6690
|
+
height: S,
|
|
6690
6691
|
perspective: "1000px"
|
|
6691
6692
|
},
|
|
6692
|
-
onClick: () => n == null ? void 0 : n(
|
|
6693
|
+
onClick: () => n == null ? void 0 : n(B),
|
|
6693
6694
|
children: /* @__PURE__ */ h.jsx(
|
|
6694
6695
|
"div",
|
|
6695
6696
|
{
|
|
6696
6697
|
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
6697
6698
|
style: {
|
|
6698
|
-
transform: `rotateY(${
|
|
6699
|
+
transform: `rotateY(${M ? 180 : 0}deg)`,
|
|
6699
6700
|
transition: "transform 0.5s ease-in-out",
|
|
6700
6701
|
transformStyle: "preserve-3d"
|
|
6701
6702
|
},
|
|
@@ -6704,11 +6705,11 @@ function ky({
|
|
|
6704
6705
|
{
|
|
6705
6706
|
className: "w-full h-full",
|
|
6706
6707
|
style: {
|
|
6707
|
-
transform:
|
|
6708
|
+
transform: C ? "scaleX(-1)" : "none"
|
|
6708
6709
|
},
|
|
6709
6710
|
children: [
|
|
6710
|
-
/* @__PURE__ */ h.jsx("img", { src:
|
|
6711
|
-
/* @__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:
|
|
6711
|
+
/* @__PURE__ */ h.jsx("img", { src: B.data.image, alt: B.title, className: "w-full h-full object-cover" }),
|
|
6712
|
+
/* @__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: B.title }) })
|
|
6712
6713
|
]
|
|
6713
6714
|
}
|
|
6714
6715
|
)
|
|
@@ -6716,9 +6717,9 @@ function ky({
|
|
|
6716
6717
|
)
|
|
6717
6718
|
}
|
|
6718
6719
|
);
|
|
6719
|
-
return /* @__PURE__ */ h.jsxs("div", { className: `flex gap-4 justify-center items-center ${
|
|
6720
|
-
|
|
6721
|
-
|
|
6720
|
+
return /* @__PURE__ */ h.jsxs("div", { className: `flex gap-4 justify-center items-center ${o}`, children: [
|
|
6721
|
+
F(w, g, y),
|
|
6722
|
+
v && F(v, x, D)
|
|
6722
6723
|
] });
|
|
6723
6724
|
}
|
|
6724
6725
|
function Vr(r) {
|
|
@@ -6774,11 +6775,11 @@ function Ay({
|
|
|
6774
6775
|
renderItem: b,
|
|
6775
6776
|
renderDetail: y,
|
|
6776
6777
|
renderActions: _,
|
|
6777
|
-
renderEmpty:
|
|
6778
|
+
renderEmpty: D,
|
|
6778
6779
|
renderLoading: E,
|
|
6779
|
-
theme:
|
|
6780
|
+
theme: w = {}
|
|
6780
6781
|
}) {
|
|
6781
|
-
const v = { ...lf, ...
|
|
6782
|
+
const v = { ...lf, ...w }, [S, F] = I([]), [T, A] = I(!1), [B, M] = I(null), [C, N] = I(/* @__PURE__ */ new Set()), [R, O] = I(null), [V, U] = I(null), [re, q] = I(null), [Z, W] = I(!1), [se, ce] = I(""), fe = l !== void 0 ? l : se, ge = (oe) => {
|
|
6782
6783
|
u ? u(oe) : ce(oe);
|
|
6783
6784
|
}, Be = ct(() => {
|
|
6784
6785
|
if (!fe.trim()) return S;
|
|
@@ -6788,19 +6789,19 @@ function Ay({
|
|
|
6788
6789
|
);
|
|
6789
6790
|
}, [S, fe]), _e = ct(() => e ? new Hd({ baseUrl: r, system_id: e }) : null, [r, e]), ee = J(async () => {
|
|
6790
6791
|
if (_e) {
|
|
6791
|
-
|
|
6792
|
+
A(!0), M(null);
|
|
6792
6793
|
try {
|
|
6793
6794
|
const oe = await _e.listEmails(t, n, i);
|
|
6794
6795
|
oe != null && oe.messages && (F(oe.messages), x == null || x(oe.messages));
|
|
6795
6796
|
} catch (oe) {
|
|
6796
6797
|
const de = oe instanceof Error ? oe : new Error("Failed to fetch emails");
|
|
6797
|
-
|
|
6798
|
+
M(de.message), m == null || m(de);
|
|
6798
6799
|
}
|
|
6799
|
-
|
|
6800
|
+
A(!1);
|
|
6800
6801
|
}
|
|
6801
6802
|
}, [_e, t, n, i, m, x]);
|
|
6802
6803
|
Ee(() => {
|
|
6803
|
-
F([]), N(/* @__PURE__ */ new Set()), U(null),
|
|
6804
|
+
F([]), N(/* @__PURE__ */ new Set()), U(null), M(null), l === void 0 && ce(""), d && ee();
|
|
6804
6805
|
}, [i, d]);
|
|
6805
6806
|
const Se = J(async (oe) => {
|
|
6806
6807
|
if (_e) {
|
|
@@ -6821,8 +6822,8 @@ function Ay({
|
|
|
6821
6822
|
return;
|
|
6822
6823
|
}
|
|
6823
6824
|
const tt = oe.uid;
|
|
6824
|
-
if (Ye.shiftKey &&
|
|
6825
|
-
const rt = Math.min(
|
|
6825
|
+
if (Ye.shiftKey && R !== null) {
|
|
6826
|
+
const rt = Math.min(R, de), Lt = Math.max(R, de), Q = S.slice(rt, Lt + 1).map((ue) => ue.uid), j = new Set(Q);
|
|
6826
6827
|
N(j), p == null || p(Array.from(j));
|
|
6827
6828
|
} else if (Ye.ctrlKey || Ye.metaKey)
|
|
6828
6829
|
N((rt) => {
|
|
@@ -6833,44 +6834,44 @@ function Ay({
|
|
|
6833
6834
|
const rt = /* @__PURE__ */ new Set([tt]);
|
|
6834
6835
|
N(rt), O(de), p == null || p(Array.from(rt));
|
|
6835
6836
|
}
|
|
6836
|
-
}, [s,
|
|
6837
|
-
if (!_e ||
|
|
6837
|
+
}, [s, R, S, C, f, p, o]), ke = J(async () => {
|
|
6838
|
+
if (!_e || C.size === 0) return;
|
|
6838
6839
|
const oe = i || "INBOX";
|
|
6839
6840
|
try {
|
|
6840
|
-
const de = await _e.trashEmails(t, Array.from(
|
|
6841
|
+
const de = await _e.trashEmails(t, Array.from(C), oe);
|
|
6841
6842
|
if (console.log("Trash result:", de), de.success && de.moved > 0) {
|
|
6842
|
-
F((tt) => tt.filter((rt) => !
|
|
6843
|
-
const Ye = Array.from(
|
|
6843
|
+
F((tt) => tt.filter((rt) => !C.has(rt.uid)));
|
|
6844
|
+
const Ye = Array.from(C);
|
|
6844
6845
|
N(/* @__PURE__ */ new Set()), g == null || g(Ye);
|
|
6845
6846
|
} else
|
|
6846
|
-
|
|
6847
|
+
M("Failed to move emails to trash");
|
|
6847
6848
|
} catch (de) {
|
|
6848
6849
|
const Ye = de instanceof Error ? de : new Error("Trash failed");
|
|
6849
|
-
console.error("Trash error:", Ye),
|
|
6850
|
+
console.error("Trash error:", Ye), M(Ye.message), m == null || m(Ye);
|
|
6850
6851
|
}
|
|
6851
|
-
}, [_e, t,
|
|
6852
|
-
if (!_e ||
|
|
6852
|
+
}, [_e, t, C, i, g, m]), Ae = J(async () => {
|
|
6853
|
+
if (!_e || C.size === 0) return;
|
|
6853
6854
|
const oe = i || "INBOX";
|
|
6854
6855
|
try {
|
|
6855
|
-
const de = await _e.archiveEmails(t, Array.from(
|
|
6856
|
+
const de = await _e.archiveEmails(t, Array.from(C), oe);
|
|
6856
6857
|
if (console.log("Archive result:", de), de.success && de.archived > 0) {
|
|
6857
|
-
F((tt) => tt.filter((rt) => !
|
|
6858
|
-
const Ye = Array.from(
|
|
6858
|
+
F((tt) => tt.filter((rt) => !C.has(rt.uid)));
|
|
6859
|
+
const Ye = Array.from(C);
|
|
6859
6860
|
N(/* @__PURE__ */ new Set()), g == null || g(Ye);
|
|
6860
6861
|
} else
|
|
6861
|
-
|
|
6862
|
+
M("Failed to archive emails");
|
|
6862
6863
|
} catch (de) {
|
|
6863
6864
|
const Ye = de instanceof Error ? de : new Error("Archive failed");
|
|
6864
|
-
console.error("Archive error:", Ye),
|
|
6865
|
+
console.error("Archive error:", Ye), M(Ye.message), m == null || m(Ye);
|
|
6865
6866
|
}
|
|
6866
|
-
}, [_e, t,
|
|
6867
|
-
if (
|
|
6867
|
+
}, [_e, t, C, i, g, m]), qe = J(() => {
|
|
6868
|
+
if (C.size === S.length)
|
|
6868
6869
|
N(/* @__PURE__ */ new Set()), p == null || p([]);
|
|
6869
6870
|
else {
|
|
6870
6871
|
const oe = new Set(S.map((de) => de.uid));
|
|
6871
6872
|
N(oe), p == null || p(Array.from(oe));
|
|
6872
6873
|
}
|
|
6873
|
-
}, [S,
|
|
6874
|
+
}, [S, C.size, p]), ze = J(() => {
|
|
6874
6875
|
N(/* @__PURE__ */ new Set()), p == null || p([]);
|
|
6875
6876
|
}, [p]), He = {
|
|
6876
6877
|
delete: ke,
|
|
@@ -7027,8 +7028,8 @@ function Ay({
|
|
|
7027
7028
|
padding: "48px",
|
|
7028
7029
|
textAlign: "center",
|
|
7029
7030
|
color: v.textSecondary
|
|
7030
|
-
}, children: "Loading..." }), me = b || L, xe = y || ye, Ge = _ || Ke, vt =
|
|
7031
|
-
return
|
|
7031
|
+
}, children: "Loading..." }), me = b || L, xe = y || ye, Ge = _ || Ke, vt = D || z, wt = E || ae;
|
|
7032
|
+
return T && S.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: [
|
|
7032
7033
|
/* @__PURE__ */ h.jsxs("div", { style: {
|
|
7033
7034
|
flex: o && V ? "0 0 50%" : "1",
|
|
7034
7035
|
display: "flex",
|
|
@@ -7036,7 +7037,7 @@ function Ay({
|
|
|
7036
7037
|
borderRight: o && V ? `1px solid ${v.border}` : "none",
|
|
7037
7038
|
overflow: "hidden"
|
|
7038
7039
|
}, children: [
|
|
7039
|
-
s && Ge(Array.from(
|
|
7040
|
+
s && Ge(Array.from(C), He),
|
|
7040
7041
|
a && /* @__PURE__ */ h.jsx("div", { style: {
|
|
7041
7042
|
padding: "8px 12px",
|
|
7042
7043
|
borderBottom: `1px solid ${v.border}`,
|
|
@@ -7099,7 +7100,7 @@ function Ay({
|
|
|
7099
7100
|
{
|
|
7100
7101
|
onClick: (Ye) => Re(oe, de, Ye),
|
|
7101
7102
|
onDoubleClick: () => ie(oe),
|
|
7102
|
-
children: me(oe,
|
|
7103
|
+
children: me(oe, C.has(oe.uid))
|
|
7103
7104
|
},
|
|
7104
7105
|
oe.uid
|
|
7105
7106
|
)) })
|
|
@@ -7118,28 +7119,28 @@ function Ty({
|
|
|
7118
7119
|
showSelectAll: a = !0,
|
|
7119
7120
|
className: l = ""
|
|
7120
7121
|
}) {
|
|
7121
|
-
const [u, c] = I(/* @__PURE__ */ new Set()), [d, f] = I(-1), p = r.filter((
|
|
7122
|
+
const [u, c] = I(/* @__PURE__ */ new Set()), [d, f] = I(-1), p = r.filter((D) => u.has(D.id)), g = d >= 0 && d < p.length ? p[d] : null, m = J((D) => {
|
|
7122
7123
|
c((E) => {
|
|
7123
|
-
const
|
|
7124
|
-
return
|
|
7124
|
+
const w = new Set(E);
|
|
7125
|
+
return w.has(D) ? w.delete(D) : w.add(D), t == null || t(Array.from(w)), w;
|
|
7125
7126
|
});
|
|
7126
7127
|
}, [t]), x = J(() => {
|
|
7127
7128
|
if (u.size === r.length)
|
|
7128
7129
|
c(/* @__PURE__ */ new Set()), f(-1), t == null || t([]);
|
|
7129
7130
|
else {
|
|
7130
|
-
const
|
|
7131
|
-
c(
|
|
7131
|
+
const D = new Set(r.map((E) => E.id));
|
|
7132
|
+
c(D), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((E) => E.id));
|
|
7132
7133
|
}
|
|
7133
7134
|
}, [r, u.size, t, n]), b = J(() => {
|
|
7134
7135
|
if (p.length === 0) return;
|
|
7135
|
-
const
|
|
7136
|
-
f(
|
|
7136
|
+
const D = d <= 0 ? p.length - 1 : d - 1;
|
|
7137
|
+
f(D), n == null || n(p[D], D);
|
|
7137
7138
|
}, [p, d, n]), y = J(() => {
|
|
7138
7139
|
if (p.length === 0) return;
|
|
7139
|
-
const
|
|
7140
|
-
f(
|
|
7141
|
-
}, [p, d, n]), _ = J((
|
|
7142
|
-
i == null || i(
|
|
7140
|
+
const D = d >= p.length - 1 ? 0 : d + 1;
|
|
7141
|
+
f(D), n == null || n(p[D], D);
|
|
7142
|
+
}, [p, d, n]), _ = J((D) => {
|
|
7143
|
+
i == null || i(D, p, g);
|
|
7143
7144
|
}, [i, p, g]);
|
|
7144
7145
|
return Le.useEffect(() => {
|
|
7145
7146
|
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));
|
|
@@ -7189,36 +7190,36 @@ function Ty({
|
|
|
7189
7190
|
)
|
|
7190
7191
|
] })
|
|
7191
7192
|
] }),
|
|
7192
|
-
/* @__PURE__ */ h.jsx("div", { className: "space-y-1", children: r.map((
|
|
7193
|
-
const E = u.has(
|
|
7193
|
+
/* @__PURE__ */ h.jsx("div", { className: "space-y-1", children: r.map((D) => {
|
|
7194
|
+
const E = u.has(D.id), w = (g == null ? void 0 : g.id) === D.id;
|
|
7194
7195
|
return /* @__PURE__ */ h.jsxs(
|
|
7195
7196
|
"div",
|
|
7196
7197
|
{
|
|
7197
|
-
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${
|
|
7198
|
-
onClick: () => m(
|
|
7198
|
+
className: `flex items-center gap-2 p-2 rounded-lg cursor-pointer transition-colors ${w ? "bg-blue-50 ring-1 ring-blue-200" : E ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
|
|
7199
|
+
onClick: () => m(D.id),
|
|
7199
7200
|
children: [
|
|
7200
7201
|
/* @__PURE__ */ h.jsx("span", { className: `material-icons text-lg ${E ? "text-blue-500" : "text-neutral-300"}`, children: E ? "check_box" : "check_box_outline_blank" }),
|
|
7201
|
-
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(
|
|
7202
|
+
/* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(D, E, w) })
|
|
7202
7203
|
]
|
|
7203
7204
|
},
|
|
7204
|
-
|
|
7205
|
+
D.id
|
|
7205
7206
|
);
|
|
7206
7207
|
}) }),
|
|
7207
|
-
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((
|
|
7208
|
-
var
|
|
7209
|
-
const E = ((
|
|
7208
|
+
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((D) => {
|
|
7209
|
+
var w;
|
|
7210
|
+
const E = ((w = D.disabled) == null ? void 0 : w.call(D, p)) ?? !1;
|
|
7210
7211
|
return /* @__PURE__ */ h.jsxs(
|
|
7211
7212
|
"button",
|
|
7212
7213
|
{
|
|
7213
|
-
onClick: () => _(
|
|
7214
|
+
onClick: () => _(D.id),
|
|
7214
7215
|
disabled: E,
|
|
7215
7216
|
className: `flex items-center gap-1 px-3 py-1.5 text-xs rounded-lg transition-colors ${E ? "bg-neutral-100 text-neutral-400 cursor-not-allowed" : "bg-neutral-100 hover:bg-neutral-200 text-neutral-700"}`,
|
|
7216
7217
|
children: [
|
|
7217
|
-
|
|
7218
|
-
|
|
7218
|
+
D.icon && /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: D.icon }),
|
|
7219
|
+
D.label
|
|
7219
7220
|
]
|
|
7220
7221
|
},
|
|
7221
|
-
|
|
7222
|
+
D.id
|
|
7222
7223
|
);
|
|
7223
7224
|
}) })
|
|
7224
7225
|
] });
|
|
@@ -7314,24 +7315,24 @@ function Tu(r, e, t) {
|
|
|
7314
7315
|
else if (g === "childList") {
|
|
7315
7316
|
u = !0;
|
|
7316
7317
|
const _ = p.addedNodes;
|
|
7317
|
-
for (let
|
|
7318
|
-
const v = _[
|
|
7318
|
+
for (let w = 0; w < _.length; w++) {
|
|
7319
|
+
const v = _[w], S = ju(v), F = v.parentNode;
|
|
7319
7320
|
if (F != null && v !== l && S === null && !Is(v, F, r)) {
|
|
7320
7321
|
if (vr) {
|
|
7321
|
-
const
|
|
7322
|
-
|
|
7322
|
+
const T = v.innerText || v.nodeValue;
|
|
7323
|
+
T && (c += T);
|
|
7323
7324
|
}
|
|
7324
7325
|
F.removeChild(v);
|
|
7325
7326
|
}
|
|
7326
7327
|
}
|
|
7327
|
-
const
|
|
7328
|
+
const D = p.removedNodes, E = D.length;
|
|
7328
7329
|
if (E > 0) {
|
|
7329
|
-
let
|
|
7330
|
+
let w = 0;
|
|
7330
7331
|
for (let v = 0; v < E; v++) {
|
|
7331
|
-
const S =
|
|
7332
|
-
(Is(S, m, r) || l === S) && (m.appendChild(S),
|
|
7332
|
+
const S = D[v];
|
|
7333
|
+
(Is(S, m, r) || l === S) && (m.appendChild(S), w++);
|
|
7333
7334
|
}
|
|
7334
|
-
E !==
|
|
7335
|
+
E !== w && s.set(b, y);
|
|
7335
7336
|
}
|
|
7336
7337
|
}
|
|
7337
7338
|
}
|
|
@@ -8047,28 +8048,28 @@ function oh(r, e, t) {
|
|
|
8047
8048
|
lo(f, 0, u - 1, g ? null : d), g && (d.textContent = "");
|
|
8048
8049
|
}
|
|
8049
8050
|
} else (function(g, m, x, b, y, _) {
|
|
8050
|
-
const
|
|
8051
|
-
let
|
|
8052
|
-
for (; F <=
|
|
8053
|
-
const
|
|
8054
|
-
if (
|
|
8051
|
+
const D = b - 1, E = y - 1;
|
|
8052
|
+
let w, v, S = _.getFirstChild(), F = 0, T = 0;
|
|
8053
|
+
for (; F <= D && T <= E; ) {
|
|
8054
|
+
const M = m[F], C = x[T];
|
|
8055
|
+
if (M === C) S = $s(Sn(C, _.element)), F++, T++;
|
|
8055
8056
|
else {
|
|
8056
|
-
|
|
8057
|
-
const
|
|
8058
|
-
if (
|
|
8059
|
-
const V = Ui(_t,
|
|
8060
|
-
V === S ? S = $s(Sn(
|
|
8061
|
-
} else Vi(
|
|
8062
|
-
else S = $s(uo(
|
|
8057
|
+
w === void 0 && (w = new Set(m)), v === void 0 && (v = new Set(x));
|
|
8058
|
+
const R = v.has(M), O = w.has(C);
|
|
8059
|
+
if (R) if (O) {
|
|
8060
|
+
const V = Ui(_t, C);
|
|
8061
|
+
V === S ? S = $s(Sn(C, _.element)) : (_.withBefore(S).insertChild(V), Sn(C, _.element)), F++, T++;
|
|
8062
|
+
} else Vi(C, _.withBefore(S)), T++;
|
|
8063
|
+
else S = $s(uo(M)), Hi(M, _.element), F++;
|
|
8063
8064
|
}
|
|
8064
|
-
const N = Wt.get(
|
|
8065
|
+
const N = Wt.get(C);
|
|
8065
8066
|
N !== null && X(N) && (Kt === null && (Kt = N.getFormat()), Ot === "" && (Ot = N.getStyle()));
|
|
8066
8067
|
}
|
|
8067
|
-
const
|
|
8068
|
-
if (
|
|
8069
|
-
const
|
|
8070
|
-
ao(x, g,
|
|
8071
|
-
} else B && !
|
|
8068
|
+
const A = F > D, B = T > E;
|
|
8069
|
+
if (A && !B) {
|
|
8070
|
+
const M = x[E + 1], C = M === void 0 ? null : _t.getElementByKey(M);
|
|
8071
|
+
ao(x, g, T, E, _.withBefore(C));
|
|
8072
|
+
} else B && !A && lo(m, F, D, _.element);
|
|
8072
8073
|
})(o, f, p, u, c, a);
|
|
8073
8074
|
}
|
|
8074
8075
|
ms(o) && (ut += ur), d.__lexicalTextContent = ut, ut = l + ut;
|
|
@@ -8425,12 +8426,12 @@ function Hl(r, e, t) {
|
|
|
8425
8426
|
}
|
|
8426
8427
|
} else {
|
|
8427
8428
|
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;
|
|
8428
|
-
let _ = Ff,
|
|
8429
|
+
let _ = Ff, D = !1;
|
|
8429
8430
|
for (let E = 0; E < p; E++) {
|
|
8430
|
-
const
|
|
8431
|
-
if (X(
|
|
8431
|
+
const w = f[E], v = w.getTextContentSize();
|
|
8432
|
+
if (X(w) && v !== 0 && !(E === 0 && w.__key === b && m === v || E === p - 1 && w.__key === y && x === 0) && (D = !0, _ &= w.getFormat(), _ === 0)) break;
|
|
8432
8433
|
}
|
|
8433
|
-
a.format =
|
|
8434
|
+
a.format = D ? _ : 0;
|
|
8434
8435
|
}
|
|
8435
8436
|
}
|
|
8436
8437
|
ne(e, Ro, void 0);
|
|
@@ -9133,24 +9134,24 @@ class dn extends bs {
|
|
|
9133
9134
|
let b = !1;
|
|
9134
9135
|
t.isSegmented() ? (p = at(d), p.__format = g, p.__style = m, p.__detail = x, b = !0) : (p = t.getWritable(), p.__text = d);
|
|
9135
9136
|
const y = le(), _ = [p];
|
|
9136
|
-
let
|
|
9137
|
+
let D = d.length;
|
|
9137
9138
|
for (let E = 1; E < c; E++) {
|
|
9138
|
-
const
|
|
9139
|
+
const w = a[E], v = w.length, S = at(w).getWritable();
|
|
9139
9140
|
S.__format = g, S.__style = m, S.__detail = x;
|
|
9140
|
-
const F = S.__key,
|
|
9141
|
+
const F = S.__key, T = D + v;
|
|
9141
9142
|
if (H(y)) {
|
|
9142
|
-
const
|
|
9143
|
-
|
|
9143
|
+
const A = y.anchor, B = y.focus;
|
|
9144
|
+
A.key === i && A.type === "text" && A.offset > D && A.offset <= T && (A.key = F, A.offset -= D, y.dirty = !0), B.key === i && B.type === "text" && B.offset > D && B.offset <= T && (B.key = F, B.offset -= D, y.dirty = !0);
|
|
9144
9145
|
}
|
|
9145
|
-
s === i && ht(F),
|
|
9146
|
+
s === i && ht(F), D = T, _.push(S);
|
|
9146
9147
|
}
|
|
9147
9148
|
if (f !== null) {
|
|
9148
9149
|
(function(v) {
|
|
9149
9150
|
const S = v.getPreviousSibling(), F = v.getNextSibling();
|
|
9150
9151
|
S !== null && qi(S), F !== null && qi(F);
|
|
9151
9152
|
})(this);
|
|
9152
|
-
const E = f.getWritable(),
|
|
9153
|
-
b ? (E.splice(
|
|
9153
|
+
const E = f.getWritable(), w = this.getIndexWithinParent();
|
|
9154
|
+
b ? (E.splice(w, 0, _), this.remove()) : E.splice(w, 1, _), H(y) && Yi(y, f, w, c - 1);
|
|
9154
9155
|
}
|
|
9155
9156
|
return _;
|
|
9156
9157
|
}
|
|
@@ -9527,8 +9528,8 @@ class Dr {
|
|
|
9527
9528
|
const t = this.anchor, n = this.focus, i = this.format, s = this.style;
|
|
9528
9529
|
let o = t, a = n;
|
|
9529
9530
|
!this.isCollapsed() && n.isBefore(t) && (o = n, a = t), o.type === "element" && function(x, b, y, _) {
|
|
9530
|
-
const
|
|
9531
|
-
|
|
9531
|
+
const D = x.getNode(), E = D.getChildAtIndex(x.offset), w = at(), v = bt(D) ? ot().append(w) : w;
|
|
9532
|
+
w.setFormat(y), w.setStyle(_), E === null ? D.append(v) : E.insertBefore(v), x.is(b) && b.set(w.__key, 0, "text"), x.set(w.__key, 0, "text");
|
|
9532
9533
|
}(o, a, i, s);
|
|
9533
9534
|
const l = o.offset;
|
|
9534
9535
|
let u = a.offset;
|
|
@@ -9566,8 +9567,8 @@ class Dr {
|
|
|
9566
9567
|
const _ = at(e);
|
|
9567
9568
|
if (_.setFormat(i), _.setStyle(s), _.select(), l === 0) f.insertBefore(_, !1);
|
|
9568
9569
|
else {
|
|
9569
|
-
const [
|
|
9570
|
-
|
|
9570
|
+
const [D] = f.splitText(l);
|
|
9571
|
+
D.insertAfter(_, !1);
|
|
9571
9572
|
}
|
|
9572
9573
|
return void (_.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
|
|
9573
9574
|
}
|
|
@@ -9592,17 +9593,17 @@ class Dr {
|
|
|
9592
9593
|
S.canBeEmpty() || S.getChildrenSize() !== 1 ? m.remove() : S.remove();
|
|
9593
9594
|
}
|
|
9594
9595
|
else x.add(m.__key);
|
|
9595
|
-
const
|
|
9596
|
-
for (let S =
|
|
9597
|
-
const F =
|
|
9596
|
+
const D = y.getChildren(), E = new Set(c), w = b.is(y), v = b.isInline() && f.getNextSibling() === null ? b : f;
|
|
9597
|
+
for (let S = D.length - 1; S >= 0; S--) {
|
|
9598
|
+
const F = D[S];
|
|
9598
9599
|
if (F.is(f) || P(F) && F.isParentOf(f)) break;
|
|
9599
|
-
F.isAttached() && (!E.has(F) || F.is(_) ?
|
|
9600
|
+
F.isAttached() && (!E.has(F) || F.is(_) ? w || v.insertAfter(F, !1) : F.remove());
|
|
9600
9601
|
}
|
|
9601
|
-
if (!
|
|
9602
|
+
if (!w) {
|
|
9602
9603
|
let S = y, F = null;
|
|
9603
9604
|
for (; S !== null; ) {
|
|
9604
|
-
const
|
|
9605
|
-
(
|
|
9605
|
+
const T = S.getChildren(), A = T.length;
|
|
9606
|
+
(A === 0 || T[A - 1].is(F)) && (x.delete(S.__key), F = S), S = S.getParent();
|
|
9606
9607
|
}
|
|
9607
9608
|
}
|
|
9608
9609
|
if (f.isToken()) if (l === p) f.select();
|
|
@@ -9612,8 +9613,8 @@ class Dr {
|
|
|
9612
9613
|
}
|
|
9613
9614
|
else f = f.spliceText(l, p - l, e, !0), f.getTextContent() === "" ? f.remove() : f.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
9614
9615
|
for (let S = 1; S < d; S++) {
|
|
9615
|
-
const F = c[S],
|
|
9616
|
-
x.has(
|
|
9616
|
+
const F = c[S], T = F.__key;
|
|
9617
|
+
x.has(T) || F.remove();
|
|
9617
9618
|
}
|
|
9618
9619
|
}
|
|
9619
9620
|
}
|
|
@@ -9645,12 +9646,12 @@ class Dr {
|
|
|
9645
9646
|
formatText(e, t = null) {
|
|
9646
9647
|
if (this.isCollapsed()) return this.toggleFormat(e), void ht(null);
|
|
9647
9648
|
const n = this.getNodes(), i = [];
|
|
9648
|
-
for (const
|
|
9649
|
-
const s = (
|
|
9649
|
+
for (const D of n) X(D) && i.push(D);
|
|
9650
|
+
const s = (D) => {
|
|
9650
9651
|
n.forEach((E) => {
|
|
9651
9652
|
if (ln(E)) {
|
|
9652
|
-
const
|
|
9653
|
-
E.setTextFormat(
|
|
9653
|
+
const w = E.getFormatFlags(e, D);
|
|
9654
|
+
E.setTextFormat(w);
|
|
9654
9655
|
}
|
|
9655
9656
|
});
|
|
9656
9657
|
}, o = i.length;
|
|
@@ -9667,7 +9668,7 @@ class Dr {
|
|
|
9667
9668
|
if (g === y) return;
|
|
9668
9669
|
if (Ar(p) || g === 0 && y === p.getTextContentSize()) p.setFormat(m);
|
|
9669
9670
|
else {
|
|
9670
|
-
const
|
|
9671
|
+
const D = p.splitText(g, y), E = g === 0 ? D[0] : D[1];
|
|
9671
9672
|
E.setFormat(m), c.type === "text" && c.set(E.__key, 0, "text"), d.type === "text" && d.set(E.__key, y - g, "text");
|
|
9672
9673
|
}
|
|
9673
9674
|
return void (this.format = m);
|
|
@@ -9675,9 +9676,9 @@ class Dr {
|
|
|
9675
9676
|
g === 0 || Ar(p) || ([, p] = p.splitText(g), g = 0), p.setFormat(m);
|
|
9676
9677
|
const _ = b.getFormatFlags(e, m);
|
|
9677
9678
|
y > 0 && (y === b.getTextContentSize() || Ar(b) || ([b] = b.splitText(y)), b.setFormat(_));
|
|
9678
|
-
for (let
|
|
9679
|
-
const E = i[
|
|
9680
|
-
E.setFormat(
|
|
9679
|
+
for (let D = f + 1; D < x; D++) {
|
|
9680
|
+
const E = i[D], w = E.getFormatFlags(e, _);
|
|
9681
|
+
E.setFormat(w);
|
|
9681
9682
|
}
|
|
9682
9683
|
c.type === "text" && c.set(p.__key, g, "text"), d.type === "text" && d.set(b.__key, y, "text"), this.format = m | _;
|
|
9683
9684
|
}
|
|
@@ -9721,8 +9722,8 @@ class Dr {
|
|
|
9721
9722
|
let y = m;
|
|
9722
9723
|
const _ = [m];
|
|
9723
9724
|
for (; y !== b; ) y.getNextSibling() || K(140), y = y.getNextSibling(), _.push(y);
|
|
9724
|
-
let
|
|
9725
|
-
for (const E of _)
|
|
9725
|
+
let D = g;
|
|
9726
|
+
for (const E of _) D = D.insertAfter(E);
|
|
9726
9727
|
}(n, c));
|
|
9727
9728
|
const f = bn(o, gr);
|
|
9728
9729
|
l && P(f) && (l.canMergeWhenEmpty() || gr(u)) && (f.append(...l.getChildren()), l.remove()), P(n) && n.isEmpty() && n.remove(), o.selectEnd();
|
|
@@ -9809,8 +9810,8 @@ class Dr {
|
|
|
9809
9810
|
P(y) ? y.selectEnd() : y.getParentOrThrow().selectEnd();
|
|
9810
9811
|
}
|
|
9811
9812
|
u.anchorNode === f.startContainer && u.anchorOffset === f.startOffset || function(y) {
|
|
9812
|
-
const _ = y.focus,
|
|
9813
|
-
mr(
|
|
9813
|
+
const _ = y.focus, D = y.anchor, E = D.key, w = D.offset, v = D.type;
|
|
9814
|
+
mr(D, _.key, _.offset, _.type), mr(_, E, w, v), y._cachedNodes = null;
|
|
9814
9815
|
}(this);
|
|
9815
9816
|
}
|
|
9816
9817
|
}
|
|
@@ -10090,15 +10091,15 @@ function xh(r, e, t, n, i, s, o) {
|
|
|
10090
10091
|
const a = n.anchorNode, l = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
|
|
10091
10092
|
if (i.has("collaboration") && d !== s || d !== null && Go(d)) return;
|
|
10092
10093
|
if (!H(e)) return void (r !== null && Zn(t, a, l) && n.removeAllRanges());
|
|
10093
|
-
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,
|
|
10094
|
+
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, D = e.format, E = e.style, w = e.isCollapsed();
|
|
10094
10095
|
let v = x, S = b, F = !1;
|
|
10095
10096
|
if (f.type === "text") {
|
|
10096
10097
|
v = zi(x);
|
|
10097
10098
|
const N = f.getNode();
|
|
10098
|
-
F = N.getFormat() !==
|
|
10099
|
+
F = N.getFormat() !== D || N.getStyle() !== E;
|
|
10099
10100
|
} else H(r) && r.anchor.type === "text" && (F = !0);
|
|
10100
|
-
var
|
|
10101
|
-
if (p.type === "text" && (S = zi(b)), v !== null && S !== null && (
|
|
10101
|
+
var T, A, B, M, C;
|
|
10102
|
+
if (p.type === "text" && (S = zi(b)), v !== null && S !== null && (w && (r === null || F || H(r) && (r.format !== D || r.style !== E)) && (T = D, A = E, B = y, M = g, C = performance.now(), Xu = [T, A, B, M, C]), u !== y || c !== _ || a !== v || l !== S || n.type === "Range" && w || (d !== null && s.contains(d) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
10102
10103
|
try {
|
|
10103
10104
|
n.setBaseAndExtent(v, y, S, _);
|
|
10104
10105
|
} catch {
|
|
@@ -10106,11 +10107,11 @@ function xh(r, e, t, n, i, s, o) {
|
|
|
10106
10107
|
if (!i.has("skip-scroll-into-view") && e.isCollapsed() && s !== null && s === document.activeElement) {
|
|
10107
10108
|
const N = e instanceof Dr && e.anchor.type === "element" ? v.childNodes[y] || null : n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
10108
10109
|
if (N !== null) {
|
|
10109
|
-
let
|
|
10110
|
+
let R;
|
|
10110
10111
|
if (N instanceof Text) {
|
|
10111
10112
|
const O = document.createRange();
|
|
10112
|
-
O.selectNode(N),
|
|
10113
|
-
} else
|
|
10113
|
+
O.selectNode(N), R = O.getBoundingClientRect();
|
|
10114
|
+
} else R = N.getBoundingClientRect();
|
|
10114
10115
|
(function(O, V, U) {
|
|
10115
10116
|
const re = U.ownerDocument, q = re.defaultView;
|
|
10116
10117
|
if (q === null) return;
|
|
@@ -10133,7 +10134,7 @@ function xh(r, e, t, n, i, s, o) {
|
|
|
10133
10134
|
if (ge) break;
|
|
10134
10135
|
fe = ei(fe);
|
|
10135
10136
|
}
|
|
10136
|
-
})(t,
|
|
10137
|
+
})(t, R, s);
|
|
10137
10138
|
}
|
|
10138
10139
|
}
|
|
10139
10140
|
ho = !0;
|
|
@@ -10259,10 +10260,10 @@ function br(r, e) {
|
|
|
10259
10260
|
if (r._pendingEditorState = null, r._editorState = t, !i && l && p !== null) {
|
|
10260
10261
|
ft = r, dt = t, kt = !1, r._updating = !0;
|
|
10261
10262
|
try {
|
|
10262
|
-
const
|
|
10263
|
-
p.disconnect(), g = lh(s, t, r,
|
|
10264
|
-
} catch (
|
|
10265
|
-
if (
|
|
10263
|
+
const w = r._dirtyType, v = r._dirtyElements, S = r._dirtyLeaves;
|
|
10264
|
+
p.disconnect(), g = lh(s, t, r, w, v, S);
|
|
10265
|
+
} catch (w) {
|
|
10266
|
+
if (w instanceof Error && r._onError(w), Gs) throw w;
|
|
10266
10267
|
return gc(r, null, n, t), Nu(r), r._dirtyType = sn, Gs = !0, br(r, s), void (Gs = !1);
|
|
10267
10268
|
} finally {
|
|
10268
10269
|
p.observe(n, sa), r._updating = f, dt = u, kt = c, ft = d;
|
|
@@ -10270,54 +10271,54 @@ function br(r, e) {
|
|
|
10270
10271
|
}
|
|
10271
10272
|
t._readOnly || (t._readOnly = !0);
|
|
10272
10273
|
const m = r._dirtyLeaves, x = r._dirtyElements, b = r._normalizedNodes, y = r._updateTags, _ = r._deferred;
|
|
10273
|
-
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(
|
|
10274
|
-
const S =
|
|
10275
|
-
let F =
|
|
10276
|
-
const
|
|
10277
|
-
let
|
|
10278
|
-
for (
|
|
10274
|
+
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(w, v) {
|
|
10275
|
+
const S = w._decorators;
|
|
10276
|
+
let F = w._pendingDecorators || S;
|
|
10277
|
+
const T = v._nodeMap;
|
|
10278
|
+
let A;
|
|
10279
|
+
for (A in F) T.has(A) || (F === S && (F = Lu(w)), delete F[A]);
|
|
10279
10280
|
}(r, t);
|
|
10280
|
-
const
|
|
10281
|
-
if (r._editable &&
|
|
10281
|
+
const D = i ? null : jt(r._window);
|
|
10282
|
+
if (r._editable && D !== null && (l || a === null || a.dirty)) {
|
|
10282
10283
|
ft = r, dt = t;
|
|
10283
10284
|
try {
|
|
10284
10285
|
if (p !== null && p.disconnect(), l || a === null || a.dirty) {
|
|
10285
|
-
const
|
|
10286
|
-
|
|
10286
|
+
const w = r._blockCursorElement;
|
|
10287
|
+
w !== null && Zo(w, r, n), xh(o, a, r, D, y, n);
|
|
10287
10288
|
}
|
|
10288
10289
|
Zf(r, n, a), p !== null && p.observe(n, sa);
|
|
10289
10290
|
} finally {
|
|
10290
10291
|
ft = d, dt = u;
|
|
10291
10292
|
}
|
|
10292
10293
|
}
|
|
10293
|
-
g !== null && function(
|
|
10294
|
-
const
|
|
10295
|
-
for (let
|
|
10296
|
-
const [
|
|
10297
|
-
|
|
10294
|
+
g !== null && function(w, v, S, F, T) {
|
|
10295
|
+
const A = Array.from(w._listeners.mutation), B = A.length;
|
|
10296
|
+
for (let M = 0; M < B; M++) {
|
|
10297
|
+
const [C, N] = A[M], R = v.get(N);
|
|
10298
|
+
R !== void 0 && C(R, { dirtyLeaves: F, prevEditorState: T, updateTags: S });
|
|
10298
10299
|
}
|
|
10299
10300
|
}(r, g, y, m, s), H(a) || a === null || o !== null && o.is(a) || r.dispatchCommand(Ro, void 0);
|
|
10300
10301
|
const E = r._pendingDecorators;
|
|
10301
|
-
E !== null && (r._decorators = E, r._pendingDecorators = null, Pn("decorator", r, !0, E)), function(
|
|
10302
|
-
const F = Rl(v),
|
|
10303
|
-
F !==
|
|
10304
|
-
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes: b, prevEditorState: e || s, tags: y }), function(
|
|
10305
|
-
if (
|
|
10306
|
-
const S =
|
|
10307
|
-
|
|
10302
|
+
E !== null && (r._decorators = E, r._pendingDecorators = null, Pn("decorator", r, !0, E)), function(w, v, S) {
|
|
10303
|
+
const F = Rl(v), T = Rl(S);
|
|
10304
|
+
F !== T && Pn("textcontent", w, !0, T);
|
|
10305
|
+
}(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes: b, prevEditorState: e || s, tags: y }), function(w, v) {
|
|
10306
|
+
if (w._deferred = [], v.length !== 0) {
|
|
10307
|
+
const S = w._updating;
|
|
10308
|
+
w._updating = !0;
|
|
10308
10309
|
try {
|
|
10309
10310
|
for (let F = 0; F < v.length; F++) v[F]();
|
|
10310
10311
|
} finally {
|
|
10311
|
-
|
|
10312
|
+
w._updating = S;
|
|
10312
10313
|
}
|
|
10313
10314
|
}
|
|
10314
|
-
}(r, _), function(
|
|
10315
|
-
const v =
|
|
10315
|
+
}(r, _), function(w) {
|
|
10316
|
+
const v = w._updates;
|
|
10316
10317
|
if (v.length !== 0) {
|
|
10317
10318
|
const S = v.shift();
|
|
10318
10319
|
if (S) {
|
|
10319
|
-
const [F,
|
|
10320
|
-
fc(
|
|
10320
|
+
const [F, T] = S;
|
|
10321
|
+
fc(w, F, T);
|
|
10321
10322
|
}
|
|
10322
10323
|
}
|
|
10323
10324
|
}(r);
|
|
@@ -10388,30 +10389,30 @@ function fc(r, e, t) {
|
|
|
10388
10389
|
}(r));
|
|
10389
10390
|
const m = r._compositionKey;
|
|
10390
10391
|
e(), s = ua(r, s), function(b, y) {
|
|
10391
|
-
const _ = y.getEditorState()._selection,
|
|
10392
|
-
if (H(
|
|
10393
|
-
const E =
|
|
10392
|
+
const _ = y.getEditorState()._selection, D = b._selection;
|
|
10393
|
+
if (H(D)) {
|
|
10394
|
+
const E = D.anchor, w = D.focus;
|
|
10394
10395
|
let v;
|
|
10395
|
-
if (E.type === "text" && (v = E.getNode(), v.selectionTransform(_,
|
|
10396
|
-
const S =
|
|
10397
|
-
v !== S && S.selectionTransform(_,
|
|
10396
|
+
if (E.type === "text" && (v = E.getNode(), v.selectionTransform(_, D)), w.type === "text") {
|
|
10397
|
+
const S = w.getNode();
|
|
10398
|
+
v !== S && S.selectionTransform(_, D);
|
|
10398
10399
|
}
|
|
10399
10400
|
}
|
|
10400
10401
|
}(l, r), r._dirtyType !== jr && (s ? function(b, y) {
|
|
10401
|
-
const _ = y._dirtyLeaves,
|
|
10402
|
+
const _ = y._dirtyLeaves, D = b._nodeMap;
|
|
10402
10403
|
for (const E of _) {
|
|
10403
|
-
const
|
|
10404
|
-
X(
|
|
10404
|
+
const w = D.get(E);
|
|
10405
|
+
X(w) && w.isAttached() && w.isSimpleText() && !w.isUnmergeable() && Fl(w);
|
|
10405
10406
|
}
|
|
10406
10407
|
}(l, r) : function(b, y) {
|
|
10407
|
-
const _ = y._dirtyLeaves,
|
|
10408
|
-
let S = _, F = S.size,
|
|
10409
|
-
for (; F > 0 ||
|
|
10408
|
+
const _ = y._dirtyLeaves, D = y._dirtyElements, E = b._nodeMap, w = xr(), v = /* @__PURE__ */ new Map();
|
|
10409
|
+
let S = _, F = S.size, T = D, A = T.size;
|
|
10410
|
+
for (; F > 0 || A > 0; ) {
|
|
10410
10411
|
if (F > 0) {
|
|
10411
10412
|
y._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
10412
10413
|
for (const B of S) {
|
|
10413
|
-
const
|
|
10414
|
-
X(
|
|
10414
|
+
const M = E.get(B);
|
|
10415
|
+
X(M) && M.isAttached() && M.isSimpleText() && !M.isUnmergeable() && Fl(M), M !== void 0 && la(M, w) && oa(y, M, v), _.add(B);
|
|
10415
10416
|
}
|
|
10416
10417
|
if (S = y._dirtyLeaves, F = S.size, F > 0) {
|
|
10417
10418
|
ki++;
|
|
@@ -10419,25 +10420,25 @@ function fc(r, e, t) {
|
|
|
10419
10420
|
}
|
|
10420
10421
|
}
|
|
10421
10422
|
y._dirtyLeaves = /* @__PURE__ */ new Set(), y._dirtyElements = /* @__PURE__ */ new Map();
|
|
10422
|
-
for (const B of
|
|
10423
|
-
const
|
|
10424
|
-
if (
|
|
10425
|
-
const N = E.get(
|
|
10426
|
-
N !== void 0 && la(N,
|
|
10423
|
+
for (const B of T) {
|
|
10424
|
+
const M = B[0], C = B[1];
|
|
10425
|
+
if (M !== "root" && !C) continue;
|
|
10426
|
+
const N = E.get(M);
|
|
10427
|
+
N !== void 0 && la(N, w) && oa(y, N, v), D.set(M, C);
|
|
10427
10428
|
}
|
|
10428
|
-
S = y._dirtyLeaves, F = S.size,
|
|
10429
|
+
S = y._dirtyLeaves, F = S.size, T = y._dirtyElements, A = T.size, ki++;
|
|
10429
10430
|
}
|
|
10430
|
-
y._dirtyLeaves = _, y._dirtyElements =
|
|
10431
|
-
}(l, r), ua(r), function(b, y, _,
|
|
10432
|
-
const E = b._nodeMap,
|
|
10433
|
-
for (const [S] of
|
|
10434
|
-
const F =
|
|
10435
|
-
F !== void 0 && (F.isAttached() || (P(F) && qu(F, S, E,
|
|
10431
|
+
y._dirtyLeaves = _, y._dirtyElements = D;
|
|
10432
|
+
}(l, r), ua(r), function(b, y, _, D) {
|
|
10433
|
+
const E = b._nodeMap, w = y._nodeMap, v = [];
|
|
10434
|
+
for (const [S] of D) {
|
|
10435
|
+
const F = w.get(S);
|
|
10436
|
+
F !== void 0 && (F.isAttached() || (P(F) && qu(F, S, E, w, v, D), E.has(S) || D.delete(S), v.push(S)));
|
|
10436
10437
|
}
|
|
10437
|
-
for (const S of v)
|
|
10438
|
+
for (const S of v) w.delete(S);
|
|
10438
10439
|
for (const S of _) {
|
|
10439
|
-
const F =
|
|
10440
|
-
F === void 0 || F.isAttached() || (E.has(S) || _.delete(S),
|
|
10440
|
+
const F = w.get(S);
|
|
10441
|
+
F === void 0 || F.isAttached() || (E.has(S) || _.delete(S), w.delete(S));
|
|
10441
10442
|
}
|
|
10442
10443
|
}(a, l, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (l._flushSync = !0);
|
|
10443
10444
|
const x = l._selection;
|
|
@@ -11093,26 +11094,26 @@ function Dh(r) {
|
|
|
11093
11094
|
for (let m = 0; m < u.length; m++) {
|
|
11094
11095
|
let x = u[m], b = null, y = null;
|
|
11095
11096
|
if (typeof x != "function") {
|
|
11096
|
-
const
|
|
11097
|
-
x =
|
|
11097
|
+
const w = x;
|
|
11098
|
+
x = w.replace, b = w.with, y = w.withKlass || null;
|
|
11098
11099
|
}
|
|
11099
|
-
const _ = x.getType(),
|
|
11100
|
-
|
|
11100
|
+
const _ = x.getType(), D = x.transform(), E = /* @__PURE__ */ new Set();
|
|
11101
|
+
D !== null && E.add(D), p.set(_, { exportDOM: d && d.export ? d.export.get(x) : void 0, klass: x, replace: b, replaceWithKlass: y, transforms: E });
|
|
11101
11102
|
}
|
|
11102
11103
|
}
|
|
11103
11104
|
const g = new ws(o, i, p, { disableEvents: s, namespace: a, theme: n }, c || console.error, function(m, x) {
|
|
11104
|
-
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), _ = (
|
|
11105
|
-
Object.keys(
|
|
11106
|
-
let
|
|
11107
|
-
|
|
11105
|
+
const b = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), _ = (D) => {
|
|
11106
|
+
Object.keys(D).forEach((E) => {
|
|
11107
|
+
let w = b.get(E);
|
|
11108
|
+
w === void 0 && (w = [], b.set(E, w)), w.push(D[E]);
|
|
11108
11109
|
});
|
|
11109
11110
|
};
|
|
11110
|
-
return m.forEach((
|
|
11111
|
-
const E =
|
|
11111
|
+
return m.forEach((D) => {
|
|
11112
|
+
const E = D.klass.importDOM;
|
|
11112
11113
|
if (E == null || y.has(E)) return;
|
|
11113
11114
|
y.add(E);
|
|
11114
|
-
const
|
|
11115
|
-
|
|
11115
|
+
const w = E.call(D.klass);
|
|
11116
|
+
w !== null && _(w);
|
|
11116
11117
|
}), x && _(x), b;
|
|
11117
11118
|
}(p, d ? d.import : void 0), f);
|
|
11118
11119
|
return l !== void 0 && (g._pendingEditorState = l, g._dirtyType = sn), g;
|
|
@@ -11583,8 +11584,8 @@ function Gh(r) {
|
|
|
11583
11584
|
let b = x.getNode(), y = 0, _ = 0;
|
|
11584
11585
|
if (X(b) && u >= 0 && c >= 0 && (y = u, _ = u + c, m.setTextNodeRange(b, y, b, _)), y === _ && d === "" || (m.insertRawText(d), b = x.getNode()), X(b)) {
|
|
11585
11586
|
y = f, _ = f + p;
|
|
11586
|
-
const
|
|
11587
|
-
y = y >
|
|
11587
|
+
const D = b.getTextContentSize();
|
|
11588
|
+
y = y > D ? D : y, _ = _ > D ? D : _, m.setTextNodeRange(b, y, b, _);
|
|
11588
11589
|
}
|
|
11589
11590
|
n.stopImmediatePropagation();
|
|
11590
11591
|
}
|
|
@@ -11660,8 +11661,8 @@ function Sc(r, e, t, n, i = /* @__PURE__ */ new Map(), s) {
|
|
|
11660
11661
|
const { nodeName: x } = g, b = m._htmlConversions.get(x.toLowerCase());
|
|
11661
11662
|
let y = null;
|
|
11662
11663
|
if (b !== void 0) for (const _ of b) {
|
|
11663
|
-
const
|
|
11664
|
-
|
|
11664
|
+
const D = _(g);
|
|
11665
|
+
D !== null && (y === null || (y.priority || 0) <= (D.priority || 0)) && (y = D);
|
|
11665
11666
|
}
|
|
11666
11667
|
return y !== null ? y.conversion : null;
|
|
11667
11668
|
}(r, e), u = l ? l(r) : null;
|
|
@@ -12225,19 +12226,19 @@ function dp({ content: r }) {
|
|
|
12225
12226
|
return t ? typeof r == "function" ? r(n) : r : null;
|
|
12226
12227
|
}
|
|
12227
12228
|
const Ac = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? cn : Ee;
|
|
12228
|
-
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":
|
|
12229
|
-
const [v, S] = I(r.isEditable()), F = J((
|
|
12230
|
-
|
|
12231
|
-
}, [r]),
|
|
12229
|
+
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": D, ...E }, w) {
|
|
12230
|
+
const [v, S] = I(r.isEditable()), F = J((A) => {
|
|
12231
|
+
A && A.ownerDocument && A.ownerDocument.defaultView ? r.setRootElement(A) : r.setRootElement(null);
|
|
12232
|
+
}, [r]), T = ct(() => /* @__PURE__ */ function(...A) {
|
|
12232
12233
|
return (B) => {
|
|
12233
|
-
|
|
12234
|
-
typeof
|
|
12234
|
+
A.forEach((M) => {
|
|
12235
|
+
typeof M == "function" ? M(B) : M != null && (M.current = B);
|
|
12235
12236
|
});
|
|
12236
12237
|
};
|
|
12237
|
-
}(
|
|
12238
|
-
return Ac(() => (S(r.isEditable()), r.registerEditableListener((
|
|
12239
|
-
S(
|
|
12240
|
-
})), [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":
|
|
12238
|
+
}(w, F), [F, w]);
|
|
12239
|
+
return Ac(() => (S(r.isEditable()), r.registerEditableListener((A) => {
|
|
12240
|
+
S(A);
|
|
12241
|
+
})), [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": D, id: m, ref: T, role: v ? x : void 0, spellCheck: b, style: y, tabIndex: _, ...E });
|
|
12241
12242
|
}
|
|
12242
12243
|
const hp = ou(fp);
|
|
12243
12244
|
function Ea(r) {
|
|
@@ -12276,14 +12277,14 @@ function _p(r, e, t, n, i) {
|
|
|
12276
12277
|
if (i) return yp;
|
|
12277
12278
|
if (!(H(s) && H(o) && o.isCollapsed() && s.isCollapsed())) return zt;
|
|
12278
12279
|
const a = function(b, y, _) {
|
|
12279
|
-
const
|
|
12280
|
-
for (const
|
|
12281
|
-
const v =
|
|
12280
|
+
const D = b._nodeMap, E = [];
|
|
12281
|
+
for (const w of y) {
|
|
12282
|
+
const v = D.get(w);
|
|
12282
12283
|
v !== void 0 && E.push(v);
|
|
12283
12284
|
}
|
|
12284
|
-
for (const [
|
|
12285
|
+
for (const [w, v] of _) {
|
|
12285
12286
|
if (!v) continue;
|
|
12286
|
-
const S =
|
|
12287
|
+
const S = D.get(w);
|
|
12287
12288
|
S === void 0 || bt(S) || E.push(S);
|
|
12288
12289
|
}
|
|
12289
12290
|
return E;
|
|
@@ -12313,8 +12314,8 @@ function vp(r, e) {
|
|
|
12313
12314
|
if (i === null) return bo;
|
|
12314
12315
|
const m = s._selection;
|
|
12315
12316
|
return a.size > 0 || l.size > 0 ? g === !1 && d !== zt && d === n && c < t + e && p || a.size === 1 && function(x, b, y) {
|
|
12316
|
-
const _ = b._nodeMap.get(x),
|
|
12317
|
-
return !(H(E) && H(
|
|
12317
|
+
const _ = b._nodeMap.get(x), D = y._nodeMap.get(x), E = b._selection, w = y._selection;
|
|
12318
|
+
return !(H(E) && H(w) && E.anchor.type === "element" && E.focus.type === "element" && w.anchor.type === "text" && w.focus.type === "text" || !X(_) || !X(D) || _.__parent !== D.__parent) && JSON.stringify(b.read(() => _.exportJSON())) === JSON.stringify(y.read(() => D.exportJSON()));
|
|
12318
12319
|
}(Array.from(a)[0], i, s) ? _i : bo : m !== null ? _i : _o;
|
|
12319
12320
|
})();
|
|
12320
12321
|
return t = c, n = d, f;
|
|
@@ -13379,9 +13380,9 @@ var zr;
|
|
|
13379
13380
|
throw new RangeError("Invalid value");
|
|
13380
13381
|
let g, m;
|
|
13381
13382
|
for (g = c; ; g++) {
|
|
13382
|
-
const _ = Ne.getNumDataCodewords(g, u) * 8,
|
|
13383
|
-
if (
|
|
13384
|
-
m =
|
|
13383
|
+
const _ = Ne.getNumDataCodewords(g, u) * 8, D = o.getTotalBits(l, g);
|
|
13384
|
+
if (D <= _) {
|
|
13385
|
+
m = D;
|
|
13385
13386
|
break;
|
|
13386
13387
|
}
|
|
13387
13388
|
if (g >= d)
|
|
@@ -13392,8 +13393,8 @@ var zr;
|
|
|
13392
13393
|
let x = [];
|
|
13393
13394
|
for (const _ of l) {
|
|
13394
13395
|
t(_.mode.modeBits, 4, x), t(_.numChars, _.mode.numCharCountBits(g), x);
|
|
13395
|
-
for (const
|
|
13396
|
-
x.push(
|
|
13396
|
+
for (const D of _.getData())
|
|
13397
|
+
x.push(D);
|
|
13397
13398
|
}
|
|
13398
13399
|
i(x.length == m);
|
|
13399
13400
|
const b = Ne.getNumDataCodewords(g, u) * 8;
|
|
@@ -13403,7 +13404,7 @@ var zr;
|
|
|
13403
13404
|
let y = [];
|
|
13404
13405
|
for (; y.length * 8 < x.length; )
|
|
13405
13406
|
y.push(0);
|
|
13406
|
-
return x.forEach((_,
|
|
13407
|
+
return x.forEach((_, D) => y[D >>> 3] |= _ << 7 - (D & 7)), new Ne(g, u, y, f);
|
|
13407
13408
|
}
|
|
13408
13409
|
/*-- Accessor methods --*/
|
|
13409
13410
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
@@ -13494,16 +13495,16 @@ var zr;
|
|
|
13494
13495
|
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);
|
|
13495
13496
|
let x = [];
|
|
13496
13497
|
const b = Ne.reedSolomonComputeDivisor(f);
|
|
13497
|
-
for (let _ = 0,
|
|
13498
|
-
let E = l.slice(
|
|
13499
|
-
|
|
13500
|
-
const
|
|
13501
|
-
_ < g && E.push(0), x.push(E.concat(
|
|
13498
|
+
for (let _ = 0, D = 0; _ < d; _++) {
|
|
13499
|
+
let E = l.slice(D, D + m - f + (_ < g ? 0 : 1));
|
|
13500
|
+
D += E.length;
|
|
13501
|
+
const w = Ne.reedSolomonComputeRemainder(E, b);
|
|
13502
|
+
_ < g && E.push(0), x.push(E.concat(w));
|
|
13502
13503
|
}
|
|
13503
13504
|
let y = [];
|
|
13504
13505
|
for (let _ = 0; _ < x[0].length; _++)
|
|
13505
|
-
x.forEach((
|
|
13506
|
-
(_ != m - f || E >= g) && y.push(
|
|
13506
|
+
x.forEach((D, E) => {
|
|
13507
|
+
(_ != m - f || E >= g) && y.push(D[_]);
|
|
13507
13508
|
});
|
|
13508
13509
|
return i(y.length == p), y;
|
|
13509
13510
|
}
|
|
@@ -13978,12 +13979,12 @@ var eg = function() {
|
|
|
13978
13979
|
"boostLevel",
|
|
13979
13980
|
"marginSize",
|
|
13980
13981
|
"imageSettings"
|
|
13981
|
-
]), { style: x } = m, b = Do(m, ["style"]), y = p == null ? void 0 : p.src, _ = Le.useRef(null),
|
|
13982
|
-
(
|
|
13983
|
-
_.current =
|
|
13982
|
+
]), { style: x } = m, b = Do(m, ["style"]), y = p == null ? void 0 : p.src, _ = Le.useRef(null), D = Le.useRef(null), E = Le.useCallback(
|
|
13983
|
+
(C) => {
|
|
13984
|
+
_.current = C, typeof t == "function" ? t(C) : t && (t.current = C);
|
|
13984
13985
|
},
|
|
13985
13986
|
[t]
|
|
13986
|
-
), [
|
|
13987
|
+
), [w, v] = Le.useState(!1), { margin: S, cells: F, numCells: T, calculatedImageSettings: A } = Wc({
|
|
13987
13988
|
value: i,
|
|
13988
13989
|
level: o,
|
|
13989
13990
|
minVersion: c,
|
|
@@ -13995,36 +13996,36 @@ var eg = function() {
|
|
|
13995
13996
|
});
|
|
13996
13997
|
Le.useEffect(() => {
|
|
13997
13998
|
if (_.current != null) {
|
|
13998
|
-
const
|
|
13999
|
+
const C = _.current, N = C.getContext("2d");
|
|
13999
14000
|
if (!N)
|
|
14000
14001
|
return;
|
|
14001
|
-
let
|
|
14002
|
-
const O =
|
|
14003
|
-
V &&
|
|
14002
|
+
let R = F;
|
|
14003
|
+
const O = D.current, V = A != null && O !== null && O.complete && O.naturalHeight !== 0 && O.naturalWidth !== 0;
|
|
14004
|
+
V && A.excavation != null && (R = Uc(
|
|
14004
14005
|
F,
|
|
14005
|
-
|
|
14006
|
+
A.excavation
|
|
14006
14007
|
));
|
|
14007
14008
|
const U = window.devicePixelRatio || 1;
|
|
14008
|
-
|
|
14009
|
-
const re = s /
|
|
14010
|
-
N.scale(re, re), N.fillStyle = a, N.fillRect(0, 0,
|
|
14009
|
+
C.height = C.width = s * U;
|
|
14010
|
+
const re = s / T * U;
|
|
14011
|
+
N.scale(re, re), N.fillStyle = a, N.fillRect(0, 0, T, T), N.fillStyle = l, eg ? N.fill(new Path2D(qc(R, S))) : F.forEach(function(q, Z) {
|
|
14011
14012
|
q.forEach(function(W, se) {
|
|
14012
14013
|
W && N.fillRect(se + S, Z + S, 1, 1);
|
|
14013
14014
|
});
|
|
14014
|
-
}),
|
|
14015
|
+
}), A && (N.globalAlpha = A.opacity), V && N.drawImage(
|
|
14015
14016
|
O,
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14017
|
+
A.x + S,
|
|
14018
|
+
A.y + S,
|
|
14019
|
+
A.w,
|
|
14020
|
+
A.h
|
|
14020
14021
|
);
|
|
14021
14022
|
}
|
|
14022
14023
|
}), Le.useEffect(() => {
|
|
14023
14024
|
v(!1);
|
|
14024
14025
|
}, [y]);
|
|
14025
14026
|
const B = Co({ height: s, width: s }, x);
|
|
14026
|
-
let
|
|
14027
|
-
return y != null && (
|
|
14027
|
+
let M = null;
|
|
14028
|
+
return y != null && (M = /* @__PURE__ */ Le.createElement(
|
|
14028
14029
|
"img",
|
|
14029
14030
|
{
|
|
14030
14031
|
src: y,
|
|
@@ -14033,8 +14034,8 @@ var eg = function() {
|
|
|
14033
14034
|
onLoad: () => {
|
|
14034
14035
|
v(!0);
|
|
14035
14036
|
},
|
|
14036
|
-
ref:
|
|
14037
|
-
crossOrigin:
|
|
14037
|
+
ref: D,
|
|
14038
|
+
crossOrigin: A == null ? void 0 : A.crossOrigin
|
|
14038
14039
|
}
|
|
14039
14040
|
)), /* @__PURE__ */ Le.createElement(Le.Fragment, null, /* @__PURE__ */ Le.createElement(
|
|
14040
14041
|
"canvas",
|
|
@@ -14045,7 +14046,7 @@ var eg = function() {
|
|
|
14045
14046
|
ref: E,
|
|
14046
14047
|
role: "img"
|
|
14047
14048
|
}, b)
|
|
14048
|
-
),
|
|
14049
|
+
), M);
|
|
14049
14050
|
}
|
|
14050
14051
|
);
|
|
14051
14052
|
tg.displayName = "QRCodeCanvas";
|
|
@@ -14085,8 +14086,8 @@ var Hc = Le.forwardRef(
|
|
|
14085
14086
|
imageSettings: g,
|
|
14086
14087
|
size: s
|
|
14087
14088
|
});
|
|
14088
|
-
let
|
|
14089
|
-
g != null && _ != null && (_.excavation != null && (
|
|
14089
|
+
let D = b, E = null;
|
|
14090
|
+
g != null && _ != null && (_.excavation != null && (D = Uc(
|
|
14090
14091
|
b,
|
|
14091
14092
|
_.excavation
|
|
14092
14093
|
)), E = /* @__PURE__ */ Le.createElement(
|
|
@@ -14102,7 +14103,7 @@ var Hc = Le.forwardRef(
|
|
|
14102
14103
|
crossOrigin: _.crossOrigin
|
|
14103
14104
|
}
|
|
14104
14105
|
));
|
|
14105
|
-
const
|
|
14106
|
+
const w = qc(D, x);
|
|
14106
14107
|
return /* @__PURE__ */ Le.createElement(
|
|
14107
14108
|
"svg",
|
|
14108
14109
|
Co({
|
|
@@ -14121,7 +14122,7 @@ var Hc = Le.forwardRef(
|
|
|
14121
14122
|
shapeRendering: "crispEdges"
|
|
14122
14123
|
}
|
|
14123
14124
|
),
|
|
14124
|
-
/* @__PURE__ */ Le.createElement("path", { fill: l, d:
|
|
14125
|
+
/* @__PURE__ */ Le.createElement("path", { fill: l, d: w, shapeRendering: "crispEdges" }),
|
|
14125
14126
|
E
|
|
14126
14127
|
);
|
|
14127
14128
|
}
|
|
@@ -14248,7 +14249,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14248
14249
|
const v = le();
|
|
14249
14250
|
H(v) && Oh(v, () => al());
|
|
14250
14251
|
});
|
|
14251
|
-
}, [u]),
|
|
14252
|
+
}, [u]), D = {
|
|
14252
14253
|
display: "flex",
|
|
14253
14254
|
alignItems: "center",
|
|
14254
14255
|
justifyContent: "center",
|
|
@@ -14266,7 +14267,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14266
14267
|
.mail-editor-toolbar-btn:hover:not(:disabled) {
|
|
14267
14268
|
background: ${r.border};
|
|
14268
14269
|
}
|
|
14269
|
-
`,
|
|
14270
|
+
`, w = () => {
|
|
14270
14271
|
setTimeout(() => {
|
|
14271
14272
|
var v;
|
|
14272
14273
|
(v = f.current) != null && v.contains(document.activeElement) || d(!1);
|
|
@@ -14293,7 +14294,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14293
14294
|
className: "mail-editor-toolbar-btn",
|
|
14294
14295
|
onClick: g,
|
|
14295
14296
|
disabled: e,
|
|
14296
|
-
style:
|
|
14297
|
+
style: D,
|
|
14297
14298
|
title: "Bold (Ctrl+B)",
|
|
14298
14299
|
children: "B"
|
|
14299
14300
|
}
|
|
@@ -14305,7 +14306,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14305
14306
|
className: "mail-editor-toolbar-btn",
|
|
14306
14307
|
onClick: m,
|
|
14307
14308
|
disabled: e,
|
|
14308
|
-
style: { ...
|
|
14309
|
+
style: { ...D, fontStyle: "italic" },
|
|
14309
14310
|
title: "Italic (Ctrl+I)",
|
|
14310
14311
|
children: "I"
|
|
14311
14312
|
}
|
|
@@ -14317,7 +14318,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14317
14318
|
className: "mail-editor-toolbar-btn",
|
|
14318
14319
|
onClick: x,
|
|
14319
14320
|
disabled: e,
|
|
14320
|
-
style: { ...
|
|
14321
|
+
style: { ...D, textDecoration: "underline" },
|
|
14321
14322
|
title: "Underline (Ctrl+U)",
|
|
14322
14323
|
children: "U"
|
|
14323
14324
|
}
|
|
@@ -14340,7 +14341,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14340
14341
|
className: "mail-editor-toolbar-btn",
|
|
14341
14342
|
onClick: b,
|
|
14342
14343
|
disabled: e,
|
|
14343
|
-
style:
|
|
14344
|
+
style: D,
|
|
14344
14345
|
title: "Bullet List",
|
|
14345
14346
|
children: /* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
14346
14347
|
/* @__PURE__ */ h.jsx("circle", { cx: "4", cy: "6", r: "2" }),
|
|
@@ -14359,7 +14360,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14359
14360
|
className: "mail-editor-toolbar-btn",
|
|
14360
14361
|
onClick: y,
|
|
14361
14362
|
disabled: e,
|
|
14362
|
-
style:
|
|
14363
|
+
style: D,
|
|
14363
14364
|
title: "Numbered List",
|
|
14364
14365
|
children: /* @__PURE__ */ h.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
14365
14366
|
/* @__PURE__ */ h.jsx("text", { x: "2", y: "8", fontSize: "8", fontFamily: "sans-serif", children: "1" }),
|
|
@@ -14389,7 +14390,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14389
14390
|
className: "mail-editor-toolbar-btn",
|
|
14390
14391
|
onClick: _,
|
|
14391
14392
|
disabled: e,
|
|
14392
|
-
style:
|
|
14393
|
+
style: D,
|
|
14393
14394
|
title: "Quote",
|
|
14394
14395
|
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" }) })
|
|
14395
14396
|
}
|
|
@@ -14402,7 +14403,7 @@ function og({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
14402
14403
|
type: "button",
|
|
14403
14404
|
onClick: () => d(!c),
|
|
14404
14405
|
disabled: s || !l || e,
|
|
14405
|
-
onBlur:
|
|
14406
|
+
onBlur: w,
|
|
14406
14407
|
style: {
|
|
14407
14408
|
display: "flex",
|
|
14408
14409
|
alignItems: "center",
|
|
@@ -14660,29 +14661,29 @@ function cg({
|
|
|
14660
14661
|
aiProcessingAction: m,
|
|
14661
14662
|
renderAboveToolbar: x
|
|
14662
14663
|
}) {
|
|
14663
|
-
const b = { ...ig, ...i }, [y, _] = Le.useState(!1),
|
|
14664
|
+
const b = { ...ig, ...i }, [y, _] = Le.useState(!1), D = Le.useRef(void 0), [E, w] = Le.useState(r), [v, S] = Le.useState(!1), [F, T] = Le.useState(null), A = g ?? v, B = m ?? F;
|
|
14664
14665
|
Le.useEffect(() => {
|
|
14665
|
-
l !== void 0 && l !==
|
|
14666
|
+
l !== void 0 && l !== D.current && (D.current = l, _(!0));
|
|
14666
14667
|
}, [l]);
|
|
14667
|
-
const
|
|
14668
|
+
const M = J(() => {
|
|
14668
14669
|
_(!1);
|
|
14669
|
-
}, []),
|
|
14670
|
-
`).map((Z) => `<p>${Z || "<br>"}</p>`).join(""),
|
|
14671
|
-
const Z =
|
|
14670
|
+
}, []), C = (q) => q.replace(/<[^>]*>/g, "").trim(), N = (q) => q.split(`
|
|
14671
|
+
`).map((Z) => `<p>${Z || "<br>"}</p>`).join(""), R = async (q) => {
|
|
14672
|
+
const Z = C(E);
|
|
14672
14673
|
if (!Z) return;
|
|
14673
14674
|
const W = q === "restructure" ? d : q === "proofread" ? f : p;
|
|
14674
14675
|
if (W) {
|
|
14675
|
-
S(!0),
|
|
14676
|
+
S(!0), T(q);
|
|
14676
14677
|
try {
|
|
14677
14678
|
const se = await W(Z), ce = N(se);
|
|
14678
|
-
|
|
14679
|
+
w(ce), e == null || e(ce), D.current = Date.now(), _(!0);
|
|
14679
14680
|
} catch (se) {
|
|
14680
14681
|
console.error(`AI ${q} failed:`, se);
|
|
14681
14682
|
} finally {
|
|
14682
|
-
S(!1),
|
|
14683
|
+
S(!1), T(null);
|
|
14683
14684
|
}
|
|
14684
14685
|
}
|
|
14685
|
-
}, O =
|
|
14686
|
+
}, O = C(E).length > 0, V = {
|
|
14686
14687
|
namespace: "MailEditor",
|
|
14687
14688
|
theme: sg,
|
|
14688
14689
|
onError: (q) => {
|
|
@@ -14694,7 +14695,7 @@ function cg({
|
|
|
14694
14695
|
(q, Z) => {
|
|
14695
14696
|
q.read(() => {
|
|
14696
14697
|
const W = Cc(Z, null);
|
|
14697
|
-
|
|
14698
|
+
w(W), e == null || e(W);
|
|
14698
14699
|
});
|
|
14699
14700
|
},
|
|
14700
14701
|
[e]
|
|
@@ -14795,9 +14796,9 @@ function cg({
|
|
|
14795
14796
|
onAiRestructure: d,
|
|
14796
14797
|
onAiProofread: f,
|
|
14797
14798
|
onAiRewrite: p,
|
|
14798
|
-
aiProcessing:
|
|
14799
|
+
aiProcessing: A,
|
|
14799
14800
|
aiProcessingAction: B,
|
|
14800
|
-
onAiAction:
|
|
14801
|
+
onAiAction: R,
|
|
14801
14802
|
hasContent: O
|
|
14802
14803
|
}
|
|
14803
14804
|
),
|
|
@@ -14832,7 +14833,7 @@ function cg({
|
|
|
14832
14833
|
{
|
|
14833
14834
|
html: y ? E : r,
|
|
14834
14835
|
isExternalUpdate: y,
|
|
14835
|
-
onImportComplete:
|
|
14836
|
+
onImportComplete: M
|
|
14836
14837
|
}
|
|
14837
14838
|
),
|
|
14838
14839
|
/* @__PURE__ */ h.jsx(
|
|
@@ -14888,15 +14889,15 @@ function My({
|
|
|
14888
14889
|
hideCancelButton: b = !1,
|
|
14889
14890
|
onAiRestructure: y,
|
|
14890
14891
|
onAiProofread: _,
|
|
14891
|
-
onAiRewrite:
|
|
14892
|
+
onAiRewrite: D,
|
|
14892
14893
|
renderAboveToolbar: E
|
|
14893
14894
|
}) {
|
|
14894
|
-
const
|
|
14895
|
+
const w = { ...dg, ...c }, [v, S] = I(r), [F, T] = I(""), [A, B] = I(""), [M, C] = I(e), [N, R] = I(t), [O, V] = I([]), [U, re] = I(!1), [q, Z] = I(""), [W, se] = I(f), [ce, fe] = I(!1), ge = Le.useRef(void 0);
|
|
14895
14896
|
Le.useEffect(() => {
|
|
14896
|
-
a !== void 0 && a !== ge.current && (ge.current = a,
|
|
14897
|
+
a !== void 0 && a !== ge.current && (ge.current = a, R(t), fe(!0));
|
|
14897
14898
|
}, [a, t]);
|
|
14898
14899
|
const Be = (z) => {
|
|
14899
|
-
|
|
14900
|
+
R(z), fe(!1), o == null || o(z);
|
|
14900
14901
|
}, _e = be(null), [ee, Se] = I(!1), ie = (z) => {
|
|
14901
14902
|
const ae = z.target.files;
|
|
14902
14903
|
if (ae) {
|
|
@@ -14921,7 +14922,7 @@ function My({
|
|
|
14921
14922
|
Z("Recipient email is required");
|
|
14922
14923
|
return;
|
|
14923
14924
|
}
|
|
14924
|
-
if (!
|
|
14925
|
+
if (!M.trim()) {
|
|
14925
14926
|
Z("Subject is required");
|
|
14926
14927
|
return;
|
|
14927
14928
|
}
|
|
@@ -14942,8 +14943,8 @@ function My({
|
|
|
14942
14943
|
), ae = N.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), me = {
|
|
14943
14944
|
to: v.trim(),
|
|
14944
14945
|
cc: F.trim() || void 0,
|
|
14945
|
-
bcc:
|
|
14946
|
-
subject:
|
|
14946
|
+
bcc: A.trim() || void 0,
|
|
14947
|
+
subject: M.trim(),
|
|
14947
14948
|
html: ae,
|
|
14948
14949
|
attachments: z,
|
|
14949
14950
|
inReplyTo: n == null ? void 0 : n.messageId
|
|
@@ -14951,7 +14952,7 @@ function My({
|
|
|
14951
14952
|
console.log("[MailComposer] Sending email - to:", me.to, "subject:", me.subject, "attachmentsCount:", me.attachments.length), me.attachments.length > 0 && me.attachments.forEach((xe, Ge) => {
|
|
14952
14953
|
var vt;
|
|
14953
14954
|
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);
|
|
14954
|
-
}), await i(me), S(""),
|
|
14955
|
+
}), await i(me), S(""), T(""), B(""), C(""), R(""), V([]);
|
|
14955
14956
|
} catch (z) {
|
|
14956
14957
|
Z(z instanceof Error ? z.message : "Failed to send email");
|
|
14957
14958
|
} finally {
|
|
@@ -14961,16 +14962,16 @@ function My({
|
|
|
14961
14962
|
width: "100%",
|
|
14962
14963
|
padding: "8px 12px",
|
|
14963
14964
|
fontSize: "14px",
|
|
14964
|
-
border: `1px solid ${
|
|
14965
|
+
border: `1px solid ${w.inputBorder}`,
|
|
14965
14966
|
borderRadius: "6px",
|
|
14966
|
-
background:
|
|
14967
|
-
color:
|
|
14967
|
+
background: w.inputBackground,
|
|
14968
|
+
color: w.text,
|
|
14968
14969
|
outline: "none"
|
|
14969
14970
|
}, ye = {
|
|
14970
14971
|
display: "block",
|
|
14971
14972
|
fontSize: "12px",
|
|
14972
14973
|
fontWeight: 500,
|
|
14973
|
-
color:
|
|
14974
|
+
color: w.textSecondary,
|
|
14974
14975
|
marginBottom: "4px",
|
|
14975
14976
|
textTransform: "uppercase"
|
|
14976
14977
|
}, Ke = (z, ae = !1) => ({
|
|
@@ -14981,8 +14982,8 @@ function My({
|
|
|
14981
14982
|
borderRadius: "6px",
|
|
14982
14983
|
cursor: ae ? "not-allowed" : "pointer",
|
|
14983
14984
|
opacity: ae ? 0.6 : 1,
|
|
14984
|
-
background: z ?
|
|
14985
|
-
color: z ? "#ffffff" :
|
|
14985
|
+
background: z ? w.buttonPrimary : w.buttonSecondary,
|
|
14986
|
+
color: z ? "#ffffff" : w.text,
|
|
14986
14987
|
display: "flex",
|
|
14987
14988
|
alignItems: "center",
|
|
14988
14989
|
gap: "8px"
|
|
@@ -14996,7 +14997,7 @@ function My({
|
|
|
14996
14997
|
flexDirection: "column",
|
|
14997
14998
|
gap: "16px",
|
|
14998
14999
|
padding: "16px",
|
|
14999
|
-
background:
|
|
15000
|
+
background: w.background
|
|
15000
15001
|
},
|
|
15001
15002
|
children: [
|
|
15002
15003
|
q && /* @__PURE__ */ h.jsx(
|
|
@@ -15038,7 +15039,7 @@ function My({
|
|
|
15038
15039
|
border: "none",
|
|
15039
15040
|
padding: 0,
|
|
15040
15041
|
fontSize: "12px",
|
|
15041
|
-
color:
|
|
15042
|
+
color: w.primary,
|
|
15042
15043
|
cursor: "pointer",
|
|
15043
15044
|
textAlign: "left"
|
|
15044
15045
|
},
|
|
@@ -15053,7 +15054,7 @@ function My({
|
|
|
15053
15054
|
{
|
|
15054
15055
|
type: "email",
|
|
15055
15056
|
value: F,
|
|
15056
|
-
onChange: (z) =>
|
|
15057
|
+
onChange: (z) => T(z.target.value),
|
|
15057
15058
|
placeholder: "cc@example.com",
|
|
15058
15059
|
disabled: d || U,
|
|
15059
15060
|
style: L
|
|
@@ -15066,7 +15067,7 @@ function My({
|
|
|
15066
15067
|
"input",
|
|
15067
15068
|
{
|
|
15068
15069
|
type: "email",
|
|
15069
|
-
value:
|
|
15070
|
+
value: A,
|
|
15070
15071
|
onChange: (z) => B(z.target.value),
|
|
15071
15072
|
placeholder: "bcc@example.com",
|
|
15072
15073
|
disabled: d || U,
|
|
@@ -15081,8 +15082,8 @@ function My({
|
|
|
15081
15082
|
"input",
|
|
15082
15083
|
{
|
|
15083
15084
|
type: "text",
|
|
15084
|
-
value:
|
|
15085
|
-
onChange: (z) =>
|
|
15085
|
+
value: M,
|
|
15086
|
+
onChange: (z) => C(z.target.value),
|
|
15086
15087
|
placeholder: "Email subject",
|
|
15087
15088
|
disabled: d || U,
|
|
15088
15089
|
style: L
|
|
@@ -15096,7 +15097,7 @@ function My({
|
|
|
15096
15097
|
onChange: Be,
|
|
15097
15098
|
placeholder: p,
|
|
15098
15099
|
replyTo: n,
|
|
15099
|
-
theme:
|
|
15100
|
+
theme: w,
|
|
15100
15101
|
disabled: d || U,
|
|
15101
15102
|
minHeight: m,
|
|
15102
15103
|
externalUpdate: ce ? a : void 0,
|
|
@@ -15104,7 +15105,7 @@ function My({
|
|
|
15104
15105
|
insertTextTrigger: u,
|
|
15105
15106
|
onAiRestructure: y,
|
|
15106
15107
|
onAiProofread: _,
|
|
15107
|
-
onAiRewrite:
|
|
15108
|
+
onAiRewrite: D,
|
|
15108
15109
|
renderAboveToolbar: E
|
|
15109
15110
|
}
|
|
15110
15111
|
) }) }),
|
|
@@ -15133,10 +15134,10 @@ function My({
|
|
|
15133
15134
|
style: {
|
|
15134
15135
|
width: "100%",
|
|
15135
15136
|
padding: "24px 16px",
|
|
15136
|
-
border: `2px dashed ${ee ?
|
|
15137
|
+
border: `2px dashed ${ee ? w.primary : w.border}`,
|
|
15137
15138
|
borderRadius: "8px",
|
|
15138
|
-
background: ee ? `${
|
|
15139
|
-
color: ee ?
|
|
15139
|
+
background: ee ? `${w.primary}10` : "transparent",
|
|
15140
|
+
color: ee ? w.primary : w.textSecondary,
|
|
15140
15141
|
cursor: d || U ? "not-allowed" : "pointer",
|
|
15141
15142
|
display: "flex",
|
|
15142
15143
|
flexDirection: "column",
|
|
@@ -15160,14 +15161,14 @@ function My({
|
|
|
15160
15161
|
alignItems: "center",
|
|
15161
15162
|
gap: "8px",
|
|
15162
15163
|
padding: "8px 12px",
|
|
15163
|
-
background:
|
|
15164
|
+
background: w.attachmentBackground,
|
|
15164
15165
|
borderRadius: "8px"
|
|
15165
15166
|
},
|
|
15166
15167
|
children: [
|
|
15167
|
-
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
15168
|
+
/* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: w.textSecondary }, children: qe(z) }),
|
|
15168
15169
|
/* @__PURE__ */ h.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
15169
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color:
|
|
15170
|
-
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "12px", color:
|
|
15170
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: w.text, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: z.name }),
|
|
15171
|
+
/* @__PURE__ */ h.jsx("div", { style: { fontSize: "12px", color: w.textSecondary }, children: He(z.size) })
|
|
15171
15172
|
] }),
|
|
15172
15173
|
/* @__PURE__ */ h.jsx(
|
|
15173
15174
|
"button",
|
|
@@ -15180,7 +15181,7 @@ function My({
|
|
|
15180
15181
|
border: "none",
|
|
15181
15182
|
padding: "4px",
|
|
15182
15183
|
cursor: "pointer",
|
|
15183
|
-
color:
|
|
15184
|
+
color: w.textSecondary,
|
|
15184
15185
|
display: "flex",
|
|
15185
15186
|
borderRadius: "4px"
|
|
15186
15187
|
},
|
|
@@ -15208,8 +15209,8 @@ function My({
|
|
|
15208
15209
|
{
|
|
15209
15210
|
type: "button",
|
|
15210
15211
|
onClick: Y,
|
|
15211
|
-
disabled: d || U || !v.trim() || !
|
|
15212
|
-
style: Ke(!0, d || U || !v.trim() || !
|
|
15212
|
+
disabled: d || U || !v.trim() || !M.trim(),
|
|
15213
|
+
style: Ke(!0, d || U || !v.trim() || !M.trim()),
|
|
15213
15214
|
children: [
|
|
15214
15215
|
/* @__PURE__ */ h.jsx(
|
|
15215
15216
|
"span",
|
|
@@ -15264,31 +15265,31 @@ function Ry({
|
|
|
15264
15265
|
}) {
|
|
15265
15266
|
const p = { ...fg, ...d }, [g, m] = I(!1), [x, b] = I(""), y = be(null), _ = be(null);
|
|
15266
15267
|
Ee(() => {
|
|
15267
|
-
function
|
|
15268
|
+
function A(B) {
|
|
15268
15269
|
y.current && !y.current.contains(B.target) && (m(!1), b(""));
|
|
15269
15270
|
}
|
|
15270
|
-
return document.addEventListener("mousedown",
|
|
15271
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
15271
15272
|
}, []);
|
|
15272
|
-
const
|
|
15273
|
-
(
|
|
15273
|
+
const D = r.filter(
|
|
15274
|
+
(A) => {
|
|
15274
15275
|
var B;
|
|
15275
|
-
return ((B =
|
|
15276
|
+
return ((B = A.label) == null ? void 0 : B.toLowerCase().includes(x.toLowerCase())) && !e.includes(A.id);
|
|
15276
15277
|
}
|
|
15277
|
-
), E = i && x.trim() && !r.some((
|
|
15278
|
+
), E = i && x.trim() && !r.some((A) => {
|
|
15278
15279
|
var B;
|
|
15279
|
-
return ((B =
|
|
15280
|
-
}),
|
|
15280
|
+
return ((B = A.label) == null ? void 0 : B.toLowerCase()) === x.toLowerCase();
|
|
15281
|
+
}), w = e.map((A) => r.find((B) => B.id === A)).filter(Boolean), v = J((A) => {
|
|
15281
15282
|
var B;
|
|
15282
|
-
c > 0 && e.length >= c || (t([...e,
|
|
15283
|
-
}, [e, t, c]), S = J((
|
|
15284
|
-
t(e.filter((B) => B !==
|
|
15283
|
+
c > 0 && e.length >= c || (t([...e, A]), b(""), c === 1 ? m(!1) : (B = _.current) == null || B.focus());
|
|
15284
|
+
}, [e, t, c]), S = J((A) => {
|
|
15285
|
+
t(e.filter((B) => B !== A));
|
|
15285
15286
|
}, [e, t]), F = J(async () => {
|
|
15286
15287
|
if (!E) return;
|
|
15287
|
-
const
|
|
15288
|
-
|
|
15289
|
-
}, [E, x, s, v]),
|
|
15290
|
-
|
|
15291
|
-
}, [E,
|
|
15288
|
+
const A = await (s == null ? void 0 : s(x.trim()));
|
|
15289
|
+
A && v(A.id), b("");
|
|
15290
|
+
}, [E, x, s, v]), T = J((A) => {
|
|
15291
|
+
A.key === "Enter" ? (A.preventDefault(), E ? F() : D.length > 0 && v(D[0].id)) : A.key === "Backspace" && !x && e.length > 0 ? S(e[e.length - 1]) : A.key === "Escape" && (m(!1), b(""));
|
|
15292
|
+
}, [E, D, x, e, F, v, S]);
|
|
15292
15293
|
return /* @__PURE__ */ h.jsxs("div", { ref: y, className: f, style: { position: "relative" }, children: [
|
|
15293
15294
|
l && /* @__PURE__ */ h.jsx(
|
|
15294
15295
|
"label",
|
|
@@ -15320,7 +15321,7 @@ function Ry({
|
|
|
15320
15321
|
alignItems: "center"
|
|
15321
15322
|
},
|
|
15322
15323
|
children: [
|
|
15323
|
-
|
|
15324
|
+
w.map((A) => /* @__PURE__ */ h.jsxs(
|
|
15324
15325
|
"span",
|
|
15325
15326
|
{
|
|
15326
15327
|
style: {
|
|
@@ -15330,17 +15331,17 @@ function Ry({
|
|
|
15330
15331
|
padding: "2px 8px",
|
|
15331
15332
|
borderRadius: "4px",
|
|
15332
15333
|
fontSize: "13px",
|
|
15333
|
-
background:
|
|
15334
|
-
color:
|
|
15334
|
+
background: A.color || p.chipBackground,
|
|
15335
|
+
color: A.color ? "#fff" : p.chipText
|
|
15335
15336
|
},
|
|
15336
15337
|
children: [
|
|
15337
|
-
|
|
15338
|
+
A.label,
|
|
15338
15339
|
!u && /* @__PURE__ */ h.jsx(
|
|
15339
15340
|
"button",
|
|
15340
15341
|
{
|
|
15341
15342
|
type: "button",
|
|
15342
15343
|
onClick: (B) => {
|
|
15343
|
-
B.stopPropagation(), S(
|
|
15344
|
+
B.stopPropagation(), S(A.id);
|
|
15344
15345
|
},
|
|
15345
15346
|
style: {
|
|
15346
15347
|
border: "none",
|
|
@@ -15356,7 +15357,7 @@ function Ry({
|
|
|
15356
15357
|
)
|
|
15357
15358
|
]
|
|
15358
15359
|
},
|
|
15359
|
-
|
|
15360
|
+
A.id
|
|
15360
15361
|
)),
|
|
15361
15362
|
/* @__PURE__ */ h.jsx(
|
|
15362
15363
|
"input",
|
|
@@ -15364,12 +15365,12 @@ function Ry({
|
|
|
15364
15365
|
ref: _,
|
|
15365
15366
|
type: "text",
|
|
15366
15367
|
value: x,
|
|
15367
|
-
onChange: (
|
|
15368
|
-
b(
|
|
15368
|
+
onChange: (A) => {
|
|
15369
|
+
b(A.target.value), g || m(!0);
|
|
15369
15370
|
},
|
|
15370
15371
|
onFocus: () => m(!0),
|
|
15371
|
-
onKeyDown:
|
|
15372
|
-
placeholder:
|
|
15372
|
+
onKeyDown: T,
|
|
15373
|
+
placeholder: w.length === 0 ? n : "",
|
|
15373
15374
|
disabled: u || c > 0 && e.length >= c,
|
|
15374
15375
|
style: {
|
|
15375
15376
|
flex: 1,
|
|
@@ -15402,7 +15403,7 @@ function Ry({
|
|
|
15402
15403
|
overflowY: "auto",
|
|
15403
15404
|
zIndex: 50
|
|
15404
15405
|
},
|
|
15405
|
-
children:
|
|
15406
|
+
children: D.length === 0 && !E ? /* @__PURE__ */ h.jsx(
|
|
15406
15407
|
"div",
|
|
15407
15408
|
{
|
|
15408
15409
|
style: {
|
|
@@ -15414,10 +15415,10 @@ function Ry({
|
|
|
15414
15415
|
children: x ? "No matches" : "No options available"
|
|
15415
15416
|
}
|
|
15416
15417
|
) : /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
15417
|
-
|
|
15418
|
+
D.map((A) => /* @__PURE__ */ h.jsxs(
|
|
15418
15419
|
"div",
|
|
15419
15420
|
{
|
|
15420
|
-
onClick: () => v(
|
|
15421
|
+
onClick: () => v(A.id),
|
|
15421
15422
|
style: {
|
|
15422
15423
|
padding: "10px 12px",
|
|
15423
15424
|
fontSize: "14px",
|
|
@@ -15434,13 +15435,13 @@ function Ry({
|
|
|
15434
15435
|
B.currentTarget.style.background = "";
|
|
15435
15436
|
},
|
|
15436
15437
|
children: [
|
|
15437
|
-
|
|
15438
|
+
A.label,
|
|
15438
15439
|
o && a && /* @__PURE__ */ h.jsx(
|
|
15439
15440
|
"button",
|
|
15440
15441
|
{
|
|
15441
15442
|
type: "button",
|
|
15442
15443
|
onClick: (B) => {
|
|
15443
|
-
B.stopPropagation(), a(
|
|
15444
|
+
B.stopPropagation(), a(A.id);
|
|
15444
15445
|
},
|
|
15445
15446
|
style: {
|
|
15446
15447
|
border: "none",
|
|
@@ -15462,7 +15463,7 @@ function Ry({
|
|
|
15462
15463
|
)
|
|
15463
15464
|
]
|
|
15464
15465
|
},
|
|
15465
|
-
|
|
15466
|
+
A.id
|
|
15466
15467
|
)),
|
|
15467
15468
|
E && /* @__PURE__ */ h.jsxs(
|
|
15468
15469
|
"div",
|
|
@@ -15473,13 +15474,13 @@ function Ry({
|
|
|
15473
15474
|
fontSize: "14px",
|
|
15474
15475
|
cursor: "pointer",
|
|
15475
15476
|
color: p.primary,
|
|
15476
|
-
borderTop:
|
|
15477
|
+
borderTop: D.length > 0 ? `1px solid ${p.border}` : "none"
|
|
15477
15478
|
},
|
|
15478
|
-
onMouseEnter: (
|
|
15479
|
-
|
|
15479
|
+
onMouseEnter: (A) => {
|
|
15480
|
+
A.currentTarget.style.background = p.hoverBackground || "";
|
|
15480
15481
|
},
|
|
15481
|
-
onMouseLeave: (
|
|
15482
|
-
|
|
15482
|
+
onMouseLeave: (A) => {
|
|
15483
|
+
A.currentTarget.style.background = "";
|
|
15483
15484
|
},
|
|
15484
15485
|
children: [
|
|
15485
15486
|
'+ Create "',
|
|
@@ -15519,8 +15520,8 @@ function jy({
|
|
|
15519
15520
|
const S = d.toLowerCase();
|
|
15520
15521
|
return r.filter(
|
|
15521
15522
|
(F) => {
|
|
15522
|
-
var
|
|
15523
|
-
return ((
|
|
15523
|
+
var T, A;
|
|
15524
|
+
return ((T = F.label) == null ? void 0 : T.toLowerCase().includes(S)) || ((A = F.notes) == null ? void 0 : A.toLowerCase().includes(S));
|
|
15524
15525
|
}
|
|
15525
15526
|
);
|
|
15526
15527
|
}, [r, d]);
|
|
@@ -15532,11 +15533,11 @@ function jy({
|
|
|
15532
15533
|
}, []);
|
|
15533
15534
|
const _ = (S) => {
|
|
15534
15535
|
i && i(S), g(!1), f("");
|
|
15535
|
-
},
|
|
15536
|
+
}, D = () => {
|
|
15536
15537
|
o && o(d.trim() || void 0), g(!1), f("");
|
|
15537
15538
|
}, E = () => {
|
|
15538
15539
|
g(!0);
|
|
15539
|
-
},
|
|
15540
|
+
}, w = (S) => {
|
|
15540
15541
|
f(S.target.value), p || g(!0);
|
|
15541
15542
|
}, v = (S) => {
|
|
15542
15543
|
S.key === "Enter" ? (S.preventDefault(), y.length > 0 && i ? (i(y[0]), g(!1), f("")) : o && d.trim() && (o(d.trim()), g(!1), f(""))) : S.key === "Escape" && (g(!1), f(""));
|
|
@@ -15625,7 +15626,7 @@ function jy({
|
|
|
15625
15626
|
ref: x,
|
|
15626
15627
|
type: "text",
|
|
15627
15628
|
value: d,
|
|
15628
|
-
onChange:
|
|
15629
|
+
onChange: w,
|
|
15629
15630
|
onFocus: E,
|
|
15630
15631
|
onKeyDown: v,
|
|
15631
15632
|
placeholder: n,
|
|
@@ -15648,7 +15649,7 @@ function jy({
|
|
|
15648
15649
|
o && /* @__PURE__ */ h.jsx(
|
|
15649
15650
|
"button",
|
|
15650
15651
|
{
|
|
15651
|
-
onClick:
|
|
15652
|
+
onClick: D,
|
|
15652
15653
|
style: {
|
|
15653
15654
|
width: "36px",
|
|
15654
15655
|
height: "36px",
|
|
@@ -15705,11 +15706,11 @@ function jy({
|
|
|
15705
15706
|
background: c.cardBackground,
|
|
15706
15707
|
transition: "background 0.15s"
|
|
15707
15708
|
},
|
|
15708
|
-
onMouseEnter: (
|
|
15709
|
-
|
|
15709
|
+
onMouseEnter: (T) => {
|
|
15710
|
+
T.currentTarget.style.background = c.cardHover || "#f3f4f6";
|
|
15710
15711
|
},
|
|
15711
|
-
onMouseLeave: (
|
|
15712
|
-
|
|
15712
|
+
onMouseLeave: (T) => {
|
|
15713
|
+
T.currentTarget.style.background = c.cardBackground || "#f9fafb";
|
|
15713
15714
|
},
|
|
15714
15715
|
children: [
|
|
15715
15716
|
/* @__PURE__ */ h.jsx("div", { style: {
|
|
@@ -15749,28 +15750,28 @@ function Ly({
|
|
|
15749
15750
|
columnClassName: f = "",
|
|
15750
15751
|
itemClassName: p = ""
|
|
15751
15752
|
}) {
|
|
15752
|
-
const [g, m] = I(null), [x, b] = I(null), [y, _] = I(null),
|
|
15753
|
-
let
|
|
15754
|
-
return i && (
|
|
15755
|
-
}, {}),
|
|
15756
|
-
const
|
|
15757
|
-
m(
|
|
15758
|
-
const
|
|
15759
|
-
|
|
15753
|
+
const [g, m] = I(null), [x, b] = I(null), [y, _] = I(null), D = be(null), E = e.reduce((B, M) => {
|
|
15754
|
+
let C = r.filter((N) => n(N) === M.id);
|
|
15755
|
+
return i && (C = C.sort((N, R) => i(N) - i(R))), B[M.id] = C, B;
|
|
15756
|
+
}, {}), w = J((B, M) => {
|
|
15757
|
+
const C = t(M), N = n(M);
|
|
15758
|
+
m(C), D.current = N, B.dataTransfer.effectAllowed = "move", B.dataTransfer.setData("text/plain", C), requestAnimationFrame(() => {
|
|
15759
|
+
const R = B.target;
|
|
15760
|
+
R.style.opacity = "0.5";
|
|
15760
15761
|
});
|
|
15761
15762
|
}, [t, n]), v = J((B) => {
|
|
15762
|
-
const
|
|
15763
|
-
|
|
15764
|
-
}, []), S = J((B,
|
|
15765
|
-
B.preventDefault(), B.dataTransfer.dropEffect = "move", b(
|
|
15763
|
+
const M = B.target;
|
|
15764
|
+
M.style.opacity = "1", m(null), b(null), _(null), D.current = null;
|
|
15765
|
+
}, []), S = J((B, M, C) => {
|
|
15766
|
+
B.preventDefault(), B.dataTransfer.dropEffect = "move", b(M), _(C);
|
|
15766
15767
|
}, []), F = J((B) => {
|
|
15767
|
-
const
|
|
15768
|
-
|
|
15769
|
-
}, []),
|
|
15768
|
+
const M = B.relatedTarget;
|
|
15769
|
+
M != null && M.closest("[data-kanban-column]") || (b(null), _(null));
|
|
15770
|
+
}, []), T = J((B, M, C) => {
|
|
15770
15771
|
if (B.preventDefault(), !g) return;
|
|
15771
|
-
const N =
|
|
15772
|
-
N ===
|
|
15773
|
-
}, [g, o, a]),
|
|
15772
|
+
const N = D.current;
|
|
15773
|
+
N === M ? a == null || a(g, M, C) : N && o(g, N, M, C), m(null), b(null), _(null), D.current = null;
|
|
15774
|
+
}, [g, o, a]), A = (B, M) => /* @__PURE__ */ h.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
15774
15775
|
/* @__PURE__ */ h.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
15775
15776
|
B.color && /* @__PURE__ */ h.jsx(
|
|
15776
15777
|
"div",
|
|
@@ -15781,7 +15782,7 @@ function Ly({
|
|
|
15781
15782
|
),
|
|
15782
15783
|
/* @__PURE__ */ h.jsx("span", { className: "font-medium text-sm text-neutral-700", children: B.label })
|
|
15783
15784
|
] }),
|
|
15784
|
-
/* @__PURE__ */ h.jsx("span", { className: "text-xs text-neutral-400 bg-neutral-100 px-2 py-0.5 rounded-full", children:
|
|
15785
|
+
/* @__PURE__ */ h.jsx("span", { className: "text-xs text-neutral-400 bg-neutral-100 px-2 py-0.5 rounded-full", children: M })
|
|
15785
15786
|
] });
|
|
15786
15787
|
return /* @__PURE__ */ h.jsx(
|
|
15787
15788
|
"div",
|
|
@@ -15789,35 +15790,35 @@ function Ly({
|
|
|
15789
15790
|
className: `flex gap-4 overflow-x-auto pb-4 ${d}`,
|
|
15790
15791
|
style: { minHeight: "400px" },
|
|
15791
15792
|
children: e.map((B) => {
|
|
15792
|
-
const
|
|
15793
|
+
const M = E[B.id] || [], C = x === B.id;
|
|
15793
15794
|
return /* @__PURE__ */ h.jsxs(
|
|
15794
15795
|
"div",
|
|
15795
15796
|
{
|
|
15796
15797
|
"data-kanban-column": B.id,
|
|
15797
15798
|
className: `flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,
|
|
15798
15799
|
onDragOver: (N) => {
|
|
15799
|
-
N.preventDefault(), g && !
|
|
15800
|
+
N.preventDefault(), g && !C && b(B.id);
|
|
15800
15801
|
},
|
|
15801
15802
|
onDragLeave: F,
|
|
15802
|
-
onDrop: (N) =>
|
|
15803
|
+
onDrop: (N) => T(N, B.id, y ?? M.length),
|
|
15803
15804
|
children: [
|
|
15804
|
-
/* @__PURE__ */ h.jsx("div", { className: "flex-shrink-0 border-b border-neutral-200", children: u ? u(B,
|
|
15805
|
+
/* @__PURE__ */ h.jsx("div", { className: "flex-shrink-0 border-b border-neutral-200", children: u ? u(B, M.length) : A(B, M.length) }),
|
|
15805
15806
|
/* @__PURE__ */ h.jsxs(
|
|
15806
15807
|
"div",
|
|
15807
15808
|
{
|
|
15808
|
-
className: `flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${
|
|
15809
|
+
className: `flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${C ? "bg-blue-50" : ""}`,
|
|
15809
15810
|
children: [
|
|
15810
|
-
|
|
15811
|
-
const O = t(N), V = g === O, U =
|
|
15811
|
+
M.map((N, R) => {
|
|
15812
|
+
const O = t(N), V = g === O, U = C && y === R && !V;
|
|
15812
15813
|
return /* @__PURE__ */ h.jsxs("div", { children: [
|
|
15813
15814
|
U && /* @__PURE__ */ h.jsx("div", { className: "h-1 bg-blue-500 rounded-full mb-2 mx-1" }),
|
|
15814
15815
|
/* @__PURE__ */ h.jsx(
|
|
15815
15816
|
"div",
|
|
15816
15817
|
{
|
|
15817
15818
|
draggable: !0,
|
|
15818
|
-
onDragStart: (re) =>
|
|
15819
|
+
onDragStart: (re) => w(re, N),
|
|
15819
15820
|
onDragEnd: v,
|
|
15820
|
-
onDragOver: (re) => S(re, B.id,
|
|
15821
|
+
onDragOver: (re) => S(re, B.id, R),
|
|
15821
15822
|
onClick: () => l == null ? void 0 : l(N),
|
|
15822
15823
|
className: `cursor-grab active:cursor-grabbing transition-all ${V ? "opacity-50 scale-95" : ""} ${p}`,
|
|
15823
15824
|
children: s(N, V)
|
|
@@ -15830,12 +15831,12 @@ function Ly({
|
|
|
15830
15831
|
{
|
|
15831
15832
|
className: "min-h-[40px] flex-1",
|
|
15832
15833
|
onDragOver: (N) => {
|
|
15833
|
-
N.preventDefault(), S(N, B.id,
|
|
15834
|
+
N.preventDefault(), S(N, B.id, M.length);
|
|
15834
15835
|
},
|
|
15835
|
-
children:
|
|
15836
|
+
children: C && y === M.length && /* @__PURE__ */ h.jsx("div", { className: "h-1 bg-blue-500 rounded-full mx-1 mt-1" })
|
|
15836
15837
|
}
|
|
15837
15838
|
),
|
|
15838
|
-
|
|
15839
|
+
M.length === 0 && C && /* @__PURE__ */ h.jsx("div", { className: "h-20 border-2 border-dashed border-blue-300 rounded-lg bg-blue-50/50 flex items-center justify-center", children: /* @__PURE__ */ h.jsx("span", { className: "text-sm text-blue-400", children: "Drop here" }) })
|
|
15839
15840
|
]
|
|
15840
15841
|
}
|
|
15841
15842
|
),
|
|
@@ -15899,24 +15900,24 @@ function Py({
|
|
|
15899
15900
|
for (let S = t; S <= n; S++)
|
|
15900
15901
|
v.push(S);
|
|
15901
15902
|
return v;
|
|
15902
|
-
}, [t, n]), _ = (n - t + 1) * i,
|
|
15903
|
+
}, [t, n]), _ = (n - t + 1) * i, D = J(
|
|
15903
15904
|
(v) => {
|
|
15904
15905
|
const S = s(v);
|
|
15905
15906
|
if (!S) return null;
|
|
15906
15907
|
const F = gg(S);
|
|
15907
15908
|
if (!F) return null;
|
|
15908
|
-
const { hours:
|
|
15909
|
-
return { top:
|
|
15909
|
+
const { hours: T, minutes: A } = F, B = Math.max(t, Math.min(n, T)), M = T < t ? 0 : A, C = (B - t) * i + M / 60 * i, N = o(v), R = Math.max(20, N / 60 * i);
|
|
15910
|
+
return { top: C, height: R };
|
|
15910
15911
|
},
|
|
15911
15912
|
[s, o, t, n, i]
|
|
15912
15913
|
), E = ct(() => {
|
|
15913
15914
|
if (!f || !yg(e)) return null;
|
|
15914
15915
|
const v = /* @__PURE__ */ new Date(), S = v.getHours(), F = v.getMinutes();
|
|
15915
15916
|
return S < t || S > n ? null : (S - t) * i + F / 60 * i;
|
|
15916
|
-
}, [e, f, t, n, i]),
|
|
15917
|
+
}, [e, f, t, n, i]), w = J(
|
|
15917
15918
|
(v) => {
|
|
15918
15919
|
if (!d) return;
|
|
15919
|
-
const S = v.currentTarget.getBoundingClientRect(),
|
|
15920
|
+
const S = v.currentTarget.getBoundingClientRect(), T = (v.clientY - S.top) / i * 60, A = Math.floor(T / 60) + t, B = Math.round(T % 60 / 15) * 15, M = Math.min(n, Math.max(t, A)), C = B >= 60 ? 0 : B, N = `${M.toString().padStart(2, "0")}:${C.toString().padStart(2, "0")}`;
|
|
15920
15921
|
d(N);
|
|
15921
15922
|
},
|
|
15922
15923
|
[d, i, t, n]
|
|
@@ -16012,7 +16013,7 @@ function Py({
|
|
|
16012
16013
|
bottom: 0,
|
|
16013
16014
|
cursor: d ? "pointer" : "default"
|
|
16014
16015
|
},
|
|
16015
|
-
onClick:
|
|
16016
|
+
onClick: w
|
|
16016
16017
|
}
|
|
16017
16018
|
),
|
|
16018
16019
|
E !== null && /* @__PURE__ */ h.jsxs(
|
|
@@ -16055,7 +16056,7 @@ function Py({
|
|
|
16055
16056
|
}
|
|
16056
16057
|
),
|
|
16057
16058
|
b.map((v) => {
|
|
16058
|
-
const S =
|
|
16059
|
+
const S = D(v);
|
|
16059
16060
|
return S ? /* @__PURE__ */ h.jsx(
|
|
16060
16061
|
"div",
|
|
16061
16062
|
{
|
|
@@ -16080,11 +16081,11 @@ function Py({
|
|
|
16080
16081
|
] });
|
|
16081
16082
|
}
|
|
16082
16083
|
function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComplete: n, variant: i = "widget", hideSaveButton: s = !1, maxDuration: o = 180 }) {
|
|
16083
|
-
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), [
|
|
16084
|
+
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), [D, E] = I(!1), [w, v] = I(null), [S, F] = I(!0), [T, A] = I([]), [B, M] = I({ completed: 0, total: 0 }), C = be(!1), N = be(!0);
|
|
16084
16085
|
Ee(() => {
|
|
16085
16086
|
N.current = S;
|
|
16086
16087
|
}, [S]);
|
|
16087
|
-
const
|
|
16088
|
+
const R = be(null), O = be(null), V = be(null), U = be(null), re = be(null), q = be([]), Z = be(null), W = be(null), se = be(null), ce = be(null), fe = be(!1), ge = be([]), Be = be(null), _e = be(null), ee = be([]), Se = be([]), ie = be("insert"), Re = be(!1), ke = be(0), Ae = be(0), qe = be(0), ze = (Q) => {
|
|
16088
16089
|
const j = Math.floor(Q / 60), ue = Math.floor(Q % 60);
|
|
16089
16090
|
return `${j.toString().padStart(2, "0")}:${ue.toString().padStart(2, "0")}`;
|
|
16090
16091
|
}, He = async (Q) => {
|
|
@@ -16121,7 +16122,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16121
16122
|
}
|
|
16122
16123
|
return await G.close(), Ce;
|
|
16123
16124
|
}, ye = J(() => {
|
|
16124
|
-
const Q =
|
|
16125
|
+
const Q = R.current;
|
|
16125
16126
|
if (!Q) return;
|
|
16126
16127
|
const j = Q.getContext("2d");
|
|
16127
16128
|
if (!j) return;
|
|
@@ -16141,16 +16142,16 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16141
16142
|
for (let gt = 0; gt < De.length; gt++) {
|
|
16142
16143
|
const Mt = De.length - 1 - gt, ir = Qe - Mt * 4;
|
|
16143
16144
|
if (ir < -3 || ir > he) continue;
|
|
16144
|
-
const Pt = De[gt] * (G / 2 - 12),
|
|
16145
|
-
j.fillStyle = "#10b981", j.fillRect(ir,
|
|
16145
|
+
const Pt = De[gt] * (G / 2 - 12), k = G / 2 - Pt;
|
|
16146
|
+
j.fillStyle = "#10b981", j.fillRect(ir, k, 3, Pt * 2);
|
|
16146
16147
|
}
|
|
16147
16148
|
else {
|
|
16148
16149
|
const gt = ve > 0 ? we / ve * De.length : 0;
|
|
16149
16150
|
for (let Mt = 0; Mt < De.length; Mt++) {
|
|
16150
16151
|
const ir = gt - Mt, Pt = Qe - ir * 4;
|
|
16151
16152
|
if (Pt < -3 || Pt > he) continue;
|
|
16152
|
-
const
|
|
16153
|
-
j.fillStyle = Mt <= gt ? "#10b981" : "#4b5563", j.fillRect(Pt, $, 3,
|
|
16153
|
+
const k = De[Mt] * (G / 2 - 12), $ = G / 2 - k;
|
|
16154
|
+
j.fillStyle = Mt <= gt ? "#10b981" : "#4b5563", j.fillRect(Pt, $, 3, k * 2);
|
|
16154
16155
|
}
|
|
16155
16156
|
}
|
|
16156
16157
|
j.strokeStyle = "#ef4444", j.lineWidth = 1, j.beginPath(), j.moveTo(Qe, 0), j.lineTo(Qe, G), j.stroke(), j.fillStyle = "#fff", j.font = "bold 18px monospace", j.textAlign = "center", j.fillText(ze(we), Qe, G - 6), l === "recording" && (j.fillStyle = "#ef4444", j.beginPath(), j.arc(20, 20, 8, 0, Math.PI * 2), j.fill(), j.fillStyle = "#fff", j.font = "10px sans-serif", j.textAlign = "left", j.fillText("REC", 34, 24)), j.textAlign = "left";
|
|
@@ -16204,7 +16205,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16204
16205
|
else
|
|
16205
16206
|
ve = De, we = ke.current > 0 ? ke.current : 1;
|
|
16206
16207
|
if (ce.current = ve, Q.getTracks().forEach((Ce) => Ce.stop()), N.current && t) {
|
|
16207
|
-
|
|
16208
|
+
A((Ce) => [...Ce, ve]), M((Ce) => ({ ...Ce, total: Ce.total + 1 })), ce.current = null, ge.current = [], b(0), p(0), d(0), u("idle");
|
|
16208
16209
|
return;
|
|
16209
16210
|
}
|
|
16210
16211
|
const Ie = URL.createObjectURL(ve), Ve = new Audio(Ie);
|
|
@@ -16227,7 +16228,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16227
16228
|
}, ae = () => {
|
|
16228
16229
|
fe.current = !1, E(!1), v(null), W.current && (cancelAnimationFrame(W.current), W.current = null), Z.current && (clearInterval(Z.current), Z.current = null), O.current && O.current.state !== "inactive" && O.current.stop();
|
|
16229
16230
|
}, me = (Q) => {
|
|
16230
|
-
const j =
|
|
16231
|
+
const j = R.current;
|
|
16231
16232
|
if (!j) return;
|
|
16232
16233
|
const ue = f || c;
|
|
16233
16234
|
if (ue <= 0) return;
|
|
@@ -16264,9 +16265,9 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16264
16265
|
ce.current ? r(ce.current, f || c) : alert("No audio recorded yet!");
|
|
16265
16266
|
};
|
|
16266
16267
|
Ee(() => {
|
|
16267
|
-
l === "recording" &&
|
|
16268
|
+
l === "recording" && R.current && re.current && fe.current && (W.current = requestAnimationFrame(Ke));
|
|
16268
16269
|
}, [l]), Ee(() => {
|
|
16269
|
-
const Q =
|
|
16270
|
+
const Q = R.current;
|
|
16270
16271
|
if (!Q) return;
|
|
16271
16272
|
const j = () => {
|
|
16272
16273
|
const ue = window.devicePixelRatio || 1, he = Q.getBoundingClientRect();
|
|
@@ -16277,7 +16278,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16277
16278
|
return j(), window.addEventListener("resize", j), () => window.removeEventListener("resize", j);
|
|
16278
16279
|
}, []), Ee(() => {
|
|
16279
16280
|
if (l === "idle") {
|
|
16280
|
-
const Q =
|
|
16281
|
+
const Q = R.current;
|
|
16281
16282
|
if (!Q) return;
|
|
16282
16283
|
const j = Q.getContext("2d");
|
|
16283
16284
|
if (!j) return;
|
|
@@ -16296,23 +16297,23 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16296
16297
|
}
|
|
16297
16298
|
}, [l]);
|
|
16298
16299
|
const Ye = J((Q) => {
|
|
16299
|
-
|
|
16300
|
+
A((j) => [...j, Q]), M((j) => ({ ...j, total: j.total + 1 }));
|
|
16300
16301
|
}, []);
|
|
16301
16302
|
if (Ee(() => {
|
|
16302
16303
|
(async () => {
|
|
16303
|
-
if (
|
|
16304
|
-
|
|
16305
|
-
const j =
|
|
16304
|
+
if (C.current || T.length === 0 || !t) return;
|
|
16305
|
+
C.current = !0;
|
|
16306
|
+
const j = T[0];
|
|
16306
16307
|
try {
|
|
16307
16308
|
const ue = await t(j);
|
|
16308
16309
|
ue && n && n(ue);
|
|
16309
16310
|
} catch (ue) {
|
|
16310
16311
|
console.error("Transcription failed:", ue);
|
|
16311
16312
|
} finally {
|
|
16312
|
-
|
|
16313
|
+
A((ue) => ue.slice(1)), M((ue) => ({ ...ue, completed: ue.completed + 1 })), C.current = !1;
|
|
16313
16314
|
}
|
|
16314
16315
|
})();
|
|
16315
|
-
}, [
|
|
16316
|
+
}, [T, t, n]), Ee(() => () => {
|
|
16316
16317
|
fe.current = !1, Z.current && clearInterval(Z.current), W.current && cancelAnimationFrame(W.current), V.current && V.current.getTracks().forEach((Q) => Q.stop()), U.current && U.current.state !== "closed" && U.current.close();
|
|
16317
16318
|
}, []), Ee(() => {
|
|
16318
16319
|
if (l === "editing" && g) {
|
|
@@ -16320,7 +16321,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16320
16321
|
const j = () => {
|
|
16321
16322
|
const ue = se.current;
|
|
16322
16323
|
if (ue && g) {
|
|
16323
|
-
const he =
|
|
16324
|
+
const he = R.current;
|
|
16324
16325
|
if (he) {
|
|
16325
16326
|
const G = he.getContext("2d");
|
|
16326
16327
|
if (G) {
|
|
@@ -16342,8 +16343,8 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16342
16343
|
G.fillStyle = te <= Pt ? "#10b981" : "#4b5563", G.fillRect(je, Fe, Mt, $e * 2);
|
|
16343
16344
|
}
|
|
16344
16345
|
G.strokeStyle = "#ef4444", G.lineWidth = 1, G.beginPath(), G.moveTo(gt, 0), G.lineTo(gt, we), G.stroke(), G.fillStyle = "#fff", G.font = "bold 18px monospace", G.textAlign = "center";
|
|
16345
|
-
const
|
|
16346
|
-
G.fillText(`${
|
|
16346
|
+
const k = Math.floor(Ce / 60), $ = Math.floor(Ce % 60);
|
|
16347
|
+
G.fillText(`${k.toString().padStart(2, "0")}:${$.toString().padStart(2, "0")}`, gt, we - 6), G.textAlign = "left";
|
|
16347
16348
|
}
|
|
16348
16349
|
}
|
|
16349
16350
|
Q = requestAnimationFrame(j);
|
|
@@ -16386,7 +16387,7 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16386
16387
|
/* @__PURE__ */ h.jsx(
|
|
16387
16388
|
"canvas",
|
|
16388
16389
|
{
|
|
16389
|
-
ref:
|
|
16390
|
+
ref: R,
|
|
16390
16391
|
style: { width: "100%", height: "32px", cursor: "pointer", flexShrink: 0 },
|
|
16391
16392
|
onMouseDown: (Q) => {
|
|
16392
16393
|
if (l === "editing") {
|
|
@@ -16438,8 +16439,8 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16438
16439
|
},
|
|
16439
16440
|
disabled: l === "idle",
|
|
16440
16441
|
style: l === "idle" ? rt : tt,
|
|
16441
|
-
title: g || l === "recording" && !
|
|
16442
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !
|
|
16442
|
+
title: g || l === "recording" && !D ? "Pause" : "Play",
|
|
16443
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !D ? "pause" : "play_arrow" })
|
|
16443
16444
|
}
|
|
16444
16445
|
),
|
|
16445
16446
|
/* @__PURE__ */ h.jsx(
|
|
@@ -16457,51 +16458,51 @@ function xg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
|
|
|
16457
16458
|
"button",
|
|
16458
16459
|
{
|
|
16459
16460
|
onClick: () => {
|
|
16460
|
-
|
|
16461
|
+
w === "insert" ? ae() : l === "idle" ? (v("insert"), z()) : l === "editing" && (v("insert"), wt("insert"));
|
|
16461
16462
|
},
|
|
16462
|
-
disabled: l === "recording" &&
|
|
16463
|
-
style: l === "recording" &&
|
|
16464
|
-
title:
|
|
16465
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
16463
|
+
disabled: l === "recording" && w !== "insert" || g,
|
|
16464
|
+
style: l === "recording" && w !== "insert" || g ? rt : tt,
|
|
16465
|
+
title: w === "insert" ? "Stop recording" : "Insert recording",
|
|
16466
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: w === "insert" ? "#ef4444" : "#171717" }, children: "add" })
|
|
16466
16467
|
}
|
|
16467
16468
|
),
|
|
16468
16469
|
/* @__PURE__ */ h.jsx(
|
|
16469
16470
|
"button",
|
|
16470
16471
|
{
|
|
16471
16472
|
onClick: () => {
|
|
16472
|
-
N.current || (
|
|
16473
|
+
N.current || (w === "mic" ? ae() : l === "idle" ? (v("mic"), z()) : l === "editing" && (v("mic"), wt("replace")));
|
|
16473
16474
|
},
|
|
16474
16475
|
onMouseDown: () => {
|
|
16475
16476
|
N.current && l === "idle" && !g && (v("mic"), z());
|
|
16476
16477
|
},
|
|
16477
16478
|
onMouseUp: () => {
|
|
16478
|
-
N.current && l === "recording" &&
|
|
16479
|
+
N.current && l === "recording" && w === "mic" && ae();
|
|
16479
16480
|
},
|
|
16480
16481
|
onMouseLeave: () => {
|
|
16481
|
-
N.current && l === "recording" &&
|
|
16482
|
+
N.current && l === "recording" && w === "mic" && ae();
|
|
16482
16483
|
},
|
|
16483
16484
|
onTouchStart: (Q) => {
|
|
16484
16485
|
Q.preventDefault(), N.current && l === "idle" && !g && (v("mic"), z());
|
|
16485
16486
|
},
|
|
16486
16487
|
onTouchEnd: (Q) => {
|
|
16487
|
-
Q.preventDefault(), N.current && l === "recording" &&
|
|
16488
|
+
Q.preventDefault(), N.current && l === "recording" && w === "mic" && ae();
|
|
16488
16489
|
},
|
|
16489
|
-
disabled: l === "recording" &&
|
|
16490
|
-
style: l === "recording" &&
|
|
16491
|
-
title: S ? "Hold to record (walkie-talkie)" :
|
|
16492
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
16490
|
+
disabled: l === "recording" && w !== "mic" || g,
|
|
16491
|
+
style: l === "recording" && w !== "mic" || g ? rt : tt,
|
|
16492
|
+
title: S ? "Hold to record (walkie-talkie)" : w === "mic" ? "Stop recording" : "Record",
|
|
16493
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: w === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
|
|
16493
16494
|
}
|
|
16494
16495
|
),
|
|
16495
16496
|
/* @__PURE__ */ h.jsx(
|
|
16496
16497
|
"button",
|
|
16497
16498
|
{
|
|
16498
16499
|
onClick: () => {
|
|
16499
|
-
|
|
16500
|
+
w === "startover" ? ae() : l === "editing" && (v("startover"), oe());
|
|
16500
16501
|
},
|
|
16501
|
-
disabled: l === "idle" || l === "recording" &&
|
|
16502
|
-
style: l === "idle" || l === "recording" &&
|
|
16503
|
-
title:
|
|
16504
|
-
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color:
|
|
16502
|
+
disabled: l === "idle" || l === "recording" && w !== "startover" || g,
|
|
16503
|
+
style: l === "idle" || l === "recording" && w !== "startover" || g ? rt : tt,
|
|
16504
|
+
title: w === "startover" ? "Stop recording" : "Start over",
|
|
16505
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: w === "startover" ? "#ef4444" : "#171717" }, children: "refresh" })
|
|
16505
16506
|
}
|
|
16506
16507
|
)
|
|
16507
16508
|
] }),
|
|
@@ -16599,45 +16600,85 @@ function Iy({
|
|
|
16599
16600
|
onChange: t,
|
|
16600
16601
|
onTranscribe: n,
|
|
16601
16602
|
onAIAction: i,
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16603
|
+
onAIPrompt: s,
|
|
16604
|
+
placeholder: o = "Type or record...",
|
|
16605
|
+
className: a = "",
|
|
16606
|
+
rows: l
|
|
16605
16607
|
}) {
|
|
16606
|
-
const [
|
|
16608
|
+
const [u, c] = I(!1), [d, f] = I(null), [p, g] = I(!1), [m, x] = I(""), b = be(null), y = (w) => {
|
|
16607
16609
|
t(e ? `${e}
|
|
16608
16610
|
|
|
16609
|
-
${
|
|
16610
|
-
},
|
|
16611
|
-
if (!(!e.trim() ||
|
|
16612
|
-
|
|
16611
|
+
${w}` : w);
|
|
16612
|
+
}, _ = async (w) => {
|
|
16613
|
+
if (!(!e.trim() || u || !i)) {
|
|
16614
|
+
c(!0), f(w), g(!1);
|
|
16613
16615
|
try {
|
|
16614
|
-
const
|
|
16615
|
-
t(
|
|
16616
|
-
} catch (
|
|
16617
|
-
console.error(`${
|
|
16616
|
+
const v = await i(w, e);
|
|
16617
|
+
t(v);
|
|
16618
|
+
} catch (v) {
|
|
16619
|
+
console.error(`${w} failed:`, v);
|
|
16618
16620
|
} finally {
|
|
16619
|
-
|
|
16621
|
+
c(!1), f(null);
|
|
16620
16622
|
}
|
|
16621
16623
|
}
|
|
16622
|
-
},
|
|
16624
|
+
}, D = () => {
|
|
16623
16625
|
setTimeout(() => {
|
|
16624
|
-
var
|
|
16625
|
-
(
|
|
16626
|
+
var w;
|
|
16627
|
+
(w = b.current) != null && w.contains(document.activeElement) || g(!1);
|
|
16626
16628
|
}, 150);
|
|
16629
|
+
}, E = async () => {
|
|
16630
|
+
if (!(!m.trim() || u || !s)) {
|
|
16631
|
+
c(!0), f(m);
|
|
16632
|
+
try {
|
|
16633
|
+
const w = await s(m, e);
|
|
16634
|
+
t(w), x("");
|
|
16635
|
+
} catch (w) {
|
|
16636
|
+
console.error("AI prompt failed:", w);
|
|
16637
|
+
} finally {
|
|
16638
|
+
c(!1), f(null);
|
|
16639
|
+
}
|
|
16640
|
+
}
|
|
16627
16641
|
};
|
|
16628
|
-
return /* @__PURE__ */ h.jsxs("div", { className: `flex flex-col flex-1 min-h-0 ${
|
|
16642
|
+
return /* @__PURE__ */ h.jsxs("div", { className: `flex flex-col flex-1 min-h-0 ${a}`, children: [
|
|
16629
16643
|
/* @__PURE__ */ h.jsx(
|
|
16630
16644
|
xg,
|
|
16631
16645
|
{
|
|
16632
16646
|
onComplete: () => {
|
|
16633
16647
|
},
|
|
16634
16648
|
onTranscribe: n,
|
|
16635
|
-
onTranscriptionComplete:
|
|
16649
|
+
onTranscriptionComplete: y,
|
|
16636
16650
|
hideSaveButton: !0,
|
|
16637
16651
|
variant: "div"
|
|
16638
16652
|
}
|
|
16639
16653
|
),
|
|
16640
|
-
/* @__PURE__ */ h.jsxs("div", { className: "flex items-
|
|
16654
|
+
s && /* @__PURE__ */ h.jsxs("div", { className: "flex items-start gap-2 bg-neutral-50 border-b border-neutral-200", children: [
|
|
16655
|
+
/* @__PURE__ */ h.jsx(
|
|
16656
|
+
"textarea",
|
|
16657
|
+
{
|
|
16658
|
+
value: m,
|
|
16659
|
+
onChange: (w) => x(w.target.value),
|
|
16660
|
+
onKeyDown: (w) => {
|
|
16661
|
+
w.stopPropagation(), w.key === "Enter" && w.ctrlKey && (w.preventDefault(), E());
|
|
16662
|
+
},
|
|
16663
|
+
placeholder: "Instructions AI... (Ctrl+Enter pour envoyer)",
|
|
16664
|
+
disabled: u,
|
|
16665
|
+
rows: 5,
|
|
16666
|
+
className: "flex-1 pl-0 pr-2 py-2 text-sm border-0 resize-y min-h-[80px] focus:ring-0 focus:outline-none bg-transparent disabled:opacity-50"
|
|
16667
|
+
}
|
|
16668
|
+
),
|
|
16669
|
+
/* @__PURE__ */ h.jsx(
|
|
16670
|
+
"button",
|
|
16671
|
+
{
|
|
16672
|
+
type: "button",
|
|
16673
|
+
onClick: E,
|
|
16674
|
+
disabled: u || !m.trim(),
|
|
16675
|
+
className: "self-start p-2 text-neutral-700 hover:text-neutral-900 transition-colors disabled:opacity-30",
|
|
16676
|
+
title: "Envoyer (Ctrl+Enter)",
|
|
16677
|
+
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px" }, children: u ? "hourglass_empty" : "smart_toy" })
|
|
16678
|
+
}
|
|
16679
|
+
)
|
|
16680
|
+
] }),
|
|
16681
|
+
(r || i || e.trim()) && /* @__PURE__ */ h.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
16641
16682
|
/* @__PURE__ */ h.jsx("label", { className: "text-sm font-medium text-neutral-700", children: r }),
|
|
16642
16683
|
/* @__PURE__ */ h.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
16643
16684
|
e.trim() && /* @__PURE__ */ h.jsx(
|
|
@@ -16650,19 +16691,19 @@ ${y}` : y);
|
|
|
16650
16691
|
children: /* @__PURE__ */ h.jsx("span", { className: "material-icons text-neutral-500", style: { fontSize: "16px" }, children: "content_copy" })
|
|
16651
16692
|
}
|
|
16652
16693
|
),
|
|
16653
|
-
i && /* @__PURE__ */ h.jsxs("div", { className: "relative", ref:
|
|
16694
|
+
i && /* @__PURE__ */ h.jsxs("div", { className: "relative", ref: b, children: [
|
|
16654
16695
|
/* @__PURE__ */ h.jsx(
|
|
16655
16696
|
"button",
|
|
16656
16697
|
{
|
|
16657
16698
|
type: "button",
|
|
16658
|
-
onClick: () =>
|
|
16659
|
-
disabled:
|
|
16699
|
+
onClick: () => g(!p),
|
|
16700
|
+
disabled: u || !e.trim(),
|
|
16660
16701
|
className: "flex items-center gap-1 text-xs text-purple-600 hover:text-purple-700 disabled:opacity-40 disabled:hover:text-purple-600 px-2 py-1 rounded hover:bg-purple-50 transition-colors",
|
|
16661
|
-
children:
|
|
16702
|
+
children: u ? /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
16662
16703
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm animate-spin", children: "hourglass_empty" }),
|
|
16663
|
-
|
|
16664
|
-
|
|
16665
|
-
|
|
16704
|
+
d === "restructure" && "Restructuring...",
|
|
16705
|
+
d === "proofread" && "Proofreading...",
|
|
16706
|
+
d === "rewrite" && "Rewriting..."
|
|
16666
16707
|
] }) : /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
16667
16708
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: "auto_fix_high" }),
|
|
16668
16709
|
"AI",
|
|
@@ -16670,17 +16711,17 @@ ${y}` : y);
|
|
|
16670
16711
|
] })
|
|
16671
16712
|
}
|
|
16672
16713
|
),
|
|
16673
|
-
|
|
16714
|
+
p && !u && /* @__PURE__ */ h.jsxs(
|
|
16674
16715
|
"div",
|
|
16675
16716
|
{
|
|
16676
16717
|
className: "absolute right-0 top-full mt-1 bg-white border border-neutral-200 rounded-lg shadow-lg z-50 min-w-[180px] py-1",
|
|
16677
|
-
onBlur:
|
|
16718
|
+
onBlur: D,
|
|
16678
16719
|
children: [
|
|
16679
16720
|
/* @__PURE__ */ h.jsxs(
|
|
16680
16721
|
"button",
|
|
16681
16722
|
{
|
|
16682
16723
|
type: "button",
|
|
16683
|
-
onClick: () =>
|
|
16724
|
+
onClick: () => _("restructure"),
|
|
16684
16725
|
className: "w-full px-3 py-2 text-left text-sm hover:bg-neutral-50 flex items-center gap-2",
|
|
16685
16726
|
children: [
|
|
16686
16727
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons text-base text-blue-500", children: "format_list_bulleted" }),
|
|
@@ -16695,7 +16736,7 @@ ${y}` : y);
|
|
|
16695
16736
|
"button",
|
|
16696
16737
|
{
|
|
16697
16738
|
type: "button",
|
|
16698
|
-
onClick: () =>
|
|
16739
|
+
onClick: () => _("proofread"),
|
|
16699
16740
|
className: "w-full px-3 py-2 text-left text-sm hover:bg-neutral-50 flex items-center gap-2",
|
|
16700
16741
|
children: [
|
|
16701
16742
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons text-base text-green-500", children: "spellcheck" }),
|
|
@@ -16710,7 +16751,7 @@ ${y}` : y);
|
|
|
16710
16751
|
"button",
|
|
16711
16752
|
{
|
|
16712
16753
|
type: "button",
|
|
16713
|
-
onClick: () =>
|
|
16754
|
+
onClick: () => _("rewrite"),
|
|
16714
16755
|
className: "w-full px-3 py-2 text-left text-sm hover:bg-neutral-50 flex items-center gap-2",
|
|
16715
16756
|
children: [
|
|
16716
16757
|
/* @__PURE__ */ h.jsx("span", { className: "material-icons text-base text-purple-500", children: "brush" }),
|
|
@@ -16731,12 +16772,12 @@ ${y}` : y);
|
|
|
16731
16772
|
"textarea",
|
|
16732
16773
|
{
|
|
16733
16774
|
value: e,
|
|
16734
|
-
onChange: (
|
|
16735
|
-
onKeyDown: (
|
|
16736
|
-
placeholder:
|
|
16737
|
-
rows:
|
|
16738
|
-
disabled:
|
|
16739
|
-
className: "flex-1 w-full px-3 py-2 border
|
|
16775
|
+
onChange: (w) => t(w.target.value),
|
|
16776
|
+
onKeyDown: (w) => w.stopPropagation(),
|
|
16777
|
+
placeholder: o,
|
|
16778
|
+
rows: l,
|
|
16779
|
+
disabled: u,
|
|
16780
|
+
className: "flex-1 w-full px-3 py-2 border-0 focus:ring-0 focus:outline-none text-sm disabled:opacity-50 disabled:bg-neutral-50 resize-none"
|
|
16740
16781
|
}
|
|
16741
16782
|
)
|
|
16742
16783
|
] });
|
|
@@ -16758,10 +16799,10 @@ function Oy({
|
|
|
16758
16799
|
outputQuality: s = 0.9,
|
|
16759
16800
|
theme: o = "dark"
|
|
16760
16801
|
}) {
|
|
16761
|
-
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 }), [
|
|
16802
|
+
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 }), [D, E] = I(!1), [w, v] = I(null), [S, F] = I({ x: 0, y: 0 }), [T, A] = I({ x: 0, y: 0, width: 100, height: 100 }), B = o === "dark", M = J(() => {
|
|
16762
16803
|
const ee = u.current;
|
|
16763
16804
|
return ee ? x === 90 || x === 270 ? { width: ee.height, height: ee.width } : { width: ee.width, height: ee.height } : { width: 100, height: 100 };
|
|
16764
|
-
}, [x]),
|
|
16805
|
+
}, [x]), C = J((ee, Se) => {
|
|
16765
16806
|
const ie = ee / Se, Re = 0.05;
|
|
16766
16807
|
for (const [ke, Ae] of Object.entries(vi))
|
|
16767
16808
|
if (Ae !== null && Math.abs(ie - Ae) / Ae < Re)
|
|
@@ -16772,14 +16813,14 @@ function Oy({
|
|
|
16772
16813
|
const ee = new Image();
|
|
16773
16814
|
ee.crossOrigin = "anonymous", ee.onload = () => {
|
|
16774
16815
|
u.current = ee;
|
|
16775
|
-
const Se =
|
|
16816
|
+
const Se = C(ee.width, ee.height);
|
|
16776
16817
|
m(Se), d(!1);
|
|
16777
16818
|
}, ee.onerror = () => {
|
|
16778
16819
|
p("Failed to load image"), d(!1);
|
|
16779
16820
|
}, ee.src = r;
|
|
16780
|
-
}, [r,
|
|
16821
|
+
}, [r, C]);
|
|
16781
16822
|
const N = J(() => {
|
|
16782
|
-
const { width: ee, height: Se } =
|
|
16823
|
+
const { width: ee, height: Se } = M(), ie = vi[g];
|
|
16783
16824
|
if (ie === null) {
|
|
16784
16825
|
_({ x: 0, y: 0, width: 100, height: 100 });
|
|
16785
16826
|
return;
|
|
@@ -16789,7 +16830,7 @@ function Oy({
|
|
|
16789
16830
|
Re > ie ? (Ae = 100, ke = ie / Re * 100) : (ke = 100, Ae = Re / ie * 100);
|
|
16790
16831
|
const qe = (100 - ke) / 2, ze = (100 - Ae) / 2;
|
|
16791
16832
|
_({ x: qe, y: ze, width: ke, height: Ae });
|
|
16792
|
-
}, [g,
|
|
16833
|
+
}, [g, M]);
|
|
16793
16834
|
Ee(() => {
|
|
16794
16835
|
u.current && N();
|
|
16795
16836
|
}, [g, x, N]), Ee(() => {
|
|
@@ -16799,7 +16840,7 @@ function Oy({
|
|
|
16799
16840
|
if (!ie) return;
|
|
16800
16841
|
const Re = a.current;
|
|
16801
16842
|
if (!Re) return;
|
|
16802
|
-
const ke = Re.clientWidth, Ae = Re.clientHeight - 140, { width: qe, height: ze } =
|
|
16843
|
+
const ke = Re.clientWidth, Ae = Re.clientHeight - 140, { width: qe, height: ze } = M(), He = qe / ze;
|
|
16803
16844
|
let Y, L;
|
|
16804
16845
|
ke / Ae > He ? (L = Math.min(Ae, ze), Y = L * He) : (Y = Math.min(ke, qe), L = Y / He), Y > ke && (Y = ke, L = Y / He), L > Ae && (L = Ae, Y = L * He), ee.width = Y, ee.height = L, ie.clearRect(0, 0, Y, L), ie.save(), ie.translate(Y / 2, L / 2), ie.rotate(x * Math.PI / 180);
|
|
16805
16846
|
let ye, Ke;
|
|
@@ -16815,8 +16856,8 @@ function Oy({
|
|
|
16815
16856
|
].forEach((wt) => {
|
|
16816
16857
|
ie.fillRect(wt.x - Ge / 2, wt.y - Ge / 2, Ge, Ge), ie.strokeRect(wt.x - Ge / 2, wt.y - Ge / 2, Ge, Ge);
|
|
16817
16858
|
});
|
|
16818
|
-
}, [y, x, c,
|
|
16819
|
-
const
|
|
16859
|
+
}, [y, x, c, M]);
|
|
16860
|
+
const R = (ee) => {
|
|
16820
16861
|
const Se = l.current;
|
|
16821
16862
|
if (!Se) return;
|
|
16822
16863
|
const ie = Se.getBoundingClientRect(), Re = (ee.clientX - ie.left) / ie.width * 100, ke = (ee.clientY - ie.top) / ie.height * 100, Ae = 4, qe = [
|
|
@@ -16827,43 +16868,43 @@ function Oy({
|
|
|
16827
16868
|
];
|
|
16828
16869
|
for (const ze of qe)
|
|
16829
16870
|
if (Math.abs(Re - ze.x) < Ae && Math.abs(ke - ze.y) < Ae) {
|
|
16830
|
-
v(ze.name), F({ x: Re, y: ke }),
|
|
16871
|
+
v(ze.name), F({ x: Re, y: ke }), A({ ...y });
|
|
16831
16872
|
return;
|
|
16832
16873
|
}
|
|
16833
|
-
Re >= y.x && Re <= y.x + y.width && ke >= y.y && ke <= y.y + y.height && (E(!0), F({ x: Re, y: ke }),
|
|
16874
|
+
Re >= y.x && Re <= y.x + y.width && ke >= y.y && ke <= y.y + y.height && (E(!0), F({ x: Re, y: ke }), A({ ...y }));
|
|
16834
16875
|
}, O = (ee) => {
|
|
16835
16876
|
const Se = l.current;
|
|
16836
16877
|
if (!Se) return;
|
|
16837
16878
|
const ie = Se.getBoundingClientRect(), Re = (ee.clientX - ie.left) / ie.width * 100, ke = (ee.clientY - ie.top) / ie.height * 100;
|
|
16838
|
-
if (
|
|
16879
|
+
if (D) {
|
|
16839
16880
|
const Ae = Re - S.x, qe = ke - S.y;
|
|
16840
|
-
let ze =
|
|
16841
|
-
ze = Math.max(0, Math.min(ze, 100 -
|
|
16842
|
-
} else if (
|
|
16843
|
-
const Ae = vi[g], { width: qe, height: ze } =
|
|
16844
|
-
let L = { ...
|
|
16881
|
+
let ze = T.x + Ae, He = T.y + qe;
|
|
16882
|
+
ze = Math.max(0, Math.min(ze, 100 - T.width)), He = Math.max(0, Math.min(He, 100 - T.height)), _({ ...T, x: ze, y: He });
|
|
16883
|
+
} else if (w) {
|
|
16884
|
+
const Ae = vi[g], { width: qe, height: ze } = M(), He = qe / ze, Y = Ae ? Ae / He : null;
|
|
16885
|
+
let L = { ...T };
|
|
16845
16886
|
const ye = Re - S.x, Ke = ke - S.y;
|
|
16846
|
-
if (
|
|
16847
|
-
L.width = Math.max(10, Math.min(100 - L.x,
|
|
16848
|
-
else if (
|
|
16849
|
-
const z = -ye, ae = Math.max(10,
|
|
16850
|
-
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 =
|
|
16851
|
-
} else if (
|
|
16852
|
-
if (L.width = Math.max(10, Math.min(100 - L.x,
|
|
16853
|
-
const z = L.width / Y, ae =
|
|
16854
|
-
ae >= 0 ? (L.height = z, L.y = ae) : (L.y = 0, L.height =
|
|
16887
|
+
if (w === "se")
|
|
16888
|
+
L.width = Math.max(10, Math.min(100 - L.x, T.width + ye)), Y ? (L.height = L.width / Y, L.y + L.height > 100 && (L.height = 100 - L.y, L.width = L.height * Y)) : L.height = Math.max(10, Math.min(100 - L.y, T.height + Ke));
|
|
16889
|
+
else if (w === "sw") {
|
|
16890
|
+
const z = -ye, ae = Math.max(10, T.width + z), me = T.x + T.width - ae;
|
|
16891
|
+
me >= 0 && (L.width = ae, L.x = me, Y ? (L.height = L.width / Y, L.y + L.height > 100 && (L.height = 100 - L.y, L.width = L.height * Y, L.x = T.x + T.width - L.width)) : L.height = Math.max(10, Math.min(100 - L.y, T.height + Ke)));
|
|
16892
|
+
} else if (w === "ne")
|
|
16893
|
+
if (L.width = Math.max(10, Math.min(100 - L.x, T.width + ye)), Y) {
|
|
16894
|
+
const z = L.width / Y, ae = T.y + T.height - z;
|
|
16895
|
+
ae >= 0 ? (L.height = z, L.y = ae) : (L.y = 0, L.height = T.y + T.height, L.width = L.height * Y);
|
|
16855
16896
|
} else {
|
|
16856
|
-
const z = -Ke, ae = Math.max(10,
|
|
16897
|
+
const z = -Ke, ae = Math.max(10, T.height + z), me = T.y + T.height - ae;
|
|
16857
16898
|
me >= 0 && (L.height = ae, L.y = me);
|
|
16858
16899
|
}
|
|
16859
|
-
else if (
|
|
16860
|
-
const z = -ye, ae = Math.max(10,
|
|
16900
|
+
else if (w === "nw") {
|
|
16901
|
+
const z = -ye, ae = Math.max(10, T.width + z), me = T.x + T.width - ae;
|
|
16861
16902
|
if (me >= 0)
|
|
16862
16903
|
if (L.width = ae, L.x = me, Y) {
|
|
16863
|
-
const xe = L.width / Y, Ge =
|
|
16864
|
-
Ge >= 0 ? (L.height = xe, L.y = Ge) : (L.y = 0, L.height =
|
|
16904
|
+
const xe = L.width / Y, Ge = T.y + T.height - xe;
|
|
16905
|
+
Ge >= 0 ? (L.height = xe, L.y = Ge) : (L.y = 0, L.height = T.y + T.height, L.width = L.height * Y, L.x = T.x + T.width - L.width);
|
|
16865
16906
|
} else {
|
|
16866
|
-
const xe = -Ke, Ge = Math.max(10,
|
|
16907
|
+
const xe = -Ke, Ge = Math.max(10, T.height + xe), vt = T.y + T.height - Ge;
|
|
16867
16908
|
vt >= 0 && (L.height = Ge, L.y = vt);
|
|
16868
16909
|
}
|
|
16869
16910
|
}
|
|
@@ -16876,7 +16917,7 @@ function Oy({
|
|
|
16876
16917
|
}, re = () => {
|
|
16877
16918
|
const ee = u.current;
|
|
16878
16919
|
if (!ee) return;
|
|
16879
|
-
const { width: Se, height: ie } =
|
|
16920
|
+
const { width: Se, height: ie } = M(), Re = y.x / 100 * Se, ke = y.y / 100 * ie, Ae = y.width / 100 * Se, qe = y.height / 100 * ie, ze = document.createElement("canvas"), He = ze.getContext("2d");
|
|
16880
16921
|
if (!He) return;
|
|
16881
16922
|
ze.width = Ae, ze.height = qe;
|
|
16882
16923
|
const Y = document.createElement("canvas"), L = Y.getContext("2d");
|
|
@@ -16961,11 +17002,11 @@ function Oy({
|
|
|
16961
17002
|
{
|
|
16962
17003
|
ref: l,
|
|
16963
17004
|
style: {
|
|
16964
|
-
cursor:
|
|
17005
|
+
cursor: D ? "grabbing" : w ? "nwse-resize" : "grab",
|
|
16965
17006
|
maxWidth: "100%",
|
|
16966
17007
|
maxHeight: "100%"
|
|
16967
17008
|
},
|
|
16968
|
-
onMouseDown:
|
|
17009
|
+
onMouseDown: R,
|
|
16969
17010
|
onMouseMove: O,
|
|
16970
17011
|
onMouseUp: V,
|
|
16971
17012
|
onMouseLeave: V
|
|
@@ -17214,10 +17255,10 @@ function Wg(r, e) {
|
|
|
17214
17255
|
for (var s = i.length, o = new Array(s), a = new Array(s), l = new Array(s), u = 0; u < s; ++u) {
|
|
17215
17256
|
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);
|
|
17216
17257
|
t(c, d, m, x, b, p, e);
|
|
17217
|
-
for (var y = 0, _ = 0,
|
|
17218
|
-
if (
|
|
17258
|
+
for (var y = 0, _ = 0, D, E; y < g; ++y)
|
|
17259
|
+
if (D = m[y]) {
|
|
17219
17260
|
for (y >= _ && (_ = y + 1); !(E = x[_]) && ++_ < g; ) ;
|
|
17220
|
-
|
|
17261
|
+
D._next = E || null;
|
|
17221
17262
|
}
|
|
17222
17263
|
}
|
|
17223
17264
|
return o = new Ft(o, n), o._enter = a, o._exit = l, o;
|
|
@@ -18097,12 +18138,12 @@ const Am = function r(e, t, n) {
|
|
|
18097
18138
|
];
|
|
18098
18139
|
};
|
|
18099
18140
|
else {
|
|
18100
|
-
var y = Math.sqrt(m), _ = (f * f - u * u + n * m) / (2 * u * t * y),
|
|
18101
|
-
b = (
|
|
18102
|
-
var S = v * b, F = Ja(E),
|
|
18141
|
+
var y = Math.sqrt(m), _ = (f * f - u * u + n * m) / (2 * u * t * y), D = (f * f - u * u - n * m) / (2 * f * t * y), E = Math.log(Math.sqrt(_ * _ + 1) - _), w = Math.log(Math.sqrt(D * D + 1) - D);
|
|
18142
|
+
b = (w - E) / e, x = function(v) {
|
|
18143
|
+
var S = v * b, F = Ja(E), T = u / (t * y) * (F * km(e * S + E) - Sm(E));
|
|
18103
18144
|
return [
|
|
18104
|
-
a +
|
|
18105
|
-
l +
|
|
18145
|
+
a + T * p,
|
|
18146
|
+
l + T * g,
|
|
18106
18147
|
u * F / Ja(e * S + E)
|
|
18107
18148
|
];
|
|
18108
18149
|
};
|
|
@@ -18781,57 +18822,57 @@ function H2(r, e, t) {
|
|
|
18781
18822
|
}
|
|
18782
18823
|
function V2() {
|
|
18783
18824
|
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;
|
|
18784
|
-
function b(
|
|
18785
|
-
|
|
18825
|
+
function b(C) {
|
|
18826
|
+
C.property("__zoom", nu).on("wheel.zoom", S, { passive: !1 }).on("mousedown.zoom", F).on("dblclick.zoom", T).filter(i).on("touchstart.zoom", A).on("touchmove.zoom", B).on("touchend.zoom touchcancel.zoom", M).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
|
18786
18827
|
}
|
|
18787
|
-
b.transform = function(
|
|
18788
|
-
var V =
|
|
18789
|
-
V.property("__zoom", nu),
|
|
18790
|
-
|
|
18828
|
+
b.transform = function(C, N, R, O) {
|
|
18829
|
+
var V = C.selection ? C.selection() : C;
|
|
18830
|
+
V.property("__zoom", nu), C !== V ? E(C, N, R, O) : V.interrupt().each(function() {
|
|
18831
|
+
w(this, arguments).event(O).start().zoom(null, typeof N == "function" ? N.apply(this, arguments) : N).end();
|
|
18791
18832
|
});
|
|
18792
|
-
}, b.scaleBy = function(
|
|
18793
|
-
b.scaleTo(
|
|
18833
|
+
}, b.scaleBy = function(C, N, R, O) {
|
|
18834
|
+
b.scaleTo(C, function() {
|
|
18794
18835
|
var V = this.__zoom.k, U = typeof N == "function" ? N.apply(this, arguments) : N;
|
|
18795
18836
|
return V * U;
|
|
18796
|
-
},
|
|
18797
|
-
}, b.scaleTo = function(
|
|
18798
|
-
b.transform(
|
|
18799
|
-
var V = e.apply(this, arguments), U = this.__zoom, re =
|
|
18837
|
+
}, R, O);
|
|
18838
|
+
}, b.scaleTo = function(C, N, R, O) {
|
|
18839
|
+
b.transform(C, function() {
|
|
18840
|
+
var V = e.apply(this, arguments), U = this.__zoom, re = R == null ? D(V) : typeof R == "function" ? R.apply(this, arguments) : R, q = U.invert(re), Z = typeof N == "function" ? N.apply(this, arguments) : N;
|
|
18800
18841
|
return t(_(y(U, Z), re, q), V, o);
|
|
18801
|
-
},
|
|
18802
|
-
}, b.translateBy = function(
|
|
18803
|
-
b.transform(
|
|
18842
|
+
}, R, O);
|
|
18843
|
+
}, b.translateBy = function(C, N, R, O) {
|
|
18844
|
+
b.transform(C, function() {
|
|
18804
18845
|
return t(this.__zoom.translate(
|
|
18805
18846
|
typeof N == "function" ? N.apply(this, arguments) : N,
|
|
18806
|
-
typeof
|
|
18847
|
+
typeof R == "function" ? R.apply(this, arguments) : R
|
|
18807
18848
|
), e.apply(this, arguments), o);
|
|
18808
18849
|
}, null, O);
|
|
18809
|
-
}, b.translateTo = function(
|
|
18810
|
-
b.transform(
|
|
18811
|
-
var U = e.apply(this, arguments), re = this.__zoom, q = O == null ?
|
|
18850
|
+
}, b.translateTo = function(C, N, R, O, V) {
|
|
18851
|
+
b.transform(C, function() {
|
|
18852
|
+
var U = e.apply(this, arguments), re = this.__zoom, q = O == null ? D(U) : typeof O == "function" ? O.apply(this, arguments) : O;
|
|
18812
18853
|
return t(ls.translate(q[0], q[1]).scale(re.k).translate(
|
|
18813
18854
|
typeof N == "function" ? -N.apply(this, arguments) : -N,
|
|
18814
|
-
typeof
|
|
18855
|
+
typeof R == "function" ? -R.apply(this, arguments) : -R
|
|
18815
18856
|
), U, o);
|
|
18816
18857
|
}, O, V);
|
|
18817
18858
|
};
|
|
18818
|
-
function y(
|
|
18819
|
-
return N = Math.max(s[0], Math.min(s[1], N)), N ===
|
|
18859
|
+
function y(C, N) {
|
|
18860
|
+
return N = Math.max(s[0], Math.min(s[1], N)), N === C.k ? C : new ar(N, C.x, C.y);
|
|
18820
18861
|
}
|
|
18821
|
-
function _(
|
|
18822
|
-
var O = N[0] -
|
|
18823
|
-
return O ===
|
|
18862
|
+
function _(C, N, R) {
|
|
18863
|
+
var O = N[0] - R[0] * C.k, V = N[1] - R[1] * C.k;
|
|
18864
|
+
return O === C.x && V === C.y ? C : new ar(C.k, O, V);
|
|
18824
18865
|
}
|
|
18825
|
-
function
|
|
18826
|
-
return [(+
|
|
18866
|
+
function D(C) {
|
|
18867
|
+
return [(+C[0][0] + +C[1][0]) / 2, (+C[0][1] + +C[1][1]) / 2];
|
|
18827
18868
|
}
|
|
18828
|
-
function E(
|
|
18829
|
-
|
|
18830
|
-
|
|
18869
|
+
function E(C, N, R, O) {
|
|
18870
|
+
C.on("start.zoom", function() {
|
|
18871
|
+
w(this, arguments).event(O).start();
|
|
18831
18872
|
}).on("interrupt.zoom end.zoom", function() {
|
|
18832
|
-
|
|
18873
|
+
w(this, arguments).event(O).end();
|
|
18833
18874
|
}).tween("zoom", function() {
|
|
18834
|
-
var V = this, U = arguments, re =
|
|
18875
|
+
var V = this, U = arguments, re = w(V, U).event(O), q = e.apply(V, U), Z = R == null ? D(q) : typeof R == "function" ? R.apply(V, U) : R, W = Math.max(q[1][0] - q[0][0], q[1][1] - q[0][1]), se = V.__zoom, ce = typeof N == "function" ? N.apply(V, U) : N, fe = l(se.invert(Z).concat(W / se.k), ce.invert(Z).concat(W / ce.k));
|
|
18835
18876
|
return function(ge) {
|
|
18836
18877
|
if (ge === 1) ge = ce;
|
|
18837
18878
|
else {
|
|
@@ -18842,31 +18883,31 @@ function V2() {
|
|
|
18842
18883
|
};
|
|
18843
18884
|
});
|
|
18844
18885
|
}
|
|
18845
|
-
function C
|
|
18846
|
-
return !
|
|
18886
|
+
function w(C, N, R) {
|
|
18887
|
+
return !R && C.__zooming || new v(C, N);
|
|
18847
18888
|
}
|
|
18848
|
-
function v(
|
|
18849
|
-
this.that =
|
|
18889
|
+
function v(C, N) {
|
|
18890
|
+
this.that = C, this.args = N, this.active = 0, this.sourceEvent = null, this.extent = e.apply(C, N), this.taps = 0;
|
|
18850
18891
|
}
|
|
18851
18892
|
v.prototype = {
|
|
18852
|
-
event: function(
|
|
18853
|
-
return
|
|
18893
|
+
event: function(C) {
|
|
18894
|
+
return C && (this.sourceEvent = C), this;
|
|
18854
18895
|
},
|
|
18855
18896
|
start: function() {
|
|
18856
18897
|
return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
|
|
18857
18898
|
},
|
|
18858
|
-
zoom: function(
|
|
18859
|
-
return this.mouse &&
|
|
18899
|
+
zoom: function(C, N) {
|
|
18900
|
+
return this.mouse && C !== "mouse" && (this.mouse[1] = N.invert(this.mouse[0])), this.touch0 && C !== "touch" && (this.touch0[1] = N.invert(this.touch0[0])), this.touch1 && C !== "touch" && (this.touch1[1] = N.invert(this.touch1[0])), this.that.__zoom = N, this.emit("zoom"), this;
|
|
18860
18901
|
},
|
|
18861
18902
|
end: function() {
|
|
18862
18903
|
return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
|
18863
18904
|
},
|
|
18864
|
-
emit: function(
|
|
18905
|
+
emit: function(C) {
|
|
18865
18906
|
var N = $t(this.that).datum();
|
|
18866
18907
|
u.call(
|
|
18867
|
-
|
|
18908
|
+
C,
|
|
18868
18909
|
this.that,
|
|
18869
|
-
new z2(
|
|
18910
|
+
new z2(C, {
|
|
18870
18911
|
sourceEvent: this.sourceEvent,
|
|
18871
18912
|
target: b,
|
|
18872
18913
|
transform: this.that.__zoom,
|
|
@@ -18876,103 +18917,103 @@ function V2() {
|
|
|
18876
18917
|
);
|
|
18877
18918
|
}
|
|
18878
18919
|
};
|
|
18879
|
-
function S(
|
|
18920
|
+
function S(C, ...N) {
|
|
18880
18921
|
if (!r.apply(this, arguments)) return;
|
|
18881
|
-
var
|
|
18882
|
-
if (
|
|
18883
|
-
(
|
|
18922
|
+
var R = w(this, N).event(C), O = this.__zoom, V = Math.max(s[0], Math.min(s[1], O.k * Math.pow(2, n.apply(this, arguments)))), U = kr(C);
|
|
18923
|
+
if (R.wheel)
|
|
18924
|
+
(R.mouse[0][0] !== U[0] || R.mouse[0][1] !== U[1]) && (R.mouse[1] = O.invert(R.mouse[0] = U)), clearTimeout(R.wheel);
|
|
18884
18925
|
else {
|
|
18885
18926
|
if (O.k === V) return;
|
|
18886
|
-
|
|
18927
|
+
R.mouse = [U, O.invert(U)], Ni(this), R.start();
|
|
18887
18928
|
}
|
|
18888
|
-
Cn(
|
|
18929
|
+
Cn(C), R.wheel = setTimeout(re, g), R.zoom("mouse", t(_(y(O, V), R.mouse[0], R.mouse[1]), R.extent, o));
|
|
18889
18930
|
function re() {
|
|
18890
|
-
|
|
18931
|
+
R.wheel = null, R.end();
|
|
18891
18932
|
}
|
|
18892
18933
|
}
|
|
18893
|
-
function F(
|
|
18934
|
+
function F(C, ...N) {
|
|
18894
18935
|
if (f || !r.apply(this, arguments)) return;
|
|
18895
|
-
var
|
|
18896
|
-
tm(
|
|
18936
|
+
var R = C.currentTarget, O = w(this, N, !0).event(C), V = $t(C.view).on("mousemove.zoom", Z, !0).on("mouseup.zoom", W, !0), U = kr(C, R), re = C.clientX, q = C.clientY;
|
|
18937
|
+
tm(C.view), Xs(C), O.mouse = [U, this.__zoom.invert(U)], Ni(this), O.start();
|
|
18897
18938
|
function Z(se) {
|
|
18898
18939
|
if (Cn(se), !O.moved) {
|
|
18899
18940
|
var ce = se.clientX - re, fe = se.clientY - q;
|
|
18900
18941
|
O.moved = ce * ce + fe * fe > m;
|
|
18901
18942
|
}
|
|
18902
|
-
O.event(se).zoom("mouse", t(_(O.that.__zoom, O.mouse[0] = kr(se,
|
|
18943
|
+
O.event(se).zoom("mouse", t(_(O.that.__zoom, O.mouse[0] = kr(se, R), O.mouse[1]), O.extent, o));
|
|
18903
18944
|
}
|
|
18904
18945
|
function W(se) {
|
|
18905
18946
|
V.on("mousemove.zoom mouseup.zoom", null), rm(se.view, O.moved), Cn(se), O.event(se).end();
|
|
18906
18947
|
}
|
|
18907
18948
|
}
|
|
18908
|
-
function
|
|
18949
|
+
function T(C, ...N) {
|
|
18909
18950
|
if (r.apply(this, arguments)) {
|
|
18910
|
-
var
|
|
18911
|
-
Cn(
|
|
18951
|
+
var R = this.__zoom, O = kr(C.changedTouches ? C.changedTouches[0] : C, this), V = R.invert(O), U = R.k * (C.shiftKey ? 0.5 : 2), re = t(_(y(R, U), O, V), e.apply(this, N), o);
|
|
18952
|
+
Cn(C), a > 0 ? $t(this).transition().duration(a).call(E, re, O, C) : $t(this).call(b.transform, re, O, C);
|
|
18912
18953
|
}
|
|
18913
18954
|
}
|
|
18914
|
-
function
|
|
18955
|
+
function A(C, ...N) {
|
|
18915
18956
|
if (r.apply(this, arguments)) {
|
|
18916
|
-
var
|
|
18917
|
-
for (Xs(
|
|
18918
|
-
q =
|
|
18957
|
+
var R = C.touches, O = R.length, V = w(this, N, C.changedTouches.length === O).event(C), U, re, q, Z;
|
|
18958
|
+
for (Xs(C), re = 0; re < O; ++re)
|
|
18959
|
+
q = R[re], Z = kr(q, this), Z = [Z, this.__zoom.invert(Z), q.identifier], V.touch0 ? !V.touch1 && V.touch0[2] !== Z[2] && (V.touch1 = Z, V.taps = 0) : (V.touch0 = Z, U = !0, V.taps = 1 + !!c);
|
|
18919
18960
|
c && (c = clearTimeout(c)), U && (V.taps < 2 && (d = Z[0], c = setTimeout(function() {
|
|
18920
18961
|
c = null;
|
|
18921
18962
|
}, p)), Ni(this), V.start());
|
|
18922
18963
|
}
|
|
18923
18964
|
}
|
|
18924
|
-
function B(
|
|
18965
|
+
function B(C, ...N) {
|
|
18925
18966
|
if (this.__zooming) {
|
|
18926
|
-
var
|
|
18927
|
-
for (Cn(
|
|
18928
|
-
re = O[U], q = kr(re, this),
|
|
18929
|
-
if (re =
|
|
18930
|
-
var W =
|
|
18967
|
+
var R = w(this, N).event(C), O = C.changedTouches, V = O.length, U, re, q, Z;
|
|
18968
|
+
for (Cn(C), U = 0; U < V; ++U)
|
|
18969
|
+
re = O[U], q = kr(re, this), R.touch0 && R.touch0[2] === re.identifier ? R.touch0[0] = q : R.touch1 && R.touch1[2] === re.identifier && (R.touch1[0] = q);
|
|
18970
|
+
if (re = R.that.__zoom, R.touch1) {
|
|
18971
|
+
var W = R.touch0[0], se = R.touch0[1], ce = R.touch1[0], fe = R.touch1[1], ge = (ge = ce[0] - W[0]) * ge + (ge = ce[1] - W[1]) * ge, Be = (Be = fe[0] - se[0]) * Be + (Be = fe[1] - se[1]) * Be;
|
|
18931
18972
|
re = y(re, Math.sqrt(ge / Be)), q = [(W[0] + ce[0]) / 2, (W[1] + ce[1]) / 2], Z = [(se[0] + fe[0]) / 2, (se[1] + fe[1]) / 2];
|
|
18932
|
-
} else if (
|
|
18973
|
+
} else if (R.touch0) q = R.touch0[0], Z = R.touch0[1];
|
|
18933
18974
|
else return;
|
|
18934
|
-
|
|
18975
|
+
R.zoom("touch", t(_(re, q, Z), R.extent, o));
|
|
18935
18976
|
}
|
|
18936
18977
|
}
|
|
18937
|
-
function
|
|
18978
|
+
function M(C, ...N) {
|
|
18938
18979
|
if (this.__zooming) {
|
|
18939
|
-
var
|
|
18940
|
-
for (Xs(
|
|
18980
|
+
var R = w(this, N).event(C), O = C.changedTouches, V = O.length, U, re;
|
|
18981
|
+
for (Xs(C), f && clearTimeout(f), f = setTimeout(function() {
|
|
18941
18982
|
f = null;
|
|
18942
18983
|
}, p), U = 0; U < V; ++U)
|
|
18943
|
-
re = O[U],
|
|
18944
|
-
if (
|
|
18945
|
-
else if (
|
|
18984
|
+
re = O[U], R.touch0 && R.touch0[2] === re.identifier ? delete R.touch0 : R.touch1 && R.touch1[2] === re.identifier && delete R.touch1;
|
|
18985
|
+
if (R.touch1 && !R.touch0 && (R.touch0 = R.touch1, delete R.touch1), R.touch0) R.touch0[1] = this.__zoom.invert(R.touch0[0]);
|
|
18986
|
+
else if (R.end(), R.taps === 2 && (re = kr(re, this), Math.hypot(d[0] - re[0], d[1] - re[1]) < x)) {
|
|
18946
18987
|
var q = $t(this).on("dblclick.zoom");
|
|
18947
18988
|
q && q.apply(this, arguments);
|
|
18948
18989
|
}
|
|
18949
18990
|
}
|
|
18950
18991
|
}
|
|
18951
|
-
return b.wheelDelta = function(
|
|
18952
|
-
return arguments.length ? (n = typeof
|
|
18953
|
-
}, b.filter = function(
|
|
18954
|
-
return arguments.length ? (r = typeof
|
|
18955
|
-
}, b.touchable = function(
|
|
18956
|
-
return arguments.length ? (i = typeof
|
|
18957
|
-
}, b.extent = function(
|
|
18958
|
-
return arguments.length ? (e = typeof
|
|
18959
|
-
}, b.scaleExtent = function(
|
|
18960
|
-
return arguments.length ? (s[0] = +
|
|
18961
|
-
}, b.translateExtent = function(
|
|
18962
|
-
return arguments.length ? (o[0][0] = +
|
|
18963
|
-
}, b.constrain = function(
|
|
18964
|
-
return arguments.length ? (t =
|
|
18965
|
-
}, b.duration = function(
|
|
18966
|
-
return arguments.length ? (a = +
|
|
18967
|
-
}, b.interpolate = function(
|
|
18968
|
-
return arguments.length ? (l =
|
|
18992
|
+
return b.wheelDelta = function(C) {
|
|
18993
|
+
return arguments.length ? (n = typeof C == "function" ? C : Ei(+C), b) : n;
|
|
18994
|
+
}, b.filter = function(C) {
|
|
18995
|
+
return arguments.length ? (r = typeof C == "function" ? C : Ei(!!C), b) : r;
|
|
18996
|
+
}, b.touchable = function(C) {
|
|
18997
|
+
return arguments.length ? (i = typeof C == "function" ? C : Ei(!!C), b) : i;
|
|
18998
|
+
}, b.extent = function(C) {
|
|
18999
|
+
return arguments.length ? (e = typeof C == "function" ? C : Ei([[+C[0][0], +C[0][1]], [+C[1][0], +C[1][1]]]), b) : e;
|
|
19000
|
+
}, b.scaleExtent = function(C) {
|
|
19001
|
+
return arguments.length ? (s[0] = +C[0], s[1] = +C[1], b) : [s[0], s[1]];
|
|
19002
|
+
}, b.translateExtent = function(C) {
|
|
19003
|
+
return arguments.length ? (o[0][0] = +C[0][0], o[1][0] = +C[1][0], o[0][1] = +C[0][1], o[1][1] = +C[1][1], b) : [[o[0][0], o[0][1]], [o[1][0], o[1][1]]];
|
|
19004
|
+
}, b.constrain = function(C) {
|
|
19005
|
+
return arguments.length ? (t = C, b) : t;
|
|
19006
|
+
}, b.duration = function(C) {
|
|
19007
|
+
return arguments.length ? (a = +C, b) : a;
|
|
19008
|
+
}, b.interpolate = function(C) {
|
|
19009
|
+
return arguments.length ? (l = C, b) : l;
|
|
18969
19010
|
}, b.on = function() {
|
|
18970
|
-
var
|
|
18971
|
-
return
|
|
18972
|
-
}, b.clickDistance = function(
|
|
18973
|
-
return arguments.length ? (m = (
|
|
18974
|
-
}, b.tapDistance = function(
|
|
18975
|
-
return arguments.length ? (x = +
|
|
19011
|
+
var C = u.on.apply(u, arguments);
|
|
19012
|
+
return C === u ? b : C;
|
|
19013
|
+
}, b.clickDistance = function(C) {
|
|
19014
|
+
return arguments.length ? (m = (C = +C) * C, b) : Math.sqrt(m);
|
|
19015
|
+
}, b.tapDistance = function(C) {
|
|
19016
|
+
return arguments.length ? (x = +C, b) : x;
|
|
18976
19017
|
}, b;
|
|
18977
19018
|
}
|
|
18978
19019
|
function G2(r = {}) {
|
|
@@ -19016,8 +19057,8 @@ function G2(r = {}) {
|
|
|
19016
19057
|
}, [o]);
|
|
19017
19058
|
const d = J((x, b, y, _ = !0) => {
|
|
19018
19059
|
if (!a.current || !l.current) return;
|
|
19019
|
-
const
|
|
19020
|
-
|
|
19060
|
+
const D = $t(a.current), E = ls.translate(x, b).scale(y);
|
|
19061
|
+
D.call(l.current.transform, E);
|
|
19021
19062
|
}, []), f = J(() => {
|
|
19022
19063
|
!a.current || !l.current || $t(a.current).call(l.current.scaleBy, 1.3);
|
|
19023
19064
|
}, []), p = J(() => {
|
|
@@ -19027,13 +19068,13 @@ function G2(r = {}) {
|
|
|
19027
19068
|
}, [d]), m = J((x, b = 50) => {
|
|
19028
19069
|
if (!a.current || !l.current || x.length === 0) return;
|
|
19029
19070
|
const _ = a.current.getBoundingClientRect();
|
|
19030
|
-
let
|
|
19071
|
+
let D = 1 / 0, E = 1 / 0, w = -1 / 0, v = -1 / 0;
|
|
19031
19072
|
for (const O of x) {
|
|
19032
19073
|
const V = O.width || 200, U = O.height || 100;
|
|
19033
|
-
|
|
19074
|
+
D = Math.min(D, O.x), E = Math.min(E, O.y), w = Math.max(w, O.x + V), v = Math.max(v, O.y + U);
|
|
19034
19075
|
}
|
|
19035
|
-
const S =
|
|
19036
|
-
d(N,
|
|
19076
|
+
const S = w - D, F = v - E, T = (_.width - b * 2) / S, A = (_.height - b * 2) / F, B = Math.min(T, A, t), M = (D + w) / 2, C = (E + v) / 2, N = _.width / 2 - M * B, R = _.height / 2 - C * B;
|
|
19077
|
+
d(N, R, B, !0);
|
|
19037
19078
|
}, [t, d]);
|
|
19038
19079
|
return {
|
|
19039
19080
|
transform: u,
|
|
@@ -19056,26 +19097,26 @@ function K2(r) {
|
|
|
19056
19097
|
Ee(() => {
|
|
19057
19098
|
g.current = e;
|
|
19058
19099
|
}, [e]);
|
|
19059
|
-
const m = J((_,
|
|
19100
|
+
const m = J((_, D) => {
|
|
19060
19101
|
const E = g.current;
|
|
19061
19102
|
return {
|
|
19062
19103
|
x: (_ - E.x) / E.k,
|
|
19063
|
-
y: (
|
|
19104
|
+
y: (D - E.y) / E.k
|
|
19064
19105
|
};
|
|
19065
|
-
}, []), x = J((_,
|
|
19106
|
+
}, []), x = J((_, D) => {
|
|
19066
19107
|
if (s) return;
|
|
19067
|
-
|
|
19068
|
-
const E =
|
|
19108
|
+
D.preventDefault(), D.stopPropagation();
|
|
19109
|
+
const E = D.currentTarget, w = parseFloat(E.dataset.x || "0"), v = parseFloat(E.dataset.y || "0");
|
|
19069
19110
|
f.current = {
|
|
19070
|
-
x:
|
|
19071
|
-
y:
|
|
19072
|
-
nodeX:
|
|
19111
|
+
x: D.clientX,
|
|
19112
|
+
y: D.clientY,
|
|
19113
|
+
nodeX: w,
|
|
19073
19114
|
nodeY: v
|
|
19074
|
-
}, p.current = { x:
|
|
19115
|
+
}, p.current = { x: w, y: v }, a(_), u(!0), d({ x: 0, y: 0 }), t == null || t(_);
|
|
19075
19116
|
}, [s, m, t]), b = J((_) => {
|
|
19076
19117
|
if (!l || !o || !f.current) return;
|
|
19077
|
-
const
|
|
19078
|
-
p.current = { x:
|
|
19118
|
+
const D = g.current, E = f.current, w = _.clientX - E.x, v = _.clientY - E.y, S = w / D.k, F = v / D.k, T = E.nodeX + S, A = E.nodeY + F;
|
|
19119
|
+
p.current = { x: T, y: A }, d({ x: S, y: F }), n == null || n(o, T, A, S, F);
|
|
19079
19120
|
}, [l, o, n]), y = J(() => {
|
|
19080
19121
|
if (!l || !o) return;
|
|
19081
19122
|
const _ = p.current;
|
|
@@ -19085,11 +19126,11 @@ function K2(r) {
|
|
|
19085
19126
|
if (!l) return;
|
|
19086
19127
|
const _ = (E) => {
|
|
19087
19128
|
b(E);
|
|
19088
|
-
},
|
|
19129
|
+
}, D = () => {
|
|
19089
19130
|
y();
|
|
19090
19131
|
};
|
|
19091
|
-
return window.addEventListener("mousemove", _), window.addEventListener("mouseup",
|
|
19092
|
-
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup",
|
|
19132
|
+
return window.addEventListener("mousemove", _), window.addEventListener("mouseup", D), () => {
|
|
19133
|
+
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", D);
|
|
19093
19134
|
};
|
|
19094
19135
|
}, [l, b, y]), {
|
|
19095
19136
|
draggedNodeId: o,
|
|
@@ -19107,71 +19148,71 @@ function Y2(r) {
|
|
|
19107
19148
|
disabled: n = !1,
|
|
19108
19149
|
controlledSelectedIds: i,
|
|
19109
19150
|
onSelectionChange: s
|
|
19110
|
-
} = r, [o, a] = I(/* @__PURE__ */ new Set()), l = i !== void 0, u = l ? new Set(i) : o, c = l ? (
|
|
19111
|
-
const
|
|
19112
|
-
s == null || s(Array.from(
|
|
19151
|
+
} = r, [o, a] = I(/* @__PURE__ */ new Set()), l = i !== void 0, u = l ? new Set(i) : o, c = l ? (T) => {
|
|
19152
|
+
const A = typeof T == "function" ? T(u) : T;
|
|
19153
|
+
s == null || s(Array.from(A));
|
|
19113
19154
|
} : a, [d, f] = I(null), [p, g] = I(!1), m = be(null), x = be(e), b = be(t);
|
|
19114
19155
|
Ee(() => {
|
|
19115
19156
|
x.current = e;
|
|
19116
19157
|
}, [e]), Ee(() => {
|
|
19117
19158
|
b.current = t;
|
|
19118
19159
|
}, [t]);
|
|
19119
|
-
const y = J((
|
|
19160
|
+
const y = J((T, A) => {
|
|
19120
19161
|
const B = x.current;
|
|
19121
19162
|
return {
|
|
19122
|
-
x: (
|
|
19123
|
-
y: (
|
|
19163
|
+
x: (T - B.x) / B.k,
|
|
19164
|
+
y: (A - B.y) / B.k
|
|
19124
19165
|
};
|
|
19125
|
-
}, []), _ = J((
|
|
19126
|
-
const B = b.current.get(
|
|
19166
|
+
}, []), _ = J((T, A) => {
|
|
19167
|
+
const B = b.current.get(T);
|
|
19127
19168
|
if (!B) return !1;
|
|
19128
|
-
const
|
|
19129
|
-
return B.x <
|
|
19130
|
-
}, []),
|
|
19131
|
-
if (n ||
|
|
19132
|
-
|
|
19133
|
-
const B = y(
|
|
19169
|
+
const M = B.width || 200, C = B.height || 100;
|
|
19170
|
+
return B.x < A.x + A.width && B.x + M > A.x && B.y < A.y + A.height && B.y + C > A.y;
|
|
19171
|
+
}, []), D = J((T) => {
|
|
19172
|
+
if (n || T.target.closest("[data-qmap-node]")) return;
|
|
19173
|
+
T.preventDefault();
|
|
19174
|
+
const B = y(T.clientX, T.clientY);
|
|
19134
19175
|
m.current = B, f({
|
|
19135
19176
|
x: B.x,
|
|
19136
19177
|
y: B.y,
|
|
19137
19178
|
width: 0,
|
|
19138
19179
|
height: 0
|
|
19139
|
-
}), g(!0),
|
|
19140
|
-
}, [n, y]), E = J((
|
|
19180
|
+
}), g(!0), T.shiftKey || c(/* @__PURE__ */ new Set());
|
|
19181
|
+
}, [n, y]), E = J((T) => {
|
|
19141
19182
|
if (!p || !m.current) return;
|
|
19142
|
-
const
|
|
19143
|
-
x: Math.min(
|
|
19144
|
-
y: Math.min(
|
|
19145
|
-
width: Math.abs(B.x -
|
|
19146
|
-
height: Math.abs(B.y -
|
|
19183
|
+
const A = m.current, B = y(T.clientX, T.clientY), M = {
|
|
19184
|
+
x: Math.min(A.x, B.x),
|
|
19185
|
+
y: Math.min(A.y, B.y),
|
|
19186
|
+
width: Math.abs(B.x - A.x),
|
|
19187
|
+
height: Math.abs(B.y - A.y)
|
|
19147
19188
|
};
|
|
19148
|
-
f(
|
|
19149
|
-
const
|
|
19189
|
+
f(M);
|
|
19190
|
+
const C = /* @__PURE__ */ new Set();
|
|
19150
19191
|
for (const [N] of b.current)
|
|
19151
|
-
_(N,
|
|
19152
|
-
c(
|
|
19153
|
-
}, [p, y, _]),
|
|
19192
|
+
_(N, M) && C.add(N);
|
|
19193
|
+
c(C);
|
|
19194
|
+
}, [p, y, _]), w = J(() => {
|
|
19154
19195
|
p && (s == null || s(Array.from(u)), g(!1), f(null), m.current = null);
|
|
19155
19196
|
}, [p, u, s]);
|
|
19156
19197
|
Ee(() => {
|
|
19157
19198
|
if (!p) return;
|
|
19158
|
-
const
|
|
19199
|
+
const T = (B) => {
|
|
19159
19200
|
E(B);
|
|
19160
|
-
},
|
|
19161
|
-
|
|
19201
|
+
}, A = () => {
|
|
19202
|
+
w();
|
|
19162
19203
|
};
|
|
19163
|
-
return window.addEventListener("mousemove",
|
|
19164
|
-
window.removeEventListener("mousemove",
|
|
19204
|
+
return window.addEventListener("mousemove", T), window.addEventListener("mouseup", A), () => {
|
|
19205
|
+
window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", A);
|
|
19165
19206
|
};
|
|
19166
|
-
}, [p, E,
|
|
19167
|
-
const v = J((
|
|
19207
|
+
}, [p, E, w]);
|
|
19208
|
+
const v = J((T, A = !1) => {
|
|
19168
19209
|
c((B) => {
|
|
19169
|
-
const
|
|
19170
|
-
return B.has(
|
|
19210
|
+
const M = new Set(A ? B : []);
|
|
19211
|
+
return B.has(T) && A ? M.delete(T) : M.add(T), s == null || s(Array.from(M)), M;
|
|
19171
19212
|
});
|
|
19172
19213
|
}, [s]), S = J(() => {
|
|
19173
|
-
const
|
|
19174
|
-
c(
|
|
19214
|
+
const T = new Set(b.current.keys());
|
|
19215
|
+
c(T), s == null || s(Array.from(T));
|
|
19175
19216
|
}, [s]), F = J(() => {
|
|
19176
19217
|
c(/* @__PURE__ */ new Set()), s == null || s([]);
|
|
19177
19218
|
}, [s]);
|
|
@@ -19180,9 +19221,9 @@ function Y2(r) {
|
|
|
19180
19221
|
setSelectedIds: c,
|
|
19181
19222
|
selectionBox: d,
|
|
19182
19223
|
isSelecting: p,
|
|
19183
|
-
startSelection:
|
|
19224
|
+
startSelection: D,
|
|
19184
19225
|
updateSelection: E,
|
|
19185
|
-
endSelection:
|
|
19226
|
+
endSelection: w,
|
|
19186
19227
|
toggleSelect: v,
|
|
19187
19228
|
selectAll: S,
|
|
19188
19229
|
clearSelection: F
|
|
@@ -19503,18 +19544,18 @@ function Gy({
|
|
|
19503
19544
|
initialTransform: b,
|
|
19504
19545
|
defaultEdgeStyle: y = oy,
|
|
19505
19546
|
defaultEdgeColor: _ = ly,
|
|
19506
|
-
defaultEdgeWidth:
|
|
19547
|
+
defaultEdgeWidth: D = ay,
|
|
19507
19548
|
draggable: E = !0,
|
|
19508
|
-
selectable:
|
|
19549
|
+
selectable: w = !0,
|
|
19509
19550
|
zoomable: v = !0,
|
|
19510
19551
|
pannable: S = !0,
|
|
19511
19552
|
className: F = "",
|
|
19512
|
-
style:
|
|
19513
|
-
background:
|
|
19553
|
+
style: T,
|
|
19554
|
+
background: A = "#f8fafc",
|
|
19514
19555
|
showGrid: B = !1,
|
|
19515
|
-
gridSize:
|
|
19556
|
+
gridSize: M = 20
|
|
19516
19557
|
}) {
|
|
19517
|
-
const
|
|
19558
|
+
const C = r.data || { positions: {} }, N = C.positions || {}, R = ct(() => {
|
|
19518
19559
|
const Y = /* @__PURE__ */ new Map();
|
|
19519
19560
|
for (const L of e) {
|
|
19520
19561
|
const ye = N[L._id] || { x: 0, y: 0 };
|
|
@@ -19538,13 +19579,13 @@ function Gy({
|
|
|
19538
19579
|
} = G2({
|
|
19539
19580
|
minZoom: m,
|
|
19540
19581
|
maxZoom: x,
|
|
19541
|
-
initialTransform: b ||
|
|
19582
|
+
initialTransform: b || C.transform,
|
|
19542
19583
|
zoomable: v,
|
|
19543
19584
|
pannable: S,
|
|
19544
19585
|
onTransformChange: (Y) => {
|
|
19545
19586
|
g == null || g(Y);
|
|
19546
19587
|
const L = {
|
|
19547
|
-
...
|
|
19588
|
+
...C,
|
|
19548
19589
|
transform: Y
|
|
19549
19590
|
};
|
|
19550
19591
|
p == null || p(L);
|
|
@@ -19558,7 +19599,7 @@ function Gy({
|
|
|
19558
19599
|
transform: O,
|
|
19559
19600
|
disabled: !E,
|
|
19560
19601
|
onDragStart: (Y) => {
|
|
19561
|
-
const L =
|
|
19602
|
+
const L = R.get(Y);
|
|
19562
19603
|
L && se(/* @__PURE__ */ new Map([[Y, { x: L.x, y: L.y }]]));
|
|
19563
19604
|
},
|
|
19564
19605
|
onDragMove: (Y, L, ye) => {
|
|
@@ -19577,19 +19618,19 @@ function Gy({
|
|
|
19577
19618
|
clearSelection: ie
|
|
19578
19619
|
} = Y2({
|
|
19579
19620
|
transform: O,
|
|
19580
|
-
nodePositions:
|
|
19581
|
-
disabled: !
|
|
19621
|
+
nodePositions: R,
|
|
19622
|
+
disabled: !w,
|
|
19582
19623
|
controlledSelectedIds: c,
|
|
19583
19624
|
onSelectionChange: d
|
|
19584
19625
|
}), Re = J((Y) => {
|
|
19585
|
-
const L =
|
|
19626
|
+
const L = R.get(Y) || { x: 0, y: 0, width: i, height: s }, ye = W.get(Y);
|
|
19586
19627
|
return ye ? { ...L, x: ye.x, y: ye.y } : L;
|
|
19587
|
-
}, [
|
|
19628
|
+
}, [R, W, i, s]), ke = ct(() => {
|
|
19588
19629
|
const Y = /* @__PURE__ */ new Map();
|
|
19589
|
-
for (const L of
|
|
19630
|
+
for (const L of R.keys())
|
|
19590
19631
|
Y.set(L, Re(L));
|
|
19591
19632
|
return Y;
|
|
19592
|
-
}, [
|
|
19633
|
+
}, [R, Re]), Ae = J((Y, L) => {
|
|
19593
19634
|
Se(Y._id, L.shiftKey), a == null || a(Y, L);
|
|
19594
19635
|
}, [Se, a]), qe = J((Y) => {
|
|
19595
19636
|
Y.target.closest("[data-qmap-node]") || ie();
|
|
@@ -19609,11 +19650,11 @@ function Gy({
|
|
|
19609
19650
|
width: "100%",
|
|
19610
19651
|
height: "100%",
|
|
19611
19652
|
overflow: "hidden",
|
|
19612
|
-
background:
|
|
19653
|
+
background: A,
|
|
19613
19654
|
backgroundImage: He,
|
|
19614
|
-
backgroundSize: B ? `${
|
|
19655
|
+
backgroundSize: B ? `${M}px ${M}px` : void 0,
|
|
19615
19656
|
cursor: _e ? "crosshair" : S ? "grab" : "default",
|
|
19616
|
-
...
|
|
19657
|
+
...T
|
|
19617
19658
|
},
|
|
19618
19659
|
onMouseDown: ze,
|
|
19619
19660
|
onClick: qe,
|
|
@@ -19636,7 +19677,7 @@ function Gy({
|
|
|
19636
19677
|
nodePositions: ke,
|
|
19637
19678
|
defaultStyle: y,
|
|
19638
19679
|
defaultColor: _,
|
|
19639
|
-
defaultWidth:
|
|
19680
|
+
defaultWidth: D,
|
|
19640
19681
|
onEdgeClick: f
|
|
19641
19682
|
}
|
|
19642
19683
|
),
|
|
@@ -19746,7 +19787,7 @@ function Gy({
|
|
|
19746
19787
|
/* @__PURE__ */ h.jsx(
|
|
19747
19788
|
"button",
|
|
19748
19789
|
{
|
|
19749
|
-
onClick: () => Z(Array.from(
|
|
19790
|
+
onClick: () => Z(Array.from(R.values())),
|
|
19750
19791
|
style: {
|
|
19751
19792
|
width: 32,
|
|
19752
19793
|
height: 32,
|