@but212/atom-effect-jquery 0.24.0 → 0.25.0
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 +4 -1
- package/dist/atom-effect-jquery.min.js +2 -2
- package/dist/atom-effect-jquery.min.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +17 -9
- package/dist/index.mjs +736 -596
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -89,53 +89,69 @@ var d = Object.freeze([]), f = class {
|
|
|
89
89
|
BATCH_CALLBACK_MUST_BE_FUNCTION: "Batch callback must be a function"
|
|
90
90
|
}, y = class {
|
|
91
91
|
constructor() {
|
|
92
|
-
this._s0 = null, this._s1 = null, this._s2 = null, this._s3 = null, this._count = 0, this.
|
|
92
|
+
this._s0 = null, this._s1 = null, this._s2 = null, this._s3 = null, this._count = 0, this._overflow = null;
|
|
93
93
|
}
|
|
94
94
|
get size() {
|
|
95
95
|
return this._count;
|
|
96
96
|
}
|
|
97
97
|
getAt(e) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+
switch (e) {
|
|
99
|
+
case 0: return this._s0;
|
|
100
|
+
case 1: return this._s1;
|
|
101
|
+
case 2: return this._s2;
|
|
102
|
+
case 3: return this._s3;
|
|
103
|
+
default: {
|
|
104
|
+
let t = this._overflow;
|
|
105
|
+
if (t !== null && e >= 4) {
|
|
106
|
+
let n = e - 4;
|
|
107
|
+
if (n < t.length) return t[n] ?? null;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
106
111
|
}
|
|
107
|
-
return null;
|
|
108
112
|
}
|
|
109
113
|
setAt(e, t) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
switch (e) {
|
|
115
|
+
case 0:
|
|
116
|
+
this._s0 = t;
|
|
117
|
+
break;
|
|
118
|
+
case 1:
|
|
119
|
+
this._s1 = t;
|
|
120
|
+
break;
|
|
121
|
+
case 2:
|
|
122
|
+
this._s2 = t;
|
|
123
|
+
break;
|
|
124
|
+
case 3:
|
|
125
|
+
this._s3 = t;
|
|
126
|
+
break;
|
|
127
|
+
default: {
|
|
128
|
+
this._overflow ??= [];
|
|
129
|
+
let n = this._overflow;
|
|
130
|
+
n[e - 4] = t;
|
|
131
|
+
}
|
|
118
132
|
}
|
|
119
133
|
e >= this._count && (this._count = e + 1);
|
|
120
134
|
}
|
|
121
135
|
truncateFrom(e) {
|
|
122
136
|
let t = this._count;
|
|
123
137
|
if (e >= t) return;
|
|
124
|
-
if (e <=
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
if (e <= 3) switch (e) {
|
|
139
|
+
case 0: {
|
|
140
|
+
let e = this._s0;
|
|
141
|
+
e != null && (this._onItemRemoved(e), this._s0 = null);
|
|
142
|
+
}
|
|
143
|
+
case 1: {
|
|
144
|
+
let e = this._s1;
|
|
145
|
+
e != null && (this._onItemRemoved(e), this._s1 = null);
|
|
146
|
+
}
|
|
147
|
+
case 2: {
|
|
148
|
+
let e = this._s2;
|
|
149
|
+
e != null && (this._onItemRemoved(e), this._s2 = null);
|
|
150
|
+
}
|
|
151
|
+
case 3: {
|
|
152
|
+
let e = this._s3;
|
|
153
|
+
e != null && (this._onItemRemoved(e), this._s3 = null);
|
|
154
|
+
}
|
|
139
155
|
}
|
|
140
156
|
let n = this._overflow;
|
|
141
157
|
if (n !== null && t > 4) {
|
|
@@ -268,19 +284,19 @@ var d = Object.freeze([]), f = class {
|
|
|
268
284
|
attachDebugInfo(e, t, n) {},
|
|
269
285
|
getDebugName: (e) => e?.[b],
|
|
270
286
|
getDebugType: (e) => e?.[x]
|
|
271
|
-
},
|
|
272
|
-
function
|
|
287
|
+
}, ee = 1, te = () => ee++;
|
|
288
|
+
function w(e, t, n) {
|
|
273
289
|
if (e instanceof m) return e;
|
|
274
290
|
let r = e instanceof Error, i = r ? e.message : String(e), a = r ? e : void 0;
|
|
275
291
|
return new t(`${r ? e.constructor.name : "Unexpected error"} (${n}): ${i}`, a);
|
|
276
292
|
}
|
|
277
|
-
var
|
|
293
|
+
var ne = class {
|
|
278
294
|
constructor() {
|
|
279
|
-
this.flags = 0, this.version = 0, this._lastSeenEpoch = c.UNINITIALIZED, this.
|
|
295
|
+
this.flags = 0, this.version = 0, this._lastSeenEpoch = c.UNINITIALIZED, this._notifying = 0, this._hotIndex = -1, this._slots = null, this._deps = null, this.id = te() & l;
|
|
280
296
|
}
|
|
281
297
|
subscribe(e) {
|
|
282
298
|
let t = typeof e == "function";
|
|
283
|
-
if (!t && (!e || typeof e.execute != "function")) throw
|
|
299
|
+
if (!t && (!e || typeof e.execute != "function")) throw w(/* @__PURE__ */ TypeError("Invalid subscriber"), m, v.ATOM_SUBSCRIBER_MUST_BE_FUNCTION);
|
|
284
300
|
let n = this._slots;
|
|
285
301
|
n || (n = new y(), this._slots = n);
|
|
286
302
|
let r = !1;
|
|
@@ -311,7 +327,7 @@ var te = class {
|
|
|
311
327
|
try {
|
|
312
328
|
n.notify(e, t);
|
|
313
329
|
} catch (e) {
|
|
314
|
-
console.error(
|
|
330
|
+
console.error(w(e, m, v.ATOM_INDIVIDUAL_SUBSCRIBER_FAILED));
|
|
315
331
|
}
|
|
316
332
|
});
|
|
317
333
|
} finally {
|
|
@@ -328,20 +344,20 @@ var te = class {
|
|
|
328
344
|
}
|
|
329
345
|
return !e.hasComputeds && !e.isDirtyFast() ? !1 : this._deepDirtyCheck();
|
|
330
346
|
}
|
|
331
|
-
},
|
|
332
|
-
function
|
|
333
|
-
return
|
|
347
|
+
}, re = 0, ie = () => (re = re + 1 & 1073741823 || 1, re), ae = (e) => e + 1 & l, oe = 0, se = !1, ce = 0, le = () => ce;
|
|
348
|
+
function ue() {
|
|
349
|
+
return se ? !1 : (se = !0, ce = ie(), oe = 0, !0);
|
|
334
350
|
}
|
|
335
|
-
var
|
|
336
|
-
|
|
337
|
-
},
|
|
351
|
+
var de = () => {
|
|
352
|
+
se = !1;
|
|
353
|
+
}, fe = () => se ? ++oe : 0, pe = /* @__PURE__ */ (function(e) {
|
|
338
354
|
return e[e.IDLE = 0] = "IDLE", e[e.BATCHING = 1] = "BATCHING", e[e.FLUSHING = 2] = "FLUSHING", e;
|
|
339
|
-
})({}),
|
|
355
|
+
})({}), T = new class {
|
|
340
356
|
constructor() {
|
|
341
357
|
this._queueBuffer = [[], []], this._bufferIndex = 0, this._size = 0, this._epoch = 0, this._isProcessing = !1, this._isBatching = !1, this._isFlushingSync = !1, this._batchDepth = 0, this._batchQueue = [], this._batchQueueSize = 0, this._maxFlushIterations = a.MAX_FLUSH_ITERATIONS, this.onOverflow = null, this._boundRunLoop = this._runLoop.bind(this);
|
|
342
358
|
}
|
|
343
359
|
get phase() {
|
|
344
|
-
return this._isProcessing || this._isFlushingSync ?
|
|
360
|
+
return this._isProcessing || this._isFlushingSync ? pe.FLUSHING : this._isBatching ? pe.BATCHING : pe.IDLE;
|
|
345
361
|
}
|
|
346
362
|
get queueSize() {
|
|
347
363
|
return this._size;
|
|
@@ -364,27 +380,29 @@ var ue = () => {
|
|
|
364
380
|
_runLoop() {
|
|
365
381
|
try {
|
|
366
382
|
if (this._size === 0) return;
|
|
367
|
-
let e =
|
|
368
|
-
this._drainQueue(), e &&
|
|
383
|
+
let e = ue();
|
|
384
|
+
this._drainQueue(), e && de();
|
|
369
385
|
} finally {
|
|
370
386
|
this._isProcessing = !1, this._size > 0 && !this._isBatching && this._flush();
|
|
371
387
|
}
|
|
372
388
|
}
|
|
373
389
|
_flushSync() {
|
|
374
390
|
this._isFlushingSync = !0;
|
|
375
|
-
let e =
|
|
391
|
+
let e = ue();
|
|
376
392
|
try {
|
|
377
393
|
this._mergeBatchQueue(), this._drainQueue();
|
|
378
394
|
} finally {
|
|
379
|
-
this._isFlushingSync = !1, e &&
|
|
395
|
+
this._isFlushingSync = !1, e && de();
|
|
380
396
|
}
|
|
381
397
|
}
|
|
382
398
|
_mergeBatchQueue() {
|
|
383
399
|
if (this._batchQueueSize === 0) return;
|
|
384
400
|
let e = ++this._epoch, t = this._batchQueue, n = this._queueBuffer[this._bufferIndex], r = this._size;
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
401
|
+
for (let i = 0; i < this._batchQueueSize; i++) {
|
|
402
|
+
let a = t[i];
|
|
403
|
+
a._nextEpoch !== e && (a._nextEpoch = e, n[r++] = a);
|
|
404
|
+
}
|
|
405
|
+
this._size = r, this._batchQueueSize = 0, t.length = 0;
|
|
388
406
|
}
|
|
389
407
|
_drainQueue() {
|
|
390
408
|
let e = 0;
|
|
@@ -423,7 +441,7 @@ var ue = () => {
|
|
|
423
441
|
if (e < a.MIN_FLUSH_ITERATIONS) throw new _(`Max flush iterations must be at least ${a.MIN_FLUSH_ITERATIONS}`);
|
|
424
442
|
this._maxFlushIterations = e;
|
|
425
443
|
}
|
|
426
|
-
}(),
|
|
444
|
+
}(), me = /* @__PURE__ */ Symbol.for("atom-effect/atom"), he = /* @__PURE__ */ Symbol.for("atom-effect/computed"), ge = /* @__PURE__ */ Symbol.for("atom-effect/effect"), _e = /* @__PURE__ */ Symbol.for("atom-effect/writable"), E = {
|
|
427
445
|
current: null,
|
|
428
446
|
run(e, t) {
|
|
429
447
|
let n = this.current;
|
|
@@ -435,36 +453,36 @@ var ue = () => {
|
|
|
435
453
|
}
|
|
436
454
|
}
|
|
437
455
|
};
|
|
438
|
-
function
|
|
439
|
-
let t =
|
|
456
|
+
function D(e) {
|
|
457
|
+
let t = E.current;
|
|
440
458
|
if (t === null) return e();
|
|
441
|
-
|
|
459
|
+
E.current = null;
|
|
442
460
|
try {
|
|
443
461
|
return e();
|
|
444
462
|
} finally {
|
|
445
|
-
|
|
463
|
+
E.current = t;
|
|
446
464
|
}
|
|
447
465
|
}
|
|
448
|
-
var
|
|
466
|
+
var ve = class extends ne {
|
|
449
467
|
constructor(e, t) {
|
|
450
|
-
super(), this
|
|
468
|
+
super(), this[me] = !0, this[_e] = !0, this._value = e, this._pendingOldValue = void 0, t && (this.flags |= i.SYNC), C.attachDebugInfo(this, "atom", this.id);
|
|
451
469
|
}
|
|
452
470
|
get value() {
|
|
453
|
-
return
|
|
471
|
+
return E.current?.addDependency(this), this._value;
|
|
454
472
|
}
|
|
455
473
|
set value(e) {
|
|
456
474
|
let t = this._value;
|
|
457
475
|
if (Object.is(t, e)) return;
|
|
458
|
-
this._value = e, this.version =
|
|
476
|
+
this._value = e, this.version = ae(this.version);
|
|
459
477
|
let n = this._slots, r = this.flags;
|
|
460
478
|
if (n == null || n.size === 0 || r & i.NOTIFICATION_SCHEDULED) return;
|
|
461
479
|
this._pendingOldValue = t;
|
|
462
480
|
let a = r | i.NOTIFICATION_SCHEDULED;
|
|
463
|
-
if (this.flags = a, (a & i.SYNC) !== 0 && !
|
|
481
|
+
if (this.flags = a, (a & i.SYNC) !== 0 && !T.isBatching) {
|
|
464
482
|
this._flushNotifications();
|
|
465
483
|
return;
|
|
466
484
|
}
|
|
467
|
-
|
|
485
|
+
T.schedule(this);
|
|
468
486
|
}
|
|
469
487
|
execute() {
|
|
470
488
|
this._flushNotifications();
|
|
@@ -488,10 +506,10 @@ var _e = class extends te {
|
|
|
488
506
|
this.dispose();
|
|
489
507
|
}
|
|
490
508
|
};
|
|
491
|
-
function
|
|
492
|
-
return new
|
|
509
|
+
function ye(e, t = {}) {
|
|
510
|
+
return new ve(e, t.sync ?? !1);
|
|
493
511
|
}
|
|
494
|
-
var
|
|
512
|
+
var be = class extends y {
|
|
495
513
|
constructor() {
|
|
496
514
|
super(), this._map = null, this._SCAN_THRESHOLD = 32, this.hasComputeds = !1, this._depsHash = 0, this._map = null, this.hasComputeds = !1, this._depsHash = 0;
|
|
497
515
|
}
|
|
@@ -507,22 +525,34 @@ var ye = class extends y {
|
|
|
507
525
|
if (t >= n) return !1;
|
|
508
526
|
let r = n - t;
|
|
509
527
|
if (this._map !== null || r > this._SCAN_THRESHOLD) return this._claimViaMap(e, t);
|
|
510
|
-
if (t < 4) {
|
|
511
|
-
|
|
528
|
+
if (t < 4) switch (t) {
|
|
529
|
+
case 0: {
|
|
512
530
|
let t = this._s0;
|
|
513
531
|
if (t && t.node === e && t.unsub) return t.version = e.version, !0;
|
|
514
532
|
}
|
|
515
|
-
|
|
533
|
+
case 1: if (n > 1) {
|
|
516
534
|
let n = this._s1;
|
|
517
535
|
if (n && n.node === e && n.unsub) return n.version = e.version, t !== 1 && (this._s1 = this._s0, this._s0 = n), !0;
|
|
518
536
|
}
|
|
519
|
-
|
|
537
|
+
case 2: if (n > 2) {
|
|
520
538
|
let n = this._s2;
|
|
521
|
-
if (n && n.node === e && n.unsub)
|
|
539
|
+
if (n && n.node === e && n.unsub) {
|
|
540
|
+
if (n.version = e.version, t !== 2) {
|
|
541
|
+
let e = t === 0 ? this._s0 : this._s1;
|
|
542
|
+
t === 0 ? this._s0 = n : this._s1 = n, this._s2 = e;
|
|
543
|
+
}
|
|
544
|
+
return !0;
|
|
545
|
+
}
|
|
522
546
|
}
|
|
523
|
-
|
|
547
|
+
case 3: if (n > 3) {
|
|
524
548
|
let n = this._s3;
|
|
525
|
-
if (n && n.node === e && n.unsub)
|
|
549
|
+
if (n && n.node === e && n.unsub) {
|
|
550
|
+
if (n.version = e.version, t !== 3) {
|
|
551
|
+
let e;
|
|
552
|
+
t === 0 ? (e = this._s0, this._s0 = n) : t === 1 ? (e = this._s1, this._s1 = n) : (e = this._s2, this._s2 = n), this._s3 = e;
|
|
553
|
+
}
|
|
554
|
+
return !0;
|
|
555
|
+
}
|
|
526
556
|
}
|
|
527
557
|
}
|
|
528
558
|
let i = t > 4 ? t : 4, a = this._overflow;
|
|
@@ -536,9 +566,14 @@ var ye = class extends y {
|
|
|
536
566
|
if (this._map === null) {
|
|
537
567
|
this._map = /* @__PURE__ */ new Map();
|
|
538
568
|
let e = this._count;
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
569
|
+
t < 4 && (t <= 0 && this._s0?.unsub && this._map.set(this._s0.node, 0), t <= 1 && this._s1?.unsub && this._map.set(this._s1.node, 1), t <= 2 && this._s2?.unsub && this._map.set(this._s2.node, 2), t <= 3 && this._s3?.unsub && this._map.set(this._s3.node, 3));
|
|
570
|
+
let n = this._overflow;
|
|
571
|
+
if (n && e > 4) {
|
|
572
|
+
let e = t > 4 ? t : 4;
|
|
573
|
+
for (let t = e - 4, r = n.length; t < r; t++) {
|
|
574
|
+
let e = n[t];
|
|
575
|
+
e?.unsub && this._map.set(e.node, t + 4);
|
|
576
|
+
}
|
|
542
577
|
}
|
|
543
578
|
}
|
|
544
579
|
let n = this._map.get(e);
|
|
@@ -558,7 +593,14 @@ var ye = class extends y {
|
|
|
558
593
|
_swapGeneral(e, t, n) {
|
|
559
594
|
if (e === t) return;
|
|
560
595
|
let r = this.getAt(t);
|
|
561
|
-
this.setAt(t, n), this.
|
|
596
|
+
if (this.setAt(t, n), e === 0) this._s0 = r;
|
|
597
|
+
else if (e === 1) this._s1 = r;
|
|
598
|
+
else if (e === 2) this._s2 = r;
|
|
599
|
+
else if (e === 3) this._s3 = r;
|
|
600
|
+
else {
|
|
601
|
+
let t = this._overflow;
|
|
602
|
+
t[e - 4] = r;
|
|
603
|
+
}
|
|
562
604
|
}
|
|
563
605
|
insertNew(e, t) {
|
|
564
606
|
let n = this._count;
|
|
@@ -566,98 +608,84 @@ var ye = class extends y {
|
|
|
566
608
|
let t = this.getAt(e);
|
|
567
609
|
t != null && (this.add(t), this._map !== null && t.unsub && this._map.set(t.node, this._count - 1));
|
|
568
610
|
}
|
|
569
|
-
e === 0
|
|
611
|
+
if (e === 0) this._s0 = t;
|
|
612
|
+
else if (e === 1) this._s1 = t;
|
|
613
|
+
else if (e === 2) this._s2 = t;
|
|
614
|
+
else if (e === 3) this._s3 = t;
|
|
615
|
+
else {
|
|
616
|
+
let n = this._overflow;
|
|
617
|
+
n || (n = [], this._overflow = n), n[e - 4] = t;
|
|
618
|
+
}
|
|
619
|
+
e >= n && (this._count = e + 1);
|
|
570
620
|
}
|
|
571
621
|
truncateFrom(e) {
|
|
572
622
|
e >= this._count || (super.truncateFrom(e), this._map !== null && (this._map.clear(), this._map = null));
|
|
573
623
|
}
|
|
574
624
|
seal() {
|
|
575
|
-
let e = this._count;
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
625
|
+
let e = this._count, t = u.VERSION_BITS, n = 0;
|
|
626
|
+
switch (e) {
|
|
627
|
+
case 0:
|
|
628
|
+
this._depsHash = 0;
|
|
629
|
+
return;
|
|
630
|
+
case 1: {
|
|
631
|
+
let e = this._s0;
|
|
632
|
+
n = n + (e.version << t) + e.node.id | 0;
|
|
633
|
+
break;
|
|
634
|
+
}
|
|
635
|
+
case 2: {
|
|
636
|
+
let e = this._s0, r = this._s1;
|
|
637
|
+
n = n + (e.version << t) + e.node.id | 0, n = n + (r.version << t) + r.node.id | 0;
|
|
638
|
+
break;
|
|
639
|
+
}
|
|
640
|
+
case 3: {
|
|
641
|
+
let e = this._s0, r = this._s1, i = this._s2;
|
|
642
|
+
n = n + (e.version << t) + e.node.id | 0, n = n + (r.version << t) + r.node.id | 0, n = n + (i.version << t) + i.node.id | 0;
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
default: {
|
|
646
|
+
let r = this._s0, i = this._s1, a = this._s2, o = this._s3;
|
|
647
|
+
if (n = n + (r.version << t) + r.node.id | 0, n = n + (i.version << t) + i.node.id | 0, n = n + (a.version << t) + a.node.id | 0, n = n + (o.version << t) + o.node.id | 0, e > 4) {
|
|
648
|
+
let e = this._overflow;
|
|
649
|
+
for (let r = 0, i = e.length; r < i; r++) {
|
|
650
|
+
let i = e[r];
|
|
651
|
+
n = n + (i.version << t) + i.node.id | 0;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
596
654
|
}
|
|
597
655
|
}
|
|
598
|
-
this._depsHash =
|
|
656
|
+
this._depsHash = n;
|
|
599
657
|
}
|
|
600
658
|
isDirtyFast() {
|
|
601
|
-
let e = this._count;
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
if (e > 1) {
|
|
609
|
-
let e = this._s1;
|
|
610
|
-
if (e) {
|
|
611
|
-
let r = e.node;
|
|
612
|
-
t = t + (r.version << n) + r.id | 0;
|
|
659
|
+
let e = this._count, t = u.VERSION_BITS, n = 0;
|
|
660
|
+
switch (e) {
|
|
661
|
+
case 0: return !1;
|
|
662
|
+
case 1: {
|
|
663
|
+
let e = this._s0.node;
|
|
664
|
+
n = n + (e.version << t) + e.id | 0;
|
|
665
|
+
break;
|
|
613
666
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
let r = e.node;
|
|
619
|
-
t = t + (r.version << n) + r.id | 0;
|
|
667
|
+
case 2: {
|
|
668
|
+
let e = this._s0.node, r = this._s1.node;
|
|
669
|
+
n = n + (e.version << t) + e.id | 0, n = n + (r.version << t) + r.id | 0;
|
|
670
|
+
break;
|
|
620
671
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
let r = e.node;
|
|
626
|
-
t = t + (r.version << n) + r.id | 0;
|
|
672
|
+
case 3: {
|
|
673
|
+
let e = this._s0.node, r = this._s1.node, i = this._s2.node;
|
|
674
|
+
n = n + (e.version << t) + e.id | 0, n = n + (r.version << t) + r.id | 0, n = n + (i.version << t) + i.id | 0;
|
|
675
|
+
break;
|
|
627
676
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
let
|
|
633
|
-
|
|
677
|
+
default: {
|
|
678
|
+
let r = this._s0.node, i = this._s1.node, a = this._s2.node, o = this._s3.node;
|
|
679
|
+
if (n = n + (r.version << t) + r.id | 0, n = n + (i.version << t) + i.id | 0, n = n + (a.version << t) + a.id | 0, n = n + (o.version << t) + o.id | 0, e > 4) {
|
|
680
|
+
let e = this._overflow;
|
|
681
|
+
for (let r = 0, i = e.length; r < i; r++) {
|
|
682
|
+
let i = e[r].node;
|
|
683
|
+
n = n + (i.version << t) + i.id | 0;
|
|
684
|
+
}
|
|
634
685
|
}
|
|
635
686
|
}
|
|
636
687
|
}
|
|
637
|
-
return
|
|
638
|
-
}
|
|
639
|
-
captureVersionSnapshot() {
|
|
640
|
-
let e = this._count;
|
|
641
|
-
if (e <= 0) return 0;
|
|
642
|
-
let t = 0, n = this._s0;
|
|
643
|
-
if (n && (t = (t << 5) - t + n.node.version | 0), e > 1) {
|
|
644
|
-
let e = this._s1;
|
|
645
|
-
e && (t = (t << 5) - t + e.node.version | 0);
|
|
646
|
-
}
|
|
647
|
-
if (e > 2) {
|
|
648
|
-
let e = this._s2;
|
|
649
|
-
e && (t = (t << 5) - t + e.node.version | 0);
|
|
650
|
-
}
|
|
651
|
-
if (e > 3) {
|
|
652
|
-
let e = this._s3;
|
|
653
|
-
e && (t = (t << 5) - t + e.node.version | 0);
|
|
654
|
-
let n = this._overflow;
|
|
655
|
-
if (n) for (let e = 0, r = n.length; e < r; e++) {
|
|
656
|
-
let r = n[e];
|
|
657
|
-
r && (t = (t << 5) - t + r.node.version | 0);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
return t;
|
|
688
|
+
return n !== this._depsHash;
|
|
661
689
|
}
|
|
662
690
|
disposeAll() {
|
|
663
691
|
this._count > 0 && this.truncateFrom(0), this.hasComputeds = !1, this._map !== null && (this._map.clear(), this._map = null);
|
|
@@ -667,41 +695,41 @@ var ye = class extends y {
|
|
|
667
695
|
}
|
|
668
696
|
compact() {}
|
|
669
697
|
};
|
|
670
|
-
function
|
|
671
|
-
return typeof e == "object" && !!e && pe in e;
|
|
672
|
-
}
|
|
673
|
-
function be(e) {
|
|
698
|
+
function xe(e) {
|
|
674
699
|
return typeof e == "object" && !!e && me in e;
|
|
675
700
|
}
|
|
676
|
-
function
|
|
701
|
+
function Se(e) {
|
|
702
|
+
return typeof e == "object" && !!e && he in e;
|
|
703
|
+
}
|
|
704
|
+
function Ce(e) {
|
|
677
705
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
678
706
|
}
|
|
679
|
-
var { IDLE:
|
|
707
|
+
var { IDLE: O, DIRTY: k, PENDING: A, RESOLVED: j, REJECTED: M, HAS_ERROR: N, RECOMPUTING: P, DISPOSED: we, IS_COMPUTED: Te, FORCE_COMPUTE: Ee } = r, De = class extends ne {
|
|
680
708
|
constructor(e, t = {}) {
|
|
681
709
|
if (typeof e != "function") throw new h(v.COMPUTED_MUST_BE_FUNCTION);
|
|
682
|
-
if (super(), this[
|
|
710
|
+
if (super(), this[me] = !0, this[he] = !0, this._error = null, this._promiseId = 0, this._deps = new be(), this._asyncRetryCount = 0, this._lastDriftEpoch = c.UNINITIALIZED, this._trackEpoch = c.UNINITIALIZED, this._trackCount = 0, this._value = void 0, this.flags = Te | k | O, this._equal = t.equal ?? Object.is, this._fn = e, this._defaultValue = "defaultValue" in t ? t.defaultValue : S, this._onError = t.onError ?? null, this._maxAsyncRetries = (t.maxAsyncRetries ?? s.MAX_ASYNC_RETRIES) & l, C.attachDebugInfo(this, "computed", this.id), t.lazy === !1) try {
|
|
683
711
|
this._recompute();
|
|
684
712
|
} catch {}
|
|
685
713
|
}
|
|
686
714
|
_track() {
|
|
687
|
-
|
|
715
|
+
E.current?.addDependency(this);
|
|
688
716
|
}
|
|
689
717
|
get value() {
|
|
690
718
|
this._track();
|
|
691
719
|
let e = this.flags;
|
|
692
|
-
if ((e & (
|
|
693
|
-
if (e &
|
|
694
|
-
if (e &
|
|
720
|
+
if ((e & (j | k | O)) === j) return this._value;
|
|
721
|
+
if (e & we) throw new h(v.COMPUTED_DISPOSED);
|
|
722
|
+
if (e & P) {
|
|
695
723
|
if (this._defaultValue !== S) return this._defaultValue;
|
|
696
724
|
throw new h(v.COMPUTED_CIRCULAR_DEPENDENCY);
|
|
697
725
|
}
|
|
698
|
-
if (e & (
|
|
726
|
+
if (e & (k | O) && ((e & O) === 0 && (e & Ee) === 0 && this._deps.size > 0 && !this._isDirty() ? this.flags &= ~k : this._recompute(), this.flags & j)) return this._value;
|
|
699
727
|
let t = this._defaultValue, n = t !== S;
|
|
700
|
-
if (this.flags &
|
|
728
|
+
if (this.flags & A) {
|
|
701
729
|
if (n) return t;
|
|
702
730
|
throw new h(v.COMPUTED_ASYNC_PENDING_NO_DEFAULT);
|
|
703
731
|
}
|
|
704
|
-
if (this.flags &
|
|
732
|
+
if (this.flags & M) {
|
|
705
733
|
if (n) return t;
|
|
706
734
|
throw this._error;
|
|
707
735
|
}
|
|
@@ -713,14 +741,16 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
713
741
|
get state() {
|
|
714
742
|
this._track();
|
|
715
743
|
let e = this.flags;
|
|
716
|
-
return e &
|
|
744
|
+
return e & j ? t.RESOLVED : e & A ? t.PENDING : e & M ? t.REJECTED : t.IDLE;
|
|
717
745
|
}
|
|
718
746
|
get hasError() {
|
|
719
|
-
if (this._track(), this.flags & (
|
|
720
|
-
let e = this._deps
|
|
747
|
+
if (this._track(), this.flags & (M | N)) return !0;
|
|
748
|
+
let e = this._deps;
|
|
749
|
+
if (!e.hasComputeds) return !1;
|
|
750
|
+
let t = e.size;
|
|
721
751
|
for (let n = 0; n < t; n++) {
|
|
722
752
|
let t = e.getAt(n);
|
|
723
|
-
if (t != null && t.node.flags &
|
|
753
|
+
if (t != null && t.node.flags & N) return !0;
|
|
724
754
|
}
|
|
725
755
|
return !1;
|
|
726
756
|
}
|
|
@@ -731,12 +761,14 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
731
761
|
this._track();
|
|
732
762
|
let e = [];
|
|
733
763
|
this._error && e.push(this._error);
|
|
734
|
-
let t = this._deps
|
|
764
|
+
let t = this._deps;
|
|
765
|
+
if (!t.hasComputeds) return e.length === 0 ? d : Object.freeze(e);
|
|
766
|
+
let n = t.size;
|
|
735
767
|
for (let r = 0; r < n; r++) {
|
|
736
768
|
let n = t.getAt(r);
|
|
737
769
|
if (n == null) continue;
|
|
738
770
|
let i = n.node;
|
|
739
|
-
i.flags &
|
|
771
|
+
i.flags & N && this._collectErrorsFromDep(i, e);
|
|
740
772
|
}
|
|
741
773
|
return e.length === 0 ? d : Object.freeze(e);
|
|
742
774
|
}
|
|
@@ -751,16 +783,16 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
751
783
|
return this._track(), this._error;
|
|
752
784
|
}
|
|
753
785
|
get isPending() {
|
|
754
|
-
return this._track(), (this.flags &
|
|
786
|
+
return this._track(), (this.flags & A) !== 0;
|
|
755
787
|
}
|
|
756
788
|
get isResolved() {
|
|
757
|
-
return this._track(), (this.flags &
|
|
789
|
+
return this._track(), (this.flags & j) !== 0;
|
|
758
790
|
}
|
|
759
791
|
invalidate() {
|
|
760
|
-
this.flags |=
|
|
792
|
+
this.flags |= Ee, this._markDirty();
|
|
761
793
|
}
|
|
762
794
|
dispose() {
|
|
763
|
-
this.flags &
|
|
795
|
+
this.flags & we || (this._deps.disposeAll(), this._slots?.clear(), this.flags = we | k | O, this._error = null, this._value = void 0, this._hotIndex = -1);
|
|
764
796
|
}
|
|
765
797
|
[Symbol.dispose]() {
|
|
766
798
|
this.dispose();
|
|
@@ -774,43 +806,40 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
774
806
|
let n = new f(e, e.version, e.subscribe(this));
|
|
775
807
|
this._deps.insertNew(t, n);
|
|
776
808
|
}
|
|
777
|
-
e.flags &
|
|
809
|
+
e.flags & Te && (this._deps.hasComputeds = !0), this._trackCount = t + 1;
|
|
778
810
|
}
|
|
779
811
|
_recompute() {
|
|
780
|
-
if (this.flags &
|
|
781
|
-
this.flags = (this.flags |
|
|
812
|
+
if (this.flags & P) return;
|
|
813
|
+
this.flags = (this.flags | P) & ~Ee, this._trackEpoch = ie(), this._trackCount = 0, this._deps.prepareTracking(), this._hotIndex = -1;
|
|
782
814
|
let e = !1;
|
|
783
815
|
try {
|
|
784
|
-
let t =
|
|
785
|
-
this._deps.truncateFrom(this._trackCount), this._deps.seal(), e = !0,
|
|
816
|
+
let t = E.run(this, this._fn);
|
|
817
|
+
this._deps.truncateFrom(this._trackCount), this._deps.seal(), e = !0, Ce(t) ? this._handleAsyncComputation(t) : this._finalizeResolution(t);
|
|
786
818
|
} catch (t) {
|
|
787
819
|
if (!e) try {
|
|
788
820
|
this._deps.truncateFrom(this._trackCount);
|
|
789
821
|
} catch {}
|
|
790
822
|
this._handleError(t, v.COMPUTED_COMPUTATION_FAILED, !0);
|
|
791
823
|
} finally {
|
|
792
|
-
this._trackEpoch = c.UNINITIALIZED, this._trackCount = 0, this.flags &= ~
|
|
824
|
+
this._trackEpoch = c.UNINITIALIZED, this._trackCount = 0, this.flags &= ~P;
|
|
793
825
|
}
|
|
794
826
|
}
|
|
795
827
|
_handleAsyncComputation(e) {
|
|
796
|
-
this.flags = (this.flags |
|
|
828
|
+
this.flags = (this.flags | A) & ~(O | k | j | M), this._notifySubscribers(void 0, void 0), this._asyncRetryCount = 0, this._promiseId = (this._promiseId + 1) % s.MAX_PROMISE_ID;
|
|
797
829
|
let t = this._promiseId;
|
|
798
830
|
e.then((e) => {
|
|
799
831
|
if (t === this._promiseId) {
|
|
800
|
-
if (this.
|
|
801
|
-
let e =
|
|
832
|
+
if (this._isDirty()) {
|
|
833
|
+
let e = le();
|
|
802
834
|
return this._lastDriftEpoch !== e && (this._lastDriftEpoch = e, this._asyncRetryCount = 0), this._asyncRetryCount++ < this._maxAsyncRetries ? this._markDirty() : this._handleError(new h(`Async drift threshold exceeded after ${this._maxAsyncRetries} retries.`), v.COMPUTED_ASYNC_COMPUTATION_FAILED);
|
|
803
835
|
}
|
|
804
836
|
this._finalizeResolution(e), this._notifySubscribers(e, void 0);
|
|
805
837
|
}
|
|
806
838
|
}, (e) => t === this._promiseId && this._handleError(e, v.COMPUTED_ASYNC_COMPUTATION_FAILED));
|
|
807
839
|
}
|
|
808
|
-
_captureVersionSnapshot() {
|
|
809
|
-
return this._deps.captureVersionSnapshot();
|
|
810
|
-
}
|
|
811
840
|
_handleError(e, t, n = !1) {
|
|
812
|
-
let r =
|
|
813
|
-
if (!n && !(this.flags &
|
|
841
|
+
let r = w(e, h, t);
|
|
842
|
+
if (!n && !(this.flags & M) && (this.version = ae(this.version)), this._error = r, this.flags = this.flags & ~(O | k | A | j) | M | N, this._onError) try {
|
|
814
843
|
this._onError(r);
|
|
815
844
|
} catch (e) {
|
|
816
845
|
console.error(v.CALLBACK_ERROR_IN_ERROR_HANDLER, e);
|
|
@@ -819,40 +848,44 @@ var { IDLE: A, DIRTY: j, PENDING: M, RESOLVED: N, REJECTED: P, HAS_ERROR: F, REC
|
|
|
819
848
|
this._notifySubscribers(void 0, void 0);
|
|
820
849
|
}
|
|
821
850
|
_finalizeResolution(e) {
|
|
822
|
-
(!(this.flags &
|
|
851
|
+
(!(this.flags & j) || !this._equal(this._value, e)) && (this.version = ae(this.version)), this._value = e, this._error = null, this.flags = (this.flags | j) & ~(O | k | A | M | N);
|
|
823
852
|
}
|
|
824
853
|
execute() {
|
|
825
854
|
this._markDirty();
|
|
826
855
|
}
|
|
827
856
|
_markDirty() {
|
|
828
|
-
this.flags & (
|
|
857
|
+
this.flags & (P | k) || (this.flags |= k, this._notifySubscribers(void 0, void 0));
|
|
858
|
+
}
|
|
859
|
+
_isDirty() {
|
|
860
|
+
let e = this._deps;
|
|
861
|
+
return e.hasComputeds ? this._deepDirtyCheck() : e.isDirtyFast();
|
|
829
862
|
}
|
|
830
863
|
_deepDirtyCheck() {
|
|
831
|
-
let e = this._deps, t =
|
|
832
|
-
|
|
864
|
+
let e = this._deps, t = E.current;
|
|
865
|
+
E.current = null;
|
|
833
866
|
try {
|
|
834
867
|
let t = e.size;
|
|
835
868
|
for (let n = 0; n < t; n++) {
|
|
836
869
|
let t = e.getAt(n);
|
|
837
870
|
if (t == null) continue;
|
|
838
871
|
let r = t.node;
|
|
839
|
-
if (r.flags &
|
|
872
|
+
if (r.flags & Te) try {
|
|
840
873
|
r.value;
|
|
841
874
|
} catch {}
|
|
842
875
|
if (r.version !== t.version) return this._hotIndex = n, !0;
|
|
843
876
|
}
|
|
844
877
|
return this._hotIndex = -1, !1;
|
|
845
878
|
} finally {
|
|
846
|
-
|
|
879
|
+
E.current = t;
|
|
847
880
|
}
|
|
848
881
|
}
|
|
849
882
|
};
|
|
850
|
-
function
|
|
851
|
-
return new
|
|
883
|
+
function F(e, t = {}) {
|
|
884
|
+
return new De(e, t);
|
|
852
885
|
}
|
|
853
|
-
var
|
|
886
|
+
var Oe = class extends ne {
|
|
854
887
|
constructor(e, t = {}) {
|
|
855
|
-
super(), this[
|
|
888
|
+
super(), this[ge] = !0, this._cleanup = null, this._deps = new be(), this._currentEpoch = c.UNINITIALIZED, this._lastFlushEpoch = c.UNINITIALIZED, this._fn = e, this._onError = t.onError ?? null, this._sync = t.sync ?? !1, this._maxExecutions = t.maxExecutionsPerSecond ?? a.MAX_EXECUTIONS_PER_SECOND, this._maxExecutionsPerFlush = t.maxExecutionsPerFlush ?? a.MAX_EXECUTIONS_PER_EFFECT, this._cleanup = null, this._deps = new be(), this._currentEpoch = c.UNINITIALIZED, this._lastFlushEpoch = c.UNINITIALIZED, this._executionsInEpoch = 0, this._executionCount = 0, this._windowStart = 0, this._windowCount = 0, this._execId = 0, this._trackCount = 0, this._sync ? this._notifyCallback = () => this.execute() : this._notifyCallback = () => T.schedule(this), C.attachDebugInfo(this, "effect", this.id);
|
|
856
889
|
}
|
|
857
890
|
run() {
|
|
858
891
|
if (this.flags & n.DISPOSED) throw new g(v.EFFECT_DISPOSED);
|
|
@@ -869,8 +902,8 @@ var Ee = class extends te {
|
|
|
869
902
|
let t = this._currentEpoch;
|
|
870
903
|
if (e._lastSeenEpoch === t) return;
|
|
871
904
|
e._lastSeenEpoch = t;
|
|
872
|
-
let i = this._trackCount, a = this._deps, o
|
|
873
|
-
o != null && o.node === e ? o.version = e.version : a.claimExisting(e, i) || this._insertNewDependency(e, i), e.flags & r.IS_COMPUTED && (a.hasComputeds = !0), this._trackCount = i + 1;
|
|
905
|
+
let i = this._trackCount, a = this._deps, o;
|
|
906
|
+
o = i === 0 ? a._s0 : i === 1 ? a._s1 : i === 2 ? a._s2 : i === 3 ? a._s3 : a.getAt(i), o != null && o.node === e ? o.version = e.version : a.claimExisting(e, i) || this._insertNewDependency(e, i), e.flags & r.IS_COMPUTED && (a.hasComputeds = !0), this._trackCount = i + 1;
|
|
874
907
|
}
|
|
875
908
|
_insertNewDependency(e, t) {
|
|
876
909
|
let n;
|
|
@@ -878,7 +911,7 @@ var Ee = class extends te {
|
|
|
878
911
|
let t = e.subscribe(this._notifyCallback);
|
|
879
912
|
n = new f(e, e.version, t);
|
|
880
913
|
} catch (t) {
|
|
881
|
-
let r =
|
|
914
|
+
let r = w(t, g, v.EFFECT_EXECUTION_FAILED);
|
|
882
915
|
if (console.error(r), this._onError) try {
|
|
883
916
|
this._onError(r);
|
|
884
917
|
} catch {}
|
|
@@ -890,11 +923,11 @@ var Ee = class extends te {
|
|
|
890
923
|
if (this.flags & (n.DISPOSED | n.EXECUTING)) return;
|
|
891
924
|
let t = this._deps;
|
|
892
925
|
if (!e && t.size > 0 && !this._isDirty()) return;
|
|
893
|
-
this._checkInfiniteLoops(), this.flags |= n.EXECUTING, this._execCleanup(), this._currentEpoch =
|
|
926
|
+
this._checkInfiniteLoops(), this.flags |= n.EXECUTING, this._execCleanup(), this._currentEpoch = ie(), this._trackCount = 0, t.prepareTracking(), this._hotIndex = -1;
|
|
894
927
|
let r = !1;
|
|
895
928
|
try {
|
|
896
|
-
let e =
|
|
897
|
-
t.truncateFrom(this._trackCount), t.seal(), r = !0,
|
|
929
|
+
let e = E.run(this, this._fn);
|
|
930
|
+
t.truncateFrom(this._trackCount), t.seal(), r = !0, Ce(e) ? this._handleAsyncResult(e) : this._cleanup = typeof e == "function" ? e : null;
|
|
898
931
|
} catch (e) {
|
|
899
932
|
if (!r) try {
|
|
900
933
|
t.truncateFrom(this._trackCount);
|
|
@@ -904,6 +937,10 @@ var Ee = class extends te {
|
|
|
904
937
|
this.flags &= ~n.EXECUTING;
|
|
905
938
|
}
|
|
906
939
|
}
|
|
940
|
+
_isDirty() {
|
|
941
|
+
let e = this._deps;
|
|
942
|
+
return e.hasComputeds ? this._deepDirtyCheck() : e.isDirtyFast();
|
|
943
|
+
}
|
|
907
944
|
_handleAsyncResult(e) {
|
|
908
945
|
let t = ++this._execId;
|
|
909
946
|
e.then((e) => {
|
|
@@ -919,8 +956,8 @@ var Ee = class extends te {
|
|
|
919
956
|
}, (e) => t === this._execId && this._handleExecutionError(e));
|
|
920
957
|
}
|
|
921
958
|
_deepDirtyCheck() {
|
|
922
|
-
let e =
|
|
923
|
-
|
|
959
|
+
let e = E.current;
|
|
960
|
+
E.current = null;
|
|
924
961
|
let t = this._deps;
|
|
925
962
|
try {
|
|
926
963
|
let e = t.size;
|
|
@@ -932,7 +969,7 @@ var Ee = class extends te {
|
|
|
932
969
|
}
|
|
933
970
|
return !1;
|
|
934
971
|
} finally {
|
|
935
|
-
|
|
972
|
+
E.current = e;
|
|
936
973
|
}
|
|
937
974
|
}
|
|
938
975
|
_tryPullComputed(e) {
|
|
@@ -951,8 +988,8 @@ var Ee = class extends te {
|
|
|
951
988
|
}
|
|
952
989
|
}
|
|
953
990
|
_checkInfiniteLoops() {
|
|
954
|
-
let e =
|
|
955
|
-
this._lastFlushEpoch !== e && (this._lastFlushEpoch = e, this._executionsInEpoch = 0), ++this._executionsInEpoch > this._maxExecutionsPerFlush && this._throwInfiniteLoopError("per-effect"),
|
|
991
|
+
let e = le();
|
|
992
|
+
this._lastFlushEpoch !== e && (this._lastFlushEpoch = e, this._executionsInEpoch = 0), ++this._executionsInEpoch > this._maxExecutionsPerFlush && this._throwInfiniteLoopError("per-effect"), fe() > a.MAX_EXECUTIONS_PER_FLUSH && this._throwInfiniteLoopError("global"), this._executionCount++;
|
|
956
993
|
}
|
|
957
994
|
_checkFrequencyLimit() {
|
|
958
995
|
if (!Number.isFinite(this._maxExecutions)) return;
|
|
@@ -976,38 +1013,41 @@ var Ee = class extends te {
|
|
|
976
1013
|
return (this.flags & n.EXECUTING) !== 0;
|
|
977
1014
|
}
|
|
978
1015
|
_throwInfiniteLoopError(e) {
|
|
979
|
-
let t = new g(`Infinite loop detected (${e}): effect executed ${this._executionsInEpoch} times in current flush. Total executions in flush: ${
|
|
1016
|
+
let t = new g(`Infinite loop detected (${e}): effect executed ${this._executionsInEpoch} times in current flush. Total executions in flush: ${oe}`);
|
|
980
1017
|
throw this.dispose(), console.error(t), t;
|
|
981
1018
|
}
|
|
982
1019
|
_handleExecutionError(e, t = v.EFFECT_EXECUTION_FAILED) {
|
|
983
|
-
let n =
|
|
1020
|
+
let n = w(e, g, t);
|
|
984
1021
|
if (console.error(n), this._onError) try {
|
|
985
1022
|
this._onError(n);
|
|
986
1023
|
} catch (e) {
|
|
987
|
-
console.error(
|
|
1024
|
+
console.error(w(e, g, v.CALLBACK_ERROR_IN_ERROR_HANDLER));
|
|
988
1025
|
}
|
|
989
1026
|
}
|
|
990
1027
|
};
|
|
991
|
-
function
|
|
1028
|
+
function I(e, t = {}) {
|
|
992
1029
|
if (typeof e != "function") throw new g(v.EFFECT_MUST_BE_FUNCTION);
|
|
993
|
-
let n = new
|
|
1030
|
+
let n = new Oe(e, t);
|
|
994
1031
|
return n.execute(), n;
|
|
995
1032
|
}
|
|
996
|
-
function
|
|
1033
|
+
function ke(e) {
|
|
997
1034
|
if (typeof e != "function") throw TypeError(v.BATCH_CALLBACK_MUST_BE_FUNCTION);
|
|
998
|
-
|
|
1035
|
+
T.startBatch();
|
|
999
1036
|
try {
|
|
1000
1037
|
return e();
|
|
1001
1038
|
} finally {
|
|
1002
|
-
|
|
1039
|
+
T.endBatch();
|
|
1003
1040
|
}
|
|
1004
1041
|
}
|
|
1005
1042
|
//#endregion
|
|
1006
1043
|
//#region src/utils/index.ts
|
|
1007
|
-
function
|
|
1008
|
-
return
|
|
1044
|
+
function L(e) {
|
|
1045
|
+
return xe(e);
|
|
1046
|
+
}
|
|
1047
|
+
function Ae(e) {
|
|
1048
|
+
return !!e && typeof e.then == "function";
|
|
1009
1049
|
}
|
|
1010
|
-
function
|
|
1050
|
+
function R(e) {
|
|
1011
1051
|
let t = e.tagName.toLowerCase();
|
|
1012
1052
|
if (e.id) return `${t}#${e.id}`;
|
|
1013
1053
|
let n = e.classList, r = n.length;
|
|
@@ -1016,8 +1056,8 @@ function z(e) {
|
|
|
1016
1056
|
for (let e = 0; e < r; e++) i += `.${n[e]}`;
|
|
1017
1057
|
return i;
|
|
1018
1058
|
}
|
|
1019
|
-
var
|
|
1020
|
-
function
|
|
1059
|
+
var z = Object.prototype.hasOwnProperty;
|
|
1060
|
+
function je(e, t) {
|
|
1021
1061
|
if (e === t) return !0;
|
|
1022
1062
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
1023
1063
|
let n = Object.keys(e), r = Object.keys(t);
|
|
@@ -1025,52 +1065,37 @@ function ke(e, t) {
|
|
|
1025
1065
|
let i = e, a = t;
|
|
1026
1066
|
for (let e = 0; e < n.length; e++) {
|
|
1027
1067
|
let t = n[e];
|
|
1028
|
-
if (!
|
|
1068
|
+
if (!z.call(a, t) || i[t] !== a[t]) return !1;
|
|
1029
1069
|
}
|
|
1030
1070
|
return !0;
|
|
1031
1071
|
}
|
|
1032
1072
|
//#endregion
|
|
1033
1073
|
//#region src/constants.ts
|
|
1034
|
-
var
|
|
1074
|
+
var B = {
|
|
1035
1075
|
ROUTE: "[atom-route]",
|
|
1036
1076
|
BINDING: "[atom-binding]",
|
|
1037
1077
|
LIST: "[atom-list]",
|
|
1038
1078
|
MOUNT: "[atom-mount]"
|
|
1039
|
-
},
|
|
1079
|
+
}, V = Object.freeze({
|
|
1040
1080
|
mode: "hash",
|
|
1041
1081
|
basePath: "",
|
|
1042
1082
|
autoBindLinks: !1,
|
|
1043
1083
|
activeClass: "active"
|
|
1044
|
-
}),
|
|
1084
|
+
}), Me = {
|
|
1045
1085
|
EVENT: "input",
|
|
1046
1086
|
DEBOUNCE: 0
|
|
1047
|
-
},
|
|
1087
|
+
}, Ne = { HIGHLIGHT_DURATION_MS: 500 }, Pe = new Set([
|
|
1048
1088
|
"input",
|
|
1049
1089
|
"select",
|
|
1050
1090
|
"textarea"
|
|
1051
|
-
]),
|
|
1052
|
-
"src",
|
|
1053
|
-
"href",
|
|
1054
|
-
"action",
|
|
1055
|
-
"formaction",
|
|
1056
|
-
"data",
|
|
1057
|
-
"poster",
|
|
1058
|
-
"background",
|
|
1059
|
-
"cite",
|
|
1060
|
-
"longdesc",
|
|
1061
|
-
"profile",
|
|
1062
|
-
"usemap",
|
|
1063
|
-
"classid",
|
|
1064
|
-
"codebase",
|
|
1065
|
-
"xlink:href"
|
|
1066
|
-
]), Pe = new Set([
|
|
1091
|
+
]), Fe = new Set([
|
|
1067
1092
|
"innerHTML",
|
|
1068
1093
|
"outerHTML",
|
|
1069
1094
|
"srcdoc",
|
|
1070
1095
|
"__proto__",
|
|
1071
1096
|
"constructor",
|
|
1072
1097
|
"prototype"
|
|
1073
|
-
]),
|
|
1098
|
+
]), H = {
|
|
1074
1099
|
ROUTE: {
|
|
1075
1100
|
NOT_FOUND: (e) => `Route "${e}" not found and no notFound route configured`,
|
|
1076
1101
|
TEMPLATE_NOT_FOUND: (e) => `Template "${e}" not found`,
|
|
@@ -1098,8 +1123,8 @@ var V = {
|
|
|
1098
1123
|
CLEANUP_ERROR: (e) => `Cleanup error${e ? ` in component <${e}>` : ""}`
|
|
1099
1124
|
},
|
|
1100
1125
|
CORE: { EFFECT_DISPOSE_ERROR: (e) => `Effect dispose error${e ? `: ${e}` : ""}` }
|
|
1101
|
-
},
|
|
1102
|
-
function
|
|
1126
|
+
}, Ie = `${Ne.HIGHLIGHT_DURATION_MS / 1e3}s`;
|
|
1127
|
+
function Le() {
|
|
1103
1128
|
if (typeof window < "u") {
|
|
1104
1129
|
let e = window.__ATOM_DEBUG__;
|
|
1105
1130
|
if (typeof e == "boolean") return e;
|
|
@@ -1109,16 +1134,16 @@ function Ie() {
|
|
|
1109
1134
|
} catch {}
|
|
1110
1135
|
return !1;
|
|
1111
1136
|
}
|
|
1112
|
-
var
|
|
1137
|
+
var Re = Le(), U = {
|
|
1113
1138
|
get enabled() {
|
|
1114
1139
|
if (typeof window < "u") {
|
|
1115
1140
|
let e = window.__ATOM_DEBUG__;
|
|
1116
1141
|
if (typeof e == "boolean") return e;
|
|
1117
1142
|
}
|
|
1118
|
-
return
|
|
1143
|
+
return Re;
|
|
1119
1144
|
},
|
|
1120
1145
|
set enabled(e) {
|
|
1121
|
-
|
|
1146
|
+
Re = e;
|
|
1122
1147
|
},
|
|
1123
1148
|
log(e, ...t) {
|
|
1124
1149
|
this.enabled && console.log(`${e}`, ...t);
|
|
@@ -1129,7 +1154,7 @@ var Le = Ie(), W = {
|
|
|
1129
1154
|
domUpdated(e, t, n, r) {
|
|
1130
1155
|
if (!this.enabled) return;
|
|
1131
1156
|
let i = t instanceof Element ? t : t[0];
|
|
1132
|
-
i && (console.log(`${e} DOM updated: ${
|
|
1157
|
+
i && (console.log(`${e} DOM updated: ${R(i)}.${n} =`, r), We(i));
|
|
1133
1158
|
},
|
|
1134
1159
|
cleanup(e, t) {
|
|
1135
1160
|
this.enabled && console.log(`${e} Cleanup: ${t}`);
|
|
@@ -1140,60 +1165,60 @@ var Le = Ie(), W = {
|
|
|
1140
1165
|
error(e, t, n) {
|
|
1141
1166
|
console.error(`${e} ${t}`, n);
|
|
1142
1167
|
}
|
|
1143
|
-
},
|
|
1144
|
-
function
|
|
1145
|
-
if ((
|
|
1168
|
+
}, ze = "atom-debug-highlight", Be = "data-atom-debug", W;
|
|
1169
|
+
function Ve() {
|
|
1170
|
+
if ((W instanceof HTMLStyleElement ? W : W?.deref())?.isConnected || document.querySelector(`style[${Be}]`)) return;
|
|
1146
1171
|
let e = document.createElement("style");
|
|
1147
|
-
e.setAttribute(
|
|
1172
|
+
e.setAttribute(Be, ""), e.textContent = `.${ze}{outline:2px solid rgba(255,68,68,0.8);outline-offset:1px;transition:outline ${Ie} ease-out}`, document.head.appendChild(e), W = typeof WeakRef < "u" ? new WeakRef(e) : e;
|
|
1148
1173
|
}
|
|
1149
|
-
var
|
|
1150
|
-
function
|
|
1151
|
-
if (!
|
|
1152
|
-
|
|
1153
|
-
let t =
|
|
1174
|
+
var He = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap();
|
|
1175
|
+
function We(e) {
|
|
1176
|
+
if (!U.enabled || !e.isConnected) return;
|
|
1177
|
+
Ve();
|
|
1178
|
+
let t = Ue.get(e);
|
|
1154
1179
|
t !== void 0 && cancelAnimationFrame(t);
|
|
1155
|
-
let n =
|
|
1180
|
+
let n = He.get(e);
|
|
1156
1181
|
n !== void 0 && clearTimeout(n);
|
|
1157
1182
|
let r = requestAnimationFrame(() => {
|
|
1158
|
-
|
|
1159
|
-
e.isConnected && e.classList.remove(
|
|
1160
|
-
},
|
|
1183
|
+
Ue.delete(e), e.isConnected && (e.classList.add(ze), He.set(e, setTimeout(() => {
|
|
1184
|
+
e.isConnected && e.classList.remove(ze), He.delete(e);
|
|
1185
|
+
}, Ne.HIGHLIGHT_DURATION_MS)));
|
|
1161
1186
|
});
|
|
1162
|
-
|
|
1187
|
+
Ue.set(e, r);
|
|
1163
1188
|
}
|
|
1164
1189
|
//#endregion
|
|
1165
1190
|
//#region src/core/namespace.ts
|
|
1166
|
-
function
|
|
1167
|
-
return
|
|
1191
|
+
function Ge(e, t) {
|
|
1192
|
+
return ye(e, t);
|
|
1168
1193
|
}
|
|
1169
|
-
Object.defineProperty(
|
|
1194
|
+
Object.defineProperty(Ge, "debug", {
|
|
1170
1195
|
enumerable: !0,
|
|
1171
1196
|
configurable: !0,
|
|
1172
1197
|
get() {
|
|
1173
|
-
return
|
|
1198
|
+
return U.enabled;
|
|
1174
1199
|
},
|
|
1175
1200
|
set(e) {
|
|
1176
|
-
|
|
1201
|
+
U.enabled = e;
|
|
1177
1202
|
}
|
|
1178
1203
|
});
|
|
1179
|
-
function
|
|
1204
|
+
function Ke() {
|
|
1180
1205
|
return new Promise((e) => setTimeout(e, 0));
|
|
1181
1206
|
}
|
|
1182
|
-
var
|
|
1183
|
-
atom:
|
|
1184
|
-
computed:
|
|
1185
|
-
effect:
|
|
1186
|
-
batch:
|
|
1187
|
-
untracked:
|
|
1188
|
-
isAtom:
|
|
1189
|
-
isComputed:
|
|
1190
|
-
isReactive:
|
|
1191
|
-
nextTick:
|
|
1207
|
+
var qe = {
|
|
1208
|
+
atom: Ge,
|
|
1209
|
+
computed: F,
|
|
1210
|
+
effect: I,
|
|
1211
|
+
batch: ke,
|
|
1212
|
+
untracked: D,
|
|
1213
|
+
isAtom: xe,
|
|
1214
|
+
isComputed: Se,
|
|
1215
|
+
isReactive: L,
|
|
1216
|
+
nextTick: Ke
|
|
1192
1217
|
};
|
|
1193
|
-
e.extend(
|
|
1218
|
+
e.extend(qe);
|
|
1194
1219
|
//#endregion
|
|
1195
1220
|
//#region src/utils/array-pool.ts
|
|
1196
|
-
var
|
|
1221
|
+
var Je = class {
|
|
1197
1222
|
constructor(e = 50, t = 256) {
|
|
1198
1223
|
this.limit = e, this.capacity = t, this.pool = [];
|
|
1199
1224
|
}
|
|
@@ -1206,7 +1231,7 @@ var qe = class {
|
|
|
1206
1231
|
reset() {
|
|
1207
1232
|
this.pool.length = 0;
|
|
1208
1233
|
}
|
|
1209
|
-
},
|
|
1234
|
+
}, Ye = class {
|
|
1210
1235
|
constructor(e, t, n = 64) {
|
|
1211
1236
|
this.factory = e, this.reset = t, this.limit = n, this.pool = [];
|
|
1212
1237
|
}
|
|
@@ -1222,13 +1247,13 @@ var qe = class {
|
|
|
1222
1247
|
get size() {
|
|
1223
1248
|
return this.pool.length;
|
|
1224
1249
|
}
|
|
1225
|
-
},
|
|
1250
|
+
}, Xe = new Je(), Ze = new Je(), Qe = new Ye(() => ({
|
|
1226
1251
|
effects: void 0,
|
|
1227
1252
|
cleanups: void 0,
|
|
1228
1253
|
componentCleanup: void 0
|
|
1229
1254
|
}), (e) => {
|
|
1230
1255
|
e.effects = void 0, e.cleanups = void 0, e.componentCleanup = void 0;
|
|
1231
|
-
}, 128),
|
|
1256
|
+
}, 128), G = "_aes-bound", K = new class {
|
|
1232
1257
|
constructor() {
|
|
1233
1258
|
this.records = /* @__PURE__ */ new WeakMap(), this.preservedNodes = /* @__PURE__ */ new WeakSet(), this.ignoredNodes = /* @__PURE__ */ new WeakSet();
|
|
1234
1259
|
}
|
|
@@ -1246,15 +1271,15 @@ var qe = class {
|
|
|
1246
1271
|
}
|
|
1247
1272
|
getOrCreateRecord(e) {
|
|
1248
1273
|
let t = this.records.get(e);
|
|
1249
|
-
return t || (t =
|
|
1274
|
+
return t || (t = Qe.acquire(), this.records.set(e, t), e.classList.add(G)), t;
|
|
1250
1275
|
}
|
|
1251
1276
|
trackEffect(e, t) {
|
|
1252
1277
|
let n = this.getOrCreateRecord(e);
|
|
1253
|
-
n.effects ??=
|
|
1278
|
+
n.effects ??= Xe.acquire(), n.effects.push(t);
|
|
1254
1279
|
}
|
|
1255
1280
|
trackCleanup(e, t) {
|
|
1256
1281
|
let n = this.getOrCreateRecord(e);
|
|
1257
|
-
n.cleanups ??=
|
|
1282
|
+
n.cleanups ??= Ze.acquire(), n.cleanups.push(t);
|
|
1258
1283
|
}
|
|
1259
1284
|
setComponentCleanup(e, t) {
|
|
1260
1285
|
let n = this.getOrCreateRecord(e);
|
|
@@ -1266,118 +1291,118 @@ var qe = class {
|
|
|
1266
1291
|
cleanup(e) {
|
|
1267
1292
|
let t = this.records.get(e);
|
|
1268
1293
|
if (!t) {
|
|
1269
|
-
e.nodeType === 1 && e.classList.remove(
|
|
1294
|
+
e.nodeType === 1 && e.classList.remove(G), this.preservedNodes.delete(e), this.ignoredNodes.delete(e);
|
|
1270
1295
|
return;
|
|
1271
1296
|
}
|
|
1272
|
-
if (this.records.delete(e), this.preservedNodes.delete(e), this.ignoredNodes.delete(e), e.nodeType === 1 && e.classList.remove(
|
|
1273
|
-
let t = e.nodeType === 1 ?
|
|
1274
|
-
|
|
1297
|
+
if (this.records.delete(e), this.preservedNodes.delete(e), this.ignoredNodes.delete(e), e.nodeType === 1 && e.classList.remove(G), U.enabled) {
|
|
1298
|
+
let t = e.nodeType === 1 ? R(e) : e.nodeName || "Node";
|
|
1299
|
+
U.cleanup(B.BINDING, t);
|
|
1275
1300
|
}
|
|
1276
1301
|
if (t.componentCleanup) try {
|
|
1277
1302
|
t.componentCleanup();
|
|
1278
1303
|
} catch (t) {
|
|
1279
|
-
let n = e.nodeType === 1 ?
|
|
1280
|
-
|
|
1304
|
+
let n = e.nodeType === 1 ? R(e) : "Node";
|
|
1305
|
+
U.error(B.MOUNT, H.MOUNT.CLEANUP_ERROR(n), t);
|
|
1281
1306
|
}
|
|
1282
1307
|
if (t.effects) {
|
|
1283
1308
|
let n = t.effects;
|
|
1284
1309
|
for (let t = 0, r = n.length; t < r; t++) try {
|
|
1285
1310
|
n[t].dispose();
|
|
1286
1311
|
} catch (t) {
|
|
1287
|
-
let n = e.nodeType === 1 ?
|
|
1288
|
-
|
|
1312
|
+
let n = e.nodeType === 1 ? R(e) : "Node";
|
|
1313
|
+
U.error(B.BINDING, H.CORE.EFFECT_DISPOSE_ERROR(n), t);
|
|
1289
1314
|
}
|
|
1290
|
-
|
|
1315
|
+
Xe.release(n), t.effects = void 0;
|
|
1291
1316
|
}
|
|
1292
1317
|
if (t.cleanups) {
|
|
1293
1318
|
let n = t.cleanups;
|
|
1294
1319
|
for (let t = 0, r = n.length; t < r; t++) try {
|
|
1295
1320
|
n[t]();
|
|
1296
1321
|
} catch (t) {
|
|
1297
|
-
let n = e.nodeType === 1 ?
|
|
1298
|
-
|
|
1322
|
+
let n = e.nodeType === 1 ? R(e) : "Node";
|
|
1323
|
+
U.error(B.BINDING, H.BINDING.CLEANUP_ERROR(n), t);
|
|
1299
1324
|
}
|
|
1300
|
-
|
|
1325
|
+
Ze.release(n), t.cleanups = void 0;
|
|
1301
1326
|
}
|
|
1302
|
-
|
|
1327
|
+
Qe.release(t);
|
|
1303
1328
|
}
|
|
1304
1329
|
cleanupDescendants(e) {
|
|
1305
|
-
let t = "getElementsByClassName" in e && typeof e.getElementsByClassName == "function" ? e.getElementsByClassName(
|
|
1330
|
+
let t = "getElementsByClassName" in e && typeof e.getElementsByClassName == "function" ? e.getElementsByClassName(G) : e.querySelectorAll(`.${G}`);
|
|
1306
1331
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
1307
1332
|
let n = t[e];
|
|
1308
|
-
n && (this.records.has(n) ? this.cleanup(n) : (n.classList.remove(
|
|
1333
|
+
n && (this.records.has(n) ? this.cleanup(n) : (n.classList.remove(G), U.enabled && U.warn(B.BINDING, `${G} class found on unregistered element:`, n)));
|
|
1309
1334
|
}
|
|
1310
1335
|
}
|
|
1311
1336
|
cleanupTree(e) {
|
|
1312
1337
|
(e.nodeType === 1 || e.nodeType === 11) && this.cleanupDescendants(e), this.cleanup(e);
|
|
1313
1338
|
}
|
|
1314
|
-
}(),
|
|
1315
|
-
function
|
|
1316
|
-
if (
|
|
1339
|
+
}(), $e = /* @__PURE__ */ new Map();
|
|
1340
|
+
function et(e) {
|
|
1341
|
+
if ($e.has(e)) return;
|
|
1317
1342
|
let t = new MutationObserver((e) => {
|
|
1318
1343
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
1319
1344
|
let n = e[t].removedNodes;
|
|
1320
1345
|
for (let e = 0, t = n.length; e < t; e++) {
|
|
1321
1346
|
let t = n[e];
|
|
1322
|
-
t.nodeType === 1 && (t.isConnected ||
|
|
1347
|
+
t.nodeType === 1 && (t.isConnected || K.isKept(t) || K.isIgnored(t) || K.cleanupTree(t));
|
|
1323
1348
|
}
|
|
1324
1349
|
}
|
|
1325
1350
|
});
|
|
1326
1351
|
t.observe(e, {
|
|
1327
1352
|
childList: !0,
|
|
1328
1353
|
subtree: !0
|
|
1329
|
-
}),
|
|
1354
|
+
}), $e.set(e, t);
|
|
1330
1355
|
}
|
|
1331
|
-
function
|
|
1332
|
-
|
|
1356
|
+
function tt() {
|
|
1357
|
+
$e.forEach((e) => e.disconnect()), $e.clear();
|
|
1333
1358
|
}
|
|
1334
1359
|
//#endregion
|
|
1335
1360
|
//#region src/core/jquery-patch.ts
|
|
1336
|
-
var
|
|
1337
|
-
if (e[
|
|
1338
|
-
let t =
|
|
1361
|
+
var nt = Symbol("atom-effect-internal"), rt = /* @__PURE__ */ new WeakMap(), q = null, it = (e) => {
|
|
1362
|
+
if (e[nt]) return e;
|
|
1363
|
+
let t = rt.get(e);
|
|
1339
1364
|
return t || (t = function(...t) {
|
|
1340
|
-
return
|
|
1341
|
-
}, t[
|
|
1365
|
+
return ke(() => e.apply(this, t));
|
|
1366
|
+
}, t[nt] = !0, rt.set(e, t)), t;
|
|
1342
1367
|
};
|
|
1343
|
-
function
|
|
1368
|
+
function at(e) {
|
|
1344
1369
|
let t = {}, n = Object.entries(e);
|
|
1345
1370
|
for (let e = 0, r = n.length; e < r; e++) {
|
|
1346
1371
|
let r = n[e], i = r[0], a = r[1];
|
|
1347
|
-
a && (t[i] =
|
|
1372
|
+
a && (t[i] = it(a));
|
|
1348
1373
|
}
|
|
1349
1374
|
return t;
|
|
1350
1375
|
}
|
|
1351
|
-
function
|
|
1376
|
+
function ot(e) {
|
|
1352
1377
|
let t = {}, n = Object.entries(e);
|
|
1353
1378
|
for (let e = 0, r = n.length; e < r; e++) {
|
|
1354
1379
|
let r = n[e], i = r[0], a = r[1];
|
|
1355
|
-
t[i] = a ?
|
|
1380
|
+
t[i] = a ? rt.get(a) ?? a : void 0;
|
|
1356
1381
|
}
|
|
1357
1382
|
return t;
|
|
1358
1383
|
}
|
|
1359
|
-
function
|
|
1360
|
-
if (
|
|
1361
|
-
|
|
1384
|
+
function st() {
|
|
1385
|
+
if (q !== null) return;
|
|
1386
|
+
q = {
|
|
1362
1387
|
on: e.fn.on,
|
|
1363
1388
|
off: e.fn.off,
|
|
1364
1389
|
remove: e.fn.remove,
|
|
1365
1390
|
empty: e.fn.empty,
|
|
1366
1391
|
detach: e.fn.detach
|
|
1367
1392
|
};
|
|
1368
|
-
let t =
|
|
1393
|
+
let t = q;
|
|
1369
1394
|
e.fn.remove = function(e) {
|
|
1370
1395
|
let n = e ? this.filter(e) : this;
|
|
1371
1396
|
for (let e = 0, t = n.length; e < t; e++) {
|
|
1372
1397
|
let t = n[e];
|
|
1373
|
-
t && (
|
|
1398
|
+
t && (K.markIgnored(t), K.cleanupTree(t));
|
|
1374
1399
|
}
|
|
1375
1400
|
let r = t.remove.call(this, e);
|
|
1376
1401
|
return r === void 0 ? this : r;
|
|
1377
1402
|
}, e.fn.empty = function() {
|
|
1378
1403
|
for (let e = 0, t = this.length; e < t; e++) {
|
|
1379
1404
|
let t = this[e];
|
|
1380
|
-
t?.hasChildNodes() &&
|
|
1405
|
+
t?.hasChildNodes() && K.cleanupDescendants(t);
|
|
1381
1406
|
}
|
|
1382
1407
|
let e = t.empty.call(this);
|
|
1383
1408
|
return e === void 0 ? this : e;
|
|
@@ -1385,67 +1410,67 @@ function ot() {
|
|
|
1385
1410
|
let n = e ? this.filter(e) : this;
|
|
1386
1411
|
for (let e = 0, t = n.length; e < t; e++) {
|
|
1387
1412
|
let t = n[e];
|
|
1388
|
-
t &&
|
|
1413
|
+
t && K.keep(t);
|
|
1389
1414
|
}
|
|
1390
1415
|
let r = t.detach.call(this, e);
|
|
1391
1416
|
return r === void 0 ? this : r;
|
|
1392
1417
|
}, e.fn.on = function(...e) {
|
|
1393
1418
|
let n = e[0];
|
|
1394
|
-
if (n && typeof n == "object") e[0] =
|
|
1419
|
+
if (n && typeof n == "object") e[0] = at(n);
|
|
1395
1420
|
else {
|
|
1396
1421
|
let t = e.length - 1;
|
|
1397
|
-
t >= 0 && typeof e[t] == "function" && (e[t] =
|
|
1422
|
+
t >= 0 && typeof e[t] == "function" && (e[t] = it(e[t]));
|
|
1398
1423
|
}
|
|
1399
1424
|
let r = t.on.apply(this, e);
|
|
1400
1425
|
return r === void 0 ? this : r;
|
|
1401
1426
|
}, e.fn.off = function(...e) {
|
|
1402
1427
|
let n = e[0];
|
|
1403
|
-
if (n && typeof n == "object") e[0] =
|
|
1428
|
+
if (n && typeof n == "object") e[0] = ot(n);
|
|
1404
1429
|
else {
|
|
1405
1430
|
let t = e.length - 1;
|
|
1406
1431
|
if (t >= 0 && typeof e[t] == "function") {
|
|
1407
1432
|
let n = e[t];
|
|
1408
|
-
e[t] =
|
|
1433
|
+
e[t] = rt.get(n) ?? n;
|
|
1409
1434
|
}
|
|
1410
1435
|
}
|
|
1411
1436
|
let r = t.off.apply(this, e);
|
|
1412
1437
|
return r === void 0 ? this : r;
|
|
1413
1438
|
};
|
|
1414
1439
|
}
|
|
1415
|
-
function
|
|
1416
|
-
|
|
1440
|
+
function ct() {
|
|
1441
|
+
q !== null && (e.fn.on = q.on, e.fn.off = q.off, e.fn.remove = q.remove, e.fn.empty = q.empty, e.fn.detach = q.detach, q = null);
|
|
1417
1442
|
}
|
|
1418
1443
|
//#endregion
|
|
1419
1444
|
//#region src/types.ts
|
|
1420
|
-
var
|
|
1445
|
+
var J = /* @__PURE__ */ function(e) {
|
|
1421
1446
|
return e[e.None = 0] = "None", e[e.Focused = 1] = "Focused", e[e.Composing = 2] = "Composing", e[e.SyncingToAtom = 4] = "SyncingToAtom", e[e.SyncingToDom = 8] = "SyncingToDom", e[e.Busy = 14] = "Busy", e;
|
|
1422
|
-
}({}),
|
|
1423
|
-
function
|
|
1424
|
-
e[
|
|
1447
|
+
}({}), lt = 0;
|
|
1448
|
+
function Y(e) {
|
|
1449
|
+
e[nt] = !0;
|
|
1425
1450
|
}
|
|
1426
|
-
var
|
|
1451
|
+
var ut = class {
|
|
1427
1452
|
constructor(e, t, n) {
|
|
1428
1453
|
this.flags = 0, this.timeoutId = void 0, this.handleCompositionStart = () => {
|
|
1429
|
-
this.flags |=
|
|
1454
|
+
this.flags |= J.Composing;
|
|
1430
1455
|
}, this.handleCompositionEnd = () => {
|
|
1431
|
-
this.flags &= ~
|
|
1456
|
+
this.flags &= ~J.Composing, this.handleInput();
|
|
1432
1457
|
}, this.handleFocus = () => {
|
|
1433
|
-
this.flags |=
|
|
1458
|
+
this.flags |= J.Focused;
|
|
1434
1459
|
}, this.handleBlur = () => {
|
|
1435
|
-
this.flags &= ~
|
|
1436
|
-
let e = !!(this.flags &
|
|
1437
|
-
this.flags &= ~
|
|
1460
|
+
this.flags &= ~J.Focused;
|
|
1461
|
+
let e = !!(this.flags & J.Composing);
|
|
1462
|
+
this.flags &= ~J.Composing, this.flushPendingDebounce(), e && this.timeoutId === void 0 && this.syncAtomFromDom(), this.normalizeDomValue();
|
|
1438
1463
|
}, this.syncDomFromAtom = () => {
|
|
1439
1464
|
let e = this.atom.value;
|
|
1440
|
-
|
|
1465
|
+
D(() => {
|
|
1441
1466
|
let t = this.format(e), n;
|
|
1442
1467
|
if (n = this.isMultipleSelect ? this.$el.val() || [] : this.el.value, this.equal(n, e)) return;
|
|
1443
|
-
let r = !!(this.flags &
|
|
1468
|
+
let r = !!(this.flags & J.Focused);
|
|
1444
1469
|
if (r) try {
|
|
1445
1470
|
let t = this.isMultipleSelect ? n : this.parse(this.el.value);
|
|
1446
1471
|
if (this.equal(t, e)) return;
|
|
1447
1472
|
} catch {}
|
|
1448
|
-
this.flags |=
|
|
1473
|
+
this.flags |= J.SyncingToDom;
|
|
1449
1474
|
try {
|
|
1450
1475
|
if (this.isMultipleSelect) this.$el.val(e);
|
|
1451
1476
|
else if (r && (this.el instanceof HTMLInputElement || this.el instanceof HTMLTextAreaElement)) try {
|
|
@@ -1457,22 +1482,22 @@ var lt = class {
|
|
|
1457
1482
|
this.el.value = t;
|
|
1458
1483
|
}
|
|
1459
1484
|
else this.el.value = t;
|
|
1460
|
-
|
|
1485
|
+
U.enabled && U.domUpdated(B.BINDING, this.$el, "val", t);
|
|
1461
1486
|
} finally {
|
|
1462
|
-
this.flags &= ~
|
|
1487
|
+
this.flags &= ~J.SyncingToDom;
|
|
1463
1488
|
}
|
|
1464
1489
|
});
|
|
1465
1490
|
}, this.cleanup = () => {
|
|
1466
1491
|
this.$el.off(this.ns), clearTimeout(this.timeoutId), this.timeoutId = void 0;
|
|
1467
|
-
}, this.$el = e, this.el = e[0], this.atom = t, this.isMultipleSelect = this.el.tagName === "SELECT" && this.el.multiple, this.ns = `.atomBind-${++
|
|
1468
|
-
let r = n.debounce ?? 0, i = n.event ??
|
|
1492
|
+
}, this.$el = e, this.el = e[0], this.atom = t, this.isMultipleSelect = this.el.tagName === "SELECT" && this.el.multiple, this.ns = `.atomBind-${++lt}`;
|
|
1493
|
+
let r = n.debounce ?? 0, i = n.event ?? Me.EVENT;
|
|
1469
1494
|
this.parse = n.parse ?? ((e) => e), this.format = n.format ?? ((e) => this.isMultipleSelect ? (Array.isArray(e) ? e : e ? [String(e)] : []).join(",") : String(e ?? ""));
|
|
1470
1495
|
let a = n.equal ?? Object.is;
|
|
1471
1496
|
this.equal = (e, t) => a(e, t) ? !0 : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((e, n) => Object.is(e, t[n])) : !1, r > 0 ? this.handleInput = () => {
|
|
1472
|
-
this.flags &
|
|
1497
|
+
this.flags & J.Composing || (clearTimeout(this.timeoutId), this.timeoutId = setTimeout(() => this.syncAtomFromDom(), r));
|
|
1473
1498
|
} : this.handleInput = () => {
|
|
1474
|
-
this.flags &
|
|
1475
|
-
},
|
|
1499
|
+
this.flags & J.Composing || this.syncAtomFromDom();
|
|
1500
|
+
}, Y(this.handleFocus), Y(this.handleBlur), Y(this.handleCompositionStart), Y(this.handleCompositionEnd), Y(this.handleInput), this.bindEvents(i);
|
|
1476
1501
|
}
|
|
1477
1502
|
flushPendingDebounce() {
|
|
1478
1503
|
this.timeoutId !== void 0 && (clearTimeout(this.timeoutId), this.timeoutId = void 0, this.syncAtomFromDom());
|
|
@@ -1485,17 +1510,17 @@ var lt = class {
|
|
|
1485
1510
|
} else this.el.value !== e && (this.el.value = e);
|
|
1486
1511
|
}
|
|
1487
1512
|
syncAtomFromDom() {
|
|
1488
|
-
if (!(this.flags &
|
|
1489
|
-
this.flags |=
|
|
1513
|
+
if (!(this.flags & J.Busy)) {
|
|
1514
|
+
this.flags |= J.SyncingToAtom;
|
|
1490
1515
|
try {
|
|
1491
1516
|
let e;
|
|
1492
1517
|
e = this.isMultipleSelect ? this.$el.val() || [] : this.el.value;
|
|
1493
1518
|
let t = this.parse(e);
|
|
1494
1519
|
this.equal(this.atom.peek(), t) || (this.atom.value = t);
|
|
1495
1520
|
} catch (e) {
|
|
1496
|
-
|
|
1521
|
+
U.warn(B.BINDING, H.BINDING.PARSE_ERROR(e instanceof Error ? e.message : String(e)), e);
|
|
1497
1522
|
} finally {
|
|
1498
|
-
this.flags &= ~
|
|
1523
|
+
this.flags &= ~J.SyncingToAtom;
|
|
1499
1524
|
}
|
|
1500
1525
|
}
|
|
1501
1526
|
}
|
|
@@ -1504,74 +1529,100 @@ var lt = class {
|
|
|
1504
1529
|
this.$el.on(`focus${t}`, this.handleFocus).on(`blur${t}`, this.handleBlur).on(`compositionstart${t}`, this.handleCompositionStart).on(`compositionend${t}`, this.handleCompositionEnd).on(n, this.handleInput);
|
|
1505
1530
|
}
|
|
1506
1531
|
};
|
|
1507
|
-
function
|
|
1508
|
-
let r = new
|
|
1532
|
+
function dt(e, t, n) {
|
|
1533
|
+
let r = new ut(e, t, n);
|
|
1509
1534
|
return {
|
|
1510
|
-
fx:
|
|
1535
|
+
fx: I(r.syncDomFromAtom),
|
|
1511
1536
|
cleanup: r.cleanup
|
|
1512
1537
|
};
|
|
1513
1538
|
}
|
|
1514
1539
|
//#endregion
|
|
1515
1540
|
//#region src/core/effect-factory.ts
|
|
1516
|
-
function
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1541
|
+
function ft(e, t, n, r) {
|
|
1542
|
+
let i = null, a = (t) => {
|
|
1543
|
+
if (Ae(t)) {
|
|
1544
|
+
let a = t;
|
|
1545
|
+
i = a, a.then((t) => {
|
|
1546
|
+
i === a && D(() => {
|
|
1547
|
+
try {
|
|
1548
|
+
n(t), U.enabled && U.domUpdated(B.BINDING, e, `${r} (async)`, t);
|
|
1549
|
+
} catch (e) {
|
|
1550
|
+
U.error(B.BINDING, H.BINDING.UPDATER_ERROR(r), e);
|
|
1551
|
+
}
|
|
1552
|
+
});
|
|
1553
|
+
}).catch((e) => {
|
|
1554
|
+
i === a && U.error(B.BINDING, H.BINDING.UPDATER_ERROR(r), e);
|
|
1529
1555
|
});
|
|
1530
|
-
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1556
|
+
} else {
|
|
1557
|
+
i = null;
|
|
1558
|
+
try {
|
|
1559
|
+
n(t), U.enabled && U.domUpdated(B.BINDING, e, r, t);
|
|
1560
|
+
} catch (e) {
|
|
1561
|
+
U.error(B.BINDING, H.BINDING.UPDATER_ERROR(r, !0), e);
|
|
1562
|
+
}
|
|
1537
1563
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1564
|
+
};
|
|
1565
|
+
L(t) ? K.trackEffect(e, I(() => {
|
|
1566
|
+
let e = t.value;
|
|
1567
|
+
D(() => a(e));
|
|
1568
|
+
}, { name: r })) : typeof t == "function" ? K.trackEffect(e, I(() => {
|
|
1569
|
+
let e = t();
|
|
1570
|
+
D(() => a(e));
|
|
1571
|
+
}, { name: r })) : D(() => a(t));
|
|
1540
1572
|
}
|
|
1541
|
-
function
|
|
1573
|
+
function pt(e, t, n, r) {
|
|
1542
1574
|
let i = Object.keys(t), a = [], o = {};
|
|
1543
1575
|
for (let e = 0; e < i.length; e++) {
|
|
1544
1576
|
let n = i[e], r = t[n];
|
|
1545
|
-
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
let i =
|
|
1549
|
-
for (let e = 0; e <
|
|
1550
|
-
let n =
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1577
|
+
L(r) || typeof r == "function" ? a.push(n) : o[n] = r;
|
|
1578
|
+
}
|
|
1579
|
+
let s = 0, c = (t) => {
|
|
1580
|
+
let i = Object.keys(t), a = [], o = {};
|
|
1581
|
+
for (let e = 0; e < i.length; e++) {
|
|
1582
|
+
let n = i[e], r = t[n];
|
|
1583
|
+
Ae(r) ? a.push(r.then((e) => ({
|
|
1584
|
+
key: n,
|
|
1585
|
+
val: e
|
|
1586
|
+
}))) : o[n] = r;
|
|
1587
|
+
}
|
|
1588
|
+
if (a.length > 0) {
|
|
1589
|
+
let t = ++s;
|
|
1590
|
+
Promise.all(a).then((i) => {
|
|
1591
|
+
if (t === s) {
|
|
1592
|
+
for (let e = 0; e < i.length; e++) {
|
|
1593
|
+
let { key: t, val: n } = i[e];
|
|
1594
|
+
o[t] = n;
|
|
1595
|
+
}
|
|
1596
|
+
D(() => {
|
|
1597
|
+
try {
|
|
1598
|
+
n(o), U.enabled && U.domUpdated(B.BINDING, e, `${r} (async)`, o);
|
|
1599
|
+
} catch (e) {
|
|
1600
|
+
U.error(B.BINDING, H.BINDING.UPDATER_ERROR(r), e);
|
|
1601
|
+
}
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
});
|
|
1605
|
+
} else {
|
|
1606
|
+
s++;
|
|
1554
1607
|
try {
|
|
1555
|
-
n(
|
|
1608
|
+
n(o), U.enabled && U.domUpdated(B.BINDING, e, r, o);
|
|
1556
1609
|
} catch (e) {
|
|
1557
|
-
|
|
1558
|
-
return;
|
|
1610
|
+
U.error(B.BINDING, H.BINDING.UPDATER_ERROR(r, !0), e);
|
|
1559
1611
|
}
|
|
1560
|
-
W.enabled && W.domUpdated(V.BINDING, e, r, i);
|
|
1561
|
-
});
|
|
1562
|
-
}, { name: r })) : O(() => {
|
|
1563
|
-
try {
|
|
1564
|
-
n(o);
|
|
1565
|
-
} catch (e) {
|
|
1566
|
-
W.error(V.BINDING, U.BINDING.UPDATER_ERROR(r, !0), e);
|
|
1567
|
-
return;
|
|
1568
1612
|
}
|
|
1569
|
-
|
|
1570
|
-
|
|
1613
|
+
};
|
|
1614
|
+
a.length > 0 ? K.trackEffect(e, I(() => {
|
|
1615
|
+
let e = { ...o };
|
|
1616
|
+
for (let n = 0; n < a.length; n++) {
|
|
1617
|
+
let r = a[n], i = t[r];
|
|
1618
|
+
e[r] = L(i) ? i.value : i();
|
|
1619
|
+
}
|
|
1620
|
+
D(() => c(e));
|
|
1621
|
+
}, { name: r })) : D(() => c(o));
|
|
1571
1622
|
}
|
|
1572
1623
|
//#endregion
|
|
1573
1624
|
//#region src/utils/sanitize.ts
|
|
1574
|
-
var
|
|
1625
|
+
var mt = new Set([
|
|
1575
1626
|
"href",
|
|
1576
1627
|
"src",
|
|
1577
1628
|
"action",
|
|
@@ -1586,144 +1637,157 @@ var pt = new Set([
|
|
|
1586
1637
|
"usemap",
|
|
1587
1638
|
"classid",
|
|
1588
1639
|
"codebase"
|
|
1589
|
-
]),
|
|
1640
|
+
]), ht = /^\s*(?:javascript|vbscript)\s*:/i, gt = /(?:expression\s*\(|behavior\s*:|-moz-binding\s*:|(?:\\[0-9a-f]{1,6}\s*|[\s\x00-\x20/'"])*(?:j\s*a\s*v\s*a\s*s\s*c\s*r\s*i\s*p\s*t|v\s*b\s*s\s*c\s*r\s*i\s*p\s*t|d\s*a\s*t\s*a)\s*:(?!image\/))/i, _t = /url\s*\(\s*(?:["']?\s*)?(?:javascript|vbscript)\s*:/i, vt = /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, yt = /&#x([0-9a-f]+);?|&#([0-9]+);?/gi, bt = {
|
|
1590
1641
|
colon: ":",
|
|
1591
1642
|
Tab: " ",
|
|
1592
1643
|
NewLine: "\n"
|
|
1593
|
-
},
|
|
1594
|
-
function
|
|
1644
|
+
}, xt = /&(colon|Tab|NewLine);/g, St = /<\?[\s\S]*?\?>/g, Ct = /(<(script|iframe|object|embed|base|meta|applet|noscript|form|style|link)\b[^>]*>([\s\S]*?)<\/\2>|<(script|iframe|object|embed|base|meta|applet|noscript|form|style|link)\b[^>]*\/?>)/gi, wt = /(j\s*a\s*v\s*a\s*s\s*c\s*r\s*i\s*p\s*t|v\s*b\s*s\s*c\s*r\s*i\s*p\s*t)\s*:/gi, Tt = /data\s*:\s*(?:text\/(?:html|javascript|vbscript|xml)|application\/(?:javascript|xhtml\+xml|xml|x-shockwave-flash)|image\/svg\+xml)/gi, Et = /\bon\w+\s*=/gim, Dt = new RegExp(gt.source, "gim");
|
|
1645
|
+
function X(e) {
|
|
1595
1646
|
let t = String(e ?? "");
|
|
1596
|
-
t = t.replace(
|
|
1647
|
+
t = t.replace(vt, ""), t = t.replace(yt, (e, t, n) => String.fromCodePoint(t ? parseInt(t, 16) : parseInt(n, 10))), t = t.replace(xt, (e, t) => bt[t] ?? ""), t = t.replace(St, "");
|
|
1597
1648
|
let n;
|
|
1598
1649
|
do
|
|
1599
|
-
n = t, t = t.replace(
|
|
1650
|
+
n = t, t = t.replace(Ct, "");
|
|
1600
1651
|
while (t !== n);
|
|
1601
|
-
return t = t.replace(
|
|
1652
|
+
return t = t.replace(wt, "data-unsafe-protocol:"), t = t.replace(Tt, "data-unsafe-protocol:"), t = t.replace(Et, "data-unsafe-attr="), t = t.replace(Dt, "data-unsafe-css:"), t;
|
|
1602
1653
|
}
|
|
1603
|
-
function Ot(e
|
|
1604
|
-
return
|
|
1605
|
-
}
|
|
1606
|
-
function kt(e) {
|
|
1607
|
-
return e.toLowerCase().includes("url(") ? gt.test(e) : !1;
|
|
1654
|
+
function Ot(e) {
|
|
1655
|
+
return e.toLowerCase().includes("url(") ? _t.test(e) : !1;
|
|
1608
1656
|
}
|
|
1609
1657
|
//#endregion
|
|
1610
1658
|
//#region src/bindings/unified.ts
|
|
1611
|
-
var
|
|
1612
|
-
function
|
|
1613
|
-
let t =
|
|
1614
|
-
return t === void 0 ? (t = e.includes("-") ? e.replace(/-./g, (e) => e[1].toUpperCase()) : e,
|
|
1659
|
+
var kt = /* @__PURE__ */ new Map();
|
|
1660
|
+
function At(e) {
|
|
1661
|
+
let t = kt.get(e);
|
|
1662
|
+
return t === void 0 ? (t = e.includes("-") ? e.replace(/-./g, (e) => e[1].toUpperCase()) : e, kt.set(e, t), t) : t;
|
|
1615
1663
|
}
|
|
1616
|
-
var
|
|
1617
|
-
function
|
|
1618
|
-
let t =
|
|
1619
|
-
return t || (t =
|
|
1664
|
+
var jt = /* @__PURE__ */ new WeakMap();
|
|
1665
|
+
function Mt(e) {
|
|
1666
|
+
let t = jt.get(e);
|
|
1667
|
+
return t || (t = F(() => {
|
|
1668
|
+
let t = e.value;
|
|
1669
|
+
return Ae(t) ? t.then((e) => X(e)) : X(t);
|
|
1670
|
+
}), jt.set(e, t)), t;
|
|
1620
1671
|
}
|
|
1621
|
-
function
|
|
1672
|
+
function Nt(e) {
|
|
1622
1673
|
return {
|
|
1623
1674
|
el: e,
|
|
1624
|
-
trackCleanup: (t) =>
|
|
1675
|
+
trackCleanup: (t) => K.trackCleanup(e, t)
|
|
1625
1676
|
};
|
|
1626
1677
|
}
|
|
1627
|
-
function
|
|
1678
|
+
function Pt(e, t, n) {
|
|
1628
1679
|
let r = e.el;
|
|
1629
|
-
|
|
1680
|
+
ft(r, t, (e) => {
|
|
1630
1681
|
let t = n ? n(e) : typeof e == "string" ? e : String(e ?? "");
|
|
1631
1682
|
r.textContent !== t && (r.textContent = t);
|
|
1632
1683
|
}, "text");
|
|
1633
1684
|
}
|
|
1634
|
-
function
|
|
1635
|
-
let n = e.el;
|
|
1636
|
-
|
|
1637
|
-
|
|
1685
|
+
function Ft(e, t) {
|
|
1686
|
+
let n = e.el, r = xe(t) ? Mt(t) : t;
|
|
1687
|
+
ft(n, r, (e) => {
|
|
1688
|
+
let i = r === t ? X(e) : e;
|
|
1689
|
+
n.innerHTML !== i && (K.cleanupDescendants(n), n.innerHTML = i);
|
|
1638
1690
|
}, "html");
|
|
1639
1691
|
}
|
|
1640
|
-
function
|
|
1641
|
-
let n = e.el;
|
|
1642
|
-
|
|
1692
|
+
function It(e, t) {
|
|
1693
|
+
let n = e.el, r = {};
|
|
1694
|
+
for (let e in t) z.call(t, e) && (r[e] = e.trim().split(/\s+/).filter(Boolean));
|
|
1695
|
+
pt(n, t, (e) => {
|
|
1643
1696
|
for (let t in e) {
|
|
1644
|
-
let
|
|
1645
|
-
|
|
1697
|
+
let i = e[t], a = r[t];
|
|
1698
|
+
i ? n.classList.add(...a) : n.classList.remove(...a);
|
|
1646
1699
|
}
|
|
1647
1700
|
}, "class");
|
|
1648
1701
|
}
|
|
1649
|
-
function
|
|
1650
|
-
let n = e.el, r = n.style;
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1702
|
+
function Lt(e, t) {
|
|
1703
|
+
let n = e.el, r = n.style, i = {}, a = {};
|
|
1704
|
+
for (let e in t) if (z.call(t, e)) {
|
|
1705
|
+
let n = t[e], [r, o] = Array.isArray(n) ? n : [n, ""];
|
|
1706
|
+
i[e] = r, a[e] = {
|
|
1707
|
+
camel: At(e),
|
|
1708
|
+
unit: o
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
pt(n, i, (e) => {
|
|
1712
|
+
for (let t in e) {
|
|
1713
|
+
let n = e[t], { camel: i, unit: o } = a[t], s = o ? String(n) + o : String(n);
|
|
1714
|
+
Ot(s) || r[i] !== s && (r[i] = s);
|
|
1658
1715
|
}
|
|
1659
|
-
},
|
|
1716
|
+
}, "css");
|
|
1660
1717
|
}
|
|
1661
|
-
function
|
|
1662
|
-
let n = e.el, r = {};
|
|
1663
|
-
for (let e in t) if (
|
|
1664
|
-
|
|
1665
|
-
|
|
1718
|
+
function Rt(e, t) {
|
|
1719
|
+
let n = e.el, r = {}, i = {};
|
|
1720
|
+
for (let e in t) if (z.call(t, e)) {
|
|
1721
|
+
let n = e.toLowerCase();
|
|
1722
|
+
if (n.startsWith("on")) {
|
|
1723
|
+
console.warn(`${B.BINDING} ${H.SECURITY.BLOCKED_EVENT_HANDLER(e)}`);
|
|
1666
1724
|
continue;
|
|
1667
1725
|
}
|
|
1668
|
-
r[e] = t[e]
|
|
1726
|
+
r[e] = t[e], i[e] = {
|
|
1727
|
+
isAria: n.startsWith("aria-"),
|
|
1728
|
+
isUrl: mt.has(n)
|
|
1729
|
+
};
|
|
1669
1730
|
}
|
|
1670
|
-
|
|
1731
|
+
let a = {};
|
|
1732
|
+
for (let e in r) a[e] = n.getAttribute(e);
|
|
1733
|
+
pt(n, r, (e) => {
|
|
1671
1734
|
for (let t in e) {
|
|
1672
|
-
let r = e[t], i =
|
|
1673
|
-
if (r == null || r === !1 && !
|
|
1674
|
-
n.removeAttribute(t);
|
|
1735
|
+
let r = e[t], o = i[t], s = o.isAria;
|
|
1736
|
+
if (r == null || r === !1 && !s) {
|
|
1737
|
+
a[t] !== null && (n.removeAttribute(t), a[t] = null);
|
|
1675
1738
|
continue;
|
|
1676
1739
|
}
|
|
1677
|
-
let
|
|
1678
|
-
if (
|
|
1679
|
-
console.warn(`${
|
|
1740
|
+
let c = r === !0 ? s ? "true" : t : String(r);
|
|
1741
|
+
if (o.isUrl && ht.test(c)) {
|
|
1742
|
+
console.warn(`${B.BINDING} ${H.SECURITY.BLOCKED_PROTOCOL(t)}`);
|
|
1680
1743
|
continue;
|
|
1681
1744
|
}
|
|
1682
|
-
|
|
1745
|
+
a[t] !== c && (n.setAttribute(t, c), a[t] = c);
|
|
1683
1746
|
}
|
|
1684
1747
|
}, "attr");
|
|
1685
1748
|
}
|
|
1686
|
-
function
|
|
1687
|
-
let n = e.el, r = {};
|
|
1688
|
-
for (let e in t) if (
|
|
1689
|
-
|
|
1690
|
-
|
|
1749
|
+
function zt(e, t) {
|
|
1750
|
+
let n = e.el, r = {}, i = {};
|
|
1751
|
+
for (let e in t) if (z.call(t, e)) {
|
|
1752
|
+
let n = e.toLowerCase();
|
|
1753
|
+
if (n.startsWith("on")) {
|
|
1754
|
+
console.warn(`${B.BINDING} ${H.SECURITY.BLOCKED_EVENT_HANDLER(e)}`);
|
|
1691
1755
|
continue;
|
|
1692
1756
|
}
|
|
1693
|
-
if (
|
|
1694
|
-
console.warn(`${
|
|
1757
|
+
if (Fe.has(e)) {
|
|
1758
|
+
console.warn(`${B.BINDING} ${H.SECURITY.BLOCKED_PROP(e)}`);
|
|
1695
1759
|
continue;
|
|
1696
1760
|
}
|
|
1697
|
-
r[e] = t[e];
|
|
1761
|
+
r[e] = t[e], i[e] = { isUrl: mt.has(n) };
|
|
1698
1762
|
}
|
|
1699
|
-
|
|
1763
|
+
pt(e.el, r, (e) => {
|
|
1700
1764
|
for (let t in e) {
|
|
1701
|
-
let r = e[t]
|
|
1702
|
-
if (
|
|
1703
|
-
console.warn(`${
|
|
1765
|
+
let r = e[t];
|
|
1766
|
+
if (i[t].isUrl && typeof r == "string" && ht.test(r)) {
|
|
1767
|
+
console.warn(`${B.BINDING} ${H.SECURITY.BLOCKED_PROTOCOL(t)}`);
|
|
1704
1768
|
continue;
|
|
1705
1769
|
}
|
|
1706
1770
|
n[t] !== r && (n[t] = r);
|
|
1707
1771
|
}
|
|
1708
1772
|
}, "prop");
|
|
1709
1773
|
}
|
|
1710
|
-
function
|
|
1774
|
+
function Bt(e, t, n) {
|
|
1711
1775
|
let r = e.el, i = n ? "hide" : "show", a = r.style.display, o = a === "none" ? "" : a;
|
|
1712
|
-
|
|
1776
|
+
ft(r, t, (e) => {
|
|
1713
1777
|
let t = n === !!e ? "none" : o;
|
|
1714
1778
|
r.style.display !== t && (r.style.display = t);
|
|
1715
1779
|
}, i);
|
|
1716
1780
|
}
|
|
1717
|
-
function
|
|
1781
|
+
function Vt(t, n, r = {}) {
|
|
1718
1782
|
let i = t.el.tagName.toLowerCase();
|
|
1719
|
-
if (!
|
|
1720
|
-
console.warn(`${
|
|
1783
|
+
if (!Pe.has(i)) {
|
|
1784
|
+
console.warn(`${B.BINDING} ${H.BINDING.INVALID_INPUT_ELEMENT(i)}`);
|
|
1721
1785
|
return;
|
|
1722
1786
|
}
|
|
1723
|
-
let { fx: a, cleanup: o } =
|
|
1724
|
-
|
|
1787
|
+
let { fx: a, cleanup: o } = dt(e(t.el), n, r);
|
|
1788
|
+
K.trackEffect(t.el, a), t.trackCleanup(o);
|
|
1725
1789
|
}
|
|
1726
|
-
function
|
|
1790
|
+
function Ht(t, n) {
|
|
1727
1791
|
let r = t.el, i = e(r), a = r.type === "radio", o = () => {
|
|
1728
1792
|
let t = r.checked;
|
|
1729
1793
|
if (n.peek() !== t && (n.value = t, a && t && r.name)) {
|
|
@@ -1731,67 +1795,143 @@ function Ut(t, n) {
|
|
|
1731
1795
|
(r.form ? e(r.form) : e(document)).find(`input[type="radio"][name="${t}"]`).not(r).trigger("change.atomRadioSync");
|
|
1732
1796
|
}
|
|
1733
1797
|
};
|
|
1734
|
-
o[
|
|
1735
|
-
let s =
|
|
1798
|
+
o[nt] = !0, i.on("change change.atomRadioSync", o), t.trackCleanup(() => i.off("change change.atomRadioSync", o));
|
|
1799
|
+
let s = I(() => {
|
|
1736
1800
|
let e = !!n.value;
|
|
1737
|
-
|
|
1738
|
-
r.checked !== e && (r.checked = e,
|
|
1801
|
+
D(() => {
|
|
1802
|
+
r.checked !== e && (r.checked = e, U.enabled && U.domUpdated(B.BINDING, r, "checked", e));
|
|
1739
1803
|
});
|
|
1740
1804
|
});
|
|
1741
|
-
|
|
1805
|
+
K.trackEffect(r, s);
|
|
1742
1806
|
}
|
|
1743
|
-
function
|
|
1807
|
+
function Ut(t, n) {
|
|
1744
1808
|
let r = e(t.el);
|
|
1745
1809
|
r.on(n), t.trackCleanup(() => r.off(n));
|
|
1746
1810
|
}
|
|
1747
|
-
function
|
|
1811
|
+
function Wt(t, n, r) {
|
|
1748
1812
|
let i = e(t.el);
|
|
1749
1813
|
i.on(n, r), t.trackCleanup(() => i.off(n, r));
|
|
1750
1814
|
}
|
|
1751
|
-
function
|
|
1752
|
-
|
|
1815
|
+
function Gt(e) {
|
|
1816
|
+
K.cleanupTree(e);
|
|
1817
|
+
}
|
|
1818
|
+
//#endregion
|
|
1819
|
+
//#region src/bindings/form.ts
|
|
1820
|
+
function Kt(e, t, n, r) {
|
|
1821
|
+
if (n === t.length) return r;
|
|
1822
|
+
let i = t[n], a = e && typeof e == "object" ? e : {}, o = a[i], s = Kt(o, t, n + 1, r);
|
|
1823
|
+
return Object.is(o, s) ? e : {
|
|
1824
|
+
...a,
|
|
1825
|
+
[i]: s
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
function qt(e, t) {
|
|
1829
|
+
let n = Symbol.for("atom-effect/atom"), r = Symbol.for("atom-effect/writable"), i = t.includes(".") ? t.split(".") : [t], a = (e) => {
|
|
1830
|
+
let t = e;
|
|
1831
|
+
for (let e = 0, n = i.length; e < n && t != null; e++) t = t[i[e]];
|
|
1832
|
+
return t;
|
|
1833
|
+
};
|
|
1834
|
+
return {
|
|
1835
|
+
get value() {
|
|
1836
|
+
return a(e.value);
|
|
1837
|
+
},
|
|
1838
|
+
set value(t) {
|
|
1839
|
+
let n = e.peek(), r = Kt(n, i, 0, t);
|
|
1840
|
+
r !== n && (e.value = r);
|
|
1841
|
+
},
|
|
1842
|
+
peek() {
|
|
1843
|
+
return a(e.peek());
|
|
1844
|
+
},
|
|
1845
|
+
subscribe(t) {
|
|
1846
|
+
return e.subscribe(t);
|
|
1847
|
+
},
|
|
1848
|
+
subscriberCount() {
|
|
1849
|
+
return e.subscriberCount();
|
|
1850
|
+
},
|
|
1851
|
+
dispose() {},
|
|
1852
|
+
[Symbol.dispose]() {},
|
|
1853
|
+
[n]: !0,
|
|
1854
|
+
[r]: !0
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
function Jt(e, t, n = {}) {
|
|
1858
|
+
let r = e.elements, i = (e) => {
|
|
1859
|
+
if (!(e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement)) return;
|
|
1860
|
+
let r = e.name;
|
|
1861
|
+
if (!r || K.hasBind(e)) return;
|
|
1862
|
+
let i = qt(t, r), a = Nt(e);
|
|
1863
|
+
e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio") ? Ht(a, i) : Vt(a, i, n);
|
|
1864
|
+
};
|
|
1865
|
+
for (let e = 0, t = r.length; e < t; e++) i(r[e]);
|
|
1866
|
+
let a = new MutationObserver((e) => {
|
|
1867
|
+
for (let t = 0, n = e.length; t < n; t++) {
|
|
1868
|
+
let n = e[t];
|
|
1869
|
+
if (n.type === "childList") {
|
|
1870
|
+
let e = n.addedNodes;
|
|
1871
|
+
for (let t = 0, n = e.length; t < n; t++) {
|
|
1872
|
+
let n = e[t];
|
|
1873
|
+
if (n.nodeType === 1) {
|
|
1874
|
+
let e = n;
|
|
1875
|
+
i(e);
|
|
1876
|
+
let t = e.querySelectorAll("input, select, textarea");
|
|
1877
|
+
for (let e = 0, n = t.length; e < n; e++) i(t[e]);
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
} else n.type === "attributes" && n.attributeName === "name" && i(n.target);
|
|
1881
|
+
}
|
|
1882
|
+
});
|
|
1883
|
+
a.observe(e, {
|
|
1884
|
+
childList: !0,
|
|
1885
|
+
subtree: !0,
|
|
1886
|
+
attributes: !0,
|
|
1887
|
+
attributeFilter: ["name"]
|
|
1888
|
+
}), K.trackCleanup(e, () => a.disconnect());
|
|
1753
1889
|
}
|
|
1754
1890
|
//#endregion
|
|
1755
1891
|
//#region src/bindings/chainable.ts
|
|
1756
1892
|
function Z(e, t) {
|
|
1757
1893
|
for (let n = 0, r = e.length; n < r; n++) {
|
|
1758
1894
|
let r = e[n];
|
|
1759
|
-
r.nodeType === 1 ? t(
|
|
1895
|
+
r.nodeType === 1 ? t(Nt(r), r) : U.enabled && U.log(B.BINDING, `Skipping non-Element node (nodeType=${r.nodeType})`);
|
|
1760
1896
|
}
|
|
1761
1897
|
return e;
|
|
1762
1898
|
}
|
|
1763
1899
|
e.fn.atomText = function(e, t) {
|
|
1764
|
-
return Z(this, (n) =>
|
|
1900
|
+
return Z(this, (n) => Pt(n, e, t));
|
|
1765
1901
|
}, e.fn.atomHtml = function(e) {
|
|
1766
|
-
return Z(this, (t) =>
|
|
1902
|
+
return Z(this, (t) => Ft(t, e));
|
|
1767
1903
|
}, e.fn.atomClass = function(e, t) {
|
|
1768
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1904
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${B.BINDING} ${H.BINDING.MISSING_CONDITION("atomClass")}`), this;
|
|
1769
1905
|
let n = typeof e == "string" ? { [e]: t } : e;
|
|
1770
|
-
return Z(this, (e) =>
|
|
1906
|
+
return Z(this, (e) => It(e, n));
|
|
1771
1907
|
}, e.fn.atomCss = function(e, t, n) {
|
|
1772
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1908
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${B.BINDING} ${H.BINDING.MISSING_SOURCE("atomCss")}`), this;
|
|
1773
1909
|
let r = typeof e == "string" ? { [e]: n ? [t, n] : t } : e;
|
|
1774
|
-
return Z(this, (e) =>
|
|
1910
|
+
return Z(this, (e) => Lt(e, r));
|
|
1775
1911
|
}, e.fn.atomAttr = function(e, t) {
|
|
1776
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1912
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${B.BINDING} ${H.BINDING.MISSING_SOURCE("atomAttr")}`), this;
|
|
1777
1913
|
let n = typeof e == "string" ? { [e]: t } : e;
|
|
1778
|
-
return Z(this, (e) =>
|
|
1914
|
+
return Z(this, (e) => Rt(e, n));
|
|
1779
1915
|
}, e.fn.atomProp = function(e, t) {
|
|
1780
|
-
if (typeof e == "string" && t === void 0) return console.warn(`${
|
|
1916
|
+
if (typeof e == "string" && t === void 0) return console.warn(`${B.BINDING} ${H.BINDING.MISSING_SOURCE("atomProp")}`), this;
|
|
1781
1917
|
let n = typeof e == "string" ? { [e]: t } : e;
|
|
1782
|
-
return Z(this, (e) =>
|
|
1918
|
+
return Z(this, (e) => zt(e, n));
|
|
1783
1919
|
}, e.fn.atomShow = function(e) {
|
|
1784
|
-
return Z(this, (t) =>
|
|
1920
|
+
return Z(this, (t) => Bt(t, e, !1));
|
|
1785
1921
|
}, e.fn.atomHide = function(e) {
|
|
1786
|
-
return Z(this, (t) =>
|
|
1922
|
+
return Z(this, (t) => Bt(t, e, !0));
|
|
1787
1923
|
}, e.fn.atomVal = function(e, t = {}) {
|
|
1788
|
-
return Z(this, (n) =>
|
|
1924
|
+
return Z(this, (n) => Vt(n, e, t));
|
|
1789
1925
|
}, e.fn.atomChecked = function(e) {
|
|
1790
|
-
return Z(this, (t) =>
|
|
1926
|
+
return Z(this, (t) => Ht(t, e));
|
|
1927
|
+
}, e.fn.atomForm = function(e, t = {}) {
|
|
1928
|
+
return Z(this, (n, r) => {
|
|
1929
|
+
r instanceof HTMLFormElement && Jt(r, e, t);
|
|
1930
|
+
});
|
|
1791
1931
|
}, e.fn.atomOn = function(e, t) {
|
|
1792
|
-
return Z(this, (n) =>
|
|
1932
|
+
return Z(this, (n) => Wt(n, e, t));
|
|
1793
1933
|
}, e.fn.atomBind = function(e) {
|
|
1794
|
-
let { text: t, html: n, class: r, css: i, attr: a, prop: o, show: s, hide: c, val: l, checked: u,
|
|
1934
|
+
let { text: t, html: n, class: r, css: i, attr: a, prop: o, show: s, hide: c, val: l, checked: u, form: d, on: f } = e, p = l === void 0 ? null : Array.isArray(l) ? {
|
|
1795
1935
|
atom: l[0],
|
|
1796
1936
|
opts: l[1]
|
|
1797
1937
|
} : {
|
|
@@ -1799,31 +1939,31 @@ e.fn.atomText = function(e, t) {
|
|
|
1799
1939
|
opts: void 0
|
|
1800
1940
|
};
|
|
1801
1941
|
return Z(this, (e) => {
|
|
1802
|
-
t !== void 0 &&
|
|
1942
|
+
t !== void 0 && Pt(e, t), n !== void 0 && Ft(e, n), r !== void 0 && It(e, r), i !== void 0 && Lt(e, i), a !== void 0 && Rt(e, a), o !== void 0 && zt(e, o), s !== void 0 && Bt(e, s, !1), c !== void 0 && Bt(e, c, !0), p !== null && Vt(e, p.atom, p.opts), u !== void 0 && Ht(e, u), d !== void 0 && e.el instanceof HTMLFormElement && Jt(e.el, d), f !== void 0 && Ut(e, f);
|
|
1803
1943
|
});
|
|
1804
1944
|
}, e.fn.atomUnbind = function() {
|
|
1805
1945
|
for (let e = 0, t = this.length; e < t; e++) {
|
|
1806
1946
|
let t = this[e];
|
|
1807
|
-
t.nodeType === 1 &&
|
|
1947
|
+
t.nodeType === 1 && Gt(t);
|
|
1808
1948
|
}
|
|
1809
1949
|
return this;
|
|
1810
1950
|
};
|
|
1811
1951
|
//#endregion
|
|
1812
1952
|
//#region src/bindings/list.ts
|
|
1813
|
-
var
|
|
1814
|
-
function
|
|
1953
|
+
var Yt = /* @__PURE__ */ new WeakMap(), Xt = 0, Zt = new Ye(() => /* @__PURE__ */ new Map(), (e) => e.clear()), Qt = new Ye(() => /* @__PURE__ */ new Set(), (e) => e.clear()), Q = new Je(100, 1024);
|
|
1954
|
+
function $t(e, t, n) {
|
|
1815
1955
|
t?.isConnected ? e.insertBefore(t) : e.appendTo(n);
|
|
1816
1956
|
}
|
|
1817
1957
|
function $(t) {
|
|
1818
1958
|
return t instanceof Element ? e(t) : t;
|
|
1819
1959
|
}
|
|
1820
|
-
var
|
|
1960
|
+
var en = class {
|
|
1821
1961
|
constructor(e, t, n) {
|
|
1822
1962
|
this.$container = e, this.containerSelector = t, this.onRemove = n, this.oldKeys = [], this.oldItems = [], this.oldNodes = [], this.removingKeys = /* @__PURE__ */ new Set(), this.$emptyEl = null, this.keyToIndex = /* @__PURE__ */ new Map(), this.statesBuffer = new Uint8Array(256), this.indicesBuffer = new Int32Array(256);
|
|
1823
1963
|
}
|
|
1824
1964
|
scheduleRemoval(e, t) {
|
|
1825
1965
|
let n = () => {
|
|
1826
|
-
this.fx?.isDisposed || (t.remove(), this.removingKeys.delete(e),
|
|
1966
|
+
this.fx?.isDisposed || (t.remove(), this.removingKeys.delete(e), U.log(B.LIST, `${this.containerSelector} removed item:`, e));
|
|
1827
1967
|
};
|
|
1828
1968
|
if (!this.onRemove) {
|
|
1829
1969
|
n();
|
|
@@ -1848,7 +1988,7 @@ var Qt = class {
|
|
|
1848
1988
|
this.statesBuffer.length < e && (this.statesBuffer = new Uint8Array(Math.max(e, this.statesBuffer.length * 2))), this.indicesBuffer.length < e && (this.indicesBuffer = new Int32Array(Math.max(e, this.indicesBuffer.length * 2)));
|
|
1849
1989
|
}
|
|
1850
1990
|
};
|
|
1851
|
-
function
|
|
1991
|
+
function tn(t, n, r, i) {
|
|
1852
1992
|
if (t.$emptyEl && n > 0 && (t.$emptyEl.remove(), t.$emptyEl = null), n !== 0) return;
|
|
1853
1993
|
let { oldKeys: a, oldNodes: o, onRemove: s } = t;
|
|
1854
1994
|
if (s) for (let e = 0, n = a.length; e < n; e++) {
|
|
@@ -1859,55 +1999,55 @@ function $t(t, n, r, i) {
|
|
|
1859
1999
|
for (let e = 0, n = a.length; e < n; e++) t.removingKeys.delete(a[e]);
|
|
1860
2000
|
r.empty();
|
|
1861
2001
|
}
|
|
1862
|
-
i && !t.$emptyEl && (t.$emptyEl = e(typeof i == "string" ?
|
|
2002
|
+
i && !t.$emptyEl && (t.$emptyEl = e(typeof i == "string" ? X(i) : i).appendTo(r)), Q.release(t.oldKeys), Q.release(t.oldItems), Q.release(t.oldNodes), t.oldKeys = [], t.oldItems = [], t.oldNodes = [];
|
|
1863
2003
|
}
|
|
1864
|
-
function
|
|
2004
|
+
function nn(e, t, n, r, i, a) {
|
|
1865
2005
|
let { oldKeys: o, oldItems: s, oldNodes: c, removingKeys: l, keyToIndex: u } = e, d = o.length, f = 0, p = d - 1, m = n - 1;
|
|
1866
2006
|
for (; f <= p && f <= m;) {
|
|
1867
2007
|
let e = t[f], n = r(e, f);
|
|
1868
2008
|
if (o[f] !== n) break;
|
|
1869
2009
|
let i = s[f];
|
|
1870
|
-
if (!(a ? a(i, e) :
|
|
2010
|
+
if (!(a ? a(i, e) : je(i, e))) break;
|
|
1871
2011
|
u.set(n, f), f++;
|
|
1872
2012
|
}
|
|
1873
2013
|
for (; p >= f && m >= f;) {
|
|
1874
2014
|
let e = t[m], n = r(e, m);
|
|
1875
2015
|
if (o[p] !== n) break;
|
|
1876
2016
|
let i = s[p];
|
|
1877
|
-
if (!(a ? a(i, e) :
|
|
2017
|
+
if (!(a ? a(i, e) : je(i, e))) break;
|
|
1878
2018
|
u.set(n, m), p--, m--;
|
|
1879
2019
|
}
|
|
1880
|
-
let h =
|
|
2020
|
+
let h = Zt.acquire();
|
|
1881
2021
|
for (let e = f; e <= p; e++) h.set(o[e], e);
|
|
1882
2022
|
let g = Q.acquire();
|
|
1883
2023
|
g.length = n;
|
|
1884
|
-
let _ =
|
|
2024
|
+
let _ = Qt.acquire();
|
|
1885
2025
|
e.ensureBuffers(n);
|
|
1886
2026
|
let v = Q.acquire();
|
|
1887
2027
|
v.length = n;
|
|
1888
2028
|
let y = Q.acquire();
|
|
1889
2029
|
y.length = n;
|
|
1890
|
-
let b = e.statesBuffer, x = e.indicesBuffer, S = Q.acquire(), C = Q.acquire(),
|
|
2030
|
+
let b = e.statesBuffer, x = e.indicesBuffer, S = Q.acquire(), C = Q.acquire(), ee = Q.acquire();
|
|
1891
2031
|
for (let e = 0; e < f; e++) g[e] = o[e], v[e] = t[e], y[e] = c[e], b[e] = 3, x[e] = e;
|
|
1892
2032
|
for (let e = d - 1, r = n - 1; r > m; r--, e--) g[r] = o[e], v[r] = t[r], y[r] = c[e], b[r] = 3, x[r] = e;
|
|
1893
2033
|
for (let n = f; n <= m; n++) {
|
|
1894
2034
|
let o = t[n], d = r(o, n);
|
|
1895
2035
|
if (g[n] = d, v[n] = o, u.set(d, n), _.has(d)) {
|
|
1896
|
-
|
|
2036
|
+
U.warn(B.LIST, H.LIST.DUPLICATE_KEY(d, n, e.containerSelector)), x[n] = -1;
|
|
1897
2037
|
continue;
|
|
1898
2038
|
}
|
|
1899
2039
|
_.add(d);
|
|
1900
2040
|
let f = h.get(d);
|
|
1901
2041
|
if (f === void 0) {
|
|
1902
|
-
S.push(d), C.push(o),
|
|
2042
|
+
S.push(d), C.push(o), ee.push(n), x[n] = -1, b[n] = 1;
|
|
1903
2043
|
continue;
|
|
1904
2044
|
}
|
|
1905
2045
|
let p = s[f];
|
|
1906
2046
|
y[n] = c[f];
|
|
1907
|
-
let m = a ? a(p, o) :
|
|
1908
|
-
!i && p !== o && !m ? (S.push(d), C.push(o),
|
|
2047
|
+
let m = a ? a(p, o) : je(p, o);
|
|
2048
|
+
!i && p !== o && !m ? (S.push(d), C.push(o), ee.push(n), b[n] = 2) : b[n] = 0, x[n] = l.has(d) ? -1 : f;
|
|
1909
2049
|
}
|
|
1910
|
-
return
|
|
2050
|
+
return Zt.release(h), {
|
|
1911
2051
|
newKeys: g,
|
|
1912
2052
|
newKeySet: _,
|
|
1913
2053
|
newItems: v,
|
|
@@ -1916,23 +2056,23 @@ function en(e, t, n, r, i, a) {
|
|
|
1916
2056
|
newIndices: x,
|
|
1917
2057
|
trKeys: S,
|
|
1918
2058
|
trItems: C,
|
|
1919
|
-
trIdxs:
|
|
2059
|
+
trIdxs: ee,
|
|
1920
2060
|
startIndex: f,
|
|
1921
2061
|
oldEndIndex: p,
|
|
1922
2062
|
newEndIndex: m
|
|
1923
2063
|
};
|
|
1924
2064
|
}
|
|
1925
|
-
function
|
|
2065
|
+
function rn(t, n, r) {
|
|
1926
2066
|
let { trKeys: i, trItems: a, trIdxs: o, newNodes: s, newStates: c } = t, l = i.length, u = n.render, d = Array(l), f = [], p = 0;
|
|
1927
2067
|
for (let e = 0; e < l; e++) {
|
|
1928
2068
|
let t = u(a[e], o[e]);
|
|
1929
2069
|
d[e] = t, typeof t == "string" && (f.push(t), p++);
|
|
1930
2070
|
}
|
|
1931
2071
|
let m = null, h = f.length;
|
|
1932
|
-
if (h > 0) if (h === 1) m = [
|
|
2072
|
+
if (h > 0) if (h === 1) m = [X(f[0])];
|
|
1933
2073
|
else {
|
|
1934
|
-
let e = `<template data-atom-sep="${(
|
|
1935
|
-
m =
|
|
2074
|
+
let e = `<template data-atom-sep="${(Xt++).toString(36)}"></template>`;
|
|
2075
|
+
m = X(f.join(e)).split(e);
|
|
1936
2076
|
}
|
|
1937
2077
|
if (r && m && p === l && !n.bind && !n.onAdd && !n.onRemove && !n.events) return m;
|
|
1938
2078
|
let g = 0;
|
|
@@ -1948,7 +2088,7 @@ function tn(t, n, r) {
|
|
|
1948
2088
|
let t = $(e);
|
|
1949
2089
|
for (let e = 0, n = t.length; e < n; e++) {
|
|
1950
2090
|
let n = t[e];
|
|
1951
|
-
n &&
|
|
2091
|
+
n && K.cleanupTree(n);
|
|
1952
2092
|
}
|
|
1953
2093
|
t.replaceWith(r);
|
|
1954
2094
|
}
|
|
@@ -1957,7 +2097,7 @@ function tn(t, n, r) {
|
|
|
1957
2097
|
}
|
|
1958
2098
|
return null;
|
|
1959
2099
|
}
|
|
1960
|
-
function
|
|
2100
|
+
function an(e, t) {
|
|
1961
2101
|
let { startIndex: n, oldEndIndex: r, newKeySet: i } = t, { oldKeys: a, oldNodes: o } = e;
|
|
1962
2102
|
for (let t = n; t <= r; t++) {
|
|
1963
2103
|
let n = a[t];
|
|
@@ -1966,14 +2106,14 @@ function nn(e, t) {
|
|
|
1966
2106
|
r && e.removeItem(n, $(r));
|
|
1967
2107
|
}
|
|
1968
2108
|
}
|
|
1969
|
-
function
|
|
2109
|
+
function on(t, n, r, i, a, o) {
|
|
1970
2110
|
let { bind: s, update: c, onAdd: l } = a, { newKeys: u, newItems: d, newNodes: f, newStates: p, newIndices: m } = n, h = u.length, g = t.oldKeys.length === 0;
|
|
1971
2111
|
if (o !== null) {
|
|
1972
2112
|
r.innerHTML = o.join("");
|
|
1973
2113
|
let n = r.firstElementChild;
|
|
1974
2114
|
for (let r = 0; r < h && n; r++) {
|
|
1975
2115
|
let i = u[r];
|
|
1976
|
-
n.setAttribute("data-atom-key", String(i)), f[r] = n, p[r] = 0, t.removingKeys.delete(i),
|
|
2116
|
+
n.setAttribute("data-atom-key", String(i)), f[r] = n, p[r] = 0, t.removingKeys.delete(i), U.enabled && U.domUpdated(B.LIST, e(n), "list.add", d[r]), n = n.nextElementSibling;
|
|
1977
2117
|
}
|
|
1978
2118
|
return;
|
|
1979
2119
|
}
|
|
@@ -1989,7 +2129,7 @@ function rn(t, n, r, i, a, o) {
|
|
|
1989
2129
|
let e = null, t = 2147483647;
|
|
1990
2130
|
for (let n = h - 1; n >= 0; n--) {
|
|
1991
2131
|
let r = m[n], a = f[n];
|
|
1992
|
-
r !== -1 && r < t ? t = r :
|
|
2132
|
+
r !== -1 && r < t ? t = r : $t($(a), e, i), e = a instanceof Element ? a : a[0] ?? null;
|
|
1993
2133
|
}
|
|
1994
2134
|
}
|
|
1995
2135
|
for (let e = 0; e < h; e++) {
|
|
@@ -1999,7 +2139,7 @@ function rn(t, n, r, i, a, o) {
|
|
|
1999
2139
|
if (r === 0 ? c?.(i, a, e) : s?.(i, a, e), r === 1) {
|
|
2000
2140
|
l?.(i);
|
|
2001
2141
|
let n = u[e];
|
|
2002
|
-
t.removingKeys.delete(n),
|
|
2142
|
+
t.removingKeys.delete(n), U.enabled && U.domUpdated(B.LIST, i, "list.add", d[e]);
|
|
2003
2143
|
}
|
|
2004
2144
|
}
|
|
2005
2145
|
}
|
|
@@ -2015,26 +2155,26 @@ e.fn.atomList = function(t, n) {
|
|
|
2015
2155
|
for (let r = 0, i = this.length; r < i; r++) {
|
|
2016
2156
|
let i = this[r], o = e(i);
|
|
2017
2157
|
o.off(".atomList");
|
|
2018
|
-
let p =
|
|
2158
|
+
let p = Yt.get(i);
|
|
2019
2159
|
p && (p.fx.dispose(), p.ctx.dispose());
|
|
2020
|
-
let m =
|
|
2160
|
+
let m = R(i), h = new en(o, m, s), g = I(() => {
|
|
2021
2161
|
let e = t.value, r = e.length;
|
|
2022
|
-
|
|
2023
|
-
if (
|
|
2024
|
-
|
|
2025
|
-
let t =
|
|
2026
|
-
if (
|
|
2162
|
+
D(() => {
|
|
2163
|
+
if (tn(h, r, o, c), r === 0) return;
|
|
2164
|
+
U.log(B.LIST, `${m} updating with ${r} items`);
|
|
2165
|
+
let t = nn(h, e, r, d, a, u), s = rn(t, n, h.oldKeys.length === 0);
|
|
2166
|
+
if (an(h, t), on(h, t, i, o, f, s), l) {
|
|
2027
2167
|
let { startIndex: e, oldEndIndex: n, newKeySet: r } = t;
|
|
2028
2168
|
for (let t = e; t <= n; t++) {
|
|
2029
2169
|
let e = h.oldKeys[t];
|
|
2030
2170
|
r.has(e) || h.keyToIndex.delete(e);
|
|
2031
2171
|
}
|
|
2032
2172
|
}
|
|
2033
|
-
Q.release(h.oldKeys), Q.release(h.oldItems), Q.release(h.oldNodes), h.oldKeys = t.newKeys, h.oldItems = t.newItems, h.oldNodes = t.newNodes,
|
|
2173
|
+
Q.release(h.oldKeys), Q.release(h.oldItems), Q.release(h.oldNodes), h.oldKeys = t.newKeys, h.oldItems = t.newItems, h.oldNodes = t.newNodes, Qt.release(t.newKeySet), Q.release(t.trKeys), Q.release(t.trItems), Q.release(t.trIdxs);
|
|
2034
2174
|
});
|
|
2035
2175
|
});
|
|
2036
2176
|
if (h.fx = g, l) for (let e in l) {
|
|
2037
|
-
if (!
|
|
2177
|
+
if (!z.call(l, e)) continue;
|
|
2038
2178
|
let t = l[e], n = e.indexOf(" "), r = n === -1 ? e : e.slice(0, n), i = (n === -1 ? null : e.slice(n + 1).trim()) || "> *";
|
|
2039
2179
|
o.on(`${r}.atomList`, i, function(e) {
|
|
2040
2180
|
let n = e.target.closest?.("[data-atom-key]");
|
|
@@ -2050,76 +2190,76 @@ e.fn.atomList = function(t, n) {
|
|
|
2050
2190
|
a !== void 0 && t.call(n, h.oldItems[a], a, e);
|
|
2051
2191
|
});
|
|
2052
2192
|
}
|
|
2053
|
-
|
|
2193
|
+
K.trackEffect(i, g), Yt.set(i, {
|
|
2054
2194
|
fx: g,
|
|
2055
2195
|
ctx: h
|
|
2056
|
-
}),
|
|
2057
|
-
h.dispose(),
|
|
2196
|
+
}), K.trackCleanup(i, () => {
|
|
2197
|
+
h.dispose(), Yt.delete(i);
|
|
2058
2198
|
});
|
|
2059
2199
|
}
|
|
2060
2200
|
return this;
|
|
2061
2201
|
};
|
|
2062
2202
|
//#endregion
|
|
2063
2203
|
//#region src/bindings/mount.ts
|
|
2064
|
-
var
|
|
2204
|
+
var sn = Object.freeze({});
|
|
2065
2205
|
e.fn.atomMount = function(t, n) {
|
|
2066
|
-
let r = n ??
|
|
2206
|
+
let r = n ?? sn;
|
|
2067
2207
|
for (let n = 0, i = this.length; n < i; n++) {
|
|
2068
2208
|
let i = this[n];
|
|
2069
2209
|
if (!i) continue;
|
|
2070
|
-
|
|
2210
|
+
K.cleanupTree(i);
|
|
2071
2211
|
let a = e(i), o;
|
|
2072
2212
|
try {
|
|
2073
|
-
o =
|
|
2213
|
+
o = D(() => t(a, r));
|
|
2074
2214
|
} catch (e) {
|
|
2075
|
-
|
|
2215
|
+
U.error(B.MOUNT, H.MOUNT.ERROR(t.name), e);
|
|
2076
2216
|
continue;
|
|
2077
2217
|
}
|
|
2078
|
-
typeof o == "function" &&
|
|
2218
|
+
typeof o == "function" && K.setComponentCleanup(i, o);
|
|
2079
2219
|
}
|
|
2080
2220
|
return this;
|
|
2081
2221
|
}, e.fn.atomUnmount = function() {
|
|
2082
2222
|
for (let e = 0, t = this.length; e < t; e++) {
|
|
2083
2223
|
let t = this[e];
|
|
2084
|
-
t &&
|
|
2224
|
+
t && Gt(t);
|
|
2085
2225
|
}
|
|
2086
2226
|
return this;
|
|
2087
2227
|
};
|
|
2088
2228
|
//#endregion
|
|
2089
2229
|
//#region src/features/route.ts
|
|
2090
|
-
function
|
|
2230
|
+
function cn(e, t) {
|
|
2091
2231
|
try {
|
|
2092
2232
|
return history.pushState(e, "", t), !0;
|
|
2093
2233
|
} catch (e) {
|
|
2094
|
-
return
|
|
2234
|
+
return U.warn(B.ROUTE, "PushState failed (likely file:// protocol or security restriction). UI will update, but URL will not.", e), !1;
|
|
2095
2235
|
}
|
|
2096
2236
|
}
|
|
2097
|
-
var
|
|
2237
|
+
var ln = class {
|
|
2098
2238
|
constructor(t) {
|
|
2099
2239
|
this.isDestroyed = !1, this.previousRoute = "", this.cleanups = [], this.templateCache = /* @__PURE__ */ new Map(), this.routeCleanups = [], this.lastRawQuery = "", this.cachedParams = {}, this.config = {
|
|
2100
2240
|
...t,
|
|
2101
|
-
mode: t.mode ??
|
|
2102
|
-
basePath: t.basePath ??
|
|
2103
|
-
autoBindLinks: t.autoBindLinks ??
|
|
2104
|
-
activeClass: t.activeClass ??
|
|
2105
|
-
}, this.isHistoryMode = this.config.mode === "history", this.$target = e(this.config.target), this.normalizedBasePath = this.config.basePath?.replace(/\/$/, "") || "", this.activeClass = this.config.activeClass ??
|
|
2241
|
+
mode: t.mode ?? V.mode,
|
|
2242
|
+
basePath: t.basePath ?? V.basePath,
|
|
2243
|
+
autoBindLinks: t.autoBindLinks ?? V.autoBindLinks,
|
|
2244
|
+
activeClass: t.activeClass ?? V.activeClass
|
|
2245
|
+
}, this.isHistoryMode = this.config.mode === "history", this.$target = e(this.config.target), this.normalizedBasePath = this.config.basePath?.replace(/\/$/, "") || "", this.activeClass = this.config.activeClass ?? V.activeClass, this.previousUrl = this.isHistoryMode ? window.location.pathname + window.location.search : window.location.hash, this.currentRouteAtom = ye(this.getRouteName()), this.currentRoute = this.currentRouteAtom, this.queryParamsAtom = ye(this.getQueryParams()), this.queryParams = F(() => this.queryParamsAtom.value), this.handleUrlChange = this.handleUrlChange.bind(this), this.destroy = this.destroy.bind(this), this.init();
|
|
2106
2246
|
}
|
|
2107
2247
|
init() {
|
|
2108
2248
|
let e = this.isHistoryMode ? "popstate" : "hashchange";
|
|
2109
2249
|
window.addEventListener(e, this.handleUrlChange), this.cleanups.push(() => window.removeEventListener(e, this.handleUrlChange));
|
|
2110
|
-
let t =
|
|
2250
|
+
let t = I(() => {
|
|
2111
2251
|
let e = this.currentRouteAtom.value;
|
|
2112
|
-
|
|
2252
|
+
D(() => {
|
|
2113
2253
|
let e = this.routeCleanups;
|
|
2114
2254
|
for (let t = 0, n = e.length; t < n; t++) try {
|
|
2115
2255
|
e[t]();
|
|
2116
2256
|
} catch (e) {
|
|
2117
|
-
|
|
2257
|
+
U.warn(B.ROUTE, "Cleanup error during route transition:", e);
|
|
2118
2258
|
}
|
|
2119
2259
|
e.length = 0;
|
|
2120
2260
|
}), this.renderRoute(e);
|
|
2121
2261
|
});
|
|
2122
|
-
this.cleanups.push(() => t.dispose()), this.setupAutoBindLinks(), this.$target[0] &&
|
|
2262
|
+
this.cleanups.push(() => t.dispose()), this.setupAutoBindLinks(), this.$target[0] && K.trackCleanup(this.$target[0], this.destroy);
|
|
2123
2263
|
}
|
|
2124
2264
|
getRouteName() {
|
|
2125
2265
|
let e = this.config.default;
|
|
@@ -2158,27 +2298,27 @@ var sn = class {
|
|
|
2158
2298
|
setUrl(e) {
|
|
2159
2299
|
if (this.isHistoryMode) {
|
|
2160
2300
|
let t = `${this.normalizedBasePath}/${e}`;
|
|
2161
|
-
|
|
2301
|
+
cn(null, t), this.previousUrl = t;
|
|
2162
2302
|
} else {
|
|
2163
2303
|
let t = `#${e}`;
|
|
2164
2304
|
window.location.hash = t, this.previousUrl = t;
|
|
2165
2305
|
}
|
|
2166
2306
|
}
|
|
2167
2307
|
restoreUrl() {
|
|
2168
|
-
this.isHistoryMode ?
|
|
2308
|
+
this.isHistoryMode ? cn(null, this.previousUrl) : window.location.hash = this.previousUrl;
|
|
2169
2309
|
}
|
|
2170
2310
|
getCurrentUrl() {
|
|
2171
2311
|
return this.isHistoryMode ? window.location.pathname + window.location.search : window.location.hash;
|
|
2172
2312
|
}
|
|
2173
2313
|
getRouteConfig(e) {
|
|
2174
2314
|
let { routes: t, notFound: n } = this.config, r = t[e];
|
|
2175
|
-
return !r && n && (r = t[n]), r || (
|
|
2315
|
+
return !r && n && (r = t[n]), r || (U.warn(B.ROUTE, H.ROUTE.NOT_FOUND(e)), null);
|
|
2176
2316
|
}
|
|
2177
2317
|
renderTemplate(e) {
|
|
2178
2318
|
let t = this.templateCache.get(e);
|
|
2179
2319
|
if (!t) {
|
|
2180
2320
|
let n = document.querySelector(e);
|
|
2181
|
-
if (!n || !(n instanceof HTMLTemplateElement)) return
|
|
2321
|
+
if (!n || !(n instanceof HTMLTemplateElement)) return U.warn(B.ROUTE, H.ROUTE.TEMPLATE_NOT_FOUND(e)), !1;
|
|
2182
2322
|
t = n, this.templateCache.set(e, t);
|
|
2183
2323
|
}
|
|
2184
2324
|
let n = t.content.cloneNode(!0);
|
|
@@ -2188,16 +2328,16 @@ var sn = class {
|
|
|
2188
2328
|
if (this.isDestroyed) return;
|
|
2189
2329
|
let t = this.$target[0];
|
|
2190
2330
|
if (!t) {
|
|
2191
|
-
|
|
2331
|
+
U.warn(B.ROUTE, H.ROUTE.TARGET_NOT_FOUND(this.config.target));
|
|
2192
2332
|
return;
|
|
2193
2333
|
}
|
|
2194
2334
|
let n = this.getRouteConfig(e);
|
|
2195
2335
|
if (!n) return;
|
|
2196
2336
|
let r = this.getQueryParams(), i = this.previousRoute, { beforeTransition: a, afterTransition: o } = this.config;
|
|
2197
|
-
a &&
|
|
2337
|
+
a && D(() => a(i, e)), this.$target.empty();
|
|
2198
2338
|
let s = r, { onEnter: c } = n;
|
|
2199
2339
|
if (c) {
|
|
2200
|
-
let e =
|
|
2340
|
+
let e = D(() => c(r, this));
|
|
2201
2341
|
e !== void 0 && (s = {
|
|
2202
2342
|
...r,
|
|
2203
2343
|
...e
|
|
@@ -2206,7 +2346,7 @@ var sn = class {
|
|
|
2206
2346
|
let l = (e) => {
|
|
2207
2347
|
this.routeCleanups.push(e);
|
|
2208
2348
|
};
|
|
2209
|
-
n.render ? n.render(t, e, s, l, this) : n.template && this.renderTemplate(n.template) && n.onMount && n.onMount(this.$target.children(), l, this), o &&
|
|
2349
|
+
n.render ? n.render(t, e, s, l, this) : n.template && this.renderTemplate(n.template) && n.onMount && n.onMount(this.$target.children(), l, this), o && D(() => o(i, e)), this.previousRoute = e;
|
|
2210
2350
|
}
|
|
2211
2351
|
handleUrlChange() {
|
|
2212
2352
|
if (this.isDestroyed) return;
|
|
@@ -2215,7 +2355,7 @@ var sn = class {
|
|
|
2215
2355
|
let t = this.getRouteName(), n = this.currentRouteAtom.peek(), r = this.getQueryParams();
|
|
2216
2356
|
if (n !== t) {
|
|
2217
2357
|
let e = this.config.routes[n];
|
|
2218
|
-
if (e?.onLeave &&
|
|
2358
|
+
if (e?.onLeave && D(() => e.onLeave(this)) === !1) {
|
|
2219
2359
|
this.restoreUrl();
|
|
2220
2360
|
return;
|
|
2221
2361
|
}
|
|
@@ -2233,9 +2373,9 @@ var sn = class {
|
|
|
2233
2373
|
e(document).on("click", "[data-route]", t), this.cleanups.push(() => {
|
|
2234
2374
|
e(document).off("click", "[data-route]", t);
|
|
2235
2375
|
});
|
|
2236
|
-
let n = this.activeClass, r = [], i =
|
|
2376
|
+
let n = this.activeClass, r = [], i = I(() => {
|
|
2237
2377
|
let e = this.currentRouteAtom.value;
|
|
2238
|
-
|
|
2378
|
+
D(() => {
|
|
2239
2379
|
for (let e = 0, t = r.length; e < t; e++) {
|
|
2240
2380
|
let t = r[e];
|
|
2241
2381
|
t.classList.remove(n), t.removeAttribute("aria-current");
|
|
@@ -2260,7 +2400,7 @@ var sn = class {
|
|
|
2260
2400
|
if (n?.onLeave && n.onLeave(this) === !1) return;
|
|
2261
2401
|
let r = e || this.config.default;
|
|
2262
2402
|
if (!r) {
|
|
2263
|
-
|
|
2403
|
+
U.warn(B.ROUTE, "navigate() called with empty routeName and no default configured.");
|
|
2264
2404
|
return;
|
|
2265
2405
|
}
|
|
2266
2406
|
this.setUrl(r), this.queryParamsAtom.value = {}, this.currentRouteAtom.value = r;
|
|
@@ -2273,18 +2413,18 @@ var sn = class {
|
|
|
2273
2413
|
for (let t = 0, n = e.length; t < n; t++) try {
|
|
2274
2414
|
e[t]();
|
|
2275
2415
|
} catch (e) {
|
|
2276
|
-
|
|
2416
|
+
U.warn(B.ROUTE, "Cleanup error during destroy:", e);
|
|
2277
2417
|
}
|
|
2278
2418
|
this.templateCache.clear();
|
|
2279
2419
|
}
|
|
2280
2420
|
};
|
|
2281
|
-
function
|
|
2282
|
-
return new
|
|
2421
|
+
function un(e) {
|
|
2422
|
+
return new ln(e);
|
|
2283
2423
|
}
|
|
2284
|
-
e.extend({ route:
|
|
2424
|
+
e.extend({ route: un });
|
|
2285
2425
|
//#endregion
|
|
2286
2426
|
//#region src/features/fetch.ts
|
|
2287
|
-
var
|
|
2427
|
+
var dn = class {
|
|
2288
2428
|
constructor(e, t) {
|
|
2289
2429
|
this.abortController = null, this.isStaticUrl = typeof e == "string", this.isStaticUrl ? this.staticUrl = e : this.getUrl = e, typeof t.ajaxOptions == "function" ? (this.ajaxOptionsFn = t.ajaxOptions, this.staticOptions = {}) : this.staticOptions = { ...t.ajaxOptions }, t.method !== void 0 && (this.staticOptions.method = t.method), t.headers !== void 0 && (this.staticOptions.headers = {
|
|
2290
2430
|
...this.staticOptions.headers,
|
|
@@ -2337,16 +2477,16 @@ var ln = class {
|
|
|
2337
2477
|
//#endregion
|
|
2338
2478
|
//#region src/index.ts
|
|
2339
2479
|
e.extend({ atomFetch(e, t) {
|
|
2340
|
-
let n = new
|
|
2480
|
+
let n = new dn(e, t), r = !(t.eager ?? !0), i = F(n.execute, {
|
|
2341
2481
|
defaultValue: t.defaultValue,
|
|
2342
2482
|
lazy: r
|
|
2343
2483
|
});
|
|
2344
2484
|
return Object.assign(i, { abort: () => n.abort() });
|
|
2345
2485
|
} }), e(() => {
|
|
2346
|
-
|
|
2486
|
+
st(), et(document.body);
|
|
2347
2487
|
});
|
|
2348
|
-
var
|
|
2488
|
+
var fn = e;
|
|
2349
2489
|
//#endregion
|
|
2350
|
-
export {
|
|
2490
|
+
export { ye as atom, ke as batch, F as computed, fn as default, tt as disableAutoCleanup, ct as disablejQueryOverrides, I as effect, et as enableAutoCleanup, st as enablejQueryOverrides, xe as isAtom, Se as isComputed, L as isReactive, Ke as nextTick, K as registry, D as untracked };
|
|
2351
2491
|
|
|
2352
2492
|
//# sourceMappingURL=index.mjs.map
|