@qwanyx/stack 0.2.100 → 0.2.101

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
@@ -2,7 +2,7 @@ var wd = Object.defineProperty;
2
2
  var Cd = (r, e, t) => e in r ? wd(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var Et = (r, e, t) => Cd(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  import * as Bi from "react";
5
- import Pe, { createContext as su, useState as L, useCallback as ee, useEffect as _e, useContext as iu, useRef as ve, useMemo as at, useLayoutEffect as cn, Suspense as Sd, forwardRef as ou, memo as li } from "react";
5
+ import Pe, { createContext as su, useState as L, useCallback as ee, useEffect as _e, useContext as iu, useRef as ve, useMemo as lt, useLayoutEffect as cn, Suspense as Sd, forwardRef as ou, memo as li } from "react";
6
6
  import { flushSync as Ed, createPortal as kd } from "react-dom";
7
7
  class Cy {
8
8
  constructor(e) {
@@ -4017,7 +4017,7 @@ class Sy {
4017
4017
  }
4018
4018
  }
4019
4019
  const Fi = "qwanyx_auth_token", Ri = "qwanyx_refresh_token", Li = "qwanyx_auth_user";
4020
- class ct {
4020
+ class et {
4021
4021
  /**
4022
4022
  * Store authentication token
4023
4023
  */
@@ -4156,7 +4156,7 @@ class uu {
4156
4156
  })).json();
4157
4157
  if (l.success && ((n = l.result) != null && n.token)) {
4158
4158
  const { token: u, user: c } = l.result;
4159
- return ct.setToken(u), ct.setUser(c), (i = (s = this.config).onLogin) == null || i.call(s, c), { success: !0, user: c, token: u };
4159
+ return et.setToken(u), et.setUser(c), (i = (s = this.config).onLogin) == null || i.call(s, c), { success: !0, user: c, token: u };
4160
4160
  } else
4161
4161
  return { success: !1, error: ((o = l.result) == null ? void 0 : o.error) || l.error || "Verification failed" };
4162
4162
  } catch (a) {
@@ -4209,7 +4209,7 @@ class uu {
4209
4209
  })).json();
4210
4210
  if (u.success && ((s = u.result) != null && s.token)) {
4211
4211
  const { token: c, user: d } = u.result;
4212
- return ct.setToken(c), ct.setUser(d), (o = (i = this.config).onLogin) == null || o.call(i, d), { success: !0, user: d, token: c };
4212
+ return et.setToken(c), et.setUser(d), (o = (i = this.config).onLogin) == null || o.call(i, d), { success: !0, user: d, token: c };
4213
4213
  } else
4214
4214
  return { success: !1, error: ((a = u.result) == null ? void 0 : a.message) || u.error || "Password reset failed" };
4215
4215
  } catch (l) {
@@ -4251,7 +4251,7 @@ class uu {
4251
4251
  };
4252
4252
  if (d.success && ((o = d.result) != null && o.token)) {
4253
4253
  const { token: f, user: p } = d.result;
4254
- return ct.setToken(f), ct.setUser(p), (l = (a = this.config).onLogin) == null || l.call(a, p), { success: !0, user: p, token: f };
4254
+ return et.setToken(f), et.setUser(p), (l = (a = this.config).onLogin) == null || l.call(a, p), { success: !0, user: p, token: f };
4255
4255
  } else
4256
4256
  return { success: !1, error: ((u = d.result) == null ? void 0 : u.error) || d.error || "Login failed" };
4257
4257
  } catch (c) {
@@ -4273,7 +4273,7 @@ class uu {
4273
4273
  */
4274
4274
  logout() {
4275
4275
  var e, t;
4276
- ct.clearAll(), (t = (e = this.config).onLogout) == null || t.call(e);
4276
+ et.clearAll(), (t = (e = this.config).onLogout) == null || t.call(e);
4277
4277
  }
4278
4278
  /**
4279
4279
  * Check if user has a specific role in a group
@@ -4285,7 +4285,7 @@ class uu {
4285
4285
  method: "POST",
4286
4286
  headers: {
4287
4287
  "Content-Type": "application/json",
4288
- ...ct.getAuthHeader()
4288
+ ...et.getAuthHeader()
4289
4289
  },
4290
4290
  body: JSON.stringify({
4291
4291
  system_id: this.config.systemId || "system",
@@ -4312,13 +4312,13 @@ class uu {
4312
4312
  * Get current user from storage
4313
4313
  */
4314
4314
  getCurrentUser() {
4315
- return ct.getUser();
4315
+ return et.getUser();
4316
4316
  }
4317
4317
  /**
4318
4318
  * Check if user is authenticated
4319
4319
  */
4320
4320
  isAuthenticated() {
4321
- return ct.isAuthenticated();
4321
+ return et.isAuthenticated();
4322
4322
  }
4323
4323
  // ===== USER MANAGEMENT =====
4324
4324
  /**
@@ -4330,7 +4330,7 @@ class uu {
4330
4330
  method: "POST",
4331
4331
  headers: {
4332
4332
  "Content-Type": "application/json",
4333
- ...ct.getAuthHeader()
4333
+ ...et.getAuthHeader()
4334
4334
  },
4335
4335
  body: JSON.stringify({
4336
4336
  system_id: "system",
@@ -4365,7 +4365,7 @@ class uu {
4365
4365
  method: "POST",
4366
4366
  headers: {
4367
4367
  "Content-Type": "application/json",
4368
- ...ct.getAuthHeader()
4368
+ ...et.getAuthHeader()
4369
4369
  },
4370
4370
  body: JSON.stringify({
4371
4371
  system_id: "system",
@@ -4401,7 +4401,7 @@ class uu {
4401
4401
  method: "POST",
4402
4402
  headers: {
4403
4403
  "Content-Type": "application/json",
4404
- ...ct.getAuthHeader()
4404
+ ...et.getAuthHeader()
4405
4405
  },
4406
4406
  body: JSON.stringify({
4407
4407
  system_id: "system",
@@ -4433,7 +4433,7 @@ class uu {
4433
4433
  method: "POST",
4434
4434
  headers: {
4435
4435
  "Content-Type": "application/json",
4436
- ...ct.getAuthHeader()
4436
+ ...et.getAuthHeader()
4437
4437
  },
4438
4438
  body: JSON.stringify({
4439
4439
  system_id: "system",
@@ -4463,7 +4463,7 @@ class uu {
4463
4463
  method: "POST",
4464
4464
  headers: {
4465
4465
  "Content-Type": "application/json",
4466
- ...ct.getAuthHeader()
4466
+ ...et.getAuthHeader()
4467
4467
  },
4468
4468
  body: JSON.stringify({
4469
4469
  system_id: "system",
@@ -4485,6 +4485,44 @@ class uu {
4485
4485
  };
4486
4486
  }
4487
4487
  }
4488
+ /**
4489
+ * Update user profile data (firstName, lastName, phone, etc.)
4490
+ */
4491
+ async updateUser(e, t) {
4492
+ var n, s;
4493
+ try {
4494
+ const o = await (await fetch(`${this.config.apiUrl}/spu/invoke`, {
4495
+ method: "POST",
4496
+ headers: {
4497
+ "Content-Type": "application/json",
4498
+ ...et.getAuthHeader()
4499
+ },
4500
+ body: JSON.stringify({
4501
+ system_id: "system",
4502
+ coprocessor: "auth",
4503
+ method: "update_user",
4504
+ params: {
4505
+ user_id: e,
4506
+ updates: t
4507
+ }
4508
+ })
4509
+ })).json();
4510
+ if (o.success && ((n = o.result) != null && n.success)) {
4511
+ const a = et.getUser();
4512
+ if (a && (a._id === e || a.id === e)) {
4513
+ const l = { ...a, ...t };
4514
+ et.setUser(l);
4515
+ }
4516
+ return { success: !0 };
4517
+ }
4518
+ return { success: !1, error: ((s = o.result) == null ? void 0 : s.error) || o.error || "Update failed" };
4519
+ } catch (i) {
4520
+ return {
4521
+ success: !1,
4522
+ error: i instanceof Error ? i.message : "Network error"
4523
+ };
4524
+ }
4525
+ }
4488
4526
  /**
4489
4527
  * Remove a user from the current system
4490
4528
  */
@@ -4496,7 +4534,7 @@ class uu {
4496
4534
  method: "POST",
4497
4535
  headers: {
4498
4536
  "Content-Type": "application/json",
4499
- ...ct.getAuthHeader()
4537
+ ...et.getAuthHeader()
4500
4538
  },
4501
4539
  body: JSON.stringify({
4502
4540
  system_id: "system",
@@ -4561,7 +4599,7 @@ class Kd {
4561
4599
  params: o
4562
4600
  } = t, a = `${this.config.baseUrl}/${e}${this.buildQueryString(o)}`, l = {
4563
4601
  ...this.config.headers,
4564
- ...ct.getAuthHeader(),
4602
+ ...et.getAuthHeader(),
4565
4603
  ...s
4566
4604
  }, u = {
4567
4605
  method: n,
@@ -4893,18 +4931,18 @@ function Qd() {
4893
4931
  if (St && xe && typeof St.stack == "string") {
4894
4932
  for (var Re = St.stack.split(`
4895
4933
  `), vt = xe.stack.split(`
4896
- `), st = Re.length - 1, ot = vt.length - 1; st >= 1 && ot >= 0 && Re[st] !== vt[ot]; )
4897
- ot--;
4898
- for (; st >= 1 && ot >= 0; st--, ot--)
4899
- if (Re[st] !== vt[ot]) {
4900
- if (st !== 1 || ot !== 1)
4934
+ `), it = Re.length - 1, at = vt.length - 1; it >= 1 && at >= 0 && Re[it] !== vt[at]; )
4935
+ at--;
4936
+ for (; it >= 1 && at >= 0; it--, at--)
4937
+ if (Re[it] !== vt[at]) {
4938
+ if (it !== 1 || at !== 1)
4901
4939
  do
4902
- if (st--, ot--, ot < 0 || Re[st] !== vt[ot]) {
4940
+ if (it--, at--, at < 0 || Re[it] !== vt[at]) {
4903
4941
  var Ft = `
4904
- ` + Re[st].replace(" at new ", " at ");
4942
+ ` + Re[it].replace(" at new ", " at ");
4905
4943
  return D.displayName && Ft.includes("<anonymous>") && (Ft = Ft.replace("<anonymous>", D.displayName)), typeof D == "function" && Z.set(D, Ft), Ft;
4906
4944
  }
4907
- while (st >= 1 && ot >= 0);
4945
+ while (it >= 1 && at >= 0);
4908
4946
  break;
4909
4947
  }
4910
4948
  }
@@ -4970,8 +5008,8 @@ function Qd() {
4970
5008
  throw vt.name = "Invariant Violation", vt;
4971
5009
  }
4972
5010
  Re = D[Fe]($, Fe, xe, te, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
4973
- } catch (st) {
4974
- Re = st;
5011
+ } catch (it) {
5012
+ Re = it;
4975
5013
  }
4976
5014
  Re && !(Re instanceof Error) && (V(Le), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", xe || "React class", te, Fe, typeof Re), V(null)), Re instanceof Error && !(Re.message in ze) && (ze[Re.message] = !0, V(Le), x("Failed %s type: %s", te, Re.message), V(null));
4977
5015
  }
@@ -5023,10 +5061,10 @@ function Qd() {
5023
5061
  }
5024
5062
  return D.key !== void 0;
5025
5063
  }
5026
- function rt(D, $) {
5064
+ function nt(D, $) {
5027
5065
  typeof D.ref == "string" && ke.current;
5028
5066
  }
5029
- function nt(D, $) {
5067
+ function st(D, $) {
5030
5068
  {
5031
5069
  var te = function() {
5032
5070
  mt || (mt = !0, x("%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)", $));
@@ -5080,17 +5118,17 @@ function Qd() {
5080
5118
  function R(D, $, te, xe, Le) {
5081
5119
  {
5082
5120
  var Ue, Fe = {}, Re = null, vt = null;
5083
- te !== void 0 && (fe(te), Re = "" + te), Qe($) && (fe($.key), Re = "" + $.key), ge($) && (vt = $.ref, rt($, Le));
5121
+ te !== void 0 && (fe(te), Re = "" + te), Qe($) && (fe($.key), Re = "" + $.key), ge($) && (vt = $.ref, nt($, Le));
5084
5122
  for (Ue in $)
5085
5123
  Ie.call($, Ue) && !Ke.hasOwnProperty(Ue) && (Fe[Ue] = $[Ue]);
5086
5124
  if (D && D.defaultProps) {
5087
- var st = D.defaultProps;
5088
- for (Ue in st)
5089
- Fe[Ue] === void 0 && (Fe[Ue] = st[Ue]);
5125
+ var it = D.defaultProps;
5126
+ for (Ue in it)
5127
+ Fe[Ue] === void 0 && (Fe[Ue] = it[Ue]);
5090
5128
  }
5091
5129
  if (Re || vt) {
5092
- var ot = typeof D == "function" ? D.displayName || D.name || "Unknown" : D;
5093
- Re && nt(Fe, ot), vt && Lt(Fe, ot);
5130
+ var at = typeof D == "function" ? D.displayName || D.name || "Unknown" : D;
5131
+ Re && st(Fe, at), vt && Lt(Fe, at);
5094
5132
  }
5095
5133
  return J(D, Re, vt, Le, xe, ke.current, Fe);
5096
5134
  }
@@ -5149,7 +5187,7 @@ Check the top-level render call using <` + te + ">.");
5149
5187
  D && D._owner && D._owner !== he.current && (xe = " It was passed a child from " + M(D._owner.type) + "."), K(D), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', te, xe), K(null);
5150
5188
  }
5151
5189
  }
5152
- function it(D, $) {
5190
+ function ot(D, $) {
5153
5191
  {
5154
5192
  if (typeof D != "object")
5155
5193
  return;
@@ -5168,7 +5206,7 @@ Check the top-level render call using <` + te + ">.");
5168
5206
  }
5169
5207
  }
5170
5208
  }
5171
- function ut(D) {
5209
+ function ct(D) {
5172
5210
  {
5173
5211
  var $ = D.type;
5174
5212
  if ($ == null || typeof $ == "string")
@@ -5214,24 +5252,24 @@ Check the top-level render call using <` + te + ">.");
5214
5252
  (D === void 0 || typeof D == "object" && D !== null && Object.keys(D).length === 0) && (Re += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
5215
5253
  var vt = $e();
5216
5254
  vt ? Re += vt : Re += Ae();
5217
- var st;
5218
- D === null ? st = "null" : ie(D) ? st = "array" : D !== void 0 && D.$$typeof === e ? (st = "<" + (M(D.type) || "Unknown") + " />", Re = " Did you accidentally export a JSX literal instead of a component?") : st = typeof D, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", st, Re);
5255
+ var it;
5256
+ D === null ? it = "null" : ie(D) ? it = "array" : D !== void 0 && D.$$typeof === e ? (it = "<" + (M(D.type) || "Unknown") + " />", Re = " Did you accidentally export a JSX literal instead of a component?") : it = typeof D, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", it, Re);
5219
5257
  }
5220
- var ot = R(D, $, te, Le, Ue);
5221
- if (ot == null)
5222
- return ot;
5258
+ var at = R(D, $, te, Le, Ue);
5259
+ if (at == null)
5260
+ return at;
5223
5261
  if (Fe) {
5224
5262
  var Ft = $.children;
5225
5263
  if (Ft !== void 0)
5226
5264
  if (xe)
5227
5265
  if (ie(Ft)) {
5228
5266
  for (var Hr = 0; Hr < Ft.length; Hr++)
5229
- it(Ft[Hr], D);
5267
+ ot(Ft[Hr], D);
5230
5268
  Object.freeze && Object.freeze(Ft);
5231
5269
  } else
5232
5270
  x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
5233
5271
  else
5234
- it(Ft, D);
5272
+ ot(Ft, D);
5235
5273
  }
5236
5274
  if (Ie.call($, "key")) {
5237
5275
  var Er = M(D), St = Object.keys($).filter(function(_d) {
@@ -5247,7 +5285,7 @@ React keys must be passed directly to JSX without using spread:
5247
5285
  <%s key={someKey} {...props} />`, Ni, Er, vd, Er), We[Er + Ni] = !0;
5248
5286
  }
5249
5287
  }
5250
- return D === n ? Je(ot) : ut(ot), ot;
5288
+ return D === n ? Je(at) : ct(at), at;
5251
5289
  }
5252
5290
  }
5253
5291
  function xt(D, $, te) {
@@ -5268,7 +5306,7 @@ function Ay({ apiUrl: r, systemId: e, children: t }) {
5268
5306
  const S = await d.isAdmin(k);
5269
5307
  l(S);
5270
5308
  }, [d]), p = ee(() => {
5271
- const k = ct.getToken(), S = ct.getUser();
5309
+ const k = et.getToken(), S = et.getUser();
5272
5310
  k && S ? (o(k), s(S), f(S._id).finally(() => c(!1))) : c(!1);
5273
5311
  }, [f]);
5274
5312
  _e(() => {
@@ -6588,7 +6626,7 @@ function My({
6588
6626
  onRefresh: p,
6589
6627
  theme: g = {}
6590
6628
  }) {
6591
- const { data: m, loading: y, error: b, refetch: x } = af(r, e), [v, C] = L(""), [k, S] = L({}), [_, E] = L(1), j = at(() => {
6629
+ const { data: m, loading: y, error: b, refetch: x } = af(r, e), [v, C] = L(""), [k, S] = L({}), [_, E] = L(1), j = lt(() => {
6592
6630
  if (!m) return { data: [], total: 0, totalPages: 0 };
6593
6631
  let w = m;
6594
6632
  return a && v && l.length > 0 && (w = Pi.search(w, v, l)), Object.keys(k).length > 0 && (w = Pi.filterByFields(w, k)), Pi.paginate(w, _, d);
@@ -7037,13 +7075,13 @@ function Py({
7037
7075
  }) {
7038
7076
  const _ = { ...uf, ...S }, [E, j] = L([]), [T, A] = L(!1), [N, M] = L(null), [w, B] = L(/* @__PURE__ */ new Set()), [F, I] = L(null), [W, q] = L(null), [se, U] = L(null), [Q, H] = L(!1), [oe, ce] = L(""), pe = l !== void 0 ? l : oe, me = (ue) => {
7039
7077
  u ? u(ue) : ce(ue);
7040
- }, Ee = at(() => {
7078
+ }, Ee = lt(() => {
7041
7079
  if (!pe.trim()) return E;
7042
7080
  const ue = pe.toLowerCase();
7043
7081
  return E.filter(
7044
7082
  (ge) => Vr(ge.from).toLowerCase().includes(ue) || Vr(ge.subject).toLowerCase().includes(ue)
7045
7083
  );
7046
- }, [E, pe]), be = at(() => e ? new Vd({ baseUrl: r, system_id: e }) : null, [r, e]), Z = ee(async () => {
7084
+ }, [E, pe]), be = lt(() => e ? new Vd({ baseUrl: r, system_id: e }) : null, [r, e]), Z = ee(async () => {
7047
7085
  if (be) {
7048
7086
  A(!0), M(null);
7049
7087
  try {
@@ -7077,18 +7115,18 @@ function Py({
7077
7115
  f == null || f(ue), o && we(ue);
7078
7116
  return;
7079
7117
  }
7080
- const rt = ue.uid;
7118
+ const nt = ue.uid;
7081
7119
  if (Qe.shiftKey && F !== null) {
7082
- const nt = Math.min(F, ge), Lt = Math.max(F, ge), J = E.slice(nt, Lt + 1).map((he) => he.uid), R = new Set(J);
7120
+ const st = Math.min(F, ge), Lt = Math.max(F, ge), J = E.slice(st, Lt + 1).map((he) => he.uid), R = new Set(J);
7083
7121
  B(R), p == null || p(Array.from(R));
7084
7122
  } else if (Qe.ctrlKey || Qe.metaKey)
7085
- B((nt) => {
7086
- const Lt = new Set(nt);
7087
- return Lt.has(rt) ? Lt.delete(rt) : Lt.add(rt), p == null || p(Array.from(Lt)), Lt;
7123
+ B((st) => {
7124
+ const Lt = new Set(st);
7125
+ return Lt.has(nt) ? Lt.delete(nt) : Lt.add(nt), p == null || p(Array.from(Lt)), Lt;
7088
7126
  }), I(ge);
7089
7127
  else {
7090
- const nt = /* @__PURE__ */ new Set([rt]);
7091
- B(nt), I(ge), p == null || p(Array.from(nt));
7128
+ const st = /* @__PURE__ */ new Set([nt]);
7129
+ B(st), I(ge), p == null || p(Array.from(st));
7092
7130
  }
7093
7131
  }, [i, F, E, w, f, p, o]), Se = ee(async () => {
7094
7132
  if (!be || w.size === 0) return;
@@ -7096,7 +7134,7 @@ function Py({
7096
7134
  try {
7097
7135
  const ge = await be.trashEmails(t, Array.from(w), ue);
7098
7136
  if (console.log("Trash result:", ge), ge.success && ge.moved > 0) {
7099
- j((rt) => rt.filter((nt) => !w.has(nt.uid)));
7137
+ j((nt) => nt.filter((st) => !w.has(st.uid)));
7100
7138
  const Qe = Array.from(w);
7101
7139
  B(/* @__PURE__ */ new Set()), g == null || g(Qe);
7102
7140
  } else
@@ -7111,7 +7149,7 @@ function Py({
7111
7149
  try {
7112
7150
  const ge = await be.archiveEmails(t, Array.from(w), ue);
7113
7151
  if (console.log("Archive result:", ge), ge.success && ge.archived > 0) {
7114
- j((rt) => rt.filter((nt) => !w.has(nt.uid)));
7152
+ j((nt) => nt.filter((st) => !w.has(st.uid)));
7115
7153
  const Qe = Array.from(w);
7116
7154
  B(/* @__PURE__ */ new Set()), g == null || g(Qe);
7117
7155
  } else
@@ -7626,7 +7664,7 @@ function Na(r, e) {
7626
7664
  return !(t !== null && t !== i || n !== null && n !== o || s !== null && s !== a);
7627
7665
  }
7628
7666
  function Ba(r, e) {
7629
- const t = r.mergeWithSibling(e), n = tt()._normalizedNodes;
7667
+ const t = r.mergeWithSibling(e), n = rt()._normalizedNodes;
7630
7668
  return n.add(r.__key), n.add(e.__key), t;
7631
7669
  }
7632
7670
  function ja(r) {
@@ -7728,7 +7766,7 @@ function Fu(r) {
7728
7766
  function Jf(r, e) {
7729
7767
  if (e != null) return void (r.__key = e);
7730
7768
  kt(), lc();
7731
- const t = tt(), n = fr(), s = "" + Kf++;
7769
+ const t = rt(), n = fr(), s = "" + Kf++;
7732
7770
  n._nodeMap.set(s, r), P(r) ? t._dirtyElements.set(s, !0) : t._dirtyLeaves.add(s), t._cloneNotNeeded.add(s), t._dirtyType = ku, r.__key = s;
7733
7771
  }
7734
7772
  function jr(r) {
@@ -7764,7 +7802,7 @@ function jr(r) {
7764
7802
  }
7765
7803
  function qs(r) {
7766
7804
  lc();
7767
- const e = r.getLatest(), t = e.__parent, n = fr(), s = tt(), i = n._nodeMap, o = s._dirtyElements;
7805
+ const e = r.getLatest(), t = e.__parent, n = fr(), s = rt(), i = n._nodeMap, o = s._dirtyElements;
7768
7806
  t !== null && function(l, u, c) {
7769
7807
  let d = l;
7770
7808
  for (; d !== null; ) {
@@ -7779,7 +7817,7 @@ function qs(r) {
7779
7817
  }
7780
7818
  function gt(r) {
7781
7819
  kt();
7782
- const e = tt(), t = e._compositionKey;
7820
+ const e = rt(), t = e._compositionKey;
7783
7821
  if (r !== t) {
7784
7822
  if (e._compositionKey = r, t !== null) {
7785
7823
  const n = bt(t);
@@ -7792,14 +7830,14 @@ function gt(r) {
7792
7830
  }
7793
7831
  }
7794
7832
  function xr() {
7795
- return is() ? null : tt()._compositionKey;
7833
+ return is() ? null : rt()._compositionKey;
7796
7834
  }
7797
7835
  function bt(r, e) {
7798
7836
  const t = (e || fr())._nodeMap.get(r);
7799
7837
  return t === void 0 ? null : t;
7800
7838
  }
7801
7839
  function Ru(r, e) {
7802
- const t = gi(r, tt());
7840
+ const t = gi(r, rt());
7803
7841
  return t !== void 0 ? bt(t, e) : null;
7804
7842
  }
7805
7843
  function gi(r, e) {
@@ -7833,7 +7871,7 @@ function Zt(r) {
7833
7871
  r !== null && (r.dirty = !0, r.setCachedNodes(null)), e._selection = r;
7834
7872
  }
7835
7873
  function Qr(r) {
7836
- const e = tt(), t = function(n, s) {
7874
+ const e = rt(), t = function(n, s) {
7837
7875
  let i = n;
7838
7876
  for (; i != null; ) {
7839
7877
  const o = gi(i, s);
@@ -7890,7 +7928,7 @@ function Jo(r, e, t, n, s) {
7890
7928
  if (a === "") {
7891
7929
  if (gt(null), fi || Jn || Io) i.remove();
7892
7930
  else {
7893
- const m = tt();
7931
+ const m = rt();
7894
7932
  setTimeout(() => {
7895
7933
  m.update(() => {
7896
7934
  i.isAttached() && i.remove();
@@ -8026,7 +8064,7 @@ function er(r) {
8026
8064
  return wt(r) || P(r) && r.isShadowRoot();
8027
8065
  }
8028
8066
  function rr(r) {
8029
- const e = tt(), t = r.constructor.getType(), n = e._nodes.get(t);
8067
+ const e = rt(), t = r.constructor.getType(), n = e._nodes.get(t);
8030
8068
  n === void 0 && Y(200, r.constructor.name, t);
8031
8069
  const { replace: s, replaceWithKlass: i } = n;
8032
8070
  if (s !== null) {
@@ -8111,7 +8149,7 @@ function bn(r, e) {
8111
8149
  return e(t) ? t : null;
8112
8150
  }
8113
8151
  function nh() {
8114
- return tt();
8152
+ return rt();
8115
8153
  }
8116
8154
  const qa = /* @__PURE__ */ new WeakMap(), sh = /* @__PURE__ */ new Map();
8117
8155
  function ih(r) {
@@ -8523,7 +8561,7 @@ const ir = Object.freeze({}), co = 30, fo = [["keydown", function(r, e) {
8523
8561
  _r && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), fi || Jn || Io || !e.isComposing() || (Rn = 0, gt(null));
8524
8562
  } else
8525
8563
  Qo(!1, e, n !== null ? n : void 0), vn && (qi(e, n || void 0), vn = !1);
8526
- kt(), Nu(tt());
8564
+ kt(), Nu(rt());
8527
8565
  }), Yr = null;
8528
8566
  }], ["click", function(r, e) {
8529
8567
  Nt(e, () => {
@@ -8657,7 +8695,7 @@ let Rn = 0, Yu = null, Qu = 0, Yr = null;
8657
8695
  const Ks = /* @__PURE__ */ new WeakMap();
8658
8696
  let ho = !1, po = !1, Ln = !1, vn = !1, Ju = [0, "", 0, "root", 0];
8659
8697
  function Xu(r, e, t, n, s) {
8660
- const i = r.anchor, o = r.focus, a = i.getNode(), l = tt(), u = Rt(l._window), c = u !== null ? u.anchorNode : null, d = i.key, f = l.getElementByKey(d), p = t.length;
8698
+ const i = r.anchor, o = r.focus, a = i.getNode(), l = rt(), u = Rt(l._window), c = u !== null ? u.anchorNode : null, d = i.key, f = l.getElementByKey(d), p = t.length;
8661
8699
  return d !== o.key || !X(a) || (!s && (!Ls || Qu < n + 50) || a.isDirty() && p < 2 || Iu(t)) && i.offset !== o.offset && !a.isComposing() || Ar(a) || a.isDirty() && p > 1 || (s || !Ls) && f !== null && !a.isComposing() && c !== zs(f) || u !== null && e !== null && (!e.collapsed || e.startContainer !== u.anchorNode || e.startOffset !== u.anchorOffset) || a.getFormat() !== r.format || a.getStyle() !== r.style || Xf(r, a);
8662
8700
  }
8663
8701
  function Wa(r, e) {
@@ -8966,7 +9004,7 @@ class bi {
8966
9004
  return t || n.reverse(), n;
8967
9005
  }
8968
9006
  isDirty() {
8969
- const e = tt()._dirtyLeaves;
9007
+ const e = rt()._dirtyLeaves;
8970
9008
  return e !== null && e.has(this.__key);
8971
9009
  }
8972
9010
  getLatest() {
@@ -8975,7 +9013,7 @@ class bi {
8975
9013
  }
8976
9014
  getWritable() {
8977
9015
  kt();
8978
- const e = fr(), t = tt(), n = e._nodeMap, s = this.__key, i = this.getLatest(), o = t._cloneNotNeeded, a = de();
9016
+ const e = fr(), t = rt(), n = e._nodeMap, s = this.__key, i = this.getLatest(), o = t._cloneNotNeeded, a = de();
8979
9017
  if (a !== null && a.setCachedNodes(null), o.has(s)) return qs(i), i;
8980
9018
  const l = ea(i);
8981
9019
  return o.add(s), qs(l), n.set(s, l), l;
@@ -9056,7 +9094,7 @@ class bi {
9056
9094
  return !1;
9057
9095
  }
9058
9096
  createParentElementNode() {
9059
- return lt();
9097
+ return ut();
9060
9098
  }
9061
9099
  selectStart() {
9062
9100
  return this.selectPrevious();
@@ -9751,7 +9789,7 @@ class Sr {
9751
9789
  return u;
9752
9790
  }
9753
9791
  applyDOMRange(e) {
9754
- const t = tt(), n = t.getEditorState()._selection, s = ic(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, n);
9792
+ const t = rt(), n = t.getEditorState()._selection, s = ic(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, n);
9755
9793
  if (s === null) return;
9756
9794
  const [i, o] = s;
9757
9795
  mr(this.anchor, i.key, i.offset, i.type), mr(this.focus, o.key, o.offset, o.type), this._cachedNodes = null;
@@ -9784,7 +9822,7 @@ class Sr {
9784
9822
  const t = this.anchor, n = this.focus, s = this.format, i = this.style;
9785
9823
  let o = t, a = n;
9786
9824
  !this.isCollapsed() && n.isBefore(t) && (o = n, a = t), o.type === "element" && function(y, b, x, v) {
9787
- const C = y.getNode(), k = C.getChildAtIndex(y.offset), S = dt(), _ = wt(C) ? lt().append(S) : S;
9825
+ const C = y.getNode(), k = C.getChildAtIndex(y.offset), S = dt(), _ = wt(C) ? ut().append(S) : S;
9788
9826
  S.setFormat(x), S.setStyle(v), k === null ? C.append(_) : k.insertBefore(_), y.is(b) && b.set(S.__key, 0, "text"), y.set(S.__key, 0, "text");
9789
9827
  }(o, a, s, i);
9790
9828
  const l = o.offset;
@@ -9960,7 +9998,7 @@ class Sr {
9960
9998
  return n.splice(g, 0, e), void s.selectEnd();
9961
9999
  }
9962
10000
  const i = function(g) {
9963
- const m = lt();
10001
+ const m = ut();
9964
10002
  let y = null;
9965
10003
  for (let b = 0; b < g.length; b++) {
9966
10004
  const x = g[b], v = Mr(x);
@@ -9988,7 +10026,7 @@ class Sr {
9988
10026
  }
9989
10027
  insertParagraph() {
9990
10028
  if (this.anchor.key === "root") {
9991
- const o = lt();
10029
+ const o = ut();
9992
10030
  return Xe().splice(this.anchor.offset, 0, [o]), o.select(), o;
9993
10031
  }
9994
10032
  const e = Vi(this), t = bn(this.anchor.getNode(), gr);
@@ -10044,7 +10082,7 @@ class Sr {
10044
10082
  return P(f) ? (m = f.__key, g = t ? f.getChildrenSize() : 0) : (g = a.getIndexWithinParent(), m = p.__key, t || g++), s.set(m, g, "element"), void (o && i.set(m, g, "element"));
10045
10083
  }
10046
10084
  }
10047
- const l = tt(), u = Rt(l._window);
10085
+ const l = rt(), u = Rt(l._window);
10048
10086
  if (!u) return;
10049
10087
  const c = l._blockCursorElement, d = l._rootElement;
10050
10088
  if (d === null || c === null || !P(a) || a.isInline() || a.canBeEmpty() || Zo(c, l, d), function(f, p, g, m) {
@@ -10092,7 +10130,7 @@ class Sr {
10092
10130
  const a = rl();
10093
10131
  a.add(o.__key), Zt(a);
10094
10132
  } else
10095
- o.remove(), tt().dispatchCommand(Fo, void 0);
10133
+ o.remove(), rt().dispatchCommand(Fo, void 0);
10096
10134
  return;
10097
10135
  }
10098
10136
  if (!e && P(o) && P(s) && s.isEmpty()) return s.remove(), void o.selectStart();
@@ -10235,7 +10273,7 @@ function sc(r, e, t) {
10235
10273
  if (r.type === "text" && e.type === "text") {
10236
10274
  const n = r.isBefore(e), s = r.is(e);
10237
10275
  tl(r, n, s), tl(e, !n, s), s && (e.key = r.key, e.offset = r.offset, e.type = r.type);
10238
- const i = tt();
10276
+ const i = rt();
10239
10277
  if (i.isComposing() && i._compositionKey !== r.key && G(t)) {
10240
10278
  const o = t.anchor, a = t.focus;
10241
10279
  mr(r, o.key, o.offset, o.type), mr(e, a.key, a.offset, a.type);
@@ -10285,7 +10323,7 @@ function de() {
10285
10323
  return fr()._selection;
10286
10324
  }
10287
10325
  function ss() {
10288
- return tt()._editorState._selection;
10326
+ return rt()._editorState._selection;
10289
10327
  }
10290
10328
  function Ys(r, e, t, n = 1) {
10291
10329
  const s = r.anchor, i = r.focus, o = s.getNode(), a = i.getNode();
@@ -10413,7 +10451,7 @@ function Vi(r) {
10413
10451
  function _h(r, e) {
10414
10452
  const t = r.getParent();
10415
10453
  if (!t) {
10416
- const s = lt();
10454
+ const s = ut();
10417
10455
  return Xe().append(s), s.select(), [Xe(), 0];
10418
10456
  }
10419
10457
  if (X(r)) {
@@ -10444,7 +10482,7 @@ function lc() {
10444
10482
  function fr() {
10445
10483
  return ht === null && Y(195, uc()), ht;
10446
10484
  }
10447
- function tt() {
10485
+ function rt() {
10448
10486
  return pt === null && Y(196, uc()), pt;
10449
10487
  }
10450
10488
  function uc() {
@@ -10485,7 +10523,7 @@ function cc(r, e) {
10485
10523
  for (const s of n) t.add(s);
10486
10524
  }
10487
10525
  function Ch(r) {
10488
- return sa(r, tt()._nodes);
10526
+ return sa(r, rt()._nodes);
10489
10527
  }
10490
10528
  function sa(r, e) {
10491
10529
  const t = r.type, n = e.get(t);
@@ -10850,7 +10888,7 @@ class hr extends bi {
10850
10888
  return this.getChildrenSize() === 0;
10851
10889
  }
10852
10890
  isDirty() {
10853
- const e = tt()._dirtyElements;
10891
+ const e = rt()._dirtyElements;
10854
10892
  return e !== null && e.has(this.__key);
10855
10893
  }
10856
10894
  isLastChild() {
@@ -11164,7 +11202,7 @@ class os extends hr {
11164
11202
  }
11165
11203
  getTextContent() {
11166
11204
  const e = this.__cachedText;
11167
- return !is() && tt()._dirtyType !== Rr || e === null ? super.getTextContent() : e;
11205
+ return !is() && rt()._dirtyType !== Rr || e === null ? super.getTextContent() : e;
11168
11206
  }
11169
11207
  remove() {
11170
11208
  Y(52);
@@ -11303,14 +11341,14 @@ class fn extends hr {
11303
11341
  return { element: t };
11304
11342
  }
11305
11343
  static importJSON(e) {
11306
- const t = lt();
11344
+ const t = ut();
11307
11345
  return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t.setTextFormat(e.textFormat), t;
11308
11346
  }
11309
11347
  exportJSON() {
11310
11348
  return { ...super.exportJSON(), textFormat: this.getTextFormat(), textStyle: this.getTextStyle(), type: "paragraph", version: 1 };
11311
11349
  }
11312
11350
  insertNewAfter(e, t) {
11313
- const n = lt();
11351
+ const n = ut();
11314
11352
  n.setTextFormat(e.format), n.setTextStyle(e.style);
11315
11353
  const s = this.getDirection();
11316
11354
  return n.setDirection(s), n.setFormat(this.getFormatType()), n.setStyle(this.getTextStyle()), this.insertAfter(n, t), n;
@@ -11325,10 +11363,10 @@ class fn extends hr {
11325
11363
  }
11326
11364
  }
11327
11365
  function Sh(r) {
11328
- const e = lt();
11366
+ const e = ut();
11329
11367
  return r.style && (e.setFormat(r.style.textAlign), ta(r, e)), { node: e };
11330
11368
  }
11331
- function lt() {
11369
+ function ut() {
11332
11370
  return rr(new fn());
11333
11371
  }
11334
11372
  function an(r) {
@@ -11596,14 +11634,14 @@ class wi {
11596
11634
  wi.version = "0.21.0+prod.esm";
11597
11635
  const mc = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Dh = mc ? cn : _e, ys = { tag: "history-merge" };
11598
11636
  function Ah({ initialConfig: r, children: e }) {
11599
- const t = at(() => {
11637
+ const t = lt(() => {
11600
11638
  const { theme: n, namespace: s, nodes: i, onError: o, editorState: a, html: l } = r, u = ff(null, n), c = kh({ editable: r.editable, html: l, namespace: s, nodes: i, onError: (d) => o(d, c), theme: n });
11601
11639
  return function(d, f) {
11602
11640
  if (f !== null) {
11603
11641
  if (f === void 0) d.update(() => {
11604
11642
  const p = Xe();
11605
11643
  if (p.isEmpty()) {
11606
- const g = lt();
11644
+ const g = ut();
11607
11645
  p.append(g);
11608
11646
  const m = mc ? document.activeElement : null;
11609
11647
  (de() !== null || m !== null && m === d.getRootElement()) && g.select();
@@ -11637,7 +11675,7 @@ function Nh(r) {
11637
11675
  }
11638
11676
  function Bh() {
11639
11677
  return function(r) {
11640
- const [e] = Ht(), t = at(() => r(e), [e, r]), [n, s] = L(() => t.initialValueFn()), i = ve(n);
11678
+ const [e] = Ht(), t = lt(() => r(e), [e, r]), [n, s] = L(() => t.initialValueFn()), i = ve(n);
11641
11679
  return Th(() => {
11642
11680
  const { initialValueFn: o, subscribe: a } = t, l = o();
11643
11681
  return i.current !== l && (i.current = l, s(l)), a((u) => {
@@ -11939,7 +11977,7 @@ function kc(r, e, t, n, s = /* @__PURE__ */ new Map(), i) {
11939
11977
  return c != null && (f = c(f)), Ws(r) && (f = Qh(r, f, p ? () => {
11940
11978
  const g = new aa();
11941
11979
  return t.push(g), g;
11942
- } : lt)), a == null ? f.length > 0 ? o = o.concat(f) : Ws(r) && function(g) {
11980
+ } : ut)), a == null ? f.length > 0 ? o = o.concat(f) : Ws(r) && function(g) {
11943
11981
  return g.nextSibling == null || g.previousSibling == null ? !1 : no(g.nextSibling) && no(g.previousSibling);
11944
11982
  }(r) && (o = o.concat(Ir())) : P(a) && a.append(...f), o;
11945
11983
  }
@@ -12153,11 +12191,11 @@ class Si extends hr {
12153
12191
  return { ...super.exportJSON(), type: "quote" };
12154
12192
  }
12155
12193
  insertNewAfter(e, t) {
12156
- const n = lt(), s = this.getDirection();
12194
+ const n = ut(), s = this.getDirection();
12157
12195
  return n.setDirection(s), this.insertAfter(n, t), n;
12158
12196
  }
12159
12197
  collapseAtStart() {
12160
- const e = lt();
12198
+ const e = ut();
12161
12199
  return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
12162
12200
  }
12163
12201
  canMergeWhenEmpty() {
@@ -12216,15 +12254,15 @@ class Ei extends hr {
12216
12254
  return { ...super.exportJSON(), tag: this.getTag(), type: "heading", version: 1 };
12217
12255
  }
12218
12256
  insertNewAfter(e, t = !0) {
12219
- const n = e ? e.anchor.offset : 0, s = this.getLastDescendant(), i = !s || e && e.anchor.key === s.getKey() && n === s.getTextContentSize() || !e ? lt() : Dn(this.getTag()), o = this.getDirection();
12257
+ const n = e ? e.anchor.offset : 0, s = this.getLastDescendant(), i = !s || e && e.anchor.key === s.getKey() && n === s.getTextContentSize() || !e ? ut() : Dn(this.getTag()), o = this.getDirection();
12220
12258
  if (i.setDirection(o), this.insertAfter(i, t), n === 0 && !this.isEmpty() && e) {
12221
- const a = lt();
12259
+ const a = ut();
12222
12260
  a.select(), this.replace(a, !0);
12223
12261
  }
12224
12262
  return i;
12225
12263
  }
12226
12264
  collapseAtStart() {
12227
- const e = this.isEmpty() ? lt() : Dn(this.getTag());
12265
+ const e = this.isEmpty() ? ut() : Dn(this.getTag());
12228
12266
  return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
12229
12267
  }
12230
12268
  extractWithChild() {
@@ -12451,7 +12489,7 @@ function fp({ contentEditable: r, placeholder: e = null, ErrorBoundary: t }) {
12451
12489
  });
12452
12490
  }), [i]), _e(() => {
12453
12491
  l(i.getDecorators());
12454
- }, [i]), at(() => {
12492
+ }, [i]), lt(() => {
12455
12493
  const u = [], c = Object.keys(a);
12456
12494
  for (let d = 0; d < c.length; d++) {
12457
12495
  const f = c[d], p = h.jsx(o, { onError: (m) => i._onError(m), children: h.jsx(Sd, { fallback: null, children: a[f] }) }), g = i.getElementByKey(f);
@@ -12485,7 +12523,7 @@ const Ac = typeof window < "u" && window.document !== void 0 && window.document.
12485
12523
  function pp({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: i, ariaExpanded: o, ariaInvalid: a, ariaLabel: l, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: p, className: g, id: m, role: y = "textbox", spellCheck: b = !0, style: x, tabIndex: v, "data-testid": C, ...k }, S) {
12486
12524
  const [_, E] = L(r.isEditable()), j = ee((A) => {
12487
12525
  A && A.ownerDocument && A.ownerDocument.defaultView ? r.setRootElement(A) : r.setRootElement(null);
12488
- }, [r]), T = at(() => /* @__PURE__ */ function(...A) {
12526
+ }, [r]), T = lt(() => /* @__PURE__ */ function(...A) {
12489
12527
  return (N) => {
12490
12528
  A.forEach((M) => {
12491
12529
  typeof M == "function" ? M(N) : M != null && (M.current = N);
@@ -12611,7 +12649,7 @@ function Ep() {
12611
12649
  function kp({ delay: r, externalHistoryState: e }) {
12612
12650
  const [t] = Ht();
12613
12651
  return function(n, s, i = 1e3) {
12614
- const o = at(() => s || Ep(), [s]);
12652
+ const o = lt(() => s || Ep(), [s]);
12615
12653
  _e(() => Sp(n, o, i), [i, n, o]);
12616
12654
  }(t, e, r), null;
12617
12655
  }
@@ -12679,7 +12717,7 @@ var Qt = Bp(function(r) {
12679
12717
  function jp(r) {
12680
12718
  let e = 1, t = r.getParent();
12681
12719
  for (; t != null; ) {
12682
- if (et(t)) {
12720
+ if (tt(t)) {
12683
12721
  const n = t.getParent();
12684
12722
  if (Oe(n)) {
12685
12723
  e++, t = n.getParent();
@@ -12700,7 +12738,7 @@ function wo(r) {
12700
12738
  }
12701
12739
  function Tc(r) {
12702
12740
  let e = [];
12703
- const t = r.getChildren().filter(et);
12741
+ const t = r.getChildren().filter(tt);
12704
12742
  for (let n = 0; n < t.length; n++) {
12705
12743
  const s = t[n], i = s.getFirstChild();
12706
12744
  Oe(i) ? e = e.concat(Tc(i)) : e.push(s);
@@ -12708,13 +12746,13 @@ function Tc(r) {
12708
12746
  return e;
12709
12747
  }
12710
12748
  function Jt(r) {
12711
- return et(r) && Oe(r.getFirstChild());
12749
+ return tt(r) && Oe(r.getFirstChild());
12712
12750
  }
12713
12751
  function Tl(r) {
12714
12752
  return Bt().append(r);
12715
12753
  }
12716
12754
  function Nc(r, e) {
12717
- return et(r) && (e.length === 0 || e.length === 1 && r.is(e[0]) && r.getChildrenSize() === 0);
12755
+ return tt(r) && (e.length === 0 || e.length === 1 && r.is(e[0]) && r.getChildrenSize() === 0);
12718
12756
  }
12719
12757
  function Nl(r, e) {
12720
12758
  r.update(() => {
@@ -12731,7 +12769,7 @@ function Nl(r, e) {
12731
12769
  a.replace(u);
12732
12770
  const c = Bt();
12733
12771
  P(a) && (c.setFormat(a.getFormatType()), c.setIndent(a.getIndent())), u.append(c);
12734
- } else if (et(a)) {
12772
+ } else if (tt(a)) {
12735
12773
  const c = a.getParentOrThrow();
12736
12774
  Or(u, c.getChildren()), c.replace(u);
12737
12775
  }
@@ -12741,7 +12779,7 @@ function Nl(r, e) {
12741
12779
  const s = /* @__PURE__ */ new Set();
12742
12780
  for (let i = 0; i < n.length; i++) {
12743
12781
  const o = n[i];
12744
- if (!P(o) || !o.isEmpty() || et(o) || s.has(o.getKey())) {
12782
+ if (!P(o) || !o.isEmpty() || tt(o) || s.has(o.getKey())) {
12745
12783
  if (Fu(o)) {
12746
12784
  let a = o.getParent();
12747
12785
  for (; a != null; ) {
@@ -12806,7 +12844,7 @@ function Mp(r) {
12806
12844
  let o = i;
12807
12845
  const a = Tc(i);
12808
12846
  for (const l of a) {
12809
- const u = lt();
12847
+ const u = ut();
12810
12848
  Or(u, l.getChildren()), o.insertAfter(u), o = u, l.__key === e.anchor.key && e.anchor.set(u.getKey(), 0, "element"), l.__key === e.focus.key && e.focus.set(u.getKey(), 0, "element"), l.remove();
12811
12849
  }
12812
12850
  i.remove();
@@ -12842,7 +12880,7 @@ function Fp(r) {
12842
12880
  function Rp(r) {
12843
12881
  if (Jt(r)) return;
12844
12882
  const e = r.getParent(), t = e ? e.getParent() : void 0;
12845
- if (Oe(t ? t.getParent() : void 0) && et(t) && Oe(e)) {
12883
+ if (Oe(t ? t.getParent() : void 0) && tt(t) && Oe(e)) {
12846
12884
  const n = e ? e.getFirstChild() : void 0, s = e ? e.getLastChild() : void 0;
12847
12885
  if (r.is(n)) t.insertBefore(r), e.isEmpty() && t.remove();
12848
12886
  else if (r.is(s)) t.insertAfter(r), e.isEmpty() && t.remove();
@@ -12858,14 +12896,14 @@ function Lp() {
12858
12896
  const r = de();
12859
12897
  if (!G(r) || !r.isCollapsed()) return !1;
12860
12898
  const e = r.anchor.getNode();
12861
- if (!et(e) || e.getChildrenSize() !== 0) return !1;
12899
+ if (!tt(e) || e.getChildrenSize() !== 0) return !1;
12862
12900
  const t = wo(e), n = e.getParent();
12863
12901
  Oe(n) || Qt(40);
12864
12902
  const s = n.getParent();
12865
12903
  let i;
12866
- if (er(s)) i = lt(), t.insertAfter(i);
12904
+ if (er(s)) i = ut(), t.insertAfter(i);
12867
12905
  else {
12868
- if (!et(s)) return !1;
12906
+ if (!tt(s)) return !1;
12869
12907
  i = Bt(), s.insertAfter(i);
12870
12908
  }
12871
12909
  i.select();
@@ -12885,7 +12923,7 @@ function Lp() {
12885
12923
  let l = a;
12886
12924
  for (; l.getNextSibling() == null && l.getPreviousSibling() == null; ) {
12887
12925
  const u = l.getParent();
12888
- if (u == null || !et(l) && !Oe(l)) break;
12926
+ if (u == null || !tt(l) && !Oe(l)) break;
12889
12927
  l = u;
12890
12928
  }
12891
12929
  l.remove();
@@ -12916,7 +12954,7 @@ class Ur extends hr {
12916
12954
  }
12917
12955
  static transform() {
12918
12956
  return (e) => {
12919
- if (et(e) || Qt(144), e.__checked == null) return;
12957
+ if (tt(e) || Qt(144), e.__checked == null) return;
12920
12958
  const t = e.getParent();
12921
12959
  Oe(t) && t.getListType() !== "check" && e.getChecked() != null && e.setChecked(void 0);
12922
12960
  };
@@ -12946,7 +12984,7 @@ class Ur extends hr {
12946
12984
  return this;
12947
12985
  }
12948
12986
  replace(e, t) {
12949
- if (et(e)) return super.replace(e);
12987
+ if (tt(e)) return super.replace(e);
12950
12988
  this.setIndent(0);
12951
12989
  const n = this.getParentOrThrow();
12952
12990
  if (!Oe(n)) return e;
@@ -12967,7 +13005,7 @@ class Ur extends hr {
12967
13005
  }
12968
13006
  insertAfter(e, t = !0) {
12969
13007
  const n = this.getParentOrThrow();
12970
- if (Oe(n) || Qt(39), et(e)) return super.insertAfter(e, t);
13008
+ if (Oe(n) || Qt(39), tt(e)) return super.insertAfter(e, t);
12971
13009
  const s = this.getNextSiblings();
12972
13010
  if (n.insertAfter(e, t), s.length !== 0) {
12973
13011
  const i = Tt(n.getListType());
@@ -12984,9 +13022,9 @@ class Ur extends hr {
12984
13022
  return this.insertAfter(n, t), n;
12985
13023
  }
12986
13024
  collapseAtStart(e) {
12987
- const t = lt();
13025
+ const t = ut();
12988
13026
  this.getChildren().forEach((o) => t.append(o));
12989
- const n = this.getParentOrThrow(), s = n.getParentOrThrow(), i = et(s);
13027
+ const n = this.getParentOrThrow(), s = n.getParentOrThrow(), i = tt(s);
12990
13028
  if (n.getChildrenSize() === 1) if (i) n.remove(), s.select();
12991
13029
  else {
12992
13030
  n.insertBefore(t), n.remove();
@@ -13018,7 +13056,7 @@ class Ur extends hr {
13018
13056
  const e = this.getParent();
13019
13057
  if (e === null) return this.getLatest().__indent;
13020
13058
  let t = e.getParentOrThrow(), n = 0;
13021
- for (; et(t); ) t = t.getParentOrThrow().getParentOrThrow(), n++;
13059
+ for (; tt(t); ) t = t.getParentOrThrow().getParentOrThrow(), n++;
13022
13060
  return n;
13023
13061
  }
13024
13062
  setIndent(e) {
@@ -13028,13 +13066,13 @@ class Ur extends hr {
13028
13066
  return this;
13029
13067
  }
13030
13068
  canInsertAfter(e) {
13031
- return et(e);
13069
+ return tt(e);
13032
13070
  }
13033
13071
  canReplaceWith(e) {
13034
- return et(e);
13072
+ return tt(e);
13035
13073
  }
13036
13074
  canMergeWith(e) {
13037
- return an(e) || et(e);
13075
+ return an(e) || tt(e);
13038
13076
  }
13039
13077
  extractWithChild(e, t) {
13040
13078
  if (!G(t)) return !1;
@@ -13080,7 +13118,7 @@ function Ip(r) {
13080
13118
  function Bt(r) {
13081
13119
  return rr(new Ur(void 0, r));
13082
13120
  }
13083
- function et(r) {
13121
+ function tt(r) {
13084
13122
  return r instanceof Ur;
13085
13123
  }
13086
13124
  class pn extends hr {
@@ -13124,7 +13162,7 @@ class pn extends hr {
13124
13162
  }(e), function(t) {
13125
13163
  const n = t.getListType() !== "check";
13126
13164
  let s = t.getStart();
13127
- for (const i of t.getChildren()) et(i) && (i.getValue() !== s && i.setValue(s), n && i.getLatest().__checked != null && i.setChecked(void 0), Oe(i.getFirstChild()) || s++);
13165
+ for (const i of t.getChildren()) tt(i) && (i.getValue() !== s && i.setValue(s), n && i.getLatest().__checked != null && i.setChecked(void 0), Oe(i.getFirstChild()) || s++);
13128
13166
  }(e);
13129
13167
  };
13130
13168
  }
@@ -13151,7 +13189,7 @@ class pn extends hr {
13151
13189
  append(...e) {
13152
13190
  for (let t = 0; t < e.length; t++) {
13153
13191
  const n = e[t];
13154
- if (et(n)) super.append(n);
13192
+ if (tt(n)) super.append(n);
13155
13193
  else {
13156
13194
  const s = Bt();
13157
13195
  if (Oe(n)) s.append(n);
@@ -13167,7 +13205,7 @@ class pn extends hr {
13167
13205
  return this;
13168
13206
  }
13169
13207
  extractWithChild(e) {
13170
- return et(e);
13208
+ return tt(e);
13171
13209
  }
13172
13210
  }
13173
13211
  function Fl(r, e, t) {
@@ -13191,7 +13229,7 @@ function Op(r) {
13191
13229
  const e = [];
13192
13230
  for (let t = 0; t < r.length; t++) {
13193
13231
  const n = r[t];
13194
- if (et(n)) {
13232
+ if (tt(n)) {
13195
13233
  e.push(n);
13196
13234
  const s = n.getChildren();
13197
13235
  s.length > 1 && s.forEach((i) => {
@@ -14807,7 +14845,7 @@ function ug({ html: r, isExternalUpdate: e, onImportComplete: t }) {
14807
14845
  () => {
14808
14846
  const i = Xe();
14809
14847
  i.clear();
14810
- const o = lt();
14848
+ const o = ut();
14811
14849
  i.append(o), o.select();
14812
14850
  const l = new DOMParser().parseFromString(r, "text/html"), c = wc(n, l).filter((d) => d.getParent() === null);
14813
14851
  c.length > 0 && ac(c), o.getTextContent() === "" && i.getChildrenSize() > 1 && o.remove(), i.selectEnd();
@@ -14835,7 +14873,7 @@ function cg({ text: r, trigger: e }) {
14835
14873
  const l = de();
14836
14874
  G(l) && l.insertText(s);
14837
14875
  } else {
14838
- const l = lt(), u = dt(s);
14876
+ const l = ut(), u = dt(s);
14839
14877
  l.append(u), o.append(l);
14840
14878
  }
14841
14879
  }
@@ -15862,7 +15900,7 @@ function Wy({
15862
15900
  className: l = "",
15863
15901
  theme: u = {}
15864
15902
  }) {
15865
- const c = { ...gg, ...u }, [d, f] = L(""), [p, g] = L(!1), m = ve(null), y = ve(null), b = at(() => e && r.find((E) => E.id === e) || null, [e, r]), x = at(() => {
15903
+ const c = { ...gg, ...u }, [d, f] = L(""), [p, g] = L(!1), m = ve(null), y = ve(null), b = lt(() => e && r.find((E) => E.id === e) || null, [e, r]), x = lt(() => {
15866
15904
  if (!d.trim()) return r;
15867
15905
  const E = d.toLowerCase();
15868
15906
  return r.filter(
@@ -16624,7 +16662,7 @@ function Vy({
16624
16662
  cardAspectRatio: t = "2:3",
16625
16663
  onNodeClick: n
16626
16664
  }) {
16627
- const [s, i] = L(null), o = at(() => e.map((u) => ({
16665
+ const [s, i] = L(null), o = lt(() => e.map((u) => ({
16628
16666
  ...u,
16629
16667
  nodes: r.filter(u.filter)
16630
16668
  })), [r, e]), a = (u) => {
@@ -16715,12 +16753,12 @@ function Gy({
16715
16753
  className: p = "",
16716
16754
  theme: g = {}
16717
16755
  }) {
16718
- const m = { ...Cg, ...g }, { allDayItems: y, timedItems: b } = at(() => {
16756
+ const m = { ...Cg, ...g }, { allDayItems: y, timedItems: b } = lt(() => {
16719
16757
  const _ = [], E = [];
16720
16758
  for (const j of r)
16721
16759
  a(j) ? _.push(j) : E.push(j);
16722
16760
  return { allDayItems: _, timedItems: E };
16723
- }, [r, a]), x = at(() => {
16761
+ }, [r, a]), x = lt(() => {
16724
16762
  const _ = [];
16725
16763
  for (let E = t; E <= n; E++)
16726
16764
  _.push(E);
@@ -16735,7 +16773,7 @@ function Gy({
16735
16773
  return { top: w, height: F };
16736
16774
  },
16737
16775
  [i, o, t, n, s]
16738
- ), k = at(() => {
16776
+ ), k = lt(() => {
16739
16777
  if (!f || !kg(e)) return null;
16740
16778
  const _ = /* @__PURE__ */ new Date(), E = _.getHours(), j = _.getMinutes();
16741
16779
  return E < t || E > n ? null : (E - t) * s + j / 60 * s;
@@ -16922,28 +16960,28 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
16922
16960
  Te.setUint8(Je + yt, We.charCodeAt(yt));
16923
16961
  };
16924
16962
  je(0, "RIFF"), Te.setUint32(4, 36 + $e, !0), je(8, "WAVE"), je(12, "fmt "), Te.setUint32(16, 16, !0), Te.setUint16(20, ye, !0), Te.setUint16(22, R, !0), Te.setUint32(24, he, !0), Te.setUint32(28, Ae, !0), Te.setUint16(32, De, !0), Te.setUint16(34, K, !0), je(36, "data"), Te.setUint32(40, $e, !0);
16925
- const it = [];
16963
+ const ot = [];
16926
16964
  for (let Je = 0; Je < R; Je++)
16927
- it.push(J.getChannelData(Je));
16928
- let ut = 44;
16965
+ ot.push(J.getChannelData(Je));
16966
+ let ct = 44;
16929
16967
  for (let Je = 0; Je < J.length; Je++)
16930
16968
  for (let We = 0; We < R; We++) {
16931
- const yt = Math.max(-1, Math.min(1, it[We][Je])), xt = yt < 0 ? yt * 32768 : yt * 32767;
16932
- Te.setInt16(ut, xt, !0), ut += 2;
16969
+ const yt = Math.max(-1, Math.min(1, ot[We][Je])), xt = yt < 0 ? yt * 32768 : yt * 32767;
16970
+ Te.setInt16(ct, xt, !0), ct += 2;
16933
16971
  }
16934
16972
  return new Blob([Ye], { type: "audio/wav" });
16935
16973
  }, O = async (J, R, he, ye) => {
16936
16974
  const K = new AudioContext(), Ne = J.sampleRate, De = Math.max(J.numberOfChannels, R.numberOfChannels), Ae = Math.min(he, J.length), $e = Math.max(0, J.length - he), Ye = ye === "insert" ? Ae + R.length + $e : Ae + R.length, Te = K.createBuffer(De, Ye, Ne);
16937
16975
  for (let je = 0; je < De; je++) {
16938
- const it = Te.getChannelData(je), ut = je < J.numberOfChannels ? J.getChannelData(je) : J.getChannelData(0);
16976
+ const ot = Te.getChannelData(je), ct = je < J.numberOfChannels ? J.getChannelData(je) : J.getChannelData(0);
16939
16977
  for (let We = 0; We < Ae; We++)
16940
- it[We] = ut[We];
16978
+ ot[We] = ct[We];
16941
16979
  const Je = je < R.numberOfChannels ? R.getChannelData(je) : R.getChannelData(0);
16942
16980
  for (let We = 0; We < R.length; We++)
16943
- it[Ae + We] = Je[We];
16981
+ ot[Ae + We] = Je[We];
16944
16982
  if (ye === "insert")
16945
16983
  for (let We = 0; We < $e; We++)
16946
- it[Ae + R.length + We] = ut[he + We];
16984
+ ot[Ae + R.length + We] = ct[he + We];
16947
16985
  }
16948
16986
  return await K.close(), Te;
16949
16987
  }, Ge = ee(() => {
@@ -16957,10 +16995,10 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
16957
16995
  Te.addColorStop(0, Ye), Te.addColorStop(1, "transparent"), R.fillStyle = Te, R.fillRect(0, 0, ye, $e);
16958
16996
  const je = R.createLinearGradient(0, K - $e, 0, K);
16959
16997
  je.addColorStop(0, "transparent"), je.addColorStop(1, Ye), R.fillStyle = je, R.fillRect(0, K - $e, ye, $e);
16960
- const it = R.createLinearGradient(0, 0, $e, 0);
16961
- it.addColorStop(0, Ye), it.addColorStop(1, "transparent"), R.fillStyle = it, R.fillRect(0, 0, $e, K);
16962
- const ut = R.createLinearGradient(ye - $e, 0, ye, 0);
16963
- ut.addColorStop(0, "transparent"), ut.addColorStop(1, Ye), R.fillStyle = ut, R.fillRect(ye - $e, 0, $e, K), R.strokeStyle = "#5a6b62", R.lineWidth = 1, R.beginPath(), R.moveTo(0, K / 2), R.lineTo(ye, K / 2), R.stroke();
16998
+ const ot = R.createLinearGradient(0, 0, $e, 0);
16999
+ ot.addColorStop(0, Ye), ot.addColorStop(1, "transparent"), R.fillStyle = ot, R.fillRect(0, 0, $e, K);
17000
+ const ct = R.createLinearGradient(ye - $e, 0, ye, 0);
17001
+ ct.addColorStop(0, "transparent"), ct.addColorStop(1, Ye), R.fillStyle = ct, R.fillRect(ye - $e, 0, $e, K), R.strokeStyle = "#5a6b62", R.lineWidth = 1, R.beginPath(), R.moveTo(0, K / 2), R.lineTo(ye, K / 2), R.stroke();
16964
17002
  const Je = ye / 2;
16965
17003
  if (Ne.length > 0)
16966
17004
  if (l === "recording")
@@ -17014,13 +17052,13 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17014
17052
  let De, Ae;
17015
17053
  if (Ee.current !== null && be.current)
17016
17054
  try {
17017
- const Te = await Ve(Ne), je = be.current.sampleRate, it = Math.floor(Ee.current * je), ut = await O(
17055
+ const Te = await Ve(Ne), je = be.current.sampleRate, ot = Math.floor(Ee.current * je), ct = await O(
17018
17056
  be.current,
17019
17057
  Te,
17020
- it,
17058
+ ot,
17021
17059
  re.current
17022
17060
  );
17023
- De = V(ut), Ae = ut.length / ut.sampleRate, re.current === "insert" && (me.current = [
17061
+ De = V(ct), Ae = ct.length / ct.sampleRate, re.current === "insert" && (me.current = [
17024
17062
  ...me.current,
17025
17063
  ...we.current
17026
17064
  ]), Ee.current = null, be.current = null, Z.current = [], we.current = [];
@@ -17152,14 +17190,14 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17152
17190
  if (K) {
17153
17191
  const Ne = ye.getBoundingClientRect(), De = Ne.width, Ae = Ne.height, $e = me.current, Ye = f || c || 1, Te = he.currentTime;
17154
17192
  K.fillStyle = "#2d3b35", K.fillRect(0, 0, De, Ae);
17155
- const je = 8, it = "rgba(0, 0, 0, 0.4)", ut = K.createLinearGradient(0, 0, 0, je);
17156
- ut.addColorStop(0, it), ut.addColorStop(1, "transparent"), K.fillStyle = ut, K.fillRect(0, 0, De, je);
17193
+ const je = 8, ot = "rgba(0, 0, 0, 0.4)", ct = K.createLinearGradient(0, 0, 0, je);
17194
+ ct.addColorStop(0, ot), ct.addColorStop(1, "transparent"), K.fillStyle = ct, K.fillRect(0, 0, De, je);
17157
17195
  const Je = K.createLinearGradient(0, Ae - je, 0, Ae);
17158
- Je.addColorStop(0, "transparent"), Je.addColorStop(1, it), K.fillStyle = Je, K.fillRect(0, Ae - je, De, je);
17196
+ Je.addColorStop(0, "transparent"), Je.addColorStop(1, ot), K.fillStyle = Je, K.fillRect(0, Ae - je, De, je);
17159
17197
  const We = K.createLinearGradient(0, 0, je, 0);
17160
- We.addColorStop(0, it), We.addColorStop(1, "transparent"), K.fillStyle = We, K.fillRect(0, 0, je, Ae);
17198
+ We.addColorStop(0, ot), We.addColorStop(1, "transparent"), K.fillStyle = We, K.fillRect(0, 0, je, Ae);
17161
17199
  const yt = K.createLinearGradient(De - je, 0, De, 0);
17162
- yt.addColorStop(0, "transparent"), yt.addColorStop(1, it), K.fillStyle = yt, K.fillRect(De - je, 0, je, Ae), K.strokeStyle = "#5a6b62", K.lineWidth = 1, K.beginPath(), K.moveTo(0, Ae / 2), K.lineTo(De, Ae / 2), K.stroke();
17200
+ yt.addColorStop(0, "transparent"), yt.addColorStop(1, ot), K.fillStyle = yt, K.fillRect(De - je, 0, je, Ae), K.strokeStyle = "#5a6b62", K.lineWidth = 1, K.beginPath(), K.moveTo(0, Ae / 2), K.lineTo(De, Ae / 2), K.stroke();
17163
17201
  const xt = De / 2, Mt = 3, sr = 4, Pt = Ye > 0 ? Te / Ye * $e.length : 0;
17164
17202
  for (let te = 0; te < $e.length; te++) {
17165
17203
  const xe = Pt - te, Le = xt - xe * sr;
@@ -17193,7 +17231,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17193
17231
  }
17194
17232
  )
17195
17233
  ] });
17196
- const rt = {
17234
+ const nt = {
17197
17235
  padding: "8px",
17198
17236
  borderRadius: "8px",
17199
17237
  border: "none",
@@ -17203,8 +17241,8 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17203
17241
  alignItems: "center",
17204
17242
  justifyContent: "center",
17205
17243
  transition: "background 0.15s"
17206
- }, nt = {
17207
- ...rt,
17244
+ }, st = {
17245
+ ...nt,
17208
17246
  opacity: 0.3,
17209
17247
  cursor: "not-allowed"
17210
17248
  }, Lt = a ? { border: "1px solid #e5e5e5", borderRadius: "12px", overflow: "hidden", background: "white" } : { overflow: "hidden", background: "white", flexShrink: 0 };
@@ -17247,7 +17285,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17247
17285
  {
17248
17286
  onClick: fe,
17249
17287
  disabled: l === "idle" || l === "recording",
17250
- style: l === "idle" || l === "recording" ? nt : rt,
17288
+ style: l === "idle" || l === "recording" ? st : nt,
17251
17289
  title: "Go to start",
17252
17290
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "first_page" })
17253
17291
  }
@@ -17263,7 +17301,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17263
17301
  Ke();
17264
17302
  },
17265
17303
  disabled: l === "idle",
17266
- style: l === "idle" ? nt : rt,
17304
+ style: l === "idle" ? st : nt,
17267
17305
  title: g || l === "recording" && !C ? "Pause" : "Play",
17268
17306
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: g || l === "recording" && !C ? "pause" : "play_arrow" })
17269
17307
  }
@@ -17273,7 +17311,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17273
17311
  {
17274
17312
  onClick: ke,
17275
17313
  disabled: l === "idle" || l === "recording",
17276
- style: l === "idle" || l === "recording" ? nt : rt,
17314
+ style: l === "idle" || l === "recording" ? st : nt,
17277
17315
  title: "Go to end",
17278
17316
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "last_page" })
17279
17317
  }
@@ -17286,7 +17324,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17286
17324
  S === "insert" ? ae() : l === "idle" ? (_("insert"), ne()) : l === "editing" && (_("insert"), mt("insert"));
17287
17325
  },
17288
17326
  disabled: l === "recording" && S !== "insert" || g,
17289
- style: l === "recording" && S !== "insert" || g ? nt : rt,
17327
+ style: l === "recording" && S !== "insert" || g ? st : nt,
17290
17328
  title: S === "insert" ? "Stop recording" : "Insert recording",
17291
17329
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: S === "insert" ? "#ef4444" : "#171717" }, children: "add" })
17292
17330
  }
@@ -17313,7 +17351,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17313
17351
  J.preventDefault(), B.current && l === "recording" && S === "mic" && ae();
17314
17352
  },
17315
17353
  disabled: l === "recording" && S !== "mic" || g,
17316
- style: l === "recording" && S !== "mic" || g ? nt : rt,
17354
+ style: l === "recording" && S !== "mic" || g ? st : nt,
17317
17355
  title: E ? "Hold to record (walkie-talkie)" : S === "mic" ? "Stop recording" : "Record",
17318
17356
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: S === "mic" ? "#ef4444" : "#171717" }, children: "mic" })
17319
17357
  }
@@ -17325,7 +17363,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17325
17363
  S === "startover" ? ae() : l === "editing" && (_("startover"), ue());
17326
17364
  },
17327
17365
  disabled: l === "idle" || l === "recording" && S !== "startover" || g,
17328
- style: l === "idle" || l === "recording" && S !== "startover" || g ? nt : rt,
17366
+ style: l === "idle" || l === "recording" && S !== "startover" || g ? st : nt,
17329
17367
  title: S === "startover" ? "Stop recording" : "Start over",
17330
17368
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: S === "startover" ? "#ef4444" : "#171717" }, children: "refresh" })
17331
17369
  }
@@ -17387,7 +17425,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17387
17425
  l === "editing" && ce.current && Qe(ce.current);
17388
17426
  },
17389
17427
  disabled: l !== "editing",
17390
- style: l !== "editing" ? nt : rt,
17428
+ style: l !== "editing" ? st : nt,
17391
17429
  title: "Transcribe audio",
17392
17430
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: E ? "#10b981" : "#171717" }, children: "subtitles" })
17393
17431
  }
@@ -17398,7 +17436,7 @@ function Dg({ onComplete: r, onCancel: e, onTranscribe: t, onTranscriptionComple
17398
17436
  {
17399
17437
  onClick: ge,
17400
17438
  disabled: l !== "editing",
17401
- style: l !== "editing" ? nt : rt,
17439
+ style: l !== "editing" ? st : nt,
17402
17440
  title: "Save recording",
17403
17441
  children: /* @__PURE__ */ h.jsx("span", { className: "material-icons", style: { fontSize: "20px", color: "#171717" }, children: "save" })
17404
17442
  }
@@ -20378,7 +20416,7 @@ const uy = li(function({
20378
20416
  width: o,
20379
20417
  onClick: a
20380
20418
  }) {
20381
- const [l, u] = L(!1), c = at(() => oy(t, n, s), [t, n, s]), d = ee((y) => {
20419
+ const [l, u] = L(!1), c = lt(() => oy(t, n, s), [t, n, s]), d = ee((y) => {
20382
20420
  y.stopPropagation(), a == null || a(e, y);
20383
20421
  }, [e, a]), f = ee(() => {
20384
20422
  u(!0);
@@ -20428,7 +20466,7 @@ const uy = li(function({
20428
20466
  ] });
20429
20467
  }, (r, e) => r.edge.id === e.edge.id && r.sourcePosition.x === e.sourcePosition.x && r.sourcePosition.y === e.sourcePosition.y && r.sourcePosition.width === e.sourcePosition.width && r.sourcePosition.height === e.sourcePosition.height && r.targetPosition.x === e.targetPosition.x && r.targetPosition.y === e.targetPosition.y && r.targetPosition.width === e.targetPosition.width && r.targetPosition.height === e.targetPosition.height && r.style === e.style && r.color === e.color && r.width === e.width && r.edge.label === e.edge.label && r.edge.color === e.edge.color && r.edge.width === e.edge.width);
20430
20468
  function cy({ pathD: r, label: e, color: t }) {
20431
- const n = at(() => `edge-label-${Math.random().toString(36).substr(2, 9)}`, []);
20469
+ const n = lt(() => `edge-label-${Math.random().toString(36).substr(2, 9)}`, []);
20432
20470
  return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
20433
20471
  /* @__PURE__ */ h.jsx("defs", { children: /* @__PURE__ */ h.jsx("path", { id: n, d: r }) }),
20434
20472
  /* @__PURE__ */ h.jsx(
@@ -20459,7 +20497,7 @@ const dy = li(function({
20459
20497
  defaultWidth: i,
20460
20498
  onEdgeClick: o
20461
20499
  }) {
20462
- const a = at(() => e.filter((l) => t.has(l.source) && t.has(l.target)), [e, t]);
20500
+ const a = lt(() => e.filter((l) => t.has(l.source) && t.has(l.target)), [e, t]);
20463
20501
  return /* @__PURE__ */ h.jsx(
20464
20502
  "svg",
20465
20503
  {
@@ -20494,7 +20532,7 @@ const dy = li(function({
20494
20532
  box: e,
20495
20533
  transform: t
20496
20534
  }) {
20497
- const n = at(() => ({
20535
+ const n = lt(() => ({
20498
20536
  x: e.x * t.k + t.x,
20499
20537
  y: e.y * t.k + t.y,
20500
20538
  width: e.width * t.k,
@@ -20550,7 +20588,7 @@ function nx({
20550
20588
  showGrid: N = !1,
20551
20589
  gridSize: M = 20
20552
20590
  }) {
20553
- const w = r.data || { positions: {} }, B = w.positions || {}, F = at(() => {
20591
+ const w = r.data || { positions: {} }, B = w.positions || {}, F = lt(() => {
20554
20592
  const ie = /* @__PURE__ */ new Map();
20555
20593
  for (const ne of e) {
20556
20594
  const ae = B[ne._id] || { x: 0, y: 0 };
@@ -20633,7 +20671,7 @@ function nx({
20633
20671
  }), Ie = ee((ie) => {
20634
20672
  const ne = F.get(ie) || { x: 0, y: 0, width: s, height: i }, ae = H.get(ie), z = ce.get(ie), fe = (z == null ? void 0 : z.width) || ne.width || s, ke = (z == null ? void 0 : z.height) || ne.height || i;
20635
20673
  return ae ? { ...ne, x: ae.x, y: ae.y, width: fe, height: ke } : { ...ne, width: fe, height: ke };
20636
- }, [F, H, ce, s, i]), ze = at(() => {
20674
+ }, [F, H, ce, s, i]), ze = lt(() => {
20637
20675
  const ie = /* @__PURE__ */ new Map();
20638
20676
  for (const ne of F.keys())
20639
20677
  ie.set(ne, Ie(ne));
@@ -20830,7 +20868,7 @@ export {
20830
20868
  Dg as AudioEditor,
20831
20869
  of as AuthFlow,
20832
20870
  By as AuthFlowModal,
20833
- ct as AuthManager,
20871
+ et as AuthManager,
20834
20872
  Ay as AuthProvider,
20835
20873
  uu as AuthService,
20836
20874
  Fy as Card,