document-model 1.1.0-experimental.1 → 1.1.0-experimental.2
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/browser/cjs/internal/{index-DypcJuba.js → index-DLodkpOq.js} +1 -1
- package/dist/browser/cjs/internal/index-azT4DEce.js +1 -0
- package/dist/browser/cjs/internal/{object-BU2CI8g7.js → object-CMr-_AP8.js} +21 -21
- 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-BzNpRs2a.js +44 -0
- package/dist/browser/es/internal/{index-CyBZ1dJQ.js → index-CL_1ivGq.js} +1 -1
- package/dist/browser/es/internal/{object-CPDHmXxz.js → object-FFc9n_3I.js} +917 -840
- package/dist/browser/src/document/object.d.ts +35 -0
- package/dist/browser/src/document/types.d.ts +6 -0
- package/dist/browser/src/document/utils/base.d.ts +5 -4
- package/dist/browser/src/document/utils/document-helpers.d.ts +1 -1
- package/dist/browser/src/document/utils/index.d.ts +1 -1
- 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/node/cjs/internal/{index-Bt4KwBzM.js → index-CPeTtUsk.js} +1 -1
- package/dist/node/cjs/internal/index-CTavCc1t.js +1 -0
- package/dist/node/cjs/internal/object-DhI24-1e.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-8lUz8qED.js +44 -0
- package/dist/node/es/internal/{index-6nUwJlFL.js → index-A880In4b.js} +1 -1
- package/dist/node/es/internal/{object-DofGWMf1.js → object-C9n9Ijnt.js} +675 -598
- package/dist/node/src/document/object.d.ts +35 -0
- package/dist/node/src/document/types.d.ts +6 -0
- package/dist/node/src/document/utils/base.d.ts +5 -4
- package/dist/node/src/document/utils/document-helpers.d.ts +1 -1
- package/dist/node/src/document/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/browser/cjs/internal/index-DZx9eknf.js +0 -1
- package/dist/browser/es/internal/index-BP3Z2ZVF.js +0 -43
- package/dist/node/cjs/internal/index-CwTTSCCW.js +0 -1
- package/dist/node/cjs/internal/object-Bc_eSRcx.js +0 -20
- package/dist/node/es/internal/index-CLgAZiia.js +0 -43
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { produce as Ot, castDraft as Bt, castImmutable as
|
|
5
|
-
import { z as
|
|
1
|
+
var Xe = Object.defineProperty;
|
|
2
|
+
var Ve = (i, r, o) => r in i ? Xe(i, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[r] = o;
|
|
3
|
+
var At = (i, r, o) => (Ve(i, typeof r != "symbol" ? r + "" : r, o), o);
|
|
4
|
+
import { produce as Ot, castDraft as Bt, castImmutable as Ke, freeze as Ge } from "immer";
|
|
5
|
+
import { z as _ } from "zod";
|
|
6
6
|
import oe from "jszip";
|
|
7
|
-
const ae = (
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
__typename:
|
|
11
|
-
type:
|
|
7
|
+
const ae = (i) => i != null, Ze = _.any().refine((i) => ae(i)), se = _.enum(["LOAD_STATE"]), pe = _.enum(["PRUNE"]), ce = _.enum(["REDO"]), le = _.enum(["SET_NAME"]), ue = _.enum(["UNDO"]);
|
|
8
|
+
function Ye() {
|
|
9
|
+
return _.object({
|
|
10
|
+
__typename: _.literal("Action").optional(),
|
|
11
|
+
type: _.string()
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
function yt() {
|
|
15
|
-
return
|
|
15
|
+
return _.literal("global").or(_.literal("local"));
|
|
16
16
|
}
|
|
17
17
|
function fe() {
|
|
18
|
-
return
|
|
18
|
+
return _.union([
|
|
19
19
|
he(),
|
|
20
20
|
xe(),
|
|
21
21
|
de(),
|
|
@@ -23,124 +23,124 @@ function fe() {
|
|
|
23
23
|
ye()
|
|
24
24
|
]);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
28
|
-
__typename:
|
|
29
|
-
data:
|
|
30
|
-
extension:
|
|
31
|
-
fileName:
|
|
32
|
-
mimeType:
|
|
26
|
+
function Qe() {
|
|
27
|
+
return _.object({
|
|
28
|
+
__typename: _.literal("DocumentFile").optional(),
|
|
29
|
+
data: _.string(),
|
|
30
|
+
extension: _.string().nullable(),
|
|
31
|
+
fileName: _.string().nullable(),
|
|
32
|
+
mimeType: _.string()
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
function he() {
|
|
36
|
-
return
|
|
37
|
-
input:
|
|
36
|
+
return _.object({
|
|
37
|
+
input: _.lazy(() => zt()),
|
|
38
38
|
type: se,
|
|
39
39
|
scope: yt()
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
function zt() {
|
|
43
|
-
return
|
|
44
|
-
operations:
|
|
45
|
-
state:
|
|
43
|
+
return _.object({
|
|
44
|
+
operations: _.number(),
|
|
45
|
+
state: _.lazy(() => me())
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
function me() {
|
|
49
|
-
return
|
|
50
|
-
data:
|
|
51
|
-
name:
|
|
49
|
+
return _.object({
|
|
50
|
+
data: _.unknown().nullish(),
|
|
51
|
+
name: _.string()
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
56
|
-
__typename:
|
|
57
|
-
hash:
|
|
58
|
-
index:
|
|
59
|
-
timestamp:
|
|
60
|
-
type:
|
|
54
|
+
function ti() {
|
|
55
|
+
return _.object({
|
|
56
|
+
__typename: _.literal("Operation").optional(),
|
|
57
|
+
hash: _.string(),
|
|
58
|
+
index: _.number(),
|
|
59
|
+
timestamp: _.string().datetime(),
|
|
60
|
+
type: _.string()
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
63
|
function xe() {
|
|
64
|
-
return
|
|
65
|
-
input:
|
|
64
|
+
return _.object({
|
|
65
|
+
input: _.lazy(() => qt()),
|
|
66
66
|
type: pe,
|
|
67
67
|
scope: yt()
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
function qt() {
|
|
71
|
-
return
|
|
72
|
-
end:
|
|
73
|
-
start:
|
|
71
|
+
return _.object({
|
|
72
|
+
end: _.number().nullish(),
|
|
73
|
+
start: _.number().nullish()
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
const
|
|
76
|
+
const Jt = _.number;
|
|
77
77
|
function de() {
|
|
78
|
-
return
|
|
79
|
-
input:
|
|
78
|
+
return _.object({
|
|
79
|
+
input: Jt(),
|
|
80
80
|
type: ce,
|
|
81
81
|
scope: yt()
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const Ht = _.string;
|
|
85
85
|
function ge() {
|
|
86
|
-
return
|
|
87
|
-
input:
|
|
86
|
+
return _.object({
|
|
87
|
+
input: Ht(),
|
|
88
88
|
type: le,
|
|
89
|
-
scope:
|
|
89
|
+
scope: _.literal("global")
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
94
|
-
__typename:
|
|
95
|
-
hash:
|
|
96
|
-
index:
|
|
97
|
-
input:
|
|
98
|
-
timestamp:
|
|
99
|
-
type:
|
|
92
|
+
function ei() {
|
|
93
|
+
return _.object({
|
|
94
|
+
__typename: _.literal("SetNameOperation").optional(),
|
|
95
|
+
hash: _.string(),
|
|
96
|
+
index: _.number(),
|
|
97
|
+
input: _.string(),
|
|
98
|
+
timestamp: _.string().datetime(),
|
|
99
|
+
type: _.string()
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
const Wt =
|
|
102
|
+
const Wt = _.number;
|
|
103
103
|
function ye() {
|
|
104
|
-
return
|
|
104
|
+
return _.object({
|
|
105
105
|
input: Wt(),
|
|
106
106
|
type: ue,
|
|
107
107
|
scope: yt()
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
111
111
|
__proto__: null,
|
|
112
|
-
ActionSchema:
|
|
112
|
+
ActionSchema: Ye,
|
|
113
113
|
BaseActionSchema: fe,
|
|
114
|
-
DocumentFileSchema:
|
|
114
|
+
DocumentFileSchema: Qe,
|
|
115
115
|
LoadStateActionInputSchema: zt,
|
|
116
116
|
LoadStateActionSchema: he,
|
|
117
117
|
LoadStateActionStateInputSchema: me,
|
|
118
118
|
Load_StateSchema: se,
|
|
119
|
-
OperationSchema:
|
|
119
|
+
OperationSchema: ti,
|
|
120
120
|
OperationScopeSchema: yt,
|
|
121
121
|
PruneActionInputSchema: qt,
|
|
122
122
|
PruneActionSchema: xe,
|
|
123
123
|
PruneSchema: pe,
|
|
124
|
-
RedoActionInputSchema:
|
|
124
|
+
RedoActionInputSchema: Jt,
|
|
125
125
|
RedoActionSchema: de,
|
|
126
126
|
RedoSchema: ce,
|
|
127
|
-
SetNameActionInputSchema:
|
|
127
|
+
SetNameActionInputSchema: Ht,
|
|
128
128
|
SetNameActionSchema: ge,
|
|
129
|
-
SetNameOperationSchema:
|
|
129
|
+
SetNameOperationSchema: ei,
|
|
130
130
|
Set_NameSchema: le,
|
|
131
131
|
UndoActionInputSchema: Wt,
|
|
132
132
|
UndoActionSchema: ye,
|
|
133
133
|
UndoSchema: ue,
|
|
134
|
-
definedNonNullAnySchema:
|
|
134
|
+
definedNonNullAnySchema: Ze,
|
|
135
135
|
isDefinedNonNullAny: ae
|
|
136
136
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
137
|
-
function Xt(
|
|
138
|
-
return
|
|
137
|
+
function Xt(i) {
|
|
138
|
+
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
139
139
|
}
|
|
140
140
|
var Nt = { exports: {} };
|
|
141
|
-
(function(
|
|
142
|
-
const { hasOwnProperty: o } = Object.prototype, p =
|
|
143
|
-
p.configure =
|
|
141
|
+
(function(i, r) {
|
|
142
|
+
const { hasOwnProperty: o } = Object.prototype, p = Z();
|
|
143
|
+
p.configure = Z, p.stringify = p, p.default = p, r.stringify = p, r.configure = Z, i.exports = p;
|
|
144
144
|
const u = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;
|
|
145
145
|
function f(w) {
|
|
146
146
|
return w.length < 5e3 && !u.test(w) ? `"${w}"` : JSON.stringify(w);
|
|
@@ -149,11 +149,11 @@ var Nt = { exports: {} };
|
|
|
149
149
|
if (w.length > 200)
|
|
150
150
|
return w.sort();
|
|
151
151
|
for (let E = 1; E < w.length; E++) {
|
|
152
|
-
const
|
|
153
|
-
let
|
|
154
|
-
for (;
|
|
155
|
-
w[
|
|
156
|
-
w[
|
|
152
|
+
const v = w[E];
|
|
153
|
+
let R = E;
|
|
154
|
+
for (; R !== 0 && w[R - 1] > v; )
|
|
155
|
+
w[R] = w[R - 1], R--;
|
|
156
|
+
w[R] = v;
|
|
157
157
|
}
|
|
158
158
|
return w;
|
|
159
159
|
}
|
|
@@ -168,13 +168,13 @@ var Nt = { exports: {} };
|
|
|
168
168
|
function h(w) {
|
|
169
169
|
return s.call(w) !== void 0 && w.length !== 0;
|
|
170
170
|
}
|
|
171
|
-
function g(w, E,
|
|
172
|
-
w.length <
|
|
173
|
-
const
|
|
174
|
-
let
|
|
175
|
-
for (let
|
|
176
|
-
|
|
177
|
-
return
|
|
171
|
+
function g(w, E, v) {
|
|
172
|
+
w.length < v && (v = w.length);
|
|
173
|
+
const R = E === "," ? "" : " ";
|
|
174
|
+
let H = `"0":${R}${w[0]}`;
|
|
175
|
+
for (let W = 1; W < v; W++)
|
|
176
|
+
H += `${E}"${W}":${R}${w[W]}`;
|
|
177
|
+
return H;
|
|
178
178
|
}
|
|
179
179
|
function y(w) {
|
|
180
180
|
if (o.call(w, "circularValue")) {
|
|
@@ -193,165 +193,165 @@ var Nt = { exports: {} };
|
|
|
193
193
|
}
|
|
194
194
|
return '"[Circular]"';
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
let
|
|
198
|
-
if (o.call(w, E) && (
|
|
196
|
+
function b(w, E) {
|
|
197
|
+
let v;
|
|
198
|
+
if (o.call(w, E) && (v = w[E], typeof v != "boolean"))
|
|
199
199
|
throw new TypeError(`The "${E}" argument must be of type boolean`);
|
|
200
|
-
return
|
|
200
|
+
return v === void 0 ? !0 : v;
|
|
201
201
|
}
|
|
202
202
|
function F(w, E) {
|
|
203
|
-
let
|
|
203
|
+
let v;
|
|
204
204
|
if (o.call(w, E)) {
|
|
205
|
-
if (
|
|
205
|
+
if (v = w[E], typeof v != "number")
|
|
206
206
|
throw new TypeError(`The "${E}" argument must be of type number`);
|
|
207
|
-
if (!Number.isInteger(
|
|
207
|
+
if (!Number.isInteger(v))
|
|
208
208
|
throw new TypeError(`The "${E}" argument must be an integer`);
|
|
209
|
-
if (
|
|
209
|
+
if (v < 1)
|
|
210
210
|
throw new RangeError(`The "${E}" argument must be >= 1`);
|
|
211
211
|
}
|
|
212
|
-
return
|
|
212
|
+
return v === void 0 ? 1 / 0 : v;
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function j(w) {
|
|
215
215
|
return w === 1 ? "1 item" : `${w} items`;
|
|
216
216
|
}
|
|
217
217
|
function $(w) {
|
|
218
218
|
const E = /* @__PURE__ */ new Set();
|
|
219
|
-
for (const
|
|
220
|
-
(typeof
|
|
219
|
+
for (const v of w)
|
|
220
|
+
(typeof v == "string" || typeof v == "number") && E.add(String(v));
|
|
221
221
|
return E;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function q(w) {
|
|
224
224
|
if (o.call(w, "strict")) {
|
|
225
225
|
const E = w.strict;
|
|
226
226
|
if (typeof E != "boolean")
|
|
227
227
|
throw new TypeError('The "strict" argument must be of type boolean');
|
|
228
228
|
if (E)
|
|
229
|
-
return (
|
|
230
|
-
let
|
|
231
|
-
throw typeof
|
|
229
|
+
return (v) => {
|
|
230
|
+
let R = `Object can not safely be stringified. Received type ${typeof v}`;
|
|
231
|
+
throw typeof v != "function" && (R += ` (${v.toString()})`), new Error(R);
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Z(w) {
|
|
236
236
|
w = { ...w };
|
|
237
|
-
const E =
|
|
237
|
+
const E = q(w);
|
|
238
238
|
E && (w.bigint === void 0 && (w.bigint = !1), "circularValue" in w || (w.circularValue = Error));
|
|
239
|
-
const
|
|
240
|
-
function ut(
|
|
241
|
-
let
|
|
242
|
-
switch (typeof
|
|
239
|
+
const v = y(w), R = b(w, "bigint"), H = b(w, "deterministic"), W = F(w, "maximumDepth"), M = F(w, "maximumBreadth");
|
|
240
|
+
function ut(X, m, S, T, O, C) {
|
|
241
|
+
let A = m[X];
|
|
242
|
+
switch (typeof A == "object" && A !== null && typeof A.toJSON == "function" && (A = A.toJSON(X)), A = T.call(m, X, A), typeof A) {
|
|
243
243
|
case "string":
|
|
244
|
-
return f(
|
|
244
|
+
return f(A);
|
|
245
245
|
case "object": {
|
|
246
|
-
if (
|
|
246
|
+
if (A === null)
|
|
247
247
|
return "null";
|
|
248
|
-
if (
|
|
249
|
-
return
|
|
250
|
-
let
|
|
248
|
+
if (S.indexOf(A) !== -1)
|
|
249
|
+
return v;
|
|
250
|
+
let k = "", B = ",";
|
|
251
251
|
const I = C;
|
|
252
|
-
if (Array.isArray(
|
|
253
|
-
if (
|
|
252
|
+
if (Array.isArray(A)) {
|
|
253
|
+
if (A.length === 0)
|
|
254
254
|
return "[]";
|
|
255
|
-
if (
|
|
255
|
+
if (W < S.length + 1)
|
|
256
256
|
return '"[Array]"';
|
|
257
|
-
|
|
257
|
+
S.push(A), O !== "" && (C += O, k += `
|
|
258
258
|
${C}`, B = `,
|
|
259
259
|
${C}`);
|
|
260
|
-
const
|
|
260
|
+
const V = Math.min(A.length, M);
|
|
261
261
|
let Q = 0;
|
|
262
|
-
for (; Q <
|
|
263
|
-
const ct = ut(String(Q),
|
|
264
|
-
|
|
262
|
+
for (; Q < V - 1; Q++) {
|
|
263
|
+
const ct = ut(String(Q), A, S, T, O, C);
|
|
264
|
+
k += ct !== void 0 ? ct : "null", k += B;
|
|
265
265
|
}
|
|
266
|
-
const tt = ut(String(Q),
|
|
267
|
-
if (
|
|
268
|
-
const ct =
|
|
269
|
-
|
|
266
|
+
const tt = ut(String(Q), A, S, T, O, C);
|
|
267
|
+
if (k += tt !== void 0 ? tt : "null", A.length - 1 > M) {
|
|
268
|
+
const ct = A.length - M - 1;
|
|
269
|
+
k += `${B}"... ${j(ct)} not stringified"`;
|
|
270
270
|
}
|
|
271
|
-
return O !== "" && (
|
|
272
|
-
${I}`),
|
|
271
|
+
return O !== "" && (k += `
|
|
272
|
+
${I}`), S.pop(), `[${k}]`;
|
|
273
273
|
}
|
|
274
|
-
let L = Object.keys(
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
274
|
+
let L = Object.keys(A);
|
|
275
|
+
const J = L.length;
|
|
276
|
+
if (J === 0)
|
|
277
277
|
return "{}";
|
|
278
|
-
if (
|
|
278
|
+
if (W < S.length + 1)
|
|
279
279
|
return '"[Object]"';
|
|
280
|
-
let U = "",
|
|
280
|
+
let U = "", K = "";
|
|
281
281
|
O !== "" && (C += O, B = `,
|
|
282
282
|
${C}`, U = " ");
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
for (let
|
|
286
|
-
const Q = L[
|
|
287
|
-
tt !== void 0 && (
|
|
283
|
+
const Y = Math.min(J, M);
|
|
284
|
+
H && !h(A) && (L = c(L)), S.push(A);
|
|
285
|
+
for (let V = 0; V < Y; V++) {
|
|
286
|
+
const Q = L[V], tt = ut(Q, A, S, T, O, C);
|
|
287
|
+
tt !== void 0 && (k += `${K}${f(Q)}:${U}${tt}`, K = B);
|
|
288
288
|
}
|
|
289
|
-
if (
|
|
290
|
-
const
|
|
291
|
-
|
|
289
|
+
if (J > M) {
|
|
290
|
+
const V = J - M;
|
|
291
|
+
k += `${K}"...":${U}"${j(V)} not stringified"`, K = B;
|
|
292
292
|
}
|
|
293
|
-
return O !== "" &&
|
|
294
|
-
${C}${
|
|
295
|
-
${I}`),
|
|
293
|
+
return O !== "" && K.length > 1 && (k = `
|
|
294
|
+
${C}${k}
|
|
295
|
+
${I}`), S.pop(), `{${k}}`;
|
|
296
296
|
}
|
|
297
297
|
case "number":
|
|
298
|
-
return isFinite(
|
|
298
|
+
return isFinite(A) ? String(A) : E ? E(A) : "null";
|
|
299
299
|
case "boolean":
|
|
300
|
-
return
|
|
300
|
+
return A === !0 ? "true" : "false";
|
|
301
301
|
case "undefined":
|
|
302
302
|
return;
|
|
303
303
|
case "bigint":
|
|
304
|
-
if (
|
|
305
|
-
return String(
|
|
304
|
+
if (R)
|
|
305
|
+
return String(A);
|
|
306
306
|
default:
|
|
307
|
-
return E ? E(
|
|
307
|
+
return E ? E(A) : void 0;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function ft(
|
|
311
|
-
switch (typeof m == "object" && m !== null && typeof m.toJSON == "function" && (m = m.toJSON(
|
|
310
|
+
function ft(X, m, S, T, O, C) {
|
|
311
|
+
switch (typeof m == "object" && m !== null && typeof m.toJSON == "function" && (m = m.toJSON(X)), typeof m) {
|
|
312
312
|
case "string":
|
|
313
313
|
return f(m);
|
|
314
314
|
case "object": {
|
|
315
315
|
if (m === null)
|
|
316
316
|
return "null";
|
|
317
|
-
if (
|
|
318
|
-
return
|
|
319
|
-
const
|
|
320
|
-
let
|
|
317
|
+
if (S.indexOf(m) !== -1)
|
|
318
|
+
return v;
|
|
319
|
+
const A = C;
|
|
320
|
+
let k = "", B = ",";
|
|
321
321
|
if (Array.isArray(m)) {
|
|
322
322
|
if (m.length === 0)
|
|
323
323
|
return "[]";
|
|
324
|
-
if (
|
|
324
|
+
if (W < S.length + 1)
|
|
325
325
|
return '"[Array]"';
|
|
326
|
-
|
|
326
|
+
S.push(m), O !== "" && (C += O, k += `
|
|
327
327
|
${C}`, B = `,
|
|
328
328
|
${C}`);
|
|
329
|
-
const
|
|
329
|
+
const J = Math.min(m.length, M);
|
|
330
330
|
let U = 0;
|
|
331
|
-
for (; U <
|
|
332
|
-
const
|
|
333
|
-
|
|
331
|
+
for (; U < J - 1; U++) {
|
|
332
|
+
const Y = ft(String(U), m[U], S, T, O, C);
|
|
333
|
+
k += Y !== void 0 ? Y : "null", k += B;
|
|
334
334
|
}
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
337
|
-
const
|
|
338
|
-
|
|
335
|
+
const K = ft(String(U), m[U], S, T, O, C);
|
|
336
|
+
if (k += K !== void 0 ? K : "null", m.length - 1 > M) {
|
|
337
|
+
const Y = m.length - M - 1;
|
|
338
|
+
k += `${B}"... ${j(Y)} not stringified"`;
|
|
339
339
|
}
|
|
340
|
-
return O !== "" && (
|
|
341
|
-
${
|
|
340
|
+
return O !== "" && (k += `
|
|
341
|
+
${A}`), S.pop(), `[${k}]`;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
S.push(m);
|
|
344
344
|
let I = "";
|
|
345
345
|
O !== "" && (C += O, B = `,
|
|
346
346
|
${C}`, I = " ");
|
|
347
347
|
let L = "";
|
|
348
|
-
for (const
|
|
349
|
-
const U = ft(
|
|
350
|
-
U !== void 0 && (
|
|
348
|
+
for (const J of T) {
|
|
349
|
+
const U = ft(J, m[J], S, T, O, C);
|
|
350
|
+
U !== void 0 && (k += `${L}${f(J)}:${I}${U}`, L = B);
|
|
351
351
|
}
|
|
352
|
-
return O !== "" && L.length > 1 && (
|
|
353
|
-
${C}${
|
|
354
|
-
${
|
|
352
|
+
return O !== "" && L.length > 1 && (k = `
|
|
353
|
+
${C}${k}
|
|
354
|
+
${A}`), S.pop(), `{${k}}`;
|
|
355
355
|
}
|
|
356
356
|
case "number":
|
|
357
357
|
return isFinite(m) ? String(m) : E ? E(m) : "null";
|
|
@@ -360,13 +360,13 @@ ${S}`), b.pop(), `{${T}}`;
|
|
|
360
360
|
case "undefined":
|
|
361
361
|
return;
|
|
362
362
|
case "bigint":
|
|
363
|
-
if (
|
|
363
|
+
if (R)
|
|
364
364
|
return String(m);
|
|
365
365
|
default:
|
|
366
366
|
return E ? E(m) : void 0;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
function st(
|
|
369
|
+
function st(X, m, S, T, O) {
|
|
370
370
|
switch (typeof m) {
|
|
371
371
|
case "string":
|
|
372
372
|
return f(m);
|
|
@@ -374,59 +374,59 @@ ${S}`), b.pop(), `{${T}}`;
|
|
|
374
374
|
if (m === null)
|
|
375
375
|
return "null";
|
|
376
376
|
if (typeof m.toJSON == "function") {
|
|
377
|
-
if (m = m.toJSON(
|
|
378
|
-
return st(
|
|
377
|
+
if (m = m.toJSON(X), typeof m != "object")
|
|
378
|
+
return st(X, m, S, T, O);
|
|
379
379
|
if (m === null)
|
|
380
380
|
return "null";
|
|
381
381
|
}
|
|
382
|
-
if (
|
|
383
|
-
return
|
|
382
|
+
if (S.indexOf(m) !== -1)
|
|
383
|
+
return v;
|
|
384
384
|
const C = O;
|
|
385
385
|
if (Array.isArray(m)) {
|
|
386
386
|
if (m.length === 0)
|
|
387
387
|
return "[]";
|
|
388
|
-
if (
|
|
388
|
+
if (W < S.length + 1)
|
|
389
389
|
return '"[Array]"';
|
|
390
|
-
|
|
390
|
+
S.push(m), O += T;
|
|
391
391
|
let U = `
|
|
392
392
|
${O}`;
|
|
393
|
-
const
|
|
394
|
-
${O}`,
|
|
395
|
-
let
|
|
396
|
-
for (;
|
|
397
|
-
const tt = st(String(
|
|
398
|
-
U += tt !== void 0 ? tt : "null", U +=
|
|
393
|
+
const K = `,
|
|
394
|
+
${O}`, Y = Math.min(m.length, M);
|
|
395
|
+
let V = 0;
|
|
396
|
+
for (; V < Y - 1; V++) {
|
|
397
|
+
const tt = st(String(V), m[V], S, T, O);
|
|
398
|
+
U += tt !== void 0 ? tt : "null", U += K;
|
|
399
399
|
}
|
|
400
|
-
const Q = st(String(
|
|
400
|
+
const Q = st(String(V), m[V], S, T, O);
|
|
401
401
|
if (U += Q !== void 0 ? Q : "null", m.length - 1 > M) {
|
|
402
402
|
const tt = m.length - M - 1;
|
|
403
|
-
U += `${
|
|
403
|
+
U += `${K}"... ${j(tt)} not stringified"`;
|
|
404
404
|
}
|
|
405
405
|
return U += `
|
|
406
|
-
${C}`,
|
|
406
|
+
${C}`, S.pop(), `[${U}]`;
|
|
407
407
|
}
|
|
408
|
-
let
|
|
409
|
-
const
|
|
410
|
-
if (
|
|
408
|
+
let A = Object.keys(m);
|
|
409
|
+
const k = A.length;
|
|
410
|
+
if (k === 0)
|
|
411
411
|
return "{}";
|
|
412
|
-
if (
|
|
412
|
+
if (W < S.length + 1)
|
|
413
413
|
return '"[Object]"';
|
|
414
|
-
O +=
|
|
414
|
+
O += T;
|
|
415
415
|
const B = `,
|
|
416
416
|
${O}`;
|
|
417
|
-
let I = "", L = "",
|
|
418
|
-
h(m) && (I += g(m, B, M),
|
|
419
|
-
for (let U = 0; U <
|
|
420
|
-
const
|
|
421
|
-
|
|
417
|
+
let I = "", L = "", J = Math.min(k, M);
|
|
418
|
+
h(m) && (I += g(m, B, M), A = A.slice(m.length), J -= m.length, L = B), H && (A = c(A)), S.push(m);
|
|
419
|
+
for (let U = 0; U < J; U++) {
|
|
420
|
+
const K = A[U], Y = st(K, m[K], S, T, O);
|
|
421
|
+
Y !== void 0 && (I += `${L}${f(K)}: ${Y}`, L = B);
|
|
422
422
|
}
|
|
423
|
-
if (
|
|
424
|
-
const U =
|
|
425
|
-
I += `${L}"...": "${
|
|
423
|
+
if (k > M) {
|
|
424
|
+
const U = k - M;
|
|
425
|
+
I += `${L}"...": "${j(U)} not stringified"`, L = B;
|
|
426
426
|
}
|
|
427
427
|
return L !== "" && (I = `
|
|
428
428
|
${O}${I}
|
|
429
|
-
${C}`),
|
|
429
|
+
${C}`), S.pop(), `{${I}}`;
|
|
430
430
|
}
|
|
431
431
|
case "number":
|
|
432
432
|
return isFinite(m) ? String(m) : E ? E(m) : "null";
|
|
@@ -435,13 +435,13 @@ ${C}`), b.pop(), `{${I}}`;
|
|
|
435
435
|
case "undefined":
|
|
436
436
|
return;
|
|
437
437
|
case "bigint":
|
|
438
|
-
if (
|
|
438
|
+
if (R)
|
|
439
439
|
return String(m);
|
|
440
440
|
default:
|
|
441
441
|
return E ? E(m) : void 0;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
function pt(
|
|
444
|
+
function pt(X, m, S) {
|
|
445
445
|
switch (typeof m) {
|
|
446
446
|
case "string":
|
|
447
447
|
return f(m);
|
|
@@ -449,50 +449,50 @@ ${C}`), b.pop(), `{${I}}`;
|
|
|
449
449
|
if (m === null)
|
|
450
450
|
return "null";
|
|
451
451
|
if (typeof m.toJSON == "function") {
|
|
452
|
-
if (m = m.toJSON(
|
|
453
|
-
return pt(
|
|
452
|
+
if (m = m.toJSON(X), typeof m != "object")
|
|
453
|
+
return pt(X, m, S);
|
|
454
454
|
if (m === null)
|
|
455
455
|
return "null";
|
|
456
456
|
}
|
|
457
|
-
if (
|
|
458
|
-
return
|
|
459
|
-
let
|
|
457
|
+
if (S.indexOf(m) !== -1)
|
|
458
|
+
return v;
|
|
459
|
+
let T = "";
|
|
460
460
|
if (Array.isArray(m)) {
|
|
461
461
|
if (m.length === 0)
|
|
462
462
|
return "[]";
|
|
463
|
-
if (
|
|
463
|
+
if (W < S.length + 1)
|
|
464
464
|
return '"[Array]"';
|
|
465
|
-
|
|
465
|
+
S.push(m);
|
|
466
466
|
const B = Math.min(m.length, M);
|
|
467
467
|
let I = 0;
|
|
468
468
|
for (; I < B - 1; I++) {
|
|
469
|
-
const
|
|
470
|
-
|
|
469
|
+
const J = pt(String(I), m[I], S);
|
|
470
|
+
T += J !== void 0 ? J : "null", T += ",";
|
|
471
471
|
}
|
|
472
|
-
const L = pt(String(I), m[I],
|
|
473
|
-
if (
|
|
474
|
-
const
|
|
475
|
-
|
|
472
|
+
const L = pt(String(I), m[I], S);
|
|
473
|
+
if (T += L !== void 0 ? L : "null", m.length - 1 > M) {
|
|
474
|
+
const J = m.length - M - 1;
|
|
475
|
+
T += `,"... ${j(J)} not stringified"`;
|
|
476
476
|
}
|
|
477
|
-
return
|
|
477
|
+
return S.pop(), `[${T}]`;
|
|
478
478
|
}
|
|
479
479
|
let O = Object.keys(m);
|
|
480
480
|
const C = O.length;
|
|
481
481
|
if (C === 0)
|
|
482
482
|
return "{}";
|
|
483
|
-
if (
|
|
483
|
+
if (W < S.length + 1)
|
|
484
484
|
return '"[Object]"';
|
|
485
|
-
let
|
|
486
|
-
h(m) && (
|
|
487
|
-
for (let B = 0; B <
|
|
488
|
-
const I = O[B], L = pt(I, m[I],
|
|
489
|
-
L !== void 0 && (
|
|
485
|
+
let A = "", k = Math.min(C, M);
|
|
486
|
+
h(m) && (T += g(m, ",", M), O = O.slice(m.length), k -= m.length, A = ","), H && (O = c(O)), S.push(m);
|
|
487
|
+
for (let B = 0; B < k; B++) {
|
|
488
|
+
const I = O[B], L = pt(I, m[I], S);
|
|
489
|
+
L !== void 0 && (T += `${A}${f(I)}:${L}`, A = ",");
|
|
490
490
|
}
|
|
491
491
|
if (C > M) {
|
|
492
492
|
const B = C - M;
|
|
493
|
-
|
|
493
|
+
T += `${A}"...":"${j(B)} not stringified"`;
|
|
494
494
|
}
|
|
495
|
-
return
|
|
495
|
+
return S.pop(), `{${T}}`;
|
|
496
496
|
}
|
|
497
497
|
case "number":
|
|
498
498
|
return isFinite(m) ? String(m) : E ? E(m) : "null";
|
|
@@ -501,40 +501,40 @@ ${C}`), b.pop(), `{${I}}`;
|
|
|
501
501
|
case "undefined":
|
|
502
502
|
return;
|
|
503
503
|
case "bigint":
|
|
504
|
-
if (
|
|
504
|
+
if (R)
|
|
505
505
|
return String(m);
|
|
506
506
|
default:
|
|
507
507
|
return E ? E(m) : void 0;
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
function Dt(
|
|
510
|
+
function Dt(X, m, S) {
|
|
511
511
|
if (arguments.length > 1) {
|
|
512
|
-
let
|
|
513
|
-
if (typeof
|
|
512
|
+
let T = "";
|
|
513
|
+
if (typeof S == "number" ? T = " ".repeat(Math.min(S, 10)) : typeof S == "string" && (T = S.slice(0, 10)), m != null) {
|
|
514
514
|
if (typeof m == "function")
|
|
515
|
-
return ut("", { "":
|
|
515
|
+
return ut("", { "": X }, [], m, T, "");
|
|
516
516
|
if (Array.isArray(m))
|
|
517
|
-
return ft("",
|
|
517
|
+
return ft("", X, [], $(m), T, "");
|
|
518
518
|
}
|
|
519
|
-
if (
|
|
520
|
-
return st("",
|
|
519
|
+
if (T.length !== 0)
|
|
520
|
+
return st("", X, [], T, "");
|
|
521
521
|
}
|
|
522
|
-
return pt("",
|
|
522
|
+
return pt("", X, []);
|
|
523
523
|
}
|
|
524
524
|
return Dt;
|
|
525
525
|
}
|
|
526
526
|
})(Nt, Nt.exports);
|
|
527
|
-
var
|
|
528
|
-
const xt = /* @__PURE__ */ Xt(
|
|
527
|
+
var ii = Nt.exports;
|
|
528
|
+
const xt = /* @__PURE__ */ Xt(ii);
|
|
529
529
|
xt.configure;
|
|
530
|
-
function
|
|
531
|
-
return { ...
|
|
530
|
+
function ri(i, r) {
|
|
531
|
+
return { ...i, name: r };
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
const { scope: p, input: u } =
|
|
533
|
+
function ni(i, r, o) {
|
|
534
|
+
const { scope: p, input: u } = r;
|
|
535
535
|
return Ot({
|
|
536
|
-
document:
|
|
537
|
-
action:
|
|
536
|
+
document: i,
|
|
537
|
+
action: r,
|
|
538
538
|
skip: o
|
|
539
539
|
}, (c) => {
|
|
540
540
|
if (c.document.operations[p].length < 1)
|
|
@@ -560,23 +560,23 @@ function ir(r, i, o) {
|
|
|
560
560
|
"Cannot undo: you can't undo more operations than the ones in the scope history"
|
|
561
561
|
);
|
|
562
562
|
const g = c.document.operations[p].length - 1;
|
|
563
|
-
let y = u,
|
|
564
|
-
for (; y > 0 &&
|
|
565
|
-
const F = c.document.operations[p][
|
|
563
|
+
let y = u, b = h ? g - s.skip : g;
|
|
564
|
+
for (; y > 0 && b >= 0; ) {
|
|
565
|
+
const F = c.document.operations[p][b];
|
|
566
566
|
if (!F) {
|
|
567
|
-
y--,
|
|
567
|
+
y--, b--;
|
|
568
568
|
continue;
|
|
569
569
|
}
|
|
570
|
-
F.type === "NOOP" && F.skip > 0 ? (
|
|
570
|
+
F.type === "NOOP" && F.skip > 0 ? (b = b - (F.skip + 1), c.skip += F.skip + 1) : (c.document.clipboard.push({ ...F }), y--, b--);
|
|
571
571
|
}
|
|
572
572
|
c.action = He(p);
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
const { scope: p, input: u } =
|
|
575
|
+
function oi(i, r, o) {
|
|
576
|
+
const { scope: p, input: u } = r;
|
|
577
577
|
return Ot({
|
|
578
|
-
document:
|
|
579
|
-
action:
|
|
578
|
+
document: i,
|
|
579
|
+
action: r,
|
|
580
580
|
skip: o
|
|
581
581
|
}, (c) => {
|
|
582
582
|
if (c.skip > 0)
|
|
@@ -606,68 +606,68 @@ function nr(r, i, o) {
|
|
|
606
606
|
});
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
const { scope: p } =
|
|
609
|
+
function ai(i, r, o) {
|
|
610
|
+
const { scope: p } = r, u = i.operations[p];
|
|
611
611
|
let {
|
|
612
612
|
input: { start: f, end: c }
|
|
613
|
-
} =
|
|
613
|
+
} = r;
|
|
614
614
|
f = f || 0, c = c || u.length;
|
|
615
615
|
const s = u.slice(f, c), h = u.slice(0, f), g = u.slice(c), y = Pt(
|
|
616
|
-
|
|
616
|
+
i.initialState,
|
|
617
617
|
{
|
|
618
|
-
...
|
|
618
|
+
...i.operations,
|
|
619
619
|
[p]: h.concat(s)
|
|
620
620
|
},
|
|
621
621
|
o
|
|
622
|
-
), { name:
|
|
622
|
+
), { name: b, state: F } = y, j = h.length, $ = h.length ? h[h.length - 1].timestamp : g.length ? g[0].timestamp : (/* @__PURE__ */ new Date()).toISOString();
|
|
623
623
|
return Pt(
|
|
624
|
-
|
|
624
|
+
i.initialState,
|
|
625
625
|
{
|
|
626
|
-
...
|
|
626
|
+
...i.operations,
|
|
627
627
|
[p]: [
|
|
628
628
|
...h,
|
|
629
629
|
{
|
|
630
630
|
...te(
|
|
631
|
-
{ name:
|
|
631
|
+
{ name: b, state: F },
|
|
632
632
|
s.length
|
|
633
633
|
),
|
|
634
634
|
timestamp: $,
|
|
635
|
-
index:
|
|
635
|
+
index: j,
|
|
636
636
|
hash: Qt({ state: F }, "global")
|
|
637
637
|
},
|
|
638
|
-
...g.map((
|
|
639
|
-
...
|
|
640
|
-
index:
|
|
638
|
+
...g.map((q, Z) => ({
|
|
639
|
+
...q,
|
|
640
|
+
index: j + Z + 1
|
|
641
641
|
}))
|
|
642
642
|
]
|
|
643
643
|
},
|
|
644
644
|
o
|
|
645
645
|
);
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function si(i, r) {
|
|
648
648
|
return {
|
|
649
|
-
...
|
|
650
|
-
name:
|
|
651
|
-
state:
|
|
649
|
+
...i,
|
|
650
|
+
name: r.name,
|
|
651
|
+
state: r.state ?? { global: {}, local: {} }
|
|
652
652
|
};
|
|
653
653
|
}
|
|
654
|
-
const we = "SET_NAME", wt = "UNDO", Et = "REDO", It = "PRUNE", Ee = "LOAD_STATE", sr = "NOOP", be = { "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"] };
|
|
654
|
+
const we = "SET_NAME", wt = "UNDO", Et = "REDO", It = "PRUNE", Ee = "LOAD_STATE", pi = "NOOP", be = { "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"] };
|
|
655
655
|
Object.freeze(be);
|
|
656
|
-
var et = function(
|
|
656
|
+
var et = function(i, r, o, p) {
|
|
657
657
|
if (o === "a" && !p)
|
|
658
658
|
throw new TypeError("Private accessor was defined without a getter");
|
|
659
|
-
if (typeof
|
|
659
|
+
if (typeof r == "function" ? i !== r || !p : !r.has(i))
|
|
660
660
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
661
|
-
return o === "m" ? p : o === "a" ? p.call(
|
|
661
|
+
return o === "m" ? p : o === "a" ? p.call(i) : p ? p.value : r.get(i);
|
|
662
662
|
}, mt, gt, lt;
|
|
663
|
-
class
|
|
664
|
-
constructor(...
|
|
663
|
+
class ci {
|
|
664
|
+
constructor(...r) {
|
|
665
665
|
mt.set(this, /* @__PURE__ */ new Map()), gt.set(this, /* @__PURE__ */ new Map()), lt.set(this, /* @__PURE__ */ new Map());
|
|
666
|
-
for (const o of
|
|
666
|
+
for (const o of r)
|
|
667
667
|
this.define(o);
|
|
668
668
|
}
|
|
669
|
-
define(
|
|
670
|
-
for (let [p, u] of Object.entries(
|
|
669
|
+
define(r, o = !1) {
|
|
670
|
+
for (let [p, u] of Object.entries(r)) {
|
|
671
671
|
p = p.toLowerCase(), u = u.map((s) => s.toLowerCase()), et(this, lt, "f").has(p) || et(this, lt, "f").set(p, /* @__PURE__ */ new Set());
|
|
672
672
|
const f = et(this, lt, "f").get(p);
|
|
673
673
|
let c = !0;
|
|
@@ -683,25 +683,25 @@ class pr {
|
|
|
683
683
|
}
|
|
684
684
|
return this;
|
|
685
685
|
}
|
|
686
|
-
getType(
|
|
687
|
-
if (typeof
|
|
686
|
+
getType(r) {
|
|
687
|
+
if (typeof r != "string")
|
|
688
688
|
return null;
|
|
689
|
-
const o =
|
|
689
|
+
const o = r.replace(/^.*[/\\]/, "").toLowerCase(), p = o.replace(/^.*\./, "").toLowerCase(), u = o.length < r.length;
|
|
690
690
|
return !(p.length < o.length - 1) && u ? null : et(this, mt, "f").get(p) ?? null;
|
|
691
691
|
}
|
|
692
|
-
getExtension(
|
|
692
|
+
getExtension(r) {
|
|
693
693
|
var o;
|
|
694
|
-
return typeof
|
|
694
|
+
return typeof r != "string" ? null : (r = (o = r == null ? void 0 : r.split) == null ? void 0 : o.call(r, ";")[0], (r && et(this, gt, "f").get(r.trim().toLowerCase())) ?? null);
|
|
695
695
|
}
|
|
696
|
-
getAllExtensions(
|
|
697
|
-
return typeof
|
|
696
|
+
getAllExtensions(r) {
|
|
697
|
+
return typeof r != "string" ? null : et(this, lt, "f").get(r.toLowerCase()) ?? null;
|
|
698
698
|
}
|
|
699
699
|
_freeze() {
|
|
700
700
|
this.define = () => {
|
|
701
701
|
throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
|
|
702
702
|
}, Object.freeze(this);
|
|
703
|
-
for (const
|
|
704
|
-
Object.freeze(
|
|
703
|
+
for (const r of et(this, lt, "f").values())
|
|
704
|
+
Object.freeze(r);
|
|
705
705
|
return this;
|
|
706
706
|
}
|
|
707
707
|
_getTestState() {
|
|
@@ -712,97 +712,97 @@ class pr {
|
|
|
712
712
|
}
|
|
713
713
|
}
|
|
714
714
|
mt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap();
|
|
715
|
-
const
|
|
715
|
+
const li = new ci(be)._freeze();
|
|
716
716
|
var Mt = { exports: {} };
|
|
717
|
-
typeof Object.create == "function" ? Mt.exports = function(
|
|
718
|
-
o && (
|
|
717
|
+
typeof Object.create == "function" ? Mt.exports = function(r, o) {
|
|
718
|
+
o && (r.super_ = o, r.prototype = Object.create(o.prototype, {
|
|
719
719
|
constructor: {
|
|
720
|
-
value:
|
|
720
|
+
value: r,
|
|
721
721
|
enumerable: !1,
|
|
722
722
|
writable: !0,
|
|
723
723
|
configurable: !0
|
|
724
724
|
}
|
|
725
725
|
}));
|
|
726
|
-
} : Mt.exports = function(
|
|
726
|
+
} : Mt.exports = function(r, o) {
|
|
727
727
|
if (o) {
|
|
728
|
-
|
|
728
|
+
r.super_ = o;
|
|
729
729
|
var p = function() {
|
|
730
730
|
};
|
|
731
|
-
p.prototype = o.prototype,
|
|
731
|
+
p.prototype = o.prototype, r.prototype = new p(), r.prototype.constructor = r;
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
var ve = Mt.exports, Rt = { exports: {} },
|
|
735
|
-
jt.byteLength =
|
|
736
|
-
jt.toByteArray =
|
|
737
|
-
jt.fromByteArray =
|
|
738
|
-
var nt = [],
|
|
739
|
-
for (var ht = 0,
|
|
740
|
-
nt[ht] = Ut[ht],
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
function
|
|
744
|
-
var
|
|
745
|
-
if (
|
|
734
|
+
var ve = Mt.exports, Rt = { exports: {} }, Se = {}, jt = {};
|
|
735
|
+
jt.byteLength = hi;
|
|
736
|
+
jt.toByteArray = xi;
|
|
737
|
+
jt.fromByteArray = yi;
|
|
738
|
+
var nt = [], it = [], ui = typeof Uint8Array < "u" ? Uint8Array : Array, Ut = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
739
|
+
for (var ht = 0, fi = Ut.length; ht < fi; ++ht)
|
|
740
|
+
nt[ht] = Ut[ht], it[Ut.charCodeAt(ht)] = ht;
|
|
741
|
+
it[45] = 62;
|
|
742
|
+
it[95] = 63;
|
|
743
|
+
function _e(i) {
|
|
744
|
+
var r = i.length;
|
|
745
|
+
if (r % 4 > 0)
|
|
746
746
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
747
|
-
var o =
|
|
748
|
-
o === -1 && (o =
|
|
749
|
-
var p = o ===
|
|
747
|
+
var o = i.indexOf("=");
|
|
748
|
+
o === -1 && (o = r);
|
|
749
|
+
var p = o === r ? 0 : 4 - o % 4;
|
|
750
750
|
return [o, p];
|
|
751
751
|
}
|
|
752
|
-
function
|
|
753
|
-
var
|
|
752
|
+
function hi(i) {
|
|
753
|
+
var r = _e(i), o = r[0], p = r[1];
|
|
754
754
|
return (o + p) * 3 / 4 - p;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
return (
|
|
756
|
+
function mi(i, r, o) {
|
|
757
|
+
return (r + o) * 3 / 4 - o;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
var
|
|
759
|
+
function xi(i) {
|
|
760
|
+
var r, o = _e(i), p = o[0], u = o[1], f = new ui(mi(i, p, u)), c = 0, s = u > 0 ? p - 4 : p, h;
|
|
761
761
|
for (h = 0; h < s; h += 4)
|
|
762
|
-
|
|
763
|
-
return u === 2 && (
|
|
762
|
+
r = it[i.charCodeAt(h)] << 18 | it[i.charCodeAt(h + 1)] << 12 | it[i.charCodeAt(h + 2)] << 6 | it[i.charCodeAt(h + 3)], f[c++] = r >> 16 & 255, f[c++] = r >> 8 & 255, f[c++] = r & 255;
|
|
763
|
+
return u === 2 && (r = it[i.charCodeAt(h)] << 2 | it[i.charCodeAt(h + 1)] >> 4, f[c++] = r & 255), u === 1 && (r = it[i.charCodeAt(h)] << 10 | it[i.charCodeAt(h + 1)] << 4 | it[i.charCodeAt(h + 2)] >> 2, f[c++] = r >> 8 & 255, f[c++] = r & 255), f;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
766
|
-
return nt[
|
|
765
|
+
function di(i) {
|
|
766
|
+
return nt[i >> 18 & 63] + nt[i >> 12 & 63] + nt[i >> 6 & 63] + nt[i & 63];
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
for (var p, u = [], f =
|
|
770
|
-
p = (
|
|
768
|
+
function gi(i, r, o) {
|
|
769
|
+
for (var p, u = [], f = r; f < o; f += 3)
|
|
770
|
+
p = (i[f] << 16 & 16711680) + (i[f + 1] << 8 & 65280) + (i[f + 2] & 255), u.push(di(p));
|
|
771
771
|
return u.join("");
|
|
772
772
|
}
|
|
773
|
-
function
|
|
774
|
-
for (var
|
|
775
|
-
u.push(
|
|
776
|
-
return p === 1 ? (
|
|
777
|
-
nt[
|
|
778
|
-
)) : p === 2 && (
|
|
779
|
-
nt[
|
|
773
|
+
function yi(i) {
|
|
774
|
+
for (var r, o = i.length, p = o % 3, u = [], f = 16383, c = 0, s = o - p; c < s; c += f)
|
|
775
|
+
u.push(gi(i, c, c + f > s ? s : c + f));
|
|
776
|
+
return p === 1 ? (r = i[o - 1], u.push(
|
|
777
|
+
nt[r >> 2] + nt[r << 4 & 63] + "=="
|
|
778
|
+
)) : p === 2 && (r = (i[o - 2] << 8) + i[o - 1], u.push(
|
|
779
|
+
nt[r >> 10] + nt[r >> 4 & 63] + nt[r << 2 & 63] + "="
|
|
780
780
|
)), u.join("");
|
|
781
781
|
}
|
|
782
782
|
var Vt = {};
|
|
783
783
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
784
|
-
Vt.read = function(
|
|
785
|
-
var f, c, s = u * 8 - p - 1, h = (1 << s) - 1, g = h >> 1, y = -7,
|
|
786
|
-
for (
|
|
784
|
+
Vt.read = function(i, r, o, p, u) {
|
|
785
|
+
var f, c, s = u * 8 - p - 1, h = (1 << s) - 1, g = h >> 1, y = -7, b = o ? u - 1 : 0, F = o ? -1 : 1, j = i[r + b];
|
|
786
|
+
for (b += F, f = j & (1 << -y) - 1, j >>= -y, y += s; y > 0; f = f * 256 + i[r + b], b += F, y -= 8)
|
|
787
787
|
;
|
|
788
|
-
for (c = f & (1 << -y) - 1, f >>= -y, y += p; y > 0; c = c * 256 + r
|
|
788
|
+
for (c = f & (1 << -y) - 1, f >>= -y, y += p; y > 0; c = c * 256 + i[r + b], b += F, y -= 8)
|
|
789
789
|
;
|
|
790
790
|
if (f === 0)
|
|
791
791
|
f = 1 - g;
|
|
792
792
|
else {
|
|
793
793
|
if (f === h)
|
|
794
|
-
return c ? NaN : (
|
|
794
|
+
return c ? NaN : (j ? -1 : 1) * (1 / 0);
|
|
795
795
|
c = c + Math.pow(2, p), f = f - g;
|
|
796
796
|
}
|
|
797
|
-
return (
|
|
797
|
+
return (j ? -1 : 1) * c * Math.pow(2, f - p);
|
|
798
798
|
};
|
|
799
|
-
Vt.write = function(
|
|
800
|
-
var c, s, h, g = f * 8 - u - 1, y = (1 << g) - 1,
|
|
801
|
-
for (
|
|
799
|
+
Vt.write = function(i, r, o, p, u, f) {
|
|
800
|
+
var c, s, h, g = f * 8 - u - 1, y = (1 << g) - 1, b = y >> 1, F = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, j = p ? 0 : f - 1, $ = p ? 1 : -1, q = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
|
|
801
|
+
for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (s = isNaN(r) ? 1 : 0, c = y) : (c = Math.floor(Math.log(r) / Math.LN2), r * (h = Math.pow(2, -c)) < 1 && (c--, h *= 2), c + b >= 1 ? r += F / h : r += F * Math.pow(2, 1 - b), r * h >= 2 && (c++, h /= 2), c + b >= y ? (s = 0, c = y) : c + b >= 1 ? (s = (r * h - 1) * Math.pow(2, u), c = c + b) : (s = r * Math.pow(2, b - 1) * Math.pow(2, u), c = 0)); u >= 8; i[o + j] = s & 255, j += $, s /= 256, u -= 8)
|
|
802
802
|
;
|
|
803
|
-
for (c = c << u | s, g += u; g > 0;
|
|
803
|
+
for (c = c << u | s, g += u; g > 0; i[o + j] = c & 255, j += $, c /= 256, g -= 8)
|
|
804
804
|
;
|
|
805
|
-
|
|
805
|
+
i[o + j - $] |= q * 128;
|
|
806
806
|
};
|
|
807
807
|
/*!
|
|
808
808
|
* The buffer module from node.js, for the browser.
|
|
@@ -810,11 +810,11 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
810
810
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
811
811
|
* @license MIT
|
|
812
812
|
*/
|
|
813
|
-
(function(
|
|
814
|
-
var
|
|
815
|
-
|
|
813
|
+
(function(i) {
|
|
814
|
+
var r = jt, o = Vt, p = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
815
|
+
i.Buffer = s, i.SlowBuffer = E, i.INSPECT_MAX_BYTES = 50;
|
|
816
816
|
var u = 2147483647;
|
|
817
|
-
|
|
817
|
+
i.kMaxLength = u, s.TYPED_ARRAY_SUPPORT = f(), !s.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
818
818
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
819
819
|
);
|
|
820
820
|
function f() {
|
|
@@ -852,7 +852,7 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
852
852
|
throw new TypeError(
|
|
853
853
|
'The "string" argument must be of type string. Received type number'
|
|
854
854
|
);
|
|
855
|
-
return
|
|
855
|
+
return b(n);
|
|
856
856
|
}
|
|
857
857
|
return h(n, t, e);
|
|
858
858
|
}
|
|
@@ -866,8 +866,8 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
866
866
|
throw new TypeError(
|
|
867
867
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof n
|
|
868
868
|
);
|
|
869
|
-
if (
|
|
870
|
-
return
|
|
869
|
+
if (rt(n, ArrayBuffer) || n && rt(n.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (rt(n, SharedArrayBuffer) || n && rt(n.buffer, SharedArrayBuffer)))
|
|
870
|
+
return q(n, t, e);
|
|
871
871
|
if (typeof n == "number")
|
|
872
872
|
throw new TypeError(
|
|
873
873
|
'The "value" argument must not be of type number. Received type number'
|
|
@@ -875,7 +875,7 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
875
875
|
var a = n.valueOf && n.valueOf();
|
|
876
876
|
if (a != null && a !== n)
|
|
877
877
|
return s.from(a, t, e);
|
|
878
|
-
var l =
|
|
878
|
+
var l = Z(n);
|
|
879
879
|
if (l)
|
|
880
880
|
return l;
|
|
881
881
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof n[Symbol.toPrimitive] == "function")
|
|
@@ -903,33 +903,33 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
903
903
|
s.alloc = function(n, t, e) {
|
|
904
904
|
return y(n, t, e);
|
|
905
905
|
};
|
|
906
|
-
function
|
|
906
|
+
function b(n) {
|
|
907
907
|
return g(n), c(n < 0 ? 0 : w(n) | 0);
|
|
908
908
|
}
|
|
909
909
|
s.allocUnsafe = function(n) {
|
|
910
|
-
return
|
|
910
|
+
return b(n);
|
|
911
911
|
}, s.allocUnsafeSlow = function(n) {
|
|
912
|
-
return
|
|
912
|
+
return b(n);
|
|
913
913
|
};
|
|
914
914
|
function F(n, t) {
|
|
915
915
|
if ((typeof t != "string" || t === "") && (t = "utf8"), !s.isEncoding(t))
|
|
916
916
|
throw new TypeError("Unknown encoding: " + t);
|
|
917
|
-
var e =
|
|
917
|
+
var e = v(n, t) | 0, a = c(e), l = a.write(n, t);
|
|
918
918
|
return l !== e && (a = a.slice(0, l)), a;
|
|
919
919
|
}
|
|
920
|
-
function
|
|
920
|
+
function j(n) {
|
|
921
921
|
for (var t = n.length < 0 ? 0 : w(n.length) | 0, e = c(t), a = 0; a < t; a += 1)
|
|
922
922
|
e[a] = n[a] & 255;
|
|
923
923
|
return e;
|
|
924
924
|
}
|
|
925
925
|
function $(n) {
|
|
926
|
-
if (
|
|
926
|
+
if (rt(n, Uint8Array)) {
|
|
927
927
|
var t = new Uint8Array(n);
|
|
928
|
-
return
|
|
928
|
+
return q(t.buffer, t.byteOffset, t.byteLength);
|
|
929
929
|
}
|
|
930
|
-
return
|
|
930
|
+
return j(n);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function q(n, t, e) {
|
|
933
933
|
if (t < 0 || n.byteLength < t)
|
|
934
934
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
935
935
|
if (n.byteLength < t + (e || 0))
|
|
@@ -937,15 +937,15 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
937
937
|
var a;
|
|
938
938
|
return t === void 0 && e === void 0 ? a = new Uint8Array(n) : e === void 0 ? a = new Uint8Array(n, t) : a = new Uint8Array(n, t, e), Object.setPrototypeOf(a, s.prototype), a;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function Z(n) {
|
|
941
941
|
if (s.isBuffer(n)) {
|
|
942
942
|
var t = w(n.length) | 0, e = c(t);
|
|
943
943
|
return e.length === 0 || n.copy(e, 0, 0, t), e;
|
|
944
944
|
}
|
|
945
945
|
if (n.length !== void 0)
|
|
946
|
-
return typeof n.length != "number" || Ct(n.length) ? c(0) :
|
|
946
|
+
return typeof n.length != "number" || Ct(n.length) ? c(0) : j(n);
|
|
947
947
|
if (n.type === "Buffer" && Array.isArray(n.data))
|
|
948
|
-
return
|
|
948
|
+
return j(n.data);
|
|
949
949
|
}
|
|
950
950
|
function w(n) {
|
|
951
951
|
if (n >= u)
|
|
@@ -958,7 +958,7 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
958
958
|
s.isBuffer = function(t) {
|
|
959
959
|
return t != null && t._isBuffer === !0 && t !== s.prototype;
|
|
960
960
|
}, s.compare = function(t, e) {
|
|
961
|
-
if (
|
|
961
|
+
if (rt(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)), rt(e, Uint8Array) && (e = s.from(e, e.offset, e.byteLength)), !s.isBuffer(t) || !s.isBuffer(e))
|
|
962
962
|
throw new TypeError(
|
|
963
963
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
964
964
|
);
|
|
@@ -999,7 +999,7 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
999
999
|
var l = s.allocUnsafe(e), x = 0;
|
|
1000
1000
|
for (a = 0; a < t.length; ++a) {
|
|
1001
1001
|
var d = t[a];
|
|
1002
|
-
if (
|
|
1002
|
+
if (rt(d, Uint8Array))
|
|
1003
1003
|
x + d.length > l.length ? s.from(d).copy(l, x) : Uint8Array.prototype.set.call(
|
|
1004
1004
|
l,
|
|
1005
1005
|
d,
|
|
@@ -1013,10 +1013,10 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
return l;
|
|
1015
1015
|
};
|
|
1016
|
-
function
|
|
1016
|
+
function v(n, t) {
|
|
1017
1017
|
if (s.isBuffer(n))
|
|
1018
1018
|
return n.length;
|
|
1019
|
-
if (ArrayBuffer.isView(n) ||
|
|
1019
|
+
if (ArrayBuffer.isView(n) || rt(n, ArrayBuffer))
|
|
1020
1020
|
return n.byteLength;
|
|
1021
1021
|
if (typeof n != "string")
|
|
1022
1022
|
throw new TypeError(
|
|
@@ -1033,7 +1033,7 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1033
1033
|
return e;
|
|
1034
1034
|
case "utf8":
|
|
1035
1035
|
case "utf-8":
|
|
1036
|
-
return
|
|
1036
|
+
return V(n).length;
|
|
1037
1037
|
case "ucs2":
|
|
1038
1038
|
case "ucs-2":
|
|
1039
1039
|
case "utf16le":
|
|
@@ -1045,19 +1045,19 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1045
1045
|
return ct(n).length;
|
|
1046
1046
|
default:
|
|
1047
1047
|
if (l)
|
|
1048
|
-
return a ? -1 :
|
|
1048
|
+
return a ? -1 : V(n).length;
|
|
1049
1049
|
t = ("" + t).toLowerCase(), l = !0;
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
|
-
s.byteLength =
|
|
1053
|
-
function
|
|
1052
|
+
s.byteLength = v;
|
|
1053
|
+
function R(n, t, e) {
|
|
1054
1054
|
var a = !1;
|
|
1055
1055
|
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))
|
|
1056
1056
|
return "";
|
|
1057
1057
|
for (n || (n = "utf8"); ; )
|
|
1058
1058
|
switch (n) {
|
|
1059
1059
|
case "hex":
|
|
1060
|
-
return
|
|
1060
|
+
return A(this, t, e);
|
|
1061
1061
|
case "utf8":
|
|
1062
1062
|
case "utf-8":
|
|
1063
1063
|
return m(this, t, e);
|
|
@@ -1067,12 +1067,12 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1067
1067
|
case "binary":
|
|
1068
1068
|
return C(this, t, e);
|
|
1069
1069
|
case "base64":
|
|
1070
|
-
return
|
|
1070
|
+
return X(this, t, e);
|
|
1071
1071
|
case "ucs2":
|
|
1072
1072
|
case "ucs-2":
|
|
1073
1073
|
case "utf16le":
|
|
1074
1074
|
case "utf-16le":
|
|
1075
|
-
return
|
|
1075
|
+
return k(this, t, e);
|
|
1076
1076
|
default:
|
|
1077
1077
|
if (a)
|
|
1078
1078
|
throw new TypeError("Unknown encoding: " + n);
|
|
@@ -1080,7 +1080,7 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
s.prototype._isBuffer = !0;
|
|
1083
|
-
function
|
|
1083
|
+
function H(n, t, e) {
|
|
1084
1084
|
var a = n[t];
|
|
1085
1085
|
n[t] = n[e], n[e] = a;
|
|
1086
1086
|
}
|
|
@@ -1089,34 +1089,34 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1089
1089
|
if (t % 2 !== 0)
|
|
1090
1090
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
1091
1091
|
for (var e = 0; e < t; e += 2)
|
|
1092
|
-
|
|
1092
|
+
H(this, e, e + 1);
|
|
1093
1093
|
return this;
|
|
1094
1094
|
}, s.prototype.swap32 = function() {
|
|
1095
1095
|
var t = this.length;
|
|
1096
1096
|
if (t % 4 !== 0)
|
|
1097
1097
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
1098
1098
|
for (var e = 0; e < t; e += 4)
|
|
1099
|
-
|
|
1099
|
+
H(this, e, e + 3), H(this, e + 1, e + 2);
|
|
1100
1100
|
return this;
|
|
1101
1101
|
}, s.prototype.swap64 = function() {
|
|
1102
1102
|
var t = this.length;
|
|
1103
1103
|
if (t % 8 !== 0)
|
|
1104
1104
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
1105
1105
|
for (var e = 0; e < t; e += 8)
|
|
1106
|
-
|
|
1106
|
+
H(this, e, e + 7), H(this, e + 1, e + 6), H(this, e + 2, e + 5), H(this, e + 3, e + 4);
|
|
1107
1107
|
return this;
|
|
1108
1108
|
}, s.prototype.toString = function() {
|
|
1109
1109
|
var t = this.length;
|
|
1110
|
-
return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) :
|
|
1110
|
+
return t === 0 ? "" : arguments.length === 0 ? m(this, 0, t) : R.apply(this, arguments);
|
|
1111
1111
|
}, s.prototype.toLocaleString = s.prototype.toString, s.prototype.equals = function(t) {
|
|
1112
1112
|
if (!s.isBuffer(t))
|
|
1113
1113
|
throw new TypeError("Argument must be a Buffer");
|
|
1114
1114
|
return this === t ? !0 : s.compare(this, t) === 0;
|
|
1115
1115
|
}, s.prototype.inspect = function() {
|
|
1116
|
-
var t = "", e =
|
|
1116
|
+
var t = "", e = i.INSPECT_MAX_BYTES;
|
|
1117
1117
|
return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
|
|
1118
1118
|
}, p && (s.prototype[p] = s.prototype.inspect), s.prototype.compare = function(t, e, a, l, x) {
|
|
1119
|
-
if (
|
|
1119
|
+
if (rt(t, Uint8Array) && (t = s.from(t, t.offset, t.byteLength)), !s.isBuffer(t))
|
|
1120
1120
|
throw new TypeError(
|
|
1121
1121
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
|
|
1122
1122
|
);
|
|
@@ -1130,14 +1130,14 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1130
1130
|
return 1;
|
|
1131
1131
|
if (e >>>= 0, a >>>= 0, l >>>= 0, x >>>= 0, this === t)
|
|
1132
1132
|
return 0;
|
|
1133
|
-
for (var d = x - l, D = a - e, N = Math.min(d, D), P = this.slice(l, x),
|
|
1134
|
-
if (P[z] !==
|
|
1135
|
-
d = P[z], D =
|
|
1133
|
+
for (var d = x - l, D = a - e, N = Math.min(d, D), P = this.slice(l, x), G = t.slice(e, a), z = 0; z < N; ++z)
|
|
1134
|
+
if (P[z] !== G[z]) {
|
|
1135
|
+
d = P[z], D = G[z];
|
|
1136
1136
|
break;
|
|
1137
1137
|
}
|
|
1138
1138
|
return d < D ? -1 : D < d ? 1 : 0;
|
|
1139
1139
|
};
|
|
1140
|
-
function
|
|
1140
|
+
function W(n, t, e, a, l) {
|
|
1141
1141
|
if (n.length === 0)
|
|
1142
1142
|
return -1;
|
|
1143
1143
|
if (typeof e == "string" ? (a = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, Ct(e) && (e = l ? 0 : n.length - 1), e < 0 && (e = n.length + e), e >= n.length) {
|
|
@@ -1162,22 +1162,22 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1162
1162
|
return -1;
|
|
1163
1163
|
x = 2, d /= 2, D /= 2, e /= 2;
|
|
1164
1164
|
}
|
|
1165
|
-
function N(ee,
|
|
1166
|
-
return x === 1 ? ee[
|
|
1165
|
+
function N(ee, ie) {
|
|
1166
|
+
return x === 1 ? ee[ie] : ee.readUInt16BE(ie * x);
|
|
1167
1167
|
}
|
|
1168
1168
|
var P;
|
|
1169
1169
|
if (l) {
|
|
1170
|
-
var
|
|
1170
|
+
var G = -1;
|
|
1171
1171
|
for (P = e; P < d; P++)
|
|
1172
|
-
if (N(n, P) === N(t,
|
|
1173
|
-
if (
|
|
1174
|
-
return
|
|
1172
|
+
if (N(n, P) === N(t, G === -1 ? 0 : P - G)) {
|
|
1173
|
+
if (G === -1 && (G = P), P - G + 1 === D)
|
|
1174
|
+
return G * x;
|
|
1175
1175
|
} else
|
|
1176
|
-
|
|
1176
|
+
G !== -1 && (P -= P - G), G = -1;
|
|
1177
1177
|
} else
|
|
1178
1178
|
for (e + D > d && (e = d - D), P = e; P >= 0; P--) {
|
|
1179
|
-
for (var z = !0,
|
|
1180
|
-
if (N(n, P +
|
|
1179
|
+
for (var z = !0, _t = 0; _t < D; _t++)
|
|
1180
|
+
if (N(n, P + _t) !== N(t, _t)) {
|
|
1181
1181
|
z = !1;
|
|
1182
1182
|
break;
|
|
1183
1183
|
}
|
|
@@ -1189,9 +1189,9 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1189
1189
|
s.prototype.includes = function(t, e, a) {
|
|
1190
1190
|
return this.indexOf(t, e, a) !== -1;
|
|
1191
1191
|
}, s.prototype.indexOf = function(t, e, a) {
|
|
1192
|
-
return
|
|
1192
|
+
return W(this, t, e, a, !0);
|
|
1193
1193
|
}, s.prototype.lastIndexOf = function(t, e, a) {
|
|
1194
|
-
return
|
|
1194
|
+
return W(this, t, e, a, !1);
|
|
1195
1195
|
};
|
|
1196
1196
|
function ut(n, t, e, a) {
|
|
1197
1197
|
e = Number(e) || 0;
|
|
@@ -1208,16 +1208,16 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1208
1208
|
return d;
|
|
1209
1209
|
}
|
|
1210
1210
|
function ft(n, t, e, a) {
|
|
1211
|
-
return
|
|
1211
|
+
return St(V(t, n.length - e), n, e, a);
|
|
1212
1212
|
}
|
|
1213
1213
|
function st(n, t, e, a) {
|
|
1214
|
-
return
|
|
1214
|
+
return St(Q(t), n, e, a);
|
|
1215
1215
|
}
|
|
1216
1216
|
function pt(n, t, e, a) {
|
|
1217
|
-
return
|
|
1217
|
+
return St(ct(t), n, e, a);
|
|
1218
1218
|
}
|
|
1219
1219
|
function Dt(n, t, e, a) {
|
|
1220
|
-
return
|
|
1220
|
+
return St(tt(t, n.length - e), n, e, a);
|
|
1221
1221
|
}
|
|
1222
1222
|
s.prototype.write = function(t, e, a, l) {
|
|
1223
1223
|
if (e === void 0)
|
|
@@ -1263,15 +1263,15 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1263
1263
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
1264
1264
|
};
|
|
1265
1265
|
};
|
|
1266
|
-
function
|
|
1267
|
-
return t === 0 && e === n.length ?
|
|
1266
|
+
function X(n, t, e) {
|
|
1267
|
+
return t === 0 && e === n.length ? r.fromByteArray(n) : r.fromByteArray(n.slice(t, e));
|
|
1268
1268
|
}
|
|
1269
1269
|
function m(n, t, e) {
|
|
1270
1270
|
e = Math.min(n.length, e);
|
|
1271
1271
|
for (var a = [], l = t; l < e; ) {
|
|
1272
1272
|
var x = n[l], d = null, D = x > 239 ? 4 : x > 223 ? 3 : x > 191 ? 2 : 1;
|
|
1273
1273
|
if (l + D <= e) {
|
|
1274
|
-
var N, P,
|
|
1274
|
+
var N, P, G, z;
|
|
1275
1275
|
switch (D) {
|
|
1276
1276
|
case 1:
|
|
1277
1277
|
x < 128 && (d = x);
|
|
@@ -1283,22 +1283,22 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1283
1283
|
N = n[l + 1], P = n[l + 2], (N & 192) === 128 && (P & 192) === 128 && (z = (x & 15) << 12 | (N & 63) << 6 | P & 63, z > 2047 && (z < 55296 || z > 57343) && (d = z));
|
|
1284
1284
|
break;
|
|
1285
1285
|
case 4:
|
|
1286
|
-
N = n[l + 1], P = n[l + 2],
|
|
1286
|
+
N = n[l + 1], P = n[l + 2], G = n[l + 3], (N & 192) === 128 && (P & 192) === 128 && (G & 192) === 128 && (z = (x & 15) << 18 | (N & 63) << 12 | (P & 63) << 6 | G & 63, z > 65535 && z < 1114112 && (d = z));
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
1289
|
d === null ? (d = 65533, D = 1) : d > 65535 && (d -= 65536, a.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), a.push(d), l += D;
|
|
1290
1290
|
}
|
|
1291
|
-
return
|
|
1291
|
+
return T(a);
|
|
1292
1292
|
}
|
|
1293
|
-
var
|
|
1294
|
-
function
|
|
1293
|
+
var S = 4096;
|
|
1294
|
+
function T(n) {
|
|
1295
1295
|
var t = n.length;
|
|
1296
|
-
if (t <=
|
|
1296
|
+
if (t <= S)
|
|
1297
1297
|
return String.fromCharCode.apply(String, n);
|
|
1298
1298
|
for (var e = "", a = 0; a < t; )
|
|
1299
1299
|
e += String.fromCharCode.apply(
|
|
1300
1300
|
String,
|
|
1301
|
-
n.slice(a, a +=
|
|
1301
|
+
n.slice(a, a += S)
|
|
1302
1302
|
);
|
|
1303
1303
|
return e;
|
|
1304
1304
|
}
|
|
@@ -1316,14 +1316,14 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1316
1316
|
a += String.fromCharCode(n[l]);
|
|
1317
1317
|
return a;
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1319
|
+
function A(n, t, e) {
|
|
1320
1320
|
var a = n.length;
|
|
1321
1321
|
(!t || t < 0) && (t = 0), (!e || e < 0 || e > a) && (e = a);
|
|
1322
1322
|
for (var l = "", x = t; x < e; ++x)
|
|
1323
|
-
l +=
|
|
1323
|
+
l += We[n[x]];
|
|
1324
1324
|
return l;
|
|
1325
1325
|
}
|
|
1326
|
-
function
|
|
1326
|
+
function k(n, t, e) {
|
|
1327
1327
|
for (var a = n.slice(t, e), l = "", x = 0; x < a.length - 1; x += 2)
|
|
1328
1328
|
l += String.fromCharCode(a[x] + a[x + 1] * 256);
|
|
1329
1329
|
return l;
|
|
@@ -1464,13 +1464,13 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1464
1464
|
if (e < 0)
|
|
1465
1465
|
throw new RangeError("Index out of range");
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function J(n, t, e, a, l) {
|
|
1468
1468
|
return t = +t, e = e >>> 0, l || L(n, t, e, 4), o.write(n, t, e, a, 23, 4), e + 4;
|
|
1469
1469
|
}
|
|
1470
1470
|
s.prototype.writeFloatLE = function(t, e, a) {
|
|
1471
|
-
return
|
|
1471
|
+
return J(this, t, e, !0, a);
|
|
1472
1472
|
}, s.prototype.writeFloatBE = function(t, e, a) {
|
|
1473
|
-
return
|
|
1473
|
+
return J(this, t, e, !1, a);
|
|
1474
1474
|
};
|
|
1475
1475
|
function U(n, t, e, a, l) {
|
|
1476
1476
|
return t = +t, e = e >>> 0, l || L(n, t, e, 8), o.write(n, t, e, a, 52, 8), e + 8;
|
|
@@ -1527,15 +1527,15 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1527
1527
|
}
|
|
1528
1528
|
return this;
|
|
1529
1529
|
};
|
|
1530
|
-
var
|
|
1531
|
-
function
|
|
1532
|
-
if (n = n.split("=")[0], n = n.trim().replace(
|
|
1530
|
+
var K = /[^+/0-9A-Za-z-_]/g;
|
|
1531
|
+
function Y(n) {
|
|
1532
|
+
if (n = n.split("=")[0], n = n.trim().replace(K, ""), n.length < 2)
|
|
1533
1533
|
return "";
|
|
1534
1534
|
for (; n.length % 4 !== 0; )
|
|
1535
1535
|
n = n + "=";
|
|
1536
1536
|
return n;
|
|
1537
1537
|
}
|
|
1538
|
-
function
|
|
1538
|
+
function V(n, t) {
|
|
1539
1539
|
t = t || 1 / 0;
|
|
1540
1540
|
for (var e, a = n.length, l = null, x = [], d = 0; d < a; ++d) {
|
|
1541
1541
|
if (e = n.charCodeAt(d), e > 55295 && e < 57344) {
|
|
@@ -1601,34 +1601,34 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1601
1601
|
return x;
|
|
1602
1602
|
}
|
|
1603
1603
|
function ct(n) {
|
|
1604
|
-
return
|
|
1604
|
+
return r.toByteArray(Y(n));
|
|
1605
1605
|
}
|
|
1606
|
-
function
|
|
1606
|
+
function St(n, t, e, a) {
|
|
1607
1607
|
for (var l = 0; l < a && !(l + e >= t.length || l >= n.length); ++l)
|
|
1608
1608
|
t[l + e] = n[l];
|
|
1609
1609
|
return l;
|
|
1610
1610
|
}
|
|
1611
|
-
function
|
|
1611
|
+
function rt(n, t) {
|
|
1612
1612
|
return n instanceof t || n != null && n.constructor != null && n.constructor.name != null && n.constructor.name === t.name;
|
|
1613
1613
|
}
|
|
1614
1614
|
function Ct(n) {
|
|
1615
1615
|
return n !== n;
|
|
1616
1616
|
}
|
|
1617
|
-
var
|
|
1617
|
+
var We = function() {
|
|
1618
1618
|
for (var n = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
|
|
1619
1619
|
for (var a = e * 16, l = 0; l < 16; ++l)
|
|
1620
1620
|
t[a + l] = n[e] + n[l];
|
|
1621
1621
|
return t;
|
|
1622
1622
|
}();
|
|
1623
|
-
})(
|
|
1623
|
+
})(Se);
|
|
1624
1624
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1625
|
-
(function(
|
|
1626
|
-
var o =
|
|
1625
|
+
(function(i, r) {
|
|
1626
|
+
var o = Se, p = o.Buffer;
|
|
1627
1627
|
function u(c, s) {
|
|
1628
1628
|
for (var h in c)
|
|
1629
1629
|
s[h] = c[h];
|
|
1630
1630
|
}
|
|
1631
|
-
p.from && p.alloc && p.allocUnsafe && p.allocUnsafeSlow ?
|
|
1631
|
+
p.from && p.alloc && p.allocUnsafe && p.allocUnsafeSlow ? i.exports = o : (u(o, r), r.Buffer = f);
|
|
1632
1632
|
function f(c, s, h) {
|
|
1633
1633
|
return p(c, s, h);
|
|
1634
1634
|
}
|
|
@@ -1651,22 +1651,22 @@ Vt.write = function(r, i, o, p, u, f) {
|
|
|
1651
1651
|
return o.SlowBuffer(c);
|
|
1652
1652
|
};
|
|
1653
1653
|
})(Rt, Rt.exports);
|
|
1654
|
-
var Kt = Rt.exports,
|
|
1655
|
-
function
|
|
1656
|
-
this._block =
|
|
1654
|
+
var Kt = Rt.exports, Ae = Kt.Buffer;
|
|
1655
|
+
function Tt(i, r) {
|
|
1656
|
+
this._block = Ae.alloc(i), this._finalSize = r, this._blockSize = i, this._len = 0;
|
|
1657
1657
|
}
|
|
1658
|
-
|
|
1659
|
-
typeof
|
|
1660
|
-
for (var o = this._block, p = this._blockSize, u =
|
|
1658
|
+
Tt.prototype.update = function(i, r) {
|
|
1659
|
+
typeof i == "string" && (r = r || "utf8", i = Ae.from(i, r));
|
|
1660
|
+
for (var o = this._block, p = this._blockSize, u = i.length, f = this._len, c = 0; c < u; ) {
|
|
1661
1661
|
for (var s = f % p, h = Math.min(u - c, p - s), g = 0; g < h; g++)
|
|
1662
|
-
o[s + g] =
|
|
1662
|
+
o[s + g] = i[c + g];
|
|
1663
1663
|
f += h, c += h, f % p === 0 && this._update(o);
|
|
1664
1664
|
}
|
|
1665
1665
|
return this._len += u, this;
|
|
1666
1666
|
};
|
|
1667
|
-
|
|
1668
|
-
var
|
|
1669
|
-
this._block[
|
|
1667
|
+
Tt.prototype.digest = function(i) {
|
|
1668
|
+
var r = this._len % this._blockSize;
|
|
1669
|
+
this._block[r] = 128, this._block.fill(0, r + 1), r >= this._finalSize && (this._update(this._block), this._block.fill(0));
|
|
1670
1670
|
var o = this._len * 8;
|
|
1671
1671
|
if (o <= 4294967295)
|
|
1672
1672
|
this._block.writeUInt32BE(o, this._blockSize - 4);
|
|
@@ -1676,54 +1676,54 @@ kt.prototype.digest = function(r) {
|
|
|
1676
1676
|
}
|
|
1677
1677
|
this._update(this._block);
|
|
1678
1678
|
var f = this._hash();
|
|
1679
|
-
return
|
|
1679
|
+
return i ? f.toString(i) : f;
|
|
1680
1680
|
};
|
|
1681
|
-
|
|
1681
|
+
Tt.prototype._update = function() {
|
|
1682
1682
|
throw new Error("_update must be implemented by subclass");
|
|
1683
1683
|
};
|
|
1684
|
-
var Fe =
|
|
1684
|
+
var Fe = Tt, wi = ve, Be = Fe, Ei = Kt.Buffer, bi = [
|
|
1685
1685
|
1518500249,
|
|
1686
1686
|
1859775393,
|
|
1687
1687
|
-1894007588,
|
|
1688
1688
|
-899497514
|
|
1689
|
-
],
|
|
1689
|
+
], vi = new Array(80);
|
|
1690
1690
|
function bt() {
|
|
1691
|
-
this.init(), this._w =
|
|
1691
|
+
this.init(), this._w = vi, Be.call(this, 64, 56);
|
|
1692
1692
|
}
|
|
1693
|
-
|
|
1693
|
+
wi(bt, Be);
|
|
1694
1694
|
bt.prototype.init = function() {
|
|
1695
1695
|
return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
|
|
1696
1696
|
};
|
|
1697
|
-
function
|
|
1698
|
-
return
|
|
1697
|
+
function Si(i) {
|
|
1698
|
+
return i << 1 | i >>> 31;
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return
|
|
1700
|
+
function _i(i) {
|
|
1701
|
+
return i << 5 | i >>> 27;
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1704
|
-
return
|
|
1703
|
+
function Ai(i) {
|
|
1704
|
+
return i << 30 | i >>> 2;
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1707
|
-
return
|
|
1706
|
+
function Fi(i, r, o, p) {
|
|
1707
|
+
return i === 0 ? r & o | ~r & p : i === 2 ? r & o | r & p | o & p : r ^ o ^ p;
|
|
1708
1708
|
}
|
|
1709
|
-
bt.prototype._update = function(
|
|
1710
|
-
for (var
|
|
1711
|
-
|
|
1709
|
+
bt.prototype._update = function(i) {
|
|
1710
|
+
for (var r = this._w, o = this._a | 0, p = this._b | 0, u = this._c | 0, f = this._d | 0, c = this._e | 0, s = 0; s < 16; ++s)
|
|
1711
|
+
r[s] = i.readInt32BE(s * 4);
|
|
1712
1712
|
for (; s < 80; ++s)
|
|
1713
|
-
|
|
1713
|
+
r[s] = Si(r[s - 3] ^ r[s - 8] ^ r[s - 14] ^ r[s - 16]);
|
|
1714
1714
|
for (var h = 0; h < 80; ++h) {
|
|
1715
|
-
var g = ~~(h / 20), y =
|
|
1716
|
-
c = f, f = u, u =
|
|
1715
|
+
var g = ~~(h / 20), y = _i(o) + Fi(g, p, u, f) + c + r[h] + bi[g] | 0;
|
|
1716
|
+
c = f, f = u, u = Ai(p), p = o, o = y;
|
|
1717
1717
|
}
|
|
1718
1718
|
this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0;
|
|
1719
1719
|
};
|
|
1720
1720
|
bt.prototype._hash = function() {
|
|
1721
|
-
var
|
|
1722
|
-
return
|
|
1721
|
+
var i = Ei.allocUnsafe(20);
|
|
1722
|
+
return i.writeInt32BE(this._a | 0, 0), i.writeInt32BE(this._b | 0, 4), i.writeInt32BE(this._c | 0, 8), i.writeInt32BE(this._d | 0, 12), i.writeInt32BE(this._e | 0, 16), i;
|
|
1723
1723
|
};
|
|
1724
|
-
var
|
|
1725
|
-
const
|
|
1726
|
-
var
|
|
1724
|
+
var Bi = bt;
|
|
1725
|
+
const Oi = /* @__PURE__ */ Xt(Bi);
|
|
1726
|
+
var Ii = ve, Oe = Fe, ji = Kt.Buffer, Ti = [
|
|
1727
1727
|
1116352408,
|
|
1728
1728
|
1899447441,
|
|
1729
1729
|
3049323471,
|
|
@@ -1788,73 +1788,73 @@ var Or = ve, Oe = Fe, Ir = Kt.Buffer, jr = [
|
|
|
1788
1788
|
2756734187,
|
|
1789
1789
|
3204031479,
|
|
1790
1790
|
3329325298
|
|
1791
|
-
],
|
|
1791
|
+
], ki = new Array(64);
|
|
1792
1792
|
function vt() {
|
|
1793
|
-
this.init(), this._w =
|
|
1793
|
+
this.init(), this._w = ki, Oe.call(this, 64, 56);
|
|
1794
1794
|
}
|
|
1795
|
-
|
|
1795
|
+
Ii(vt, Oe);
|
|
1796
1796
|
vt.prototype.init = function() {
|
|
1797
1797
|
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;
|
|
1798
1798
|
};
|
|
1799
|
-
function
|
|
1800
|
-
return o ^
|
|
1799
|
+
function Di(i, r, o) {
|
|
1800
|
+
return o ^ i & (r ^ o);
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1803
|
-
return
|
|
1802
|
+
function Ci(i, r, o) {
|
|
1803
|
+
return i & r | o & (i | r);
|
|
1804
1804
|
}
|
|
1805
|
-
function
|
|
1806
|
-
return (
|
|
1805
|
+
function Ui(i) {
|
|
1806
|
+
return (i >>> 2 | i << 30) ^ (i >>> 13 | i << 19) ^ (i >>> 22 | i << 10);
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1809
|
-
return (
|
|
1808
|
+
function $i(i) {
|
|
1809
|
+
return (i >>> 6 | i << 26) ^ (i >>> 11 | i << 21) ^ (i >>> 25 | i << 7);
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1812
|
-
return (
|
|
1811
|
+
function Ni(i) {
|
|
1812
|
+
return (i >>> 7 | i << 25) ^ (i >>> 18 | i << 14) ^ i >>> 3;
|
|
1813
1813
|
}
|
|
1814
|
-
function
|
|
1815
|
-
return (
|
|
1814
|
+
function Mi(i) {
|
|
1815
|
+
return (i >>> 17 | i << 15) ^ (i >>> 19 | i << 13) ^ i >>> 10;
|
|
1816
1816
|
}
|
|
1817
|
-
vt.prototype._update = function(
|
|
1818
|
-
for (var
|
|
1819
|
-
|
|
1817
|
+
vt.prototype._update = function(i) {
|
|
1818
|
+
for (var r = this._w, o = this._a | 0, p = this._b | 0, u = this._c | 0, f = this._d | 0, c = this._e | 0, s = this._f | 0, h = this._g | 0, g = this._h | 0, y = 0; y < 16; ++y)
|
|
1819
|
+
r[y] = i.readInt32BE(y * 4);
|
|
1820
1820
|
for (; y < 64; ++y)
|
|
1821
|
-
|
|
1822
|
-
for (var
|
|
1823
|
-
var F = g +
|
|
1824
|
-
g = h, h = s, s = c, c = f + F | 0, f = u, u = p, p = o, o = F +
|
|
1821
|
+
r[y] = Mi(r[y - 2]) + r[y - 7] + Ni(r[y - 15]) + r[y - 16] | 0;
|
|
1822
|
+
for (var b = 0; b < 64; ++b) {
|
|
1823
|
+
var F = g + $i(c) + Di(c, s, h) + Ti[b] + r[b] | 0, j = Ui(o) + Ci(o, p, u) | 0;
|
|
1824
|
+
g = h, h = s, s = c, c = f + F | 0, f = u, u = p, p = o, o = F + j | 0;
|
|
1825
1825
|
}
|
|
1826
1826
|
this._a = o + this._a | 0, this._b = p + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = c + this._e | 0, this._f = s + this._f | 0, this._g = h + this._g | 0, this._h = g + this._h | 0;
|
|
1827
1827
|
};
|
|
1828
1828
|
vt.prototype._hash = function() {
|
|
1829
|
-
var
|
|
1830
|
-
return
|
|
1829
|
+
var i = ji.allocUnsafe(32);
|
|
1830
|
+
return i.writeInt32BE(this._a, 0), i.writeInt32BE(this._b, 4), i.writeInt32BE(this._c, 8), i.writeInt32BE(this._d, 12), i.writeInt32BE(this._e, 16), i.writeInt32BE(this._f, 20), i.writeInt32BE(this._g, 24), i.writeInt32BE(this._h, 28), i;
|
|
1831
1831
|
};
|
|
1832
|
-
var
|
|
1833
|
-
const
|
|
1834
|
-
function
|
|
1832
|
+
var Ri = vt;
|
|
1833
|
+
const Li = /* @__PURE__ */ Xt(Ri), Gt = new Error("File system not available.");
|
|
1834
|
+
function Pi(i, r, o) {
|
|
1835
1835
|
throw Gt;
|
|
1836
1836
|
}
|
|
1837
|
-
function Ie(
|
|
1837
|
+
function Ie(i) {
|
|
1838
1838
|
throw Gt;
|
|
1839
1839
|
}
|
|
1840
|
-
function
|
|
1840
|
+
function zi(i) {
|
|
1841
1841
|
throw Gt;
|
|
1842
1842
|
}
|
|
1843
|
-
const
|
|
1844
|
-
sha1:
|
|
1845
|
-
sha256:
|
|
1846
|
-
},
|
|
1847
|
-
if (!["sha1", "sha256"].includes(
|
|
1843
|
+
const qi = async (i) => Ie(), Ji = {
|
|
1844
|
+
sha1: Oi,
|
|
1845
|
+
sha256: Li
|
|
1846
|
+
}, kt = (i, r = "sha1") => {
|
|
1847
|
+
if (!["sha1", "sha256"].includes(r))
|
|
1848
1848
|
throw new Error("Hashing algorithm not supported: Available: sha1, sha256");
|
|
1849
|
-
const o =
|
|
1850
|
-
return new o().update(
|
|
1849
|
+
const o = Ji[r];
|
|
1850
|
+
return new o().update(i).digest("base64");
|
|
1851
1851
|
};
|
|
1852
|
-
function
|
|
1853
|
-
const
|
|
1852
|
+
function Hi(i) {
|
|
1853
|
+
const r = [], o = Object.keys(i);
|
|
1854
1854
|
for (const p of o) {
|
|
1855
|
-
const u =
|
|
1855
|
+
const u = i[p].sort((f, c) => f.index - c.index);
|
|
1856
1856
|
for (let f = 0; f < u.length; f++)
|
|
1857
|
-
u[f].index !== f &&
|
|
1857
|
+
u[f].index !== f && r.push({
|
|
1858
1858
|
message: `Invalid operation index ${u[f].index} at position ${f}`,
|
|
1859
1859
|
details: {
|
|
1860
1860
|
position: f,
|
|
@@ -1863,103 +1863,103 @@ function Hr(r) {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
});
|
|
1865
1865
|
}
|
|
1866
|
-
return
|
|
1866
|
+
return r;
|
|
1867
1867
|
}
|
|
1868
|
-
const je = async (
|
|
1869
|
-
const
|
|
1868
|
+
const je = async (i) => {
|
|
1869
|
+
const r = new oe(), { name: o, revision: p, documentType: u, created: f, lastModified: c } = i, s = {
|
|
1870
1870
|
name: o,
|
|
1871
1871
|
revision: p,
|
|
1872
1872
|
documentType: u,
|
|
1873
1873
|
created: f,
|
|
1874
1874
|
lastModified: c
|
|
1875
1875
|
};
|
|
1876
|
-
return
|
|
1876
|
+
return r.file("header.json", JSON.stringify(s, null, 2)), r.file(
|
|
1877
1877
|
"state.json",
|
|
1878
|
-
JSON.stringify(
|
|
1879
|
-
),
|
|
1880
|
-
const { data: y, ...
|
|
1881
|
-
|
|
1878
|
+
JSON.stringify(i.initialState || {}, null, 2)
|
|
1879
|
+
), r.file("operations.json", JSON.stringify(i.operations, null, 2)), Object.keys(i.attachments).forEach((g) => {
|
|
1880
|
+
const { data: y, ...b } = i.attachments[g];
|
|
1881
|
+
r.file(g, y, {
|
|
1882
1882
|
base64: !0,
|
|
1883
1883
|
createFolders: !0,
|
|
1884
|
-
comment: JSON.stringify(
|
|
1884
|
+
comment: JSON.stringify(b)
|
|
1885
1885
|
});
|
|
1886
|
-
}),
|
|
1887
|
-
},
|
|
1888
|
-
await (await je(
|
|
1886
|
+
}), r;
|
|
1887
|
+
}, Wi = async (i, r, o, p) => {
|
|
1888
|
+
await (await je(i)).generateAsync({
|
|
1889
1889
|
type: "uint8array",
|
|
1890
1890
|
streamFiles: !0
|
|
1891
1891
|
});
|
|
1892
|
-
const f = p ??
|
|
1893
|
-
return
|
|
1894
|
-
|
|
1892
|
+
const f = p ?? i.name, c = `.${o}.zip`;
|
|
1893
|
+
return Pi(
|
|
1894
|
+
r,
|
|
1895
1895
|
f.endsWith(c) ? f : `${f}${c}`
|
|
1896
1896
|
);
|
|
1897
|
-
},
|
|
1898
|
-
const p = await (await je(
|
|
1897
|
+
}, yr = async (i, r) => {
|
|
1898
|
+
const p = await (await je(i)).generateAsync({ type: "blob" }), u = await r.createWritable();
|
|
1899
1899
|
await u.write(p), await u.close();
|
|
1900
|
-
},
|
|
1900
|
+
}, re = async (i, r, o) => {
|
|
1901
1901
|
const p = Ie();
|
|
1902
|
-
return
|
|
1903
|
-
},
|
|
1902
|
+
return Xi(p, r, o);
|
|
1903
|
+
}, Xi = async (i, r, o) => {
|
|
1904
1904
|
const p = new oe();
|
|
1905
|
-
return await p.loadAsync(
|
|
1905
|
+
return await p.loadAsync(i), Vi(p, r, o);
|
|
1906
1906
|
};
|
|
1907
|
-
async function
|
|
1908
|
-
const p =
|
|
1907
|
+
async function Vi(i, r, o) {
|
|
1908
|
+
const p = i.file("state.json");
|
|
1909
1909
|
if (!p)
|
|
1910
1910
|
throw new Error("Initial state not found");
|
|
1911
|
-
const u = await p.async("string"), f = JSON.parse(u), c =
|
|
1911
|
+
const u = await p.async("string"), f = JSON.parse(u), c = i.file("header.json");
|
|
1912
1912
|
let s;
|
|
1913
1913
|
c && (s = JSON.parse(await c.async("string")));
|
|
1914
|
-
const h =
|
|
1914
|
+
const h = i.file("operations.json");
|
|
1915
1915
|
if (!h)
|
|
1916
1916
|
throw new Error("Operations history not found");
|
|
1917
1917
|
const g = JSON.parse(
|
|
1918
1918
|
await h.async("string")
|
|
1919
|
-
), y =
|
|
1919
|
+
), y = Hi(g);
|
|
1920
1920
|
if (y.length) {
|
|
1921
|
-
const F = y.map((
|
|
1921
|
+
const F = y.map((j) => j.message);
|
|
1922
1922
|
throw new Error(F.join(`
|
|
1923
1923
|
`));
|
|
1924
1924
|
}
|
|
1925
|
-
let
|
|
1925
|
+
let b = Re(
|
|
1926
1926
|
f,
|
|
1927
1927
|
g,
|
|
1928
|
-
|
|
1928
|
+
r,
|
|
1929
1929
|
void 0,
|
|
1930
1930
|
s,
|
|
1931
1931
|
{},
|
|
1932
1932
|
o
|
|
1933
1933
|
);
|
|
1934
|
-
return s && (
|
|
1935
|
-
...
|
|
1934
|
+
return s && (b = {
|
|
1935
|
+
...b,
|
|
1936
1936
|
...s
|
|
1937
|
-
}),
|
|
1937
|
+
}), b;
|
|
1938
1938
|
}
|
|
1939
|
-
function
|
|
1940
|
-
const
|
|
1941
|
-
return { extension:
|
|
1939
|
+
function Te(i) {
|
|
1940
|
+
const r = i.replace(/^.*\./, "") || void 0, o = i.replace(/^.*[/\\]/, "") || void 0;
|
|
1941
|
+
return { extension: r, fileName: o };
|
|
1942
1942
|
}
|
|
1943
|
-
async function
|
|
1944
|
-
const { buffer:
|
|
1943
|
+
async function wr(i) {
|
|
1944
|
+
const { buffer: r, mimeType: o = "application/octet-stream" } = await zi(), p = Te(i), u = r.toString("base64");
|
|
1945
1945
|
return {
|
|
1946
1946
|
data: u,
|
|
1947
|
-
hash:
|
|
1947
|
+
hash: kt(u),
|
|
1948
1948
|
mimeType: o,
|
|
1949
1949
|
...p
|
|
1950
1950
|
};
|
|
1951
1951
|
}
|
|
1952
|
-
async function
|
|
1953
|
-
const
|
|
1954
|
-
return { data: u, hash:
|
|
1952
|
+
async function Er(i) {
|
|
1953
|
+
const r = await qi(), o = li.getType(i) || "application/octet-stream", p = Te(i), u = r.toString("base64");
|
|
1954
|
+
return { data: u, hash: kt(u), mimeType: o, ...p };
|
|
1955
1955
|
}
|
|
1956
|
-
var
|
|
1957
|
-
function Zt(
|
|
1958
|
-
const
|
|
1956
|
+
var ke = /* @__PURE__ */ ((i) => (i.UNEXPECTED_INDEX = "UNEXPECTED_INDEX", i))(ke || {}), De = /* @__PURE__ */ ((i) => (i.DUPLICATED_INDEX = "DUPLICATED_INDEX", i.MISSING_INDEX = "MISSING_INDEX", i))(De || {});
|
|
1957
|
+
function Zt(i) {
|
|
1958
|
+
const r = [];
|
|
1959
1959
|
let o = -1;
|
|
1960
|
-
for (const p of
|
|
1960
|
+
for (const p of i) {
|
|
1961
1961
|
const u = p.index - p.skip;
|
|
1962
|
-
u !== o + 1 &&
|
|
1962
|
+
u !== o + 1 && r.push({
|
|
1963
1963
|
operation: {
|
|
1964
1964
|
index: p.index,
|
|
1965
1965
|
skip: p.skip
|
|
@@ -1969,30 +1969,30 @@ function Zt(r) {
|
|
|
1969
1969
|
message: `Expected index ${o + 1} with skip 0 or equivalent, got index ${p.index} with skip ${p.skip}`
|
|
1970
1970
|
}), o = p.index;
|
|
1971
1971
|
}
|
|
1972
|
-
return
|
|
1972
|
+
return r;
|
|
1973
1973
|
}
|
|
1974
|
-
function ot(
|
|
1974
|
+
function ot(i) {
|
|
1975
1975
|
var p, u, f;
|
|
1976
|
-
const
|
|
1977
|
-
let o =
|
|
1976
|
+
const r = [];
|
|
1977
|
+
let o = i.length - 1;
|
|
1978
1978
|
for (; o > -1; ) {
|
|
1979
|
-
|
|
1980
|
-
const c = (((p =
|
|
1979
|
+
r.unshift(i[o]);
|
|
1980
|
+
const c = (((p = i[o]) == null ? void 0 : p.index) || 0) - (((u = i[o]) == null ? void 0 : u.skip) || 0) - 1;
|
|
1981
1981
|
let s = o - 1;
|
|
1982
|
-
for (; s > -1 && (((f =
|
|
1982
|
+
for (; s > -1 && (((f = i[s]) == null ? void 0 : f.index) || 0) > c; )
|
|
1983
1983
|
s--;
|
|
1984
1984
|
o = s;
|
|
1985
1985
|
}
|
|
1986
|
-
return
|
|
1986
|
+
return r;
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1989
|
-
const
|
|
1990
|
-
return o && (o.type === "NOOP" ?
|
|
1988
|
+
function Ki(i) {
|
|
1989
|
+
const r = [...i], o = r[r.length - 1];
|
|
1990
|
+
return o && (o.type === "NOOP" ? r.push({
|
|
1991
1991
|
...o,
|
|
1992
1992
|
index: o.index,
|
|
1993
1993
|
type: "NOOP",
|
|
1994
|
-
skip: $e(
|
|
1995
|
-
}) :
|
|
1994
|
+
skip: $e(i)
|
|
1995
|
+
}) : r.push({
|
|
1996
1996
|
type: "NOOP",
|
|
1997
1997
|
index: o.index + 1,
|
|
1998
1998
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -2000,29 +2000,29 @@ function Vr(r) {
|
|
|
2000
2000
|
skip: 1,
|
|
2001
2001
|
scope: o.scope,
|
|
2002
2002
|
hash: o.hash
|
|
2003
|
-
})),
|
|
2003
|
+
})), r;
|
|
2004
2004
|
}
|
|
2005
|
-
function at(
|
|
2006
|
-
return
|
|
2005
|
+
function at(i) {
|
|
2006
|
+
return i.slice().sort((r, o) => r.skip - o.skip).sort((r, o) => r.index - o.index);
|
|
2007
2007
|
}
|
|
2008
|
-
const
|
|
2008
|
+
const Gi = (i, r, o) => [...r, ...o].sort(
|
|
2009
2009
|
(p, u) => new Date(p.timestamp).getTime() - new Date(u.timestamp).getTime()
|
|
2010
2010
|
).map((p, u) => ({
|
|
2011
2011
|
...p,
|
|
2012
|
-
index:
|
|
2013
|
-
skip: u === 0 ?
|
|
2014
|
-
})),
|
|
2012
|
+
index: i.index + u,
|
|
2013
|
+
skip: u === 0 ? i.skip : 0
|
|
2014
|
+
})), Zi = (i, r, o) => [...r, ...o].sort(
|
|
2015
2015
|
(p, u) => new Date(p.timestamp).getTime() - new Date(u.timestamp).getTime()
|
|
2016
2016
|
).sort((p, u) => p.index - u.index).map((p, u) => ({
|
|
2017
2017
|
...p,
|
|
2018
|
-
index:
|
|
2019
|
-
skip: u === 0 ?
|
|
2018
|
+
index: i.index + u,
|
|
2019
|
+
skip: u === 0 ? i.skip : 0
|
|
2020
2020
|
}));
|
|
2021
|
-
function Yt(
|
|
2022
|
-
return xt(
|
|
2021
|
+
function Yt(i, r) {
|
|
2022
|
+
return xt(i) === xt(r);
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2025
|
-
const o = ot(at(
|
|
2024
|
+
function Yi(i, r) {
|
|
2025
|
+
const o = ot(at(i.slice())), p = ot(at(r.slice()));
|
|
2026
2026
|
if (o.length < 1)
|
|
2027
2027
|
return [p, []];
|
|
2028
2028
|
const u = [];
|
|
@@ -2045,25 +2045,25 @@ function Zr(r, i) {
|
|
|
2045
2045
|
}
|
|
2046
2046
|
return [ot(u), o];
|
|
2047
2047
|
}
|
|
2048
|
-
function Ce(
|
|
2049
|
-
return
|
|
2048
|
+
function Ce(i, r) {
|
|
2049
|
+
return i.index < r.index || i.index === r.index && i.skip < r.skip;
|
|
2050
2050
|
}
|
|
2051
|
-
function Ue(
|
|
2051
|
+
function Ue(i, r) {
|
|
2052
2052
|
const o = [], p = [], u = [], f = Math.max(
|
|
2053
|
-
|
|
2054
|
-
|
|
2053
|
+
i.length,
|
|
2054
|
+
r.length
|
|
2055
2055
|
);
|
|
2056
2056
|
let c = !1;
|
|
2057
2057
|
for (let s = 0; s < f; s++) {
|
|
2058
|
-
const h =
|
|
2058
|
+
const h = i[s], g = r[s];
|
|
2059
2059
|
h && g ? !c && Yt(h, g) ? o.push(h) : (c = !0, p.push(h), u.push(g)) : h ? p.push(h) : g && u.push(g);
|
|
2060
2060
|
}
|
|
2061
2061
|
return [o, p, u];
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2063
|
+
function Qi(i, r, o) {
|
|
2064
2064
|
const [p, u, f] = Ue(
|
|
2065
|
-
ot(
|
|
2066
|
-
ot(
|
|
2065
|
+
ot(i),
|
|
2066
|
+
ot(r)
|
|
2067
2067
|
), c = $t(p), s = 1 + Math.max(
|
|
2068
2068
|
c,
|
|
2069
2069
|
$t(u),
|
|
@@ -2078,31 +2078,31 @@ function Yr(r, i, o) {
|
|
|
2078
2078
|
);
|
|
2079
2079
|
return p.concat(h);
|
|
2080
2080
|
}
|
|
2081
|
-
function $t(
|
|
2082
|
-
const
|
|
2083
|
-
return
|
|
2081
|
+
function $t(i) {
|
|
2082
|
+
const r = i[i.length - 1];
|
|
2083
|
+
return r ? r.index : -1;
|
|
2084
2084
|
}
|
|
2085
|
-
function $e(
|
|
2085
|
+
function $e(i) {
|
|
2086
2086
|
var p, u, f;
|
|
2087
|
-
if (
|
|
2087
|
+
if (i.length < 1)
|
|
2088
2088
|
return -1;
|
|
2089
|
-
const
|
|
2090
|
-
let o = (((p =
|
|
2091
|
-
return
|
|
2089
|
+
const r = ot(i);
|
|
2090
|
+
let o = (((p = r[r.length - 1]) == null ? void 0 : p.skip) || 0) + 1;
|
|
2091
|
+
return r.length > 1 && (o += ((u = r[r.length - 2]) == null ? void 0 : u.skip) || 0), (((f = r[r.length - 1]) == null ? void 0 : f.index) || -1) < o ? -1 : o;
|
|
2092
2092
|
}
|
|
2093
|
-
const
|
|
2094
|
-
ot(at(
|
|
2095
|
-
),
|
|
2093
|
+
const tr = (i) => Zt(
|
|
2094
|
+
ot(at(i))
|
|
2095
|
+
), er = (i) => i.reduce((o, p) => {
|
|
2096
2096
|
var u;
|
|
2097
2097
|
return o[p.scope] || (o[p.scope] = []), (u = o[p.scope]) == null || u.push(p), o;
|
|
2098
|
-
}, {}),
|
|
2098
|
+
}, {}), ir = (i, r) => {
|
|
2099
2099
|
var h;
|
|
2100
2100
|
const o = {
|
|
2101
2101
|
integrityIssues: [],
|
|
2102
2102
|
validOperations: [],
|
|
2103
2103
|
invalidOperations: [],
|
|
2104
2104
|
duplicatedOperations: []
|
|
2105
|
-
}, p = at(
|
|
2105
|
+
}, p = at(i), u = at(r), f = Zt([
|
|
2106
2106
|
...p,
|
|
2107
2107
|
...u
|
|
2108
2108
|
]), s = (h = [...f.filter(
|
|
@@ -2114,7 +2114,7 @@ const Qr = (r) => Zt(
|
|
|
2114
2114
|
o.invalidOperations.push(g);
|
|
2115
2115
|
continue;
|
|
2116
2116
|
}
|
|
2117
|
-
if (f.some((
|
|
2117
|
+
if (f.some((b) => b.operation.index === g.index && b.operation.skip === g.skip && b.category === "DUPLICATED_INDEX")) {
|
|
2118
2118
|
o.duplicatedOperations.push(g);
|
|
2119
2119
|
continue;
|
|
2120
2120
|
}
|
|
@@ -2122,25 +2122,25 @@ const Qr = (r) => Zt(
|
|
|
2122
2122
|
}
|
|
2123
2123
|
return o.integrityIssues.push(...f), o;
|
|
2124
2124
|
};
|
|
2125
|
-
function
|
|
2126
|
-
return
|
|
2125
|
+
function rr(i, r) {
|
|
2126
|
+
return i.filter((o) => !r.some((p) => o.type === "NOOP" && o.skip === 0 && o.index === p.index || o.index === p.index && o.skip === p.skip && o.scope === p.scope && o.hash === p.hash && o.type === p.type));
|
|
2127
2127
|
}
|
|
2128
|
-
function Ne(
|
|
2129
|
-
const [o] = at(
|
|
2130
|
-
...
|
|
2131
|
-
index:
|
|
2128
|
+
function Ne(i, r) {
|
|
2129
|
+
const [o] = at(i).slice(-1), p = (o == null ? void 0 : o.index) ?? -1, u = p + 1, f = {
|
|
2130
|
+
...r,
|
|
2131
|
+
index: r.index ?? u
|
|
2132
2132
|
};
|
|
2133
2133
|
if (f.index < p)
|
|
2134
2134
|
throw new Error(
|
|
2135
2135
|
`The skip header operation index must be greater than or equal to ${p}`
|
|
2136
2136
|
);
|
|
2137
2137
|
return (ot(
|
|
2138
|
-
at([...
|
|
2138
|
+
at([...i, f])
|
|
2139
2139
|
) || []).slice(0, -1);
|
|
2140
2140
|
}
|
|
2141
|
-
function Lt(
|
|
2141
|
+
function Lt(i) {
|
|
2142
2142
|
return {
|
|
2143
|
-
...Object.entries(
|
|
2143
|
+
...Object.entries(i).reduce(
|
|
2144
2144
|
(o, p) => {
|
|
2145
2145
|
const [u, f] = p;
|
|
2146
2146
|
return {
|
|
@@ -2152,60 +2152,57 @@ function Lt(r) {
|
|
|
2152
2152
|
)
|
|
2153
2153
|
};
|
|
2154
2154
|
}
|
|
2155
|
-
const
|
|
2155
|
+
const br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2156
2156
|
__proto__: null,
|
|
2157
2157
|
IntegrityIssueSubType: De,
|
|
2158
|
-
IntegrityIssueType:
|
|
2159
|
-
addUndo:
|
|
2160
|
-
attachBranch:
|
|
2158
|
+
IntegrityIssueType: ke,
|
|
2159
|
+
addUndo: Ki,
|
|
2160
|
+
attachBranch: Yi,
|
|
2161
2161
|
checkCleanedOperationsIntegrity: Zt,
|
|
2162
|
-
checkOperationsIntegrity:
|
|
2162
|
+
checkOperationsIntegrity: tr,
|
|
2163
2163
|
garbageCollect: ot,
|
|
2164
|
-
|
|
2165
|
-
groupOperationsByScope:
|
|
2166
|
-
merge:
|
|
2164
|
+
garbageCollectDocumentOperations: Lt,
|
|
2165
|
+
groupOperationsByScope: er,
|
|
2166
|
+
merge: Qi,
|
|
2167
2167
|
nextSkipNumber: $e,
|
|
2168
2168
|
operationsAreEqual: Yt,
|
|
2169
2169
|
precedes: Ce,
|
|
2170
|
-
prepareOperations:
|
|
2171
|
-
removeExistingOperations:
|
|
2172
|
-
reshuffleByTimestamp:
|
|
2173
|
-
reshuffleByTimestampAndIndex:
|
|
2170
|
+
prepareOperations: ir,
|
|
2171
|
+
removeExistingOperations: rr,
|
|
2172
|
+
reshuffleByTimestamp: Gi,
|
|
2173
|
+
reshuffleByTimestampAndIndex: Zi,
|
|
2174
2174
|
skipHeaderOperations: Ne,
|
|
2175
2175
|
sortOperations: at,
|
|
2176
2176
|
split: Ue
|
|
2177
2177
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2178
|
-
function
|
|
2178
|
+
function nr(i, r) {
|
|
2179
2179
|
let o;
|
|
2180
|
-
return "index" in
|
|
2180
|
+
return "index" in r ? o = { ...r } : o = i.operations[r.scope].at(-1), ((o == null ? void 0 : o.index) ?? -1) + 1;
|
|
2181
2181
|
}
|
|
2182
|
-
function
|
|
2182
|
+
function or(i, r) {
|
|
2183
2183
|
return {
|
|
2184
|
-
...
|
|
2184
|
+
...i,
|
|
2185
2185
|
revision: {
|
|
2186
|
-
...
|
|
2187
|
-
[
|
|
2186
|
+
...i.revision,
|
|
2187
|
+
[r.scope]: nr(i, r)
|
|
2188
2188
|
},
|
|
2189
2189
|
lastModified: (/* @__PURE__ */ new Date()).toISOString()
|
|
2190
2190
|
};
|
|
2191
2191
|
}
|
|
2192
|
-
function
|
|
2193
|
-
if ([wt, Et, It].includes(
|
|
2194
|
-
return
|
|
2195
|
-
const { scope: p } =
|
|
2196
|
-
0,
|
|
2197
|
-
r.revision[p]
|
|
2198
|
-
), f = [...u].pop();
|
|
2192
|
+
function ar(i, r, o = 0) {
|
|
2193
|
+
if ([wt, Et, It].includes(r.type))
|
|
2194
|
+
return i;
|
|
2195
|
+
const { scope: p } = r, u = i.operations[p].slice(), f = u.at(-1);
|
|
2199
2196
|
let c = ((f == null ? void 0 : f.index) ?? -1) + 1;
|
|
2200
|
-
if ("index" in
|
|
2201
|
-
if (
|
|
2197
|
+
if ("index" in r) {
|
|
2198
|
+
if (r.index - o > c)
|
|
2202
2199
|
throw new Error(
|
|
2203
|
-
`Missing operations: expected ${c} with skip 0 or equivalent, got index ${
|
|
2200
|
+
`Missing operations: expected ${c} with skip 0 or equivalent, got index ${r.index} with skip ${o}`
|
|
2204
2201
|
);
|
|
2205
|
-
c =
|
|
2202
|
+
c = r.index;
|
|
2206
2203
|
}
|
|
2207
2204
|
return u.push({
|
|
2208
|
-
...
|
|
2205
|
+
...r,
|
|
2209
2206
|
index: c,
|
|
2210
2207
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2211
2208
|
hash: "",
|
|
@@ -2213,124 +2210,152 @@ function oi(r, i, o = 0) {
|
|
|
2213
2210
|
skip: o,
|
|
2214
2211
|
error: void 0
|
|
2215
2212
|
}), {
|
|
2216
|
-
...
|
|
2217
|
-
operations: { ...
|
|
2213
|
+
...i,
|
|
2214
|
+
operations: { ...i.operations, [p]: u }
|
|
2218
2215
|
};
|
|
2219
2216
|
}
|
|
2220
|
-
function
|
|
2221
|
-
let p =
|
|
2222
|
-
return p =
|
|
2217
|
+
function sr(i, r, o = 0) {
|
|
2218
|
+
let p = ar(i, r, o);
|
|
2219
|
+
return p = or(p, r), p;
|
|
2223
2220
|
}
|
|
2224
|
-
function
|
|
2225
|
-
switch (fe().parse(
|
|
2221
|
+
function pr(i, r, o) {
|
|
2222
|
+
switch (fe().parse(r), r.type) {
|
|
2226
2223
|
case we:
|
|
2227
|
-
return
|
|
2224
|
+
return ri(i, r.input);
|
|
2228
2225
|
case It:
|
|
2229
|
-
return
|
|
2226
|
+
return ai(i, r, o);
|
|
2230
2227
|
case Ee:
|
|
2231
|
-
return
|
|
2228
|
+
return si(i, r.input.state);
|
|
2232
2229
|
default:
|
|
2233
|
-
return
|
|
2230
|
+
return i;
|
|
2234
2231
|
}
|
|
2235
2232
|
}
|
|
2236
|
-
function
|
|
2237
|
-
switch (
|
|
2233
|
+
function vr(i, r, o) {
|
|
2234
|
+
switch (r.type) {
|
|
2238
2235
|
case wt:
|
|
2239
|
-
return
|
|
2236
|
+
return ni(i, r, o);
|
|
2240
2237
|
case Et:
|
|
2241
|
-
return
|
|
2238
|
+
return oi(i, r, o);
|
|
2242
2239
|
default:
|
|
2243
|
-
return { document:
|
|
2240
|
+
return { document: i, action: r, skip: o };
|
|
2244
2241
|
}
|
|
2245
2242
|
}
|
|
2246
|
-
function
|
|
2247
|
-
const
|
|
2248
|
-
if (!
|
|
2249
|
-
return
|
|
2250
|
-
const
|
|
2243
|
+
function cr(i, r, o, p, u = !1, f = Le) {
|
|
2244
|
+
const c = r.scope, s = i.operations[c].at(-1);
|
|
2245
|
+
if (!s)
|
|
2246
|
+
return i;
|
|
2247
|
+
const h = Lt(
|
|
2251
2248
|
{
|
|
2252
|
-
...
|
|
2253
|
-
[
|
|
2254
|
-
|
|
2255
|
-
|
|
2249
|
+
...i.operations,
|
|
2250
|
+
[c]: Ne(
|
|
2251
|
+
i.operations[c],
|
|
2252
|
+
s
|
|
2256
2253
|
)
|
|
2257
2254
|
}
|
|
2258
|
-
), { state: s } = Pt(
|
|
2259
|
-
r.initialState,
|
|
2260
|
-
c,
|
|
2261
|
-
o,
|
|
2262
|
-
void 0,
|
|
2263
|
-
void 0,
|
|
2264
|
-
void 0
|
|
2265
2255
|
);
|
|
2256
|
+
let g;
|
|
2257
|
+
const y = h[c].at(-1);
|
|
2258
|
+
if (u && (y != null && y.resultingState))
|
|
2259
|
+
g = f(
|
|
2260
|
+
y.resultingState
|
|
2261
|
+
);
|
|
2262
|
+
else {
|
|
2263
|
+
const { state: b } = Pt(
|
|
2264
|
+
i.initialState,
|
|
2265
|
+
h,
|
|
2266
|
+
o,
|
|
2267
|
+
void 0,
|
|
2268
|
+
void 0,
|
|
2269
|
+
void 0,
|
|
2270
|
+
void 0,
|
|
2271
|
+
{
|
|
2272
|
+
reuseHash: !0,
|
|
2273
|
+
reuseOperationResultingState: u,
|
|
2274
|
+
operationResultingStateParser: f
|
|
2275
|
+
}
|
|
2276
|
+
);
|
|
2277
|
+
g = b[c];
|
|
2278
|
+
}
|
|
2266
2279
|
return {
|
|
2267
|
-
...
|
|
2268
|
-
state:
|
|
2280
|
+
...i,
|
|
2281
|
+
state: {
|
|
2282
|
+
...i.state,
|
|
2283
|
+
[c]: g
|
|
2284
|
+
},
|
|
2269
2285
|
operations: Lt({
|
|
2270
|
-
...
|
|
2286
|
+
...i.operations
|
|
2271
2287
|
})
|
|
2272
2288
|
};
|
|
2273
2289
|
}
|
|
2274
|
-
function Me(
|
|
2275
|
-
const {
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2290
|
+
function Me(i, r, o, p, u = {}) {
|
|
2291
|
+
const {
|
|
2292
|
+
skip: f,
|
|
2293
|
+
ignoreSkipOperations: c = !1,
|
|
2294
|
+
reuseHash: s = !1,
|
|
2295
|
+
reuseOperationResultingState: h = !1,
|
|
2296
|
+
operationResultingStateParser: g
|
|
2297
|
+
} = u, y = { ...r }, b = f || 0;
|
|
2298
|
+
let F = { ...i };
|
|
2299
|
+
const j = !c && (b > 0 || "index" in y && y.skip > 0);
|
|
2300
|
+
return ne(y) && (F = pr(F, y, o)), F = sr(F, y, b), j && (F = cr(
|
|
2301
|
+
F,
|
|
2279
2302
|
y,
|
|
2303
|
+
o,
|
|
2304
|
+
b,
|
|
2280
2305
|
h,
|
|
2281
|
-
|
|
2282
|
-
)),
|
|
2306
|
+
g
|
|
2307
|
+
)), F = Ot(F, ($) => {
|
|
2283
2308
|
try {
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2286
|
-
|
|
2309
|
+
const q = o(
|
|
2310
|
+
$.state,
|
|
2311
|
+
y,
|
|
2287
2312
|
p
|
|
2288
2313
|
);
|
|
2289
|
-
if (
|
|
2314
|
+
if (q)
|
|
2290
2315
|
return Bt({
|
|
2291
|
-
...
|
|
2316
|
+
...F,
|
|
2292
2317
|
// clipboard: [...clipboardValue],
|
|
2293
|
-
state:
|
|
2318
|
+
state: q
|
|
2294
2319
|
});
|
|
2295
|
-
} catch (
|
|
2296
|
-
const
|
|
2297
|
-
|
|
2298
|
-
...
|
|
2299
|
-
[
|
|
2300
|
-
...
|
|
2320
|
+
} catch (q) {
|
|
2321
|
+
const Z = F.operations[y.scope].length - 1;
|
|
2322
|
+
$.operations[y.scope][Z].error = q.message, $.operations[y.scope][Z].skip = 0, j && ($.state = Bt({ ...i.state }), $.operations = Bt({
|
|
2323
|
+
...i.operations,
|
|
2324
|
+
[y.scope]: [
|
|
2325
|
+
...i.operations[y.scope],
|
|
2301
2326
|
{
|
|
2302
|
-
|
|
2327
|
+
...$.operations[y.scope][Z]
|
|
2303
2328
|
}
|
|
2304
2329
|
]
|
|
2305
2330
|
}));
|
|
2306
2331
|
}
|
|
2307
|
-
}), Ot(
|
|
2308
|
-
if ([wt, Et, It].includes(
|
|
2309
|
-
return
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
const { hash:
|
|
2313
|
-
|
|
2314
|
-
...
|
|
2332
|
+
}), Ot(F, ($) => {
|
|
2333
|
+
if ([wt, Et, It].includes(y.type))
|
|
2334
|
+
return $;
|
|
2335
|
+
const q = y.scope || "global", Z = s && Object.prototype.hasOwnProperty.call(y, "hash") ? y.hash : Qt($, q);
|
|
2336
|
+
$.operations[q][$.operations[q].length - 1].hash = Z, !ne(y) && y.attachments && y.attachments.forEach((w) => {
|
|
2337
|
+
const { hash: E, ...v } = w;
|
|
2338
|
+
$.attachments[E] = {
|
|
2339
|
+
...v
|
|
2315
2340
|
};
|
|
2316
2341
|
});
|
|
2317
2342
|
});
|
|
2318
2343
|
}
|
|
2319
|
-
function
|
|
2320
|
-
return
|
|
2344
|
+
function Sr(i) {
|
|
2345
|
+
return i.type === pi && i.skip !== void 0 && i.skip > 0 && i.hash !== void 0;
|
|
2321
2346
|
}
|
|
2322
|
-
function
|
|
2323
|
-
return [wt, Et].includes(
|
|
2347
|
+
function _r(i) {
|
|
2348
|
+
return [wt, Et].includes(i.type);
|
|
2324
2349
|
}
|
|
2325
|
-
function ne(
|
|
2326
|
-
return [we, wt, Et, It, Ee].includes(
|
|
2350
|
+
function ne(i) {
|
|
2351
|
+
return [we, wt, Et, It, Ee].includes(i.type);
|
|
2327
2352
|
}
|
|
2328
|
-
function dt(
|
|
2329
|
-
if (!
|
|
2353
|
+
function dt(i, r, o, p, u = "global") {
|
|
2354
|
+
if (!i)
|
|
2330
2355
|
throw new Error("Empty action type");
|
|
2331
|
-
if (typeof
|
|
2332
|
-
throw new Error(`Invalid action type: ${JSON.stringify(
|
|
2333
|
-
const f = { type:
|
|
2356
|
+
if (typeof i != "string")
|
|
2357
|
+
throw new Error(`Invalid action type: ${JSON.stringify(i)}`);
|
|
2358
|
+
const f = { type: i, input: r, scope: u };
|
|
2334
2359
|
o && (f.attachments = o);
|
|
2335
2360
|
try {
|
|
2336
2361
|
p == null || p().parse(f.input);
|
|
@@ -2339,10 +2364,10 @@ function dt(r, i, o, p, u = "global") {
|
|
|
2339
2364
|
}
|
|
2340
2365
|
return f;
|
|
2341
2366
|
}
|
|
2342
|
-
function
|
|
2343
|
-
return (o, p, u, f) =>
|
|
2367
|
+
function lr(i, r = Me) {
|
|
2368
|
+
return (o, p, u, f) => r(o, p, i, u, f);
|
|
2344
2369
|
}
|
|
2345
|
-
const
|
|
2370
|
+
const ur = (i, r) => ({
|
|
2346
2371
|
name: "",
|
|
2347
2372
|
documentType: "",
|
|
2348
2373
|
revision: {
|
|
@@ -2352,12 +2377,12 @@ const li = (r, i) => ({
|
|
|
2352
2377
|
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2353
2378
|
lastModified: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2354
2379
|
attachments: {},
|
|
2355
|
-
...
|
|
2356
|
-
state: (
|
|
2357
|
-
}),
|
|
2358
|
-
const o =
|
|
2359
|
-
|
|
2360
|
-
|
|
2380
|
+
...i,
|
|
2381
|
+
state: (r == null ? void 0 : r(i == null ? void 0 : i.state)) ?? (i == null ? void 0 : i.state) ?? { global: {}, local: {} }
|
|
2382
|
+
}), fr = (i, r) => {
|
|
2383
|
+
const o = ur(
|
|
2384
|
+
i,
|
|
2385
|
+
r
|
|
2361
2386
|
);
|
|
2362
2387
|
return {
|
|
2363
2388
|
...o,
|
|
@@ -2365,16 +2390,16 @@ const li = (r, i) => ({
|
|
|
2365
2390
|
operations: { global: [], local: [] },
|
|
2366
2391
|
clipboard: []
|
|
2367
2392
|
};
|
|
2368
|
-
}, Qt = (
|
|
2369
|
-
const o = Math.random() *
|
|
2370
|
-
return
|
|
2393
|
+
}, Qt = (i, r = "global") => kt(xt(i.state[r] || "")), Ar = (i, r = 1e3) => {
|
|
2394
|
+
const o = Math.random() * r;
|
|
2395
|
+
return kt(`${(i ?? /* @__PURE__ */ new Date()).toISOString()}${o}`);
|
|
2371
2396
|
};
|
|
2372
|
-
function Ft(
|
|
2373
|
-
return
|
|
2397
|
+
function Ft(i) {
|
|
2398
|
+
return Ke(Ge(i, !0));
|
|
2374
2399
|
}
|
|
2375
|
-
function
|
|
2376
|
-
const o = [...
|
|
2377
|
-
let p =
|
|
2400
|
+
function Fr(i, r) {
|
|
2401
|
+
const o = [...i];
|
|
2402
|
+
let p = r || 0, u = o.length > 0 ? o[o.length - 1].index : 0;
|
|
2378
2403
|
const f = [];
|
|
2379
2404
|
for (const c of o.reverse()) {
|
|
2380
2405
|
if (p > 0) {
|
|
@@ -2395,9 +2420,9 @@ function Si(r, i) {
|
|
|
2395
2420
|
}
|
|
2396
2421
|
return f.reverse();
|
|
2397
2422
|
}
|
|
2398
|
-
function
|
|
2399
|
-
const p =
|
|
2400
|
-
let u = o, f = 0, c =
|
|
2423
|
+
function Br(i, r, o) {
|
|
2424
|
+
const p = i.slice().sort((s, h) => s.skip - h.skip).sort((s, h) => s.index - h.index);
|
|
2425
|
+
let u = o, f = 0, c = r;
|
|
2401
2426
|
for (const s of p.reverse()) {
|
|
2402
2427
|
const h = c - s.index;
|
|
2403
2428
|
if (u = u - h, u > -1)
|
|
@@ -2407,21 +2432,21 @@ function Fi(r, i, o) {
|
|
|
2407
2432
|
}
|
|
2408
2433
|
return f;
|
|
2409
2434
|
}
|
|
2410
|
-
function
|
|
2411
|
-
return Object.values(
|
|
2412
|
-
(
|
|
2435
|
+
function Or(i) {
|
|
2436
|
+
return Object.values(i).flatMap((r) => r).sort(
|
|
2437
|
+
(r, o) => new Date(r.timestamp).getTime() - new Date(o.timestamp).getTime()
|
|
2413
2438
|
);
|
|
2414
2439
|
}
|
|
2415
|
-
function
|
|
2416
|
-
return Object.values(
|
|
2417
|
-
(
|
|
2440
|
+
function Ir(i) {
|
|
2441
|
+
return Object.values(i).flatMap((r) => r).sort(
|
|
2442
|
+
(r, o) => new Date(r.operation.timestamp).getTime() - new Date(o.operation.timestamp).getTime()
|
|
2418
2443
|
);
|
|
2419
2444
|
}
|
|
2420
|
-
function Pt(
|
|
2421
|
-
const h =
|
|
2445
|
+
function Pt(i, r, o, p, u, f = Me, c = {}, s) {
|
|
2446
|
+
const h = lr(o, f);
|
|
2422
2447
|
return Re(
|
|
2423
|
-
r,
|
|
2424
2448
|
i,
|
|
2449
|
+
r,
|
|
2425
2450
|
h,
|
|
2426
2451
|
p,
|
|
2427
2452
|
u,
|
|
@@ -2429,109 +2454,160 @@ function Pt(r, i, o, p, u, f = Me, c = {}, s) {
|
|
|
2429
2454
|
s
|
|
2430
2455
|
);
|
|
2431
2456
|
}
|
|
2432
|
-
function Re(
|
|
2433
|
-
const
|
|
2434
|
-
|
|
2457
|
+
function Re(i, r, o, p, u, f = {}, c) {
|
|
2458
|
+
const {
|
|
2459
|
+
checkHashes: s = !0,
|
|
2460
|
+
reuseOperationResultingState: h,
|
|
2461
|
+
operationResultingStateParser: g = Le
|
|
2462
|
+
} = c || {};
|
|
2463
|
+
let y = i;
|
|
2464
|
+
const b = [], F = {
|
|
2465
|
+
global: [],
|
|
2466
|
+
local: []
|
|
2467
|
+
};
|
|
2468
|
+
if (h)
|
|
2469
|
+
for (const [w, E] of Object.entries(r)) {
|
|
2470
|
+
const v = E.findLastIndex(
|
|
2471
|
+
(H) => !!H.resultingState
|
|
2472
|
+
);
|
|
2473
|
+
if (v < 0) {
|
|
2474
|
+
b.push(...E);
|
|
2475
|
+
continue;
|
|
2476
|
+
}
|
|
2477
|
+
const R = E[v];
|
|
2478
|
+
try {
|
|
2479
|
+
const H = g(
|
|
2480
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion
|
|
2481
|
+
R.resultingState
|
|
2482
|
+
);
|
|
2483
|
+
y = {
|
|
2484
|
+
...y,
|
|
2485
|
+
state: {
|
|
2486
|
+
...y.state,
|
|
2487
|
+
// TODO how to deal with attachments?
|
|
2488
|
+
[w]: H
|
|
2489
|
+
}
|
|
2490
|
+
}, F[w].push(
|
|
2491
|
+
...E.slice(0, v + 1)
|
|
2492
|
+
), b.push(...E.slice(v + 1));
|
|
2493
|
+
} catch {
|
|
2494
|
+
b.push(...E);
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
else
|
|
2498
|
+
b.push(...Object.values(r).flat());
|
|
2499
|
+
const j = fr(y);
|
|
2500
|
+
j.initialState = i, j.operations = F;
|
|
2501
|
+
const $ = b.reduce((w, E) => o(w, E, p, {
|
|
2502
|
+
skip: E.skip,
|
|
2435
2503
|
ignoreSkipOperations: !0,
|
|
2436
2504
|
reuseHash: !s
|
|
2437
|
-
}),
|
|
2505
|
+
}), j);
|
|
2438
2506
|
if (!s)
|
|
2439
|
-
for (const
|
|
2440
|
-
for (let
|
|
2441
|
-
const
|
|
2442
|
-
if (
|
|
2443
|
-
if (
|
|
2444
|
-
throw new Error(`Hash mismatch for scope ${
|
|
2507
|
+
for (const w of Object.keys($.state))
|
|
2508
|
+
for (let E = b.length - 1; E >= 0; E--) {
|
|
2509
|
+
const v = b[E];
|
|
2510
|
+
if (v.scope === w) {
|
|
2511
|
+
if (v.hash !== Qt($, w))
|
|
2512
|
+
throw new Error(`Hash mismatch for scope ${w}`);
|
|
2445
2513
|
break;
|
|
2446
2514
|
}
|
|
2447
2515
|
}
|
|
2448
|
-
const
|
|
2449
|
-
|
|
2516
|
+
const q = Object.keys(
|
|
2517
|
+
$.operations
|
|
2450
2518
|
).reduce(
|
|
2451
|
-
(
|
|
2452
|
-
const
|
|
2519
|
+
(w, E) => {
|
|
2520
|
+
const v = E;
|
|
2453
2521
|
return {
|
|
2454
|
-
...
|
|
2455
|
-
[
|
|
2456
|
-
|
|
2457
|
-
var
|
|
2522
|
+
...w,
|
|
2523
|
+
[v]: [
|
|
2524
|
+
...$.operations[v].map((R, H) => {
|
|
2525
|
+
var W;
|
|
2458
2526
|
return {
|
|
2459
|
-
...
|
|
2460
|
-
timestamp: ((
|
|
2527
|
+
...R,
|
|
2528
|
+
timestamp: ((W = r[v][H]) == null ? void 0 : W.timestamp) ?? R.timestamp
|
|
2461
2529
|
};
|
|
2462
2530
|
})
|
|
2463
2531
|
]
|
|
2464
2532
|
};
|
|
2465
2533
|
},
|
|
2466
2534
|
{ global: [], local: [] }
|
|
2467
|
-
),
|
|
2468
|
-
const
|
|
2469
|
-
return (
|
|
2470
|
-
},
|
|
2471
|
-
return {
|
|
2472
|
-
}
|
|
2473
|
-
function
|
|
2474
|
-
return xt(
|
|
2475
|
-
}
|
|
2476
|
-
|
|
2535
|
+
), Z = Object.values(q).reduce((w, E) => {
|
|
2536
|
+
const v = E[E.length - 1];
|
|
2537
|
+
return (v == null ? void 0 : v.timestamp) > w && (w = v.timestamp), w;
|
|
2538
|
+
}, i.lastModified);
|
|
2539
|
+
return { ...$, operations: q, lastModified: Z };
|
|
2540
|
+
}
|
|
2541
|
+
function jr(i, r) {
|
|
2542
|
+
return xt(i) === xt(r);
|
|
2543
|
+
}
|
|
2544
|
+
function Le(i) {
|
|
2545
|
+
const r = typeof i;
|
|
2546
|
+
if (r === "string")
|
|
2547
|
+
return JSON.parse(i);
|
|
2548
|
+
if (r === "object")
|
|
2549
|
+
return i;
|
|
2550
|
+
throw new Error(`Providing resulting state is of type: ${r}`);
|
|
2551
|
+
}
|
|
2552
|
+
const Pe = (i) => dt(
|
|
2477
2553
|
"SET_NAME",
|
|
2478
|
-
|
|
2554
|
+
i,
|
|
2479
2555
|
void 0,
|
|
2480
|
-
|
|
2556
|
+
Ht,
|
|
2481
2557
|
void 0
|
|
2482
|
-
),
|
|
2558
|
+
), ze = (i = 1, r = "global") => dt(
|
|
2483
2559
|
"UNDO",
|
|
2484
|
-
|
|
2560
|
+
i,
|
|
2485
2561
|
void 0,
|
|
2486
2562
|
Wt,
|
|
2487
|
-
|
|
2488
|
-
),
|
|
2563
|
+
r
|
|
2564
|
+
), qe = (i = 1, r = "global") => dt(
|
|
2489
2565
|
"REDO",
|
|
2490
|
-
|
|
2566
|
+
i,
|
|
2491
2567
|
void 0,
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
),
|
|
2568
|
+
Jt,
|
|
2569
|
+
r
|
|
2570
|
+
), Je = (i, r, o = "global") => dt(
|
|
2495
2571
|
"PRUNE",
|
|
2496
|
-
{ start:
|
|
2572
|
+
{ start: i, end: r },
|
|
2497
2573
|
void 0,
|
|
2498
2574
|
qt,
|
|
2499
2575
|
o
|
|
2500
|
-
), te = (
|
|
2576
|
+
), te = (i, r) => dt(
|
|
2501
2577
|
"LOAD_STATE",
|
|
2502
|
-
{ state:
|
|
2578
|
+
{ state: i, operations: r },
|
|
2503
2579
|
void 0,
|
|
2504
2580
|
zt
|
|
2505
|
-
), He = (
|
|
2581
|
+
), He = (i = "global") => dt("NOOP", {}, void 0, void 0, i), Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2506
2582
|
__proto__: null,
|
|
2507
2583
|
loadState: te,
|
|
2508
2584
|
noop: He,
|
|
2509
|
-
prune:
|
|
2510
|
-
redo:
|
|
2511
|
-
setName:
|
|
2512
|
-
undo:
|
|
2585
|
+
prune: Je,
|
|
2586
|
+
redo: qe,
|
|
2587
|
+
setName: Pe,
|
|
2588
|
+
undo: ze
|
|
2513
2589
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2514
|
-
class
|
|
2590
|
+
class kr {
|
|
2515
2591
|
/**
|
|
2516
2592
|
* Constructs a BaseDocument instance with an initial state.
|
|
2517
2593
|
* @param reducer - The reducer function that updates the state.
|
|
2518
2594
|
* @param document - The initial state of the document.
|
|
2519
2595
|
*/
|
|
2520
|
-
constructor(
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
this._reducer =
|
|
2596
|
+
constructor(r, o, p) {
|
|
2597
|
+
At(this, "_document");
|
|
2598
|
+
At(this, "_reducer");
|
|
2599
|
+
At(this, "_signalDispatch");
|
|
2600
|
+
this._reducer = r, this._document = o, this._signalDispatch = p;
|
|
2525
2601
|
}
|
|
2526
2602
|
/**
|
|
2527
2603
|
* Dispatches an action to update the state of the document.
|
|
2528
2604
|
* @param action - The action to dispatch.
|
|
2529
2605
|
* @returns The Document instance.
|
|
2530
2606
|
*/
|
|
2531
|
-
dispatch(
|
|
2607
|
+
dispatch(r, o) {
|
|
2532
2608
|
return this._document = this._reducer(
|
|
2533
2609
|
this._document,
|
|
2534
|
-
|
|
2610
|
+
r,
|
|
2535
2611
|
this._signalDispatch,
|
|
2536
2612
|
o
|
|
2537
2613
|
), this;
|
|
@@ -2542,15 +2618,15 @@ class ki {
|
|
|
2542
2618
|
* @param extension - The file extension to use when saving the state.
|
|
2543
2619
|
* @returns The file path where the state was saved.
|
|
2544
2620
|
*/
|
|
2545
|
-
saveToFile(
|
|
2546
|
-
return
|
|
2621
|
+
saveToFile(r, o, p) {
|
|
2622
|
+
return Wi(this._document, r, o, p);
|
|
2547
2623
|
}
|
|
2548
2624
|
/**
|
|
2549
2625
|
* Loads the state of the document from a file.
|
|
2550
2626
|
* @param path - The file path where the state is stored.
|
|
2551
2627
|
*/
|
|
2552
|
-
async loadFromFile(
|
|
2553
|
-
this._document = await
|
|
2628
|
+
async loadFromFile(r) {
|
|
2629
|
+
this._document = await re(r, this._reducer);
|
|
2554
2630
|
}
|
|
2555
2631
|
/**
|
|
2556
2632
|
* Loads the state of the document from a file and returns it.
|
|
@@ -2558,8 +2634,8 @@ class ki {
|
|
|
2558
2634
|
* @param reducer - The reducer function that updates the state.
|
|
2559
2635
|
* @returns The state of the document.
|
|
2560
2636
|
*/
|
|
2561
|
-
static async stateFromFile(
|
|
2562
|
-
return await
|
|
2637
|
+
static async stateFromFile(r, o) {
|
|
2638
|
+
return await re(r, o);
|
|
2563
2639
|
}
|
|
2564
2640
|
/**
|
|
2565
2641
|
* Gets the current state of the document.
|
|
@@ -2603,8 +2679,8 @@ class ki {
|
|
|
2603
2679
|
get revision() {
|
|
2604
2680
|
return this._document.revision.global;
|
|
2605
2681
|
}
|
|
2606
|
-
getRevision(
|
|
2607
|
-
return this._document.revision[
|
|
2682
|
+
getRevision(r) {
|
|
2683
|
+
return this._document.revision[r];
|
|
2608
2684
|
}
|
|
2609
2685
|
/**
|
|
2610
2686
|
* Gets the initial state of the document.
|
|
@@ -2622,53 +2698,53 @@ class ki {
|
|
|
2622
2698
|
* Gets the attachment associated with the given key.
|
|
2623
2699
|
* @param attachment - The key of the attachment to retrieve.
|
|
2624
2700
|
*/
|
|
2625
|
-
getAttachment(
|
|
2626
|
-
return this._document.attachments[
|
|
2701
|
+
getAttachment(r) {
|
|
2702
|
+
return this._document.attachments[r];
|
|
2627
2703
|
}
|
|
2628
2704
|
/**
|
|
2629
2705
|
* Sets the name of the document.
|
|
2630
2706
|
* @param name - The new name of the document.
|
|
2631
2707
|
*/
|
|
2632
|
-
setName(
|
|
2633
|
-
return this.dispatch(
|
|
2708
|
+
setName(r) {
|
|
2709
|
+
return this.dispatch(Pe(r)), this;
|
|
2634
2710
|
}
|
|
2635
2711
|
/**
|
|
2636
2712
|
* Reverts a number of actions from the document.
|
|
2637
2713
|
* @param count - The number of actions to revert.
|
|
2638
2714
|
*/
|
|
2639
|
-
undo(
|
|
2640
|
-
return this.dispatch(
|
|
2715
|
+
undo(r) {
|
|
2716
|
+
return this.dispatch(ze(r)), this;
|
|
2641
2717
|
}
|
|
2642
2718
|
/**
|
|
2643
2719
|
* Reapplies a number of actions to the document.
|
|
2644
2720
|
* @param count - The number of actions to reapply.
|
|
2645
2721
|
*/
|
|
2646
|
-
redo(
|
|
2647
|
-
return this.dispatch(
|
|
2722
|
+
redo(r) {
|
|
2723
|
+
return this.dispatch(qe(r)), this;
|
|
2648
2724
|
}
|
|
2649
2725
|
/**
|
|
2650
2726
|
* Removes a range of operations from the document.
|
|
2651
2727
|
* @param start - The starting index of the range to remove.
|
|
2652
2728
|
* @param end - The ending index of the range to remove.
|
|
2653
2729
|
*/
|
|
2654
|
-
prune(
|
|
2655
|
-
return this.dispatch(
|
|
2730
|
+
prune(r, o) {
|
|
2731
|
+
return this.dispatch(Je(r, o)), this;
|
|
2656
2732
|
}
|
|
2657
2733
|
/**
|
|
2658
2734
|
* Loads a document state and a set of operations.
|
|
2659
2735
|
* @param state - The state to load.
|
|
2660
2736
|
* @param operations - The operations to apply to the document.
|
|
2661
2737
|
*/
|
|
2662
|
-
loadState(
|
|
2663
|
-
return this.dispatch(te(
|
|
2738
|
+
loadState(r, o) {
|
|
2739
|
+
return this.dispatch(te(r, o)), this;
|
|
2664
2740
|
}
|
|
2665
2741
|
}
|
|
2666
|
-
function
|
|
2667
|
-
|
|
2742
|
+
function Dr(i, r) {
|
|
2743
|
+
r.forEach((o) => {
|
|
2668
2744
|
Object.getOwnPropertyNames(o.prototype).forEach((p) => {
|
|
2669
2745
|
Object.defineProperty(
|
|
2670
2746
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2671
|
-
|
|
2747
|
+
i.prototype,
|
|
2672
2748
|
p,
|
|
2673
2749
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
2674
2750
|
Object.getOwnPropertyDescriptor(o.prototype, p) || /* @__PURE__ */ Object.create(null)
|
|
@@ -2677,36 +2753,37 @@ function Ti(r, i) {
|
|
|
2677
2753
|
});
|
|
2678
2754
|
}
|
|
2679
2755
|
export {
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2756
|
+
Ir as A,
|
|
2757
|
+
kr as B,
|
|
2758
|
+
Or as C,
|
|
2759
|
+
Hi as D,
|
|
2760
|
+
Me as E,
|
|
2761
|
+
vr as F,
|
|
2762
|
+
gr as G,
|
|
2763
|
+
ur as a,
|
|
2764
|
+
fr as b,
|
|
2765
|
+
lr as c,
|
|
2766
|
+
yr as d,
|
|
2767
|
+
Xi as e,
|
|
2691
2768
|
dt as f,
|
|
2692
|
-
|
|
2693
|
-
|
|
2769
|
+
Dr as g,
|
|
2770
|
+
Tr as h,
|
|
2694
2771
|
ne as i,
|
|
2695
|
-
|
|
2772
|
+
Br as j,
|
|
2696
2773
|
je as k,
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2774
|
+
re as l,
|
|
2775
|
+
br as m,
|
|
2776
|
+
Er as n,
|
|
2777
|
+
wr as o,
|
|
2701
2778
|
Qt as p,
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2779
|
+
Ar as q,
|
|
2780
|
+
Sr as r,
|
|
2781
|
+
Wi as s,
|
|
2782
|
+
jr as t,
|
|
2783
|
+
_r as u,
|
|
2784
|
+
Fr as v,
|
|
2785
|
+
Le as w,
|
|
2786
|
+
Ft as x,
|
|
2787
|
+
Re as y,
|
|
2788
|
+
Pt as z
|
|
2712
2789
|
};
|