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