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