@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/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 _, w, E, C, v;
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 = (w = g.envelope) == null ? void 0 : w.from) == null ? void 0 : E.email) || "Unknown", b = ((C = g.envelope) == null ? void 0 : C.subject) || "(No subject)", y = ((v = g.envelope) == null ? void 0 : v.date) || "";
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((w) => w.command === "UID FETCH");
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((w) => ({ filename: w.filename, mimeType: w.mimeType, contentId: w.contentId })));
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 w of u.attachments || [])
3700
- if (w.contentId) {
3701
- const E = this.contentToBase64(w.content), C = `data:${w.mimeType};base64,${E}`, v = w.contentId.replace(/^<|>$/g, "");
3702
- c.set(v, C), c.set(`<${v}>`, C);
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, (w, E) => {
3706
- const C = c.get(E) || c.get(`<${E}>`);
3707
- return C ? `src="${C}"` : w;
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((w) => w.toLowerCase().includes("seen"))) || !1, p = ((y = u.from) == null ? void 0 : y.address) || ((_ = u.from) == null ? void 0 : _.name) || "Unknown";
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((w) => ({
3720
- filename: w.filename || "attachment",
3721
- mimeType: w.mimeType || "application/octet-stream",
3722
- size: this.getContentSize(w.content)
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(T) {
4422
- if (T === null || typeof T != "object")
4421
+ function x(k) {
4422
+ if (k === null || typeof k != "object")
4423
4423
  return null;
4424
- var $ = g && T[g] || T[m];
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(T) {
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", T, te);
4432
+ _("error", k, te);
4433
4433
  }
4434
4434
  }
4435
- function _(T, $, te) {
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[T], console, $e);
4442
+ $e.unshift("Warning: " + $), Function.prototype.apply.call(console[k], console, $e);
4443
4443
  }
4444
4444
  }
4445
- var w = !1, E = !1, C = !1, v = !1, S = !1, F;
4445
+ var D = !1, E = !1, w = !1, v = !1, S = !1, F;
4446
4446
  F = Symbol.for("react.module.reference");
4447
- function A(T) {
4448
- return !!(typeof T == "string" || typeof T == "function" || T === n || T === s || S || T === i || T === u || T === c || v || T === p || w || E || C || typeof T == "object" && T !== null && (T.$$typeof === f || T.$$typeof === d || T.$$typeof === o || T.$$typeof === a || T.$$typeof === l || // This needs to include all possible module reference object
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
- T.$$typeof === F || T.getModuleId !== void 0));
4452
+ k.$$typeof === F || k.getModuleId !== void 0));
4453
4453
  }
4454
- function k(T, $, te) {
4455
- var pe = T.displayName;
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(T) {
4462
- return T.displayName || "Context";
4461
+ function B(k) {
4462
+ return k.displayName || "Context";
4463
4463
  }
4464
- function R(T) {
4465
- if (T == null)
4464
+ function M(k) {
4465
+ if (k == null)
4466
4466
  return null;
4467
- if (typeof T.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof T == "function")
4468
- return T.displayName || T.name || null;
4469
- if (typeof T == "string")
4470
- return T;
4471
- switch (T) {
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 T == "object")
4486
- switch (T.$$typeof) {
4485
+ if (typeof k == "object")
4486
+ switch (k.$$typeof) {
4487
4487
  case a:
4488
- var $ = T;
4488
+ var $ = k;
4489
4489
  return B($) + ".Consumer";
4490
4490
  case o:
4491
- var te = T;
4491
+ var te = k;
4492
4492
  return B(te._context) + ".Provider";
4493
4493
  case l:
4494
- return k(T, T.render, "ForwardRef");
4494
+ return A(k, k.render, "ForwardRef");
4495
4495
  case d:
4496
- var pe = T.displayName || null;
4497
- return pe !== null ? pe : R(T.type) || "Memo";
4496
+ var pe = k.displayName || null;
4497
+ return pe !== null ? pe : M(k.type) || "Memo";
4498
4498
  case f: {
4499
- var je = T, $e = je._payload, Fe = je._init;
4499
+ var je = k, $e = je._payload, Fe = je._init;
4500
4500
  try {
4501
- return R(Fe($e));
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 D = Object.assign, N = 0, M, O, V, U, re, q, Z;
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
- M = console.log, O = console.info, V = console.warn, U = console.error, re = console.group, q = console.groupCollapsed, Z = console.groupEnd;
4517
- var T = {
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: T,
4525
- log: T,
4526
- warn: T,
4527
- error: T,
4528
- group: T,
4529
- groupCollapsed: T,
4530
- groupEnd: T
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 T = {
4539
+ var k = {
4540
4540
  configurable: !0,
4541
4541
  enumerable: !0,
4542
4542
  writable: !0
4543
4543
  };
4544
4544
  Object.defineProperties(console, {
4545
- log: D({}, T, {
4546
- value: M
4545
+ log: C({}, k, {
4546
+ value: R
4547
4547
  }),
4548
- info: D({}, T, {
4548
+ info: C({}, k, {
4549
4549
  value: O
4550
4550
  }),
4551
- warn: D({}, T, {
4551
+ warn: C({}, k, {
4552
4552
  value: V
4553
4553
  }),
4554
- error: D({}, T, {
4554
+ error: C({}, k, {
4555
4555
  value: U
4556
4556
  }),
4557
- group: D({}, T, {
4557
+ group: C({}, k, {
4558
4558
  value: re
4559
4559
  }),
4560
- groupCollapsed: D({}, T, {
4560
+ groupCollapsed: C({}, k, {
4561
4561
  value: q
4562
4562
  }),
4563
- groupEnd: D({}, T, {
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(T, $, te) {
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 + T;
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(T, $) {
4591
- if (!T || _e)
4590
+ function ie(k, $) {
4591
+ if (!k || _e)
4592
4592
  return "";
4593
4593
  {
4594
- var te = ee.get(T);
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(T, [], Fe);
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
- T.call(Fe.prototype);
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
- T();
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 T.displayName && Rt.includes("<anonymous>") && (Rt = Rt.replace("<anonymous>", T.displayName)), typeof T == "function" && ee.set(T, Rt), Rt;
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 = T ? T.displayName || T.name : "", Er = Hr ? Be(Hr) : "";
4659
- return typeof T == "function" && ee.set(T, Er), Er;
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(T, $, te) {
4662
- return ie(T, !1);
4661
+ function Re(k, $, te) {
4662
+ return ie(k, !1);
4663
4663
  }
4664
- function ke(T) {
4665
- var $ = T.prototype;
4664
+ function ke(k) {
4665
+ var $ = k.prototype;
4666
4666
  return !!($ && $.isReactComponent);
4667
4667
  }
4668
- function Ae(T, $, te) {
4669
- if (T == null)
4668
+ function Ae(k, $, te) {
4669
+ if (k == null)
4670
4670
  return "";
4671
- if (typeof T == "function")
4672
- return ie(T, ke(T));
4673
- if (typeof T == "string")
4674
- return Be(T);
4675
- switch (T) {
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 T == "object")
4682
- switch (T.$$typeof) {
4681
+ if (typeof k == "object")
4682
+ switch (k.$$typeof) {
4683
4683
  case l:
4684
- return Re(T.render);
4684
+ return Re(k.render);
4685
4685
  case d:
4686
- return Ae(T.type, $, te);
4686
+ return Ae(k.type, $, te);
4687
4687
  case f: {
4688
- var pe = T, je = pe._payload, $e = pe._init;
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(T) {
4699
- if (T) {
4700
- var $ = T._owner, te = Ae(T.type, T._source, $ ? $.type : null);
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(T, $, te, pe, je) {
4705
+ function L(k, $, te, pe, je) {
4706
4706
  {
4707
4707
  var $e = Function.call.bind(qe);
4708
- for (var Fe in T)
4709
- if ($e(T, Fe)) {
4708
+ for (var Fe in k)
4709
+ if ($e(k, Fe)) {
4710
4710
  var Me = void 0;
4711
4711
  try {
4712
- if (typeof T[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 T[Fe] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
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 = T[Fe]($, Fe, pe, te, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
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(T) {
4726
- return ye(T);
4725
+ function Ke(k) {
4726
+ return ye(k);
4727
4727
  }
4728
- function z(T) {
4728
+ function z(k) {
4729
4729
  {
4730
- var $ = typeof Symbol == "function" && Symbol.toStringTag, te = $ && T[Symbol.toStringTag] || T.constructor.name || "Object";
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(T) {
4734
+ function ae(k) {
4735
4735
  try {
4736
- return me(T), !1;
4736
+ return me(k), !1;
4737
4737
  } catch {
4738
4738
  return !0;
4739
4739
  }
4740
4740
  }
4741
- function me(T) {
4742
- return "" + T;
4741
+ function me(k) {
4742
+ return "" + k;
4743
4743
  }
4744
- function xe(T) {
4745
- if (ae(T))
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(T)), me(T);
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(T) {
4755
- if (qe.call(T, "ref")) {
4756
- var $ = Object.getOwnPropertyDescriptor(T, "ref").get;
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 T.ref !== void 0;
4760
+ return k.ref !== void 0;
4761
4761
  }
4762
- function Ye(T) {
4763
- if (qe.call(T, "key")) {
4764
- var $ = Object.getOwnPropertyDescriptor(T, "key").get;
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 T.key !== void 0;
4768
+ return k.key !== void 0;
4769
4769
  }
4770
- function tt(T, $) {
4771
- typeof T.ref == "string" && Ge.current;
4770
+ function tt(k, $) {
4771
+ typeof k.ref == "string" && Ge.current;
4772
4772
  }
4773
- function rt(T, $) {
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(T, "key", {
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(T, $) {
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(T, "ref", {
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(T, $, te, pe, je, $e, Fe) {
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: T,
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(T, $, te, pe, je) {
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 (T && T.defaultProps) {
4831
- var nt = T.defaultProps;
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 T == "function" ? T.displayName || T.name || "Unknown" : T;
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(T, Me, yt, je, pe, Ge.current, Fe);
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(T) {
4844
- if (T) {
4845
- var $ = T._owner, te = Ae(T.type, T._source, $ ? $.type : null);
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(T) {
4853
- return typeof T == "object" && T !== null && T.$$typeof === e;
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 T = R(ue.current.type);
4859
- if (T)
4858
+ var k = M(ue.current.type);
4859
+ if (k)
4860
4860
  return `
4861
4861
 
4862
- Check the render method of \`` + T + "`.";
4862
+ Check the render method of \`` + k + "`.";
4863
4863
  }
4864
4864
  return "";
4865
4865
  }
4866
4866
  }
4867
- function Ie(T) {
4867
+ function Ie(k) {
4868
4868
  return "";
4869
4869
  }
4870
4870
  var Ve = {};
4871
- function Ce(T) {
4871
+ function Ce(k) {
4872
4872
  {
4873
4873
  var $ = we();
4874
4874
  if (!$) {
4875
- var te = typeof T == "string" ? T : T.displayName || T.name;
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(T, $) {
4883
+ function Te(k, $) {
4884
4884
  {
4885
- if (!T._store || T._store.validated || T.key != null)
4885
+ if (!k._store || k._store.validated || k.key != null)
4886
4886
  return;
4887
- T._store.validated = !0;
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
- T && T._owner && T._owner !== ue.current && (pe = " It was passed a child from " + R(T._owner.type) + "."), G(T), 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);
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(T, $) {
4896
+ function it(k, $) {
4897
4897
  {
4898
- if (typeof T != "object")
4898
+ if (typeof k != "object")
4899
4899
  return;
4900
- if (Ke(T))
4901
- for (var te = 0; te < T.length; te++) {
4902
- var pe = T[te];
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(T))
4906
- T._store && (T._store.validated = !0);
4907
- else if (T) {
4908
- var je = x(T);
4909
- if (typeof je == "function" && je !== T.entries)
4910
- for (var $e = je.call(T), Fe; !(Fe = $e.next()).done; )
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(T) {
4915
+ function lt(k) {
4916
4916
  {
4917
- var $ = T.type;
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 = R($);
4931
- L(te, T.props, "prop", pe, T);
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 = R($);
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(T) {
4940
+ function Qe(k) {
4941
4941
  {
4942
- for (var $ = Object.keys(T.props), te = 0; te < $.length; te++) {
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(T), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", pe), G(null);
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
- T.ref !== null && (G(T), y("Invalid attribute `ref` supplied to `React.Fragment`."), G(null));
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(T, $, te, pe, je, $e) {
4953
+ function pt(k, $, te, pe, je, $e) {
4954
4954
  {
4955
- var Fe = A(T);
4955
+ var Fe = T(k);
4956
4956
  if (!Fe) {
4957
4957
  var Me = "";
4958
- (T === void 0 || typeof T == "object" && T !== null && Object.keys(T).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.");
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
- T === null ? nt = "null" : Ke(T) ? nt = "array" : T !== void 0 && T.$$typeof === e ? (nt = "<" + (R(T.type) || "Unknown") + " />", Me = " Did you accidentally export a JSX literal instead of a component?") : nt = typeof T, 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);
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(T, $, te, je, $e);
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], T);
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, T);
4978
+ it(Rt, k);
4979
4979
  }
4980
4980
  if (qe.call($, "key")) {
4981
- var Er = R(T), Ct = Object.keys($).filter(function(_d) {
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 T === n ? Qe(st) : lt(st), st;
4994
+ return k === n ? Qe(st) : lt(st), st;
4995
4995
  }
4996
4996
  }
4997
- function gt(T, $, te) {
4998
- return pt(T, $, te, !0);
4997
+ function gt(k, $, te) {
4998
+ return pt(k, $, te, !0);
4999
4999
  }
5000
- function Mt(T, $, te) {
5001
- return pt(T, $, te, !1);
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 C = await d.isAdmin(E);
5013
- l(C);
5012
+ const w = await d.isAdmin(E);
5013
+ l(w);
5014
5014
  }, [d]), p = J(() => {
5015
- const E = Tt.getToken(), C = Tt.getUser();
5016
- E && C ? (o(E), i(C), f(C._id).finally(() => c(!1))) : c(!1);
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, C) => {
5022
- const v = await d.login(E, C);
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, C, v) => d.register(E, C, v), [d]), x = J(async (E, C) => {
5025
- const v = await d.verifyEmail(E, C);
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, C, v) => {
5028
- const S = await d.setPasswordWithCode(E, C, v);
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]), w = J(() => {
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: w,
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 w(A) {
5081
- A.preventDefault(), y(!0), x("");
5082
- const k = await r(d, p);
5083
- k.success ? e == null || e() : x(k.error || "Connexion impossible"), y(!1);
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
- }, C = {
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: w, children: [
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: (A) => f(A.target.value),
5145
+ onChange: (T) => f(T.target.value),
5146
5146
  required: !0,
5147
- style: C,
5148
- onFocus: (A) => {
5149
- A.target.style.borderColor = _.primaryColor, A.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
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: (A) => {
5152
- A.target.style.borderColor = _.borderColor, A.target.style.boxShadow = "none";
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: (A) => g(A.target.value),
5164
+ onChange: (T) => g(T.target.value),
5165
5165
  required: !0,
5166
- style: C,
5167
- onFocus: (A) => {
5168
- A.target.style.borderColor = _.primaryColor, A.target.style.boxShadow = `0 0 0 2px ${_.primaryColor}20`;
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: (A) => {
5171
- A.target.style.borderColor = _.borderColor, A.target.style.boxShadow = "none";
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: (A) => {
5183
- b || (A.target.style.backgroundColor = _.primaryHoverColor);
5182
+ onMouseEnter: (T) => {
5183
+ b || (T.target.style.backgroundColor = _.primaryHoverColor);
5184
5184
  },
5185
- onMouseLeave: (A) => {
5186
- b || (A.target.style.backgroundColor = _.primaryColor);
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(""), [_, w] = I(""), [E, C] = I(""), [v, S] = I(""), [F, A] = I(""), [k, B] = I(""), [R, D] = I(!1), N = { ...Qd, ...g };
5295
- async function M(W) {
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
- D(!0);
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"), D(!1);
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: R ? N.textMutedColor : N.primaryColor,
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: R ? "not-allowed" : "pointer",
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: M, children: [
5366
- k && /* @__PURE__ */ h.jsx("div", { style: q, children: /* @__PURE__ */ h.jsx("p", { style: { fontSize: "0.875rem", color: N.errorColor, margin: 0 }, children: k }) }),
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) => A(W.target.value),
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) => w(W.target.value),
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) => C(W.target.value),
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: R,
5437
+ disabled: M,
5438
5438
  style: re,
5439
5439
  onMouseEnter: (W) => {
5440
- R || (W.target.style.backgroundColor = N.primaryHoverColor);
5440
+ M || (W.target.style.backgroundColor = N.primaryHoverColor);
5441
5441
  },
5442
5442
  onMouseLeave: (W) => {
5443
- R || (W.target.style.backgroundColor = N.primaryColor);
5443
+ M || (W.target.style.backgroundColor = N.primaryColor);
5444
5444
  },
5445
- children: R ? o : s
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(""), [w, E] = I(!1), [C, v] = I(!1), [S, F] = I(!1), A = be([]), k = { ...Jd, ...p };
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 = A.current[0]) == null || q.focus();
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 = A.current[q + 1]) == null || ce.focus()), W && q === f - 1) {
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
- }, R = (q, Z) => {
5495
+ }, M = (q, Z) => {
5496
5496
  var W;
5497
- Z.key === "Backspace" && !x[q] && q > 0 && ((W = A.current[q - 1]) == null || W.focus());
5498
- }, D = (q) => {
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 = A.current[se]) == null || ce.focus()), Z.length === f && N(Z);
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 = A.current[0]) == null || se.focus()), E(!1);
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 M() {
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: k.backgroundColor,
5527
- borderRadius: k.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 ${k.borderColor}`,
5541
- borderRadius: k.borderRadius,
5542
- backgroundColor: k.inputBackground,
5543
- color: k.textColor,
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: w ? k.textMutedColor : k.primaryColor,
5549
+ backgroundColor: D ? A.textMutedColor : A.primaryColor,
5550
5550
  color: "#ffffff",
5551
5551
  border: "none",
5552
- borderRadius: k.borderRadius,
5552
+ borderRadius: A.borderRadius,
5553
5553
  fontSize: "1rem",
5554
5554
  fontWeight: 500,
5555
- cursor: w ? "not-allowed" : "pointer",
5555
+ cursor: D ? "not-allowed" : "pointer",
5556
5556
  transition: "background-color 0.2s"
5557
5557
  }, re = {
5558
- color: k.primaryColor,
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: k.textColor,
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: k.textMutedColor,
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: k.errorBackgroundColor,
5583
- border: `1px solid ${k.errorColor}20`,
5584
- borderRadius: k.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: k.errorColor, margin: 0, textAlign: "center" }, children: y }) }),
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 ${k.successColor}20`,
5591
- borderRadius: k.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: k.successColor, margin: 0, textAlign: "center" }, children: "Code renvoyé !" }) }),
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
- A.current[Z] = W;
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) => R(Z, W),
5611
- onPaste: D,
5612
- disabled: w,
5610
+ onKeyDown: (W) => M(Z, W),
5611
+ onPaste: C,
5612
+ disabled: D,
5613
5613
  style: {
5614
5614
  ...V,
5615
- borderColor: q ? k.primaryColor : k.borderColor
5615
+ borderColor: q ? A.primaryColor : A.borderColor
5616
5616
  },
5617
5617
  onFocus: (W) => {
5618
- W.target.style.borderColor = k.primaryColor, W.target.style.boxShadow = `0 0 0 3px ${k.primaryColor}20`;
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 ? k.primaryColor : k.borderColor, W.target.style.boxShadow = "none";
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: w || x.join("").length !== f,
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: w ? l : a
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: M,
5644
- disabled: C,
5643
+ onClick: R,
5644
+ disabled: w,
5645
5645
  style: {
5646
5646
  ...re,
5647
- opacity: C ? 0.5 : 1
5647
+ opacity: w ? 0.5 : 1
5648
5648
  },
5649
- children: C ? c : u
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 A = await r(f);
5687
- A.success ? e == null || e(f) : m(A.error || "Erreur lors de l'envoi"), b(!1);
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 w = {
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
- }, C = {
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: w, className: c, children: [
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: C, children: a }),
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(""), [_, w] = I(""), [E, C] = I(!1), v = { ...tf, ...f };
5818
- async function S(D) {
5819
- if (D.preventDefault(), w(""), m !== b) {
5820
- w("Les mots de passe ne correspondent pas");
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
- w("Le mot de passe doit contenir au moins 8 caractères");
5824
+ D("Le mot de passe doit contenir au moins 8 caractères");
5825
5825
  return;
5826
5826
  }
5827
- C(!0);
5827
+ w(!0);
5828
5828
  const N = await t(r, e, m);
5829
- N.success ? n == null || n() : w(N.error || "Erreur lors de la réinitialisation"), C(!1);
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
- }, A = {
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
- }, k = {
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
- }, R = {
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: k, children: u }),
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: (D) => x(D.target.value),
5905
+ onChange: (C) => x(C.target.value),
5906
5906
  required: !0,
5907
5907
  minLength: 8,
5908
- style: A
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: k, children: c }),
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: (D) => y(D.target.value),
5919
+ onChange: (C) => y(C.target.value),
5920
5920
  required: !0,
5921
- style: A
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: (D) => {
5932
- E || (D.target.style.backgroundColor = v.primaryHoverColor);
5931
+ onMouseEnter: (C) => {
5932
+ E || (C.target.style.backgroundColor = v.primaryHoverColor);
5933
5933
  },
5934
- onMouseLeave: (D) => {
5935
- E || (D.target.style.backgroundColor = v.primaryColor);
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: R, children: d }) })
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 w(A, k) {
5962
- const B = await r(A, k);
5963
- return B.requiresVerification ? (b(A), m("verify-email"), { success: !1, error: "Veuillez vérifier votre email" }) : 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(A, k, B) {
5966
- const R = await e(A, k, B);
5967
- return R.success && R.requiresVerification && (b(A), m("verify-email")), R;
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 C(A) {
5970
- const k = await n(A);
5971
- return k.success && (b(A), m("verify-reset-code")), k;
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(A, k) {
5974
- return _(k), m("reset-password"), { success: !0 };
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: w,
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: C,
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 A = {
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: A, children: "Mot de passe oublié ?" }),
6083
- /* @__PURE__ */ h.jsx("button", { type: "button", onClick: () => m("register"), style: A, children: "Créer un compte" })
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), [_, w] = I(""), [E, C] = I({}), [v, S] = I(1), F = ct(() => {
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 D = m;
6338
- return a && _ && l.length > 0 && (D = Ps.search(D, _, l)), Object.keys(E).length > 0 && (D = Ps.filterByFields(D, E)), Ps.paginate(D, v, d);
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 A = () => {
6344
- w(""), C({}), S(1), y(), p == null || p();
6345
- }, k = {
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
- }, R = s || ((D) => /* @__PURE__ */ h.jsxs("div", { style: {
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: k.text }, children: D.title || D.name || D.label || "Untitled" }),
6357
- D.description && /* @__PURE__ */ h.jsx("div", { style: { fontSize: "13px", color: k.textSecondary, marginTop: "4px" }, children: D.description })
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: k.textSecondary
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: A,
6375
+ onClick: T,
6376
6376
  style: {
6377
6377
  marginTop: "16px",
6378
6378
  padding: "8px 16px",
6379
- background: k.primary,
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: k.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 ${k.border}`
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: k.text
6407
+ color: A.text
6408
6408
  }, children: n }),
6409
6409
  /* @__PURE__ */ h.jsx(
6410
6410
  "button",
6411
6411
  {
6412
- onClick: A,
6412
+ onClick: T,
6413
6413
  style: {
6414
6414
  padding: "6px 12px",
6415
6415
  background: "transparent",
6416
- border: `1px solid ${k.border}`,
6416
+ border: `1px solid ${A.border}`,
6417
6417
  borderRadius: "6px",
6418
- color: k.textSecondary,
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: (D) => w(D.target.value),
6432
+ onChange: (C) => D(C.target.value),
6433
6433
  style: {
6434
6434
  width: "100%",
6435
6435
  padding: "8px 12px",
6436
- border: `1px solid ${k.border}`,
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: k.textSecondary
6454
- }, children: i }) : F.data.map((D, N) => /* @__PURE__ */ h.jsx(
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(D),
6457
+ onClick: () => f == null ? void 0 : f(C),
6458
6458
  style: {
6459
- background: k.cardBackground,
6459
+ background: A.cardBackground,
6460
6460
  borderRadius: t === "list" ? "0" : "8px",
6461
- borderBottom: t === "list" ? `1px solid ${k.border}` : "none",
6461
+ borderBottom: t === "list" ? `1px solid ${A.border}` : "none",
6462
6462
  transition: "all 0.15s ease"
6463
6463
  },
6464
- onMouseEnter: (M) => {
6465
- f && (M.currentTarget.style.background = k.border);
6464
+ onMouseEnter: (R) => {
6465
+ f && (R.currentTarget.style.background = A.border);
6466
6466
  },
6467
- onMouseLeave: (M) => {
6468
- M.currentTarget.style.background = k.cardBackground;
6467
+ onMouseLeave: (R) => {
6468
+ R.currentTarget.style.background = A.cardBackground;
6469
6469
  },
6470
- children: R(D, N)
6470
+ children: M(C, N)
6471
6471
  },
6472
- o(D, N)
6472
+ o(C, N)
6473
6473
  )) }),
6474
6474
  F.totalPages > 1 && /* @__PURE__ */ h.jsxs("div", { style: {
6475
6475
  padding: "16px",
6476
- borderTop: `1px solid ${k.border}`,
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: k.textSecondary }, children: [
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((D) => Math.max(1, D - 1)),
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 ${k.border}`,
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((D) => Math.min(F.totalPages, D + 1)),
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 ${k.border}`,
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
- className: s = ""
6634
+ aspectRatio: s = "1:1",
6635
+ className: o = ""
6635
6636
  }) {
6636
- var S, F;
6637
- const [o] = I(() => {
6637
+ var T, A;
6638
+ const [a] = I(() => {
6638
6639
  if (r.length === 0) return [[], []];
6639
- const A = of(r), k = Math.ceil(A.length / 2);
6640
+ const B = of(r), M = Math.ceil(B.length / 2);
6640
6641
  return console.log("[AnimatedCardFlip] Pools:", {
6641
- left: A.slice(0, k).map((B) => B.title),
6642
- right: A.slice(k).map((B) => B.title)
6643
- }), [A.slice(0, k), A.slice(k)];
6644
- }), [a, l] = I(() => {
6645
- const A = kl[i];
6646
- if (typeof window > "u") return A.base;
6647
- const k = window.innerWidth;
6648
- return "lg" in A && k >= 1024 ? A.lg : k >= 768 ? A.md : k >= 640 ? A.sm : A.base;
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 A = () => {
6652
- const k = kl[i], B = window.innerWidth;
6653
- "lg" in k && B >= 1024 ? l(k.lg) : B >= 768 ? l(k.md) : B >= 640 ? l(k.sm) : l(k.base);
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", A), A(), () => window.removeEventListener("resize", A);
6656
+ return window.addEventListener("resize", B), B(), () => window.removeEventListener("resize", B);
6656
6657
  }, [i]);
6657
- const [u, c] = I(0), [d, f] = I(0), [p, g] = I(!1), [m, x] = I(!1), [b, y] = I(!1), [_, w] = I(!1);
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 (o[0].length <= 1) return;
6660
- const A = setInterval(() => {
6661
- g((k) => !k), setTimeout(() => {
6662
- c((k) => (k + 1) % o[0].length), y((k) => !k);
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(A);
6666
- }, [o, e, t]), Ee(() => {
6667
- if (o[1].length <= 1) return;
6668
- let A = null;
6669
- const k = setTimeout(() => {
6670
- A = setInterval(() => {
6671
- x((B) => !B), setTimeout(() => {
6672
- f((B) => (B + 1) % o[1].length), w((B) => !B);
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(k), A && clearInterval(A);
6678
+ clearTimeout(M), B && clearInterval(B);
6678
6679
  };
6679
- }, [o, e, t]);
6680
- const E = (S = o[0]) == null ? void 0 : S[u], C = (F = o[1]) == null ? void 0 : F[d];
6681
- if (r.length === 0 || !E)
6682
- return /* @__PURE__ */ h.jsx("div", { className: `flex items-center justify-center p-8 ${s}`, children: /* @__PURE__ */ h.jsx("p", { className: "text-gray-500", children: "No images available" }) });
6683
- const v = (A, k, B) => /* @__PURE__ */ h.jsx(
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: a,
6689
- height: a,
6689
+ width: l,
6690
+ height: S,
6690
6691
  perspective: "1000px"
6691
6692
  },
6692
- onClick: () => n == null ? void 0 : n(A),
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(${k ? 180 : 0}deg)`,
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: B ? "scaleX(-1)" : "none"
6708
+ transform: C ? "scaleX(-1)" : "none"
6708
6709
  },
6709
6710
  children: [
6710
- /* @__PURE__ */ h.jsx("img", { src: A.data.image, alt: A.title, className: "w-full h-full object-cover" }),
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: A.title }) })
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 ${s}`, children: [
6720
- v(E, p, b),
6721
- C && v(C, m, _)
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: w,
6778
+ renderEmpty: D,
6778
6779
  renderLoading: E,
6779
- theme: C = {}
6780
+ theme: w = {}
6780
6781
  }) {
6781
- const v = { ...lf, ...C }, [S, F] = I([]), [A, k] = I(!1), [B, R] = I(null), [D, N] = I(/* @__PURE__ */ new Set()), [M, 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
+ 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
- k(!0), R(null);
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
- R(de.message), m == null || m(de);
6798
+ M(de.message), m == null || m(de);
6798
6799
  }
6799
- k(!1);
6800
+ A(!1);
6800
6801
  }
6801
6802
  }, [_e, t, n, i, m, x]);
6802
6803
  Ee(() => {
6803
- F([]), N(/* @__PURE__ */ new Set()), U(null), R(null), l === void 0 && ce(""), d && ee();
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 && M !== null) {
6825
- const rt = Math.min(M, de), Lt = Math.max(M, de), Q = S.slice(rt, Lt + 1).map((ue) => ue.uid), j = new Set(Q);
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, M, S, D, f, p, o]), ke = J(async () => {
6837
- if (!_e || D.size === 0) return;
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(D), oe);
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) => !D.has(rt.uid)));
6843
- const Ye = Array.from(D);
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
- R("Failed to move emails to trash");
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), R(Ye.message), m == null || m(Ye);
6850
+ console.error("Trash error:", Ye), M(Ye.message), m == null || m(Ye);
6850
6851
  }
6851
- }, [_e, t, D, i, g, m]), Ae = J(async () => {
6852
- if (!_e || D.size === 0) return;
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(D), oe);
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) => !D.has(rt.uid)));
6858
- const Ye = Array.from(D);
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
- R("Failed to archive emails");
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), R(Ye.message), m == null || m(Ye);
6865
+ console.error("Archive error:", Ye), M(Ye.message), m == null || m(Ye);
6865
6866
  }
6866
- }, [_e, t, D, i, g, m]), qe = J(() => {
6867
- if (D.size === S.length)
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, D.size, p]), ze = J(() => {
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 = w || z, wt = E || ae;
7031
- return A && 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: [
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(D), He),
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, D.has(oe.uid))
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((w) => u.has(w.id)), g = d >= 0 && d < p.length ? p[d] : null, m = J((w) => {
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 C = new Set(E);
7124
- return C.has(w) ? C.delete(w) : C.add(w), t == null || t(Array.from(C)), C;
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 w = new Set(r.map((E) => E.id));
7131
- c(w), r.length > 0 && (f(0), n == null || n(r[0], 0)), t == null || t(r.map((E) => E.id));
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 w = d <= 0 ? p.length - 1 : d - 1;
7136
- f(w), n == null || n(p[w], w);
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 w = d >= p.length - 1 ? 0 : d + 1;
7140
- f(w), n == null || n(p[w], w);
7141
- }, [p, d, n]), _ = J((w) => {
7142
- i == null || i(w, p, g);
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((w) => {
7193
- const E = u.has(w.id), C = (g == null ? void 0 : g.id) === w.id;
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 ${C ? "bg-blue-50 ring-1 ring-blue-200" : E ? "bg-neutral-100" : "hover:bg-neutral-50"}`,
7198
- onClick: () => m(w.id),
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(w, E, C) })
7202
+ /* @__PURE__ */ h.jsx("div", { className: "flex-1 min-w-0", children: e(D, E, w) })
7202
7203
  ]
7203
7204
  },
7204
- w.id
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((w) => {
7208
- var C;
7209
- const E = ((C = w.disabled) == null ? void 0 : C.call(w, p)) ?? !1;
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: () => _(w.id),
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
- w.icon && /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: w.icon }),
7218
- w.label
7218
+ D.icon && /* @__PURE__ */ h.jsx("span", { className: "material-icons text-sm", children: D.icon }),
7219
+ D.label
7219
7220
  ]
7220
7221
  },
7221
- w.id
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 C = 0; C < _.length; C++) {
7318
- const v = _[C], S = ju(v), F = v.parentNode;
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 A = v.innerText || v.nodeValue;
7322
- A && (c += A);
7322
+ const T = v.innerText || v.nodeValue;
7323
+ T && (c += T);
7323
7324
  }
7324
7325
  F.removeChild(v);
7325
7326
  }
7326
7327
  }
7327
- const w = p.removedNodes, E = w.length;
7328
+ const D = p.removedNodes, E = D.length;
7328
7329
  if (E > 0) {
7329
- let C = 0;
7330
+ let w = 0;
7330
7331
  for (let v = 0; v < E; v++) {
7331
- const S = w[v];
7332
- (Is(S, m, r) || l === S) && (m.appendChild(S), C++);
7332
+ const S = D[v];
7333
+ (Is(S, m, r) || l === S) && (m.appendChild(S), w++);
7333
7334
  }
7334
- E !== C && s.set(b, y);
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 w = b - 1, E = y - 1;
8051
- let C, v, S = _.getFirstChild(), F = 0, A = 0;
8052
- for (; F <= w && A <= E; ) {
8053
- const R = m[F], D = x[A];
8054
- if (R === D) S = $s(Sn(D, _.element)), F++, A++;
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
- C === void 0 && (C = new Set(m)), v === void 0 && (v = new Set(x));
8057
- const M = v.has(R), O = C.has(D);
8058
- if (M) if (O) {
8059
- const V = Ui(_t, D);
8060
- V === S ? S = $s(Sn(D, _.element)) : (_.withBefore(S).insertChild(V), Sn(D, _.element)), F++, A++;
8061
- } else Vi(D, _.withBefore(S)), A++;
8062
- else S = $s(uo(R)), Hi(R, _.element), F++;
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(D);
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 k = F > w, B = A > E;
8068
- if (k && !B) {
8069
- const R = x[E + 1], D = R === void 0 ? null : _t.getElementByKey(R);
8070
- ao(x, g, A, E, _.withBefore(D));
8071
- } else B && !k && lo(m, F, w, _.element);
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, w = !1;
8429
+ let _ = Ff, D = !1;
8429
8430
  for (let E = 0; E < p; E++) {
8430
- const C = f[E], v = C.getTextContentSize();
8431
- if (X(C) && v !== 0 && !(E === 0 && C.__key === b && m === v || E === p - 1 && C.__key === y && x === 0) && (w = !0, _ &= C.getFormat(), _ === 0)) break;
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 = w ? _ : 0;
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 w = d.length;
9137
+ let D = d.length;
9137
9138
  for (let E = 1; E < c; E++) {
9138
- const C = a[E], v = C.length, S = at(C).getWritable();
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, A = w + v;
9141
+ const F = S.__key, T = D + v;
9141
9142
  if (H(y)) {
9142
- const k = y.anchor, B = y.focus;
9143
- k.key === i && k.type === "text" && k.offset > w && k.offset <= A && (k.key = F, k.offset -= w, y.dirty = !0), B.key === i && B.type === "text" && B.offset > w && B.offset <= A && (B.key = F, B.offset -= w, y.dirty = !0);
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), w = A, _.push(S);
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(), C = this.getIndexWithinParent();
9153
- b ? (E.splice(C, 0, _), this.remove()) : E.splice(C, 1, _), H(y) && Yi(y, f, C, c - 1);
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 w = x.getNode(), E = w.getChildAtIndex(x.offset), C = at(), v = bt(w) ? ot().append(C) : C;
9531
- C.setFormat(y), C.setStyle(_), E === null ? w.append(v) : E.insertBefore(v), x.is(b) && b.set(C.__key, 0, "text"), x.set(C.__key, 0, "text");
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 [w] = f.splitText(l);
9570
- w.insertAfter(_, !1);
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 w = y.getChildren(), E = new Set(c), C = b.is(y), v = b.isInline() && f.getNextSibling() === null ? b : f;
9596
- for (let S = w.length - 1; S >= 0; S--) {
9597
- const F = w[S];
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(_) ? C || v.insertAfter(F, !1) : F.remove());
9600
+ F.isAttached() && (!E.has(F) || F.is(_) ? w || v.insertAfter(F, !1) : F.remove());
9600
9601
  }
9601
- if (!C) {
9602
+ if (!w) {
9602
9603
  let S = y, F = null;
9603
9604
  for (; S !== null; ) {
9604
- const A = S.getChildren(), k = A.length;
9605
- (k === 0 || A[k - 1].is(F)) && (x.delete(S.__key), F = S), S = S.getParent();
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], A = F.__key;
9616
- x.has(A) || F.remove();
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 w of n) X(w) && i.push(w);
9649
- const s = (w) => {
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 C = E.getFormatFlags(e, w);
9653
- E.setTextFormat(C);
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 w = p.splitText(g, y), E = g === 0 ? w[0] : w[1];
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 w = f + 1; w < x; w++) {
9679
- const E = i[w], C = E.getFormatFlags(e, _);
9680
- E.setFormat(C);
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 w = g;
9725
- for (const E of _) w = w.insertAfter(E);
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, w = y.anchor, E = w.key, C = w.offset, v = w.type;
9813
- mr(w, _.key, _.offset, _.type), mr(_, E, C, v), y._cachedNodes = null;
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, w = e.format, E = e.style, C = e.isCollapsed();
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() !== w || N.getStyle() !== E;
10099
+ F = N.getFormat() !== D || N.getStyle() !== E;
10099
10100
  } else H(r) && r.anchor.type === "text" && (F = !0);
10100
- var A, k, B, R, D;
10101
- if (p.type === "text" && (S = zi(b)), v !== null && S !== null && (C && (r === null || F || H(r) && (r.format !== w || r.style !== E)) && (A = w, k = E, B = y, R = g, D = performance.now(), Xu = [A, k, B, R, D]), u !== y || c !== _ || a !== v || l !== S || n.type === "Range" && C || (d !== null && s.contains(d) || s.focus({ preventScroll: !0 }), f.type === "element"))) {
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 M;
10110
+ let R;
10110
10111
  if (N instanceof Text) {
10111
10112
  const O = document.createRange();
10112
- O.selectNode(N), M = O.getBoundingClientRect();
10113
- } else M = N.getBoundingClientRect();
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, M, s);
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 C = r._dirtyType, v = r._dirtyElements, S = r._dirtyLeaves;
10263
- p.disconnect(), g = lh(s, t, r, C, v, S);
10264
- } catch (C) {
10265
- if (C instanceof Error && r._onError(C), Gs) throw C;
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(C, v) {
10274
- const S = C._decorators;
10275
- let F = C._pendingDecorators || S;
10276
- const A = v._nodeMap;
10277
- let k;
10278
- for (k in F) A.has(k) || (F === S && (F = Lu(C)), delete F[k]);
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 w = i ? null : jt(r._window);
10281
- if (r._editable && w !== null && (l || a === null || a.dirty)) {
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 C = r._blockCursorElement;
10286
- C !== null && Zo(C, r, n), xh(o, a, r, w, y, n);
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(C, v, S, F, A) {
10294
- const k = Array.from(C._listeners.mutation), B = k.length;
10295
- for (let R = 0; R < B; R++) {
10296
- const [D, N] = k[R], M = v.get(N);
10297
- M !== void 0 && D(M, { dirtyLeaves: F, prevEditorState: A, updateTags: S });
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(C, v, S) {
10302
- const F = Rl(v), A = Rl(S);
10303
- F !== A && Pn("textcontent", C, !0, A);
10304
- }(r, e || s, t), Pn("update", r, !0, { dirtyElements: x, dirtyLeaves: m, editorState: t, normalizedNodes: b, prevEditorState: e || s, tags: y }), function(C, v) {
10305
- if (C._deferred = [], v.length !== 0) {
10306
- const S = C._updating;
10307
- C._updating = !0;
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
- C._updating = S;
10312
+ w._updating = S;
10312
10313
  }
10313
10314
  }
10314
- }(r, _), function(C) {
10315
- const v = C._updates;
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, A] = S;
10320
- fc(C, F, A);
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, w = b._selection;
10392
- if (H(w)) {
10393
- const E = w.anchor, C = w.focus;
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(_, w)), C.type === "text") {
10396
- const S = C.getNode();
10397
- v !== S && S.selectionTransform(_, w);
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, w = b._nodeMap;
10402
+ const _ = y._dirtyLeaves, D = b._nodeMap;
10402
10403
  for (const E of _) {
10403
- const C = w.get(E);
10404
- X(C) && C.isAttached() && C.isSimpleText() && !C.isUnmergeable() && Fl(C);
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, w = y._dirtyElements, E = b._nodeMap, C = xr(), v = /* @__PURE__ */ new Map();
10408
- let S = _, F = S.size, A = w, k = A.size;
10409
- for (; F > 0 || k > 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 R = E.get(B);
10414
- X(R) && R.isAttached() && R.isSimpleText() && !R.isUnmergeable() && Fl(R), R !== void 0 && la(R, C) && oa(y, R, v), _.add(B);
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 A) {
10423
- const R = B[0], D = B[1];
10424
- if (R !== "root" && !D) continue;
10425
- const N = E.get(R);
10426
- N !== void 0 && la(N, C) && oa(y, N, v), w.set(R, D);
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, A = y._dirtyElements, k = A.size, ki++;
10429
+ S = y._dirtyLeaves, F = S.size, T = y._dirtyElements, A = T.size, ki++;
10429
10430
  }
10430
- y._dirtyLeaves = _, y._dirtyElements = w;
10431
- }(l, r), ua(r), function(b, y, _, w) {
10432
- const E = b._nodeMap, C = y._nodeMap, v = [];
10433
- for (const [S] of w) {
10434
- const F = C.get(S);
10435
- F !== void 0 && (F.isAttached() || (P(F) && qu(F, S, E, C, v, w), E.has(S) || w.delete(S), v.push(S)));
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) C.delete(S);
10438
+ for (const S of v) w.delete(S);
10438
10439
  for (const S of _) {
10439
- const F = C.get(S);
10440
- F === void 0 || F.isAttached() || (E.has(S) || _.delete(S), C.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 C = x;
11097
- x = C.replace, b = C.with, y = C.withKlass || null;
11097
+ const w = x;
11098
+ x = w.replace, b = w.with, y = w.withKlass || null;
11098
11099
  }
11099
- const _ = x.getType(), w = x.transform(), E = /* @__PURE__ */ new Set();
11100
- w !== null && E.add(w), p.set(_, { exportDOM: d && d.export ? d.export.get(x) : void 0, klass: x, replace: b, replaceWithKlass: y, transforms: E });
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(), _ = (w) => {
11105
- Object.keys(w).forEach((E) => {
11106
- let C = b.get(E);
11107
- C === void 0 && (C = [], b.set(E, C)), C.push(w[E]);
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((w) => {
11111
- const E = w.klass.importDOM;
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 C = E.call(w.klass);
11115
- C !== null && _(C);
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 w = b.getTextContentSize();
11587
- y = y > w ? w : y, _ = _ > w ? w : _, m.setTextNodeRange(b, y, b, _);
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 w = _(g);
11664
- w !== null && (y === null || (y.priority || 0) <= (w.priority || 0)) && (y = w);
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": w, ...E }, C) {
12229
- const [v, S] = I(r.isEditable()), F = J((k) => {
12230
- k && k.ownerDocument && k.ownerDocument.defaultView ? r.setRootElement(k) : r.setRootElement(null);
12231
- }, [r]), A = ct(() => /* @__PURE__ */ function(...k) {
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
- k.forEach((R) => {
12234
- typeof R == "function" ? R(B) : R != null && (R.current = B);
12234
+ A.forEach((M) => {
12235
+ typeof M == "function" ? M(B) : M != null && (M.current = B);
12235
12236
  });
12236
12237
  };
12237
- }(C, F), [F, C]);
12238
- return Ac(() => (S(r.isEditable()), r.registerEditableListener((k) => {
12239
- S(k);
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": w, id: m, ref: A, role: v ? x : void 0, spellCheck: b, style: y, tabIndex: _, ...E });
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 w = b._nodeMap, E = [];
12280
- for (const C of y) {
12281
- const v = w.get(C);
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 [C, v] of _) {
12285
+ for (const [w, v] of _) {
12285
12286
  if (!v) continue;
12286
- const S = w.get(C);
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), w = y._nodeMap.get(x), E = b._selection, C = y._selection;
12317
- return !(H(E) && H(C) && E.anchor.type === "element" && E.focus.type === "element" && C.anchor.type === "text" && C.focus.type === "text" || !X(_) || !X(w) || _.__parent !== w.__parent) && JSON.stringify(b.read(() => _.exportJSON())) === JSON.stringify(y.read(() => w.exportJSON()));
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, w = o.getTotalBits(l, g);
13383
- if (w <= _) {
13384
- m = w;
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 w of _.getData())
13396
- x.push(w);
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((_, w) => y[w >>> 3] |= _ << 7 - (w & 7)), new Ne(g, u, y, f);
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, w = 0; _ < d; _++) {
13498
- let E = l.slice(w, w + m - f + (_ < g ? 0 : 1));
13499
- w += E.length;
13500
- const C = Ne.reedSolomonComputeRemainder(E, b);
13501
- _ < g && E.push(0), x.push(E.concat(C));
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((w, E) => {
13506
- (_ != m - f || E >= g) && y.push(w[_]);
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), w = Le.useRef(null), E = Le.useCallback(
13982
- (D) => {
13983
- _.current = D, typeof t == "function" ? t(D) : t && (t.current = D);
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
- ), [C, v] = Le.useState(!1), { margin: S, cells: F, numCells: A, calculatedImageSettings: k } = Wc({
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 D = _.current, N = D.getContext("2d");
13999
+ const C = _.current, N = C.getContext("2d");
13999
14000
  if (!N)
14000
14001
  return;
14001
- let M = F;
14002
- const O = w.current, V = k != null && O !== null && O.complete && O.naturalHeight !== 0 && O.naturalWidth !== 0;
14003
- V && k.excavation != null && (M = Uc(
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
- k.excavation
14006
+ A.excavation
14006
14007
  ));
14007
14008
  const U = window.devicePixelRatio || 1;
14008
- D.height = D.width = s * U;
14009
- const re = s / A * U;
14010
- N.scale(re, re), N.fillStyle = a, N.fillRect(0, 0, A, A), N.fillStyle = l, eg ? N.fill(new Path2D(qc(M, S))) : F.forEach(function(q, Z) {
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
- }), k && (N.globalAlpha = k.opacity), V && N.drawImage(
14015
+ }), A && (N.globalAlpha = A.opacity), V && N.drawImage(
14015
14016
  O,
14016
- k.x + S,
14017
- k.y + S,
14018
- k.w,
14019
- k.h
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 R = null;
14027
- return y != null && (R = /* @__PURE__ */ Le.createElement(
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: w,
14037
- crossOrigin: k == null ? void 0 : k.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
- ), R);
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 w = b, E = null;
14089
- g != null && _ != null && (_.excavation != null && (w = Uc(
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 C = qc(w, x);
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: C, shapeRendering: "crispEdges" }),
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]), w = {
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
- `, C = () => {
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: w,
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: { ...w, fontStyle: "italic" },
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: { ...w, textDecoration: "underline" },
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: w,
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: w,
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: w,
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: C,
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), w = Le.useRef(void 0), [E, C] = Le.useState(r), [v, S] = Le.useState(!1), [F, A] = Le.useState(null), k = g ?? v, B = m ?? F;
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 !== w.current && (w.current = l, _(!0));
14666
+ l !== void 0 && l !== D.current && (D.current = l, _(!0));
14666
14667
  }, [l]);
14667
- const R = J(() => {
14668
+ const M = J(() => {
14668
14669
  _(!1);
14669
- }, []), D = (q) => q.replace(/<[^>]*>/g, "").trim(), N = (q) => q.split(`
14670
- `).map((Z) => `<p>${Z || "<br>"}</p>`).join(""), M = async (q) => {
14671
- const Z = D(E);
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), A(q);
14676
+ S(!0), T(q);
14676
14677
  try {
14677
14678
  const se = await W(Z), ce = N(se);
14678
- C(ce), e == null || e(ce), w.current = Date.now(), _(!0);
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), A(null);
14683
+ S(!1), T(null);
14683
14684
  }
14684
14685
  }
14685
- }, O = D(E).length > 0, V = {
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
- C(W), e == null || e(W);
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: k,
14799
+ aiProcessing: A,
14799
14800
  aiProcessingAction: B,
14800
- onAiAction: M,
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: R
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: w,
14892
+ onAiRewrite: D,
14892
14893
  renderAboveToolbar: E
14893
14894
  }) {
14894
- const C = { ...dg, ...c }, [v, S] = I(r), [F, A] = I(""), [k, B] = I(""), [R, D] = I(e), [N, M] = 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
+ 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, M(t), fe(!0));
14897
+ a !== void 0 && a !== ge.current && (ge.current = a, R(t), fe(!0));
14897
14898
  }, [a, t]);
14898
14899
  const Be = (z) => {
14899
- M(z), fe(!1), o == null || o(z);
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 (!R.trim()) {
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: k.trim() || void 0,
14946
- subject: R.trim(),
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(""), A(""), B(""), D(""), M(""), V([]);
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 ${C.inputBorder}`,
14965
+ border: `1px solid ${w.inputBorder}`,
14965
14966
  borderRadius: "6px",
14966
- background: C.inputBackground,
14967
- color: C.text,
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: C.textSecondary,
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 ? C.buttonPrimary : C.buttonSecondary,
14985
- color: z ? "#ffffff" : C.text,
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: C.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: C.primary,
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) => A(z.target.value),
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: k,
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: R,
15085
- onChange: (z) => D(z.target.value),
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: C,
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: w,
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 ? C.primary : C.border}`,
15137
+ border: `2px dashed ${ee ? w.primary : w.border}`,
15137
15138
  borderRadius: "8px",
15138
- background: ee ? `${C.primary}10` : "transparent",
15139
- color: ee ? C.primary : C.textSecondary,
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: C.attachmentBackground,
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: C.textSecondary }, children: qe(z) }),
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: C.text, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: z.name }),
15170
- /* @__PURE__ */ h.jsx("div", { style: { fontSize: "12px", color: C.textSecondary }, children: He(z.size) })
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: C.textSecondary,
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() || !R.trim(),
15212
- style: Ke(!0, d || U || !v.trim() || !R.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 k(B) {
15268
+ function A(B) {
15268
15269
  y.current && !y.current.contains(B.target) && (m(!1), b(""));
15269
15270
  }
15270
- return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
15271
+ return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
15271
15272
  }, []);
15272
- const w = r.filter(
15273
- (k) => {
15273
+ const D = r.filter(
15274
+ (A) => {
15274
15275
  var B;
15275
- return ((B = k.label) == null ? void 0 : B.toLowerCase().includes(x.toLowerCase())) && !e.includes(k.id);
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((k) => {
15278
+ ), E = i && x.trim() && !r.some((A) => {
15278
15279
  var B;
15279
- return ((B = k.label) == null ? void 0 : B.toLowerCase()) === x.toLowerCase();
15280
- }), C = e.map((k) => r.find((B) => B.id === k)).filter(Boolean), v = J((k) => {
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, k]), b(""), c === 1 ? m(!1) : (B = _.current) == null || B.focus());
15283
- }, [e, t, c]), S = J((k) => {
15284
- t(e.filter((B) => B !== k));
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 k = await (s == null ? void 0 : s(x.trim()));
15288
- k && v(k.id), b("");
15289
- }, [E, x, s, v]), A = J((k) => {
15290
- k.key === "Enter" ? (k.preventDefault(), E ? F() : w.length > 0 && v(w[0].id)) : k.key === "Backspace" && !x && e.length > 0 ? S(e[e.length - 1]) : k.key === "Escape" && (m(!1), b(""));
15291
- }, [E, w, x, e, F, v, S]);
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
- C.map((k) => /* @__PURE__ */ h.jsxs(
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: k.color || p.chipBackground,
15334
- color: k.color ? "#fff" : p.chipText
15334
+ background: A.color || p.chipBackground,
15335
+ color: A.color ? "#fff" : p.chipText
15335
15336
  },
15336
15337
  children: [
15337
- k.label,
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(k.id);
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
- k.id
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: (k) => {
15368
- b(k.target.value), g || m(!0);
15368
+ onChange: (A) => {
15369
+ b(A.target.value), g || m(!0);
15369
15370
  },
15370
15371
  onFocus: () => m(!0),
15371
- onKeyDown: A,
15372
- placeholder: C.length === 0 ? n : "",
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: w.length === 0 && !E ? /* @__PURE__ */ h.jsx(
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
- w.map((k) => /* @__PURE__ */ h.jsxs(
15418
+ D.map((A) => /* @__PURE__ */ h.jsxs(
15418
15419
  "div",
15419
15420
  {
15420
- onClick: () => v(k.id),
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
- k.label,
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(k.id);
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
- k.id
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: w.length > 0 ? `1px solid ${p.border}` : "none"
15477
+ borderTop: D.length > 0 ? `1px solid ${p.border}` : "none"
15477
15478
  },
15478
- onMouseEnter: (k) => {
15479
- k.currentTarget.style.background = p.hoverBackground || "";
15479
+ onMouseEnter: (A) => {
15480
+ A.currentTarget.style.background = p.hoverBackground || "";
15480
15481
  },
15481
- onMouseLeave: (k) => {
15482
- k.currentTarget.style.background = "";
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 A, k;
15523
- return ((A = F.label) == null ? void 0 : A.toLowerCase().includes(S)) || ((k = F.notes) == null ? void 0 : k.toLowerCase().includes(S));
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
- }, w = () => {
15536
+ }, D = () => {
15536
15537
  o && o(d.trim() || void 0), g(!1), f("");
15537
15538
  }, E = () => {
15538
15539
  g(!0);
15539
- }, C = (S) => {
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: C,
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: w,
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: (A) => {
15709
- A.currentTarget.style.background = c.cardHover || "#f3f4f6";
15709
+ onMouseEnter: (T) => {
15710
+ T.currentTarget.style.background = c.cardHover || "#f3f4f6";
15710
15711
  },
15711
- onMouseLeave: (A) => {
15712
- A.currentTarget.style.background = c.cardBackground || "#f9fafb";
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), w = be(null), E = e.reduce((B, R) => {
15753
- let D = r.filter((N) => n(N) === R.id);
15754
- return i && (D = D.sort((N, M) => i(N) - i(M))), B[R.id] = D, B;
15755
- }, {}), C = J((B, R) => {
15756
- const D = t(R), N = n(R);
15757
- m(D), w.current = N, B.dataTransfer.effectAllowed = "move", B.dataTransfer.setData("text/plain", D), requestAnimationFrame(() => {
15758
- const M = B.target;
15759
- M.style.opacity = "0.5";
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 R = B.target;
15763
- R.style.opacity = "1", m(null), b(null), _(null), w.current = null;
15764
- }, []), S = J((B, R, D) => {
15765
- B.preventDefault(), B.dataTransfer.dropEffect = "move", b(R), _(D);
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 R = B.relatedTarget;
15768
- R != null && R.closest("[data-kanban-column]") || (b(null), _(null));
15769
- }, []), A = J((B, R, D) => {
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 = w.current;
15772
- N === R ? a == null || a(g, R, D) : N && o(g, N, R, D), m(null), b(null), _(null), w.current = null;
15773
- }, [g, o, a]), k = (B, R) => /* @__PURE__ */ h.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
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: R })
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 R = E[B.id] || [], D = x === B.id;
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 && !D && b(B.id);
15800
+ N.preventDefault(), g && !C && b(B.id);
15800
15801
  },
15801
15802
  onDragLeave: F,
15802
- onDrop: (N) => A(N, B.id, y ?? R.length),
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, R.length) : k(B, R.length) }),
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 ${D ? "bg-blue-50" : ""}`,
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
- R.map((N, M) => {
15811
- const O = t(N), V = g === O, U = D && y === M && !V;
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) => C(re, N),
15819
+ onDragStart: (re) => w(re, N),
15819
15820
  onDragEnd: v,
15820
- onDragOver: (re) => S(re, B.id, M),
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, R.length);
15834
+ N.preventDefault(), S(N, B.id, M.length);
15834
15835
  },
15835
- children: D && y === R.length && /* @__PURE__ */ h.jsx("div", { className: "h-1 bg-blue-500 rounded-full mx-1 mt-1" })
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
- R.length === 0 && D && /* @__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
+ 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, w = J(
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: A, minutes: k } = F, B = Math.max(t, Math.min(n, A)), R = A < t ? 0 : k, D = (B - t) * i + R / 60 * i, N = o(v), M = Math.max(20, N / 60 * i);
15909
- return { top: D, height: M };
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]), C = J(
15917
+ }, [e, f, t, n, i]), w = J(
15917
15918
  (v) => {
15918
15919
  if (!d) return;
15919
- const S = v.currentTarget.getBoundingClientRect(), A = (v.clientY - S.top) / i * 60, k = Math.floor(A / 60) + t, B = Math.round(A % 60 / 15) * 15, R = Math.min(n, Math.max(t, k)), D = B >= 60 ? 0 : B, N = `${R.toString().padStart(2, "0")}:${D.toString().padStart(2, "0")}`;
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: C
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 = w(v);
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), [w, E] = I(!1), [C, v] = I(null), [S, F] = I(!0), [A, k] = I([]), [B, R] = I({ completed: 0, total: 0 }), D = be(!1), N = be(!0);
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 M = 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
+ 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 = M.current;
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), T = G / 2 - Pt;
16145
- j.fillStyle = "#10b981", j.fillRect(ir, T, 3, Pt * 2);
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 T = De[Mt] * (G / 2 - 12), $ = G / 2 - T;
16153
- j.fillStyle = Mt <= gt ? "#10b981" : "#4b5563", j.fillRect(Pt, $, 3, T * 2);
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
- k((Ce) => [...Ce, ve]), R((Ce) => ({ ...Ce, total: Ce.total + 1 })), ce.current = null, ge.current = [], b(0), p(0), d(0), u("idle");
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 = M.current;
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" && M.current && re.current && fe.current && (W.current = requestAnimationFrame(Ke));
16268
+ l === "recording" && R.current && re.current && fe.current && (W.current = requestAnimationFrame(Ke));
16268
16269
  }, [l]), Ee(() => {
16269
- const Q = M.current;
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 = M.current;
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
- k((j) => [...j, Q]), R((j) => ({ ...j, total: j.total + 1 }));
16300
+ A((j) => [...j, Q]), M((j) => ({ ...j, total: j.total + 1 }));
16300
16301
  }, []);
16301
16302
  if (Ee(() => {
16302
16303
  (async () => {
16303
- if (D.current || A.length === 0 || !t) return;
16304
- D.current = !0;
16305
- const j = A[0];
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
- k((ue) => ue.slice(1)), R((ue) => ({ ...ue, completed: ue.completed + 1 })), D.current = !1;
16313
+ A((ue) => ue.slice(1)), M((ue) => ({ ...ue, completed: ue.completed + 1 })), C.current = !1;
16313
16314
  }
16314
16315
  })();
16315
- }, [A, t, n]), Ee(() => () => {
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 = M.current;
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 T = Math.floor(Ce / 60), $ = Math.floor(Ce % 60);
16346
- G.fillText(`${T.toString().padStart(2, "0")}:${$.toString().padStart(2, "0")}`, gt, we - 6), G.textAlign = "left";
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: M,
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" && !w ? "Pause" : "Play",
16442
- children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !w ? "pause" : "play_arrow" })
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
- C === "insert" ? ae() : l === "idle" ? (v("insert"), z()) : l === "editing" && (v("insert"), wt("insert"));
16461
+ w === "insert" ? ae() : l === "idle" ? (v("insert"), z()) : l === "editing" && (v("insert"), wt("insert"));
16461
16462
  },
16462
- disabled: l === "recording" && C !== "insert" || g,
16463
- style: l === "recording" && C !== "insert" || g ? rt : tt,
16464
- title: C === "insert" ? "Stop recording" : "Insert recording",
16465
- children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: C === "insert" ? "#ef4444" : "#171717" }, children: "add" })
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 || (C === "mic" ? ae() : l === "idle" ? (v("mic"), z()) : l === "editing" && (v("mic"), wt("replace")));
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" && C === "mic" && ae();
16479
+ N.current && l === "recording" && w === "mic" && ae();
16479
16480
  },
16480
16481
  onMouseLeave: () => {
16481
- N.current && l === "recording" && C === "mic" && ae();
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" && C === "mic" && ae();
16488
+ Q.preventDefault(), N.current && l === "recording" && w === "mic" && ae();
16488
16489
  },
16489
- disabled: l === "recording" && C !== "mic" || g,
16490
- style: l === "recording" && C !== "mic" || g ? rt : tt,
16491
- title: S ? "Hold to record (walkie-talkie)" : C === "mic" ? "Stop recording" : "Record",
16492
- children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: C === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
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
- C === "startover" ? ae() : l === "editing" && (v("startover"), oe());
16500
+ w === "startover" ? ae() : l === "editing" && (v("startover"), oe());
16500
16501
  },
16501
- disabled: l === "idle" || l === "recording" && C !== "startover" || g,
16502
- style: l === "idle" || l === "recording" && C !== "startover" || g ? rt : tt,
16503
- title: C === "startover" ? "Stop recording" : "Start over",
16504
- children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: C === "startover" ? "#ef4444" : "#171717" }, children: "refresh" })
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
- placeholder: s = "Type or record...",
16603
- className: o = "",
16604
- rows: a
16603
+ onAIPrompt: s,
16604
+ placeholder: o = "Type or record...",
16605
+ className: a = "",
16606
+ rows: l
16605
16607
  }) {
16606
- const [l, u] = I(!1), [c, d] = I(null), [f, p] = I(!1), g = be(null), m = (y) => {
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
- ${y}` : y);
16610
- }, x = async (y) => {
16611
- if (!(!e.trim() || l || !i)) {
16612
- u(!0), d(y), p(!1);
16611
+ ${w}` : w);
16612
+ }, _ = async (w) => {
16613
+ if (!(!e.trim() || u || !i)) {
16614
+ c(!0), f(w), g(!1);
16613
16615
  try {
16614
- const _ = await i(y, e);
16615
- t(_);
16616
- } catch (_) {
16617
- console.error(`${y} failed:`, _);
16616
+ const v = await i(w, e);
16617
+ t(v);
16618
+ } catch (v) {
16619
+ console.error(`${w} failed:`, v);
16618
16620
  } finally {
16619
- u(!1), d(null);
16621
+ c(!1), f(null);
16620
16622
  }
16621
16623
  }
16622
- }, b = () => {
16624
+ }, D = () => {
16623
16625
  setTimeout(() => {
16624
- var y;
16625
- (y = g.current) != null && y.contains(document.activeElement) || p(!1);
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 ${o}`, children: [
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: m,
16649
+ onTranscriptionComplete: y,
16636
16650
  hideSaveButton: !0,
16637
16651
  variant: "div"
16638
16652
  }
16639
16653
  ),
16640
- /* @__PURE__ */ h.jsxs("div", { className: "flex items-center justify-between mt-3 mb-1", children: [
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: g, children: [
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: () => p(!f),
16659
- disabled: l || !e.trim(),
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: l ? /* @__PURE__ */ h.jsxs(h.Fragment, { 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
- c === "restructure" && "Restructuring...",
16664
- c === "proofread" && "Proofreading...",
16665
- c === "rewrite" && "Rewriting..."
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
- f && !l && /* @__PURE__ */ h.jsxs(
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: b,
16718
+ onBlur: D,
16678
16719
  children: [
16679
16720
  /* @__PURE__ */ h.jsxs(
16680
16721
  "button",
16681
16722
  {
16682
16723
  type: "button",
16683
- onClick: () => x("restructure"),
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: () => x("proofread"),
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: () => x("rewrite"),
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: (y) => t(y.target.value),
16735
- onKeyDown: (y) => y.stopPropagation(),
16736
- placeholder: s,
16737
- rows: a,
16738
- disabled: l,
16739
- className: "flex-1 w-full px-3 py-2 border border-neutral-300 rounded-lg focus:ring-2 focus:ring-neutral-900 text-sm disabled:opacity-50 disabled:bg-neutral-50 resize-none"
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 }), [w, E] = I(!1), [C, v] = I(null), [S, F] = I({ x: 0, y: 0 }), [A, k] = I({ x: 0, y: 0, width: 100, height: 100 }), B = o === "dark", R = J(() => {
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]), D = J((ee, Se) => {
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 = D(ee.width, ee.height);
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, D]);
16821
+ }, [r, C]);
16781
16822
  const N = J(() => {
16782
- const { width: ee, height: Se } = R(), ie = vi[g];
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, R]);
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 } = R(), He = qe / 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, R]);
16819
- const M = (ee) => {
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 }), k({ ...y });
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 }), k({ ...y }));
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 (w) {
16879
+ if (D) {
16839
16880
  const Ae = Re - S.x, qe = ke - S.y;
16840
- let ze = A.x + Ae, He = A.y + qe;
16841
- ze = Math.max(0, Math.min(ze, 100 - A.width)), He = Math.max(0, Math.min(He, 100 - A.height)), _({ ...A, x: ze, y: He });
16842
- } else if (C) {
16843
- const Ae = vi[g], { width: qe, height: ze } = R(), He = qe / ze, Y = Ae ? Ae / He : null;
16844
- let L = { ...A };
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 (C === "se")
16847
- L.width = Math.max(10, Math.min(100 - L.x, A.width + ye)), Y ? (L.height = L.width / Y, L.y + L.height > 100 && (L.height = 100 - L.y, L.width = L.height * Y)) : L.height = Math.max(10, Math.min(100 - L.y, A.height + Ke));
16848
- else if (C === "sw") {
16849
- const z = -ye, ae = Math.max(10, A.width + z), me = A.x + A.width - ae;
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 = A.x + A.width - L.width)) : L.height = Math.max(10, Math.min(100 - L.y, A.height + Ke)));
16851
- } else if (C === "ne")
16852
- if (L.width = Math.max(10, Math.min(100 - L.x, A.width + ye)), Y) {
16853
- const z = L.width / Y, ae = A.y + A.height - z;
16854
- ae >= 0 ? (L.height = z, L.y = ae) : (L.y = 0, L.height = A.y + A.height, L.width = L.height * Y);
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, A.height + z), me = A.y + A.height - ae;
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 (C === "nw") {
16860
- const z = -ye, ae = Math.max(10, A.width + z), me = A.x + A.width - ae;
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 = A.y + A.height - xe;
16864
- Ge >= 0 ? (L.height = xe, L.y = Ge) : (L.y = 0, L.height = A.y + A.height, L.width = L.height * Y, L.x = A.x + A.width - L.width);
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, A.height + xe), vt = A.y + A.height - Ge;
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 } = R(), 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");
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: w ? "grabbing" : C ? "nwse-resize" : "grab",
17005
+ cursor: D ? "grabbing" : w ? "nwse-resize" : "grab",
16965
17006
  maxWidth: "100%",
16966
17007
  maxHeight: "100%"
16967
17008
  },
16968
- onMouseDown: M,
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, w, E; y < g; ++y)
17218
- if (w = m[y]) {
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
- w._next = E || null;
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), w = (f * f - u * u - n * m) / (2 * f * t * y), E = Math.log(Math.sqrt(_ * _ + 1) - _), C = Math.log(Math.sqrt(w * w + 1) - w);
18101
- b = (C - E) / e, x = function(v) {
18102
- var S = v * b, F = Ja(E), A = u / (t * y) * (F * km(e * S + E) - Sm(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 + A * p,
18105
- l + A * g,
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(D) {
18785
- D.property("__zoom", nu).on("wheel.zoom", S, { passive: !1 }).on("mousedown.zoom", F).on("dblclick.zoom", A).filter(i).on("touchstart.zoom", k).on("touchmove.zoom", B).on("touchend.zoom touchcancel.zoom", R).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
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(D, N, M, O) {
18788
- var V = D.selection ? D.selection() : D;
18789
- V.property("__zoom", nu), D !== V ? E(D, N, M, O) : V.interrupt().each(function() {
18790
- C(this, arguments).event(O).start().zoom(null, typeof N == "function" ? N.apply(this, arguments) : N).end();
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(D, N, M, O) {
18793
- b.scaleTo(D, function() {
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
- }, M, O);
18797
- }, b.scaleTo = function(D, N, M, O) {
18798
- b.transform(D, function() {
18799
- var V = e.apply(this, arguments), U = this.__zoom, re = M == null ? w(V) : typeof M == "function" ? M.apply(this, arguments) : M, q = U.invert(re), Z = typeof N == "function" ? N.apply(this, arguments) : N;
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
- }, M, O);
18802
- }, b.translateBy = function(D, N, M, O) {
18803
- b.transform(D, function() {
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 M == "function" ? M.apply(this, arguments) : M
18847
+ typeof R == "function" ? R.apply(this, arguments) : R
18807
18848
  ), e.apply(this, arguments), o);
18808
18849
  }, null, O);
18809
- }, b.translateTo = function(D, N, M, O, V) {
18810
- b.transform(D, function() {
18811
- var U = e.apply(this, arguments), re = this.__zoom, q = O == null ? w(U) : typeof O == "function" ? O.apply(this, arguments) : O;
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 M == "function" ? -M.apply(this, arguments) : -M
18855
+ typeof R == "function" ? -R.apply(this, arguments) : -R
18815
18856
  ), U, o);
18816
18857
  }, O, V);
18817
18858
  };
18818
- function y(D, N) {
18819
- return N = Math.max(s[0], Math.min(s[1], N)), N === D.k ? D : new ar(N, D.x, D.y);
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 _(D, N, M) {
18822
- var O = N[0] - M[0] * D.k, V = N[1] - M[1] * D.k;
18823
- return O === D.x && V === D.y ? D : new ar(D.k, O, V);
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 w(D) {
18826
- return [(+D[0][0] + +D[1][0]) / 2, (+D[0][1] + +D[1][1]) / 2];
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(D, N, M, O) {
18829
- D.on("start.zoom", function() {
18830
- C(this, arguments).event(O).start();
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
- C(this, arguments).event(O).end();
18873
+ w(this, arguments).event(O).end();
18833
18874
  }).tween("zoom", function() {
18834
- var V = this, U = arguments, re = C(V, U).event(O), q = e.apply(V, U), Z = M == null ? w(q) : typeof M == "function" ? M.apply(V, U) : M, W = Math.max(q[1][0] - q[0][0], q[1][1] - q[0][1]), se = V.__zoom, ce = typeof N == "function" ? N.apply(V, U) : N, fe = l(se.invert(Z).concat(W / se.k), ce.invert(Z).concat(W / ce.k));
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(D, N, M) {
18846
- return !M && D.__zooming || new v(D, N);
18886
+ function w(C, N, R) {
18887
+ return !R && C.__zooming || new v(C, N);
18847
18888
  }
18848
- function v(D, N) {
18849
- this.that = D, this.args = N, this.active = 0, this.sourceEvent = null, this.extent = e.apply(D, N), this.taps = 0;
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(D) {
18853
- return D && (this.sourceEvent = D), this;
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(D, N) {
18859
- return this.mouse && D !== "mouse" && (this.mouse[1] = N.invert(this.mouse[0])), this.touch0 && D !== "touch" && (this.touch0[1] = N.invert(this.touch0[0])), this.touch1 && D !== "touch" && (this.touch1[1] = N.invert(this.touch1[0])), this.that.__zoom = N, this.emit("zoom"), this;
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(D) {
18905
+ emit: function(C) {
18865
18906
  var N = $t(this.that).datum();
18866
18907
  u.call(
18867
- D,
18908
+ C,
18868
18909
  this.that,
18869
- new z2(D, {
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(D, ...N) {
18920
+ function S(C, ...N) {
18880
18921
  if (!r.apply(this, arguments)) return;
18881
- var M = C(this, N).event(D), O = this.__zoom, V = Math.max(s[0], Math.min(s[1], O.k * Math.pow(2, n.apply(this, arguments)))), U = kr(D);
18882
- if (M.wheel)
18883
- (M.mouse[0][0] !== U[0] || M.mouse[0][1] !== U[1]) && (M.mouse[1] = O.invert(M.mouse[0] = U)), clearTimeout(M.wheel);
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
- M.mouse = [U, O.invert(U)], Ni(this), M.start();
18927
+ R.mouse = [U, O.invert(U)], Ni(this), R.start();
18887
18928
  }
18888
- Cn(D), M.wheel = setTimeout(re, g), M.zoom("mouse", t(_(y(O, V), M.mouse[0], M.mouse[1]), M.extent, o));
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
- M.wheel = null, M.end();
18931
+ R.wheel = null, R.end();
18891
18932
  }
18892
18933
  }
18893
- function F(D, ...N) {
18934
+ function F(C, ...N) {
18894
18935
  if (f || !r.apply(this, arguments)) return;
18895
- var M = D.currentTarget, O = C(this, N, !0).event(D), V = $t(D.view).on("mousemove.zoom", Z, !0).on("mouseup.zoom", W, !0), U = kr(D, M), re = D.clientX, q = D.clientY;
18896
- tm(D.view), Xs(D), O.mouse = [U, this.__zoom.invert(U)], Ni(this), O.start();
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, M), O.mouse[1]), O.extent, o));
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 A(D, ...N) {
18949
+ function T(C, ...N) {
18909
18950
  if (r.apply(this, arguments)) {
18910
- var M = this.__zoom, O = kr(D.changedTouches ? D.changedTouches[0] : D, this), V = M.invert(O), U = M.k * (D.shiftKey ? 0.5 : 2), re = t(_(y(M, U), O, V), e.apply(this, N), o);
18911
- Cn(D), a > 0 ? $t(this).transition().duration(a).call(E, re, O, D) : $t(this).call(b.transform, re, O, D);
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 k(D, ...N) {
18955
+ function A(C, ...N) {
18915
18956
  if (r.apply(this, arguments)) {
18916
- var M = D.touches, O = M.length, V = C(this, N, D.changedTouches.length === O).event(D), U, re, q, Z;
18917
- for (Xs(D), re = 0; re < O; ++re)
18918
- q = M[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);
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(D, ...N) {
18965
+ function B(C, ...N) {
18925
18966
  if (this.__zooming) {
18926
- var M = C(this, N).event(D), O = D.changedTouches, V = O.length, U, re, q, Z;
18927
- for (Cn(D), U = 0; U < V; ++U)
18928
- re = O[U], q = kr(re, this), M.touch0 && M.touch0[2] === re.identifier ? M.touch0[0] = q : M.touch1 && M.touch1[2] === re.identifier && (M.touch1[0] = q);
18929
- if (re = M.that.__zoom, M.touch1) {
18930
- var W = M.touch0[0], se = M.touch0[1], ce = M.touch1[0], fe = M.touch1[1], ge = (ge = ce[0] - W[0]) * ge + (ge = ce[1] - W[1]) * ge, Be = (Be = fe[0] - se[0]) * Be + (Be = fe[1] - se[1]) * Be;
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 (M.touch0) q = M.touch0[0], Z = M.touch0[1];
18973
+ } else if (R.touch0) q = R.touch0[0], Z = R.touch0[1];
18933
18974
  else return;
18934
- M.zoom("touch", t(_(re, q, Z), M.extent, o));
18975
+ R.zoom("touch", t(_(re, q, Z), R.extent, o));
18935
18976
  }
18936
18977
  }
18937
- function R(D, ...N) {
18978
+ function M(C, ...N) {
18938
18979
  if (this.__zooming) {
18939
- var M = C(this, N).event(D), O = D.changedTouches, V = O.length, U, re;
18940
- for (Xs(D), f && clearTimeout(f), f = setTimeout(function() {
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], M.touch0 && M.touch0[2] === re.identifier ? delete M.touch0 : M.touch1 && M.touch1[2] === re.identifier && delete M.touch1;
18944
- if (M.touch1 && !M.touch0 && (M.touch0 = M.touch1, delete M.touch1), M.touch0) M.touch0[1] = this.__zoom.invert(M.touch0[0]);
18945
- else if (M.end(), M.taps === 2 && (re = kr(re, this), Math.hypot(d[0] - re[0], d[1] - re[1]) < x)) {
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(D) {
18952
- return arguments.length ? (n = typeof D == "function" ? D : Ei(+D), b) : n;
18953
- }, b.filter = function(D) {
18954
- return arguments.length ? (r = typeof D == "function" ? D : Ei(!!D), b) : r;
18955
- }, b.touchable = function(D) {
18956
- return arguments.length ? (i = typeof D == "function" ? D : Ei(!!D), b) : i;
18957
- }, b.extent = function(D) {
18958
- return arguments.length ? (e = typeof D == "function" ? D : Ei([[+D[0][0], +D[0][1]], [+D[1][0], +D[1][1]]]), b) : e;
18959
- }, b.scaleExtent = function(D) {
18960
- return arguments.length ? (s[0] = +D[0], s[1] = +D[1], b) : [s[0], s[1]];
18961
- }, b.translateExtent = function(D) {
18962
- return arguments.length ? (o[0][0] = +D[0][0], o[1][0] = +D[1][0], o[0][1] = +D[0][1], o[1][1] = +D[1][1], b) : [[o[0][0], o[0][1]], [o[1][0], o[1][1]]];
18963
- }, b.constrain = function(D) {
18964
- return arguments.length ? (t = D, b) : t;
18965
- }, b.duration = function(D) {
18966
- return arguments.length ? (a = +D, b) : a;
18967
- }, b.interpolate = function(D) {
18968
- return arguments.length ? (l = D, b) : 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 D = u.on.apply(u, arguments);
18971
- return D === u ? b : D;
18972
- }, b.clickDistance = function(D) {
18973
- return arguments.length ? (m = (D = +D) * D, b) : Math.sqrt(m);
18974
- }, b.tapDistance = function(D) {
18975
- return arguments.length ? (x = +D, b) : 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 w = $t(a.current), E = ls.translate(x, b).scale(y);
19020
- w.call(l.current.transform, E);
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 w = 1 / 0, E = 1 / 0, C = -1 / 0, v = -1 / 0;
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
- w = Math.min(w, O.x), E = Math.min(E, O.y), C = Math.max(C, O.x + V), v = Math.max(v, O.y + U);
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 = C - w, F = v - E, A = (_.width - b * 2) / S, k = (_.height - b * 2) / F, B = Math.min(A, k, t), R = (w + C) / 2, D = (E + v) / 2, N = _.width / 2 - R * B, M = _.height / 2 - D * B;
19036
- d(N, M, B, !0);
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((_, w) => {
19100
+ const m = J((_, D) => {
19060
19101
  const E = g.current;
19061
19102
  return {
19062
19103
  x: (_ - E.x) / E.k,
19063
- y: (w - E.y) / E.k
19104
+ y: (D - E.y) / E.k
19064
19105
  };
19065
- }, []), x = J((_, w) => {
19106
+ }, []), x = J((_, D) => {
19066
19107
  if (s) return;
19067
- w.preventDefault(), w.stopPropagation();
19068
- const E = w.currentTarget, C = parseFloat(E.dataset.x || "0"), v = parseFloat(E.dataset.y || "0");
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: w.clientX,
19071
- y: w.clientY,
19072
- nodeX: C,
19111
+ x: D.clientX,
19112
+ y: D.clientY,
19113
+ nodeX: w,
19073
19114
  nodeY: v
19074
- }, p.current = { x: C, y: v }, a(_), u(!0), d({ x: 0, y: 0 }), t == null || t(_);
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 w = g.current, E = f.current, C = _.clientX - E.x, v = _.clientY - E.y, S = C / w.k, F = v / w.k, A = E.nodeX + S, k = E.nodeY + F;
19078
- p.current = { x: A, y: k }, d({ x: S, y: F }), n == null || n(o, A, k, S, F);
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
- }, w = () => {
19129
+ }, D = () => {
19089
19130
  y();
19090
19131
  };
19091
- return window.addEventListener("mousemove", _), window.addEventListener("mouseup", w), () => {
19092
- window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", w);
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 ? (A) => {
19111
- const k = typeof A == "function" ? A(u) : A;
19112
- s == null || s(Array.from(k));
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((A, k) => {
19160
+ const y = J((T, A) => {
19120
19161
  const B = x.current;
19121
19162
  return {
19122
- x: (A - B.x) / B.k,
19123
- y: (k - B.y) / B.k
19163
+ x: (T - B.x) / B.k,
19164
+ y: (A - B.y) / B.k
19124
19165
  };
19125
- }, []), _ = J((A, k) => {
19126
- const B = b.current.get(A);
19166
+ }, []), _ = J((T, A) => {
19167
+ const B = b.current.get(T);
19127
19168
  if (!B) return !1;
19128
- const R = B.width || 200, D = B.height || 100;
19129
- return B.x < k.x + k.width && B.x + R > k.x && B.y < k.y + k.height && B.y + D > k.y;
19130
- }, []), w = J((A) => {
19131
- if (n || A.target.closest("[data-qmap-node]")) return;
19132
- A.preventDefault();
19133
- const B = y(A.clientX, A.clientY);
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), A.shiftKey || c(/* @__PURE__ */ new Set());
19140
- }, [n, y]), E = J((A) => {
19180
+ }), g(!0), T.shiftKey || c(/* @__PURE__ */ new Set());
19181
+ }, [n, y]), E = J((T) => {
19141
19182
  if (!p || !m.current) return;
19142
- const k = m.current, B = y(A.clientX, A.clientY), R = {
19143
- x: Math.min(k.x, B.x),
19144
- y: Math.min(k.y, B.y),
19145
- width: Math.abs(B.x - k.x),
19146
- height: Math.abs(B.y - k.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(R);
19149
- const D = /* @__PURE__ */ new Set();
19189
+ f(M);
19190
+ const C = /* @__PURE__ */ new Set();
19150
19191
  for (const [N] of b.current)
19151
- _(N, R) && D.add(N);
19152
- c(D);
19153
- }, [p, y, _]), C = J(() => {
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 A = (B) => {
19199
+ const T = (B) => {
19159
19200
  E(B);
19160
- }, k = () => {
19161
- C();
19201
+ }, A = () => {
19202
+ w();
19162
19203
  };
19163
- return window.addEventListener("mousemove", A), window.addEventListener("mouseup", k), () => {
19164
- window.removeEventListener("mousemove", A), window.removeEventListener("mouseup", k);
19204
+ return window.addEventListener("mousemove", T), window.addEventListener("mouseup", A), () => {
19205
+ window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", A);
19165
19206
  };
19166
- }, [p, E, C]);
19167
- const v = J((A, k = !1) => {
19207
+ }, [p, E, w]);
19208
+ const v = J((T, A = !1) => {
19168
19209
  c((B) => {
19169
- const R = new Set(k ? B : []);
19170
- return B.has(A) && k ? R.delete(A) : R.add(A), s == null || s(Array.from(R)), R;
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 A = new Set(b.current.keys());
19174
- c(A), s == null || s(Array.from(A));
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: w,
19224
+ startSelection: D,
19184
19225
  updateSelection: E,
19185
- endSelection: C,
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: w = ay,
19547
+ defaultEdgeWidth: D = ay,
19507
19548
  draggable: E = !0,
19508
- selectable: C = !0,
19549
+ selectable: w = !0,
19509
19550
  zoomable: v = !0,
19510
19551
  pannable: S = !0,
19511
19552
  className: F = "",
19512
- style: A,
19513
- background: k = "#f8fafc",
19553
+ style: T,
19554
+ background: A = "#f8fafc",
19514
19555
  showGrid: B = !1,
19515
- gridSize: R = 20
19556
+ gridSize: M = 20
19516
19557
  }) {
19517
- const D = r.data || { positions: {} }, N = D.positions || {}, M = ct(() => {
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 || D.transform,
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
- ...D,
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 = M.get(Y);
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: M,
19581
- disabled: !C,
19621
+ nodePositions: R,
19622
+ disabled: !w,
19582
19623
  controlledSelectedIds: c,
19583
19624
  onSelectionChange: d
19584
19625
  }), Re = J((Y) => {
19585
- const L = M.get(Y) || { x: 0, y: 0, width: i, height: s }, ye = W.get(Y);
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
- }, [M, W, i, s]), ke = ct(() => {
19628
+ }, [R, W, i, s]), ke = ct(() => {
19588
19629
  const Y = /* @__PURE__ */ new Map();
19589
- for (const L of M.keys())
19630
+ for (const L of R.keys())
19590
19631
  Y.set(L, Re(L));
19591
19632
  return Y;
19592
- }, [M, Re]), Ae = J((Y, L) => {
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: k,
19653
+ background: A,
19613
19654
  backgroundImage: He,
19614
- backgroundSize: B ? `${R}px ${R}px` : void 0,
19655
+ backgroundSize: B ? `${M}px ${M}px` : void 0,
19615
19656
  cursor: _e ? "crosshair" : S ? "grab" : "default",
19616
- ...A
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: w,
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(M.values())),
19790
+ onClick: () => Z(Array.from(R.values())),
19750
19791
  style: {
19751
19792
  width: 32,
19752
19793
  height: 32,