@qwanyx/stack 0.2.42 → 0.2.44
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.cjs.js +21 -21
- package/dist/index.esm.js +658 -651
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ var Oa = Object.defineProperty;
|
|
|
2
2
|
var Ma = (r, e, t) => e in r ? Oa(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var Ir = (r, e, t) => Ma(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import * as As from "react";
|
|
5
|
-
import
|
|
5
|
+
import Je, { useState as H, useCallback as re, useEffect as De, useMemo as bt, useRef as xe, createContext as Ia, useContext as $a, useLayoutEffect as jr, Suspense as za, forwardRef as al } from "react";
|
|
6
6
|
import { flushSync as qa, createPortal as Ua } from "react-dom";
|
|
7
7
|
class xf {
|
|
8
8
|
constructor(e) {
|
|
@@ -4044,7 +4044,7 @@ var Hi;
|
|
|
4044
4044
|
function hu() {
|
|
4045
4045
|
if (Hi) return $r;
|
|
4046
4046
|
Hi = 1;
|
|
4047
|
-
var r =
|
|
4047
|
+
var r = Je, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
4048
4048
|
function i(l, a, u) {
|
|
4049
4049
|
var c, d = {}, f = null, h = null;
|
|
4050
4050
|
u !== void 0 && (f = "" + u), a.key !== void 0 && (f = "" + a.key), a.ref !== void 0 && (h = a.ref);
|
|
@@ -4067,7 +4067,7 @@ var zr = {};
|
|
|
4067
4067
|
var Ji;
|
|
4068
4068
|
function pu() {
|
|
4069
4069
|
return Ji || (Ji = 1, process.env.NODE_ENV !== "production" && function() {
|
|
4070
|
-
var r =
|
|
4070
|
+
var r = Je, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), i = Symbol.for("react.provider"), l = Symbol.for("react.context"), a = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), h = Symbol.for("react.offscreen"), g = Symbol.iterator, m = "@@iterator";
|
|
4071
4071
|
function y(_) {
|
|
4072
4072
|
if (_ === null || typeof _ != "object")
|
|
4073
4073
|
return null;
|
|
@@ -4094,7 +4094,7 @@ function pu() {
|
|
|
4094
4094
|
}
|
|
4095
4095
|
var w = !1, E = !1, v = !1, b = !1, D = !1, k;
|
|
4096
4096
|
k = Symbol.for("react.module.reference");
|
|
4097
|
-
function
|
|
4097
|
+
function I(_) {
|
|
4098
4098
|
return !!(typeof _ == "string" || typeof _ == "function" || _ === n || _ === o || D || _ === s || _ === u || _ === c || b || _ === h || w || E || v || typeof _ == "object" && _ !== null && (_.$$typeof === f || _.$$typeof === d || _.$$typeof === i || _.$$typeof === l || _.$$typeof === a || // This needs to include all possible module reference object
|
|
4099
4099
|
// types supported by any Flight configuration anywhere since
|
|
4100
4100
|
// we don't know which Flight build this will end up being used
|
|
@@ -4156,14 +4156,14 @@ function pu() {
|
|
|
4156
4156
|
}
|
|
4157
4157
|
return null;
|
|
4158
4158
|
}
|
|
4159
|
-
var j = Object.assign,
|
|
4159
|
+
var j = Object.assign, O = 0, X, de, ie, oe, ve, pe, we;
|
|
4160
4160
|
function Se() {
|
|
4161
4161
|
}
|
|
4162
4162
|
Se.__reactDisabledLog = !0;
|
|
4163
4163
|
function Oe() {
|
|
4164
4164
|
{
|
|
4165
|
-
if (
|
|
4166
|
-
|
|
4165
|
+
if (O === 0) {
|
|
4166
|
+
X = console.log, de = console.info, ie = console.warn, oe = console.error, ve = console.group, pe = console.groupCollapsed, we = console.groupEnd;
|
|
4167
4167
|
var _ = {
|
|
4168
4168
|
configurable: !0,
|
|
4169
4169
|
enumerable: !0,
|
|
@@ -4180,12 +4180,12 @@ function pu() {
|
|
|
4180
4180
|
groupEnd: _
|
|
4181
4181
|
});
|
|
4182
4182
|
}
|
|
4183
|
-
|
|
4183
|
+
O++;
|
|
4184
4184
|
}
|
|
4185
4185
|
}
|
|
4186
4186
|
function ke() {
|
|
4187
4187
|
{
|
|
4188
|
-
if (
|
|
4188
|
+
if (O--, O === 0) {
|
|
4189
4189
|
var _ = {
|
|
4190
4190
|
configurable: !0,
|
|
4191
4191
|
enumerable: !0,
|
|
@@ -4193,7 +4193,7 @@ function pu() {
|
|
|
4193
4193
|
};
|
|
4194
4194
|
Object.defineProperties(console, {
|
|
4195
4195
|
log: j({}, _, {
|
|
4196
|
-
value:
|
|
4196
|
+
value: X
|
|
4197
4197
|
}),
|
|
4198
4198
|
info: j({}, _, {
|
|
4199
4199
|
value: de
|
|
@@ -4215,21 +4215,21 @@ function pu() {
|
|
|
4215
4215
|
})
|
|
4216
4216
|
});
|
|
4217
4217
|
}
|
|
4218
|
-
|
|
4218
|
+
O < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
4219
4219
|
}
|
|
4220
4220
|
}
|
|
4221
|
-
var Ce = C.ReactCurrentDispatcher,
|
|
4221
|
+
var Ce = C.ReactCurrentDispatcher, Ve;
|
|
4222
4222
|
function ze(_, P, G) {
|
|
4223
4223
|
{
|
|
4224
|
-
if (
|
|
4224
|
+
if (Ve === void 0)
|
|
4225
4225
|
try {
|
|
4226
4226
|
throw Error();
|
|
4227
4227
|
} catch (he) {
|
|
4228
4228
|
var Z = he.stack.trim().match(/\n( *(at )?)/);
|
|
4229
|
-
|
|
4229
|
+
Ve = Z && Z[1] || "";
|
|
4230
4230
|
}
|
|
4231
4231
|
return `
|
|
4232
|
-
` +
|
|
4232
|
+
` + Ve + _;
|
|
4233
4233
|
}
|
|
4234
4234
|
}
|
|
4235
4235
|
var ge = !1, Me;
|
|
@@ -4286,14 +4286,14 @@ function pu() {
|
|
|
4286
4286
|
} catch (Ze) {
|
|
4287
4287
|
if (Ze && Z && typeof Ze.stack == "string") {
|
|
4288
4288
|
for (var se = Ze.stack.split(`
|
|
4289
|
-
`),
|
|
4290
|
-
`), Ne = se.length - 1, je =
|
|
4289
|
+
`), He = Z.stack.split(`
|
|
4290
|
+
`), Ne = se.length - 1, je = He.length - 1; Ne >= 1 && je >= 0 && se[Ne] !== He[je]; )
|
|
4291
4291
|
je--;
|
|
4292
4292
|
for (; Ne >= 1 && je >= 0; Ne--, je--)
|
|
4293
|
-
if (se[Ne] !==
|
|
4293
|
+
if (se[Ne] !== He[je]) {
|
|
4294
4294
|
if (Ne !== 1 || je !== 1)
|
|
4295
4295
|
do
|
|
4296
|
-
if (Ne--, je--, je < 0 || se[Ne] !==
|
|
4296
|
+
if (Ne--, je--, je < 0 || se[Ne] !== He[je]) {
|
|
4297
4297
|
var at = `
|
|
4298
4298
|
` + se[Ne].replace(" at new ", " at ");
|
|
4299
4299
|
return _.displayName && at.includes("<anonymous>") && (at = at.replace("<anonymous>", _.displayName)), typeof _ == "function" && Me.set(_, at), at;
|
|
@@ -4360,8 +4360,8 @@ function pu() {
|
|
|
4360
4360
|
var se = void 0;
|
|
4361
4361
|
try {
|
|
4362
4362
|
if (typeof _[le] != "function") {
|
|
4363
|
-
var
|
|
4364
|
-
throw
|
|
4363
|
+
var He = Error((Z || "React class") + ": " + G + " type `" + le + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof _[le] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
4364
|
+
throw He.name = "Invariant Violation", He;
|
|
4365
4365
|
}
|
|
4366
4366
|
se = _[le](P, le, Z, G, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
4367
4367
|
} catch (Ne) {
|
|
@@ -4383,25 +4383,25 @@ function pu() {
|
|
|
4383
4383
|
}
|
|
4384
4384
|
function be(_) {
|
|
4385
4385
|
try {
|
|
4386
|
-
return
|
|
4386
|
+
return qe(_), !1;
|
|
4387
4387
|
} catch {
|
|
4388
4388
|
return !0;
|
|
4389
4389
|
}
|
|
4390
4390
|
}
|
|
4391
|
-
function
|
|
4391
|
+
function qe(_) {
|
|
4392
4392
|
return "" + _;
|
|
4393
4393
|
}
|
|
4394
|
-
function
|
|
4394
|
+
function R(_) {
|
|
4395
4395
|
if (be(_))
|
|
4396
|
-
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(_)),
|
|
4396
|
+
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(_)), qe(_);
|
|
4397
4397
|
}
|
|
4398
|
-
var T = C.ReactCurrentOwner,
|
|
4398
|
+
var T = C.ReactCurrentOwner, Q = {
|
|
4399
4399
|
key: !0,
|
|
4400
4400
|
ref: !0,
|
|
4401
4401
|
__self: !0,
|
|
4402
4402
|
__source: !0
|
|
4403
4403
|
}, J, S;
|
|
4404
|
-
function
|
|
4404
|
+
function $(_) {
|
|
4405
4405
|
if (dt.call(_, "ref")) {
|
|
4406
4406
|
var P = Object.getOwnPropertyDescriptor(_, "ref").get;
|
|
4407
4407
|
if (P && P.isReactWarning)
|
|
@@ -4417,7 +4417,7 @@ function pu() {
|
|
|
4417
4417
|
}
|
|
4418
4418
|
return _.key !== void 0;
|
|
4419
4419
|
}
|
|
4420
|
-
function
|
|
4420
|
+
function Y(_, P) {
|
|
4421
4421
|
typeof _.ref == "string" && T.current;
|
|
4422
4422
|
}
|
|
4423
4423
|
function ee(_, P) {
|
|
@@ -4473,20 +4473,20 @@ function pu() {
|
|
|
4473
4473
|
};
|
|
4474
4474
|
function te(_, P, G, Z, he) {
|
|
4475
4475
|
{
|
|
4476
|
-
var _e, le = {}, se = null,
|
|
4477
|
-
G !== void 0 && (
|
|
4476
|
+
var _e, le = {}, se = null, He = null;
|
|
4477
|
+
G !== void 0 && (R(G), se = "" + G), K(P) && (R(P.key), se = "" + P.key), $(P) && (He = P.ref, Y(P, he));
|
|
4478
4478
|
for (_e in P)
|
|
4479
|
-
dt.call(P, _e) && !
|
|
4479
|
+
dt.call(P, _e) && !Q.hasOwnProperty(_e) && (le[_e] = P[_e]);
|
|
4480
4480
|
if (_ && _.defaultProps) {
|
|
4481
4481
|
var Ne = _.defaultProps;
|
|
4482
4482
|
for (_e in Ne)
|
|
4483
4483
|
le[_e] === void 0 && (le[_e] = Ne[_e]);
|
|
4484
4484
|
}
|
|
4485
|
-
if (se ||
|
|
4485
|
+
if (se || He) {
|
|
4486
4486
|
var je = typeof _ == "function" ? _.displayName || _.name || "Unknown" : _;
|
|
4487
|
-
se && ee(le, je),
|
|
4487
|
+
se && ee(le, je), He && ae(le, je);
|
|
4488
4488
|
}
|
|
4489
|
-
return ne(_, se,
|
|
4489
|
+
return ne(_, se, He, he, Z, T.current, le);
|
|
4490
4490
|
}
|
|
4491
4491
|
}
|
|
4492
4492
|
var Ae = C.ReactCurrentOwner, Fe = C.ReactDebugCurrentFrame;
|
|
@@ -4499,10 +4499,10 @@ function pu() {
|
|
|
4499
4499
|
}
|
|
4500
4500
|
var fe;
|
|
4501
4501
|
fe = !1;
|
|
4502
|
-
function
|
|
4502
|
+
function Ue(_) {
|
|
4503
4503
|
return typeof _ == "object" && _ !== null && _.$$typeof === e;
|
|
4504
4504
|
}
|
|
4505
|
-
function
|
|
4505
|
+
function We() {
|
|
4506
4506
|
{
|
|
4507
4507
|
if (Ae.current) {
|
|
4508
4508
|
var _ = L(Ae.current.type);
|
|
@@ -4520,7 +4520,7 @@ Check the render method of \`` + _ + "`.";
|
|
|
4520
4520
|
var Et = {};
|
|
4521
4521
|
function pt(_) {
|
|
4522
4522
|
{
|
|
4523
|
-
var P =
|
|
4523
|
+
var P = We();
|
|
4524
4524
|
if (!P) {
|
|
4525
4525
|
var G = typeof _ == "string" ? _ : _.displayName || _.name;
|
|
4526
4526
|
G && (P = `
|
|
@@ -4550,15 +4550,15 @@ Check the top-level render call using <` + G + ">.");
|
|
|
4550
4550
|
if (At(_))
|
|
4551
4551
|
for (var G = 0; G < _.length; G++) {
|
|
4552
4552
|
var Z = _[G];
|
|
4553
|
-
|
|
4553
|
+
Ue(Z) && Pt(Z, P);
|
|
4554
4554
|
}
|
|
4555
|
-
else if (
|
|
4555
|
+
else if (Ue(_))
|
|
4556
4556
|
_._store && (_._store.validated = !0);
|
|
4557
4557
|
else if (_) {
|
|
4558
4558
|
var he = y(_);
|
|
4559
4559
|
if (typeof he == "function" && he !== _.entries)
|
|
4560
4560
|
for (var _e = he.call(_), le; !(le = _e.next()).done; )
|
|
4561
|
-
|
|
4561
|
+
Ue(le.value) && Pt(le.value, P);
|
|
4562
4562
|
}
|
|
4563
4563
|
}
|
|
4564
4564
|
}
|
|
@@ -4602,12 +4602,12 @@ Check the top-level render call using <` + G + ">.");
|
|
|
4602
4602
|
var xr = {};
|
|
4603
4603
|
function Mr(_, P, G, Z, he, _e) {
|
|
4604
4604
|
{
|
|
4605
|
-
var le =
|
|
4605
|
+
var le = I(_);
|
|
4606
4606
|
if (!le) {
|
|
4607
4607
|
var se = "";
|
|
4608
4608
|
(_ === void 0 || typeof _ == "object" && _ !== null && Object.keys(_).length === 0) && (se += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
4609
|
-
var
|
|
4610
|
-
|
|
4609
|
+
var He = lt();
|
|
4610
|
+
He ? se += He : se += We();
|
|
4611
4611
|
var Ne;
|
|
4612
4612
|
_ === null ? Ne = "null" : At(_) ? Ne = "array" : _ !== void 0 && _.$$typeof === e ? (Ne = "<" + (L(_.type) || "Unknown") + " />", se = " Did you accidentally export a JSX literal instead of a component?") : Ne = typeof _, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ne, se);
|
|
4613
4613
|
}
|
|
@@ -4766,7 +4766,7 @@ function vf({
|
|
|
4766
4766
|
De(() => {
|
|
4767
4767
|
D(1);
|
|
4768
4768
|
}, [A, E]);
|
|
4769
|
-
const
|
|
4769
|
+
const I = () => {
|
|
4770
4770
|
w(""), v({}), D(1), x(), h == null || h();
|
|
4771
4771
|
}, B = {
|
|
4772
4772
|
background: g.background || "#ffffff",
|
|
@@ -4798,7 +4798,7 @@ function vf({
|
|
|
4798
4798
|
/* @__PURE__ */ p.jsx(
|
|
4799
4799
|
"button",
|
|
4800
4800
|
{
|
|
4801
|
-
onClick:
|
|
4801
|
+
onClick: I,
|
|
4802
4802
|
style: {
|
|
4803
4803
|
marginTop: "16px",
|
|
4804
4804
|
padding: "8px 16px",
|
|
@@ -4835,7 +4835,7 @@ function vf({
|
|
|
4835
4835
|
/* @__PURE__ */ p.jsx(
|
|
4836
4836
|
"button",
|
|
4837
4837
|
{
|
|
4838
|
-
onClick:
|
|
4838
|
+
onClick: I,
|
|
4839
4839
|
style: {
|
|
4840
4840
|
padding: "6px 12px",
|
|
4841
4841
|
background: "transparent",
|
|
@@ -4877,7 +4877,7 @@ function vf({
|
|
|
4877
4877
|
padding: "48px",
|
|
4878
4878
|
textAlign: "center",
|
|
4879
4879
|
color: B.textSecondary
|
|
4880
|
-
}, children: s }) : k.data.map((j,
|
|
4880
|
+
}, children: s }) : k.data.map((j, O) => /* @__PURE__ */ p.jsx(
|
|
4881
4881
|
"div",
|
|
4882
4882
|
{
|
|
4883
4883
|
onClick: () => f == null ? void 0 : f(j),
|
|
@@ -4887,15 +4887,15 @@ function vf({
|
|
|
4887
4887
|
borderBottom: t === "list" ? `1px solid ${B.border}` : "none",
|
|
4888
4888
|
transition: "all 0.15s ease"
|
|
4889
4889
|
},
|
|
4890
|
-
onMouseEnter: (
|
|
4891
|
-
f && (
|
|
4890
|
+
onMouseEnter: (X) => {
|
|
4891
|
+
f && (X.currentTarget.style.background = B.border);
|
|
4892
4892
|
},
|
|
4893
|
-
onMouseLeave: (
|
|
4894
|
-
|
|
4893
|
+
onMouseLeave: (X) => {
|
|
4894
|
+
X.currentTarget.style.background = B.cardBackground;
|
|
4895
4895
|
},
|
|
4896
|
-
children: L(j,
|
|
4896
|
+
children: L(j, O)
|
|
4897
4897
|
},
|
|
4898
|
-
i(j,
|
|
4898
|
+
i(j, O)
|
|
4899
4899
|
)) }),
|
|
4900
4900
|
k.totalPages > 1 && /* @__PURE__ */ p.jsxs("div", { style: {
|
|
4901
4901
|
padding: "16px",
|
|
@@ -5062,14 +5062,14 @@ function Df({
|
|
|
5062
5062
|
}
|
|
5063
5063
|
const v = [], b = [], D = [];
|
|
5064
5064
|
for (let k = 0; k < l && k < r.length; k++) {
|
|
5065
|
-
const
|
|
5066
|
-
|
|
5065
|
+
const I = C(D);
|
|
5066
|
+
I && (v.push(I), D.push(I._id));
|
|
5067
5067
|
}
|
|
5068
5068
|
for (let k = 0; k < v.length; k++) {
|
|
5069
|
-
const
|
|
5069
|
+
const I = [
|
|
5070
5070
|
v[k]._id,
|
|
5071
5071
|
...v.filter((F, L) => L !== k).map((F) => F._id)
|
|
5072
|
-
], B = C(
|
|
5072
|
+
], B = C(I);
|
|
5073
5073
|
B ? b.push(B) : b.push(v[k]);
|
|
5074
5074
|
}
|
|
5075
5075
|
u(v), d(b);
|
|
@@ -5077,22 +5077,22 @@ function Df({
|
|
|
5077
5077
|
const A = re((v) => {
|
|
5078
5078
|
const b = x(), D = setTimeout(() => {
|
|
5079
5079
|
h((k) => {
|
|
5080
|
-
const
|
|
5081
|
-
return
|
|
5080
|
+
const I = [...k];
|
|
5081
|
+
return I[v] = !I[v], I;
|
|
5082
5082
|
}), setTimeout(() => {
|
|
5083
5083
|
m((k) => {
|
|
5084
|
-
const
|
|
5085
|
-
return
|
|
5084
|
+
const I = [...k];
|
|
5085
|
+
return I[v] = !I[v], I;
|
|
5086
5086
|
}), setTimeout(() => {
|
|
5087
5087
|
const k = !g[v];
|
|
5088
|
-
k && u((
|
|
5089
|
-
const B = [...
|
|
5088
|
+
k && u((I) => {
|
|
5089
|
+
const B = [...I];
|
|
5090
5090
|
return B[v] = c[v], B;
|
|
5091
|
-
}), d((
|
|
5092
|
-
const B = [...
|
|
5091
|
+
}), d((I) => {
|
|
5092
|
+
const B = [...I], L = [
|
|
5093
5093
|
(k ? c[v] : a[v])._id,
|
|
5094
|
-
...a.filter((
|
|
5095
|
-
...
|
|
5094
|
+
...a.filter((O, X) => X !== v).map((O) => O._id),
|
|
5095
|
+
...I.filter((O, X) => X !== v).map((O) => O._id)
|
|
5096
5096
|
], j = C(L);
|
|
5097
5097
|
return j && (B[v] = j), B;
|
|
5098
5098
|
}), setTimeout(() => {
|
|
@@ -5259,13 +5259,13 @@ function Af({
|
|
|
5259
5259
|
renderLoading: E,
|
|
5260
5260
|
theme: v = {}
|
|
5261
5261
|
}) {
|
|
5262
|
-
const b = { ...mu, ...v }, [D, k] = H([]), [
|
|
5262
|
+
const b = { ...mu, ...v }, [D, k] = H([]), [I, B] = H(!1), [F, L] = H(null), [j, O] = H(/* @__PURE__ */ new Set()), [X, de] = H(null), [ie, oe] = H(null), [ve, pe] = H(null), [we, Se] = H(!1), [Oe, ke] = H(""), Ce = a !== void 0 ? a : Oe, Ve = (S) => {
|
|
5263
5263
|
u ? u(S) : ke(S);
|
|
5264
5264
|
}, ze = bt(() => {
|
|
5265
5265
|
if (!Ce.trim()) return D;
|
|
5266
5266
|
const S = Ce.toLowerCase();
|
|
5267
5267
|
return D.filter(
|
|
5268
|
-
(
|
|
5268
|
+
($) => _r($.from).toLowerCase().includes(S) || _r($.subject).toLowerCase().includes(S)
|
|
5269
5269
|
);
|
|
5270
5270
|
}, [D, Ce]), ge = bt(() => e ? new uu({ baseUrl: r, system_id: e }) : null, [r, e]), Me = re(async () => {
|
|
5271
5271
|
if (ge) {
|
|
@@ -5274,85 +5274,85 @@ function Af({
|
|
|
5274
5274
|
const S = await ge.listEmails(t, n, s);
|
|
5275
5275
|
S != null && S.messages && (k(S.messages), y == null || y(S.messages));
|
|
5276
5276
|
} catch (S) {
|
|
5277
|
-
const
|
|
5278
|
-
L(
|
|
5277
|
+
const $ = S instanceof Error ? S : new Error("Failed to fetch emails");
|
|
5278
|
+
L($.message), m == null || m($);
|
|
5279
5279
|
}
|
|
5280
5280
|
B(!1);
|
|
5281
5281
|
}
|
|
5282
5282
|
}, [ge, t, n, s, m, y]);
|
|
5283
5283
|
De(() => {
|
|
5284
|
-
k([]),
|
|
5284
|
+
k([]), O(/* @__PURE__ */ new Set()), oe(null), L(null), a === void 0 && ke(""), d && Me();
|
|
5285
5285
|
}, [s, d]);
|
|
5286
5286
|
const ct = re(async (S) => {
|
|
5287
5287
|
if (ge) {
|
|
5288
5288
|
oe(S), pe(null), Se(!0);
|
|
5289
5289
|
try {
|
|
5290
|
-
const
|
|
5291
|
-
|
|
5292
|
-
} catch (
|
|
5293
|
-
console.error("Failed to fetch email body:",
|
|
5290
|
+
const $ = await ge.getEmailParsed(t, S.uid, s || "INBOX");
|
|
5291
|
+
$ != null && $.body && pe($.body);
|
|
5292
|
+
} catch ($) {
|
|
5293
|
+
console.error("Failed to fetch email body:", $);
|
|
5294
5294
|
}
|
|
5295
5295
|
Se(!1);
|
|
5296
5296
|
}
|
|
5297
5297
|
}, [ge, t, s]), Ct = re((S) => {
|
|
5298
5298
|
f == null || f(S), i && ct(S);
|
|
5299
|
-
}, [f, i, ct]), qt = re((S,
|
|
5299
|
+
}, [f, i, ct]), qt = re((S, $, K) => {
|
|
5300
5300
|
if (!o) {
|
|
5301
5301
|
f == null || f(S), i && ct(S);
|
|
5302
5302
|
return;
|
|
5303
5303
|
}
|
|
5304
|
-
const
|
|
5305
|
-
if (K.shiftKey &&
|
|
5306
|
-
const ee = Math.min(
|
|
5307
|
-
|
|
5304
|
+
const Y = S.uid;
|
|
5305
|
+
if (K.shiftKey && X !== null) {
|
|
5306
|
+
const ee = Math.min(X, $), ae = Math.max(X, $), ne = D.slice(ee, ae + 1).map((Ae) => Ae.uid), te = new Set(ne);
|
|
5307
|
+
O(te), h == null || h(Array.from(te));
|
|
5308
5308
|
} else if (K.ctrlKey || K.metaKey)
|
|
5309
|
-
|
|
5309
|
+
O((ee) => {
|
|
5310
5310
|
const ae = new Set(ee);
|
|
5311
|
-
return ae.has(
|
|
5312
|
-
}), de(
|
|
5311
|
+
return ae.has(Y) ? ae.delete(Y) : ae.add(Y), h == null || h(Array.from(ae)), ae;
|
|
5312
|
+
}), de($);
|
|
5313
5313
|
else {
|
|
5314
|
-
const ee = /* @__PURE__ */ new Set([
|
|
5315
|
-
|
|
5314
|
+
const ee = /* @__PURE__ */ new Set([Y]);
|
|
5315
|
+
O(ee), de($), h == null || h(Array.from(ee));
|
|
5316
5316
|
}
|
|
5317
|
-
}, [o,
|
|
5317
|
+
}, [o, X, D, j, f, h, i]), it = re(async () => {
|
|
5318
5318
|
if (!ge || j.size === 0) return;
|
|
5319
5319
|
const S = s || "INBOX";
|
|
5320
5320
|
try {
|
|
5321
|
-
const
|
|
5322
|
-
if (console.log("Trash result:",
|
|
5323
|
-
k((
|
|
5321
|
+
const $ = await ge.trashEmails(t, Array.from(j), S);
|
|
5322
|
+
if (console.log("Trash result:", $), $.success && $.moved > 0) {
|
|
5323
|
+
k((Y) => Y.filter((ee) => !j.has(ee.uid)));
|
|
5324
5324
|
const K = Array.from(j);
|
|
5325
|
-
|
|
5325
|
+
O(/* @__PURE__ */ new Set()), g == null || g(K);
|
|
5326
5326
|
} else
|
|
5327
5327
|
L("Failed to move emails to trash");
|
|
5328
|
-
} catch (
|
|
5329
|
-
const K =
|
|
5328
|
+
} catch ($) {
|
|
5329
|
+
const K = $ instanceof Error ? $ : new Error("Trash failed");
|
|
5330
5330
|
console.error("Trash error:", K), L(K.message), m == null || m(K);
|
|
5331
5331
|
}
|
|
5332
5332
|
}, [ge, t, j, s, g, m]), ot = re(async () => {
|
|
5333
5333
|
if (!ge || j.size === 0) return;
|
|
5334
5334
|
const S = s || "INBOX";
|
|
5335
5335
|
try {
|
|
5336
|
-
const
|
|
5337
|
-
if (console.log("Archive result:",
|
|
5338
|
-
k((
|
|
5336
|
+
const $ = await ge.archiveEmails(t, Array.from(j), S);
|
|
5337
|
+
if (console.log("Archive result:", $), $.success && $.archived > 0) {
|
|
5338
|
+
k((Y) => Y.filter((ee) => !j.has(ee.uid)));
|
|
5339
5339
|
const K = Array.from(j);
|
|
5340
|
-
|
|
5340
|
+
O(/* @__PURE__ */ new Set()), g == null || g(K);
|
|
5341
5341
|
} else
|
|
5342
5342
|
L("Failed to archive emails");
|
|
5343
|
-
} catch (
|
|
5344
|
-
const K =
|
|
5343
|
+
} catch ($) {
|
|
5344
|
+
const K = $ instanceof Error ? $ : new Error("Archive failed");
|
|
5345
5345
|
console.error("Archive error:", K), L(K.message), m == null || m(K);
|
|
5346
5346
|
}
|
|
5347
5347
|
}, [ge, t, j, s, g, m]), dt = re(() => {
|
|
5348
5348
|
if (j.size === D.length)
|
|
5349
|
-
|
|
5349
|
+
O(/* @__PURE__ */ new Set()), h == null || h([]);
|
|
5350
5350
|
else {
|
|
5351
|
-
const S = new Set(D.map((
|
|
5352
|
-
|
|
5351
|
+
const S = new Set(D.map(($) => $.uid));
|
|
5352
|
+
O(S), h == null || h(Array.from(S));
|
|
5353
5353
|
}
|
|
5354
5354
|
}, [D, j.size, h]), Ut = re(() => {
|
|
5355
|
-
|
|
5355
|
+
O(/* @__PURE__ */ new Set()), h == null || h([]);
|
|
5356
5356
|
}, [h]), Wt = {
|
|
5357
5357
|
delete: it,
|
|
5358
5358
|
archive: ot,
|
|
@@ -5361,11 +5361,11 @@ function Af({
|
|
|
5361
5361
|
clearSelection: Ut
|
|
5362
5362
|
}, Dt = (S) => {
|
|
5363
5363
|
if (!S) return "";
|
|
5364
|
-
const
|
|
5365
|
-
return
|
|
5366
|
-
}, ft = (S,
|
|
5364
|
+
const $ = new Date(S), K = /* @__PURE__ */ new Date();
|
|
5365
|
+
return $.toDateString() === K.toDateString() ? $.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : $.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
5366
|
+
}, ft = (S, $) => /* @__PURE__ */ p.jsx("div", { style: {
|
|
5367
5367
|
padding: "12px 16px",
|
|
5368
|
-
background:
|
|
5368
|
+
background: $ ? b.selectedBackground : S.seen ? b.cardBackground : b.unreadBackground,
|
|
5369
5369
|
borderBottom: `1px solid ${b.border}`,
|
|
5370
5370
|
cursor: "pointer",
|
|
5371
5371
|
transition: "background 0.15s ease"
|
|
@@ -5409,7 +5409,7 @@ function Af({
|
|
|
5409
5409
|
dangerouslySetInnerHTML: { __html: ve }
|
|
5410
5410
|
}
|
|
5411
5411
|
) : /* @__PURE__ */ p.jsx("div", { style: { fontSize: "14px", color: b.textSecondary }, children: "No content available" })
|
|
5412
|
-
] }), At = (S,
|
|
5412
|
+
] }), At = (S, $) => /* @__PURE__ */ p.jsxs("div", { style: {
|
|
5413
5413
|
display: "flex",
|
|
5414
5414
|
alignItems: "center",
|
|
5415
5415
|
gap: "8px",
|
|
@@ -5420,7 +5420,7 @@ function Af({
|
|
|
5420
5420
|
/* @__PURE__ */ p.jsx(
|
|
5421
5421
|
"button",
|
|
5422
5422
|
{
|
|
5423
|
-
onClick:
|
|
5423
|
+
onClick: $.selectAll,
|
|
5424
5424
|
style: {
|
|
5425
5425
|
padding: "6px 12px",
|
|
5426
5426
|
background: "transparent",
|
|
@@ -5441,7 +5441,7 @@ function Af({
|
|
|
5441
5441
|
/* @__PURE__ */ p.jsx(
|
|
5442
5442
|
"button",
|
|
5443
5443
|
{
|
|
5444
|
-
onClick:
|
|
5444
|
+
onClick: $.archive,
|
|
5445
5445
|
title: "Archive",
|
|
5446
5446
|
style: {
|
|
5447
5447
|
display: "flex",
|
|
@@ -5461,7 +5461,7 @@ function Af({
|
|
|
5461
5461
|
/* @__PURE__ */ p.jsx(
|
|
5462
5462
|
"button",
|
|
5463
5463
|
{
|
|
5464
|
-
onClick:
|
|
5464
|
+
onClick: $.delete,
|
|
5465
5465
|
title: "Delete",
|
|
5466
5466
|
style: {
|
|
5467
5467
|
display: "flex",
|
|
@@ -5483,7 +5483,7 @@ function Af({
|
|
|
5483
5483
|
/* @__PURE__ */ p.jsx(
|
|
5484
5484
|
"button",
|
|
5485
5485
|
{
|
|
5486
|
-
onClick:
|
|
5486
|
+
onClick: $.refresh,
|
|
5487
5487
|
title: "Refresh",
|
|
5488
5488
|
style: {
|
|
5489
5489
|
display: "flex",
|
|
@@ -5508,8 +5508,8 @@ function Af({
|
|
|
5508
5508
|
padding: "48px",
|
|
5509
5509
|
textAlign: "center",
|
|
5510
5510
|
color: b.textSecondary
|
|
5511
|
-
}, children: "Loading..." }),
|
|
5512
|
-
return
|
|
5511
|
+
}, children: "Loading..." }), qe = C || ft, R = x || ht, T = A || At, Q = w || W, J = E || be;
|
|
5512
|
+
return I && D.length === 0 ? /* @__PURE__ */ p.jsx("div", { style: { background: b.background, width: "100%", height: "100%" }, children: J() }) : /* @__PURE__ */ p.jsxs("div", { style: { display: "flex", background: b.background, width: "100%", height: "100%" }, children: [
|
|
5513
5513
|
/* @__PURE__ */ p.jsxs("div", { style: {
|
|
5514
5514
|
flex: i && ie ? "0 0 50%" : "1",
|
|
5515
5515
|
display: "flex",
|
|
@@ -5540,7 +5540,7 @@ function Af({
|
|
|
5540
5540
|
type: "text",
|
|
5541
5541
|
placeholder: "Search by email or subject...",
|
|
5542
5542
|
value: Ce,
|
|
5543
|
-
onChange: (S) =>
|
|
5543
|
+
onChange: (S) => Ve(S.target.value),
|
|
5544
5544
|
style: {
|
|
5545
5545
|
flex: 1,
|
|
5546
5546
|
border: "none",
|
|
@@ -5554,7 +5554,7 @@ function Af({
|
|
|
5554
5554
|
Ce && /* @__PURE__ */ p.jsx(
|
|
5555
5555
|
"button",
|
|
5556
5556
|
{
|
|
5557
|
-
onClick: () =>
|
|
5557
|
+
onClick: () => Ve(""),
|
|
5558
5558
|
style: {
|
|
5559
5559
|
border: "none",
|
|
5560
5560
|
background: "transparent",
|
|
@@ -5575,17 +5575,17 @@ function Af({
|
|
|
5575
5575
|
fontSize: "14px",
|
|
5576
5576
|
borderBottom: `1px solid ${b.border}`
|
|
5577
5577
|
}, children: F }),
|
|
5578
|
-
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ze.length === 0 ?
|
|
5578
|
+
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: ze.length === 0 ? Q() : ze.map((S, $) => /* @__PURE__ */ p.jsx(
|
|
5579
5579
|
"div",
|
|
5580
5580
|
{
|
|
5581
|
-
onClick: (K) => qt(S,
|
|
5581
|
+
onClick: (K) => qt(S, $, K),
|
|
5582
5582
|
onDoubleClick: () => Ct(S),
|
|
5583
|
-
children:
|
|
5583
|
+
children: qe(S, j.has(S.uid))
|
|
5584
5584
|
},
|
|
5585
5585
|
S.uid
|
|
5586
5586
|
)) })
|
|
5587
5587
|
] }),
|
|
5588
|
-
i && ie && /* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children:
|
|
5588
|
+
i && ie && /* @__PURE__ */ p.jsx("div", { style: { flex: 1, overflowY: "auto" }, children: R(ie) })
|
|
5589
5589
|
] });
|
|
5590
5590
|
}
|
|
5591
5591
|
function Ef({
|
|
@@ -5622,7 +5622,7 @@ function Ef({
|
|
|
5622
5622
|
}, [h, d, n]), A = re((w) => {
|
|
5623
5623
|
s == null || s(w, h, g);
|
|
5624
5624
|
}, [s, h, g]);
|
|
5625
|
-
return
|
|
5625
|
+
return Je.useEffect(() => {
|
|
5626
5626
|
h.length === 0 ? f(-1) : d >= h.length ? f(h.length - 1) : d < 0 && h.length > 0 && (f(0), n == null || n(h[0], 0));
|
|
5627
5627
|
}, [h.length, d, n]), r.length === 0 ? /* @__PURE__ */ p.jsx("div", { className: `text-sm text-neutral-400 text-center py-4 ${a}`, children: i }) : /* @__PURE__ */ p.jsxs("div", { className: `space-y-2 ${a}`, children: [
|
|
5628
5628
|
/* @__PURE__ */ p.jsxs("div", { className: "flex items-center justify-between text-xs text-neutral-500", children: [
|
|
@@ -5732,7 +5732,7 @@ const fi = {}, _u = {}, hl = {}, or = {}, Er = {}, ln = {}, Sr = {}, os = {}, Ws
|
|
|
5732
5732
|
function Ju(r) {
|
|
5733
5733
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
5734
5734
|
}
|
|
5735
|
-
var
|
|
5735
|
+
var z = Ju(function(r) {
|
|
5736
5736
|
const e = new URLSearchParams();
|
|
5737
5737
|
e.append("code", r);
|
|
5738
5738
|
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
|
|
@@ -5760,7 +5760,7 @@ function Xu(r, e, t) {
|
|
|
5760
5760
|
i !== null && Ti(e, i, s, o, !1);
|
|
5761
5761
|
}
|
|
5762
5762
|
function Zu(r, e, t) {
|
|
5763
|
-
if (
|
|
5763
|
+
if (M(r)) {
|
|
5764
5764
|
const n = r.anchor.getNode();
|
|
5765
5765
|
if (n.is(t) && r.format !== n.getFormat()) return !1;
|
|
5766
5766
|
}
|
|
@@ -5770,7 +5770,7 @@ function ec(r, e, t, n) {
|
|
|
5770
5770
|
for (let s = r; s && !hc(s); s = xn(s)) {
|
|
5771
5771
|
const o = ds(s, e);
|
|
5772
5772
|
if (o !== void 0) {
|
|
5773
|
-
const i =
|
|
5773
|
+
const i = Ke(o, t);
|
|
5774
5774
|
if (i) return me(i) ? void 0 : [s, i];
|
|
5775
5775
|
} else if (s === n) return [n, Rl(t)];
|
|
5776
5776
|
}
|
|
@@ -5791,7 +5791,7 @@ function kl(r, e, t) {
|
|
|
5791
5791
|
const h = e[f], g = h.type, m = h.target, y = ec(m, r, l, i);
|
|
5792
5792
|
if (!y) continue;
|
|
5793
5793
|
const [C, x] = y;
|
|
5794
|
-
if (g === "characterData") n &&
|
|
5794
|
+
if (g === "characterData") n && q(x) && Zu(s, m, x) && Xu(m, x, r);
|
|
5795
5795
|
else if (g === "childList") {
|
|
5796
5796
|
u = !0;
|
|
5797
5797
|
const A = h.addedNodes;
|
|
@@ -5799,8 +5799,8 @@ function kl(r, e, t) {
|
|
|
5799
5799
|
const b = A[v], D = Ll(b), k = b.parentNode;
|
|
5800
5800
|
if (k != null && b !== a && D === null && !Ns(b, k, r)) {
|
|
5801
5801
|
if (Yt) {
|
|
5802
|
-
const
|
|
5803
|
-
|
|
5802
|
+
const I = b.innerText || b.nodeValue;
|
|
5803
|
+
I && (c += I);
|
|
5804
5804
|
}
|
|
5805
5805
|
k.removeChild(b);
|
|
5806
5806
|
}
|
|
@@ -5856,7 +5856,7 @@ function Zi(r, e) {
|
|
|
5856
5856
|
function eo(r) {
|
|
5857
5857
|
let e, t, n = r;
|
|
5858
5858
|
if (n.__text !== "" || !n.isSimpleText() || n.isUnmergeable()) {
|
|
5859
|
-
for (; (e = n.getPreviousSibling()) !== null &&
|
|
5859
|
+
for (; (e = n.getPreviousSibling()) !== null && q(e) && e.isSimpleText() && !e.isUnmergeable(); ) {
|
|
5860
5860
|
if (e.__text !== "") {
|
|
5861
5861
|
if (Xi(e, n)) {
|
|
5862
5862
|
n = Zi(e, n);
|
|
@@ -5866,7 +5866,7 @@ function eo(r) {
|
|
|
5866
5866
|
}
|
|
5867
5867
|
e.remove();
|
|
5868
5868
|
}
|
|
5869
|
-
for (; (t = n.getNextSibling()) !== null &&
|
|
5869
|
+
for (; (t = n.getNextSibling()) !== null && q(t) && t.isSimpleText() && !t.isUnmergeable(); ) {
|
|
5870
5870
|
if (t.__text !== "") {
|
|
5871
5871
|
if (Xi(n, t)) {
|
|
5872
5872
|
n = Zi(n, t);
|
|
@@ -5885,7 +5885,7 @@ function to(r) {
|
|
|
5885
5885
|
for (; r.type === "element"; ) {
|
|
5886
5886
|
const e = r.getNode(), t = r.offset;
|
|
5887
5887
|
let n, s;
|
|
5888
|
-
if (t === e.getChildrenSize() ? (n = e.getChildAtIndex(t - 1), s = !0) : (n = e.getChildAtIndex(t), s = !1),
|
|
5888
|
+
if (t === e.getChildrenSize() ? (n = e.getChildAtIndex(t - 1), s = !0) : (n = e.getChildAtIndex(t), s = !1), q(n)) {
|
|
5889
5889
|
r.set(n.__key, s ? n.getTextContentSize() : 0, "text");
|
|
5890
5890
|
break;
|
|
5891
5891
|
}
|
|
@@ -5947,7 +5947,7 @@ function Vn(r, e, t) {
|
|
|
5947
5947
|
return e === "subscript" ? s &= -65 : e === "superscript" && (s &= -33), s;
|
|
5948
5948
|
}
|
|
5949
5949
|
function jl(r) {
|
|
5950
|
-
return
|
|
5950
|
+
return q(r) || ar(r) || me(r);
|
|
5951
5951
|
}
|
|
5952
5952
|
function sc(r, e) {
|
|
5953
5953
|
if (e != null) return void (r.__key = e);
|
|
@@ -6001,16 +6001,16 @@ function Kn(r) {
|
|
|
6001
6001
|
const l = e.__key;
|
|
6002
6002
|
s._dirtyType = Al, N(r) ? i.set(l, !0) : s._dirtyLeaves.add(l);
|
|
6003
6003
|
}
|
|
6004
|
-
function
|
|
6004
|
+
function Ge(r) {
|
|
6005
6005
|
et();
|
|
6006
6006
|
const e = Be(), t = e._compositionKey;
|
|
6007
6007
|
if (r !== t) {
|
|
6008
6008
|
if (e._compositionKey = r, t !== null) {
|
|
6009
|
-
const n =
|
|
6009
|
+
const n = Ke(t);
|
|
6010
6010
|
n !== null && n.getWritable();
|
|
6011
6011
|
}
|
|
6012
6012
|
if (r !== null) {
|
|
6013
|
-
const n =
|
|
6013
|
+
const n = Ke(r);
|
|
6014
6014
|
n !== null && n.getWritable();
|
|
6015
6015
|
}
|
|
6016
6016
|
}
|
|
@@ -6018,13 +6018,13 @@ function We(r) {
|
|
|
6018
6018
|
function Ht() {
|
|
6019
6019
|
return Cn() ? null : Be()._compositionKey;
|
|
6020
6020
|
}
|
|
6021
|
-
function
|
|
6021
|
+
function Ke(r, e) {
|
|
6022
6022
|
const t = (e || $t())._nodeMap.get(r);
|
|
6023
6023
|
return t === void 0 ? null : t;
|
|
6024
6024
|
}
|
|
6025
6025
|
function Ll(r, e) {
|
|
6026
6026
|
const t = ds(r, Be());
|
|
6027
|
-
return t !== void 0 ?
|
|
6027
|
+
return t !== void 0 ? Ke(t, e) : null;
|
|
6028
6028
|
}
|
|
6029
6029
|
function ds(r, e) {
|
|
6030
6030
|
return r[`__lexicalKey_${e._key}`];
|
|
@@ -6066,7 +6066,7 @@ function Dr(r) {
|
|
|
6066
6066
|
}
|
|
6067
6067
|
return null;
|
|
6068
6068
|
}(r, e);
|
|
6069
|
-
return t === null ? r === e.getRootElement() ?
|
|
6069
|
+
return t === null ? r === e.getRootElement() ? Ke("root") : null : Ke(t);
|
|
6070
6070
|
}
|
|
6071
6071
|
function no(r, e) {
|
|
6072
6072
|
return e ? r.getTextContentSize() : 0;
|
|
@@ -6094,7 +6094,7 @@ function ki(r, e, t) {
|
|
|
6094
6094
|
if (s !== null) {
|
|
6095
6095
|
let l = Il(s);
|
|
6096
6096
|
const a = Nr(s);
|
|
6097
|
-
if (l !== null &&
|
|
6097
|
+
if (l !== null && q(a)) {
|
|
6098
6098
|
if (l === us && t) {
|
|
6099
6099
|
const u = t.length;
|
|
6100
6100
|
l = t, o = u, i = u;
|
|
@@ -6112,7 +6112,7 @@ function Ti(r, e, t, n, s) {
|
|
|
6112
6112
|
const a = o.getTextContent();
|
|
6113
6113
|
if (s || l !== a) {
|
|
6114
6114
|
if (l === "") {
|
|
6115
|
-
if (
|
|
6115
|
+
if (Ge(null), as || gn || mi) o.remove();
|
|
6116
6116
|
else {
|
|
6117
6117
|
const m = Be();
|
|
6118
6118
|
setTimeout(() => {
|
|
@@ -6124,9 +6124,9 @@ function Ti(r, e, t, n, s) {
|
|
|
6124
6124
|
return;
|
|
6125
6125
|
}
|
|
6126
6126
|
const u = o.getParent(), c = wn(), d = o.getTextContentSize(), f = Ht(), h = o.getKey();
|
|
6127
|
-
if (o.isToken() || f !== null && h === f && !i ||
|
|
6127
|
+
if (o.isToken() || f !== null && h === f && !i || M(c) && (u !== null && !u.canInsertTextBefore() && c.anchor.offset === 0 || c.anchor.key === r.__key && c.anchor.offset === 0 && !o.canInsertTextBefore() && !i || c.focus.key === r.__key && c.focus.offset === d && !o.canInsertTextAfter() && !i)) return void o.markDirty();
|
|
6128
6128
|
const g = V();
|
|
6129
|
-
if (!
|
|
6129
|
+
if (!M(g) || t === null || n === null) return void o.setTextContent(l);
|
|
6130
6130
|
if (g.setTextNodeRange(o, t, o, n), o.isSegmented()) {
|
|
6131
6131
|
const m = Pe(o.getTextContent());
|
|
6132
6132
|
o.replace(m), o = m;
|
|
@@ -6141,7 +6141,7 @@ function ic(r, e) {
|
|
|
6141
6141
|
const t = r.anchor.offset, n = e.getParentOrThrow(), s = e.isToken();
|
|
6142
6142
|
return t === 0 ? !e.canInsertTextBefore() || !n.canInsertTextBefore() && !e.isComposing() || s || function(o) {
|
|
6143
6143
|
const i = o.getPreviousSibling();
|
|
6144
|
-
return (
|
|
6144
|
+
return (q(i) || N(i) && i.isInline()) && !i.canInsertTextAfter();
|
|
6145
6145
|
}(e) : t === e.getTextContentSize() && (!e.canInsertTextAfter() || !n.canInsertTextAfter() && !e.isComposing() || s);
|
|
6146
6146
|
}
|
|
6147
6147
|
function so(r) {
|
|
@@ -6183,7 +6183,7 @@ function en(r, e) {
|
|
|
6183
6183
|
function Bi(r, e, t, n, s) {
|
|
6184
6184
|
if (t.size === 0) return;
|
|
6185
6185
|
const o = n.__type, i = n.__key, l = e.get(o);
|
|
6186
|
-
l === void 0 &&
|
|
6186
|
+
l === void 0 && z(33, o);
|
|
6187
6187
|
const a = l.klass;
|
|
6188
6188
|
let u = r.get(a);
|
|
6189
6189
|
u === void 0 && (u = /* @__PURE__ */ new Map(), r.set(a, u));
|
|
@@ -6216,11 +6216,11 @@ function U(r, e, t) {
|
|
|
6216
6216
|
return ca(r, e, t);
|
|
6217
6217
|
}
|
|
6218
6218
|
function fs(r) {
|
|
6219
|
-
return !
|
|
6219
|
+
return !Ye(r) && !r.isLastChild() && !r.isInline();
|
|
6220
6220
|
}
|
|
6221
6221
|
function Hn(r, e) {
|
|
6222
6222
|
const t = r._keyToDOMMap.get(e);
|
|
6223
|
-
return t === void 0 &&
|
|
6223
|
+
return t === void 0 && z(75, e), t;
|
|
6224
6224
|
}
|
|
6225
6225
|
function xn(r) {
|
|
6226
6226
|
const e = r.assignedSlot || r.parentElement;
|
|
@@ -6236,7 +6236,7 @@ function tn(r, e) {
|
|
|
6236
6236
|
}
|
|
6237
6237
|
function hs(r) {
|
|
6238
6238
|
const e = r._window;
|
|
6239
|
-
return e === null &&
|
|
6239
|
+
return e === null && z(78), e;
|
|
6240
6240
|
}
|
|
6241
6241
|
function lc(r) {
|
|
6242
6242
|
let e = r.getParentOrThrow();
|
|
@@ -6247,20 +6247,20 @@ function lc(r) {
|
|
|
6247
6247
|
return e;
|
|
6248
6248
|
}
|
|
6249
6249
|
function Ft(r) {
|
|
6250
|
-
return
|
|
6250
|
+
return Ye(r) || N(r) && r.isShadowRoot();
|
|
6251
6251
|
}
|
|
6252
6252
|
function Lt(r) {
|
|
6253
6253
|
const e = Be(), t = r.constructor.getType(), n = e._nodes.get(t);
|
|
6254
|
-
n === void 0 &&
|
|
6254
|
+
n === void 0 && z(200, r.constructor.name, t);
|
|
6255
6255
|
const { replace: s, replaceWithKlass: o } = n;
|
|
6256
6256
|
if (s !== null) {
|
|
6257
6257
|
const i = s(r), l = i.constructor;
|
|
6258
|
-
return o !== null ? i instanceof o ||
|
|
6258
|
+
return o !== null ? i instanceof o || z(201, o.name, o.getType(), l.name, l.getType(), r.constructor.name, t) : i instanceof r.constructor && l !== r.constructor || z(202, l.name, l.getType(), r.constructor.name, t), i.__key === r.__key && z(203, r.constructor.name, t, l.name, l.getType()), i;
|
|
6259
6259
|
}
|
|
6260
6260
|
return r;
|
|
6261
6261
|
}
|
|
6262
6262
|
function Fs(r, e) {
|
|
6263
|
-
!
|
|
6263
|
+
!Ye(r.getParent()) || N(e) || me(e) || z(99);
|
|
6264
6264
|
}
|
|
6265
6265
|
function js(r) {
|
|
6266
6266
|
return (me(r) || N(r) && !r.canBeEmpty()) && !r.isInline();
|
|
@@ -6272,7 +6272,7 @@ function Ni(r, e, t) {
|
|
|
6272
6272
|
}
|
|
6273
6273
|
function ac(r, e, t) {
|
|
6274
6274
|
let n = r._blockCursorElement;
|
|
6275
|
-
if (
|
|
6275
|
+
if (M(t) && t.isCollapsed() && t.anchor.type === "element" && e.contains(document.activeElement)) {
|
|
6276
6276
|
const s = t.anchor, o = s.getNode(), i = s.offset;
|
|
6277
6277
|
let l = !1, a = null;
|
|
6278
6278
|
if (i === o.getChildrenSize())
|
|
@@ -6326,7 +6326,7 @@ function Jn(r) {
|
|
|
6326
6326
|
function Vt(r) {
|
|
6327
6327
|
if (me(r) && !r.isInline()) return !0;
|
|
6328
6328
|
if (!N(r) || Ft(r)) return !1;
|
|
6329
|
-
const e = r.getFirstChild(), t = e === null || ar(e) ||
|
|
6329
|
+
const e = r.getFirstChild(), t = e === null || ar(e) || q(e) || e.isInline();
|
|
6330
6330
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
6331
6331
|
}
|
|
6332
6332
|
function Wr(r, e) {
|
|
@@ -6340,7 +6340,7 @@ function cc() {
|
|
|
6340
6340
|
const co = /* @__PURE__ */ new WeakMap(), dc = /* @__PURE__ */ new Map();
|
|
6341
6341
|
function fc(r) {
|
|
6342
6342
|
if (!r._readOnly && r.isEmpty()) return dc;
|
|
6343
|
-
r._readOnly ||
|
|
6343
|
+
r._readOnly || z(192);
|
|
6344
6344
|
let e = co.get(r);
|
|
6345
6345
|
if (!e) {
|
|
6346
6346
|
e = /* @__PURE__ */ new Map(), co.set(r, e);
|
|
@@ -6370,14 +6370,14 @@ function zl(r, e, t, n, s, o) {
|
|
|
6370
6370
|
i.__parent === e && (N(i) && zl(i, l, t, n, s, o), t.has(l) || o.delete(l), s.push(l)), i = i.getNextSibling();
|
|
6371
6371
|
}
|
|
6372
6372
|
}
|
|
6373
|
-
let Xt,
|
|
6373
|
+
let Xt, Xe, dn, ps, Hs, Js, dr, _t, Qs, fn, Re = "", Qe = "", St = null, mt = "", Ot = "", ql = !1, hn = !1, Rn = null;
|
|
6374
6374
|
function Qn(r, e) {
|
|
6375
6375
|
const t = dr.get(r);
|
|
6376
6376
|
if (e !== null) {
|
|
6377
6377
|
const n = Zs(r);
|
|
6378
6378
|
n.parentNode === e && e.removeChild(n);
|
|
6379
6379
|
}
|
|
6380
|
-
if (_t.has(r) ||
|
|
6380
|
+
if (_t.has(r) || Xe._keyToDOMMap.delete(r), N(t)) {
|
|
6381
6381
|
const n = Xn(t, dr);
|
|
6382
6382
|
Ys(n, 0, n.length - 1, null);
|
|
6383
6383
|
}
|
|
@@ -6409,20 +6409,20 @@ function Wl(r, e) {
|
|
|
6409
6409
|
}
|
|
6410
6410
|
function Yn(r, e) {
|
|
6411
6411
|
const t = _t.get(r);
|
|
6412
|
-
t === void 0 &&
|
|
6413
|
-
const n = t.createDOM(Xt,
|
|
6412
|
+
t === void 0 && z(60);
|
|
6413
|
+
const n = t.createDOM(Xt, Xe);
|
|
6414
6414
|
if (function(s, o, i) {
|
|
6415
6415
|
const l = i._keyToDOMMap;
|
|
6416
6416
|
(function(a, u, c) {
|
|
6417
6417
|
a[`__lexicalKey_${u._key}`] = c;
|
|
6418
6418
|
})(o, i, s), l.set(s, o);
|
|
6419
|
-
}(r, n,
|
|
6419
|
+
}(r, n, Xe), q(t) ? n.setAttribute("data-lexical-text", "true") : me(t) && n.setAttribute("data-lexical-decorator", "true"), N(t)) {
|
|
6420
6420
|
const s = t.__indent, o = t.__size;
|
|
6421
6421
|
if (s !== 0 && Ul(n, s), o !== 0) {
|
|
6422
6422
|
const l = o - 1;
|
|
6423
6423
|
(function(a, u, c, d) {
|
|
6424
|
-
const f =
|
|
6425
|
-
|
|
6424
|
+
const f = Qe;
|
|
6425
|
+
Qe = "", Xs(a, c, 0, u, c.getDOMSlot(d)), Vl(c, d), Qe = f;
|
|
6426
6426
|
})(Xn(t, _t), l, t, n);
|
|
6427
6427
|
}
|
|
6428
6428
|
const i = t.__format;
|
|
@@ -6430,9 +6430,9 @@ function Yn(r, e) {
|
|
|
6430
6430
|
} else {
|
|
6431
6431
|
const s = t.getTextContent();
|
|
6432
6432
|
if (me(t)) {
|
|
6433
|
-
const o = t.decorate(
|
|
6433
|
+
const o = t.decorate(Xe, Xt);
|
|
6434
6434
|
o !== null && Kl(r, o), n.contentEditable = "false";
|
|
6435
|
-
} else
|
|
6435
|
+
} else q(t) && (t.isDirectionless() || (Qe += s));
|
|
6436
6436
|
Re += s, Ot += s;
|
|
6437
6437
|
}
|
|
6438
6438
|
return e !== null && e.insertChild(n), Bi(fn, dn, ps, t, "created"), n;
|
|
@@ -6444,7 +6444,7 @@ function Xs(r, e, t, n, s) {
|
|
|
6444
6444
|
for (; i <= n; ++i) {
|
|
6445
6445
|
Yn(r[i], s);
|
|
6446
6446
|
const l = _t.get(r[i]);
|
|
6447
|
-
l !== null &&
|
|
6447
|
+
l !== null && q(l) && (St === null && (St = l.getFormat()), mt === "" && (mt = l.getStyle()));
|
|
6448
6448
|
}
|
|
6449
6449
|
fs(e) && (Re += Mt), s.element.__lexicalTextContent = Re, Re = o + Re;
|
|
6450
6450
|
}
|
|
@@ -6465,8 +6465,8 @@ function Gl(r, e, t) {
|
|
|
6465
6465
|
}
|
|
6466
6466
|
function Vl(r, e) {
|
|
6467
6467
|
const t = e.__lexicalDirTextContent || "", n = e.__lexicalDir || "";
|
|
6468
|
-
if (t !==
|
|
6469
|
-
const o =
|
|
6468
|
+
if (t !== Qe || n !== Rn) {
|
|
6469
|
+
const o = Qe === "", i = o ? Rn : (s = Qe, Uu.test(s) ? "rtl" : Wu.test(s) ? "ltr" : null);
|
|
6470
6470
|
if (i !== n) {
|
|
6471
6471
|
const l = e.classList, a = Xt.theme;
|
|
6472
6472
|
let u = n !== null ? a[n] : void 0, c = i !== null ? a[i] : void 0;
|
|
@@ -6490,14 +6490,14 @@ function Vl(r, e) {
|
|
|
6490
6490
|
}
|
|
6491
6491
|
hn || (r.getWritable().__dir = i);
|
|
6492
6492
|
}
|
|
6493
|
-
Rn = i, e.__lexicalDirTextContent =
|
|
6493
|
+
Rn = i, e.__lexicalDirTextContent = Qe, e.__lexicalDir = i;
|
|
6494
6494
|
}
|
|
6495
6495
|
var s;
|
|
6496
6496
|
}
|
|
6497
6497
|
function gc(r, e, t) {
|
|
6498
|
-
const n =
|
|
6498
|
+
const n = Qe;
|
|
6499
6499
|
var s;
|
|
6500
|
-
|
|
6500
|
+
Qe = "", St = null, mt = "", function(o, i, l) {
|
|
6501
6501
|
const a = Re, u = o.__size, c = i.__size;
|
|
6502
6502
|
Re = "";
|
|
6503
6503
|
const d = l.element;
|
|
@@ -6518,10 +6518,10 @@ function gc(r, e, t) {
|
|
|
6518
6518
|
Qn(f, null);
|
|
6519
6519
|
}
|
|
6520
6520
|
const g = _t.get(h);
|
|
6521
|
-
|
|
6521
|
+
q(g) && (St === null && (St = g.getFormat()), mt === "" && (mt = g.getStyle()));
|
|
6522
6522
|
} else {
|
|
6523
6523
|
const f = Xn(o, dr), h = Xn(i, _t);
|
|
6524
|
-
if (f.length !== u &&
|
|
6524
|
+
if (f.length !== u && z(227), h.length !== c && z(228), u === 0) c !== 0 && Xs(h, i, 0, c - 1, l);
|
|
6525
6525
|
else if (c === 0) {
|
|
6526
6526
|
if (u !== 0) {
|
|
6527
6527
|
const g = l.after == null && l.before == null && l.element.__lexicalLineBreak == null;
|
|
@@ -6529,104 +6529,104 @@ function gc(r, e, t) {
|
|
|
6529
6529
|
}
|
|
6530
6530
|
} else (function(g, m, y, C, x, A) {
|
|
6531
6531
|
const w = C - 1, E = x - 1;
|
|
6532
|
-
let v, b, D = A.getFirstChild(), k = 0,
|
|
6533
|
-
for (; k <= w &&
|
|
6534
|
-
const L = m[k], j = y[
|
|
6535
|
-
if (L === j) D = Ls(Jr(j, A.element)), k++,
|
|
6532
|
+
let v, b, D = A.getFirstChild(), k = 0, I = 0;
|
|
6533
|
+
for (; k <= w && I <= E; ) {
|
|
6534
|
+
const L = m[k], j = y[I];
|
|
6535
|
+
if (L === j) D = Ls(Jr(j, A.element)), k++, I++;
|
|
6536
6536
|
else {
|
|
6537
6537
|
v === void 0 && (v = new Set(m)), b === void 0 && (b = new Set(y));
|
|
6538
|
-
const
|
|
6539
|
-
if (
|
|
6540
|
-
const ie = Hn(
|
|
6541
|
-
ie === D ? D = Ls(Jr(j, A.element)) : (A.withBefore(D).insertChild(ie), Jr(j, A.element)), k++,
|
|
6542
|
-
} else Yn(j, A.withBefore(D)),
|
|
6538
|
+
const X = b.has(L), de = v.has(j);
|
|
6539
|
+
if (X) if (de) {
|
|
6540
|
+
const ie = Hn(Xe, j);
|
|
6541
|
+
ie === D ? D = Ls(Jr(j, A.element)) : (A.withBefore(D).insertChild(ie), Jr(j, A.element)), k++, I++;
|
|
6542
|
+
} else Yn(j, A.withBefore(D)), I++;
|
|
6543
6543
|
else D = Ls(Zs(L)), Qn(L, A.element), k++;
|
|
6544
6544
|
}
|
|
6545
|
-
const
|
|
6546
|
-
|
|
6545
|
+
const O = _t.get(j);
|
|
6546
|
+
O !== null && q(O) && (St === null && (St = O.getFormat()), mt === "" && (mt = O.getStyle()));
|
|
6547
6547
|
}
|
|
6548
|
-
const B = k > w, F =
|
|
6548
|
+
const B = k > w, F = I > E;
|
|
6549
6549
|
if (B && !F) {
|
|
6550
|
-
const L = y[E + 1], j = L === void 0 ? null :
|
|
6551
|
-
Xs(y, g,
|
|
6550
|
+
const L = y[E + 1], j = L === void 0 ? null : Xe.getElementByKey(L);
|
|
6551
|
+
Xs(y, g, I, E, A.withBefore(j));
|
|
6552
6552
|
} else F && !B && Ys(m, k, w, A.element);
|
|
6553
6553
|
})(i, f, h, u, c, l);
|
|
6554
6554
|
}
|
|
6555
6555
|
fs(i) && (Re += Mt), d.__lexicalTextContent = Re, Re = a + Re;
|
|
6556
6556
|
}(r, e, e.getDOMSlot(t)), Vl(e, t), Fr(s = e) && St != null && St !== s.__textFormat && !hn && (s.setTextFormat(St), s.setTextStyle(mt)), function(o) {
|
|
6557
6557
|
Fr(o) && mt !== "" && mt !== o.__textStyle && !hn && o.setTextStyle(mt);
|
|
6558
|
-
}(e),
|
|
6558
|
+
}(e), Qe = n;
|
|
6559
6559
|
}
|
|
6560
6560
|
function Xn(r, e) {
|
|
6561
6561
|
const t = [];
|
|
6562
6562
|
let n = r.__first;
|
|
6563
6563
|
for (; n !== null; ) {
|
|
6564
6564
|
const s = e.get(n);
|
|
6565
|
-
s === void 0 &&
|
|
6565
|
+
s === void 0 && z(101), t.push(n), n = s.__next;
|
|
6566
6566
|
}
|
|
6567
6567
|
return t;
|
|
6568
6568
|
}
|
|
6569
6569
|
function Jr(r, e) {
|
|
6570
6570
|
const t = dr.get(r);
|
|
6571
6571
|
let n = _t.get(r);
|
|
6572
|
-
t !== void 0 && n !== void 0 ||
|
|
6573
|
-
const s = ql || Js.has(r) || Hs.has(r), o = Hn(
|
|
6572
|
+
t !== void 0 && n !== void 0 || z(61);
|
|
6573
|
+
const s = ql || Js.has(r) || Hs.has(r), o = Hn(Xe, r);
|
|
6574
6574
|
if (t === n && !s) {
|
|
6575
6575
|
if (N(t)) {
|
|
6576
6576
|
const i = o.__lexicalTextContent;
|
|
6577
6577
|
i !== void 0 && (Re += i, Ot += i);
|
|
6578
6578
|
const l = o.__lexicalDirTextContent;
|
|
6579
|
-
l !== void 0 && (
|
|
6579
|
+
l !== void 0 && (Qe += l);
|
|
6580
6580
|
} else {
|
|
6581
6581
|
const i = t.getTextContent();
|
|
6582
|
-
|
|
6582
|
+
q(t) && !t.isDirectionless() && (Qe += i), Ot += i, Re += i;
|
|
6583
6583
|
}
|
|
6584
6584
|
return o;
|
|
6585
6585
|
}
|
|
6586
6586
|
if (t !== n && s && Bi(fn, dn, ps, n, "updated"), n.updateDOM(t, o, Xt)) {
|
|
6587
6587
|
const i = Yn(r, null);
|
|
6588
|
-
return e === null &&
|
|
6588
|
+
return e === null && z(62), e.replaceChild(i, o), Qn(r, null), i;
|
|
6589
6589
|
}
|
|
6590
6590
|
if (N(t) && N(n)) {
|
|
6591
6591
|
const i = n.__indent;
|
|
6592
6592
|
i !== t.__indent && Ul(o, i);
|
|
6593
6593
|
const l = n.__format;
|
|
6594
|
-
l !== t.__format && Wl(o, l), s && (gc(t, n, o),
|
|
6594
|
+
l !== t.__format && Wl(o, l), s && (gc(t, n, o), Ye(n) || n.isInline() || Gl(t, n, o)), fs(n) && (Re += Mt, Ot += Mt);
|
|
6595
6595
|
} else {
|
|
6596
6596
|
const i = n.getTextContent();
|
|
6597
6597
|
if (me(n)) {
|
|
6598
|
-
const l = n.decorate(
|
|
6598
|
+
const l = n.decorate(Xe, Xt);
|
|
6599
6599
|
l !== null && Kl(r, l);
|
|
6600
|
-
} else
|
|
6600
|
+
} else q(n) && !n.isDirectionless() && (Qe += i);
|
|
6601
6601
|
Re += i, Ot += i;
|
|
6602
6602
|
}
|
|
6603
|
-
if (!hn &&
|
|
6603
|
+
if (!hn && Ye(n) && n.__cachedText !== Ot) {
|
|
6604
6604
|
const i = n.getWritable();
|
|
6605
6605
|
i.__cachedText = Ot, n = i;
|
|
6606
6606
|
}
|
|
6607
6607
|
return o;
|
|
6608
6608
|
}
|
|
6609
6609
|
function Kl(r, e) {
|
|
6610
|
-
let t =
|
|
6611
|
-
const n =
|
|
6610
|
+
let t = Xe._pendingDecorators;
|
|
6611
|
+
const n = Xe._decorators;
|
|
6612
6612
|
if (t === null) {
|
|
6613
6613
|
if (n[r] === e) return;
|
|
6614
|
-
t = Pl(
|
|
6614
|
+
t = Pl(Xe);
|
|
6615
6615
|
}
|
|
6616
6616
|
t[r] = e;
|
|
6617
6617
|
}
|
|
6618
6618
|
function Ls(r) {
|
|
6619
6619
|
let e = r.nextSibling;
|
|
6620
|
-
return e !== null && e ===
|
|
6620
|
+
return e !== null && e === Xe._blockCursorElement && (e = e.nextSibling), e;
|
|
6621
6621
|
}
|
|
6622
6622
|
function mc(r, e, t, n, s, o) {
|
|
6623
|
-
Re = "", Ot = "",
|
|
6623
|
+
Re = "", Ot = "", Qe = "", ql = n === Br, Rn = null, Xe = t, Xt = t._config, dn = t._nodes, ps = Xe._listeners.mutation, Hs = s, Js = o, dr = r._nodeMap, _t = e._nodeMap, hn = e._readOnly, Qs = new Map(t._keyToDOMMap);
|
|
6624
6624
|
const i = /* @__PURE__ */ new Map();
|
|
6625
|
-
return fn = i, Jr("root", null),
|
|
6625
|
+
return fn = i, Jr("root", null), Xe = void 0, dn = void 0, Hs = void 0, Js = void 0, dr = void 0, _t = void 0, Xt = void 0, Qs = void 0, fn = void 0, i;
|
|
6626
6626
|
}
|
|
6627
6627
|
function Zs(r) {
|
|
6628
6628
|
const e = Qs.get(r);
|
|
6629
|
-
return e === void 0 &&
|
|
6629
|
+
return e === void 0 && z(75, r), e;
|
|
6630
6630
|
}
|
|
6631
6631
|
const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
6632
6632
|
if (rn = r.timeStamp, Hl = r.key, e.isComposing()) return;
|
|
@@ -6707,7 +6707,7 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6707
6707
|
}(t, n, o, s)) r.preventDefault(), U(e, pi, void 0);
|
|
6708
6708
|
else {
|
|
6709
6709
|
const l = e._editorState._selection;
|
|
6710
|
-
l === null ||
|
|
6710
|
+
l === null || M(l) ? !Yt && lo(t, o, s) && (r.preventDefault(), U(e, Gs, r)) : function(a, u, c, d) {
|
|
6711
6711
|
return !u && a.toLowerCase() === "c" && (gt ? c : d);
|
|
6712
6712
|
}(t, n, o, s) ? (r.preventDefault(), U(e, ls, r)) : function(a, u, c, d) {
|
|
6713
6713
|
return !u && a.toLowerCase() === "x" && (gt ? c : d);
|
|
@@ -6725,9 +6725,9 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6725
6725
|
}], ["compositionstart", function(r, e) {
|
|
6726
6726
|
nt(e, () => {
|
|
6727
6727
|
const t = V();
|
|
6728
|
-
if (
|
|
6728
|
+
if (M(t) && !e.isComposing()) {
|
|
6729
6729
|
const n = t.anchor, s = t.anchor.getNode();
|
|
6730
|
-
|
|
6730
|
+
Ge(n.key), (r.timeStamp < rn + ei || n.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || q(s) && s.getStyle() !== t.style) && U(e, Sr, qu);
|
|
6731
6731
|
}
|
|
6732
6732
|
});
|
|
6733
6733
|
}], ["compositionend", function(r, e) {
|
|
@@ -6737,14 +6737,14 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6737
6737
|
}], ["input", function(r, e) {
|
|
6738
6738
|
r.stopPropagation(), nt(e, () => {
|
|
6739
6739
|
const t = V(), n = r.data, s = Xl(r);
|
|
6740
|
-
if (n != null &&
|
|
6740
|
+
if (n != null && M(t) && Yl(t, s, n, r.timeStamp, !1)) {
|
|
6741
6741
|
Gr && (Ps(e, n), Gr = !1);
|
|
6742
6742
|
const o = t.anchor.getNode(), i = ut(e._window);
|
|
6743
6743
|
if (i === null) return;
|
|
6744
6744
|
const l = t.isBackward(), a = l ? t.anchor.offset : t.focus.offset, u = l ? t.focus.offset : t.anchor.offset;
|
|
6745
|
-
zn && !t.isCollapsed() &&
|
|
6745
|
+
zn && !t.isCollapsed() && q(o) && i.anchorNode !== null && o.getTextContent().slice(0, a) + n + o.getTextContent().slice(a + u) === Il(i.anchorNode) || U(e, Sr, n);
|
|
6746
6746
|
const c = n.length;
|
|
6747
|
-
Yt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), as || gn || mi || !e.isComposing() || (rn = 0,
|
|
6747
|
+
Yt && c > 1 && r.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= c), as || gn || mi || !e.isComposing() || (rn = 0, Ge(null));
|
|
6748
6748
|
} else
|
|
6749
6749
|
ki(!1, e, n !== null ? n : void 0), Gr && (Ps(e, n || void 0), Gr = !1);
|
|
6750
6750
|
et(), Tl(Be());
|
|
@@ -6753,9 +6753,9 @@ const Rt = Object.freeze({}), ei = 30, ti = [["keydown", function(r, e) {
|
|
|
6753
6753
|
nt(e, () => {
|
|
6754
6754
|
const t = V(), n = ut(e._window), s = wn();
|
|
6755
6755
|
if (n) {
|
|
6756
|
-
if (
|
|
6756
|
+
if (M(t)) {
|
|
6757
6757
|
const o = t.anchor, i = o.getNode();
|
|
6758
|
-
o.type === "element" && o.offset === 0 && t.isCollapsed() && !
|
|
6758
|
+
o.type === "element" && o.offset === 0 && t.isCollapsed() && !Ye(i) && Ee().getChildrenSize() === 1 && i.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (n.removeAllRanges(), t.dirty = !0) : r.detail === 3 && !t.isCollapsed() && i !== t.focus.getNode() && (N(i) ? i.select(0) : i.getParentOrThrow().select(0));
|
|
6759
6759
|
} else if (r.pointerType === "touch") {
|
|
6760
6760
|
const o = n.anchorNode;
|
|
6761
6761
|
if (o !== null) {
|
|
@@ -6774,22 +6774,22 @@ zn && ti.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6774
6774
|
if (s === "deleteContentBackward") {
|
|
6775
6775
|
if (i === null) {
|
|
6776
6776
|
const h = wn();
|
|
6777
|
-
if (!
|
|
6777
|
+
if (!M(h)) return;
|
|
6778
6778
|
Nt(h.clone());
|
|
6779
6779
|
}
|
|
6780
|
-
if (
|
|
6780
|
+
if (M(i)) {
|
|
6781
6781
|
const h = i.anchor.key === i.focus.key;
|
|
6782
6782
|
if (l = t.timeStamp, Hl === "MediaLast" && l < rn + ei && n.isComposing() && h) {
|
|
6783
|
-
if (
|
|
6783
|
+
if (Ge(null), rn = 0, setTimeout(() => {
|
|
6784
6784
|
nt(n, () => {
|
|
6785
|
-
|
|
6785
|
+
Ge(null);
|
|
6786
6786
|
});
|
|
6787
|
-
}, ei),
|
|
6787
|
+
}, ei), M(i)) {
|
|
6788
6788
|
const g = i.anchor.getNode();
|
|
6789
|
-
g.markDirty(), i.format = g.getFormat(),
|
|
6789
|
+
g.markDirty(), i.format = g.getFormat(), q(g) || z(142), i.style = g.getStyle();
|
|
6790
6790
|
}
|
|
6791
6791
|
} else {
|
|
6792
|
-
|
|
6792
|
+
Ge(null), t.preventDefault();
|
|
6793
6793
|
const g = i.anchor.getNode(), m = g.getTextContent(), y = g.canInsertTextAfter(), C = i.anchor.offset === 0 && i.focus.offset === m.length;
|
|
6794
6794
|
Ou && h && !C && y || U(n, or, !0);
|
|
6795
6795
|
}
|
|
@@ -6797,9 +6797,9 @@ zn && ti.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6797
6797
|
}
|
|
6798
6798
|
}
|
|
6799
6799
|
var l;
|
|
6800
|
-
if (!
|
|
6800
|
+
if (!M(i)) return;
|
|
6801
6801
|
const a = t.data;
|
|
6802
|
-
Cr !== null && ki(!1, n, Cr), i.dirty && Cr === null || !i.isCollapsed() ||
|
|
6802
|
+
Cr !== null && ki(!1, n, Cr), i.dirty && Cr === null || !i.isCollapsed() || Ye(i.anchor.getNode()) || o === null || i.applyDOMRange(o), Cr = null;
|
|
6803
6803
|
const u = i.anchor, c = i.focus, d = u.getNode(), f = c.getNode();
|
|
6804
6804
|
if (s !== "insertText" && s !== "insertTranspose") switch (t.preventDefault(), s) {
|
|
6805
6805
|
case "insertFromYank":
|
|
@@ -6808,13 +6808,13 @@ zn && ti.push(["beforeinput", (r, e) => function(t, n) {
|
|
|
6808
6808
|
U(n, Sr, t);
|
|
6809
6809
|
break;
|
|
6810
6810
|
case "insertFromComposition":
|
|
6811
|
-
|
|
6811
|
+
Ge(null), U(n, Sr, t);
|
|
6812
6812
|
break;
|
|
6813
6813
|
case "insertLineBreak":
|
|
6814
|
-
|
|
6814
|
+
Ge(null), U(n, Er, !1);
|
|
6815
6815
|
break;
|
|
6816
6816
|
case "insertParagraph":
|
|
6817
|
-
|
|
6817
|
+
Ge(null), nn && !gn ? (nn = !1, U(n, Er, !1)) : U(n, ln, void 0);
|
|
6818
6818
|
break;
|
|
6819
6819
|
case "insertFromPaste":
|
|
6820
6820
|
case "insertFromPasteAsQuotation":
|
|
@@ -6882,7 +6882,7 @@ const Zn = /* @__PURE__ */ new WeakMap();
|
|
|
6882
6882
|
let ri = !1, ni = !1, nn = !1, Gr = !1, Ql = [0, "", 0, "root", 0];
|
|
6883
6883
|
function Yl(r, e, t, n, s) {
|
|
6884
6884
|
const o = r.anchor, i = r.focus, l = o.getNode(), a = Be(), u = ut(a._window), c = u !== null ? u.anchorNode : null, d = o.key, f = a.getElementByKey(d), h = t.length;
|
|
6885
|
-
return d !== i.key || !
|
|
6885
|
+
return d !== i.key || !q(l) || (!s && (!zn || Jl < n + 50) || l.isDirty() && h < 2 || Ol(t)) && o.offset !== i.offset && !l.isComposing() || sr(l) || l.isDirty() && h > 1 || (s || !zn) && f !== null && !l.isComposing() && c !== Gn(f) || u !== null && e !== null && (!e.collapsed || e.startContainer !== u.anchorNode || e.startOffset !== u.anchorOffset) || l.getFormat() !== r.format || l.getStyle() !== r.style || ic(r, l);
|
|
6886
6886
|
}
|
|
6887
6887
|
function ho(r, e) {
|
|
6888
6888
|
return r !== null && r.nodeValue !== null && r.nodeType === Zt && e !== 0 && e !== r.nodeValue.length;
|
|
@@ -6893,13 +6893,13 @@ function po(r, e, t) {
|
|
|
6893
6893
|
if (!t) return void Nt(null);
|
|
6894
6894
|
if (!yn(e, n, o)) return;
|
|
6895
6895
|
const l = V();
|
|
6896
|
-
if (
|
|
6896
|
+
if (M(l)) {
|
|
6897
6897
|
const a = l.anchor, u = a.getNode();
|
|
6898
6898
|
if (l.isCollapsed()) {
|
|
6899
6899
|
r.type === "Range" && r.anchorNode === r.focusNode && (l.dirty = !0);
|
|
6900
6900
|
const c = hs(e).event, d = c ? c.timeStamp : performance.now(), [f, h, g, m, y] = Ql, C = Ee(), x = e.isComposing() === !1 && C.getTextContent() === "";
|
|
6901
6901
|
if (d < y + 200 && a.offset === g && a.key === m) l.format = f, l.style = h;
|
|
6902
|
-
else if (a.type === "text")
|
|
6902
|
+
else if (a.type === "text") q(u) || z(141), l.format = u.getFormat(), l.style = u.getStyle();
|
|
6903
6903
|
else if (a.type === "element" && !x) {
|
|
6904
6904
|
const A = a.getNode();
|
|
6905
6905
|
l.style = "", A instanceof Pr && A.getChildrenSize() === 0 ? (l.format = A.getTextFormat(), l.style = A.getTextStyle()) : l.format = 0;
|
|
@@ -6909,7 +6909,7 @@ function po(r, e, t) {
|
|
|
6909
6909
|
let A = zu, w = !1;
|
|
6910
6910
|
for (let E = 0; E < h; E++) {
|
|
6911
6911
|
const v = f[E], b = v.getTextContentSize();
|
|
6912
|
-
if (
|
|
6912
|
+
if (q(v) && b !== 0 && !(E === 0 && v.__key === C && m === b || E === h - 1 && v.__key === x && y === 0) && (w = !0, A &= v.getFormat(), A === 0)) break;
|
|
6913
6913
|
}
|
|
6914
6914
|
l.format = w ? A : 0;
|
|
6915
6915
|
}
|
|
@@ -6924,15 +6924,15 @@ function Xl(r) {
|
|
|
6924
6924
|
}
|
|
6925
6925
|
function Ps(r, e) {
|
|
6926
6926
|
const t = r._compositionKey;
|
|
6927
|
-
if (
|
|
6927
|
+
if (Ge(null), t !== null && e != null) {
|
|
6928
6928
|
if (e === "") {
|
|
6929
|
-
const n =
|
|
6930
|
-
return void (s !== null && s.nodeValue !== null &&
|
|
6929
|
+
const n = Ke(t), s = Gn(r.getElementByKey(t));
|
|
6930
|
+
return void (s !== null && s.nodeValue !== null && q(n) && Ti(n, s.nodeValue, null, null, !0));
|
|
6931
6931
|
}
|
|
6932
6932
|
if (e[e.length - 1] === `
|
|
6933
6933
|
`) {
|
|
6934
6934
|
const n = V();
|
|
6935
|
-
if (
|
|
6935
|
+
if (M(n)) {
|
|
6936
6936
|
const s = n.focus;
|
|
6937
6937
|
return n.anchor.set(s.key, s.offset, s.type), void U(r, $n, null);
|
|
6938
6938
|
}
|
|
@@ -6967,16 +6967,16 @@ function mo(r) {
|
|
|
6967
6967
|
}
|
|
6968
6968
|
function yc(r) {
|
|
6969
6969
|
const e = r.ownerDocument, t = Zn.get(e);
|
|
6970
|
-
t === void 0 &&
|
|
6970
|
+
t === void 0 && z(162);
|
|
6971
6971
|
const n = t - 1;
|
|
6972
|
-
n >= 0 ||
|
|
6972
|
+
n >= 0 || z(164), Zn.set(e, n), n === 0 && e.removeEventListener("selectionchange", ea);
|
|
6973
6973
|
const s = cs(r);
|
|
6974
6974
|
Ei(s) ? (function(i) {
|
|
6975
6975
|
if (i._parentEditor !== null) {
|
|
6976
6976
|
const l = Si(i), a = l[l.length - 1]._key;
|
|
6977
6977
|
kr.get(a) === i && kr.delete(a);
|
|
6978
6978
|
} else kr.delete(i._key);
|
|
6979
|
-
}(s), r.__lexicalEditor = null) : s &&
|
|
6979
|
+
}(s), r.__lexicalEditor = null) : s && z(198);
|
|
6980
6980
|
const o = Zl(r);
|
|
6981
6981
|
for (let i = 0; i < o.length; i++) o[i]();
|
|
6982
6982
|
r.__lexicalEventHandles = [];
|
|
@@ -6987,27 +6987,27 @@ function si(r, e, t) {
|
|
|
6987
6987
|
if (s === null) return;
|
|
6988
6988
|
const o = function(l) {
|
|
6989
6989
|
const a = V();
|
|
6990
|
-
if (!
|
|
6990
|
+
if (!M(a) || !N(l)) return a;
|
|
6991
6991
|
const { anchor: u, focus: c } = a, d = u.getNode(), f = c.getNode();
|
|
6992
6992
|
return tn(d, l) && u.set(l.__key, 0, "element"), tn(f, l) && c.set(l.__key, 0, "element"), a;
|
|
6993
6993
|
}(r);
|
|
6994
6994
|
let i = !1;
|
|
6995
|
-
if (
|
|
6995
|
+
if (M(o) && e) {
|
|
6996
6996
|
const l = o.anchor, a = o.focus;
|
|
6997
6997
|
l.key === n && (ts(l, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0), a.key === n && (ts(a, r, s, r.getPreviousSibling(), r.getNextSibling()), i = !0);
|
|
6998
6998
|
} else kt(o) && e && r.isSelected() && r.selectPrevious();
|
|
6999
|
-
if (
|
|
6999
|
+
if (M(o) && e && !i) {
|
|
7000
7000
|
const l = r.getIndexWithinParent();
|
|
7001
7001
|
lr(r), es(o, s, l, -1);
|
|
7002
7002
|
} else lr(r);
|
|
7003
|
-
t || Ft(s) || s.canBeEmpty() || !s.isEmpty() || si(s, e), e &&
|
|
7003
|
+
t || Ft(s) || s.canBeEmpty() || !s.isEmpty() || si(s, e), e && Ye(s) && s.isEmpty() && s.selectEnd();
|
|
7004
7004
|
}
|
|
7005
7005
|
class gs {
|
|
7006
7006
|
static getType() {
|
|
7007
|
-
|
|
7007
|
+
z(64, this.name);
|
|
7008
7008
|
}
|
|
7009
7009
|
static clone(e) {
|
|
7010
|
-
|
|
7010
|
+
z(65, this.name);
|
|
7011
7011
|
}
|
|
7012
7012
|
afterCloneFrom(e) {
|
|
7013
7013
|
this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev;
|
|
@@ -7019,13 +7019,13 @@ class gs {
|
|
|
7019
7019
|
return this.__type;
|
|
7020
7020
|
}
|
|
7021
7021
|
isInline() {
|
|
7022
|
-
|
|
7022
|
+
z(137, this.constructor.name);
|
|
7023
7023
|
}
|
|
7024
7024
|
isAttached() {
|
|
7025
7025
|
let e = this.__key;
|
|
7026
7026
|
for (; e !== null; ) {
|
|
7027
7027
|
if (e === "root") return !0;
|
|
7028
|
-
const t =
|
|
7028
|
+
const t = Ke(e);
|
|
7029
7029
|
if (t === null) break;
|
|
7030
7030
|
e = t.__parent;
|
|
7031
7031
|
}
|
|
@@ -7035,8 +7035,8 @@ class gs {
|
|
|
7035
7035
|
const t = e || V();
|
|
7036
7036
|
if (t == null) return !1;
|
|
7037
7037
|
const n = t.getNodes().some((s) => s.__key === this.__key);
|
|
7038
|
-
if (
|
|
7039
|
-
if (
|
|
7038
|
+
if (q(this)) return n;
|
|
7039
|
+
if (M(t) && t.anchor.type === "element" && t.focus.type === "element") {
|
|
7040
7040
|
if (t.isCollapsed()) return !1;
|
|
7041
7041
|
const s = this.getParent();
|
|
7042
7042
|
if (me(this) && this.isInline() && s) {
|
|
@@ -7061,24 +7061,24 @@ class gs {
|
|
|
7061
7061
|
}
|
|
7062
7062
|
getParent() {
|
|
7063
7063
|
const e = this.getLatest().__parent;
|
|
7064
|
-
return e === null ? null :
|
|
7064
|
+
return e === null ? null : Ke(e);
|
|
7065
7065
|
}
|
|
7066
7066
|
getParentOrThrow() {
|
|
7067
7067
|
const e = this.getParent();
|
|
7068
|
-
return e === null &&
|
|
7068
|
+
return e === null && z(66, this.__key), e;
|
|
7069
7069
|
}
|
|
7070
7070
|
getTopLevelElement() {
|
|
7071
7071
|
let e = this;
|
|
7072
7072
|
for (; e !== null; ) {
|
|
7073
7073
|
const t = e.getParent();
|
|
7074
|
-
if (Ft(t)) return N(e) || e === this && me(e) ||
|
|
7074
|
+
if (Ft(t)) return N(e) || e === this && me(e) || z(194), e;
|
|
7075
7075
|
e = t;
|
|
7076
7076
|
}
|
|
7077
7077
|
return null;
|
|
7078
7078
|
}
|
|
7079
7079
|
getTopLevelElementOrThrow() {
|
|
7080
7080
|
const e = this.getTopLevelElement();
|
|
7081
|
-
return e === null &&
|
|
7081
|
+
return e === null && z(67, this.__key), e;
|
|
7082
7082
|
}
|
|
7083
7083
|
getParents() {
|
|
7084
7084
|
const e = [];
|
|
@@ -7094,7 +7094,7 @@ class gs {
|
|
|
7094
7094
|
}
|
|
7095
7095
|
getPreviousSibling() {
|
|
7096
7096
|
const e = this.getLatest().__prev;
|
|
7097
|
-
return e === null ? null :
|
|
7097
|
+
return e === null ? null : Ke(e);
|
|
7098
7098
|
}
|
|
7099
7099
|
getPreviousSiblings() {
|
|
7100
7100
|
const e = [], t = this.getParent();
|
|
@@ -7105,7 +7105,7 @@ class gs {
|
|
|
7105
7105
|
}
|
|
7106
7106
|
getNextSibling() {
|
|
7107
7107
|
const e = this.getLatest().__next;
|
|
7108
|
-
return e === null ? null :
|
|
7108
|
+
return e === null ? null : Ke(e);
|
|
7109
7109
|
}
|
|
7110
7110
|
getNextSiblings() {
|
|
7111
7111
|
const e = [];
|
|
@@ -7182,7 +7182,7 @@ class gs {
|
|
|
7182
7182
|
if (s.has(u.__key) || n.push(u), u === e) break;
|
|
7183
7183
|
let c = null, d = u;
|
|
7184
7184
|
do {
|
|
7185
|
-
if (d === null &&
|
|
7185
|
+
if (d === null && z(68), c = t ? d.getNextSibling() : d.getPreviousSibling(), d = d.getParent(), d === null) break;
|
|
7186
7186
|
c !== null || s.has(d.__key) || n.push(d);
|
|
7187
7187
|
} while (c === null);
|
|
7188
7188
|
o = c;
|
|
@@ -7194,8 +7194,8 @@ class gs {
|
|
|
7194
7194
|
return e !== null && e.has(this.__key);
|
|
7195
7195
|
}
|
|
7196
7196
|
getLatest() {
|
|
7197
|
-
const e =
|
|
7198
|
-
return e === null &&
|
|
7197
|
+
const e = Ke(this.__key);
|
|
7198
|
+
return e === null && z(113), e;
|
|
7199
7199
|
}
|
|
7200
7200
|
getWritable() {
|
|
7201
7201
|
et();
|
|
@@ -7211,19 +7211,19 @@ class gs {
|
|
|
7211
7211
|
return this.getTextContent().length;
|
|
7212
7212
|
}
|
|
7213
7213
|
createDOM(e, t) {
|
|
7214
|
-
|
|
7214
|
+
z(70);
|
|
7215
7215
|
}
|
|
7216
7216
|
updateDOM(e, t, n) {
|
|
7217
|
-
|
|
7217
|
+
z(71);
|
|
7218
7218
|
}
|
|
7219
7219
|
exportDOM(e) {
|
|
7220
7220
|
return { element: this.createDOM(e._config, e) };
|
|
7221
7221
|
}
|
|
7222
7222
|
exportJSON() {
|
|
7223
|
-
|
|
7223
|
+
z(72);
|
|
7224
7224
|
}
|
|
7225
7225
|
static importJSON(e) {
|
|
7226
|
-
|
|
7226
|
+
z(18, this.name);
|
|
7227
7227
|
}
|
|
7228
7228
|
static transform() {
|
|
7229
7229
|
return null;
|
|
@@ -7238,14 +7238,14 @@ class gs {
|
|
|
7238
7238
|
const s = this.getLatest(), o = this.__key, i = e.__key, l = e.getWritable(), a = this.getParentOrThrow().getWritable(), u = a.__size;
|
|
7239
7239
|
lr(l);
|
|
7240
7240
|
const c = s.getPreviousSibling(), d = s.getNextSibling(), f = s.__prev, h = s.__next, g = s.__parent;
|
|
7241
|
-
if (si(s, !1, !0), c === null ? a.__first = i : c.getWritable().__next = i, l.__prev = f, d === null ? a.__last = i : d.getWritable().__prev = i, l.__next = h, l.__parent = g, a.__size = u, t && (N(this) && N(l) ||
|
|
7241
|
+
if (si(s, !1, !0), c === null ? a.__first = i : c.getWritable().__next = i, l.__prev = f, d === null ? a.__last = i : d.getWritable().__prev = i, l.__next = h, l.__parent = g, a.__size = u, t && (N(this) && N(l) || z(139), this.getChildren().forEach((m) => {
|
|
7242
7242
|
l.append(m);
|
|
7243
|
-
})),
|
|
7243
|
+
})), M(n)) {
|
|
7244
7244
|
Nt(n);
|
|
7245
7245
|
const m = n.anchor, y = n.focus;
|
|
7246
7246
|
m.key === o && _o(m, l), y.key === o && _o(y, l);
|
|
7247
7247
|
}
|
|
7248
|
-
return Ht() === o &&
|
|
7248
|
+
return Ht() === o && Ge(i), l;
|
|
7249
7249
|
}
|
|
7250
7250
|
insertAfter(e, t = !0) {
|
|
7251
7251
|
et(), Fs(this, e);
|
|
@@ -7253,13 +7253,13 @@ class gs {
|
|
|
7253
7253
|
let l = !1, a = !1;
|
|
7254
7254
|
if (o !== null) {
|
|
7255
7255
|
const h = e.getIndexWithinParent();
|
|
7256
|
-
if (lr(s),
|
|
7256
|
+
if (lr(s), M(i)) {
|
|
7257
7257
|
const g = o.__key, m = i.anchor, y = i.focus;
|
|
7258
7258
|
l = m.type === "element" && m.key === g && m.offset === h + 1, a = y.type === "element" && y.key === g && y.offset === h + 1;
|
|
7259
7259
|
}
|
|
7260
7260
|
}
|
|
7261
7261
|
const u = this.getNextSibling(), c = this.getParentOrThrow().getWritable(), d = s.__key, f = n.__next;
|
|
7262
|
-
if (u === null ? c.__last = d : u.getWritable().__prev = d, c.__size++, n.__next = d, s.__next = f, s.__prev = n.__key, s.__parent = n.__parent, t &&
|
|
7262
|
+
if (u === null ? c.__last = d : u.getWritable().__prev = d, c.__size++, n.__next = d, s.__next = f, s.__prev = n.__key, s.__parent = n.__parent, t && M(i)) {
|
|
7263
7263
|
const h = this.getIndexWithinParent();
|
|
7264
7264
|
es(i, c, h + 1);
|
|
7265
7265
|
const g = c.__key;
|
|
@@ -7274,7 +7274,7 @@ class gs {
|
|
|
7274
7274
|
const i = this.getPreviousSibling(), l = this.getParentOrThrow().getWritable(), a = n.__prev, u = this.getIndexWithinParent();
|
|
7275
7275
|
i === null ? l.__first = o : i.getWritable().__next = o, l.__size++, n.__prev = o, s.__prev = a, s.__next = n.__key, s.__parent = n.__parent;
|
|
7276
7276
|
const c = V();
|
|
7277
|
-
return t &&
|
|
7277
|
+
return t && M(c) && es(c, this.getParentOrThrow(), u), e;
|
|
7278
7278
|
}
|
|
7279
7279
|
isParentRequired() {
|
|
7280
7280
|
return !1;
|
|
@@ -7293,7 +7293,7 @@ class gs {
|
|
|
7293
7293
|
const n = this.getPreviousSibling(), s = this.getParentOrThrow();
|
|
7294
7294
|
if (n === null) return s.select(0, 0);
|
|
7295
7295
|
if (N(n)) return n.select();
|
|
7296
|
-
if (!
|
|
7296
|
+
if (!q(n)) {
|
|
7297
7297
|
const o = n.getIndexWithinParent() + 1;
|
|
7298
7298
|
return s.select(o, o);
|
|
7299
7299
|
}
|
|
@@ -7304,7 +7304,7 @@ class gs {
|
|
|
7304
7304
|
const n = this.getNextSibling(), s = this.getParentOrThrow();
|
|
7305
7305
|
if (n === null) return s.select();
|
|
7306
7306
|
if (N(n)) return n.select(0, 0);
|
|
7307
|
-
if (!
|
|
7307
|
+
if (!q(n)) {
|
|
7308
7308
|
const o = n.getIndexWithinParent();
|
|
7309
7309
|
return s.select(o, o);
|
|
7310
7310
|
}
|
|
@@ -7497,12 +7497,12 @@ class Lr extends gs {
|
|
|
7497
7497
|
if ((l === null ? u : l) !== (a === null ? c : a)) return !0;
|
|
7498
7498
|
if (l === a && u !== c) {
|
|
7499
7499
|
const m = t.firstChild;
|
|
7500
|
-
m == null &&
|
|
7500
|
+
m == null && z(48);
|
|
7501
7501
|
const y = document.createElement(c);
|
|
7502
7502
|
return yo(y, this, 0, i, s, n), t.replaceChild(y, m), !1;
|
|
7503
7503
|
}
|
|
7504
7504
|
let d = t;
|
|
7505
|
-
a !== null && l !== null && (d = t.firstChild, d == null &&
|
|
7505
|
+
a !== null && l !== null && (d = t.firstChild, d == null && z(49)), ra(s, d, this);
|
|
7506
7506
|
const f = n.theme.text;
|
|
7507
7507
|
f !== void 0 && o !== i && ta(0, o, i, d, f);
|
|
7508
7508
|
const h = e.__style, g = this.__style;
|
|
@@ -7517,7 +7517,7 @@ class Lr extends gs {
|
|
|
7517
7517
|
}
|
|
7518
7518
|
exportDOM(e) {
|
|
7519
7519
|
let { element: t } = super.exportDOM(e);
|
|
7520
|
-
return t !== null && It(t) ||
|
|
7520
|
+
return t !== null && It(t) || z(132), t.style.whiteSpace = "pre-wrap", this.hasFormat("bold") && (t = Nn(t, "b")), this.hasFormat("italic") && (t = Nn(t, "i")), this.hasFormat("strikethrough") && (t = Nn(t, "s")), this.hasFormat("underline") && (t = Nn(t, "u")), { element: t };
|
|
7521
7521
|
}
|
|
7522
7522
|
exportJSON() {
|
|
7523
7523
|
return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), type: "text", version: 1 };
|
|
@@ -7567,10 +7567,10 @@ class Lr extends gs {
|
|
|
7567
7567
|
const a = i.length;
|
|
7568
7568
|
n === void 0 && (n = a), s === void 0 && (s = a);
|
|
7569
7569
|
} else n = 0, s = 0;
|
|
7570
|
-
if (!
|
|
7570
|
+
if (!M(o)) return ia(l, n, l, s, "text", "text");
|
|
7571
7571
|
{
|
|
7572
7572
|
const a = Ht();
|
|
7573
|
-
a !== o.anchor.key && a !== o.focus.key ||
|
|
7573
|
+
a !== o.anchor.key && a !== o.focus.key || Ge(l), o.setTextNodeRange(this, n, this, s);
|
|
7574
7574
|
}
|
|
7575
7575
|
return o;
|
|
7576
7576
|
}
|
|
@@ -7586,7 +7586,7 @@ class Lr extends gs {
|
|
|
7586
7586
|
let a = e;
|
|
7587
7587
|
a < 0 && (a = l + a, a < 0 && (a = 0));
|
|
7588
7588
|
const u = V();
|
|
7589
|
-
if (s &&
|
|
7589
|
+
if (s && M(u)) {
|
|
7590
7590
|
const d = e + l;
|
|
7591
7591
|
u.setTextNodeRange(o, d, o, d);
|
|
7592
7592
|
}
|
|
@@ -7618,12 +7618,12 @@ class Lr extends gs {
|
|
|
7618
7618
|
for (let E = 1; E < c; E++) {
|
|
7619
7619
|
const v = l[E], b = v.length, D = Pe(v).getWritable();
|
|
7620
7620
|
D.__format = g, D.__style = m, D.__detail = y;
|
|
7621
|
-
const k = D.__key,
|
|
7622
|
-
if (
|
|
7621
|
+
const k = D.__key, I = w + b;
|
|
7622
|
+
if (M(x)) {
|
|
7623
7623
|
const B = x.anchor, F = x.focus;
|
|
7624
|
-
B.key === s && B.type === "text" && B.offset > w && B.offset <=
|
|
7624
|
+
B.key === s && B.type === "text" && B.offset > w && B.offset <= I && (B.key = k, B.offset -= w, x.dirty = !0), F.key === s && F.type === "text" && F.offset > w && F.offset <= I && (F.key = k, F.offset -= w, x.dirty = !0);
|
|
7625
7625
|
}
|
|
7626
|
-
o === s &&
|
|
7626
|
+
o === s && Ge(k), w = I, A.push(D);
|
|
7627
7627
|
}
|
|
7628
7628
|
if (f !== null) {
|
|
7629
7629
|
(function(b) {
|
|
@@ -7631,17 +7631,17 @@ class Lr extends gs {
|
|
|
7631
7631
|
D !== null && Kn(D), k !== null && Kn(k);
|
|
7632
7632
|
})(this);
|
|
7633
7633
|
const E = f.getWritable(), v = this.getIndexWithinParent();
|
|
7634
|
-
C ? (E.splice(v, 0, A), this.remove()) : E.splice(v, 1, A),
|
|
7634
|
+
C ? (E.splice(v, 0, A), this.remove()) : E.splice(v, 1, A), M(x) && es(x, f, v, c - 1);
|
|
7635
7635
|
}
|
|
7636
7636
|
return A;
|
|
7637
7637
|
}
|
|
7638
7638
|
mergeWithSibling(e) {
|
|
7639
7639
|
const t = e === this.getPreviousSibling();
|
|
7640
|
-
t || e === this.getNextSibling() ||
|
|
7640
|
+
t || e === this.getNextSibling() || z(50);
|
|
7641
7641
|
const n = this.__key, s = e.__key, o = this.__text, i = o.length;
|
|
7642
|
-
Ht() === s &&
|
|
7642
|
+
Ht() === s && Ge(n);
|
|
7643
7643
|
const l = V();
|
|
7644
|
-
if (
|
|
7644
|
+
if (M(l)) {
|
|
7645
7645
|
const d = l.anchor, f = l.focus;
|
|
7646
7646
|
d !== null && d.key === s && (So(d, t, n, e, i), l.dirty = !0), f !== null && f.key === s && (So(f, t, n, e, i), l.dirty = !0);
|
|
7647
7647
|
}
|
|
@@ -7667,7 +7667,7 @@ function vc(r) {
|
|
|
7667
7667
|
}
|
|
7668
7668
|
function wc(r) {
|
|
7669
7669
|
const e = r;
|
|
7670
|
-
r.parentElement === null &&
|
|
7670
|
+
r.parentElement === null && z(129);
|
|
7671
7671
|
let t = e.textContent || "";
|
|
7672
7672
|
if (function(n) {
|
|
7673
7673
|
let s, o = n.parentNode;
|
|
@@ -7736,12 +7736,12 @@ function Gt(r) {
|
|
|
7736
7736
|
function Pe(r = "") {
|
|
7737
7737
|
return Lt(new Lr(r));
|
|
7738
7738
|
}
|
|
7739
|
-
function
|
|
7739
|
+
function q(r) {
|
|
7740
7740
|
return r instanceof Lr;
|
|
7741
7741
|
}
|
|
7742
7742
|
function Li(r, e) {
|
|
7743
7743
|
const t = r.fontWeight, n = r.textDecoration.split(" "), s = t === "700" || t === "bold", o = n.includes("line-through"), i = r.fontStyle === "italic", l = n.includes("underline"), a = r.verticalAlign;
|
|
7744
|
-
return (u) => (
|
|
7744
|
+
return (u) => (q(u) && (s && !u.hasFormat("bold") && u.toggleFormat("bold"), o && !u.hasFormat("strikethrough") && u.toggleFormat("strikethrough"), i && !u.hasFormat("italic") && u.toggleFormat("italic"), l && !u.hasFormat("underline") && u.toggleFormat("underline"), a !== "sub" || u.hasFormat("subscript") || u.toggleFormat("subscript"), a !== "super" || u.hasFormat("superscript") || u.toggleFormat("superscript"), e && !u.hasFormat(e) && u.toggleFormat(e)), u);
|
|
7745
7745
|
}
|
|
7746
7746
|
class _n extends Lr {
|
|
7747
7747
|
static getType() {
|
|
@@ -7767,13 +7767,13 @@ class _n extends Lr {
|
|
|
7767
7767
|
return { ...super.exportJSON(), type: "tab", version: 1 };
|
|
7768
7768
|
}
|
|
7769
7769
|
setTextContent(e) {
|
|
7770
|
-
|
|
7770
|
+
z(126);
|
|
7771
7771
|
}
|
|
7772
7772
|
setDetail(e) {
|
|
7773
|
-
|
|
7773
|
+
z(127);
|
|
7774
7774
|
}
|
|
7775
7775
|
setMode(e) {
|
|
7776
|
-
|
|
7776
|
+
z(128);
|
|
7777
7777
|
}
|
|
7778
7778
|
canInsertTextBefore() {
|
|
7779
7779
|
return !1;
|
|
@@ -7809,12 +7809,12 @@ class Ac {
|
|
|
7809
7809
|
return t === n ? s < o : t.isBefore(n);
|
|
7810
7810
|
}
|
|
7811
7811
|
getNode() {
|
|
7812
|
-
const e =
|
|
7813
|
-
return e === null &&
|
|
7812
|
+
const e = Ke(this.key);
|
|
7813
|
+
return e === null && z(20), e;
|
|
7814
7814
|
}
|
|
7815
7815
|
set(e, t, n) {
|
|
7816
7816
|
const s = this._selection, o = this.key;
|
|
7817
|
-
this.key = e, this.offset = t, this.type = n, Cn() || (Ht() === o &&
|
|
7817
|
+
this.key = e, this.offset = t, this.type = n, Cn() || (Ht() === o && Ge(e), s !== null && (s.setCachedNodes(null), s.dirty = !0));
|
|
7818
7818
|
}
|
|
7819
7819
|
}
|
|
7820
7820
|
function jt(r, e, t) {
|
|
@@ -7822,13 +7822,13 @@ function jt(r, e, t) {
|
|
|
7822
7822
|
}
|
|
7823
7823
|
function Ms(r, e) {
|
|
7824
7824
|
let t = e.__key, n = r.offset, s = "element";
|
|
7825
|
-
if (
|
|
7825
|
+
if (q(e)) {
|
|
7826
7826
|
s = "text";
|
|
7827
7827
|
const o = e.getTextContentSize();
|
|
7828
7828
|
n > o && (n = o);
|
|
7829
7829
|
} else if (!N(e)) {
|
|
7830
7830
|
const o = e.getNextSibling();
|
|
7831
|
-
if (
|
|
7831
|
+
if (q(o)) t = o.__key, n = 0, s = "text";
|
|
7832
7832
|
else {
|
|
7833
7833
|
const i = e.getParent();
|
|
7834
7834
|
i && (t = i.__key, n = e.getIndexWithinParent() + 1);
|
|
@@ -7839,7 +7839,7 @@ function Ms(r, e) {
|
|
|
7839
7839
|
function _o(r, e) {
|
|
7840
7840
|
if (N(e)) {
|
|
7841
7841
|
const t = e.getLastDescendant();
|
|
7842
|
-
N(t) ||
|
|
7842
|
+
N(t) || q(t) ? Ms(r, t) : Ms(r, e);
|
|
7843
7843
|
} else Ms(r, e);
|
|
7844
7844
|
}
|
|
7845
7845
|
function Kt(r, e, t, n) {
|
|
@@ -7894,7 +7894,7 @@ class ms {
|
|
|
7894
7894
|
insertNodes(e) {
|
|
7895
7895
|
const t = this.getNodes(), n = t.length, s = t[n - 1];
|
|
7896
7896
|
let o;
|
|
7897
|
-
if (
|
|
7897
|
+
if (q(s)) o = s.select();
|
|
7898
7898
|
else {
|
|
7899
7899
|
const i = s.getIndexWithinParent() + 1;
|
|
7900
7900
|
o = s.getParentOrThrow().select(i, i);
|
|
@@ -7907,7 +7907,7 @@ class ms {
|
|
|
7907
7907
|
if (e !== null) return e;
|
|
7908
7908
|
const t = this._nodes, n = [];
|
|
7909
7909
|
for (const s of t) {
|
|
7910
|
-
const o =
|
|
7910
|
+
const o = Ke(s);
|
|
7911
7911
|
o !== null && n.push(o);
|
|
7912
7912
|
}
|
|
7913
7913
|
return Cn() || (this._cachedNodes = n), n;
|
|
@@ -7919,7 +7919,7 @@ class ms {
|
|
|
7919
7919
|
return t;
|
|
7920
7920
|
}
|
|
7921
7921
|
}
|
|
7922
|
-
function
|
|
7922
|
+
function M(r) {
|
|
7923
7923
|
return r instanceof er;
|
|
7924
7924
|
}
|
|
7925
7925
|
class er {
|
|
@@ -7933,7 +7933,7 @@ class er {
|
|
|
7933
7933
|
this._cachedNodes = e;
|
|
7934
7934
|
}
|
|
7935
7935
|
is(e) {
|
|
7936
|
-
return !!
|
|
7936
|
+
return !!M(e) && this.anchor.is(e.anchor) && this.focus.is(e.focus) && this.format === e.format && this.style === e.style;
|
|
7937
7937
|
}
|
|
7938
7938
|
isCollapsed() {
|
|
7939
7939
|
return this.anchor.is(this.focus);
|
|
@@ -7967,7 +7967,7 @@ class er {
|
|
|
7967
7967
|
const f = e[d];
|
|
7968
7968
|
if (N(f) && !f.isInline()) c || (u += `
|
|
7969
7969
|
`), c = !f.isEmpty();
|
|
7970
|
-
else if (c = !1,
|
|
7970
|
+
else if (c = !1, q(f)) {
|
|
7971
7971
|
let h = f.getTextContent();
|
|
7972
7972
|
f === t ? f === n ? s.type === "element" && o.type === "element" && o.offset !== s.offset || (h = l < a ? h.slice(l, a) : h.slice(a, l)) : h = i ? h.slice(l) : h.slice(a) : f === n && (h = i ? h.slice(0, a) : h.slice(0, l)), u += h;
|
|
7973
7973
|
} else !me(f) && !ar(f) || f === n && this.isCollapsed() || (u += f.getTextContent());
|
|
@@ -8008,22 +8008,22 @@ class er {
|
|
|
8008
8008
|
const t = this.anchor, n = this.focus, s = this.format, o = this.style;
|
|
8009
8009
|
let i = t, l = n;
|
|
8010
8010
|
!this.isCollapsed() && n.isBefore(t) && (i = n, l = t), i.type === "element" && function(y, C, x, A) {
|
|
8011
|
-
const w = y.getNode(), E = w.getChildAtIndex(y.offset), v = Pe(), b =
|
|
8011
|
+
const w = y.getNode(), E = w.getChildAtIndex(y.offset), v = Pe(), b = Ye(w) ? Le().append(v) : v;
|
|
8012
8012
|
v.setFormat(x), v.setStyle(A), E === null ? w.append(b) : E.insertBefore(b), y.is(C) && C.set(v.__key, 0, "text"), y.set(v.__key, 0, "text");
|
|
8013
8013
|
}(i, l, s, o);
|
|
8014
8014
|
const a = i.offset;
|
|
8015
8015
|
let u = l.offset;
|
|
8016
8016
|
const c = this.getNodes(), d = c.length;
|
|
8017
8017
|
let f = c[0];
|
|
8018
|
-
|
|
8018
|
+
q(f) || z(26);
|
|
8019
8019
|
const h = f.getTextContent().length, g = f.getParentOrThrow();
|
|
8020
8020
|
let m = c[d - 1];
|
|
8021
8021
|
if (d === 1 && l.type === "element" && (u = h, l.set(i.key, u, "text")), this.isCollapsed() && a === h && (f.isSegmented() || f.isToken() || !f.canInsertTextAfter() || !g.canInsertTextAfter() && f.getNextSibling() === null)) {
|
|
8022
8022
|
let y = f.getNextSibling();
|
|
8023
|
-
if (
|
|
8023
|
+
if (q(y) && y.canInsertTextBefore() && !sr(y) || (y = Pe(), y.setFormat(s), y.setStyle(o), g.canInsertTextAfter() ? f.insertAfter(y) : g.insertAfter(y)), y.select(0, 0), f = y, e !== "") return void this.insertText(e);
|
|
8024
8024
|
} else if (this.isCollapsed() && a === 0 && (f.isSegmented() || f.isToken() || !f.canInsertTextBefore() || !g.canInsertTextBefore() && f.getPreviousSibling() === null)) {
|
|
8025
8025
|
let y = f.getPreviousSibling();
|
|
8026
|
-
if (
|
|
8026
|
+
if (q(y) && !sr(y) || (y = Pe(), y.setFormat(s), g.canInsertTextBefore() ? f.insertBefore(y) : g.insertBefore(y)), y.select(), f = y, e !== "") return void this.insertText(e);
|
|
8027
8027
|
} else if (f.isSegmented() && a !== h) {
|
|
8028
8028
|
const y = Pe(f.getTextContent());
|
|
8029
8029
|
y.setFormat(s), f.replace(y), f = y;
|
|
@@ -8062,12 +8062,12 @@ class er {
|
|
|
8062
8062
|
if (!C.is(x) && x.isInline()) do
|
|
8063
8063
|
A = x, x = x.getParentOrThrow();
|
|
8064
8064
|
while (x.isInline());
|
|
8065
|
-
if (l.type === "text" && (u !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < u) if (
|
|
8065
|
+
if (l.type === "text" && (u !== 0 || m.getTextContent() === "") || l.type === "element" && m.getIndexWithinParent() < u) if (q(m) && !m.isToken() && u !== m.getTextContentSize()) {
|
|
8066
8066
|
if (m.isSegmented()) {
|
|
8067
8067
|
const D = Pe(m.getTextContent());
|
|
8068
8068
|
m.replace(D), m = D;
|
|
8069
8069
|
}
|
|
8070
|
-
|
|
8070
|
+
Ye(l.getNode()) || l.type !== "text" || (m = m.spliceText(0, u, "")), y.add(m.__key);
|
|
8071
8071
|
} else {
|
|
8072
8072
|
const D = m.getParentOrThrow();
|
|
8073
8073
|
D.canBeEmpty() || D.getChildrenSize() !== 1 ? m.remove() : D.remove();
|
|
@@ -8082,8 +8082,8 @@ class er {
|
|
|
8082
8082
|
if (!v) {
|
|
8083
8083
|
let D = x, k = null;
|
|
8084
8084
|
for (; D !== null; ) {
|
|
8085
|
-
const
|
|
8086
|
-
(B === 0 ||
|
|
8085
|
+
const I = D.getChildren(), B = I.length;
|
|
8086
|
+
(B === 0 || I[B - 1].is(k)) && (y.delete(D.__key), k = D), D = D.getParent();
|
|
8087
8087
|
}
|
|
8088
8088
|
}
|
|
8089
8089
|
if (f.isToken()) if (a === h) f.select();
|
|
@@ -8093,8 +8093,8 @@ class er {
|
|
|
8093
8093
|
}
|
|
8094
8094
|
else f = f.spliceText(a, h - a, e, !0), f.getTextContent() === "" ? f.remove() : f.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
|
|
8095
8095
|
for (let D = 1; D < d; D++) {
|
|
8096
|
-
const k = c[D],
|
|
8097
|
-
y.has(
|
|
8096
|
+
const k = c[D], I = k.__key;
|
|
8097
|
+
y.has(I) || k.remove();
|
|
8098
8098
|
}
|
|
8099
8099
|
}
|
|
8100
8100
|
}
|
|
@@ -8103,7 +8103,7 @@ class er {
|
|
|
8103
8103
|
const { anchor: e, focus: t } = this, n = this.getNodes(), s = this.isBackward() ? t : e, o = this.isBackward() ? e : t;
|
|
8104
8104
|
let i = s.getNode(), l = o.getNode();
|
|
8105
8105
|
const a = Wr(i, Vt), u = Wr(l, Vt);
|
|
8106
|
-
|
|
8106
|
+
q(i) && i.isToken() && s.offset < i.getTextContentSize() && (s.offset = 0), o.offset > 0 && q(l) && l.isToken() && (o.offset = l.getTextContentSize()), n.forEach((d) => {
|
|
8107
8107
|
tn(i, d) || tn(l, d) || d.getKey() === i.getKey() || d.getKey() === l.getKey() || d.remove();
|
|
8108
8108
|
});
|
|
8109
8109
|
const c = (d, f) => {
|
|
@@ -8113,20 +8113,20 @@ class er {
|
|
|
8113
8113
|
return h.setFormat(d.getFormat()), h.setStyle(d.getStyle()), d.replace(h);
|
|
8114
8114
|
}
|
|
8115
8115
|
};
|
|
8116
|
-
if (i === l &&
|
|
8116
|
+
if (i === l && q(i)) {
|
|
8117
8117
|
const d = Math.abs(t.offset - e.offset);
|
|
8118
8118
|
return i.spliceText(s.offset, d, "", !0), void c(i, d);
|
|
8119
8119
|
}
|
|
8120
|
-
if (
|
|
8120
|
+
if (q(i)) {
|
|
8121
8121
|
const d = i.getTextContentSize() - s.offset;
|
|
8122
8122
|
i.spliceText(s.offset, d, ""), i = c(i, d) || i;
|
|
8123
8123
|
}
|
|
8124
|
-
|
|
8124
|
+
q(l) && (l.spliceText(0, o.offset, ""), l = c(l, o.offset) || l), i.isAttached() && q(i) ? i.selectEnd() : l.isAttached() && q(l) && l.selectStart(), N(a) && N(u) && a !== u && (a.append(...u.getChildren()), u.remove(), o.set(s.key, s.offset, s.type));
|
|
8125
8125
|
}
|
|
8126
8126
|
formatText(e, t = null) {
|
|
8127
|
-
if (this.isCollapsed()) return this.toggleFormat(e), void
|
|
8127
|
+
if (this.isCollapsed()) return this.toggleFormat(e), void Ge(null);
|
|
8128
8128
|
const n = this.getNodes(), s = [];
|
|
8129
|
-
for (const w of n)
|
|
8129
|
+
for (const w of n) q(w) && s.push(w);
|
|
8130
8130
|
const o = (w) => {
|
|
8131
8131
|
n.forEach((E) => {
|
|
8132
8132
|
if (Fr(E)) {
|
|
@@ -8135,7 +8135,7 @@ class er {
|
|
|
8135
8135
|
}
|
|
8136
8136
|
});
|
|
8137
8137
|
}, i = s.length;
|
|
8138
|
-
if (i === 0) return this.toggleFormat(e),
|
|
8138
|
+
if (i === 0) return this.toggleFormat(e), Ge(null), void o(t);
|
|
8139
8139
|
const l = this.anchor, a = this.focus, u = this.isBackward(), c = u ? a : l, d = u ? l : a;
|
|
8140
8140
|
let f = 0, h = s[0], g = c.type === "element" ? 0 : c.offset;
|
|
8141
8141
|
if (c.type === "text" && g === h.getTextContentSize() && (f = 1, h = s[1], g = 0), h == null) return;
|
|
@@ -8167,7 +8167,7 @@ class er {
|
|
|
8167
8167
|
if (this.anchor.key === "root") {
|
|
8168
8168
|
this.insertParagraph();
|
|
8169
8169
|
const g = V();
|
|
8170
|
-
return
|
|
8170
|
+
return M(g) || z(134), g.insertNodes(e);
|
|
8171
8171
|
}
|
|
8172
8172
|
const t = (this.isBackward() ? this.focus : this.anchor).getNode(), n = Wr(t, Vt), s = e[e.length - 1];
|
|
8173
8173
|
if (N(n) && "__language" in n) {
|
|
@@ -8179,7 +8179,7 @@ class er {
|
|
|
8179
8179
|
return;
|
|
8180
8180
|
}
|
|
8181
8181
|
if (!e.some((g) => (N(g) || me(g)) && !g.isInline())) {
|
|
8182
|
-
N(n) ||
|
|
8182
|
+
N(n) || z(211, t.constructor.name, t.getType());
|
|
8183
8183
|
const g = Is(this);
|
|
8184
8184
|
return n.splice(g, 0, e), void s.selectEnd();
|
|
8185
8185
|
}
|
|
@@ -8188,7 +8188,7 @@ class er {
|
|
|
8188
8188
|
let y = null;
|
|
8189
8189
|
for (let C = 0; C < g.length; C++) {
|
|
8190
8190
|
const x = g[C], A = ar(x);
|
|
8191
|
-
if (A || me(x) && x.isInline() || N(x) && x.isInline() ||
|
|
8191
|
+
if (A || me(x) && x.isInline() || N(x) && x.isInline() || q(x) || x.isParentRequired()) {
|
|
8192
8192
|
if (y === null && (y = x.createParentElementNode(), m.append(y), A)) continue;
|
|
8193
8193
|
y !== null && y.append(x);
|
|
8194
8194
|
} else m.append(x), y = null;
|
|
@@ -8197,11 +8197,11 @@ class er {
|
|
|
8197
8197
|
}(e), i = o.getLastDescendant(), l = o.getChildren(), a = !N(n) || !n.isEmpty() ? this.insertParagraph() : null, u = l[l.length - 1];
|
|
8198
8198
|
let c = l[0];
|
|
8199
8199
|
var d;
|
|
8200
|
-
N(d = c) && Vt(d) && !d.isEmpty() && N(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (N(n) ||
|
|
8200
|
+
N(d = c) && Vt(d) && !d.isEmpty() && N(n) && (!n.isEmpty() || n.canMergeWhenEmpty()) && (N(n) || z(211, t.constructor.name, t.getType()), n.append(...c.getChildren()), c = l[1]), c && (n === null && z(212, t.constructor.name, t.getType()), function(g, m, y) {
|
|
8201
8201
|
const C = m.getParentOrThrow().getLastChild();
|
|
8202
8202
|
let x = m;
|
|
8203
8203
|
const A = [m];
|
|
8204
|
-
for (; x !== C; ) x.getNextSibling() ||
|
|
8204
|
+
for (; x !== C; ) x.getNextSibling() || z(140), x = x.getNextSibling(), A.push(x);
|
|
8205
8205
|
let w = g;
|
|
8206
8206
|
for (const E of A) w = w.insertAfter(E);
|
|
8207
8207
|
}(n, c));
|
|
@@ -8216,7 +8216,7 @@ class er {
|
|
|
8216
8216
|
return Ee().splice(this.anchor.offset, 0, [i]), i.select(), i;
|
|
8217
8217
|
}
|
|
8218
8218
|
const e = Is(this), t = Wr(this.anchor.getNode(), Vt);
|
|
8219
|
-
N(t) ||
|
|
8219
|
+
N(t) || z(213);
|
|
8220
8220
|
const n = t.getChildAtIndex(e), s = n ? [n, ...n.getNextSiblings()] : [], o = t.insertNewAfter(this, !1);
|
|
8221
8221
|
return o ? (o.append(...s), o.selectStart(), o) : null;
|
|
8222
8222
|
}
|
|
@@ -8233,18 +8233,18 @@ class er {
|
|
|
8233
8233
|
const [a, u] = ii(this);
|
|
8234
8234
|
if (t === 0) return [];
|
|
8235
8235
|
if (t === 1) {
|
|
8236
|
-
if (
|
|
8236
|
+
if (q(i) && !this.isCollapsed()) {
|
|
8237
8237
|
const d = a > u ? u : a, f = a > u ? a : u, h = i.splitText(d, f), g = d === 0 ? h[0] : h[1];
|
|
8238
8238
|
return g != null ? [g] : [];
|
|
8239
8239
|
}
|
|
8240
8240
|
return [i];
|
|
8241
8241
|
}
|
|
8242
8242
|
const c = s.isBefore(o);
|
|
8243
|
-
if (
|
|
8243
|
+
if (q(i)) {
|
|
8244
8244
|
const d = c ? a : u;
|
|
8245
8245
|
d === i.getTextContentSize() ? e.shift() : d !== 0 && ([, i] = i.splitText(d), e[0] = i);
|
|
8246
8246
|
}
|
|
8247
|
-
if (
|
|
8247
|
+
if (q(l)) {
|
|
8248
8248
|
const d = l.getTextContent().length, f = c ? u : a;
|
|
8249
8249
|
f === 0 ? e.pop() : f !== d && ([l] = l.splitText(f), e[n] = l);
|
|
8250
8250
|
}
|
|
@@ -8258,7 +8258,7 @@ class er {
|
|
|
8258
8258
|
return h.add(l.__key), void Nt(h);
|
|
8259
8259
|
}
|
|
8260
8260
|
const f = t ? l.getPreviousSibling() : l.getNextSibling();
|
|
8261
|
-
if (
|
|
8261
|
+
if (q(f)) {
|
|
8262
8262
|
const h = f.__key, g = t ? f.getTextContent().length : 0;
|
|
8263
8263
|
return s.set(h, g, "text"), void (i && o.set(h, g, "text"));
|
|
8264
8264
|
}
|
|
@@ -8274,7 +8274,7 @@ class er {
|
|
|
8274
8274
|
if (d === null || c === null || !N(l) || l.isInline() || l.canBeEmpty() || Ni(c, a, d), function(f, h, g, m) {
|
|
8275
8275
|
f.modify(h, g, m);
|
|
8276
8276
|
}(u, e, t ? "backward" : "forward", n), u.rangeCount > 0) {
|
|
8277
|
-
const f = u.getRangeAt(0), h = this.anchor.getNode(), g =
|
|
8277
|
+
const f = u.getRangeAt(0), h = this.anchor.getNode(), g = Ye(h) ? h : lc(h);
|
|
8278
8278
|
if (this.applyDOMRange(f), this.dirty = !0, !i) {
|
|
8279
8279
|
const m = this.getNodes(), y = [];
|
|
8280
8280
|
let C = !1;
|
|
@@ -8343,7 +8343,7 @@ class er {
|
|
|
8343
8343
|
}
|
|
8344
8344
|
if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
|
|
8345
8345
|
const n = this.anchor.getNode();
|
|
8346
|
-
n.isEmpty() &&
|
|
8346
|
+
n.isEmpty() && Ye(n.getParent()) && n.getIndexWithinParent() === 0 && n.collapseAtStart(this);
|
|
8347
8347
|
}
|
|
8348
8348
|
}
|
|
8349
8349
|
deleteLine(e) {
|
|
@@ -8411,13 +8411,13 @@ function Co(r, e, t, n) {
|
|
|
8411
8411
|
const f = u.parentNode;
|
|
8412
8412
|
r === f && e > Array.prototype.indexOf.call(f.children, u) && o--;
|
|
8413
8413
|
}
|
|
8414
|
-
if (s = Dr(c),
|
|
8414
|
+
if (s = Dr(c), q(s)) o = no(s, i);
|
|
8415
8415
|
else {
|
|
8416
8416
|
let f = Dr(r);
|
|
8417
8417
|
if (f === null) return null;
|
|
8418
8418
|
if (N(f)) {
|
|
8419
8419
|
const h = n.getElementByKey(f.getKey());
|
|
8420
|
-
h === null &&
|
|
8420
|
+
h === null && z(214), [f, o] = f.getDOMSlot(h).resolveChildIndex(f, h, r, e), N(f) || z(215), i && o >= f.getChildrenSize() && (o = Math.max(0, f.getChildrenSize() - 1));
|
|
8421
8421
|
let m = f.getChildAtIndex(o);
|
|
8422
8422
|
if (N(m) && function(y, C, x) {
|
|
8423
8423
|
const A = y.getParent();
|
|
@@ -8426,7 +8426,7 @@ function Co(r, e, t, n) {
|
|
|
8426
8426
|
const y = i ? m.getLastDescendant() : m.getFirstDescendant();
|
|
8427
8427
|
y === null ? f = m : (m = y, f = N(m) ? m : m.getParentOrThrow()), o = 0;
|
|
8428
8428
|
}
|
|
8429
|
-
|
|
8429
|
+
q(m) ? (s = m, f = null, o = no(m, i)) : m !== f && i && !d && (N(f) || z(216), o = Math.min(f.getChildrenSize(), o + 1));
|
|
8430
8430
|
} else {
|
|
8431
8431
|
const h = f.getIndexWithinParent();
|
|
8432
8432
|
o = e === 0 && me(f) && Dr(r) === f ? h : h + 1, f = f.getParentOrThrow();
|
|
@@ -8434,7 +8434,7 @@ function Co(r, e, t, n) {
|
|
|
8434
8434
|
if (N(f)) return jt(f.__key, o, "element");
|
|
8435
8435
|
}
|
|
8436
8436
|
} else s = Dr(r);
|
|
8437
|
-
return
|
|
8437
|
+
return q(s) ? jt(s.__key, o, "text") : null;
|
|
8438
8438
|
}
|
|
8439
8439
|
function Do(r, e, t) {
|
|
8440
8440
|
const n = r.offset, s = r.getNode();
|
|
@@ -8443,15 +8443,15 @@ function Do(r, e, t) {
|
|
|
8443
8443
|
if (e) {
|
|
8444
8444
|
if ((t || !e) && o === null && N(i) && i.isInline()) {
|
|
8445
8445
|
const l = i.getPreviousSibling();
|
|
8446
|
-
|
|
8446
|
+
q(l) && (r.key = l.__key, r.offset = l.getTextContent().length);
|
|
8447
8447
|
}
|
|
8448
|
-
} else N(o) && !t && o.isInline() ? (r.key = o.__key, r.offset = o.getChildrenSize(), r.type = "element") :
|
|
8448
|
+
} else N(o) && !t && o.isInline() ? (r.key = o.__key, r.offset = o.getChildrenSize(), r.type = "element") : q(o) && (r.key = o.__key, r.offset = o.getTextContent().length);
|
|
8449
8449
|
} else if (n === s.getTextContent().length) {
|
|
8450
8450
|
const o = s.getNextSibling(), i = s.getParent();
|
|
8451
8451
|
if (e && N(o) && o.isInline()) r.key = o.__key, r.offset = 0, r.type = "element";
|
|
8452
8452
|
else if ((t || e) && o === null && N(i) && i.isInline() && !i.canInsertTextAfter()) {
|
|
8453
8453
|
const l = i.getNextSibling();
|
|
8454
|
-
|
|
8454
|
+
q(l) && (r.key = l.__key, r.offset = 0);
|
|
8455
8455
|
}
|
|
8456
8456
|
}
|
|
8457
8457
|
}
|
|
@@ -8460,7 +8460,7 @@ function na(r, e, t) {
|
|
|
8460
8460
|
const n = r.isBefore(e), s = r.is(e);
|
|
8461
8461
|
Do(r, n, s), Do(e, !n, s), s && (e.key = r.key, e.offset = r.offset, e.type = r.type);
|
|
8462
8462
|
const o = Be();
|
|
8463
|
-
if (o.isComposing() && o._compositionKey !== r.key &&
|
|
8463
|
+
if (o.isComposing() && o._compositionKey !== r.key && M(t)) {
|
|
8464
8464
|
const i = t.anchor, l = t.focus;
|
|
8465
8465
|
Kt(r, i.key, i.offset, i.type), Kt(e, l.key, l.offset, l.type);
|
|
8466
8466
|
}
|
|
@@ -8468,9 +8468,9 @@ function na(r, e, t) {
|
|
|
8468
8468
|
}
|
|
8469
8469
|
function sa(r, e, t, n, s, o) {
|
|
8470
8470
|
if (r === null || t === null || !yn(s, r, t)) return null;
|
|
8471
|
-
const i = Co(r, e,
|
|
8471
|
+
const i = Co(r, e, M(o) ? o.anchor : null, s);
|
|
8472
8472
|
if (i === null) return null;
|
|
8473
|
-
const l = Co(t, n,
|
|
8473
|
+
const l = Co(t, n, M(o) ? o.focus : null, s);
|
|
8474
8474
|
if (l === null) return null;
|
|
8475
8475
|
if (i.type === "element" && l.type === "element") {
|
|
8476
8476
|
const a = Dr(r), u = Dr(t);
|
|
@@ -8497,13 +8497,13 @@ function Pi(r, e, t, n) {
|
|
|
8497
8497
|
if (s === null) return null;
|
|
8498
8498
|
const o = n || s.event, i = o ? o.type : void 0, l = i === "selectionchange", a = !Vs && (l || i === "beforeinput" || i === "compositionstart" || i === "compositionend" || i === "click" && o && o.detail === 3 || i === "drop" || i === void 0);
|
|
8499
8499
|
let u, c, d, f;
|
|
8500
|
-
if (
|
|
8500
|
+
if (M(r) && !a) return r.clone();
|
|
8501
8501
|
if (e === null) return null;
|
|
8502
|
-
if (u = e.anchorNode, c = e.focusNode, d = e.anchorOffset, f = e.focusOffset, l &&
|
|
8502
|
+
if (u = e.anchorNode, c = e.focusNode, d = e.anchorOffset, f = e.focusOffset, l && M(r) && !yn(t, u, c)) return r.clone();
|
|
8503
8503
|
const h = sa(u, d, c, f, t, r);
|
|
8504
8504
|
if (h === null) return null;
|
|
8505
8505
|
const [g, m] = h;
|
|
8506
|
-
return new er(g, m,
|
|
8506
|
+
return new er(g, m, M(r) ? r.format : 0, M(r) ? r.style : "");
|
|
8507
8507
|
}
|
|
8508
8508
|
function V() {
|
|
8509
8509
|
return $t()._selection;
|
|
@@ -8539,21 +8539,21 @@ function Eo(r) {
|
|
|
8539
8539
|
if (r.isCollapsed()) {
|
|
8540
8540
|
if (!N(o)) return;
|
|
8541
8541
|
const l = o.getChildrenSize(), a = t >= l, u = a ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(t);
|
|
8542
|
-
if (
|
|
8542
|
+
if (q(u)) {
|
|
8543
8543
|
let c = 0;
|
|
8544
8544
|
a && (c = u.getTextContentSize()), e.set(u.__key, c, "text"), n.set(u.__key, c, "text");
|
|
8545
8545
|
}
|
|
8546
8546
|
} else {
|
|
8547
8547
|
if (N(o)) {
|
|
8548
8548
|
const l = o.getChildrenSize(), a = t >= l, u = a ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(t);
|
|
8549
|
-
if (
|
|
8549
|
+
if (q(u)) {
|
|
8550
8550
|
let c = 0;
|
|
8551
8551
|
a && (c = u.getTextContentSize()), e.set(u.__key, c, "text");
|
|
8552
8552
|
}
|
|
8553
8553
|
}
|
|
8554
8554
|
if (N(i)) {
|
|
8555
8555
|
const l = i.getChildrenSize(), a = s >= l, u = a ? i.getChildAtIndex(l - 1) : i.getChildAtIndex(s);
|
|
8556
|
-
if (
|
|
8556
|
+
if (q(u)) {
|
|
8557
8557
|
let c = 0;
|
|
8558
8558
|
a && (c = u.getTextContentSize()), n.set(u.__key, c, "text");
|
|
8559
8559
|
}
|
|
@@ -8562,7 +8562,7 @@ function Eo(r) {
|
|
|
8562
8562
|
}
|
|
8563
8563
|
function ts(r, e, t, n, s) {
|
|
8564
8564
|
let o = null, i = 0, l = null;
|
|
8565
|
-
n !== null ? (o = n.__key,
|
|
8565
|
+
n !== null ? (o = n.__key, q(n) ? (i = n.getTextContentSize(), l = "text") : N(n) && (i = n.getChildrenSize(), l = "element")) : s !== null && (o = s.__key, q(s) ? l = "text" : N(s) && (l = "element")), o !== null && l !== null ? r.set(o, i, l) : (i = e.getIndexWithinParent(), i === -1 && (i = t.getChildrenSize()), r.set(t.__key, i, "element"));
|
|
8566
8566
|
}
|
|
8567
8567
|
function So(r, e, t, n, s) {
|
|
8568
8568
|
r.type === "text" ? (r.key = t, e || (r.offset += s)) : r.offset > n.getIndexWithinParent() && (r.offset -= 1);
|
|
@@ -8570,51 +8570,51 @@ function So(r, e, t, n, s) {
|
|
|
8570
8570
|
function Sc(r, e, t, n, s, o, i) {
|
|
8571
8571
|
const l = n.anchorNode, a = n.focusNode, u = n.anchorOffset, c = n.focusOffset, d = document.activeElement;
|
|
8572
8572
|
if (s.has("collaboration") && d !== o || d !== null && Ai(d)) return;
|
|
8573
|
-
if (!
|
|
8573
|
+
if (!M(e)) return void (r !== null && yn(t, l, a) && n.removeAllRanges());
|
|
8574
8574
|
const f = e.anchor, h = e.focus, g = f.key, m = h.key, y = Hn(t, g), C = Hn(t, m), x = f.offset, A = h.offset, w = e.format, E = e.style, v = e.isCollapsed();
|
|
8575
8575
|
let b = y, D = C, k = !1;
|
|
8576
8576
|
if (f.type === "text") {
|
|
8577
8577
|
b = Gn(y);
|
|
8578
|
-
const
|
|
8579
|
-
k =
|
|
8580
|
-
} else
|
|
8581
|
-
var
|
|
8582
|
-
if (h.type === "text" && (D = Gn(C)), b !== null && D !== null && (v && (r === null || k ||
|
|
8578
|
+
const O = f.getNode();
|
|
8579
|
+
k = O.getFormat() !== w || O.getStyle() !== E;
|
|
8580
|
+
} else M(r) && r.anchor.type === "text" && (k = !0);
|
|
8581
|
+
var I, B, F, L, j;
|
|
8582
|
+
if (h.type === "text" && (D = Gn(C)), b !== null && D !== null && (v && (r === null || k || M(r) && (r.format !== w || r.style !== E)) && (I = w, B = E, F = x, L = g, j = performance.now(), Ql = [I, B, F, L, j]), u !== x || c !== A || l !== b || a !== D || n.type === "Range" && v || (d !== null && o.contains(d) || o.focus({ preventScroll: !0 }), f.type === "element"))) {
|
|
8583
8583
|
try {
|
|
8584
8584
|
n.setBaseAndExtent(b, x, D, A);
|
|
8585
8585
|
} catch {
|
|
8586
8586
|
}
|
|
8587
8587
|
if (!s.has("skip-scroll-into-view") && e.isCollapsed() && o !== null && o === document.activeElement) {
|
|
8588
|
-
const
|
|
8589
|
-
if (
|
|
8590
|
-
let
|
|
8591
|
-
if (
|
|
8588
|
+
const O = e instanceof er && e.anchor.type === "element" ? b.childNodes[x] || null : n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
8589
|
+
if (O !== null) {
|
|
8590
|
+
let X;
|
|
8591
|
+
if (O instanceof Text) {
|
|
8592
8592
|
const de = document.createRange();
|
|
8593
|
-
de.selectNode(
|
|
8594
|
-
} else
|
|
8593
|
+
de.selectNode(O), X = de.getBoundingClientRect();
|
|
8594
|
+
} else X = O.getBoundingClientRect();
|
|
8595
8595
|
(function(de, ie, oe) {
|
|
8596
8596
|
const ve = oe.ownerDocument, pe = ve.defaultView;
|
|
8597
8597
|
if (pe === null) return;
|
|
8598
8598
|
let { top: we, bottom: Se } = ie, Oe = 0, ke = 0, Ce = oe;
|
|
8599
8599
|
for (; Ce !== null; ) {
|
|
8600
|
-
const
|
|
8601
|
-
if (
|
|
8600
|
+
const Ve = Ce === ve.body;
|
|
8601
|
+
if (Ve) Oe = 0, ke = hs(de).innerHeight;
|
|
8602
8602
|
else {
|
|
8603
8603
|
const ge = Ce.getBoundingClientRect();
|
|
8604
8604
|
Oe = ge.top, ke = ge.bottom;
|
|
8605
8605
|
}
|
|
8606
8606
|
let ze = 0;
|
|
8607
|
-
if (we < Oe ? ze = -(Oe - we) : Se > ke && (ze = Se - ke), ze !== 0) if (
|
|
8607
|
+
if (we < Oe ? ze = -(Oe - we) : Se > ke && (ze = Se - ke), ze !== 0) if (Ve) pe.scrollBy(0, ze);
|
|
8608
8608
|
else {
|
|
8609
8609
|
const ge = Ce.scrollTop;
|
|
8610
8610
|
Ce.scrollTop += ze;
|
|
8611
8611
|
const Me = Ce.scrollTop - ge;
|
|
8612
8612
|
we -= Me, Se -= Me;
|
|
8613
8613
|
}
|
|
8614
|
-
if (
|
|
8614
|
+
if (Ve) break;
|
|
8615
8615
|
Ce = xn(Ce);
|
|
8616
8616
|
}
|
|
8617
|
-
})(t,
|
|
8617
|
+
})(t, X, o);
|
|
8618
8618
|
}
|
|
8619
8619
|
}
|
|
8620
8620
|
ri = !0;
|
|
@@ -8628,7 +8628,7 @@ function Is(r) {
|
|
|
8628
8628
|
let e = r;
|
|
8629
8629
|
r.isCollapsed() || e.removeText();
|
|
8630
8630
|
const t = V();
|
|
8631
|
-
|
|
8631
|
+
M(t) && (e = t), M(e) || z(161);
|
|
8632
8632
|
const n = e.anchor;
|
|
8633
8633
|
let s = n.getNode(), o = n.offset;
|
|
8634
8634
|
for (; !Vt(s); ) [s, o] = kc(s, o);
|
|
@@ -8640,7 +8640,7 @@ function kc(r, e) {
|
|
|
8640
8640
|
const s = Le();
|
|
8641
8641
|
return Ee().append(s), s.select(), [Ee(), 0];
|
|
8642
8642
|
}
|
|
8643
|
-
if (
|
|
8643
|
+
if (q(r)) {
|
|
8644
8644
|
const s = r.splitText(e);
|
|
8645
8645
|
if (s.length === 0) return [t, r.getIndexWithinParent()];
|
|
8646
8646
|
const o = e === 0 ? 0 : 1;
|
|
@@ -8660,16 +8660,16 @@ function Cn() {
|
|
|
8660
8660
|
return tt || Ie !== null && Ie._readOnly;
|
|
8661
8661
|
}
|
|
8662
8662
|
function et() {
|
|
8663
|
-
tt &&
|
|
8663
|
+
tt && z(13);
|
|
8664
8664
|
}
|
|
8665
8665
|
function la() {
|
|
8666
|
-
On > 99 &&
|
|
8666
|
+
On > 99 && z(14);
|
|
8667
8667
|
}
|
|
8668
8668
|
function $t() {
|
|
8669
|
-
return Ie === null &&
|
|
8669
|
+
return Ie === null && z(195, aa()), Ie;
|
|
8670
8670
|
}
|
|
8671
8671
|
function Be() {
|
|
8672
|
-
return $e === null &&
|
|
8672
|
+
return $e === null && z(196, aa()), $e;
|
|
8673
8673
|
}
|
|
8674
8674
|
function aa() {
|
|
8675
8675
|
let r = 0;
|
|
@@ -8691,7 +8691,7 @@ function Tc() {
|
|
|
8691
8691
|
function To(r, e, t) {
|
|
8692
8692
|
const n = e.__type, s = function(l, a) {
|
|
8693
8693
|
const u = l._nodes.get(a);
|
|
8694
|
-
return u === void 0 &&
|
|
8694
|
+
return u === void 0 && z(30, a), u;
|
|
8695
8695
|
}(r, n);
|
|
8696
8696
|
let o = t.get(n);
|
|
8697
8697
|
o === void 0 && (o = Array.from(s.transforms), t.set(n, o));
|
|
@@ -8713,9 +8713,9 @@ function Bc(r) {
|
|
|
8713
8713
|
}
|
|
8714
8714
|
function Ri(r, e) {
|
|
8715
8715
|
const t = r.type, n = e.get(t);
|
|
8716
|
-
n === void 0 &&
|
|
8716
|
+
n === void 0 && z(17, t);
|
|
8717
8717
|
const s = n.klass;
|
|
8718
|
-
r.type !== s.getType() &&
|
|
8718
|
+
r.type !== s.getType() && z(18, s.name);
|
|
8719
8719
|
const o = s.importJSON(r), i = r.children;
|
|
8720
8720
|
if (N(o) && Array.isArray(i)) for (let l = 0; l < i.length; l++) {
|
|
8721
8721
|
const a = Ri(i[l], e);
|
|
@@ -8754,9 +8754,9 @@ function Jt(r, e) {
|
|
|
8754
8754
|
a && (r._dirtyType = ur, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements = /* @__PURE__ */ new Map(), r._normalizedNodes = /* @__PURE__ */ new Set(), r._updateTags = /* @__PURE__ */ new Set()), function(v, b) {
|
|
8755
8755
|
const D = v._decorators;
|
|
8756
8756
|
let k = v._pendingDecorators || D;
|
|
8757
|
-
const
|
|
8757
|
+
const I = b._nodeMap;
|
|
8758
8758
|
let B;
|
|
8759
|
-
for (B in k)
|
|
8759
|
+
for (B in k) I.has(B) || (k === D && (k = Pl(v)), delete k[B]);
|
|
8760
8760
|
}(r, t);
|
|
8761
8761
|
const w = s ? null : ut(r._window);
|
|
8762
8762
|
if (r._editable && w !== null && (a || l === null || l.dirty)) {
|
|
@@ -8771,17 +8771,17 @@ function Jt(r, e) {
|
|
|
8771
8771
|
$e = d, Ie = u;
|
|
8772
8772
|
}
|
|
8773
8773
|
}
|
|
8774
|
-
g !== null && function(v, b, D, k,
|
|
8774
|
+
g !== null && function(v, b, D, k, I) {
|
|
8775
8775
|
const B = Array.from(v._listeners.mutation), F = B.length;
|
|
8776
8776
|
for (let L = 0; L < F; L++) {
|
|
8777
|
-
const [j,
|
|
8778
|
-
|
|
8777
|
+
const [j, O] = B[L], X = b.get(O);
|
|
8778
|
+
X !== void 0 && j(X, { dirtyLeaves: k, prevEditorState: I, updateTags: D });
|
|
8779
8779
|
}
|
|
8780
|
-
}(r, g, x, m, o),
|
|
8780
|
+
}(r, g, x, m, o), M(l) || l === null || i !== null && i.is(l) || r.dispatchCommand(fi, void 0);
|
|
8781
8781
|
const E = r._pendingDecorators;
|
|
8782
8782
|
E !== null && (r._decorators = E, r._pendingDecorators = null, sn("decorator", r, !0, E)), function(v, b, D) {
|
|
8783
|
-
const k = ro(b),
|
|
8784
|
-
k !==
|
|
8783
|
+
const k = ro(b), I = ro(D);
|
|
8784
|
+
k !== I && sn("textcontent", v, !0, I);
|
|
8785
8785
|
}(r, e || o, t), sn("update", r, !0, { dirtyElements: y, dirtyLeaves: m, editorState: t, normalizedNodes: C, prevEditorState: e || o, tags: x }), function(v, b) {
|
|
8786
8786
|
if (v._deferred = [], b.length !== 0) {
|
|
8787
8787
|
const D = v._updating;
|
|
@@ -8797,8 +8797,8 @@ function Jt(r, e) {
|
|
|
8797
8797
|
if (b.length !== 0) {
|
|
8798
8798
|
const D = b.shift();
|
|
8799
8799
|
if (D) {
|
|
8800
|
-
const [k,
|
|
8801
|
-
da(v, k,
|
|
8800
|
+
const [k, I] = D;
|
|
8801
|
+
da(v, k, I);
|
|
8802
8802
|
}
|
|
8803
8803
|
}
|
|
8804
8804
|
}(r);
|
|
@@ -8844,7 +8844,7 @@ function Fo(r, e) {
|
|
|
8844
8844
|
if (i !== void 0) {
|
|
8845
8845
|
if (l = i.onUpdate, i.skipTransforms && (n = !0), i.discrete) {
|
|
8846
8846
|
const a = r._pendingEditorState;
|
|
8847
|
-
a === null &&
|
|
8847
|
+
a === null && z(191), a._flushSync = !0;
|
|
8848
8848
|
}
|
|
8849
8849
|
l && r._deferred.push(l), ua(r, i.tag);
|
|
8850
8850
|
}
|
|
@@ -8865,12 +8865,12 @@ function da(r, e, t) {
|
|
|
8865
8865
|
try {
|
|
8866
8866
|
u && (r._headless ? l._selection !== null && (a._selection = l._selection.clone()) : a._selection = function(C) {
|
|
8867
8867
|
const x = C.getEditorState()._selection, A = ut(C._window);
|
|
8868
|
-
return
|
|
8868
|
+
return M(x) || x == null ? Pi(x, A, C, null) : x.clone();
|
|
8869
8869
|
}(r));
|
|
8870
8870
|
const m = r._compositionKey;
|
|
8871
8871
|
e(), o = Fo(r, o), function(C, x) {
|
|
8872
8872
|
const A = x.getEditorState()._selection, w = C._selection;
|
|
8873
|
-
if (
|
|
8873
|
+
if (M(w)) {
|
|
8874
8874
|
const E = w.anchor, v = w.focus;
|
|
8875
8875
|
let b;
|
|
8876
8876
|
if (E.type === "text" && (b = E.getNode(), b.selectionTransform(A, w)), v.type === "text") {
|
|
@@ -8882,17 +8882,17 @@ function da(r, e, t) {
|
|
|
8882
8882
|
const A = x._dirtyLeaves, w = C._nodeMap;
|
|
8883
8883
|
for (const E of A) {
|
|
8884
8884
|
const v = w.get(E);
|
|
8885
|
-
|
|
8885
|
+
q(v) && v.isAttached() && v.isSimpleText() && !v.isUnmergeable() && eo(v);
|
|
8886
8886
|
}
|
|
8887
8887
|
}(a, r) : function(C, x) {
|
|
8888
8888
|
const A = x._dirtyLeaves, w = x._dirtyElements, E = C._nodeMap, v = Ht(), b = /* @__PURE__ */ new Map();
|
|
8889
|
-
let D = A, k = D.size,
|
|
8889
|
+
let D = A, k = D.size, I = w, B = I.size;
|
|
8890
8890
|
for (; k > 0 || B > 0; ) {
|
|
8891
8891
|
if (k > 0) {
|
|
8892
8892
|
x._dirtyLeaves = /* @__PURE__ */ new Set();
|
|
8893
8893
|
for (const F of D) {
|
|
8894
8894
|
const L = E.get(F);
|
|
8895
|
-
|
|
8895
|
+
q(L) && L.isAttached() && L.isSimpleText() && !L.isUnmergeable() && eo(L), L !== void 0 && Bo(L, v) && To(x, L, b), A.add(F);
|
|
8896
8896
|
}
|
|
8897
8897
|
if (D = x._dirtyLeaves, k = D.size, k > 0) {
|
|
8898
8898
|
On++;
|
|
@@ -8900,13 +8900,13 @@ function da(r, e, t) {
|
|
|
8900
8900
|
}
|
|
8901
8901
|
}
|
|
8902
8902
|
x._dirtyLeaves = /* @__PURE__ */ new Set(), x._dirtyElements = /* @__PURE__ */ new Map();
|
|
8903
|
-
for (const F of
|
|
8903
|
+
for (const F of I) {
|
|
8904
8904
|
const L = F[0], j = F[1];
|
|
8905
8905
|
if (L !== "root" && !j) continue;
|
|
8906
|
-
const
|
|
8907
|
-
|
|
8906
|
+
const O = E.get(L);
|
|
8907
|
+
O !== void 0 && Bo(O, v) && To(x, O, b), w.set(L, j);
|
|
8908
8908
|
}
|
|
8909
|
-
D = x._dirtyLeaves, k = D.size,
|
|
8909
|
+
D = x._dirtyLeaves, k = D.size, I = x._dirtyElements, B = I.size, On++;
|
|
8910
8910
|
}
|
|
8911
8911
|
x._dirtyLeaves = A, x._dirtyElements = w;
|
|
8912
8912
|
}(a, r), Fo(r), function(C, x, A, w) {
|
|
@@ -8922,9 +8922,9 @@ function da(r, e, t) {
|
|
|
8922
8922
|
}
|
|
8923
8923
|
}(l, a, r._dirtyLeaves, r._dirtyElements)), m !== r._compositionKey && (a._flushSync = !0);
|
|
8924
8924
|
const y = a._selection;
|
|
8925
|
-
if (
|
|
8925
|
+
if (M(y)) {
|
|
8926
8926
|
const C = a._nodeMap, x = y.anchor.key, A = y.focus.key;
|
|
8927
|
-
C.get(x) !== void 0 && C.get(A) !== void 0 ||
|
|
8927
|
+
C.get(x) !== void 0 && C.get(A) !== void 0 || z(19);
|
|
8928
8928
|
} else kt(y) && y._nodes.size === 0 && (a._selection = null);
|
|
8929
8929
|
} catch (m) {
|
|
8930
8930
|
return m instanceof Error && r._onError(m), r._pendingEditorState = l, r._dirtyType = Br, r._cloneNotNeeded.clear(), r._dirtyLeaves = /* @__PURE__ */ new Set(), r._dirtyElements.clear(), void Jt(r);
|
|
@@ -8959,13 +8959,13 @@ class on {
|
|
|
8959
8959
|
}
|
|
8960
8960
|
insertChild(e) {
|
|
8961
8961
|
const t = this.before || this.getManagedLineBreak();
|
|
8962
|
-
return t !== null && t.parentElement !== this.element &&
|
|
8962
|
+
return t !== null && t.parentElement !== this.element && z(222), this.element.insertBefore(e, t), this;
|
|
8963
8963
|
}
|
|
8964
8964
|
removeChild(e) {
|
|
8965
|
-
return e.parentElement !== this.element &&
|
|
8965
|
+
return e.parentElement !== this.element && z(223), this.element.removeChild(e), this;
|
|
8966
8966
|
}
|
|
8967
8967
|
replaceChild(e, t) {
|
|
8968
|
-
return t.parentElement !== this.element &&
|
|
8968
|
+
return t.parentElement !== this.element && z(224), this.element.replaceChild(e, t), this;
|
|
8969
8969
|
}
|
|
8970
8970
|
getFirstChild() {
|
|
8971
8971
|
const e = this.after ? this.after.nextSibling : this.element.firstChild;
|
|
@@ -9033,7 +9033,7 @@ function jo(r, e) {
|
|
|
9033
9033
|
for (let o = n.previousSibling; o !== null; o = n.previousSibling) s++;
|
|
9034
9034
|
t.push(s);
|
|
9035
9035
|
}
|
|
9036
|
-
return n !== r &&
|
|
9036
|
+
return n !== r && z(225), t.reverse();
|
|
9037
9037
|
}
|
|
9038
9038
|
class zt extends gs {
|
|
9039
9039
|
constructor(e) {
|
|
@@ -9085,7 +9085,7 @@ class zt extends gs {
|
|
|
9085
9085
|
const e = [];
|
|
9086
9086
|
let t = this.getFirstChild();
|
|
9087
9087
|
for (; t !== null; ) {
|
|
9088
|
-
if (
|
|
9088
|
+
if (q(t) && e.push(t), N(t)) {
|
|
9089
9089
|
const n = t.getAllTextNodes();
|
|
9090
9090
|
e.push(...n);
|
|
9091
9091
|
}
|
|
@@ -9122,19 +9122,19 @@ class zt extends gs {
|
|
|
9122
9122
|
}
|
|
9123
9123
|
getFirstChild() {
|
|
9124
9124
|
const e = this.getLatest().__first;
|
|
9125
|
-
return e === null ? null :
|
|
9125
|
+
return e === null ? null : Ke(e);
|
|
9126
9126
|
}
|
|
9127
9127
|
getFirstChildOrThrow() {
|
|
9128
9128
|
const e = this.getFirstChild();
|
|
9129
|
-
return e === null &&
|
|
9129
|
+
return e === null && z(45, this.__key), e;
|
|
9130
9130
|
}
|
|
9131
9131
|
getLastChild() {
|
|
9132
9132
|
const e = this.getLatest().__last;
|
|
9133
|
-
return e === null ? null :
|
|
9133
|
+
return e === null ? null : Ke(e);
|
|
9134
9134
|
}
|
|
9135
9135
|
getLastChildOrThrow() {
|
|
9136
9136
|
const e = this.getLastChild();
|
|
9137
|
-
return e === null &&
|
|
9137
|
+
return e === null && z(96, this.__key), e;
|
|
9138
9138
|
}
|
|
9139
9139
|
getChildAtIndex(e) {
|
|
9140
9140
|
const t = this.getChildrenSize();
|
|
@@ -9188,15 +9188,15 @@ class zt extends gs {
|
|
|
9188
9188
|
if (!this.canBeEmpty()) {
|
|
9189
9189
|
if (e === 0 && t === 0) {
|
|
9190
9190
|
const a = this.getFirstChild();
|
|
9191
|
-
if (
|
|
9191
|
+
if (q(a) || N(a)) return a.select(0, 0);
|
|
9192
9192
|
} else if (!(e !== void 0 && e !== i || t !== void 0 && t !== i)) {
|
|
9193
9193
|
const a = this.getLastChild();
|
|
9194
|
-
if (
|
|
9194
|
+
if (q(a) || N(a)) return a.select();
|
|
9195
9195
|
}
|
|
9196
9196
|
}
|
|
9197
9197
|
s === void 0 && (s = i), o === void 0 && (o = i);
|
|
9198
9198
|
const l = this.__key;
|
|
9199
|
-
return
|
|
9199
|
+
return M(n) ? (n.anchor.set(l, s, "element"), n.focus.set(l, o, "element"), n.dirty = !0, n) : ia(l, s, l, o, "element", "element");
|
|
9200
9200
|
}
|
|
9201
9201
|
selectStart() {
|
|
9202
9202
|
const e = this.getFirstDescendant();
|
|
@@ -9228,7 +9228,7 @@ class zt extends gs {
|
|
|
9228
9228
|
}
|
|
9229
9229
|
splice(e, t, n) {
|
|
9230
9230
|
const s = n.length, o = this.getChildrenSize(), i = this.getWritable();
|
|
9231
|
-
e + t <= o ||
|
|
9231
|
+
e + t <= o || z(226, String(e), String(t), String(o));
|
|
9232
9232
|
const l = i.__key, a = [], u = [], c = this.getChildAtIndex(e + t);
|
|
9233
9233
|
let d = null, f = o - t + s;
|
|
9234
9234
|
if (e !== 0) if (e === o) d = this.getLastChild();
|
|
@@ -9239,7 +9239,7 @@ class zt extends gs {
|
|
|
9239
9239
|
if (t > 0) {
|
|
9240
9240
|
let g = d === null ? this.getFirstChild() : d.getNextSibling();
|
|
9241
9241
|
for (let m = 0; m < t; m++) {
|
|
9242
|
-
g === null &&
|
|
9242
|
+
g === null && z(100);
|
|
9243
9243
|
const y = g.getNextSibling(), C = g.__key;
|
|
9244
9244
|
lr(g.getWritable()), u.push(C), g = y;
|
|
9245
9245
|
}
|
|
@@ -9256,7 +9256,7 @@ class zt extends gs {
|
|
|
9256
9256
|
const x = h.getWritable();
|
|
9257
9257
|
x.__next = C, y.__prev = x.__key;
|
|
9258
9258
|
}
|
|
9259
|
-
m.__key === l &&
|
|
9259
|
+
m.__key === l && z(76), y.__parent = l, a.push(C), h = m;
|
|
9260
9260
|
}
|
|
9261
9261
|
if (e + t === o)
|
|
9262
9262
|
h !== null && (h.getWritable().__next = null, i.__last = h.__key);
|
|
@@ -9269,7 +9269,7 @@ class zt extends gs {
|
|
|
9269
9269
|
}
|
|
9270
9270
|
if (i.__size = f, u.length) {
|
|
9271
9271
|
const g = V();
|
|
9272
|
-
if (
|
|
9272
|
+
if (M(g)) {
|
|
9273
9273
|
const m = new Set(u), y = new Set(a), { anchor: C, focus: x } = g;
|
|
9274
9274
|
Lo(C, m, y) && ts(C, C.getNode(), this, d, c), Lo(x, m, y) && ts(x, x.getNode(), this, d, c), f !== 0 || this.canBeEmpty() || Ft(this) || this.remove();
|
|
9275
9275
|
}
|
|
@@ -9358,7 +9358,7 @@ class Nc extends gs {
|
|
|
9358
9358
|
super(e);
|
|
9359
9359
|
}
|
|
9360
9360
|
decorate(e, t) {
|
|
9361
|
-
|
|
9361
|
+
z(47);
|
|
9362
9362
|
}
|
|
9363
9363
|
isIsolated() {
|
|
9364
9364
|
return !1;
|
|
@@ -9384,23 +9384,23 @@ class Dn extends zt {
|
|
|
9384
9384
|
super("root"), this.__cachedText = null;
|
|
9385
9385
|
}
|
|
9386
9386
|
getTopLevelElementOrThrow() {
|
|
9387
|
-
|
|
9387
|
+
z(51);
|
|
9388
9388
|
}
|
|
9389
9389
|
getTextContent() {
|
|
9390
9390
|
const e = this.__cachedText;
|
|
9391
9391
|
return !Cn() && Be()._dirtyType !== ur || e === null ? super.getTextContent() : e;
|
|
9392
9392
|
}
|
|
9393
9393
|
remove() {
|
|
9394
|
-
|
|
9394
|
+
z(52);
|
|
9395
9395
|
}
|
|
9396
9396
|
replace(e) {
|
|
9397
|
-
|
|
9397
|
+
z(53);
|
|
9398
9398
|
}
|
|
9399
9399
|
insertBefore(e) {
|
|
9400
|
-
|
|
9400
|
+
z(54);
|
|
9401
9401
|
}
|
|
9402
9402
|
insertAfter(e) {
|
|
9403
|
-
|
|
9403
|
+
z(55);
|
|
9404
9404
|
}
|
|
9405
9405
|
updateDOM(e, t) {
|
|
9406
9406
|
return !1;
|
|
@@ -9408,7 +9408,7 @@ class Dn extends zt {
|
|
|
9408
9408
|
append(...e) {
|
|
9409
9409
|
for (let t = 0; t < e.length; t++) {
|
|
9410
9410
|
const n = e[t];
|
|
9411
|
-
N(n) || me(n) ||
|
|
9411
|
+
N(n) || me(n) || z(56);
|
|
9412
9412
|
}
|
|
9413
9413
|
return super.append(...e);
|
|
9414
9414
|
}
|
|
@@ -9423,7 +9423,7 @@ class Dn extends zt {
|
|
|
9423
9423
|
return !0;
|
|
9424
9424
|
}
|
|
9425
9425
|
}
|
|
9426
|
-
function
|
|
9426
|
+
function Ye(r) {
|
|
9427
9427
|
return r instanceof Dn;
|
|
9428
9428
|
}
|
|
9429
9429
|
function fa(r) {
|
|
@@ -9434,9 +9434,9 @@ function Oi() {
|
|
|
9434
9434
|
}
|
|
9435
9435
|
function ha(r) {
|
|
9436
9436
|
const e = r.exportJSON(), t = r.constructor;
|
|
9437
|
-
if (e.type !== t.getType() &&
|
|
9437
|
+
if (e.type !== t.getType() && z(130, t.name), N(r)) {
|
|
9438
9438
|
const n = e.children;
|
|
9439
|
-
Array.isArray(n) ||
|
|
9439
|
+
Array.isArray(n) || z(59, t.name);
|
|
9440
9440
|
const s = r.getChildren();
|
|
9441
9441
|
for (let o = 0; o < s.length; o++) {
|
|
9442
9442
|
const i = ha(s[o]);
|
|
@@ -9541,7 +9541,7 @@ class Pr extends zt {
|
|
|
9541
9541
|
}
|
|
9542
9542
|
collapseAtStart() {
|
|
9543
9543
|
const e = this.getChildren();
|
|
9544
|
-
if (e.length === 0 ||
|
|
9544
|
+
if (e.length === 0 || q(e[0]) && e[0].getTextContent().trim() === "") {
|
|
9545
9545
|
if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0;
|
|
9546
9546
|
if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0;
|
|
9547
9547
|
}
|
|
@@ -9636,11 +9636,11 @@ class xs {
|
|
|
9636
9636
|
};
|
|
9637
9637
|
}
|
|
9638
9638
|
registerCommand(e, t, n) {
|
|
9639
|
-
n === void 0 &&
|
|
9639
|
+
n === void 0 && z(35);
|
|
9640
9640
|
const s = this._commands;
|
|
9641
9641
|
s.has(e) || s.set(e, [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()]);
|
|
9642
9642
|
const o = s.get(e);
|
|
9643
|
-
o === void 0 &&
|
|
9643
|
+
o === void 0 && z(36, String(e));
|
|
9644
9644
|
const i = o[n];
|
|
9645
9645
|
return i.add(t), () => {
|
|
9646
9646
|
i.delete(t), o.every((l) => l.size === 0) && s.delete(e);
|
|
@@ -9656,7 +9656,7 @@ class xs {
|
|
|
9656
9656
|
}
|
|
9657
9657
|
getRegisteredNode(e) {
|
|
9658
9658
|
const t = this._nodes.get(e.getType());
|
|
9659
|
-
return t === void 0 &&
|
|
9659
|
+
return t === void 0 && z(37, e.name), t;
|
|
9660
9660
|
}
|
|
9661
9661
|
resolveRegisteredNodeAfterReplacements(e) {
|
|
9662
9662
|
for (; e.replaceWithKlass; ) e = this.getRegisteredNode(e.replaceWithKlass);
|
|
@@ -9765,7 +9765,7 @@ class xs {
|
|
|
9765
9765
|
return this._editorState;
|
|
9766
9766
|
}
|
|
9767
9767
|
setEditorState(e, t) {
|
|
9768
|
-
e.isEmpty() &&
|
|
9768
|
+
e.isEmpty() && z(38);
|
|
9769
9769
|
let n = e;
|
|
9770
9770
|
n._readOnly && (n = fa(e), n._selection = e._selection ? e._selection.clone() : null), Tl(this);
|
|
9771
9771
|
const s = this._pendingEditorState, o = this._updateTags, i = t !== void 0 ? t.tag : null;
|
|
@@ -9890,7 +9890,7 @@ function qc(r) {
|
|
|
9890
9890
|
const o = s.getChildren(), i = o.length;
|
|
9891
9891
|
for (let l = 0; l < i; l++) {
|
|
9892
9892
|
const a = o[n];
|
|
9893
|
-
if (!
|
|
9893
|
+
if (!q(a)) return !1;
|
|
9894
9894
|
}
|
|
9895
9895
|
}
|
|
9896
9896
|
}
|
|
@@ -9974,7 +9974,7 @@ function Qc(r, e, t, n) {
|
|
|
9974
9974
|
}
|
|
9975
9975
|
function Yc(r) {
|
|
9976
9976
|
const e = r.anchor.getNode();
|
|
9977
|
-
return (
|
|
9977
|
+
return (Ye(e) ? e : e.getParentOrThrow()).getDirection() === "rtl";
|
|
9978
9978
|
}
|
|
9979
9979
|
function Ro(r, e, t) {
|
|
9980
9980
|
const n = Yc(r);
|
|
@@ -9982,7 +9982,7 @@ function Ro(r, e, t) {
|
|
|
9982
9982
|
}
|
|
9983
9983
|
function Oo(r) {
|
|
9984
9984
|
if (me(r) || !N(r) || Ft(r)) return !1;
|
|
9985
|
-
const e = r.getFirstChild(), t = e === null || ar(e) ||
|
|
9985
|
+
const e = r.getFirstChild(), t = e === null || ar(e) || q(e) || e.isInline();
|
|
9986
9986
|
return !r.isInline() && r.canBeEmpty() !== !1 && t;
|
|
9987
9987
|
}
|
|
9988
9988
|
function Xc(r) {
|
|
@@ -10059,10 +10059,10 @@ function nd(r) {
|
|
|
10059
10059
|
const [u, c, d, f, h, g] = a;
|
|
10060
10060
|
r.update(() => {
|
|
10061
10061
|
const m = V();
|
|
10062
|
-
if (
|
|
10062
|
+
if (M(m)) {
|
|
10063
10063
|
const y = m.anchor;
|
|
10064
10064
|
let C = y.getNode(), x = 0, A = 0;
|
|
10065
|
-
if (
|
|
10065
|
+
if (q(C) && u >= 0 && c >= 0 && (x = u, A = u + c, m.setTextNodeRange(C, x, C, A)), x === A && d === "" || (m.insertRawText(d), C = y.getNode()), q(C)) {
|
|
10066
10066
|
x = f, A = f + h;
|
|
10067
10067
|
const w = C.getTextContentSize();
|
|
10068
10068
|
x = x > w ? w : x, A = A > w ? w : A, m.setTextNodeRange(C, x, C, A);
|
|
@@ -10112,7 +10112,7 @@ function Ca(r, e, t, n = null) {
|
|
|
10112
10112
|
let i = e;
|
|
10113
10113
|
if (n !== null) {
|
|
10114
10114
|
let h = Fi(e);
|
|
10115
|
-
h =
|
|
10115
|
+
h = q(h) && n !== null ? ya(n, h) : h, i = h;
|
|
10116
10116
|
}
|
|
10117
10117
|
const l = N(i) ? i.getChildren() : [], a = r._nodes.get(i.getType());
|
|
10118
10118
|
let u;
|
|
@@ -10190,10 +10190,10 @@ var rs = id(function(r) {
|
|
|
10190
10190
|
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
10191
10191
|
});
|
|
10192
10192
|
function od(r, e = V()) {
|
|
10193
|
-
return e == null && rs(166),
|
|
10193
|
+
return e == null && rs(166), M(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : wa(r, e);
|
|
10194
10194
|
}
|
|
10195
10195
|
function ld(r, e = V()) {
|
|
10196
|
-
return e == null && rs(166),
|
|
10196
|
+
return e == null && rs(166), M(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(ad(r, e));
|
|
10197
10197
|
}
|
|
10198
10198
|
function Mo(r, e, t) {
|
|
10199
10199
|
const n = r.getData("application/x-lexical-editor");
|
|
@@ -10212,12 +10212,12 @@ function Mo(r, e, t) {
|
|
|
10212
10212
|
} catch {
|
|
10213
10213
|
}
|
|
10214
10214
|
const o = r.getData("text/plain") || r.getData("text/uri-list");
|
|
10215
|
-
if (o != null) if (
|
|
10215
|
+
if (o != null) if (M(e)) {
|
|
10216
10216
|
const i = o.split(/(\r?\n|\t)/);
|
|
10217
10217
|
i[i.length - 1] === "" && i.pop();
|
|
10218
10218
|
for (let l = 0; l < i.length; l++) {
|
|
10219
10219
|
const a = V();
|
|
10220
|
-
if (
|
|
10220
|
+
if (M(a)) {
|
|
10221
10221
|
const u = i[l];
|
|
10222
10222
|
u === `
|
|
10223
10223
|
` || u === `\r
|
|
@@ -10235,7 +10235,7 @@ function Ea(r, e, t, n = []) {
|
|
|
10235
10235
|
let i = t;
|
|
10236
10236
|
if (e !== null) {
|
|
10237
10237
|
let u = Fi(t);
|
|
10238
|
-
u =
|
|
10238
|
+
u = q(u) && e !== null ? ya(e, u) : u, i = u;
|
|
10239
10239
|
}
|
|
10240
10240
|
const l = N(i) ? i.getChildren() : [], a = function(u) {
|
|
10241
10241
|
const c = u.exportJSON(), d = u.constructor;
|
|
@@ -10245,7 +10245,7 @@ function Ea(r, e, t, n = []) {
|
|
|
10245
10245
|
}
|
|
10246
10246
|
return c;
|
|
10247
10247
|
}(i);
|
|
10248
|
-
if (
|
|
10248
|
+
if (q(i)) {
|
|
10249
10249
|
const u = i.__text;
|
|
10250
10250
|
u.length > 0 ? a.text = u : s = !1;
|
|
10251
10251
|
}
|
|
@@ -10270,7 +10270,7 @@ function ud(r) {
|
|
|
10270
10270
|
const e = [];
|
|
10271
10271
|
for (let t = 0; t < r.length; t++) {
|
|
10272
10272
|
const n = r[t], s = Bc(n);
|
|
10273
|
-
|
|
10273
|
+
q(s) && Hc(s), e.push(s);
|
|
10274
10274
|
}
|
|
10275
10275
|
return e;
|
|
10276
10276
|
}
|
|
@@ -10478,7 +10478,7 @@ function jn(r) {
|
|
|
10478
10478
|
}
|
|
10479
10479
|
function Vo(r) {
|
|
10480
10480
|
const e = V();
|
|
10481
|
-
if (!
|
|
10481
|
+
if (!M(e)) return !1;
|
|
10482
10482
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes();
|
|
10483
10483
|
for (let s = 0; s < n.length; s++) {
|
|
10484
10484
|
const o = n[s], i = o.getKey();
|
|
@@ -10500,13 +10500,13 @@ function bd(r) {
|
|
|
10500
10500
|
return !!kt(t) && (t.clear(), !0);
|
|
10501
10501
|
}, 0), r.registerCommand(or, (e) => {
|
|
10502
10502
|
const t = V();
|
|
10503
|
-
return !!
|
|
10503
|
+
return !!M(t) && (t.deleteCharacter(e), !0);
|
|
10504
10504
|
}, ce), r.registerCommand(an, (e) => {
|
|
10505
10505
|
const t = V();
|
|
10506
|
-
return !!
|
|
10506
|
+
return !!M(t) && (t.deleteWord(e), !0);
|
|
10507
10507
|
}, ce), r.registerCommand(un, (e) => {
|
|
10508
10508
|
const t = V();
|
|
10509
|
-
return !!
|
|
10509
|
+
return !!M(t) && (t.deleteLine(e), !0);
|
|
10510
10510
|
}, ce), r.registerCommand(Sr, (e) => {
|
|
10511
10511
|
const t = V();
|
|
10512
10512
|
if (typeof e == "string") t !== null && t.insertText(e);
|
|
@@ -10514,7 +10514,7 @@ function bd(r) {
|
|
|
10514
10514
|
if (t === null) return !1;
|
|
10515
10515
|
const n = e.dataTransfer;
|
|
10516
10516
|
if (n != null) Mo(n, t, r);
|
|
10517
|
-
else if (
|
|
10517
|
+
else if (M(t)) {
|
|
10518
10518
|
const s = e.data;
|
|
10519
10519
|
return s && t.insertText(s), !0;
|
|
10520
10520
|
}
|
|
@@ -10522,13 +10522,13 @@ function bd(r) {
|
|
|
10522
10522
|
return !0;
|
|
10523
10523
|
}, ce), r.registerCommand(Ws, () => {
|
|
10524
10524
|
const e = V();
|
|
10525
|
-
return !!
|
|
10525
|
+
return !!M(e) && (e.removeText(), !0);
|
|
10526
10526
|
}, ce), r.registerCommand(xt, (e) => {
|
|
10527
10527
|
const t = V();
|
|
10528
|
-
return !!
|
|
10528
|
+
return !!M(t) && (t.formatText(e), !0);
|
|
10529
10529
|
}, ce), r.registerCommand(ku, (e) => {
|
|
10530
10530
|
const t = V();
|
|
10531
|
-
if (!
|
|
10531
|
+
if (!M(t) && !kt(t)) return !1;
|
|
10532
10532
|
const n = t.getNodes();
|
|
10533
10533
|
for (const s of n) {
|
|
10534
10534
|
const o = bs(s, (i) => N(i) && !i.isInline());
|
|
@@ -10537,10 +10537,10 @@ function bd(r) {
|
|
|
10537
10537
|
return !0;
|
|
10538
10538
|
}, ce), r.registerCommand(Er, (e) => {
|
|
10539
10539
|
const t = V();
|
|
10540
|
-
return !!
|
|
10540
|
+
return !!M(t) && (t.insertLineBreak(e), !0);
|
|
10541
10541
|
}, ce), r.registerCommand(ln, () => {
|
|
10542
10542
|
const e = V();
|
|
10543
|
-
return !!
|
|
10543
|
+
return !!M(e) && (e.insertParagraph(), !0);
|
|
10544
10544
|
}, ce), r.registerCommand(Eu, () => (oa([vn()]), !0), ce), r.registerCommand(Su, () => Vo((e) => {
|
|
10545
10545
|
const t = e.getIndent();
|
|
10546
10546
|
e.setIndent(t + 1);
|
|
@@ -10552,7 +10552,7 @@ function bd(r) {
|
|
|
10552
10552
|
if (kt(t) && !Ln(e.target)) {
|
|
10553
10553
|
const n = t.getNodes();
|
|
10554
10554
|
if (n.length > 0) return n[0].selectPrevious(), !0;
|
|
10555
|
-
} else if (
|
|
10555
|
+
} else if (M(t)) {
|
|
10556
10556
|
const n = cn(t.focus, !0);
|
|
10557
10557
|
if (!e.shiftKey && me(n) && !n.isIsolated() && !n.isInline()) return n.selectPrevious(), e.preventDefault(), !0;
|
|
10558
10558
|
}
|
|
@@ -10562,7 +10562,7 @@ function bd(r) {
|
|
|
10562
10562
|
if (kt(t)) {
|
|
10563
10563
|
const n = t.getNodes();
|
|
10564
10564
|
if (n.length > 0) return n[0].selectNext(0, 0), !0;
|
|
10565
|
-
} else if (
|
|
10565
|
+
} else if (M(t)) {
|
|
10566
10566
|
if (function(s) {
|
|
10567
10567
|
const o = s.focus;
|
|
10568
10568
|
return o.key === "root" && o.offset === Ee().getChildrenSize();
|
|
@@ -10577,7 +10577,7 @@ function bd(r) {
|
|
|
10577
10577
|
const n = t.getNodes();
|
|
10578
10578
|
if (n.length > 0) return e.preventDefault(), n[0].selectPrevious(), !0;
|
|
10579
10579
|
}
|
|
10580
|
-
if (!
|
|
10580
|
+
if (!M(t)) return !1;
|
|
10581
10581
|
if (Po(t, !0)) {
|
|
10582
10582
|
const n = e.shiftKey;
|
|
10583
10583
|
return e.preventDefault(), Ro(t, n, !0), !0;
|
|
@@ -10589,22 +10589,22 @@ function bd(r) {
|
|
|
10589
10589
|
const s = t.getNodes();
|
|
10590
10590
|
if (s.length > 0) return e.preventDefault(), s[0].selectNext(0, 0), !0;
|
|
10591
10591
|
}
|
|
10592
|
-
if (!
|
|
10592
|
+
if (!M(t)) return !1;
|
|
10593
10593
|
const n = e.shiftKey;
|
|
10594
10594
|
return !!Po(t, !1) && (e.preventDefault(), Ro(t, n, !1), !0);
|
|
10595
10595
|
}, ce), r.registerCommand(xl, (e) => {
|
|
10596
10596
|
if (Ln(e.target)) return !1;
|
|
10597
10597
|
const t = V();
|
|
10598
|
-
if (!
|
|
10598
|
+
if (!M(t)) return !1;
|
|
10599
10599
|
const { anchor: n } = t, s = n.getNode();
|
|
10600
|
-
return t.isCollapsed() && n.offset === 0 && !
|
|
10600
|
+
return t.isCollapsed() && n.offset === 0 && !Ye(s) && rd(s).getIndent() > 0 ? (e.preventDefault(), r.dispatchCommand(Qi, void 0)) : (!Uo || navigator.language !== "ko-KR") && (e.preventDefault(), r.dispatchCommand(or, !0));
|
|
10601
10601
|
}, ce), r.registerCommand(_l, (e) => {
|
|
10602
10602
|
if (Ln(e.target)) return !1;
|
|
10603
10603
|
const t = V();
|
|
10604
|
-
return !!
|
|
10604
|
+
return !!M(t) && (e.preventDefault(), r.dispatchCommand(or, !1));
|
|
10605
10605
|
}, ce), r.registerCommand($n, (e) => {
|
|
10606
10606
|
const t = V();
|
|
10607
|
-
if (!
|
|
10607
|
+
if (!M(t)) return !1;
|
|
10608
10608
|
if (e !== null) {
|
|
10609
10609
|
if ((Uo || gd || yd) && pd) return !1;
|
|
10610
10610
|
if (e.preventDefault(), e.shiftKey) return r.dispatchCommand(Er, !1);
|
|
@@ -10612,7 +10612,7 @@ function bd(r) {
|
|
|
10612
10612
|
return r.dispatchCommand(ln, void 0);
|
|
10613
10613
|
}, ce), r.registerCommand(bl, () => {
|
|
10614
10614
|
const e = V();
|
|
10615
|
-
return !!
|
|
10615
|
+
return !!M(e) && (r.blur(), !0);
|
|
10616
10616
|
}, ce), r.registerCommand(vl, (e) => {
|
|
10617
10617
|
const [, t] = jn(e);
|
|
10618
10618
|
if (t.length > 0) {
|
|
@@ -10621,7 +10621,7 @@ function bd(r) {
|
|
|
10621
10621
|
const { offset: o, node: i } = s, l = Nr(i);
|
|
10622
10622
|
if (l !== null) {
|
|
10623
10623
|
const a = Ec();
|
|
10624
|
-
if (
|
|
10624
|
+
if (q(l)) a.anchor.set(l.getKey(), o, "text"), a.focus.set(l.getKey(), o, "text");
|
|
10625
10625
|
else {
|
|
10626
10626
|
const c = l.getParentOrThrow().getKey(), d = l.getIndexWithinParent() + 1;
|
|
10627
10627
|
a.anchor.set(c, d, "element"), a.focus.set(c, d, "element");
|
|
@@ -10634,13 +10634,13 @@ function bd(r) {
|
|
|
10634
10634
|
return e.preventDefault(), !0;
|
|
10635
10635
|
}
|
|
10636
10636
|
const n = V();
|
|
10637
|
-
return !!
|
|
10637
|
+
return !!M(n);
|
|
10638
10638
|
}, ce), r.registerCommand(wl, (e) => {
|
|
10639
10639
|
const [t] = jn(e), n = V();
|
|
10640
|
-
return !(t && !
|
|
10640
|
+
return !(t && !M(n));
|
|
10641
10641
|
}, ce), r.registerCommand(Cl, (e) => {
|
|
10642
10642
|
const [t] = jn(e), n = V();
|
|
10643
|
-
if (t && !
|
|
10643
|
+
if (t && !M(n)) return !1;
|
|
10644
10644
|
const s = qo(e.clientX, e.clientY);
|
|
10645
10645
|
if (s !== null) {
|
|
10646
10646
|
const o = Nr(s.node);
|
|
@@ -10650,7 +10650,7 @@ function bd(r) {
|
|
|
10650
10650
|
}, ce), r.registerCommand(Gs, () => (oc(), !0), ce), r.registerCommand(ls, (e) => ($o(r, Qt(e, ClipboardEvent) ? e : null), !0), ce), r.registerCommand(gi, (e) => (async function(t, n) {
|
|
10651
10651
|
await $o(n, Qt(t, ClipboardEvent) ? t : null), n.update(() => {
|
|
10652
10652
|
const s = V();
|
|
10653
|
-
|
|
10653
|
+
M(s) ? s.removeText() : kt(s) && s.getNodes().forEach((o) => o.remove());
|
|
10654
10654
|
});
|
|
10655
10655
|
}(e, r), !0), ce), r.registerCommand(os, (e) => {
|
|
10656
10656
|
const [, t, n] = jn(e);
|
|
@@ -10709,7 +10709,7 @@ const Sa = typeof window < "u" && window.document !== void 0 && window.document.
|
|
|
10709
10709
|
function wd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaControls: n, ariaDescribedBy: s, ariaErrorMessage: o, ariaExpanded: i, ariaInvalid: l, ariaLabel: a, ariaLabelledBy: u, ariaMultiline: c, ariaOwns: d, ariaRequired: f, autoCapitalize: h, className: g, id: m, role: y = "textbox", spellCheck: C = !0, style: x, tabIndex: A, "data-testid": w, ...E }, v) {
|
|
10710
10710
|
const [b, D] = H(r.isEditable()), k = re((B) => {
|
|
10711
10711
|
B && B.ownerDocument && B.ownerDocument.defaultView ? r.setRootElement(B) : r.setRootElement(null);
|
|
10712
|
-
}, [r]),
|
|
10712
|
+
}, [r]), I = bt(() => /* @__PURE__ */ function(...B) {
|
|
10713
10713
|
return (F) => {
|
|
10714
10714
|
B.forEach((L) => {
|
|
10715
10715
|
typeof L == "function" ? L(F) : L != null && (L.current = F);
|
|
@@ -10718,7 +10718,7 @@ function wd({ editor: r, ariaActiveDescendant: e, ariaAutoComplete: t, ariaContr
|
|
|
10718
10718
|
}(v, k), [k, v]);
|
|
10719
10719
|
return Sa(() => (D(r.isEditable()), r.registerEditableListener((B) => {
|
|
10720
10720
|
D(B);
|
|
10721
|
-
})), [r]), p.jsx("div", { "aria-activedescendant": b ? e : void 0, "aria-autocomplete": b ? t : "none", "aria-controls": b ? n : void 0, "aria-describedby": s, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": b && y === "combobox" ? !!i : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": b ? d : void 0, "aria-readonly": !b || void 0, "aria-required": f, autoCapitalize: h, className: g, contentEditable: b, "data-testid": w, id: m, ref:
|
|
10721
|
+
})), [r]), p.jsx("div", { "aria-activedescendant": b ? e : void 0, "aria-autocomplete": b ? t : "none", "aria-controls": b ? n : void 0, "aria-describedby": s, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": b && y === "combobox" ? !!i : void 0, ...l != null ? { "aria-invalid": l } : {}, "aria-label": a, "aria-labelledby": u, "aria-multiline": c, "aria-owns": b ? d : void 0, "aria-readonly": !b || void 0, "aria-required": f, autoCapitalize: h, className: g, contentEditable: b, "data-testid": w, id: m, ref: I, role: b ? y : void 0, spellCheck: C, style: x, tabIndex: A, ...E });
|
|
10722
10722
|
}
|
|
10723
10723
|
const Cd = al(wd);
|
|
10724
10724
|
function Ho(r) {
|
|
@@ -10755,7 +10755,7 @@ function Bd(r, e, t, n, s) {
|
|
|
10755
10755
|
if (r === null || t.size === 0 && n.size === 0 && !s) return yt;
|
|
10756
10756
|
const o = e._selection, i = r._selection;
|
|
10757
10757
|
if (s) return Sd;
|
|
10758
|
-
if (!(
|
|
10758
|
+
if (!(M(o) && M(i) && i.isCollapsed() && o.isCollapsed())) return yt;
|
|
10759
10759
|
const l = function(C, x, A) {
|
|
10760
10760
|
const w = C._nodeMap, E = [];
|
|
10761
10761
|
for (const v of x) {
|
|
@@ -10765,17 +10765,17 @@ function Bd(r, e, t, n, s) {
|
|
|
10765
10765
|
for (const [v, b] of A) {
|
|
10766
10766
|
if (!b) continue;
|
|
10767
10767
|
const D = w.get(v);
|
|
10768
|
-
D === void 0 ||
|
|
10768
|
+
D === void 0 || Ye(D) || E.push(D);
|
|
10769
10769
|
}
|
|
10770
10770
|
return E;
|
|
10771
10771
|
}(e, t, n);
|
|
10772
10772
|
if (l.length === 0) return yt;
|
|
10773
10773
|
if (l.length > 1) {
|
|
10774
10774
|
const C = e._nodeMap, x = C.get(o.anchor.key), A = C.get(i.anchor.key);
|
|
10775
|
-
return x && A && !r._nodeMap.has(x.__key) &&
|
|
10775
|
+
return x && A && !r._nodeMap.has(x.__key) && q(x) && x.__text.length === 1 && o.anchor.offset === 1 ? Jo : yt;
|
|
10776
10776
|
}
|
|
10777
10777
|
const a = l[0], u = r._nodeMap.get(a.__key);
|
|
10778
|
-
if (!
|
|
10778
|
+
if (!q(u) || !q(a) || u.__mode !== a.__mode) return yt;
|
|
10779
10779
|
const c = u.__text, d = a.__text;
|
|
10780
10780
|
if (c === d) return yt;
|
|
10781
10781
|
const f = o.anchor, h = i.anchor;
|
|
@@ -10795,7 +10795,7 @@ function Nd(r, e) {
|
|
|
10795
10795
|
const m = o._selection;
|
|
10796
10796
|
return l.size > 0 || a.size > 0 ? g === !1 && d !== yt && d === n && c < t + e && h || l.size === 1 && function(y, C, x) {
|
|
10797
10797
|
const A = C._nodeMap.get(y), w = x._nodeMap.get(y), E = C._selection, v = x._selection;
|
|
10798
|
-
return !(
|
|
10798
|
+
return !(M(E) && M(v) && E.anchor.type === "element" && E.focus.type === "element" && v.anchor.type === "text" && v.focus.type === "text" || !q(A) || !q(w) || A.__parent !== w.__parent) && JSON.stringify(C.read(() => A.exportJSON())) === JSON.stringify(x.read(() => w.exportJSON()));
|
|
10799
10799
|
}(Array.from(l)[0], s, o) ? Pn : ai : m !== null ? Pn : ui;
|
|
10800
10800
|
})();
|
|
10801
10801
|
return t = c, n = d, f;
|
|
@@ -10945,7 +10945,7 @@ function Zo(r, e) {
|
|
|
10945
10945
|
const t = V();
|
|
10946
10946
|
if (t !== null) {
|
|
10947
10947
|
const n = t.getNodes();
|
|
10948
|
-
if (
|
|
10948
|
+
if (M(t)) {
|
|
10949
10949
|
const o = t.getStartEndPoints();
|
|
10950
10950
|
o === null && Tt(143);
|
|
10951
10951
|
const [i] = o, l = i.getNode(), a = l.getParent();
|
|
@@ -11016,7 +11016,7 @@ function $i(r, e) {
|
|
|
11016
11016
|
function zd(r) {
|
|
11017
11017
|
r.update(() => {
|
|
11018
11018
|
const e = V();
|
|
11019
|
-
if (
|
|
11019
|
+
if (M(e)) {
|
|
11020
11020
|
const t = /* @__PURE__ */ new Set(), n = e.getNodes(), s = e.anchor.getNode();
|
|
11021
11021
|
if (Ta(s, n)) t.add(di(s));
|
|
11022
11022
|
else for (let o = 0; o < n.length; o++) {
|
|
@@ -11080,7 +11080,7 @@ function Ud(r) {
|
|
|
11080
11080
|
}
|
|
11081
11081
|
function Wd() {
|
|
11082
11082
|
const r = V();
|
|
11083
|
-
if (!
|
|
11083
|
+
if (!M(r) || !r.isCollapsed()) return !1;
|
|
11084
11084
|
const e = r.anchor.getNode();
|
|
11085
11085
|
if (!Te(e) || e.getChildrenSize() !== 0) return !1;
|
|
11086
11086
|
const t = di(e), n = e.getParent();
|
|
@@ -11261,7 +11261,7 @@ class gr extends zt {
|
|
|
11261
11261
|
return Fr(e) || Te(e);
|
|
11262
11262
|
}
|
|
11263
11263
|
extractWithChild(e, t) {
|
|
11264
|
-
if (!
|
|
11264
|
+
if (!M(t)) return !1;
|
|
11265
11265
|
const n = t.anchor.getNode(), s = t.focus.getNode();
|
|
11266
11266
|
return this.isParentOf(n) && this.isParentOf(s) && this.getTextContent().length === t.getTextContent().length;
|
|
11267
11267
|
}
|
|
@@ -11537,7 +11537,7 @@ class mr extends zt {
|
|
|
11537
11537
|
return !0;
|
|
11538
11538
|
}
|
|
11539
11539
|
extractWithChild(e, t, n) {
|
|
11540
|
-
if (!
|
|
11540
|
+
if (!M(t)) return !1;
|
|
11541
11541
|
const s = t.anchor.getNode(), o = t.focus.getNode();
|
|
11542
11542
|
return this.isParentOf(s) && this.isParentOf(o) && t.getTextContent().length > 0;
|
|
11543
11543
|
}
|
|
@@ -11613,7 +11613,7 @@ function Zd(r) {
|
|
|
11613
11613
|
const ll = pn();
|
|
11614
11614
|
function zs(r, e = {}) {
|
|
11615
11615
|
const { target: t, title: n } = e, s = e.rel === void 0 ? "noreferrer" : e.rel, o = V();
|
|
11616
|
-
if (!
|
|
11616
|
+
if (!M(o)) return;
|
|
11617
11617
|
const i = o.extract();
|
|
11618
11618
|
if (r === null) i.forEach((l) => {
|
|
11619
11619
|
const a = bs(l, (u) => !Zd(u) && Vr(u));
|
|
@@ -11662,7 +11662,7 @@ function ef({ validateUrl: r, attributes: e }) {
|
|
|
11662
11662
|
}
|
|
11663
11663
|
}, Ar), r !== void 0 ? t.registerCommand(os, (n) => {
|
|
11664
11664
|
const s = V();
|
|
11665
|
-
if (!
|
|
11665
|
+
if (!M(s) || s.isCollapsed() || !Qt(n, ClipboardEvent)) return !1;
|
|
11666
11666
|
const o = n;
|
|
11667
11667
|
if (o.clipboardData === null) return !1;
|
|
11668
11668
|
const i = o.clipboardData.getData("text");
|
|
@@ -11701,7 +11701,7 @@ const tf = {
|
|
|
11701
11701
|
}
|
|
11702
11702
|
};
|
|
11703
11703
|
function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiRewrite: s, aiProcessing: o, aiProcessingAction: i, onAiAction: l, hasContent: a }) {
|
|
11704
|
-
const [u] = vt(), [c, d] =
|
|
11704
|
+
const [u] = vt(), [c, d] = Je.useState(!1), f = Je.useRef(null), h = t || n || s, g = re(() => {
|
|
11705
11705
|
u.dispatchCommand(xt, "bold");
|
|
11706
11706
|
}, [u]), m = re(() => {
|
|
11707
11707
|
u.dispatchCommand(xt, "italic");
|
|
@@ -11714,7 +11714,7 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
11714
11714
|
}, [u]), A = re(() => {
|
|
11715
11715
|
u.update(() => {
|
|
11716
11716
|
const b = V();
|
|
11717
|
-
|
|
11717
|
+
M(b) && Jc(b, () => Ii());
|
|
11718
11718
|
});
|
|
11719
11719
|
}, [u]), w = {
|
|
11720
11720
|
display: "flex",
|
|
@@ -12012,7 +12012,7 @@ function nf({ theme: r, disabled: e, onAiRestructure: t, onAiProofread: n, onAiR
|
|
|
12012
12012
|
);
|
|
12013
12013
|
}
|
|
12014
12014
|
function sf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
|
|
12015
|
-
const [n] = vt(), s =
|
|
12015
|
+
const [n] = vt(), s = Je.useRef(!1);
|
|
12016
12016
|
return De(() => {
|
|
12017
12017
|
r && (s.current && !e || (s.current = !0, n.update(
|
|
12018
12018
|
() => {
|
|
@@ -12030,21 +12030,21 @@ function sf({ html: r, isExternalUpdate: e, onImportComplete: t }) {
|
|
|
12030
12030
|
}, [r, e, n, t]), null;
|
|
12031
12031
|
}
|
|
12032
12032
|
function of({ text: r, trigger: e }) {
|
|
12033
|
-
const [t] = vt(), n =
|
|
12033
|
+
const [t] = vt(), n = Je.useRef(void 0);
|
|
12034
12034
|
return De(() => {
|
|
12035
12035
|
if (e === void 0 || e === n.current || !r) return;
|
|
12036
12036
|
n.current = e;
|
|
12037
12037
|
const s = r.trim();
|
|
12038
12038
|
s && (t.update(() => {
|
|
12039
12039
|
const o = V();
|
|
12040
|
-
if (
|
|
12040
|
+
if (M(o))
|
|
12041
12041
|
o.insertText(s);
|
|
12042
12042
|
else {
|
|
12043
12043
|
const i = Ee(), l = i.getLastChild();
|
|
12044
12044
|
if (l) {
|
|
12045
12045
|
l.selectEnd();
|
|
12046
12046
|
const a = V();
|
|
12047
|
-
|
|
12047
|
+
M(a) && a.insertText(s);
|
|
12048
12048
|
} else {
|
|
12049
12049
|
const a = Le(), u = Pe(s);
|
|
12050
12050
|
a.append(u), i.append(a);
|
|
@@ -12128,26 +12128,26 @@ function af({
|
|
|
12128
12128
|
aiProcessingAction: m,
|
|
12129
12129
|
renderAboveToolbar: y
|
|
12130
12130
|
}) {
|
|
12131
|
-
const C = { ...tf, ...s }, [x, A] =
|
|
12132
|
-
|
|
12131
|
+
const C = { ...tf, ...s }, [x, A] = Je.useState(!1), w = Je.useRef(void 0), [E, v] = Je.useState(r), [b, D] = Je.useState(!1), [k, I] = Je.useState(null), B = g ?? b, F = m ?? k;
|
|
12132
|
+
Je.useEffect(() => {
|
|
12133
12133
|
a !== void 0 && a !== w.current && (w.current = a, A(!0));
|
|
12134
12134
|
}, [a]);
|
|
12135
12135
|
const L = re(() => {
|
|
12136
12136
|
A(!1);
|
|
12137
|
-
}, []), j = (pe) => pe.replace(/<[^>]*>/g, "").trim(),
|
|
12138
|
-
`).map((we) => `<p>${we || "<br>"}</p>`).join(""),
|
|
12137
|
+
}, []), j = (pe) => pe.replace(/<[^>]*>/g, "").trim(), O = (pe) => pe.split(`
|
|
12138
|
+
`).map((we) => `<p>${we || "<br>"}</p>`).join(""), X = async (pe) => {
|
|
12139
12139
|
const we = j(E);
|
|
12140
12140
|
if (!we) return;
|
|
12141
12141
|
const Se = pe === "restructure" ? d : pe === "proofread" ? f : h;
|
|
12142
12142
|
if (Se) {
|
|
12143
|
-
D(!0),
|
|
12143
|
+
D(!0), I(pe);
|
|
12144
12144
|
try {
|
|
12145
|
-
const Oe = await Se(we), ke =
|
|
12145
|
+
const Oe = await Se(we), ke = O(Oe);
|
|
12146
12146
|
v(ke), e == null || e(ke), w.current = Date.now(), A(!0);
|
|
12147
12147
|
} catch (Oe) {
|
|
12148
12148
|
console.error(`AI ${pe} failed:`, Oe);
|
|
12149
12149
|
} finally {
|
|
12150
|
-
D(!1),
|
|
12150
|
+
D(!1), I(null);
|
|
12151
12151
|
}
|
|
12152
12152
|
}
|
|
12153
12153
|
}, de = j(E).length > 0, ie = {
|
|
@@ -12265,7 +12265,7 @@ function af({
|
|
|
12265
12265
|
onAiRewrite: h,
|
|
12266
12266
|
aiProcessing: B,
|
|
12267
12267
|
aiProcessingAction: F,
|
|
12268
|
-
onAiAction:
|
|
12268
|
+
onAiAction: X,
|
|
12269
12269
|
hasContent: de
|
|
12270
12270
|
}
|
|
12271
12271
|
),
|
|
@@ -12359,15 +12359,19 @@ function Sf({
|
|
|
12359
12359
|
onAiRewrite: w,
|
|
12360
12360
|
renderAboveToolbar: E
|
|
12361
12361
|
}) {
|
|
12362
|
-
const v = { ...uf, ...c }, [b, D] = H(r), [k,
|
|
12363
|
-
|
|
12364
|
-
l !== void 0 && l !==
|
|
12362
|
+
const v = { ...uf, ...c }, [b, D] = H(r), [k, I] = H(""), [B, F] = H(""), [L, j] = H(e), [O, X] = H(t), [de, ie] = H([]), [oe, ve] = H(!1), [pe, we] = H(""), [Se, Oe] = H(f), [ke, Ce] = H(!1), Ve = Je.useRef(void 0);
|
|
12363
|
+
Je.useEffect(() => {
|
|
12364
|
+
l !== void 0 && l !== Ve.current && (Ve.current = l, X(t), Ce(!0));
|
|
12365
12365
|
}, [l, t]);
|
|
12366
12366
|
const ze = (W) => {
|
|
12367
|
-
|
|
12367
|
+
X(W), Ce(!1), i == null || i(W);
|
|
12368
12368
|
}, ge = xe(null), [Me, ct] = H(!1), Ct = (W) => {
|
|
12369
12369
|
const be = W.target.files;
|
|
12370
|
-
|
|
12370
|
+
if (be) {
|
|
12371
|
+
const qe = Array.from(be);
|
|
12372
|
+
console.log("[MailComposer] Files selected:", qe.map((R) => ({ name: R.name, size: R.size, type: R.type }))), ie((R) => [...R, ...qe]);
|
|
12373
|
+
}
|
|
12374
|
+
ge.current && (ge.current.value = "");
|
|
12371
12375
|
}, qt = (W) => {
|
|
12372
12376
|
W.preventDefault(), W.stopPropagation(), ct(!0);
|
|
12373
12377
|
}, it = (W) => {
|
|
@@ -12375,7 +12379,7 @@ function Sf({
|
|
|
12375
12379
|
}, ot = (W) => {
|
|
12376
12380
|
W.preventDefault(), W.stopPropagation(), ct(!1), W.dataTransfer.files && ie((be) => [...be, ...Array.from(W.dataTransfer.files)]);
|
|
12377
12381
|
}, dt = (W) => W.type.startsWith("image/") ? "image" : W.type === "application/pdf" ? "picture_as_pdf" : W.type.includes("spreadsheet") || W.type.includes("excel") ? "table_chart" : W.type.includes("document") || W.type.includes("word") ? "description" : "attach_file", Ut = (W) => {
|
|
12378
|
-
ie((be) => be.filter((
|
|
12382
|
+
ie((be) => be.filter((qe, R) => R !== W));
|
|
12379
12383
|
}, Wt = (W) => W < 1024 ? `${W} B` : W < 1024 * 1024 ? `${(W / 1024).toFixed(1)} KB` : `${(W / (1024 * 1024)).toFixed(1)} MB`, Dt = async () => {
|
|
12380
12384
|
if (!b.trim()) {
|
|
12381
12385
|
we("Recipient email is required");
|
|
@@ -12388,19 +12392,18 @@ function Sf({
|
|
|
12388
12392
|
ve(!0), we("");
|
|
12389
12393
|
try {
|
|
12390
12394
|
const W = await Promise.all(
|
|
12391
|
-
de.map(async (
|
|
12392
|
-
const
|
|
12393
|
-
new Uint8Array(
|
|
12395
|
+
de.map(async (R) => {
|
|
12396
|
+
const T = await R.arrayBuffer(), Q = btoa(
|
|
12397
|
+
new Uint8Array(T).reduce((J, S) => J + String.fromCharCode(S), "")
|
|
12394
12398
|
);
|
|
12395
12399
|
return {
|
|
12396
|
-
filename:
|
|
12397
|
-
content_type:
|
|
12398
|
-
data:
|
|
12399
|
-
size:
|
|
12400
|
+
filename: R.name,
|
|
12401
|
+
content_type: R.type || "application/octet-stream",
|
|
12402
|
+
data: Q,
|
|
12403
|
+
size: R.size
|
|
12400
12404
|
};
|
|
12401
12405
|
})
|
|
12402
|
-
), be =
|
|
12403
|
-
await s({
|
|
12406
|
+
), be = O.replace(/>\n+</g, "><").replace(/<p class="[^"]*"><\/p>/g, "<br>").trim(), qe = {
|
|
12404
12407
|
to: b.trim(),
|
|
12405
12408
|
cc: k.trim() || void 0,
|
|
12406
12409
|
bcc: B.trim() || void 0,
|
|
@@ -12408,7 +12411,11 @@ function Sf({
|
|
|
12408
12411
|
html: be,
|
|
12409
12412
|
attachments: W,
|
|
12410
12413
|
inReplyTo: n == null ? void 0 : n.messageId
|
|
12411
|
-
}
|
|
12414
|
+
};
|
|
12415
|
+
console.log("[MailComposer] Sending email - to:", qe.to, "subject:", qe.subject, "attachmentsCount:", qe.attachments.length), qe.attachments.length > 0 && qe.attachments.forEach((R, T) => {
|
|
12416
|
+
var Q;
|
|
12417
|
+
console.log(`[MailComposer] Attachment ${T + 1}:`, R.filename, "size:", R.size, "type:", R.content_type, "data length:", ((Q = R.data) == null ? void 0 : Q.length) || 0);
|
|
12418
|
+
}), await s(qe), D(""), I(""), F(""), j(""), X(""), ie([]);
|
|
12412
12419
|
} catch (W) {
|
|
12413
12420
|
we(W instanceof Error ? W.message : "Failed to send email");
|
|
12414
12421
|
} finally {
|
|
@@ -12510,7 +12517,7 @@ function Sf({
|
|
|
12510
12517
|
{
|
|
12511
12518
|
type: "email",
|
|
12512
12519
|
value: k,
|
|
12513
|
-
onChange: (W) =>
|
|
12520
|
+
onChange: (W) => I(W.target.value),
|
|
12514
12521
|
placeholder: "cc@example.com",
|
|
12515
12522
|
disabled: d || oe,
|
|
12516
12523
|
style: ft
|
|
@@ -12549,7 +12556,7 @@ function Sf({
|
|
|
12549
12556
|
/* @__PURE__ */ p.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", minHeight: 0 }, children: /* @__PURE__ */ p.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ p.jsx(
|
|
12550
12557
|
af,
|
|
12551
12558
|
{
|
|
12552
|
-
value:
|
|
12559
|
+
value: O,
|
|
12553
12560
|
onChange: ze,
|
|
12554
12561
|
placeholder: h,
|
|
12555
12562
|
replyTo: n,
|
|
@@ -12743,7 +12750,7 @@ function kf({
|
|
|
12743
12750
|
if (!E) return;
|
|
12744
12751
|
const B = await (o == null ? void 0 : o(y.trim()));
|
|
12745
12752
|
B && b(B.id), C("");
|
|
12746
|
-
}, [E, y, o, b]),
|
|
12753
|
+
}, [E, y, o, b]), I = re((B) => {
|
|
12747
12754
|
B.key === "Enter" ? (B.preventDefault(), E ? k() : w.length > 0 && b(w[0].id)) : B.key === "Backspace" && !y && e.length > 0 ? D(e[e.length - 1]) : B.key === "Escape" && (m(!1), C(""));
|
|
12748
12755
|
}, [E, w, y, e, k, b, D]);
|
|
12749
12756
|
return /* @__PURE__ */ p.jsxs("div", { ref: x, className: f, style: { position: "relative" }, children: [
|
|
@@ -12825,7 +12832,7 @@ function kf({
|
|
|
12825
12832
|
C(B.target.value), g || m(!0);
|
|
12826
12833
|
},
|
|
12827
12834
|
onFocus: () => m(!0),
|
|
12828
|
-
onKeyDown:
|
|
12835
|
+
onKeyDown: I,
|
|
12829
12836
|
placeholder: v.length === 0 ? n : "",
|
|
12830
12837
|
disabled: u || c > 0 && e.length >= c,
|
|
12831
12838
|
style: {
|
|
@@ -12967,13 +12974,13 @@ function Tf({
|
|
|
12967
12974
|
itemClassName: h = ""
|
|
12968
12975
|
}) {
|
|
12969
12976
|
const [g, m] = H(null), [y, C] = H(null), [x, A] = H(null), w = xe(null), E = e.reduce((F, L) => {
|
|
12970
|
-
let j = r.filter((
|
|
12971
|
-
return s && (j = j.sort((
|
|
12977
|
+
let j = r.filter((O) => n(O) === L.id);
|
|
12978
|
+
return s && (j = j.sort((O, X) => s(O) - s(X))), F[L.id] = j, F;
|
|
12972
12979
|
}, {}), v = re((F, L) => {
|
|
12973
|
-
const j = t(L),
|
|
12974
|
-
m(j), w.current =
|
|
12975
|
-
const
|
|
12976
|
-
|
|
12980
|
+
const j = t(L), O = n(L);
|
|
12981
|
+
m(j), w.current = O, F.dataTransfer.effectAllowed = "move", F.dataTransfer.setData("text/plain", j), requestAnimationFrame(() => {
|
|
12982
|
+
const X = F.target;
|
|
12983
|
+
X.style.opacity = "0.5";
|
|
12977
12984
|
});
|
|
12978
12985
|
}, [t, n]), b = re((F) => {
|
|
12979
12986
|
const L = F.target;
|
|
@@ -12983,10 +12990,10 @@ function Tf({
|
|
|
12983
12990
|
}, []), k = re((F) => {
|
|
12984
12991
|
const L = F.relatedTarget;
|
|
12985
12992
|
L != null && L.closest("[data-kanban-column]") || (C(null), A(null));
|
|
12986
|
-
}, []),
|
|
12993
|
+
}, []), I = re((F, L, j) => {
|
|
12987
12994
|
if (F.preventDefault(), !g) return;
|
|
12988
|
-
const
|
|
12989
|
-
|
|
12995
|
+
const O = w.current;
|
|
12996
|
+
O === L ? l == null || l(g, L, j) : O && i(g, O, L, j), m(null), C(null), A(null), w.current = null;
|
|
12990
12997
|
}, [g, i, l]), B = (F, L) => /* @__PURE__ */ p.jsxs("div", { className: "flex items-center justify-between px-3 py-2", children: [
|
|
12991
12998
|
/* @__PURE__ */ p.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
12992
12999
|
F.color && /* @__PURE__ */ p.jsx(
|
|
@@ -13012,11 +13019,11 @@ function Tf({
|
|
|
13012
13019
|
{
|
|
13013
13020
|
"data-kanban-column": F.id,
|
|
13014
13021
|
className: `flex-1 min-w-[180px] bg-neutral-50 rounded-xl flex flex-col ${f}`,
|
|
13015
|
-
onDragOver: (
|
|
13016
|
-
|
|
13022
|
+
onDragOver: (O) => {
|
|
13023
|
+
O.preventDefault(), g && !j && C(F.id);
|
|
13017
13024
|
},
|
|
13018
13025
|
onDragLeave: k,
|
|
13019
|
-
onDrop: (
|
|
13026
|
+
onDrop: (O) => I(O, F.id, x ?? L.length),
|
|
13020
13027
|
children: [
|
|
13021
13028
|
/* @__PURE__ */ p.jsx("div", { className: "flex-shrink-0 border-b border-neutral-200", children: u ? u(F, L.length) : B(F, L.length) }),
|
|
13022
13029
|
/* @__PURE__ */ p.jsxs(
|
|
@@ -13024,20 +13031,20 @@ function Tf({
|
|
|
13024
13031
|
{
|
|
13025
13032
|
className: `flex-1 overflow-y-auto p-2 space-y-2 min-h-[100px] transition-colors ${j ? "bg-blue-50" : ""}`,
|
|
13026
13033
|
children: [
|
|
13027
|
-
L.map((
|
|
13028
|
-
const de = t(
|
|
13034
|
+
L.map((O, X) => {
|
|
13035
|
+
const de = t(O), ie = g === de, oe = j && x === X && !ie;
|
|
13029
13036
|
return /* @__PURE__ */ p.jsxs("div", { children: [
|
|
13030
13037
|
oe && /* @__PURE__ */ p.jsx("div", { className: "h-1 bg-blue-500 rounded-full mb-2 mx-1" }),
|
|
13031
13038
|
/* @__PURE__ */ p.jsx(
|
|
13032
13039
|
"div",
|
|
13033
13040
|
{
|
|
13034
13041
|
draggable: !0,
|
|
13035
|
-
onDragStart: (ve) => v(ve,
|
|
13042
|
+
onDragStart: (ve) => v(ve, O),
|
|
13036
13043
|
onDragEnd: b,
|
|
13037
|
-
onDragOver: (ve) => D(ve, F.id,
|
|
13038
|
-
onClick: () => a == null ? void 0 : a(
|
|
13044
|
+
onDragOver: (ve) => D(ve, F.id, X),
|
|
13045
|
+
onClick: () => a == null ? void 0 : a(O),
|
|
13039
13046
|
className: `cursor-grab active:cursor-grabbing transition-all ${ie ? "opacity-50 scale-95" : ""} ${h}`,
|
|
13040
|
-
children: o(
|
|
13047
|
+
children: o(O, ie)
|
|
13041
13048
|
}
|
|
13042
13049
|
)
|
|
13043
13050
|
] }, de);
|
|
@@ -13046,8 +13053,8 @@ function Tf({
|
|
|
13046
13053
|
"div",
|
|
13047
13054
|
{
|
|
13048
13055
|
className: "min-h-[40px] flex-1",
|
|
13049
|
-
onDragOver: (
|
|
13050
|
-
|
|
13056
|
+
onDragOver: (O) => {
|
|
13057
|
+
O.preventDefault(), D(O, F.id, L.length);
|
|
13051
13058
|
},
|
|
13052
13059
|
children: j && x === L.length && /* @__PURE__ */ p.jsx("div", { className: "h-1 bg-blue-500 rounded-full mx-1 mt-1" })
|
|
13053
13060
|
}
|
|
@@ -13122,8 +13129,8 @@ function Bf({
|
|
|
13122
13129
|
if (!D) return null;
|
|
13123
13130
|
const k = ff(D);
|
|
13124
13131
|
if (!k) return null;
|
|
13125
|
-
const { hours:
|
|
13126
|
-
return { top: j, height:
|
|
13132
|
+
const { hours: I, minutes: B } = k, F = Math.max(t, Math.min(n, I)), L = I < t ? 0 : B, j = (F - t) * s + L / 60 * s, O = i(b), X = Math.max(20, O / 60 * s);
|
|
13133
|
+
return { top: j, height: X };
|
|
13127
13134
|
},
|
|
13128
13135
|
[o, i, t, n, s]
|
|
13129
13136
|
), E = bt(() => {
|
|
@@ -13133,8 +13140,8 @@ function Bf({
|
|
|
13133
13140
|
}, [e, f, t, n, s]), v = re(
|
|
13134
13141
|
(b) => {
|
|
13135
13142
|
if (!d) return;
|
|
13136
|
-
const D = b.currentTarget.getBoundingClientRect(),
|
|
13137
|
-
d(
|
|
13143
|
+
const D = b.currentTarget.getBoundingClientRect(), I = (b.clientY - D.top) / s * 60, B = Math.floor(I / 60) + t, F = Math.round(I % 60 / 15) * 15, L = Math.min(n, Math.max(t, B)), j = F >= 60 ? 0 : F, O = `${L.toString().padStart(2, "0")}:${j.toString().padStart(2, "0")}`;
|
|
13144
|
+
d(O);
|
|
13138
13145
|
},
|
|
13139
13146
|
[d, s, t, n]
|
|
13140
13147
|
);
|
|
@@ -13297,48 +13304,48 @@ function Bf({
|
|
|
13297
13304
|
] });
|
|
13298
13305
|
}
|
|
13299
13306
|
function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, variant: s = "widget", hideSaveButton: o = !1 }) {
|
|
13300
|
-
const i = s === "widget", [l, a] = H("idle"), [u, c] = H(0), [d, f] = H(0), [h, g] = H(!1), [m, y] = H(0), [C, x] = H(null), [A, w] = H(!1), [E, v] = H(null), b = xe(null), D = xe(null), k = xe(null),
|
|
13301
|
-
const T = Math.floor(
|
|
13302
|
-
return `${T.toString().padStart(2, "0")}:${
|
|
13303
|
-
}, ge = async (
|
|
13304
|
-
const T = await
|
|
13305
|
-
return await
|
|
13306
|
-
}, Me = (
|
|
13307
|
-
const T =
|
|
13308
|
-
for (let
|
|
13309
|
-
ne.setUint8(ye +
|
|
13307
|
+
const i = s === "widget", [l, a] = H("idle"), [u, c] = H(0), [d, f] = H(0), [h, g] = H(!1), [m, y] = H(0), [C, x] = H(null), [A, w] = H(!1), [E, v] = H(null), b = xe(null), D = xe(null), k = xe(null), I = xe(null), B = xe(null), F = xe([]), L = xe(null), j = xe(null), O = xe(null), X = xe(null), de = xe(!1), ie = xe([]), oe = xe(null), ve = xe(null), pe = xe([]), we = xe([]), Se = xe("insert"), Oe = xe(!1), ke = xe(0), Ce = xe(0), Ve = xe(0), ze = (R) => {
|
|
13308
|
+
const T = Math.floor(R / 60), Q = Math.floor(R % 60);
|
|
13309
|
+
return `${T.toString().padStart(2, "0")}:${Q.toString().padStart(2, "0")}`;
|
|
13310
|
+
}, ge = async (R) => {
|
|
13311
|
+
const T = await R.arrayBuffer(), Q = new AudioContext(), J = await Q.decodeAudioData(T);
|
|
13312
|
+
return await Q.close(), J;
|
|
13313
|
+
}, Me = (R) => {
|
|
13314
|
+
const T = R.numberOfChannels, Q = R.sampleRate, J = 1, S = 16, $ = S / 8, K = T * $, Y = Q * K, ee = R.length * K, ae = new ArrayBuffer(44 + ee), ne = new DataView(ae), te = (ye, fe) => {
|
|
13315
|
+
for (let Ue = 0; Ue < fe.length; Ue++)
|
|
13316
|
+
ne.setUint8(ye + Ue, fe.charCodeAt(Ue));
|
|
13310
13317
|
};
|
|
13311
|
-
te(0, "RIFF"), ne.setUint32(4, 36 + ee, !0), te(8, "WAVE"), te(12, "fmt "), ne.setUint32(16, 16, !0), ne.setUint16(20, J, !0), ne.setUint16(22, T, !0), ne.setUint32(24,
|
|
13318
|
+
te(0, "RIFF"), ne.setUint32(4, 36 + ee, !0), te(8, "WAVE"), te(12, "fmt "), ne.setUint32(16, 16, !0), ne.setUint16(20, J, !0), ne.setUint16(22, T, !0), ne.setUint32(24, Q, !0), ne.setUint32(28, Y, !0), ne.setUint16(32, K, !0), ne.setUint16(34, S, !0), te(36, "data"), ne.setUint32(40, ee, !0);
|
|
13312
13319
|
const Ae = [];
|
|
13313
13320
|
for (let ye = 0; ye < T; ye++)
|
|
13314
|
-
Ae.push(
|
|
13321
|
+
Ae.push(R.getChannelData(ye));
|
|
13315
13322
|
let Fe = 44;
|
|
13316
|
-
for (let ye = 0; ye <
|
|
13323
|
+
for (let ye = 0; ye < R.length; ye++)
|
|
13317
13324
|
for (let fe = 0; fe < T; fe++) {
|
|
13318
|
-
const
|
|
13319
|
-
ne.setInt16(Fe,
|
|
13325
|
+
const Ue = Math.max(-1, Math.min(1, Ae[fe][ye])), We = Ue < 0 ? Ue * 32768 : Ue * 32767;
|
|
13326
|
+
ne.setInt16(Fe, We, !0), Fe += 2;
|
|
13320
13327
|
}
|
|
13321
13328
|
return new Blob([ae], { type: "audio/wav" });
|
|
13322
|
-
}, ct = async (
|
|
13323
|
-
const S = new AudioContext(),
|
|
13329
|
+
}, ct = async (R, T, Q, J) => {
|
|
13330
|
+
const S = new AudioContext(), $ = R.sampleRate, K = Math.max(R.numberOfChannels, T.numberOfChannels), Y = Math.min(Q, R.length), ee = Math.max(0, R.length - Q), ae = J === "insert" ? Y + T.length + ee : Y + T.length, ne = S.createBuffer(K, ae, $);
|
|
13324
13331
|
for (let te = 0; te < K; te++) {
|
|
13325
|
-
const Ae = ne.getChannelData(te), Fe = te <
|
|
13326
|
-
for (let fe = 0; fe <
|
|
13332
|
+
const Ae = ne.getChannelData(te), Fe = te < R.numberOfChannels ? R.getChannelData(te) : R.getChannelData(0);
|
|
13333
|
+
for (let fe = 0; fe < Y; fe++)
|
|
13327
13334
|
Ae[fe] = Fe[fe];
|
|
13328
13335
|
const ye = te < T.numberOfChannels ? T.getChannelData(te) : T.getChannelData(0);
|
|
13329
13336
|
for (let fe = 0; fe < T.length; fe++)
|
|
13330
|
-
Ae[
|
|
13337
|
+
Ae[Y + fe] = ye[fe];
|
|
13331
13338
|
if (J === "insert")
|
|
13332
13339
|
for (let fe = 0; fe < ee; fe++)
|
|
13333
|
-
Ae[
|
|
13340
|
+
Ae[Y + T.length + fe] = Fe[Q + fe];
|
|
13334
13341
|
}
|
|
13335
13342
|
return await S.close(), ne;
|
|
13336
13343
|
}, Ct = re(() => {
|
|
13337
|
-
const
|
|
13338
|
-
if (!
|
|
13339
|
-
const T =
|
|
13344
|
+
const R = b.current;
|
|
13345
|
+
if (!R) return;
|
|
13346
|
+
const T = R.getContext("2d");
|
|
13340
13347
|
if (!T) return;
|
|
13341
|
-
const
|
|
13348
|
+
const Q = R.getBoundingClientRect(), J = Q.width, S = Q.height, $ = ie.current, K = d || u || 1, Y = l === "recording" ? u : m;
|
|
13342
13349
|
T.fillStyle = "#2d3b35", T.fillRect(0, 0, J, S);
|
|
13343
13350
|
const ee = 8, ae = "rgba(0, 0, 0, 0.4)", ne = T.createLinearGradient(0, 0, 0, ee);
|
|
13344
13351
|
ne.addColorStop(0, ae), ne.addColorStop(1, "transparent"), T.fillStyle = ne, T.fillRect(0, 0, J, ee);
|
|
@@ -13349,80 +13356,80 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13349
13356
|
const Fe = T.createLinearGradient(J - ee, 0, J, 0);
|
|
13350
13357
|
Fe.addColorStop(0, "transparent"), Fe.addColorStop(1, ae), T.fillStyle = Fe, T.fillRect(J - ee, 0, ee, S), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, S / 2), T.lineTo(J, S / 2), T.stroke();
|
|
13351
13358
|
const ye = J / 2;
|
|
13352
|
-
if (
|
|
13359
|
+
if ($.length > 0)
|
|
13353
13360
|
if (l === "recording")
|
|
13354
|
-
for (let
|
|
13355
|
-
const lt =
|
|
13361
|
+
for (let We = 0; We < $.length; We++) {
|
|
13362
|
+
const lt = $.length - 1 - We, Et = ye - lt * 4;
|
|
13356
13363
|
if (Et < -3 || Et > J) continue;
|
|
13357
|
-
const pt =
|
|
13364
|
+
const pt = $[We] * (S / 2 - 12), Pt = S / 2 - pt;
|
|
13358
13365
|
T.fillStyle = "#10b981", T.fillRect(Et, Pt, 3, pt * 2);
|
|
13359
13366
|
}
|
|
13360
13367
|
else {
|
|
13361
|
-
const
|
|
13362
|
-
for (let lt = 0; lt <
|
|
13363
|
-
const Et =
|
|
13368
|
+
const We = K > 0 ? Y / K * $.length : 0;
|
|
13369
|
+
for (let lt = 0; lt < $.length; lt++) {
|
|
13370
|
+
const Et = We - lt, pt = ye - Et * 4;
|
|
13364
13371
|
if (pt < -3 || pt > J) continue;
|
|
13365
|
-
const Pt =
|
|
13366
|
-
T.fillStyle = lt <=
|
|
13372
|
+
const Pt = $[lt] * (S / 2 - 12), yr = S / 2 - Pt;
|
|
13373
|
+
T.fillStyle = lt <= We ? "#10b981" : "#4b5563", T.fillRect(pt, yr, 3, Pt * 2);
|
|
13367
13374
|
}
|
|
13368
13375
|
}
|
|
13369
|
-
T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(ye, 0), T.lineTo(ye, S), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText(ze(
|
|
13376
|
+
T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(ye, 0), T.lineTo(ye, S), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText(ze(Y), ye, S - 6), l === "recording" && (T.fillStyle = "#ef4444", T.beginPath(), T.arc(20, 20, 8, 0, Math.PI * 2), T.fill(), T.fillStyle = "#fff", T.font = "10px sans-serif", T.textAlign = "left", T.fillText("REC", 34, 24)), T.textAlign = "left";
|
|
13370
13377
|
}, [l, m, u, d]), qt = () => {
|
|
13371
|
-
const
|
|
13372
|
-
if (!
|
|
13373
|
-
const T =
|
|
13374
|
-
|
|
13378
|
+
const R = B.current;
|
|
13379
|
+
if (!R || !de.current) return;
|
|
13380
|
+
const T = R.frequencyBinCount, Q = new Uint8Array(T);
|
|
13381
|
+
R.getByteTimeDomainData(Q);
|
|
13375
13382
|
let J = 0;
|
|
13376
13383
|
for (let K = 0; K < T; K++) {
|
|
13377
|
-
const
|
|
13378
|
-
J +=
|
|
13384
|
+
const Y = (Q[K] - 128) / 128;
|
|
13385
|
+
J += Y * Y;
|
|
13379
13386
|
}
|
|
13380
|
-
const S = Math.sqrt(J / T),
|
|
13381
|
-
ie.current.push(
|
|
13387
|
+
const S = Math.sqrt(J / T), $ = Math.min(1, S * 3);
|
|
13388
|
+
ie.current.push($), Ct(), de.current && (j.current = requestAnimationFrame(qt));
|
|
13382
13389
|
}, it = async () => {
|
|
13383
13390
|
try {
|
|
13384
13391
|
x(null), w(!1), oe.current === null && (ie.current = []);
|
|
13385
|
-
const
|
|
13386
|
-
k.current =
|
|
13392
|
+
const R = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
13393
|
+
k.current = R;
|
|
13387
13394
|
const T = new AudioContext();
|
|
13388
|
-
|
|
13389
|
-
const
|
|
13390
|
-
|
|
13391
|
-
const S = new MediaRecorder(
|
|
13392
|
-
D.current = S, F.current = [], S.ondataavailable = (
|
|
13393
|
-
|
|
13395
|
+
I.current = T;
|
|
13396
|
+
const Q = T.createAnalyser();
|
|
13397
|
+
Q.fftSize = 2048, B.current = Q, T.createMediaStreamSource(R).connect(Q);
|
|
13398
|
+
const S = new MediaRecorder(R);
|
|
13399
|
+
D.current = S, F.current = [], S.ondataavailable = ($) => {
|
|
13400
|
+
$.data.size > 0 && F.current.push($.data);
|
|
13394
13401
|
}, S.onstop = async () => {
|
|
13395
13402
|
try {
|
|
13396
13403
|
if (de.current = !1, F.current.length === 0) {
|
|
13397
|
-
x("No audio was recorded. Please try again."), a("idle"),
|
|
13404
|
+
x("No audio was recorded. Please try again."), a("idle"), R.getTracks().forEach((ne) => ne.stop());
|
|
13398
13405
|
return;
|
|
13399
13406
|
}
|
|
13400
|
-
const
|
|
13401
|
-
let K,
|
|
13407
|
+
const $ = new Blob(F.current, { type: "audio/webm" });
|
|
13408
|
+
let K, Y;
|
|
13402
13409
|
if (oe.current !== null && ve.current)
|
|
13403
13410
|
try {
|
|
13404
|
-
const ne = await ge(
|
|
13411
|
+
const ne = await ge($), te = ve.current.sampleRate, Ae = Math.floor(oe.current * te), Fe = await ct(
|
|
13405
13412
|
ve.current,
|
|
13406
13413
|
ne,
|
|
13407
13414
|
Ae,
|
|
13408
13415
|
Se.current
|
|
13409
13416
|
);
|
|
13410
|
-
K = Me(Fe),
|
|
13417
|
+
K = Me(Fe), Y = Fe.length / Fe.sampleRate, Se.current === "insert" && (ie.current = [
|
|
13411
13418
|
...ie.current,
|
|
13412
13419
|
...we.current
|
|
13413
13420
|
]), oe.current = null, ve.current = null, pe.current = [], we.current = [];
|
|
13414
13421
|
} catch {
|
|
13415
|
-
K =
|
|
13422
|
+
K = $, Y = ke.current > 0 ? ke.current : 1;
|
|
13416
13423
|
}
|
|
13417
13424
|
else
|
|
13418
|
-
K =
|
|
13419
|
-
|
|
13425
|
+
K = $, Y = ke.current > 0 ? ke.current : 1;
|
|
13426
|
+
X.current = K;
|
|
13420
13427
|
const ee = URL.createObjectURL(K), ae = new Audio(ee);
|
|
13421
13428
|
ae.ontimeupdate = () => {
|
|
13422
13429
|
y(ae.currentTime);
|
|
13423
13430
|
}, ae.onended = () => {
|
|
13424
13431
|
g(!1);
|
|
13425
|
-
},
|
|
13432
|
+
}, O.current = ae, f(Y), y(Y), a("editing"), R.getTracks().forEach((ne) => ne.stop());
|
|
13426
13433
|
} catch {
|
|
13427
13434
|
x("Failed to process recording"), a("idle");
|
|
13428
13435
|
}
|
|
@@ -13434,112 +13441,112 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13434
13441
|
}
|
|
13435
13442
|
}, ot = () => {
|
|
13436
13443
|
de.current = !1, w(!1), v(null), j.current && (cancelAnimationFrame(j.current), j.current = null), L.current && (clearInterval(L.current), L.current = null), D.current && D.current.state !== "inactive" && D.current.stop();
|
|
13437
|
-
}, dt = (
|
|
13444
|
+
}, dt = (R) => {
|
|
13438
13445
|
const T = b.current;
|
|
13439
13446
|
if (!T) return;
|
|
13440
|
-
const
|
|
13441
|
-
if (
|
|
13447
|
+
const Q = d || u;
|
|
13448
|
+
if (Q <= 0) return;
|
|
13442
13449
|
const J = ie.current;
|
|
13443
13450
|
if (J.length === 0) return;
|
|
13444
|
-
const S = T.getBoundingClientRect(),
|
|
13445
|
-
|
|
13451
|
+
const S = T.getBoundingClientRect(), $ = R - Ce.current, K = 4, Y = S.width / T.width, ee = J.length / Q * K, ae = -$ / (ee * Y), ne = Ve.current + ae, te = Math.max(0, Math.min(ne, Q));
|
|
13452
|
+
O.current && (O.current.currentTime = te), y(te);
|
|
13446
13453
|
}, Ut = () => {
|
|
13447
|
-
|
|
13454
|
+
O.current && (O.current.currentTime = 0), y(0);
|
|
13448
13455
|
}, Wt = () => {
|
|
13449
|
-
const
|
|
13450
|
-
|
|
13456
|
+
const R = d || u;
|
|
13457
|
+
O.current && (O.current.currentTime = R), y(R);
|
|
13451
13458
|
}, Dt = () => {
|
|
13452
|
-
const
|
|
13453
|
-
|
|
13459
|
+
const R = O.current;
|
|
13460
|
+
R && (h ? (R.pause(), y(R.currentTime), g(!1)) : (R.currentTime = m, R.play().catch(() => {
|
|
13454
13461
|
}), g(!0)));
|
|
13455
|
-
}, ft = async (
|
|
13456
|
-
if (!
|
|
13462
|
+
}, ft = async (R) => {
|
|
13463
|
+
if (!X.current) {
|
|
13457
13464
|
it();
|
|
13458
13465
|
return;
|
|
13459
13466
|
}
|
|
13460
13467
|
try {
|
|
13461
|
-
|
|
13468
|
+
O.current && (O.current.pause(), g(!1)), Se.current = R, ve.current = await ge(X.current);
|
|
13462
13469
|
const T = d || u;
|
|
13463
13470
|
oe.current = m;
|
|
13464
|
-
const
|
|
13471
|
+
const Q = T > 0 ? m / T : 0, J = Math.floor(Q * ie.current.length);
|
|
13465
13472
|
pe.current = ie.current.slice(0, J), we.current = ie.current.slice(J), ie.current = [...pe.current], it();
|
|
13466
13473
|
} catch {
|
|
13467
13474
|
x("Failed to prepare recording. Please try again.");
|
|
13468
13475
|
}
|
|
13469
13476
|
}, ht = () => {
|
|
13470
|
-
|
|
13477
|
+
O.current && (O.current.pause(), O.current = null), X.current = null, ve.current = null, oe.current = null, pe.current = [], g(!1), y(0), f(0), c(0), it();
|
|
13471
13478
|
}, At = () => {
|
|
13472
|
-
|
|
13479
|
+
X.current ? r(X.current, d || u) : alert("No audio recorded yet!");
|
|
13473
13480
|
};
|
|
13474
13481
|
if (De(() => {
|
|
13475
13482
|
l === "recording" && b.current && B.current && de.current && (j.current = requestAnimationFrame(qt));
|
|
13476
13483
|
}, [l]), De(() => {
|
|
13477
|
-
const
|
|
13478
|
-
if (!
|
|
13484
|
+
const R = b.current;
|
|
13485
|
+
if (!R) return;
|
|
13479
13486
|
const T = () => {
|
|
13480
|
-
const
|
|
13481
|
-
|
|
13482
|
-
const S =
|
|
13483
|
-
S && S.scale(
|
|
13487
|
+
const Q = window.devicePixelRatio || 1, J = R.getBoundingClientRect();
|
|
13488
|
+
R.width = J.width * Q, R.height = J.height * Q;
|
|
13489
|
+
const S = R.getContext("2d");
|
|
13490
|
+
S && S.scale(Q, Q);
|
|
13484
13491
|
};
|
|
13485
13492
|
return T(), window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
|
|
13486
13493
|
}, []), De(() => {
|
|
13487
13494
|
if (l === "idle") {
|
|
13488
|
-
const
|
|
13489
|
-
if (!
|
|
13490
|
-
const T =
|
|
13495
|
+
const R = b.current;
|
|
13496
|
+
if (!R) return;
|
|
13497
|
+
const T = R.getContext("2d");
|
|
13491
13498
|
if (!T) return;
|
|
13492
|
-
const
|
|
13499
|
+
const Q = R.getBoundingClientRect(), J = Q.width, S = Q.height;
|
|
13493
13500
|
T.fillStyle = "#2d3b35", T.fillRect(0, 0, J, S);
|
|
13494
|
-
const
|
|
13495
|
-
|
|
13496
|
-
const ee = T.createLinearGradient(0, S -
|
|
13497
|
-
ee.addColorStop(0, "transparent"), ee.addColorStop(1, K), T.fillStyle = ee, T.fillRect(0, S -
|
|
13498
|
-
const ae = T.createLinearGradient(0, 0,
|
|
13499
|
-
ae.addColorStop(0, K), ae.addColorStop(1, "transparent"), T.fillStyle = ae, T.fillRect(0, 0,
|
|
13500
|
-
const ne = T.createLinearGradient(J -
|
|
13501
|
-
ne.addColorStop(0, "transparent"), ne.addColorStop(1, K), T.fillStyle = ne, T.fillRect(J -
|
|
13501
|
+
const $ = 8, K = "rgba(0, 0, 0, 0.4)", Y = T.createLinearGradient(0, 0, 0, $);
|
|
13502
|
+
Y.addColorStop(0, K), Y.addColorStop(1, "transparent"), T.fillStyle = Y, T.fillRect(0, 0, J, $);
|
|
13503
|
+
const ee = T.createLinearGradient(0, S - $, 0, S);
|
|
13504
|
+
ee.addColorStop(0, "transparent"), ee.addColorStop(1, K), T.fillStyle = ee, T.fillRect(0, S - $, J, $);
|
|
13505
|
+
const ae = T.createLinearGradient(0, 0, $, 0);
|
|
13506
|
+
ae.addColorStop(0, K), ae.addColorStop(1, "transparent"), T.fillStyle = ae, T.fillRect(0, 0, $, S);
|
|
13507
|
+
const ne = T.createLinearGradient(J - $, 0, J, 0);
|
|
13508
|
+
ne.addColorStop(0, "transparent"), ne.addColorStop(1, K), T.fillStyle = ne, T.fillRect(J - $, 0, $, S), T.strokeStyle = "#5a6b62", T.lineWidth = 1, T.beginPath(), T.moveTo(0, S / 2), T.lineTo(J, S / 2), T.stroke();
|
|
13502
13509
|
const te = J / 2;
|
|
13503
13510
|
T.strokeStyle = "#ef4444", T.lineWidth = 1, T.beginPath(), T.moveTo(te, 0), T.lineTo(te, S), T.stroke(), T.fillStyle = "#fff", T.font = "bold 18px monospace", T.textAlign = "center", T.fillText("00:00", te, S - 6);
|
|
13504
13511
|
}
|
|
13505
13512
|
}, [l]), De(() => () => {
|
|
13506
|
-
de.current = !1, L.current && clearInterval(L.current), j.current && cancelAnimationFrame(j.current), k.current && k.current.getTracks().forEach((
|
|
13513
|
+
de.current = !1, L.current && clearInterval(L.current), j.current && cancelAnimationFrame(j.current), k.current && k.current.getTracks().forEach((R) => R.stop()), I.current && I.current.state !== "closed" && I.current.close();
|
|
13507
13514
|
}, []), De(() => {
|
|
13508
13515
|
if (l === "editing" && h) {
|
|
13509
|
-
let
|
|
13516
|
+
let R;
|
|
13510
13517
|
const T = () => {
|
|
13511
|
-
const
|
|
13512
|
-
if (
|
|
13518
|
+
const Q = O.current;
|
|
13519
|
+
if (Q && h) {
|
|
13513
13520
|
const J = b.current;
|
|
13514
13521
|
if (J) {
|
|
13515
13522
|
const S = J.getContext("2d");
|
|
13516
13523
|
if (S) {
|
|
13517
|
-
const
|
|
13518
|
-
S.fillStyle = "#2d3b35", S.fillRect(0, 0, K,
|
|
13524
|
+
const $ = J.getBoundingClientRect(), K = $.width, Y = $.height, ee = ie.current, ae = d || u || 1, ne = Q.currentTime;
|
|
13525
|
+
S.fillStyle = "#2d3b35", S.fillRect(0, 0, K, Y);
|
|
13519
13526
|
const te = 8, Ae = "rgba(0, 0, 0, 0.4)", Fe = S.createLinearGradient(0, 0, 0, te);
|
|
13520
13527
|
Fe.addColorStop(0, Ae), Fe.addColorStop(1, "transparent"), S.fillStyle = Fe, S.fillRect(0, 0, K, te);
|
|
13521
|
-
const ye = S.createLinearGradient(0,
|
|
13522
|
-
ye.addColorStop(0, "transparent"), ye.addColorStop(1, Ae), S.fillStyle = ye, S.fillRect(0,
|
|
13528
|
+
const ye = S.createLinearGradient(0, Y - te, 0, Y);
|
|
13529
|
+
ye.addColorStop(0, "transparent"), ye.addColorStop(1, Ae), S.fillStyle = ye, S.fillRect(0, Y - te, K, te);
|
|
13523
13530
|
const fe = S.createLinearGradient(0, 0, te, 0);
|
|
13524
|
-
fe.addColorStop(0, Ae), fe.addColorStop(1, "transparent"), S.fillStyle = fe, S.fillRect(0, 0, te,
|
|
13525
|
-
const
|
|
13526
|
-
|
|
13527
|
-
const
|
|
13531
|
+
fe.addColorStop(0, Ae), fe.addColorStop(1, "transparent"), S.fillStyle = fe, S.fillRect(0, 0, te, Y);
|
|
13532
|
+
const Ue = S.createLinearGradient(K - te, 0, K, 0);
|
|
13533
|
+
Ue.addColorStop(0, "transparent"), Ue.addColorStop(1, Ae), S.fillStyle = Ue, S.fillRect(K - te, 0, te, Y), S.strokeStyle = "#5a6b62", S.lineWidth = 1, S.beginPath(), S.moveTo(0, Y / 2), S.lineTo(K, Y / 2), S.stroke();
|
|
13534
|
+
const We = K / 2, lt = 3, Et = 4, pt = ae > 0 ? ne / ae * ee.length : 0;
|
|
13528
13535
|
for (let tr = 0; tr < ee.length; tr++) {
|
|
13529
|
-
const ws = pt - tr, xr =
|
|
13536
|
+
const ws = pt - tr, xr = We - ws * Et;
|
|
13530
13537
|
if (xr < -lt || xr > K) continue;
|
|
13531
|
-
const Mr = ee[tr] * (
|
|
13538
|
+
const Mr = ee[tr] * (Y / 2 - 12), Cs = Y / 2 - Mr;
|
|
13532
13539
|
S.fillStyle = tr <= pt ? "#10b981" : "#4b5563", S.fillRect(xr, Cs, lt, Mr * 2);
|
|
13533
13540
|
}
|
|
13534
|
-
S.strokeStyle = "#ef4444", S.lineWidth = 1, S.beginPath(), S.moveTo(
|
|
13541
|
+
S.strokeStyle = "#ef4444", S.lineWidth = 1, S.beginPath(), S.moveTo(We, 0), S.lineTo(We, Y), S.stroke(), S.fillStyle = "#fff", S.font = "bold 18px monospace", S.textAlign = "center";
|
|
13535
13542
|
const Pt = Math.floor(ne / 60), yr = Math.floor(ne % 60);
|
|
13536
|
-
S.fillText(`${Pt.toString().padStart(2, "0")}:${yr.toString().padStart(2, "0")}`,
|
|
13543
|
+
S.fillText(`${Pt.toString().padStart(2, "0")}:${yr.toString().padStart(2, "0")}`, We, Y - 6), S.textAlign = "left";
|
|
13537
13544
|
}
|
|
13538
13545
|
}
|
|
13539
|
-
|
|
13546
|
+
R = requestAnimationFrame(T);
|
|
13540
13547
|
}
|
|
13541
13548
|
};
|
|
13542
|
-
return
|
|
13549
|
+
return R = requestAnimationFrame(T), () => cancelAnimationFrame(R);
|
|
13543
13550
|
}
|
|
13544
13551
|
}, [l, h, d, u]), De(() => {
|
|
13545
13552
|
l === "editing" && !h && Ct();
|
|
@@ -13571,22 +13578,22 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13571
13578
|
...W,
|
|
13572
13579
|
opacity: 0.3,
|
|
13573
13580
|
cursor: "not-allowed"
|
|
13574
|
-
},
|
|
13575
|
-
return /* @__PURE__ */ p.jsxs("div", { style:
|
|
13581
|
+
}, qe = i ? { border: "1px solid #e5e5e5", borderRadius: "12px", overflow: "hidden", background: "white" } : { overflow: "hidden", background: "white", flexShrink: 0 };
|
|
13582
|
+
return /* @__PURE__ */ p.jsxs("div", { style: qe, children: [
|
|
13576
13583
|
/* @__PURE__ */ p.jsx(
|
|
13577
13584
|
"canvas",
|
|
13578
13585
|
{
|
|
13579
13586
|
ref: b,
|
|
13580
13587
|
style: { width: "100%", height: "32px", cursor: "pointer", flexShrink: 0 },
|
|
13581
|
-
onMouseDown: (
|
|
13588
|
+
onMouseDown: (R) => {
|
|
13582
13589
|
if (l === "editing") {
|
|
13583
|
-
Oe.current = !0, Ce.current =
|
|
13590
|
+
Oe.current = !0, Ce.current = R.clientX, Ve.current = m;
|
|
13584
13591
|
const T = (J) => {
|
|
13585
13592
|
Oe.current && dt(J.clientX);
|
|
13586
|
-
},
|
|
13587
|
-
Oe.current = !1, window.removeEventListener("mousemove", T), window.removeEventListener("mouseup",
|
|
13593
|
+
}, Q = () => {
|
|
13594
|
+
Oe.current = !1, window.removeEventListener("mousemove", T), window.removeEventListener("mouseup", Q);
|
|
13588
13595
|
};
|
|
13589
|
-
window.addEventListener("mousemove", T), window.addEventListener("mouseup",
|
|
13596
|
+
window.addEventListener("mousemove", T), window.addEventListener("mouseup", Q);
|
|
13590
13597
|
}
|
|
13591
13598
|
}
|
|
13592
13599
|
}
|
|
@@ -13621,8 +13628,8 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13621
13628
|
{
|
|
13622
13629
|
onClick: () => {
|
|
13623
13630
|
if (l === "recording") {
|
|
13624
|
-
const
|
|
13625
|
-
|
|
13631
|
+
const R = D.current;
|
|
13632
|
+
R && (R.state === "recording" ? (R.pause(), w(!0)) : R.state === "paused" && (R.resume(), w(!1)));
|
|
13626
13633
|
} else
|
|
13627
13634
|
Dt();
|
|
13628
13635
|
},
|
|
@@ -13684,7 +13691,7 @@ function Nf({ onComplete: r, onCancel: e, onTranscribe: t, transcribing: n, vari
|
|
|
13684
13691
|
t && /* @__PURE__ */ p.jsx(
|
|
13685
13692
|
"button",
|
|
13686
13693
|
{
|
|
13687
|
-
onClick: () =>
|
|
13694
|
+
onClick: () => X.current && t(X.current),
|
|
13688
13695
|
disabled: l !== "editing" || n,
|
|
13689
13696
|
style: l !== "editing" || n ? be : W,
|
|
13690
13697
|
title: n ? "Transcribing..." : "Transcribe audio",
|