use-abcd 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -232
- package/dist/collection.d.ts +12 -3
- package/dist/examples/TreeEditor.d.ts +2 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1624 -968
- package/dist/index.js.map +1 -1
- package/dist/item-cache.test.d.ts +1 -0
- package/dist/item.d.ts +1 -5
- package/dist/node.d.ts +50 -0
- package/dist/node.test.d.ts +1 -0
- package/dist/sync-queue.d.ts +36 -0
- package/dist/types.d.ts +4 -1
- package/dist/useCrud.d.ts +1 -1
- package/dist/useCrud.test.d.ts +1 -0
- package/dist/useCrudTree.d.ts +45 -0
- package/dist/useCrudTree.test.d.ts +1 -0
- package/dist/useItem.d.ts +1 -1
- package/dist/useNode.d.ts +25 -0
- package/dist/useSelectedNode.d.ts +12 -0
- package/dist/useSyncState.d.ts +20 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useSyncExternalStore as
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { useSyncExternalStore as j, useCallback as T, useRef as Nn, useMemo as Dn } from "react";
|
|
2
|
+
import { c as Ga } from "./chunks/types-Dy4rYb2N.js";
|
|
3
|
+
import { c as Wa, b as Va, a as Ja, f as Ya, d as Xa, s as Za } from "./chunks/client-DReyDQ23.js";
|
|
4
|
+
const v = {
|
|
5
5
|
Remove: "remove",
|
|
6
6
|
Replace: "replace",
|
|
7
7
|
Add: "add"
|
|
8
|
-
},
|
|
8
|
+
}, en = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Hn = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), ve = Symbol.iterator, E = {
|
|
9
9
|
mutable: "mutable",
|
|
10
10
|
immutable: "immutable"
|
|
11
|
-
},
|
|
12
|
-
function
|
|
11
|
+
}, tt = {};
|
|
12
|
+
function he(e, t) {
|
|
13
13
|
return e instanceof Map ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function yt(e, t) {
|
|
16
16
|
if (t in e) {
|
|
17
17
|
let n = Reflect.getPrototypeOf(e);
|
|
18
18
|
for (; n; ) {
|
|
@@ -23,89 +23,89 @@ function Ye(e, t) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function nt(e) {
|
|
27
27
|
return Object.getPrototypeOf(e) === Set.prototype;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function rt(e) {
|
|
30
30
|
return Object.getPrototypeOf(e) === Map.prototype;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function x(e) {
|
|
33
33
|
var t;
|
|
34
34
|
return (t = e.copy) !== null && t !== void 0 ? t : e.original;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return !!
|
|
36
|
+
function K(e) {
|
|
37
|
+
return !!d(e);
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return typeof e != "object" ? null : e?.[
|
|
39
|
+
function d(e) {
|
|
40
|
+
return typeof e != "object" ? null : e?.[en];
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function it(e) {
|
|
43
43
|
var t;
|
|
44
|
-
const n =
|
|
44
|
+
const n = d(e);
|
|
45
45
|
return n ? (t = n.copy) !== null && t !== void 0 ? t : n.original : e;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function $(e, t) {
|
|
48
48
|
if (!e || typeof e != "object")
|
|
49
49
|
return !1;
|
|
50
50
|
let n;
|
|
51
|
-
return Object.getPrototypeOf(e) === Object.prototype || Array.isArray(e) || e instanceof Map || e instanceof Set || !!t?.mark && ((n = t.mark(e,
|
|
51
|
+
return Object.getPrototypeOf(e) === Object.prototype || Array.isArray(e) || e instanceof Map || e instanceof Set || !!t?.mark && ((n = t.mark(e, E)) === E.immutable || typeof n == "function");
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function tn(e, t = []) {
|
|
54
54
|
if (Object.hasOwnProperty.call(e, "key")) {
|
|
55
|
-
const n = e.parent.copy, r =
|
|
55
|
+
const n = e.parent.copy, r = d(q(n, e.key));
|
|
56
56
|
if (r !== null && r?.original !== e.original)
|
|
57
57
|
return null;
|
|
58
|
-
const
|
|
59
|
-
if (!(
|
|
58
|
+
const i = e.parent.type === 3, s = i ? Array.from(e.parent.setMap.keys()).indexOf(e.key) : e.key;
|
|
59
|
+
if (!(i && n.size > s || he(n, s)))
|
|
60
60
|
return null;
|
|
61
|
-
t.push(
|
|
61
|
+
t.push(s);
|
|
62
62
|
}
|
|
63
63
|
if (e.parent)
|
|
64
|
-
return
|
|
64
|
+
return tn(e.parent, t);
|
|
65
65
|
t.reverse();
|
|
66
66
|
try {
|
|
67
|
-
|
|
67
|
+
Ln(e.copy, t);
|
|
68
68
|
} catch {
|
|
69
69
|
return null;
|
|
70
70
|
}
|
|
71
71
|
return t;
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ee(e) {
|
|
74
74
|
return Array.isArray(e) ? 1 : e instanceof Map ? 2 : e instanceof Set ? 3 : 0;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
76
|
+
function q(e, t) {
|
|
77
|
+
return ee(e) === 2 ? e.get(t) : e[t];
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
79
|
+
function be(e, t, n) {
|
|
80
|
+
ee(e) === 2 ? e.set(t, n) : e[t] = n;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
const n =
|
|
84
|
-
return (n ?
|
|
82
|
+
function Ne(e, t) {
|
|
83
|
+
const n = d(e);
|
|
84
|
+
return (n ? x(n) : e)[t];
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function H(e, t) {
|
|
87
87
|
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function Be(e) {
|
|
90
90
|
if (e)
|
|
91
91
|
for (; e.finalities.revoke.length > 0; )
|
|
92
92
|
e.finalities.revoke.pop()();
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function J(e, t) {
|
|
95
95
|
return t ? e : [""].concat(e).map((n) => {
|
|
96
96
|
const r = `${n}`;
|
|
97
97
|
return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
98
98
|
}).join("/");
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function Ln(e, t) {
|
|
101
101
|
for (let n = 0; n < t.length - 1; n += 1) {
|
|
102
102
|
const r = t[n];
|
|
103
|
-
if (e =
|
|
103
|
+
if (e = q(ee(e) === 3 ? Array.from(e) : e, r), typeof e != "object")
|
|
104
104
|
throw new Error(`Cannot resolve patch at '${t.join("/")}'.`);
|
|
105
105
|
}
|
|
106
106
|
return e;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function qn(e) {
|
|
109
109
|
const t = Object.create(Object.getPrototypeOf(e));
|
|
110
110
|
return Reflect.ownKeys(e).forEach((n) => {
|
|
111
111
|
let r = Reflect.getOwnPropertyDescriptor(e, n);
|
|
@@ -121,26 +121,26 @@ function Zt(e) {
|
|
|
121
121
|
}), Reflect.defineProperty(t, n, r);
|
|
122
122
|
}), t;
|
|
123
123
|
}
|
|
124
|
-
const
|
|
125
|
-
function
|
|
124
|
+
const Qn = Object.prototype.propertyIsEnumerable;
|
|
125
|
+
function nn(e, t) {
|
|
126
126
|
let n;
|
|
127
127
|
if (Array.isArray(e))
|
|
128
128
|
return Array.prototype.concat.call(e);
|
|
129
129
|
if (e instanceof Set) {
|
|
130
|
-
if (!
|
|
130
|
+
if (!nt(e)) {
|
|
131
131
|
const r = Object.getPrototypeOf(e).constructor;
|
|
132
132
|
return new r(e.values());
|
|
133
133
|
}
|
|
134
134
|
return Set.prototype.difference ? Set.prototype.difference.call(e, /* @__PURE__ */ new Set()) : new Set(e.values());
|
|
135
135
|
} else if (e instanceof Map) {
|
|
136
|
-
if (!
|
|
136
|
+
if (!rt(e)) {
|
|
137
137
|
const r = Object.getPrototypeOf(e).constructor;
|
|
138
138
|
return new r(e);
|
|
139
139
|
}
|
|
140
140
|
return new Map(e);
|
|
141
|
-
} else if (t?.mark && (n = t.mark(e,
|
|
142
|
-
if (n ===
|
|
143
|
-
return
|
|
141
|
+
} else if (t?.mark && (n = t.mark(e, E), n !== void 0) && n !== E.mutable) {
|
|
142
|
+
if (n === E.immutable)
|
|
143
|
+
return qn(e);
|
|
144
144
|
if (typeof n == "function") {
|
|
145
145
|
if (t.enablePatches || t.enableAutoFreeze)
|
|
146
146
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
@@ -149,36 +149,36 @@ function At(e, t) {
|
|
|
149
149
|
throw new Error(`Unsupported mark result: ${n}`);
|
|
150
150
|
} else if (typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype) {
|
|
151
151
|
const r = {};
|
|
152
|
-
return Object.keys(e).forEach((
|
|
153
|
-
r[
|
|
154
|
-
}), Object.getOwnPropertySymbols(e).forEach((
|
|
155
|
-
|
|
152
|
+
return Object.keys(e).forEach((i) => {
|
|
153
|
+
r[i] = e[i];
|
|
154
|
+
}), Object.getOwnPropertySymbols(e).forEach((i) => {
|
|
155
|
+
Qn.call(e, i) && (r[i] = e[i]);
|
|
156
156
|
}), r;
|
|
157
157
|
} else
|
|
158
158
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
e.copy || (e.copy =
|
|
160
|
+
function A(e) {
|
|
161
|
+
e.copy || (e.copy = nn(e.original, e.options));
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
if (
|
|
165
|
-
return
|
|
163
|
+
function le(e) {
|
|
164
|
+
if (!$(e))
|
|
165
|
+
return it(e);
|
|
166
166
|
if (Array.isArray(e))
|
|
167
|
-
return e.map(
|
|
167
|
+
return e.map(le);
|
|
168
168
|
if (e instanceof Map) {
|
|
169
|
-
const n = Array.from(e.entries()).map(([r,
|
|
169
|
+
const n = Array.from(e.entries()).map(([r, i]) => [
|
|
170
170
|
r,
|
|
171
|
-
|
|
171
|
+
le(i)
|
|
172
172
|
]);
|
|
173
|
-
if (!
|
|
173
|
+
if (!rt(e)) {
|
|
174
174
|
const r = Object.getPrototypeOf(e).constructor;
|
|
175
175
|
return new r(n);
|
|
176
176
|
}
|
|
177
177
|
return new Map(n);
|
|
178
178
|
}
|
|
179
179
|
if (e instanceof Set) {
|
|
180
|
-
const n = Array.from(e).map(
|
|
181
|
-
if (!
|
|
180
|
+
const n = Array.from(e).map(le);
|
|
181
|
+
if (!nt(e)) {
|
|
182
182
|
const r = Object.getPrototypeOf(e).constructor;
|
|
183
183
|
return new r(n);
|
|
184
184
|
}
|
|
@@ -186,196 +186,196 @@ function ee(e) {
|
|
|
186
186
|
}
|
|
187
187
|
const t = Object.create(Object.getPrototypeOf(e));
|
|
188
188
|
for (const n in e)
|
|
189
|
-
t[n] =
|
|
189
|
+
t[n] = le(e[n]);
|
|
190
190
|
return t;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
return
|
|
192
|
+
function we(e) {
|
|
193
|
+
return K(e) ? le(e) : e;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function z(e) {
|
|
196
196
|
var t;
|
|
197
|
-
e.assignedMap = (t = e.assignedMap) !== null && t !== void 0 ? t : /* @__PURE__ */ new Map(), e.operated || (e.operated = !0, e.parent &&
|
|
197
|
+
e.assignedMap = (t = e.assignedMap) !== null && t !== void 0 ? t : /* @__PURE__ */ new Map(), e.operated || (e.operated = !0, e.parent && z(e.parent));
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function gt() {
|
|
200
200
|
throw new Error("Cannot modify frozen object");
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function se(e, t, n, r, i) {
|
|
203
203
|
{
|
|
204
|
-
n = n ?? /* @__PURE__ */ new WeakMap(), r = r ?? [],
|
|
204
|
+
n = n ?? /* @__PURE__ */ new WeakMap(), r = r ?? [], i = i ?? [];
|
|
205
205
|
const o = n.has(e) ? n.get(e) : e;
|
|
206
206
|
if (r.length > 0) {
|
|
207
207
|
const a = r.indexOf(o);
|
|
208
208
|
if (o && typeof o == "object" && a !== -1)
|
|
209
|
-
throw r[0] === o ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${
|
|
209
|
+
throw r[0] === o ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0, a).map((c, u) => {
|
|
210
210
|
if (typeof c == "symbol")
|
|
211
211
|
return `[${c.toString()}]`;
|
|
212
|
-
const
|
|
213
|
-
return typeof c == "object" && (
|
|
212
|
+
const l = r[u];
|
|
213
|
+
return typeof c == "object" && (l instanceof Map || l instanceof Set) ? Array.from(l.keys()).indexOf(c) : c;
|
|
214
214
|
}).join("/")}`);
|
|
215
|
-
r.push(o),
|
|
215
|
+
r.push(o), i.push(t);
|
|
216
216
|
} else
|
|
217
217
|
r.push(o);
|
|
218
218
|
}
|
|
219
|
-
if (Object.isFrozen(e) ||
|
|
220
|
-
r.pop(),
|
|
219
|
+
if (Object.isFrozen(e) || K(e)) {
|
|
220
|
+
r.pop(), i.pop();
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
-
switch (
|
|
223
|
+
switch (ee(e)) {
|
|
224
224
|
case 2:
|
|
225
225
|
for (const [a, c] of e)
|
|
226
|
-
|
|
227
|
-
e.set = e.clear = e.delete =
|
|
226
|
+
se(a, a, n, r, i), se(c, a, n, r, i);
|
|
227
|
+
e.set = e.clear = e.delete = gt;
|
|
228
228
|
break;
|
|
229
229
|
case 3:
|
|
230
230
|
for (const a of e)
|
|
231
|
-
|
|
232
|
-
e.add = e.clear = e.delete =
|
|
231
|
+
se(a, a, n, r, i);
|
|
232
|
+
e.add = e.clear = e.delete = gt;
|
|
233
233
|
break;
|
|
234
234
|
case 1:
|
|
235
235
|
Object.freeze(e);
|
|
236
236
|
let o = 0;
|
|
237
237
|
for (const a of e)
|
|
238
|
-
|
|
238
|
+
se(a, o, n, r, i), o += 1;
|
|
239
239
|
break;
|
|
240
240
|
default:
|
|
241
241
|
Object.freeze(e), Object.keys(e).forEach((a) => {
|
|
242
242
|
const c = e[a];
|
|
243
|
-
|
|
243
|
+
se(c, a, n, r, i);
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
r.pop(),
|
|
246
|
+
r.pop(), i.pop();
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
const n =
|
|
248
|
+
function st(e, t) {
|
|
249
|
+
const n = ee(e);
|
|
250
250
|
if (n === 0)
|
|
251
251
|
Reflect.ownKeys(e).forEach((r) => {
|
|
252
252
|
t(r, e[r], e);
|
|
253
253
|
});
|
|
254
254
|
else if (n === 1) {
|
|
255
255
|
let r = 0;
|
|
256
|
-
for (const
|
|
257
|
-
t(r,
|
|
256
|
+
for (const i of e)
|
|
257
|
+
t(r, i, e), r += 1;
|
|
258
258
|
} else
|
|
259
|
-
e.forEach((r,
|
|
259
|
+
e.forEach((r, i) => t(i, r, e));
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
if (
|
|
261
|
+
function rn(e, t, n) {
|
|
262
|
+
if (K(e) || !$(e, n) || t.has(e) || Object.isFrozen(e))
|
|
263
263
|
return;
|
|
264
|
-
const r = e instanceof Set,
|
|
265
|
-
if (t.add(e),
|
|
264
|
+
const r = e instanceof Set, i = r ? /* @__PURE__ */ new Map() : void 0;
|
|
265
|
+
if (t.add(e), st(e, (s, o) => {
|
|
266
266
|
var a;
|
|
267
|
-
if (
|
|
268
|
-
const c =
|
|
269
|
-
|
|
267
|
+
if (K(o)) {
|
|
268
|
+
const c = d(o);
|
|
269
|
+
A(c);
|
|
270
270
|
const u = !((a = c.assignedMap) === null || a === void 0) && a.size || c.operated ? c.copy : c.original;
|
|
271
|
-
|
|
271
|
+
be(r ? i : e, s, u);
|
|
272
272
|
} else
|
|
273
|
-
|
|
274
|
-
}),
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
|
|
273
|
+
rn(o, t, n);
|
|
274
|
+
}), i) {
|
|
275
|
+
const s = e, o = Array.from(s);
|
|
276
|
+
s.clear(), o.forEach((a) => {
|
|
277
|
+
s.add(i.has(a) ? i.get(a) : a);
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Bn(e, t) {
|
|
282
282
|
const n = e.type === 3 ? e.setMap : e.copy;
|
|
283
|
-
e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n &&
|
|
283
|
+
e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n && rn(q(n, t), e.finalities.handledSet, e.options);
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Ue(e) {
|
|
286
286
|
e.type === 3 && e.copy && (e.copy.clear(), e.setMap.forEach((t) => {
|
|
287
|
-
e.copy.add(
|
|
287
|
+
e.copy.add(it(t));
|
|
288
288
|
}));
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function Ge(e, t, n, r) {
|
|
291
291
|
if (e.operated && e.assignedMap && e.assignedMap.size > 0 && !e.finalized) {
|
|
292
292
|
if (n && r) {
|
|
293
|
-
const
|
|
294
|
-
|
|
293
|
+
const s = tn(e);
|
|
294
|
+
s && t(e, s, n, r);
|
|
295
295
|
}
|
|
296
296
|
e.finalized = !0;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
const
|
|
301
|
-
|
|
299
|
+
function ot(e, t, n, r) {
|
|
300
|
+
const i = d(n);
|
|
301
|
+
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((s, o) => {
|
|
302
302
|
var a;
|
|
303
303
|
const c = e.type === 3 ? e.setMap : e.copy;
|
|
304
|
-
if (
|
|
305
|
-
let u =
|
|
306
|
-
|
|
304
|
+
if (H(q(c, t), n)) {
|
|
305
|
+
let u = i.original;
|
|
306
|
+
i.copy && (u = i.copy), Ue(e), Ge(e, r, s, o), e.options.enableAutoFreeze && (e.options.updatedValues = (a = e.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), e.options.updatedValues.set(u, i.original)), be(c, t, u);
|
|
307
307
|
}
|
|
308
|
-
}), e.options.enableAutoFreeze &&
|
|
309
|
-
const
|
|
310
|
-
|
|
308
|
+
}), e.options.enableAutoFreeze && i.finalities !== e.finalities && (e.options.enableAutoFreeze = !1)), $(n, e.options) && e.finalities.draft.push(() => {
|
|
309
|
+
const s = e.type === 3 ? e.setMap : e.copy;
|
|
310
|
+
H(q(s, t), n) && Bn(e, t);
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
let { original:
|
|
315
|
-
c.length <
|
|
316
|
-
for (let u = 0; u <
|
|
317
|
-
if (o.get(u.toString()) && c[u] !==
|
|
318
|
-
const
|
|
313
|
+
function Un(e, t, n, r, i) {
|
|
314
|
+
let { original: s, assignedMap: o, options: a } = e, c = e.copy;
|
|
315
|
+
c.length < s.length && ([s, c] = [c, s], [n, r] = [r, n]);
|
|
316
|
+
for (let u = 0; u < s.length; u += 1)
|
|
317
|
+
if (o.get(u.toString()) && c[u] !== s[u]) {
|
|
318
|
+
const l = t.concat([u]), f = J(l, i);
|
|
319
319
|
n.push({
|
|
320
|
-
op:
|
|
321
|
-
path:
|
|
320
|
+
op: v.Replace,
|
|
321
|
+
path: f,
|
|
322
322
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
323
|
-
value:
|
|
323
|
+
value: we(c[u])
|
|
324
324
|
}), r.push({
|
|
325
|
-
op:
|
|
326
|
-
path:
|
|
325
|
+
op: v.Replace,
|
|
326
|
+
path: f,
|
|
327
327
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
328
|
-
value:
|
|
328
|
+
value: we(s[u])
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
|
-
for (let u =
|
|
332
|
-
const
|
|
331
|
+
for (let u = s.length; u < c.length; u += 1) {
|
|
332
|
+
const l = t.concat([u]), f = J(l, i);
|
|
333
333
|
n.push({
|
|
334
|
-
op:
|
|
335
|
-
path:
|
|
334
|
+
op: v.Add,
|
|
335
|
+
path: f,
|
|
336
336
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
337
|
-
value:
|
|
337
|
+
value: we(c[u])
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
|
-
if (
|
|
340
|
+
if (s.length < c.length) {
|
|
341
341
|
const { arrayLengthAssignment: u = !0 } = a.enablePatches;
|
|
342
342
|
if (u) {
|
|
343
|
-
const
|
|
343
|
+
const l = t.concat(["length"]), f = J(l, i);
|
|
344
344
|
r.push({
|
|
345
|
-
op:
|
|
346
|
-
path:
|
|
347
|
-
value:
|
|
345
|
+
op: v.Replace,
|
|
346
|
+
path: f,
|
|
347
|
+
value: s.length
|
|
348
348
|
});
|
|
349
349
|
} else
|
|
350
|
-
for (let
|
|
351
|
-
const
|
|
350
|
+
for (let l = c.length; s.length < l; l -= 1) {
|
|
351
|
+
const f = t.concat([l - 1]), h = J(f, i);
|
|
352
352
|
r.push({
|
|
353
|
-
op:
|
|
354
|
-
path:
|
|
353
|
+
op: v.Remove,
|
|
354
|
+
path: h
|
|
355
355
|
});
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Gn({ original: e, copy: t, assignedMap: n }, r, i, s, o) {
|
|
360
360
|
n.forEach((a, c) => {
|
|
361
|
-
const u =
|
|
362
|
-
if (
|
|
361
|
+
const u = q(e, c), l = we(q(t, c)), f = a ? he(e, c) ? v.Replace : v.Add : v.Remove;
|
|
362
|
+
if (H(u, l) && f === v.Replace)
|
|
363
363
|
return;
|
|
364
|
-
const
|
|
365
|
-
|
|
364
|
+
const h = r.concat(c), p = J(h, o);
|
|
365
|
+
i.push(f === v.Remove ? { op: f, path: p } : { op: f, path: p, value: l }), s.push(f === v.Add ? { op: v.Remove, path: p } : f === v.Remove ? { op: v.Add, path: p, value: u } : { op: v.Replace, path: p, value: u });
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Kn({ original: e, copy: t }, n, r, i, s) {
|
|
369
369
|
let o = 0;
|
|
370
370
|
e.forEach((a) => {
|
|
371
371
|
if (!t.has(a)) {
|
|
372
|
-
const c = n.concat([o]), u =
|
|
372
|
+
const c = n.concat([o]), u = J(c, s);
|
|
373
373
|
r.push({
|
|
374
|
-
op:
|
|
374
|
+
op: v.Remove,
|
|
375
375
|
path: u,
|
|
376
376
|
value: a
|
|
377
|
-
}),
|
|
378
|
-
op:
|
|
377
|
+
}), i.unshift({
|
|
378
|
+
op: v.Add,
|
|
379
379
|
path: u,
|
|
380
380
|
value: a
|
|
381
381
|
});
|
|
@@ -383,13 +383,13 @@ function nn({ original: e, copy: t }, n, r, s, i) {
|
|
|
383
383
|
o += 1;
|
|
384
384
|
}), o = 0, t.forEach((a) => {
|
|
385
385
|
if (!e.has(a)) {
|
|
386
|
-
const c = n.concat([o]), u =
|
|
386
|
+
const c = n.concat([o]), u = J(c, s);
|
|
387
387
|
r.push({
|
|
388
|
-
op:
|
|
388
|
+
op: v.Add,
|
|
389
389
|
path: u,
|
|
390
390
|
value: a
|
|
391
|
-
}),
|
|
392
|
-
op:
|
|
391
|
+
}), i.unshift({
|
|
392
|
+
op: v.Remove,
|
|
393
393
|
path: u,
|
|
394
394
|
value: a
|
|
395
395
|
});
|
|
@@ -397,74 +397,74 @@ function nn({ original: e, copy: t }, n, r, s, i) {
|
|
|
397
397
|
o += 1;
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
const { pathAsArray:
|
|
400
|
+
function _e(e, t, n, r) {
|
|
401
|
+
const { pathAsArray: i = !0 } = e.options.enablePatches;
|
|
402
402
|
switch (e.type) {
|
|
403
403
|
case 0:
|
|
404
404
|
case 2:
|
|
405
|
-
return
|
|
405
|
+
return Gn(e, t, n, r, i);
|
|
406
406
|
case 1:
|
|
407
|
-
return
|
|
407
|
+
return Un(e, t, n, r, i);
|
|
408
408
|
case 3:
|
|
409
|
-
return
|
|
409
|
+
return Kn(e, t, n, r, i);
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
const
|
|
413
|
-
if (typeof e == "object" && e !== null && (
|
|
412
|
+
const Ae = (e, t, n = !1) => {
|
|
413
|
+
if (typeof e == "object" && e !== null && (!$(e, t) || n))
|
|
414
414
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
415
|
-
},
|
|
415
|
+
}, Ke = {
|
|
416
416
|
get size() {
|
|
417
|
-
return
|
|
417
|
+
return x(d(this)).size;
|
|
418
418
|
},
|
|
419
419
|
has(e) {
|
|
420
|
-
return
|
|
420
|
+
return x(d(this)).has(e);
|
|
421
421
|
},
|
|
422
422
|
set(e, t) {
|
|
423
|
-
const n =
|
|
424
|
-
return (!r.has(e) || !
|
|
423
|
+
const n = d(this), r = x(n);
|
|
424
|
+
return (!r.has(e) || !H(r.get(e), t)) && (A(n), z(n), n.assignedMap.set(e, !0), n.copy.set(e, t), ot(n, e, t, _e)), this;
|
|
425
425
|
},
|
|
426
426
|
delete(e) {
|
|
427
427
|
if (!this.has(e))
|
|
428
428
|
return !1;
|
|
429
|
-
const t =
|
|
430
|
-
return
|
|
429
|
+
const t = d(this);
|
|
430
|
+
return A(t), z(t), t.original.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.copy.delete(e), !0;
|
|
431
431
|
},
|
|
432
432
|
clear() {
|
|
433
|
-
const e =
|
|
433
|
+
const e = d(this);
|
|
434
434
|
if (this.size) {
|
|
435
|
-
|
|
435
|
+
A(e), z(e), e.assignedMap = /* @__PURE__ */ new Map();
|
|
436
436
|
for (const [t] of e.original)
|
|
437
437
|
e.assignedMap.set(t, !1);
|
|
438
438
|
e.copy.clear();
|
|
439
439
|
}
|
|
440
440
|
},
|
|
441
441
|
forEach(e, t) {
|
|
442
|
-
const n =
|
|
443
|
-
|
|
444
|
-
e.call(t, this.get(
|
|
442
|
+
const n = d(this);
|
|
443
|
+
x(n).forEach((r, i) => {
|
|
444
|
+
e.call(t, this.get(i), i, this);
|
|
445
445
|
});
|
|
446
446
|
},
|
|
447
447
|
get(e) {
|
|
448
448
|
var t, n;
|
|
449
|
-
const r =
|
|
450
|
-
if (r.options.strict &&
|
|
451
|
-
return
|
|
452
|
-
const o =
|
|
453
|
-
original:
|
|
449
|
+
const r = d(this), i = x(r).get(e), s = ((n = (t = r.options).mark) === null || n === void 0 ? void 0 : n.call(t, i, E)) === E.mutable;
|
|
450
|
+
if (r.options.strict && Ae(i, r.options, s), s || r.finalized || !$(i, r.options) || i !== r.original.get(e))
|
|
451
|
+
return i;
|
|
452
|
+
const o = tt.createDraft({
|
|
453
|
+
original: i,
|
|
454
454
|
parentDraft: r,
|
|
455
455
|
key: e,
|
|
456
456
|
finalities: r.finalities,
|
|
457
457
|
options: r.options
|
|
458
458
|
});
|
|
459
|
-
return
|
|
459
|
+
return A(r), r.copy.set(e, o), o;
|
|
460
460
|
},
|
|
461
461
|
keys() {
|
|
462
|
-
return
|
|
462
|
+
return x(d(this)).keys();
|
|
463
463
|
},
|
|
464
464
|
values() {
|
|
465
465
|
const e = this.keys();
|
|
466
466
|
return {
|
|
467
|
-
[
|
|
467
|
+
[ve]: () => this.values(),
|
|
468
468
|
next: () => {
|
|
469
469
|
const t = e.next();
|
|
470
470
|
return t.done ? t : {
|
|
@@ -477,7 +477,7 @@ const he = (e, t, n = !1) => {
|
|
|
477
477
|
entries() {
|
|
478
478
|
const e = this.keys();
|
|
479
479
|
return {
|
|
480
|
-
[
|
|
480
|
+
[ve]: () => this.entries(),
|
|
481
481
|
next: () => {
|
|
482
482
|
const t = e.next();
|
|
483
483
|
if (t.done)
|
|
@@ -490,80 +490,80 @@ const he = (e, t, n = !1) => {
|
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
492
|
},
|
|
493
|
-
[
|
|
493
|
+
[ve]() {
|
|
494
494
|
return this.entries();
|
|
495
495
|
}
|
|
496
|
-
},
|
|
497
|
-
var r,
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
500
|
-
return
|
|
501
|
-
const o =
|
|
496
|
+
}, Wn = Reflect.ownKeys(Ke), bt = (e, t, { isValuesIterator: n }) => () => {
|
|
497
|
+
var r, i;
|
|
498
|
+
const s = t.next();
|
|
499
|
+
if (s.done)
|
|
500
|
+
return s;
|
|
501
|
+
const o = s.value;
|
|
502
502
|
let a = e.setMap.get(o);
|
|
503
|
-
const c =
|
|
504
|
-
if (e.options.strict &&
|
|
505
|
-
const
|
|
503
|
+
const c = d(a), u = ((i = (r = e.options).mark) === null || i === void 0 ? void 0 : i.call(r, a, E)) === E.mutable;
|
|
504
|
+
if (e.options.strict && Ae(o, e.options, u), !u && !c && $(o, e.options) && !e.finalized && e.original.has(o)) {
|
|
505
|
+
const l = tt.createDraft({
|
|
506
506
|
original: o,
|
|
507
507
|
parentDraft: e,
|
|
508
508
|
key: o,
|
|
509
509
|
finalities: e.finalities,
|
|
510
510
|
options: e.options
|
|
511
511
|
});
|
|
512
|
-
e.setMap.set(o,
|
|
512
|
+
e.setMap.set(o, l), a = l;
|
|
513
513
|
} else c && (a = c.proxy);
|
|
514
514
|
return {
|
|
515
515
|
done: !1,
|
|
516
516
|
value: n ? a : [a, a]
|
|
517
517
|
};
|
|
518
|
-
},
|
|
518
|
+
}, Pe = {
|
|
519
519
|
get size() {
|
|
520
|
-
return
|
|
520
|
+
return d(this).setMap.size;
|
|
521
521
|
},
|
|
522
522
|
has(e) {
|
|
523
|
-
const t =
|
|
523
|
+
const t = d(this);
|
|
524
524
|
if (t.setMap.has(e))
|
|
525
525
|
return !0;
|
|
526
|
-
|
|
527
|
-
const n =
|
|
526
|
+
A(t);
|
|
527
|
+
const n = d(e);
|
|
528
528
|
return !!(n && t.setMap.has(n.original));
|
|
529
529
|
},
|
|
530
530
|
add(e) {
|
|
531
|
-
const t =
|
|
532
|
-
return this.has(e) || (
|
|
531
|
+
const t = d(this);
|
|
532
|
+
return this.has(e) || (A(t), z(t), t.assignedMap.set(e, !0), t.setMap.set(e, e), ot(t, e, e, _e)), this;
|
|
533
533
|
},
|
|
534
534
|
delete(e) {
|
|
535
535
|
if (!this.has(e))
|
|
536
536
|
return !1;
|
|
537
|
-
const t =
|
|
538
|
-
|
|
539
|
-
const n =
|
|
537
|
+
const t = d(this);
|
|
538
|
+
A(t), z(t);
|
|
539
|
+
const n = d(e);
|
|
540
540
|
return n && t.setMap.has(n.original) ? (t.assignedMap.set(n.original, !1), t.setMap.delete(n.original)) : (!n && t.setMap.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.setMap.delete(e));
|
|
541
541
|
},
|
|
542
542
|
clear() {
|
|
543
543
|
if (!this.size)
|
|
544
544
|
return;
|
|
545
|
-
const e =
|
|
546
|
-
|
|
545
|
+
const e = d(this);
|
|
546
|
+
A(e), z(e);
|
|
547
547
|
for (const t of e.original)
|
|
548
548
|
e.assignedMap.set(t, !1);
|
|
549
549
|
e.setMap.clear();
|
|
550
550
|
},
|
|
551
551
|
values() {
|
|
552
|
-
const e =
|
|
553
|
-
|
|
552
|
+
const e = d(this);
|
|
553
|
+
A(e);
|
|
554
554
|
const t = e.setMap.keys();
|
|
555
555
|
return {
|
|
556
556
|
[Symbol.iterator]: () => this.values(),
|
|
557
|
-
next:
|
|
557
|
+
next: bt(e, t, { isValuesIterator: !0 })
|
|
558
558
|
};
|
|
559
559
|
},
|
|
560
560
|
entries() {
|
|
561
|
-
const e =
|
|
562
|
-
|
|
561
|
+
const e = d(this);
|
|
562
|
+
A(e);
|
|
563
563
|
const t = e.setMap.keys();
|
|
564
564
|
return {
|
|
565
565
|
[Symbol.iterator]: () => this.entries(),
|
|
566
|
-
next:
|
|
566
|
+
next: bt(e, t, {
|
|
567
567
|
isValuesIterator: !1
|
|
568
568
|
})
|
|
569
569
|
};
|
|
@@ -571,7 +571,7 @@ const he = (e, t, n = !1) => {
|
|
|
571
571
|
keys() {
|
|
572
572
|
return this.values();
|
|
573
573
|
},
|
|
574
|
-
[
|
|
574
|
+
[ve]() {
|
|
575
575
|
return this.values();
|
|
576
576
|
},
|
|
577
577
|
forEach(e, t) {
|
|
@@ -581,7 +581,7 @@ const he = (e, t, n = !1) => {
|
|
|
581
581
|
e.call(t, r.value, r.value, this), r = n.next();
|
|
582
582
|
}
|
|
583
583
|
};
|
|
584
|
-
Set.prototype.difference && Object.assign(
|
|
584
|
+
Set.prototype.difference && Object.assign(Pe, {
|
|
585
585
|
intersection(e) {
|
|
586
586
|
return Set.prototype.intersection.call(new Set(this.values()), e);
|
|
587
587
|
},
|
|
@@ -604,71 +604,71 @@ Set.prototype.difference && Object.assign(pe, {
|
|
|
604
604
|
return Set.prototype.isDisjointFrom.call(new Set(this.values()), e);
|
|
605
605
|
}
|
|
606
606
|
});
|
|
607
|
-
const
|
|
607
|
+
const Vn = Reflect.ownKeys(Pe), sn = {
|
|
608
608
|
get(e, t, n) {
|
|
609
|
-
var r,
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
return
|
|
613
|
-
if (t ===
|
|
609
|
+
var r, i;
|
|
610
|
+
const s = (r = e.copy) === null || r === void 0 ? void 0 : r[t];
|
|
611
|
+
if (s && e.finalities.draftsCache.has(s))
|
|
612
|
+
return s;
|
|
613
|
+
if (t === en)
|
|
614
614
|
return e;
|
|
615
615
|
let o;
|
|
616
616
|
if (e.options.mark) {
|
|
617
617
|
const u = t === "size" && (e.original instanceof Map || e.original instanceof Set) ? Reflect.get(e.original, t) : Reflect.get(e.original, t, n);
|
|
618
|
-
if (o = e.options.mark(u,
|
|
619
|
-
return e.options.strict &&
|
|
618
|
+
if (o = e.options.mark(u, E), o === E.mutable)
|
|
619
|
+
return e.options.strict && Ae(u, e.options, !0), u;
|
|
620
620
|
}
|
|
621
|
-
const a =
|
|
622
|
-
if (a instanceof Map &&
|
|
623
|
-
return t === "size" ? Object.getOwnPropertyDescriptor(
|
|
624
|
-
if (a instanceof Set &&
|
|
625
|
-
return t === "size" ? Object.getOwnPropertyDescriptor(
|
|
626
|
-
if (!
|
|
627
|
-
const u =
|
|
621
|
+
const a = x(e);
|
|
622
|
+
if (a instanceof Map && Wn.includes(t))
|
|
623
|
+
return t === "size" ? Object.getOwnPropertyDescriptor(Ke, "size").get.call(e.proxy) : Ke[t].bind(e.proxy);
|
|
624
|
+
if (a instanceof Set && Vn.includes(t))
|
|
625
|
+
return t === "size" ? Object.getOwnPropertyDescriptor(Pe, "size").get.call(e.proxy) : Pe[t].bind(e.proxy);
|
|
626
|
+
if (!he(a, t)) {
|
|
627
|
+
const u = yt(a, t);
|
|
628
628
|
return u ? "value" in u ? u.value : (
|
|
629
629
|
// !case: support for getter
|
|
630
|
-
(
|
|
630
|
+
(i = u.get) === null || i === void 0 ? void 0 : i.call(e.proxy)
|
|
631
631
|
) : void 0;
|
|
632
632
|
}
|
|
633
633
|
const c = a[t];
|
|
634
|
-
if (e.options.strict &&
|
|
634
|
+
if (e.options.strict && Ae(c, e.options), e.finalized || !$(c, e.options))
|
|
635
635
|
return c;
|
|
636
|
-
if (c ===
|
|
637
|
-
if (
|
|
636
|
+
if (c === Ne(e.original, t)) {
|
|
637
|
+
if (A(e), e.copy[t] = at({
|
|
638
638
|
original: e.original[t],
|
|
639
639
|
parentDraft: e,
|
|
640
640
|
key: e.type === 1 ? Number(t) : t,
|
|
641
641
|
finalities: e.finalities,
|
|
642
642
|
options: e.options
|
|
643
643
|
}), typeof o == "function") {
|
|
644
|
-
const u =
|
|
645
|
-
return
|
|
644
|
+
const u = d(e.copy[t]);
|
|
645
|
+
return A(u), z(u), u.copy;
|
|
646
646
|
}
|
|
647
647
|
return e.copy[t];
|
|
648
648
|
}
|
|
649
|
-
return
|
|
649
|
+
return K(c) && e.finalities.draftsCache.add(c), c;
|
|
650
650
|
},
|
|
651
651
|
set(e, t, n) {
|
|
652
652
|
var r;
|
|
653
653
|
if (e.type === 3 || e.type === 2)
|
|
654
654
|
throw new Error("Map/Set draft does not support any property assignment.");
|
|
655
|
-
let
|
|
656
|
-
if (e.type === 1 && t !== "length" && !(Number.isInteger(
|
|
655
|
+
let i;
|
|
656
|
+
if (e.type === 1 && t !== "length" && !(Number.isInteger(i = Number(t)) && i >= 0 && (t === 0 || i === 0 || String(i) === String(t))))
|
|
657
657
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
658
|
-
const
|
|
659
|
-
if (
|
|
660
|
-
return
|
|
661
|
-
const o =
|
|
662
|
-
return a &&
|
|
658
|
+
const s = yt(x(e), t);
|
|
659
|
+
if (s?.set)
|
|
660
|
+
return s.set.call(e.proxy, n), !0;
|
|
661
|
+
const o = Ne(x(e), t), a = d(o);
|
|
662
|
+
return a && H(a.original, n) ? (e.copy[t] = n, e.assignedMap = (r = e.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), e.assignedMap.set(t, !1), !0) : (H(n, o) && (n !== void 0 || he(e.original, t)) || (A(e), z(e), he(e.original, t) && H(n, e.original[t]) ? e.assignedMap.delete(t) : e.assignedMap.set(t, !0), e.copy[t] = n, ot(e, t, n, _e)), !0);
|
|
663
663
|
},
|
|
664
664
|
has(e, t) {
|
|
665
|
-
return t in
|
|
665
|
+
return t in x(e);
|
|
666
666
|
},
|
|
667
667
|
ownKeys(e) {
|
|
668
|
-
return Reflect.ownKeys(
|
|
668
|
+
return Reflect.ownKeys(x(e));
|
|
669
669
|
},
|
|
670
670
|
getOwnPropertyDescriptor(e, t) {
|
|
671
|
-
const n =
|
|
671
|
+
const n = x(e), r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
672
672
|
return r && {
|
|
673
673
|
writable: !0,
|
|
674
674
|
configurable: e.type !== 1 || t !== "length",
|
|
@@ -687,62 +687,62 @@ const sn = Reflect.ownKeys(pe), Et = {
|
|
|
687
687
|
},
|
|
688
688
|
deleteProperty(e, t) {
|
|
689
689
|
var n;
|
|
690
|
-
return e.type === 1 ?
|
|
690
|
+
return e.type === 1 ? sn.set.call(this, e, t, void 0, e.proxy) : (Ne(e.original, t) !== void 0 || t in e.original ? (A(e), z(e), e.assignedMap.set(t, !1)) : (e.assignedMap = (n = e.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), e.assignedMap.delete(t)), e.copy && delete e.copy[t], !0);
|
|
691
691
|
}
|
|
692
692
|
};
|
|
693
|
-
function
|
|
694
|
-
const { original: t, parentDraft: n, key: r, finalities:
|
|
693
|
+
function at(e) {
|
|
694
|
+
const { original: t, parentDraft: n, key: r, finalities: i, options: s } = e, o = ee(t), a = {
|
|
695
695
|
type: o,
|
|
696
696
|
finalized: !1,
|
|
697
697
|
parent: n,
|
|
698
698
|
original: t,
|
|
699
699
|
copy: null,
|
|
700
700
|
proxy: null,
|
|
701
|
-
finalities:
|
|
702
|
-
options:
|
|
701
|
+
finalities: i,
|
|
702
|
+
options: s,
|
|
703
703
|
// Mapping of draft Set items to their corresponding draft values.
|
|
704
704
|
setMap: o === 3 ? new Map(t.entries()) : void 0
|
|
705
705
|
};
|
|
706
706
|
(r || "key" in e) && (a.key = r);
|
|
707
|
-
const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a,
|
|
708
|
-
if (
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
var
|
|
712
|
-
const
|
|
713
|
-
let
|
|
714
|
-
const
|
|
715
|
-
if (
|
|
716
|
-
let
|
|
717
|
-
|
|
707
|
+
const { proxy: c, revoke: u } = Proxy.revocable(o === 1 ? Object.assign([], a) : a, sn);
|
|
708
|
+
if (i.revoke.push(u), a.proxy = c, n) {
|
|
709
|
+
const l = n;
|
|
710
|
+
l.finalities.draft.push((f, h) => {
|
|
711
|
+
var p, g;
|
|
712
|
+
const b = d(c);
|
|
713
|
+
let w = l.type === 3 ? l.setMap : l.copy;
|
|
714
|
+
const C = q(w, r), S = d(C);
|
|
715
|
+
if (S) {
|
|
716
|
+
let P = S.original;
|
|
717
|
+
S.operated && (P = it(C)), Ue(S), Ge(S, _e, f, h), l.options.enableAutoFreeze && (l.options.updatedValues = (p = l.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(P, S.original)), be(w, r, P);
|
|
718
718
|
}
|
|
719
|
-
(
|
|
720
|
-
|
|
719
|
+
(g = b.callbacks) === null || g === void 0 || g.forEach((P) => {
|
|
720
|
+
P(f, h);
|
|
721
721
|
});
|
|
722
722
|
});
|
|
723
723
|
} else {
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
|
|
724
|
+
const l = d(c);
|
|
725
|
+
l.finalities.draft.push((f, h) => {
|
|
726
|
+
Ue(l), Ge(l, _e, f, h);
|
|
727
727
|
});
|
|
728
728
|
}
|
|
729
729
|
return c;
|
|
730
730
|
}
|
|
731
|
-
|
|
732
|
-
function
|
|
733
|
-
var
|
|
734
|
-
const o =
|
|
731
|
+
tt.createDraft = at;
|
|
732
|
+
function Jn(e, t, n, r, i) {
|
|
733
|
+
var s;
|
|
734
|
+
const o = d(e), a = (s = o?.original) !== null && s !== void 0 ? s : e, c = !!t.length;
|
|
735
735
|
if (o?.operated)
|
|
736
736
|
for (; o.finalities.draft.length > 0; )
|
|
737
737
|
o.finalities.draft.pop()(n, r);
|
|
738
738
|
const u = c ? t[0] : o ? o.operated ? o.copy : o.original : e;
|
|
739
|
-
return o &&
|
|
739
|
+
return o && Be(o), i && se(u, u, o?.options.updatedValues), [
|
|
740
740
|
u,
|
|
741
|
-
n && c ? [{ op:
|
|
742
|
-
r && c ? [{ op:
|
|
741
|
+
n && c ? [{ op: v.Replace, path: [], value: t[0] }] : n,
|
|
742
|
+
r && c ? [{ op: v.Replace, path: [], value: a }] : r
|
|
743
743
|
];
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function Yn(e, t) {
|
|
746
746
|
var n;
|
|
747
747
|
const r = {
|
|
748
748
|
draft: [],
|
|
@@ -750,9 +750,9 @@ function an(e, t) {
|
|
|
750
750
|
handledSet: /* @__PURE__ */ new WeakSet(),
|
|
751
751
|
draftsCache: /* @__PURE__ */ new WeakSet()
|
|
752
752
|
};
|
|
753
|
-
let
|
|
754
|
-
t.enablePatches && (
|
|
755
|
-
const a = ((n = t.mark) === null || n === void 0 ? void 0 : n.call(t, e,
|
|
753
|
+
let i, s;
|
|
754
|
+
t.enablePatches && (i = [], s = []);
|
|
755
|
+
const a = ((n = t.mark) === null || n === void 0 ? void 0 : n.call(t, e, E)) === E.mutable || !$(e, t) ? e : at({
|
|
756
756
|
original: e,
|
|
757
757
|
parentDraft: null,
|
|
758
758
|
finalities: r,
|
|
@@ -761,242 +761,242 @@ function an(e, t) {
|
|
|
761
761
|
return [
|
|
762
762
|
a,
|
|
763
763
|
(c = []) => {
|
|
764
|
-
const [u,
|
|
765
|
-
return t.enablePatches ? [u,
|
|
764
|
+
const [u, l, f] = Jn(a, c, i, s, t.enableAutoFreeze);
|
|
765
|
+
return t.enablePatches ? [u, l, f] : u;
|
|
766
766
|
}
|
|
767
767
|
];
|
|
768
768
|
}
|
|
769
|
-
function
|
|
770
|
-
const { rootDraft: t, value: n, useRawReturn: r = !1, isRoot:
|
|
771
|
-
|
|
772
|
-
const c =
|
|
769
|
+
function We(e) {
|
|
770
|
+
const { rootDraft: t, value: n, useRawReturn: r = !1, isRoot: i = !0 } = e;
|
|
771
|
+
st(n, (s, o, a) => {
|
|
772
|
+
const c = d(o);
|
|
773
773
|
if (c && t && c.finalities === t.finalities) {
|
|
774
774
|
e.isContainDraft = !0;
|
|
775
775
|
const u = c.original;
|
|
776
776
|
if (a instanceof Set) {
|
|
777
|
-
const
|
|
778
|
-
a.clear(),
|
|
777
|
+
const l = Array.from(a);
|
|
778
|
+
a.clear(), l.forEach((f) => a.add(s === f ? u : f));
|
|
779
779
|
} else
|
|
780
|
-
|
|
781
|
-
} else typeof o == "object" && o !== null && (e.value = o, e.isRoot = !1,
|
|
782
|
-
}),
|
|
780
|
+
be(a, s, u);
|
|
781
|
+
} else typeof o == "object" && o !== null && (e.value = o, e.isRoot = !1, We(e));
|
|
782
|
+
}), i && (e.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function on(e) {
|
|
785
785
|
var t;
|
|
786
|
-
const n =
|
|
787
|
-
if (
|
|
786
|
+
const n = d(e);
|
|
787
|
+
if (!$(e, n?.options))
|
|
788
788
|
return e;
|
|
789
|
-
const r =
|
|
789
|
+
const r = ee(e);
|
|
790
790
|
if (n && !n.operated)
|
|
791
791
|
return n.original;
|
|
792
|
-
let
|
|
793
|
-
function
|
|
794
|
-
|
|
792
|
+
let i;
|
|
793
|
+
function s() {
|
|
794
|
+
i = r === 2 ? rt(e) ? new Map(e) : new (Object.getPrototypeOf(e)).constructor(e) : r === 3 ? Array.from(n.setMap.values()) : nn(e, n?.options);
|
|
795
795
|
}
|
|
796
796
|
if (n) {
|
|
797
797
|
n.finalized = !0;
|
|
798
798
|
try {
|
|
799
|
-
|
|
799
|
+
s();
|
|
800
800
|
} finally {
|
|
801
801
|
n.finalized = !1;
|
|
802
802
|
}
|
|
803
803
|
} else
|
|
804
|
-
|
|
805
|
-
if (
|
|
806
|
-
if (n &&
|
|
804
|
+
i = e;
|
|
805
|
+
if (st(i, (o, a) => {
|
|
806
|
+
if (n && H(q(n.original, o), a))
|
|
807
807
|
return;
|
|
808
|
-
const c =
|
|
809
|
-
c !== a && (
|
|
808
|
+
const c = on(a);
|
|
809
|
+
c !== a && (i === e && s(), be(i, o, c));
|
|
810
810
|
}), r === 3) {
|
|
811
|
-
const o = (t = n?.original) !== null && t !== void 0 ? t :
|
|
812
|
-
return
|
|
811
|
+
const o = (t = n?.original) !== null && t !== void 0 ? t : i;
|
|
812
|
+
return nt(o) ? new Set(i) : new (Object.getPrototypeOf(o)).constructor(i);
|
|
813
813
|
}
|
|
814
|
-
return
|
|
814
|
+
return i;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
if (!
|
|
816
|
+
function mt(e) {
|
|
817
|
+
if (!K(e))
|
|
818
818
|
throw new Error(`current() is only used for Draft, parameter: ${e}`);
|
|
819
|
-
return
|
|
819
|
+
return on(e);
|
|
820
820
|
}
|
|
821
|
-
const
|
|
822
|
-
var
|
|
821
|
+
const Xn = (e) => function t(n, r, i) {
|
|
822
|
+
var s, o, a;
|
|
823
823
|
if (typeof n == "function" && typeof r != "function")
|
|
824
|
-
return function(
|
|
825
|
-
return t(
|
|
824
|
+
return function(_, ...D) {
|
|
825
|
+
return t(_, (G) => n.call(this, G, ...D), r);
|
|
826
826
|
};
|
|
827
827
|
const c = n, u = r;
|
|
828
|
-
let
|
|
829
|
-
if (typeof r != "function" && (
|
|
830
|
-
throw new Error(`Invalid options: ${
|
|
831
|
-
|
|
832
|
-
const
|
|
833
|
-
for (const
|
|
834
|
-
if (typeof
|
|
835
|
-
throw new Error(`Invalid mark: ${
|
|
836
|
-
const
|
|
837
|
-
if (
|
|
838
|
-
return
|
|
828
|
+
let l = i;
|
|
829
|
+
if (typeof r != "function" && (l = r), l !== void 0 && Object.prototype.toString.call(l) !== "[object Object]")
|
|
830
|
+
throw new Error(`Invalid options: ${l}, 'options' should be an object.`);
|
|
831
|
+
l = Object.assign(Object.assign({}, e), l);
|
|
832
|
+
const f = K(c) ? mt(c) : c, h = Array.isArray(l.mark) ? ((_, D) => {
|
|
833
|
+
for (const G of l.mark) {
|
|
834
|
+
if (typeof G != "function")
|
|
835
|
+
throw new Error(`Invalid mark: ${G}, 'mark' should be a function.`);
|
|
836
|
+
const ce = G(_, D);
|
|
837
|
+
if (ce)
|
|
838
|
+
return ce;
|
|
839
839
|
}
|
|
840
|
-
}) :
|
|
841
|
-
enableAutoFreeze: (a =
|
|
842
|
-
mark:
|
|
843
|
-
strict:
|
|
844
|
-
enablePatches:
|
|
840
|
+
}) : l.mark, p = (s = l.enablePatches) !== null && s !== void 0 ? s : !1, g = (o = l.strict) !== null && o !== void 0 ? o : !1, w = {
|
|
841
|
+
enableAutoFreeze: (a = l.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
|
|
842
|
+
mark: h,
|
|
843
|
+
strict: g,
|
|
844
|
+
enablePatches: p
|
|
845
845
|
};
|
|
846
|
-
if (
|
|
846
|
+
if (!$(f, w) && typeof f == "object" && f !== null)
|
|
847
847
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
848
|
-
const [
|
|
848
|
+
const [C, S] = Yn(f, w);
|
|
849
849
|
if (typeof r != "function") {
|
|
850
|
-
if (
|
|
850
|
+
if (!$(f, w))
|
|
851
851
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
852
|
-
return [
|
|
852
|
+
return [C, S];
|
|
853
853
|
}
|
|
854
|
-
let
|
|
854
|
+
let P;
|
|
855
855
|
try {
|
|
856
|
-
|
|
857
|
-
} catch (
|
|
858
|
-
throw
|
|
859
|
-
}
|
|
860
|
-
const
|
|
861
|
-
const
|
|
862
|
-
if (!
|
|
863
|
-
if (
|
|
856
|
+
P = u(C);
|
|
857
|
+
} catch (_) {
|
|
858
|
+
throw Be(d(C)), _;
|
|
859
|
+
}
|
|
860
|
+
const V = (_) => {
|
|
861
|
+
const D = d(C);
|
|
862
|
+
if (!K(_)) {
|
|
863
|
+
if (_ !== void 0 && !H(_, C) && D?.operated)
|
|
864
864
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
865
|
-
const
|
|
866
|
-
if (
|
|
867
|
-
const
|
|
868
|
-
return
|
|
869
|
-
rootDraft:
|
|
870
|
-
value:
|
|
865
|
+
const ce = _?.[Hn];
|
|
866
|
+
if (ce) {
|
|
867
|
+
const zn = ce[0];
|
|
868
|
+
return w.strict && typeof _ == "object" && _ !== null && We({
|
|
869
|
+
rootDraft: D,
|
|
870
|
+
value: _,
|
|
871
871
|
useRawReturn: !0
|
|
872
|
-
}),
|
|
872
|
+
}), S([zn]);
|
|
873
873
|
}
|
|
874
|
-
if (
|
|
875
|
-
return typeof
|
|
874
|
+
if (_ !== void 0)
|
|
875
|
+
return typeof _ == "object" && _ !== null && We({ rootDraft: D, value: _ }), S([_]);
|
|
876
876
|
}
|
|
877
|
-
if (
|
|
878
|
-
return
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
if (
|
|
877
|
+
if (_ === C || _ === void 0)
|
|
878
|
+
return S([]);
|
|
879
|
+
const G = d(_);
|
|
880
|
+
if (w === G.options) {
|
|
881
|
+
if (G.operated)
|
|
882
882
|
throw new Error("Cannot return a modified child draft.");
|
|
883
|
-
return
|
|
883
|
+
return S([mt(_)]);
|
|
884
884
|
}
|
|
885
|
-
return
|
|
885
|
+
return S([_]);
|
|
886
886
|
};
|
|
887
|
-
return
|
|
888
|
-
throw
|
|
889
|
-
}) :
|
|
890
|
-
},
|
|
887
|
+
return P instanceof Promise ? P.then(V, (_) => {
|
|
888
|
+
throw Be(d(C)), _;
|
|
889
|
+
}) : V(P);
|
|
890
|
+
}, I = Xn();
|
|
891
891
|
Object.prototype.constructor.toString();
|
|
892
|
-
var
|
|
893
|
-
function
|
|
894
|
-
var t =
|
|
892
|
+
var an = typeof global == "object" && global && global.Object === Object && global, Zn = typeof self == "object" && self && self.Object === Object && self, Q = an || Zn || Function("return this")(), N = Q.Symbol, cn = Object.prototype, kn = cn.hasOwnProperty, er = cn.toString, ue = N ? N.toStringTag : void 0;
|
|
893
|
+
function tr(e) {
|
|
894
|
+
var t = kn.call(e, ue), n = e[ue];
|
|
895
895
|
try {
|
|
896
|
-
e[
|
|
896
|
+
e[ue] = void 0;
|
|
897
897
|
var r = !0;
|
|
898
898
|
} catch {
|
|
899
899
|
}
|
|
900
|
-
var
|
|
901
|
-
return r && (t ? e[
|
|
900
|
+
var i = er.call(e);
|
|
901
|
+
return r && (t ? e[ue] = n : delete e[ue]), i;
|
|
902
902
|
}
|
|
903
|
-
var
|
|
904
|
-
function
|
|
905
|
-
return
|
|
903
|
+
var nr = Object.prototype, rr = nr.toString;
|
|
904
|
+
function ir(e) {
|
|
905
|
+
return rr.call(e);
|
|
906
906
|
}
|
|
907
|
-
var
|
|
908
|
-
function
|
|
909
|
-
return e == null ? e === void 0 ?
|
|
907
|
+
var sr = "[object Null]", or = "[object Undefined]", St = N ? N.toStringTag : void 0;
|
|
908
|
+
function te(e) {
|
|
909
|
+
return e == null ? e === void 0 ? or : sr : St && St in Object(e) ? tr(e) : ir(e);
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function X(e) {
|
|
912
912
|
return e != null && typeof e == "object";
|
|
913
913
|
}
|
|
914
|
-
var
|
|
915
|
-
function
|
|
916
|
-
return typeof e == "symbol" ||
|
|
914
|
+
var ar = "[object Symbol]";
|
|
915
|
+
function Z(e) {
|
|
916
|
+
return typeof e == "symbol" || X(e) && te(e) == ar;
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
for (var n = -1, r = e == null ? 0 : e.length,
|
|
920
|
-
|
|
921
|
-
return
|
|
918
|
+
function de(e, t) {
|
|
919
|
+
for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r; )
|
|
920
|
+
i[n] = t(e[n], n, e);
|
|
921
|
+
return i;
|
|
922
922
|
}
|
|
923
|
-
var
|
|
924
|
-
function
|
|
923
|
+
var M = Array.isArray, vt = N ? N.prototype : void 0, wt = vt ? vt.toString : void 0;
|
|
924
|
+
function un(e) {
|
|
925
925
|
if (typeof e == "string")
|
|
926
926
|
return e;
|
|
927
|
-
if (
|
|
928
|
-
return
|
|
929
|
-
if (
|
|
930
|
-
return
|
|
927
|
+
if (M(e))
|
|
928
|
+
return de(e, un) + "";
|
|
929
|
+
if (Z(e))
|
|
930
|
+
return wt ? wt.call(e) : "";
|
|
931
931
|
var t = e + "";
|
|
932
932
|
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
933
933
|
}
|
|
934
|
-
var
|
|
935
|
-
function
|
|
936
|
-
for (var t = e.length; t-- &&
|
|
934
|
+
var cr = /\s/;
|
|
935
|
+
function ur(e) {
|
|
936
|
+
for (var t = e.length; t-- && cr.test(e.charAt(t)); )
|
|
937
937
|
;
|
|
938
938
|
return t;
|
|
939
939
|
}
|
|
940
|
-
var
|
|
941
|
-
function
|
|
942
|
-
return e && e.slice(0,
|
|
940
|
+
var lr = /^\s+/;
|
|
941
|
+
function fr(e) {
|
|
942
|
+
return e && e.slice(0, ur(e) + 1).replace(lr, "");
|
|
943
943
|
}
|
|
944
|
-
function
|
|
944
|
+
function ae(e) {
|
|
945
945
|
var t = typeof e;
|
|
946
946
|
return e != null && (t == "object" || t == "function");
|
|
947
947
|
}
|
|
948
|
-
var
|
|
949
|
-
function
|
|
948
|
+
var Ot = NaN, hr = /^[-+]0x[0-9a-f]+$/i, dr = /^0b[01]+$/i, pr = /^0o[0-7]+$/i, _r = parseInt;
|
|
949
|
+
function yr(e) {
|
|
950
950
|
if (typeof e == "number")
|
|
951
951
|
return e;
|
|
952
|
-
if (
|
|
953
|
-
return
|
|
954
|
-
if (
|
|
952
|
+
if (Z(e))
|
|
953
|
+
return Ot;
|
|
954
|
+
if (ae(e)) {
|
|
955
955
|
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
956
|
-
e =
|
|
956
|
+
e = ae(t) ? t + "" : t;
|
|
957
957
|
}
|
|
958
958
|
if (typeof e != "string")
|
|
959
959
|
return e === 0 ? e : +e;
|
|
960
|
-
e =
|
|
961
|
-
var n =
|
|
962
|
-
return n ||
|
|
960
|
+
e = fr(e);
|
|
961
|
+
var n = dr.test(e);
|
|
962
|
+
return n || pr.test(e) ? _r(e.slice(2), n ? 2 : 8) : hr.test(e) ? Ot : +e;
|
|
963
963
|
}
|
|
964
|
-
var
|
|
965
|
-
function
|
|
964
|
+
var Ct = 1 / 0, gr = 17976931348623157e292;
|
|
965
|
+
function br(e) {
|
|
966
966
|
if (!e)
|
|
967
967
|
return e === 0 ? e : 0;
|
|
968
|
-
if (e =
|
|
968
|
+
if (e = yr(e), e === Ct || e === -Ct) {
|
|
969
969
|
var t = e < 0 ? -1 : 1;
|
|
970
|
-
return t *
|
|
970
|
+
return t * gr;
|
|
971
971
|
}
|
|
972
972
|
return e === e ? e : 0;
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
var t =
|
|
974
|
+
function ln(e) {
|
|
975
|
+
var t = br(e), n = t % 1;
|
|
976
976
|
return t === t ? n ? t - n : t : 0;
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function me(e) {
|
|
979
979
|
return e;
|
|
980
980
|
}
|
|
981
|
-
var
|
|
982
|
-
function
|
|
983
|
-
if (!
|
|
981
|
+
var mr = "[object AsyncFunction]", Sr = "[object Function]", vr = "[object GeneratorFunction]", wr = "[object Proxy]";
|
|
982
|
+
function fn(e) {
|
|
983
|
+
if (!ae(e))
|
|
984
984
|
return !1;
|
|
985
|
-
var t =
|
|
986
|
-
return t ==
|
|
985
|
+
var t = te(e);
|
|
986
|
+
return t == Sr || t == vr || t == mr || t == wr;
|
|
987
987
|
}
|
|
988
|
-
var
|
|
989
|
-
var e = /[^.]+$/.exec(
|
|
988
|
+
var De = Q["__core-js_shared__"], Mt = (function() {
|
|
989
|
+
var e = /[^.]+$/.exec(De && De.keys && De.keys.IE_PROTO || "");
|
|
990
990
|
return e ? "Symbol(src)_1." + e : "";
|
|
991
991
|
})();
|
|
992
|
-
function
|
|
993
|
-
return !!
|
|
992
|
+
function Or(e) {
|
|
993
|
+
return !!Mt && Mt in e;
|
|
994
994
|
}
|
|
995
|
-
var
|
|
996
|
-
function
|
|
995
|
+
var Cr = Function.prototype, Mr = Cr.toString;
|
|
996
|
+
function ne(e) {
|
|
997
997
|
if (e != null) {
|
|
998
998
|
try {
|
|
999
|
-
return
|
|
999
|
+
return Mr.call(e);
|
|
1000
1000
|
} catch {
|
|
1001
1001
|
}
|
|
1002
1002
|
try {
|
|
@@ -1006,393 +1006,474 @@ function W(e) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return "";
|
|
1008
1008
|
}
|
|
1009
|
-
var
|
|
1010
|
-
"^" +
|
|
1009
|
+
var Ar = /[\\^$.*+?()[\]{}|]/g, Pr = /^\[object .+?Constructor\]$/, xr = Function.prototype, Er = Object.prototype, Tr = xr.toString, Rr = Er.hasOwnProperty, Ir = RegExp(
|
|
1010
|
+
"^" + Tr.call(Rr).replace(Ar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1011
1011
|
);
|
|
1012
|
-
function
|
|
1013
|
-
if (!
|
|
1012
|
+
function jr(e) {
|
|
1013
|
+
if (!ae(e) || Or(e))
|
|
1014
1014
|
return !1;
|
|
1015
|
-
var t =
|
|
1016
|
-
return t.test(
|
|
1015
|
+
var t = fn(e) ? Ir : Pr;
|
|
1016
|
+
return t.test(ne(e));
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function $r(e, t) {
|
|
1019
1019
|
return e?.[t];
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
var n =
|
|
1023
|
-
return
|
|
1021
|
+
function re(e, t) {
|
|
1022
|
+
var n = $r(e, t);
|
|
1023
|
+
return jr(n) ? n : void 0;
|
|
1024
1024
|
}
|
|
1025
|
-
var
|
|
1026
|
-
function
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
return
|
|
1025
|
+
var Ve = re(Q, "WeakMap");
|
|
1026
|
+
function Fr(e, t, n) {
|
|
1027
|
+
switch (n.length) {
|
|
1028
|
+
case 0:
|
|
1029
|
+
return e.call(t);
|
|
1030
|
+
case 1:
|
|
1031
|
+
return e.call(t, n[0]);
|
|
1032
|
+
case 2:
|
|
1033
|
+
return e.call(t, n[0], n[1]);
|
|
1034
|
+
case 3:
|
|
1035
|
+
return e.call(t, n[0], n[1], n[2]);
|
|
1036
|
+
}
|
|
1037
|
+
return e.apply(t, n);
|
|
1038
|
+
}
|
|
1039
|
+
var zr = 800, Nr = 16, Dr = Date.now;
|
|
1040
|
+
function Hr(e) {
|
|
1041
|
+
var t = 0, n = 0;
|
|
1042
|
+
return function() {
|
|
1043
|
+
var r = Dr(), i = Nr - (r - n);
|
|
1044
|
+
if (n = r, i > 0) {
|
|
1045
|
+
if (++t >= zr)
|
|
1046
|
+
return arguments[0];
|
|
1047
|
+
} else
|
|
1048
|
+
t = 0;
|
|
1049
|
+
return e.apply(void 0, arguments);
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
function Lr(e) {
|
|
1053
|
+
return function() {
|
|
1054
|
+
return e;
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
var At = (function() {
|
|
1058
|
+
try {
|
|
1059
|
+
var e = re(Object, "defineProperty");
|
|
1060
|
+
return e({}, "", {}), e;
|
|
1061
|
+
} catch {
|
|
1062
|
+
}
|
|
1063
|
+
})(), qr = At ? function(e, t) {
|
|
1064
|
+
return At(e, "toString", {
|
|
1065
|
+
configurable: !0,
|
|
1066
|
+
enumerable: !1,
|
|
1067
|
+
value: Lr(t),
|
|
1068
|
+
writable: !0
|
|
1069
|
+
});
|
|
1070
|
+
} : me, Qr = Hr(qr);
|
|
1071
|
+
function Br(e, t) {
|
|
1072
|
+
for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1; )
|
|
1073
|
+
;
|
|
1074
|
+
return e;
|
|
1075
|
+
}
|
|
1076
|
+
function Ur(e, t, n, r) {
|
|
1077
|
+
for (var i = e.length, s = n + -1; ++s < i; )
|
|
1078
|
+
if (t(e[s], s, e))
|
|
1079
|
+
return s;
|
|
1030
1080
|
return -1;
|
|
1031
1081
|
}
|
|
1032
|
-
var
|
|
1033
|
-
function
|
|
1082
|
+
var Gr = 9007199254740991, Kr = /^(?:0|[1-9]\d*)$/;
|
|
1083
|
+
function ct(e, t) {
|
|
1034
1084
|
var n = typeof e;
|
|
1035
|
-
return t = t ??
|
|
1085
|
+
return t = t ?? Gr, !!t && (n == "number" || n != "symbol" && Kr.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
1036
1086
|
}
|
|
1037
|
-
function
|
|
1087
|
+
function ut(e, t) {
|
|
1038
1088
|
return e === t || e !== e && t !== t;
|
|
1039
1089
|
}
|
|
1040
|
-
var
|
|
1041
|
-
function
|
|
1042
|
-
return
|
|
1090
|
+
var Pt = Math.max;
|
|
1091
|
+
function Wr(e, t, n) {
|
|
1092
|
+
return t = Pt(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1093
|
+
for (var r = arguments, i = -1, s = Pt(r.length - t, 0), o = Array(s); ++i < s; )
|
|
1094
|
+
o[i] = r[t + i];
|
|
1095
|
+
i = -1;
|
|
1096
|
+
for (var a = Array(t + 1); ++i < t; )
|
|
1097
|
+
a[i] = r[i];
|
|
1098
|
+
return a[t] = n(o), Fr(e, this, a);
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
function Vr(e, t) {
|
|
1102
|
+
return Qr(Wr(e, t, me), e + "");
|
|
1103
|
+
}
|
|
1104
|
+
var Jr = 9007199254740991;
|
|
1105
|
+
function lt(e) {
|
|
1106
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Jr;
|
|
1107
|
+
}
|
|
1108
|
+
function ie(e) {
|
|
1109
|
+
return e != null && lt(e.length) && !fn(e);
|
|
1043
1110
|
}
|
|
1044
|
-
function
|
|
1045
|
-
|
|
1111
|
+
function xt(e, t, n) {
|
|
1112
|
+
if (!ae(n))
|
|
1113
|
+
return !1;
|
|
1114
|
+
var r = typeof t;
|
|
1115
|
+
return (r == "number" ? ie(n) && ct(t, n.length) : r == "string" && t in n) ? ut(n[t], e) : !1;
|
|
1046
1116
|
}
|
|
1047
|
-
var
|
|
1048
|
-
function
|
|
1049
|
-
var t = e && e.constructor, n = typeof t == "function" && t.prototype ||
|
|
1117
|
+
var Yr = Object.prototype;
|
|
1118
|
+
function hn(e) {
|
|
1119
|
+
var t = e && e.constructor, n = typeof t == "function" && t.prototype || Yr;
|
|
1050
1120
|
return e === n;
|
|
1051
1121
|
}
|
|
1052
|
-
function
|
|
1122
|
+
function Xr(e, t) {
|
|
1053
1123
|
for (var n = -1, r = Array(e); ++n < e; )
|
|
1054
1124
|
r[n] = t(n);
|
|
1055
1125
|
return r;
|
|
1056
1126
|
}
|
|
1057
|
-
var
|
|
1058
|
-
function
|
|
1059
|
-
return
|
|
1127
|
+
var Zr = "[object Arguments]";
|
|
1128
|
+
function Et(e) {
|
|
1129
|
+
return X(e) && te(e) == Zr;
|
|
1060
1130
|
}
|
|
1061
|
-
var
|
|
1131
|
+
var dn = Object.prototype, kr = dn.hasOwnProperty, ei = dn.propertyIsEnumerable, Te = Et(/* @__PURE__ */ (function() {
|
|
1062
1132
|
return arguments;
|
|
1063
|
-
})()) ?
|
|
1064
|
-
return
|
|
1133
|
+
})()) ? Et : function(e) {
|
|
1134
|
+
return X(e) && kr.call(e, "callee") && !ei.call(e, "callee");
|
|
1065
1135
|
};
|
|
1066
|
-
function
|
|
1136
|
+
function ti() {
|
|
1067
1137
|
return !1;
|
|
1068
1138
|
}
|
|
1069
|
-
var
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
function
|
|
1073
|
-
return
|
|
1139
|
+
var pn = typeof exports == "object" && exports && !exports.nodeType && exports, Tt = pn && typeof module == "object" && module && !module.nodeType && module, ni = Tt && Tt.exports === pn, Rt = ni ? Q.Buffer : void 0, ri = Rt ? Rt.isBuffer : void 0, xe = ri || ti, ii = "[object Arguments]", si = "[object Array]", oi = "[object Boolean]", ai = "[object Date]", ci = "[object Error]", ui = "[object Function]", li = "[object Map]", fi = "[object Number]", hi = "[object Object]", di = "[object RegExp]", pi = "[object Set]", _i = "[object String]", yi = "[object WeakMap]", gi = "[object ArrayBuffer]", bi = "[object DataView]", mi = "[object Float32Array]", Si = "[object Float64Array]", vi = "[object Int8Array]", wi = "[object Int16Array]", Oi = "[object Int32Array]", Ci = "[object Uint8Array]", Mi = "[object Uint8ClampedArray]", Ai = "[object Uint16Array]", Pi = "[object Uint32Array]", y = {};
|
|
1140
|
+
y[mi] = y[Si] = y[vi] = y[wi] = y[Oi] = y[Ci] = y[Mi] = y[Ai] = y[Pi] = !0;
|
|
1141
|
+
y[ii] = y[si] = y[gi] = y[oi] = y[bi] = y[ai] = y[ci] = y[ui] = y[li] = y[fi] = y[hi] = y[di] = y[pi] = y[_i] = y[yi] = !1;
|
|
1142
|
+
function xi(e) {
|
|
1143
|
+
return X(e) && lt(e.length) && !!y[te(e)];
|
|
1074
1144
|
}
|
|
1075
|
-
function
|
|
1145
|
+
function _n(e) {
|
|
1076
1146
|
return function(t) {
|
|
1077
1147
|
return e(t);
|
|
1078
1148
|
};
|
|
1079
1149
|
}
|
|
1080
|
-
var
|
|
1150
|
+
var yn = typeof exports == "object" && exports && !exports.nodeType && exports, pe = yn && typeof module == "object" && module && !module.nodeType && module, Ei = pe && pe.exports === yn, He = Ei && an.process, It = (function() {
|
|
1081
1151
|
try {
|
|
1082
|
-
var e =
|
|
1083
|
-
return e ||
|
|
1152
|
+
var e = pe && pe.require && pe.require("util").types;
|
|
1153
|
+
return e || He && He.binding && He.binding("util");
|
|
1084
1154
|
} catch {
|
|
1085
1155
|
}
|
|
1086
|
-
})(),
|
|
1087
|
-
function
|
|
1088
|
-
var n =
|
|
1156
|
+
})(), jt = It && It.isTypedArray, ft = jt ? _n(jt) : xi, Ti = Object.prototype, Ri = Ti.hasOwnProperty;
|
|
1157
|
+
function Ii(e, t) {
|
|
1158
|
+
var n = M(e), r = !n && Te(e), i = !n && !r && xe(e), s = !n && !r && !i && ft(e), o = n || r || i || s, a = o ? Xr(e.length, String) : [], c = a.length;
|
|
1089
1159
|
for (var u in e)
|
|
1090
|
-
|
|
1160
|
+
Ri.call(e, u) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1091
1161
|
(u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1162
|
+
i && (u == "offset" || u == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1163
|
+
s && (u == "buffer" || u == "byteLength" || u == "byteOffset") || // Skip index properties.
|
|
1164
|
+
ct(u, c))) && a.push(u);
|
|
1095
1165
|
return a;
|
|
1096
1166
|
}
|
|
1097
|
-
function
|
|
1167
|
+
function ji(e, t) {
|
|
1098
1168
|
return function(n) {
|
|
1099
1169
|
return e(t(n));
|
|
1100
1170
|
};
|
|
1101
1171
|
}
|
|
1102
|
-
var
|
|
1103
|
-
function
|
|
1104
|
-
if (!
|
|
1105
|
-
return
|
|
1172
|
+
var $i = ji(Object.keys, Object), Fi = Object.prototype, zi = Fi.hasOwnProperty;
|
|
1173
|
+
function ht(e) {
|
|
1174
|
+
if (!hn(e))
|
|
1175
|
+
return $i(e);
|
|
1106
1176
|
var t = [];
|
|
1107
1177
|
for (var n in Object(e))
|
|
1108
|
-
|
|
1178
|
+
zi.call(e, n) && n != "constructor" && t.push(n);
|
|
1109
1179
|
return t;
|
|
1110
1180
|
}
|
|
1111
|
-
function
|
|
1112
|
-
return
|
|
1181
|
+
function Re(e) {
|
|
1182
|
+
return ie(e) ? Ii(e) : ht(e);
|
|
1113
1183
|
}
|
|
1114
|
-
var
|
|
1115
|
-
function
|
|
1116
|
-
if (
|
|
1184
|
+
var Ni = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Di = /^\w*$/;
|
|
1185
|
+
function dt(e, t) {
|
|
1186
|
+
if (M(e))
|
|
1117
1187
|
return !1;
|
|
1118
1188
|
var n = typeof e;
|
|
1119
|
-
return n == "number" || n == "symbol" || n == "boolean" || e == null ||
|
|
1189
|
+
return n == "number" || n == "symbol" || n == "boolean" || e == null || Z(e) ? !0 : Di.test(e) || !Ni.test(e) || t != null && e in Object(t);
|
|
1120
1190
|
}
|
|
1121
|
-
var
|
|
1122
|
-
function
|
|
1123
|
-
this.__data__ =
|
|
1191
|
+
var ye = re(Object, "create");
|
|
1192
|
+
function Hi() {
|
|
1193
|
+
this.__data__ = ye ? ye(null) : {}, this.size = 0;
|
|
1124
1194
|
}
|
|
1125
|
-
function
|
|
1195
|
+
function Li(e) {
|
|
1126
1196
|
var t = this.has(e) && delete this.__data__[e];
|
|
1127
1197
|
return this.size -= t ? 1 : 0, t;
|
|
1128
1198
|
}
|
|
1129
|
-
var
|
|
1130
|
-
function
|
|
1199
|
+
var qi = "__lodash_hash_undefined__", Qi = Object.prototype, Bi = Qi.hasOwnProperty;
|
|
1200
|
+
function Ui(e) {
|
|
1131
1201
|
var t = this.__data__;
|
|
1132
|
-
if (
|
|
1202
|
+
if (ye) {
|
|
1133
1203
|
var n = t[e];
|
|
1134
|
-
return n ===
|
|
1204
|
+
return n === qi ? void 0 : n;
|
|
1135
1205
|
}
|
|
1136
|
-
return
|
|
1206
|
+
return Bi.call(t, e) ? t[e] : void 0;
|
|
1137
1207
|
}
|
|
1138
|
-
var
|
|
1139
|
-
function
|
|
1208
|
+
var Gi = Object.prototype, Ki = Gi.hasOwnProperty;
|
|
1209
|
+
function Wi(e) {
|
|
1140
1210
|
var t = this.__data__;
|
|
1141
|
-
return
|
|
1211
|
+
return ye ? t[e] !== void 0 : Ki.call(t, e);
|
|
1142
1212
|
}
|
|
1143
|
-
var
|
|
1144
|
-
function
|
|
1213
|
+
var Vi = "__lodash_hash_undefined__";
|
|
1214
|
+
function Ji(e, t) {
|
|
1145
1215
|
var n = this.__data__;
|
|
1146
|
-
return this.size += this.has(e) ? 0 : 1, n[e] =
|
|
1216
|
+
return this.size += this.has(e) ? 0 : 1, n[e] = ye && t === void 0 ? Vi : t, this;
|
|
1147
1217
|
}
|
|
1148
|
-
function
|
|
1218
|
+
function k(e) {
|
|
1149
1219
|
var t = -1, n = e == null ? 0 : e.length;
|
|
1150
1220
|
for (this.clear(); ++t < n; ) {
|
|
1151
1221
|
var r = e[t];
|
|
1152
1222
|
this.set(r[0], r[1]);
|
|
1153
1223
|
}
|
|
1154
1224
|
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
function
|
|
1225
|
+
k.prototype.clear = Hi;
|
|
1226
|
+
k.prototype.delete = Li;
|
|
1227
|
+
k.prototype.get = Ui;
|
|
1228
|
+
k.prototype.has = Wi;
|
|
1229
|
+
k.prototype.set = Ji;
|
|
1230
|
+
function Yi() {
|
|
1161
1231
|
this.__data__ = [], this.size = 0;
|
|
1162
1232
|
}
|
|
1163
|
-
function
|
|
1233
|
+
function Ie(e, t) {
|
|
1164
1234
|
for (var n = e.length; n--; )
|
|
1165
|
-
if (
|
|
1235
|
+
if (ut(e[n][0], t))
|
|
1166
1236
|
return n;
|
|
1167
1237
|
return -1;
|
|
1168
1238
|
}
|
|
1169
|
-
var
|
|
1170
|
-
function
|
|
1171
|
-
var t = this.__data__, n =
|
|
1239
|
+
var Xi = Array.prototype, Zi = Xi.splice;
|
|
1240
|
+
function ki(e) {
|
|
1241
|
+
var t = this.__data__, n = Ie(t, e);
|
|
1172
1242
|
if (n < 0)
|
|
1173
1243
|
return !1;
|
|
1174
1244
|
var r = t.length - 1;
|
|
1175
|
-
return n == r ? t.pop() :
|
|
1245
|
+
return n == r ? t.pop() : Zi.call(t, n, 1), --this.size, !0;
|
|
1176
1246
|
}
|
|
1177
|
-
function
|
|
1178
|
-
var t = this.__data__, n =
|
|
1247
|
+
function es(e) {
|
|
1248
|
+
var t = this.__data__, n = Ie(t, e);
|
|
1179
1249
|
return n < 0 ? void 0 : t[n][1];
|
|
1180
1250
|
}
|
|
1181
|
-
function
|
|
1182
|
-
return
|
|
1251
|
+
function ts(e) {
|
|
1252
|
+
return Ie(this.__data__, e) > -1;
|
|
1183
1253
|
}
|
|
1184
|
-
function
|
|
1185
|
-
var n = this.__data__, r =
|
|
1254
|
+
function ns(e, t) {
|
|
1255
|
+
var n = this.__data__, r = Ie(n, e);
|
|
1186
1256
|
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
|
|
1187
1257
|
}
|
|
1188
|
-
function
|
|
1258
|
+
function B(e) {
|
|
1189
1259
|
var t = -1, n = e == null ? 0 : e.length;
|
|
1190
1260
|
for (this.clear(); ++t < n; ) {
|
|
1191
1261
|
var r = e[t];
|
|
1192
1262
|
this.set(r[0], r[1]);
|
|
1193
1263
|
}
|
|
1194
1264
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
var
|
|
1201
|
-
function
|
|
1265
|
+
B.prototype.clear = Yi;
|
|
1266
|
+
B.prototype.delete = ki;
|
|
1267
|
+
B.prototype.get = es;
|
|
1268
|
+
B.prototype.has = ts;
|
|
1269
|
+
B.prototype.set = ns;
|
|
1270
|
+
var ge = re(Q, "Map");
|
|
1271
|
+
function rs() {
|
|
1202
1272
|
this.size = 0, this.__data__ = {
|
|
1203
|
-
hash: new
|
|
1204
|
-
map: new (
|
|
1205
|
-
string: new
|
|
1273
|
+
hash: new k(),
|
|
1274
|
+
map: new (ge || B)(),
|
|
1275
|
+
string: new k()
|
|
1206
1276
|
};
|
|
1207
1277
|
}
|
|
1208
|
-
function
|
|
1278
|
+
function is(e) {
|
|
1209
1279
|
var t = typeof e;
|
|
1210
1280
|
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
1211
1281
|
}
|
|
1212
|
-
function
|
|
1282
|
+
function je(e, t) {
|
|
1213
1283
|
var n = e.__data__;
|
|
1214
|
-
return
|
|
1284
|
+
return is(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
|
|
1215
1285
|
}
|
|
1216
|
-
function
|
|
1217
|
-
var t =
|
|
1286
|
+
function ss(e) {
|
|
1287
|
+
var t = je(this, e).delete(e);
|
|
1218
1288
|
return this.size -= t ? 1 : 0, t;
|
|
1219
1289
|
}
|
|
1220
|
-
function
|
|
1221
|
-
return
|
|
1290
|
+
function os(e) {
|
|
1291
|
+
return je(this, e).get(e);
|
|
1222
1292
|
}
|
|
1223
|
-
function
|
|
1224
|
-
return
|
|
1293
|
+
function as(e) {
|
|
1294
|
+
return je(this, e).has(e);
|
|
1225
1295
|
}
|
|
1226
|
-
function
|
|
1227
|
-
var n =
|
|
1296
|
+
function cs(e, t) {
|
|
1297
|
+
var n = je(this, e), r = n.size;
|
|
1228
1298
|
return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
|
|
1229
1299
|
}
|
|
1230
|
-
function
|
|
1300
|
+
function U(e) {
|
|
1231
1301
|
var t = -1, n = e == null ? 0 : e.length;
|
|
1232
1302
|
for (this.clear(); ++t < n; ) {
|
|
1233
1303
|
var r = e[t];
|
|
1234
1304
|
this.set(r[0], r[1]);
|
|
1235
1305
|
}
|
|
1236
1306
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
var
|
|
1243
|
-
function
|
|
1307
|
+
U.prototype.clear = rs;
|
|
1308
|
+
U.prototype.delete = ss;
|
|
1309
|
+
U.prototype.get = os;
|
|
1310
|
+
U.prototype.has = as;
|
|
1311
|
+
U.prototype.set = cs;
|
|
1312
|
+
var us = "Expected a function";
|
|
1313
|
+
function pt(e, t) {
|
|
1244
1314
|
if (typeof e != "function" || t != null && typeof t != "function")
|
|
1245
|
-
throw new TypeError(
|
|
1315
|
+
throw new TypeError(us);
|
|
1246
1316
|
var n = function() {
|
|
1247
|
-
var r = arguments,
|
|
1248
|
-
if (
|
|
1249
|
-
return
|
|
1317
|
+
var r = arguments, i = t ? t.apply(this, r) : r[0], s = n.cache;
|
|
1318
|
+
if (s.has(i))
|
|
1319
|
+
return s.get(i);
|
|
1250
1320
|
var o = e.apply(this, r);
|
|
1251
|
-
return n.cache =
|
|
1321
|
+
return n.cache = s.set(i, o) || s, o;
|
|
1252
1322
|
};
|
|
1253
|
-
return n.cache = new (
|
|
1323
|
+
return n.cache = new (pt.Cache || U)(), n;
|
|
1254
1324
|
}
|
|
1255
|
-
|
|
1256
|
-
var
|
|
1257
|
-
function
|
|
1258
|
-
var t =
|
|
1259
|
-
return n.size ===
|
|
1325
|
+
pt.Cache = U;
|
|
1326
|
+
var ls = 500;
|
|
1327
|
+
function fs(e) {
|
|
1328
|
+
var t = pt(e, function(r) {
|
|
1329
|
+
return n.size === ls && n.clear(), r;
|
|
1260
1330
|
}), n = t.cache;
|
|
1261
1331
|
return t;
|
|
1262
1332
|
}
|
|
1263
|
-
var
|
|
1333
|
+
var hs = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ds = /\\(\\)?/g, ps = fs(function(e) {
|
|
1264
1334
|
var t = [];
|
|
1265
|
-
return e.charCodeAt(0) === 46 && t.push(""), e.replace(
|
|
1266
|
-
t.push(
|
|
1335
|
+
return e.charCodeAt(0) === 46 && t.push(""), e.replace(hs, function(n, r, i, s) {
|
|
1336
|
+
t.push(i ? s.replace(ds, "$1") : r || n);
|
|
1267
1337
|
}), t;
|
|
1268
1338
|
});
|
|
1269
|
-
function
|
|
1270
|
-
return e == null ? "" :
|
|
1339
|
+
function gn(e) {
|
|
1340
|
+
return e == null ? "" : un(e);
|
|
1271
1341
|
}
|
|
1272
|
-
function
|
|
1273
|
-
return
|
|
1342
|
+
function bn(e, t) {
|
|
1343
|
+
return M(e) ? e : dt(e, t) ? [e] : ps(gn(e));
|
|
1274
1344
|
}
|
|
1275
|
-
function
|
|
1276
|
-
if (typeof e == "string" ||
|
|
1345
|
+
function $e(e) {
|
|
1346
|
+
if (typeof e == "string" || Z(e))
|
|
1277
1347
|
return e;
|
|
1278
1348
|
var t = e + "";
|
|
1279
1349
|
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
1280
1350
|
}
|
|
1281
|
-
function
|
|
1282
|
-
t =
|
|
1351
|
+
function _t(e, t) {
|
|
1352
|
+
t = bn(t, e);
|
|
1283
1353
|
for (var n = 0, r = t.length; e != null && n < r; )
|
|
1284
|
-
e = e[
|
|
1354
|
+
e = e[$e(t[n++])];
|
|
1285
1355
|
return n && n == r ? e : void 0;
|
|
1286
1356
|
}
|
|
1287
|
-
function
|
|
1288
|
-
var r = e == null ? void 0 :
|
|
1357
|
+
function m(e, t, n) {
|
|
1358
|
+
var r = e == null ? void 0 : _t(e, t);
|
|
1289
1359
|
return r === void 0 ? n : r;
|
|
1290
1360
|
}
|
|
1291
|
-
function
|
|
1292
|
-
for (var n = -1, r = t.length,
|
|
1293
|
-
e[
|
|
1361
|
+
function mn(e, t) {
|
|
1362
|
+
for (var n = -1, r = t.length, i = e.length; ++n < r; )
|
|
1363
|
+
e[i + n] = t[n];
|
|
1294
1364
|
return e;
|
|
1295
1365
|
}
|
|
1296
|
-
var
|
|
1297
|
-
function
|
|
1298
|
-
return
|
|
1366
|
+
var $t = N ? N.isConcatSpreadable : void 0;
|
|
1367
|
+
function _s(e) {
|
|
1368
|
+
return M(e) || Te(e) || !!($t && e && e[$t]);
|
|
1299
1369
|
}
|
|
1300
|
-
function
|
|
1301
|
-
var
|
|
1302
|
-
for (n || (n =
|
|
1303
|
-
var a = e[
|
|
1304
|
-
n(a) ?
|
|
1370
|
+
function Sn(e, t, n, r, i) {
|
|
1371
|
+
var s = -1, o = e.length;
|
|
1372
|
+
for (n || (n = _s), i || (i = []); ++s < o; ) {
|
|
1373
|
+
var a = e[s];
|
|
1374
|
+
n(a) ? mn(i, a) : i[i.length] = a;
|
|
1305
1375
|
}
|
|
1376
|
+
return i;
|
|
1377
|
+
}
|
|
1378
|
+
function vn(e, t, n) {
|
|
1379
|
+
var r = -1, i = e.length;
|
|
1380
|
+
t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
|
|
1381
|
+
for (var s = Array(i); ++r < i; )
|
|
1382
|
+
s[r] = e[r + t];
|
|
1306
1383
|
return s;
|
|
1307
1384
|
}
|
|
1308
|
-
|
|
1309
|
-
|
|
1385
|
+
var ys = "\\ud800-\\udfff", gs = "\\u0300-\\u036f", bs = "\\ufe20-\\ufe2f", ms = "\\u20d0-\\u20ff", Ss = gs + bs + ms, vs = "\\ufe0e\\ufe0f", ws = "\\u200d", Os = RegExp("[" + ws + ys + Ss + vs + "]");
|
|
1386
|
+
function Cs(e) {
|
|
1387
|
+
return Os.test(e);
|
|
1388
|
+
}
|
|
1389
|
+
function Ms() {
|
|
1390
|
+
this.__data__ = new B(), this.size = 0;
|
|
1310
1391
|
}
|
|
1311
1392
|
function As(e) {
|
|
1312
1393
|
var t = this.__data__, n = t.delete(e);
|
|
1313
1394
|
return this.size = t.size, n;
|
|
1314
1395
|
}
|
|
1315
|
-
function
|
|
1396
|
+
function Ps(e) {
|
|
1316
1397
|
return this.__data__.get(e);
|
|
1317
1398
|
}
|
|
1318
|
-
function
|
|
1399
|
+
function xs(e) {
|
|
1319
1400
|
return this.__data__.has(e);
|
|
1320
1401
|
}
|
|
1321
|
-
var
|
|
1402
|
+
var Es = 200;
|
|
1322
1403
|
function Ts(e, t) {
|
|
1323
1404
|
var n = this.__data__;
|
|
1324
|
-
if (n instanceof
|
|
1405
|
+
if (n instanceof B) {
|
|
1325
1406
|
var r = n.__data__;
|
|
1326
|
-
if (!
|
|
1407
|
+
if (!ge || r.length < Es - 1)
|
|
1327
1408
|
return r.push([e, t]), this.size = ++n.size, this;
|
|
1328
|
-
n = this.__data__ = new
|
|
1409
|
+
n = this.__data__ = new U(r);
|
|
1329
1410
|
}
|
|
1330
1411
|
return n.set(e, t), this.size = n.size, this;
|
|
1331
1412
|
}
|
|
1332
|
-
function
|
|
1333
|
-
var t = this.__data__ = new
|
|
1413
|
+
function L(e) {
|
|
1414
|
+
var t = this.__data__ = new B(e);
|
|
1334
1415
|
this.size = t.size;
|
|
1335
1416
|
}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
function
|
|
1342
|
-
for (var n = -1, r = e == null ? 0 : e.length,
|
|
1417
|
+
L.prototype.clear = Ms;
|
|
1418
|
+
L.prototype.delete = As;
|
|
1419
|
+
L.prototype.get = Ps;
|
|
1420
|
+
L.prototype.has = xs;
|
|
1421
|
+
L.prototype.set = Ts;
|
|
1422
|
+
function wn(e, t) {
|
|
1423
|
+
for (var n = -1, r = e == null ? 0 : e.length, i = 0, s = []; ++n < r; ) {
|
|
1343
1424
|
var o = e[n];
|
|
1344
|
-
t(o, n, e) && (i
|
|
1425
|
+
t(o, n, e) && (s[i++] = o);
|
|
1345
1426
|
}
|
|
1346
|
-
return
|
|
1427
|
+
return s;
|
|
1347
1428
|
}
|
|
1348
|
-
function
|
|
1429
|
+
function Rs() {
|
|
1349
1430
|
return [];
|
|
1350
1431
|
}
|
|
1351
|
-
var
|
|
1352
|
-
return e == null ? [] : (e = Object(e),
|
|
1432
|
+
var Is = Object.prototype, js = Is.propertyIsEnumerable, Ft = Object.getOwnPropertySymbols, $s = Ft ? function(e) {
|
|
1433
|
+
return e == null ? [] : (e = Object(e), wn(Ft(e), function(t) {
|
|
1353
1434
|
return js.call(e, t);
|
|
1354
1435
|
}));
|
|
1355
|
-
} :
|
|
1436
|
+
} : Rs;
|
|
1356
1437
|
function Fs(e, t, n) {
|
|
1357
1438
|
var r = t(e);
|
|
1358
|
-
return
|
|
1439
|
+
return M(e) ? r : mn(r, n(e));
|
|
1359
1440
|
}
|
|
1360
|
-
function
|
|
1361
|
-
return Fs(e,
|
|
1441
|
+
function zt(e) {
|
|
1442
|
+
return Fs(e, Re, $s);
|
|
1362
1443
|
}
|
|
1363
|
-
var
|
|
1364
|
-
(
|
|
1365
|
-
var t =
|
|
1444
|
+
var Je = re(Q, "DataView"), Ye = re(Q, "Promise"), Xe = re(Q, "Set"), Nt = "[object Map]", zs = "[object Object]", Dt = "[object Promise]", Ht = "[object Set]", Lt = "[object WeakMap]", qt = "[object DataView]", Ns = ne(Je), Ds = ne(ge), Hs = ne(Ye), Ls = ne(Xe), qs = ne(Ve), F = te;
|
|
1445
|
+
(Je && F(new Je(new ArrayBuffer(1))) != qt || ge && F(new ge()) != Nt || Ye && F(Ye.resolve()) != Dt || Xe && F(new Xe()) != Ht || Ve && F(new Ve()) != Lt) && (F = function(e) {
|
|
1446
|
+
var t = te(e), n = t == zs ? e.constructor : void 0, r = n ? ne(n) : "";
|
|
1366
1447
|
if (r)
|
|
1367
1448
|
switch (r) {
|
|
1449
|
+
case Ns:
|
|
1450
|
+
return qt;
|
|
1368
1451
|
case Ds:
|
|
1369
|
-
return
|
|
1452
|
+
return Nt;
|
|
1370
1453
|
case Hs:
|
|
1371
|
-
return
|
|
1372
|
-
case Ns:
|
|
1373
|
-
return dt;
|
|
1454
|
+
return Dt;
|
|
1374
1455
|
case Ls:
|
|
1375
|
-
return
|
|
1456
|
+
return Ht;
|
|
1376
1457
|
case qs:
|
|
1377
|
-
return
|
|
1458
|
+
return Lt;
|
|
1378
1459
|
}
|
|
1379
1460
|
return t;
|
|
1380
1461
|
});
|
|
1381
|
-
var
|
|
1382
|
-
function
|
|
1462
|
+
var Qt = Q.Uint8Array, Qs = "__lodash_hash_undefined__";
|
|
1463
|
+
function Bs(e) {
|
|
1383
1464
|
return this.__data__.set(e, Qs), this;
|
|
1384
1465
|
}
|
|
1385
1466
|
function Us(e) {
|
|
1386
1467
|
return this.__data__.has(e);
|
|
1387
1468
|
}
|
|
1388
|
-
function
|
|
1469
|
+
function Ee(e) {
|
|
1389
1470
|
var t = -1, n = e == null ? 0 : e.length;
|
|
1390
|
-
for (this.__data__ = new
|
|
1471
|
+
for (this.__data__ = new U(); ++t < n; )
|
|
1391
1472
|
this.add(e[t]);
|
|
1392
1473
|
}
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
function
|
|
1474
|
+
Ee.prototype.add = Ee.prototype.push = Bs;
|
|
1475
|
+
Ee.prototype.has = Us;
|
|
1476
|
+
function Gs(e, t) {
|
|
1396
1477
|
for (var n = -1, r = e == null ? 0 : e.length; ++n < r; )
|
|
1397
1478
|
if (t(e[n], n, e))
|
|
1398
1479
|
return !0;
|
|
@@ -1401,325 +1482,471 @@ function Bs(e, t) {
|
|
|
1401
1482
|
function Ks(e, t) {
|
|
1402
1483
|
return e.has(t);
|
|
1403
1484
|
}
|
|
1404
|
-
var Ws = 1,
|
|
1405
|
-
function
|
|
1485
|
+
var Ws = 1, Vs = 2;
|
|
1486
|
+
function On(e, t, n, r, i, s) {
|
|
1406
1487
|
var o = n & Ws, a = e.length, c = t.length;
|
|
1407
1488
|
if (a != c && !(o && c > a))
|
|
1408
1489
|
return !1;
|
|
1409
|
-
var u =
|
|
1410
|
-
if (u &&
|
|
1411
|
-
return u == t &&
|
|
1412
|
-
var
|
|
1413
|
-
for (
|
|
1414
|
-
var
|
|
1490
|
+
var u = s.get(e), l = s.get(t);
|
|
1491
|
+
if (u && l)
|
|
1492
|
+
return u == t && l == e;
|
|
1493
|
+
var f = -1, h = !0, p = n & Vs ? new Ee() : void 0;
|
|
1494
|
+
for (s.set(e, t), s.set(t, e); ++f < a; ) {
|
|
1495
|
+
var g = e[f], b = t[f];
|
|
1415
1496
|
if (r)
|
|
1416
|
-
var
|
|
1417
|
-
if (
|
|
1418
|
-
if (
|
|
1497
|
+
var w = o ? r(b, g, f, t, e, s) : r(g, b, f, e, t, s);
|
|
1498
|
+
if (w !== void 0) {
|
|
1499
|
+
if (w)
|
|
1419
1500
|
continue;
|
|
1420
|
-
|
|
1501
|
+
h = !1;
|
|
1421
1502
|
break;
|
|
1422
1503
|
}
|
|
1423
|
-
if (
|
|
1424
|
-
if (!
|
|
1425
|
-
if (!Ks(
|
|
1426
|
-
return
|
|
1504
|
+
if (p) {
|
|
1505
|
+
if (!Gs(t, function(C, S) {
|
|
1506
|
+
if (!Ks(p, S) && (g === C || i(g, C, n, r, s)))
|
|
1507
|
+
return p.push(S);
|
|
1427
1508
|
})) {
|
|
1428
|
-
|
|
1509
|
+
h = !1;
|
|
1429
1510
|
break;
|
|
1430
1511
|
}
|
|
1431
|
-
} else if (!(
|
|
1432
|
-
|
|
1512
|
+
} else if (!(g === b || i(g, b, n, r, s))) {
|
|
1513
|
+
h = !1;
|
|
1433
1514
|
break;
|
|
1434
1515
|
}
|
|
1435
1516
|
}
|
|
1436
|
-
return
|
|
1517
|
+
return s.delete(e), s.delete(t), h;
|
|
1437
1518
|
}
|
|
1438
|
-
function
|
|
1519
|
+
function Js(e) {
|
|
1439
1520
|
var t = -1, n = Array(e.size);
|
|
1440
|
-
return e.forEach(function(r,
|
|
1441
|
-
n[++t] = [
|
|
1521
|
+
return e.forEach(function(r, i) {
|
|
1522
|
+
n[++t] = [i, r];
|
|
1442
1523
|
}), n;
|
|
1443
1524
|
}
|
|
1444
|
-
function
|
|
1525
|
+
function Ys(e) {
|
|
1445
1526
|
var t = -1, n = Array(e.size);
|
|
1446
1527
|
return e.forEach(function(r) {
|
|
1447
1528
|
n[++t] = r;
|
|
1448
1529
|
}), n;
|
|
1449
1530
|
}
|
|
1450
|
-
var
|
|
1451
|
-
function
|
|
1531
|
+
var Xs = 1, Zs = 2, ks = "[object Boolean]", eo = "[object Date]", to = "[object Error]", no = "[object Map]", ro = "[object Number]", io = "[object RegExp]", so = "[object Set]", oo = "[object String]", ao = "[object Symbol]", co = "[object ArrayBuffer]", uo = "[object DataView]", Bt = N ? N.prototype : void 0, Le = Bt ? Bt.valueOf : void 0;
|
|
1532
|
+
function lo(e, t, n, r, i, s, o) {
|
|
1452
1533
|
switch (n) {
|
|
1453
|
-
case
|
|
1534
|
+
case uo:
|
|
1454
1535
|
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
|
|
1455
1536
|
return !1;
|
|
1456
1537
|
e = e.buffer, t = t.buffer;
|
|
1457
|
-
case
|
|
1458
|
-
return !(e.byteLength != t.byteLength || !
|
|
1538
|
+
case co:
|
|
1539
|
+
return !(e.byteLength != t.byteLength || !s(new Qt(e), new Qt(t)));
|
|
1459
1540
|
case ks:
|
|
1460
|
-
case
|
|
1461
|
-
case
|
|
1462
|
-
return
|
|
1463
|
-
case
|
|
1541
|
+
case eo:
|
|
1542
|
+
case ro:
|
|
1543
|
+
return ut(+e, +t);
|
|
1544
|
+
case to:
|
|
1464
1545
|
return e.name == t.name && e.message == t.message;
|
|
1465
|
-
case
|
|
1466
|
-
case
|
|
1546
|
+
case io:
|
|
1547
|
+
case oo:
|
|
1467
1548
|
return e == t + "";
|
|
1468
|
-
case
|
|
1469
|
-
var a =
|
|
1470
|
-
case
|
|
1471
|
-
var c = r &
|
|
1472
|
-
if (a || (a =
|
|
1549
|
+
case no:
|
|
1550
|
+
var a = Js;
|
|
1551
|
+
case so:
|
|
1552
|
+
var c = r & Xs;
|
|
1553
|
+
if (a || (a = Ys), e.size != t.size && !c)
|
|
1473
1554
|
return !1;
|
|
1474
1555
|
var u = o.get(e);
|
|
1475
1556
|
if (u)
|
|
1476
1557
|
return u == t;
|
|
1477
|
-
r |=
|
|
1478
|
-
var
|
|
1479
|
-
return o.delete(e),
|
|
1480
|
-
case
|
|
1481
|
-
if (
|
|
1482
|
-
return
|
|
1558
|
+
r |= Zs, o.set(e, t);
|
|
1559
|
+
var l = On(a(e), a(t), r, i, s, o);
|
|
1560
|
+
return o.delete(e), l;
|
|
1561
|
+
case ao:
|
|
1562
|
+
if (Le)
|
|
1563
|
+
return Le.call(e) == Le.call(t);
|
|
1483
1564
|
}
|
|
1484
1565
|
return !1;
|
|
1485
1566
|
}
|
|
1486
|
-
var
|
|
1487
|
-
function
|
|
1488
|
-
var o = n &
|
|
1489
|
-
if (c !=
|
|
1567
|
+
var fo = 1, ho = Object.prototype, po = ho.hasOwnProperty;
|
|
1568
|
+
function _o(e, t, n, r, i, s) {
|
|
1569
|
+
var o = n & fo, a = zt(e), c = a.length, u = zt(t), l = u.length;
|
|
1570
|
+
if (c != l && !o)
|
|
1490
1571
|
return !1;
|
|
1491
|
-
for (var
|
|
1492
|
-
var
|
|
1493
|
-
if (!(o ?
|
|
1572
|
+
for (var f = c; f--; ) {
|
|
1573
|
+
var h = a[f];
|
|
1574
|
+
if (!(o ? h in t : po.call(t, h)))
|
|
1494
1575
|
return !1;
|
|
1495
1576
|
}
|
|
1496
|
-
var
|
|
1497
|
-
if (
|
|
1498
|
-
return
|
|
1499
|
-
var
|
|
1500
|
-
|
|
1501
|
-
for (var
|
|
1502
|
-
|
|
1503
|
-
var
|
|
1577
|
+
var p = s.get(e), g = s.get(t);
|
|
1578
|
+
if (p && g)
|
|
1579
|
+
return p == t && g == e;
|
|
1580
|
+
var b = !0;
|
|
1581
|
+
s.set(e, t), s.set(t, e);
|
|
1582
|
+
for (var w = o; ++f < c; ) {
|
|
1583
|
+
h = a[f];
|
|
1584
|
+
var C = e[h], S = t[h];
|
|
1504
1585
|
if (r)
|
|
1505
|
-
var
|
|
1506
|
-
if (!(
|
|
1507
|
-
|
|
1586
|
+
var P = o ? r(S, C, h, t, e, s) : r(C, S, h, e, t, s);
|
|
1587
|
+
if (!(P === void 0 ? C === S || i(C, S, n, r, s) : P)) {
|
|
1588
|
+
b = !1;
|
|
1508
1589
|
break;
|
|
1509
1590
|
}
|
|
1510
|
-
|
|
1591
|
+
w || (w = h == "constructor");
|
|
1511
1592
|
}
|
|
1512
|
-
if (
|
|
1513
|
-
var
|
|
1514
|
-
|
|
1593
|
+
if (b && !w) {
|
|
1594
|
+
var V = e.constructor, _ = t.constructor;
|
|
1595
|
+
V != _ && "constructor" in e && "constructor" in t && !(typeof V == "function" && V instanceof V && typeof _ == "function" && _ instanceof _) && (b = !1);
|
|
1515
1596
|
}
|
|
1516
|
-
return
|
|
1597
|
+
return s.delete(e), s.delete(t), b;
|
|
1517
1598
|
}
|
|
1518
|
-
var
|
|
1519
|
-
function
|
|
1520
|
-
var o =
|
|
1521
|
-
c = c ==
|
|
1522
|
-
var
|
|
1523
|
-
if (
|
|
1524
|
-
if (!
|
|
1599
|
+
var yo = 1, Ut = "[object Arguments]", Gt = "[object Array]", Se = "[object Object]", go = Object.prototype, Kt = go.hasOwnProperty;
|
|
1600
|
+
function bo(e, t, n, r, i, s) {
|
|
1601
|
+
var o = M(e), a = M(t), c = o ? Gt : F(e), u = a ? Gt : F(t);
|
|
1602
|
+
c = c == Ut ? Se : c, u = u == Ut ? Se : u;
|
|
1603
|
+
var l = c == Se, f = u == Se, h = c == u;
|
|
1604
|
+
if (h && xe(e)) {
|
|
1605
|
+
if (!xe(t))
|
|
1525
1606
|
return !1;
|
|
1526
|
-
o = !0,
|
|
1527
|
-
}
|
|
1528
|
-
if (
|
|
1529
|
-
return
|
|
1530
|
-
if (!(n &
|
|
1531
|
-
var
|
|
1532
|
-
if (
|
|
1533
|
-
var
|
|
1534
|
-
return
|
|
1607
|
+
o = !0, l = !1;
|
|
1608
|
+
}
|
|
1609
|
+
if (h && !l)
|
|
1610
|
+
return s || (s = new L()), o || ft(e) ? On(e, t, n, r, i, s) : lo(e, t, c, n, r, i, s);
|
|
1611
|
+
if (!(n & yo)) {
|
|
1612
|
+
var p = l && Kt.call(e, "__wrapped__"), g = f && Kt.call(t, "__wrapped__");
|
|
1613
|
+
if (p || g) {
|
|
1614
|
+
var b = p ? e.value() : e, w = g ? t.value() : t;
|
|
1615
|
+
return s || (s = new L()), i(b, w, n, r, s);
|
|
1535
1616
|
}
|
|
1536
1617
|
}
|
|
1537
|
-
return
|
|
1618
|
+
return h ? (s || (s = new L()), _o(e, t, n, r, i, s)) : !1;
|
|
1538
1619
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return e === t ? !0 : e == null || t == null || !
|
|
1620
|
+
function Fe(e, t, n, r, i) {
|
|
1621
|
+
return e === t ? !0 : e == null || t == null || !X(e) && !X(t) ? e !== e && t !== t : bo(e, t, n, r, Fe, i);
|
|
1541
1622
|
}
|
|
1542
|
-
var
|
|
1543
|
-
function
|
|
1544
|
-
var
|
|
1623
|
+
var mo = 1, So = 2;
|
|
1624
|
+
function vo(e, t, n, r) {
|
|
1625
|
+
var i = n.length, s = i;
|
|
1545
1626
|
if (e == null)
|
|
1546
|
-
return !
|
|
1547
|
-
for (e = Object(e);
|
|
1548
|
-
var o = n[
|
|
1627
|
+
return !s;
|
|
1628
|
+
for (e = Object(e); i--; ) {
|
|
1629
|
+
var o = n[i];
|
|
1549
1630
|
if (o[2] ? o[1] !== e[o[0]] : !(o[0] in e))
|
|
1550
1631
|
return !1;
|
|
1551
1632
|
}
|
|
1552
|
-
for (; ++
|
|
1553
|
-
o = n[
|
|
1633
|
+
for (; ++i < s; ) {
|
|
1634
|
+
o = n[i];
|
|
1554
1635
|
var a = o[0], c = e[a], u = o[1];
|
|
1555
1636
|
if (o[2]) {
|
|
1556
1637
|
if (c === void 0 && !(a in e))
|
|
1557
1638
|
return !1;
|
|
1558
1639
|
} else {
|
|
1559
|
-
var
|
|
1560
|
-
if (!(
|
|
1640
|
+
var l = new L(), f;
|
|
1641
|
+
if (!(f === void 0 ? Fe(u, c, mo | So, r, l) : f))
|
|
1561
1642
|
return !1;
|
|
1562
1643
|
}
|
|
1563
1644
|
}
|
|
1564
1645
|
return !0;
|
|
1565
1646
|
}
|
|
1566
|
-
function
|
|
1567
|
-
return e === e && !
|
|
1647
|
+
function Cn(e) {
|
|
1648
|
+
return e === e && !ae(e);
|
|
1568
1649
|
}
|
|
1569
|
-
function
|
|
1570
|
-
for (var t =
|
|
1571
|
-
var r = t[n],
|
|
1572
|
-
t[n] = [r,
|
|
1650
|
+
function wo(e) {
|
|
1651
|
+
for (var t = Re(e), n = t.length; n--; ) {
|
|
1652
|
+
var r = t[n], i = e[r];
|
|
1653
|
+
t[n] = [r, i, Cn(i)];
|
|
1573
1654
|
}
|
|
1574
1655
|
return t;
|
|
1575
1656
|
}
|
|
1576
|
-
function
|
|
1657
|
+
function Mn(e, t) {
|
|
1577
1658
|
return function(n) {
|
|
1578
1659
|
return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
|
|
1579
1660
|
};
|
|
1580
1661
|
}
|
|
1581
|
-
function
|
|
1582
|
-
var t =
|
|
1583
|
-
return t.length == 1 && t[0][2] ?
|
|
1584
|
-
return n === e ||
|
|
1662
|
+
function Oo(e) {
|
|
1663
|
+
var t = wo(e);
|
|
1664
|
+
return t.length == 1 && t[0][2] ? Mn(t[0][0], t[0][1]) : function(n) {
|
|
1665
|
+
return n === e || vo(n, e, t);
|
|
1585
1666
|
};
|
|
1586
1667
|
}
|
|
1587
|
-
function
|
|
1668
|
+
function Co(e, t) {
|
|
1588
1669
|
return e != null && t in Object(e);
|
|
1589
1670
|
}
|
|
1590
|
-
function
|
|
1591
|
-
t =
|
|
1592
|
-
for (var r = -1,
|
|
1593
|
-
var o =
|
|
1594
|
-
if (!(
|
|
1671
|
+
function Mo(e, t, n) {
|
|
1672
|
+
t = bn(t, e);
|
|
1673
|
+
for (var r = -1, i = t.length, s = !1; ++r < i; ) {
|
|
1674
|
+
var o = $e(t[r]);
|
|
1675
|
+
if (!(s = e != null && n(e, o)))
|
|
1595
1676
|
break;
|
|
1596
1677
|
e = e[o];
|
|
1597
1678
|
}
|
|
1598
|
-
return
|
|
1679
|
+
return s || ++r != i ? s : (i = e == null ? 0 : e.length, !!i && lt(i) && ct(o, i) && (M(e) || Te(e)));
|
|
1599
1680
|
}
|
|
1600
|
-
function
|
|
1601
|
-
return e != null &&
|
|
1681
|
+
function Ao(e, t) {
|
|
1682
|
+
return e != null && Mo(e, t, Co);
|
|
1602
1683
|
}
|
|
1603
|
-
var
|
|
1604
|
-
function
|
|
1605
|
-
return
|
|
1606
|
-
var r =
|
|
1607
|
-
return r === void 0 && r === t ?
|
|
1684
|
+
var Po = 1, xo = 2;
|
|
1685
|
+
function Eo(e, t) {
|
|
1686
|
+
return dt(e) && Cn(t) ? Mn($e(e), t) : function(n) {
|
|
1687
|
+
var r = m(n, e);
|
|
1688
|
+
return r === void 0 && r === t ? Ao(n, e) : Fe(t, r, Po | xo);
|
|
1608
1689
|
};
|
|
1609
1690
|
}
|
|
1610
|
-
function
|
|
1691
|
+
function An(e) {
|
|
1611
1692
|
return function(t) {
|
|
1612
1693
|
return t?.[e];
|
|
1613
1694
|
};
|
|
1614
1695
|
}
|
|
1615
|
-
function
|
|
1696
|
+
function To(e) {
|
|
1616
1697
|
return function(t) {
|
|
1617
|
-
return
|
|
1698
|
+
return _t(t, e);
|
|
1618
1699
|
};
|
|
1619
1700
|
}
|
|
1620
|
-
function
|
|
1621
|
-
return
|
|
1701
|
+
function Ro(e) {
|
|
1702
|
+
return dt(e) ? An($e(e)) : To(e);
|
|
1622
1703
|
}
|
|
1623
|
-
function
|
|
1624
|
-
return typeof e == "function" ? e : e == null ?
|
|
1704
|
+
function W(e) {
|
|
1705
|
+
return typeof e == "function" ? e : e == null ? me : typeof e == "object" ? M(e) ? Eo(e[0], e[1]) : Oo(e) : Ro(e);
|
|
1625
1706
|
}
|
|
1626
|
-
function
|
|
1707
|
+
function Io(e) {
|
|
1627
1708
|
return function(t, n, r) {
|
|
1628
|
-
for (var
|
|
1629
|
-
var c = o[++
|
|
1630
|
-
if (n(
|
|
1709
|
+
for (var i = -1, s = Object(t), o = r(t), a = o.length; a--; ) {
|
|
1710
|
+
var c = o[++i];
|
|
1711
|
+
if (n(s[c], c, s) === !1)
|
|
1631
1712
|
break;
|
|
1632
1713
|
}
|
|
1633
1714
|
return t;
|
|
1634
1715
|
};
|
|
1635
1716
|
}
|
|
1636
|
-
var
|
|
1637
|
-
function $
|
|
1638
|
-
return e &&
|
|
1717
|
+
var jo = Io();
|
|
1718
|
+
function $o(e, t) {
|
|
1719
|
+
return e && jo(e, t, Re);
|
|
1639
1720
|
}
|
|
1640
|
-
function
|
|
1721
|
+
function Fo(e, t) {
|
|
1641
1722
|
return function(n, r) {
|
|
1642
1723
|
if (n == null)
|
|
1643
1724
|
return n;
|
|
1644
|
-
if (!
|
|
1725
|
+
if (!ie(n))
|
|
1645
1726
|
return e(n, r);
|
|
1646
|
-
for (var
|
|
1727
|
+
for (var i = n.length, s = -1, o = Object(n); ++s < i && r(o[s], s, o) !== !1; )
|
|
1647
1728
|
;
|
|
1648
1729
|
return n;
|
|
1649
1730
|
};
|
|
1650
1731
|
}
|
|
1651
|
-
var
|
|
1652
|
-
function
|
|
1732
|
+
var ze = Fo($o);
|
|
1733
|
+
function fe(e) {
|
|
1653
1734
|
var t = e == null ? 0 : e.length;
|
|
1654
1735
|
return t ? e[t - 1] : void 0;
|
|
1655
1736
|
}
|
|
1656
|
-
function
|
|
1737
|
+
function zo(e) {
|
|
1738
|
+
return typeof e == "function" ? e : me;
|
|
1739
|
+
}
|
|
1740
|
+
function Oe(e, t) {
|
|
1741
|
+
var n = M(e) ? Br : ze;
|
|
1742
|
+
return n(e, zo(t));
|
|
1743
|
+
}
|
|
1744
|
+
function No(e, t) {
|
|
1657
1745
|
for (var n = -1, r = e == null ? 0 : e.length; ++n < r; )
|
|
1658
1746
|
if (!t(e[n], n, e))
|
|
1659
1747
|
return !1;
|
|
1660
1748
|
return !0;
|
|
1661
1749
|
}
|
|
1662
|
-
function
|
|
1750
|
+
function Do(e, t) {
|
|
1663
1751
|
var n = !0;
|
|
1664
|
-
return
|
|
1665
|
-
return n = !!t(r,
|
|
1752
|
+
return ze(e, function(r, i, s) {
|
|
1753
|
+
return n = !!t(r, i, s), n;
|
|
1666
1754
|
}), n;
|
|
1667
1755
|
}
|
|
1668
|
-
function
|
|
1669
|
-
var r =
|
|
1670
|
-
return r(e,
|
|
1756
|
+
function Ho(e, t, n) {
|
|
1757
|
+
var r = M(e) ? No : Do;
|
|
1758
|
+
return r(e, W(t));
|
|
1671
1759
|
}
|
|
1672
|
-
function
|
|
1760
|
+
function Lo(e, t) {
|
|
1761
|
+
var n = [];
|
|
1762
|
+
return ze(e, function(r, i, s) {
|
|
1763
|
+
t(r, i, s) && n.push(r);
|
|
1764
|
+
}), n;
|
|
1765
|
+
}
|
|
1766
|
+
function Ce(e, t) {
|
|
1767
|
+
var n = M(e) ? wn : Lo;
|
|
1768
|
+
return n(e, W(t));
|
|
1769
|
+
}
|
|
1770
|
+
function qo(e) {
|
|
1673
1771
|
return function(t, n, r) {
|
|
1674
|
-
var
|
|
1675
|
-
if (!
|
|
1676
|
-
var
|
|
1677
|
-
t =
|
|
1678
|
-
return i
|
|
1772
|
+
var i = Object(t);
|
|
1773
|
+
if (!ie(t)) {
|
|
1774
|
+
var s = W(n);
|
|
1775
|
+
t = Re(t), n = function(a) {
|
|
1776
|
+
return s(i[a], a, i);
|
|
1679
1777
|
};
|
|
1680
1778
|
}
|
|
1681
1779
|
var o = e(t, n, r);
|
|
1682
|
-
return o > -1 ? s
|
|
1780
|
+
return o > -1 ? i[s ? t[o] : o] : void 0;
|
|
1683
1781
|
};
|
|
1684
1782
|
}
|
|
1685
|
-
var
|
|
1686
|
-
function
|
|
1783
|
+
var Qo = Math.max;
|
|
1784
|
+
function Bo(e, t, n) {
|
|
1687
1785
|
var r = e == null ? 0 : e.length;
|
|
1688
1786
|
if (!r)
|
|
1689
1787
|
return -1;
|
|
1690
|
-
var
|
|
1691
|
-
return
|
|
1692
|
-
}
|
|
1693
|
-
var
|
|
1694
|
-
function
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1788
|
+
var i = n == null ? 0 : ln(n);
|
|
1789
|
+
return i < 0 && (i = Qo(r + i, 0)), Ur(e, W(t), i);
|
|
1790
|
+
}
|
|
1791
|
+
var Ze = qo(Bo);
|
|
1792
|
+
function Uo(e) {
|
|
1793
|
+
return e && e.length ? e[0] : void 0;
|
|
1794
|
+
}
|
|
1795
|
+
function Pn(e, t) {
|
|
1796
|
+
var n = -1, r = ie(e) ? Array(e.length) : [];
|
|
1797
|
+
return ze(e, function(i, s, o) {
|
|
1798
|
+
r[++n] = t(i, s, o);
|
|
1698
1799
|
}), r;
|
|
1699
1800
|
}
|
|
1700
|
-
function
|
|
1701
|
-
var n =
|
|
1702
|
-
return n(e,
|
|
1801
|
+
function Y(e, t) {
|
|
1802
|
+
var n = M(e) ? de : Pn;
|
|
1803
|
+
return n(e, W(t));
|
|
1703
1804
|
}
|
|
1704
|
-
function
|
|
1705
|
-
return
|
|
1805
|
+
function Go(e, t) {
|
|
1806
|
+
return Sn(Y(e, t));
|
|
1706
1807
|
}
|
|
1707
|
-
function
|
|
1808
|
+
function Ko(e) {
|
|
1708
1809
|
for (var t = -1, n = e == null ? 0 : e.length, r = {}; ++t < n; ) {
|
|
1709
|
-
var
|
|
1710
|
-
r[
|
|
1810
|
+
var i = e[t];
|
|
1811
|
+
r[i[0]] = i[1];
|
|
1711
1812
|
}
|
|
1712
1813
|
return r;
|
|
1713
1814
|
}
|
|
1714
|
-
function
|
|
1715
|
-
return
|
|
1815
|
+
function Wo(e, t) {
|
|
1816
|
+
return e > t;
|
|
1716
1817
|
}
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1818
|
+
var Vo = "[object String]";
|
|
1819
|
+
function Jo(e) {
|
|
1820
|
+
return typeof e == "string" || !M(e) && X(e) && te(e) == Vo;
|
|
1821
|
+
}
|
|
1822
|
+
function Yo(e) {
|
|
1823
|
+
var t = e == null ? 0 : e.length;
|
|
1824
|
+
return t ? vn(e, 0, -1) : [];
|
|
1825
|
+
}
|
|
1826
|
+
var Xo = "[object Map]", Zo = "[object Set]", ko = Object.prototype, ea = ko.hasOwnProperty;
|
|
1827
|
+
function xn(e) {
|
|
1828
|
+
if (e == null)
|
|
1829
|
+
return !0;
|
|
1830
|
+
if (ie(e) && (M(e) || typeof e == "string" || typeof e.splice == "function" || xe(e) || ft(e) || Te(e)))
|
|
1831
|
+
return !e.length;
|
|
1832
|
+
var t = F(e);
|
|
1833
|
+
if (t == Xo || t == Zo)
|
|
1834
|
+
return !e.size;
|
|
1835
|
+
if (hn(e))
|
|
1836
|
+
return !ht(e).length;
|
|
1837
|
+
for (var n in e)
|
|
1838
|
+
if (ea.call(e, n))
|
|
1839
|
+
return !1;
|
|
1840
|
+
return !0;
|
|
1841
|
+
}
|
|
1842
|
+
function O(e, t) {
|
|
1843
|
+
return Fe(e, t);
|
|
1844
|
+
}
|
|
1845
|
+
var ta = Array.prototype, na = ta.join;
|
|
1846
|
+
function qe(e, t) {
|
|
1847
|
+
return e == null ? "" : na.call(e, t);
|
|
1848
|
+
}
|
|
1849
|
+
function ra(e, t) {
|
|
1850
|
+
return e < t;
|
|
1851
|
+
}
|
|
1852
|
+
function En(e, t, n) {
|
|
1853
|
+
for (var r = -1, i = e.length; ++r < i; ) {
|
|
1854
|
+
var s = e[r], o = t(s);
|
|
1855
|
+
if (o != null && (a === void 0 ? o === o && !Z(o) : n(o, a)))
|
|
1856
|
+
var a = o, c = s;
|
|
1857
|
+
}
|
|
1858
|
+
return c;
|
|
1859
|
+
}
|
|
1860
|
+
function Wt(e, t) {
|
|
1861
|
+
return e && e.length ? En(e, W(t), Wo) : void 0;
|
|
1862
|
+
}
|
|
1863
|
+
function ia(e, t) {
|
|
1864
|
+
return e && e.length ? En(e, W(t), ra) : void 0;
|
|
1865
|
+
}
|
|
1866
|
+
function sa(e, t) {
|
|
1867
|
+
var n = e.length;
|
|
1868
|
+
for (e.sort(t); n--; )
|
|
1869
|
+
e[n] = e[n].value;
|
|
1870
|
+
return e;
|
|
1871
|
+
}
|
|
1872
|
+
function oa(e, t) {
|
|
1873
|
+
if (e !== t) {
|
|
1874
|
+
var n = e !== void 0, r = e === null, i = e === e, s = Z(e), o = t !== void 0, a = t === null, c = t === t, u = Z(t);
|
|
1875
|
+
if (!a && !u && !s && e > t || s && o && c && !a && !u || r && o && c || !n && c || !i)
|
|
1876
|
+
return 1;
|
|
1877
|
+
if (!r && !s && !u && e < t || u && n && i && !r && !s || a && n && i || !o && i || !c)
|
|
1878
|
+
return -1;
|
|
1879
|
+
}
|
|
1880
|
+
return 0;
|
|
1881
|
+
}
|
|
1882
|
+
function aa(e, t, n) {
|
|
1883
|
+
for (var r = -1, i = e.criteria, s = t.criteria, o = i.length, a = n.length; ++r < o; ) {
|
|
1884
|
+
var c = oa(i[r], s[r]);
|
|
1885
|
+
if (c) {
|
|
1886
|
+
if (r >= a)
|
|
1887
|
+
return c;
|
|
1888
|
+
var u = n[r];
|
|
1889
|
+
return c * (u == "desc" ? -1 : 1);
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
return e.index - t.index;
|
|
1893
|
+
}
|
|
1894
|
+
function ca(e, t, n) {
|
|
1895
|
+
t.length ? t = de(t, function(s) {
|
|
1896
|
+
return M(s) ? function(o) {
|
|
1897
|
+
return _t(o, s.length === 1 ? s[0] : s);
|
|
1898
|
+
} : s;
|
|
1899
|
+
}) : t = [me];
|
|
1900
|
+
var r = -1;
|
|
1901
|
+
t = de(t, _n(W));
|
|
1902
|
+
var i = Pn(e, function(s, o, a) {
|
|
1903
|
+
var c = de(t, function(u) {
|
|
1904
|
+
return u(s);
|
|
1905
|
+
});
|
|
1906
|
+
return { criteria: c, index: ++r, value: s };
|
|
1907
|
+
});
|
|
1908
|
+
return sa(i, function(s, o) {
|
|
1909
|
+
return aa(s, o, n);
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
var ua = An("length"), Tn = "\\ud800-\\udfff", la = "\\u0300-\\u036f", fa = "\\ufe20-\\ufe2f", ha = "\\u20d0-\\u20ff", da = la + fa + ha, pa = "\\ufe0e\\ufe0f", _a = "[" + Tn + "]", ke = "[" + da + "]", et = "\\ud83c[\\udffb-\\udfff]", ya = "(?:" + ke + "|" + et + ")", Rn = "[^" + Tn + "]", In = "(?:\\ud83c[\\udde6-\\uddff]){2}", jn = "[\\ud800-\\udbff][\\udc00-\\udfff]", ga = "\\u200d", $n = ya + "?", Fn = "[" + pa + "]?", ba = "(?:" + ga + "(?:" + [Rn, In, jn].join("|") + ")" + Fn + $n + ")*", ma = Fn + $n + ba, Sa = "(?:" + [Rn + ke + "?", ke, In, jn, _a].join("|") + ")", Vt = RegExp(et + "(?=" + et + ")|" + Sa + ma, "g");
|
|
1913
|
+
function va(e) {
|
|
1914
|
+
for (var t = Vt.lastIndex = 0; Vt.test(e); )
|
|
1915
|
+
++t;
|
|
1916
|
+
return t;
|
|
1917
|
+
}
|
|
1918
|
+
function wa(e) {
|
|
1919
|
+
return Cs(e) ? va(e) : ua(e);
|
|
1920
|
+
}
|
|
1921
|
+
var Oa = "[object Map]", Ca = "[object Set]";
|
|
1922
|
+
function oe(e) {
|
|
1923
|
+
if (e == null)
|
|
1924
|
+
return 0;
|
|
1925
|
+
if (ie(e))
|
|
1926
|
+
return Jo(e) ? wa(e) : e.length;
|
|
1927
|
+
var t = F(e);
|
|
1928
|
+
return t == Oa || t == Ca ? e.size : ht(e).length;
|
|
1929
|
+
}
|
|
1930
|
+
var Me = Vr(function(e, t) {
|
|
1931
|
+
if (e == null)
|
|
1932
|
+
return [];
|
|
1933
|
+
var n = t.length;
|
|
1934
|
+
return n > 1 && xt(e, t[0], t[1]) ? t = [] : n > 2 && xt(t[0], t[1], t[2]) && (t = [t[0]]), ca(e, Sn(t), []);
|
|
1935
|
+
});
|
|
1936
|
+
function Ma(e, t, n) {
|
|
1937
|
+
return e && e.length ? (t = t === void 0 ? 1 : ln(t), vn(e, 0, t < 0 ? 0 : t)) : [];
|
|
1938
|
+
}
|
|
1939
|
+
var Aa = 0;
|
|
1940
|
+
function Jt(e) {
|
|
1941
|
+
var t = ++Aa;
|
|
1942
|
+
return gn(e) + t;
|
|
1943
|
+
}
|
|
1944
|
+
const Pa = (e, t) => {
|
|
1945
|
+
if (xn(e)) return [t];
|
|
1946
|
+
const n = fe(e);
|
|
1947
|
+
return O(n.type, "create") && O(t.type, "delete") ? null : O(n.type, "create") && O(t.type, "update") ? [{ ...n, data: t.data }] : O(n.type, "update") && O(t.type, "update") ? [...Yo(e), t] : O(n.type, "update") && O(t.type, "delete") ? [...e, t] : [t];
|
|
1721
1948
|
};
|
|
1722
|
-
class
|
|
1949
|
+
class xa {
|
|
1723
1950
|
_config;
|
|
1724
1951
|
_state;
|
|
1725
1952
|
_subscribers = /* @__PURE__ */ new Set();
|
|
@@ -1736,8 +1963,8 @@ class Vi {
|
|
|
1736
1963
|
}
|
|
1737
1964
|
enqueue(t) {
|
|
1738
1965
|
this._updateState((n) => {
|
|
1739
|
-
const r = [...n.queue.get(t.id) ?? []],
|
|
1740
|
-
|
|
1966
|
+
const r = [...n.queue.get(t.id) ?? []], i = Pa(r, t);
|
|
1967
|
+
i ? n.queue.set(t.id, i) : n.queue.delete(t.id), n.errors.delete(t.id);
|
|
1741
1968
|
}), this._scheduleFlush();
|
|
1742
1969
|
}
|
|
1743
1970
|
pause() {
|
|
@@ -1753,8 +1980,8 @@ class Vi {
|
|
|
1753
1980
|
retryAll() {
|
|
1754
1981
|
const t = this._state.errors;
|
|
1755
1982
|
t.size !== 0 && (this._updateState((n) => {
|
|
1756
|
-
for (const [r,
|
|
1757
|
-
n.queue.has(r) || n.queue.set(r,
|
|
1983
|
+
for (const [r, i] of t)
|
|
1984
|
+
n.queue.has(r) || n.queue.set(r, i.operations);
|
|
1758
1985
|
n.errors.clear();
|
|
1759
1986
|
}), this._scheduleFlush());
|
|
1760
1987
|
}
|
|
@@ -1786,7 +2013,7 @@ class Vi {
|
|
|
1786
2013
|
return this._subscribers.add(t), () => this._subscribers.delete(t);
|
|
1787
2014
|
}
|
|
1788
2015
|
_updateState(t) {
|
|
1789
|
-
this._state =
|
|
2016
|
+
this._state = I(this._state, t), this._subscribers.forEach((n) => n());
|
|
1790
2017
|
}
|
|
1791
2018
|
_scheduleFlush() {
|
|
1792
2019
|
this._state.isPaused || this._state.isSyncing || (this._clearTimer(), this._debounceTimer = setTimeout(() => this._flush(), this._config.debounce));
|
|
@@ -1794,64 +2021,97 @@ class Vi {
|
|
|
1794
2021
|
_clearTimer() {
|
|
1795
2022
|
this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null);
|
|
1796
2023
|
}
|
|
2024
|
+
/**
|
|
2025
|
+
* Flush pending changes to the server.
|
|
2026
|
+
*
|
|
2027
|
+
* Flow:
|
|
2028
|
+
* 1. Move queued items to inFlight (atomic swap prevents duplicate sends)
|
|
2029
|
+
* 2. Flatten all changes and optionally batch by batchSize
|
|
2030
|
+
* 3. Send to server via onSync callback
|
|
2031
|
+
* 4. Process results (handle success, retries, ID remapping)
|
|
2032
|
+
* 5. Schedule next flush if more items queued
|
|
2033
|
+
*/
|
|
1797
2034
|
async _flush() {
|
|
1798
2035
|
const { isPaused: t, isSyncing: n, queue: r } = this._state;
|
|
1799
|
-
if (t || n || r
|
|
1800
|
-
this.
|
|
1801
|
-
|
|
2036
|
+
if (t || n || O(oe(r), 0)) return;
|
|
2037
|
+
const i = m(this._config, "batchSize", 1 / 0), s = [...r.entries()], o = Ma(s, i), a = s.slice(oe(o));
|
|
2038
|
+
this._updateState((u) => {
|
|
2039
|
+
u.inFlight = new Map(o), u.queue = new Map(a), u.isSyncing = !0;
|
|
1802
2040
|
});
|
|
1803
|
-
const
|
|
2041
|
+
const c = Go([...this._state.inFlight.values()]);
|
|
1804
2042
|
this._abortController = new AbortController();
|
|
1805
2043
|
try {
|
|
1806
|
-
const
|
|
1807
|
-
this._processResults(
|
|
1808
|
-
} catch (
|
|
1809
|
-
this._handleError(
|
|
2044
|
+
const u = await this._config.onSync(c, this._abortController.signal);
|
|
2045
|
+
this._processResults(Ko(Y(u, (l) => [l.id, l])));
|
|
2046
|
+
} catch (u) {
|
|
2047
|
+
this._handleError(u);
|
|
1810
2048
|
}
|
|
1811
|
-
this._abortController = null, this._state.queue
|
|
1812
|
-
}
|
|
2049
|
+
this._abortController = null, oe(this._state.queue) > 0 && !this._state.isPaused && this._scheduleFlush();
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Process sync results and update state accordingly.
|
|
2053
|
+
*
|
|
2054
|
+
* For each item in flight:
|
|
2055
|
+
* - If ALL operations succeeded: clear errors, collect ID remappings
|
|
2056
|
+
* - If ANY operation failed: increment retry counter, re-queue if under maxRetries
|
|
2057
|
+
*
|
|
2058
|
+
* ID Remapping: When server assigns new IDs to created items (e.g., temp ID -> DB ID),
|
|
2059
|
+
* we collect these mappings and notify via onIdRemap callback so the collection
|
|
2060
|
+
* can update its local state.
|
|
2061
|
+
*/
|
|
1813
2062
|
_processResults(t) {
|
|
1814
2063
|
const n = this._state.inFlight, r = [];
|
|
1815
|
-
this._updateState((
|
|
1816
|
-
for (const [
|
|
1817
|
-
if (
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
const
|
|
1827
|
-
s.
|
|
1828
|
-
|
|
2064
|
+
this._updateState((i) => {
|
|
2065
|
+
for (const [s, o] of n)
|
|
2066
|
+
if (Ho(
|
|
2067
|
+
o,
|
|
2068
|
+
(c) => O(m(t, [c.id, "status"]), "success")
|
|
2069
|
+
))
|
|
2070
|
+
i.errors.delete(s), Oe(o, (c) => {
|
|
2071
|
+
const u = m(t, c.id);
|
|
2072
|
+
O(c.type, "create") && m(u, "newId") && !O(m(u, "newId"), c.id) && r.push({ tempId: c.id, newId: u.newId });
|
|
2073
|
+
});
|
|
2074
|
+
else {
|
|
2075
|
+
const c = m(i.errors.get(s), "retries", 0) + 1;
|
|
2076
|
+
c < this._config.maxRetries && !i.queue.has(s) && i.queue.set(s, o);
|
|
2077
|
+
const u = Ze(o, (l) => !O(m(t, [l.id, "status"]), "success"));
|
|
2078
|
+
i.errors.set(s, {
|
|
2079
|
+
error: m(t, [m(u, "id", ""), "error"], "Unknown error"),
|
|
1829
2080
|
retries: c,
|
|
1830
2081
|
operations: o
|
|
1831
2082
|
});
|
|
1832
2083
|
}
|
|
1833
|
-
|
|
1834
|
-
}), r
|
|
1835
|
-
}
|
|
2084
|
+
i.inFlight = /* @__PURE__ */ new Map(), i.isSyncing = !1;
|
|
2085
|
+
}), !xn(r) && this._config.onIdRemap && this._config.onIdRemap(r);
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* Handle network or unexpected errors during sync.
|
|
2089
|
+
*
|
|
2090
|
+
* Two scenarios:
|
|
2091
|
+
* 1. Aborted (e.g., SyncQueue destroyed): Re-queue all items without incrementing retries
|
|
2092
|
+
* 2. Actual error: Increment retries, re-queue if under limit, record error
|
|
2093
|
+
*
|
|
2094
|
+
* This ensures no data loss - failed operations are preserved for retry.
|
|
2095
|
+
*/
|
|
1836
2096
|
_handleError(t) {
|
|
1837
|
-
const n = this._state.inFlight, r = this._abortController
|
|
1838
|
-
this._updateState((
|
|
2097
|
+
const n = this._state.inFlight, r = m(this._abortController, "signal.aborted", !1), i = t instanceof Error ? t.message : String(t);
|
|
2098
|
+
this._updateState((s) => {
|
|
1839
2099
|
for (const [o, a] of n)
|
|
1840
2100
|
if (r)
|
|
1841
|
-
|
|
2101
|
+
s.queue.has(o) || s.queue.set(o, a);
|
|
1842
2102
|
else {
|
|
1843
|
-
const c = (
|
|
1844
|
-
c < this._config.maxRetries && !
|
|
1845
|
-
error:
|
|
2103
|
+
const c = m(s.errors.get(o), "retries", 0) + 1;
|
|
2104
|
+
c < this._config.maxRetries && !s.queue.has(o) && s.queue.set(o, a), s.errors.set(o, {
|
|
2105
|
+
error: i,
|
|
1846
2106
|
retries: c,
|
|
1847
2107
|
operations: a
|
|
1848
2108
|
});
|
|
1849
2109
|
}
|
|
1850
|
-
|
|
2110
|
+
s.inFlight = /* @__PURE__ */ new Map(), s.isSyncing = !1;
|
|
1851
2111
|
});
|
|
1852
2112
|
}
|
|
1853
2113
|
}
|
|
1854
|
-
class
|
|
2114
|
+
class Ea {
|
|
1855
2115
|
_cache = /* @__PURE__ */ new Map();
|
|
1856
2116
|
_capacity;
|
|
1857
2117
|
_ttl;
|
|
@@ -1884,7 +2144,7 @@ class Zi {
|
|
|
1884
2144
|
return this._cache.size;
|
|
1885
2145
|
}
|
|
1886
2146
|
}
|
|
1887
|
-
class
|
|
2147
|
+
class Ta {
|
|
1888
2148
|
_config;
|
|
1889
2149
|
_cache;
|
|
1890
2150
|
_state = { status: "idle", items: [] };
|
|
@@ -1892,43 +2152,43 @@ class Ji {
|
|
|
1892
2152
|
_abortController = null;
|
|
1893
2153
|
_currentContext = null;
|
|
1894
2154
|
constructor(t) {
|
|
1895
|
-
this._config = { retries: 0, ...t }, this._cache = new
|
|
2155
|
+
this._config = { retries: 0, ...t }, this._cache = new Ea(t.cacheCapacity, t.cacheTtl);
|
|
1896
2156
|
}
|
|
1897
2157
|
_getCacheKey = (t) => JSON.stringify([this._config.id, t]);
|
|
1898
2158
|
_setState(t) {
|
|
1899
|
-
this._state =
|
|
2159
|
+
this._state = I(this._state, (n) => {
|
|
1900
2160
|
Object.assign(n, t);
|
|
1901
2161
|
}), this._subscribers.forEach((n) => n());
|
|
1902
2162
|
}
|
|
1903
2163
|
async _fetchWithRetry(t, n) {
|
|
1904
2164
|
const r = this._config.retries;
|
|
1905
|
-
let
|
|
1906
|
-
for (let
|
|
2165
|
+
let i;
|
|
2166
|
+
for (let s = 0; s <= r; s++) {
|
|
1907
2167
|
if (n.aborted) throw new DOMException("Aborted", "AbortError");
|
|
1908
2168
|
try {
|
|
1909
|
-
return
|
|
2169
|
+
return s > 0 && this._setState({ retryCount: s }), await this._config.onFetch(t, n);
|
|
1910
2170
|
} catch (o) {
|
|
1911
|
-
if (
|
|
2171
|
+
if (i = o, n.aborted || s === r) throw o;
|
|
1912
2172
|
}
|
|
1913
2173
|
}
|
|
1914
|
-
throw
|
|
2174
|
+
throw i;
|
|
1915
2175
|
}
|
|
1916
2176
|
async fetch(t) {
|
|
1917
2177
|
const n = this._getCacheKey(t), r = this._cache.get(n);
|
|
1918
2178
|
if (r !== null)
|
|
1919
2179
|
return this._currentContext = t, this._setState({ status: "idle", items: r, error: void 0, retryCount: void 0 }), r;
|
|
1920
2180
|
this._abortController?.abort("New fetch request started");
|
|
1921
|
-
const
|
|
1922
|
-
this._abortController =
|
|
2181
|
+
const i = new AbortController();
|
|
2182
|
+
this._abortController = i, this._currentContext = t, this._setState({ status: "fetching", error: void 0, retryCount: void 0 });
|
|
1923
2183
|
try {
|
|
1924
|
-
const
|
|
1925
|
-
return this._cache.set(n,
|
|
1926
|
-
} catch (
|
|
1927
|
-
if (
|
|
2184
|
+
const s = await this._fetchWithRetry(t, i.signal);
|
|
2185
|
+
return this._cache.set(n, s), this._abortController = null, this._setState({ status: "idle", items: s, error: void 0, retryCount: void 0 }), s;
|
|
2186
|
+
} catch (s) {
|
|
2187
|
+
if (i.signal.aborted) return this._state.items;
|
|
1928
2188
|
throw this._abortController = null, this._setState({
|
|
1929
2189
|
status: "error",
|
|
1930
|
-
error:
|
|
1931
|
-
}),
|
|
2190
|
+
error: s instanceof Error ? s.message : String(s)
|
|
2191
|
+
}), s;
|
|
1932
2192
|
}
|
|
1933
2193
|
}
|
|
1934
2194
|
async refresh(t) {
|
|
@@ -1954,24 +2214,13 @@ class Ji {
|
|
|
1954
2214
|
};
|
|
1955
2215
|
}
|
|
1956
2216
|
}
|
|
1957
|
-
class
|
|
2217
|
+
class Yt {
|
|
1958
2218
|
_collection;
|
|
1959
2219
|
_id;
|
|
1960
2220
|
_cachedStatus = null;
|
|
1961
|
-
_refCount = 0;
|
|
1962
2221
|
constructor(t, n) {
|
|
1963
2222
|
this._collection = t, this._id = n;
|
|
1964
2223
|
}
|
|
1965
|
-
// Reference counting for lifecycle management
|
|
1966
|
-
_retain() {
|
|
1967
|
-
this._refCount++;
|
|
1968
|
-
}
|
|
1969
|
-
_release() {
|
|
1970
|
-
this._refCount--, this._refCount <= 0 && this._collection._releaseItem(this._id);
|
|
1971
|
-
}
|
|
1972
|
-
get refCount() {
|
|
1973
|
-
return this._refCount;
|
|
1974
|
-
}
|
|
1975
2224
|
get id() {
|
|
1976
2225
|
return this._id;
|
|
1977
2226
|
}
|
|
@@ -1986,7 +2235,7 @@ class ki {
|
|
|
1986
2235
|
}
|
|
1987
2236
|
getStatus() {
|
|
1988
2237
|
const t = this._collection.getItemStatus(this._id);
|
|
1989
|
-
return
|
|
2238
|
+
return O(this._cachedStatus, t) || (this._cachedStatus = t), this._cachedStatus;
|
|
1990
2239
|
}
|
|
1991
2240
|
exists() {
|
|
1992
2241
|
return this._collection.getState().items.has(this._id);
|
|
@@ -2001,50 +2250,245 @@ class ki {
|
|
|
2001
2250
|
this._id = t;
|
|
2002
2251
|
}
|
|
2003
2252
|
}
|
|
2004
|
-
|
|
2253
|
+
const Ra = ".";
|
|
2254
|
+
function Xt(e, t) {
|
|
2255
|
+
const n = e.lastIndexOf(t);
|
|
2256
|
+
return n === -1 ? null : e.slice(0, n);
|
|
2257
|
+
}
|
|
2258
|
+
function Ia(e, t, n) {
|
|
2259
|
+
return e.startsWith(t + n) ? !e.slice(t.length + 1).includes(n) : !1;
|
|
2260
|
+
}
|
|
2261
|
+
function Qe(e, t, n) {
|
|
2262
|
+
return e.startsWith(t + n);
|
|
2263
|
+
}
|
|
2264
|
+
function Zt(e, t) {
|
|
2265
|
+
return e.split(t).length - 1;
|
|
2266
|
+
}
|
|
2267
|
+
class kt {
|
|
2268
|
+
_id;
|
|
2269
|
+
_collection;
|
|
2270
|
+
_cachedStatus = null;
|
|
2271
|
+
constructor(t, n) {
|
|
2272
|
+
this._collection = t, this._id = n;
|
|
2273
|
+
}
|
|
2274
|
+
get _separator() {
|
|
2275
|
+
return this._collection.config.nodeSeparator ?? Ra;
|
|
2276
|
+
}
|
|
2277
|
+
get id() {
|
|
2278
|
+
return this._id;
|
|
2279
|
+
}
|
|
2280
|
+
get data() {
|
|
2281
|
+
return this._collection.getState().items.get(this._id);
|
|
2282
|
+
}
|
|
2283
|
+
get collection() {
|
|
2284
|
+
return this._collection;
|
|
2285
|
+
}
|
|
2286
|
+
get depth() {
|
|
2287
|
+
return Zt(this._id, this._separator);
|
|
2288
|
+
}
|
|
2289
|
+
exists() {
|
|
2290
|
+
return this._collection.getState().items.has(this._id);
|
|
2291
|
+
}
|
|
2292
|
+
getStatus() {
|
|
2293
|
+
const t = this._collection.getItemStatus(this._id);
|
|
2294
|
+
return O(this._cachedStatus, t) || (this._cachedStatus = t), this._cachedStatus;
|
|
2295
|
+
}
|
|
2296
|
+
getParent() {
|
|
2297
|
+
const t = Xt(this._id, this._separator);
|
|
2298
|
+
return t ? this._collection.getNode(t) : null;
|
|
2299
|
+
}
|
|
2300
|
+
getChildren() {
|
|
2301
|
+
const t = [...this._collection.items.entries()], n = Y(
|
|
2302
|
+
Ce(t, ([i]) => Ia(i, this._id, this._separator)),
|
|
2303
|
+
([i, s]) => ({ id: i, position: s.position })
|
|
2304
|
+
), r = Me(n, "position");
|
|
2305
|
+
return Y(r, (i) => this._collection.getNode(i.id));
|
|
2306
|
+
}
|
|
2307
|
+
_generateChildId() {
|
|
2308
|
+
const { getNodeId: t } = this._collection.config, n = t ? t() : Jt();
|
|
2309
|
+
return qe([this._id, n], this._separator);
|
|
2310
|
+
}
|
|
2311
|
+
append(t, n = "object") {
|
|
2312
|
+
const r = this.getChildren(), i = Wt(r, (u) => m(u, "data.position", 0)), o = (i ? m(i, "data.position", 0) : -1) + 1, a = this._generateChildId(), c = { id: a, position: o, value: t, type: n };
|
|
2313
|
+
return this._collection.create(c), a;
|
|
2314
|
+
}
|
|
2315
|
+
prepend(t, n = "object") {
|
|
2316
|
+
const r = this.getChildren(), i = ia(r, (u) => m(u, "data.position", 0)), o = (i ? m(i, "data.position", 0) : 1) - 1, a = this._generateChildId(), c = { id: a, position: o, value: t, type: n };
|
|
2317
|
+
return this._collection.create(c), a;
|
|
2318
|
+
}
|
|
2319
|
+
/**
|
|
2320
|
+
* Move node to a new position within the same parent (reordering)
|
|
2321
|
+
* or to a different parent (reparenting).
|
|
2322
|
+
*
|
|
2323
|
+
* @param targetPosition - The target position among siblings
|
|
2324
|
+
* @param targetParent - Optional target parent node. If not provided, moves within current parent.
|
|
2325
|
+
*/
|
|
2326
|
+
move(t, n) {
|
|
2327
|
+
const r = this.data;
|
|
2328
|
+
if (!r) return;
|
|
2329
|
+
const i = Xt(this._id, this._separator);
|
|
2330
|
+
if (!i) return;
|
|
2331
|
+
if (!n) {
|
|
2332
|
+
const o = r.position;
|
|
2333
|
+
if (o === t) return;
|
|
2334
|
+
const c = this._collection.getNode(i).getChildren(), u = Ze(c, (l) => m(l, "data.position") === t);
|
|
2335
|
+
this._collection.batch(() => {
|
|
2336
|
+
u && this._collection.update(u.id, (l) => {
|
|
2337
|
+
l.position = o;
|
|
2338
|
+
}), this._collection.update(this._id, (l) => {
|
|
2339
|
+
l.position = t;
|
|
2340
|
+
});
|
|
2341
|
+
});
|
|
2342
|
+
return;
|
|
2343
|
+
}
|
|
2344
|
+
if (n.id === i) {
|
|
2345
|
+
this.move(t);
|
|
2346
|
+
return;
|
|
2347
|
+
}
|
|
2348
|
+
if (n.id === this._id || Qe(n.id, this._id, this._separator))
|
|
2349
|
+
return;
|
|
2350
|
+
const s = this.clone();
|
|
2351
|
+
this._collection.batch(() => {
|
|
2352
|
+
n._mergeClonedSubset(s, t), this.remove();
|
|
2353
|
+
});
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* Clone this node and all its descendants into a Map with remapped IDs.
|
|
2357
|
+
* The root of the clone has a temporary ID that will be remapped when merged.
|
|
2358
|
+
* @returns Map of cloned nodes keyed by their relative path from clone root
|
|
2359
|
+
*/
|
|
2360
|
+
clone() {
|
|
2361
|
+
const t = this.data;
|
|
2362
|
+
if (!t) return /* @__PURE__ */ new Map();
|
|
2363
|
+
const { getNodeId: n } = this._collection.config, r = n ? n() : Jt(), i = /* @__PURE__ */ new Map();
|
|
2364
|
+
i.set(r, {
|
|
2365
|
+
id: r,
|
|
2366
|
+
position: t.position,
|
|
2367
|
+
value: t.value,
|
|
2368
|
+
type: t.type
|
|
2369
|
+
});
|
|
2370
|
+
const s = Ce(
|
|
2371
|
+
[...this._collection.items.entries()],
|
|
2372
|
+
([o]) => Qe(o, this._id, this._separator)
|
|
2373
|
+
);
|
|
2374
|
+
return Oe(s, ([o, a]) => {
|
|
2375
|
+
const c = o.slice(this._id.length + 1), u = qe([r, c], this._separator), l = a;
|
|
2376
|
+
i.set(u, {
|
|
2377
|
+
id: u,
|
|
2378
|
+
position: l.position,
|
|
2379
|
+
value: l.value,
|
|
2380
|
+
type: l.type
|
|
2381
|
+
});
|
|
2382
|
+
}), i;
|
|
2383
|
+
}
|
|
2384
|
+
/**
|
|
2385
|
+
* Internal method to merge a cloned subset under this node.
|
|
2386
|
+
* The cloned nodes will have their IDs prefixed with this node's ID.
|
|
2387
|
+
*/
|
|
2388
|
+
_mergeClonedSubset(t, n) {
|
|
2389
|
+
if (t.size === 0) return;
|
|
2390
|
+
const r = [...t.keys()];
|
|
2391
|
+
let i = Ze(r, (a) => !a.includes(this._separator));
|
|
2392
|
+
if (i || (i = Uo(Me(r, (a) => a.length))), !i) return;
|
|
2393
|
+
const s = this._generateChildId();
|
|
2394
|
+
let o;
|
|
2395
|
+
if (n !== void 0)
|
|
2396
|
+
o = n;
|
|
2397
|
+
else {
|
|
2398
|
+
const a = this.getChildren(), c = Wt(a, (l) => m(l, "data.position", 0));
|
|
2399
|
+
o = (c ? m(c, "data.position", 0) : -1) + 1;
|
|
2400
|
+
}
|
|
2401
|
+
return Oe([...t.entries()], ([a, c]) => {
|
|
2402
|
+
let u;
|
|
2403
|
+
if (a === i)
|
|
2404
|
+
u = s;
|
|
2405
|
+
else {
|
|
2406
|
+
const f = a.slice(i.length);
|
|
2407
|
+
u = qe([s, f.slice(this._separator.length)], this._separator);
|
|
2408
|
+
}
|
|
2409
|
+
const l = {
|
|
2410
|
+
id: u,
|
|
2411
|
+
position: a === i ? o : c.position,
|
|
2412
|
+
value: c.value,
|
|
2413
|
+
type: c.type
|
|
2414
|
+
};
|
|
2415
|
+
this._collection.create(l);
|
|
2416
|
+
}), s;
|
|
2417
|
+
}
|
|
2418
|
+
updateProp(t) {
|
|
2419
|
+
this._collection.update(this._id, (n) => {
|
|
2420
|
+
t(n.value);
|
|
2421
|
+
});
|
|
2422
|
+
}
|
|
2423
|
+
remove() {
|
|
2424
|
+
const t = [...this._collection.items.keys()], n = Y(
|
|
2425
|
+
Ce(t, (i) => Qe(i, this._id, this._separator)),
|
|
2426
|
+
(i) => i
|
|
2427
|
+
), r = [this._id, ...n];
|
|
2428
|
+
this._collection.batch(() => {
|
|
2429
|
+
const i = Me(r, (s) => -Zt(s, this._separator));
|
|
2430
|
+
Oe(i, (s) => this._collection.remove(s));
|
|
2431
|
+
});
|
|
2432
|
+
}
|
|
2433
|
+
select() {
|
|
2434
|
+
this._collection.selectNode(this._id);
|
|
2435
|
+
}
|
|
2436
|
+
_updateId(t) {
|
|
2437
|
+
this._id = t;
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
class R {
|
|
2005
2441
|
// Global cache of collection instances by id
|
|
2442
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2006
2443
|
static _cache = /* @__PURE__ */ new Map();
|
|
2007
2444
|
// Get or create a collection instance
|
|
2008
2445
|
static get(t) {
|
|
2009
|
-
const n =
|
|
2446
|
+
const n = R._cache.get(t.id);
|
|
2010
2447
|
if (n)
|
|
2011
2448
|
return n;
|
|
2012
|
-
const r = new
|
|
2013
|
-
return
|
|
2449
|
+
const r = new R(t);
|
|
2450
|
+
return R._cache.set(t.id, r), r;
|
|
2014
2451
|
}
|
|
2015
2452
|
// Clear a specific collection from cache
|
|
2016
2453
|
static clear(t) {
|
|
2017
|
-
|
|
2454
|
+
R._cache.delete(t);
|
|
2018
2455
|
}
|
|
2019
2456
|
// Clear all collections from cache
|
|
2020
2457
|
static clearAll() {
|
|
2021
|
-
|
|
2458
|
+
R._cache.clear();
|
|
2459
|
+
}
|
|
2460
|
+
// Get existing collection by ID (returns undefined if not found)
|
|
2461
|
+
static getById(t) {
|
|
2462
|
+
return R._cache.get(t);
|
|
2022
2463
|
}
|
|
2023
2464
|
id;
|
|
2024
2465
|
config;
|
|
2025
2466
|
_state;
|
|
2026
2467
|
_syncQueue;
|
|
2027
2468
|
_fetchHandler;
|
|
2028
|
-
_itemCache = /* @__PURE__ */ new
|
|
2469
|
+
_itemCache = /* @__PURE__ */ new WeakMap();
|
|
2470
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2471
|
+
_nodeCache = /* @__PURE__ */ new WeakMap();
|
|
2472
|
+
_selectedNodeId = null;
|
|
2029
2473
|
_subscribers = /* @__PURE__ */ new Set();
|
|
2030
2474
|
_hasInitialized = !1;
|
|
2031
2475
|
_batchMode = !1;
|
|
2032
2476
|
constructor(t) {
|
|
2033
2477
|
this.id = t.id, this.config = t;
|
|
2034
|
-
const n = async (
|
|
2035
|
-
this._syncQueue = new
|
|
2478
|
+
const n = async (s) => s.map((o) => ({ id: o.id, status: "success" }));
|
|
2479
|
+
this._syncQueue = new xa({
|
|
2036
2480
|
debounce: t.syncDebounce ?? 300,
|
|
2037
2481
|
maxRetries: t.syncRetries ?? 3,
|
|
2038
2482
|
onSync: t.onSync ?? n,
|
|
2039
|
-
onIdRemap: (
|
|
2040
|
-
}), this._fetchHandler = new
|
|
2483
|
+
onIdRemap: (s) => this._handleIdRemap(s)
|
|
2484
|
+
}), this._fetchHandler = new Ta({
|
|
2041
2485
|
id: t.id,
|
|
2042
2486
|
cacheCapacity: t.cacheCapacity ?? 10,
|
|
2043
2487
|
cacheTtl: t.cacheTtl ?? 6e4,
|
|
2044
2488
|
retries: t.fetchRetries ?? 0,
|
|
2045
2489
|
onFetch: t.onFetch
|
|
2046
2490
|
});
|
|
2047
|
-
const r = this._syncQueue.getState(),
|
|
2491
|
+
const r = this._syncQueue.getState(), i = this._fetchHandler.getState();
|
|
2048
2492
|
this._state = {
|
|
2049
2493
|
context: t.initialContext,
|
|
2050
2494
|
items: /* @__PURE__ */ new Map(),
|
|
@@ -2052,8 +2496,8 @@ class q {
|
|
|
2052
2496
|
loading: !1,
|
|
2053
2497
|
syncing: !1,
|
|
2054
2498
|
syncQueue: r,
|
|
2055
|
-
fetchStatus:
|
|
2056
|
-
fetchError:
|
|
2499
|
+
fetchStatus: i.status,
|
|
2500
|
+
fetchError: i.error
|
|
2057
2501
|
}, this._syncQueue.subscribe(() => {
|
|
2058
2502
|
this._onSyncQueueChange();
|
|
2059
2503
|
}), this._fetchHandler.subscribe(() => {
|
|
@@ -2088,35 +2532,35 @@ class q {
|
|
|
2088
2532
|
}
|
|
2089
2533
|
// Get item status from sync queue state
|
|
2090
2534
|
getItemStatus(t) {
|
|
2091
|
-
const { queue: n, inFlight: r, errors:
|
|
2092
|
-
if (
|
|
2535
|
+
const { queue: n, inFlight: r, errors: i } = this._state.syncQueue, s = r.get(t), o = fe(s);
|
|
2536
|
+
if (o)
|
|
2093
2537
|
return {
|
|
2094
|
-
type:
|
|
2538
|
+
type: o.type,
|
|
2095
2539
|
status: "syncing",
|
|
2096
|
-
retries:
|
|
2540
|
+
retries: m(i.get(t), "retries", 0)
|
|
2097
2541
|
};
|
|
2098
|
-
const
|
|
2099
|
-
if (
|
|
2100
|
-
const
|
|
2542
|
+
const a = n.get(t), c = fe(a);
|
|
2543
|
+
if (c) {
|
|
2544
|
+
const l = i.get(t);
|
|
2101
2545
|
return {
|
|
2102
2546
|
type: c.type,
|
|
2103
|
-
status:
|
|
2104
|
-
retries:
|
|
2105
|
-
error:
|
|
2547
|
+
status: l ? "error" : "pending",
|
|
2548
|
+
retries: m(l, "retries", 0),
|
|
2549
|
+
error: m(l, "error")
|
|
2106
2550
|
};
|
|
2107
2551
|
}
|
|
2108
|
-
const
|
|
2109
|
-
return
|
|
2552
|
+
const u = i.get(t);
|
|
2553
|
+
return u ? {
|
|
2110
2554
|
type: "update",
|
|
2111
2555
|
status: "error",
|
|
2112
|
-
retries:
|
|
2113
|
-
error:
|
|
2556
|
+
retries: u.retries,
|
|
2557
|
+
error: u.error
|
|
2114
2558
|
} : null;
|
|
2115
2559
|
}
|
|
2116
2560
|
// Create a new item (local-first)
|
|
2117
2561
|
create(t) {
|
|
2118
2562
|
const n = this.config.getId(t);
|
|
2119
|
-
this._state =
|
|
2563
|
+
this._state = I(this._state, (r) => {
|
|
2120
2564
|
r.items.set(n, t);
|
|
2121
2565
|
}), this._fetchHandler.invalidateCache(), this._notifySubscribers(), this._syncQueue.enqueue({ id: n, type: "create", data: t });
|
|
2122
2566
|
}
|
|
@@ -2124,32 +2568,64 @@ class q {
|
|
|
2124
2568
|
update(t, n) {
|
|
2125
2569
|
const r = this._state.items.get(t);
|
|
2126
2570
|
if (!r) return;
|
|
2127
|
-
const
|
|
2128
|
-
this._state =
|
|
2129
|
-
|
|
2130
|
-
}), this._fetchHandler.invalidateCache(), this._notifySubscribers(), this._syncQueue.enqueue({ id: t, type: "update", data:
|
|
2571
|
+
const i = I(r, n);
|
|
2572
|
+
this._state = I(this._state, (s) => {
|
|
2573
|
+
s.items.set(t, i);
|
|
2574
|
+
}), this._fetchHandler.invalidateCache(), this._notifySubscribers(), this._syncQueue.enqueue({ id: t, type: "update", data: i });
|
|
2131
2575
|
}
|
|
2132
2576
|
// Remove an item (local-first)
|
|
2133
2577
|
remove(t) {
|
|
2134
2578
|
const n = this._state.items.get(t);
|
|
2135
|
-
n && (this._state =
|
|
2579
|
+
n && (this._state = I(this._state, (r) => {
|
|
2136
2580
|
r.items.delete(t);
|
|
2137
|
-
}), this.
|
|
2581
|
+
}), this._fetchHandler.invalidateCache(), this._notifySubscribers(), this._syncQueue.enqueue({ id: t, type: "delete", data: n }));
|
|
2138
2582
|
}
|
|
2139
|
-
// Get Item reference (cached
|
|
2583
|
+
// Get Item reference (cached by data object)
|
|
2140
2584
|
getItem(t) {
|
|
2141
|
-
|
|
2142
|
-
|
|
2585
|
+
const n = this._state.items.get(t);
|
|
2586
|
+
if (!n)
|
|
2587
|
+
return new Yt(this, t);
|
|
2588
|
+
const r = n;
|
|
2589
|
+
let i = this._itemCache.get(r);
|
|
2590
|
+
return i || (i = new Yt(this, t), this._itemCache.set(r, i)), i;
|
|
2591
|
+
}
|
|
2592
|
+
// Get Node reference (cached by data object) - for tree collections
|
|
2593
|
+
getNode(t) {
|
|
2594
|
+
const n = this._state.items.get(t);
|
|
2595
|
+
if (!n)
|
|
2596
|
+
return new kt(this, t);
|
|
2597
|
+
const r = n;
|
|
2598
|
+
let i = this._nodeCache.get(r);
|
|
2599
|
+
return i || (i = new kt(this, t), this._nodeCache.set(r, i)), i;
|
|
2600
|
+
}
|
|
2601
|
+
// Execute multiple operations with single notification at the end
|
|
2602
|
+
batch(t) {
|
|
2603
|
+
this._batchMode = !0;
|
|
2604
|
+
try {
|
|
2605
|
+
t();
|
|
2606
|
+
} finally {
|
|
2607
|
+
this._batchMode = !1, this._notifySubscribers();
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
// Selection methods for tree nodes
|
|
2611
|
+
selectNode(t) {
|
|
2612
|
+
this._selectedNodeId !== t && (this._selectedNodeId = t, this._notifySubscribers());
|
|
2613
|
+
}
|
|
2614
|
+
deselectNode() {
|
|
2615
|
+
this._selectedNodeId !== null && (this._selectedNodeId = null, this._notifySubscribers());
|
|
2143
2616
|
}
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2617
|
+
get selectedNodeId() {
|
|
2618
|
+
return this._selectedNodeId;
|
|
2619
|
+
}
|
|
2620
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2621
|
+
get selectedNode() {
|
|
2622
|
+
return this._selectedNodeId ? this.getNode(this._selectedNodeId) : null;
|
|
2147
2623
|
}
|
|
2148
2624
|
// Update context and refetch
|
|
2149
2625
|
setContext(t) {
|
|
2150
|
-
const n = this._state.context, r =
|
|
2151
|
-
n !== r && (this._state =
|
|
2152
|
-
|
|
2626
|
+
const n = this._state.context, r = I(n, t);
|
|
2627
|
+
n !== r && (this._state = I(this._state, (i) => {
|
|
2628
|
+
i.context = r;
|
|
2153
2629
|
}), this._fetchHandler.fetch(r), this._notifySubscribers());
|
|
2154
2630
|
}
|
|
2155
2631
|
// Force refresh (bypass cache)
|
|
@@ -2168,7 +2644,7 @@ class q {
|
|
|
2168
2644
|
}
|
|
2169
2645
|
// Cleanup everything and remove from global cache
|
|
2170
2646
|
destroy() {
|
|
2171
|
-
this._syncQueue.destroy(), this._fetchHandler.destroy(), this.
|
|
2647
|
+
this._syncQueue.destroy(), this._fetchHandler.destroy(), this._subscribers.clear(), R._cache.delete(this.id);
|
|
2172
2648
|
}
|
|
2173
2649
|
// Private methods
|
|
2174
2650
|
async _initialFetch() {
|
|
@@ -2180,26 +2656,26 @@ class q {
|
|
|
2180
2656
|
}
|
|
2181
2657
|
_onFetchChange() {
|
|
2182
2658
|
const t = this._fetchHandler.getState();
|
|
2183
|
-
this._state =
|
|
2659
|
+
this._state = I(this._state, (n) => {
|
|
2184
2660
|
n.fetchStatus = t.status, n.fetchError = t.error, n.loading = t.status === "fetching", n.syncState = this._computeSyncState(t.status, n.syncQueue.isSyncing);
|
|
2185
|
-
const { queue: r, inFlight:
|
|
2661
|
+
const { queue: r, inFlight: i } = this._state.syncQueue, s = /* @__PURE__ */ new Map();
|
|
2186
2662
|
for (const o of t.items) {
|
|
2187
2663
|
const a = this.config.getId(o);
|
|
2188
|
-
|
|
2664
|
+
s.set(a, o);
|
|
2189
2665
|
}
|
|
2190
2666
|
for (const [o, a] of r) {
|
|
2191
|
-
const c = a
|
|
2192
|
-
(c.type === "create" || c.type === "update") &&
|
|
2667
|
+
const c = fe(a);
|
|
2668
|
+
c && (c.type === "create" || c.type === "update") && s.set(o, c.data);
|
|
2193
2669
|
}
|
|
2194
|
-
for (const [o, a] of
|
|
2195
|
-
const c = a
|
|
2196
|
-
(c.type === "create" || c.type === "update") &&
|
|
2670
|
+
for (const [o, a] of i) {
|
|
2671
|
+
const c = fe(a);
|
|
2672
|
+
c && (c.type === "create" || c.type === "update") && s.set(o, c.data);
|
|
2197
2673
|
}
|
|
2198
|
-
n.items =
|
|
2674
|
+
n.items = s;
|
|
2199
2675
|
}), this._notifySubscribers();
|
|
2200
2676
|
}
|
|
2201
2677
|
_updateSyncState(t) {
|
|
2202
|
-
this._state =
|
|
2678
|
+
this._state = I(this._state, (n) => {
|
|
2203
2679
|
n.syncQueue = t, n.syncing = t.isSyncing, n.syncState = this._computeSyncState(n.fetchStatus, t.isSyncing);
|
|
2204
2680
|
}), this._notifySubscribers();
|
|
2205
2681
|
}
|
|
@@ -2214,24 +2690,27 @@ class q {
|
|
|
2214
2690
|
_handleIdRemap(t) {
|
|
2215
2691
|
if (t.length === 0) return;
|
|
2216
2692
|
const { setId: n } = this.config;
|
|
2217
|
-
this._state =
|
|
2218
|
-
for (const { tempId:
|
|
2219
|
-
const o = r.items.get(
|
|
2693
|
+
this._state = I(this._state, (r) => {
|
|
2694
|
+
for (const { tempId: i, newId: s } of t) {
|
|
2695
|
+
const o = r.items.get(i);
|
|
2220
2696
|
if (o) {
|
|
2221
2697
|
let a;
|
|
2222
|
-
n ? a = n(o,
|
|
2698
|
+
n ? a = n(o, s) : (o.id = s, a = o), r.items.delete(i), r.items.set(s, a);
|
|
2223
2699
|
}
|
|
2224
2700
|
}
|
|
2225
2701
|
});
|
|
2226
|
-
for (const {
|
|
2227
|
-
const i = this.
|
|
2228
|
-
|
|
2702
|
+
for (const { newId: r } of t) {
|
|
2703
|
+
const i = this._state.items.get(r);
|
|
2704
|
+
if (i) {
|
|
2705
|
+
const s = i, o = this._itemCache.get(s);
|
|
2706
|
+
o && o._updateId(r);
|
|
2707
|
+
}
|
|
2229
2708
|
}
|
|
2230
2709
|
this._notifySubscribers();
|
|
2231
2710
|
}
|
|
2232
2711
|
}
|
|
2233
|
-
function
|
|
2234
|
-
const t =
|
|
2712
|
+
function Da(e) {
|
|
2713
|
+
const t = R.get(e), n = j(
|
|
2235
2714
|
(r) => t.subscribe(r),
|
|
2236
2715
|
() => t.getState(),
|
|
2237
2716
|
() => t.getState()
|
|
@@ -2248,7 +2727,7 @@ function to(e) {
|
|
|
2248
2727
|
fetchError: n.fetchError,
|
|
2249
2728
|
// Item operations
|
|
2250
2729
|
create: (r) => t.create(r),
|
|
2251
|
-
update: (r,
|
|
2730
|
+
update: (r, i) => t.update(r, i),
|
|
2252
2731
|
remove: (r) => t.remove(r),
|
|
2253
2732
|
getItem: (r) => t.getItem(r),
|
|
2254
2733
|
getItemStatus: (r) => t.getItemStatus(r),
|
|
@@ -2261,39 +2740,216 @@ function to(e) {
|
|
|
2261
2740
|
retrySync: (r) => t.retrySync(r)
|
|
2262
2741
|
};
|
|
2263
2742
|
}
|
|
2264
|
-
function
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2743
|
+
function Ha(e) {
|
|
2744
|
+
const t = R.get(e), n = j(
|
|
2745
|
+
(a) => t.subscribe(a),
|
|
2746
|
+
() => t.getState(),
|
|
2747
|
+
() => t.getState()
|
|
2748
|
+
), r = j(
|
|
2749
|
+
(a) => t.subscribe(a),
|
|
2750
|
+
() => t.items.get(e.rootId) ? t.getNode(e.rootId) : null,
|
|
2751
|
+
() => t.items.get(e.rootId) ? t.getNode(e.rootId) : null
|
|
2752
|
+
), i = j(
|
|
2753
|
+
(a) => t.subscribe(a),
|
|
2754
|
+
() => t.selectedNodeId,
|
|
2755
|
+
() => t.selectedNodeId
|
|
2756
|
+
), s = j(
|
|
2757
|
+
(a) => t.subscribe(a),
|
|
2758
|
+
() => t.selectedNode,
|
|
2759
|
+
() => t.selectedNode
|
|
2760
|
+
), o = T(() => {
|
|
2761
|
+
const a = e.nodeSeparator ?? ".", c = (l, f) => l.startsWith(f + a) ? !l.slice(f.length + 1).includes(a) : !1, u = (l) => {
|
|
2762
|
+
const f = n.items.get(l);
|
|
2763
|
+
if (!f) return null;
|
|
2764
|
+
const h = Y(
|
|
2765
|
+
Ce([...n.items.entries()], ([b]) => c(b, l)),
|
|
2766
|
+
([b, w]) => ({ id: b, position: w.position })
|
|
2767
|
+
), p = Me(h, "position"), g = Y(p, (b) => u(b.id)).filter(Boolean);
|
|
2768
|
+
return {
|
|
2769
|
+
id: f.id,
|
|
2770
|
+
type: f.type,
|
|
2771
|
+
value: f.value,
|
|
2772
|
+
...g.length > 0 ? { children: g } : {}
|
|
2773
|
+
};
|
|
2774
|
+
};
|
|
2775
|
+
return u(e.rootId);
|
|
2776
|
+
}, [n.items, e.rootId, e.nodeSeparator]);
|
|
2777
|
+
return {
|
|
2778
|
+
// Root node for tree operations
|
|
2779
|
+
rootNode: r,
|
|
2780
|
+
// State (all from single immutable state object)
|
|
2781
|
+
items: n.items,
|
|
2782
|
+
context: n.context,
|
|
2783
|
+
syncState: n.syncState,
|
|
2784
|
+
syncQueue: n.syncQueue,
|
|
2785
|
+
loading: n.loading,
|
|
2786
|
+
syncing: n.syncing,
|
|
2787
|
+
fetchStatus: n.fetchStatus,
|
|
2788
|
+
fetchError: n.fetchError,
|
|
2789
|
+
// Node operations
|
|
2790
|
+
getNode: (a) => t.getNode(a),
|
|
2791
|
+
getNodeStatus: (a) => t.getItemStatus(a),
|
|
2792
|
+
// Context & refresh
|
|
2793
|
+
setContext: (a) => t.setContext(a),
|
|
2794
|
+
refresh: () => t.refresh(),
|
|
2795
|
+
// Sync controls
|
|
2796
|
+
pauseSync: () => t.pauseSync(),
|
|
2797
|
+
resumeSync: () => t.resumeSync(),
|
|
2798
|
+
retrySync: (a) => t.retrySync(a),
|
|
2799
|
+
// Selection
|
|
2800
|
+
selectNode: (a) => t.selectNode(a),
|
|
2801
|
+
deselectNode: () => t.deselectNode(),
|
|
2802
|
+
selectedNodeId: i,
|
|
2803
|
+
selectedNode: s,
|
|
2804
|
+
// Serialization
|
|
2805
|
+
toJson: o
|
|
2806
|
+
};
|
|
2807
|
+
}
|
|
2808
|
+
function La(e) {
|
|
2809
|
+
const t = j(
|
|
2269
2810
|
(o) => e.collection.subscribe(o),
|
|
2270
2811
|
() => e.data,
|
|
2271
2812
|
() => e.data
|
|
2272
|
-
), n =
|
|
2813
|
+
), n = j(
|
|
2273
2814
|
(o) => e.collection.subscribe(o),
|
|
2274
2815
|
() => e.getStatus(),
|
|
2275
2816
|
() => e.getStatus()
|
|
2276
|
-
), r =
|
|
2817
|
+
), r = j(
|
|
2277
2818
|
(o) => e.collection.subscribe(o),
|
|
2278
2819
|
() => e.exists(),
|
|
2279
2820
|
() => e.exists()
|
|
2280
|
-
),
|
|
2281
|
-
return { data: t, status: n, update:
|
|
2821
|
+
), i = T((o) => e.update(o), [e]), s = T(() => e.remove(), [e]);
|
|
2822
|
+
return { data: t, status: n, update: i, remove: s, exists: r };
|
|
2823
|
+
}
|
|
2824
|
+
function ja(e, t) {
|
|
2825
|
+
if (!O(oe(e), oe(t))) return !0;
|
|
2826
|
+
for (let n = 0; n < oe(e); n++)
|
|
2827
|
+
if (!O(e[n].id, t[n].id)) return !0;
|
|
2828
|
+
return !1;
|
|
2829
|
+
}
|
|
2830
|
+
const $a = {
|
|
2831
|
+
data: void 0,
|
|
2832
|
+
status: null,
|
|
2833
|
+
exists: !1,
|
|
2834
|
+
isSelected: !1,
|
|
2835
|
+
children: []
|
|
2836
|
+
};
|
|
2837
|
+
function Fa(e) {
|
|
2838
|
+
const t = Nn(null), n = j(
|
|
2839
|
+
(h) => e.collection.subscribe(h),
|
|
2840
|
+
() => {
|
|
2841
|
+
const h = e.getChildren(), p = t.current, g = p && !ja(p.children, h) ? p.children : h, b = {
|
|
2842
|
+
data: e.data,
|
|
2843
|
+
status: e.getStatus(),
|
|
2844
|
+
exists: e.exists(),
|
|
2845
|
+
isSelected: O(e.collection.selectedNodeId, e.id),
|
|
2846
|
+
children: g
|
|
2847
|
+
};
|
|
2848
|
+
return O(p, b) || (t.current = b), t.current;
|
|
2849
|
+
},
|
|
2850
|
+
() => t.current ?? $a
|
|
2851
|
+
), r = T(() => e.getParent(), [e]), i = T((h, p) => e.append(h, p), [e]), s = T((h, p) => e.prepend(h, p), [e]), o = T(
|
|
2852
|
+
(h, p) => e.move(h, p),
|
|
2853
|
+
[e]
|
|
2854
|
+
), a = T(() => e.clone(), [e]), c = T(
|
|
2855
|
+
(h) => e.updateProp(h),
|
|
2856
|
+
[e]
|
|
2857
|
+
), u = T(() => e.remove(), [e]), l = T(() => e.select(), [e]), f = T(() => e.collection.deselectNode(), [e]);
|
|
2858
|
+
return {
|
|
2859
|
+
isPresent: !0,
|
|
2860
|
+
data: n.data,
|
|
2861
|
+
status: n.status,
|
|
2862
|
+
exists: n.exists,
|
|
2863
|
+
isSelected: n.isSelected,
|
|
2864
|
+
depth: e.depth,
|
|
2865
|
+
getParent: r,
|
|
2866
|
+
children: n.children,
|
|
2867
|
+
append: i,
|
|
2868
|
+
prepend: s,
|
|
2869
|
+
move: o,
|
|
2870
|
+
clone: a,
|
|
2871
|
+
updateProp: c,
|
|
2872
|
+
remove: u,
|
|
2873
|
+
select: l,
|
|
2874
|
+
deselect: f
|
|
2875
|
+
};
|
|
2876
|
+
}
|
|
2877
|
+
const za = {
|
|
2878
|
+
isPresent: !1,
|
|
2879
|
+
data: void 0,
|
|
2880
|
+
status: null,
|
|
2881
|
+
exists: !1,
|
|
2882
|
+
isSelected: !1,
|
|
2883
|
+
depth: 0,
|
|
2884
|
+
getParent: () => null,
|
|
2885
|
+
children: [],
|
|
2886
|
+
append: () => "",
|
|
2887
|
+
prepend: () => "",
|
|
2888
|
+
move: () => {
|
|
2889
|
+
},
|
|
2890
|
+
clone: () => /* @__PURE__ */ new Map(),
|
|
2891
|
+
updateProp: () => {
|
|
2892
|
+
},
|
|
2893
|
+
remove: () => {
|
|
2894
|
+
},
|
|
2895
|
+
select: () => {
|
|
2896
|
+
},
|
|
2897
|
+
deselect: () => {
|
|
2898
|
+
}
|
|
2899
|
+
};
|
|
2900
|
+
function qa(e) {
|
|
2901
|
+
const t = R.getById(e);
|
|
2902
|
+
if (!t)
|
|
2903
|
+
throw new Error(
|
|
2904
|
+
`Collection with id "${e}" not found. Make sure useCrud is called first.`
|
|
2905
|
+
);
|
|
2906
|
+
const n = j(
|
|
2907
|
+
(s) => t.subscribe(s),
|
|
2908
|
+
() => t.selectedNode,
|
|
2909
|
+
() => t.selectedNode
|
|
2910
|
+
), r = Dn(() => t.getNode("__dummy__"), [t]), i = Fa(n ?? r);
|
|
2911
|
+
return n ? i : za;
|
|
2912
|
+
}
|
|
2913
|
+
function Qa(e) {
|
|
2914
|
+
const t = R.getById(e);
|
|
2915
|
+
if (!t)
|
|
2916
|
+
throw new Error(
|
|
2917
|
+
`Collection with id "${e}" not found. Make sure useCrud is called first.`
|
|
2918
|
+
);
|
|
2919
|
+
const n = j(
|
|
2920
|
+
(r) => t.subscribe(r),
|
|
2921
|
+
() => t.getState(),
|
|
2922
|
+
() => t.getState()
|
|
2923
|
+
);
|
|
2924
|
+
return {
|
|
2925
|
+
syncState: n.syncState,
|
|
2926
|
+
syncing: n.syncing,
|
|
2927
|
+
queue: n.syncQueue.queue,
|
|
2928
|
+
inFlight: n.syncQueue.inFlight,
|
|
2929
|
+
errors: n.syncQueue.errors,
|
|
2930
|
+
isPaused: n.syncQueue.isPaused,
|
|
2931
|
+
isSyncing: n.syncQueue.isSyncing
|
|
2932
|
+
};
|
|
2282
2933
|
}
|
|
2283
2934
|
export {
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2935
|
+
Ea as Cache,
|
|
2936
|
+
R as Collection,
|
|
2937
|
+
Ta as FetchHandler,
|
|
2938
|
+
Yt as Item,
|
|
2939
|
+
kt as Node,
|
|
2940
|
+
xa as SyncQueue,
|
|
2941
|
+
Ga as categorizeResults,
|
|
2942
|
+
Wa as createSyncClient,
|
|
2943
|
+
Va as createSyncClientFromEndpoint,
|
|
2944
|
+
Ja as createSyncClientWithStats,
|
|
2945
|
+
Ya as fetchToSyncResult,
|
|
2946
|
+
Xa as syncError,
|
|
2947
|
+
Za as syncSuccess,
|
|
2948
|
+
Da as useCrud,
|
|
2949
|
+
Ha as useCrudTree,
|
|
2950
|
+
La as useItem,
|
|
2951
|
+
Fa as useNode,
|
|
2952
|
+
qa as useSelectedNode,
|
|
2953
|
+
Qa as useSyncState
|
|
2298
2954
|
};
|
|
2299
2955
|
//# sourceMappingURL=index.js.map
|