pptx-svelte-viewer 2.20.3 → 2.20.5
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/CHANGELOG.md +12 -0
- package/dist/{AiChatPanel-BSSU_rdb.js → AiChatPanel-gUaCLYgo.js} +471 -467
- package/dist/{GLTFLoader-CAjQhVgN.js → GLTFLoader-9vQ_XShd.js} +43 -44
- package/dist/{OrbitControls-B2ezETBF.js → OrbitControls-DRqFov_0.js} +5 -9
- package/dist/{awareness-CkFlr7xx.js → awareness-CrSnuSE_.js} +1 -1
- package/dist/{export-Cg11dsXy.js → export-BJ59Rfa6.js} +20375 -20292
- package/dist/index.js +1 -1
- package/dist/{smartart-3d-BLqXYusO.js → smartart-3d-CX2GnyTe.js} +2 -2
- package/dist/{three.module-BLwnGxzY.js → three.module-BAfeCwYa.js} +890 -868
- package/dist/viewer/collab/collaboration-remote-sync.d.ts +2 -2
- package/dist/viewer/collab/collaboration-remote-sync.d.ts.map +1 -1
- package/dist/viewer/collab/collaboration.svelte.d.ts +2 -2
- package/dist/viewer/collab/collaboration.svelte.d.ts.map +1 -1
- package/dist/viewer/index.d.ts +41 -2
- package/dist/viewer/index.js +1 -1
- package/dist/viewer/state/presentation-loader.svelte.d.ts +8 -2
- package/dist/viewer/state/presentation-loader.svelte.d.ts.map +1 -1
- package/dist/viewer/state/viewer-effects.svelte.d.ts.map +1 -1
- package/dist/{y-webrtc-Cph8DzuM.js → y-webrtc-Ctru8jg8.js} +37 -38
- package/dist/y-websocket-BgHVdw-O.js +125 -0
- package/dist/{yjs-CE9F053g.js → yjs-DbU20bpp.js} +383 -385
- package/package.json +6 -6
- package/dist/y-websocket-C6aE1Dkp.js +0 -115
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
const t =
|
|
1
|
+
var O = () => /* @__PURE__ */ new Map(), me = (e) => {
|
|
2
|
+
const t = O();
|
|
3
3
|
return e.forEach((r, n) => {
|
|
4
4
|
t.set(n, r);
|
|
5
5
|
}), t;
|
|
@@ -27,7 +27,7 @@ var T = () => /* @__PURE__ */ new Map(), me = (e) => {
|
|
|
27
27
|
return r;
|
|
28
28
|
}, zt = Array.isArray, bs = class {
|
|
29
29
|
constructor() {
|
|
30
|
-
this._observers =
|
|
30
|
+
this._observers = O();
|
|
31
31
|
}
|
|
32
32
|
on(e, t) {
|
|
33
33
|
return J(this._observers, e, K).add(t), t;
|
|
@@ -43,14 +43,14 @@ var T = () => /* @__PURE__ */ new Map(), me = (e) => {
|
|
|
43
43
|
r !== void 0 && (r.delete(t), r.size === 0 && this._observers.delete(e));
|
|
44
44
|
}
|
|
45
45
|
emit(e, t) {
|
|
46
|
-
return Y((this._observers.get(e) ||
|
|
46
|
+
return Y((this._observers.get(e) || O()).values()).forEach((r) => r(...t));
|
|
47
47
|
}
|
|
48
48
|
destroy() {
|
|
49
|
-
this._observers =
|
|
49
|
+
this._observers = O();
|
|
50
50
|
}
|
|
51
|
-
},
|
|
51
|
+
}, Lo = class {
|
|
52
52
|
constructor() {
|
|
53
|
-
this._observers =
|
|
53
|
+
this._observers = O();
|
|
54
54
|
}
|
|
55
55
|
on(e, t) {
|
|
56
56
|
J(this._observers, e, K).add(t);
|
|
@@ -66,44 +66,42 @@ var T = () => /* @__PURE__ */ new Map(), me = (e) => {
|
|
|
66
66
|
r !== void 0 && (r.delete(t), r.size === 0 && this._observers.delete(e));
|
|
67
67
|
}
|
|
68
68
|
emit(e, t) {
|
|
69
|
-
return Y((this._observers.get(e) ||
|
|
69
|
+
return Y((this._observers.get(e) || O()).values()).forEach((r) => r(...t));
|
|
70
70
|
}
|
|
71
71
|
destroy() {
|
|
72
|
-
this._observers =
|
|
72
|
+
this._observers = O();
|
|
73
73
|
}
|
|
74
|
-
},
|
|
75
|
-
throw
|
|
74
|
+
}, V = Math.floor, Tt = Math.abs, $o = Math.log10, Vr = (e, t) => e < t ? e : t, Z = (e, t) => e > t ? e : t, No = Number.isNaN, Mo = Math.pow, Fr = (e) => e !== 0 ? e < 0 : 1 / e < 0, Br = Date.now, F = (e) => new Error(e), M = () => {
|
|
75
|
+
throw F("Method unimplemented");
|
|
76
76
|
}, N = () => {
|
|
77
|
-
throw
|
|
77
|
+
throw F("Unexpected case");
|
|
78
78
|
};
|
|
79
|
-
var Ss =
|
|
80
|
-
var qo = Ss - 1, Zo = Cs - 1, Qo = Es - 1, Po = Ds - 1, tc = As - 1, ec = Is - 1, rc = Ts - 1, nc = Os - 1, sc = xs - 1, ic = Ls - 1, lc = $s - 1, oc = Ns - 1, cc = Ms - 1, ac = Us - 1;
|
|
81
|
-
var hc = crypto.subtle, Rs = crypto.getRandomValues.bind(crypto), uc = Math.random, jr = () => Rs(/* @__PURE__ */ new Uint32Array(1))[0], Bs = "10000000-1000-4000-8000-100000000000", Vs = () => Bs.replace(/[018]/g, (e) => (e ^ jr() & 15 >> e / 4).toString(16)), Rt = Number.MAX_SAFE_INTEGER, fr = Number.MIN_SAFE_INTEGER, Fs = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && B(e) === e), dc = Number.isNaN, fc = Number.parseInt, Be = String.fromCharCode, gc = String.fromCodePoint, pc = Be(65535), js = (e) => e.toLowerCase(), Ys = /^\s*/g, Js = (e) => e.replace(Ys, ""), Xs = /([A-Z])/g, gr = (e, t) => Js(e.replace(Xs, (r) => `${t}${js(r)}`)), Gs = (e) => {
|
|
79
|
+
var Uo = crypto.subtle, Ss = crypto.getRandomValues.bind(crypto), Ro = Math.random, jr = () => Ss(/* @__PURE__ */ new Uint32Array(1))[0], Cs = "10000000-1000-4000-8000-100000000000", Es = () => Cs.replace(/[018]/g, (e) => (e ^ jr() & 15 >> e / 4).toString(16)), Rt = Number.MAX_SAFE_INTEGER, fr = Number.MIN_SAFE_INTEGER, Ds = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && V(e) === e), Vo = Number.isNaN, Fo = Number.parseInt, Ve = String.fromCharCode, Bo = String.fromCodePoint, jo = Ve(65535), As = (e) => e.toLowerCase(), Is = /^\s*/g, Os = (e) => e.replace(Is, ""), xs = /([A-Z])/g, gr = (e, t) => Os(e.replace(xs, (r) => `${t}${As(r)}`)), Ts = (e) => {
|
|
82
80
|
const t = unescape(encodeURIComponent(e)), r = t.length, n = new Uint8Array(r);
|
|
83
81
|
for (let s = 0; s < r; s++) n[s] = t.codePointAt(s);
|
|
84
82
|
return n;
|
|
85
|
-
}, pt = typeof TextEncoder < "u" ? new TextEncoder() : null,
|
|
83
|
+
}, pt = typeof TextEncoder < "u" ? new TextEncoder() : null, Ls = (e) => pt.encode(e), $s = pt ? Ls : Ts, gt = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", {
|
|
86
84
|
fatal: !0,
|
|
87
85
|
ignoreBOM: !0
|
|
88
86
|
});
|
|
89
87
|
gt && gt.decode(/* @__PURE__ */ new Uint8Array()).length === 1 && (gt = null);
|
|
90
|
-
var
|
|
88
|
+
var Ns = (e, t) => _s(t, () => e).join(""), St = class {
|
|
91
89
|
constructor() {
|
|
92
90
|
this.cpos = 0, this.cbuf = /* @__PURE__ */ new Uint8Array(100), this.bufs = [];
|
|
93
91
|
}
|
|
94
|
-
}, Kt = () => new St(),
|
|
92
|
+
}, Kt = () => new St(), Ms = (e) => {
|
|
95
93
|
let t = e.cpos;
|
|
96
94
|
for (let r = 0; r < e.bufs.length; r++) t += e.bufs[r].length;
|
|
97
95
|
return t;
|
|
98
96
|
}, R = (e) => {
|
|
99
|
-
const t = new Uint8Array(
|
|
97
|
+
const t = new Uint8Array(Ms(e));
|
|
100
98
|
let r = 0;
|
|
101
99
|
for (let n = 0; n < e.bufs.length; n++) {
|
|
102
100
|
const s = e.bufs[n];
|
|
103
101
|
t.set(s, r), r += s.length;
|
|
104
102
|
}
|
|
105
103
|
return t.set(new Uint8Array(e.cbuf.buffer, 0, e.cpos), r), t;
|
|
106
|
-
},
|
|
104
|
+
}, Us = (e, t) => {
|
|
107
105
|
const r = e.cbuf.length;
|
|
108
106
|
r - e.cpos < t && (e.bufs.push(new Uint8Array(e.cbuf.buffer, 0, e.cpos)), e.cbuf = new Uint8Array(Z(r, t) * 2), e.cpos = 0);
|
|
109
107
|
}, _ = (e, t) => {
|
|
@@ -111,41 +109,41 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
111
109
|
e.cpos === r && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(r * 2), e.cpos = 0), e.cbuf[e.cpos++] = t;
|
|
112
110
|
}, ye = _, v = (e, t) => {
|
|
113
111
|
for (; t > 127; )
|
|
114
|
-
_(e, 128 | 127 & t), t =
|
|
112
|
+
_(e, 128 | 127 & t), t = V(t / 128);
|
|
115
113
|
_(e, 127 & t);
|
|
116
|
-
},
|
|
117
|
-
const r =
|
|
118
|
-
for (r && (t = -t), _(e, (t > 63 ? 128 : 0) | (r ? 64 : 0) | 63 & t), t =
|
|
119
|
-
_(e, (t > 127 ? 128 : 0) | 127 & t), t =
|
|
120
|
-
}, ke = /* @__PURE__ */ new Uint8Array(3e4),
|
|
121
|
-
if (t.length <
|
|
114
|
+
}, Fe = (e, t) => {
|
|
115
|
+
const r = Fr(t);
|
|
116
|
+
for (r && (t = -t), _(e, (t > 63 ? 128 : 0) | (r ? 64 : 0) | 63 & t), t = V(t / 64); t > 0; )
|
|
117
|
+
_(e, (t > 127 ? 128 : 0) | 127 & t), t = V(t / 128);
|
|
118
|
+
}, ke = /* @__PURE__ */ new Uint8Array(3e4), Rs = ke.length / 3, Vs = (e, t) => {
|
|
119
|
+
if (t.length < Rs) {
|
|
122
120
|
const r = pt.encodeInto(t, ke).written || 0;
|
|
123
121
|
v(e, r);
|
|
124
122
|
for (let n = 0; n < r; n++) _(e, ke[n]);
|
|
125
|
-
} else
|
|
126
|
-
},
|
|
123
|
+
} else x(e, $s(t));
|
|
124
|
+
}, Fs = (e, t) => {
|
|
127
125
|
const r = unescape(encodeURIComponent(t)), n = r.length;
|
|
128
126
|
v(e, n);
|
|
129
127
|
for (let s = 0; s < n; s++) _(e, r.codePointAt(s));
|
|
130
|
-
}, rt = pt && pt.encodeInto ?
|
|
131
|
-
const r = e.cbuf.length, n = e.cpos, s =
|
|
128
|
+
}, rt = pt && pt.encodeInto ? Vs : Fs, Wt = (e, t) => {
|
|
129
|
+
const r = e.cbuf.length, n = e.cpos, s = Vr(r - n, t.length), i = t.length - s;
|
|
132
130
|
e.cbuf.set(t.subarray(0, s), n), e.cpos += s, i > 0 && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(Z(r * 2, i)), e.cbuf.set(t.subarray(s)), e.cpos = i);
|
|
133
|
-
},
|
|
131
|
+
}, x = (e, t) => {
|
|
134
132
|
v(e, t.byteLength), Wt(e, t);
|
|
135
|
-
},
|
|
136
|
-
|
|
133
|
+
}, Be = (e, t) => {
|
|
134
|
+
Us(e, t);
|
|
137
135
|
const r = new DataView(e.cbuf.buffer, e.cpos, t);
|
|
138
136
|
return e.cpos += t, r;
|
|
139
|
-
},
|
|
137
|
+
}, Bs = (e, t) => Be(e, 4).setFloat32(0, t, !1), js = (e, t) => Be(e, 8).setFloat64(0, t, !1), Ys = (e, t) => Be(e, 8).setBigInt64(0, t, !1), pr = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(4)), Js = (e) => (pr.setFloat32(0, e), pr.getFloat32(0) === e), vt = (e, t) => {
|
|
140
138
|
switch (typeof t) {
|
|
141
139
|
case "string":
|
|
142
140
|
_(e, 119), rt(e, t);
|
|
143
141
|
break;
|
|
144
142
|
case "number":
|
|
145
|
-
|
|
143
|
+
Ds(t) && Tt(t) <= 2147483647 ? (_(e, 125), Fe(e, t)) : Js(t) ? (_(e, 124), Bs(e, t)) : (_(e, 123), js(e, t));
|
|
146
144
|
break;
|
|
147
145
|
case "bigint":
|
|
148
|
-
_(e, 122),
|
|
146
|
+
_(e, 122), Ys(e, t);
|
|
149
147
|
break;
|
|
150
148
|
case "object":
|
|
151
149
|
if (t === null) _(e, 126);
|
|
@@ -153,7 +151,7 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
153
151
|
_(e, 117), v(e, t.length);
|
|
154
152
|
for (let r = 0; r < t.length; r++) vt(e, t[r]);
|
|
155
153
|
} else if (t instanceof Uint8Array)
|
|
156
|
-
_(e, 116),
|
|
154
|
+
_(e, 116), x(e, t);
|
|
157
155
|
else {
|
|
158
156
|
_(e, 118);
|
|
159
157
|
const r = Object.keys(t);
|
|
@@ -178,7 +176,7 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
178
176
|
this.s === e ? this.count++ : (this.count > 0 && v(this, this.count - 1), this.count = 1, this.w(this, e), this.s = e);
|
|
179
177
|
}
|
|
180
178
|
}, wr = (e) => {
|
|
181
|
-
e.count > 0 && (
|
|
179
|
+
e.count > 0 && (Fe(e.encoder, e.count === 1 ? e.s : -e.s), e.count > 1 && v(e.encoder, e.count - 2));
|
|
182
180
|
}, Lt = class {
|
|
183
181
|
constructor() {
|
|
184
182
|
this.encoder = new St(), this.s = 0, this.count = 0;
|
|
@@ -192,7 +190,7 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
192
190
|
}, mr = (e) => {
|
|
193
191
|
if (e.count > 0) {
|
|
194
192
|
const t = e.diff * 2 + (e.count === 1 ? 0 : 1);
|
|
195
|
-
|
|
193
|
+
Fe(e.encoder, t), e.count > 1 && v(e.encoder, e.count - 2);
|
|
196
194
|
}
|
|
197
195
|
}, ae = class {
|
|
198
196
|
constructor() {
|
|
@@ -204,7 +202,7 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
204
202
|
toUint8Array() {
|
|
205
203
|
return mr(this), R(this.encoder);
|
|
206
204
|
}
|
|
207
|
-
},
|
|
205
|
+
}, Xs = class {
|
|
208
206
|
constructor() {
|
|
209
207
|
this.sarr = [], this.s = "", this.lensE = new Lt();
|
|
210
208
|
}
|
|
@@ -215,14 +213,14 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
215
213
|
const e = new St();
|
|
216
214
|
return this.sarr.push(this.s), this.s = "", rt(e, this.sarr.join("")), Wt(e, this.lensE.toUint8Array()), R(e);
|
|
217
215
|
}
|
|
218
|
-
}, Yr =
|
|
216
|
+
}, Yr = F("Unexpected end of array"), Jr = F("Integer out of Range"), qt = class {
|
|
219
217
|
constructor(e) {
|
|
220
218
|
this.arr = e, this.pos = 0;
|
|
221
219
|
}
|
|
222
|
-
}, ht = (e) => new qt(e),
|
|
220
|
+
}, ht = (e) => new qt(e), Gs = (e) => e.pos !== e.arr.length, Hs = (e, t) => {
|
|
223
221
|
const r = new Uint8Array(e.arr.buffer, e.pos + e.arr.byteOffset, t);
|
|
224
222
|
return e.pos += t, r;
|
|
225
|
-
},
|
|
223
|
+
}, T = (e) => Hs(e, p(e)), lt = (e) => e.arr[e.pos++], p = (e) => {
|
|
226
224
|
let t = 0, r = 1;
|
|
227
225
|
const n = e.arr.length;
|
|
228
226
|
for (; e.pos < n; ) {
|
|
@@ -241,7 +239,7 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
241
239
|
if (r > Rt) throw Jr;
|
|
242
240
|
}
|
|
243
241
|
throw Yr;
|
|
244
|
-
},
|
|
242
|
+
}, zs = (e) => {
|
|
245
243
|
let t = p(e);
|
|
246
244
|
if (t === 0) return "";
|
|
247
245
|
{
|
|
@@ -253,17 +251,17 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
253
251
|
}
|
|
254
252
|
return decodeURIComponent(escape(r));
|
|
255
253
|
}
|
|
256
|
-
},
|
|
254
|
+
}, Ks = (e) => gt.decode(T(e)), nt = gt ? Ks : zs, Ye = (e, t) => {
|
|
257
255
|
const r = new DataView(e.arr.buffer, e.arr.byteOffset + e.pos, t);
|
|
258
256
|
return e.pos += t, r;
|
|
259
|
-
},
|
|
257
|
+
}, Ws = (e) => Ye(e, 4).getFloat32(0, !1), qs = (e) => Ye(e, 8).getFloat64(0, !1), Zs = (e) => Ye(e, 8).getBigInt64(0, !1), Qs = [
|
|
260
258
|
(e) => {
|
|
261
259
|
},
|
|
262
260
|
(e) => null,
|
|
263
261
|
je,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
262
|
+
Ws,
|
|
263
|
+
qs,
|
|
264
|
+
Zs,
|
|
267
265
|
(e) => !1,
|
|
268
266
|
(e) => !0,
|
|
269
267
|
nt,
|
|
@@ -280,13 +278,13 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
280
278
|
for (let n = 0; n < t; n++) r.push(wt(e));
|
|
281
279
|
return r;
|
|
282
280
|
},
|
|
283
|
-
|
|
284
|
-
], wt = (e) =>
|
|
281
|
+
T
|
|
282
|
+
], wt = (e) => Qs[127 - lt(e)](e), yr = class extends qt {
|
|
285
283
|
constructor(e, t) {
|
|
286
284
|
super(e), this.reader = t, this.s = null, this.count = 0;
|
|
287
285
|
}
|
|
288
286
|
read() {
|
|
289
|
-
return this.count === 0 && (this.s = this.reader(this),
|
|
287
|
+
return this.count === 0 && (this.s = this.reader(this), Gs(this) ? this.count = p(this) + 1 : this.count = -1), this.count--, this.s;
|
|
290
288
|
}
|
|
291
289
|
}, $t = class extends qt {
|
|
292
290
|
constructor(e) {
|
|
@@ -295,7 +293,7 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
295
293
|
read() {
|
|
296
294
|
if (this.count === 0) {
|
|
297
295
|
this.s = je(this);
|
|
298
|
-
const e =
|
|
296
|
+
const e = Fr(this.s);
|
|
299
297
|
this.count = 1, e && (this.s = -this.s, this.count = p(this) + 2);
|
|
300
298
|
}
|
|
301
299
|
return this.count--, this.s;
|
|
@@ -307,11 +305,11 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
307
305
|
read() {
|
|
308
306
|
if (this.count === 0) {
|
|
309
307
|
const e = je(this), t = e & 1;
|
|
310
|
-
this.diff =
|
|
308
|
+
this.diff = V(e / 2), this.count = 1, t && (this.count = p(this) + 2);
|
|
311
309
|
}
|
|
312
310
|
return this.s += this.diff, this.count--, this.s;
|
|
313
311
|
}
|
|
314
|
-
},
|
|
312
|
+
}, Ps = class {
|
|
315
313
|
constructor(e) {
|
|
316
314
|
this.decoder = new $t(e), this.str = nt(this.decoder), this.spos = 0;
|
|
317
315
|
}
|
|
@@ -319,7 +317,7 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
319
317
|
const e = this.spos + this.decoder.read(), t = this.str.slice(this.spos, e);
|
|
320
318
|
return this.spos = e, t;
|
|
321
319
|
}
|
|
322
|
-
}, kr = (e) => e === void 0 ? null : e,
|
|
320
|
+
}, kr = (e) => e === void 0 ? null : e, ti = class {
|
|
323
321
|
constructor() {
|
|
324
322
|
this.map = /* @__PURE__ */ new Map();
|
|
325
323
|
}
|
|
@@ -329,37 +327,37 @@ var Ks = (e, t) => _s(t, () => e).join(""), St = class {
|
|
|
329
327
|
getItem(e) {
|
|
330
328
|
return this.map.get(e);
|
|
331
329
|
}
|
|
332
|
-
}, Xr = new
|
|
330
|
+
}, Xr = new ti(), Je = !0;
|
|
333
331
|
try {
|
|
334
332
|
typeof localStorage < "u" && localStorage && (Xr = localStorage, Je = !1);
|
|
335
333
|
} catch {
|
|
336
334
|
}
|
|
337
|
-
var
|
|
335
|
+
var ei = Xr, Yo = (e) => Je || addEventListener("storage", e), Jo = (e) => Je || removeEventListener("storage", e), mt = /* @__PURE__ */ Symbol("Equality"), Gr = (e, t) => e === t || !!e?.[mt]?.(t) || !1, ri = (e) => typeof e == "object", ni = Object.assign, si = Object.keys, ii = (e, t) => {
|
|
338
336
|
for (const r in e) t(e[r], r);
|
|
339
|
-
},
|
|
337
|
+
}, Xo = (e, t) => {
|
|
340
338
|
const r = [];
|
|
341
339
|
for (const n in e) r.push(t(e[n], n));
|
|
342
340
|
return r;
|
|
343
|
-
},
|
|
341
|
+
}, Vt = (e) => si(e).length, li = (e) => {
|
|
344
342
|
for (const t in e) return !1;
|
|
345
343
|
return !0;
|
|
346
344
|
}, Ct = (e, t) => {
|
|
347
345
|
for (const r in e) if (!t(e[r], r)) return !1;
|
|
348
346
|
return !0;
|
|
349
|
-
}, Xe = (e, t) => Object.prototype.hasOwnProperty.call(e, t),
|
|
347
|
+
}, Xe = (e, t) => Object.prototype.hasOwnProperty.call(e, t), oi = (e, t) => e === t || Vt(e) === Vt(t) && Ct(e, (r, n) => (r !== void 0 || Xe(t, n)) && Gr(t[n], r)), ci = Object.freeze, Hr = (e) => {
|
|
350
348
|
for (const t in e) {
|
|
351
349
|
const r = e[t];
|
|
352
350
|
(typeof r == "object" || typeof r == "function") && Hr(e[t]);
|
|
353
351
|
}
|
|
354
|
-
return
|
|
352
|
+
return ci(e);
|
|
355
353
|
}, Ge = (e, t, r = 0) => {
|
|
356
354
|
try {
|
|
357
355
|
for (; r < e.length; r++) e[r](...t);
|
|
358
356
|
} finally {
|
|
359
357
|
r < e.length && Ge(e, t, r + 1);
|
|
360
358
|
}
|
|
361
|
-
},
|
|
362
|
-
},
|
|
359
|
+
}, ai = () => {
|
|
360
|
+
}, hi = (e) => e, Nt = (e, t) => {
|
|
363
361
|
if (e === t) return !0;
|
|
364
362
|
if (e == null || t == null || e.constructor !== t.constructor && (e.constructor || Object) !== (t.constructor || Object)) return !1;
|
|
365
363
|
if (e[mt] != null) return e[mt](t);
|
|
@@ -380,7 +378,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
380
378
|
break;
|
|
381
379
|
case void 0:
|
|
382
380
|
case Object:
|
|
383
|
-
if (
|
|
381
|
+
if (Vt(e) !== Vt(t)) return !1;
|
|
384
382
|
for (const r in e) if (!Xe(e, r) || !Nt(e[r], t[r])) return !1;
|
|
385
383
|
break;
|
|
386
384
|
case Array:
|
|
@@ -391,51 +389,52 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
391
389
|
return !1;
|
|
392
390
|
}
|
|
393
391
|
return !0;
|
|
394
|
-
},
|
|
395
|
-
if (U === void 0)
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
392
|
+
}, ui = (e, t) => t.includes(e), ot = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", zr = typeof window < "u" && typeof document < "u" && !ot, Go = typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1, U, di = [], fi = () => {
|
|
393
|
+
if (U === void 0)
|
|
394
|
+
if (ot) {
|
|
395
|
+
U = O();
|
|
396
|
+
const e = process.argv;
|
|
397
|
+
let t = null;
|
|
398
|
+
for (let r = 0; r < e.length; r++) {
|
|
399
|
+
const n = e[r];
|
|
400
|
+
n[0] === "-" ? (t !== null && U.set(t, ""), t = n) : t !== null ? (U.set(t, n), t = null) : di.push(n);
|
|
401
|
+
}
|
|
402
|
+
t !== null && U.set(t, "");
|
|
403
|
+
} else typeof location == "object" ? (U = O(), (location.search || "?").slice(1).split("&").forEach((e) => {
|
|
404
|
+
if (e.length !== 0) {
|
|
405
|
+
const [t, r] = e.split("=");
|
|
406
|
+
U.set(`--${gr(t, "-")}`, r), U.set(`-${gr(t, "-")}`, r);
|
|
407
|
+
}
|
|
408
|
+
})) : U = O();
|
|
410
409
|
return U;
|
|
411
|
-
}, _e = (e) =>
|
|
410
|
+
}, _e = (e) => fi().has(e), yt = (e) => kr(ot ? process.env[e.toUpperCase().replaceAll("-", "_")] : ei.getItem(e)), Kr = (e) => _e("--" + e) || yt(e) !== null, gi = Kr("production"), pi = ot && ui(process.env.FORCE_COLOR, [
|
|
412
411
|
"true",
|
|
413
412
|
"1",
|
|
414
413
|
"2"
|
|
415
|
-
]),
|
|
414
|
+
]), vi = pi || !_e("--no-colors") && !Kr("no-color") && (!ot || process.stdout.isTTY) && (!ot || _e("--color") || yt("COLORTERM") !== null || (yt("TERM") || "").includes("color")), wi = class {
|
|
416
415
|
constructor(e, t) {
|
|
417
416
|
this.left = e, this.right = t;
|
|
418
417
|
}
|
|
419
|
-
}, j = (e, t) => new
|
|
418
|
+
}, j = (e, t) => new wi(e, t), Wr = (e) => new Uint8Array(e), mi = (e, t, r) => new Uint8Array(e, t, r), Ho = (e) => new Uint8Array(e), yi = (e) => {
|
|
420
419
|
let t = "";
|
|
421
|
-
for (let r = 0; r < e.byteLength; r++) t +=
|
|
420
|
+
for (let r = 0; r < e.byteLength; r++) t += Ve(e[r]);
|
|
422
421
|
return btoa(t);
|
|
423
|
-
},
|
|
422
|
+
}, ki = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), _i = (e) => {
|
|
424
423
|
const t = atob(e), r = Wr(t.length);
|
|
425
424
|
for (let n = 0; n < t.length; n++) r[n] = t.charCodeAt(n);
|
|
426
425
|
return r;
|
|
427
|
-
},
|
|
426
|
+
}, bi = (e) => {
|
|
428
427
|
const t = Buffer.from(e, "base64");
|
|
429
|
-
return
|
|
430
|
-
},
|
|
428
|
+
return mi(t.buffer, t.byteOffset, t.byteLength);
|
|
429
|
+
}, zo = zr ? yi : ki, Ko = zr ? _i : bi, Si = (e) => {
|
|
431
430
|
const t = Wr(e.byteLength);
|
|
432
431
|
return t.set(e), t;
|
|
433
|
-
}, _r = (e) => e.next() >= 0.5, ue = (e, t, r) =>
|
|
432
|
+
}, _r = (e) => e.next() >= 0.5, ue = (e, t, r) => V(e.next() * (r + 1 - t) + t), qr = (e, t, r) => V(e.next() * (r + 1 - t) + t), He = (e, t, r) => qr(e, t, r), Ci = (e) => Ve(He(e, 97, 122)), Ei = (e, t = 0, r = 20) => {
|
|
434
433
|
const n = He(e, t, r);
|
|
435
434
|
let s = "";
|
|
436
|
-
for (let i = 0; i < n; i++) s +=
|
|
435
|
+
for (let i = 0; i < n; i++) s += Ci(e);
|
|
437
436
|
return s;
|
|
438
|
-
}, de = (e, t) => t[He(e, 0, t.length - 1)],
|
|
437
|
+
}, de = (e, t) => t[He(e, 0, t.length - 1)], Di = /* @__PURE__ */ Symbol("0schema"), Ai = class {
|
|
439
438
|
constructor() {
|
|
440
439
|
this._rerrs = [];
|
|
441
440
|
}
|
|
@@ -451,12 +450,12 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
451
450
|
const e = [];
|
|
452
451
|
for (let t = this._rerrs.length - 1; t > 0; t--) {
|
|
453
452
|
const r = this._rerrs[t];
|
|
454
|
-
e.push(
|
|
453
|
+
e.push(Ns(" ", (this._rerrs.length - t) * 2) + `${r.path != null ? `[${r.path}] ` : ""}${r.has} doesn't match ${r.expected}. ${r.message}`);
|
|
455
454
|
}
|
|
456
455
|
return e.join(`
|
|
457
456
|
`);
|
|
458
457
|
}
|
|
459
|
-
}, be = (e, t) => e === t ? !0 : e == null || t == null || e.constructor !== t.constructor ? !1 : e[mt] ? Gr(e, t) : zt(e) ? Re(e, (r) => Rr(t, (n) => be(r, n))) :
|
|
458
|
+
}, be = (e, t) => e === t ? !0 : e == null || t == null || e.constructor !== t.constructor ? !1 : e[mt] ? Gr(e, t) : zt(e) ? Re(e, (r) => Rr(t, (n) => be(r, n))) : ri(e) ? Ct(e, (r, n) => be(r, t[n])) : !1, I = class {
|
|
460
459
|
static _dilutes = !1;
|
|
461
460
|
extends(e) {
|
|
462
461
|
let [t, r] = [this.shape, e.shape];
|
|
@@ -465,7 +464,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
465
464
|
equals(e) {
|
|
466
465
|
return this.constructor === e.constructor && Nt(this.shape, e.shape);
|
|
467
466
|
}
|
|
468
|
-
[
|
|
467
|
+
[Di]() {
|
|
469
468
|
return !0;
|
|
470
469
|
}
|
|
471
470
|
[mt](e) {
|
|
@@ -499,7 +498,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
499
498
|
const r = e?.constructor === this.shape && (this._c == null || this._c(e));
|
|
500
499
|
return !r && t?.extend(null, this.shape.name, e?.constructor.name, e?.constructor !== this.shape ? "Constructor match failed" : "Check failed"), r;
|
|
501
500
|
}
|
|
502
|
-
}, k = (e, t = null) => new ze(e, t),
|
|
501
|
+
}, k = (e, t = null) => new ze(e, t), Wo = k(ze), Ke = class extends I {
|
|
503
502
|
constructor(e) {
|
|
504
503
|
super(), this.shape = e;
|
|
505
504
|
}
|
|
@@ -507,7 +506,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
507
506
|
const r = this.shape(e);
|
|
508
507
|
return !r && t?.extend(null, "custom prop", e?.constructor.name, "failed to check custom prop"), r;
|
|
509
508
|
}
|
|
510
|
-
}, S = (e) => new Ke(e),
|
|
509
|
+
}, S = (e) => new Ke(e), qo = k(Ke), Zt = class extends I {
|
|
511
510
|
constructor(e) {
|
|
512
511
|
super(), this.shape = e;
|
|
513
512
|
}
|
|
@@ -515,14 +514,14 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
515
514
|
const r = this.shape.some((n) => n === e);
|
|
516
515
|
return !r && t?.extend(null, this.shape.join(" | "), e.toString()), r;
|
|
517
516
|
}
|
|
518
|
-
}, Qt = (...e) => new Zt(e), Zr = k(Zt),
|
|
519
|
-
if (ct.check(e)) return [
|
|
517
|
+
}, Qt = (...e) => new Zt(e), Zr = k(Zt), Ii = RegExp.escape || ((e) => e.replace(/[().|&,$^[\]]/g, (t) => "\\" + t)), Qr = (e) => {
|
|
518
|
+
if (ct.check(e)) return [Ii(e)];
|
|
520
519
|
if (Zr.check(e)) return e.shape.map((t) => t + "");
|
|
521
520
|
if (dn.check(e)) return ["[+-]?\\d+.?\\d*"];
|
|
522
521
|
if (fn.check(e)) return [".*"];
|
|
523
|
-
if (
|
|
522
|
+
if (Ft.check(e)) return e.shape.map(Qr).flat(1);
|
|
524
523
|
N();
|
|
525
|
-
},
|
|
524
|
+
}, Oi = class extends I {
|
|
526
525
|
constructor(e) {
|
|
527
526
|
super(), this.shape = e, this._r = new RegExp("^" + e.map(Qr).map((t) => `(${t.join("|")})`).join("") + "$");
|
|
528
527
|
}
|
|
@@ -530,7 +529,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
530
529
|
const r = this._r.exec(e) != null;
|
|
531
530
|
return !r && t?.extend(null, this._r.toString(), e.toString(), "String doesn't match string template."), r;
|
|
532
531
|
}
|
|
533
|
-
},
|
|
532
|
+
}, Zo = k(Oi), xi = /* @__PURE__ */ Symbol("optional"), Pr = class extends I {
|
|
534
533
|
constructor(e) {
|
|
535
534
|
super(), this.shape = e;
|
|
536
535
|
}
|
|
@@ -538,14 +537,14 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
538
537
|
const r = e === void 0 || this.shape.check(e);
|
|
539
538
|
return !r && t?.extend(null, "undefined (optional)", "()"), r;
|
|
540
539
|
}
|
|
541
|
-
get [
|
|
540
|
+
get [xi]() {
|
|
542
541
|
return !0;
|
|
543
542
|
}
|
|
544
|
-
},
|
|
543
|
+
}, Ti = k(Pr), tn = class extends I {
|
|
545
544
|
check(e, t) {
|
|
546
545
|
return t?.extend(null, "never", typeof e), !1;
|
|
547
546
|
}
|
|
548
|
-
},
|
|
547
|
+
}, Qo = new tn(), Po = k(tn), en = class rn extends I {
|
|
549
548
|
constructor(t, r = !1) {
|
|
550
549
|
super(), this.shape = t, this._isPartial = r;
|
|
551
550
|
}
|
|
@@ -559,7 +558,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
559
558
|
return !i && r?.extend(s.toString(), n.toString(), typeof t[s], "Object property does not match"), i;
|
|
560
559
|
});
|
|
561
560
|
}
|
|
562
|
-
},
|
|
561
|
+
}, Li = (e) => new en(e), $i = k(en), Ni = S((e) => e != null && (e.constructor === Object || e.constructor == null)), nn = class extends I {
|
|
563
562
|
constructor(e, t) {
|
|
564
563
|
super(), this.shape = {
|
|
565
564
|
keys: e,
|
|
@@ -572,7 +571,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
572
571
|
return !s && t?.extend(n + "", "Record", typeof e, s ? "Key doesn't match schema" : "Value doesn't match value"), s && this.shape.values.check(r, t);
|
|
573
572
|
});
|
|
574
573
|
}
|
|
575
|
-
}, sn = (e, t) => new nn(e, t),
|
|
574
|
+
}, sn = (e, t) => new nn(e, t), Mi = k(nn), ln = class extends I {
|
|
576
575
|
constructor(e) {
|
|
577
576
|
super(), this.shape = e;
|
|
578
577
|
}
|
|
@@ -582,7 +581,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
582
581
|
return !s && t?.extend(n.toString(), "Tuple", typeof r), s;
|
|
583
582
|
});
|
|
584
583
|
}
|
|
585
|
-
},
|
|
584
|
+
}, Ui = (...e) => new ln(e), tc = k(ln), on = class extends I {
|
|
586
585
|
constructor(e) {
|
|
587
586
|
super(), this.shape = e.length === 1 ? e[0] : new We(e);
|
|
588
587
|
}
|
|
@@ -590,7 +589,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
590
589
|
const r = zt(e) && Re(e, (n) => this.shape.check(n));
|
|
591
590
|
return !r && t?.extend(null, "Array", ""), r;
|
|
592
591
|
}
|
|
593
|
-
}, cn = (...e) => new on(e),
|
|
592
|
+
}, cn = (...e) => new on(e), Ri = k(on), Vi = S((e) => zt(e)), an = class extends I {
|
|
594
593
|
constructor(e, t) {
|
|
595
594
|
super(), this.shape = e, this._c = t;
|
|
596
595
|
}
|
|
@@ -598,15 +597,15 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
598
597
|
const r = e instanceof this.shape && (this._c == null || this._c(e));
|
|
599
598
|
return !r && t?.extend(null, this.shape.name, e?.constructor.name), r;
|
|
600
599
|
}
|
|
601
|
-
},
|
|
600
|
+
}, Fi = (e, t = null) => new an(e, t), ec = k(an), Bi = Fi(I), ji = class extends I {
|
|
602
601
|
constructor(e) {
|
|
603
|
-
super(), this.len = e.length - 1, this.args =
|
|
602
|
+
super(), this.len = e.length - 1, this.args = Ui(...e.slice(-1)), this.res = e[this.len];
|
|
604
603
|
}
|
|
605
604
|
check(e, t) {
|
|
606
605
|
const r = e.constructor === Function && e.length <= this.len;
|
|
607
606
|
return !r && t?.extend(null, "function", typeof e), r;
|
|
608
607
|
}
|
|
609
|
-
},
|
|
608
|
+
}, Yi = k(ji), Ji = S((e) => typeof e == "function"), Xi = class extends I {
|
|
610
609
|
constructor(e) {
|
|
611
610
|
super(), this.shape = e;
|
|
612
611
|
}
|
|
@@ -614,7 +613,7 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
614
613
|
const r = Re(this.shape, (n) => n.check(e, t));
|
|
615
614
|
return !r && t?.extend(null, "Intersectinon", typeof e), r;
|
|
616
615
|
}
|
|
617
|
-
},
|
|
616
|
+
}, rc = k(Xi, (e) => e.shape.length > 0), We = class extends I {
|
|
618
617
|
static _dilutes = !0;
|
|
619
618
|
constructor(e) {
|
|
620
619
|
super(), this.shape = e;
|
|
@@ -623,27 +622,27 @@ var pi = Xr, vc = (e) => Je || addEventListener("storage", e), wc = (e) => Je ||
|
|
|
623
622
|
const r = Rr(this.shape, (n) => n.check(e, t));
|
|
624
623
|
return t?.extend(null, "Union", typeof e), r;
|
|
625
624
|
}
|
|
626
|
-
}, ut = (...e) => e.findIndex((t) =>
|
|
627
|
-
const e = cn(
|
|
625
|
+
}, ut = (...e) => e.findIndex((t) => Ft.check(t)) >= 0 ? ut(...e.map((t) => kt(t)).map((t) => Ft.check(t) ? t.shape : [t]).flat(1)) : e.length === 1 ? e[0] : new We(e), Ft = k(We), hn = () => !0, Bt = S(hn), Gi = k(Ke, (e) => e.shape === hn), qe = S((e) => typeof e == "bigint"), Hi = S((e) => e === qe), un = S((e) => typeof e == "symbol"), nc = S((e) => e === un), st = S((e) => typeof e == "number"), dn = S((e) => e === st), ct = S((e) => typeof e == "string"), fn = S((e) => e === ct), Pt = S((e) => typeof e == "boolean"), zi = S((e) => e === Pt), gn = Qt(void 0), sc = k(Zt, (e) => e.shape.length === 1 && e.shape[0] === void 0), ic = Qt(void 0), te = Qt(null), Ki = k(Zt, (e) => e.shape.length === 1 && e.shape[0] === null), lc = k(Uint8Array), oc = k(ze, (e) => e.shape === Uint8Array), Wi = ut(st, ct, te, gn, qe, Pt, un), cc = (() => {
|
|
626
|
+
const e = cn(Bt), t = sn(ct, Bt), r = ut(st, ct, te, Pt, e, t);
|
|
628
627
|
return e.shape = r, t.shape.values = r, r;
|
|
629
628
|
})(), kt = (e) => {
|
|
630
|
-
if (
|
|
631
|
-
if (
|
|
629
|
+
if (Bi.check(e)) return e;
|
|
630
|
+
if (Ni.check(e)) {
|
|
632
631
|
const t = {};
|
|
633
632
|
for (const r in e) t[r] = kt(e[r]);
|
|
634
|
-
return
|
|
633
|
+
return Li(t);
|
|
635
634
|
} else {
|
|
636
|
-
if (
|
|
637
|
-
if (
|
|
638
|
-
if (
|
|
635
|
+
if (Vi.check(e)) return ut(...e.map(kt));
|
|
636
|
+
if (Wi.check(e)) return Qt(e);
|
|
637
|
+
if (Ji.check(e)) return k(e);
|
|
639
638
|
}
|
|
640
639
|
N();
|
|
641
|
-
}, br =
|
|
640
|
+
}, br = gi ? () => {
|
|
642
641
|
} : (e, t) => {
|
|
643
|
-
const r = new
|
|
644
|
-
if (!t.check(e, r)) throw
|
|
642
|
+
const r = new Ai();
|
|
643
|
+
if (!t.check(e, r)) throw F(`Expected value to be of type ${t.constructor.name}.
|
|
645
644
|
${r.toString()}`);
|
|
646
|
-
},
|
|
645
|
+
}, qi = class {
|
|
647
646
|
constructor(e) {
|
|
648
647
|
this.patterns = [], this.$state = e;
|
|
649
648
|
}
|
|
@@ -654,7 +653,7 @@ ${r.toString()}`);
|
|
|
654
653
|
}), this;
|
|
655
654
|
}
|
|
656
655
|
else(e) {
|
|
657
|
-
return this.if(
|
|
656
|
+
return this.if(Bt, e);
|
|
658
657
|
}
|
|
659
658
|
done() {
|
|
660
659
|
return (e, t) => {
|
|
@@ -662,28 +661,28 @@ ${r.toString()}`);
|
|
|
662
661
|
const n = this.patterns[r];
|
|
663
662
|
if (n.if.check(e)) return n.h(e, t);
|
|
664
663
|
}
|
|
665
|
-
throw
|
|
664
|
+
throw F("Unhandled pattern");
|
|
666
665
|
};
|
|
667
666
|
}
|
|
668
|
-
},
|
|
667
|
+
}, Zi = (e) => new qi(e), pn = Zi(Bt).if(dn, (e, t) => ue(t, fr, Rt)).if(fn, (e, t) => Ei(t)).if(zi, (e, t) => _r(t)).if(Hi, (e, t) => BigInt(ue(t, fr, Rt))).if(Ft, (e, t) => tt(t, de(t, e.shape))).if($i, (e, t) => {
|
|
669
668
|
const r = {};
|
|
670
669
|
for (const n in e.shape) {
|
|
671
670
|
let s = e.shape[n];
|
|
672
|
-
if (
|
|
671
|
+
if (Ti.check(s)) {
|
|
673
672
|
if (_r(t)) continue;
|
|
674
673
|
s = s.shape;
|
|
675
674
|
}
|
|
676
675
|
r[n] = pn(s, t);
|
|
677
676
|
}
|
|
678
677
|
return r;
|
|
679
|
-
}).if(
|
|
678
|
+
}).if(Ri, (e, t) => {
|
|
680
679
|
const r = [], n = qr(t, 0, 42);
|
|
681
680
|
for (let s = 0; s < n; s++) r.push(tt(t, e.shape));
|
|
682
681
|
return r;
|
|
683
|
-
}).if(Zr, (e, t) => de(t, e.shape)).if(
|
|
682
|
+
}).if(Zr, (e, t) => de(t, e.shape)).if(Ki, (e, t) => null).if(Yi, (e, t) => {
|
|
684
683
|
const r = tt(t, e.res);
|
|
685
684
|
return () => r;
|
|
686
|
-
}).if(
|
|
685
|
+
}).if(Gi, (e, t) => tt(t, de(t, [
|
|
687
686
|
st,
|
|
688
687
|
ct,
|
|
689
688
|
te,
|
|
@@ -692,14 +691,14 @@ ${r.toString()}`);
|
|
|
692
691
|
Pt,
|
|
693
692
|
cn(st),
|
|
694
693
|
sn(ut("a", "b", "c"), st)
|
|
695
|
-
]))).if(
|
|
694
|
+
]))).if(Mi, (e, t) => {
|
|
696
695
|
const r = {}, n = ue(t, 0, 3);
|
|
697
696
|
for (let s = 0; s < n; s++) {
|
|
698
697
|
const i = tt(t, e.shape.keys);
|
|
699
698
|
r[i] = tt(t, e.shape.values);
|
|
700
699
|
}
|
|
701
700
|
return r;
|
|
702
|
-
}).done(), tt = (e, t) => pn(kt(t), e), Q = typeof document < "u" ? document : {},
|
|
701
|
+
}).done(), tt = (e, t) => pn(kt(t), e), Q = typeof document < "u" ? document : {}, ac = S((e) => e.nodeType === rl), hc = typeof DOMParser < "u" ? new DOMParser() : null, uc = S((e) => e.nodeType === Pi), dc = S((e) => e.nodeType === tl), Qi = (e) => ms(e, (t, r) => `${r}:${t};`).join(""), Pi = Q.ELEMENT_NODE, tl = Q.TEXT_NODE, fc = Q.CDATA_SECTION_NODE, gc = Q.COMMENT_NODE, el = Q.DOCUMENT_NODE, pc = Q.DOCUMENT_TYPE_NODE, rl = Q.DOCUMENT_FRAGMENT_NODE, vc = S((e) => e.nodeType === el), nl = JSON.stringify, X = Symbol, vn = X(), wn = X(), mn = X(), sl = X(), yn = X(), kn = X(), _n = X(), ee = X(), bn = X(), il = (e) => {
|
|
703
702
|
e.length === 1 && e[0]?.constructor === Function && (e = e[0]());
|
|
704
703
|
const t = [], r = [];
|
|
705
704
|
let n = 0;
|
|
@@ -719,42 +718,42 @@ ${r.toString()}`);
|
|
|
719
718
|
_n,
|
|
720
719
|
ee,
|
|
721
720
|
mn
|
|
722
|
-
], fe = 0, Cr =
|
|
721
|
+
], fe = 0, Cr = Br(), ll = (e, t) => {
|
|
723
722
|
const r = Sr[fe], n = yt("log"), s = n !== null && (n === "*" || n === "true" || new RegExp(n, "gi").test(t));
|
|
724
723
|
return fe = (fe + 1) % Sr.length, t += ": ", s ? (...i) => {
|
|
725
724
|
i.length === 1 && i[0]?.constructor === Function && (i = i[0]());
|
|
726
|
-
const l =
|
|
725
|
+
const l = Br(), o = l - Cr;
|
|
727
726
|
Cr = l, e(r, t, bn, ...i.map((c) => {
|
|
728
727
|
switch (c != null && c.constructor === Uint8Array && (c = Array.from(c)), typeof c) {
|
|
729
728
|
case "string":
|
|
730
729
|
case "symbol":
|
|
731
730
|
return c;
|
|
732
731
|
default:
|
|
733
|
-
return
|
|
732
|
+
return nl(c);
|
|
734
733
|
}
|
|
735
734
|
}), r, " +" + o + "ms");
|
|
736
|
-
} :
|
|
737
|
-
},
|
|
735
|
+
} : ai;
|
|
736
|
+
}, ol = {
|
|
738
737
|
[vn]: j("font-weight", "bold"),
|
|
739
738
|
[wn]: j("font-weight", "normal"),
|
|
740
739
|
[mn]: j("color", "blue"),
|
|
741
740
|
[yn]: j("color", "green"),
|
|
742
|
-
[
|
|
741
|
+
[sl]: j("color", "grey"),
|
|
743
742
|
[kn]: j("color", "red"),
|
|
744
743
|
[_n]: j("color", "purple"),
|
|
745
744
|
[ee]: j("color", "orange"),
|
|
746
745
|
[bn]: j("color", "black")
|
|
747
|
-
},
|
|
746
|
+
}, cl = (e) => {
|
|
748
747
|
e.length === 1 && e[0]?.constructor === Function && (e = e[0]());
|
|
749
|
-
const t = [], r = [], n =
|
|
748
|
+
const t = [], r = [], n = O();
|
|
750
749
|
let s = [], i = 0;
|
|
751
750
|
for (; i < e.length; i++) {
|
|
752
|
-
const l = e[i], o =
|
|
751
|
+
const l = e[i], o = ol[l];
|
|
753
752
|
if (o !== void 0) n.set(o.left, o.right);
|
|
754
753
|
else {
|
|
755
754
|
if (l === void 0) break;
|
|
756
755
|
if (l.constructor === String || l.constructor === Number) {
|
|
757
|
-
const c =
|
|
756
|
+
const c = Qi(n);
|
|
758
757
|
i > 0 || c.length > 0 ? (t.push("%c" + l), r.push(c)) : t.push(l);
|
|
759
758
|
} else break;
|
|
760
759
|
}
|
|
@@ -764,16 +763,16 @@ ${r.toString()}`);
|
|
|
764
763
|
l instanceof Symbol || s.push(l);
|
|
765
764
|
}
|
|
766
765
|
return s;
|
|
767
|
-
}, Sn =
|
|
766
|
+
}, Sn = vi ? cl : il, Cn = (...e) => {
|
|
768
767
|
console.log(...Sn(e)), En.forEach((t) => t.print(e));
|
|
769
|
-
},
|
|
768
|
+
}, al = (...e) => {
|
|
770
769
|
console.warn(...Sn(e)), e.unshift(ee), En.forEach((t) => t.print(e));
|
|
771
|
-
}, En = K(),
|
|
770
|
+
}, En = K(), wc = (e) => ll(Cn, e), Er = (e) => new Promise(e), mc = Promise.all.bind(Promise), yc = (e) => Promise.reject(e), kc = (e) => Promise.resolve(e), Dn = (e) => ({
|
|
772
771
|
[Symbol.iterator]() {
|
|
773
772
|
return this;
|
|
774
773
|
},
|
|
775
774
|
next: e
|
|
776
|
-
}),
|
|
775
|
+
}), hl = (e, t) => Dn(() => {
|
|
777
776
|
let r;
|
|
778
777
|
do
|
|
779
778
|
r = e.next();
|
|
@@ -799,10 +798,10 @@ ${r.toString()}`);
|
|
|
799
798
|
const l = i[i.length - 1], o = l.id.clock + l.length;
|
|
800
799
|
for (let c = 0, h = n[c]; c < n.length && h.clock < o; h = n[++c]) Yn(e, i, h.clock, h.len, r);
|
|
801
800
|
}
|
|
802
|
-
}),
|
|
801
|
+
}), ul = (e, t) => {
|
|
803
802
|
let r = 0, n = e.length - 1;
|
|
804
803
|
for (; r <= n; ) {
|
|
805
|
-
const s =
|
|
804
|
+
const s = V((r + n) / 2), i = e[s], l = i.clock;
|
|
806
805
|
if (l <= t) {
|
|
807
806
|
if (t < l + i.len) return s;
|
|
808
807
|
r = s + 1;
|
|
@@ -811,7 +810,7 @@ ${r.toString()}`);
|
|
|
811
810
|
return null;
|
|
812
811
|
}, In = (e, t) => {
|
|
813
812
|
const r = e.clients.get(t.client);
|
|
814
|
-
return r !== void 0 &&
|
|
813
|
+
return r !== void 0 && ul(r, t.clock) !== null;
|
|
815
814
|
}, Ze = (e) => {
|
|
816
815
|
e.clients.forEach((t) => {
|
|
817
816
|
t.sort((s, i) => s.clock - i.clock);
|
|
@@ -822,7 +821,7 @@ ${r.toString()}`);
|
|
|
822
821
|
}
|
|
823
822
|
t.length = n;
|
|
824
823
|
});
|
|
825
|
-
},
|
|
824
|
+
}, dl = (e) => {
|
|
826
825
|
const t = new Et();
|
|
827
826
|
for (let r = 0; r < e.length; r++) e[r].clients.forEach((n, s) => {
|
|
828
827
|
if (!t.clients.has(s)) {
|
|
@@ -834,8 +833,8 @@ ${r.toString()}`);
|
|
|
834
833
|
return Ze(t), t;
|
|
835
834
|
}, jt = (e, t, r, n) => {
|
|
836
835
|
J(e.clients, t, () => []).push(new re(r, n));
|
|
837
|
-
},
|
|
838
|
-
const t =
|
|
836
|
+
}, On = () => new Et(), fl = (e) => {
|
|
837
|
+
const t = On();
|
|
839
838
|
return e.clients.forEach((r, n) => {
|
|
840
839
|
const s = [];
|
|
841
840
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -879,7 +878,7 @@ ${r.toString()}`);
|
|
|
879
878
|
const d = e.readDsClock(), u = d + e.readDsLen();
|
|
880
879
|
if (d < h) {
|
|
881
880
|
h < u && jt(n, l, h, u - h);
|
|
882
|
-
let f =
|
|
881
|
+
let f = B(c, d), g = c[f];
|
|
883
882
|
for (!g.deleted && g.id.clock < d && (c.splice(f + 1, 0, Ht(t, g, d - g.id.clock)), f++); f < c.length && (g = c[f++], g.id.clock < u); )
|
|
884
883
|
g.deleted || (u < g.id.clock + g.length && c.splice(f, 0, Ht(t, g, u - g.id.clock)), g.delete(t));
|
|
885
884
|
} else jt(n, l, d, u - d);
|
|
@@ -890,9 +889,9 @@ ${r.toString()}`);
|
|
|
890
889
|
return v(i.restEncoder, 0), dt(i, n), i.toUint8Array();
|
|
891
890
|
}
|
|
892
891
|
return null;
|
|
893
|
-
},
|
|
894
|
-
constructor({ guid: t =
|
|
895
|
-
super(), this.gc = n, this.gcFilter = s, this.clientID =
|
|
892
|
+
}, xn = jr, Pe = class Tn extends bs {
|
|
893
|
+
constructor({ guid: t = Es(), collectionid: r = null, gc: n = !0, gcFilter: s = () => !0, meta: i = null, autoLoad: l = !1, shouldLoad: o = !0 } = {}) {
|
|
894
|
+
super(), this.gc = n, this.gcFilter = s, this.clientID = xn(), this.guid = t, this.collectionid = r, this.share = /* @__PURE__ */ new Map(), this.store = new Bn(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = o, this.autoLoad = l, this.meta = i, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = Er((h) => {
|
|
896
895
|
this.on("load", () => {
|
|
897
896
|
this.isLoaded = !0, h(this);
|
|
898
897
|
});
|
|
@@ -927,14 +926,15 @@ ${r.toString()}`);
|
|
|
927
926
|
const i = new r();
|
|
928
927
|
return i._integrate(this, null), i;
|
|
929
928
|
}), s = n.constructor;
|
|
930
|
-
if (r !== C && s !== r)
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
929
|
+
if (r !== C && s !== r)
|
|
930
|
+
if (s === C) {
|
|
931
|
+
const i = new r();
|
|
932
|
+
i._map = n._map, n._map.forEach((l) => {
|
|
933
|
+
for (; l !== null; l = l.left) l.parent = i;
|
|
934
|
+
}), i._start = n._start;
|
|
935
|
+
for (let l = i._start; l !== null; l = l.right) l.parent = i;
|
|
936
|
+
return i._length = n._length, this.share.set(t, i), i._integrate(this, null), i;
|
|
937
|
+
} else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);
|
|
938
938
|
return n;
|
|
939
939
|
}
|
|
940
940
|
getArray(t = "") {
|
|
@@ -964,7 +964,7 @@ ${r.toString()}`);
|
|
|
964
964
|
if (t !== null) {
|
|
965
965
|
this._item = null;
|
|
966
966
|
const r = t.content;
|
|
967
|
-
r.doc = new
|
|
967
|
+
r.doc = new Tn({
|
|
968
968
|
guid: this.guid,
|
|
969
969
|
...r.opts,
|
|
970
970
|
shouldLoad: !1
|
|
@@ -1016,7 +1016,7 @@ ${r.toString()}`);
|
|
|
1016
1016
|
return wt(this.restDecoder);
|
|
1017
1017
|
}
|
|
1018
1018
|
readBuf() {
|
|
1019
|
-
return
|
|
1019
|
+
return Si(T(this.restDecoder));
|
|
1020
1020
|
}
|
|
1021
1021
|
readJSON() {
|
|
1022
1022
|
return JSON.parse(nt(this.restDecoder));
|
|
@@ -1024,7 +1024,7 @@ ${r.toString()}`);
|
|
|
1024
1024
|
readKey() {
|
|
1025
1025
|
return nt(this.restDecoder);
|
|
1026
1026
|
}
|
|
1027
|
-
},
|
|
1027
|
+
}, gl = class {
|
|
1028
1028
|
constructor(e) {
|
|
1029
1029
|
this.dsCurrVal = 0, this.restDecoder = e;
|
|
1030
1030
|
}
|
|
@@ -1038,9 +1038,9 @@ ${r.toString()}`);
|
|
|
1038
1038
|
const e = p(this.restDecoder) + 1;
|
|
1039
1039
|
return this.dsCurrVal += e, e;
|
|
1040
1040
|
}
|
|
1041
|
-
}, at = class extends
|
|
1041
|
+
}, at = class extends gl {
|
|
1042
1042
|
constructor(e) {
|
|
1043
|
-
super(e), this.keys = [], p(e), this.keyClockDecoder = new he(
|
|
1043
|
+
super(e), this.keys = [], p(e), this.keyClockDecoder = new he(T(e)), this.clientDecoder = new $t(T(e)), this.leftClockDecoder = new he(T(e)), this.rightClockDecoder = new he(T(e)), this.infoDecoder = new yr(T(e), lt), this.stringDecoder = new Ps(T(e)), this.parentInfoDecoder = new yr(T(e), lt), this.typeRefDecoder = new $t(T(e)), this.lenDecoder = new $t(T(e));
|
|
1044
1044
|
}
|
|
1045
1045
|
readLeftID() {
|
|
1046
1046
|
return new it(this.clientDecoder.read(), this.leftClockDecoder.read());
|
|
@@ -1070,7 +1070,7 @@ ${r.toString()}`);
|
|
|
1070
1070
|
return wt(this.restDecoder);
|
|
1071
1071
|
}
|
|
1072
1072
|
readBuf() {
|
|
1073
|
-
return
|
|
1073
|
+
return T(this.restDecoder);
|
|
1074
1074
|
}
|
|
1075
1075
|
readJSON() {
|
|
1076
1076
|
return wt(this.restDecoder);
|
|
@@ -1127,7 +1127,7 @@ ${r.toString()}`);
|
|
|
1127
1127
|
vt(this.restEncoder, e);
|
|
1128
1128
|
}
|
|
1129
1129
|
writeBuf(e) {
|
|
1130
|
-
|
|
1130
|
+
x(this.restEncoder, e);
|
|
1131
1131
|
}
|
|
1132
1132
|
writeJSON(e) {
|
|
1133
1133
|
rt(this.restEncoder, JSON.stringify(e));
|
|
@@ -1154,11 +1154,11 @@ ${r.toString()}`);
|
|
|
1154
1154
|
}
|
|
1155
1155
|
}, W = class extends Mn {
|
|
1156
1156
|
constructor() {
|
|
1157
|
-
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new ae(), this.clientEncoder = new Lt(), this.leftClockEncoder = new ae(), this.rightClockEncoder = new ae(), this.infoEncoder = new vr(ye), this.stringEncoder = new
|
|
1157
|
+
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new ae(), this.clientEncoder = new Lt(), this.leftClockEncoder = new ae(), this.rightClockEncoder = new ae(), this.infoEncoder = new vr(ye), this.stringEncoder = new Xs(), this.parentInfoEncoder = new vr(ye), this.typeRefEncoder = new Lt(), this.lenEncoder = new Lt();
|
|
1158
1158
|
}
|
|
1159
1159
|
toUint8Array() {
|
|
1160
1160
|
const e = Kt();
|
|
1161
|
-
return v(e, 0),
|
|
1161
|
+
return v(e, 0), x(e, this.keyClockEncoder.toUint8Array()), x(e, this.clientEncoder.toUint8Array()), x(e, this.leftClockEncoder.toUint8Array()), x(e, this.rightClockEncoder.toUint8Array()), x(e, R(this.infoEncoder)), x(e, this.stringEncoder.toUint8Array()), x(e, R(this.parentInfoEncoder)), x(e, this.typeRefEncoder.toUint8Array()), x(e, this.lenEncoder.toUint8Array()), Wt(e, R(this.restEncoder)), R(e);
|
|
1162
1162
|
}
|
|
1163
1163
|
writeLeftID(e) {
|
|
1164
1164
|
this.clientEncoder.write(e.client), this.leftClockEncoder.write(e.clock);
|
|
@@ -1188,7 +1188,7 @@ ${r.toString()}`);
|
|
|
1188
1188
|
vt(this.restEncoder, e);
|
|
1189
1189
|
}
|
|
1190
1190
|
writeBuf(e) {
|
|
1191
|
-
|
|
1191
|
+
x(this.restEncoder, e);
|
|
1192
1192
|
}
|
|
1193
1193
|
writeJSON(e) {
|
|
1194
1194
|
vt(this.restEncoder, e);
|
|
@@ -1197,9 +1197,9 @@ ${r.toString()}`);
|
|
|
1197
1197
|
const t = this.keyMap.get(e);
|
|
1198
1198
|
t === void 0 ? (this.keyClockEncoder.write(this.keyClock++), this.stringEncoder.write(e)) : this.keyClockEncoder.write(t);
|
|
1199
1199
|
}
|
|
1200
|
-
},
|
|
1200
|
+
}, pl = (e, t, r, n) => {
|
|
1201
1201
|
n = Z(n, t[0].id.clock);
|
|
1202
|
-
const s =
|
|
1202
|
+
const s = B(t, n);
|
|
1203
1203
|
v(e.restEncoder, t.length - s), e.writeClient(r), v(e.restEncoder, n);
|
|
1204
1204
|
const i = t[s];
|
|
1205
1205
|
i.write(e, n - i.id.clock);
|
|
@@ -1211,10 +1211,10 @@ ${r.toString()}`);
|
|
|
1211
1211
|
}), ne(t).forEach((s, i) => {
|
|
1212
1212
|
r.has(i) || n.set(i, 0);
|
|
1213
1213
|
}), v(e.restEncoder, n.size), Y(n.entries()).sort((s, i) => i[0] - s[0]).forEach(([s, i]) => {
|
|
1214
|
-
|
|
1214
|
+
pl(e, t.clients.get(s), s, i);
|
|
1215
1215
|
});
|
|
1216
|
-
},
|
|
1217
|
-
const r =
|
|
1216
|
+
}, vl = (e, t) => {
|
|
1217
|
+
const r = O(), n = p(e.restDecoder);
|
|
1218
1218
|
for (let s = 0; s < n; s++) {
|
|
1219
1219
|
const i = p(e.restDecoder), l = new Array(i), o = e.readClient();
|
|
1220
1220
|
let c = p(e.restDecoder);
|
|
@@ -1243,7 +1243,7 @@ ${r.toString()}`);
|
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
return r;
|
|
1246
|
-
},
|
|
1246
|
+
}, wl = (e, t, r) => {
|
|
1247
1247
|
const n = [];
|
|
1248
1248
|
let s = Y(r.keys()).sort((f, g) => f - g);
|
|
1249
1249
|
if (s.length === 0) return null;
|
|
@@ -1257,7 +1257,7 @@ ${r.toString()}`);
|
|
|
1257
1257
|
};
|
|
1258
1258
|
let l = i();
|
|
1259
1259
|
if (l === null) return null;
|
|
1260
|
-
const o = new
|
|
1260
|
+
const o = new Bn(), c = /* @__PURE__ */ new Map(), h = (f, g) => {
|
|
1261
1261
|
const y = c.get(f);
|
|
1262
1262
|
(y == null || y > g) && c.set(f, g);
|
|
1263
1263
|
};
|
|
@@ -1306,10 +1306,10 @@ ${r.toString()}`);
|
|
|
1306
1306
|
};
|
|
1307
1307
|
}
|
|
1308
1308
|
return null;
|
|
1309
|
-
},
|
|
1309
|
+
}, ml = (e, t) => tr(e, t.doc.store, t.beforeState), yl = (e, t, r, n = new at(e)) => m(t, (s) => {
|
|
1310
1310
|
s.local = !1;
|
|
1311
1311
|
let i = !1;
|
|
1312
|
-
const l = s.doc, o = l.store, c =
|
|
1312
|
+
const l = s.doc, o = l.store, c = vl(n, l), h = wl(s, o, c), a = o.pendingStructs;
|
|
1313
1313
|
if (a) {
|
|
1314
1314
|
for (const [u, f] of a.missing) if (f < b(o, u)) {
|
|
1315
1315
|
i = !0;
|
|
@@ -1336,52 +1336,52 @@ ${r.toString()}`);
|
|
|
1336
1336
|
}
|
|
1337
1337
|
}, r, !1), Un = (e, t, r, n = at) => {
|
|
1338
1338
|
const s = ht(t);
|
|
1339
|
-
|
|
1340
|
-
},
|
|
1341
|
-
tr(e, t.store, r), dt(e,
|
|
1342
|
-
},
|
|
1339
|
+
yl(s, e, r, new n(s));
|
|
1340
|
+
}, _c = (e, t, r) => Un(e, t, r, $n), kl = (e, t, r = /* @__PURE__ */ new Map()) => {
|
|
1341
|
+
tr(e, t.store, r), dt(e, fl(t.store));
|
|
1342
|
+
}, _l = (e, t = new Uint8Array([0]), r = new W()) => {
|
|
1343
1343
|
const n = Rn(t);
|
|
1344
|
-
|
|
1344
|
+
kl(r, e, n);
|
|
1345
1345
|
const s = [r.toUint8Array()];
|
|
1346
|
-
if (e.store.pendingDs && s.push(e.store.pendingDs), e.store.pendingStructs && s.push(
|
|
1347
|
-
if (r.constructor === Dt) return
|
|
1346
|
+
if (e.store.pendingDs && s.push(e.store.pendingDs), e.store.pendingStructs && s.push(Rl(e.store.pendingStructs.update, t)), s.length > 1) {
|
|
1347
|
+
if (r.constructor === Dt) return Ml(s.map((i, l) => l === 0 ? i : Fl(i)));
|
|
1348
1348
|
if (r.constructor === W) return Yt(s);
|
|
1349
1349
|
}
|
|
1350
1350
|
return s[0];
|
|
1351
|
-
},
|
|
1351
|
+
}, bc = (e, t) => _l(e, t, new Dt()), bl = (e) => {
|
|
1352
1352
|
const t = /* @__PURE__ */ new Map(), r = p(e.restDecoder);
|
|
1353
1353
|
for (let n = 0; n < r; n++) {
|
|
1354
1354
|
const s = p(e.restDecoder), i = p(e.restDecoder);
|
|
1355
1355
|
t.set(s, i);
|
|
1356
1356
|
}
|
|
1357
1357
|
return t;
|
|
1358
|
-
}, Rn = (e) =>
|
|
1358
|
+
}, Rn = (e) => bl(new Ln(ht(e))), Vn = (e, t) => (v(e.restEncoder, t.size), Y(t.entries()).sort((r, n) => n[0] - r[0]).forEach(([r, n]) => {
|
|
1359
1359
|
v(e.restEncoder, r), v(e.restEncoder, n);
|
|
1360
|
-
}), e),
|
|
1360
|
+
}), e), Sl = (e, t) => Vn(e, ne(t.store)), Cl = (e, t = new Mn()) => (e instanceof Map ? Vn(t, e) : Sl(t, e), t.toUint8Array()), Sc = (e) => Cl(e, new Nn()), El = class {
|
|
1361
1361
|
constructor() {
|
|
1362
1362
|
this.l = [];
|
|
1363
1363
|
}
|
|
1364
|
-
}, Ar = () => new
|
|
1364
|
+
}, Ar = () => new El(), Ir = (e, t) => e.l.push(t), Or = (e, t) => {
|
|
1365
1365
|
const r = e.l, n = r.length;
|
|
1366
1366
|
e.l = r.filter((s) => t !== s), n === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
|
|
1367
|
-
},
|
|
1367
|
+
}, Fn = (e, t, r) => Ge(e.l, [t, r]), it = class {
|
|
1368
1368
|
constructor(e, t) {
|
|
1369
1369
|
this.client = e, this.clock = t;
|
|
1370
1370
|
}
|
|
1371
|
-
}, It = (e, t) => e === t || e !== null && t !== null && e.client === t.client && e.clock === t.clock, w = (e, t) => new it(e, t),
|
|
1371
|
+
}, It = (e, t) => e === t || e !== null && t !== null && e.client === t.client && e.clock === t.clock, w = (e, t) => new it(e, t), Dl = (e) => {
|
|
1372
1372
|
for (const [t, r] of e.doc.share.entries()) if (r === e) return t;
|
|
1373
1373
|
throw N();
|
|
1374
|
-
},
|
|
1374
|
+
}, Al = class {
|
|
1375
1375
|
constructor(e, t) {
|
|
1376
1376
|
this.ds = e, this.sv = t;
|
|
1377
1377
|
}
|
|
1378
|
-
},
|
|
1378
|
+
}, Il = (e, t) => new Al(e, t), Cc = Il(On(), /* @__PURE__ */ new Map()), et = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !In(t.ds, e.id), Se = (e, t) => {
|
|
1379
1379
|
const r = J(e.meta, Se, K), n = e.doc.store;
|
|
1380
1380
|
r.has(t) || (t.sv.forEach((s, i) => {
|
|
1381
1381
|
s < b(n, i) && z(e, w(i, s));
|
|
1382
1382
|
}), An(e, t.ds, (s) => {
|
|
1383
1383
|
}), r.add(t));
|
|
1384
|
-
},
|
|
1384
|
+
}, Bn = class {
|
|
1385
1385
|
constructor() {
|
|
1386
1386
|
this.clients = /* @__PURE__ */ new Map(), this.pendingStructs = null, this.pendingDs = null;
|
|
1387
1387
|
}
|
|
@@ -1405,33 +1405,33 @@ ${r.toString()}`);
|
|
|
1405
1405
|
if (n.id.clock + n.length !== t.id.clock) throw N();
|
|
1406
1406
|
}
|
|
1407
1407
|
r.push(t);
|
|
1408
|
-
},
|
|
1408
|
+
}, B = (e, t) => {
|
|
1409
1409
|
let r = 0, n = e.length - 1, s = e[n], i = s.id.clock;
|
|
1410
1410
|
if (i === t) return n;
|
|
1411
|
-
let l =
|
|
1411
|
+
let l = V(t / (i + s.length - 1) * n);
|
|
1412
1412
|
for (; r <= n; ) {
|
|
1413
1413
|
if (s = e[l], i = s.id.clock, i <= t) {
|
|
1414
1414
|
if (t < i + s.length) return l;
|
|
1415
1415
|
r = l + 1;
|
|
1416
1416
|
} else n = l - 1;
|
|
1417
|
-
l =
|
|
1417
|
+
l = V((r + n) / 2);
|
|
1418
1418
|
}
|
|
1419
1419
|
throw N();
|
|
1420
|
-
},
|
|
1420
|
+
}, Ol = (e, t) => {
|
|
1421
1421
|
const r = e.clients.get(t.client);
|
|
1422
|
-
return r[
|
|
1423
|
-
}, pe =
|
|
1424
|
-
const n =
|
|
1422
|
+
return r[B(r, t.clock)];
|
|
1423
|
+
}, pe = Ol, Ce = (e, t, r) => {
|
|
1424
|
+
const n = B(t, r), s = t[n];
|
|
1425
1425
|
return s.id.clock < r && s instanceof D ? (t.splice(n + 1, 0, Ht(e, s, r - s.id.clock)), n + 1) : n;
|
|
1426
1426
|
}, z = (e, t) => {
|
|
1427
1427
|
const r = e.doc.store.clients.get(t.client);
|
|
1428
1428
|
return r[Ce(e, r, t.clock)];
|
|
1429
|
-
},
|
|
1430
|
-
const n = t.clients.get(r.client), s =
|
|
1429
|
+
}, xr = (e, t, r) => {
|
|
1430
|
+
const n = t.clients.get(r.client), s = B(n, r.clock), i = n[s];
|
|
1431
1431
|
return r.clock !== i.id.clock + i.length - 1 && i.constructor !== L && n.splice(s + 1, 0, Ht(e, i, r.clock - i.id.clock + 1)), i;
|
|
1432
|
-
},
|
|
1432
|
+
}, xl = (e, t, r) => {
|
|
1433
1433
|
const n = e.clients.get(t.id.client);
|
|
1434
|
-
n[
|
|
1434
|
+
n[B(n, t.id.clock)] = r;
|
|
1435
1435
|
}, Yn = (e, t, r, n, s) => {
|
|
1436
1436
|
if (n === 0) return;
|
|
1437
1437
|
const i = r + n;
|
|
@@ -1439,11 +1439,11 @@ ${r.toString()}`);
|
|
|
1439
1439
|
do
|
|
1440
1440
|
o = t[l++], i < o.id.clock + o.length && Ce(e, t, i), s(o);
|
|
1441
1441
|
while (l < t.length && t[l].id.clock < i);
|
|
1442
|
-
},
|
|
1442
|
+
}, Tl = class {
|
|
1443
1443
|
constructor(e, t, r) {
|
|
1444
1444
|
this.doc = e, this.deleteSet = new Et(), this.beforeState = ne(e.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = t, this.meta = /* @__PURE__ */ new Map(), this.local = r, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
|
|
1445
1445
|
}
|
|
1446
|
-
},
|
|
1446
|
+
}, Tr = (e, t) => t.deleteSet.clients.size === 0 && !ys(t.afterState, (r, n) => t.beforeState.get(n) !== r) ? !1 : (Ze(t.deleteSet), ml(e, t), dt(e, t.deleteSet), !0), Lr = (e, t, r) => {
|
|
1447
1447
|
const n = t._item;
|
|
1448
1448
|
(n === null || n.id.clock < (e.beforeState.get(n.id.client) || 0) && !n.deleted) && J(e.changed, t, K).add(r);
|
|
1449
1449
|
}, Mt = (e, t) => {
|
|
@@ -1457,23 +1457,23 @@ ${r.toString()}`);
|
|
|
1457
1457
|
}
|
|
1458
1458
|
const i = t - s;
|
|
1459
1459
|
return i && e.splice(t + 1 - i, i), i;
|
|
1460
|
-
},
|
|
1460
|
+
}, Ll = (e, t, r) => {
|
|
1461
1461
|
for (const [n, s] of e.clients.entries()) {
|
|
1462
1462
|
const i = t.clients.get(n);
|
|
1463
1463
|
for (let l = s.length - 1; l >= 0; l--) {
|
|
1464
1464
|
const o = s[l], c = o.clock + o.len;
|
|
1465
|
-
for (let h =
|
|
1465
|
+
for (let h = B(i, o.clock), a = i[h]; h < i.length && a.id.clock < c; a = i[++h]) {
|
|
1466
1466
|
const d = i[h];
|
|
1467
1467
|
if (o.clock + o.len <= d.id.clock) break;
|
|
1468
1468
|
d instanceof D && d.deleted && !d.keep && r(d) && d.gc(t, !1);
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
},
|
|
1472
|
+
}, $l = (e, t) => {
|
|
1473
1473
|
e.clients.forEach((r, n) => {
|
|
1474
1474
|
const s = t.clients.get(n);
|
|
1475
1475
|
for (let i = r.length - 1; i >= 0; i--) {
|
|
1476
|
-
const l = r[i], o =
|
|
1476
|
+
const l = r[i], o = Vr(s.length - 1, 1 + B(s, l.clock + l.len - 1));
|
|
1477
1477
|
for (let c = o, h = s[c]; c > 0 && h.id.clock >= l.clock; h = s[c]) c -= 1 + Mt(s, c);
|
|
1478
1478
|
}
|
|
1479
1479
|
});
|
|
@@ -1490,27 +1490,27 @@ ${r.toString()}`);
|
|
|
1490
1490
|
h._dEH.l.length > 0 && (h._item === null || !h._item.deleted) && (c = c.filter((a) => a.target._item === null || !a.target._item.deleted), c.forEach((a) => {
|
|
1491
1491
|
a.currentTarget = h, a._path = null;
|
|
1492
1492
|
}), c.sort((a, d) => a.path.length - d.path.length), o.push(() => {
|
|
1493
|
-
|
|
1493
|
+
Fn(h._dEH, c, r);
|
|
1494
1494
|
}));
|
|
1495
1495
|
}), o.push(() => n.emit("afterTransaction", [r, n])), o.push(() => {
|
|
1496
|
-
r._needFormattingCleanup &&
|
|
1496
|
+
r._needFormattingCleanup && Pl(r);
|
|
1497
1497
|
});
|
|
1498
1498
|
}), Ge(o, []);
|
|
1499
1499
|
} finally {
|
|
1500
|
-
n.gc &&
|
|
1500
|
+
n.gc && Ll(i, s, n.gcFilter), $l(i, s), r.afterState.forEach((a, d) => {
|
|
1501
1501
|
const u = r.beforeState.get(d) || 0;
|
|
1502
1502
|
if (u !== a) {
|
|
1503
|
-
const f = s.clients.get(d), g = Z(
|
|
1503
|
+
const f = s.clients.get(d), g = Z(B(f, u), 1);
|
|
1504
1504
|
for (let y = f.length - 1; y >= g; ) y -= 1 + Mt(f, y);
|
|
1505
1505
|
}
|
|
1506
1506
|
});
|
|
1507
1507
|
for (let a = l.length - 1; a >= 0; a--) {
|
|
1508
|
-
const { client: d, clock: u } = l[a].id, f = s.clients.get(d), g =
|
|
1508
|
+
const { client: d, clock: u } = l[a].id, f = s.clients.get(d), g = B(f, u);
|
|
1509
1509
|
g + 1 < f.length && Mt(f, g + 1) > 1 || g > 0 && Mt(f, g);
|
|
1510
1510
|
}
|
|
1511
|
-
if (!r.local && r.afterState.get(n.clientID) !== r.beforeState.get(n.clientID) && (Cn(ee, vn, "[yjs] ", wn, kn, "Changed the client-id because another client seems to be using it."), n.clientID =
|
|
1511
|
+
if (!r.local && r.afterState.get(n.clientID) !== r.beforeState.get(n.clientID) && (Cn(ee, vn, "[yjs] ", wn, kn, "Changed the client-id because another client seems to be using it."), n.clientID = xn()), n.emit("afterTransactionCleanup", [r, n]), n._observers.has("update")) {
|
|
1512
1512
|
const a = new Dt();
|
|
1513
|
-
|
|
1513
|
+
Tr(a, r) && n.emit("update", [
|
|
1514
1514
|
a.toUint8Array(),
|
|
1515
1515
|
r.origin,
|
|
1516
1516
|
n,
|
|
@@ -1519,7 +1519,7 @@ ${r.toString()}`);
|
|
|
1519
1519
|
}
|
|
1520
1520
|
if (n._observers.has("updateV2")) {
|
|
1521
1521
|
const a = new W();
|
|
1522
|
-
|
|
1522
|
+
Tr(a, r) && n.emit("updateV2", [
|
|
1523
1523
|
a.toUint8Array(),
|
|
1524
1524
|
r.origin,
|
|
1525
1525
|
n,
|
|
@@ -1543,7 +1543,7 @@ ${r.toString()}`);
|
|
|
1543
1543
|
}, m = (e, t, r = null, n = !0) => {
|
|
1544
1544
|
const s = e._transactionCleanups;
|
|
1545
1545
|
let i = !1, l = null;
|
|
1546
|
-
e._transaction === null && (i = !0, e._transaction = new
|
|
1546
|
+
e._transaction === null && (i = !0, e._transaction = new Tl(e, r, n), s.push(e._transaction), s.length === 1 && e.emit("beforeAllTransactions", [e]), e.emit("beforeTransaction", [e._transaction, e]));
|
|
1547
1547
|
try {
|
|
1548
1548
|
l = t(e._transaction);
|
|
1549
1549
|
} finally {
|
|
@@ -1554,7 +1554,7 @@ ${r.toString()}`);
|
|
|
1554
1554
|
}
|
|
1555
1555
|
return l;
|
|
1556
1556
|
};
|
|
1557
|
-
function*
|
|
1557
|
+
function* Nl(e) {
|
|
1558
1558
|
const t = p(e.restDecoder);
|
|
1559
1559
|
for (let r = 0; r < t; r++) {
|
|
1560
1560
|
const n = p(e.restDecoder), s = e.readClient();
|
|
@@ -1576,7 +1576,7 @@ function* Kl(e) {
|
|
|
1576
1576
|
}
|
|
1577
1577
|
var er = class {
|
|
1578
1578
|
constructor(e, t) {
|
|
1579
|
-
this.gen =
|
|
1579
|
+
this.gen = Nl(e), this.curr = null, this.done = !1, this.filterSkips = t, this.next();
|
|
1580
1580
|
}
|
|
1581
1581
|
next() {
|
|
1582
1582
|
do
|
|
@@ -1588,7 +1588,7 @@ var er = class {
|
|
|
1588
1588
|
constructor(e) {
|
|
1589
1589
|
this.currClient = 0, this.startClock = 0, this.written = 0, this.encoder = e, this.clientStructs = [];
|
|
1590
1590
|
}
|
|
1591
|
-
},
|
|
1591
|
+
}, Ml = (e) => Yt(e, $n, Dt), Ul = (e, t) => {
|
|
1592
1592
|
if (e.constructor === L) {
|
|
1593
1593
|
const { client: r, clock: n } = e.id;
|
|
1594
1594
|
return new L(w(r, n + t), e.length - t);
|
|
@@ -1621,18 +1621,19 @@ var er = class {
|
|
|
1621
1621
|
struct: u,
|
|
1622
1622
|
offset: 0
|
|
1623
1623
|
}, a.next();
|
|
1624
|
-
else if (i.struct.id.clock + i.struct.length < u.id.clock)
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1624
|
+
else if (i.struct.id.clock + i.struct.length < u.id.clock)
|
|
1625
|
+
if (i.struct.constructor === $) i.struct.length = u.id.clock + u.length - i.struct.id.clock;
|
|
1626
|
+
else {
|
|
1627
|
+
G(o, i.struct, i.offset);
|
|
1628
|
+
const g = u.id.clock - i.struct.id.clock - i.struct.length;
|
|
1629
|
+
i = {
|
|
1630
|
+
struct: new $(w(d, i.struct.id.clock + i.struct.length), g),
|
|
1631
|
+
offset: 0
|
|
1632
|
+
};
|
|
1633
|
+
}
|
|
1633
1634
|
else {
|
|
1634
1635
|
const g = i.struct.id.clock + i.struct.length - u.id.clock;
|
|
1635
|
-
g > 0 && (i.struct.constructor === $ ? i.struct.length -= g : u =
|
|
1636
|
+
g > 0 && (i.struct.constructor === $ ? i.struct.length -= g : u = Ul(u, g)), i.struct.mergeWith(u) || (G(o, i.struct, i.offset), i = {
|
|
1636
1637
|
struct: u,
|
|
1637
1638
|
offset: 0
|
|
1638
1639
|
}, a.next());
|
|
@@ -1649,9 +1650,9 @@ var er = class {
|
|
|
1649
1650
|
};
|
|
1650
1651
|
}
|
|
1651
1652
|
i !== null && (G(o, i.struct, i.offset), i = null), nr(o);
|
|
1652
|
-
const c = n.map((a) => Qe(a)), h =
|
|
1653
|
+
const c = n.map((a) => Qe(a)), h = dl(c);
|
|
1653
1654
|
return dt(l, h), l.toUint8Array();
|
|
1654
|
-
},
|
|
1655
|
+
}, Rl = (e, t, r = at, n = W) => {
|
|
1655
1656
|
const s = Rn(t), i = new n(), l = new rr(i), o = new r(ht(e)), c = new er(o, !1);
|
|
1656
1657
|
for (; c.curr; ) {
|
|
1657
1658
|
const a = c.curr, d = a.id.client, u = s.get(d) || 0;
|
|
@@ -1682,25 +1683,25 @@ var er = class {
|
|
|
1682
1683
|
const n = e.clientStructs[r];
|
|
1683
1684
|
v(t, n.written), Wt(t, n.restEncoder);
|
|
1684
1685
|
}
|
|
1685
|
-
},
|
|
1686
|
+
}, Vl = (e, t, r, n) => {
|
|
1686
1687
|
const s = new r(ht(e)), i = new er(s, !1), l = new n(), o = new rr(l);
|
|
1687
1688
|
for (let h = i.curr; h !== null; h = i.next()) G(o, t(h), 0);
|
|
1688
1689
|
nr(o);
|
|
1689
1690
|
const c = Qe(s);
|
|
1690
1691
|
return dt(l, c), l.toUint8Array();
|
|
1691
|
-
},
|
|
1692
|
+
}, Fl = (e) => Vl(e, hi, at, Dt), $r = "You must not compute changes after the event-handler fired.", se = class {
|
|
1692
1693
|
constructor(e, t) {
|
|
1693
1694
|
this.target = e, this.currentTarget = e, this.transaction = t, this._changes = null, this._keys = null, this._delta = null, this._path = null;
|
|
1694
1695
|
}
|
|
1695
1696
|
get path() {
|
|
1696
|
-
return this._path || (this._path =
|
|
1697
|
+
return this._path || (this._path = Bl(this.currentTarget, this.target));
|
|
1697
1698
|
}
|
|
1698
1699
|
deletes(e) {
|
|
1699
1700
|
return In(this.transaction.deleteSet, e.id);
|
|
1700
1701
|
}
|
|
1701
1702
|
get keys() {
|
|
1702
1703
|
if (this._keys === null) {
|
|
1703
|
-
if (this.transaction.doc._transactionCleanups.length === 0) throw
|
|
1704
|
+
if (this.transaction.doc._transactionCleanups.length === 0) throw F($r);
|
|
1704
1705
|
const e = /* @__PURE__ */ new Map(), t = this.target;
|
|
1705
1706
|
this.transaction.changed.get(t).forEach((r) => {
|
|
1706
1707
|
if (r !== null) {
|
|
@@ -1709,9 +1710,10 @@ var er = class {
|
|
|
1709
1710
|
if (this.adds(n)) {
|
|
1710
1711
|
let l = n.left;
|
|
1711
1712
|
for (; l !== null && this.adds(l); ) l = l.left;
|
|
1712
|
-
if (this.deletes(n))
|
|
1713
|
-
|
|
1714
|
-
|
|
1713
|
+
if (this.deletes(n))
|
|
1714
|
+
if (l !== null && this.deletes(l))
|
|
1715
|
+
s = "delete", i = ce(l.content.getContent());
|
|
1716
|
+
else return;
|
|
1715
1717
|
else l !== null && this.deletes(l) ? (s = "update", i = ce(l.content.getContent())) : (s = "add", i = void 0);
|
|
1716
1718
|
} else if (this.deletes(n))
|
|
1717
1719
|
s = "delete", i = ce(n.content.getContent());
|
|
@@ -1734,7 +1736,7 @@ var er = class {
|
|
|
1734
1736
|
get changes() {
|
|
1735
1737
|
let e = this._changes;
|
|
1736
1738
|
if (e === null) {
|
|
1737
|
-
if (this.transaction.doc._transactionCleanups.length === 0) throw
|
|
1739
|
+
if (this.transaction.doc._transactionCleanups.length === 0) throw F($r);
|
|
1738
1740
|
const t = this.target, r = K(), n = K(), s = [];
|
|
1739
1741
|
if (e = {
|
|
1740
1742
|
added: r,
|
|
@@ -1753,7 +1755,7 @@ var er = class {
|
|
|
1753
1755
|
}
|
|
1754
1756
|
return e;
|
|
1755
1757
|
}
|
|
1756
|
-
},
|
|
1758
|
+
}, Bl = (e, t) => {
|
|
1757
1759
|
const r = [];
|
|
1758
1760
|
for (; t._item !== null && t !== e; ) {
|
|
1759
1761
|
if (t._item.parentSub !== null) r.unshift(t._item.parentSub);
|
|
@@ -1767,28 +1769,28 @@ var er = class {
|
|
|
1767
1769
|
}
|
|
1768
1770
|
return r;
|
|
1769
1771
|
}, A = () => {
|
|
1770
|
-
|
|
1771
|
-
}, Gn = 80, sr = 0,
|
|
1772
|
+
al("Invalid access: Add Yjs type to a document before reading data.");
|
|
1773
|
+
}, Gn = 80, sr = 0, jl = class {
|
|
1772
1774
|
constructor(e, t) {
|
|
1773
1775
|
e.marker = !0, this.p = e, this.index = t, this.timestamp = sr++;
|
|
1774
1776
|
}
|
|
1775
|
-
},
|
|
1777
|
+
}, Yl = (e) => {
|
|
1776
1778
|
e.timestamp = sr++;
|
|
1777
1779
|
}, Hn = (e, t, r) => {
|
|
1778
1780
|
e.p.marker = !1, e.p = t, t.marker = !0, e.index = r, e.timestamp = sr++;
|
|
1779
|
-
},
|
|
1781
|
+
}, Jl = (e, t, r) => {
|
|
1780
1782
|
if (e.length >= Gn) {
|
|
1781
1783
|
const n = e.reduce((s, i) => s.timestamp < i.timestamp ? s : i);
|
|
1782
1784
|
return Hn(n, t, r), n;
|
|
1783
1785
|
} else {
|
|
1784
|
-
const n = new
|
|
1786
|
+
const n = new jl(t, r);
|
|
1785
1787
|
return e.push(n), n;
|
|
1786
1788
|
}
|
|
1787
1789
|
}, ie = (e, t) => {
|
|
1788
1790
|
if (e._start === null || t === 0 || e._searchMarker === null) return null;
|
|
1789
|
-
const r = e._searchMarker.length === 0 ? null : e._searchMarker.reduce((i, l) =>
|
|
1791
|
+
const r = e._searchMarker.length === 0 ? null : e._searchMarker.reduce((i, l) => Tt(t - i.index) < Tt(t - l.index) ? i : l);
|
|
1790
1792
|
let n = e._start, s = 0;
|
|
1791
|
-
for (r !== null && (n = r.p, s = r.index,
|
|
1793
|
+
for (r !== null && (n = r.p, s = r.index, Yl(r)); n.right !== null && s < t; ) {
|
|
1792
1794
|
if (!n.deleted && n.countable) {
|
|
1793
1795
|
if (t < s + n.length) break;
|
|
1794
1796
|
s += n.length;
|
|
@@ -1799,7 +1801,7 @@ var er = class {
|
|
|
1799
1801
|
n = n.left, !n.deleted && n.countable && (s -= n.length);
|
|
1800
1802
|
for (; n.left !== null && n.left.id.client === n.id.client && n.left.id.clock + n.left.length === n.id.clock; )
|
|
1801
1803
|
n = n.left, !n.deleted && n.countable && (s -= n.length);
|
|
1802
|
-
return r !== null &&
|
|
1804
|
+
return r !== null && Tt(r.index - s) < n.parent.length / Gn ? (Hn(r, n, s), r) : Jl(e._searchMarker, n, s);
|
|
1803
1805
|
}, _t = (e, t, r) => {
|
|
1804
1806
|
for (let n = e.length - 1; n >= 0; n--) {
|
|
1805
1807
|
const s = e[n];
|
|
@@ -1819,7 +1821,7 @@ var er = class {
|
|
|
1819
1821
|
const n = e, s = t.changedParentTypes;
|
|
1820
1822
|
for (; J(s, e, () => []).push(r), e._item !== null; )
|
|
1821
1823
|
e = e._item.parent;
|
|
1822
|
-
|
|
1824
|
+
Fn(n._eH, r, t);
|
|
1823
1825
|
}, C = class {
|
|
1824
1826
|
constructor() {
|
|
1825
1827
|
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = Ar(), this._dEH = Ar(), this._searchMarker = null;
|
|
@@ -1853,10 +1855,10 @@ var er = class {
|
|
|
1853
1855
|
Ir(this._dEH, e);
|
|
1854
1856
|
}
|
|
1855
1857
|
unobserve(e) {
|
|
1856
|
-
|
|
1858
|
+
Or(this._eH, e);
|
|
1857
1859
|
}
|
|
1858
1860
|
unobserveDeep(e) {
|
|
1859
|
-
|
|
1861
|
+
Or(this._dEH, e);
|
|
1860
1862
|
}
|
|
1861
1863
|
toJSON() {
|
|
1862
1864
|
}
|
|
@@ -1904,7 +1906,7 @@ var er = class {
|
|
|
1904
1906
|
return bt(e, (n, s) => {
|
|
1905
1907
|
r.push(t(n, s, e));
|
|
1906
1908
|
}), r;
|
|
1907
|
-
},
|
|
1909
|
+
}, Xl = (e) => {
|
|
1908
1910
|
let t = e._start, r = null, n = 0;
|
|
1909
1911
|
return {
|
|
1910
1912
|
[Symbol.iterator]() {
|
|
@@ -1967,7 +1969,7 @@ var er = class {
|
|
|
1967
1969
|
}
|
|
1968
1970
|
}
|
|
1969
1971
|
}), a();
|
|
1970
|
-
}, Zn = () =>
|
|
1972
|
+
}, Zn = () => F("Length exceeded!"), Qn = (e, t, r, n) => {
|
|
1971
1973
|
if (r > t._length) throw Zn();
|
|
1972
1974
|
if (r === 0)
|
|
1973
1975
|
return t._searchMarker && _t(t._searchMarker, r, n.length), Jt(e, t, null, n);
|
|
@@ -1981,7 +1983,7 @@ var er = class {
|
|
|
1981
1983
|
r -= l.length;
|
|
1982
1984
|
}
|
|
1983
1985
|
return t._searchMarker && _t(t._searchMarker, s, n.length), Jt(e, t, l, n);
|
|
1984
|
-
},
|
|
1986
|
+
}, Gl = (e, t, r) => {
|
|
1985
1987
|
let n = (t._searchMarker || []).reduce((s, i) => i.index > s.index ? i : s, {
|
|
1986
1988
|
index: 0,
|
|
1987
1989
|
p: t._start
|
|
@@ -2038,14 +2040,14 @@ var er = class {
|
|
|
2038
2040
|
e.doc ?? A();
|
|
2039
2041
|
const r = e._map.get(t);
|
|
2040
2042
|
return r !== void 0 && !r.deleted;
|
|
2041
|
-
},
|
|
2043
|
+
}, Hl = (e, t) => {
|
|
2042
2044
|
const r = {};
|
|
2043
2045
|
return e._map.forEach((n, s) => {
|
|
2044
2046
|
let i = n;
|
|
2045
2047
|
for (; i !== null && (!t.sv.has(i.id.client) || i.id.clock >= (t.sv.get(i.id.client) || 0)); ) i = i.left;
|
|
2046
2048
|
i !== null && et(i, t) && (r[s] = i.content.getContent()[i.length - 1]);
|
|
2047
2049
|
}), r;
|
|
2048
|
-
},
|
|
2050
|
+
}, Ot = (e) => (e.doc ?? A(), hl(e._map.entries(), (t) => !t[1].deleted)), zl = class extends se {
|
|
2049
2051
|
}, rs = class Ut extends C {
|
|
2050
2052
|
constructor() {
|
|
2051
2053
|
super(), this._prelimContent = [], this._searchMarker = [];
|
|
@@ -2068,7 +2070,7 @@ var er = class {
|
|
|
2068
2070
|
return this.doc ?? A(), this._length;
|
|
2069
2071
|
}
|
|
2070
2072
|
_callObserver(t, r) {
|
|
2071
|
-
super._callObserver(t, r), le(this, t, new
|
|
2073
|
+
super._callObserver(t, r), le(this, t, new zl(this, t));
|
|
2072
2074
|
}
|
|
2073
2075
|
insert(t, r) {
|
|
2074
2076
|
this.doc !== null ? m(this.doc, (n) => {
|
|
@@ -2077,7 +2079,7 @@ var er = class {
|
|
|
2077
2079
|
}
|
|
2078
2080
|
push(t) {
|
|
2079
2081
|
this.doc !== null ? m(this.doc, (r) => {
|
|
2080
|
-
|
|
2082
|
+
Gl(r, this, t);
|
|
2081
2083
|
}) : this._prelimContent.push(...t);
|
|
2082
2084
|
}
|
|
2083
2085
|
unshift(t) {
|
|
@@ -2107,12 +2109,12 @@ var er = class {
|
|
|
2107
2109
|
bt(this, t);
|
|
2108
2110
|
}
|
|
2109
2111
|
[Symbol.iterator]() {
|
|
2110
|
-
return
|
|
2112
|
+
return Xl(this);
|
|
2111
2113
|
}
|
|
2112
2114
|
_write(t) {
|
|
2113
|
-
t.writeTypeRef(
|
|
2115
|
+
t.writeTypeRef(bo);
|
|
2114
2116
|
}
|
|
2115
|
-
},
|
|
2117
|
+
}, Kl = (e) => new rs(), Wl = class extends se {
|
|
2116
2118
|
constructor(e, t, r) {
|
|
2117
2119
|
super(e, t), this.keysChanged = r;
|
|
2118
2120
|
}
|
|
@@ -2135,7 +2137,7 @@ var er = class {
|
|
|
2135
2137
|
}), t;
|
|
2136
2138
|
}
|
|
2137
2139
|
_callObserver(t, r) {
|
|
2138
|
-
le(this, t, new
|
|
2140
|
+
le(this, t, new Wl(this, t, r));
|
|
2139
2141
|
}
|
|
2140
2142
|
toJSON() {
|
|
2141
2143
|
this.doc ?? A();
|
|
@@ -2148,16 +2150,16 @@ var er = class {
|
|
|
2148
2150
|
}), t;
|
|
2149
2151
|
}
|
|
2150
2152
|
get size() {
|
|
2151
|
-
return [...
|
|
2153
|
+
return [...Ot(this)].length;
|
|
2152
2154
|
}
|
|
2153
2155
|
keys() {
|
|
2154
|
-
return ge(
|
|
2156
|
+
return ge(Ot(this), (t) => t[0]);
|
|
2155
2157
|
}
|
|
2156
2158
|
values() {
|
|
2157
|
-
return ge(
|
|
2159
|
+
return ge(Ot(this), (t) => t[1].content.getContent()[t[1].length - 1]);
|
|
2158
2160
|
}
|
|
2159
2161
|
entries() {
|
|
2160
|
-
return ge(
|
|
2162
|
+
return ge(Ot(this), (t) => [t[0], t[1].content.getContent()[t[1].length - 1]]);
|
|
2161
2163
|
}
|
|
2162
2164
|
forEach(t) {
|
|
2163
2165
|
this.doc ?? A(), this._map.forEach((r, n) => {
|
|
@@ -2191,9 +2193,9 @@ var er = class {
|
|
|
2191
2193
|
}) : this._prelimContent.clear();
|
|
2192
2194
|
}
|
|
2193
2195
|
_write(t) {
|
|
2194
|
-
t.writeTypeRef(
|
|
2196
|
+
t.writeTypeRef(So);
|
|
2195
2197
|
}
|
|
2196
|
-
},
|
|
2198
|
+
}, ql = (e) => new or(), H = (e, t) => e === t || typeof e == "object" && typeof t == "object" && e && t && oi(e, t), De = class {
|
|
2197
2199
|
constructor(e, t, r, n) {
|
|
2198
2200
|
this.left = e, this.right = t, this.index = r, this.currentAttributes = n;
|
|
2199
2201
|
}
|
|
@@ -2204,7 +2206,7 @@ var er = class {
|
|
|
2204
2206
|
for (; t.right !== null && r > 0; )
|
|
2205
2207
|
t.right.content.constructor === E ? t.right.deleted || ft(t.currentAttributes, t.right.content) : t.right.deleted || (r < t.right.length && z(e, w(t.right.id.client, t.right.id.clock + r)), t.index += t.right.length, r -= t.right.length), t.left = t.right, t.right = t.right.right;
|
|
2206
2208
|
return t;
|
|
2207
|
-
},
|
|
2209
|
+
}, xt = (e, t, r, n) => {
|
|
2208
2210
|
const s = /* @__PURE__ */ new Map(), i = n ? ie(t, r) : null;
|
|
2209
2211
|
if (i) {
|
|
2210
2212
|
const l = new De(i.p.left, i.p, i.index, s);
|
|
@@ -2269,7 +2271,6 @@ var er = class {
|
|
|
2269
2271
|
}
|
|
2270
2272
|
default:
|
|
2271
2273
|
n < r.right.length && z(e, w(r.right.id.client, r.right.id.clock + n)), n -= r.right.length;
|
|
2272
|
-
break;
|
|
2273
2274
|
}
|
|
2274
2275
|
r.forward();
|
|
2275
2276
|
}
|
|
@@ -2282,7 +2283,7 @@ var er = class {
|
|
|
2282
2283
|
ns(e, t, r, o);
|
|
2283
2284
|
}, ls = (e, t, r, n, s) => {
|
|
2284
2285
|
let i = t;
|
|
2285
|
-
const l =
|
|
2286
|
+
const l = O();
|
|
2286
2287
|
for (; i && (!i.countable || i.deleted); ) {
|
|
2287
2288
|
if (!i.deleted && i.content.constructor === E) {
|
|
2288
2289
|
const h = i.content;
|
|
@@ -2302,7 +2303,7 @@ var er = class {
|
|
|
2302
2303
|
t = t.right;
|
|
2303
2304
|
}
|
|
2304
2305
|
return o;
|
|
2305
|
-
},
|
|
2306
|
+
}, Zl = (e, t) => {
|
|
2306
2307
|
for (; t && t.right && (t.right.deleted || !t.right.countable); ) t = t.right;
|
|
2307
2308
|
const r = /* @__PURE__ */ new Set();
|
|
2308
2309
|
for (; t && (t.deleted || !t.countable); ) {
|
|
@@ -2312,15 +2313,15 @@ var er = class {
|
|
|
2312
2313
|
}
|
|
2313
2314
|
t = t.left;
|
|
2314
2315
|
}
|
|
2315
|
-
},
|
|
2316
|
+
}, Ql = (e) => {
|
|
2316
2317
|
let t = 0;
|
|
2317
2318
|
return m(e.doc, (r) => {
|
|
2318
|
-
let n = e._start, s = e._start, i =
|
|
2319
|
+
let n = e._start, s = e._start, i = O();
|
|
2319
2320
|
const l = me(i);
|
|
2320
2321
|
for (; s; )
|
|
2321
2322
|
s.deleted === !1 && (s.content.constructor === E ? ft(l, s.content) : (t += ls(r, n, s, i, l), i = me(l), n = s)), s = s.right;
|
|
2322
2323
|
}), t;
|
|
2323
|
-
},
|
|
2324
|
+
}, Pl = (e) => {
|
|
2324
2325
|
const t = /* @__PURE__ */ new Set(), r = e.doc;
|
|
2325
2326
|
for (const [n, s] of e.afterState.entries()) {
|
|
2326
2327
|
const i = e.beforeState.get(n) || 0;
|
|
@@ -2332,9 +2333,9 @@ var er = class {
|
|
|
2332
2333
|
An(e, e.deleteSet, (s) => {
|
|
2333
2334
|
if (s instanceof L || !s.parent._hasFormatting || t.has(s.parent)) return;
|
|
2334
2335
|
const i = s.parent;
|
|
2335
|
-
s.content.constructor === E ? t.add(i) :
|
|
2336
|
+
s.content.constructor === E ? t.add(i) : Zl(n, s);
|
|
2336
2337
|
});
|
|
2337
|
-
for (const s of t)
|
|
2338
|
+
for (const s of t) Ql(s);
|
|
2338
2339
|
});
|
|
2339
2340
|
}, Ur = (e, t, r) => {
|
|
2340
2341
|
const n = r, s = me(t.currentAttributes), i = t.right;
|
|
@@ -2344,14 +2345,13 @@ var er = class {
|
|
|
2344
2345
|
case At:
|
|
2345
2346
|
case q:
|
|
2346
2347
|
r < t.right.length && z(e, w(t.right.id.client, t.right.id.clock + r)), r -= t.right.length, t.right.delete(e);
|
|
2347
|
-
break;
|
|
2348
2348
|
}
|
|
2349
2349
|
t.forward();
|
|
2350
2350
|
}
|
|
2351
2351
|
i && ls(e, i, t.right, s, t.currentAttributes);
|
|
2352
2352
|
const l = (t.left || t.right).parent;
|
|
2353
2353
|
return l._searchMarker && _t(l._searchMarker, t.index, -n + r), t;
|
|
2354
|
-
},
|
|
2354
|
+
}, to = class extends se {
|
|
2355
2355
|
constructor(e, t, r) {
|
|
2356
2356
|
super(e, t), this.childListChanged = !1, this.keysChanged = /* @__PURE__ */ new Set(), r.forEach((n) => {
|
|
2357
2357
|
n === null ? this.childListChanged = !0 : this.keysChanged.add(n);
|
|
@@ -2390,8 +2390,7 @@ var er = class {
|
|
|
2390
2390
|
}))), c = "";
|
|
2391
2391
|
break;
|
|
2392
2392
|
case "retain":
|
|
2393
|
-
h > 0 && (u = { retain: h },
|
|
2394
|
-
break;
|
|
2393
|
+
h > 0 && (u = { retain: h }, li(o) || (u.attributes = ni({}, o))), h = 0;
|
|
2395
2394
|
}
|
|
2396
2395
|
u && t.push(u), l = null;
|
|
2397
2396
|
}
|
|
@@ -2461,7 +2460,7 @@ var er = class {
|
|
|
2461
2460
|
}
|
|
2462
2461
|
_callObserver(t, r) {
|
|
2463
2462
|
super._callObserver(t, r);
|
|
2464
|
-
const n = new
|
|
2463
|
+
const n = new to(this, t, r);
|
|
2465
2464
|
le(this, t, n), !t.local && this._hasFormatting && (t._needFormattingCleanup = !0);
|
|
2466
2465
|
}
|
|
2467
2466
|
toString() {
|
|
@@ -2525,7 +2524,6 @@ var er = class {
|
|
|
2525
2524
|
}
|
|
2526
2525
|
case E:
|
|
2527
2526
|
et(c, t) && (h(), ft(i, c.content));
|
|
2528
|
-
break;
|
|
2529
2527
|
}
|
|
2530
2528
|
c = c.right;
|
|
2531
2529
|
}
|
|
@@ -2539,7 +2537,7 @@ var er = class {
|
|
|
2539
2537
|
if (r.length <= 0) return;
|
|
2540
2538
|
const s = this.doc;
|
|
2541
2539
|
s !== null ? m(s, (i) => {
|
|
2542
|
-
const l =
|
|
2540
|
+
const l = xt(i, this, t, !n);
|
|
2543
2541
|
n || (n = {}, l.currentAttributes.forEach((o, c) => {
|
|
2544
2542
|
n[c] = o;
|
|
2545
2543
|
})), ve(i, this, l, r, n);
|
|
@@ -2548,7 +2546,7 @@ var er = class {
|
|
|
2548
2546
|
insertEmbed(t, r, n) {
|
|
2549
2547
|
const s = this.doc;
|
|
2550
2548
|
s !== null ? m(s, (i) => {
|
|
2551
|
-
const l =
|
|
2549
|
+
const l = xt(i, this, t, !n);
|
|
2552
2550
|
ve(i, this, l, r, n || {});
|
|
2553
2551
|
}) : this._pending.push(() => this.insertEmbed(t, r, n || {}));
|
|
2554
2552
|
}
|
|
@@ -2556,14 +2554,14 @@ var er = class {
|
|
|
2556
2554
|
if (r === 0) return;
|
|
2557
2555
|
const n = this.doc;
|
|
2558
2556
|
n !== null ? m(n, (s) => {
|
|
2559
|
-
Ur(s,
|
|
2557
|
+
Ur(s, xt(s, this, t, !0), r);
|
|
2560
2558
|
}) : this._pending.push(() => this.delete(t, r));
|
|
2561
2559
|
}
|
|
2562
2560
|
format(t, r, n) {
|
|
2563
2561
|
if (r === 0) return;
|
|
2564
2562
|
const s = this.doc;
|
|
2565
2563
|
s !== null ? m(s, (i) => {
|
|
2566
|
-
const l =
|
|
2564
|
+
const l = xt(i, this, t, !1);
|
|
2567
2565
|
l.right !== null && Mr(i, this, l, r, n);
|
|
2568
2566
|
}) : this._pending.push(() => this.format(t, r, n));
|
|
2569
2567
|
}
|
|
@@ -2584,9 +2582,9 @@ var er = class {
|
|
|
2584
2582
|
return ts(this);
|
|
2585
2583
|
}
|
|
2586
2584
|
_write(t) {
|
|
2587
|
-
t.writeTypeRef(
|
|
2585
|
+
t.writeTypeRef(Co);
|
|
2588
2586
|
}
|
|
2589
|
-
},
|
|
2587
|
+
}, eo = (e) => new cr(), we = class {
|
|
2590
2588
|
constructor(e, t = () => !0) {
|
|
2591
2589
|
this._filter = t, this._root = e, this._currentNode = e._start, this._firstCall = !0, e.doc ?? A();
|
|
2592
2590
|
}
|
|
@@ -2646,7 +2644,7 @@ var er = class {
|
|
|
2646
2644
|
return t = t.toUpperCase(), Y(new we(this, (r) => r.nodeName && r.nodeName.toUpperCase() === t));
|
|
2647
2645
|
}
|
|
2648
2646
|
_callObserver(t, r) {
|
|
2649
|
-
le(this, t, new
|
|
2647
|
+
le(this, t, new so(this, r, t));
|
|
2650
2648
|
}
|
|
2651
2649
|
toString() {
|
|
2652
2650
|
return Wn(this, (t) => t.toString()).join("");
|
|
@@ -2672,7 +2670,7 @@ var er = class {
|
|
|
2672
2670
|
});
|
|
2673
2671
|
else {
|
|
2674
2672
|
const n = this._prelimContent, s = t === null ? 0 : n.findIndex((i) => i === t) + 1;
|
|
2675
|
-
if (s === 0 && t !== null) throw
|
|
2673
|
+
if (s === 0 && t !== null) throw F("Reference item not found");
|
|
2676
2674
|
n.splice(s, 0, ...r);
|
|
2677
2675
|
}
|
|
2678
2676
|
}
|
|
@@ -2700,9 +2698,9 @@ var er = class {
|
|
|
2700
2698
|
bt(this, t);
|
|
2701
2699
|
}
|
|
2702
2700
|
_write(t) {
|
|
2703
|
-
t.writeTypeRef(
|
|
2701
|
+
t.writeTypeRef(Do);
|
|
2704
2702
|
}
|
|
2705
|
-
},
|
|
2703
|
+
}, ro = (e) => new oe(), ar = class Oe extends oe {
|
|
2706
2704
|
constructor(t = "UNDEFINED") {
|
|
2707
2705
|
super(), this.nodeName = t, this._prelimAttrs = /* @__PURE__ */ new Map();
|
|
2708
2706
|
}
|
|
@@ -2720,11 +2718,11 @@ var er = class {
|
|
|
2720
2718
|
}), this._prelimAttrs = null;
|
|
2721
2719
|
}
|
|
2722
2720
|
_copy() {
|
|
2723
|
-
return new
|
|
2721
|
+
return new Oe(this.nodeName);
|
|
2724
2722
|
}
|
|
2725
2723
|
clone() {
|
|
2726
|
-
const t = new
|
|
2727
|
-
return
|
|
2724
|
+
const t = new Oe(this.nodeName), r = this.getAttributes();
|
|
2725
|
+
return ii(r, (n, s) => {
|
|
2728
2726
|
t.setAttribute(s, n);
|
|
2729
2727
|
}), t.insert(0, this.toArray().map((n) => n instanceof C ? n.clone() : n)), t;
|
|
2730
2728
|
}
|
|
@@ -2757,7 +2755,7 @@ var er = class {
|
|
|
2757
2755
|
return es(this, t);
|
|
2758
2756
|
}
|
|
2759
2757
|
getAttributes(t) {
|
|
2760
|
-
return t ?
|
|
2758
|
+
return t ? Hl(this, t) : ts(this);
|
|
2761
2759
|
}
|
|
2762
2760
|
toDOM(t = document, r = {}, n) {
|
|
2763
2761
|
const s = t.createElement(this.nodeName), i = this.getAttributes();
|
|
@@ -2770,23 +2768,23 @@ var er = class {
|
|
|
2770
2768
|
}), n !== void 0 && n._createAssociation(s, this), s;
|
|
2771
2769
|
}
|
|
2772
2770
|
_write(t) {
|
|
2773
|
-
t.writeTypeRef(
|
|
2771
|
+
t.writeTypeRef(Eo), t.writeKey(this.nodeName);
|
|
2774
2772
|
}
|
|
2775
|
-
},
|
|
2773
|
+
}, no = (e) => new ar(e.readKey()), so = class extends se {
|
|
2776
2774
|
constructor(e, t, r) {
|
|
2777
2775
|
super(e, r), this.childListChanged = !1, this.attributesChanged = /* @__PURE__ */ new Set(), t.forEach((n) => {
|
|
2778
2776
|
n === null ? this.childListChanged = !0 : this.attributesChanged.add(n);
|
|
2779
2777
|
});
|
|
2780
2778
|
}
|
|
2781
|
-
},
|
|
2779
|
+
}, io = class xe extends or {
|
|
2782
2780
|
constructor(t) {
|
|
2783
2781
|
super(), this.hookName = t;
|
|
2784
2782
|
}
|
|
2785
2783
|
_copy() {
|
|
2786
|
-
return new
|
|
2784
|
+
return new xe(this.hookName);
|
|
2787
2785
|
}
|
|
2788
2786
|
clone() {
|
|
2789
|
-
const t = new
|
|
2787
|
+
const t = new xe(this.hookName);
|
|
2790
2788
|
return this.forEach((r, n) => {
|
|
2791
2789
|
t.set(n, r);
|
|
2792
2790
|
}), t;
|
|
@@ -2797,9 +2795,9 @@ var er = class {
|
|
|
2797
2795
|
return s !== void 0 ? i = s.createDom(this) : i = document.createElement(this.hookName), i.setAttribute("data-yjs-hook", this.hookName), n !== void 0 && n._createAssociation(i, this), i;
|
|
2798
2796
|
}
|
|
2799
2797
|
_write(t) {
|
|
2800
|
-
t.writeTypeRef(
|
|
2798
|
+
t.writeTypeRef(Ao), t.writeKey(this.hookName);
|
|
2801
2799
|
}
|
|
2802
|
-
},
|
|
2800
|
+
}, lo = (e) => new io(e.readKey()), oo = class Te extends cr {
|
|
2803
2801
|
get nextSibling() {
|
|
2804
2802
|
const t = this._item ? this._item.next : null;
|
|
2805
2803
|
return t ? t.content.type : null;
|
|
@@ -2809,10 +2807,10 @@ var er = class {
|
|
|
2809
2807
|
return t ? t.content.type : null;
|
|
2810
2808
|
}
|
|
2811
2809
|
_copy() {
|
|
2812
|
-
return new
|
|
2810
|
+
return new Te();
|
|
2813
2811
|
}
|
|
2814
2812
|
clone() {
|
|
2815
|
-
const t = new
|
|
2813
|
+
const t = new Te();
|
|
2816
2814
|
return t.applyDelta(this.toDelta()), t;
|
|
2817
2815
|
}
|
|
2818
2816
|
toDOM(t = document, r, n) {
|
|
@@ -2853,9 +2851,9 @@ var er = class {
|
|
|
2853
2851
|
return this.toString();
|
|
2854
2852
|
}
|
|
2855
2853
|
_write(t) {
|
|
2856
|
-
t.writeTypeRef(
|
|
2854
|
+
t.writeTypeRef(Io);
|
|
2857
2855
|
}
|
|
2858
|
-
},
|
|
2856
|
+
}, co = (e) => new oo(), hr = class {
|
|
2859
2857
|
constructor(e, t) {
|
|
2860
2858
|
this.id = e, this.length = t;
|
|
2861
2859
|
}
|
|
@@ -2871,7 +2869,7 @@ var er = class {
|
|
|
2871
2869
|
integrate(e, t) {
|
|
2872
2870
|
throw M();
|
|
2873
2871
|
}
|
|
2874
|
-
},
|
|
2872
|
+
}, ao = 0, L = class extends hr {
|
|
2875
2873
|
get deleted() {
|
|
2876
2874
|
return !0;
|
|
2877
2875
|
}
|
|
@@ -2884,7 +2882,7 @@ var er = class {
|
|
|
2884
2882
|
t > 0 && (this.id.clock += t, this.length -= t), jn(e.doc.store, this);
|
|
2885
2883
|
}
|
|
2886
2884
|
write(e, t) {
|
|
2887
|
-
e.writeInfo(
|
|
2885
|
+
e.writeInfo(ao), e.writeLen(this.length - t);
|
|
2888
2886
|
}
|
|
2889
2887
|
getMissing(e, t) {
|
|
2890
2888
|
return null;
|
|
@@ -2923,7 +2921,7 @@ var er = class {
|
|
|
2923
2921
|
getRef() {
|
|
2924
2922
|
return 3;
|
|
2925
2923
|
}
|
|
2926
|
-
},
|
|
2924
|
+
}, ho = (e) => new ur(e.readBuf()), cs = class Le {
|
|
2927
2925
|
constructor(t) {
|
|
2928
2926
|
this.len = t;
|
|
2929
2927
|
}
|
|
@@ -2959,7 +2957,7 @@ var er = class {
|
|
|
2959
2957
|
getRef() {
|
|
2960
2958
|
return 1;
|
|
2961
2959
|
}
|
|
2962
|
-
},
|
|
2960
|
+
}, uo = (e) => new cs(e.readLen()), as = (e, t) => new Pe({
|
|
2963
2961
|
guid: e,
|
|
2964
2962
|
...t,
|
|
2965
2963
|
shouldLoad: t.shouldLoad || t.autoLoad || !1
|
|
@@ -3001,7 +2999,7 @@ var er = class {
|
|
|
3001
2999
|
getRef() {
|
|
3002
3000
|
return 9;
|
|
3003
3001
|
}
|
|
3004
|
-
},
|
|
3002
|
+
}, fo = (e) => new dr(as(e.readString(), e.readAny())), At = class us {
|
|
3005
3003
|
constructor(t) {
|
|
3006
3004
|
this.embed = t;
|
|
3007
3005
|
}
|
|
@@ -3035,7 +3033,7 @@ var er = class {
|
|
|
3035
3033
|
getRef() {
|
|
3036
3034
|
return 5;
|
|
3037
3035
|
}
|
|
3038
|
-
},
|
|
3036
|
+
}, go = (e) => new At(e.readJSON()), E = class ds {
|
|
3039
3037
|
constructor(t, r) {
|
|
3040
3038
|
this.key = t, this.value = r;
|
|
3041
3039
|
}
|
|
@@ -3071,7 +3069,7 @@ var er = class {
|
|
|
3071
3069
|
getRef() {
|
|
3072
3070
|
return 6;
|
|
3073
3071
|
}
|
|
3074
|
-
},
|
|
3072
|
+
}, po = (e) => new E(e.readKey(), e.readJSON()), vo = class $e {
|
|
3075
3073
|
constructor(t) {
|
|
3076
3074
|
this.arr = t;
|
|
3077
3075
|
}
|
|
@@ -3111,16 +3109,16 @@ var er = class {
|
|
|
3111
3109
|
getRef() {
|
|
3112
3110
|
return 2;
|
|
3113
3111
|
}
|
|
3114
|
-
},
|
|
3112
|
+
}, wo = (e) => {
|
|
3115
3113
|
const t = e.readLen(), r = [];
|
|
3116
3114
|
for (let n = 0; n < t; n++) {
|
|
3117
3115
|
const s = e.readString();
|
|
3118
3116
|
s === "undefined" ? r.push(void 0) : r.push(JSON.parse(s));
|
|
3119
3117
|
}
|
|
3120
|
-
return new
|
|
3121
|
-
},
|
|
3118
|
+
return new vo(r);
|
|
3119
|
+
}, mo = yt("node_env") === "development", Gt = class Ne {
|
|
3122
3120
|
constructor(t) {
|
|
3123
|
-
this.arr = t,
|
|
3121
|
+
this.arr = t, mo && Hr(t);
|
|
3124
3122
|
}
|
|
3125
3123
|
getLength() {
|
|
3126
3124
|
return this.arr.length;
|
|
@@ -3158,7 +3156,7 @@ var er = class {
|
|
|
3158
3156
|
getRef() {
|
|
3159
3157
|
return 8;
|
|
3160
3158
|
}
|
|
3161
|
-
},
|
|
3159
|
+
}, yo = (e) => {
|
|
3162
3160
|
const t = e.readLen(), r = [];
|
|
3163
3161
|
for (let n = 0; n < t; n++) r.push(e.readAny());
|
|
3164
3162
|
return new Gt(r);
|
|
@@ -3199,15 +3197,15 @@ var er = class {
|
|
|
3199
3197
|
getRef() {
|
|
3200
3198
|
return 4;
|
|
3201
3199
|
}
|
|
3202
|
-
},
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
],
|
|
3200
|
+
}, ko = (e) => new q(e.readString()), _o = [
|
|
3201
|
+
Kl,
|
|
3202
|
+
ql,
|
|
3203
|
+
eo,
|
|
3204
|
+
no,
|
|
3205
|
+
ro,
|
|
3206
|
+
lo,
|
|
3207
|
+
co
|
|
3208
|
+
], bo = 0, So = 1, Co = 2, Eo = 3, Do = 4, Ao = 5, Io = 6, P = class fs {
|
|
3211
3209
|
constructor(t) {
|
|
3212
3210
|
this.type = t;
|
|
3213
3211
|
}
|
|
@@ -3255,7 +3253,7 @@ var er = class {
|
|
|
3255
3253
|
getRef() {
|
|
3256
3254
|
return 7;
|
|
3257
3255
|
}
|
|
3258
|
-
},
|
|
3256
|
+
}, Oo = (e) => new P(_o[e.readTypeRef()](e)), Ht = (e, t, r) => {
|
|
3259
3257
|
const { client: n, clock: s } = t.id, i = new D(w(n, s + r), t, w(n, s + r - 1), t.right, t.rightOrigin, t.parent, t.parentSub, t.content.splice(r));
|
|
3260
3258
|
return t.deleted && i.markDeleted(), t.keep && (i.keep = !0), t.redone !== null && (i.redone = w(t.redone.client, t.redone.clock + r)), t.right = i, i.right !== null && (i.right.left = i), e._mergeStructs.push(i), i.parentSub !== null && i.right === null && i.parent._map.set(i.parentSub, i), t.length = r, i;
|
|
3261
3259
|
}, D = class Ue extends hr {
|
|
@@ -3290,7 +3288,7 @@ var er = class {
|
|
|
3290
3288
|
if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= b(r, this.origin.client)) return this.origin.client;
|
|
3291
3289
|
if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= b(r, this.rightOrigin.client)) return this.rightOrigin.client;
|
|
3292
3290
|
if (this.parent && this.parent.constructor === it && this.id.client !== this.parent.client && this.parent.clock >= b(r, this.parent.client)) return this.parent.client;
|
|
3293
|
-
if (this.origin && (this.left =
|
|
3291
|
+
if (this.origin && (this.left = xr(t, r, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = z(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === L || this.right && this.right.constructor === L) this.parent = null;
|
|
3294
3292
|
else if (!this.parent)
|
|
3295
3293
|
this.left && this.left.constructor === Ue ? (this.parent = this.left.parent, this.parentSub = this.left.parentSub) : this.right && this.right.constructor === Ue && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
|
|
3296
3294
|
else if (this.parent.constructor === it) {
|
|
@@ -3300,7 +3298,7 @@ var er = class {
|
|
|
3300
3298
|
return null;
|
|
3301
3299
|
}
|
|
3302
3300
|
integrate(t, r) {
|
|
3303
|
-
if (r > 0 && (this.id.clock += r, this.left =
|
|
3301
|
+
if (r > 0 && (this.id.clock += r, this.left = xr(t, t.doc.store, w(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(r), this.length -= r), this.parent) {
|
|
3304
3302
|
if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
|
|
3305
3303
|
let n = this.left, s;
|
|
3306
3304
|
if (n !== null) s = n.right;
|
|
@@ -3364,7 +3362,7 @@ var er = class {
|
|
|
3364
3362
|
}
|
|
3365
3363
|
gc(t, r) {
|
|
3366
3364
|
if (!this.deleted) throw N();
|
|
3367
|
-
this.content.gc(t), r ?
|
|
3365
|
+
this.content.gc(t), r ? xl(t, this, new L(this.id, this.length)) : this.content = new cs(this.length);
|
|
3368
3366
|
}
|
|
3369
3367
|
write(t, r) {
|
|
3370
3368
|
const n = r > 0 ? w(this.id.client, this.id.clock + r - 1) : this.origin, s = this.rightOrigin, i = this.parentSub, l = this.content.getRef() & 31 | (n === null ? 0 : 128) | (s === null ? 0 : 64) | (i === null ? 0 : 32);
|
|
@@ -3373,7 +3371,7 @@ var er = class {
|
|
|
3373
3371
|
if (o._item !== void 0) {
|
|
3374
3372
|
const c = o._item;
|
|
3375
3373
|
if (c === null) {
|
|
3376
|
-
const h =
|
|
3374
|
+
const h = Dl(o);
|
|
3377
3375
|
t.writeParentInfo(!0), t.writeString(h);
|
|
3378
3376
|
} else
|
|
3379
3377
|
t.writeParentInfo(!1), t.writeLeftID(c.id);
|
|
@@ -3382,23 +3380,23 @@ var er = class {
|
|
|
3382
3380
|
}
|
|
3383
3381
|
this.content.write(t, r);
|
|
3384
3382
|
}
|
|
3385
|
-
}, gs = (e, t) =>
|
|
3383
|
+
}, gs = (e, t) => xo[t & 31](e), xo = [
|
|
3386
3384
|
() => {
|
|
3387
3385
|
N();
|
|
3388
3386
|
},
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3387
|
+
uo,
|
|
3388
|
+
wo,
|
|
3389
|
+
ho,
|
|
3390
|
+
ko,
|
|
3391
|
+
go,
|
|
3392
|
+
po,
|
|
3393
|
+
Oo,
|
|
3394
|
+
yo,
|
|
3395
|
+
fo,
|
|
3398
3396
|
() => {
|
|
3399
3397
|
N();
|
|
3400
3398
|
}
|
|
3401
|
-
],
|
|
3399
|
+
], To = 10, $ = class extends hr {
|
|
3402
3400
|
get deleted() {
|
|
3403
3401
|
return !0;
|
|
3404
3402
|
}
|
|
@@ -3411,7 +3409,7 @@ var er = class {
|
|
|
3411
3409
|
N();
|
|
3412
3410
|
}
|
|
3413
3411
|
write(e, t) {
|
|
3414
|
-
e.writeInfo(
|
|
3412
|
+
e.writeInfo(To), v(e.restEncoder, this.length - t);
|
|
3415
3413
|
}
|
|
3416
3414
|
getMissing(e, t) {
|
|
3417
3415
|
return null;
|
|
@@ -3420,54 +3418,54 @@ var er = class {
|
|
|
3420
3418
|
ps[vs] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");
|
|
3421
3419
|
ps[vs] = !0;
|
|
3422
3420
|
export {
|
|
3423
|
-
|
|
3421
|
+
x as A,
|
|
3424
3422
|
rs as Array,
|
|
3425
|
-
|
|
3423
|
+
Lo as B,
|
|
3426
3424
|
Kt as C,
|
|
3427
3425
|
ye as D,
|
|
3428
3426
|
Pe as Doc,
|
|
3429
3427
|
vt as E,
|
|
3430
|
-
|
|
3428
|
+
Br as F,
|
|
3431
3429
|
K as H,
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3430
|
+
V as I,
|
|
3431
|
+
$o as L,
|
|
3432
|
+
Ro as M,
|
|
3435
3433
|
or as Map,
|
|
3436
|
-
|
|
3434
|
+
Es as N,
|
|
3437
3435
|
rt as O,
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3436
|
+
F as P,
|
|
3437
|
+
Vr as R,
|
|
3438
|
+
T as S,
|
|
3441
3439
|
R as T,
|
|
3442
3440
|
cr as Text,
|
|
3443
3441
|
J as U,
|
|
3444
3442
|
bs as V,
|
|
3445
3443
|
ht as _,
|
|
3446
|
-
|
|
3447
|
-
|
|
3444
|
+
sl as a,
|
|
3445
|
+
_c as applyUpdate,
|
|
3448
3446
|
nt as b,
|
|
3449
|
-
|
|
3447
|
+
Ho as c,
|
|
3450
3448
|
ot as d,
|
|
3451
|
-
|
|
3452
|
-
|
|
3449
|
+
bc as encodeStateAsUpdate,
|
|
3450
|
+
Sc as encodeStateVector,
|
|
3453
3451
|
Nt as f,
|
|
3454
|
-
|
|
3455
|
-
|
|
3452
|
+
ei as g,
|
|
3453
|
+
Yo as h,
|
|
3456
3454
|
vn as i,
|
|
3457
|
-
|
|
3455
|
+
$s as j,
|
|
3458
3456
|
v as k,
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3457
|
+
Ko as l,
|
|
3458
|
+
Jo as m,
|
|
3459
|
+
kc as n,
|
|
3462
3460
|
wn as o,
|
|
3463
|
-
|
|
3464
|
-
|
|
3461
|
+
Xo as p,
|
|
3462
|
+
wc as r,
|
|
3465
3463
|
bn as s,
|
|
3466
|
-
|
|
3467
|
-
|
|
3464
|
+
yc as t,
|
|
3465
|
+
zo as u,
|
|
3468
3466
|
wt as v,
|
|
3469
|
-
|
|
3467
|
+
Ms as w,
|
|
3470
3468
|
p as x,
|
|
3471
3469
|
lt as y,
|
|
3472
|
-
|
|
3470
|
+
Mo as z
|
|
3473
3471
|
};
|