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