@solidjs/signals 2.0.0-beta.14 → 2.0.0-beta.15
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 +2 -3
- package/dist/dev.js +295 -194
- package/dist/node.cjs +1419 -1360
- package/dist/prod.js +1152 -1098
- package/dist/types/core/core.d.ts +2 -14
- package/dist/types/core/dev.d.ts +1 -1
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/store/projection.d.ts +2 -2
- package/dist/types/store/store.d.ts +1 -0
- package/dist/types-cjs/core/core.d.cts +2 -14
- package/dist/types-cjs/core/dev.d.cts +1 -1
- package/dist/types-cjs/core/index.d.cts +1 -1
- package/dist/types-cjs/index.d.cts +1 -1
- package/dist/types-cjs/store/projection.d.cts +2 -2
- package/dist/types-cjs/store/store.d.cts +1 -0
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -54,442 +54,337 @@ const C = "sp";
|
|
|
54
54
|
const E = typeof Proxy === "function";
|
|
55
55
|
const k = {};
|
|
56
56
|
const j = Symbol("refresh");
|
|
57
|
-
const W =
|
|
58
|
-
const R = new
|
|
59
|
-
|
|
60
|
-
const I = undefined;
|
|
61
|
-
function emitDiagnostic(e) {
|
|
62
|
-
const t = { sequence: ++A, ...e };
|
|
63
|
-
for (const e of W) e(t);
|
|
64
|
-
for (const e of R) e.push(t);
|
|
65
|
-
return t;
|
|
66
|
-
}
|
|
67
|
-
function actualInsertIntoHeap(e, t) {
|
|
68
|
-
const n = (e.i?.t ? e.i.u?.o : e.i?.o) ?? -1;
|
|
69
|
-
if (n >= e.o) e.o = n + 1;
|
|
70
|
-
const r = e.o;
|
|
71
|
-
const i = t.l[r];
|
|
72
|
-
if (i === undefined) t.l[r] = e;
|
|
73
|
-
else {
|
|
74
|
-
const t = i.p;
|
|
75
|
-
t.h = e;
|
|
76
|
-
e.p = t;
|
|
77
|
-
i.p = e;
|
|
78
|
-
}
|
|
79
|
-
if (r > t.S) t.S = r;
|
|
80
|
-
}
|
|
81
|
-
function insertIntoHeap(e, o) {
|
|
82
|
-
let u = e._;
|
|
83
|
-
if (u & (i | r | a)) return;
|
|
84
|
-
if (u & t) {
|
|
85
|
-
e._ = (u & -4) | n | i;
|
|
86
|
-
} else e._ = u | i;
|
|
87
|
-
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
88
|
-
}
|
|
89
|
-
function insertIntoHeapHeight(e, t) {
|
|
90
|
-
let n = e._;
|
|
91
|
-
if (n & (i | r | s | a)) return;
|
|
92
|
-
e._ = n | s;
|
|
93
|
-
actualInsertIntoHeap(e, t);
|
|
94
|
-
}
|
|
95
|
-
function deleteFromHeap(e, t) {
|
|
96
|
-
const n = e._;
|
|
97
|
-
if (!(n & (i | s))) return;
|
|
98
|
-
e._ = n & -25;
|
|
99
|
-
const r = e.o;
|
|
100
|
-
if (e.p === e) t.l[r] = undefined;
|
|
101
|
-
else {
|
|
102
|
-
const n = e.h;
|
|
103
|
-
const i = t.l[r];
|
|
104
|
-
const s = n ?? i;
|
|
105
|
-
if (e === i) t.l[r] = n;
|
|
106
|
-
else e.p.h = n;
|
|
107
|
-
s.p = e.p;
|
|
108
|
-
}
|
|
109
|
-
e.p = e;
|
|
110
|
-
e.h = undefined;
|
|
111
|
-
}
|
|
112
|
-
function markHeap(e) {
|
|
113
|
-
if (e.m) return;
|
|
114
|
-
e.m = true;
|
|
115
|
-
for (let t = 0; t <= e.S; t++) {
|
|
116
|
-
for (let n = e.l[t]; n !== undefined; n = n.h) {
|
|
117
|
-
if (n._ & i) markNode(n);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function markNode(e, r = n) {
|
|
122
|
-
const i = e._;
|
|
123
|
-
if ((i & (t | n)) >= r) return;
|
|
124
|
-
e._ = (i & -4) | r;
|
|
125
|
-
for (let n = e.O; n !== null; n = n.P) {
|
|
126
|
-
markNode(n.N, t);
|
|
127
|
-
}
|
|
128
|
-
if (e.C !== null) {
|
|
129
|
-
for (let n = e.C; n !== null; n = n.k) {
|
|
130
|
-
for (let e = n.O; e !== null; e = e.P) {
|
|
131
|
-
markNode(e.N, t);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
function runHeap(e, t) {
|
|
137
|
-
e.m = false;
|
|
138
|
-
for (e.j = 0; e.j <= e.S; e.j++) {
|
|
139
|
-
let n = e.l[e.j];
|
|
140
|
-
while (n !== undefined) {
|
|
141
|
-
if (n._ & i) t(n);
|
|
142
|
-
else adjustHeight(n, e);
|
|
143
|
-
n = e.l[e.j];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
e.S = 0;
|
|
147
|
-
}
|
|
148
|
-
function adjustHeight(e, t) {
|
|
149
|
-
deleteFromHeap(e, t);
|
|
150
|
-
let n = e.o;
|
|
151
|
-
for (let t = e.W; t; t = t.R) {
|
|
152
|
-
const e = t.A;
|
|
153
|
-
const r = e.I || e;
|
|
154
|
-
if (r.L && r.o >= n) n = r.o + 1;
|
|
155
|
-
}
|
|
156
|
-
if (e.o !== n) {
|
|
157
|
-
e.o = n;
|
|
158
|
-
for (let n = e.O; n !== null; n = n.P) {
|
|
159
|
-
insertIntoHeapHeight(n.N, t);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
const L = new WeakMap();
|
|
164
|
-
const T = new Set();
|
|
57
|
+
const W = undefined;
|
|
58
|
+
const R = new WeakMap();
|
|
59
|
+
const A = new Set();
|
|
165
60
|
function getOrCreateLane(e) {
|
|
166
|
-
let t =
|
|
61
|
+
let t = R.get(e);
|
|
167
62
|
if (t) {
|
|
168
63
|
return findLane(t);
|
|
169
64
|
}
|
|
170
|
-
const n = e.
|
|
171
|
-
const r = n?.
|
|
172
|
-
t = {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
e.
|
|
65
|
+
const n = e.t;
|
|
66
|
+
const r = n?.i ? findLane(n.i) : null;
|
|
67
|
+
t = { o: e, u: new Set(), l: [[], []], p: null, h: q, S: r };
|
|
68
|
+
R.set(e, t);
|
|
69
|
+
A.add(t);
|
|
70
|
+
e._ = false;
|
|
176
71
|
return t;
|
|
177
72
|
}
|
|
178
73
|
function findLane(e) {
|
|
179
|
-
while (e.
|
|
74
|
+
while (e.p) e = e.p;
|
|
180
75
|
return e;
|
|
181
76
|
}
|
|
182
77
|
function mergeLanes(e, t) {
|
|
183
78
|
e = findLane(e);
|
|
184
79
|
t = findLane(t);
|
|
185
80
|
if (e === t) return e;
|
|
186
|
-
t.
|
|
187
|
-
for (const n of t.
|
|
188
|
-
e.
|
|
189
|
-
e.
|
|
81
|
+
t.p = e;
|
|
82
|
+
for (const n of t.u) e.u.add(n);
|
|
83
|
+
e.l[0].push(...t.l[0]);
|
|
84
|
+
e.l[1].push(...t.l[1]);
|
|
190
85
|
return e;
|
|
191
86
|
}
|
|
192
87
|
function resolveLane(e) {
|
|
193
|
-
const t = e.
|
|
88
|
+
const t = e.i;
|
|
194
89
|
if (!t) return undefined;
|
|
195
90
|
const n = findLane(t);
|
|
196
|
-
if (
|
|
197
|
-
e.
|
|
91
|
+
if (A.has(n)) return n;
|
|
92
|
+
e.i = undefined;
|
|
198
93
|
return undefined;
|
|
199
94
|
}
|
|
200
95
|
function resolveTransition(e) {
|
|
201
|
-
return resolveLane(e)?.
|
|
96
|
+
return resolveLane(e)?.h ?? e.h;
|
|
202
97
|
}
|
|
203
98
|
function hasActiveOverride(e) {
|
|
204
|
-
return !!(e.
|
|
99
|
+
return !!(e.m !== undefined && e.m !== x);
|
|
205
100
|
}
|
|
206
101
|
function assignOrMergeLane(e, t) {
|
|
207
102
|
const n = findLane(t);
|
|
208
|
-
const r = e.
|
|
103
|
+
const r = e.i;
|
|
209
104
|
if (r) {
|
|
210
|
-
if (r.
|
|
211
|
-
e.
|
|
105
|
+
if (r.p) {
|
|
106
|
+
e.i = t;
|
|
212
107
|
return;
|
|
213
108
|
}
|
|
214
109
|
const i = findLane(r);
|
|
215
|
-
if (
|
|
110
|
+
if (A.has(i)) {
|
|
216
111
|
if (i !== n && !hasActiveOverride(e)) {
|
|
217
|
-
if (n.
|
|
218
|
-
e.
|
|
219
|
-
} else if (i.
|
|
112
|
+
if (n.S && findLane(n.S) === i) {
|
|
113
|
+
e.i = t;
|
|
114
|
+
} else if (i.S && findLane(i.S) === n);
|
|
220
115
|
else mergeLanes(n, i);
|
|
221
116
|
}
|
|
222
117
|
return;
|
|
223
118
|
}
|
|
224
119
|
}
|
|
225
|
-
e.
|
|
120
|
+
e.i = t;
|
|
226
121
|
}
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
const
|
|
122
|
+
const I = new Set();
|
|
123
|
+
const L = { O: new Array(2e3).fill(undefined), P: false, N: 0, C: 0 };
|
|
124
|
+
const T = { O: new Array(2e3).fill(undefined), P: false, N: 0, C: 0 };
|
|
125
|
+
let H = 0;
|
|
126
|
+
let q = null;
|
|
127
|
+
let Q = false;
|
|
230
128
|
let F = 0;
|
|
231
|
-
let M =
|
|
232
|
-
let
|
|
233
|
-
|
|
234
|
-
let K = false;
|
|
235
|
-
let B = null;
|
|
236
|
-
const G = new Set();
|
|
129
|
+
let M = false;
|
|
130
|
+
let V = null;
|
|
131
|
+
const D = new Set();
|
|
237
132
|
function registerTransientStoreNode(e) {
|
|
238
|
-
|
|
133
|
+
D.add(e);
|
|
239
134
|
}
|
|
240
135
|
function canUseSimpleSyncFlush(e) {
|
|
241
136
|
return (
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
e.
|
|
245
|
-
e
|
|
246
|
-
e.
|
|
247
|
-
|
|
137
|
+
I.size === 0 &&
|
|
138
|
+
A.size === 0 &&
|
|
139
|
+
e.k.length === 0 &&
|
|
140
|
+
e.j.length === 0 &&
|
|
141
|
+
e.W.size === 0 &&
|
|
142
|
+
D.size === 0
|
|
248
143
|
);
|
|
249
144
|
}
|
|
250
145
|
function sweepTransientStoreNodes() {
|
|
251
|
-
if (
|
|
252
|
-
for (const e of
|
|
253
|
-
if (e.
|
|
254
|
-
|
|
146
|
+
if (D.size === 0) return;
|
|
147
|
+
for (const e of D) {
|
|
148
|
+
if (e.R !== null) {
|
|
149
|
+
D.delete(e);
|
|
255
150
|
continue;
|
|
256
151
|
}
|
|
257
|
-
if (e.
|
|
258
|
-
if (e.
|
|
259
|
-
|
|
260
|
-
e.
|
|
152
|
+
if (e.A !== x) continue;
|
|
153
|
+
if (e.m !== undefined && e.m !== x) continue;
|
|
154
|
+
D.delete(e);
|
|
155
|
+
e.I?.();
|
|
261
156
|
}
|
|
262
157
|
}
|
|
263
158
|
function enforceLoadingBoundary(e) {}
|
|
264
159
|
function shouldReadStashedOptimisticValue(e) {
|
|
265
|
-
return !!
|
|
160
|
+
return !!V?.has(e);
|
|
266
161
|
}
|
|
267
162
|
function runLaneEffects(e) {
|
|
268
|
-
for (const t of
|
|
269
|
-
if (t.
|
|
270
|
-
const n = t.
|
|
163
|
+
for (const t of A) {
|
|
164
|
+
if (t.p || t.u.size > 0) continue;
|
|
165
|
+
const n = t.l[e - 1];
|
|
271
166
|
if (n.length) {
|
|
272
|
-
t.
|
|
167
|
+
t.l[e - 1] = [];
|
|
273
168
|
runQueue(n, e);
|
|
274
169
|
}
|
|
275
170
|
}
|
|
276
171
|
}
|
|
277
172
|
function queueStashedOptimisticEffects(e) {
|
|
278
|
-
for (let t = e.
|
|
279
|
-
const e = t.
|
|
280
|
-
if (!e.
|
|
281
|
-
if (e.
|
|
282
|
-
if (!e.
|
|
283
|
-
e.
|
|
284
|
-
e.
|
|
173
|
+
for (let t = e.R; t !== null; t = t.L) {
|
|
174
|
+
const e = t.T;
|
|
175
|
+
if (!e.H) continue;
|
|
176
|
+
if (e.H === P) {
|
|
177
|
+
if (!e.q) {
|
|
178
|
+
e.q = true;
|
|
179
|
+
e.F.enqueue(v, e.M);
|
|
285
180
|
}
|
|
286
181
|
continue;
|
|
287
182
|
}
|
|
288
|
-
const n = e.
|
|
289
|
-
if (n.
|
|
183
|
+
const n = e.V & o ? T : L;
|
|
184
|
+
if (n.N > e.D) n.N = e.D;
|
|
290
185
|
insertIntoHeap(e, n);
|
|
291
186
|
}
|
|
292
187
|
}
|
|
293
188
|
function setProjectionWriteActive(e) {
|
|
294
|
-
|
|
189
|
+
M = e;
|
|
295
190
|
}
|
|
296
191
|
function mergeTransitionState(e, t) {
|
|
297
|
-
t.
|
|
298
|
-
e.
|
|
299
|
-
for (const n of
|
|
300
|
-
e
|
|
301
|
-
for (const n of t.
|
|
302
|
-
for (const [n, r] of t.
|
|
303
|
-
let t = e.
|
|
304
|
-
if (!t) e.
|
|
192
|
+
t.K = e;
|
|
193
|
+
e.B.push(...t.B);
|
|
194
|
+
for (const n of A) if (n.h === t) n.h = e;
|
|
195
|
+
e.j.push(...t.j);
|
|
196
|
+
for (const n of t.W) e.W.add(n);
|
|
197
|
+
for (const [n, r] of t.G) {
|
|
198
|
+
let t = e.G.get(n);
|
|
199
|
+
if (!t) e.G.set(n, (t = new Set()));
|
|
305
200
|
for (const e of r) t.add(e);
|
|
306
201
|
}
|
|
307
|
-
for (const n of t.
|
|
202
|
+
for (const n of t.U) e.U.add(n);
|
|
308
203
|
}
|
|
309
204
|
function resolveOptimisticNodes(e) {
|
|
310
205
|
for (let t = 0; t < e.length; t++) {
|
|
311
206
|
const n = e[t];
|
|
312
|
-
n.
|
|
313
|
-
if (n.
|
|
314
|
-
n
|
|
315
|
-
n.
|
|
207
|
+
n.i = undefined;
|
|
208
|
+
if (n.A !== x) {
|
|
209
|
+
n.$ = n.A;
|
|
210
|
+
n.A = x;
|
|
316
211
|
}
|
|
317
|
-
const r = n.
|
|
318
|
-
n.
|
|
319
|
-
if (r !== x && n
|
|
320
|
-
n.
|
|
212
|
+
const r = n.m;
|
|
213
|
+
n.m = x;
|
|
214
|
+
if (r !== x && n.$ !== r) insertSubs(n, true);
|
|
215
|
+
n.h = null;
|
|
321
216
|
}
|
|
322
217
|
e.length = 0;
|
|
323
218
|
}
|
|
324
219
|
function cleanupCompletedLanes(e) {
|
|
325
|
-
for (const t of
|
|
326
|
-
const n = e ? t.
|
|
220
|
+
for (const t of A) {
|
|
221
|
+
const n = e ? t.h === e : !t.h;
|
|
327
222
|
if (!n) continue;
|
|
328
|
-
if (!t.
|
|
329
|
-
if (t.
|
|
330
|
-
if (t.
|
|
223
|
+
if (!t.p) {
|
|
224
|
+
if (t.l[0].length) runQueue(t.l[0], O);
|
|
225
|
+
if (t.l[1].length) runQueue(t.l[1], v);
|
|
331
226
|
}
|
|
332
|
-
if (t.
|
|
333
|
-
t.
|
|
334
|
-
t.
|
|
335
|
-
t.
|
|
336
|
-
|
|
337
|
-
|
|
227
|
+
if (t.o.i === t) t.o.i = undefined;
|
|
228
|
+
t.u.clear();
|
|
229
|
+
t.l[0].length = 0;
|
|
230
|
+
t.l[1].length = 0;
|
|
231
|
+
A.delete(t);
|
|
232
|
+
R.delete(t.o);
|
|
338
233
|
}
|
|
339
234
|
}
|
|
340
235
|
function schedule() {
|
|
341
|
-
if (
|
|
342
|
-
|
|
343
|
-
if (!
|
|
236
|
+
if (Q) return;
|
|
237
|
+
Q = true;
|
|
238
|
+
if (!F && !K.J && !M) queueMicrotask(flush);
|
|
344
239
|
}
|
|
345
240
|
class Queue {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
created =
|
|
241
|
+
X = null;
|
|
242
|
+
Y = [[], []];
|
|
243
|
+
k = [];
|
|
244
|
+
created = H;
|
|
350
245
|
addChild(e) {
|
|
351
|
-
this.
|
|
352
|
-
e.
|
|
246
|
+
this.k.push(e);
|
|
247
|
+
e.X = this;
|
|
353
248
|
}
|
|
354
249
|
removeChild(e) {
|
|
355
|
-
const t = this.
|
|
250
|
+
const t = this.k.indexOf(e);
|
|
356
251
|
if (t >= 0) {
|
|
357
|
-
this.
|
|
358
|
-
e.
|
|
252
|
+
this.k.splice(t, 1);
|
|
253
|
+
e.X = null;
|
|
359
254
|
}
|
|
360
255
|
}
|
|
361
256
|
notify(e, t, n, r) {
|
|
362
|
-
if (this.
|
|
257
|
+
if (this.X) return this.X.notify(e, t, n, r);
|
|
363
258
|
return false;
|
|
364
259
|
}
|
|
365
260
|
run(e) {
|
|
366
|
-
if (this.
|
|
367
|
-
const t = this.
|
|
368
|
-
this.
|
|
261
|
+
if (this.Y[e - 1].length) {
|
|
262
|
+
const t = this.Y[e - 1];
|
|
263
|
+
this.Y[e - 1] = [];
|
|
369
264
|
runQueue(t, e);
|
|
370
265
|
}
|
|
371
|
-
for (let t = 0; t < this.
|
|
266
|
+
for (let t = 0; t < this.k.length; t++) this.k[t].run?.(e);
|
|
372
267
|
}
|
|
373
268
|
enqueue(e, t) {
|
|
374
269
|
if (e) {
|
|
375
|
-
if (
|
|
376
|
-
const n = findLane(
|
|
377
|
-
n.
|
|
270
|
+
if (Z) {
|
|
271
|
+
const n = findLane(Z);
|
|
272
|
+
n.l[e - 1].push(t);
|
|
378
273
|
} else {
|
|
379
|
-
this.
|
|
274
|
+
this.Y[e - 1].push(t);
|
|
380
275
|
}
|
|
381
276
|
}
|
|
382
277
|
schedule();
|
|
383
278
|
}
|
|
384
279
|
stashQueues(e) {
|
|
385
|
-
e.
|
|
386
|
-
e.
|
|
387
|
-
this.
|
|
388
|
-
for (let t = 0; t < this.
|
|
389
|
-
let n = this.
|
|
390
|
-
let r = e.
|
|
280
|
+
e.Y[0].push(...this.Y[0]);
|
|
281
|
+
e.Y[1].push(...this.Y[1]);
|
|
282
|
+
this.Y = [[], []];
|
|
283
|
+
for (let t = 0; t < this.k.length; t++) {
|
|
284
|
+
let n = this.k[t];
|
|
285
|
+
let r = e.k[t];
|
|
391
286
|
if (!r) {
|
|
392
|
-
r = {
|
|
393
|
-
e.
|
|
287
|
+
r = { Y: [[], []], k: [] };
|
|
288
|
+
e.k[t] = r;
|
|
394
289
|
}
|
|
395
290
|
n.stashQueues(r);
|
|
396
291
|
}
|
|
397
292
|
}
|
|
398
293
|
restoreQueues(e) {
|
|
399
|
-
this.
|
|
400
|
-
this.
|
|
401
|
-
for (let t = 0; t < e.
|
|
402
|
-
const n = e.
|
|
403
|
-
let r = this.
|
|
294
|
+
this.Y[0].push(...e.Y[0]);
|
|
295
|
+
this.Y[1].push(...e.Y[1]);
|
|
296
|
+
for (let t = 0; t < e.k.length; t++) {
|
|
297
|
+
const n = e.k[t];
|
|
298
|
+
let r = this.k[t];
|
|
404
299
|
if (r) r.restoreQueues(n);
|
|
405
300
|
}
|
|
406
301
|
}
|
|
407
302
|
}
|
|
408
303
|
class GlobalQueue extends Queue {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
static
|
|
415
|
-
static
|
|
416
|
-
static
|
|
417
|
-
static
|
|
304
|
+
J = false;
|
|
305
|
+
Z = null;
|
|
306
|
+
ee = [];
|
|
307
|
+
j = [];
|
|
308
|
+
W = new Set();
|
|
309
|
+
static te;
|
|
310
|
+
static ne;
|
|
311
|
+
static re;
|
|
312
|
+
static ie = null;
|
|
418
313
|
flush() {
|
|
419
|
-
if (this.
|
|
420
|
-
this.
|
|
314
|
+
if (this.J) return;
|
|
315
|
+
this.J = true;
|
|
421
316
|
try {
|
|
422
|
-
runHeap(
|
|
423
|
-
if (
|
|
424
|
-
const e = transitionComplete(
|
|
317
|
+
runHeap(L, GlobalQueue.te);
|
|
318
|
+
if (q) {
|
|
319
|
+
const e = transitionComplete(q);
|
|
425
320
|
if (!e) {
|
|
426
|
-
const e =
|
|
427
|
-
runHeap(
|
|
428
|
-
this.
|
|
429
|
-
this.
|
|
430
|
-
this
|
|
431
|
-
this.
|
|
321
|
+
const e = q;
|
|
322
|
+
runHeap(T, GlobalQueue.te);
|
|
323
|
+
this.Z = null;
|
|
324
|
+
this.ee = [];
|
|
325
|
+
this.j = [];
|
|
326
|
+
this.W = new Set();
|
|
432
327
|
runLaneEffects(O);
|
|
433
328
|
runLaneEffects(v);
|
|
434
|
-
this.stashQueues(e.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
reassignPendingTransition(e.
|
|
438
|
-
|
|
439
|
-
if (!e.
|
|
440
|
-
|
|
441
|
-
for (let t = 0; t < e
|
|
442
|
-
const n = e
|
|
443
|
-
if (n.
|
|
444
|
-
|
|
329
|
+
this.stashQueues(e.se);
|
|
330
|
+
H++;
|
|
331
|
+
Q = L.C >= L.N;
|
|
332
|
+
reassignPendingTransition(e.ee);
|
|
333
|
+
q = null;
|
|
334
|
+
if (!e.B.length && !e.G.size && e.j.length) {
|
|
335
|
+
V = new Set();
|
|
336
|
+
for (let t = 0; t < e.j.length; t++) {
|
|
337
|
+
const n = e.j[t];
|
|
338
|
+
if (n.oe || n.ue & d) continue;
|
|
339
|
+
V.add(n);
|
|
445
340
|
queueStashedOptimisticEffects(n);
|
|
446
341
|
}
|
|
447
342
|
}
|
|
448
343
|
try {
|
|
449
344
|
finalizePureQueue(null, true);
|
|
450
345
|
} finally {
|
|
451
|
-
|
|
346
|
+
V = null;
|
|
452
347
|
}
|
|
453
348
|
return;
|
|
454
349
|
}
|
|
455
|
-
this.
|
|
456
|
-
this.restoreQueues(
|
|
457
|
-
|
|
458
|
-
const t =
|
|
459
|
-
|
|
460
|
-
reassignPendingTransition(this.
|
|
350
|
+
this.ee !== q.ee && this.ee.push(...q.ee);
|
|
351
|
+
this.restoreQueues(q.se);
|
|
352
|
+
I.delete(q);
|
|
353
|
+
const t = q;
|
|
354
|
+
q = null;
|
|
355
|
+
reassignPendingTransition(this.ee);
|
|
461
356
|
finalizePureQueue(t);
|
|
462
357
|
} else {
|
|
463
358
|
if (canUseSimpleSyncFlush(this)) {
|
|
464
359
|
commitPendingNodes();
|
|
465
|
-
if (
|
|
466
|
-
runHeap(
|
|
360
|
+
if (L.C >= L.N) {
|
|
361
|
+
runHeap(L, GlobalQueue.te);
|
|
467
362
|
commitPendingNodes();
|
|
468
363
|
}
|
|
469
364
|
} else {
|
|
470
|
-
if (
|
|
365
|
+
if (I.size) runHeap(T, GlobalQueue.te);
|
|
471
366
|
finalizePureQueue();
|
|
472
367
|
}
|
|
473
368
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
369
|
+
H++;
|
|
370
|
+
Q = L.C >= L.N;
|
|
371
|
+
A.size && runLaneEffects(O);
|
|
477
372
|
this.run(O);
|
|
478
|
-
|
|
373
|
+
A.size && runLaneEffects(v);
|
|
479
374
|
this.run(v);
|
|
480
375
|
if (false);
|
|
481
376
|
} finally {
|
|
482
|
-
this.
|
|
377
|
+
this.J = false;
|
|
483
378
|
}
|
|
484
379
|
}
|
|
485
380
|
notify(e, t, n, r) {
|
|
486
381
|
if (t & _) {
|
|
487
382
|
if (n & _) {
|
|
488
|
-
const t = r !== undefined ? r : e.
|
|
489
|
-
if (
|
|
383
|
+
const t = r !== undefined ? r : e.fe;
|
|
384
|
+
if (q && t) {
|
|
490
385
|
const n = t.source;
|
|
491
|
-
let r =
|
|
492
|
-
if (!r)
|
|
386
|
+
let r = q.G.get(n);
|
|
387
|
+
if (!r) q.G.set(n, (r = new Set()));
|
|
493
388
|
const i = r.size;
|
|
494
389
|
r.add(e);
|
|
495
390
|
if (r.size !== i) schedule();
|
|
@@ -501,125 +396,125 @@ class GlobalQueue extends Queue {
|
|
|
501
396
|
}
|
|
502
397
|
initTransition(e) {
|
|
503
398
|
if (e) e = currentTransition(e);
|
|
504
|
-
if (e && e ===
|
|
505
|
-
if (!e &&
|
|
506
|
-
if (!
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
399
|
+
if (e && e === q) return;
|
|
400
|
+
if (!e && q && q.le === H) return;
|
|
401
|
+
if (!q) {
|
|
402
|
+
q = e ?? {
|
|
403
|
+
le: H,
|
|
404
|
+
ee: [],
|
|
405
|
+
G: new Map(),
|
|
406
|
+
j: [],
|
|
407
|
+
W: new Set(),
|
|
408
|
+
B: [],
|
|
409
|
+
se: { Y: [[], []], k: [] },
|
|
410
|
+
K: false,
|
|
411
|
+
U: new Set()
|
|
517
412
|
};
|
|
518
413
|
} else if (e) {
|
|
519
|
-
const t =
|
|
414
|
+
const t = q;
|
|
520
415
|
mergeTransitionState(e, t);
|
|
521
|
-
|
|
522
|
-
|
|
416
|
+
I.delete(t);
|
|
417
|
+
q = e;
|
|
523
418
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
if (this.
|
|
527
|
-
this.
|
|
528
|
-
|
|
529
|
-
this.
|
|
419
|
+
I.add(q);
|
|
420
|
+
q.le = H;
|
|
421
|
+
if (this.Z !== null) {
|
|
422
|
+
this.Z.h = q;
|
|
423
|
+
q.ee.push(this.Z);
|
|
424
|
+
this.Z = null;
|
|
530
425
|
}
|
|
531
|
-
if (this.
|
|
532
|
-
for (let e = 0; e < this.
|
|
533
|
-
const t = this.
|
|
534
|
-
t.
|
|
535
|
-
|
|
426
|
+
if (this.ee !== q.ee) {
|
|
427
|
+
for (let e = 0; e < this.ee.length; e++) {
|
|
428
|
+
const t = this.ee[e];
|
|
429
|
+
t.h = q;
|
|
430
|
+
q.ee.push(t);
|
|
536
431
|
}
|
|
537
|
-
this.
|
|
432
|
+
this.ee = q.ee;
|
|
538
433
|
}
|
|
539
|
-
if (this
|
|
540
|
-
for (let e = 0; e < this
|
|
541
|
-
const t = this
|
|
542
|
-
t.
|
|
543
|
-
|
|
434
|
+
if (this.j !== q.j) {
|
|
435
|
+
for (let e = 0; e < this.j.length; e++) {
|
|
436
|
+
const t = this.j[e];
|
|
437
|
+
t.h = q;
|
|
438
|
+
q.j.push(t);
|
|
544
439
|
}
|
|
545
|
-
this
|
|
440
|
+
this.j = q.j;
|
|
546
441
|
}
|
|
547
|
-
for (const e of
|
|
548
|
-
if (!e.
|
|
442
|
+
for (const e of A) {
|
|
443
|
+
if (!e.h) e.h = q;
|
|
549
444
|
}
|
|
550
|
-
if (this.
|
|
551
|
-
for (const e of this.
|
|
552
|
-
this.
|
|
445
|
+
if (this.W !== q.W) {
|
|
446
|
+
for (const e of this.W) q.W.add(e);
|
|
447
|
+
this.W = q.W;
|
|
553
448
|
}
|
|
554
449
|
}
|
|
555
450
|
}
|
|
556
451
|
function queuePendingNode(e) {
|
|
557
|
-
if (
|
|
558
|
-
|
|
452
|
+
if (q) {
|
|
453
|
+
K.ee.push(e);
|
|
559
454
|
return;
|
|
560
455
|
}
|
|
561
|
-
if (
|
|
562
|
-
|
|
456
|
+
if (K.Z === null && K.ee.length === 0) {
|
|
457
|
+
K.Z = e;
|
|
563
458
|
return;
|
|
564
459
|
}
|
|
565
|
-
if (
|
|
566
|
-
|
|
567
|
-
|
|
460
|
+
if (K.Z !== null) {
|
|
461
|
+
K.ee.push(K.Z);
|
|
462
|
+
K.Z = null;
|
|
568
463
|
}
|
|
569
|
-
|
|
464
|
+
K.ee.push(e);
|
|
570
465
|
}
|
|
571
466
|
function insertSubs(e, t = false) {
|
|
572
|
-
const n = e.
|
|
573
|
-
const r = e.
|
|
574
|
-
for (let i = e.
|
|
575
|
-
if (r && i.
|
|
576
|
-
i.
|
|
467
|
+
const n = e.i || Z;
|
|
468
|
+
const r = e.ce !== undefined;
|
|
469
|
+
for (let i = e.R; i !== null; i = i.L) {
|
|
470
|
+
if (r && i.T.ue & y) {
|
|
471
|
+
i.T.V |= l;
|
|
577
472
|
continue;
|
|
578
473
|
}
|
|
579
474
|
if (t && n) {
|
|
580
|
-
i.
|
|
581
|
-
assignOrMergeLane(i.
|
|
475
|
+
i.T.V |= f;
|
|
476
|
+
assignOrMergeLane(i.T, n);
|
|
582
477
|
} else if (t) {
|
|
583
|
-
i.
|
|
584
|
-
i.
|
|
478
|
+
i.T.V |= f;
|
|
479
|
+
i.T.i = undefined;
|
|
585
480
|
}
|
|
586
|
-
const e = i.
|
|
587
|
-
if (e.
|
|
588
|
-
if (!e.
|
|
589
|
-
e.
|
|
590
|
-
e.
|
|
481
|
+
const e = i.T;
|
|
482
|
+
if (e.H === P) {
|
|
483
|
+
if (!e.q) {
|
|
484
|
+
e.q = true;
|
|
485
|
+
e.F.enqueue(v, e.M);
|
|
591
486
|
}
|
|
592
487
|
continue;
|
|
593
488
|
}
|
|
594
|
-
const s = i.
|
|
595
|
-
if (s.
|
|
596
|
-
insertIntoHeap(i.
|
|
489
|
+
const s = i.T.V & o ? T : L;
|
|
490
|
+
if (s.N > i.T.D) s.N = i.T.D;
|
|
491
|
+
insertIntoHeap(i.T, s);
|
|
597
492
|
}
|
|
598
493
|
}
|
|
599
494
|
function commitPendingNode(e) {
|
|
600
495
|
const t = e;
|
|
601
|
-
if (!t.
|
|
602
|
-
if (e.
|
|
603
|
-
e
|
|
604
|
-
e.
|
|
496
|
+
if (!t.oe) {
|
|
497
|
+
if (e.A !== x) {
|
|
498
|
+
e.$ = e.A;
|
|
499
|
+
e.A = x;
|
|
605
500
|
}
|
|
606
501
|
return;
|
|
607
502
|
}
|
|
608
|
-
if (e.
|
|
609
|
-
e
|
|
610
|
-
e.
|
|
611
|
-
if (e.
|
|
503
|
+
if (e.A !== x) {
|
|
504
|
+
e.$ = e.A;
|
|
505
|
+
e.A = x;
|
|
506
|
+
if (e.H && e.H !== P) e.q = true;
|
|
612
507
|
}
|
|
613
|
-
t.
|
|
614
|
-
if (!(t.
|
|
615
|
-
if (t.
|
|
508
|
+
t.V &= ~a;
|
|
509
|
+
if (!(t.ae & _)) t.ae &= ~b;
|
|
510
|
+
if (t.de !== null || t.pe !== null) GlobalQueue.ne(t, false, true);
|
|
616
511
|
}
|
|
617
512
|
function commitPendingNodes() {
|
|
618
|
-
if (
|
|
619
|
-
commitPendingNode(
|
|
620
|
-
|
|
513
|
+
if (K.Z !== null) {
|
|
514
|
+
commitPendingNode(K.Z);
|
|
515
|
+
K.Z = null;
|
|
621
516
|
}
|
|
622
|
-
const e =
|
|
517
|
+
const e = K.ee;
|
|
623
518
|
for (let t = 0; t < e.length; t++) {
|
|
624
519
|
commitPendingNode(e[t]);
|
|
625
520
|
}
|
|
@@ -628,32 +523,32 @@ function commitPendingNodes() {
|
|
|
628
523
|
function finalizePureQueue(e = null, t = false) {
|
|
629
524
|
const n = !t;
|
|
630
525
|
if (n) commitPendingNodes();
|
|
631
|
-
if (!t &&
|
|
632
|
-
const r =
|
|
633
|
-
if (r) runHeap(
|
|
526
|
+
if (!t && K.k.length) checkBoundaryChildren(K);
|
|
527
|
+
const r = L.C >= L.N;
|
|
528
|
+
if (r) runHeap(L, GlobalQueue.te);
|
|
634
529
|
if (n) {
|
|
635
530
|
if (r) commitPendingNodes();
|
|
636
|
-
resolveOptimisticNodes(e ? e
|
|
637
|
-
if (e && e.
|
|
638
|
-
for (const t of e.
|
|
639
|
-
if (t.
|
|
640
|
-
if (t.
|
|
641
|
-
if (!t.
|
|
642
|
-
t.
|
|
643
|
-
t.
|
|
531
|
+
resolveOptimisticNodes(e ? e.j : K.j);
|
|
532
|
+
if (e && e.U.size) {
|
|
533
|
+
for (const t of e.U) {
|
|
534
|
+
if (t.V & u) continue;
|
|
535
|
+
if (t.H === P) {
|
|
536
|
+
if (!t.q) {
|
|
537
|
+
t.q = true;
|
|
538
|
+
t.F.enqueue(v, t.M);
|
|
644
539
|
}
|
|
645
540
|
continue;
|
|
646
541
|
}
|
|
647
|
-
const e = t.
|
|
648
|
-
if (e.
|
|
542
|
+
const e = t.V & o ? T : L;
|
|
543
|
+
if (e.N > t.D) e.N = t.D;
|
|
649
544
|
insertIntoHeap(t, e);
|
|
650
545
|
}
|
|
651
|
-
e.
|
|
546
|
+
e.U.clear();
|
|
652
547
|
}
|
|
653
|
-
const t = e ? e.
|
|
654
|
-
if (GlobalQueue.
|
|
548
|
+
const t = e ? e.W : K.W;
|
|
549
|
+
if (GlobalQueue.ie && t.size) {
|
|
655
550
|
for (const e of t) {
|
|
656
|
-
GlobalQueue.
|
|
551
|
+
GlobalQueue.ie(e);
|
|
657
552
|
}
|
|
658
553
|
t.clear();
|
|
659
554
|
schedule();
|
|
@@ -663,58 +558,61 @@ function finalizePureQueue(e = null, t = false) {
|
|
|
663
558
|
}
|
|
664
559
|
}
|
|
665
560
|
function checkBoundaryChildren(e) {
|
|
666
|
-
for (const t of e.
|
|
561
|
+
for (const t of e.k) {
|
|
667
562
|
t.checkSources?.();
|
|
668
563
|
checkBoundaryChildren(t);
|
|
669
564
|
}
|
|
670
565
|
}
|
|
671
566
|
function trackOptimisticStore(e) {
|
|
672
|
-
|
|
567
|
+
K.W.add(e);
|
|
673
568
|
schedule();
|
|
674
569
|
}
|
|
675
570
|
function reassignPendingTransition(e) {
|
|
676
571
|
for (let t = 0; t < e.length; t++) {
|
|
677
|
-
e[t].
|
|
572
|
+
e[t].h = q;
|
|
678
573
|
}
|
|
679
574
|
}
|
|
680
|
-
const
|
|
575
|
+
const K = new GlobalQueue();
|
|
681
576
|
function flush(e) {
|
|
682
577
|
if (e) {
|
|
683
|
-
|
|
578
|
+
F++;
|
|
684
579
|
try {
|
|
685
580
|
return e();
|
|
686
581
|
} finally {
|
|
687
|
-
|
|
688
|
-
|
|
582
|
+
try {
|
|
583
|
+
flush();
|
|
584
|
+
} finally {
|
|
585
|
+
F--;
|
|
586
|
+
}
|
|
689
587
|
}
|
|
690
588
|
}
|
|
691
|
-
if (
|
|
589
|
+
if (K.J) {
|
|
692
590
|
return;
|
|
693
591
|
}
|
|
694
|
-
while (
|
|
695
|
-
|
|
592
|
+
while (Q || q) {
|
|
593
|
+
K.flush();
|
|
696
594
|
}
|
|
697
595
|
}
|
|
698
596
|
function runQueue(e, t) {
|
|
699
597
|
for (let n = 0; n < e.length; n++) e[n](t);
|
|
700
598
|
}
|
|
701
599
|
function reporterBlocksSource(e, t) {
|
|
702
|
-
if (e.
|
|
703
|
-
if (e.
|
|
704
|
-
for (let n = e.
|
|
705
|
-
let e = n.
|
|
600
|
+
if (e.V & (o | u)) return false;
|
|
601
|
+
if (e.he === t || e.ye?.has(t)) return true;
|
|
602
|
+
for (let n = e.Se; n; n = n.ge) {
|
|
603
|
+
let e = n.we;
|
|
706
604
|
while (e) {
|
|
707
|
-
if (e === t || e.
|
|
708
|
-
e = e.
|
|
605
|
+
if (e === t || e._e === t) return true;
|
|
606
|
+
e = e.t;
|
|
709
607
|
}
|
|
710
608
|
}
|
|
711
|
-
return !!(e.
|
|
609
|
+
return !!(e.ae & _ && e.fe instanceof NotReadyError && e.fe.source === t);
|
|
712
610
|
}
|
|
713
611
|
function transitionComplete(e) {
|
|
714
|
-
if (e.
|
|
715
|
-
if (e.
|
|
612
|
+
if (e.K) return true;
|
|
613
|
+
if (e.B.length) return false;
|
|
716
614
|
let t = true;
|
|
717
|
-
for (const [n, r] of e.
|
|
615
|
+
for (const [n, r] of e.G) {
|
|
718
616
|
let i = false;
|
|
719
617
|
for (const e of r) {
|
|
720
618
|
if (reporterBlocksSource(e, n)) {
|
|
@@ -723,107 +621,205 @@ function transitionComplete(e) {
|
|
|
723
621
|
}
|
|
724
622
|
r.delete(e);
|
|
725
623
|
}
|
|
726
|
-
if (!i) e.
|
|
727
|
-
else if (n.
|
|
624
|
+
if (!i) e.G.delete(n);
|
|
625
|
+
else if (n.ae & _ && n.fe?.source === n) {
|
|
728
626
|
t = false;
|
|
729
627
|
break;
|
|
730
628
|
}
|
|
731
629
|
}
|
|
732
630
|
if (t) {
|
|
733
|
-
for (let n = 0; n < e
|
|
734
|
-
const r = e
|
|
631
|
+
for (let n = 0; n < e.j.length; n++) {
|
|
632
|
+
const r = e.j[n];
|
|
735
633
|
if (
|
|
736
634
|
hasActiveOverride(r) &&
|
|
737
|
-
"
|
|
738
|
-
r.
|
|
739
|
-
r.
|
|
740
|
-
r.
|
|
635
|
+
"ae" in r &&
|
|
636
|
+
r.ae & _ &&
|
|
637
|
+
r.fe instanceof NotReadyError &&
|
|
638
|
+
r.fe.source !== r
|
|
741
639
|
) {
|
|
742
640
|
t = false;
|
|
743
641
|
break;
|
|
744
642
|
}
|
|
745
643
|
}
|
|
746
644
|
}
|
|
747
|
-
t && (e.
|
|
645
|
+
t && (e.K = true);
|
|
748
646
|
return t;
|
|
749
647
|
}
|
|
750
648
|
function currentTransition(e) {
|
|
751
|
-
while (e.
|
|
649
|
+
while (e.K && typeof e.K === "object") e = e.K;
|
|
752
650
|
return e;
|
|
753
651
|
}
|
|
754
652
|
function setActiveTransition(e) {
|
|
755
|
-
|
|
653
|
+
q = e;
|
|
756
654
|
}
|
|
757
655
|
function runInTransition(e, t) {
|
|
758
|
-
const n =
|
|
656
|
+
const n = q;
|
|
759
657
|
try {
|
|
760
|
-
|
|
658
|
+
q = currentTransition(e);
|
|
761
659
|
return t();
|
|
762
660
|
} finally {
|
|
763
|
-
|
|
661
|
+
q = n;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
function actualInsertIntoHeap(e, t) {
|
|
665
|
+
const n = (e.X?.me ? e.X.be?.D : e.X?.D) ?? -1;
|
|
666
|
+
if (n >= e.D) e.D = n + 1;
|
|
667
|
+
const r = e.D;
|
|
668
|
+
const i = t.O[r];
|
|
669
|
+
if (i === undefined) t.O[r] = e;
|
|
670
|
+
else {
|
|
671
|
+
const t = i.Oe;
|
|
672
|
+
t.ve = e;
|
|
673
|
+
e.Oe = t;
|
|
674
|
+
i.Oe = e;
|
|
675
|
+
}
|
|
676
|
+
if (r > t.C) t.C = r;
|
|
677
|
+
}
|
|
678
|
+
function insertIntoHeap(e, o) {
|
|
679
|
+
let u = e.V;
|
|
680
|
+
if (u & (i | r | a)) return;
|
|
681
|
+
if (u & t) {
|
|
682
|
+
e.V = (u & -4) | n | i;
|
|
683
|
+
} else e.V = u | i;
|
|
684
|
+
if (!(u & s)) actualInsertIntoHeap(e, o);
|
|
685
|
+
}
|
|
686
|
+
function insertIntoHeapHeight(e, t) {
|
|
687
|
+
let n = e.V;
|
|
688
|
+
if (n & (i | r | s | a)) return;
|
|
689
|
+
e.V = n | s;
|
|
690
|
+
actualInsertIntoHeap(e, t);
|
|
691
|
+
}
|
|
692
|
+
function deleteFromHeap(e, t) {
|
|
693
|
+
const n = e.V;
|
|
694
|
+
if (!(n & (i | s))) return;
|
|
695
|
+
e.V = n & -25;
|
|
696
|
+
const r = e.D;
|
|
697
|
+
if (e.Oe === e) t.O[r] = undefined;
|
|
698
|
+
else {
|
|
699
|
+
const n = e.ve;
|
|
700
|
+
const i = t.O[r];
|
|
701
|
+
const s = n ?? i;
|
|
702
|
+
if (e === i) t.O[r] = n;
|
|
703
|
+
else e.Oe.ve = n;
|
|
704
|
+
s.Oe = e.Oe;
|
|
705
|
+
}
|
|
706
|
+
e.Oe = e;
|
|
707
|
+
e.ve = undefined;
|
|
708
|
+
}
|
|
709
|
+
function markHeap(e) {
|
|
710
|
+
if (e.P) return;
|
|
711
|
+
e.P = true;
|
|
712
|
+
for (let t = 0; t <= e.C; t++) {
|
|
713
|
+
for (let n = e.O[t]; n !== undefined; n = n.ve) {
|
|
714
|
+
if (n.V & i) markNode(n);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
function markNode(e, r = n) {
|
|
719
|
+
const i = e.V;
|
|
720
|
+
if ((i & (t | n)) >= r) return;
|
|
721
|
+
e.V = (i & -4) | r;
|
|
722
|
+
for (let n = e.R; n !== null; n = n.L) {
|
|
723
|
+
markNode(n.T, t);
|
|
724
|
+
}
|
|
725
|
+
if (e.Pe !== null) {
|
|
726
|
+
for (let n = e.Pe; n !== null; n = n.xe) {
|
|
727
|
+
for (let e = n.R; e !== null; e = e.L) {
|
|
728
|
+
markNode(e.T, t);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
function runHeap(e, t) {
|
|
734
|
+
e.P = false;
|
|
735
|
+
for (e.N = 0; e.N <= e.C; e.N++) {
|
|
736
|
+
let n = e.O[e.N];
|
|
737
|
+
while (n !== undefined) {
|
|
738
|
+
if (n.V & i) t(n);
|
|
739
|
+
else adjustHeight(n, e);
|
|
740
|
+
n = e.O[e.N];
|
|
741
|
+
}
|
|
764
742
|
}
|
|
743
|
+
e.C = 0;
|
|
765
744
|
}
|
|
766
|
-
|
|
745
|
+
function adjustHeight(e, t) {
|
|
746
|
+
deleteFromHeap(e, t);
|
|
747
|
+
let n = e.D;
|
|
748
|
+
for (let t = e.Se; t; t = t.ge) {
|
|
749
|
+
const e = t.we;
|
|
750
|
+
const r = e._e || e;
|
|
751
|
+
if (r.oe && r.D >= n) n = r.D + 1;
|
|
752
|
+
}
|
|
753
|
+
if (e.D !== n) {
|
|
754
|
+
e.D = n;
|
|
755
|
+
for (let t = e.R; t !== null; t = t.L) {
|
|
756
|
+
insertIntoHeapHeight(t.T, t.T.V & o ? T : L);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const B = {};
|
|
767
761
|
function markDisposal(e) {
|
|
768
762
|
let t = e.Ne;
|
|
769
763
|
while (t) {
|
|
770
|
-
t.
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
764
|
+
const e = t.V;
|
|
765
|
+
t.V = e | o;
|
|
766
|
+
if (e & (i | s)) {
|
|
767
|
+
deleteFromHeap(t, e & o ? T : L);
|
|
768
|
+
if (e & i) insertIntoHeap(t, T);
|
|
769
|
+
else insertIntoHeapHeight(t, T);
|
|
774
770
|
}
|
|
775
771
|
markDisposal(t);
|
|
776
772
|
t = t.Ce;
|
|
777
773
|
}
|
|
778
774
|
}
|
|
779
775
|
function dispose(e) {
|
|
780
|
-
let t = e.
|
|
781
|
-
|
|
776
|
+
let t = e.Se;
|
|
777
|
+
while (t !== null) {
|
|
782
778
|
t = unlinkSubs(t);
|
|
783
|
-
}
|
|
784
|
-
e.
|
|
779
|
+
}
|
|
780
|
+
e.Se = null;
|
|
785
781
|
e.Ee = null;
|
|
786
782
|
disposeChildren(e, true);
|
|
787
783
|
}
|
|
788
784
|
function disposeChildren(e, t = false, n) {
|
|
789
|
-
const r = e.
|
|
785
|
+
const r = e.V;
|
|
790
786
|
if (r & u) return;
|
|
791
|
-
if (t) e.
|
|
792
|
-
if (t && e.
|
|
793
|
-
let i = n ? e.
|
|
787
|
+
if (t) e.V = r | u;
|
|
788
|
+
if (t && e.oe) e.ke = null;
|
|
789
|
+
let i = n ? e.de : e.Ne;
|
|
794
790
|
while (i) {
|
|
795
791
|
const e = i.Ce;
|
|
796
|
-
if (i.
|
|
792
|
+
if (i.Se) {
|
|
797
793
|
const e = i;
|
|
798
|
-
deleteFromHeap(e, e.
|
|
799
|
-
let t = e.
|
|
794
|
+
deleteFromHeap(e, e.V & o ? T : L);
|
|
795
|
+
let t = e.Se;
|
|
800
796
|
do {
|
|
801
797
|
t = unlinkSubs(t);
|
|
802
798
|
} while (t !== null);
|
|
803
|
-
e.
|
|
799
|
+
e.Se = null;
|
|
804
800
|
e.Ee = null;
|
|
805
801
|
}
|
|
806
802
|
disposeChildren(i, true);
|
|
807
803
|
i = e;
|
|
808
804
|
}
|
|
809
805
|
if (n) {
|
|
810
|
-
e.
|
|
806
|
+
e.de = null;
|
|
811
807
|
} else {
|
|
812
808
|
e.Ne = null;
|
|
813
809
|
e.je = 0;
|
|
814
810
|
}
|
|
815
|
-
if (t && !n && !(r & o) && e.
|
|
811
|
+
if (t && !n && !(r & o) && e.X !== null && !(e.X.V & u)) {
|
|
816
812
|
const t = e.We;
|
|
817
813
|
const n = e.Ce;
|
|
818
814
|
if (t !== null) t.Ce = n;
|
|
819
|
-
else e.
|
|
815
|
+
else e.X.Ne = n;
|
|
820
816
|
if (n !== null) n.We = t;
|
|
821
817
|
e.We = null;
|
|
822
818
|
}
|
|
823
819
|
runDisposal(e, n);
|
|
824
820
|
}
|
|
825
821
|
function runDisposal(e, t) {
|
|
826
|
-
let n = t ? e.
|
|
822
|
+
let n = t ? e.pe : e.Re;
|
|
827
823
|
if (!n) return;
|
|
828
824
|
if (Array.isArray(n)) {
|
|
829
825
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -833,11 +829,11 @@ function runDisposal(e, t) {
|
|
|
833
829
|
} else {
|
|
834
830
|
n.call(n);
|
|
835
831
|
}
|
|
836
|
-
t ? (e.
|
|
832
|
+
t ? (e.pe = null) : (e.Re = null);
|
|
837
833
|
}
|
|
838
834
|
function childId(e, t) {
|
|
839
835
|
let n = e;
|
|
840
|
-
while (n.
|
|
836
|
+
while (n.ue & h && n.X) n = n.X;
|
|
841
837
|
if (n.id != null) return formatId(n.id, t ? n.je++ : n.je);
|
|
842
838
|
throw new Error("Cannot get child id from owner without an id");
|
|
843
839
|
}
|
|
@@ -853,43 +849,43 @@ function formatId(e, t) {
|
|
|
853
849
|
return e + (r ? String.fromCharCode(64 + r) : "") + n;
|
|
854
850
|
}
|
|
855
851
|
function getObserver() {
|
|
856
|
-
if (
|
|
857
|
-
return
|
|
852
|
+
if ($ || X) return B;
|
|
853
|
+
return z ? Y : null;
|
|
858
854
|
}
|
|
859
855
|
function getOwner() {
|
|
860
|
-
return
|
|
856
|
+
return Y;
|
|
861
857
|
}
|
|
862
858
|
function cleanup(e) {
|
|
863
|
-
if (!
|
|
864
|
-
if (!
|
|
865
|
-
else if (Array.isArray(
|
|
866
|
-
else
|
|
859
|
+
if (!Y) return e;
|
|
860
|
+
if (!Y.Re) Y.Re = e;
|
|
861
|
+
else if (Array.isArray(Y.Re)) Y.Re.push(e);
|
|
862
|
+
else Y.Re = [Y.Re, e];
|
|
867
863
|
return e;
|
|
868
864
|
}
|
|
869
865
|
function isDisposed(e) {
|
|
870
|
-
return !!(e.
|
|
866
|
+
return !!(e.V & (u | o));
|
|
871
867
|
}
|
|
872
868
|
function disposeRootSelf(e = true) {
|
|
873
869
|
disposeChildren(this, e);
|
|
874
870
|
}
|
|
875
871
|
function createOwner(e) {
|
|
876
|
-
const t =
|
|
872
|
+
const t = Y;
|
|
877
873
|
const n = e?.transparent ?? false;
|
|
878
874
|
const r = {
|
|
879
875
|
id: e?.id ?? (n ? t?.id : t?.id != null ? getNextChildId(t) : undefined),
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
876
|
+
ue: n ? h : 0,
|
|
877
|
+
me: true,
|
|
878
|
+
be: t?.me ? t.be : t,
|
|
883
879
|
Ne: null,
|
|
884
880
|
Ce: null,
|
|
885
881
|
We: null,
|
|
886
882
|
Re: null,
|
|
887
|
-
|
|
883
|
+
F: t?.F ?? K,
|
|
888
884
|
Ae: t?.Ae || k,
|
|
889
885
|
je: 0,
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
886
|
+
pe: null,
|
|
887
|
+
de: null,
|
|
888
|
+
X: t,
|
|
893
889
|
dispose: disposeRootSelf
|
|
894
890
|
};
|
|
895
891
|
if (t) {
|
|
@@ -909,128 +905,128 @@ function createRoot(e, t) {
|
|
|
909
905
|
return runWithOwner(n, () => e(() => n.dispose()));
|
|
910
906
|
}
|
|
911
907
|
function unlinkSubs(e) {
|
|
912
|
-
const t = e.
|
|
913
|
-
const n = e.
|
|
914
|
-
const r = e.
|
|
908
|
+
const t = e.we;
|
|
909
|
+
const n = e.ge;
|
|
910
|
+
const r = e.L;
|
|
915
911
|
const i = e.Ie;
|
|
916
912
|
if (r !== null) r.Ie = i;
|
|
917
913
|
else t.Le = i;
|
|
918
|
-
if (i !== null) i.
|
|
914
|
+
if (i !== null) i.L = r;
|
|
919
915
|
else {
|
|
920
|
-
t.
|
|
916
|
+
t.R = r;
|
|
921
917
|
if (r === null) {
|
|
922
|
-
t.
|
|
918
|
+
t.I?.();
|
|
923
919
|
const e = t;
|
|
924
|
-
e.
|
|
920
|
+
e.oe && e.ue & g && !(e.V & o) && unobserved(e);
|
|
925
921
|
}
|
|
926
922
|
}
|
|
927
923
|
return n;
|
|
928
924
|
}
|
|
929
925
|
function trimStaleDeps(e) {
|
|
930
926
|
const t = e.Ee;
|
|
931
|
-
let n = t !== null ? t.
|
|
927
|
+
let n = t !== null ? t.ge : e.Se;
|
|
932
928
|
if (n !== null) {
|
|
933
929
|
do {
|
|
934
930
|
n = unlinkSubs(n);
|
|
935
931
|
} while (n !== null);
|
|
936
|
-
if (t !== null) t.
|
|
937
|
-
else e.
|
|
932
|
+
if (t !== null) t.ge = null;
|
|
933
|
+
else e.Se = null;
|
|
938
934
|
}
|
|
939
935
|
}
|
|
940
936
|
function unobserved(e) {
|
|
941
|
-
deleteFromHeap(e, e.
|
|
942
|
-
let t = e.
|
|
937
|
+
deleteFromHeap(e, e.V & o ? T : L);
|
|
938
|
+
let t = e.Se;
|
|
943
939
|
while (t !== null) {
|
|
944
940
|
t = unlinkSubs(t);
|
|
945
941
|
}
|
|
946
|
-
e.
|
|
942
|
+
e.Se = null;
|
|
947
943
|
e.Ee = null;
|
|
948
944
|
disposeChildren(e, true);
|
|
949
945
|
}
|
|
950
946
|
function link(e, t) {
|
|
951
947
|
const n = t.Ee;
|
|
952
|
-
if (n !== null && n.
|
|
948
|
+
if (n !== null && n.we === e) return;
|
|
953
949
|
let i = null;
|
|
954
|
-
const s = t.
|
|
950
|
+
const s = t.V & r;
|
|
955
951
|
if (s) {
|
|
956
|
-
i = n !== null ? n.
|
|
957
|
-
if (i !== null && i.
|
|
952
|
+
i = n !== null ? n.ge : t.Se;
|
|
953
|
+
if (i !== null && i.we === e) {
|
|
958
954
|
t.Ee = i;
|
|
959
955
|
return;
|
|
960
956
|
}
|
|
961
957
|
}
|
|
962
958
|
const o = e.Le;
|
|
963
|
-
if (o !== null && o.
|
|
964
|
-
const u = (t.Ee = e.Le = {
|
|
965
|
-
if (n !== null) n.
|
|
966
|
-
else t.
|
|
967
|
-
if (o !== null) o.
|
|
968
|
-
else e.
|
|
959
|
+
if (o !== null && o.T === t && (!s || isValidLink(o, t))) return;
|
|
960
|
+
const u = (t.Ee = e.Le = { we: e, T: t, ge: i, Ie: o, L: null });
|
|
961
|
+
if (n !== null) n.ge = u;
|
|
962
|
+
else t.Se = u;
|
|
963
|
+
if (o !== null) o.L = u;
|
|
964
|
+
else e.R = u;
|
|
969
965
|
}
|
|
970
966
|
function isValidLink(e, t) {
|
|
971
967
|
const n = t.Ee;
|
|
972
968
|
if (n !== null) {
|
|
973
|
-
let r = t.
|
|
969
|
+
let r = t.Se;
|
|
974
970
|
do {
|
|
975
971
|
if (r === e) return true;
|
|
976
972
|
if (r === n) break;
|
|
977
|
-
r = r.
|
|
973
|
+
r = r.ge;
|
|
978
974
|
} while (r !== null);
|
|
979
975
|
}
|
|
980
976
|
return false;
|
|
981
977
|
}
|
|
982
978
|
function addPendingSource(e, t) {
|
|
983
|
-
if (e.
|
|
984
|
-
if (!e.
|
|
985
|
-
e.
|
|
979
|
+
if (e.he === t || e.ye?.has(t)) return false;
|
|
980
|
+
if (!e.he) {
|
|
981
|
+
e.he = t;
|
|
986
982
|
return true;
|
|
987
983
|
}
|
|
988
|
-
if (!e.
|
|
989
|
-
e.
|
|
984
|
+
if (!e.ye) {
|
|
985
|
+
e.ye = new Set([e.he, t]);
|
|
990
986
|
} else {
|
|
991
|
-
e.
|
|
987
|
+
e.ye.add(t);
|
|
992
988
|
}
|
|
993
|
-
e.
|
|
989
|
+
e.he = undefined;
|
|
994
990
|
return true;
|
|
995
991
|
}
|
|
996
992
|
function removePendingSource(e, t) {
|
|
997
|
-
if (e.
|
|
998
|
-
if (e.
|
|
999
|
-
e.
|
|
993
|
+
if (e.he) {
|
|
994
|
+
if (e.he !== t) return false;
|
|
995
|
+
e.he = undefined;
|
|
1000
996
|
return true;
|
|
1001
997
|
}
|
|
1002
|
-
if (!e.
|
|
1003
|
-
if (e.
|
|
1004
|
-
e.
|
|
1005
|
-
e.
|
|
1006
|
-
} else if (e.
|
|
1007
|
-
e.
|
|
998
|
+
if (!e.ye?.delete(t)) return false;
|
|
999
|
+
if (e.ye.size === 1) {
|
|
1000
|
+
e.he = e.ye.values().next().value;
|
|
1001
|
+
e.ye = undefined;
|
|
1002
|
+
} else if (e.ye.size === 0) {
|
|
1003
|
+
e.ye = undefined;
|
|
1008
1004
|
}
|
|
1009
1005
|
return true;
|
|
1010
1006
|
}
|
|
1011
1007
|
function clearPendingSources(e) {
|
|
1012
|
-
e.
|
|
1013
|
-
e.
|
|
1014
|
-
e.
|
|
1008
|
+
e.he = undefined;
|
|
1009
|
+
e.ye?.clear();
|
|
1010
|
+
e.ye = undefined;
|
|
1015
1011
|
}
|
|
1016
1012
|
function setPendingError(e, t, n) {
|
|
1017
1013
|
if (!t) {
|
|
1018
|
-
e.
|
|
1014
|
+
e.fe = null;
|
|
1019
1015
|
return;
|
|
1020
1016
|
}
|
|
1021
1017
|
if (n instanceof NotReadyError && n.source === t) {
|
|
1022
|
-
e.
|
|
1018
|
+
e.fe = n;
|
|
1023
1019
|
return;
|
|
1024
1020
|
}
|
|
1025
|
-
const r = e.
|
|
1021
|
+
const r = e.fe;
|
|
1026
1022
|
if (!(r instanceof NotReadyError) || r.source !== t) {
|
|
1027
|
-
e.
|
|
1023
|
+
e.fe = new NotReadyError(t);
|
|
1028
1024
|
}
|
|
1029
1025
|
}
|
|
1030
1026
|
function forEachDependent(e, t) {
|
|
1031
|
-
for (let n = e.
|
|
1032
|
-
for (let n = e.
|
|
1033
|
-
for (let e = n.
|
|
1027
|
+
for (let n = e.R; n !== null; n = n.L) t(n.T);
|
|
1028
|
+
for (let n = e.Pe; n !== null; n = n.xe) {
|
|
1029
|
+
for (let e = n.R; e !== null; e = e.L) t(e.T);
|
|
1034
1030
|
}
|
|
1035
1031
|
}
|
|
1036
1032
|
function settlePendingSource(e) {
|
|
@@ -1039,25 +1035,25 @@ function settlePendingSource(e) {
|
|
|
1039
1035
|
const settle = r => {
|
|
1040
1036
|
if (n.has(r) || !removePendingSource(r, e)) return;
|
|
1041
1037
|
n.add(r);
|
|
1042
|
-
r.
|
|
1043
|
-
const i = r.
|
|
1038
|
+
r.le = H;
|
|
1039
|
+
const i = r.he ?? r.ye?.values().next().value;
|
|
1044
1040
|
if (i) {
|
|
1045
1041
|
setPendingError(r, i);
|
|
1046
1042
|
updatePendingSignal(r);
|
|
1047
1043
|
} else {
|
|
1048
|
-
r.
|
|
1044
|
+
r.ae &= ~_;
|
|
1049
1045
|
setPendingError(r);
|
|
1050
1046
|
updatePendingSignal(r);
|
|
1051
1047
|
if (r.Te) {
|
|
1052
|
-
if (r.
|
|
1048
|
+
if (r.H === P) {
|
|
1053
1049
|
const e = r;
|
|
1054
|
-
if (!e.
|
|
1055
|
-
e.
|
|
1056
|
-
e.
|
|
1050
|
+
if (!e.q) {
|
|
1051
|
+
e.q = true;
|
|
1052
|
+
e.F.enqueue(v, e.M);
|
|
1057
1053
|
}
|
|
1058
1054
|
} else {
|
|
1059
|
-
const e = r.
|
|
1060
|
-
if (e.
|
|
1055
|
+
const e = r.V & o ? T : L;
|
|
1056
|
+
if (e.N > r.D) e.N = r.D;
|
|
1061
1057
|
insertIntoHeap(r, e);
|
|
1062
1058
|
}
|
|
1063
1059
|
t = true;
|
|
@@ -1086,34 +1082,36 @@ function handleAsync(e, t, r) {
|
|
|
1086
1082
|
let o;
|
|
1087
1083
|
const handleError = n => {
|
|
1088
1084
|
if (e.ke !== t) return;
|
|
1089
|
-
|
|
1085
|
+
K.initTransition(resolveTransition(e));
|
|
1090
1086
|
notifyStatus(e, n instanceof NotReadyError ? _ : m, n);
|
|
1091
|
-
e.
|
|
1087
|
+
e.le = H;
|
|
1092
1088
|
};
|
|
1093
1089
|
const asyncWrite = (i, s) => {
|
|
1094
1090
|
if (e.ke !== t) return;
|
|
1095
|
-
if (e.
|
|
1096
|
-
|
|
1097
|
-
const o = !!(e.
|
|
1091
|
+
if (e.V & (n | f)) return;
|
|
1092
|
+
K.initTransition(resolveTransition(e));
|
|
1093
|
+
const o = !!(e.ae & b);
|
|
1098
1094
|
trimStaleDeps(e);
|
|
1099
1095
|
clearStatus(e);
|
|
1100
1096
|
const u = resolveLane(e);
|
|
1101
|
-
if (u) u.
|
|
1102
|
-
if (r)
|
|
1103
|
-
|
|
1104
|
-
if (
|
|
1097
|
+
if (u) u.u.delete(e);
|
|
1098
|
+
if (r) {
|
|
1099
|
+
r(i);
|
|
1100
|
+
if (o) clearStatus(e, true);
|
|
1101
|
+
} else if (e.m !== undefined) {
|
|
1102
|
+
if (e.m !== undefined && e.m !== x) e.A = i;
|
|
1105
1103
|
else {
|
|
1106
|
-
e
|
|
1104
|
+
e.$ = i;
|
|
1107
1105
|
insertSubs(e);
|
|
1108
1106
|
}
|
|
1109
|
-
e.
|
|
1107
|
+
e.le = H;
|
|
1110
1108
|
} else if (u) {
|
|
1111
|
-
const t = e.
|
|
1112
|
-
const n = e
|
|
1109
|
+
const t = e.H;
|
|
1110
|
+
const n = e.$;
|
|
1113
1111
|
const r = e.He;
|
|
1114
1112
|
if ((!t && o) || !r || !r(i, n)) {
|
|
1115
|
-
e
|
|
1116
|
-
e.
|
|
1113
|
+
e.$ = i;
|
|
1114
|
+
e.le = H;
|
|
1117
1115
|
if (e.qe) {
|
|
1118
1116
|
setSignal(e.qe, i);
|
|
1119
1117
|
}
|
|
@@ -1143,8 +1141,8 @@ function handleAsync(e, t, r) {
|
|
|
1143
1141
|
);
|
|
1144
1142
|
r = false;
|
|
1145
1143
|
if (!n) {
|
|
1146
|
-
|
|
1147
|
-
throw new NotReadyError(
|
|
1144
|
+
K.initTransition(resolveTransition(e));
|
|
1145
|
+
throw new NotReadyError(Y);
|
|
1148
1146
|
}
|
|
1149
1147
|
}
|
|
1150
1148
|
if (i) {
|
|
@@ -1197,17 +1195,17 @@ function handleAsync(e, t, r) {
|
|
|
1197
1195
|
};
|
|
1198
1196
|
const s = iterate();
|
|
1199
1197
|
if (!r && !s) {
|
|
1200
|
-
|
|
1201
|
-
throw new NotReadyError(
|
|
1198
|
+
K.initTransition(resolveTransition(e));
|
|
1199
|
+
throw new NotReadyError(Y);
|
|
1202
1200
|
}
|
|
1203
1201
|
}
|
|
1204
1202
|
return o;
|
|
1205
1203
|
}
|
|
1206
1204
|
function clearStatus(e, t = false) {
|
|
1207
|
-
if (e.
|
|
1205
|
+
if (e.he || e.ye) clearPendingSources(e);
|
|
1208
1206
|
if (e.Te) e.Te = false;
|
|
1209
|
-
e.
|
|
1210
|
-
if (e.
|
|
1207
|
+
e.ae = t ? 0 : e.ae & b;
|
|
1208
|
+
if (e.fe) setPendingError(e);
|
|
1211
1209
|
if (e.Qe) updatePendingSignal(e);
|
|
1212
1210
|
if (e.Fe) e.Fe();
|
|
1213
1211
|
}
|
|
@@ -1216,17 +1214,17 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
1216
1214
|
n = new StatusError(e, n);
|
|
1217
1215
|
const s = t === _ && n instanceof NotReadyError ? n.source : undefined;
|
|
1218
1216
|
const o = s === e;
|
|
1219
|
-
const u = t === _ && e.
|
|
1217
|
+
const u = t === _ && e.m !== undefined && !o;
|
|
1220
1218
|
const f = u && hasActiveOverride(e);
|
|
1221
1219
|
if (!r) {
|
|
1222
1220
|
if (t === _ && s) {
|
|
1223
1221
|
addPendingSource(e, s);
|
|
1224
|
-
e.
|
|
1222
|
+
e.ae = _ | (e.ae & b);
|
|
1225
1223
|
setPendingError(e, s, n);
|
|
1226
1224
|
} else {
|
|
1227
1225
|
clearPendingSources(e);
|
|
1228
|
-
e.
|
|
1229
|
-
e.
|
|
1226
|
+
e.ae = t | (t !== m ? e.ae & b : 0);
|
|
1227
|
+
e.fe = n;
|
|
1230
1228
|
}
|
|
1231
1229
|
updatePendingSignal(e);
|
|
1232
1230
|
}
|
|
@@ -1247,22 +1245,22 @@ function notifyStatus(e, t, n, r, i) {
|
|
|
1247
1245
|
return;
|
|
1248
1246
|
}
|
|
1249
1247
|
forEachDependent(e, e => {
|
|
1250
|
-
e.
|
|
1248
|
+
e.le = H;
|
|
1251
1249
|
if (
|
|
1252
|
-
(t === _ && s && e.
|
|
1253
|
-
(t !== _ && (e.
|
|
1250
|
+
(t === _ && s && e.he !== s && !e.ye?.has(s)) ||
|
|
1251
|
+
(t !== _ && (e.fe !== n || e.he || e.ye))
|
|
1254
1252
|
) {
|
|
1255
|
-
if (!l && !e.
|
|
1253
|
+
if (!l && !e.h) queuePendingNode(e);
|
|
1256
1254
|
notifyStatus(e, t, n, l, c);
|
|
1257
1255
|
}
|
|
1258
1256
|
});
|
|
1259
1257
|
}
|
|
1260
|
-
let
|
|
1258
|
+
let G = null;
|
|
1261
1259
|
function enableExternalSource(e) {
|
|
1262
1260
|
const { factory: t, untrack: n = e => e() } = e;
|
|
1263
|
-
if (
|
|
1264
|
-
const { factory: e, untrack: r } =
|
|
1265
|
-
|
|
1261
|
+
if (G) {
|
|
1262
|
+
const { factory: e, untrack: r } = G;
|
|
1263
|
+
G = {
|
|
1266
1264
|
factory: (n, r) => {
|
|
1267
1265
|
const i = e(n, r);
|
|
1268
1266
|
const s = t(e => i.track(e), r);
|
|
@@ -1277,32 +1275,31 @@ function enableExternalSource(e) {
|
|
|
1277
1275
|
untrack: e => r(() => n(e))
|
|
1278
1276
|
};
|
|
1279
1277
|
} else {
|
|
1280
|
-
|
|
1278
|
+
G = { factory: t, untrack: n };
|
|
1281
1279
|
}
|
|
1282
1280
|
}
|
|
1283
|
-
GlobalQueue.
|
|
1284
|
-
GlobalQueue.
|
|
1281
|
+
GlobalQueue.te = recompute;
|
|
1282
|
+
GlobalQueue.ne = disposeChildren;
|
|
1283
|
+
let z = false;
|
|
1284
|
+
let U = false;
|
|
1285
|
+
let $ = false;
|
|
1285
1286
|
let J = false;
|
|
1286
1287
|
let X = false;
|
|
1287
|
-
let Y =
|
|
1288
|
-
let Z =
|
|
1289
|
-
let ee =
|
|
1288
|
+
let Y = null;
|
|
1289
|
+
let Z = null;
|
|
1290
|
+
let ee = null;
|
|
1290
1291
|
let te = false;
|
|
1291
1292
|
let ne = null;
|
|
1292
|
-
let re = null;
|
|
1293
|
-
let ie = null;
|
|
1294
|
-
let se = false;
|
|
1295
|
-
let oe = null;
|
|
1296
1293
|
function ownerInSnapshotScope(e) {
|
|
1297
1294
|
while (e) {
|
|
1298
1295
|
if (e.Me) return true;
|
|
1299
|
-
e = e.
|
|
1296
|
+
e = e.X;
|
|
1300
1297
|
}
|
|
1301
1298
|
return false;
|
|
1302
1299
|
}
|
|
1303
1300
|
function setSnapshotCapture(e) {
|
|
1304
|
-
|
|
1305
|
-
if (e && !
|
|
1301
|
+
te = e;
|
|
1302
|
+
if (e && !ne) ne = new Set();
|
|
1306
1303
|
}
|
|
1307
1304
|
function markSnapshotScope(e) {
|
|
1308
1305
|
e.Me = true;
|
|
@@ -1319,14 +1316,14 @@ function releaseSubtree(e) {
|
|
|
1319
1316
|
t = t.Ce;
|
|
1320
1317
|
continue;
|
|
1321
1318
|
}
|
|
1322
|
-
if (t.
|
|
1319
|
+
if (t.oe) {
|
|
1323
1320
|
const e = t;
|
|
1324
|
-
e.
|
|
1325
|
-
if (e.
|
|
1326
|
-
e.
|
|
1327
|
-
e.
|
|
1328
|
-
if (
|
|
1329
|
-
insertIntoHeap(e,
|
|
1321
|
+
e.ue &= ~y;
|
|
1322
|
+
if (e.V & l) {
|
|
1323
|
+
e.V &= ~l;
|
|
1324
|
+
e.V |= n;
|
|
1325
|
+
if (L.N > e.D) L.N = e.D;
|
|
1326
|
+
insertIntoHeap(e, L);
|
|
1330
1327
|
}
|
|
1331
1328
|
}
|
|
1332
1329
|
releaseSubtree(t);
|
|
@@ -1334,57 +1331,57 @@ function releaseSubtree(e) {
|
|
|
1334
1331
|
}
|
|
1335
1332
|
}
|
|
1336
1333
|
function clearSnapshots() {
|
|
1337
|
-
if (
|
|
1338
|
-
for (const e of
|
|
1339
|
-
delete e.
|
|
1334
|
+
if (ne) {
|
|
1335
|
+
for (const e of ne) {
|
|
1336
|
+
delete e.ce;
|
|
1340
1337
|
delete e[C];
|
|
1341
1338
|
}
|
|
1342
|
-
|
|
1339
|
+
ne = null;
|
|
1343
1340
|
}
|
|
1344
|
-
|
|
1341
|
+
te = false;
|
|
1345
1342
|
}
|
|
1346
1343
|
function recompute(t, n = false) {
|
|
1347
|
-
const i = t.
|
|
1344
|
+
const i = t.H;
|
|
1348
1345
|
if (!n) {
|
|
1349
|
-
if (t.
|
|
1350
|
-
deleteFromHeap(t, t.
|
|
1346
|
+
if (t.h && (!i || q) && q !== t.h) K.initTransition(t.h);
|
|
1347
|
+
deleteFromHeap(t, t.V & o ? T : L);
|
|
1351
1348
|
t.ke = null;
|
|
1352
|
-
if (t.
|
|
1349
|
+
if (t.h || i === P) disposeChildren(t);
|
|
1353
1350
|
else if (t.Ne !== null || t.Re !== null) {
|
|
1354
1351
|
markDisposal(t);
|
|
1355
|
-
t.
|
|
1356
|
-
t.
|
|
1352
|
+
t.pe = t.Re;
|
|
1353
|
+
t.de = t.Ne;
|
|
1357
1354
|
t.Re = null;
|
|
1358
1355
|
t.Ne = null;
|
|
1359
1356
|
t.je = 0;
|
|
1360
1357
|
} else;
|
|
1361
1358
|
}
|
|
1362
|
-
let s = !!(t.
|
|
1363
|
-
const u = t.
|
|
1364
|
-
const c = !!(t.
|
|
1365
|
-
const a = !!(t.
|
|
1366
|
-
const d =
|
|
1367
|
-
|
|
1359
|
+
let s = !!(t.V & f);
|
|
1360
|
+
const u = t.m !== undefined && t.m !== x;
|
|
1361
|
+
const c = !!(t.ae & _);
|
|
1362
|
+
const a = !!(t.ae & b);
|
|
1363
|
+
const d = Y;
|
|
1364
|
+
Y = t;
|
|
1368
1365
|
t.Ee = null;
|
|
1369
|
-
t.
|
|
1370
|
-
t.
|
|
1371
|
-
let p = t.
|
|
1372
|
-
let h = t.
|
|
1373
|
-
let y =
|
|
1374
|
-
let S =
|
|
1375
|
-
|
|
1366
|
+
t.V = r;
|
|
1367
|
+
t.le = H;
|
|
1368
|
+
let p = t.A === x ? t.$ : t.A;
|
|
1369
|
+
let h = t.D;
|
|
1370
|
+
let y = z;
|
|
1371
|
+
let S = Z;
|
|
1372
|
+
z = true;
|
|
1376
1373
|
if (s) {
|
|
1377
1374
|
const e = resolveLane(t);
|
|
1378
|
-
if (e)
|
|
1379
|
-
} else if (
|
|
1380
|
-
for (let e = t.
|
|
1381
|
-
const n = e.
|
|
1382
|
-
if (n.
|
|
1375
|
+
if (e) Z = e;
|
|
1376
|
+
} else if (q && !n && q.j.length) {
|
|
1377
|
+
for (let e = t.Se; e; e = e.ge) {
|
|
1378
|
+
const n = e.we;
|
|
1379
|
+
if (n.V & f) {
|
|
1383
1380
|
const e = resolveLane(n);
|
|
1384
1381
|
if (e) {
|
|
1385
1382
|
s = true;
|
|
1386
|
-
|
|
1387
|
-
t.
|
|
1383
|
+
Z = e;
|
|
1384
|
+
t.V |= f;
|
|
1388
1385
|
assignOrMergeLane(t, e);
|
|
1389
1386
|
break;
|
|
1390
1387
|
}
|
|
@@ -1392,35 +1389,35 @@ function recompute(t, n = false) {
|
|
|
1392
1389
|
}
|
|
1393
1390
|
}
|
|
1394
1391
|
const g = i && i !== v;
|
|
1395
|
-
const O =
|
|
1396
|
-
if (g)
|
|
1392
|
+
const O = U;
|
|
1393
|
+
if (g) U = true;
|
|
1397
1394
|
try {
|
|
1398
|
-
if (!false && t.
|
|
1399
|
-
p = t.
|
|
1395
|
+
if (!false && t.ue & w) {
|
|
1396
|
+
p = t.oe(p);
|
|
1400
1397
|
t.ke = null;
|
|
1401
1398
|
} else {
|
|
1402
1399
|
const e = t.ke;
|
|
1403
|
-
const n = t.
|
|
1400
|
+
const n = t.oe(p);
|
|
1404
1401
|
const r = typeof n === "object" && n !== null;
|
|
1405
1402
|
const i = t.ke !== e;
|
|
1406
1403
|
p = i || !r ? n : handleAsync(t, n);
|
|
1407
1404
|
if (!i && !r) t.ke = null;
|
|
1408
1405
|
}
|
|
1409
1406
|
clearStatus(t, n);
|
|
1410
|
-
if (t.
|
|
1407
|
+
if (t.i) {
|
|
1411
1408
|
const e = resolveLane(t);
|
|
1412
1409
|
if (e) {
|
|
1413
|
-
e.
|
|
1414
|
-
updatePendingSignal(e.
|
|
1410
|
+
e.u.delete(t);
|
|
1411
|
+
updatePendingSignal(e.o);
|
|
1415
1412
|
}
|
|
1416
1413
|
}
|
|
1417
1414
|
} catch (e) {
|
|
1418
|
-
if (e instanceof NotReadyError &&
|
|
1419
|
-
const e = findLane(
|
|
1420
|
-
if (e.
|
|
1421
|
-
e.
|
|
1422
|
-
t.
|
|
1423
|
-
updatePendingSignal(e.
|
|
1415
|
+
if (e instanceof NotReadyError && Z) {
|
|
1416
|
+
const e = findLane(Z);
|
|
1417
|
+
if (e.o !== t) {
|
|
1418
|
+
e.u.add(t);
|
|
1419
|
+
t.i = e;
|
|
1420
|
+
updatePendingSignal(e.o);
|
|
1424
1421
|
}
|
|
1425
1422
|
}
|
|
1426
1423
|
if (e instanceof NotReadyError) t.Te = true;
|
|
@@ -1429,102 +1426,102 @@ function recompute(t, n = false) {
|
|
|
1429
1426
|
e instanceof NotReadyError ? _ : m,
|
|
1430
1427
|
e,
|
|
1431
1428
|
undefined,
|
|
1432
|
-
e instanceof NotReadyError ? t.
|
|
1429
|
+
e instanceof NotReadyError ? t.i : undefined
|
|
1433
1430
|
);
|
|
1434
1431
|
} finally {
|
|
1435
|
-
|
|
1436
|
-
if (g)
|
|
1437
|
-
t.
|
|
1438
|
-
|
|
1432
|
+
z = y;
|
|
1433
|
+
if (g) U = O;
|
|
1434
|
+
t.V = e | (n ? t.V & l : 0);
|
|
1435
|
+
Y = d;
|
|
1439
1436
|
}
|
|
1440
|
-
if (!t.
|
|
1437
|
+
if (!t.fe) {
|
|
1441
1438
|
trimStaleDeps(t);
|
|
1442
|
-
const e = u ? t.
|
|
1439
|
+
const e = u ? t.m : t.A === x ? t.$ : t.A;
|
|
1443
1440
|
const r = (!i && a) || !t.He || !t.He(e, p);
|
|
1444
1441
|
if (i && r) {
|
|
1445
|
-
t.
|
|
1446
|
-
if (!n) t.
|
|
1442
|
+
t.q = !t.fe;
|
|
1443
|
+
if (!n) t.F.enqueue(i, GlobalQueue.re.bind(null, t));
|
|
1447
1444
|
}
|
|
1448
1445
|
if (r) {
|
|
1449
|
-
const e = u ? t.
|
|
1450
|
-
if (n || (i &&
|
|
1451
|
-
t
|
|
1446
|
+
const e = u ? t.m : undefined;
|
|
1447
|
+
if (n || (i && q !== t.h) || s) {
|
|
1448
|
+
t.$ = p;
|
|
1452
1449
|
if (u && s) {
|
|
1453
|
-
t.
|
|
1454
|
-
t.
|
|
1450
|
+
t.m = p;
|
|
1451
|
+
t.A = p;
|
|
1455
1452
|
}
|
|
1456
|
-
} else t.
|
|
1457
|
-
if (u && !s && c && !t.
|
|
1458
|
-
if (!u || s || t.
|
|
1453
|
+
} else t.A = p;
|
|
1454
|
+
if (u && !s && c && !t._) t.m = p;
|
|
1455
|
+
if (!u || s || t.m !== e) insertSubs(t, s || u);
|
|
1459
1456
|
} else if (u) {
|
|
1460
|
-
t.
|
|
1461
|
-
} else if (t.
|
|
1462
|
-
for (let e = t.
|
|
1463
|
-
insertIntoHeapHeight(e.
|
|
1457
|
+
t.A = p;
|
|
1458
|
+
} else if (t.D != h) {
|
|
1459
|
+
for (let e = t.R; e !== null; e = e.L) {
|
|
1460
|
+
insertIntoHeapHeight(e.T, e.T.V & o ? T : L);
|
|
1464
1461
|
}
|
|
1465
1462
|
}
|
|
1466
1463
|
}
|
|
1467
|
-
|
|
1468
|
-
const N = t.
|
|
1469
|
-
N && (!n || t.
|
|
1470
|
-
t.
|
|
1464
|
+
Z = S;
|
|
1465
|
+
const N = t.A !== x || t.de !== null || t.pe !== null || !!(t.ae & (_ | b));
|
|
1466
|
+
N && (!n || t.ae & _) && !t.h && !(q && u) && queuePendingNode(t);
|
|
1467
|
+
t.h && i && q !== t.h && runInTransition(t.h, () => recompute(t));
|
|
1471
1468
|
}
|
|
1472
1469
|
function updateIfNecessary(e) {
|
|
1473
|
-
if (e.
|
|
1474
|
-
for (let t = e.
|
|
1475
|
-
const r = t.
|
|
1476
|
-
const i = r.
|
|
1477
|
-
if (i.
|
|
1470
|
+
if (e.V & t) {
|
|
1471
|
+
for (let t = e.Se; t; t = t.ge) {
|
|
1472
|
+
const r = t.we;
|
|
1473
|
+
const i = r._e || r;
|
|
1474
|
+
if (i.oe) {
|
|
1478
1475
|
updateIfNecessary(i);
|
|
1479
1476
|
}
|
|
1480
|
-
if (e.
|
|
1477
|
+
if (e.V & n) {
|
|
1481
1478
|
break;
|
|
1482
1479
|
}
|
|
1483
1480
|
}
|
|
1484
1481
|
}
|
|
1485
|
-
if (e.
|
|
1482
|
+
if (e.V & (n | f) || (e.fe && e.le < H && !e.ke)) {
|
|
1486
1483
|
recompute(e);
|
|
1487
1484
|
}
|
|
1488
|
-
e.
|
|
1485
|
+
e.V = e.V & (l | i | s);
|
|
1489
1486
|
}
|
|
1490
1487
|
function computed(t, n) {
|
|
1491
1488
|
const r = n?.transparent ?? false;
|
|
1492
1489
|
const i = {
|
|
1493
|
-
id: n?.id ?? (r ?
|
|
1494
|
-
|
|
1490
|
+
id: n?.id ?? (r ? Y?.id : Y?.id != null ? getNextChildId(Y) : undefined),
|
|
1491
|
+
ue:
|
|
1495
1492
|
(r ? h : 0) |
|
|
1496
1493
|
(n?.ownedWrite ? d : 0) |
|
|
1497
|
-
(!
|
|
1494
|
+
(!Y || n?.lazy ? g : 0) |
|
|
1498
1495
|
(n?.sync ? w : 0) |
|
|
1499
|
-
(
|
|
1496
|
+
(te && ownerInSnapshotScope(Y) ? y : 0),
|
|
1500
1497
|
He: n?.equals != null ? n.equals : isEqual,
|
|
1501
|
-
|
|
1498
|
+
I: n?.unobserved,
|
|
1502
1499
|
Re: null,
|
|
1503
|
-
|
|
1504
|
-
Ae:
|
|
1500
|
+
F: Y?.F ?? K,
|
|
1501
|
+
Ae: Y?.Ae ?? k,
|
|
1505
1502
|
je: 0,
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1503
|
+
oe: t,
|
|
1504
|
+
$: undefined,
|
|
1505
|
+
D: 0,
|
|
1506
|
+
Pe: null,
|
|
1507
|
+
ve: undefined,
|
|
1508
|
+
Oe: null,
|
|
1509
|
+
Se: null,
|
|
1513
1510
|
Ee: null,
|
|
1514
|
-
|
|
1511
|
+
R: null,
|
|
1515
1512
|
Le: null,
|
|
1516
|
-
|
|
1513
|
+
X: Y,
|
|
1517
1514
|
Ce: null,
|
|
1518
1515
|
We: null,
|
|
1519
1516
|
Ne: null,
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1517
|
+
V: n?.lazy ? c : e,
|
|
1518
|
+
ae: b,
|
|
1519
|
+
le: H,
|
|
1520
|
+
A: x,
|
|
1521
|
+
pe: null,
|
|
1522
|
+
de: null,
|
|
1526
1523
|
ke: null,
|
|
1527
|
-
|
|
1524
|
+
h: null
|
|
1528
1525
|
};
|
|
1529
1526
|
setupComputedNode(i, n);
|
|
1530
1527
|
return i;
|
|
@@ -1532,330 +1529,337 @@ function computed(t, n) {
|
|
|
1532
1529
|
function createEffectNode(e, t, n, r, i, s) {
|
|
1533
1530
|
const o = s?.transparent ?? false;
|
|
1534
1531
|
const u = {
|
|
1535
|
-
id: s?.id ?? (o ?
|
|
1536
|
-
|
|
1532
|
+
id: s?.id ?? (o ? Y?.id : Y?.id != null ? getNextChildId(Y) : undefined),
|
|
1533
|
+
ue:
|
|
1537
1534
|
(o ? h : 0) |
|
|
1538
1535
|
(s?.ownedWrite ? d : 0) |
|
|
1539
1536
|
(s?.sync ? w : 0) |
|
|
1540
|
-
(
|
|
1537
|
+
(te && ownerInSnapshotScope(Y) ? y : 0),
|
|
1541
1538
|
He: false,
|
|
1542
|
-
|
|
1539
|
+
I: s?.unobserved,
|
|
1543
1540
|
Re: null,
|
|
1544
|
-
|
|
1545
|
-
Ae:
|
|
1541
|
+
F: Y?.F ?? K,
|
|
1542
|
+
Ae: Y?.Ae ?? k,
|
|
1546
1543
|
je: 0,
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1544
|
+
oe: e,
|
|
1545
|
+
$: undefined,
|
|
1546
|
+
D: 0,
|
|
1547
|
+
Pe: null,
|
|
1548
|
+
ve: undefined,
|
|
1549
|
+
Oe: null,
|
|
1550
|
+
Se: null,
|
|
1554
1551
|
Ee: null,
|
|
1555
|
-
|
|
1552
|
+
R: null,
|
|
1556
1553
|
Le: null,
|
|
1557
|
-
|
|
1554
|
+
X: Y,
|
|
1558
1555
|
Ce: null,
|
|
1559
1556
|
We: null,
|
|
1560
1557
|
Ne: null,
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1558
|
+
V: c,
|
|
1559
|
+
ae: b,
|
|
1560
|
+
le: H,
|
|
1561
|
+
A: x,
|
|
1562
|
+
pe: null,
|
|
1563
|
+
de: null,
|
|
1567
1564
|
ke: null,
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1565
|
+
h: null,
|
|
1566
|
+
q: false,
|
|
1567
|
+
Ve: undefined,
|
|
1568
|
+
De: t,
|
|
1572
1569
|
Ke: n,
|
|
1573
1570
|
Be: undefined,
|
|
1574
1571
|
Ge: false,
|
|
1575
|
-
|
|
1572
|
+
H: r,
|
|
1576
1573
|
Fe: i
|
|
1577
1574
|
};
|
|
1578
|
-
setupComputedNode(u,
|
|
1575
|
+
setupComputedNode(u, re);
|
|
1579
1576
|
return u;
|
|
1580
1577
|
}
|
|
1581
|
-
const
|
|
1578
|
+
const re = { lazy: true };
|
|
1582
1579
|
function setupComputedNode(e, t) {
|
|
1583
|
-
e.
|
|
1584
|
-
const n =
|
|
1585
|
-
if (
|
|
1586
|
-
const t =
|
|
1580
|
+
e.Oe = e;
|
|
1581
|
+
const n = Y?.me ? Y.be : Y;
|
|
1582
|
+
if (Y) {
|
|
1583
|
+
const t = Y.Ne;
|
|
1587
1584
|
if (t === null) {
|
|
1588
|
-
|
|
1585
|
+
Y.Ne = e;
|
|
1589
1586
|
} else {
|
|
1590
1587
|
e.Ce = t;
|
|
1591
1588
|
t.We = e;
|
|
1592
|
-
|
|
1589
|
+
Y.Ne = e;
|
|
1593
1590
|
}
|
|
1594
1591
|
}
|
|
1595
|
-
if (n) e.
|
|
1596
|
-
if (
|
|
1592
|
+
if (n) e.D = n.D + 1;
|
|
1593
|
+
if (G) {
|
|
1597
1594
|
const t = signal(undefined, { equals: false, ownedWrite: true });
|
|
1598
|
-
const n =
|
|
1595
|
+
const n = G.factory(e.oe, () => {
|
|
1599
1596
|
setSignal(t, undefined);
|
|
1600
1597
|
});
|
|
1601
1598
|
cleanup(() => n.dispose());
|
|
1602
|
-
e.
|
|
1599
|
+
e.oe = e => {
|
|
1603
1600
|
read(t);
|
|
1604
1601
|
return n.track(e);
|
|
1605
1602
|
};
|
|
1606
1603
|
}
|
|
1607
1604
|
!t?.lazy && recompute(e, true);
|
|
1608
|
-
if (
|
|
1609
|
-
if (!(e.
|
|
1610
|
-
e.
|
|
1611
|
-
|
|
1605
|
+
if (te && !t?.lazy) {
|
|
1606
|
+
if (!(e.ae & _)) {
|
|
1607
|
+
e.ce = e.$ === undefined ? N : e.$;
|
|
1608
|
+
ne.add(e);
|
|
1612
1609
|
}
|
|
1613
1610
|
}
|
|
1614
1611
|
}
|
|
1615
1612
|
function signal(e, t, n = null) {
|
|
1616
1613
|
const r = {
|
|
1617
1614
|
He: t?.equals != null ? t.equals : isEqual,
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1615
|
+
ue: (t?.ownedWrite ? d : 0) | (t?.ze ? p : 0),
|
|
1616
|
+
I: t?.unobserved,
|
|
1617
|
+
$: e,
|
|
1618
|
+
R: null,
|
|
1622
1619
|
Le: null,
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1620
|
+
le: H,
|
|
1621
|
+
_e: n,
|
|
1622
|
+
xe: n?.Pe || null,
|
|
1623
|
+
A: x
|
|
1627
1624
|
};
|
|
1628
|
-
n && (n.
|
|
1629
|
-
if (
|
|
1630
|
-
r.
|
|
1631
|
-
|
|
1625
|
+
n && (n.Pe = r);
|
|
1626
|
+
if (te && !(r.ue & p) && !((n?.ae ?? 0) & _)) {
|
|
1627
|
+
r.ce = e === undefined ? N : e;
|
|
1628
|
+
ne.add(r);
|
|
1632
1629
|
}
|
|
1633
1630
|
return r;
|
|
1634
1631
|
}
|
|
1635
1632
|
function optimisticSignal(e, t) {
|
|
1636
1633
|
const n = signal(e, t);
|
|
1637
|
-
n.
|
|
1634
|
+
n.m = x;
|
|
1638
1635
|
return n;
|
|
1639
1636
|
}
|
|
1640
1637
|
function optimisticComputed(e, t) {
|
|
1641
1638
|
const n = computed(e, t);
|
|
1642
|
-
n.
|
|
1639
|
+
n.m = x;
|
|
1643
1640
|
return n;
|
|
1644
1641
|
}
|
|
1645
1642
|
function isEqual(e, t) {
|
|
1646
1643
|
return e === t;
|
|
1647
1644
|
}
|
|
1648
1645
|
function untrack(e, t) {
|
|
1649
|
-
if (
|
|
1650
|
-
const n =
|
|
1651
|
-
|
|
1646
|
+
if (!G && !z && true) return e();
|
|
1647
|
+
const n = z;
|
|
1648
|
+
z = false;
|
|
1652
1649
|
try {
|
|
1653
|
-
if (
|
|
1650
|
+
if (G) return G.untrack(e);
|
|
1654
1651
|
return e();
|
|
1655
1652
|
} finally {
|
|
1656
|
-
|
|
1653
|
+
z = n;
|
|
1657
1654
|
}
|
|
1658
1655
|
}
|
|
1659
1656
|
function read(e) {
|
|
1660
|
-
if (
|
|
1657
|
+
if (X) {
|
|
1661
1658
|
const t = getLatestValueComputed(e);
|
|
1662
|
-
const n =
|
|
1663
|
-
|
|
1664
|
-
const r = e.
|
|
1659
|
+
const n = X;
|
|
1660
|
+
X = false;
|
|
1661
|
+
const r = e.m !== undefined && e.m !== x ? e.m : e.$;
|
|
1665
1662
|
let i;
|
|
1666
1663
|
try {
|
|
1667
1664
|
i = read(t);
|
|
1668
1665
|
} catch (e) {
|
|
1669
|
-
if (!
|
|
1666
|
+
if (!Y && e instanceof NotReadyError) return r;
|
|
1670
1667
|
throw e;
|
|
1671
1668
|
} finally {
|
|
1672
|
-
|
|
1669
|
+
X = n;
|
|
1673
1670
|
}
|
|
1674
|
-
if (t.
|
|
1675
|
-
if (
|
|
1676
|
-
const e = findLane(t.
|
|
1677
|
-
const n = findLane(
|
|
1678
|
-
if (e !== n && e.
|
|
1671
|
+
if (t.ae & _) return r;
|
|
1672
|
+
if (U && Z && t.i) {
|
|
1673
|
+
const e = findLane(t.i);
|
|
1674
|
+
const n = findLane(Z);
|
|
1675
|
+
if (e !== n && e.u.size > 0) {
|
|
1679
1676
|
return r;
|
|
1680
1677
|
}
|
|
1681
1678
|
}
|
|
1682
1679
|
return i;
|
|
1683
1680
|
}
|
|
1684
|
-
if (
|
|
1685
|
-
const t = e.
|
|
1686
|
-
const n =
|
|
1687
|
-
|
|
1688
|
-
let r =
|
|
1689
|
-
if (r?.
|
|
1681
|
+
if ($) {
|
|
1682
|
+
const t = e._e;
|
|
1683
|
+
const n = $;
|
|
1684
|
+
$ = false;
|
|
1685
|
+
let r = Y;
|
|
1686
|
+
if (r?.me) r = r.be;
|
|
1690
1687
|
const i = t || e;
|
|
1691
1688
|
const s = e;
|
|
1692
|
-
if (typeof s.
|
|
1689
|
+
if (typeof s.oe === "function") {
|
|
1693
1690
|
const t = e;
|
|
1694
|
-
if (t.
|
|
1695
|
-
t.
|
|
1691
|
+
if (t.V & c) {
|
|
1692
|
+
t.V &= ~c;
|
|
1696
1693
|
recompute(t, true);
|
|
1697
|
-
} else if (t.
|
|
1694
|
+
} else if (t.V & u) {
|
|
1698
1695
|
recompute(t, true);
|
|
1699
1696
|
} else {
|
|
1700
1697
|
updateIfNecessary(t);
|
|
1701
1698
|
}
|
|
1702
1699
|
}
|
|
1703
|
-
if (r && i.
|
|
1704
|
-
if (
|
|
1705
|
-
|
|
1706
|
-
throw i.
|
|
1700
|
+
if (r && i.ae & _ && i.ae & b) {
|
|
1701
|
+
if (z && e !== r) link(e, r);
|
|
1702
|
+
$ = n;
|
|
1703
|
+
throw i.fe;
|
|
1707
1704
|
}
|
|
1708
|
-
if (t && e.
|
|
1709
|
-
if (e.
|
|
1710
|
-
|
|
1705
|
+
if (t && e.m !== undefined) {
|
|
1706
|
+
if (e.m !== x && (t.ke || !!(t.ae & _))) {
|
|
1707
|
+
J = true;
|
|
1711
1708
|
}
|
|
1712
1709
|
collectPendingSources(e);
|
|
1713
1710
|
collectPendingSources(t);
|
|
1714
|
-
if (r &&
|
|
1711
|
+
if (r && z) link(e, r);
|
|
1715
1712
|
} else {
|
|
1716
1713
|
collectPendingSources(e);
|
|
1717
1714
|
if (t) collectPendingSources(t);
|
|
1718
1715
|
}
|
|
1719
|
-
|
|
1716
|
+
$ = n;
|
|
1720
1717
|
}
|
|
1721
|
-
let t =
|
|
1722
|
-
if (t?.
|
|
1718
|
+
let t = Y;
|
|
1719
|
+
if (t?.me) t = t.be;
|
|
1723
1720
|
const n = e;
|
|
1724
|
-
if (typeof n.
|
|
1721
|
+
if (typeof n.oe === "function") {
|
|
1725
1722
|
const t = e;
|
|
1726
|
-
if (t.
|
|
1727
|
-
t.
|
|
1723
|
+
if (t.V & c) {
|
|
1724
|
+
t.V &= ~c;
|
|
1728
1725
|
recompute(t, true);
|
|
1729
|
-
} else if (t.
|
|
1726
|
+
} else if (t.V & u) {
|
|
1730
1727
|
recompute(t, true);
|
|
1731
1728
|
}
|
|
1732
1729
|
}
|
|
1733
|
-
const r = e.
|
|
1730
|
+
const r = e._e || e;
|
|
1734
1731
|
if (
|
|
1735
|
-
!n.
|
|
1732
|
+
!n.oe &&
|
|
1736
1733
|
r === e &&
|
|
1737
|
-
e.
|
|
1738
|
-
e.
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
!
|
|
1734
|
+
e.m === undefined &&
|
|
1735
|
+
e.ce === undefined &&
|
|
1736
|
+
q === null &&
|
|
1737
|
+
Z === null &&
|
|
1738
|
+
!te &&
|
|
1742
1739
|
true
|
|
1743
1740
|
) {
|
|
1744
|
-
if (t &&
|
|
1745
|
-
return !t || e.
|
|
1741
|
+
if (t && z) link(e, t);
|
|
1742
|
+
return !t || e.A === x ? e.$ : e.A;
|
|
1746
1743
|
}
|
|
1747
|
-
if (t &&
|
|
1744
|
+
if (t && z) {
|
|
1748
1745
|
link(e, t);
|
|
1749
|
-
if (r.
|
|
1750
|
-
const n = e.
|
|
1751
|
-
if (r.
|
|
1746
|
+
if (r.oe) {
|
|
1747
|
+
const n = e.V & o;
|
|
1748
|
+
if (r.D >= (n ? T.N : L.N)) {
|
|
1752
1749
|
markNode(t);
|
|
1753
|
-
markHeap(n ?
|
|
1750
|
+
markHeap(n ? T : L);
|
|
1754
1751
|
updateIfNecessary(r);
|
|
1755
1752
|
}
|
|
1756
|
-
const i = r.
|
|
1757
|
-
if (i >= t.
|
|
1758
|
-
t.
|
|
1753
|
+
const i = r.D;
|
|
1754
|
+
if (i >= t.D && e.X !== t) {
|
|
1755
|
+
t.D = i + 1;
|
|
1759
1756
|
}
|
|
1760
1757
|
}
|
|
1761
1758
|
}
|
|
1762
|
-
if (r.
|
|
1763
|
-
if (t && !(
|
|
1764
|
-
if (
|
|
1765
|
-
const n = r.
|
|
1766
|
-
const i = findLane(
|
|
1759
|
+
if (r.ae & _) {
|
|
1760
|
+
if (t && !(U && r.h && q !== r.h)) {
|
|
1761
|
+
if (Z) {
|
|
1762
|
+
const n = r.i;
|
|
1763
|
+
const i = findLane(Z);
|
|
1767
1764
|
if (n && findLane(n) === i && !hasActiveOverride(r)) {
|
|
1768
|
-
if (!
|
|
1769
|
-
throw r.
|
|
1765
|
+
if (!z && e !== t) link(e, t);
|
|
1766
|
+
throw r.fe;
|
|
1770
1767
|
}
|
|
1771
1768
|
} else {
|
|
1772
|
-
if (!
|
|
1773
|
-
throw r.
|
|
1769
|
+
if (!z && e !== t) link(e, t);
|
|
1770
|
+
throw r.fe;
|
|
1774
1771
|
}
|
|
1775
|
-
} else if (t && r !== e && r.
|
|
1776
|
-
if (!
|
|
1777
|
-
throw r.
|
|
1778
|
-
} else if (!t && r.
|
|
1779
|
-
throw r.
|
|
1772
|
+
} else if (t && r !== e && r.ae & b) {
|
|
1773
|
+
if (!z && e !== t) link(e, t);
|
|
1774
|
+
throw r.fe;
|
|
1775
|
+
} else if (!t && r.ae & b) {
|
|
1776
|
+
throw r.fe;
|
|
1780
1777
|
}
|
|
1781
1778
|
}
|
|
1782
|
-
if (e.
|
|
1783
|
-
if (e.
|
|
1779
|
+
if (e.oe && e.ae & m) {
|
|
1780
|
+
if (e.le < H) {
|
|
1784
1781
|
recompute(e);
|
|
1785
1782
|
return read(e);
|
|
1786
|
-
} else throw e.
|
|
1783
|
+
} else throw e.fe;
|
|
1787
1784
|
}
|
|
1788
|
-
if (
|
|
1789
|
-
const n = e.
|
|
1785
|
+
if (te && t && t.ue & y) {
|
|
1786
|
+
const n = e.ce;
|
|
1790
1787
|
if (n !== undefined) {
|
|
1791
1788
|
const r = n === N ? undefined : n;
|
|
1792
|
-
const i = e.
|
|
1793
|
-
if (i !== r) t.
|
|
1789
|
+
const i = e.A !== x ? e.A : e.$;
|
|
1790
|
+
if (i !== r) t.V |= l;
|
|
1794
1791
|
return r;
|
|
1795
1792
|
}
|
|
1796
1793
|
}
|
|
1797
|
-
if (e.
|
|
1798
|
-
if (t &&
|
|
1799
|
-
return e.
|
|
1794
|
+
if (e.m !== undefined && e.m !== x) {
|
|
1795
|
+
if (t && U && shouldReadStashedOptimisticValue(e)) return e.$;
|
|
1796
|
+
return e.m;
|
|
1800
1797
|
}
|
|
1801
|
-
if (
|
|
1802
|
-
|
|
1803
|
-
return e
|
|
1798
|
+
if (q !== null && Z !== null && !X && e.A !== x && (r === e || !!(r.V & a)) && !e.oe && t) {
|
|
1799
|
+
q.U.add(t);
|
|
1800
|
+
return e.$;
|
|
1804
1801
|
}
|
|
1805
1802
|
const i =
|
|
1806
1803
|
!t ||
|
|
1807
|
-
(
|
|
1808
|
-
e.
|
|
1809
|
-
(
|
|
1810
|
-
? e
|
|
1811
|
-
: e.
|
|
1812
|
-
if (!t && r === e && typeof n.
|
|
1804
|
+
(Z !== null && (e.m !== undefined || e.i || (r === e && U) || !!(r.ae & _))) ||
|
|
1805
|
+
e.A === x ||
|
|
1806
|
+
(U && e.h && q !== e.h)
|
|
1807
|
+
? e.$
|
|
1808
|
+
: e.A;
|
|
1809
|
+
if (!t && r === e && typeof n.oe === "function" && e.ue & g && !(r.ae & _) && !e.R) {
|
|
1813
1810
|
unobserved(e);
|
|
1814
1811
|
}
|
|
1815
1812
|
return i;
|
|
1816
1813
|
}
|
|
1817
1814
|
function setSignal(e, t) {
|
|
1818
|
-
if (e.
|
|
1819
|
-
const n = e.
|
|
1820
|
-
const r = e.
|
|
1821
|
-
const i = n ? (r ? e.
|
|
1815
|
+
if (e.h && q !== e.h) K.initTransition(e.h);
|
|
1816
|
+
const n = e.m !== undefined && !M;
|
|
1817
|
+
const r = e.m !== undefined && e.m !== x;
|
|
1818
|
+
const i = n ? (r ? e.m : e.$) : e.A === x ? e.$ : e.A;
|
|
1822
1819
|
if (typeof t === "function") t = t(i);
|
|
1823
|
-
const s = !e.He || !e.He(i, t) || !!(e.
|
|
1820
|
+
const s = !e.He || !e.He(i, t) || !!(e.ae & b);
|
|
1824
1821
|
if (!s) {
|
|
1825
|
-
if (n && r
|
|
1826
|
-
|
|
1827
|
-
|
|
1822
|
+
if (n && r) {
|
|
1823
|
+
const t = resolveTransition(e);
|
|
1824
|
+
if (t && q !== t) K.initTransition(t);
|
|
1825
|
+
if (e.oe) {
|
|
1826
|
+
insertSubs(e, true);
|
|
1827
|
+
schedule();
|
|
1828
|
+
}
|
|
1828
1829
|
}
|
|
1829
1830
|
return t;
|
|
1830
1831
|
}
|
|
1831
1832
|
if (n) {
|
|
1832
|
-
const n = e.
|
|
1833
|
-
if (!n)
|
|
1833
|
+
const n = e.m === x;
|
|
1834
|
+
if (!n) K.initTransition(resolveTransition(e));
|
|
1834
1835
|
if (n) {
|
|
1835
|
-
e.
|
|
1836
|
-
|
|
1836
|
+
e.A = e.$;
|
|
1837
|
+
K.j.push(e);
|
|
1837
1838
|
}
|
|
1838
|
-
e.
|
|
1839
|
+
e._ = true;
|
|
1839
1840
|
const r = getOrCreateLane(e);
|
|
1840
|
-
e.
|
|
1841
|
-
e.
|
|
1841
|
+
e.i = r;
|
|
1842
|
+
e.m = t;
|
|
1842
1843
|
} else {
|
|
1843
|
-
if (e.
|
|
1844
|
-
e.
|
|
1844
|
+
if (e.A === x) queuePendingNode(e);
|
|
1845
|
+
e.A = t;
|
|
1845
1846
|
}
|
|
1846
1847
|
if (e.Qe) updatePendingSignal(e);
|
|
1847
1848
|
if (e.qe) {
|
|
1848
1849
|
setSignal(e.qe, t);
|
|
1849
1850
|
}
|
|
1850
|
-
e.
|
|
1851
|
+
e.le = H;
|
|
1851
1852
|
insertSubs(e, n);
|
|
1852
1853
|
schedule();
|
|
1853
1854
|
return t;
|
|
1854
1855
|
}
|
|
1855
1856
|
function suppressComputedRecompute(e) {
|
|
1856
|
-
deleteFromHeap(e, e.
|
|
1857
|
-
if (!(e.
|
|
1858
|
-
|
|
1857
|
+
deleteFromHeap(e, e.V & o ? T : L);
|
|
1858
|
+
if (!(e.V & a) && e.A === x) {
|
|
1859
|
+
queuePendingNode(e);
|
|
1860
|
+
schedule();
|
|
1861
|
+
}
|
|
1862
|
+
e.V = (e.V & -4) | a;
|
|
1859
1863
|
}
|
|
1860
1864
|
function setMemo(e, t) {
|
|
1861
1865
|
const n = setSignal(e, t);
|
|
@@ -1863,161 +1867,153 @@ function setMemo(e, t) {
|
|
|
1863
1867
|
return n;
|
|
1864
1868
|
}
|
|
1865
1869
|
function runWithOwner(e, t) {
|
|
1866
|
-
const n =
|
|
1867
|
-
const r =
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
+
const n = Y;
|
|
1871
|
+
const r = z;
|
|
1872
|
+
Y = e;
|
|
1873
|
+
z = false;
|
|
1870
1874
|
try {
|
|
1871
1875
|
return t();
|
|
1872
1876
|
} finally {
|
|
1873
|
-
|
|
1874
|
-
|
|
1877
|
+
Y = n;
|
|
1878
|
+
z = r;
|
|
1875
1879
|
}
|
|
1876
1880
|
}
|
|
1877
1881
|
function getPendingSignal(e) {
|
|
1878
1882
|
if (!e.Qe) {
|
|
1879
1883
|
e.Qe = optimisticSignal(false, { ownedWrite: true });
|
|
1880
|
-
if (e.
|
|
1881
|
-
e.Qe.
|
|
1884
|
+
if (e.t) {
|
|
1885
|
+
e.Qe.t = e;
|
|
1882
1886
|
}
|
|
1883
1887
|
if (computePendingState(e)) setSignal(e.Qe, true);
|
|
1884
1888
|
}
|
|
1885
1889
|
return e.Qe;
|
|
1886
1890
|
}
|
|
1887
1891
|
function collectPendingSources(e) {
|
|
1888
|
-
|
|
1889
|
-
const t = e.
|
|
1890
|
-
if (t !== e)
|
|
1892
|
+
ee?.add(e);
|
|
1893
|
+
const t = e._e || e;
|
|
1894
|
+
if (t !== e) ee?.add(t);
|
|
1891
1895
|
}
|
|
1892
1896
|
function computePendingState(e) {
|
|
1893
1897
|
const t = e;
|
|
1894
|
-
const n = e.
|
|
1895
|
-
if (e.
|
|
1896
|
-
const n = e.
|
|
1897
|
-
if (n.
|
|
1898
|
-
return e.
|
|
1898
|
+
const n = e._e;
|
|
1899
|
+
if (e.t) {
|
|
1900
|
+
const n = e.t;
|
|
1901
|
+
if (n.ae & _ && !(n.ae & b)) return true;
|
|
1902
|
+
return e.A !== x && !(t.ae & b);
|
|
1899
1903
|
}
|
|
1900
|
-
if (n && e.
|
|
1901
|
-
return !n.ke && !(n.
|
|
1904
|
+
if (n && e.A !== x) {
|
|
1905
|
+
return !!(n.V & a) || (!n.ke && !(n.ae & _));
|
|
1902
1906
|
}
|
|
1903
|
-
if (e.
|
|
1904
|
-
if (t.
|
|
1905
|
-
if (e.
|
|
1906
|
-
const t = e.
|
|
1907
|
-
return !!(t && t.
|
|
1907
|
+
if (e.m !== undefined && e.m !== x) {
|
|
1908
|
+
if (t.ae & _ && !(t.ae & b)) return true;
|
|
1909
|
+
if (e.t) {
|
|
1910
|
+
const t = e.i ? findLane(e.i) : null;
|
|
1911
|
+
return !!(t && t.u.size > 0);
|
|
1908
1912
|
}
|
|
1909
1913
|
return true;
|
|
1910
1914
|
}
|
|
1911
|
-
if (e.
|
|
1915
|
+
if (e.m !== undefined && e.m === x && !e.t) {
|
|
1912
1916
|
return false;
|
|
1913
1917
|
}
|
|
1914
|
-
if (e.
|
|
1915
|
-
return !!(t.
|
|
1918
|
+
if (e.A !== x && !(t.ae & b)) return true;
|
|
1919
|
+
return !!(t.ae & _ && !(t.ae & b));
|
|
1916
1920
|
}
|
|
1917
1921
|
function updatePendingSignal(e) {
|
|
1918
1922
|
if (e.Qe) {
|
|
1919
1923
|
const t = computePendingState(e);
|
|
1920
1924
|
const n = e.Qe;
|
|
1921
1925
|
setSignal(n, t);
|
|
1922
|
-
if (!t && n.
|
|
1926
|
+
if (!t && n.i) {
|
|
1923
1927
|
const t = resolveLane(e);
|
|
1924
|
-
if (t && t.
|
|
1925
|
-
const e = findLane(n.
|
|
1928
|
+
if (t && t.u.size > 0) {
|
|
1929
|
+
const e = findLane(n.i);
|
|
1926
1930
|
if (e !== t) {
|
|
1927
1931
|
mergeLanes(t, e);
|
|
1928
1932
|
}
|
|
1929
1933
|
}
|
|
1930
|
-
|
|
1931
|
-
n.
|
|
1934
|
+
R.delete(n);
|
|
1935
|
+
n.i = undefined;
|
|
1932
1936
|
}
|
|
1933
1937
|
}
|
|
1934
1938
|
}
|
|
1935
1939
|
function getLatestValueComputed(e) {
|
|
1936
1940
|
if (!e.qe) {
|
|
1937
|
-
const t =
|
|
1938
|
-
|
|
1939
|
-
const n =
|
|
1940
|
-
|
|
1941
|
-
const r =
|
|
1942
|
-
|
|
1941
|
+
const t = X;
|
|
1942
|
+
X = false;
|
|
1943
|
+
const n = $;
|
|
1944
|
+
$ = false;
|
|
1945
|
+
const r = Y;
|
|
1946
|
+
Y = null;
|
|
1943
1947
|
e.qe = optimisticComputed(() => read(e));
|
|
1944
|
-
e.qe.
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
+
e.qe.t = e;
|
|
1949
|
+
Y = r;
|
|
1950
|
+
$ = n;
|
|
1951
|
+
X = t;
|
|
1948
1952
|
}
|
|
1949
1953
|
return e.qe;
|
|
1950
1954
|
}
|
|
1951
1955
|
function staleValues(e, t = true) {
|
|
1952
|
-
const n =
|
|
1953
|
-
|
|
1956
|
+
const n = U;
|
|
1957
|
+
U = t;
|
|
1954
1958
|
try {
|
|
1955
1959
|
return e();
|
|
1956
1960
|
} finally {
|
|
1957
|
-
|
|
1961
|
+
U = n;
|
|
1958
1962
|
}
|
|
1959
1963
|
}
|
|
1960
1964
|
function latest(e) {
|
|
1961
|
-
const t =
|
|
1962
|
-
|
|
1965
|
+
const t = X;
|
|
1966
|
+
X = true;
|
|
1963
1967
|
try {
|
|
1964
1968
|
return e();
|
|
1965
1969
|
} finally {
|
|
1966
|
-
|
|
1970
|
+
X = t;
|
|
1967
1971
|
}
|
|
1968
1972
|
}
|
|
1969
1973
|
function isPending(e) {
|
|
1970
|
-
const t =
|
|
1971
|
-
const n =
|
|
1972
|
-
const r =
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1974
|
+
const t = $;
|
|
1975
|
+
const n = J;
|
|
1976
|
+
const r = ee;
|
|
1977
|
+
$ = true;
|
|
1978
|
+
J = false;
|
|
1979
|
+
ee = new Set();
|
|
1976
1980
|
const collectPending = () => {
|
|
1977
|
-
|
|
1981
|
+
$ = false;
|
|
1978
1982
|
try {
|
|
1979
|
-
|
|
1980
|
-
if (read(getPendingSignal(e)))
|
|
1983
|
+
ee.forEach(e => {
|
|
1984
|
+
if (read(getPendingSignal(e))) J = true;
|
|
1981
1985
|
});
|
|
1982
1986
|
} finally {
|
|
1983
|
-
|
|
1987
|
+
$ = true;
|
|
1984
1988
|
}
|
|
1985
1989
|
};
|
|
1986
1990
|
try {
|
|
1987
1991
|
e();
|
|
1988
1992
|
collectPending();
|
|
1989
|
-
return
|
|
1993
|
+
return J;
|
|
1990
1994
|
} catch (e) {
|
|
1991
1995
|
collectPending();
|
|
1992
1996
|
if (e instanceof NotReadyError) {
|
|
1993
|
-
if (
|
|
1994
|
-
if (
|
|
1997
|
+
if (J && !(e.source?.ae & b)) return true;
|
|
1998
|
+
if (Y) throw e;
|
|
1995
1999
|
}
|
|
1996
|
-
return
|
|
2000
|
+
return J;
|
|
1997
2001
|
} finally {
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2002
|
+
$ = t;
|
|
2003
|
+
J = n;
|
|
2004
|
+
ee = r;
|
|
2001
2005
|
}
|
|
2002
2006
|
}
|
|
2003
2007
|
function refresh(e) {
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
} finally {
|
|
2013
|
-
Y = t;
|
|
2014
|
-
if (!t) {
|
|
2015
|
-
schedule();
|
|
2016
|
-
}
|
|
2008
|
+
const r = e?.[j];
|
|
2009
|
+
if (!r) {
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
if (typeof r.oe === "function" && !(r.V & (u | a))) {
|
|
2013
|
+
r.V = (r.V & ~t) | n;
|
|
2014
|
+
insertIntoHeap(r, r.V & o ? T : L);
|
|
2015
|
+
schedule();
|
|
2017
2016
|
}
|
|
2018
|
-
}
|
|
2019
|
-
function isRefreshing() {
|
|
2020
|
-
return Y;
|
|
2021
2017
|
}
|
|
2022
2018
|
function createContext(e, t) {
|
|
2023
2019
|
return { id: Symbol(t), defaultValue: e };
|
|
@@ -2049,15 +2045,15 @@ function effect(e, t, n, r) {
|
|
|
2049
2045
|
const s = createEffectNode(e, t, n, i ? v : O, notifyEffectStatus, r);
|
|
2050
2046
|
recompute(s, true);
|
|
2051
2047
|
!r?.defer &&
|
|
2052
|
-
(s.
|
|
2048
|
+
(s.H === v || r?.schedule ? s.F.enqueue(s.H, runEffect.bind(null, s)) : runEffect(s));
|
|
2053
2049
|
}
|
|
2054
2050
|
function notifyEffectStatus(e, t) {
|
|
2055
|
-
const n = e !== undefined ? e : this.
|
|
2056
|
-
const r = t !== undefined ? t : this.
|
|
2051
|
+
const n = e !== undefined ? e : this.ae;
|
|
2052
|
+
const r = t !== undefined ? t : this.fe;
|
|
2057
2053
|
if (n & m) {
|
|
2058
2054
|
let e = r;
|
|
2059
|
-
this.
|
|
2060
|
-
if (this.
|
|
2055
|
+
this.F.notify(this, _, 0);
|
|
2056
|
+
if (this.H === v) {
|
|
2061
2057
|
try {
|
|
2062
2058
|
return this.Ke
|
|
2063
2059
|
? this.Ke(e, () => {
|
|
@@ -2069,38 +2065,38 @@ function notifyEffectStatus(e, t) {
|
|
|
2069
2065
|
e = t;
|
|
2070
2066
|
}
|
|
2071
2067
|
}
|
|
2072
|
-
if (!this.
|
|
2073
|
-
} else if (this.
|
|
2074
|
-
this.
|
|
2068
|
+
if (!this.F.notify(this, m, m)) throw e;
|
|
2069
|
+
} else if (this.H === O) {
|
|
2070
|
+
this.F.notify(this, _ | m, n, r);
|
|
2075
2071
|
}
|
|
2076
2072
|
}
|
|
2077
2073
|
function runEffect(e) {
|
|
2078
|
-
if (!e.
|
|
2074
|
+
if (!e.q || e.V & u) return;
|
|
2079
2075
|
e.Be?.();
|
|
2080
2076
|
e.Be = undefined;
|
|
2081
2077
|
try {
|
|
2082
|
-
const t = e.
|
|
2078
|
+
const t = e.De(e.$, e.Ve);
|
|
2083
2079
|
if (false && t !== undefined && typeof t !== "function");
|
|
2084
2080
|
e.Be = t;
|
|
2085
2081
|
if (e.Be && !e.Ge) {
|
|
2086
2082
|
e.Ge = true;
|
|
2087
|
-
runWithOwner(e.
|
|
2083
|
+
runWithOwner(e.X, () => cleanup(() => e.Be?.()));
|
|
2088
2084
|
}
|
|
2089
2085
|
} catch (t) {
|
|
2090
|
-
e.
|
|
2091
|
-
e.
|
|
2092
|
-
if (!e.
|
|
2086
|
+
e.fe = new StatusError(e, t);
|
|
2087
|
+
e.ae |= m;
|
|
2088
|
+
if (!e.F.notify(e, m, m)) throw t;
|
|
2093
2089
|
} finally {
|
|
2094
|
-
e.
|
|
2095
|
-
e.
|
|
2090
|
+
e.Ve = e.$;
|
|
2091
|
+
e.q = false;
|
|
2096
2092
|
}
|
|
2097
2093
|
}
|
|
2098
|
-
GlobalQueue.
|
|
2094
|
+
GlobalQueue.re = runEffect;
|
|
2099
2095
|
function trackedEffect(e, t) {
|
|
2100
2096
|
const run = () => {
|
|
2101
|
-
if (!n.
|
|
2097
|
+
if (!n.q || n.V & u) return;
|
|
2102
2098
|
try {
|
|
2103
|
-
n.
|
|
2099
|
+
n.q = false;
|
|
2104
2100
|
recompute(n);
|
|
2105
2101
|
} finally {
|
|
2106
2102
|
}
|
|
@@ -2115,23 +2111,23 @@ function trackedEffect(e, t) {
|
|
|
2115
2111
|
{ ...t, lazy: true }
|
|
2116
2112
|
);
|
|
2117
2113
|
n.Be = undefined;
|
|
2118
|
-
n.
|
|
2119
|
-
n.
|
|
2120
|
-
n.
|
|
2114
|
+
n.ue = (n.ue & ~g) | S;
|
|
2115
|
+
n.q = true;
|
|
2116
|
+
n.H = P;
|
|
2121
2117
|
n.Fe = (e, t) => {
|
|
2122
|
-
const r = e !== undefined ? e : n.
|
|
2118
|
+
const r = e !== undefined ? e : n.ae;
|
|
2123
2119
|
if (r & m) {
|
|
2124
|
-
n.
|
|
2125
|
-
const e = t !== undefined ? t : n.
|
|
2126
|
-
if (!n.
|
|
2120
|
+
n.F.notify(n, _, 0);
|
|
2121
|
+
const e = t !== undefined ? t : n.fe;
|
|
2122
|
+
if (!n.F.notify(n, m, m)) throw e;
|
|
2127
2123
|
}
|
|
2128
2124
|
};
|
|
2129
|
-
n.
|
|
2130
|
-
n.
|
|
2125
|
+
n.M = run;
|
|
2126
|
+
n.F.enqueue(v, run);
|
|
2131
2127
|
cleanup(() => n.Be?.());
|
|
2132
2128
|
}
|
|
2133
2129
|
function restoreTransition(e, t) {
|
|
2134
|
-
|
|
2130
|
+
K.initTransition(e);
|
|
2135
2131
|
const n = t();
|
|
2136
2132
|
flush();
|
|
2137
2133
|
return n;
|
|
@@ -2140,13 +2136,13 @@ function action(e) {
|
|
|
2140
2136
|
return (...t) =>
|
|
2141
2137
|
new Promise((n, r) => {
|
|
2142
2138
|
const i = e(...t);
|
|
2143
|
-
|
|
2144
|
-
let s =
|
|
2145
|
-
s.
|
|
2139
|
+
K.initTransition();
|
|
2140
|
+
let s = q;
|
|
2141
|
+
s.B.push(i);
|
|
2146
2142
|
const done = (e, t) => {
|
|
2147
2143
|
s = currentTransition(s);
|
|
2148
|
-
const o = s.
|
|
2149
|
-
if (o >= 0) s.
|
|
2144
|
+
const o = s.B.indexOf(i);
|
|
2145
|
+
if (o >= 0) s.B.splice(o, 1);
|
|
2150
2146
|
setActiveTransition(s);
|
|
2151
2147
|
schedule();
|
|
2152
2148
|
t ? r(t) : n(e);
|
|
@@ -2185,7 +2181,7 @@ function accessor(e) {
|
|
|
2185
2181
|
function createSignal(e, t) {
|
|
2186
2182
|
if (typeof e === "function") {
|
|
2187
2183
|
const n = computed(e, t);
|
|
2188
|
-
n.
|
|
2184
|
+
n.ue &= ~g;
|
|
2189
2185
|
return [accessor(n), setMemo.bind(null, n)];
|
|
2190
2186
|
}
|
|
2191
2187
|
const n = signal(e, t);
|
|
@@ -2242,7 +2238,7 @@ function resolve(e) {
|
|
|
2242
2238
|
function createOptimistic(e, t) {
|
|
2243
2239
|
if (typeof e === "function") {
|
|
2244
2240
|
const n = optimisticComputed(e, t);
|
|
2245
|
-
n.
|
|
2241
|
+
n.ue &= ~g;
|
|
2246
2242
|
return [accessor(n), setSignal.bind(null, n)];
|
|
2247
2243
|
}
|
|
2248
2244
|
const n = optimisticSignal(e, t);
|
|
@@ -2250,15 +2246,15 @@ function createOptimistic(e, t) {
|
|
|
2250
2246
|
}
|
|
2251
2247
|
function onSettled(e) {
|
|
2252
2248
|
const t = getOwner();
|
|
2253
|
-
t && !(t.
|
|
2249
|
+
t && !(t.ue & S)
|
|
2254
2250
|
? createTrackedEffect(() => untrack(e), undefined)
|
|
2255
|
-
:
|
|
2251
|
+
: K.enqueue(v, () => {
|
|
2256
2252
|
const t = e();
|
|
2257
2253
|
t?.();
|
|
2258
2254
|
});
|
|
2259
2255
|
}
|
|
2260
2256
|
function unwrap(e) {
|
|
2261
|
-
return e?.[
|
|
2257
|
+
return e?.[se]?.[ae] ?? e;
|
|
2262
2258
|
}
|
|
2263
2259
|
function getOverrideValue(e, t, n, r) {
|
|
2264
2260
|
if (r && n in r) return r[n];
|
|
@@ -2270,205 +2266,216 @@ function getAllKeys(e, t, n) {
|
|
|
2270
2266
|
return Array.from(new Set([...r, ...i]));
|
|
2271
2267
|
}
|
|
2272
2268
|
function applyState(e, t, n) {
|
|
2273
|
-
const r = t?.[
|
|
2269
|
+
const r = t?.[se];
|
|
2274
2270
|
if (!r) return;
|
|
2275
|
-
if (r[
|
|
2271
|
+
if (r[le] || r[ce]) {
|
|
2276
2272
|
applyStateSlow(e, r, n);
|
|
2277
2273
|
} else {
|
|
2278
2274
|
applyStateFast(e, r, n);
|
|
2279
2275
|
}
|
|
2280
2276
|
}
|
|
2281
2277
|
function applyStateFast(e, t, n) {
|
|
2282
|
-
const r = t[
|
|
2278
|
+
const r = t[fe];
|
|
2283
2279
|
if (e === r) return;
|
|
2284
|
-
|
|
2285
|
-
t[
|
|
2280
|
+
const i = t[ae];
|
|
2281
|
+
(t[ye] || _e).set(e, t[oe]);
|
|
2282
|
+
t[fe] = e;
|
|
2286
2283
|
if (Array.isArray(r)) {
|
|
2287
|
-
let
|
|
2288
|
-
const
|
|
2289
|
-
if (e.length &&
|
|
2290
|
-
let
|
|
2284
|
+
let s = false;
|
|
2285
|
+
const o = r.length;
|
|
2286
|
+
if (e.length && o && e[0] && n(e[0]) != null) {
|
|
2287
|
+
let u, f, l, c, a, d, p, h;
|
|
2291
2288
|
for (
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2289
|
+
l = 0, c = Math.min(o, e.length);
|
|
2290
|
+
l < c && ((d = r[l]) === e[l] || (d && e[l] && n(d) === n(e[l])));
|
|
2291
|
+
l++
|
|
2295
2292
|
) {
|
|
2296
|
-
applyState(e[
|
|
2293
|
+
applyState(e[l], wrap(d, t), n);
|
|
2297
2294
|
}
|
|
2298
|
-
const
|
|
2299
|
-
|
|
2295
|
+
const y = new Array(e.length),
|
|
2296
|
+
S = new Map();
|
|
2300
2297
|
for (
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2298
|
+
c = o - 1, a = e.length - 1;
|
|
2299
|
+
c >= l && a >= l && ((d = r[c]) === e[a] || (d && e[a] && n(d) === n(e[a])));
|
|
2300
|
+
c--, a--
|
|
2304
2301
|
) {
|
|
2305
|
-
|
|
2302
|
+
y[a] = d;
|
|
2306
2303
|
}
|
|
2307
|
-
if (
|
|
2308
|
-
for (
|
|
2309
|
-
|
|
2310
|
-
|
|
2304
|
+
if (l > a || l > c) {
|
|
2305
|
+
for (f = l; f <= a; f++) {
|
|
2306
|
+
s = true;
|
|
2307
|
+
i?.[f] && setSignal(i[f], wrap(e[f], t));
|
|
2311
2308
|
}
|
|
2312
|
-
for (;
|
|
2313
|
-
|
|
2314
|
-
const r = wrap(
|
|
2315
|
-
|
|
2316
|
-
applyState(e[
|
|
2309
|
+
for (; f < e.length; f++) {
|
|
2310
|
+
s = true;
|
|
2311
|
+
const r = wrap(y[f], t);
|
|
2312
|
+
i?.[f] && setSignal(i[f], r);
|
|
2313
|
+
applyState(e[f], r, n);
|
|
2317
2314
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2315
|
+
s && notifySelf(t);
|
|
2316
|
+
o !== e.length && i?.length && setSignal(i.length, e.length);
|
|
2320
2317
|
return;
|
|
2321
2318
|
}
|
|
2322
|
-
|
|
2323
|
-
for (
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
}
|
|
2330
|
-
for (
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
if (
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2319
|
+
p = new Array(a + 1);
|
|
2320
|
+
for (f = a; f >= l; f--) {
|
|
2321
|
+
d = e[f];
|
|
2322
|
+
h = d ? n(d) : d;
|
|
2323
|
+
u = S.get(h);
|
|
2324
|
+
p[f] = u === undefined ? -1 : u;
|
|
2325
|
+
S.set(h, f);
|
|
2326
|
+
}
|
|
2327
|
+
for (u = l; u <= c; u++) {
|
|
2328
|
+
d = r[u];
|
|
2329
|
+
h = d ? n(d) : d;
|
|
2330
|
+
f = S.get(h);
|
|
2331
|
+
if (f !== undefined && f !== -1) {
|
|
2332
|
+
y[f] = d;
|
|
2333
|
+
f = p[f];
|
|
2334
|
+
S.set(h, f);
|
|
2338
2335
|
}
|
|
2339
2336
|
}
|
|
2340
|
-
for (
|
|
2341
|
-
if (
|
|
2342
|
-
const r = wrap(
|
|
2343
|
-
|
|
2344
|
-
applyState(e[
|
|
2345
|
-
} else
|
|
2337
|
+
for (f = l; f < e.length; f++) {
|
|
2338
|
+
if (f in y) {
|
|
2339
|
+
const r = wrap(y[f], t);
|
|
2340
|
+
i?.[f] && setSignal(i[f], r);
|
|
2341
|
+
applyState(e[f], r, n);
|
|
2342
|
+
} else i?.[f] && setSignal(i[f], wrap(e[f], t));
|
|
2346
2343
|
}
|
|
2347
|
-
if (
|
|
2344
|
+
if (l < e.length) s = true;
|
|
2348
2345
|
} else if (e.length) {
|
|
2349
|
-
for (let
|
|
2350
|
-
const
|
|
2351
|
-
isWrappable(
|
|
2346
|
+
for (let o = 0, u = e.length; o < u; o++) {
|
|
2347
|
+
const u = r[o];
|
|
2348
|
+
if (isWrappable(u)) applyState(e[o], wrap(u, t), n);
|
|
2349
|
+
else {
|
|
2350
|
+
if (u !== e[o]) s = true;
|
|
2351
|
+
i?.[o] && setSignal(i[o], e[o]);
|
|
2352
|
+
}
|
|
2352
2353
|
}
|
|
2353
2354
|
}
|
|
2354
|
-
if (
|
|
2355
|
-
|
|
2356
|
-
|
|
2355
|
+
if (o !== e.length) {
|
|
2356
|
+
s = true;
|
|
2357
|
+
i?.length && setSignal(i.length, e.length);
|
|
2357
2358
|
}
|
|
2358
|
-
|
|
2359
|
+
s && notifySelf(t);
|
|
2359
2360
|
return;
|
|
2360
2361
|
}
|
|
2361
|
-
let
|
|
2362
|
-
if (
|
|
2363
|
-
const
|
|
2364
|
-
const o =
|
|
2362
|
+
let s = t[ae];
|
|
2363
|
+
if (s) {
|
|
2364
|
+
const i = s[ie];
|
|
2365
|
+
const o = i ? getAllKeys(r, undefined, e) : Object.keys(s);
|
|
2365
2366
|
for (let u = 0, f = o.length; u < f; u++) {
|
|
2366
2367
|
const f = o[u];
|
|
2367
|
-
const l =
|
|
2368
|
+
const l = s[f];
|
|
2368
2369
|
const c = unwrap(r[f]);
|
|
2369
2370
|
let a = unwrap(e[f]);
|
|
2370
2371
|
if (c === a) continue;
|
|
2371
2372
|
if (!c || !isWrappable(c) || !isWrappable(a) || (n(c) != null && n(c) !== n(a))) {
|
|
2372
|
-
|
|
2373
|
+
i && setSignal(i, void 0);
|
|
2373
2374
|
l && setSignal(l, isWrappable(a) ? wrap(a, t) : a);
|
|
2374
2375
|
} else applyState(a, wrap(c, t), n);
|
|
2375
2376
|
}
|
|
2376
2377
|
}
|
|
2377
|
-
if ((
|
|
2378
|
-
const t = Object.keys(
|
|
2378
|
+
if ((s = t[de])) {
|
|
2379
|
+
const t = Object.keys(s);
|
|
2379
2380
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2380
2381
|
const r = t[n];
|
|
2381
|
-
setSignal(
|
|
2382
|
+
setSignal(s[r], r in e);
|
|
2382
2383
|
}
|
|
2383
2384
|
}
|
|
2384
2385
|
}
|
|
2385
2386
|
function applyStateSlow(e, t, n) {
|
|
2386
|
-
const r = t[
|
|
2387
|
-
const i = t[
|
|
2388
|
-
const s = t[
|
|
2389
|
-
let o = t[
|
|
2390
|
-
(t[
|
|
2391
|
-
t[
|
|
2392
|
-
t[
|
|
2387
|
+
const r = t[fe];
|
|
2388
|
+
const i = t[le];
|
|
2389
|
+
const s = t[ce];
|
|
2390
|
+
let o = t[ae];
|
|
2391
|
+
(t[ye] || _e).set(e, t[oe]);
|
|
2392
|
+
t[fe] = e;
|
|
2393
|
+
t[le] = undefined;
|
|
2393
2394
|
if (Array.isArray(r)) {
|
|
2394
|
-
let
|
|
2395
|
-
const
|
|
2396
|
-
if (e.length &&
|
|
2397
|
-
let
|
|
2395
|
+
let u = false;
|
|
2396
|
+
const f = getOverrideValue(r, i, "length", s);
|
|
2397
|
+
if (e.length && f && e[0] && n(e[0]) != null) {
|
|
2398
|
+
let l, c, a, d, p, h, y, S;
|
|
2398
2399
|
for (
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2400
|
+
a = 0, d = Math.min(f, e.length);
|
|
2401
|
+
a < d && ((h = getOverrideValue(r, i, a, s)) === e[a] || (h && e[a] && n(h) === n(e[a])));
|
|
2402
|
+
a++
|
|
2402
2403
|
) {
|
|
2403
|
-
applyState(e[
|
|
2404
|
+
applyState(e[a], wrap(h, t), n);
|
|
2404
2405
|
}
|
|
2405
|
-
const
|
|
2406
|
-
|
|
2406
|
+
const g = new Array(e.length),
|
|
2407
|
+
w = new Map();
|
|
2407
2408
|
for (
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
((
|
|
2412
|
-
|
|
2409
|
+
d = f - 1, p = e.length - 1;
|
|
2410
|
+
d >= a &&
|
|
2411
|
+
p >= a &&
|
|
2412
|
+
((h = getOverrideValue(r, i, d, s)) === e[p] || (h && e[p] && n(h) === n(e[p])));
|
|
2413
|
+
d--, p--
|
|
2413
2414
|
) {
|
|
2414
|
-
|
|
2415
|
+
g[p] = h;
|
|
2415
2416
|
}
|
|
2416
|
-
if (
|
|
2417
|
-
for (
|
|
2418
|
-
|
|
2419
|
-
|
|
2417
|
+
if (a > p || a > d) {
|
|
2418
|
+
for (c = a; c <= p; c++) {
|
|
2419
|
+
u = true;
|
|
2420
|
+
o?.[c] && setSignal(o[c], wrap(e[c], t));
|
|
2420
2421
|
}
|
|
2421
|
-
for (;
|
|
2422
|
-
|
|
2423
|
-
const r = wrap(
|
|
2424
|
-
|
|
2425
|
-
applyState(e[
|
|
2422
|
+
for (; c < e.length; c++) {
|
|
2423
|
+
u = true;
|
|
2424
|
+
const r = wrap(g[c], t);
|
|
2425
|
+
o?.[c] && setSignal(o[c], r);
|
|
2426
|
+
applyState(e[c], r, n);
|
|
2426
2427
|
}
|
|
2427
|
-
|
|
2428
|
-
u
|
|
2428
|
+
const r = e.length;
|
|
2429
|
+
u && notifySelf(t);
|
|
2430
|
+
f !== r && o?.length && setSignal(o.length, r);
|
|
2429
2431
|
return;
|
|
2430
2432
|
}
|
|
2431
|
-
|
|
2432
|
-
for (
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
}
|
|
2439
|
-
for (
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
if (
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2433
|
+
y = new Array(p + 1);
|
|
2434
|
+
for (c = p; c >= a; c--) {
|
|
2435
|
+
h = e[c];
|
|
2436
|
+
S = h ? n(h) : h;
|
|
2437
|
+
l = w.get(S);
|
|
2438
|
+
y[c] = l === undefined ? -1 : l;
|
|
2439
|
+
w.set(S, c);
|
|
2440
|
+
}
|
|
2441
|
+
for (l = a; l <= d; l++) {
|
|
2442
|
+
h = getOverrideValue(r, i, l, s);
|
|
2443
|
+
S = h ? n(h) : h;
|
|
2444
|
+
c = w.get(S);
|
|
2445
|
+
if (c !== undefined && c !== -1) {
|
|
2446
|
+
g[c] = h;
|
|
2447
|
+
c = y[c];
|
|
2448
|
+
w.set(S, c);
|
|
2447
2449
|
}
|
|
2448
2450
|
}
|
|
2449
|
-
for (
|
|
2450
|
-
if (
|
|
2451
|
-
const r = wrap(
|
|
2452
|
-
|
|
2453
|
-
applyState(e[
|
|
2454
|
-
} else
|
|
2451
|
+
for (c = a; c < e.length; c++) {
|
|
2452
|
+
if (c in g) {
|
|
2453
|
+
const r = wrap(g[c], t);
|
|
2454
|
+
o?.[c] && setSignal(o[c], r);
|
|
2455
|
+
applyState(e[c], r, n);
|
|
2456
|
+
} else o?.[c] && setSignal(o[c], wrap(e[c], t));
|
|
2455
2457
|
}
|
|
2456
|
-
if (
|
|
2458
|
+
if (a < e.length) u = true;
|
|
2457
2459
|
} else if (e.length) {
|
|
2458
|
-
for (let
|
|
2459
|
-
const
|
|
2460
|
-
isWrappable(
|
|
2460
|
+
for (let f = 0, l = e.length; f < l; f++) {
|
|
2461
|
+
const l = getOverrideValue(r, i, f, s);
|
|
2462
|
+
if (isWrappable(l)) applyState(e[f], wrap(l, t), n);
|
|
2463
|
+
else {
|
|
2464
|
+
if (l !== e[f]) u = true;
|
|
2465
|
+
o?.[f] && setSignal(o[f], e[f]);
|
|
2466
|
+
}
|
|
2461
2467
|
}
|
|
2462
2468
|
}
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2469
|
+
const l = e.length;
|
|
2470
|
+
if (f !== l) {
|
|
2471
|
+
u = true;
|
|
2472
|
+
o?.length && setSignal(o.length, l);
|
|
2466
2473
|
}
|
|
2467
|
-
|
|
2474
|
+
u && notifySelf(t);
|
|
2468
2475
|
return;
|
|
2469
2476
|
}
|
|
2470
2477
|
if (o) {
|
|
2471
|
-
const u = o[
|
|
2478
|
+
const u = o[ie];
|
|
2472
2479
|
const f = u ? getAllKeys(r, i, e) : Object.keys(o);
|
|
2473
2480
|
for (let l = 0, c = f.length; l < c; l++) {
|
|
2474
2481
|
const c = f[l];
|
|
@@ -2482,7 +2489,7 @@ function applyStateSlow(e, t, n) {
|
|
|
2482
2489
|
} else applyState(p, wrap(d, t), n);
|
|
2483
2490
|
}
|
|
2484
2491
|
}
|
|
2485
|
-
if ((o = t[
|
|
2492
|
+
if ((o = t[de])) {
|
|
2486
2493
|
const t = Object.keys(o);
|
|
2487
2494
|
for (let n = 0, r = t.length; n < r; n++) {
|
|
2488
2495
|
const r = t[n];
|
|
@@ -2495,7 +2502,7 @@ function reconcile(e, t) {
|
|
|
2495
2502
|
if (n == null) throw new Error("Cannot reconcile null or undefined state");
|
|
2496
2503
|
const r = typeof t === "string" ? e => e[t] : t;
|
|
2497
2504
|
const i = r(n);
|
|
2498
|
-
if (i !== undefined && r(e) !==
|
|
2505
|
+
if (i !== undefined && r(e) !== i)
|
|
2499
2506
|
throw new Error("Cannot reconcile states with different identity");
|
|
2500
2507
|
applyState(e, n, r);
|
|
2501
2508
|
};
|
|
@@ -2504,9 +2511,9 @@ function createProjectionInternal(e, t, n) {
|
|
|
2504
2511
|
let r;
|
|
2505
2512
|
const i = new WeakMap();
|
|
2506
2513
|
const wrapper = e => {
|
|
2507
|
-
e[
|
|
2508
|
-
e[
|
|
2509
|
-
Object.defineProperty(e,
|
|
2514
|
+
e[he] = wrapProjection;
|
|
2515
|
+
e[ye] = i;
|
|
2516
|
+
Object.defineProperty(e, Se, {
|
|
2510
2517
|
get() {
|
|
2511
2518
|
return r;
|
|
2512
2519
|
},
|
|
@@ -2515,8 +2522,8 @@ function createProjectionInternal(e, t, n) {
|
|
|
2515
2522
|
};
|
|
2516
2523
|
const wrapProjection = e => {
|
|
2517
2524
|
if (i.has(e)) return i.get(e);
|
|
2518
|
-
if (e[
|
|
2519
|
-
const t = createStoreProxy(e,
|
|
2525
|
+
if (e[se]?.[he] === wrapProjection) return e;
|
|
2526
|
+
const t = createStoreProxy(e, Oe, wrapper);
|
|
2520
2527
|
i.set(e, t);
|
|
2521
2528
|
return t;
|
|
2522
2529
|
};
|
|
@@ -2525,45 +2532,46 @@ function createProjectionInternal(e, t, n) {
|
|
|
2525
2532
|
if (!r) r = getOwner();
|
|
2526
2533
|
runProjectionComputed(s, e, n?.key || "id");
|
|
2527
2534
|
}, undefined);
|
|
2528
|
-
r.
|
|
2535
|
+
r.ue &= ~g;
|
|
2529
2536
|
return { store: s, node: r };
|
|
2530
2537
|
}
|
|
2531
2538
|
function createProjection(e, t, n) {
|
|
2532
2539
|
return createProjectionInternal(e, t, n).store;
|
|
2533
2540
|
}
|
|
2534
|
-
function runProjectionComputed(e, t, n, r) {
|
|
2535
|
-
const
|
|
2536
|
-
let
|
|
2537
|
-
let
|
|
2538
|
-
const
|
|
2541
|
+
function runProjectionComputed(e, t, n, r, i) {
|
|
2542
|
+
const s = getOwner();
|
|
2543
|
+
let o = false;
|
|
2544
|
+
let u;
|
|
2545
|
+
const f = new Proxy(
|
|
2539
2546
|
e,
|
|
2540
|
-
createWriteTraps(() => !
|
|
2547
|
+
createWriteTraps(() => !o || s.ke === u, i)
|
|
2541
2548
|
);
|
|
2542
|
-
storeSetter(
|
|
2543
|
-
|
|
2544
|
-
|
|
2549
|
+
storeSetter(f, i => {
|
|
2550
|
+
u = t(i);
|
|
2551
|
+
o = true;
|
|
2545
2552
|
const commit = t => {
|
|
2546
|
-
if (t ===
|
|
2553
|
+
if (t === i || t === undefined) return;
|
|
2547
2554
|
const write = () => storeSetter(e, reconcile(t, n));
|
|
2548
2555
|
r ? r(write) : write();
|
|
2549
2556
|
};
|
|
2550
|
-
commit(handleAsync(
|
|
2557
|
+
commit(handleAsync(s, u, commit));
|
|
2551
2558
|
});
|
|
2552
|
-
return
|
|
2559
|
+
return s;
|
|
2553
2560
|
}
|
|
2554
|
-
function createWriteTraps(e) {
|
|
2555
|
-
const
|
|
2556
|
-
get(e,
|
|
2561
|
+
function createWriteTraps(e, t) {
|
|
2562
|
+
const n = {
|
|
2563
|
+
get(e, t) {
|
|
2557
2564
|
let r;
|
|
2558
2565
|
setWriteOverride(true);
|
|
2559
2566
|
setProjectionWriteActive(true);
|
|
2560
2567
|
try {
|
|
2561
|
-
r = e[
|
|
2568
|
+
r = e[t];
|
|
2562
2569
|
} finally {
|
|
2563
2570
|
setWriteOverride(false);
|
|
2564
2571
|
setProjectionWriteActive(false);
|
|
2565
2572
|
}
|
|
2566
|
-
|
|
2573
|
+
if (t === se) return r;
|
|
2574
|
+
return typeof r === "object" && r !== null ? new Proxy(r, n) : r;
|
|
2567
2575
|
},
|
|
2568
2576
|
has(e, t) {
|
|
2569
2577
|
let n;
|
|
@@ -2577,24 +2585,26 @@ function createWriteTraps(e) {
|
|
|
2577
2585
|
}
|
|
2578
2586
|
return n;
|
|
2579
2587
|
},
|
|
2580
|
-
set(
|
|
2588
|
+
set(n, r, i) {
|
|
2581
2589
|
if (e && !e()) return true;
|
|
2582
2590
|
setWriteOverride(true);
|
|
2583
2591
|
setProjectionWriteActive(true);
|
|
2584
2592
|
try {
|
|
2585
|
-
|
|
2593
|
+
n[r] = i;
|
|
2594
|
+
t?.();
|
|
2586
2595
|
} finally {
|
|
2587
2596
|
setWriteOverride(false);
|
|
2588
2597
|
setProjectionWriteActive(false);
|
|
2589
2598
|
}
|
|
2590
2599
|
return true;
|
|
2591
2600
|
},
|
|
2592
|
-
deleteProperty(
|
|
2601
|
+
deleteProperty(n, r) {
|
|
2593
2602
|
if (e && !e()) return true;
|
|
2594
2603
|
setWriteOverride(true);
|
|
2595
2604
|
setProjectionWriteActive(true);
|
|
2596
2605
|
try {
|
|
2597
|
-
delete
|
|
2606
|
+
delete n[r];
|
|
2607
|
+
t?.();
|
|
2598
2608
|
} finally {
|
|
2599
2609
|
setWriteOverride(false);
|
|
2600
2610
|
setProjectionWriteActive(false);
|
|
@@ -2602,68 +2612,86 @@ function createWriteTraps(e) {
|
|
|
2602
2612
|
return true;
|
|
2603
2613
|
}
|
|
2604
2614
|
};
|
|
2605
|
-
return
|
|
2615
|
+
return n;
|
|
2606
2616
|
}
|
|
2607
|
-
const
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
const
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2617
|
+
const ie = Symbol(0),
|
|
2618
|
+
se = Symbol(0),
|
|
2619
|
+
oe = Symbol(0),
|
|
2620
|
+
ue = Symbol(0);
|
|
2621
|
+
const fe = "v",
|
|
2622
|
+
le = "o",
|
|
2623
|
+
ce = "x",
|
|
2624
|
+
ae = "n",
|
|
2625
|
+
de = "h",
|
|
2626
|
+
pe = "c",
|
|
2627
|
+
he = "w",
|
|
2628
|
+
ye = "l",
|
|
2629
|
+
Se = "f",
|
|
2630
|
+
ge = "p";
|
|
2631
|
+
const we = Symbol(0);
|
|
2632
|
+
function createStoreProxy(e, t = Oe, n) {
|
|
2622
2633
|
let r;
|
|
2623
2634
|
if (Array.isArray(e)) {
|
|
2624
2635
|
r = [];
|
|
2625
2636
|
r.v = e;
|
|
2626
2637
|
} else {
|
|
2627
2638
|
r = { v: e };
|
|
2628
|
-
const t = e?.[
|
|
2639
|
+
const t = e?.[se]?.[fe] ?? e;
|
|
2629
2640
|
const n = Object.getPrototypeOf(t);
|
|
2630
2641
|
if (n !== null && n !== Object.prototype) {
|
|
2631
|
-
r[
|
|
2642
|
+
r[pe] = true;
|
|
2632
2643
|
}
|
|
2633
2644
|
}
|
|
2634
2645
|
n && n(r);
|
|
2635
|
-
return (r[
|
|
2646
|
+
return (r[oe] = new Proxy(r, t));
|
|
2636
2647
|
}
|
|
2637
|
-
const
|
|
2648
|
+
const _e = new WeakMap();
|
|
2638
2649
|
function wrap(e, t) {
|
|
2639
|
-
if (t?.[
|
|
2640
|
-
let n = e[
|
|
2641
|
-
if (!n)
|
|
2650
|
+
if (t?.[he]) return t[he](e, t);
|
|
2651
|
+
let n = e[oe] || _e.get(e);
|
|
2652
|
+
if (!n) _e.set(e, (n = createStoreProxy(e)));
|
|
2642
2653
|
return n;
|
|
2643
2654
|
}
|
|
2644
2655
|
function isWrappable(e) {
|
|
2645
2656
|
if (e == null || typeof e !== "object" || Object.isFrozen(e)) return false;
|
|
2646
2657
|
return typeof Node === "undefined" || !(e instanceof Node);
|
|
2647
2658
|
}
|
|
2648
|
-
let
|
|
2659
|
+
let me = false;
|
|
2649
2660
|
function setWriteOverride(e) {
|
|
2650
|
-
|
|
2661
|
+
me = e;
|
|
2651
2662
|
}
|
|
2652
2663
|
function writeOnly(e) {
|
|
2653
|
-
return
|
|
2654
|
-
}
|
|
2655
|
-
function unwrapStoreValue(e) {
|
|
2656
|
-
|
|
2664
|
+
return me || !!be?.has(e);
|
|
2665
|
+
}
|
|
2666
|
+
function unwrapStoreValue(e, t, n) {
|
|
2667
|
+
const r = e?.[se] || n?.get(e)?.[se];
|
|
2668
|
+
if (!r) return e;
|
|
2669
|
+
const i = r[le];
|
|
2670
|
+
if (!i) return r[fe];
|
|
2671
|
+
if (!t) t = new Map();
|
|
2672
|
+
if (t.has(e)) return t.get(e);
|
|
2673
|
+
const s = r[fe];
|
|
2674
|
+
const o = Array.isArray(s);
|
|
2675
|
+
const u = o ? [] : Object.create(Object.getPrototypeOf(s));
|
|
2676
|
+
t.set(e, u);
|
|
2677
|
+
n = r[ye] ?? _e;
|
|
2678
|
+
for (const e of getKeys(s, i)) {
|
|
2679
|
+
if (o && e === "length") continue;
|
|
2680
|
+
const r = e in i ? i[e] : s[e];
|
|
2681
|
+
if (r !== ue) u[e] = unwrapStoreValue(r, t, n);
|
|
2682
|
+
}
|
|
2683
|
+
if (o) u.length = i.length ?? s.length;
|
|
2684
|
+
return u;
|
|
2657
2685
|
}
|
|
2658
2686
|
function isPrototypePollutionKey$1(e) {
|
|
2659
2687
|
return e === "__proto__" || e === "constructor" || e === "prototype";
|
|
2660
2688
|
}
|
|
2661
2689
|
function hasOwnStoreProperty(e, t) {
|
|
2662
|
-
const n = e[
|
|
2663
|
-
if (n && Object.prototype.hasOwnProperty.call(n, t) && n[t] !==
|
|
2664
|
-
const r = e[
|
|
2665
|
-
if (r && Object.prototype.hasOwnProperty.call(r, t) && r[t] !==
|
|
2666
|
-
return Object.prototype.hasOwnProperty.call(unwrapStoreValue(e[
|
|
2690
|
+
const n = e[ce];
|
|
2691
|
+
if (n && Object.prototype.hasOwnProperty.call(n, t) && n[t] !== ue) return true;
|
|
2692
|
+
const r = e[le];
|
|
2693
|
+
if (r && Object.prototype.hasOwnProperty.call(r, t) && r[t] !== ue) return true;
|
|
2694
|
+
return Object.prototype.hasOwnProperty.call(unwrapStoreValue(e[fe]), t);
|
|
2667
2695
|
}
|
|
2668
2696
|
function hasInheritedAccessor(e, t) {
|
|
2669
2697
|
let n = Object.getPrototypeOf(e);
|
|
@@ -2692,17 +2720,21 @@ function getNode(e, t, n, r, i = isEqual, s, o) {
|
|
|
2692
2720
|
r
|
|
2693
2721
|
);
|
|
2694
2722
|
if (s) {
|
|
2695
|
-
u.
|
|
2723
|
+
u.m = x;
|
|
2696
2724
|
}
|
|
2697
2725
|
if (o && t in o) {
|
|
2698
2726
|
const e = o[t];
|
|
2699
|
-
u.
|
|
2700
|
-
|
|
2727
|
+
u.ce = e === undefined ? N : e;
|
|
2728
|
+
ne?.add(u);
|
|
2701
2729
|
}
|
|
2702
2730
|
return (e[t] = u);
|
|
2703
2731
|
}
|
|
2704
|
-
function trackSelf(e, t =
|
|
2705
|
-
getObserver() && read(getNode(getNodes(e,
|
|
2732
|
+
function trackSelf(e, t = ie) {
|
|
2733
|
+
getObserver() && read(getNode(getNodes(e, ae), t, undefined, e[Se], false, e[ge]));
|
|
2734
|
+
}
|
|
2735
|
+
function notifySelf(e) {
|
|
2736
|
+
const t = e[ae]?.[ie];
|
|
2737
|
+
t && setSignal(t, e[ge] && !M ? we : undefined);
|
|
2706
2738
|
}
|
|
2707
2739
|
function getKeys(e, t, n = true) {
|
|
2708
2740
|
const r = untrack(() => (n ? Object.keys(e) : Reflect.ownKeys(e)));
|
|
@@ -2710,60 +2742,60 @@ function getKeys(e, t, n = true) {
|
|
|
2710
2742
|
const i = new Set(r);
|
|
2711
2743
|
const s = Reflect.ownKeys(t);
|
|
2712
2744
|
for (const e of s) {
|
|
2713
|
-
if (t[e] !==
|
|
2745
|
+
if (t[e] !== ue) i.add(e);
|
|
2714
2746
|
else i.delete(e);
|
|
2715
2747
|
}
|
|
2716
2748
|
return Array.from(i);
|
|
2717
2749
|
}
|
|
2718
2750
|
function getPropertyDescriptor(e, t, n) {
|
|
2719
2751
|
if (t && n in t) {
|
|
2720
|
-
if (t[n] ===
|
|
2752
|
+
if (t[n] === ue) return void 0;
|
|
2721
2753
|
const r = Reflect.getOwnPropertyDescriptor(t, n);
|
|
2722
2754
|
if (r?.get || r?.set || !(n in e)) return r;
|
|
2723
2755
|
}
|
|
2724
2756
|
return Reflect.getOwnPropertyDescriptor(e, n);
|
|
2725
2757
|
}
|
|
2726
2758
|
function prepareStoreWrite(e, t, n) {
|
|
2727
|
-
if (e[
|
|
2728
|
-
const t = e[
|
|
2729
|
-
if (t?.
|
|
2730
|
-
|
|
2759
|
+
if (e[ge]) {
|
|
2760
|
+
const t = e[Se];
|
|
2761
|
+
if (t?.h) {
|
|
2762
|
+
K.initTransition(t.h);
|
|
2731
2763
|
}
|
|
2732
2764
|
}
|
|
2733
|
-
const r = e[
|
|
2765
|
+
const r = e[fe];
|
|
2734
2766
|
const i = r[n];
|
|
2735
|
-
if (
|
|
2767
|
+
if (te && typeof n !== "symbol" && !((e[Se]?.ae ?? 0) & _)) {
|
|
2736
2768
|
if (!e[C]) {
|
|
2737
2769
|
e[C] = Object.create(null);
|
|
2738
|
-
|
|
2770
|
+
ne?.add(e);
|
|
2739
2771
|
}
|
|
2740
2772
|
if (!(n in e[C])) {
|
|
2741
2773
|
e[C][n] = i;
|
|
2742
2774
|
}
|
|
2743
2775
|
}
|
|
2744
|
-
const s = e[
|
|
2745
|
-
const o = s ?
|
|
2776
|
+
const s = e[ge] && !M;
|
|
2777
|
+
const o = s ? ce : le;
|
|
2746
2778
|
if (s) trackOptimisticStore(t);
|
|
2747
2779
|
return { base: i, overrideKey: o, state: r };
|
|
2748
2780
|
}
|
|
2749
2781
|
function upsertStoreNode(e, t, n, r, i) {
|
|
2750
2782
|
if (t[n]) return t[n];
|
|
2751
2783
|
const s = isWrappable(r) ? wrap(r, e) : r;
|
|
2752
|
-
const o = getNode(t, n, s, e[
|
|
2784
|
+
const o = getNode(t, n, s, e[Se], isEqual, e[ge], i);
|
|
2753
2785
|
registerTransientStoreNode(o);
|
|
2754
2786
|
return o;
|
|
2755
2787
|
}
|
|
2756
2788
|
function notifyStoreProperty(e, t, n, r, i, s) {
|
|
2757
|
-
const o =
|
|
2789
|
+
const o = M || e[ge];
|
|
2758
2790
|
const u = n !== "delete";
|
|
2759
|
-
const f = e[
|
|
2791
|
+
const f = e[de]?.[t];
|
|
2760
2792
|
if (f) {
|
|
2761
2793
|
setSignal(f, u);
|
|
2762
2794
|
} else if (!o && n !== "invalidate" && s !== u) {
|
|
2763
|
-
const n = upsertStoreNode(e, getNodes(e,
|
|
2795
|
+
const n = upsertStoreNode(e, getNodes(e, de), t, s);
|
|
2764
2796
|
setSignal(n, u);
|
|
2765
2797
|
}
|
|
2766
|
-
const l = getNodes(e,
|
|
2798
|
+
const l = getNodes(e, ae);
|
|
2767
2799
|
if (n === "set") {
|
|
2768
2800
|
if (l[t]) {
|
|
2769
2801
|
setSignal(l[t], () => (isWrappable(r) ? wrap(r, e) : r));
|
|
@@ -2784,107 +2816,109 @@ function notifyStoreProperty(e, t, n, r, i, s) {
|
|
|
2784
2816
|
setSignal(n, undefined);
|
|
2785
2817
|
}
|
|
2786
2818
|
}
|
|
2787
|
-
|
|
2819
|
+
notifySelf(e);
|
|
2788
2820
|
}
|
|
2789
|
-
let
|
|
2790
|
-
const
|
|
2821
|
+
let be = null;
|
|
2822
|
+
const Oe = {
|
|
2791
2823
|
get(e, t, n) {
|
|
2792
|
-
if (t ===
|
|
2793
|
-
if (t ===
|
|
2794
|
-
if (t === j) return e[
|
|
2795
|
-
if (t ===
|
|
2824
|
+
if (t === se) return e;
|
|
2825
|
+
if (t === oe) return n;
|
|
2826
|
+
if (t === j) return e[Se];
|
|
2827
|
+
if (t === ie) {
|
|
2796
2828
|
trackSelf(e);
|
|
2797
2829
|
return n;
|
|
2798
2830
|
}
|
|
2799
|
-
const r =
|
|
2800
|
-
const i =
|
|
2801
|
-
const s =
|
|
2831
|
+
const r = getObserver() === e[Se];
|
|
2832
|
+
const i = getNodes(e, ae);
|
|
2833
|
+
const s = r ? undefined : i[t];
|
|
2834
|
+
const o = e[fe];
|
|
2802
2835
|
if (
|
|
2803
|
-
!
|
|
2836
|
+
!s &&
|
|
2837
|
+
!e[le] &&
|
|
2838
|
+
!e[ce] &&
|
|
2804
2839
|
!e[pe] &&
|
|
2805
|
-
!e[he] &&
|
|
2806
2840
|
!e[ge] &&
|
|
2807
|
-
!e[be] &&
|
|
2808
2841
|
!e[C] &&
|
|
2809
|
-
!
|
|
2810
|
-
!(t in
|
|
2842
|
+
!o[se] &&
|
|
2843
|
+
!(t in o) &&
|
|
2811
2844
|
getObserver() &&
|
|
2845
|
+
!r &&
|
|
2812
2846
|
!writeOnly(n)
|
|
2813
2847
|
) {
|
|
2814
|
-
return read(getNode(
|
|
2815
|
-
}
|
|
2816
|
-
const
|
|
2817
|
-
const
|
|
2818
|
-
const
|
|
2819
|
-
const
|
|
2820
|
-
if (!
|
|
2821
|
-
const r = Object.getOwnPropertyDescriptor(
|
|
2848
|
+
return read(getNode(i, t, undefined, e[Se]));
|
|
2849
|
+
}
|
|
2850
|
+
const u = e[ce] && t in e[ce];
|
|
2851
|
+
const f = u || (e[le] && t in e[le]);
|
|
2852
|
+
const l = !!e[fe][se];
|
|
2853
|
+
const c = u ? e[ce] : e[le] && t in e[le] ? e[le] : e[fe];
|
|
2854
|
+
if (!s) {
|
|
2855
|
+
const r = Object.getOwnPropertyDescriptor(c, t);
|
|
2822
2856
|
if (r && r.get) return r.get.call(n);
|
|
2823
|
-
if (!r && !
|
|
2824
|
-
const e = unwrapStoreValue(
|
|
2857
|
+
if (!r && !f && e[pe]) {
|
|
2858
|
+
const e = unwrapStoreValue(c);
|
|
2825
2859
|
if (hasInheritedAccessor(e, t)) {
|
|
2826
|
-
return Reflect.get(
|
|
2860
|
+
return Reflect.get(c, t, n);
|
|
2827
2861
|
}
|
|
2828
2862
|
}
|
|
2829
2863
|
}
|
|
2830
2864
|
if (writeOnly(n)) {
|
|
2831
2865
|
if (isPrototypePollutionKey$1(t) && !hasOwnStoreProperty(e, t)) return undefined;
|
|
2832
2866
|
let n =
|
|
2833
|
-
|
|
2834
|
-
n ===
|
|
2867
|
+
s && (f || !l) ? (s.m !== undefined && s.m !== x ? s.m : s.A !== x ? s.A : s.$) : c[t];
|
|
2868
|
+
n === ue && (n = undefined);
|
|
2835
2869
|
if (!isWrappable(n)) return n;
|
|
2836
2870
|
const r = wrap(n, e);
|
|
2837
|
-
|
|
2871
|
+
be?.add(r);
|
|
2838
2872
|
return r;
|
|
2839
2873
|
}
|
|
2840
|
-
let
|
|
2841
|
-
|
|
2842
|
-
if (!
|
|
2843
|
-
if (!
|
|
2874
|
+
let a = s ? (f || !l ? read(i[t]) : (read(i[t]), c[t])) : c[t];
|
|
2875
|
+
a === ue && (a = undefined);
|
|
2876
|
+
if (!s) {
|
|
2877
|
+
if (!f && typeof a === "function" && !c.hasOwnProperty(t)) {
|
|
2844
2878
|
let t;
|
|
2845
|
-
return !Array.isArray(e[
|
|
2846
|
-
?
|
|
2847
|
-
:
|
|
2848
|
-
} else if (getObserver()) {
|
|
2849
|
-
return read(getNode(
|
|
2879
|
+
return !Array.isArray(e[fe]) && (t = Object.getPrototypeOf(e[fe])) && t !== Object.prototype
|
|
2880
|
+
? a.bind(c)
|
|
2881
|
+
: a;
|
|
2882
|
+
} else if (getObserver() && !r) {
|
|
2883
|
+
return read(getNode(i, t, isWrappable(a) ? wrap(a, e) : a, e[Se], isEqual, e[ge], e[C]));
|
|
2850
2884
|
}
|
|
2851
2885
|
}
|
|
2852
|
-
return isWrappable(
|
|
2886
|
+
return isWrappable(a) ? wrap(a, e) : a;
|
|
2853
2887
|
},
|
|
2854
2888
|
has(e, t) {
|
|
2855
|
-
if (t ===
|
|
2889
|
+
if (t === oe || t === ie || t === "__proto__") return true;
|
|
2856
2890
|
const n =
|
|
2857
|
-
e[
|
|
2858
|
-
if (writeOnly(e[
|
|
2859
|
-
const r = getNodes(e,
|
|
2891
|
+
e[ce] && t in e[ce] ? e[ce][t] !== ue : e[le] && t in e[le] ? e[le][t] !== ue : t in e[fe];
|
|
2892
|
+
if (writeOnly(e[oe]) || getObserver() === e[Se]) return n;
|
|
2893
|
+
const r = getNodes(e, de);
|
|
2860
2894
|
if (r[t]) return read(r[t]);
|
|
2861
2895
|
if (getObserver()) {
|
|
2862
|
-
return read(getNode(r, t, n, e[
|
|
2896
|
+
return read(getNode(r, t, n, e[Se], isEqual, e[ge]));
|
|
2863
2897
|
}
|
|
2864
2898
|
return n;
|
|
2865
2899
|
},
|
|
2866
2900
|
set(e, t, n) {
|
|
2867
2901
|
if (t === "__proto__") return true;
|
|
2868
|
-
const r = e[
|
|
2902
|
+
const r = e[oe];
|
|
2869
2903
|
if (writeOnly(r)) {
|
|
2870
2904
|
untrack(() => {
|
|
2871
2905
|
const { base: i, overrideKey: s, state: o } = prepareStoreWrite(e, r, t);
|
|
2872
|
-
const u = e[
|
|
2906
|
+
const u = e[ce] && t in e[ce] ? e[ce][t] : e[le] && t in e[le] ? e[le][t] : i;
|
|
2873
2907
|
const f =
|
|
2874
|
-
e[
|
|
2875
|
-
? e[
|
|
2876
|
-
: e[
|
|
2877
|
-
? e[
|
|
2878
|
-
: t in e[
|
|
2908
|
+
e[ce] && t in e[ce]
|
|
2909
|
+
? e[ce][t] !== ue
|
|
2910
|
+
: e[le] && t in e[le]
|
|
2911
|
+
? e[le][t] !== ue
|
|
2912
|
+
: t in e[fe];
|
|
2879
2913
|
const l = unwrapStoreValue(n);
|
|
2880
2914
|
const c = Array.isArray(o) && t !== "length";
|
|
2881
2915
|
const a = c ? parseInt(t) + 1 : 0;
|
|
2882
2916
|
const d =
|
|
2883
2917
|
c &&
|
|
2884
|
-
(e[
|
|
2885
|
-
? e[
|
|
2886
|
-
: e[
|
|
2887
|
-
? e[
|
|
2918
|
+
(e[ce] && "length" in e[ce]
|
|
2919
|
+
? e[ce].length
|
|
2920
|
+
: e[le] && "length" in e[le]
|
|
2921
|
+
? e[le].length
|
|
2888
2922
|
: o.length);
|
|
2889
2923
|
const p = c && a > d ? a : undefined;
|
|
2890
2924
|
if (u === l && p === undefined) return true;
|
|
@@ -2896,10 +2930,10 @@ const xe = {
|
|
|
2896
2930
|
}
|
|
2897
2931
|
notifyStoreProperty(e, t, "set", l, u, f);
|
|
2898
2932
|
if (Array.isArray(o) && t !== "length" && p !== undefined) {
|
|
2899
|
-
const t = getNodes(e,
|
|
2933
|
+
const t = getNodes(e, ae);
|
|
2900
2934
|
if (t.length) {
|
|
2901
2935
|
setSignal(t.length, p);
|
|
2902
|
-
} else if (!
|
|
2936
|
+
} else if (!M && !e[ge]) {
|
|
2903
2937
|
const n = upsertStoreNode(e, t, "length", d, e[C]);
|
|
2904
2938
|
setSignal(n, p);
|
|
2905
2939
|
}
|
|
@@ -2911,7 +2945,7 @@ const xe = {
|
|
|
2911
2945
|
},
|
|
2912
2946
|
defineProperty(e, t, n) {
|
|
2913
2947
|
if (t === "__proto__") return true;
|
|
2914
|
-
const r = e[
|
|
2948
|
+
const r = e[oe];
|
|
2915
2949
|
if (writeOnly(r)) {
|
|
2916
2950
|
untrack(() => {
|
|
2917
2951
|
const { base: i, overrideKey: s } = prepareStoreWrite(e, r, t);
|
|
@@ -2925,16 +2959,16 @@ const xe = {
|
|
|
2925
2959
|
},
|
|
2926
2960
|
deleteProperty(e, t) {
|
|
2927
2961
|
if (t === "__proto__") return true;
|
|
2928
|
-
const n = e[
|
|
2929
|
-
const r = e[
|
|
2930
|
-
if (writeOnly(e[
|
|
2962
|
+
const n = e[ce]?.[t] === ue;
|
|
2963
|
+
const r = e[le]?.[t] === ue;
|
|
2964
|
+
if (writeOnly(e[oe]) && !n && !r) {
|
|
2931
2965
|
untrack(() => {
|
|
2932
|
-
const n = e[
|
|
2933
|
-
const r = n ?
|
|
2934
|
-
if (n) trackOptimisticStore(e[
|
|
2935
|
-
const i = e[
|
|
2936
|
-
if (t in e[
|
|
2937
|
-
(e[r] || (e[r] = Object.create(null)))[t] =
|
|
2966
|
+
const n = e[ge] && !M;
|
|
2967
|
+
const r = n ? ce : le;
|
|
2968
|
+
if (n) trackOptimisticStore(e[oe]);
|
|
2969
|
+
const i = e[ce] && t in e[ce] ? e[ce][t] : e[le] && t in e[le] ? e[le][t] : e[fe][t];
|
|
2970
|
+
if (t in e[fe] || (e[le] && t in e[le])) {
|
|
2971
|
+
(e[r] || (e[r] = Object.create(null)))[t] = ue;
|
|
2938
2972
|
} else if (e[r] && t in e[r]) {
|
|
2939
2973
|
delete e[r][t];
|
|
2940
2974
|
} else return true;
|
|
@@ -2944,12 +2978,12 @@ const xe = {
|
|
|
2944
2978
|
return true;
|
|
2945
2979
|
},
|
|
2946
2980
|
ownKeys(e) {
|
|
2947
|
-
trackSelf(e);
|
|
2948
|
-
let t = getKeys(e[
|
|
2949
|
-
if (e[
|
|
2981
|
+
if (getObserver() !== e[Se]) trackSelf(e);
|
|
2982
|
+
let t = getKeys(e[fe], e[le], false);
|
|
2983
|
+
if (e[ce]) {
|
|
2950
2984
|
const n = new Set(t);
|
|
2951
|
-
for (const t of Reflect.ownKeys(e[
|
|
2952
|
-
if (e[
|
|
2985
|
+
for (const t of Reflect.ownKeys(e[ce])) {
|
|
2986
|
+
if (e[ce][t] !== ue) n.add(t);
|
|
2953
2987
|
else n.delete(t);
|
|
2954
2988
|
}
|
|
2955
2989
|
t = Array.from(n);
|
|
@@ -2957,27 +2991,27 @@ const xe = {
|
|
|
2957
2991
|
return t;
|
|
2958
2992
|
},
|
|
2959
2993
|
getOwnPropertyDescriptor(e, t) {
|
|
2960
|
-
if (t ===
|
|
2961
|
-
if (e[
|
|
2962
|
-
if (e[
|
|
2963
|
-
const n = Reflect.getOwnPropertyDescriptor(e[
|
|
2964
|
-
if (n?.get || n?.set || !(t in e[
|
|
2965
|
-
const r = getPropertyDescriptor(e[
|
|
2994
|
+
if (t === oe) return { value: e[oe], writable: true, configurable: true };
|
|
2995
|
+
if (e[ce] && t in e[ce]) {
|
|
2996
|
+
if (e[ce][t] === ue) return undefined;
|
|
2997
|
+
const n = Reflect.getOwnPropertyDescriptor(e[ce], t);
|
|
2998
|
+
if (n?.get || n?.set || !(t in e[fe])) return n;
|
|
2999
|
+
const r = getPropertyDescriptor(e[fe], e[le], t);
|
|
2966
3000
|
if (r) {
|
|
2967
|
-
return { ...r, value: e[
|
|
3001
|
+
return { ...r, value: e[ce][t] };
|
|
2968
3002
|
}
|
|
2969
|
-
return { value: e[
|
|
3003
|
+
return { value: e[ce][t], writable: true, enumerable: true, configurable: true };
|
|
2970
3004
|
}
|
|
2971
|
-
return getPropertyDescriptor(e[
|
|
3005
|
+
return getPropertyDescriptor(e[fe], e[le], t);
|
|
2972
3006
|
},
|
|
2973
3007
|
getPrototypeOf(e) {
|
|
2974
|
-
return Object.getPrototypeOf(e[
|
|
3008
|
+
return Object.getPrototypeOf(e[fe]);
|
|
2975
3009
|
}
|
|
2976
3010
|
};
|
|
2977
3011
|
function storeSetter(e, t) {
|
|
2978
|
-
const n =
|
|
2979
|
-
|
|
2980
|
-
|
|
3012
|
+
const n = be;
|
|
3013
|
+
be = new Set();
|
|
3014
|
+
be.add(e);
|
|
2981
3015
|
try {
|
|
2982
3016
|
const n = t(e);
|
|
2983
3017
|
if (n !== e && n !== undefined) {
|
|
@@ -2993,8 +3027,8 @@ function storeSetter(e, t) {
|
|
|
2993
3027
|
}
|
|
2994
3028
|
}
|
|
2995
3029
|
} finally {
|
|
2996
|
-
|
|
2997
|
-
|
|
3030
|
+
be.clear();
|
|
3031
|
+
be = n;
|
|
2998
3032
|
}
|
|
2999
3033
|
}
|
|
3000
3034
|
function createStore(e, t, n) {
|
|
@@ -3002,11 +3036,16 @@ function createStore(e, t, n) {
|
|
|
3002
3036
|
i = r ? createProjectionInternal(e, t, n).store : wrap(e);
|
|
3003
3037
|
return [
|
|
3004
3038
|
i,
|
|
3005
|
-
r
|
|
3039
|
+
r
|
|
3040
|
+
? e => {
|
|
3041
|
+
suppressComputedRecompute(i[j]);
|
|
3042
|
+
storeSetter(i, e);
|
|
3043
|
+
}
|
|
3044
|
+
: e => storeSetter(i, e)
|
|
3006
3045
|
];
|
|
3007
3046
|
}
|
|
3008
3047
|
function createOptimisticStore(e, t, n) {
|
|
3009
|
-
GlobalQueue.
|
|
3048
|
+
GlobalQueue.ie ||= clearOptimisticStore;
|
|
3010
3049
|
const r = typeof e === "function";
|
|
3011
3050
|
const i = r ? t : e;
|
|
3012
3051
|
const s = r ? e : undefined;
|
|
@@ -3014,39 +3053,53 @@ function createOptimisticStore(e, t, n) {
|
|
|
3014
3053
|
return [o, e => storeSetter(o, e)];
|
|
3015
3054
|
}
|
|
3016
3055
|
function clearOptimisticStore(e) {
|
|
3017
|
-
const t = e[
|
|
3018
|
-
if (!t || !t[
|
|
3019
|
-
|
|
3020
|
-
|
|
3056
|
+
const t = e[se];
|
|
3057
|
+
if (!t || !t[ce]) return;
|
|
3058
|
+
clearOptimisticOverride(t);
|
|
3059
|
+
}
|
|
3060
|
+
function clearOptimisticOverride(e) {
|
|
3061
|
+
const t = e[ce];
|
|
3062
|
+
if (!t) return;
|
|
3063
|
+
const n = e[ae];
|
|
3064
|
+
delete e[ce];
|
|
3065
|
+
const r = M;
|
|
3021
3066
|
setProjectionWriteActive(true);
|
|
3022
3067
|
try {
|
|
3023
|
-
if (
|
|
3024
|
-
for (const
|
|
3025
|
-
if (r
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
const i =
|
|
3029
|
-
|
|
3068
|
+
if (n) {
|
|
3069
|
+
for (const r of Reflect.ownKeys(t)) {
|
|
3070
|
+
if (n[r]) {
|
|
3071
|
+
const t = n[r];
|
|
3072
|
+
t.i = undefined;
|
|
3073
|
+
const i = e[le] && r in e[le] ? e[le][r] : e[fe][r];
|
|
3074
|
+
const s = i === ue ? undefined : i;
|
|
3075
|
+
const o = isWrappable(s) ? wrap(s, e) : s;
|
|
3076
|
+
const u = t.m !== undefined && t.m !== x ? t.m : t.A !== x ? t.A : t.$;
|
|
3077
|
+
t.m = x;
|
|
3078
|
+
t.A = x;
|
|
3079
|
+
t.$ = o;
|
|
3080
|
+
if (!t.He || !t.He(u, o)) {
|
|
3081
|
+
insertSubs(t, true);
|
|
3082
|
+
schedule();
|
|
3083
|
+
}
|
|
3030
3084
|
}
|
|
3031
3085
|
}
|
|
3032
|
-
if (
|
|
3033
|
-
|
|
3034
|
-
|
|
3086
|
+
if (n[ie]) {
|
|
3087
|
+
n[ie].i = undefined;
|
|
3088
|
+
notifySelf(e);
|
|
3035
3089
|
}
|
|
3036
3090
|
}
|
|
3037
3091
|
} finally {
|
|
3038
|
-
setProjectionWriteActive(
|
|
3092
|
+
setProjectionWriteActive(r);
|
|
3039
3093
|
}
|
|
3040
|
-
delete t[he];
|
|
3041
3094
|
}
|
|
3042
3095
|
function createOptimisticProjectionInternal(e, t, n) {
|
|
3043
3096
|
let r;
|
|
3044
3097
|
const i = new WeakMap();
|
|
3045
3098
|
const wrapper = e => {
|
|
3046
|
-
e[
|
|
3047
|
-
e[
|
|
3048
|
-
e[
|
|
3049
|
-
Object.defineProperty(e,
|
|
3099
|
+
e[he] = wrapProjection;
|
|
3100
|
+
e[ye] = i;
|
|
3101
|
+
e[ge] = true;
|
|
3102
|
+
Object.defineProperty(e, Se, {
|
|
3050
3103
|
get() {
|
|
3051
3104
|
return r;
|
|
3052
3105
|
},
|
|
@@ -3055,34 +3108,40 @@ function createOptimisticProjectionInternal(e, t, n) {
|
|
|
3055
3108
|
};
|
|
3056
3109
|
const wrapProjection = e => {
|
|
3057
3110
|
if (i.has(e)) return i.get(e);
|
|
3058
|
-
if (e[
|
|
3059
|
-
const t = createStoreProxy(e,
|
|
3111
|
+
if (e[se]?.[he] === wrapProjection) return e;
|
|
3112
|
+
const t = createStoreProxy(e, Oe, wrapper);
|
|
3060
3113
|
i.set(e, t);
|
|
3061
3114
|
return t;
|
|
3062
3115
|
};
|
|
3063
3116
|
const s = wrapProjection(t);
|
|
3064
3117
|
if (e) {
|
|
3118
|
+
const clearProjectionOverride = () => {
|
|
3119
|
+
const e = s[se];
|
|
3120
|
+
if (e?.[ce]) clearOptimisticOverride(e);
|
|
3121
|
+
};
|
|
3065
3122
|
const wrapCommit = e => {
|
|
3123
|
+
const t = M;
|
|
3066
3124
|
setProjectionWriteActive(true);
|
|
3067
3125
|
try {
|
|
3068
3126
|
e();
|
|
3127
|
+
clearProjectionOverride();
|
|
3069
3128
|
} finally {
|
|
3070
|
-
setProjectionWriteActive(
|
|
3129
|
+
setProjectionWriteActive(t);
|
|
3071
3130
|
}
|
|
3072
3131
|
};
|
|
3073
3132
|
r = computed(() => {
|
|
3074
3133
|
setProjectionWriteActive(true);
|
|
3075
3134
|
try {
|
|
3076
|
-
runProjectionComputed(s, e, n?.key || "id", wrapCommit);
|
|
3135
|
+
runProjectionComputed(s, e, n?.key || "id", wrapCommit, clearProjectionOverride);
|
|
3077
3136
|
} finally {
|
|
3078
3137
|
setProjectionWriteActive(false);
|
|
3079
3138
|
}
|
|
3080
3139
|
}, undefined);
|
|
3081
|
-
r.
|
|
3140
|
+
r.ue &= ~g;
|
|
3082
3141
|
}
|
|
3083
3142
|
return { store: s, node: r };
|
|
3084
3143
|
}
|
|
3085
|
-
const
|
|
3144
|
+
const ve = Symbol(0);
|
|
3086
3145
|
function isPrototypePollutionKey(e) {
|
|
3087
3146
|
return e === "__proto__" || e === "constructor" || e === "prototype";
|
|
3088
3147
|
}
|
|
@@ -3130,7 +3189,7 @@ function updatePath(e, t, n = 0) {
|
|
|
3130
3189
|
if (s === i) return;
|
|
3131
3190
|
}
|
|
3132
3191
|
if (r === undefined && s == undefined) return;
|
|
3133
|
-
if (s ===
|
|
3192
|
+
if (s === ve) {
|
|
3134
3193
|
delete e[r];
|
|
3135
3194
|
} else if (r === undefined || (isWrappable(i) && isWrappable(s) && !Array.isArray(s))) {
|
|
3136
3195
|
const t = r !== undefined ? e[r] : e;
|
|
@@ -3146,35 +3205,35 @@ function updatePath(e, t, n = 0) {
|
|
|
3146
3205
|
e[r] = s;
|
|
3147
3206
|
}
|
|
3148
3207
|
}
|
|
3149
|
-
const
|
|
3208
|
+
const Pe = Object.assign(
|
|
3150
3209
|
function storePath(...e) {
|
|
3151
3210
|
return t => {
|
|
3152
3211
|
updatePath(t, e);
|
|
3153
3212
|
};
|
|
3154
3213
|
},
|
|
3155
|
-
{ DELETE:
|
|
3214
|
+
{ DELETE: ve }
|
|
3156
3215
|
);
|
|
3157
3216
|
function snapshotImpl(e, t, n, r) {
|
|
3158
3217
|
let i, s, o, u, f, l;
|
|
3159
3218
|
if (!isWrappable(e)) return e;
|
|
3160
3219
|
if (n && n.has(e)) return n.get(e);
|
|
3161
3220
|
if (!n) n = new Map();
|
|
3162
|
-
if ((i = e[
|
|
3163
|
-
if (t) trackSelf(i,
|
|
3164
|
-
o = i[
|
|
3165
|
-
s = Array.isArray(i[
|
|
3166
|
-
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[
|
|
3167
|
-
e = i[
|
|
3168
|
-
r =
|
|
3221
|
+
if ((i = e[se] || r?.get(e)?.[se])) {
|
|
3222
|
+
if (t) trackSelf(i, ie);
|
|
3223
|
+
o = i[le];
|
|
3224
|
+
s = Array.isArray(i[fe]);
|
|
3225
|
+
n.set(e, o ? (u = s ? [] : Object.create(Object.getPrototypeOf(i[fe]))) : i[fe]);
|
|
3226
|
+
e = i[fe];
|
|
3227
|
+
r = i[ye] ?? _e;
|
|
3169
3228
|
} else {
|
|
3170
3229
|
s = Array.isArray(e);
|
|
3171
3230
|
n.set(e, e);
|
|
3172
3231
|
}
|
|
3173
3232
|
if (s) {
|
|
3174
|
-
const s = o?.length
|
|
3233
|
+
const s = o?.length ?? e.length;
|
|
3175
3234
|
for (let c = 0; c < s; c++) {
|
|
3176
3235
|
l = o && c in o ? o[c] : e[c];
|
|
3177
|
-
if (l ===
|
|
3236
|
+
if (l === ue) continue;
|
|
3178
3237
|
if (t && isWrappable(l)) wrap(l, i);
|
|
3179
3238
|
if ((f = snapshotImpl(l, t, n, r)) !== l || u) {
|
|
3180
3239
|
if (!u) n.set(e, (u = [...e]));
|
|
@@ -3209,13 +3268,13 @@ function deep(e) {
|
|
|
3209
3268
|
function trueFn() {
|
|
3210
3269
|
return true;
|
|
3211
3270
|
}
|
|
3212
|
-
const
|
|
3271
|
+
const xe = {
|
|
3213
3272
|
get(e, t, n) {
|
|
3214
|
-
if (t ===
|
|
3273
|
+
if (t === oe) return n;
|
|
3215
3274
|
return e.get(t);
|
|
3216
3275
|
},
|
|
3217
3276
|
has(e, t) {
|
|
3218
|
-
if (t ===
|
|
3277
|
+
if (t === oe) return true;
|
|
3219
3278
|
return e.has(t);
|
|
3220
3279
|
},
|
|
3221
3280
|
set: trueFn,
|
|
@@ -3238,15 +3297,15 @@ const Ee = {
|
|
|
3238
3297
|
function resolveSource(e) {
|
|
3239
3298
|
return !(e = typeof e === "function" ? e() : e) ? {} : e;
|
|
3240
3299
|
}
|
|
3241
|
-
const
|
|
3300
|
+
const Ne = Symbol(0);
|
|
3242
3301
|
function merge(...e) {
|
|
3243
3302
|
if (e.length === 1 && typeof e[0] !== "function") return e[0];
|
|
3244
3303
|
let t = false;
|
|
3245
3304
|
const n = [];
|
|
3246
3305
|
for (let r = 0; r < e.length; r++) {
|
|
3247
3306
|
const i = e[r];
|
|
3248
|
-
t = t || (!!i &&
|
|
3249
|
-
const s = !!i && i[
|
|
3307
|
+
t = t || (!!i && oe in i);
|
|
3308
|
+
const s = !!i && i[Ne];
|
|
3250
3309
|
if (s) {
|
|
3251
3310
|
for (let e = 0; e < s.length; e++) n.push(s[e]);
|
|
3252
3311
|
} else n.push(typeof i === "function" ? ((t = true), createMemo(i)) : i);
|
|
@@ -3255,7 +3314,7 @@ function merge(...e) {
|
|
|
3255
3314
|
return new Proxy(
|
|
3256
3315
|
{
|
|
3257
3316
|
get(e) {
|
|
3258
|
-
if (e ===
|
|
3317
|
+
if (e === Ne) return n;
|
|
3259
3318
|
for (let t = n.length - 1; t >= 0; t--) {
|
|
3260
3319
|
const r = resolveSource(n[t]);
|
|
3261
3320
|
if (e in r) return r[e];
|
|
@@ -3276,7 +3335,7 @@ function merge(...e) {
|
|
|
3276
3335
|
return [...e];
|
|
3277
3336
|
}
|
|
3278
3337
|
},
|
|
3279
|
-
|
|
3338
|
+
xe
|
|
3280
3339
|
);
|
|
3281
3340
|
}
|
|
3282
3341
|
const r = Object.create(null);
|
|
@@ -3308,11 +3367,11 @@ function merge(...e) {
|
|
|
3308
3367
|
if (n.get) Object.defineProperty(o, t, n);
|
|
3309
3368
|
else o[t] = n.value;
|
|
3310
3369
|
}
|
|
3311
|
-
o[
|
|
3370
|
+
o[Ne] = n;
|
|
3312
3371
|
return o;
|
|
3313
3372
|
}
|
|
3314
3373
|
function omit(e, ...t) {
|
|
3315
|
-
if (E &&
|
|
3374
|
+
if (E && oe in e) {
|
|
3316
3375
|
return new Proxy(
|
|
3317
3376
|
{
|
|
3318
3377
|
get(n) {
|
|
@@ -3325,7 +3384,7 @@ function omit(e, ...t) {
|
|
|
3325
3384
|
return Object.keys(e).filter(e => !t.includes(e));
|
|
3326
3385
|
}
|
|
3327
3386
|
},
|
|
3328
|
-
|
|
3387
|
+
xe
|
|
3329
3388
|
);
|
|
3330
3389
|
}
|
|
3331
3390
|
const n = {};
|
|
@@ -3360,33 +3419,33 @@ function mapArray(e, t, n) {
|
|
|
3360
3419
|
st: n?.fallback
|
|
3361
3420
|
};
|
|
3362
3421
|
const u = computed(updateKeyedMap.bind(o));
|
|
3363
|
-
o.Ue.
|
|
3364
|
-
u.
|
|
3422
|
+
o.Ue.be = u;
|
|
3423
|
+
u.ue &= ~g;
|
|
3365
3424
|
return accessor(u);
|
|
3366
3425
|
}
|
|
3367
|
-
const
|
|
3426
|
+
const Ce = { ownedWrite: true };
|
|
3368
3427
|
function updateKeyedMap() {
|
|
3369
3428
|
const e = this.Je() || [],
|
|
3370
3429
|
t = e.length;
|
|
3371
|
-
e[
|
|
3430
|
+
e[ie];
|
|
3372
3431
|
runWithOwner(this.Ue, () => {
|
|
3373
3432
|
let n,
|
|
3374
3433
|
r,
|
|
3375
3434
|
i = this.nt
|
|
3376
3435
|
? this.it
|
|
3377
3436
|
? () => {
|
|
3378
|
-
this.nt[r] = signal(e[r],
|
|
3437
|
+
this.nt[r] = signal(e[r], Ce);
|
|
3379
3438
|
return this.Ye(accessor(this.nt[r]), r);
|
|
3380
3439
|
}
|
|
3381
3440
|
: () => {
|
|
3382
|
-
this.nt[r] = signal(e[r],
|
|
3383
|
-
this.rt && (this.rt[r] = signal(r,
|
|
3441
|
+
this.nt[r] = signal(e[r], Ce);
|
|
3442
|
+
this.rt && (this.rt[r] = signal(r, Ce));
|
|
3384
3443
|
return this.Ye(accessor(this.nt[r]), this.rt ? accessor(this.rt[r]) : undefined);
|
|
3385
3444
|
}
|
|
3386
3445
|
: this.rt
|
|
3387
3446
|
? () => {
|
|
3388
3447
|
const t = e[r];
|
|
3389
|
-
this.rt[r] = signal(r,
|
|
3448
|
+
this.rt[r] = signal(r, Ce);
|
|
3390
3449
|
return this.Ye(t, accessor(this.rt[r]));
|
|
3391
3450
|
}
|
|
3392
3451
|
: () => {
|
|
@@ -3504,7 +3563,7 @@ function repeat(e, t, n) {
|
|
|
3504
3563
|
st: n?.fallback
|
|
3505
3564
|
})
|
|
3506
3565
|
);
|
|
3507
|
-
i.
|
|
3566
|
+
i.ue &= ~g;
|
|
3508
3567
|
return accessor(i);
|
|
3509
3568
|
}
|
|
3510
3569
|
function updateRepeat() {
|
|
@@ -3517,6 +3576,7 @@ function updateRepeat() {
|
|
|
3517
3576
|
this.et = [];
|
|
3518
3577
|
this.Ze = [];
|
|
3519
3578
|
this.$e = 0;
|
|
3579
|
+
this.ot = 0;
|
|
3520
3580
|
}
|
|
3521
3581
|
if (this.st && !this.Ze[0]) {
|
|
3522
3582
|
this.Ze[0] = runWithOwner((this.et[0] = createOwner()), this.st);
|
|
@@ -3528,10 +3588,10 @@ function updateRepeat() {
|
|
|
3528
3588
|
if (this.$e === 0 && this.et[0]) this.et[0].dispose();
|
|
3529
3589
|
for (let e = n; e < r; e++) this.et[e - this.ot].dispose();
|
|
3530
3590
|
if (this.ot < t) {
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
this.et.splice(0,
|
|
3534
|
-
this.Ze.splice(0,
|
|
3591
|
+
const e = t - this.ot;
|
|
3592
|
+
for (let t = 0; t < e && t < this.$e; t++) this.et[t].dispose();
|
|
3593
|
+
this.et.splice(0, e);
|
|
3594
|
+
this.Ze.splice(0, e);
|
|
3535
3595
|
} else if (this.ot > t) {
|
|
3536
3596
|
let n = r - this.ot - 1;
|
|
3537
3597
|
let i = this.ot - t;
|
|
@@ -3560,28 +3620,28 @@ function compare(e, t, n) {
|
|
|
3560
3620
|
function boundaryComputed(e, t) {
|
|
3561
3621
|
const n = computed(e, { lazy: true });
|
|
3562
3622
|
n.Fe = (e, t) => {
|
|
3563
|
-
const r = e !== undefined ? e : n.
|
|
3564
|
-
const i = t !== undefined ? t : n.
|
|
3565
|
-
n.
|
|
3566
|
-
n.
|
|
3623
|
+
const r = e !== undefined ? e : n.ae;
|
|
3624
|
+
const i = t !== undefined ? t : n.fe;
|
|
3625
|
+
n.ae &= ~n.lt;
|
|
3626
|
+
n.F.notify(n, n.lt, r, i);
|
|
3567
3627
|
};
|
|
3568
3628
|
n.lt = t;
|
|
3569
|
-
n.
|
|
3629
|
+
n.ue &= ~g;
|
|
3570
3630
|
recompute(n, true);
|
|
3571
3631
|
return n;
|
|
3572
3632
|
}
|
|
3573
3633
|
function createBoundChildren(e, t, n, r) {
|
|
3574
|
-
const i = e.
|
|
3575
|
-
i.addChild((e.
|
|
3576
|
-
cleanup(() => i.removeChild(e.
|
|
3634
|
+
const i = e.F;
|
|
3635
|
+
i.addChild((e.F = n));
|
|
3636
|
+
cleanup(() => i.removeChild(e.F));
|
|
3577
3637
|
return runWithOwner(e, () => {
|
|
3578
3638
|
const e = computed(t);
|
|
3579
3639
|
return boundaryComputed(() => flatten(read(e)), r);
|
|
3580
3640
|
});
|
|
3581
3641
|
}
|
|
3582
|
-
const
|
|
3583
|
-
const
|
|
3584
|
-
let
|
|
3642
|
+
const Ee = Symbol();
|
|
3643
|
+
const ke = createContext(null);
|
|
3644
|
+
let je = false;
|
|
3585
3645
|
const FALSE_ACCESSOR = () => false;
|
|
3586
3646
|
const SEQUENTIAL_ACCESSOR = () => "sequential";
|
|
3587
3647
|
function isRevealController(e) {
|
|
@@ -3715,18 +3775,18 @@ class CollectionQueue extends Queue {
|
|
|
3715
3775
|
Et;
|
|
3716
3776
|
dt = true;
|
|
3717
3777
|
ht = signal(false, { ownedWrite: true, ze: true });
|
|
3718
|
-
|
|
3778
|
+
fe;
|
|
3719
3779
|
yt = signal(false, { ownedWrite: true, ze: true });
|
|
3720
3780
|
gt;
|
|
3721
3781
|
wt = false;
|
|
3722
3782
|
kt;
|
|
3723
|
-
jt =
|
|
3783
|
+
jt = Ee;
|
|
3724
3784
|
constructor(e) {
|
|
3725
3785
|
super();
|
|
3726
3786
|
this.Ct = e;
|
|
3727
3787
|
}
|
|
3728
3788
|
run(e) {
|
|
3729
|
-
if (!e || (read(this.ht) && (!
|
|
3789
|
+
if (!e || (read(this.ht) && (!je || read(this.yt)))) return;
|
|
3730
3790
|
return super.run(e);
|
|
3731
3791
|
}
|
|
3732
3792
|
notify(e, t, n, r) {
|
|
@@ -3736,7 +3796,7 @@ class CollectionQueue extends Queue {
|
|
|
3736
3796
|
try {
|
|
3737
3797
|
return this.kt();
|
|
3738
3798
|
} catch {
|
|
3739
|
-
return
|
|
3799
|
+
return Ee;
|
|
3740
3800
|
}
|
|
3741
3801
|
});
|
|
3742
3802
|
if (e !== this.jt) {
|
|
@@ -3751,13 +3811,13 @@ class CollectionQueue extends Queue {
|
|
|
3751
3811
|
}
|
|
3752
3812
|
if (n & this.Ct) {
|
|
3753
3813
|
this.dt = true;
|
|
3754
|
-
const t = r?.source || e.
|
|
3814
|
+
const t = r?.source || e.fe?.source;
|
|
3755
3815
|
if (t) {
|
|
3756
3816
|
const e = this.ct.size === 0;
|
|
3757
3817
|
this.ct.add(t);
|
|
3758
3818
|
if (e) setSignal(this.ht, true);
|
|
3759
3819
|
if (this.Ct & m) {
|
|
3760
|
-
setSignal(this.
|
|
3820
|
+
setSignal(this.fe, t.fe?.cause ?? t.fe);
|
|
3761
3821
|
}
|
|
3762
3822
|
}
|
|
3763
3823
|
}
|
|
@@ -3766,11 +3826,11 @@ class CollectionQueue extends Queue {
|
|
|
3766
3826
|
}
|
|
3767
3827
|
checkSources() {
|
|
3768
3828
|
for (const e of this.ct) {
|
|
3769
|
-
if (e.
|
|
3829
|
+
if (e.V & u || (!(e.ae & this.Ct) && !(this.Ct & m && e.ae & _))) this.ct.delete(e);
|
|
3770
3830
|
}
|
|
3771
3831
|
if (!this.ct.size) {
|
|
3772
3832
|
if (this.Ct & _ && this.dt && !this.wt && this.Et) {
|
|
3773
|
-
this.dt = !!(this.Et.
|
|
3833
|
+
this.dt = !!(this.Et.ae & this.Ct);
|
|
3774
3834
|
} else {
|
|
3775
3835
|
this.dt = false;
|
|
3776
3836
|
}
|
|
@@ -3783,14 +3843,14 @@ class CollectionQueue extends Queue {
|
|
|
3783
3843
|
}
|
|
3784
3844
|
}
|
|
3785
3845
|
}
|
|
3786
|
-
if (
|
|
3846
|
+
if (je) this.gt?.evaluate();
|
|
3787
3847
|
}
|
|
3788
3848
|
}
|
|
3789
3849
|
function createCollectionBoundary(e, t, n, r) {
|
|
3790
3850
|
const i = createOwner();
|
|
3791
|
-
if (
|
|
3851
|
+
if (je) setContext(ke, null, i);
|
|
3792
3852
|
const s = new CollectionQueue(e);
|
|
3793
|
-
if (e === m) s.
|
|
3853
|
+
if (e === m) s.fe = signal(undefined, { ownedWrite: true, ze: true });
|
|
3794
3854
|
if (r) s.kt = r;
|
|
3795
3855
|
const o = (s.Et = createBoundChildren(i, t, s, e));
|
|
3796
3856
|
untrack(() => {
|
|
@@ -3801,9 +3861,9 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3801
3861
|
if (e instanceof NotReadyError) t = true;
|
|
3802
3862
|
else throw e;
|
|
3803
3863
|
}
|
|
3804
|
-
s.dt = t || !!(o.
|
|
3864
|
+
s.dt = t || !!(o.ae & e) || o.fe instanceof NotReadyError;
|
|
3805
3865
|
});
|
|
3806
|
-
const u =
|
|
3866
|
+
const u = je && e === _ ? getContext(ke) : null;
|
|
3807
3867
|
if (u) {
|
|
3808
3868
|
s.gt = u;
|
|
3809
3869
|
u.register(s);
|
|
@@ -3815,7 +3875,7 @@ function createCollectionBoundary(e, t, n, r) {
|
|
|
3815
3875
|
const e = read(o);
|
|
3816
3876
|
if (!untrack(() => read(s.ht))) return ((s.wt = true), e);
|
|
3817
3877
|
}
|
|
3818
|
-
if (
|
|
3878
|
+
if (je && read(s.yt)) return undefined;
|
|
3819
3879
|
return n(s);
|
|
3820
3880
|
})
|
|
3821
3881
|
);
|
|
@@ -3825,20 +3885,20 @@ function createLoadingBoundary(e, t, n) {
|
|
|
3825
3885
|
}
|
|
3826
3886
|
function createErrorBoundary(e, t) {
|
|
3827
3887
|
return createCollectionBoundary(m, e, e =>
|
|
3828
|
-
t(accessor(e.
|
|
3888
|
+
t(accessor(e.fe), () => {
|
|
3829
3889
|
for (const t of e.ct) recompute(t);
|
|
3830
3890
|
schedule();
|
|
3831
3891
|
})
|
|
3832
3892
|
);
|
|
3833
3893
|
}
|
|
3834
3894
|
function createRevealOrder(e, t) {
|
|
3835
|
-
|
|
3895
|
+
je = true;
|
|
3836
3896
|
const n = createOwner();
|
|
3837
|
-
const r = getContext(
|
|
3897
|
+
const r = getContext(ke);
|
|
3838
3898
|
const i = t?.order || SEQUENTIAL_ACCESSOR,
|
|
3839
3899
|
s = t?.collapsed || FALSE_ACCESSOR;
|
|
3840
3900
|
const o = new RevealController(i, s);
|
|
3841
|
-
setContext(
|
|
3901
|
+
setContext(ke, o, n);
|
|
3842
3902
|
return runWithOwner(n, () => {
|
|
3843
3903
|
const t = e();
|
|
3844
3904
|
computed(() => {
|
|
@@ -3903,13 +3963,13 @@ function flattenArray(e, t = [], n) {
|
|
|
3903
3963
|
if (r) throw r;
|
|
3904
3964
|
return i;
|
|
3905
3965
|
}
|
|
3906
|
-
const
|
|
3907
|
-
exports.$PROXY =
|
|
3966
|
+
const We = undefined;
|
|
3967
|
+
exports.$PROXY = oe;
|
|
3908
3968
|
exports.$REFRESH = j;
|
|
3909
|
-
exports.$TARGET =
|
|
3910
|
-
exports.$TRACK =
|
|
3969
|
+
exports.$TARGET = se;
|
|
3970
|
+
exports.$TRACK = ie;
|
|
3911
3971
|
exports.ContextNotFoundError = ContextNotFoundError;
|
|
3912
|
-
exports.DEV =
|
|
3972
|
+
exports.DEV = We;
|
|
3913
3973
|
exports.NoOwnerError = NoOwnerError;
|
|
3914
3974
|
exports.NotReadyError = NotReadyError;
|
|
3915
3975
|
exports.SUPPORTS_PROXY = E;
|
|
@@ -3943,7 +4003,6 @@ exports.getOwner = getOwner;
|
|
|
3943
4003
|
exports.isDisposed = isDisposed;
|
|
3944
4004
|
exports.isEqual = isEqual;
|
|
3945
4005
|
exports.isPending = isPending;
|
|
3946
|
-
exports.isRefreshing = isRefreshing;
|
|
3947
4006
|
exports.isWrappable = isWrappable;
|
|
3948
4007
|
exports.latest = latest;
|
|
3949
4008
|
exports.mapArray = mapArray;
|
|
@@ -3962,5 +4021,5 @@ exports.runWithOwner = runWithOwner;
|
|
|
3962
4021
|
exports.setContext = setContext;
|
|
3963
4022
|
exports.setSnapshotCapture = setSnapshotCapture;
|
|
3964
4023
|
exports.snapshot = snapshot;
|
|
3965
|
-
exports.storePath =
|
|
4024
|
+
exports.storePath = Pe;
|
|
3966
4025
|
exports.untrack = untrack;
|