document-model 1.0.50 → 1.0.52
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/browser/cjs/document-model.js +1 -1
- package/dist/browser/cjs/document.js +1 -1
- package/dist/browser/cjs/index.js +1 -1
- package/dist/{node/cjs/internal/index-CRjFLQNR.js → browser/cjs/internal/index-BVWyYyNE.js} +1 -1
- package/dist/browser/cjs/internal/{index-CPJM383s.js → index-CnVGNZ9_.js} +1 -1
- package/dist/browser/cjs/internal/object-5l5_pTNL.js +25 -0
- package/dist/browser/es/document-model.js +2 -2
- package/dist/browser/es/document.js +2 -2
- package/dist/browser/es/index.js +3 -3
- package/dist/browser/es/internal/{index-tEH7iGUj.js → index-CF0d1_Cg.js} +1 -1
- package/dist/browser/es/internal/{index-BzIVYv7p.js → index-aS_vqu4O.js} +1 -1
- package/dist/browser/es/internal/{object-Dev4WFVH.js → object-BdaEhPk1.js} +770 -771
- package/dist/browser/src/document/object.d.ts +35 -0
- package/dist/browser/src/document/types.d.ts +2 -0
- package/dist/node/cjs/document-model.js +1 -1
- package/dist/node/cjs/document.js +1 -1
- package/dist/node/cjs/index.js +1 -1
- package/dist/{browser/cjs/internal/index-REU04m7f.js → node/cjs/internal/index-B9gc2lPN.js} +1 -1
- package/dist/node/cjs/internal/{index-BX95XaQ_.js → index-JtuONOcD.js} +1 -1
- package/dist/node/cjs/internal/object-D6wRzEDN.js +20 -0
- package/dist/node/es/document-model.js +2 -2
- package/dist/node/es/document.js +2 -2
- package/dist/node/es/index.js +3 -3
- package/dist/node/es/internal/{index-BzNCX_-9.js → index-BclkoIYP.js} +1 -1
- package/dist/node/es/internal/{index-DpH4_29z.js → index-EY0PPZnJ.js} +1 -1
- package/dist/node/es/internal/{object-BFkXGmt6.js → object-BxC3xMqY.js} +509 -510
- package/dist/node/src/document/object.d.ts +35 -0
- package/dist/node/src/document/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/browser/cjs/internal/object-DkoS83BB.js +0 -25
- package/dist/node/cjs/internal/object-CGt7Qacd.js +0 -20
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var De = Object.defineProperty;
|
|
2
|
-
var Ce = (
|
|
3
|
-
var At = (
|
|
2
|
+
var Ce = (r, i, s) => i in r ? De(r, i, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[i] = s;
|
|
3
|
+
var At = (r, i, s) => (Ce(r, typeof i != "symbol" ? i + "" : i, s), s);
|
|
4
4
|
import { produce as xt, castDraft as Ut, castImmutable as Ne, freeze as Me } from "immer";
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as v } from "zod";
|
|
6
6
|
import ee from "jszip";
|
|
7
|
-
const re = (
|
|
7
|
+
const re = (r) => r != null, Re = v.any().refine((r) => re(r)), ie = v.enum(["LOAD_STATE"]), ne = v.enum(["PRUNE"]), oe = v.enum(["REDO"]), ae = v.enum(["SET_NAME"]), se = v.enum(["UNDO"]);
|
|
8
8
|
function Le() {
|
|
9
|
-
return
|
|
10
|
-
__typename:
|
|
11
|
-
type:
|
|
9
|
+
return v.object({
|
|
10
|
+
__typename: v.literal("Action").optional(),
|
|
11
|
+
type: v.string()
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function dt() {
|
|
15
|
-
return
|
|
15
|
+
return v.literal("global").or(v.literal("local"));
|
|
16
16
|
}
|
|
17
17
|
function pe() {
|
|
18
|
-
return
|
|
18
|
+
return v.union([
|
|
19
19
|
ce(),
|
|
20
20
|
ue(),
|
|
21
21
|
fe(),
|
|
@@ -24,84 +24,84 @@ function pe() {
|
|
|
24
24
|
]);
|
|
25
25
|
}
|
|
26
26
|
function ze() {
|
|
27
|
-
return
|
|
28
|
-
__typename:
|
|
29
|
-
data:
|
|
30
|
-
extension:
|
|
31
|
-
fileName:
|
|
32
|
-
mimeType:
|
|
27
|
+
return v.object({
|
|
28
|
+
__typename: v.literal("DocumentFile").optional(),
|
|
29
|
+
data: v.string(),
|
|
30
|
+
extension: v.string().nullable(),
|
|
31
|
+
fileName: v.string().nullable(),
|
|
32
|
+
mimeType: v.string()
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
function ce() {
|
|
36
|
-
return
|
|
37
|
-
input:
|
|
36
|
+
return v.object({
|
|
37
|
+
input: v.lazy(() => Mt()),
|
|
38
38
|
type: ie,
|
|
39
39
|
scope: dt()
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
function Mt() {
|
|
43
|
-
return
|
|
44
|
-
operations:
|
|
45
|
-
state:
|
|
43
|
+
return v.object({
|
|
44
|
+
operations: v.number(),
|
|
45
|
+
state: v.lazy(() => le())
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function le() {
|
|
49
|
-
return
|
|
50
|
-
data:
|
|
51
|
-
name:
|
|
49
|
+
return v.object({
|
|
50
|
+
data: v.unknown().nullish(),
|
|
51
|
+
name: v.string()
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function Pe() {
|
|
55
|
-
return
|
|
56
|
-
__typename:
|
|
57
|
-
hash:
|
|
58
|
-
index:
|
|
59
|
-
timestamp:
|
|
60
|
-
type:
|
|
55
|
+
return v.object({
|
|
56
|
+
__typename: v.literal("Operation").optional(),
|
|
57
|
+
hash: v.string(),
|
|
58
|
+
index: v.number(),
|
|
59
|
+
timestamp: v.string().datetime(),
|
|
60
|
+
type: v.string()
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
function ue() {
|
|
64
|
-
return
|
|
65
|
-
input:
|
|
64
|
+
return v.object({
|
|
65
|
+
input: v.lazy(() => Rt()),
|
|
66
66
|
type: ne,
|
|
67
67
|
scope: dt()
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
function Rt() {
|
|
71
|
-
return
|
|
72
|
-
end:
|
|
73
|
-
start:
|
|
71
|
+
return v.object({
|
|
72
|
+
end: v.number().nullish(),
|
|
73
|
+
start: v.number().nullish()
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
const Lt =
|
|
76
|
+
const Lt = v.number;
|
|
77
77
|
function fe() {
|
|
78
|
-
return
|
|
78
|
+
return v.object({
|
|
79
79
|
input: Lt(),
|
|
80
80
|
type: oe,
|
|
81
81
|
scope: dt()
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const zt =
|
|
84
|
+
const zt = v.string;
|
|
85
85
|
function he() {
|
|
86
|
-
return
|
|
86
|
+
return v.object({
|
|
87
87
|
input: zt(),
|
|
88
88
|
type: ae,
|
|
89
|
-
scope:
|
|
89
|
+
scope: v.literal("global")
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
function qe() {
|
|
93
|
-
return
|
|
94
|
-
__typename:
|
|
95
|
-
hash:
|
|
96
|
-
index:
|
|
97
|
-
input:
|
|
98
|
-
timestamp:
|
|
99
|
-
type:
|
|
93
|
+
return v.object({
|
|
94
|
+
__typename: v.literal("SetNameOperation").optional(),
|
|
95
|
+
hash: v.string(),
|
|
96
|
+
index: v.number(),
|
|
97
|
+
input: v.string(),
|
|
98
|
+
timestamp: v.string().datetime(),
|
|
99
|
+
type: v.string()
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
const Pt =
|
|
102
|
+
const Pt = v.number;
|
|
103
103
|
function me() {
|
|
104
|
-
return
|
|
104
|
+
return v.object({
|
|
105
105
|
input: Pt(),
|
|
106
106
|
type: se,
|
|
107
107
|
scope: dt()
|
|
@@ -134,28 +134,28 @@ const ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
134
134
|
definedNonNullAnySchema: Re,
|
|
135
135
|
isDefinedNonNullAny: re
|
|
136
136
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
137
|
-
function qt(
|
|
138
|
-
return
|
|
137
|
+
function qt(r) {
|
|
138
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
139
139
|
}
|
|
140
140
|
var $t = { exports: {} };
|
|
141
|
-
(function(
|
|
142
|
-
const { hasOwnProperty: s } = Object.prototype, p =
|
|
143
|
-
p.configure =
|
|
141
|
+
(function(r, i) {
|
|
142
|
+
const { hasOwnProperty: s } = Object.prototype, p = C();
|
|
143
|
+
p.configure = C, p.stringify = p, p.default = p, i.stringify = p, i.configure = C, r.exports = p;
|
|
144
144
|
const f = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;
|
|
145
|
-
function u(
|
|
146
|
-
return
|
|
147
|
-
}
|
|
148
|
-
function l(
|
|
149
|
-
if (
|
|
150
|
-
return
|
|
151
|
-
for (let b = 1; b <
|
|
152
|
-
const
|
|
153
|
-
let
|
|
154
|
-
for (;
|
|
155
|
-
|
|
156
|
-
|
|
145
|
+
function u(y) {
|
|
146
|
+
return y.length < 5e3 && !f.test(y) ? `"${y}"` : JSON.stringify(y);
|
|
147
|
+
}
|
|
148
|
+
function l(y) {
|
|
149
|
+
if (y.length > 200)
|
|
150
|
+
return y.sort();
|
|
151
|
+
for (let b = 1; b < y.length; b++) {
|
|
152
|
+
const I = y[b];
|
|
153
|
+
let W = b;
|
|
154
|
+
for (; W !== 0 && y[W - 1] > I; )
|
|
155
|
+
y[W] = y[W - 1], W--;
|
|
156
|
+
y[W] = I;
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return y;
|
|
159
159
|
}
|
|
160
160
|
const a = Object.getOwnPropertyDescriptor(
|
|
161
161
|
Object.getPrototypeOf(
|
|
@@ -165,20 +165,20 @@ var $t = { exports: {} };
|
|
|
165
165
|
),
|
|
166
166
|
Symbol.toStringTag
|
|
167
167
|
).get;
|
|
168
|
-
function h(
|
|
169
|
-
return a.call(
|
|
170
|
-
}
|
|
171
|
-
function y
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
let
|
|
175
|
-
for (let
|
|
176
|
-
|
|
177
|
-
return
|
|
178
|
-
}
|
|
179
|
-
function
|
|
180
|
-
if (s.call(
|
|
181
|
-
const b =
|
|
168
|
+
function h(y) {
|
|
169
|
+
return a.call(y) !== void 0 && y.length !== 0;
|
|
170
|
+
}
|
|
171
|
+
function w(y, b, I) {
|
|
172
|
+
y.length < I && (I = y.length);
|
|
173
|
+
const W = b === "," ? "" : " ";
|
|
174
|
+
let Y = `"0":${W}${y[0]}`;
|
|
175
|
+
for (let G = 1; G < I; G++)
|
|
176
|
+
Y += `${b}"${G}":${W}${y[G]}`;
|
|
177
|
+
return Y;
|
|
178
|
+
}
|
|
179
|
+
function g(y) {
|
|
180
|
+
if (s.call(y, "circularValue")) {
|
|
181
|
+
const b = y.circularValue;
|
|
182
182
|
if (typeof b == "string")
|
|
183
183
|
return `"${b}"`;
|
|
184
184
|
if (b == null)
|
|
@@ -193,51 +193,51 @@ var $t = { exports: {} };
|
|
|
193
193
|
}
|
|
194
194
|
return '"[Circular]"';
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
let
|
|
198
|
-
if (s.call(
|
|
196
|
+
function A(y, b) {
|
|
197
|
+
let I;
|
|
198
|
+
if (s.call(y, b) && (I = y[b], typeof I != "boolean"))
|
|
199
199
|
throw new TypeError(`The "${b}" argument must be of type boolean`);
|
|
200
|
-
return
|
|
200
|
+
return I === void 0 ? !0 : I;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
let
|
|
204
|
-
if (s.call(
|
|
205
|
-
if (
|
|
202
|
+
function _(y, b) {
|
|
203
|
+
let I;
|
|
204
|
+
if (s.call(y, b)) {
|
|
205
|
+
if (I = y[b], typeof I != "number")
|
|
206
206
|
throw new TypeError(`The "${b}" argument must be of type number`);
|
|
207
|
-
if (!Number.isInteger(
|
|
207
|
+
if (!Number.isInteger(I))
|
|
208
208
|
throw new TypeError(`The "${b}" argument must be an integer`);
|
|
209
|
-
if (
|
|
209
|
+
if (I < 1)
|
|
210
210
|
throw new RangeError(`The "${b}" argument must be >= 1`);
|
|
211
211
|
}
|
|
212
|
-
return
|
|
212
|
+
return I === void 0 ? 1 / 0 : I;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
214
|
+
function F(y) {
|
|
215
|
+
return y === 1 ? "1 item" : `${y} items`;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function U(y) {
|
|
218
218
|
const b = /* @__PURE__ */ new Set();
|
|
219
|
-
for (const
|
|
220
|
-
(typeof
|
|
219
|
+
for (const I of y)
|
|
220
|
+
(typeof I == "string" || typeof I == "number") && b.add(String(I));
|
|
221
221
|
return b;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
if (s.call(
|
|
225
|
-
const b =
|
|
223
|
+
function L(y) {
|
|
224
|
+
if (s.call(y, "strict")) {
|
|
225
|
+
const b = y.strict;
|
|
226
226
|
if (typeof b != "boolean")
|
|
227
227
|
throw new TypeError('The "strict" argument must be of type boolean');
|
|
228
228
|
if (b)
|
|
229
|
-
return (
|
|
230
|
-
let
|
|
231
|
-
throw typeof
|
|
229
|
+
return (I) => {
|
|
230
|
+
let W = `Object can not safely be stringified. Received type ${typeof I}`;
|
|
231
|
+
throw typeof I != "function" && (W += ` (${I.toString()})`), new Error(W);
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
237
|
-
const b =
|
|
238
|
-
b && (
|
|
239
|
-
const
|
|
240
|
-
function ct(V, m, E, T, j,
|
|
235
|
+
function C(y) {
|
|
236
|
+
y = { ...y };
|
|
237
|
+
const b = L(y);
|
|
238
|
+
b && (y.bigint === void 0 && (y.bigint = !1), "circularValue" in y || (y.circularValue = Error));
|
|
239
|
+
const I = g(y), W = A(y, "bigint"), Y = A(y, "deterministic"), G = _(y, "maximumDepth"), R = _(y, "maximumBreadth");
|
|
240
|
+
function ct(V, m, E, T, j, D) {
|
|
241
241
|
let S = m[V];
|
|
242
242
|
switch (typeof S == "object" && S !== null && typeof S.toJSON == "function" && (S = S.toJSON(V)), S = T.call(m, V, S), typeof S) {
|
|
243
243
|
case "string":
|
|
@@ -246,53 +246,53 @@ var $t = { exports: {} };
|
|
|
246
246
|
if (S === null)
|
|
247
247
|
return "null";
|
|
248
248
|
if (E.indexOf(S) !== -1)
|
|
249
|
-
return
|
|
250
|
-
let k = "",
|
|
251
|
-
const
|
|
249
|
+
return I;
|
|
250
|
+
let k = "", B = ",";
|
|
251
|
+
const O = D;
|
|
252
252
|
if (Array.isArray(S)) {
|
|
253
253
|
if (S.length === 0)
|
|
254
254
|
return "[]";
|
|
255
|
-
if (
|
|
255
|
+
if (G < E.length + 1)
|
|
256
256
|
return '"[Array]"';
|
|
257
|
-
E.push(S), j !== "" && (
|
|
258
|
-
${
|
|
259
|
-
${
|
|
260
|
-
const H = Math.min(S.length,
|
|
257
|
+
E.push(S), j !== "" && (D += j, k += `
|
|
258
|
+
${D}`, B = `,
|
|
259
|
+
${D}`);
|
|
260
|
+
const H = Math.min(S.length, R);
|
|
261
261
|
let Q = 0;
|
|
262
262
|
for (; Q < H - 1; Q++) {
|
|
263
|
-
const st = ct(String(Q), S, E, T, j,
|
|
264
|
-
k += st !== void 0 ? st : "null", k +=
|
|
263
|
+
const st = ct(String(Q), S, E, T, j, D);
|
|
264
|
+
k += st !== void 0 ? st : "null", k += B;
|
|
265
265
|
}
|
|
266
|
-
const tt = ct(String(Q), S, E, T, j,
|
|
267
|
-
if (k += tt !== void 0 ? tt : "null", S.length - 1 >
|
|
268
|
-
const st = S.length -
|
|
269
|
-
k += `${
|
|
266
|
+
const tt = ct(String(Q), S, E, T, j, D);
|
|
267
|
+
if (k += tt !== void 0 ? tt : "null", S.length - 1 > R) {
|
|
268
|
+
const st = S.length - R - 1;
|
|
269
|
+
k += `${B}"... ${F(st)} not stringified"`;
|
|
270
270
|
}
|
|
271
271
|
return j !== "" && (k += `
|
|
272
|
-
${
|
|
272
|
+
${O}`), E.pop(), `[${k}]`;
|
|
273
273
|
}
|
|
274
|
-
let
|
|
275
|
-
const J =
|
|
274
|
+
let z = Object.keys(S);
|
|
275
|
+
const J = z.length;
|
|
276
276
|
if (J === 0)
|
|
277
277
|
return "{}";
|
|
278
|
-
if (
|
|
278
|
+
if (G < E.length + 1)
|
|
279
279
|
return '"[Object]"';
|
|
280
|
-
let
|
|
281
|
-
j !== "" && (
|
|
282
|
-
${
|
|
283
|
-
const X = Math.min(J,
|
|
284
|
-
|
|
280
|
+
let N = "", K = "";
|
|
281
|
+
j !== "" && (D += j, B = `,
|
|
282
|
+
${D}`, N = " ");
|
|
283
|
+
const X = Math.min(J, R);
|
|
284
|
+
Y && !h(S) && (z = l(z)), E.push(S);
|
|
285
285
|
for (let H = 0; H < X; H++) {
|
|
286
|
-
const Q =
|
|
287
|
-
tt !== void 0 && (k += `${
|
|
286
|
+
const Q = z[H], tt = ct(Q, S, E, T, j, D);
|
|
287
|
+
tt !== void 0 && (k += `${K}${u(Q)}:${N}${tt}`, K = B);
|
|
288
288
|
}
|
|
289
|
-
if (J >
|
|
290
|
-
const H = J -
|
|
291
|
-
k += `${
|
|
289
|
+
if (J > R) {
|
|
290
|
+
const H = J - R;
|
|
291
|
+
k += `${K}"...":${N}"${F(H)} not stringified"`, K = B;
|
|
292
292
|
}
|
|
293
|
-
return j !== "" &&
|
|
294
|
-
${
|
|
295
|
-
${
|
|
293
|
+
return j !== "" && K.length > 1 && (k = `
|
|
294
|
+
${D}${k}
|
|
295
|
+
${O}`), E.pop(), `{${k}}`;
|
|
296
296
|
}
|
|
297
297
|
case "number":
|
|
298
298
|
return isFinite(S) ? String(S) : b ? b(S) : "null";
|
|
@@ -301,13 +301,13 @@ ${I}`), E.pop(), `{${k}}`;
|
|
|
301
301
|
case "undefined":
|
|
302
302
|
return;
|
|
303
303
|
case "bigint":
|
|
304
|
-
if (
|
|
304
|
+
if (W)
|
|
305
305
|
return String(S);
|
|
306
306
|
default:
|
|
307
307
|
return b ? b(S) : void 0;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function lt(V, m, E, T, j,
|
|
310
|
+
function lt(V, m, E, T, j, D) {
|
|
311
311
|
switch (typeof m == "object" && m !== null && typeof m.toJSON == "function" && (m = m.toJSON(V)), typeof m) {
|
|
312
312
|
case "string":
|
|
313
313
|
return u(m);
|
|
@@ -315,42 +315,42 @@ ${I}`), E.pop(), `{${k}}`;
|
|
|
315
315
|
if (m === null)
|
|
316
316
|
return "null";
|
|
317
317
|
if (E.indexOf(m) !== -1)
|
|
318
|
-
return
|
|
319
|
-
const S =
|
|
320
|
-
let k = "",
|
|
318
|
+
return I;
|
|
319
|
+
const S = D;
|
|
320
|
+
let k = "", B = ",";
|
|
321
321
|
if (Array.isArray(m)) {
|
|
322
322
|
if (m.length === 0)
|
|
323
323
|
return "[]";
|
|
324
|
-
if (
|
|
324
|
+
if (G < E.length + 1)
|
|
325
325
|
return '"[Array]"';
|
|
326
|
-
E.push(m), j !== "" && (
|
|
327
|
-
${
|
|
328
|
-
${
|
|
329
|
-
const J = Math.min(m.length,
|
|
330
|
-
let
|
|
331
|
-
for (;
|
|
332
|
-
const X = lt(String(
|
|
333
|
-
k += X !== void 0 ? X : "null", k +=
|
|
326
|
+
E.push(m), j !== "" && (D += j, k += `
|
|
327
|
+
${D}`, B = `,
|
|
328
|
+
${D}`);
|
|
329
|
+
const J = Math.min(m.length, R);
|
|
330
|
+
let N = 0;
|
|
331
|
+
for (; N < J - 1; N++) {
|
|
332
|
+
const X = lt(String(N), m[N], E, T, j, D);
|
|
333
|
+
k += X !== void 0 ? X : "null", k += B;
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
if (k +=
|
|
337
|
-
const X = m.length -
|
|
338
|
-
k += `${
|
|
335
|
+
const K = lt(String(N), m[N], E, T, j, D);
|
|
336
|
+
if (k += K !== void 0 ? K : "null", m.length - 1 > R) {
|
|
337
|
+
const X = m.length - R - 1;
|
|
338
|
+
k += `${B}"... ${F(X)} not stringified"`;
|
|
339
339
|
}
|
|
340
340
|
return j !== "" && (k += `
|
|
341
341
|
${S}`), E.pop(), `[${k}]`;
|
|
342
342
|
}
|
|
343
343
|
E.push(m);
|
|
344
|
-
let
|
|
345
|
-
j !== "" && (
|
|
346
|
-
${
|
|
347
|
-
let
|
|
344
|
+
let O = "";
|
|
345
|
+
j !== "" && (D += j, B = `,
|
|
346
|
+
${D}`, O = " ");
|
|
347
|
+
let z = "";
|
|
348
348
|
for (const J of T) {
|
|
349
|
-
const
|
|
350
|
-
|
|
349
|
+
const N = lt(J, m[J], E, T, j, D);
|
|
350
|
+
N !== void 0 && (k += `${z}${u(J)}:${O}${N}`, z = B);
|
|
351
351
|
}
|
|
352
|
-
return j !== "" &&
|
|
353
|
-
${
|
|
352
|
+
return j !== "" && z.length > 1 && (k = `
|
|
353
|
+
${D}${k}
|
|
354
354
|
${S}`), E.pop(), `{${k}}`;
|
|
355
355
|
}
|
|
356
356
|
case "number":
|
|
@@ -360,7 +360,7 @@ ${S}`), E.pop(), `{${k}}`;
|
|
|
360
360
|
case "undefined":
|
|
361
361
|
return;
|
|
362
362
|
case "bigint":
|
|
363
|
-
if (
|
|
363
|
+
if (W)
|
|
364
364
|
return String(m);
|
|
365
365
|
default:
|
|
366
366
|
return b ? b(m) : void 0;
|
|
@@ -380,53 +380,53 @@ ${S}`), E.pop(), `{${k}}`;
|
|
|
380
380
|
return "null";
|
|
381
381
|
}
|
|
382
382
|
if (E.indexOf(m) !== -1)
|
|
383
|
-
return
|
|
384
|
-
const
|
|
383
|
+
return I;
|
|
384
|
+
const D = j;
|
|
385
385
|
if (Array.isArray(m)) {
|
|
386
386
|
if (m.length === 0)
|
|
387
387
|
return "[]";
|
|
388
|
-
if (
|
|
388
|
+
if (G < E.length + 1)
|
|
389
389
|
return '"[Array]"';
|
|
390
390
|
E.push(m), j += T;
|
|
391
|
-
let
|
|
391
|
+
let N = `
|
|
392
392
|
${j}`;
|
|
393
|
-
const
|
|
394
|
-
${j}`, X = Math.min(m.length,
|
|
393
|
+
const K = `,
|
|
394
|
+
${j}`, X = Math.min(m.length, R);
|
|
395
395
|
let H = 0;
|
|
396
396
|
for (; H < X - 1; H++) {
|
|
397
397
|
const tt = ot(String(H), m[H], E, T, j);
|
|
398
|
-
|
|
398
|
+
N += tt !== void 0 ? tt : "null", N += K;
|
|
399
399
|
}
|
|
400
400
|
const Q = ot(String(H), m[H], E, T, j);
|
|
401
|
-
if (
|
|
402
|
-
const tt = m.length -
|
|
403
|
-
|
|
401
|
+
if (N += Q !== void 0 ? Q : "null", m.length - 1 > R) {
|
|
402
|
+
const tt = m.length - R - 1;
|
|
403
|
+
N += `${K}"... ${F(tt)} not stringified"`;
|
|
404
404
|
}
|
|
405
|
-
return
|
|
406
|
-
${
|
|
405
|
+
return N += `
|
|
406
|
+
${D}`, E.pop(), `[${N}]`;
|
|
407
407
|
}
|
|
408
408
|
let S = Object.keys(m);
|
|
409
409
|
const k = S.length;
|
|
410
410
|
if (k === 0)
|
|
411
411
|
return "{}";
|
|
412
|
-
if (
|
|
412
|
+
if (G < E.length + 1)
|
|
413
413
|
return '"[Object]"';
|
|
414
414
|
j += T;
|
|
415
|
-
const
|
|
415
|
+
const B = `,
|
|
416
416
|
${j}`;
|
|
417
|
-
let
|
|
418
|
-
h(m) && (
|
|
419
|
-
for (let
|
|
420
|
-
const
|
|
421
|
-
X !== void 0 && (
|
|
417
|
+
let O = "", z = "", J = Math.min(k, R);
|
|
418
|
+
h(m) && (O += w(m, B, R), S = S.slice(m.length), J -= m.length, z = B), Y && (S = l(S)), E.push(m);
|
|
419
|
+
for (let N = 0; N < J; N++) {
|
|
420
|
+
const K = S[N], X = ot(K, m[K], E, T, j);
|
|
421
|
+
X !== void 0 && (O += `${z}${u(K)}: ${X}`, z = B);
|
|
422
422
|
}
|
|
423
|
-
if (k >
|
|
424
|
-
const
|
|
425
|
-
|
|
423
|
+
if (k > R) {
|
|
424
|
+
const N = k - R;
|
|
425
|
+
O += `${z}"...": "${F(N)} not stringified"`, z = B;
|
|
426
426
|
}
|
|
427
|
-
return
|
|
428
|
-
${j}${
|
|
429
|
-
${
|
|
427
|
+
return z !== "" && (O = `
|
|
428
|
+
${j}${O}
|
|
429
|
+
${D}`), E.pop(), `{${O}}`;
|
|
430
430
|
}
|
|
431
431
|
case "number":
|
|
432
432
|
return isFinite(m) ? String(m) : b ? b(m) : "null";
|
|
@@ -435,7 +435,7 @@ ${$}`), E.pop(), `{${I}}`;
|
|
|
435
435
|
case "undefined":
|
|
436
436
|
return;
|
|
437
437
|
case "bigint":
|
|
438
|
-
if (
|
|
438
|
+
if (W)
|
|
439
439
|
return String(m);
|
|
440
440
|
default:
|
|
441
441
|
return b ? b(m) : void 0;
|
|
@@ -455,42 +455,42 @@ ${$}`), E.pop(), `{${I}}`;
|
|
|
455
455
|
return "null";
|
|
456
456
|
}
|
|
457
457
|
if (E.indexOf(m) !== -1)
|
|
458
|
-
return
|
|
458
|
+
return I;
|
|
459
459
|
let T = "";
|
|
460
460
|
if (Array.isArray(m)) {
|
|
461
461
|
if (m.length === 0)
|
|
462
462
|
return "[]";
|
|
463
|
-
if (
|
|
463
|
+
if (G < E.length + 1)
|
|
464
464
|
return '"[Array]"';
|
|
465
465
|
E.push(m);
|
|
466
|
-
const
|
|
467
|
-
let
|
|
468
|
-
for (;
|
|
469
|
-
const J = at(String(
|
|
466
|
+
const B = Math.min(m.length, R);
|
|
467
|
+
let O = 0;
|
|
468
|
+
for (; O < B - 1; O++) {
|
|
469
|
+
const J = at(String(O), m[O], E);
|
|
470
470
|
T += J !== void 0 ? J : "null", T += ",";
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
if (T +=
|
|
474
|
-
const J = m.length -
|
|
475
|
-
T += `,"... ${
|
|
472
|
+
const z = at(String(O), m[O], E);
|
|
473
|
+
if (T += z !== void 0 ? z : "null", m.length - 1 > R) {
|
|
474
|
+
const J = m.length - R - 1;
|
|
475
|
+
T += `,"... ${F(J)} not stringified"`;
|
|
476
476
|
}
|
|
477
477
|
return E.pop(), `[${T}]`;
|
|
478
478
|
}
|
|
479
479
|
let j = Object.keys(m);
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
480
|
+
const D = j.length;
|
|
481
|
+
if (D === 0)
|
|
482
482
|
return "{}";
|
|
483
|
-
if (
|
|
483
|
+
if (G < E.length + 1)
|
|
484
484
|
return '"[Object]"';
|
|
485
|
-
let S = "", k = Math.min(
|
|
486
|
-
h(m) && (T +=
|
|
487
|
-
for (let
|
|
488
|
-
const
|
|
489
|
-
|
|
485
|
+
let S = "", k = Math.min(D, R);
|
|
486
|
+
h(m) && (T += w(m, ",", R), j = j.slice(m.length), k -= m.length, S = ","), Y && (j = l(j)), E.push(m);
|
|
487
|
+
for (let B = 0; B < k; B++) {
|
|
488
|
+
const O = j[B], z = at(O, m[O], E);
|
|
489
|
+
z !== void 0 && (T += `${S}${u(O)}:${z}`, S = ",");
|
|
490
490
|
}
|
|
491
|
-
if (
|
|
492
|
-
const
|
|
493
|
-
T += `${S}"...":"${B
|
|
491
|
+
if (D > R) {
|
|
492
|
+
const B = D - R;
|
|
493
|
+
T += `${S}"...":"${F(B)} not stringified"`;
|
|
494
494
|
}
|
|
495
495
|
return E.pop(), `{${T}}`;
|
|
496
496
|
}
|
|
@@ -501,7 +501,7 @@ ${$}`), E.pop(), `{${I}}`;
|
|
|
501
501
|
case "undefined":
|
|
502
502
|
return;
|
|
503
503
|
case "bigint":
|
|
504
|
-
if (
|
|
504
|
+
if (W)
|
|
505
505
|
return String(m);
|
|
506
506
|
default:
|
|
507
507
|
return b ? b(m) : void 0;
|
|
@@ -514,7 +514,7 @@ ${$}`), E.pop(), `{${I}}`;
|
|
|
514
514
|
if (typeof m == "function")
|
|
515
515
|
return ct("", { "": V }, [], m, T, "");
|
|
516
516
|
if (Array.isArray(m))
|
|
517
|
-
return lt("", V, [],
|
|
517
|
+
return lt("", V, [], U(m), T, "");
|
|
518
518
|
}
|
|
519
519
|
if (T.length !== 0)
|
|
520
520
|
return ot("", V, [], T, "");
|
|
@@ -527,24 +527,24 @@ ${$}`), E.pop(), `{${I}}`;
|
|
|
527
527
|
var Je = $t.exports;
|
|
528
528
|
const St = /* @__PURE__ */ qt(Je);
|
|
529
529
|
St.configure;
|
|
530
|
-
function We(
|
|
531
|
-
return { ...
|
|
530
|
+
function We(r, i) {
|
|
531
|
+
return { ...r, name: i };
|
|
532
532
|
}
|
|
533
|
-
function Ve(
|
|
533
|
+
function Ve(r, i, s) {
|
|
534
534
|
const p = {
|
|
535
535
|
skip: s,
|
|
536
|
-
document:
|
|
537
|
-
}, { scope: f } =
|
|
538
|
-
return !f ||
|
|
536
|
+
document: r
|
|
537
|
+
}, { scope: f } = i;
|
|
538
|
+
return !f || i.skip === void 0 ? p : xt(p, (u) => {
|
|
539
539
|
const [l] = u.document.operations[f].slice(-1);
|
|
540
|
-
|
|
540
|
+
i.skip && i.skip > 0 && (u.skip = i.skip), l.type === "NOOP" && i.index === l.index && u.skip > l.skip && u.document.operations[f].pop();
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
function He(
|
|
544
|
-
const { scope: p, input: f } =
|
|
543
|
+
function He(r, i, s) {
|
|
544
|
+
const { scope: p, input: f } = i;
|
|
545
545
|
return xt({
|
|
546
|
-
document:
|
|
547
|
-
action:
|
|
546
|
+
document: r,
|
|
547
|
+
action: i,
|
|
548
548
|
skip: s
|
|
549
549
|
}, (l) => {
|
|
550
550
|
if (l.document.operations[p].length < 1)
|
|
@@ -562,31 +562,31 @@ function He(i, r, s) {
|
|
|
562
562
|
const [a] = l.document.operations[p].slice(-1), h = a.type === "NOOP" && a.skip > 0;
|
|
563
563
|
if (l.skip += f, h) {
|
|
564
564
|
l.skip += a.skip;
|
|
565
|
-
const
|
|
566
|
-
|
|
565
|
+
const _ = l.document.operations[p][l.document.operations[p].length - 2];
|
|
566
|
+
_ && a.index - _.index === 1 && l.document.operations[p].pop();
|
|
567
567
|
}
|
|
568
568
|
if (l.document.operations[p].length < l.skip)
|
|
569
569
|
throw new Error(
|
|
570
570
|
"Cannot undo: you can't undo more operations than the ones in the scope history"
|
|
571
571
|
);
|
|
572
|
-
const
|
|
573
|
-
let
|
|
574
|
-
for (;
|
|
575
|
-
const
|
|
576
|
-
if (!
|
|
577
|
-
|
|
572
|
+
const w = l.document.operations[p].length - 1;
|
|
573
|
+
let g = f, A = h ? w - a.skip : w;
|
|
574
|
+
for (; g > 0 && A >= 0; ) {
|
|
575
|
+
const _ = l.document.operations[p][A];
|
|
576
|
+
if (!_) {
|
|
577
|
+
g--, A--;
|
|
578
578
|
continue;
|
|
579
579
|
}
|
|
580
|
-
|
|
580
|
+
_.type === "NOOP" && _.skip > 0 ? (A = A - (_.skip + 1), l.skip += _.skip + 1) : (l.document.clipboard.push({ ..._ }), g--, A--);
|
|
581
581
|
}
|
|
582
582
|
l.action = Zt(p);
|
|
583
583
|
});
|
|
584
584
|
}
|
|
585
|
-
function Ke(
|
|
586
|
-
const { scope: p, input: f } =
|
|
585
|
+
function Ke(r, i, s) {
|
|
586
|
+
const { scope: p, input: f } = i;
|
|
587
587
|
return xt({
|
|
588
|
-
document:
|
|
589
|
-
action:
|
|
588
|
+
document: r,
|
|
589
|
+
action: i,
|
|
590
590
|
skip: s
|
|
591
591
|
}, (l) => {
|
|
592
592
|
if (l.skip > 0)
|
|
@@ -602,7 +602,7 @@ function Ke(i, r, s) {
|
|
|
602
602
|
if (l.document.clipboard.length < 1)
|
|
603
603
|
throw new Error("Cannot redo: no operations in the clipboard");
|
|
604
604
|
const a = l.document.clipboard.findLastIndex(
|
|
605
|
-
(
|
|
605
|
+
(w) => w.scope === p
|
|
606
606
|
);
|
|
607
607
|
if (a < 0)
|
|
608
608
|
throw new Error(
|
|
@@ -616,192 +616,201 @@ function Ke(i, r, s) {
|
|
|
616
616
|
});
|
|
617
617
|
});
|
|
618
618
|
}
|
|
619
|
-
function Ze(
|
|
620
|
-
const { scope: p } =
|
|
619
|
+
function Ze(r, i, s) {
|
|
620
|
+
const { scope: p } = i, f = r.operations[p];
|
|
621
621
|
let {
|
|
622
622
|
input: { start: u, end: l }
|
|
623
|
-
} =
|
|
623
|
+
} = i;
|
|
624
624
|
u = u || 0, l = l || f.length;
|
|
625
|
-
const a = f.slice(u, l), h = f.slice(0, u),
|
|
626
|
-
|
|
625
|
+
const a = f.slice(u, l), h = f.slice(0, u), w = f.slice(l), g = Nt(
|
|
626
|
+
r.initialState,
|
|
627
627
|
{
|
|
628
|
-
...
|
|
628
|
+
...r.operations,
|
|
629
629
|
[p]: h.concat(a)
|
|
630
630
|
},
|
|
631
631
|
s
|
|
632
|
-
), { name:
|
|
632
|
+
), { name: A, state: _ } = g, F = h.length, U = h.length ? h[h.length - 1].timestamp : w.length ? w[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
|
|
633
633
|
return Nt(
|
|
634
|
-
|
|
634
|
+
r.initialState,
|
|
635
635
|
{
|
|
636
|
-
...
|
|
636
|
+
...r.operations,
|
|
637
637
|
[p]: [
|
|
638
638
|
...h,
|
|
639
639
|
{
|
|
640
640
|
...Kt(
|
|
641
|
-
{ name:
|
|
641
|
+
{ name: A, state: _ },
|
|
642
642
|
a.length
|
|
643
643
|
),
|
|
644
|
-
timestamp:
|
|
645
|
-
index:
|
|
646
|
-
hash: Ht({ state:
|
|
644
|
+
timestamp: U,
|
|
645
|
+
index: F,
|
|
646
|
+
hash: Ht({ state: _ }, "global")
|
|
647
647
|
},
|
|
648
|
-
...
|
|
649
|
-
...
|
|
650
|
-
index:
|
|
648
|
+
...w.map((L, C) => ({
|
|
649
|
+
...L,
|
|
650
|
+
index: F + C + 1
|
|
651
651
|
}))
|
|
652
652
|
]
|
|
653
653
|
},
|
|
654
654
|
s
|
|
655
655
|
);
|
|
656
656
|
}
|
|
657
|
-
function Ge(
|
|
657
|
+
function Ge(r, i) {
|
|
658
658
|
return {
|
|
659
|
-
...
|
|
660
|
-
name:
|
|
661
|
-
state:
|
|
659
|
+
...r,
|
|
660
|
+
name: i.name,
|
|
661
|
+
state: i.state ?? { global: {}, local: {} }
|
|
662
662
|
};
|
|
663
663
|
}
|
|
664
664
|
const xe = "SET_NAME", gt = "UNDO", yt = "REDO", Ft = "PRUNE", de = "LOAD_STATE", Ye = "NOOP";
|
|
665
|
-
function Xe(
|
|
665
|
+
function Xe(r, i) {
|
|
666
666
|
let s;
|
|
667
|
-
return "index" in
|
|
667
|
+
return "index" in i ? s = { ...i } : s = r.operations[i.scope].slice(-1)[0], ((s == null ? void 0 : s.index) ?? -1) + 1;
|
|
668
668
|
}
|
|
669
|
-
function Qe(
|
|
669
|
+
function Qe(r, i) {
|
|
670
670
|
return {
|
|
671
|
-
...
|
|
671
|
+
...r,
|
|
672
672
|
revision: {
|
|
673
|
-
...
|
|
674
|
-
[
|
|
673
|
+
...r.revision,
|
|
674
|
+
[i.scope]: Xe(r, i)
|
|
675
675
|
},
|
|
676
676
|
lastModified: (/* @__PURE__ */ new Date()).toISOString()
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
function tr(
|
|
680
|
-
if ([gt, yt, Ft].includes(
|
|
681
|
-
return
|
|
682
|
-
const { scope: p } =
|
|
679
|
+
function tr(r, i, s = 0) {
|
|
680
|
+
if ([gt, yt, Ft].includes(i.type))
|
|
681
|
+
return r;
|
|
682
|
+
const { scope: p } = i, f = r.operations[p].slice(
|
|
683
683
|
0,
|
|
684
|
-
|
|
684
|
+
r.revision[p]
|
|
685
685
|
), u = [...f].pop();
|
|
686
686
|
let l = ((u == null ? void 0 : u.index) ?? -1) + 1;
|
|
687
|
-
if ("index" in
|
|
688
|
-
if (
|
|
687
|
+
if ("index" in i) {
|
|
688
|
+
if (i.index > l + s)
|
|
689
689
|
throw new Error(
|
|
690
|
-
`Missing operations: expected ${l} with skip 0 or equivalent, got index ${
|
|
690
|
+
`Missing operations: expected ${l} with skip 0 or equivalent, got index ${i.index} with skip ${s}`
|
|
691
691
|
);
|
|
692
|
-
l =
|
|
692
|
+
l = i.index;
|
|
693
693
|
}
|
|
694
694
|
return f.push({
|
|
695
|
-
...
|
|
695
|
+
...i,
|
|
696
696
|
index: l,
|
|
697
697
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
698
698
|
hash: "",
|
|
699
699
|
scope: p,
|
|
700
|
-
skip: s
|
|
700
|
+
skip: s,
|
|
701
|
+
error: void 0
|
|
701
702
|
}), {
|
|
702
|
-
...
|
|
703
|
-
operations: { ...
|
|
703
|
+
...r,
|
|
704
|
+
operations: { ...r.operations, [p]: f }
|
|
704
705
|
};
|
|
705
706
|
}
|
|
706
|
-
function er(
|
|
707
|
-
let p = tr(
|
|
708
|
-
return p = Qe(p,
|
|
707
|
+
function er(r, i, s = 0) {
|
|
708
|
+
let p = tr(r, i, s);
|
|
709
|
+
return p = Qe(p, i), p;
|
|
709
710
|
}
|
|
710
|
-
function rr(
|
|
711
|
-
switch (pe().parse(
|
|
711
|
+
function rr(r, i, s) {
|
|
712
|
+
switch (pe().parse(i), i.type) {
|
|
712
713
|
case xe:
|
|
713
|
-
return We(
|
|
714
|
+
return We(r, i.input);
|
|
714
715
|
case Ft:
|
|
715
|
-
return Ze(
|
|
716
|
+
return Ze(r, i, s);
|
|
716
717
|
case de:
|
|
717
|
-
return Ge(
|
|
718
|
+
return Ge(r, i.input.state);
|
|
718
719
|
default:
|
|
719
|
-
return
|
|
720
|
+
return r;
|
|
720
721
|
}
|
|
721
722
|
}
|
|
722
|
-
function ir(
|
|
723
|
-
switch (
|
|
723
|
+
function ir(r, i, s) {
|
|
724
|
+
switch (i.type) {
|
|
724
725
|
case gt:
|
|
725
|
-
return He(
|
|
726
|
+
return He(r, i, s);
|
|
726
727
|
case yt:
|
|
727
|
-
return Ke(
|
|
728
|
+
return Ke(r, i, s);
|
|
728
729
|
default:
|
|
729
|
-
return { document:
|
|
730
|
+
return { document: r, action: i, skip: s };
|
|
730
731
|
}
|
|
731
732
|
}
|
|
732
|
-
function ge(
|
|
733
|
+
function ge(r, i, s, p, f = {}) {
|
|
733
734
|
const { skip: u, ignoreSkipOperations: l = !1, reuseHash: a = !1 } = f;
|
|
734
|
-
let h = { ...
|
|
735
|
+
let h = { ...i }, w = u || 0, g = r, A = [...r.clipboard];
|
|
735
736
|
if (Mr(h)) {
|
|
736
|
-
const { document:
|
|
737
|
-
|
|
737
|
+
const { document: _, skip: F } = Ve(g, h, w);
|
|
738
|
+
w = F, g = _;
|
|
738
739
|
}
|
|
739
740
|
if (Xt(h)) {
|
|
740
741
|
const {
|
|
741
|
-
skip:
|
|
742
|
-
action:
|
|
743
|
-
document:
|
|
744
|
-
} = ir(
|
|
745
|
-
h =
|
|
746
|
-
}
|
|
747
|
-
if (Qt(h) && (
|
|
748
|
-
let
|
|
749
|
-
"index" in h && (
|
|
750
|
-
|
|
742
|
+
skip: _,
|
|
743
|
+
action: F,
|
|
744
|
+
document: U
|
|
745
|
+
} = ir(r, h, w);
|
|
746
|
+
h = F, w = _, g = U, A = [...g.clipboard];
|
|
747
|
+
}
|
|
748
|
+
if (Qt(h) && (g = rr(g, h, s)), w > 0 && !l) {
|
|
749
|
+
let _ = w;
|
|
750
|
+
"index" in h && (_ = qr(
|
|
751
|
+
g.operations[h.scope],
|
|
751
752
|
h.index,
|
|
752
|
-
|
|
753
|
-
)),
|
|
754
|
-
|
|
755
|
-
|
|
753
|
+
w
|
|
754
|
+
)), g = Nt(
|
|
755
|
+
g.initialState,
|
|
756
|
+
g.operations,
|
|
756
757
|
s,
|
|
757
758
|
void 0,
|
|
758
759
|
void 0,
|
|
759
760
|
void 0,
|
|
760
|
-
{ [h.scope]:
|
|
761
|
+
{ [h.scope]: _ }
|
|
761
762
|
// TODO reuse hash?
|
|
762
763
|
);
|
|
763
764
|
}
|
|
764
|
-
return
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
765
|
+
return g = er(g, h, w), g = xt(g, (_) => {
|
|
766
|
+
try {
|
|
767
|
+
const F = s(
|
|
768
|
+
_.state,
|
|
769
|
+
h,
|
|
770
|
+
p
|
|
771
|
+
), U = Xt(i) ? [...A] : [];
|
|
772
|
+
if (F)
|
|
773
|
+
return Ut({
|
|
774
|
+
...g,
|
|
775
|
+
clipboard: [...U],
|
|
776
|
+
state: F
|
|
777
|
+
});
|
|
778
|
+
_.clipboard = Ut([...U]);
|
|
779
|
+
} catch (F) {
|
|
780
|
+
const U = g.operations[h.scope].length - 1;
|
|
781
|
+
_.operations[h.scope][U].error = F.message, console.error(
|
|
782
|
+
`Error thrown in reducer. Action: ${JSON.stringify(h)}, Error:`,
|
|
783
|
+
F
|
|
784
|
+
);
|
|
785
|
+
}
|
|
786
|
+
}), xt(g, (_) => {
|
|
778
787
|
if ([gt, yt, Ft].includes(h.type))
|
|
779
|
-
return
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
const { hash:
|
|
783
|
-
|
|
784
|
-
...
|
|
788
|
+
return _;
|
|
789
|
+
const F = h.scope || "global", U = a && Object.prototype.hasOwnProperty.call(h, "hash") ? h.hash : Ht(_, F);
|
|
790
|
+
_.operations[F][_.operations[F].length - 1].hash = U, !Qt(h) && h.attachments && h.attachments.forEach((L) => {
|
|
791
|
+
const { hash: C, ...y } = L;
|
|
792
|
+
_.attachments[C] = {
|
|
793
|
+
...y
|
|
785
794
|
};
|
|
786
795
|
});
|
|
787
796
|
});
|
|
788
797
|
}
|
|
789
798
|
var Dt = { exports: {} };
|
|
790
|
-
typeof Object.create == "function" ? Dt.exports = function(
|
|
791
|
-
s && (
|
|
799
|
+
typeof Object.create == "function" ? Dt.exports = function(i, s) {
|
|
800
|
+
s && (i.super_ = s, i.prototype = Object.create(s.prototype, {
|
|
792
801
|
constructor: {
|
|
793
|
-
value:
|
|
802
|
+
value: i,
|
|
794
803
|
enumerable: !1,
|
|
795
804
|
writable: !0,
|
|
796
805
|
configurable: !0
|
|
797
806
|
}
|
|
798
807
|
}));
|
|
799
|
-
} : Dt.exports = function(
|
|
808
|
+
} : Dt.exports = function(i, s) {
|
|
800
809
|
if (s) {
|
|
801
|
-
|
|
810
|
+
i.super_ = s;
|
|
802
811
|
var p = function() {
|
|
803
812
|
};
|
|
804
|
-
p.prototype = s.prototype,
|
|
813
|
+
p.prototype = s.prototype, i.prototype = new p(), i.prototype.constructor = i;
|
|
805
814
|
}
|
|
806
815
|
};
|
|
807
816
|
var ye = Dt.exports, Ct = { exports: {} }, we = {}, Bt = {};
|
|
@@ -813,69 +822,69 @@ for (var ut = 0, or = kt.length; ut < or; ++ut)
|
|
|
813
822
|
nt[ut] = kt[ut], rt[kt.charCodeAt(ut)] = ut;
|
|
814
823
|
rt[45] = 62;
|
|
815
824
|
rt[95] = 63;
|
|
816
|
-
function be(
|
|
817
|
-
var
|
|
818
|
-
if (
|
|
825
|
+
function be(r) {
|
|
826
|
+
var i = r.length;
|
|
827
|
+
if (i % 4 > 0)
|
|
819
828
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
820
|
-
var s =
|
|
821
|
-
s === -1 && (s =
|
|
822
|
-
var p = s ===
|
|
829
|
+
var s = r.indexOf("=");
|
|
830
|
+
s === -1 && (s = i);
|
|
831
|
+
var p = s === i ? 0 : 4 - s % 4;
|
|
823
832
|
return [s, p];
|
|
824
833
|
}
|
|
825
|
-
function ar(
|
|
826
|
-
var
|
|
834
|
+
function ar(r) {
|
|
835
|
+
var i = be(r), s = i[0], p = i[1];
|
|
827
836
|
return (s + p) * 3 / 4 - p;
|
|
828
837
|
}
|
|
829
|
-
function sr(
|
|
830
|
-
return (
|
|
838
|
+
function sr(r, i, s) {
|
|
839
|
+
return (i + s) * 3 / 4 - s;
|
|
831
840
|
}
|
|
832
|
-
function pr(
|
|
833
|
-
var
|
|
841
|
+
function pr(r) {
|
|
842
|
+
var i, s = be(r), p = s[0], f = s[1], u = new nr(sr(r, p, f)), l = 0, a = f > 0 ? p - 4 : p, h;
|
|
834
843
|
for (h = 0; h < a; h += 4)
|
|
835
|
-
|
|
836
|
-
return f === 2 && (
|
|
844
|
+
i = rt[r.charCodeAt(h)] << 18 | rt[r.charCodeAt(h + 1)] << 12 | rt[r.charCodeAt(h + 2)] << 6 | rt[r.charCodeAt(h + 3)], u[l++] = i >> 16 & 255, u[l++] = i >> 8 & 255, u[l++] = i & 255;
|
|
845
|
+
return f === 2 && (i = rt[r.charCodeAt(h)] << 2 | rt[r.charCodeAt(h + 1)] >> 4, u[l++] = i & 255), f === 1 && (i = rt[r.charCodeAt(h)] << 10 | rt[r.charCodeAt(h + 1)] << 4 | rt[r.charCodeAt(h + 2)] >> 2, u[l++] = i >> 8 & 255, u[l++] = i & 255), u;
|
|
837
846
|
}
|
|
838
|
-
function cr(
|
|
839
|
-
return nt[
|
|
847
|
+
function cr(r) {
|
|
848
|
+
return nt[r >> 18 & 63] + nt[r >> 12 & 63] + nt[r >> 6 & 63] + nt[r & 63];
|
|
840
849
|
}
|
|
841
|
-
function lr(
|
|
842
|
-
for (var p, f = [], u =
|
|
843
|
-
p = (
|
|
850
|
+
function lr(r, i, s) {
|
|
851
|
+
for (var p, f = [], u = i; u < s; u += 3)
|
|
852
|
+
p = (r[u] << 16 & 16711680) + (r[u + 1] << 8 & 65280) + (r[u + 2] & 255), f.push(cr(p));
|
|
844
853
|
return f.join("");
|
|
845
854
|
}
|
|
846
|
-
function ur(
|
|
847
|
-
for (var
|
|
848
|
-
f.push(lr(
|
|
849
|
-
return p === 1 ? (
|
|
850
|
-
nt[
|
|
851
|
-
)) : p === 2 && (
|
|
852
|
-
nt[
|
|
855
|
+
function ur(r) {
|
|
856
|
+
for (var i, s = r.length, p = s % 3, f = [], u = 16383, l = 0, a = s - p; l < a; l += u)
|
|
857
|
+
f.push(lr(r, l, l + u > a ? a : l + u));
|
|
858
|
+
return p === 1 ? (i = r[s - 1], f.push(
|
|
859
|
+
nt[i >> 2] + nt[i << 4 & 63] + "=="
|
|
860
|
+
)) : p === 2 && (i = (r[s - 2] << 8) + r[s - 1], f.push(
|
|
861
|
+
nt[i >> 10] + nt[i >> 4 & 63] + nt[i << 2 & 63] + "="
|
|
853
862
|
)), f.join("");
|
|
854
863
|
}
|
|
855
864
|
var Jt = {};
|
|
856
865
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
857
|
-
Jt.read = function(
|
|
858
|
-
var u, l, a = f * 8 - p - 1, h = (1 << a) - 1,
|
|
859
|
-
for (
|
|
866
|
+
Jt.read = function(r, i, s, p, f) {
|
|
867
|
+
var u, l, a = f * 8 - p - 1, h = (1 << a) - 1, w = h >> 1, g = -7, A = s ? f - 1 : 0, _ = s ? -1 : 1, F = r[i + A];
|
|
868
|
+
for (A += _, u = F & (1 << -g) - 1, F >>= -g, g += a; g > 0; u = u * 256 + r[i + A], A += _, g -= 8)
|
|
860
869
|
;
|
|
861
|
-
for (l = u & (1 << -
|
|
870
|
+
for (l = u & (1 << -g) - 1, u >>= -g, g += p; g > 0; l = l * 256 + r[i + A], A += _, g -= 8)
|
|
862
871
|
;
|
|
863
872
|
if (u === 0)
|
|
864
|
-
u = 1 -
|
|
873
|
+
u = 1 - w;
|
|
865
874
|
else {
|
|
866
875
|
if (u === h)
|
|
867
|
-
return l ? NaN : (
|
|
868
|
-
l = l + Math.pow(2, p), u = u -
|
|
876
|
+
return l ? NaN : (F ? -1 : 1) * (1 / 0);
|
|
877
|
+
l = l + Math.pow(2, p), u = u - w;
|
|
869
878
|
}
|
|
870
|
-
return (
|
|
879
|
+
return (F ? -1 : 1) * l * Math.pow(2, u - p);
|
|
871
880
|
};
|
|
872
|
-
Jt.write = function(
|
|
873
|
-
var l, a, h,
|
|
874
|
-
for (
|
|
881
|
+
Jt.write = function(r, i, s, p, f, u) {
|
|
882
|
+
var l, a, h, w = u * 8 - f - 1, g = (1 << w) - 1, A = g >> 1, _ = f === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = p ? 0 : u - 1, U = p ? 1 : -1, L = i < 0 || i === 0 && 1 / i < 0 ? 1 : 0;
|
|
883
|
+
for (i = Math.abs(i), isNaN(i) || i === 1 / 0 ? (a = isNaN(i) ? 1 : 0, l = g) : (l = Math.floor(Math.log(i) / Math.LN2), i * (h = Math.pow(2, -l)) < 1 && (l--, h *= 2), l + A >= 1 ? i += _ / h : i += _ * Math.pow(2, 1 - A), i * h >= 2 && (l++, h /= 2), l + A >= g ? (a = 0, l = g) : l + A >= 1 ? (a = (i * h - 1) * Math.pow(2, f), l = l + A) : (a = i * Math.pow(2, A - 1) * Math.pow(2, f), l = 0)); f >= 8; r[s + F] = a & 255, F += U, a /= 256, f -= 8)
|
|
875
884
|
;
|
|
876
|
-
for (l = l << f | a,
|
|
885
|
+
for (l = l << f | a, w += f; w > 0; r[s + F] = l & 255, F += U, l /= 256, w -= 8)
|
|
877
886
|
;
|
|
878
|
-
|
|
887
|
+
r[s + F - U] |= L * 128;
|
|
879
888
|
};
|
|
880
889
|
/*!
|
|
881
890
|
* The buffer module from node.js, for the browser.
|
|
@@ -883,11 +892,11 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
883
892
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
884
893
|
* @license MIT
|
|
885
894
|
*/
|
|
886
|
-
(function(
|
|
887
|
-
var
|
|
888
|
-
|
|
895
|
+
(function(r) {
|
|
896
|
+
var i = Bt, s = Jt, p = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
897
|
+
r.Buffer = a, r.SlowBuffer = b, r.INSPECT_MAX_BYTES = 50;
|
|
889
898
|
var f = 2147483647;
|
|
890
|
-
|
|
899
|
+
r.kMaxLength = f, a.TYPED_ARRAY_SUPPORT = u(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
891
900
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
892
901
|
);
|
|
893
902
|
function u() {
|
|
@@ -925,22 +934,22 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
925
934
|
throw new TypeError(
|
|
926
935
|
'The "string" argument must be of type string. Received type number'
|
|
927
936
|
);
|
|
928
|
-
return
|
|
937
|
+
return A(n);
|
|
929
938
|
}
|
|
930
939
|
return h(n, t, e);
|
|
931
940
|
}
|
|
932
941
|
a.poolSize = 8192;
|
|
933
942
|
function h(n, t, e) {
|
|
934
943
|
if (typeof n == "string")
|
|
935
|
-
return
|
|
944
|
+
return _(n, t);
|
|
936
945
|
if (ArrayBuffer.isView(n))
|
|
937
|
-
return
|
|
946
|
+
return U(n);
|
|
938
947
|
if (n == null)
|
|
939
948
|
throw new TypeError(
|
|
940
949
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof n
|
|
941
950
|
);
|
|
942
951
|
if (it(n, ArrayBuffer) || n && it(n.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (it(n, SharedArrayBuffer) || n && it(n.buffer, SharedArrayBuffer)))
|
|
943
|
-
return
|
|
952
|
+
return L(n, t, e);
|
|
944
953
|
if (typeof n == "number")
|
|
945
954
|
throw new TypeError(
|
|
946
955
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -948,7 +957,7 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
948
957
|
var o = n.valueOf && n.valueOf();
|
|
949
958
|
if (o != null && o !== n)
|
|
950
959
|
return a.from(o, t, e);
|
|
951
|
-
var c =
|
|
960
|
+
var c = C(n);
|
|
952
961
|
if (c)
|
|
953
962
|
return c;
|
|
954
963
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof n[Symbol.toPrimitive] == "function")
|
|
@@ -964,45 +973,45 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
964
973
|
a.from = function(n, t, e) {
|
|
965
974
|
return h(n, t, e);
|
|
966
975
|
}, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
|
|
967
|
-
function
|
|
976
|
+
function w(n) {
|
|
968
977
|
if (typeof n != "number")
|
|
969
978
|
throw new TypeError('"size" argument must be of type number');
|
|
970
979
|
if (n < 0)
|
|
971
980
|
throw new RangeError('The value "' + n + '" is invalid for option "size"');
|
|
972
981
|
}
|
|
973
|
-
function
|
|
974
|
-
return
|
|
982
|
+
function g(n, t, e) {
|
|
983
|
+
return w(n), n <= 0 ? l(n) : t !== void 0 ? typeof e == "string" ? l(n).fill(t, e) : l(n).fill(t) : l(n);
|
|
975
984
|
}
|
|
976
985
|
a.alloc = function(n, t, e) {
|
|
977
|
-
return
|
|
986
|
+
return g(n, t, e);
|
|
978
987
|
};
|
|
979
|
-
function
|
|
980
|
-
return
|
|
988
|
+
function A(n) {
|
|
989
|
+
return w(n), l(n < 0 ? 0 : y(n) | 0);
|
|
981
990
|
}
|
|
982
991
|
a.allocUnsafe = function(n) {
|
|
983
|
-
return
|
|
992
|
+
return A(n);
|
|
984
993
|
}, a.allocUnsafeSlow = function(n) {
|
|
985
|
-
return
|
|
994
|
+
return A(n);
|
|
986
995
|
};
|
|
987
|
-
function
|
|
996
|
+
function _(n, t) {
|
|
988
997
|
if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
|
|
989
998
|
throw new TypeError("Unknown encoding: " + t);
|
|
990
|
-
var e =
|
|
999
|
+
var e = I(n, t) | 0, o = l(e), c = o.write(n, t);
|
|
991
1000
|
return c !== e && (o = o.slice(0, c)), o;
|
|
992
1001
|
}
|
|
993
|
-
function
|
|
994
|
-
for (var t = n.length < 0 ? 0 :
|
|
1002
|
+
function F(n) {
|
|
1003
|
+
for (var t = n.length < 0 ? 0 : y(n.length) | 0, e = l(t), o = 0; o < t; o += 1)
|
|
995
1004
|
e[o] = n[o] & 255;
|
|
996
1005
|
return e;
|
|
997
1006
|
}
|
|
998
|
-
function
|
|
1007
|
+
function U(n) {
|
|
999
1008
|
if (it(n, Uint8Array)) {
|
|
1000
1009
|
var t = new Uint8Array(n);
|
|
1001
|
-
return
|
|
1010
|
+
return L(t.buffer, t.byteOffset, t.byteLength);
|
|
1002
1011
|
}
|
|
1003
|
-
return
|
|
1012
|
+
return F(n);
|
|
1004
1013
|
}
|
|
1005
|
-
function
|
|
1014
|
+
function L(n, t, e) {
|
|
1006
1015
|
if (t < 0 || n.byteLength < t)
|
|
1007
1016
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1008
1017
|
if (n.byteLength < t + (e || 0))
|
|
@@ -1010,17 +1019,17 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1010
1019
|
var o;
|
|
1011
1020
|
return t === void 0 && e === void 0 ? o = new Uint8Array(n) : e === void 0 ? o = new Uint8Array(n, t) : o = new Uint8Array(n, t, e), Object.setPrototypeOf(o, a.prototype), o;
|
|
1012
1021
|
}
|
|
1013
|
-
function
|
|
1022
|
+
function C(n) {
|
|
1014
1023
|
if (a.isBuffer(n)) {
|
|
1015
|
-
var t =
|
|
1024
|
+
var t = y(n.length) | 0, e = l(t);
|
|
1016
1025
|
return e.length === 0 || n.copy(e, 0, 0, t), e;
|
|
1017
1026
|
}
|
|
1018
1027
|
if (n.length !== void 0)
|
|
1019
|
-
return typeof n.length != "number" || Tt(n.length) ? l(0) :
|
|
1028
|
+
return typeof n.length != "number" || Tt(n.length) ? l(0) : F(n);
|
|
1020
1029
|
if (n.type === "Buffer" && Array.isArray(n.data))
|
|
1021
|
-
return
|
|
1030
|
+
return F(n.data);
|
|
1022
1031
|
}
|
|
1023
|
-
function
|
|
1032
|
+
function y(n) {
|
|
1024
1033
|
if (n >= f)
|
|
1025
1034
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + f.toString(16) + " bytes");
|
|
1026
1035
|
return n | 0;
|
|
@@ -1086,7 +1095,7 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1086
1095
|
}
|
|
1087
1096
|
return c;
|
|
1088
1097
|
};
|
|
1089
|
-
function
|
|
1098
|
+
function I(n, t) {
|
|
1090
1099
|
if (a.isBuffer(n))
|
|
1091
1100
|
return n.length;
|
|
1092
1101
|
if (ArrayBuffer.isView(n) || it(n, ArrayBuffer))
|
|
@@ -1122,8 +1131,8 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1122
1131
|
t = ("" + t).toLowerCase(), c = !0;
|
|
1123
1132
|
}
|
|
1124
1133
|
}
|
|
1125
|
-
a.byteLength =
|
|
1126
|
-
function
|
|
1134
|
+
a.byteLength = I;
|
|
1135
|
+
function W(n, t, e) {
|
|
1127
1136
|
var o = !1;
|
|
1128
1137
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
|
|
1129
1138
|
return "";
|
|
@@ -1138,7 +1147,7 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1138
1147
|
return j(this, t, e);
|
|
1139
1148
|
case "latin1":
|
|
1140
1149
|
case "binary":
|
|
1141
|
-
return
|
|
1150
|
+
return D(this, t, e);
|
|
1142
1151
|
case "base64":
|
|
1143
1152
|
return V(this, t, e);
|
|
1144
1153
|
case "ucs2":
|
|
@@ -1153,7 +1162,7 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1153
1162
|
}
|
|
1154
1163
|
}
|
|
1155
1164
|
a.prototype._isBuffer = !0;
|
|
1156
|
-
function
|
|
1165
|
+
function Y(n, t, e) {
|
|
1157
1166
|
var o = n[t];
|
|
1158
1167
|
n[t] = n[e], n[e] = o;
|
|
1159
1168
|
}
|
|
@@ -1162,31 +1171,31 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1162
1171
|
if (t % 2 !== 0)
|
|
1163
1172
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
1164
1173
|
for (var e = 0; e < t; e += 2)
|
|
1165
|
-
|
|
1174
|
+
Y(this, e, e + 1);
|
|
1166
1175
|
return this;
|
|
1167
1176
|
}, a.prototype.swap32 = function() {
|
|
1168
1177
|
var t = this.length;
|
|
1169
1178
|
if (t % 4 !== 0)
|
|
1170
1179
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
1171
1180
|
for (var e = 0; e < t; e += 4)
|
|
1172
|
-
|
|
1181
|
+
Y(this, e, e + 3), Y(this, e + 1, e + 2);
|
|
1173
1182
|
return this;
|
|
1174
1183
|
}, a.prototype.swap64 = function() {
|
|
1175
1184
|
var t = this.length;
|
|
1176
1185
|
if (t % 8 !== 0)
|
|
1177
1186
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
1178
1187
|
for (var e = 0; e < t; e += 8)
|
|
1179
|
-
|
|
1188
|
+
Y(this, e, e + 7), Y(this, e + 1, e + 6), Y(this, e + 2, e + 5), Y(this, e + 3, e + 4);
|
|
1180
1189
|
return this;
|
|
1181
1190
|
}, a.prototype.toString = function() {
|
|
1182
1191
|
var t = this.length;
|
|
1183
|
-
return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) :
|
|
1192
|
+
return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) : W.apply(this, arguments);
|
|
1184
1193
|
}, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
|
|
1185
1194
|
if (!a.isBuffer(t))
|
|
1186
1195
|
throw new TypeError("Argument must be a Buffer");
|
|
1187
1196
|
return this === t ? !0 : a.compare(this, t) === 0;
|
|
1188
1197
|
}, a.prototype.inspect = function() {
|
|
1189
|
-
var t = "", e =
|
|
1198
|
+
var t = "", e = r.INSPECT_MAX_BYTES;
|
|
1190
1199
|
return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
|
|
1191
1200
|
}, p && (a.prototype[p] = a.prototype.inspect), a.prototype.compare = function(t, e, o, c, x) {
|
|
1192
1201
|
if (it(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
|
|
@@ -1203,14 +1212,14 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1203
1212
|
return 1;
|
|
1204
1213
|
if (e >>>= 0, o >>>= 0, c >>>= 0, x >>>= 0, this === t)
|
|
1205
1214
|
return 0;
|
|
1206
|
-
for (var d = x - c,
|
|
1207
|
-
if (
|
|
1208
|
-
d =
|
|
1215
|
+
for (var d = x - c, $ = o - e, M = Math.min(d, $), P = this.slice(c, x), Z = t.slice(e, o), q = 0; q < M; ++q)
|
|
1216
|
+
if (P[q] !== Z[q]) {
|
|
1217
|
+
d = P[q], $ = Z[q];
|
|
1209
1218
|
break;
|
|
1210
1219
|
}
|
|
1211
|
-
return d <
|
|
1220
|
+
return d < $ ? -1 : $ < d ? 1 : 0;
|
|
1212
1221
|
};
|
|
1213
|
-
function
|
|
1222
|
+
function G(n, t, e, o, c) {
|
|
1214
1223
|
if (n.length === 0)
|
|
1215
1224
|
return -1;
|
|
1216
1225
|
if (typeof e == "string" ? (o = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, Tt(e) && (e = c ? 0 : n.length - 1), e < 0 && (e = n.length + e), e >= n.length) {
|
|
@@ -1223,48 +1232,48 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1223
1232
|
else
|
|
1224
1233
|
return -1;
|
|
1225
1234
|
if (typeof t == "string" && (t = a.from(t, o)), a.isBuffer(t))
|
|
1226
|
-
return t.length === 0 ? -1 :
|
|
1235
|
+
return t.length === 0 ? -1 : R(n, t, e, o, c);
|
|
1227
1236
|
if (typeof t == "number")
|
|
1228
|
-
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? c ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) :
|
|
1237
|
+
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? c ? Uint8Array.prototype.indexOf.call(n, t, e) : Uint8Array.prototype.lastIndexOf.call(n, t, e) : R(n, [t], e, o, c);
|
|
1229
1238
|
throw new TypeError("val must be string, number or Buffer");
|
|
1230
1239
|
}
|
|
1231
|
-
function
|
|
1232
|
-
var x = 1, d = n.length,
|
|
1240
|
+
function R(n, t, e, o, c) {
|
|
1241
|
+
var x = 1, d = n.length, $ = t.length;
|
|
1233
1242
|
if (o !== void 0 && (o = String(o).toLowerCase(), o === "ucs2" || o === "ucs-2" || o === "utf16le" || o === "utf-16le")) {
|
|
1234
1243
|
if (n.length < 2 || t.length < 2)
|
|
1235
1244
|
return -1;
|
|
1236
|
-
x = 2, d /= 2,
|
|
1245
|
+
x = 2, d /= 2, $ /= 2, e /= 2;
|
|
1237
1246
|
}
|
|
1238
|
-
function
|
|
1247
|
+
function M(Gt, Yt) {
|
|
1239
1248
|
return x === 1 ? Gt[Yt] : Gt.readUInt16BE(Yt * x);
|
|
1240
1249
|
}
|
|
1241
|
-
var
|
|
1250
|
+
var P;
|
|
1242
1251
|
if (c) {
|
|
1243
|
-
var
|
|
1244
|
-
for (
|
|
1245
|
-
if (
|
|
1246
|
-
if (
|
|
1247
|
-
return
|
|
1252
|
+
var Z = -1;
|
|
1253
|
+
for (P = e; P < d; P++)
|
|
1254
|
+
if (M(n, P) === M(t, Z === -1 ? 0 : P - Z)) {
|
|
1255
|
+
if (Z === -1 && (Z = P), P - Z + 1 === $)
|
|
1256
|
+
return Z * x;
|
|
1248
1257
|
} else
|
|
1249
|
-
|
|
1258
|
+
Z !== -1 && (P -= P - Z), Z = -1;
|
|
1250
1259
|
} else
|
|
1251
|
-
for (e +
|
|
1252
|
-
for (var q = !0, vt = 0; vt <
|
|
1253
|
-
if (
|
|
1260
|
+
for (e + $ > d && (e = d - $), P = e; P >= 0; P--) {
|
|
1261
|
+
for (var q = !0, vt = 0; vt < $; vt++)
|
|
1262
|
+
if (M(n, P + vt) !== M(t, vt)) {
|
|
1254
1263
|
q = !1;
|
|
1255
1264
|
break;
|
|
1256
1265
|
}
|
|
1257
1266
|
if (q)
|
|
1258
|
-
return
|
|
1267
|
+
return P;
|
|
1259
1268
|
}
|
|
1260
1269
|
return -1;
|
|
1261
1270
|
}
|
|
1262
1271
|
a.prototype.includes = function(t, e, o) {
|
|
1263
1272
|
return this.indexOf(t, e, o) !== -1;
|
|
1264
1273
|
}, a.prototype.indexOf = function(t, e, o) {
|
|
1265
|
-
return
|
|
1274
|
+
return G(this, t, e, o, !0);
|
|
1266
1275
|
}, a.prototype.lastIndexOf = function(t, e, o) {
|
|
1267
|
-
return
|
|
1276
|
+
return G(this, t, e, o, !1);
|
|
1268
1277
|
};
|
|
1269
1278
|
function ct(n, t, e, o) {
|
|
1270
1279
|
e = Number(e) || 0;
|
|
@@ -1273,10 +1282,10 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1273
1282
|
var x = t.length;
|
|
1274
1283
|
o > x / 2 && (o = x / 2);
|
|
1275
1284
|
for (var d = 0; d < o; ++d) {
|
|
1276
|
-
var
|
|
1277
|
-
if (Tt(
|
|
1285
|
+
var $ = parseInt(t.substr(d * 2, 2), 16);
|
|
1286
|
+
if (Tt($))
|
|
1278
1287
|
return d;
|
|
1279
|
-
n[e + d] =
|
|
1288
|
+
n[e + d] = $;
|
|
1280
1289
|
}
|
|
1281
1290
|
return d;
|
|
1282
1291
|
}
|
|
@@ -1337,29 +1346,29 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1337
1346
|
};
|
|
1338
1347
|
};
|
|
1339
1348
|
function V(n, t, e) {
|
|
1340
|
-
return t === 0 && e === n.length ?
|
|
1349
|
+
return t === 0 && e === n.length ? i.fromByteArray(n) : i.fromByteArray(n.slice(t, e));
|
|
1341
1350
|
}
|
|
1342
1351
|
function m(n, t, e) {
|
|
1343
1352
|
e = Math.min(n.length, e);
|
|
1344
1353
|
for (var o = [], c = t; c < e; ) {
|
|
1345
|
-
var x = n[c], d = null,
|
|
1346
|
-
if (c +
|
|
1347
|
-
var
|
|
1348
|
-
switch (
|
|
1354
|
+
var x = n[c], d = null, $ = x > 239 ? 4 : x > 223 ? 3 : x > 191 ? 2 : 1;
|
|
1355
|
+
if (c + $ <= e) {
|
|
1356
|
+
var M, P, Z, q;
|
|
1357
|
+
switch ($) {
|
|
1349
1358
|
case 1:
|
|
1350
1359
|
x < 128 && (d = x);
|
|
1351
1360
|
break;
|
|
1352
1361
|
case 2:
|
|
1353
|
-
|
|
1362
|
+
M = n[c + 1], (M & 192) === 128 && (q = (x & 31) << 6 | M & 63, q > 127 && (d = q));
|
|
1354
1363
|
break;
|
|
1355
1364
|
case 3:
|
|
1356
|
-
|
|
1365
|
+
M = n[c + 1], P = n[c + 2], (M & 192) === 128 && (P & 192) === 128 && (q = (x & 15) << 12 | (M & 63) << 6 | P & 63, q > 2047 && (q < 55296 || q > 57343) && (d = q));
|
|
1357
1366
|
break;
|
|
1358
1367
|
case 4:
|
|
1359
|
-
|
|
1368
|
+
M = n[c + 1], P = n[c + 2], Z = n[c + 3], (M & 192) === 128 && (P & 192) === 128 && (Z & 192) === 128 && (q = (x & 15) << 18 | (M & 63) << 12 | (P & 63) << 6 | Z & 63, q > 65535 && q < 1114112 && (d = q));
|
|
1360
1369
|
}
|
|
1361
1370
|
}
|
|
1362
|
-
d === null ? (d = 65533,
|
|
1371
|
+
d === null ? (d = 65533, $ = 1) : d > 65535 && (d -= 65536, o.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), o.push(d), c += $;
|
|
1363
1372
|
}
|
|
1364
1373
|
return T(o);
|
|
1365
1374
|
}
|
|
@@ -1382,7 +1391,7 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1382
1391
|
o += String.fromCharCode(n[c] & 127);
|
|
1383
1392
|
return o;
|
|
1384
1393
|
}
|
|
1385
|
-
function
|
|
1394
|
+
function D(n, t, e) {
|
|
1386
1395
|
var o = "";
|
|
1387
1396
|
e = Math.min(n.length, e);
|
|
1388
1397
|
for (var c = t; c < e; ++c)
|
|
@@ -1407,66 +1416,66 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1407
1416
|
var c = this.subarray(t, e);
|
|
1408
1417
|
return Object.setPrototypeOf(c, a.prototype), c;
|
|
1409
1418
|
};
|
|
1410
|
-
function
|
|
1419
|
+
function B(n, t, e) {
|
|
1411
1420
|
if (n % 1 !== 0 || n < 0)
|
|
1412
1421
|
throw new RangeError("offset is not uint");
|
|
1413
1422
|
if (n + t > e)
|
|
1414
1423
|
throw new RangeError("Trying to access beyond buffer length");
|
|
1415
1424
|
}
|
|
1416
1425
|
a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, o) {
|
|
1417
|
-
t = t >>> 0, e = e >>> 0, o ||
|
|
1426
|
+
t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
|
|
1418
1427
|
for (var c = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
|
|
1419
1428
|
c += this[t + d] * x;
|
|
1420
1429
|
return c;
|
|
1421
1430
|
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, o) {
|
|
1422
|
-
t = t >>> 0, e = e >>> 0, o ||
|
|
1431
|
+
t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
|
|
1423
1432
|
for (var c = this[t + --e], x = 1; e > 0 && (x *= 256); )
|
|
1424
1433
|
c += this[t + --e] * x;
|
|
1425
1434
|
return c;
|
|
1426
1435
|
}, a.prototype.readUint8 = a.prototype.readUInt8 = function(t, e) {
|
|
1427
|
-
return t = t >>> 0, e ||
|
|
1436
|
+
return t = t >>> 0, e || B(t, 1, this.length), this[t];
|
|
1428
1437
|
}, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(t, e) {
|
|
1429
|
-
return t = t >>> 0, e ||
|
|
1438
|
+
return t = t >>> 0, e || B(t, 2, this.length), this[t] | this[t + 1] << 8;
|
|
1430
1439
|
}, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(t, e) {
|
|
1431
|
-
return t = t >>> 0, e ||
|
|
1440
|
+
return t = t >>> 0, e || B(t, 2, this.length), this[t] << 8 | this[t + 1];
|
|
1432
1441
|
}, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(t, e) {
|
|
1433
|
-
return t = t >>> 0, e ||
|
|
1442
|
+
return t = t >>> 0, e || B(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
|
|
1434
1443
|
}, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(t, e) {
|
|
1435
|
-
return t = t >>> 0, e ||
|
|
1444
|
+
return t = t >>> 0, e || B(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
|
|
1436
1445
|
}, a.prototype.readIntLE = function(t, e, o) {
|
|
1437
|
-
t = t >>> 0, e = e >>> 0, o ||
|
|
1446
|
+
t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
|
|
1438
1447
|
for (var c = this[t], x = 1, d = 0; ++d < e && (x *= 256); )
|
|
1439
1448
|
c += this[t + d] * x;
|
|
1440
1449
|
return x *= 128, c >= x && (c -= Math.pow(2, 8 * e)), c;
|
|
1441
1450
|
}, a.prototype.readIntBE = function(t, e, o) {
|
|
1442
|
-
t = t >>> 0, e = e >>> 0, o ||
|
|
1451
|
+
t = t >>> 0, e = e >>> 0, o || B(t, e, this.length);
|
|
1443
1452
|
for (var c = e, x = 1, d = this[t + --c]; c > 0 && (x *= 256); )
|
|
1444
1453
|
d += this[t + --c] * x;
|
|
1445
1454
|
return x *= 128, d >= x && (d -= Math.pow(2, 8 * e)), d;
|
|
1446
1455
|
}, a.prototype.readInt8 = function(t, e) {
|
|
1447
|
-
return t = t >>> 0, e ||
|
|
1456
|
+
return t = t >>> 0, e || B(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
|
|
1448
1457
|
}, a.prototype.readInt16LE = function(t, e) {
|
|
1449
|
-
t = t >>> 0, e ||
|
|
1458
|
+
t = t >>> 0, e || B(t, 2, this.length);
|
|
1450
1459
|
var o = this[t] | this[t + 1] << 8;
|
|
1451
1460
|
return o & 32768 ? o | 4294901760 : o;
|
|
1452
1461
|
}, a.prototype.readInt16BE = function(t, e) {
|
|
1453
|
-
t = t >>> 0, e ||
|
|
1462
|
+
t = t >>> 0, e || B(t, 2, this.length);
|
|
1454
1463
|
var o = this[t + 1] | this[t] << 8;
|
|
1455
1464
|
return o & 32768 ? o | 4294901760 : o;
|
|
1456
1465
|
}, a.prototype.readInt32LE = function(t, e) {
|
|
1457
|
-
return t = t >>> 0, e ||
|
|
1466
|
+
return t = t >>> 0, e || B(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
|
|
1458
1467
|
}, a.prototype.readInt32BE = function(t, e) {
|
|
1459
|
-
return t = t >>> 0, e ||
|
|
1468
|
+
return t = t >>> 0, e || B(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
|
|
1460
1469
|
}, a.prototype.readFloatLE = function(t, e) {
|
|
1461
|
-
return t = t >>> 0, e ||
|
|
1470
|
+
return t = t >>> 0, e || B(t, 4, this.length), s.read(this, t, !0, 23, 4);
|
|
1462
1471
|
}, a.prototype.readFloatBE = function(t, e) {
|
|
1463
|
-
return t = t >>> 0, e ||
|
|
1472
|
+
return t = t >>> 0, e || B(t, 4, this.length), s.read(this, t, !1, 23, 4);
|
|
1464
1473
|
}, a.prototype.readDoubleLE = function(t, e) {
|
|
1465
|
-
return t = t >>> 0, e ||
|
|
1474
|
+
return t = t >>> 0, e || B(t, 8, this.length), s.read(this, t, !0, 52, 8);
|
|
1466
1475
|
}, a.prototype.readDoubleBE = function(t, e) {
|
|
1467
|
-
return t = t >>> 0, e ||
|
|
1476
|
+
return t = t >>> 0, e || B(t, 8, this.length), s.read(this, t, !1, 52, 8);
|
|
1468
1477
|
};
|
|
1469
|
-
function
|
|
1478
|
+
function O(n, t, e, o, c, x) {
|
|
1470
1479
|
if (!a.isBuffer(n))
|
|
1471
1480
|
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1472
1481
|
if (t > c || t < x)
|
|
@@ -1477,81 +1486,81 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1477
1486
|
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, o, c) {
|
|
1478
1487
|
if (t = +t, e = e >>> 0, o = o >>> 0, !c) {
|
|
1479
1488
|
var x = Math.pow(2, 8 * o) - 1;
|
|
1480
|
-
|
|
1489
|
+
O(this, t, e, o, x, 0);
|
|
1481
1490
|
}
|
|
1482
|
-
var d = 1,
|
|
1483
|
-
for (this[e] = t & 255;
|
|
1484
|
-
this[e +
|
|
1491
|
+
var d = 1, $ = 0;
|
|
1492
|
+
for (this[e] = t & 255; ++$ < o && (d *= 256); )
|
|
1493
|
+
this[e + $] = t / d & 255;
|
|
1485
1494
|
return e + o;
|
|
1486
1495
|
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, o, c) {
|
|
1487
1496
|
if (t = +t, e = e >>> 0, o = o >>> 0, !c) {
|
|
1488
1497
|
var x = Math.pow(2, 8 * o) - 1;
|
|
1489
|
-
|
|
1498
|
+
O(this, t, e, o, x, 0);
|
|
1490
1499
|
}
|
|
1491
|
-
var d = o - 1,
|
|
1492
|
-
for (this[e + d] = t & 255; --d >= 0 && (
|
|
1493
|
-
this[e + d] = t /
|
|
1500
|
+
var d = o - 1, $ = 1;
|
|
1501
|
+
for (this[e + d] = t & 255; --d >= 0 && ($ *= 256); )
|
|
1502
|
+
this[e + d] = t / $ & 255;
|
|
1494
1503
|
return e + o;
|
|
1495
1504
|
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, o) {
|
|
1496
|
-
return t = +t, e = e >>> 0, o ||
|
|
1505
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
|
|
1497
1506
|
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(t, e, o) {
|
|
1498
|
-
return t = +t, e = e >>> 0, o ||
|
|
1507
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
|
|
1499
1508
|
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(t, e, o) {
|
|
1500
|
-
return t = +t, e = e >>> 0, o ||
|
|
1509
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
|
|
1501
1510
|
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(t, e, o) {
|
|
1502
|
-
return t = +t, e = e >>> 0, o ||
|
|
1511
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
|
|
1503
1512
|
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, o) {
|
|
1504
|
-
return t = +t, e = e >>> 0, o ||
|
|
1513
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
|
|
1505
1514
|
}, a.prototype.writeIntLE = function(t, e, o, c) {
|
|
1506
1515
|
if (t = +t, e = e >>> 0, !c) {
|
|
1507
1516
|
var x = Math.pow(2, 8 * o - 1);
|
|
1508
|
-
|
|
1517
|
+
O(this, t, e, o, x - 1, -x);
|
|
1509
1518
|
}
|
|
1510
|
-
var d = 0,
|
|
1511
|
-
for (this[e] = t & 255; ++d < o && (
|
|
1512
|
-
t < 0 &&
|
|
1519
|
+
var d = 0, $ = 1, M = 0;
|
|
1520
|
+
for (this[e] = t & 255; ++d < o && ($ *= 256); )
|
|
1521
|
+
t < 0 && M === 0 && this[e + d - 1] !== 0 && (M = 1), this[e + d] = (t / $ >> 0) - M & 255;
|
|
1513
1522
|
return e + o;
|
|
1514
1523
|
}, a.prototype.writeIntBE = function(t, e, o, c) {
|
|
1515
1524
|
if (t = +t, e = e >>> 0, !c) {
|
|
1516
1525
|
var x = Math.pow(2, 8 * o - 1);
|
|
1517
|
-
|
|
1526
|
+
O(this, t, e, o, x - 1, -x);
|
|
1518
1527
|
}
|
|
1519
|
-
var d = o - 1,
|
|
1520
|
-
for (this[e + d] = t & 255; --d >= 0 && (
|
|
1521
|
-
t < 0 &&
|
|
1528
|
+
var d = o - 1, $ = 1, M = 0;
|
|
1529
|
+
for (this[e + d] = t & 255; --d >= 0 && ($ *= 256); )
|
|
1530
|
+
t < 0 && M === 0 && this[e + d + 1] !== 0 && (M = 1), this[e + d] = (t / $ >> 0) - M & 255;
|
|
1522
1531
|
return e + o;
|
|
1523
1532
|
}, a.prototype.writeInt8 = function(t, e, o) {
|
|
1524
|
-
return t = +t, e = e >>> 0, o ||
|
|
1533
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
|
|
1525
1534
|
}, a.prototype.writeInt16LE = function(t, e, o) {
|
|
1526
|
-
return t = +t, e = e >>> 0, o ||
|
|
1535
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
|
|
1527
1536
|
}, a.prototype.writeInt16BE = function(t, e, o) {
|
|
1528
|
-
return t = +t, e = e >>> 0, o ||
|
|
1537
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
|
|
1529
1538
|
}, a.prototype.writeInt32LE = function(t, e, o) {
|
|
1530
|
-
return t = +t, e = e >>> 0, o ||
|
|
1539
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
|
|
1531
1540
|
}, a.prototype.writeInt32BE = function(t, e, o) {
|
|
1532
|
-
return t = +t, e = e >>> 0, o ||
|
|
1541
|
+
return t = +t, e = e >>> 0, o || O(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
|
|
1533
1542
|
};
|
|
1534
|
-
function
|
|
1543
|
+
function z(n, t, e, o, c, x) {
|
|
1535
1544
|
if (e + o > n.length)
|
|
1536
1545
|
throw new RangeError("Index out of range");
|
|
1537
1546
|
if (e < 0)
|
|
1538
1547
|
throw new RangeError("Index out of range");
|
|
1539
1548
|
}
|
|
1540
1549
|
function J(n, t, e, o, c) {
|
|
1541
|
-
return t = +t, e = e >>> 0, c ||
|
|
1550
|
+
return t = +t, e = e >>> 0, c || z(n, t, e, 4), s.write(n, t, e, o, 23, 4), e + 4;
|
|
1542
1551
|
}
|
|
1543
1552
|
a.prototype.writeFloatLE = function(t, e, o) {
|
|
1544
1553
|
return J(this, t, e, !0, o);
|
|
1545
1554
|
}, a.prototype.writeFloatBE = function(t, e, o) {
|
|
1546
1555
|
return J(this, t, e, !1, o);
|
|
1547
1556
|
};
|
|
1548
|
-
function
|
|
1549
|
-
return t = +t, e = e >>> 0, c ||
|
|
1557
|
+
function N(n, t, e, o, c) {
|
|
1558
|
+
return t = +t, e = e >>> 0, c || z(n, t, e, 8), s.write(n, t, e, o, 52, 8), e + 8;
|
|
1550
1559
|
}
|
|
1551
1560
|
a.prototype.writeDoubleLE = function(t, e, o) {
|
|
1552
|
-
return
|
|
1561
|
+
return N(this, t, e, !0, o);
|
|
1553
1562
|
}, a.prototype.writeDoubleBE = function(t, e, o) {
|
|
1554
|
-
return
|
|
1563
|
+
return N(this, t, e, !1, o);
|
|
1555
1564
|
}, a.prototype.copy = function(t, e, o, c) {
|
|
1556
1565
|
if (!a.isBuffer(t))
|
|
1557
1566
|
throw new TypeError("argument should be a Buffer");
|
|
@@ -1592,17 +1601,17 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1592
1601
|
for (d = e; d < o; ++d)
|
|
1593
1602
|
this[d] = t;
|
|
1594
1603
|
else {
|
|
1595
|
-
var
|
|
1596
|
-
if (
|
|
1604
|
+
var $ = a.isBuffer(t) ? t : a.from(t, c), M = $.length;
|
|
1605
|
+
if (M === 0)
|
|
1597
1606
|
throw new TypeError('The value "' + t + '" is invalid for argument "value"');
|
|
1598
1607
|
for (d = 0; d < o - e; ++d)
|
|
1599
|
-
this[d + e] =
|
|
1608
|
+
this[d + e] = $[d % M];
|
|
1600
1609
|
}
|
|
1601
1610
|
return this;
|
|
1602
1611
|
};
|
|
1603
|
-
var
|
|
1612
|
+
var K = /[^+/0-9A-Za-z-_]/g;
|
|
1604
1613
|
function X(n) {
|
|
1605
|
-
if (n = n.split("=")[0], n = n.trim().replace(
|
|
1614
|
+
if (n = n.split("=")[0], n = n.trim().replace(K, ""), n.length < 2)
|
|
1606
1615
|
return "";
|
|
1607
1616
|
for (; n.length % 4 !== 0; )
|
|
1608
1617
|
n = n + "=";
|
|
@@ -1674,7 +1683,7 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1674
1683
|
return x;
|
|
1675
1684
|
}
|
|
1676
1685
|
function st(n) {
|
|
1677
|
-
return
|
|
1686
|
+
return i.toByteArray(X(n));
|
|
1678
1687
|
}
|
|
1679
1688
|
function Et(n, t, e, o) {
|
|
1680
1689
|
for (var c = 0; c < o && !(c + e >= t.length || c >= n.length); ++c)
|
|
@@ -1695,13 +1704,13 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1695
1704
|
}();
|
|
1696
1705
|
})(we);
|
|
1697
1706
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1698
|
-
(function(
|
|
1707
|
+
(function(r, i) {
|
|
1699
1708
|
var s = we, p = s.Buffer;
|
|
1700
1709
|
function f(l, a) {
|
|
1701
1710
|
for (var h in l)
|
|
1702
1711
|
a[h] = l[h];
|
|
1703
1712
|
}
|
|
1704
|
-
p.from && p.alloc && p.allocUnsafe && p.allocUnsafeSlow ?
|
|
1713
|
+
p.from && p.alloc && p.allocUnsafe && p.allocUnsafeSlow ? r.exports = s : (f(s, i), i.Buffer = u);
|
|
1705
1714
|
function u(l, a, h) {
|
|
1706
1715
|
return p(l, a, h);
|
|
1707
1716
|
}
|
|
@@ -1712,8 +1721,8 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1712
1721
|
}, u.alloc = function(l, a, h) {
|
|
1713
1722
|
if (typeof l != "number")
|
|
1714
1723
|
throw new TypeError("Argument must be a number");
|
|
1715
|
-
var
|
|
1716
|
-
return a !== void 0 ? typeof h == "string" ?
|
|
1724
|
+
var w = p(l);
|
|
1725
|
+
return a !== void 0 ? typeof h == "string" ? w.fill(a, h) : w.fill(a) : w.fill(0), w;
|
|
1717
1726
|
}, u.allocUnsafe = function(l) {
|
|
1718
1727
|
if (typeof l != "number")
|
|
1719
1728
|
throw new TypeError("Argument must be a number");
|
|
@@ -1725,21 +1734,21 @@ Jt.write = function(i, r, s, p, f, u) {
|
|
|
1725
1734
|
};
|
|
1726
1735
|
})(Ct, Ct.exports);
|
|
1727
1736
|
var Wt = Ct.exports, Ee = Wt.Buffer;
|
|
1728
|
-
function jt(
|
|
1729
|
-
this._block = Ee.alloc(
|
|
1730
|
-
}
|
|
1731
|
-
jt.prototype.update = function(
|
|
1732
|
-
typeof
|
|
1733
|
-
for (var s = this._block, p = this._blockSize, f =
|
|
1734
|
-
for (var a = u % p, h = Math.min(f - l, p - a),
|
|
1735
|
-
s[a +
|
|
1737
|
+
function jt(r, i) {
|
|
1738
|
+
this._block = Ee.alloc(r), this._finalSize = i, this._blockSize = r, this._len = 0;
|
|
1739
|
+
}
|
|
1740
|
+
jt.prototype.update = function(r, i) {
|
|
1741
|
+
typeof r == "string" && (i = i || "utf8", r = Ee.from(r, i));
|
|
1742
|
+
for (var s = this._block, p = this._blockSize, f = r.length, u = this._len, l = 0; l < f; ) {
|
|
1743
|
+
for (var a = u % p, h = Math.min(f - l, p - a), w = 0; w < h; w++)
|
|
1744
|
+
s[a + w] = r[l + w];
|
|
1736
1745
|
u += h, l += h, u % p === 0 && this._update(s);
|
|
1737
1746
|
}
|
|
1738
1747
|
return this._len += f, this;
|
|
1739
1748
|
};
|
|
1740
|
-
jt.prototype.digest = function(
|
|
1741
|
-
var
|
|
1742
|
-
this._block[
|
|
1749
|
+
jt.prototype.digest = function(r) {
|
|
1750
|
+
var i = this._len % this._blockSize;
|
|
1751
|
+
this._block[i] = 128, this._block.fill(0, i + 1), i >= this._finalSize && (this._update(this._block), this._block.fill(0));
|
|
1743
1752
|
var s = this._len * 8;
|
|
1744
1753
|
if (s <= 4294967295)
|
|
1745
1754
|
this._block.writeUInt32BE(s, this._blockSize - 4);
|
|
@@ -1749,7 +1758,7 @@ jt.prototype.digest = function(i) {
|
|
|
1749
1758
|
}
|
|
1750
1759
|
this._update(this._block);
|
|
1751
1760
|
var u = this._hash();
|
|
1752
|
-
return
|
|
1761
|
+
return r ? u.toString(r) : u;
|
|
1753
1762
|
};
|
|
1754
1763
|
jt.prototype._update = function() {
|
|
1755
1764
|
throw new Error("_update must be implemented by subclass");
|
|
@@ -1767,32 +1776,32 @@ fr(wt, Ae);
|
|
|
1767
1776
|
wt.prototype.init = function() {
|
|
1768
1777
|
return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
|
|
1769
1778
|
};
|
|
1770
|
-
function dr(
|
|
1771
|
-
return
|
|
1779
|
+
function dr(r) {
|
|
1780
|
+
return r << 1 | r >>> 31;
|
|
1772
1781
|
}
|
|
1773
|
-
function gr(
|
|
1774
|
-
return
|
|
1782
|
+
function gr(r) {
|
|
1783
|
+
return r << 5 | r >>> 27;
|
|
1775
1784
|
}
|
|
1776
|
-
function yr(
|
|
1777
|
-
return
|
|
1785
|
+
function yr(r) {
|
|
1786
|
+
return r << 30 | r >>> 2;
|
|
1778
1787
|
}
|
|
1779
|
-
function wr(
|
|
1780
|
-
return
|
|
1788
|
+
function wr(r, i, s, p) {
|
|
1789
|
+
return r === 0 ? i & s | ~i & p : r === 2 ? i & s | i & p | s & p : i ^ s ^ p;
|
|
1781
1790
|
}
|
|
1782
|
-
wt.prototype._update = function(
|
|
1783
|
-
for (var
|
|
1784
|
-
|
|
1791
|
+
wt.prototype._update = function(r) {
|
|
1792
|
+
for (var i = this._w, s = this._a | 0, p = this._b | 0, f = this._c | 0, u = this._d | 0, l = this._e | 0, a = 0; a < 16; ++a)
|
|
1793
|
+
i[a] = r.readInt32BE(a * 4);
|
|
1785
1794
|
for (; a < 80; ++a)
|
|
1786
|
-
|
|
1795
|
+
i[a] = dr(i[a - 3] ^ i[a - 8] ^ i[a - 14] ^ i[a - 16]);
|
|
1787
1796
|
for (var h = 0; h < 80; ++h) {
|
|
1788
|
-
var
|
|
1789
|
-
l = u, u = f, f = yr(p), p = s, s =
|
|
1797
|
+
var w = ~~(h / 20), g = gr(s) + wr(w, p, f, u) + l + i[h] + mr[w] | 0;
|
|
1798
|
+
l = u, u = f, f = yr(p), p = s, s = g;
|
|
1790
1799
|
}
|
|
1791
1800
|
this._a = s + this._a | 0, this._b = p + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = l + this._e | 0;
|
|
1792
1801
|
};
|
|
1793
1802
|
wt.prototype._hash = function() {
|
|
1794
|
-
var
|
|
1795
|
-
return
|
|
1803
|
+
var r = hr.allocUnsafe(20);
|
|
1804
|
+
return r.writeInt32BE(this._a | 0, 0), r.writeInt32BE(this._b | 0, 4), r.writeInt32BE(this._c | 0, 8), r.writeInt32BE(this._d | 0, 12), r.writeInt32BE(this._e | 0, 16), r;
|
|
1796
1805
|
};
|
|
1797
1806
|
var br = wt;
|
|
1798
1807
|
const Er = /* @__PURE__ */ qt(br);
|
|
@@ -1869,74 +1878,74 @@ vr(bt, _e);
|
|
|
1869
1878
|
bt.prototype.init = function() {
|
|
1870
1879
|
return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this;
|
|
1871
1880
|
};
|
|
1872
|
-
function Fr(
|
|
1873
|
-
return s ^
|
|
1881
|
+
function Fr(r, i, s) {
|
|
1882
|
+
return s ^ r & (i ^ s);
|
|
1874
1883
|
}
|
|
1875
|
-
function Br(
|
|
1876
|
-
return
|
|
1884
|
+
function Br(r, i, s) {
|
|
1885
|
+
return r & i | s & (r | i);
|
|
1877
1886
|
}
|
|
1878
|
-
function jr(
|
|
1879
|
-
return (
|
|
1887
|
+
function jr(r) {
|
|
1888
|
+
return (r >>> 2 | r << 30) ^ (r >>> 13 | r << 19) ^ (r >>> 22 | r << 10);
|
|
1880
1889
|
}
|
|
1881
|
-
function Or(
|
|
1882
|
-
return (
|
|
1890
|
+
function Or(r) {
|
|
1891
|
+
return (r >>> 6 | r << 26) ^ (r >>> 11 | r << 21) ^ (r >>> 25 | r << 7);
|
|
1883
1892
|
}
|
|
1884
|
-
function Ir(
|
|
1885
|
-
return (
|
|
1893
|
+
function Ir(r) {
|
|
1894
|
+
return (r >>> 7 | r << 25) ^ (r >>> 18 | r << 14) ^ r >>> 3;
|
|
1886
1895
|
}
|
|
1887
|
-
function Tr(
|
|
1888
|
-
return (
|
|
1896
|
+
function Tr(r) {
|
|
1897
|
+
return (r >>> 17 | r << 15) ^ (r >>> 19 | r << 13) ^ r >>> 10;
|
|
1889
1898
|
}
|
|
1890
|
-
bt.prototype._update = function(
|
|
1891
|
-
for (var
|
|
1892
|
-
|
|
1893
|
-
for (;
|
|
1894
|
-
|
|
1895
|
-
for (var
|
|
1896
|
-
var
|
|
1897
|
-
|
|
1899
|
+
bt.prototype._update = function(r) {
|
|
1900
|
+
for (var i = this._w, s = this._a | 0, p = this._b | 0, f = this._c | 0, u = this._d | 0, l = this._e | 0, a = this._f | 0, h = this._g | 0, w = this._h | 0, g = 0; g < 16; ++g)
|
|
1901
|
+
i[g] = r.readInt32BE(g * 4);
|
|
1902
|
+
for (; g < 64; ++g)
|
|
1903
|
+
i[g] = Tr(i[g - 2]) + i[g - 7] + Ir(i[g - 15]) + i[g - 16] | 0;
|
|
1904
|
+
for (var A = 0; A < 64; ++A) {
|
|
1905
|
+
var _ = w + Or(l) + Fr(l, a, h) + _r[A] + i[A] | 0, F = jr(s) + Br(s, p, f) | 0;
|
|
1906
|
+
w = h, h = a, a = l, l = u + _ | 0, u = f, f = p, p = s, s = _ + F | 0;
|
|
1898
1907
|
}
|
|
1899
|
-
this._a = s + this._a | 0, this._b = p + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = l + this._e | 0, this._f = a + this._f | 0, this._g = h + this._g | 0, this._h =
|
|
1908
|
+
this._a = s + this._a | 0, this._b = p + this._b | 0, this._c = f + this._c | 0, this._d = u + this._d | 0, this._e = l + this._e | 0, this._f = a + this._f | 0, this._g = h + this._g | 0, this._h = w + this._h | 0;
|
|
1900
1909
|
};
|
|
1901
1910
|
bt.prototype._hash = function() {
|
|
1902
|
-
var
|
|
1903
|
-
return
|
|
1911
|
+
var r = Ar.allocUnsafe(32);
|
|
1912
|
+
return r.writeInt32BE(this._a, 0), r.writeInt32BE(this._b, 4), r.writeInt32BE(this._c, 8), r.writeInt32BE(this._d, 12), r.writeInt32BE(this._e, 16), r.writeInt32BE(this._f, 20), r.writeInt32BE(this._g, 24), r.writeInt32BE(this._h, 28), r;
|
|
1904
1913
|
};
|
|
1905
1914
|
var kr = bt;
|
|
1906
1915
|
const Ur = /* @__PURE__ */ qt(kr), Vt = new Error("File system not available.");
|
|
1907
|
-
function $r(
|
|
1916
|
+
function $r(r, i, s) {
|
|
1908
1917
|
throw Vt;
|
|
1909
1918
|
}
|
|
1910
|
-
function Se(
|
|
1919
|
+
function Se(r) {
|
|
1911
1920
|
throw Vt;
|
|
1912
1921
|
}
|
|
1913
|
-
function Dr(
|
|
1922
|
+
function Dr(r) {
|
|
1914
1923
|
throw Vt;
|
|
1915
1924
|
}
|
|
1916
|
-
const Cr = async (
|
|
1925
|
+
const Cr = async (r) => Se(), Nr = {
|
|
1917
1926
|
sha1: Er,
|
|
1918
1927
|
sha256: Ur
|
|
1919
|
-
}, Ot = (
|
|
1920
|
-
if (!["sha1", "sha256"].includes(
|
|
1928
|
+
}, Ot = (r, i = "sha1") => {
|
|
1929
|
+
if (!["sha1", "sha256"].includes(i))
|
|
1921
1930
|
throw new Error("Hashing algorithm not supported: Available: sha1, sha256");
|
|
1922
|
-
const s = Nr[
|
|
1923
|
-
return new s().update(
|
|
1931
|
+
const s = Nr[i];
|
|
1932
|
+
return new s().update(r).digest("base64");
|
|
1924
1933
|
};
|
|
1925
|
-
function Mr(
|
|
1926
|
-
return
|
|
1934
|
+
function Mr(r) {
|
|
1935
|
+
return r.type === Ye && r.skip !== void 0 && r.skip > 0 && r.hash !== void 0;
|
|
1927
1936
|
}
|
|
1928
|
-
function Xt(
|
|
1929
|
-
return [gt, yt].includes(
|
|
1937
|
+
function Xt(r) {
|
|
1938
|
+
return [gt, yt].includes(r.type);
|
|
1930
1939
|
}
|
|
1931
|
-
function Qt(
|
|
1932
|
-
return [xe, gt, yt, Ft, de].includes(
|
|
1940
|
+
function Qt(r) {
|
|
1941
|
+
return [xe, gt, yt, Ft, de].includes(r.type);
|
|
1933
1942
|
}
|
|
1934
|
-
function ht(
|
|
1935
|
-
if (!
|
|
1943
|
+
function ht(r, i, s, p, f = "global") {
|
|
1944
|
+
if (!r)
|
|
1936
1945
|
throw new Error("Empty action type");
|
|
1937
|
-
if (typeof
|
|
1938
|
-
throw new Error(`Invalid action type: ${JSON.stringify(
|
|
1939
|
-
const u = { type:
|
|
1946
|
+
if (typeof r != "string")
|
|
1947
|
+
throw new Error(`Invalid action type: ${JSON.stringify(r)}`);
|
|
1948
|
+
const u = { type: r, input: i, scope: f };
|
|
1940
1949
|
s && (u.attachments = s);
|
|
1941
1950
|
try {
|
|
1942
1951
|
p == null || p().parse(u.input);
|
|
@@ -1945,10 +1954,10 @@ function ht(i, r, s, p, f = "global") {
|
|
|
1945
1954
|
}
|
|
1946
1955
|
return u;
|
|
1947
1956
|
}
|
|
1948
|
-
function Rr(
|
|
1949
|
-
return (s, p, f, u) =>
|
|
1957
|
+
function Rr(r, i = ge) {
|
|
1958
|
+
return (s, p, f, u) => i(s, p, r, f, u);
|
|
1950
1959
|
}
|
|
1951
|
-
const Lr = (
|
|
1960
|
+
const Lr = (r, i) => ({
|
|
1952
1961
|
name: "",
|
|
1953
1962
|
documentType: "",
|
|
1954
1963
|
revision: {
|
|
@@ -1958,12 +1967,12 @@ const Lr = (i, r) => ({
|
|
|
1958
1967
|
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1959
1968
|
lastModified: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1960
1969
|
attachments: {},
|
|
1961
|
-
...
|
|
1962
|
-
state: (
|
|
1963
|
-
}), zr = (
|
|
1970
|
+
...r,
|
|
1971
|
+
state: (i == null ? void 0 : i(r == null ? void 0 : r.state)) ?? (r == null ? void 0 : r.state) ?? { global: {}, local: {} }
|
|
1972
|
+
}), zr = (r, i) => {
|
|
1964
1973
|
const s = Lr(
|
|
1965
|
-
|
|
1966
|
-
|
|
1974
|
+
r,
|
|
1975
|
+
i
|
|
1967
1976
|
);
|
|
1968
1977
|
return {
|
|
1969
1978
|
...s,
|
|
@@ -1971,21 +1980,21 @@ const Lr = (i, r) => ({
|
|
|
1971
1980
|
operations: { global: [], local: [] },
|
|
1972
1981
|
clipboard: []
|
|
1973
1982
|
};
|
|
1974
|
-
}, Ht = (
|
|
1975
|
-
const s = Math.random() *
|
|
1976
|
-
return Ot(`${(
|
|
1983
|
+
}, Ht = (r, i = "global") => Ot(St(r.state[i] || "")), ri = (r, i = 1e3) => {
|
|
1984
|
+
const s = Math.random() * i;
|
|
1985
|
+
return Ot(`${(r ?? /* @__PURE__ */ new Date()).toISOString()}${s}`);
|
|
1977
1986
|
};
|
|
1978
|
-
function _t(
|
|
1979
|
-
return Ne(Me(
|
|
1987
|
+
function _t(r) {
|
|
1988
|
+
return Ne(Me(r, !0));
|
|
1980
1989
|
}
|
|
1981
|
-
function Pr(
|
|
1982
|
-
const s = [...
|
|
1983
|
-
let p =
|
|
1990
|
+
function Pr(r, i) {
|
|
1991
|
+
const s = [...r];
|
|
1992
|
+
let p = i || 0, f = s.length > 0 ? s[s.length - 1].index : 0;
|
|
1984
1993
|
const u = [];
|
|
1985
1994
|
for (const l of s.reverse()) {
|
|
1986
1995
|
if (p > 0) {
|
|
1987
|
-
const
|
|
1988
|
-
p -=
|
|
1996
|
+
const w = f - l.index;
|
|
1997
|
+
p -= w;
|
|
1989
1998
|
}
|
|
1990
1999
|
if (p < 0)
|
|
1991
2000
|
throw new Error("Invalid operation index, missing operations");
|
|
@@ -1994,16 +2003,16 @@ function Pr(i, r) {
|
|
|
1994
2003
|
operation: l
|
|
1995
2004
|
}, h = l.skip > 0 ? l.skip + 1 : 0;
|
|
1996
2005
|
if (h > 0 && h > p) {
|
|
1997
|
-
const
|
|
1998
|
-
p = p +
|
|
2006
|
+
const w = h - p;
|
|
2007
|
+
p = p + w;
|
|
1999
2008
|
}
|
|
2000
2009
|
f = l.index, u.push(a);
|
|
2001
2010
|
}
|
|
2002
2011
|
return u.reverse();
|
|
2003
2012
|
}
|
|
2004
|
-
function qr(
|
|
2005
|
-
const p =
|
|
2006
|
-
let f = s, u = 0, l =
|
|
2013
|
+
function qr(r, i, s) {
|
|
2014
|
+
const p = r.slice().sort((a, h) => a.skip - h.skip).sort((a, h) => a.index - h.index);
|
|
2015
|
+
let f = s, u = 0, l = i;
|
|
2007
2016
|
for (const a of p.reverse()) {
|
|
2008
2017
|
const h = l - a.index;
|
|
2009
2018
|
if (f = f - h, f > -1)
|
|
@@ -2013,21 +2022,21 @@ function qr(i, r, s) {
|
|
|
2013
2022
|
}
|
|
2014
2023
|
return u;
|
|
2015
2024
|
}
|
|
2016
|
-
function ii(
|
|
2017
|
-
return Object.values(
|
|
2018
|
-
(
|
|
2025
|
+
function ii(r) {
|
|
2026
|
+
return Object.values(r).flatMap((i) => i).sort(
|
|
2027
|
+
(i, s) => new Date(i.timestamp).getTime() - new Date(s.timestamp).getTime()
|
|
2019
2028
|
);
|
|
2020
2029
|
}
|
|
2021
|
-
function Jr(
|
|
2022
|
-
return Object.values(
|
|
2023
|
-
(
|
|
2030
|
+
function Jr(r) {
|
|
2031
|
+
return Object.values(r).flatMap((i) => i).sort(
|
|
2032
|
+
(i, s) => new Date(i.operation.timestamp).getTime() - new Date(s.operation.timestamp).getTime()
|
|
2024
2033
|
);
|
|
2025
2034
|
}
|
|
2026
|
-
function Nt(
|
|
2035
|
+
function Nt(r, i, s, p, f, u = ge, l = {}, a) {
|
|
2027
2036
|
const h = Rr(s, u);
|
|
2028
2037
|
return Fe(
|
|
2029
|
-
i,
|
|
2030
2038
|
r,
|
|
2039
|
+
i,
|
|
2031
2040
|
h,
|
|
2032
2041
|
p,
|
|
2033
2042
|
f,
|
|
@@ -2035,106 +2044,96 @@ function Nt(i, r, s, p, f, u = ge, l = {}, a) {
|
|
|
2035
2044
|
a
|
|
2036
2045
|
);
|
|
2037
2046
|
}
|
|
2038
|
-
function Fe(
|
|
2039
|
-
const a = (l == null ? void 0 : l.checkHashes) ?? !0, h = zr(
|
|
2040
|
-
const
|
|
2047
|
+
function Fe(r, i, s, p, f, u = {}, l) {
|
|
2048
|
+
const a = (l == null ? void 0 : l.checkHashes) ?? !0, h = zr(r), w = Object.keys(i).reduce((U, L) => {
|
|
2049
|
+
const C = L;
|
|
2041
2050
|
return {
|
|
2042
|
-
...
|
|
2043
|
-
[
|
|
2051
|
+
...U,
|
|
2052
|
+
[C]: Pr(
|
|
2053
|
+
i[C],
|
|
2054
|
+
u[C]
|
|
2055
|
+
)
|
|
2044
2056
|
};
|
|
2045
|
-
}, {}),
|
|
2046
|
-
(
|
|
2047
|
-
|
|
2048
|
-
return {
|
|
2049
|
-
...C,
|
|
2050
|
-
[g]: Pr(
|
|
2051
|
-
y[g],
|
|
2052
|
-
u[g]
|
|
2053
|
-
)
|
|
2054
|
-
};
|
|
2055
|
-
},
|
|
2056
|
-
{}
|
|
2057
|
-
), _ = Jr(w), v = _.reduce(
|
|
2058
|
-
(C, { ignore: R, operation: g }, b, O) => R ? s(C, Zt(g.scope), p, {
|
|
2059
|
-
skip: g.skip,
|
|
2057
|
+
}, {}), g = Jr(w), A = g.reduce(
|
|
2058
|
+
(U, { ignore: L, operation: C }) => L ? s(U, Zt(C.scope), p, {
|
|
2059
|
+
skip: C.skip,
|
|
2060
2060
|
ignoreSkipOperations: !0
|
|
2061
2061
|
// TODO: reuse hash?
|
|
2062
|
-
}) : s(
|
|
2063
|
-
skip:
|
|
2062
|
+
}) : s(U, C, p, {
|
|
2063
|
+
skip: C.skip,
|
|
2064
2064
|
ignoreSkipOperations: !0,
|
|
2065
2065
|
reuseHash: !a
|
|
2066
2066
|
}),
|
|
2067
2067
|
h
|
|
2068
2068
|
);
|
|
2069
|
-
if (!a)
|
|
2070
|
-
for (const
|
|
2071
|
-
for (let
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2069
|
+
if (!a)
|
|
2070
|
+
for (const U of Object.keys(A.state))
|
|
2071
|
+
for (let L = g.length - 1; L >= 0; L--) {
|
|
2072
|
+
const { ignore: C, operation: y } = g[L];
|
|
2073
|
+
if (!(C || y.scope !== U)) {
|
|
2074
|
+
if (y.hash !== Ht(A, U))
|
|
2075
|
+
throw new Error(`Hash mismatch for scope ${U}`);
|
|
2075
2076
|
break;
|
|
2076
2077
|
}
|
|
2077
|
-
|
|
2078
|
-
const
|
|
2079
|
-
|
|
2078
|
+
}
|
|
2079
|
+
const _ = Object.keys(
|
|
2080
|
+
A.operations
|
|
2080
2081
|
).reduce(
|
|
2081
|
-
(
|
|
2082
|
-
const
|
|
2082
|
+
(U, L) => {
|
|
2083
|
+
const C = L;
|
|
2083
2084
|
return {
|
|
2084
|
-
...
|
|
2085
|
-
[
|
|
2086
|
-
...
|
|
2087
|
-
var
|
|
2085
|
+
...U,
|
|
2086
|
+
[C]: [
|
|
2087
|
+
...A.operations[C].map((y, b) => {
|
|
2088
|
+
var I;
|
|
2088
2089
|
return {
|
|
2089
|
-
...
|
|
2090
|
-
timestamp: ((
|
|
2090
|
+
...y,
|
|
2091
|
+
timestamp: ((I = i[C][b]) == null ? void 0 : I.timestamp) ?? y.timestamp
|
|
2091
2092
|
};
|
|
2092
|
-
})
|
|
2093
|
-
...b
|
|
2093
|
+
})
|
|
2094
2094
|
]
|
|
2095
2095
|
};
|
|
2096
2096
|
},
|
|
2097
2097
|
{ global: [], local: [] }
|
|
2098
|
-
),
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
return { ...v, operations: B, lastModified: W };
|
|
2098
|
+
), F = Object.values(_).reduce((U, L) => {
|
|
2099
|
+
const C = L[L.length - 1];
|
|
2100
|
+
return (C == null ? void 0 : C.timestamp) > U && (U = C.timestamp), U;
|
|
2101
|
+
}, r.lastModified);
|
|
2102
|
+
return { ...A, operations: _, lastModified: F };
|
|
2104
2103
|
}
|
|
2105
|
-
function ni(
|
|
2106
|
-
return St(
|
|
2104
|
+
function ni(r, i) {
|
|
2105
|
+
return St(r) === St(i);
|
|
2107
2106
|
}
|
|
2108
|
-
const Be = (
|
|
2107
|
+
const Be = (r) => ht(
|
|
2109
2108
|
"SET_NAME",
|
|
2110
|
-
|
|
2109
|
+
r,
|
|
2111
2110
|
void 0,
|
|
2112
2111
|
zt,
|
|
2113
2112
|
void 0
|
|
2114
|
-
), je = (
|
|
2113
|
+
), je = (r = 1, i = "global") => ht(
|
|
2115
2114
|
"UNDO",
|
|
2116
|
-
|
|
2115
|
+
r,
|
|
2117
2116
|
void 0,
|
|
2118
2117
|
Pt,
|
|
2119
|
-
|
|
2120
|
-
), Oe = (
|
|
2118
|
+
i
|
|
2119
|
+
), Oe = (r = 1, i = "global") => ht(
|
|
2121
2120
|
"REDO",
|
|
2122
|
-
|
|
2121
|
+
r,
|
|
2123
2122
|
void 0,
|
|
2124
2123
|
Lt,
|
|
2125
|
-
|
|
2126
|
-
), Ie = (
|
|
2124
|
+
i
|
|
2125
|
+
), Ie = (r, i, s = "global") => ht(
|
|
2127
2126
|
"PRUNE",
|
|
2128
|
-
{ start:
|
|
2127
|
+
{ start: r, end: i },
|
|
2129
2128
|
void 0,
|
|
2130
2129
|
Rt,
|
|
2131
2130
|
s
|
|
2132
|
-
), Kt = (
|
|
2131
|
+
), Kt = (r, i) => ht(
|
|
2133
2132
|
"LOAD_STATE",
|
|
2134
|
-
{ state:
|
|
2133
|
+
{ state: r, operations: i },
|
|
2135
2134
|
void 0,
|
|
2136
2135
|
Mt
|
|
2137
|
-
), Zt = (
|
|
2136
|
+
), Zt = (r = "global") => ht("NOOP", {}, void 0, void 0, r), oi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2138
2137
|
__proto__: null,
|
|
2139
2138
|
loadState: Kt,
|
|
2140
2139
|
noop: Zt,
|
|
@@ -2144,21 +2143,21 @@ const Be = (i) => ht(
|
|
|
2144
2143
|
undo: je
|
|
2145
2144
|
}, Symbol.toStringTag, { value: "Module" })), Te = { "application/andrew-inset": ["ez"], "application/appinstaller": ["appinstaller"], "application/applixware": ["aw"], "application/appx": ["appx"], "application/appxbundle": ["appxbundle"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/automationml-aml+xml": ["aml"], "application/automationml-amlx+zip": ["amlx"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cpl+xml": ["cpl"], "application/cu-seeme": ["cu"], "application/cwl": ["cwl"], "application/dash+xml": ["mpd"], "application/dash-patch+xml": ["mpp"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdf": ["fdf"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["*js"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/media-policy-dataset+xml": ["mpf"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"], "application/msix": ["msix"], "application/msixbundle": ["msixbundle"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-keys": ["asc"], "application/pgp-signature": ["sig", "*asc"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/sql": ["sql"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/watcherinfo+xml": ["wif"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xfdf": ["xfdf"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/aac": ["adts", "aac"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avci": ["avci"], "image/avcs": ["avcs"], "image/avif": ["avif"], "image/bmp": ["bmp", "dib"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/dpx": ["dpx"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm", "jpgm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/jt": ["jt"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/prc": ["prc"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/u3d": ["u3d"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/javascript": ["js", "mjs"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["md", "markdown"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/wgsl": ["wgsl"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "*jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] };
|
|
2146
2145
|
Object.freeze(Te);
|
|
2147
|
-
var et = function(
|
|
2146
|
+
var et = function(r, i, s, p) {
|
|
2148
2147
|
if (s === "a" && !p)
|
|
2149
2148
|
throw new TypeError("Private accessor was defined without a getter");
|
|
2150
|
-
if (typeof
|
|
2149
|
+
if (typeof i == "function" ? r !== i || !p : !i.has(r))
|
|
2151
2150
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2152
|
-
return s === "m" ? p : s === "a" ? p.call(
|
|
2151
|
+
return s === "m" ? p : s === "a" ? p.call(r) : p ? p.value : i.get(r);
|
|
2153
2152
|
}, ft, mt, pt;
|
|
2154
2153
|
class Wr {
|
|
2155
|
-
constructor(...
|
|
2154
|
+
constructor(...i) {
|
|
2156
2155
|
ft.set(this, /* @__PURE__ */ new Map()), mt.set(this, /* @__PURE__ */ new Map()), pt.set(this, /* @__PURE__ */ new Map());
|
|
2157
|
-
for (const s of
|
|
2156
|
+
for (const s of i)
|
|
2158
2157
|
this.define(s);
|
|
2159
2158
|
}
|
|
2160
|
-
define(
|
|
2161
|
-
for (let [p, f] of Object.entries(
|
|
2159
|
+
define(i, s = !1) {
|
|
2160
|
+
for (let [p, f] of Object.entries(i)) {
|
|
2162
2161
|
p = p.toLowerCase(), f = f.map((a) => a.toLowerCase()), et(this, pt, "f").has(p) || et(this, pt, "f").set(p, /* @__PURE__ */ new Set());
|
|
2163
2162
|
const u = et(this, pt, "f").get(p);
|
|
2164
2163
|
let l = !0;
|
|
@@ -2166,33 +2165,33 @@ class Wr {
|
|
|
2166
2165
|
const h = a.startsWith("*");
|
|
2167
2166
|
if (a = h ? a.slice(1) : a, u == null || u.add(a), l && et(this, mt, "f").set(p, a), l = !1, h)
|
|
2168
2167
|
continue;
|
|
2169
|
-
const
|
|
2170
|
-
if (
|
|
2171
|
-
throw new Error(`"${p} -> ${a}" conflicts with "${
|
|
2168
|
+
const w = et(this, ft, "f").get(a);
|
|
2169
|
+
if (w && w != p && !s)
|
|
2170
|
+
throw new Error(`"${p} -> ${a}" conflicts with "${w} -> ${a}". Pass \`force=true\` to override this definition.`);
|
|
2172
2171
|
et(this, ft, "f").set(a, p);
|
|
2173
2172
|
}
|
|
2174
2173
|
}
|
|
2175
2174
|
return this;
|
|
2176
2175
|
}
|
|
2177
|
-
getType(
|
|
2178
|
-
if (typeof
|
|
2176
|
+
getType(i) {
|
|
2177
|
+
if (typeof i != "string")
|
|
2179
2178
|
return null;
|
|
2180
|
-
const s =
|
|
2179
|
+
const s = i.replace(/^.*[/\\]/, "").toLowerCase(), p = s.replace(/^.*\./, "").toLowerCase(), f = s.length < i.length;
|
|
2181
2180
|
return !(p.length < s.length - 1) && f ? null : et(this, ft, "f").get(p) ?? null;
|
|
2182
2181
|
}
|
|
2183
|
-
getExtension(
|
|
2182
|
+
getExtension(i) {
|
|
2184
2183
|
var s;
|
|
2185
|
-
return typeof
|
|
2184
|
+
return typeof i != "string" ? null : (i = (s = i == null ? void 0 : i.split) == null ? void 0 : s.call(i, ";")[0], (i && et(this, mt, "f").get(i.trim().toLowerCase())) ?? null);
|
|
2186
2185
|
}
|
|
2187
|
-
getAllExtensions(
|
|
2188
|
-
return typeof
|
|
2186
|
+
getAllExtensions(i) {
|
|
2187
|
+
return typeof i != "string" ? null : et(this, pt, "f").get(i.toLowerCase()) ?? null;
|
|
2189
2188
|
}
|
|
2190
2189
|
_freeze() {
|
|
2191
2190
|
this.define = () => {
|
|
2192
2191
|
throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
|
|
2193
2192
|
}, Object.freeze(this);
|
|
2194
|
-
for (const
|
|
2195
|
-
Object.freeze(
|
|
2193
|
+
for (const i of et(this, pt, "f").values())
|
|
2194
|
+
Object.freeze(i);
|
|
2196
2195
|
return this;
|
|
2197
2196
|
}
|
|
2198
2197
|
_getTestState() {
|
|
@@ -2204,12 +2203,12 @@ class Wr {
|
|
|
2204
2203
|
}
|
|
2205
2204
|
ft = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap();
|
|
2206
2205
|
const Vr = new Wr(Te)._freeze();
|
|
2207
|
-
function Hr(
|
|
2208
|
-
const
|
|
2206
|
+
function Hr(r) {
|
|
2207
|
+
const i = [], s = Object.keys(r);
|
|
2209
2208
|
for (const p of s) {
|
|
2210
|
-
const f =
|
|
2209
|
+
const f = r[p].sort((u, l) => u.index - l.index);
|
|
2211
2210
|
for (let u = 0; u < f.length; u++)
|
|
2212
|
-
f[u].index !== u &&
|
|
2211
|
+
f[u].index !== u && i.push({
|
|
2213
2212
|
message: `Invalid operation index ${f[u].index} at position ${u}`,
|
|
2214
2213
|
details: {
|
|
2215
2214
|
position: u,
|
|
@@ -2218,85 +2217,85 @@ function Hr(i) {
|
|
|
2218
2217
|
}
|
|
2219
2218
|
});
|
|
2220
2219
|
}
|
|
2221
|
-
return
|
|
2220
|
+
return i;
|
|
2222
2221
|
}
|
|
2223
|
-
const ke = async (
|
|
2224
|
-
const
|
|
2222
|
+
const ke = async (r) => {
|
|
2223
|
+
const i = new ee(), { name: s, revision: p, documentType: f, created: u, lastModified: l } = r, a = {
|
|
2225
2224
|
name: s,
|
|
2226
2225
|
revision: p,
|
|
2227
2226
|
documentType: f,
|
|
2228
2227
|
created: u,
|
|
2229
2228
|
lastModified: l
|
|
2230
2229
|
};
|
|
2231
|
-
return
|
|
2230
|
+
return i.file("header.json", JSON.stringify(a, null, 2)), i.file(
|
|
2232
2231
|
"state.json",
|
|
2233
|
-
JSON.stringify(
|
|
2234
|
-
),
|
|
2235
|
-
const { data:
|
|
2236
|
-
|
|
2232
|
+
JSON.stringify(r.initialState || {}, null, 2)
|
|
2233
|
+
), i.file("operations.json", JSON.stringify(r.operations, null, 2)), Object.keys(r.attachments).forEach((w) => {
|
|
2234
|
+
const { data: g, ...A } = r.attachments[w];
|
|
2235
|
+
i.file(w, g, {
|
|
2237
2236
|
base64: !0,
|
|
2238
2237
|
createFolders: !0,
|
|
2239
|
-
comment: JSON.stringify(
|
|
2238
|
+
comment: JSON.stringify(A)
|
|
2240
2239
|
});
|
|
2241
|
-
}),
|
|
2242
|
-
}, Kr = async (
|
|
2243
|
-
await (await ke(
|
|
2240
|
+
}), i;
|
|
2241
|
+
}, Kr = async (r, i, s, p) => {
|
|
2242
|
+
await (await ke(r)).generateAsync({
|
|
2244
2243
|
type: "uint8array",
|
|
2245
2244
|
streamFiles: !0
|
|
2246
2245
|
});
|
|
2247
|
-
const u = p ??
|
|
2246
|
+
const u = p ?? r.name, l = `.${s}.zip`;
|
|
2248
2247
|
return $r(
|
|
2249
|
-
|
|
2248
|
+
i,
|
|
2250
2249
|
u.endsWith(l) ? u : `${u}${l}`
|
|
2251
2250
|
);
|
|
2252
|
-
}, ai = async (
|
|
2253
|
-
const p = await (await ke(
|
|
2251
|
+
}, ai = async (r, i) => {
|
|
2252
|
+
const p = await (await ke(r)).generateAsync({ type: "blob" }), f = await i.createWritable();
|
|
2254
2253
|
await f.write(p), await f.close();
|
|
2255
|
-
}, te = async (
|
|
2254
|
+
}, te = async (r, i, s) => {
|
|
2256
2255
|
const p = Se();
|
|
2257
|
-
return Zr(p,
|
|
2258
|
-
}, Zr = async (
|
|
2256
|
+
return Zr(p, i, s);
|
|
2257
|
+
}, Zr = async (r, i, s) => {
|
|
2259
2258
|
const p = new ee();
|
|
2260
|
-
return await p.loadAsync(
|
|
2259
|
+
return await p.loadAsync(r), Gr(p, i, s);
|
|
2261
2260
|
};
|
|
2262
|
-
async function Gr(
|
|
2263
|
-
const p =
|
|
2261
|
+
async function Gr(r, i, s) {
|
|
2262
|
+
const p = r.file("state.json");
|
|
2264
2263
|
if (!p)
|
|
2265
2264
|
throw new Error("Initial state not found");
|
|
2266
|
-
const f = await p.async("string"), u = JSON.parse(f), l =
|
|
2265
|
+
const f = await p.async("string"), u = JSON.parse(f), l = r.file("header.json");
|
|
2267
2266
|
let a;
|
|
2268
2267
|
l && (a = JSON.parse(await l.async("string")));
|
|
2269
|
-
const h =
|
|
2268
|
+
const h = r.file("operations.json");
|
|
2270
2269
|
if (!h)
|
|
2271
2270
|
throw new Error("Operations history not found");
|
|
2272
|
-
const
|
|
2271
|
+
const w = JSON.parse(
|
|
2273
2272
|
await h.async("string")
|
|
2274
|
-
),
|
|
2275
|
-
if (
|
|
2276
|
-
const
|
|
2277
|
-
throw new Error(
|
|
2273
|
+
), g = Hr(w);
|
|
2274
|
+
if (g.length) {
|
|
2275
|
+
const _ = g.map((F) => F.message);
|
|
2276
|
+
throw new Error(_.join(`
|
|
2278
2277
|
`));
|
|
2279
2278
|
}
|
|
2280
|
-
let
|
|
2279
|
+
let A = Fe(
|
|
2281
2280
|
u,
|
|
2282
|
-
|
|
2283
|
-
|
|
2281
|
+
w,
|
|
2282
|
+
i,
|
|
2284
2283
|
void 0,
|
|
2285
2284
|
a,
|
|
2286
2285
|
{},
|
|
2287
2286
|
s
|
|
2288
2287
|
);
|
|
2289
|
-
return a && (
|
|
2290
|
-
...
|
|
2288
|
+
return a && (A = {
|
|
2289
|
+
...A,
|
|
2291
2290
|
...a
|
|
2292
|
-
}),
|
|
2291
|
+
}), A;
|
|
2293
2292
|
}
|
|
2294
|
-
function Ue(
|
|
2295
|
-
const
|
|
2296
|
-
return { extension:
|
|
2293
|
+
function Ue(r) {
|
|
2294
|
+
const i = r.replace(/^.*\./, "") || void 0, s = r.replace(/^.*[/\\]/, "") || void 0;
|
|
2295
|
+
return { extension: i, fileName: s };
|
|
2297
2296
|
}
|
|
2298
|
-
async function si(
|
|
2299
|
-
const { buffer:
|
|
2297
|
+
async function si(r) {
|
|
2298
|
+
const { buffer: i, mimeType: s = "application/octet-stream" } = await Dr(), p = Ue(r), f = i.toString("base64");
|
|
2300
2299
|
return {
|
|
2301
2300
|
data: f,
|
|
2302
2301
|
hash: Ot(f),
|
|
@@ -2304,8 +2303,8 @@ async function si(i) {
|
|
|
2304
2303
|
...p
|
|
2305
2304
|
};
|
|
2306
2305
|
}
|
|
2307
|
-
async function pi(
|
|
2308
|
-
const
|
|
2306
|
+
async function pi(r) {
|
|
2307
|
+
const i = await Cr(), s = Vr.getType(r) || "application/octet-stream", p = Ue(r), f = i.toString("base64");
|
|
2309
2308
|
return { data: f, hash: Ot(f), mimeType: s, ...p };
|
|
2310
2309
|
}
|
|
2311
2310
|
class ci {
|
|
@@ -2314,21 +2313,21 @@ class ci {
|
|
|
2314
2313
|
* @param reducer - The reducer function that updates the state.
|
|
2315
2314
|
* @param document - The initial state of the document.
|
|
2316
2315
|
*/
|
|
2317
|
-
constructor(
|
|
2316
|
+
constructor(i, s, p) {
|
|
2318
2317
|
At(this, "_document");
|
|
2319
2318
|
At(this, "_reducer");
|
|
2320
2319
|
At(this, "_signalDispatch");
|
|
2321
|
-
this._reducer =
|
|
2320
|
+
this._reducer = i, this._document = s, this._signalDispatch = p;
|
|
2322
2321
|
}
|
|
2323
2322
|
/**
|
|
2324
2323
|
* Dispatches an action to update the state of the document.
|
|
2325
2324
|
* @param action - The action to dispatch.
|
|
2326
2325
|
* @returns The Document instance.
|
|
2327
2326
|
*/
|
|
2328
|
-
dispatch(
|
|
2327
|
+
dispatch(i, s) {
|
|
2329
2328
|
return this._document = this._reducer(
|
|
2330
2329
|
this._document,
|
|
2331
|
-
|
|
2330
|
+
i,
|
|
2332
2331
|
this._signalDispatch,
|
|
2333
2332
|
s
|
|
2334
2333
|
), this;
|
|
@@ -2339,15 +2338,15 @@ class ci {
|
|
|
2339
2338
|
* @param extension - The file extension to use when saving the state.
|
|
2340
2339
|
* @returns The file path where the state was saved.
|
|
2341
2340
|
*/
|
|
2342
|
-
saveToFile(
|
|
2343
|
-
return Kr(this._document,
|
|
2341
|
+
saveToFile(i, s, p) {
|
|
2342
|
+
return Kr(this._document, i, s, p);
|
|
2344
2343
|
}
|
|
2345
2344
|
/**
|
|
2346
2345
|
* Loads the state of the document from a file.
|
|
2347
2346
|
* @param path - The file path where the state is stored.
|
|
2348
2347
|
*/
|
|
2349
|
-
async loadFromFile(
|
|
2350
|
-
this._document = await te(
|
|
2348
|
+
async loadFromFile(i) {
|
|
2349
|
+
this._document = await te(i, this._reducer);
|
|
2351
2350
|
}
|
|
2352
2351
|
/**
|
|
2353
2352
|
* Loads the state of the document from a file and returns it.
|
|
@@ -2355,8 +2354,8 @@ class ci {
|
|
|
2355
2354
|
* @param reducer - The reducer function that updates the state.
|
|
2356
2355
|
* @returns The state of the document.
|
|
2357
2356
|
*/
|
|
2358
|
-
static async stateFromFile(
|
|
2359
|
-
return await te(
|
|
2357
|
+
static async stateFromFile(i, s) {
|
|
2358
|
+
return await te(i, s);
|
|
2360
2359
|
}
|
|
2361
2360
|
/**
|
|
2362
2361
|
* Gets the current state of the document.
|
|
@@ -2400,8 +2399,8 @@ class ci {
|
|
|
2400
2399
|
get revision() {
|
|
2401
2400
|
return this._document.revision.global;
|
|
2402
2401
|
}
|
|
2403
|
-
getRevision(
|
|
2404
|
-
return this._document.revision[
|
|
2402
|
+
getRevision(i) {
|
|
2403
|
+
return this._document.revision[i];
|
|
2405
2404
|
}
|
|
2406
2405
|
/**
|
|
2407
2406
|
* Gets the initial state of the document.
|
|
@@ -2419,53 +2418,53 @@ class ci {
|
|
|
2419
2418
|
* Gets the attachment associated with the given key.
|
|
2420
2419
|
* @param attachment - The key of the attachment to retrieve.
|
|
2421
2420
|
*/
|
|
2422
|
-
getAttachment(
|
|
2423
|
-
return this._document.attachments[
|
|
2421
|
+
getAttachment(i) {
|
|
2422
|
+
return this._document.attachments[i];
|
|
2424
2423
|
}
|
|
2425
2424
|
/**
|
|
2426
2425
|
* Sets the name of the document.
|
|
2427
2426
|
* @param name - The new name of the document.
|
|
2428
2427
|
*/
|
|
2429
|
-
setName(
|
|
2430
|
-
return this.dispatch(Be(
|
|
2428
|
+
setName(i) {
|
|
2429
|
+
return this.dispatch(Be(i)), this;
|
|
2431
2430
|
}
|
|
2432
2431
|
/**
|
|
2433
2432
|
* Reverts a number of actions from the document.
|
|
2434
2433
|
* @param count - The number of actions to revert.
|
|
2435
2434
|
*/
|
|
2436
|
-
undo(
|
|
2437
|
-
return this.dispatch(je(
|
|
2435
|
+
undo(i) {
|
|
2436
|
+
return this.dispatch(je(i)), this;
|
|
2438
2437
|
}
|
|
2439
2438
|
/**
|
|
2440
2439
|
* Reapplies a number of actions to the document.
|
|
2441
2440
|
* @param count - The number of actions to reapply.
|
|
2442
2441
|
*/
|
|
2443
|
-
redo(
|
|
2444
|
-
return this.dispatch(Oe(
|
|
2442
|
+
redo(i) {
|
|
2443
|
+
return this.dispatch(Oe(i)), this;
|
|
2445
2444
|
}
|
|
2446
2445
|
/**
|
|
2447
2446
|
* Removes a range of operations from the document.
|
|
2448
2447
|
* @param start - The starting index of the range to remove.
|
|
2449
2448
|
* @param end - The ending index of the range to remove.
|
|
2450
2449
|
*/
|
|
2451
|
-
prune(
|
|
2452
|
-
return this.dispatch(Ie(
|
|
2450
|
+
prune(i, s) {
|
|
2451
|
+
return this.dispatch(Ie(i, s)), this;
|
|
2453
2452
|
}
|
|
2454
2453
|
/**
|
|
2455
2454
|
* Loads a document state and a set of operations.
|
|
2456
2455
|
* @param state - The state to load.
|
|
2457
2456
|
* @param operations - The operations to apply to the document.
|
|
2458
2457
|
*/
|
|
2459
|
-
loadState(
|
|
2460
|
-
return this.dispatch(Kt(
|
|
2458
|
+
loadState(i, s) {
|
|
2459
|
+
return this.dispatch(Kt(i, s)), this;
|
|
2461
2460
|
}
|
|
2462
2461
|
}
|
|
2463
|
-
function li(
|
|
2464
|
-
|
|
2462
|
+
function li(r, i) {
|
|
2463
|
+
i.forEach((s) => {
|
|
2465
2464
|
Object.getOwnPropertyNames(s.prototype).forEach((p) => {
|
|
2466
2465
|
Object.defineProperty(
|
|
2467
2466
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2468
|
-
|
|
2467
|
+
r.prototype,
|
|
2469
2468
|
p,
|
|
2470
2469
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
2471
2470
|
Object.getOwnPropertyDescriptor(s.prototype, p) || /* @__PURE__ */ Object.create(null)
|