@vue/runtime-dom 3.5.17 → 3.6.0-alpha.1

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.17
2
+ * @vue/runtime-dom v3.6.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -21,6 +21,8 @@ var VueRuntimeDOM = (function (exports) {
21
21
  const NO = () => false;
22
22
  const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
23
23
  (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
24
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
25
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
24
26
  const isModelListener = (key) => key.startsWith("onUpdate:");
25
27
  const extend = Object.assign;
26
28
  const remove = (arr, el) => {
@@ -54,6 +56,7 @@ var VueRuntimeDOM = (function (exports) {
54
56
  // the leading comma is intentional so empty string "" is also included
55
57
  ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
56
58
  );
59
+ const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
57
60
  const isBuiltInDirective = /* @__PURE__ */ makeMap(
58
61
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
59
62
  );
@@ -65,10 +68,9 @@ var VueRuntimeDOM = (function (exports) {
65
68
  };
66
69
  };
67
70
  const camelizeRE = /-(\w)/g;
71
+ const camelizeReplacer = (_, c) => c ? c.toUpperCase() : "";
68
72
  const camelize = cacheStringFunction(
69
- (str) => {
70
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
71
- }
73
+ (str) => str.replace(camelizeRE, camelizeReplacer)
72
74
  );
73
75
  const hyphenateRE = /\B([A-Z])/g;
74
76
  const hyphenate = cacheStringFunction(
@@ -109,6 +111,10 @@ var VueRuntimeDOM = (function (exports) {
109
111
  const getGlobalThis = () => {
110
112
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
111
113
  };
114
+ function canSetValueDirectly(tagName) {
115
+ return tagName !== "PROGRESS" && // custom elements may use _value internally
116
+ !tagName.includes("-");
117
+ }
112
118
 
113
119
  const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol";
114
120
  const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
@@ -216,6 +222,24 @@ var VueRuntimeDOM = (function (exports) {
216
222
  const type = typeof value;
217
223
  return type === "string" || type === "number" || type === "boolean";
218
224
  }
225
+ function shouldSetAsAttr(tagName, key) {
226
+ if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
227
+ return true;
228
+ }
229
+ if (key === "form") {
230
+ return true;
231
+ }
232
+ if (key === "list" && tagName === "INPUT") {
233
+ return true;
234
+ }
235
+ if (key === "type" && tagName === "TEXTAREA") {
236
+ return true;
237
+ }
238
+ if ((key === "width" || key === "height") && (tagName === "IMG" || tagName === "VIDEO" || tagName === "CANVAS" || tagName === "SOURCE")) {
239
+ return true;
240
+ }
241
+ return false;
242
+ }
219
243
 
220
244
  const cssVarNameEscapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
221
245
  function getEscapedCssVarName(key, doubleEscape) {
@@ -279,7 +303,20 @@ var VueRuntimeDOM = (function (exports) {
279
303
  return !!(val && val["__v_isRef"] === true);
280
304
  };
281
305
  const toDisplayString = (val) => {
282
- return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
306
+ switch (typeof val) {
307
+ case "string":
308
+ return val;
309
+ case "object":
310
+ if (val) {
311
+ if (isRef$1(val)) {
312
+ return toDisplayString(val.value);
313
+ } else if (isArray(val) || val.toString === objectToString || !isFunction(val.toString)) {
314
+ return JSON.stringify(val, replacer, 2);
315
+ }
316
+ }
317
+ default:
318
+ return val == null ? "" : String(val);
319
+ }
283
320
  };
284
321
  const replacer = (_key, val) => {
285
322
  if (isRef$1(val)) {
@@ -314,604 +351,407 @@ var VueRuntimeDOM = (function (exports) {
314
351
  );
315
352
  };
316
353
 
317
- function warn$2(msg, ...args) {
318
- console.warn(`[Vue warn] ${msg}`, ...args);
319
- }
320
-
321
- let activeEffectScope;
322
- class EffectScope {
323
- constructor(detached = false) {
324
- this.detached = detached;
325
- /**
326
- * @internal
327
- */
328
- this._active = true;
329
- /**
330
- * @internal track `on` calls, allow `on` call multiple times
331
- */
332
- this._on = 0;
333
- /**
334
- * @internal
335
- */
336
- this.effects = [];
337
- /**
338
- * @internal
339
- */
340
- this.cleanups = [];
341
- this._isPaused = false;
342
- this.parent = activeEffectScope;
343
- if (!detached && activeEffectScope) {
344
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
345
- this
346
- ) - 1;
347
- }
348
- }
349
- get active() {
350
- return this._active;
351
- }
352
- pause() {
353
- if (this._active) {
354
- this._isPaused = true;
355
- let i, l;
356
- if (this.scopes) {
357
- for (i = 0, l = this.scopes.length; i < l; i++) {
358
- this.scopes[i].pause();
359
- }
360
- }
361
- for (i = 0, l = this.effects.length; i < l; i++) {
362
- this.effects[i].pause();
363
- }
364
- }
365
- }
366
- /**
367
- * Resumes the effect scope, including all child scopes and effects.
368
- */
369
- resume() {
370
- if (this._active) {
371
- if (this._isPaused) {
372
- this._isPaused = false;
373
- let i, l;
374
- if (this.scopes) {
375
- for (i = 0, l = this.scopes.length; i < l; i++) {
376
- this.scopes[i].resume();
377
- }
378
- }
379
- for (i = 0, l = this.effects.length; i < l; i++) {
380
- this.effects[i].resume();
381
- }
382
- }
383
- }
384
- }
385
- run(fn) {
386
- if (this._active) {
387
- const currentEffectScope = activeEffectScope;
388
- try {
389
- activeEffectScope = this;
390
- return fn();
391
- } finally {
392
- activeEffectScope = currentEffectScope;
393
- }
394
- } else {
395
- warn$2(`cannot run an inactive effect scope.`);
396
- }
397
- }
398
- /**
399
- * This should only be called on non-detached scopes
400
- * @internal
401
- */
402
- on() {
403
- if (++this._on === 1) {
404
- this.prevScope = activeEffectScope;
405
- activeEffectScope = this;
406
- }
407
- }
408
- /**
409
- * This should only be called on non-detached scopes
410
- * @internal
411
- */
412
- off() {
413
- if (this._on > 0 && --this._on === 0) {
414
- activeEffectScope = this.prevScope;
415
- this.prevScope = void 0;
416
- }
417
- }
418
- stop(fromParent) {
419
- if (this._active) {
420
- this._active = false;
421
- let i, l;
422
- for (i = 0, l = this.effects.length; i < l; i++) {
423
- this.effects[i].stop();
424
- }
425
- this.effects.length = 0;
426
- for (i = 0, l = this.cleanups.length; i < l; i++) {
427
- this.cleanups[i]();
354
+ function getSequence(arr) {
355
+ const p = arr.slice();
356
+ const result = [0];
357
+ let i, j, u, v, c;
358
+ const len = arr.length;
359
+ for (i = 0; i < len; i++) {
360
+ const arrI = arr[i];
361
+ if (arrI !== 0) {
362
+ j = result[result.length - 1];
363
+ if (arr[j] < arrI) {
364
+ p[i] = j;
365
+ result.push(i);
366
+ continue;
428
367
  }
429
- this.cleanups.length = 0;
430
- if (this.scopes) {
431
- for (i = 0, l = this.scopes.length; i < l; i++) {
432
- this.scopes[i].stop(true);
368
+ u = 0;
369
+ v = result.length - 1;
370
+ while (u < v) {
371
+ c = u + v >> 1;
372
+ if (arr[result[c]] < arrI) {
373
+ u = c + 1;
374
+ } else {
375
+ v = c;
433
376
  }
434
- this.scopes.length = 0;
435
377
  }
436
- if (!this.detached && this.parent && !fromParent) {
437
- const last = this.parent.scopes.pop();
438
- if (last && last !== this) {
439
- this.parent.scopes[this.index] = last;
440
- last.index = this.index;
378
+ if (arrI < arr[result[u]]) {
379
+ if (u > 0) {
380
+ p[i] = result[u - 1];
441
381
  }
382
+ result[u] = i;
442
383
  }
443
- this.parent = void 0;
444
384
  }
445
385
  }
446
- }
447
- function effectScope(detached) {
448
- return new EffectScope(detached);
449
- }
450
- function getCurrentScope() {
451
- return activeEffectScope;
452
- }
453
- function onScopeDispose(fn, failSilently = false) {
454
- if (activeEffectScope) {
455
- activeEffectScope.cleanups.push(fn);
456
- } else if (!failSilently) {
457
- warn$2(
458
- `onScopeDispose() is called when there is no active effect scope to be associated with.`
459
- );
386
+ u = result.length;
387
+ v = result[u - 1];
388
+ while (u-- > 0) {
389
+ result[u] = v;
390
+ v = p[v];
460
391
  }
392
+ return result;
461
393
  }
462
394
 
463
- let activeSub;
464
- const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
465
- class ReactiveEffect {
466
- constructor(fn) {
467
- this.fn = fn;
468
- /**
469
- * @internal
470
- */
471
- this.deps = void 0;
472
- /**
473
- * @internal
474
- */
475
- this.depsTail = void 0;
476
- /**
477
- * @internal
478
- */
479
- this.flags = 1 | 4;
480
- /**
481
- * @internal
482
- */
483
- this.next = void 0;
484
- /**
485
- * @internal
486
- */
487
- this.cleanup = void 0;
488
- this.scheduler = void 0;
489
- if (activeEffectScope && activeEffectScope.active) {
490
- activeEffectScope.effects.push(this);
491
- }
492
- }
493
- pause() {
494
- this.flags |= 64;
495
- }
496
- resume() {
497
- if (this.flags & 64) {
498
- this.flags &= -65;
499
- if (pausedQueueEffects.has(this)) {
500
- pausedQueueEffects.delete(this);
501
- this.trigger();
502
- }
503
- }
504
- }
505
- /**
506
- * @internal
507
- */
508
- notify() {
509
- if (this.flags & 2 && !(this.flags & 32)) {
510
- return;
511
- }
512
- if (!(this.flags & 8)) {
513
- batch(this);
514
- }
515
- }
516
- run() {
517
- if (!(this.flags & 1)) {
518
- return this.fn();
519
- }
520
- this.flags |= 2;
521
- cleanupEffect(this);
522
- prepareDeps(this);
523
- const prevEffect = activeSub;
524
- const prevShouldTrack = shouldTrack;
525
- activeSub = this;
526
- shouldTrack = true;
527
- try {
528
- return this.fn();
529
- } finally {
530
- if (activeSub !== this) {
531
- warn$2(
532
- "Active effect was not restored correctly - this is likely a Vue internal bug."
533
- );
534
- }
535
- cleanupDeps(this);
536
- activeSub = prevEffect;
537
- shouldTrack = prevShouldTrack;
538
- this.flags &= -3;
539
- }
540
- }
541
- stop() {
542
- if (this.flags & 1) {
543
- for (let link = this.deps; link; link = link.nextDep) {
544
- removeSub(link);
545
- }
546
- this.deps = this.depsTail = void 0;
547
- cleanupEffect(this);
548
- this.onStop && this.onStop();
549
- this.flags &= -2;
550
- }
395
+ function normalizeCssVarValue(value) {
396
+ if (value == null) {
397
+ return "initial";
551
398
  }
552
- trigger() {
553
- if (this.flags & 64) {
554
- pausedQueueEffects.add(this);
555
- } else if (this.scheduler) {
556
- this.scheduler();
557
- } else {
558
- this.runIfDirty();
559
- }
399
+ if (typeof value === "string") {
400
+ return value === "" ? " " : value;
560
401
  }
561
- /**
562
- * @internal
563
- */
564
- runIfDirty() {
565
- if (isDirty(this)) {
566
- this.run();
402
+ if (typeof value !== "number" || !Number.isFinite(value)) {
403
+ {
404
+ console.warn(
405
+ "[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",
406
+ value
407
+ );
567
408
  }
568
409
  }
569
- get dirty() {
570
- return isDirty(this);
571
- }
410
+ return String(value);
411
+ }
412
+
413
+ function warn$2(msg, ...args) {
414
+ console.warn(`[Vue warn] ${msg}`, ...args);
572
415
  }
416
+
417
+ var ReactiveFlags = /* @__PURE__ */ ((ReactiveFlags2) => {
418
+ ReactiveFlags2[ReactiveFlags2["None"] = 0] = "None";
419
+ ReactiveFlags2[ReactiveFlags2["Mutable"] = 1] = "Mutable";
420
+ ReactiveFlags2[ReactiveFlags2["Watching"] = 2] = "Watching";
421
+ ReactiveFlags2[ReactiveFlags2["RecursedCheck"] = 4] = "RecursedCheck";
422
+ ReactiveFlags2[ReactiveFlags2["Recursed"] = 8] = "Recursed";
423
+ ReactiveFlags2[ReactiveFlags2["Dirty"] = 16] = "Dirty";
424
+ ReactiveFlags2[ReactiveFlags2["Pending"] = 32] = "Pending";
425
+ return ReactiveFlags2;
426
+ })(ReactiveFlags || {});
427
+ const notifyBuffer = [];
573
428
  let batchDepth = 0;
574
- let batchedSub;
575
- let batchedComputed;
576
- function batch(sub, isComputed = false) {
577
- sub.flags |= 8;
578
- if (isComputed) {
579
- sub.next = batchedComputed;
580
- batchedComputed = sub;
581
- return;
429
+ let activeSub = void 0;
430
+ let notifyIndex = 0;
431
+ let notifyBufferLength = 0;
432
+ function setActiveSub(sub) {
433
+ try {
434
+ return activeSub;
435
+ } finally {
436
+ activeSub = sub;
582
437
  }
583
- sub.next = batchedSub;
584
- batchedSub = sub;
585
438
  }
586
439
  function startBatch() {
587
- batchDepth++;
440
+ ++batchDepth;
588
441
  }
589
442
  function endBatch() {
590
- if (--batchDepth > 0) {
591
- return;
592
- }
593
- if (batchedComputed) {
594
- let e = batchedComputed;
595
- batchedComputed = void 0;
596
- while (e) {
597
- const next = e.next;
598
- e.next = void 0;
599
- e.flags &= -9;
600
- e = next;
601
- }
602
- }
603
- let error;
604
- while (batchedSub) {
605
- let e = batchedSub;
606
- batchedSub = void 0;
607
- while (e) {
608
- const next = e.next;
609
- e.next = void 0;
610
- e.flags &= -9;
611
- if (e.flags & 1) {
612
- try {
613
- ;
614
- e.trigger();
615
- } catch (err) {
616
- if (!error) error = err;
617
- }
618
- }
619
- e = next;
620
- }
621
- }
622
- if (error) throw error;
623
- }
624
- function prepareDeps(sub) {
625
- for (let link = sub.deps; link; link = link.nextDep) {
626
- link.version = -1;
627
- link.prevActiveLink = link.dep.activeLink;
628
- link.dep.activeLink = link;
443
+ if (!--batchDepth && notifyBufferLength) {
444
+ flush();
629
445
  }
630
446
  }
631
- function cleanupDeps(sub) {
632
- let head;
633
- let tail = sub.depsTail;
634
- let link = tail;
635
- while (link) {
636
- const prev = link.prevDep;
637
- if (link.version === -1) {
638
- if (link === tail) tail = prev;
639
- removeSub(link);
640
- removeDep(link);
641
- } else {
642
- head = link;
643
- }
644
- link.dep.activeLink = link.prevActiveLink;
645
- link.prevActiveLink = void 0;
646
- link = prev;
447
+ function link(dep, sub) {
448
+ const prevDep = sub.depsTail;
449
+ if (prevDep !== void 0 && prevDep.dep === dep) {
450
+ return;
647
451
  }
648
- sub.deps = head;
649
- sub.depsTail = tail;
650
- }
651
- function isDirty(sub) {
652
- for (let link = sub.deps; link; link = link.nextDep) {
653
- if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
654
- return true;
452
+ let nextDep = void 0;
453
+ const recursedCheck = sub.flags & 4 /* RecursedCheck */;
454
+ if (recursedCheck) {
455
+ nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;
456
+ if (nextDep !== void 0 && nextDep.dep === dep) {
457
+ sub.depsTail = nextDep;
458
+ return;
655
459
  }
656
460
  }
657
- if (sub._dirty) {
658
- return true;
659
- }
660
- return false;
661
- }
662
- function refreshComputed(computed) {
663
- if (computed.flags & 4 && !(computed.flags & 16)) {
461
+ const prevSub = dep.subsTail;
462
+ if (prevSub !== void 0 && prevSub.sub === sub && (!recursedCheck || isValidLink(prevSub, sub))) {
664
463
  return;
665
464
  }
666
- computed.flags &= -17;
667
- if (computed.globalVersion === globalVersion) {
668
- return;
465
+ const newLink = sub.depsTail = dep.subsTail = {
466
+ dep,
467
+ sub,
468
+ prevDep,
469
+ nextDep,
470
+ prevSub,
471
+ nextSub: void 0
472
+ };
473
+ if (nextDep !== void 0) {
474
+ nextDep.prevDep = newLink;
669
475
  }
670
- computed.globalVersion = globalVersion;
671
- if (!computed.isSSR && computed.flags & 128 && (!computed.deps && !computed._dirty || !isDirty(computed))) {
672
- return;
476
+ if (prevDep !== void 0) {
477
+ prevDep.nextDep = newLink;
478
+ } else {
479
+ sub.deps = newLink;
673
480
  }
674
- computed.flags |= 2;
675
- const dep = computed.dep;
676
- const prevSub = activeSub;
677
- const prevShouldTrack = shouldTrack;
678
- activeSub = computed;
679
- shouldTrack = true;
680
- try {
681
- prepareDeps(computed);
682
- const value = computed.fn(computed._value);
683
- if (dep.version === 0 || hasChanged(value, computed._value)) {
684
- computed.flags |= 128;
685
- computed._value = value;
686
- dep.version++;
687
- }
688
- } catch (err) {
689
- dep.version++;
690
- throw err;
691
- } finally {
692
- activeSub = prevSub;
693
- shouldTrack = prevShouldTrack;
694
- cleanupDeps(computed);
695
- computed.flags &= -3;
481
+ if (prevSub !== void 0) {
482
+ prevSub.nextSub = newLink;
483
+ } else {
484
+ dep.subs = newLink;
696
485
  }
697
486
  }
698
- function removeSub(link, soft = false) {
699
- const { dep, prevSub, nextSub } = link;
700
- if (prevSub) {
701
- prevSub.nextSub = nextSub;
702
- link.prevSub = void 0;
487
+ function unlink(link2, sub = link2.sub) {
488
+ const dep = link2.dep;
489
+ const prevDep = link2.prevDep;
490
+ const nextDep = link2.nextDep;
491
+ const nextSub = link2.nextSub;
492
+ const prevSub = link2.prevSub;
493
+ if (nextDep !== void 0) {
494
+ nextDep.prevDep = prevDep;
495
+ } else {
496
+ sub.depsTail = prevDep;
703
497
  }
704
- if (nextSub) {
705
- nextSub.prevSub = prevSub;
706
- link.nextSub = void 0;
498
+ if (prevDep !== void 0) {
499
+ prevDep.nextDep = nextDep;
500
+ } else {
501
+ sub.deps = nextDep;
707
502
  }
708
- if (dep.subsHead === link) {
709
- dep.subsHead = nextSub;
503
+ if (nextSub !== void 0) {
504
+ nextSub.prevSub = prevSub;
505
+ } else {
506
+ dep.subsTail = prevSub;
710
507
  }
711
- if (dep.subs === link) {
712
- dep.subs = prevSub;
713
- if (!prevSub && dep.computed) {
714
- dep.computed.flags &= -5;
715
- for (let l = dep.computed.deps; l; l = l.nextDep) {
716
- removeSub(l, true);
508
+ if (prevSub !== void 0) {
509
+ prevSub.nextSub = nextSub;
510
+ } else if ((dep.subs = nextSub) === void 0) {
511
+ let toRemove = dep.deps;
512
+ if (toRemove !== void 0) {
513
+ do {
514
+ toRemove = unlink(toRemove, dep);
515
+ } while (toRemove !== void 0);
516
+ dep.flags |= 16 /* Dirty */;
517
+ }
518
+ }
519
+ return nextDep;
520
+ }
521
+ function propagate(link2) {
522
+ let next = link2.nextSub;
523
+ let stack;
524
+ top: do {
525
+ const sub = link2.sub;
526
+ let flags = sub.flags;
527
+ if (flags & (1 /* Mutable */ | 2 /* Watching */)) {
528
+ if (!(flags & (4 /* RecursedCheck */ | 8 /* Recursed */ | 16 /* Dirty */ | 32 /* Pending */))) {
529
+ sub.flags = flags | 32 /* Pending */;
530
+ } else if (!(flags & (4 /* RecursedCheck */ | 8 /* Recursed */))) {
531
+ flags = 0 /* None */;
532
+ } else if (!(flags & 4 /* RecursedCheck */)) {
533
+ sub.flags = flags & -9 /* Recursed */ | 32 /* Pending */;
534
+ } else if (!(flags & (16 /* Dirty */ | 32 /* Pending */)) && isValidLink(link2, sub)) {
535
+ sub.flags = flags | 8 /* Recursed */ | 32 /* Pending */;
536
+ flags &= 1 /* Mutable */;
537
+ } else {
538
+ flags = 0 /* None */;
539
+ }
540
+ if (flags & 2 /* Watching */) {
541
+ notifyBuffer[notifyBufferLength++] = sub;
542
+ }
543
+ if (flags & 1 /* Mutable */) {
544
+ const subSubs = sub.subs;
545
+ if (subSubs !== void 0) {
546
+ link2 = subSubs;
547
+ if (subSubs.nextSub !== void 0) {
548
+ stack = { value: next, prev: stack };
549
+ next = link2.nextSub;
550
+ }
551
+ continue;
552
+ }
717
553
  }
718
554
  }
719
- }
720
- if (!soft && !--dep.sc && dep.map) {
721
- dep.map.delete(dep.key);
722
- }
555
+ if ((link2 = next) !== void 0) {
556
+ next = link2.nextSub;
557
+ continue;
558
+ }
559
+ while (stack !== void 0) {
560
+ link2 = stack.value;
561
+ stack = stack.prev;
562
+ if (link2 !== void 0) {
563
+ next = link2.nextSub;
564
+ continue top;
565
+ }
566
+ }
567
+ break;
568
+ } while (true);
723
569
  }
724
- function removeDep(link) {
725
- const { prevDep, nextDep } = link;
726
- if (prevDep) {
727
- prevDep.nextDep = nextDep;
728
- link.prevDep = void 0;
729
- }
730
- if (nextDep) {
731
- nextDep.prevDep = prevDep;
732
- link.nextDep = void 0;
733
- }
570
+ function startTracking(sub) {
571
+ sub.depsTail = void 0;
572
+ sub.flags = sub.flags & -57 | 4 /* RecursedCheck */;
573
+ return setActiveSub(sub);
734
574
  }
735
- function effect(fn, options) {
736
- if (fn.effect instanceof ReactiveEffect) {
737
- fn = fn.effect.fn;
738
- }
739
- const e = new ReactiveEffect(fn);
740
- if (options) {
741
- extend(e, options);
575
+ function endTracking(sub, prevSub) {
576
+ if (activeSub !== sub) {
577
+ warn$2(
578
+ "Active effect was not restored correctly - this is likely a Vue internal bug."
579
+ );
742
580
  }
743
- try {
744
- e.run();
745
- } catch (err) {
746
- e.stop();
747
- throw err;
748
- }
749
- const runner = e.run.bind(e);
750
- runner.effect = e;
751
- return runner;
752
- }
753
- function stop(runner) {
754
- runner.effect.stop();
755
- }
756
- let shouldTrack = true;
757
- const trackStack = [];
758
- function pauseTracking() {
759
- trackStack.push(shouldTrack);
760
- shouldTrack = false;
761
- }
762
- function resetTracking() {
763
- const last = trackStack.pop();
764
- shouldTrack = last === void 0 ? true : last;
765
- }
766
- function cleanupEffect(e) {
767
- const { cleanup } = e;
768
- e.cleanup = void 0;
769
- if (cleanup) {
770
- const prevSub = activeSub;
771
- activeSub = void 0;
772
- try {
773
- cleanup();
774
- } finally {
775
- activeSub = prevSub;
776
- }
581
+ activeSub = prevSub;
582
+ const depsTail = sub.depsTail;
583
+ let toRemove = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
584
+ while (toRemove !== void 0) {
585
+ toRemove = unlink(toRemove, sub);
586
+ }
587
+ sub.flags &= -5 /* RecursedCheck */;
588
+ }
589
+ function flush() {
590
+ while (notifyIndex < notifyBufferLength) {
591
+ const effect = notifyBuffer[notifyIndex];
592
+ notifyBuffer[notifyIndex++] = void 0;
593
+ effect.notify();
594
+ }
595
+ notifyIndex = 0;
596
+ notifyBufferLength = 0;
597
+ }
598
+ function checkDirty(link2, sub) {
599
+ let stack;
600
+ let checkDepth = 0;
601
+ top: do {
602
+ const dep = link2.dep;
603
+ const depFlags = dep.flags;
604
+ let dirty = false;
605
+ if (sub.flags & 16 /* Dirty */) {
606
+ dirty = true;
607
+ } else if ((depFlags & (1 /* Mutable */ | 16 /* Dirty */)) === (1 /* Mutable */ | 16 /* Dirty */)) {
608
+ if (dep.update()) {
609
+ const subs = dep.subs;
610
+ if (subs.nextSub !== void 0) {
611
+ shallowPropagate(subs);
612
+ }
613
+ dirty = true;
614
+ }
615
+ } else if ((depFlags & (1 /* Mutable */ | 32 /* Pending */)) === (1 /* Mutable */ | 32 /* Pending */)) {
616
+ if (link2.nextSub !== void 0 || link2.prevSub !== void 0) {
617
+ stack = { value: link2, prev: stack };
618
+ }
619
+ link2 = dep.deps;
620
+ sub = dep;
621
+ ++checkDepth;
622
+ continue;
623
+ }
624
+ if (!dirty && link2.nextDep !== void 0) {
625
+ link2 = link2.nextDep;
626
+ continue;
627
+ }
628
+ while (checkDepth) {
629
+ --checkDepth;
630
+ const firstSub = sub.subs;
631
+ const hasMultipleSubs = firstSub.nextSub !== void 0;
632
+ if (hasMultipleSubs) {
633
+ link2 = stack.value;
634
+ stack = stack.prev;
635
+ } else {
636
+ link2 = firstSub;
637
+ }
638
+ if (dirty) {
639
+ if (sub.update()) {
640
+ if (hasMultipleSubs) {
641
+ shallowPropagate(firstSub);
642
+ }
643
+ sub = link2.sub;
644
+ continue;
645
+ }
646
+ } else {
647
+ sub.flags &= -33 /* Pending */;
648
+ }
649
+ sub = link2.sub;
650
+ if (link2.nextDep !== void 0) {
651
+ link2 = link2.nextDep;
652
+ continue top;
653
+ }
654
+ dirty = false;
655
+ }
656
+ return dirty;
657
+ } while (true);
658
+ }
659
+ function shallowPropagate(link2) {
660
+ do {
661
+ const sub = link2.sub;
662
+ const nextSub = link2.nextSub;
663
+ const subFlags = sub.flags;
664
+ if ((subFlags & (32 /* Pending */ | 16 /* Dirty */)) === 32 /* Pending */) {
665
+ sub.flags = subFlags | 16 /* Dirty */;
666
+ }
667
+ link2 = nextSub;
668
+ } while (link2 !== void 0);
669
+ }
670
+ function isValidLink(checkLink, sub) {
671
+ const depsTail = sub.depsTail;
672
+ if (depsTail !== void 0) {
673
+ let link2 = sub.deps;
674
+ do {
675
+ if (link2 === checkLink) {
676
+ return true;
677
+ }
678
+ if (link2 === depsTail) {
679
+ break;
680
+ }
681
+ link2 = link2.nextDep;
682
+ } while (link2 !== void 0);
777
683
  }
684
+ return false;
778
685
  }
779
686
 
780
- let globalVersion = 0;
781
- class Link {
782
- constructor(sub, dep) {
783
- this.sub = sub;
784
- this.dep = dep;
785
- this.version = dep.version;
786
- this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
687
+ const triggerEventInfos = [];
688
+ function onTrack(sub, debugInfo) {
689
+ if (sub.onTrack) {
690
+ sub.onTrack(
691
+ extend(
692
+ {
693
+ effect: sub
694
+ },
695
+ debugInfo
696
+ )
697
+ );
787
698
  }
788
699
  }
789
- class Dep {
790
- // TODO isolatedDeclarations "__v_skip"
791
- constructor(computed) {
792
- this.computed = computed;
793
- this.version = 0;
794
- /**
795
- * Link between this dep and the current active effect
796
- */
797
- this.activeLink = void 0;
798
- /**
799
- * Doubly linked list representing the subscribing effects (tail)
800
- */
801
- this.subs = void 0;
802
- /**
803
- * For object property deps cleanup
804
- */
805
- this.map = void 0;
806
- this.key = void 0;
807
- /**
808
- * Subscriber counter
809
- */
810
- this.sc = 0;
811
- /**
812
- * @internal
813
- */
814
- this.__v_skip = true;
815
- {
816
- this.subsHead = void 0;
817
- }
818
- }
819
- track(debugInfo) {
820
- if (!activeSub || !shouldTrack || activeSub === this.computed) {
821
- return;
822
- }
823
- let link = this.activeLink;
824
- if (link === void 0 || link.sub !== activeSub) {
825
- link = this.activeLink = new Link(activeSub, this);
826
- if (!activeSub.deps) {
827
- activeSub.deps = activeSub.depsTail = link;
828
- } else {
829
- link.prevDep = activeSub.depsTail;
830
- activeSub.depsTail.nextDep = link;
831
- activeSub.depsTail = link;
832
- }
833
- addSub(link);
834
- } else if (link.version === -1) {
835
- link.version = this.version;
836
- if (link.nextDep) {
837
- const next = link.nextDep;
838
- next.prevDep = link.prevDep;
839
- if (link.prevDep) {
840
- link.prevDep.nextDep = next;
841
- }
842
- link.prevDep = activeSub.depsTail;
843
- link.nextDep = void 0;
844
- activeSub.depsTail.nextDep = link;
845
- activeSub.depsTail = link;
846
- if (activeSub.deps === link) {
847
- activeSub.deps = next;
848
- }
849
- }
850
- }
851
- if (activeSub.onTrack) {
852
- activeSub.onTrack(
853
- extend(
854
- {
855
- effect: activeSub
856
- },
857
- debugInfo
858
- )
859
- );
860
- }
861
- return link;
862
- }
863
- trigger(debugInfo) {
864
- this.version++;
865
- globalVersion++;
866
- this.notify(debugInfo);
700
+ function onTrigger(sub) {
701
+ if (sub.onTrigger) {
702
+ const debugInfo = triggerEventInfos[triggerEventInfos.length - 1];
703
+ sub.onTrigger(
704
+ extend(
705
+ {
706
+ effect: sub
707
+ },
708
+ debugInfo
709
+ )
710
+ );
867
711
  }
868
- notify(debugInfo) {
869
- startBatch();
870
- try {
871
- if (true) {
872
- for (let head = this.subsHead; head; head = head.nextSub) {
873
- if (head.sub.onTrigger && !(head.sub.flags & 8)) {
874
- head.sub.onTrigger(
875
- extend(
876
- {
877
- effect: head.sub
878
- },
879
- debugInfo
880
- )
881
- );
882
- }
883
- }
884
- }
885
- for (let link = this.subs; link; link = link.prevSub) {
886
- if (link.sub.notify()) {
887
- ;
888
- link.sub.dep.notify();
889
- }
890
- }
891
- } finally {
892
- endBatch();
712
+ }
713
+ function setupOnTrigger(target) {
714
+ Object.defineProperty(target.prototype, "onTrigger", {
715
+ get() {
716
+ return this._onTrigger;
717
+ },
718
+ set(val) {
719
+ if (val && !this._onTrigger) setupFlagsHandler(this);
720
+ this._onTrigger = val;
893
721
  }
894
- }
722
+ });
895
723
  }
896
- function addSub(link) {
897
- link.dep.sc++;
898
- if (link.sub.flags & 4) {
899
- const computed = link.dep.computed;
900
- if (computed && !link.dep.subs) {
901
- computed.flags |= 4 | 16;
902
- for (let l = computed.deps; l; l = l.nextDep) {
903
- addSub(l);
724
+ function setupFlagsHandler(target) {
725
+ target._flags = target.flags;
726
+ Object.defineProperty(target, "flags", {
727
+ get() {
728
+ return target._flags;
729
+ },
730
+ set(value) {
731
+ if (!(target._flags & (ReactiveFlags.Dirty | ReactiveFlags.Pending)) && !!(value & (ReactiveFlags.Dirty | ReactiveFlags.Pending))) {
732
+ onTrigger(this);
904
733
  }
734
+ target._flags = value;
905
735
  }
906
- const currentTail = link.dep.subs;
907
- if (currentTail !== link) {
908
- link.prevSub = currentTail;
909
- if (currentTail) currentTail.nextSub = link;
910
- }
911
- if (link.dep.subsHead === void 0) {
912
- link.dep.subsHead = link;
736
+ });
737
+ }
738
+
739
+ class Dep {
740
+ constructor(map, key) {
741
+ this.map = map;
742
+ this.key = key;
743
+ this._subs = void 0;
744
+ this.subsTail = void 0;
745
+ this.flags = ReactiveFlags.None;
746
+ }
747
+ get subs() {
748
+ return this._subs;
749
+ }
750
+ set subs(value) {
751
+ this._subs = value;
752
+ if (value === void 0) {
753
+ this.map.delete(this.key);
913
754
  }
914
- link.dep.subs = link;
915
755
  }
916
756
  }
917
757
  const targetMap = /* @__PURE__ */ new WeakMap();
@@ -925,36 +765,34 @@ var VueRuntimeDOM = (function (exports) {
925
765
  "Array iterate"
926
766
  );
927
767
  function track(target, type, key) {
928
- if (shouldTrack && activeSub) {
768
+ if (activeSub !== void 0) {
929
769
  let depsMap = targetMap.get(target);
930
770
  if (!depsMap) {
931
771
  targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
932
772
  }
933
773
  let dep = depsMap.get(key);
934
774
  if (!dep) {
935
- depsMap.set(key, dep = new Dep());
936
- dep.map = depsMap;
937
- dep.key = key;
775
+ depsMap.set(key, dep = new Dep(depsMap, key));
938
776
  }
939
777
  {
940
- dep.track({
778
+ onTrack(activeSub, {
941
779
  target,
942
780
  type,
943
781
  key
944
782
  });
945
783
  }
784
+ link(dep, activeSub);
946
785
  }
947
786
  }
948
787
  function trigger(target, type, key, newValue, oldValue, oldTarget) {
949
788
  const depsMap = targetMap.get(target);
950
789
  if (!depsMap) {
951
- globalVersion++;
952
790
  return;
953
791
  }
954
792
  const run = (dep) => {
955
- if (dep) {
793
+ if (dep !== void 0 && dep.subs !== void 0) {
956
794
  {
957
- dep.trigger({
795
+ triggerEventInfos.push({
958
796
  target,
959
797
  type,
960
798
  key,
@@ -963,6 +801,11 @@ var VueRuntimeDOM = (function (exports) {
963
801
  oldTarget
964
802
  });
965
803
  }
804
+ propagate(dep.subs);
805
+ shallowPropagate(dep.subs);
806
+ {
807
+ triggerEventInfos.pop();
808
+ }
966
809
  }
967
810
  };
968
811
  startBatch();
@@ -1187,11 +1030,11 @@ var VueRuntimeDOM = (function (exports) {
1187
1030
  return res;
1188
1031
  }
1189
1032
  function noTracking(self, method, args = []) {
1190
- pauseTracking();
1191
1033
  startBatch();
1034
+ const prevSub = setActiveSub();
1192
1035
  const res = toRaw(self)[method].apply(self, args);
1036
+ setActiveSub(prevSub);
1193
1037
  endBatch();
1194
- resetTracking();
1195
1038
  return res;
1196
1039
  }
1197
1040
 
@@ -1237,14 +1080,18 @@ var VueRuntimeDOM = (function (exports) {
1237
1080
  return hasOwnProperty;
1238
1081
  }
1239
1082
  }
1083
+ const wasRef = isRef(target);
1240
1084
  const res = Reflect.get(
1241
1085
  target,
1242
1086
  key,
1243
1087
  // if this is a proxy wrapping a ref, return methods using the raw ref
1244
1088
  // as receiver so that we don't have to call `toRaw` on the ref in all
1245
1089
  // its class methods
1246
- isRef(target) ? target : receiver
1090
+ wasRef ? target : receiver
1247
1091
  );
1092
+ if (wasRef && key !== "value") {
1093
+ return res;
1094
+ }
1248
1095
  if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
1249
1096
  return res;
1250
1097
  }
@@ -1696,33 +1543,47 @@ var VueRuntimeDOM = (function (exports) {
1696
1543
  return r ? r["__v_isRef"] === true : false;
1697
1544
  }
1698
1545
  function ref(value) {
1699
- return createRef(value, false);
1546
+ return createRef(value, toReactive);
1700
1547
  }
1701
1548
  function shallowRef(value) {
1702
- return createRef(value, true);
1549
+ return createRef(value);
1703
1550
  }
1704
- function createRef(rawValue, shallow) {
1551
+ function createRef(rawValue, wrap) {
1705
1552
  if (isRef(rawValue)) {
1706
1553
  return rawValue;
1707
1554
  }
1708
- return new RefImpl(rawValue, shallow);
1555
+ return new RefImpl(rawValue, wrap);
1709
1556
  }
1710
1557
  class RefImpl {
1711
- constructor(value, isShallow2) {
1712
- this.dep = new Dep();
1713
- this["__v_isRef"] = true;
1714
- this["__v_isShallow"] = false;
1715
- this._rawValue = isShallow2 ? value : toRaw(value);
1716
- this._value = isShallow2 ? value : toReactive(value);
1717
- this["__v_isShallow"] = isShallow2;
1558
+ // TODO isolatedDeclarations "__v_isShallow"
1559
+ constructor(value, wrap) {
1560
+ this.subs = void 0;
1561
+ this.subsTail = void 0;
1562
+ this.flags = ReactiveFlags.Mutable;
1563
+ /**
1564
+ * @internal
1565
+ */
1566
+ this.__v_isRef = true;
1567
+ // TODO isolatedDeclarations "__v_isRef"
1568
+ /**
1569
+ * @internal
1570
+ */
1571
+ this.__v_isShallow = false;
1572
+ this._oldValue = this._rawValue = wrap ? toRaw(value) : value;
1573
+ this._value = wrap ? wrap(value) : value;
1574
+ this._wrap = wrap;
1575
+ this["__v_isShallow"] = !wrap;
1576
+ }
1577
+ get dep() {
1578
+ return this;
1718
1579
  }
1719
1580
  get value() {
1720
- {
1721
- this.dep.track({
1722
- target: this,
1723
- type: "get",
1724
- key: "value"
1725
- });
1581
+ trackRef(this);
1582
+ if (this.flags & ReactiveFlags.Dirty && this.update()) {
1583
+ const subs = this.subs;
1584
+ if (subs !== void 0) {
1585
+ shallowPropagate(subs);
1586
+ }
1726
1587
  }
1727
1588
  return this._value;
1728
1589
  }
@@ -1731,30 +1592,55 @@ var VueRuntimeDOM = (function (exports) {
1731
1592
  const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
1732
1593
  newValue = useDirectValue ? newValue : toRaw(newValue);
1733
1594
  if (hasChanged(newValue, oldValue)) {
1595
+ this.flags |= ReactiveFlags.Dirty;
1734
1596
  this._rawValue = newValue;
1735
- this._value = useDirectValue ? newValue : toReactive(newValue);
1736
- {
1737
- this.dep.trigger({
1738
- target: this,
1739
- type: "set",
1740
- key: "value",
1741
- newValue,
1742
- oldValue
1743
- });
1597
+ this._value = !useDirectValue && this._wrap ? this._wrap(newValue) : newValue;
1598
+ const subs = this.subs;
1599
+ if (subs !== void 0) {
1600
+ {
1601
+ triggerEventInfos.push({
1602
+ target: this,
1603
+ type: "set",
1604
+ key: "value",
1605
+ newValue,
1606
+ oldValue
1607
+ });
1608
+ }
1609
+ propagate(subs);
1610
+ if (!batchDepth) {
1611
+ flush();
1612
+ }
1613
+ {
1614
+ triggerEventInfos.pop();
1615
+ }
1744
1616
  }
1745
1617
  }
1746
1618
  }
1619
+ update() {
1620
+ this.flags &= ~ReactiveFlags.Dirty;
1621
+ return hasChanged(this._oldValue, this._oldValue = this._rawValue);
1622
+ }
1747
1623
  }
1748
1624
  function triggerRef(ref2) {
1749
- if (ref2.dep) {
1625
+ const dep = ref2.dep;
1626
+ if (dep !== void 0 && dep.subs !== void 0) {
1627
+ propagate(dep.subs);
1628
+ shallowPropagate(dep.subs);
1629
+ if (!batchDepth) {
1630
+ flush();
1631
+ }
1632
+ }
1633
+ }
1634
+ function trackRef(dep) {
1635
+ if (activeSub !== void 0) {
1750
1636
  {
1751
- ref2.dep.trigger({
1752
- target: ref2,
1753
- type: "set",
1754
- key: "value",
1755
- newValue: ref2._value
1637
+ onTrack(activeSub, {
1638
+ target: dep,
1639
+ type: "get",
1640
+ key: "value"
1756
1641
  });
1757
1642
  }
1643
+ link(dep, activeSub);
1758
1644
  }
1759
1645
  }
1760
1646
  function unref(ref2) {
@@ -1780,13 +1666,21 @@ var VueRuntimeDOM = (function (exports) {
1780
1666
  }
1781
1667
  class CustomRefImpl {
1782
1668
  constructor(factory) {
1669
+ this.subs = void 0;
1670
+ this.subsTail = void 0;
1671
+ this.flags = ReactiveFlags.None;
1783
1672
  this["__v_isRef"] = true;
1784
1673
  this._value = void 0;
1785
- const dep = this.dep = new Dep();
1786
- const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
1674
+ const { get, set } = factory(
1675
+ () => trackRef(this),
1676
+ () => triggerRef(this)
1677
+ );
1787
1678
  this._get = get;
1788
1679
  this._set = set;
1789
1680
  }
1681
+ get dep() {
1682
+ return this;
1683
+ }
1790
1684
  get value() {
1791
1685
  return this._value = this._get();
1792
1686
  }
@@ -1798,9 +1692,6 @@ var VueRuntimeDOM = (function (exports) {
1798
1692
  return new CustomRefImpl(factory);
1799
1693
  }
1800
1694
  function toRefs(object) {
1801
- if (!isProxy(object)) {
1802
- warn$2(`toRefs() expects a reactive object but received a plain one.`);
1803
- }
1804
1695
  const ret = isArray(object) ? new Array(object.length) : {};
1805
1696
  for (const key in object) {
1806
1697
  ret[key] = propertyToRef(object, key);
@@ -1853,69 +1744,333 @@ var VueRuntimeDOM = (function (exports) {
1853
1744
  return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1854
1745
  }
1855
1746
 
1856
- class ComputedRefImpl {
1857
- constructor(fn, setter, isSSR) {
1858
- this.fn = fn;
1859
- this.setter = setter;
1860
- /**
1861
- * @internal
1862
- */
1863
- this._value = void 0;
1864
- /**
1865
- * @internal
1866
- */
1867
- this.dep = new Dep(this);
1747
+ class ReactiveEffect {
1748
+ constructor(fn) {
1749
+ this.deps = void 0;
1750
+ this.depsTail = void 0;
1751
+ this.subs = void 0;
1752
+ this.subsTail = void 0;
1753
+ this.flags = ReactiveFlags.Watching | ReactiveFlags.Dirty;
1868
1754
  /**
1869
1755
  * @internal
1870
1756
  */
1871
- this.__v_isRef = true;
1872
- // TODO isolatedDeclarations "__v_isReadonly"
1873
- // A computed is also a subscriber that tracks other deps
1757
+ this.cleanups = [];
1874
1758
  /**
1875
1759
  * @internal
1876
1760
  */
1761
+ this.cleanupsLength = 0;
1762
+ if (fn !== void 0) {
1763
+ this.fn = fn;
1764
+ }
1765
+ if (activeEffectScope) {
1766
+ link(this, activeEffectScope);
1767
+ }
1768
+ }
1769
+ // @ts-expect-error
1770
+ fn() {
1771
+ }
1772
+ get active() {
1773
+ return !(this.flags & 1024);
1774
+ }
1775
+ pause() {
1776
+ this.flags |= 256;
1777
+ }
1778
+ resume() {
1779
+ const flags = this.flags &= -257;
1780
+ if (flags & (ReactiveFlags.Dirty | ReactiveFlags.Pending)) {
1781
+ this.notify();
1782
+ }
1783
+ }
1784
+ notify() {
1785
+ if (!(this.flags & 256) && this.dirty) {
1786
+ this.run();
1787
+ }
1788
+ }
1789
+ run() {
1790
+ if (!this.active) {
1791
+ return this.fn();
1792
+ }
1793
+ cleanup(this);
1794
+ const prevSub = startTracking(this);
1795
+ try {
1796
+ return this.fn();
1797
+ } finally {
1798
+ endTracking(this, prevSub);
1799
+ const flags = this.flags;
1800
+ if ((flags & (ReactiveFlags.Recursed | 128)) === (ReactiveFlags.Recursed | 128)) {
1801
+ this.flags = flags & ~ReactiveFlags.Recursed;
1802
+ this.notify();
1803
+ }
1804
+ }
1805
+ }
1806
+ stop() {
1807
+ if (!this.active) {
1808
+ return;
1809
+ }
1810
+ this.flags = 1024;
1811
+ let dep = this.deps;
1812
+ while (dep !== void 0) {
1813
+ dep = unlink(dep, this);
1814
+ }
1815
+ const sub = this.subs;
1816
+ if (sub !== void 0) {
1817
+ unlink(sub);
1818
+ }
1819
+ cleanup(this);
1820
+ }
1821
+ get dirty() {
1822
+ const flags = this.flags;
1823
+ if (flags & ReactiveFlags.Dirty) {
1824
+ return true;
1825
+ }
1826
+ if (flags & ReactiveFlags.Pending) {
1827
+ if (checkDirty(this.deps, this)) {
1828
+ this.flags = flags | ReactiveFlags.Dirty;
1829
+ return true;
1830
+ } else {
1831
+ this.flags = flags & ~ReactiveFlags.Pending;
1832
+ }
1833
+ }
1834
+ return false;
1835
+ }
1836
+ }
1837
+ {
1838
+ setupOnTrigger(ReactiveEffect);
1839
+ }
1840
+ function effect(fn, options) {
1841
+ if (fn.effect instanceof ReactiveEffect) {
1842
+ fn = fn.effect.fn;
1843
+ }
1844
+ const e = new ReactiveEffect(fn);
1845
+ if (options) {
1846
+ const { onStop, scheduler } = options;
1847
+ if (onStop) {
1848
+ options.onStop = void 0;
1849
+ const stop2 = e.stop.bind(e);
1850
+ e.stop = () => {
1851
+ stop2();
1852
+ onStop();
1853
+ };
1854
+ }
1855
+ if (scheduler) {
1856
+ options.scheduler = void 0;
1857
+ e.notify = () => {
1858
+ if (!(e.flags & 256)) {
1859
+ scheduler();
1860
+ }
1861
+ };
1862
+ }
1863
+ extend(e, options);
1864
+ }
1865
+ try {
1866
+ e.run();
1867
+ } catch (err) {
1868
+ e.stop();
1869
+ throw err;
1870
+ }
1871
+ const runner = e.run.bind(e);
1872
+ runner.effect = e;
1873
+ return runner;
1874
+ }
1875
+ function stop(runner) {
1876
+ runner.effect.stop();
1877
+ }
1878
+ function cleanup(sub) {
1879
+ const l = sub.cleanupsLength;
1880
+ if (l) {
1881
+ for (let i = 0; i < l; i++) {
1882
+ sub.cleanups[i]();
1883
+ }
1884
+ sub.cleanupsLength = 0;
1885
+ }
1886
+ }
1887
+
1888
+ let activeEffectScope;
1889
+ class EffectScope {
1890
+ constructor(detached = false) {
1877
1891
  this.deps = void 0;
1892
+ this.depsTail = void 0;
1893
+ this.subs = void 0;
1894
+ this.subsTail = void 0;
1895
+ this.flags = 0;
1878
1896
  /**
1879
1897
  * @internal
1880
1898
  */
1881
- this.depsTail = void 0;
1899
+ this.cleanups = [];
1882
1900
  /**
1883
1901
  * @internal
1884
1902
  */
1885
- this.flags = 16;
1903
+ this.cleanupsLength = 0;
1904
+ if (!detached && activeEffectScope) {
1905
+ link(this, activeEffectScope);
1906
+ }
1907
+ }
1908
+ get active() {
1909
+ return !(this.flags & 1024);
1910
+ }
1911
+ pause() {
1912
+ if (!(this.flags & 256)) {
1913
+ this.flags |= 256;
1914
+ for (let link2 = this.deps; link2 !== void 0; link2 = link2.nextDep) {
1915
+ const dep = link2.dep;
1916
+ if ("pause" in dep) {
1917
+ dep.pause();
1918
+ }
1919
+ }
1920
+ }
1921
+ }
1922
+ /**
1923
+ * Resumes the effect scope, including all child scopes and effects.
1924
+ */
1925
+ resume() {
1926
+ const flags = this.flags;
1927
+ if (flags & 256) {
1928
+ this.flags = flags & -257;
1929
+ for (let link2 = this.deps; link2 !== void 0; link2 = link2.nextDep) {
1930
+ const dep = link2.dep;
1931
+ if ("resume" in dep) {
1932
+ dep.resume();
1933
+ }
1934
+ }
1935
+ }
1936
+ }
1937
+ run(fn) {
1938
+ const prevSub = setActiveSub();
1939
+ const prevScope = activeEffectScope;
1940
+ try {
1941
+ activeEffectScope = this;
1942
+ return fn();
1943
+ } finally {
1944
+ activeEffectScope = prevScope;
1945
+ setActiveSub(prevSub);
1946
+ }
1947
+ }
1948
+ stop() {
1949
+ if (!this.active) {
1950
+ return;
1951
+ }
1952
+ this.flags = 1024;
1953
+ let dep = this.deps;
1954
+ while (dep !== void 0) {
1955
+ const node = dep.dep;
1956
+ if ("stop" in node) {
1957
+ dep = dep.nextDep;
1958
+ node.stop();
1959
+ } else {
1960
+ dep = unlink(dep, this);
1961
+ }
1962
+ }
1963
+ const sub = this.subs;
1964
+ if (sub !== void 0) {
1965
+ unlink(sub);
1966
+ }
1967
+ cleanup(this);
1968
+ }
1969
+ }
1970
+ function effectScope(detached) {
1971
+ return new EffectScope(detached);
1972
+ }
1973
+ function getCurrentScope() {
1974
+ return activeEffectScope;
1975
+ }
1976
+ function setCurrentScope(scope) {
1977
+ try {
1978
+ return activeEffectScope;
1979
+ } finally {
1980
+ activeEffectScope = scope;
1981
+ }
1982
+ }
1983
+ function onScopeDispose(fn, failSilently = false) {
1984
+ if (activeEffectScope !== void 0) {
1985
+ activeEffectScope.cleanups[activeEffectScope.cleanupsLength++] = fn;
1986
+ } else if (!failSilently) {
1987
+ warn$2(
1988
+ `onScopeDispose() is called when there is no active effect scope to be associated with.`
1989
+ );
1990
+ }
1991
+ }
1992
+
1993
+ class ComputedRefImpl {
1994
+ constructor(fn, setter) {
1995
+ this.fn = fn;
1996
+ this.setter = setter;
1886
1997
  /**
1887
1998
  * @internal
1888
1999
  */
1889
- this.globalVersion = globalVersion - 1;
2000
+ this._value = void 0;
2001
+ this.subs = void 0;
2002
+ this.subsTail = void 0;
2003
+ this.deps = void 0;
2004
+ this.depsTail = void 0;
2005
+ this.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;
1890
2006
  /**
1891
2007
  * @internal
1892
2008
  */
1893
- this.next = void 0;
1894
- // for backwards compat
1895
- this.effect = this;
2009
+ this.__v_isRef = true;
1896
2010
  this["__v_isReadonly"] = !setter;
1897
- this.isSSR = isSSR;
2011
+ }
2012
+ // TODO isolatedDeclarations "__v_isReadonly"
2013
+ // for backwards compat
2014
+ get effect() {
2015
+ return this;
2016
+ }
2017
+ // for backwards compat
2018
+ get dep() {
2019
+ return this;
1898
2020
  }
1899
2021
  /**
1900
2022
  * @internal
2023
+ * for backwards compat
1901
2024
  */
1902
- notify() {
1903
- this.flags |= 16;
1904
- if (!(this.flags & 8) && // avoid infinite self recursion
1905
- activeSub !== this) {
1906
- batch(this, true);
2025
+ get _dirty() {
2026
+ const flags = this.flags;
2027
+ if (flags & ReactiveFlags.Dirty) {
1907
2028
  return true;
1908
2029
  }
2030
+ if (flags & ReactiveFlags.Pending) {
2031
+ if (checkDirty(this.deps, this)) {
2032
+ this.flags = flags | ReactiveFlags.Dirty;
2033
+ return true;
2034
+ } else {
2035
+ this.flags = flags & ~ReactiveFlags.Pending;
2036
+ }
2037
+ }
2038
+ return false;
2039
+ }
2040
+ /**
2041
+ * @internal
2042
+ * for backwards compat
2043
+ */
2044
+ set _dirty(v) {
2045
+ if (v) {
2046
+ this.flags |= ReactiveFlags.Dirty;
2047
+ } else {
2048
+ this.flags &= ~(ReactiveFlags.Dirty | ReactiveFlags.Pending);
2049
+ }
1909
2050
  }
1910
2051
  get value() {
1911
- const link = this.dep.track({
1912
- target: this,
1913
- type: "get",
1914
- key: "value"
1915
- }) ;
1916
- refreshComputed(this);
1917
- if (link) {
1918
- link.version = this.dep.version;
2052
+ const flags = this.flags;
2053
+ if (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(this.deps, this)) {
2054
+ if (this.update()) {
2055
+ const subs = this.subs;
2056
+ if (subs !== void 0) {
2057
+ shallowPropagate(subs);
2058
+ }
2059
+ }
2060
+ } else if (flags & ReactiveFlags.Pending) {
2061
+ this.flags = flags & ~ReactiveFlags.Pending;
2062
+ }
2063
+ if (activeSub !== void 0) {
2064
+ {
2065
+ onTrack(activeSub, {
2066
+ target: this,
2067
+ type: "get",
2068
+ key: "value"
2069
+ });
2070
+ }
2071
+ link(this, activeSub);
2072
+ } else if (activeEffectScope !== void 0) {
2073
+ link(this, activeEffectScope);
1919
2074
  }
1920
2075
  return this._value;
1921
2076
  }
@@ -1926,6 +2081,23 @@ var VueRuntimeDOM = (function (exports) {
1926
2081
  warn$2("Write operation failed: computed value is readonly");
1927
2082
  }
1928
2083
  }
2084
+ update() {
2085
+ const prevSub = startTracking(this);
2086
+ try {
2087
+ const oldValue = this._value;
2088
+ const newValue = this.fn(oldValue);
2089
+ if (hasChanged(oldValue, newValue)) {
2090
+ this._value = newValue;
2091
+ return true;
2092
+ }
2093
+ return false;
2094
+ } finally {
2095
+ endTracking(this, prevSub);
2096
+ }
2097
+ }
2098
+ }
2099
+ {
2100
+ setupOnTrigger(ComputedRefImpl);
1929
2101
  }
1930
2102
  function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1931
2103
  let getter;
@@ -1936,7 +2108,7 @@ var VueRuntimeDOM = (function (exports) {
1936
2108
  getter = getterOrOptions.get;
1937
2109
  setter = getterOrOptions.set;
1938
2110
  }
1939
- const cRef = new ComputedRefImpl(getter, setter, isSSR);
2111
+ const cRef = new ComputedRefImpl(getter, setter);
1940
2112
  if (debugOptions && !isSSR) {
1941
2113
  cRef.onTrack = debugOptions.onTrack;
1942
2114
  cRef.onTrigger = debugOptions.onTrigger;
@@ -1957,177 +2129,146 @@ var VueRuntimeDOM = (function (exports) {
1957
2129
  };
1958
2130
 
1959
2131
  const INITIAL_WATCHER_VALUE = {};
1960
- const cleanupMap = /* @__PURE__ */ new WeakMap();
1961
2132
  let activeWatcher = void 0;
1962
2133
  function getCurrentWatcher() {
1963
2134
  return activeWatcher;
1964
2135
  }
1965
2136
  function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
1966
2137
  if (owner) {
1967
- let cleanups = cleanupMap.get(owner);
1968
- if (!cleanups) cleanupMap.set(owner, cleanups = []);
1969
- cleanups.push(cleanupFn);
2138
+ const { call } = owner.options;
2139
+ if (call) {
2140
+ owner.cleanups[owner.cleanupsLength++] = () => call(cleanupFn, 4);
2141
+ } else {
2142
+ owner.cleanups[owner.cleanupsLength++] = cleanupFn;
2143
+ }
1970
2144
  } else if (!failSilently) {
1971
2145
  warn$2(
1972
2146
  `onWatcherCleanup() was called when there was no active watcher to associate with.`
1973
2147
  );
1974
2148
  }
1975
2149
  }
1976
- function watch$1(source, cb, options = EMPTY_OBJ) {
1977
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
1978
- const warnInvalidSource = (s) => {
1979
- (options.onWarn || warn$2)(
1980
- `Invalid watch source: `,
1981
- s,
1982
- `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
1983
- );
1984
- };
1985
- const reactiveGetter = (source2) => {
1986
- if (deep) return source2;
1987
- if (isShallow(source2) || deep === false || deep === 0)
1988
- return traverse(source2, 1);
1989
- return traverse(source2);
1990
- };
1991
- let effect;
1992
- let getter;
1993
- let cleanup;
1994
- let boundCleanup;
1995
- let forceTrigger = false;
1996
- let isMultiSource = false;
1997
- if (isRef(source)) {
1998
- getter = () => source.value;
1999
- forceTrigger = isShallow(source);
2000
- } else if (isReactive(source)) {
2001
- getter = () => reactiveGetter(source);
2002
- forceTrigger = true;
2003
- } else if (isArray(source)) {
2004
- isMultiSource = true;
2005
- forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
2006
- getter = () => source.map((s) => {
2007
- if (isRef(s)) {
2008
- return s.value;
2009
- } else if (isReactive(s)) {
2010
- return reactiveGetter(s);
2011
- } else if (isFunction(s)) {
2012
- return call ? call(s, 2) : s();
2150
+ class WatcherEffect extends ReactiveEffect {
2151
+ constructor(source, cb, options = EMPTY_OBJ) {
2152
+ const { deep, once, call, onWarn } = options;
2153
+ let getter;
2154
+ let forceTrigger = false;
2155
+ let isMultiSource = false;
2156
+ if (isRef(source)) {
2157
+ getter = () => source.value;
2158
+ forceTrigger = isShallow(source);
2159
+ } else if (isReactive(source)) {
2160
+ getter = () => reactiveGetter(source, deep);
2161
+ forceTrigger = true;
2162
+ } else if (isArray(source)) {
2163
+ isMultiSource = true;
2164
+ forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
2165
+ getter = () => source.map((s) => {
2166
+ if (isRef(s)) {
2167
+ return s.value;
2168
+ } else if (isReactive(s)) {
2169
+ return reactiveGetter(s, deep);
2170
+ } else if (isFunction(s)) {
2171
+ return call ? call(s, 2) : s();
2172
+ } else {
2173
+ warnInvalidSource(s, onWarn);
2174
+ }
2175
+ });
2176
+ } else if (isFunction(source)) {
2177
+ if (cb) {
2178
+ getter = call ? () => call(source, 2) : source;
2013
2179
  } else {
2014
- warnInvalidSource(s);
2015
- }
2016
- });
2017
- } else if (isFunction(source)) {
2018
- if (cb) {
2019
- getter = call ? () => call(source, 2) : source;
2020
- } else {
2021
- getter = () => {
2022
- if (cleanup) {
2023
- pauseTracking();
2180
+ getter = () => {
2181
+ if (this.cleanupsLength) {
2182
+ const prevSub = setActiveSub();
2183
+ try {
2184
+ cleanup(this);
2185
+ } finally {
2186
+ setActiveSub(prevSub);
2187
+ }
2188
+ }
2189
+ const currentEffect = activeWatcher;
2190
+ activeWatcher = this;
2024
2191
  try {
2025
- cleanup();
2192
+ return call ? call(source, 3, [
2193
+ this.boundCleanup
2194
+ ]) : source(this.boundCleanup);
2026
2195
  } finally {
2027
- resetTracking();
2196
+ activeWatcher = currentEffect;
2028
2197
  }
2029
- }
2030
- const currentEffect = activeWatcher;
2031
- activeWatcher = effect;
2032
- try {
2033
- return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
2034
- } finally {
2035
- activeWatcher = currentEffect;
2036
- }
2037
- };
2038
- }
2039
- } else {
2040
- getter = NOOP;
2041
- warnInvalidSource(source);
2042
- }
2043
- if (cb && deep) {
2044
- const baseGetter = getter;
2045
- const depth = deep === true ? Infinity : deep;
2046
- getter = () => traverse(baseGetter(), depth);
2047
- }
2048
- const scope = getCurrentScope();
2049
- const watchHandle = () => {
2050
- effect.stop();
2051
- if (scope && scope.active) {
2052
- remove(scope.effects, effect);
2053
- }
2054
- };
2055
- if (once && cb) {
2056
- const _cb = cb;
2057
- cb = (...args) => {
2058
- _cb(...args);
2059
- watchHandle();
2060
- };
2061
- }
2062
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2063
- const job = (immediateFirstRun) => {
2064
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
2065
- return;
2066
- }
2067
- if (cb) {
2068
- const newValue = effect.run();
2069
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2070
- if (cleanup) {
2071
- cleanup();
2072
- }
2073
- const currentWatcher = activeWatcher;
2074
- activeWatcher = effect;
2075
- try {
2076
- const args = [
2077
- newValue,
2078
- // pass undefined as the old value when it's changed for the first time
2079
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
2080
- boundCleanup
2081
- ];
2082
- oldValue = newValue;
2083
- call ? call(cb, 3, args) : (
2084
- // @ts-expect-error
2085
- cb(...args)
2086
- );
2087
- } finally {
2088
- activeWatcher = currentWatcher;
2089
- }
2198
+ };
2090
2199
  }
2091
2200
  } else {
2092
- effect.run();
2201
+ getter = NOOP;
2202
+ warnInvalidSource(source, onWarn);
2203
+ }
2204
+ if (cb && deep) {
2205
+ const baseGetter = getter;
2206
+ const depth = deep === true ? Infinity : deep;
2207
+ getter = () => traverse(baseGetter(), depth);
2208
+ }
2209
+ super(getter);
2210
+ this.cb = cb;
2211
+ this.options = options;
2212
+ this.boundCleanup = (fn) => onWatcherCleanup(fn, false, this);
2213
+ this.forceTrigger = forceTrigger;
2214
+ this.isMultiSource = isMultiSource;
2215
+ if (once && cb) {
2216
+ const _cb = cb;
2217
+ cb = (...args) => {
2218
+ _cb(...args);
2219
+ this.stop();
2220
+ };
2093
2221
  }
2094
- };
2095
- if (augmentJob) {
2096
- augmentJob(job);
2097
- }
2098
- effect = new ReactiveEffect(getter);
2099
- effect.scheduler = scheduler ? () => scheduler(job, false) : job;
2100
- boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
2101
- cleanup = effect.onStop = () => {
2102
- const cleanups = cleanupMap.get(effect);
2103
- if (cleanups) {
2104
- if (call) {
2105
- call(cleanups, 4);
2106
- } else {
2107
- for (const cleanup2 of cleanups) cleanup2();
2108
- }
2109
- cleanupMap.delete(effect);
2222
+ this.cb = cb;
2223
+ this.oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
2224
+ {
2225
+ this.onTrack = options.onTrack;
2226
+ this.onTrigger = options.onTrigger;
2110
2227
  }
2111
- };
2112
- {
2113
- effect.onTrack = options.onTrack;
2114
- effect.onTrigger = options.onTrigger;
2115
2228
  }
2116
- if (cb) {
2117
- if (immediate) {
2118
- job(true);
2119
- } else {
2120
- oldValue = effect.run();
2229
+ run(initialRun = false) {
2230
+ const oldValue = this.oldValue;
2231
+ const newValue = this.oldValue = super.run();
2232
+ if (!this.cb) {
2233
+ return;
2234
+ }
2235
+ const { immediate, deep, call } = this.options;
2236
+ if (initialRun && !immediate) {
2237
+ return;
2238
+ }
2239
+ if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2240
+ cleanup(this);
2241
+ const currentWatcher = activeWatcher;
2242
+ activeWatcher = this;
2243
+ try {
2244
+ const args = [
2245
+ newValue,
2246
+ // pass undefined as the old value when it's changed for the first time
2247
+ oldValue === INITIAL_WATCHER_VALUE ? void 0 : this.isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
2248
+ this.boundCleanup
2249
+ ];
2250
+ call ? call(this.cb, 3, args) : (
2251
+ // @ts-expect-error
2252
+ this.cb(...args)
2253
+ );
2254
+ } finally {
2255
+ activeWatcher = currentWatcher;
2256
+ }
2121
2257
  }
2122
- } else if (scheduler) {
2123
- scheduler(job.bind(null, true), true);
2124
- } else {
2125
- effect.run();
2126
2258
  }
2127
- watchHandle.pause = effect.pause.bind(effect);
2128
- watchHandle.resume = effect.resume.bind(effect);
2129
- watchHandle.stop = watchHandle;
2130
- return watchHandle;
2259
+ }
2260
+ function reactiveGetter(source, deep) {
2261
+ if (deep) return source;
2262
+ if (isShallow(source) || deep === false || deep === 0)
2263
+ return traverse(source, 1);
2264
+ return traverse(source);
2265
+ }
2266
+ function warnInvalidSource(s, onWarn) {
2267
+ (onWarn || warn$2)(
2268
+ `Invalid watch source: `,
2269
+ s,
2270
+ `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
2271
+ );
2131
2272
  }
2132
2273
  function traverse(value, depth = Infinity, seen) {
2133
2274
  if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
@@ -2163,8 +2304,8 @@ var VueRuntimeDOM = (function (exports) {
2163
2304
  }
2164
2305
 
2165
2306
  const stack = [];
2166
- function pushWarningContext(vnode) {
2167
- stack.push(vnode);
2307
+ function pushWarningContext(ctx) {
2308
+ stack.push(ctx);
2168
2309
  }
2169
2310
  function popWarningContext() {
2170
2311
  stack.pop();
@@ -2173,8 +2314,9 @@ var VueRuntimeDOM = (function (exports) {
2173
2314
  function warn$1(msg, ...args) {
2174
2315
  if (isWarning) return;
2175
2316
  isWarning = true;
2176
- pauseTracking();
2177
- const instance = stack.length ? stack[stack.length - 1].component : null;
2317
+ const prevSub = setActiveSub();
2318
+ const entry = stack.length ? stack[stack.length - 1] : null;
2319
+ const instance = isVNode(entry) ? entry.component : entry;
2178
2320
  const appWarnHandler = instance && instance.appContext.config.warnHandler;
2179
2321
  const trace = getComponentTrace();
2180
2322
  if (appWarnHandler) {
@@ -2188,9 +2330,9 @@ var VueRuntimeDOM = (function (exports) {
2188
2330
  var _a, _b;
2189
2331
  return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
2190
2332
  }).join(""),
2191
- instance && instance.proxy,
2333
+ instance && instance.proxy || instance,
2192
2334
  trace.map(
2193
- ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
2335
+ ({ ctx }) => `at <${formatComponentName(instance, ctx.type)}>`
2194
2336
  ).join("\n"),
2195
2337
  trace
2196
2338
  ]
@@ -2204,27 +2346,31 @@ var VueRuntimeDOM = (function (exports) {
2204
2346
  }
2205
2347
  console.warn(...warnArgs);
2206
2348
  }
2207
- resetTracking();
2349
+ setActiveSub(prevSub);
2208
2350
  isWarning = false;
2209
2351
  }
2210
2352
  function getComponentTrace() {
2211
- let currentVNode = stack[stack.length - 1];
2212
- if (!currentVNode) {
2353
+ let currentCtx = stack[stack.length - 1];
2354
+ if (!currentCtx) {
2213
2355
  return [];
2214
2356
  }
2215
2357
  const normalizedStack = [];
2216
- while (currentVNode) {
2358
+ while (currentCtx) {
2217
2359
  const last = normalizedStack[0];
2218
- if (last && last.vnode === currentVNode) {
2360
+ if (last && last.ctx === currentCtx) {
2219
2361
  last.recurseCount++;
2220
2362
  } else {
2221
2363
  normalizedStack.push({
2222
- vnode: currentVNode,
2364
+ ctx: currentCtx,
2223
2365
  recurseCount: 0
2224
2366
  });
2225
2367
  }
2226
- const parentInstance = currentVNode.component && currentVNode.component.parent;
2227
- currentVNode = parentInstance && parentInstance.vnode;
2368
+ if (isVNode(currentCtx)) {
2369
+ const parent = currentCtx.component && currentCtx.component.parent;
2370
+ currentCtx = parent && parent.vnode || parent;
2371
+ } else {
2372
+ currentCtx = currentCtx.parent;
2373
+ }
2228
2374
  }
2229
2375
  return normalizedStack;
2230
2376
  }
@@ -2236,16 +2382,13 @@ var VueRuntimeDOM = (function (exports) {
2236
2382
  });
2237
2383
  return logs;
2238
2384
  }
2239
- function formatTraceEntry({ vnode, recurseCount }) {
2385
+ function formatTraceEntry({ ctx, recurseCount }) {
2240
2386
  const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
2241
- const isRoot = vnode.component ? vnode.component.parent == null : false;
2242
- const open = ` at <${formatComponentName(
2243
- vnode.component,
2244
- vnode.type,
2245
- isRoot
2246
- )}`;
2387
+ const instance = isVNode(ctx) ? ctx.component : ctx;
2388
+ const isRoot = instance ? instance.parent == null : false;
2389
+ const open = ` at <${formatComponentName(instance, ctx.type, isRoot)}`;
2247
2390
  const close = `>` + postfix;
2248
- return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
2391
+ return ctx.props ? [open, ...formatProps(ctx.props), close] : [open + close];
2249
2392
  }
2250
2393
  function formatProps(props) {
2251
2394
  const res = [];
@@ -2377,11 +2520,10 @@ var VueRuntimeDOM = (function (exports) {
2377
2520
  }
2378
2521
  }
2379
2522
  function handleError(err, instance, type, throwInDev = true) {
2380
- const contextVNode = instance ? instance.vnode : null;
2381
2523
  const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
2382
2524
  if (instance) {
2383
2525
  let cur = instance.parent;
2384
- const exposedInstance = instance.proxy;
2526
+ const exposedInstance = instance.proxy || instance;
2385
2527
  const errorInfo = ErrorTypeStrings$1[type] ;
2386
2528
  while (cur) {
2387
2529
  const errorCapturedHooks = cur.ec;
@@ -2395,26 +2537,26 @@ var VueRuntimeDOM = (function (exports) {
2395
2537
  cur = cur.parent;
2396
2538
  }
2397
2539
  if (errorHandler) {
2398
- pauseTracking();
2540
+ const prevSub = setActiveSub();
2399
2541
  callWithErrorHandling(errorHandler, null, 10, [
2400
2542
  err,
2401
2543
  exposedInstance,
2402
2544
  errorInfo
2403
2545
  ]);
2404
- resetTracking();
2546
+ setActiveSub(prevSub);
2405
2547
  return;
2406
2548
  }
2407
2549
  }
2408
- logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
2550
+ logError(err, type, instance, throwInDev, throwUnhandledErrorInProduction);
2409
2551
  }
2410
- function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
2552
+ function logError(err, type, instance, throwInDev = true, throwInProd = false) {
2411
2553
  {
2412
2554
  const info = ErrorTypeStrings$1[type];
2413
- if (contextVNode) {
2414
- pushWarningContext(contextVNode);
2555
+ if (instance) {
2556
+ pushWarningContext(instance);
2415
2557
  }
2416
2558
  warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
2417
- if (contextVNode) {
2559
+ if (instance) {
2418
2560
  popWarningContext();
2419
2561
  }
2420
2562
  if (throwInDev) {
@@ -2425,26 +2567,23 @@ var VueRuntimeDOM = (function (exports) {
2425
2567
  }
2426
2568
  }
2427
2569
 
2428
- const queue = [];
2429
- let flushIndex = -1;
2430
- const pendingPostFlushCbs = [];
2431
- let activePostFlushCbs = null;
2570
+ const jobs = [];
2571
+ let postJobs = [];
2572
+ let activePostJobs = null;
2573
+ let currentFlushPromise = null;
2574
+ let jobsLength = 0;
2575
+ let flushIndex = 0;
2432
2576
  let postFlushIndex = 0;
2433
2577
  const resolvedPromise = /* @__PURE__ */ Promise.resolve();
2434
- let currentFlushPromise = null;
2435
2578
  const RECURSION_LIMIT = 100;
2436
2579
  function nextTick(fn) {
2437
2580
  const p = currentFlushPromise || resolvedPromise;
2438
2581
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
2439
2582
  }
2440
- function findInsertionIndex(id) {
2441
- let start = flushIndex + 1;
2442
- let end = queue.length;
2583
+ function findInsertionIndex(order, queue, start, end) {
2443
2584
  while (start < end) {
2444
2585
  const middle = start + end >>> 1;
2445
- const middleJob = queue[middle];
2446
- const middleJobId = getId(middleJob);
2447
- if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
2586
+ if (queue[middle].order <= order) {
2448
2587
  start = middle + 1;
2449
2588
  } else {
2450
2589
  end = middle;
@@ -2452,130 +2591,168 @@ var VueRuntimeDOM = (function (exports) {
2452
2591
  }
2453
2592
  return start;
2454
2593
  }
2455
- function queueJob(job) {
2456
- if (!(job.flags & 1)) {
2457
- const jobId = getId(job);
2458
- const lastJob = queue[queue.length - 1];
2459
- if (!lastJob || // fast path when the job id is larger than the tail
2460
- !(job.flags & 2) && jobId >= getId(lastJob)) {
2461
- queue.push(job);
2594
+ function queueJob(job, id, isPre = false) {
2595
+ if (queueJobWorker(
2596
+ job,
2597
+ id === void 0 ? isPre ? -2 : Infinity : isPre ? id * 2 : id * 2 + 1,
2598
+ jobs,
2599
+ jobsLength,
2600
+ flushIndex
2601
+ )) {
2602
+ jobsLength++;
2603
+ queueFlush();
2604
+ }
2605
+ }
2606
+ function queueJobWorker(job, order, queue, length, flushIndex2) {
2607
+ const flags = job.flags;
2608
+ if (!(flags & 1)) {
2609
+ job.flags = flags | 1;
2610
+ job.order = order;
2611
+ if (flushIndex2 === length || // fast path when the job id is larger than the tail
2612
+ order >= queue[length - 1].order) {
2613
+ queue[length] = job;
2462
2614
  } else {
2463
- queue.splice(findInsertionIndex(jobId), 0, job);
2615
+ queue.splice(findInsertionIndex(order, queue, flushIndex2, length), 0, job);
2464
2616
  }
2465
- job.flags |= 1;
2466
- queueFlush();
2617
+ return true;
2467
2618
  }
2619
+ return false;
2468
2620
  }
2621
+ const doFlushJobs = () => {
2622
+ try {
2623
+ flushJobs();
2624
+ } catch (e) {
2625
+ currentFlushPromise = null;
2626
+ throw e;
2627
+ }
2628
+ };
2469
2629
  function queueFlush() {
2470
2630
  if (!currentFlushPromise) {
2471
- currentFlushPromise = resolvedPromise.then(flushJobs);
2631
+ currentFlushPromise = resolvedPromise.then(doFlushJobs);
2472
2632
  }
2473
2633
  }
2474
- function queuePostFlushCb(cb) {
2475
- if (!isArray(cb)) {
2476
- if (activePostFlushCbs && cb.id === -1) {
2477
- activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2478
- } else if (!(cb.flags & 1)) {
2479
- pendingPostFlushCbs.push(cb);
2480
- cb.flags |= 1;
2634
+ function queuePostFlushCb(jobs2, id = Infinity) {
2635
+ if (!isArray(jobs2)) {
2636
+ if (activePostJobs && id === -1) {
2637
+ activePostJobs.splice(postFlushIndex, 0, jobs2);
2638
+ } else {
2639
+ queueJobWorker(jobs2, id, postJobs, postJobs.length, 0);
2481
2640
  }
2482
2641
  } else {
2483
- pendingPostFlushCbs.push(...cb);
2642
+ for (const job of jobs2) {
2643
+ queueJobWorker(job, id, postJobs, postJobs.length, 0);
2644
+ }
2484
2645
  }
2485
2646
  queueFlush();
2486
2647
  }
2487
- function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
2648
+ function flushPreFlushCbs(instance, seen) {
2488
2649
  {
2489
2650
  seen = seen || /* @__PURE__ */ new Map();
2490
2651
  }
2491
- for (; i < queue.length; i++) {
2492
- const cb = queue[i];
2493
- if (cb && cb.flags & 2) {
2494
- if (instance && cb.id !== instance.uid) {
2495
- continue;
2496
- }
2497
- if (checkRecursiveUpdates(seen, cb)) {
2498
- continue;
2499
- }
2500
- queue.splice(i, 1);
2501
- i--;
2502
- if (cb.flags & 4) {
2503
- cb.flags &= -2;
2504
- }
2505
- cb();
2506
- if (!(cb.flags & 4)) {
2507
- cb.flags &= -2;
2508
- }
2652
+ for (let i = flushIndex; i < jobsLength; i++) {
2653
+ const cb = jobs[i];
2654
+ if (cb.order & 1 || cb.order === Infinity) {
2655
+ continue;
2656
+ }
2657
+ if (instance && cb.order !== instance.uid * 2) {
2658
+ continue;
2659
+ }
2660
+ if (checkRecursiveUpdates(seen, cb)) {
2661
+ continue;
2662
+ }
2663
+ jobs.splice(i, 1);
2664
+ i--;
2665
+ jobsLength--;
2666
+ if (cb.flags & 2) {
2667
+ cb.flags &= -2;
2668
+ }
2669
+ cb();
2670
+ if (!(cb.flags & 2)) {
2671
+ cb.flags &= -2;
2509
2672
  }
2510
2673
  }
2511
2674
  }
2512
2675
  function flushPostFlushCbs(seen) {
2513
- if (pendingPostFlushCbs.length) {
2514
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
2515
- (a, b) => getId(a) - getId(b)
2516
- );
2517
- pendingPostFlushCbs.length = 0;
2518
- if (activePostFlushCbs) {
2519
- activePostFlushCbs.push(...deduped);
2676
+ if (postJobs.length) {
2677
+ if (activePostJobs) {
2678
+ activePostJobs.push(...postJobs);
2679
+ postJobs.length = 0;
2520
2680
  return;
2521
2681
  }
2522
- activePostFlushCbs = deduped;
2682
+ activePostJobs = postJobs;
2683
+ postJobs = [];
2523
2684
  {
2524
2685
  seen = seen || /* @__PURE__ */ new Map();
2525
2686
  }
2526
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
2527
- const cb = activePostFlushCbs[postFlushIndex];
2687
+ while (postFlushIndex < activePostJobs.length) {
2688
+ const cb = activePostJobs[postFlushIndex++];
2528
2689
  if (checkRecursiveUpdates(seen, cb)) {
2529
2690
  continue;
2530
2691
  }
2531
- if (cb.flags & 4) {
2692
+ if (cb.flags & 2) {
2532
2693
  cb.flags &= -2;
2533
2694
  }
2534
- if (!(cb.flags & 8)) cb();
2535
- cb.flags &= -2;
2695
+ if (!(cb.flags & 4)) {
2696
+ try {
2697
+ cb();
2698
+ } finally {
2699
+ cb.flags &= -2;
2700
+ }
2701
+ }
2536
2702
  }
2537
- activePostFlushCbs = null;
2703
+ activePostJobs = null;
2538
2704
  postFlushIndex = 0;
2539
2705
  }
2540
2706
  }
2541
- const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
2707
+ let isFlushing = false;
2708
+ function flushOnAppMount() {
2709
+ if (!isFlushing) {
2710
+ isFlushing = true;
2711
+ flushPreFlushCbs();
2712
+ flushPostFlushCbs();
2713
+ isFlushing = false;
2714
+ }
2715
+ }
2542
2716
  function flushJobs(seen) {
2543
2717
  {
2544
- seen = seen || /* @__PURE__ */ new Map();
2718
+ seen || (seen = /* @__PURE__ */ new Map());
2545
2719
  }
2546
- const check = (job) => checkRecursiveUpdates(seen, job) ;
2547
2720
  try {
2548
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
2549
- const job = queue[flushIndex];
2550
- if (job && !(job.flags & 8)) {
2551
- if (check(job)) {
2721
+ while (flushIndex < jobsLength) {
2722
+ const job = jobs[flushIndex];
2723
+ jobs[flushIndex++] = void 0;
2724
+ if (!(job.flags & 4)) {
2725
+ if (checkRecursiveUpdates(seen, job)) {
2552
2726
  continue;
2553
2727
  }
2554
- if (job.flags & 4) {
2728
+ if (job.flags & 2) {
2555
2729
  job.flags &= ~1;
2556
2730
  }
2557
- callWithErrorHandling(
2558
- job,
2559
- job.i,
2560
- job.i ? 15 : 14
2561
- );
2562
- if (!(job.flags & 4)) {
2563
- job.flags &= ~1;
2731
+ try {
2732
+ job();
2733
+ } catch (err) {
2734
+ handleError(
2735
+ err,
2736
+ job.i,
2737
+ job.i ? 15 : 14
2738
+ );
2739
+ } finally {
2740
+ if (!(job.flags & 2)) {
2741
+ job.flags &= ~1;
2742
+ }
2564
2743
  }
2565
2744
  }
2566
2745
  }
2567
2746
  } finally {
2568
- for (; flushIndex < queue.length; flushIndex++) {
2569
- const job = queue[flushIndex];
2570
- if (job) {
2571
- job.flags &= -2;
2572
- }
2747
+ while (flushIndex < jobsLength) {
2748
+ jobs[flushIndex].flags &= -2;
2749
+ jobs[flushIndex++] = void 0;
2573
2750
  }
2574
- flushIndex = -1;
2575
- queue.length = 0;
2751
+ flushIndex = 0;
2752
+ jobsLength = 0;
2576
2753
  flushPostFlushCbs(seen);
2577
2754
  currentFlushPromise = null;
2578
- if (queue.length || pendingPostFlushCbs.length) {
2755
+ if (jobsLength || postJobs.length) {
2579
2756
  flushJobs(seen);
2580
2757
  }
2581
2758
  }
@@ -2642,10 +2819,17 @@ var VueRuntimeDOM = (function (exports) {
2642
2819
  instance.render = newRender;
2643
2820
  normalizeClassComponent(instance.type).render = newRender;
2644
2821
  }
2645
- instance.renderCache = [];
2646
2822
  isHmrUpdating = true;
2647
- instance.update();
2648
- isHmrUpdating = false;
2823
+ if (instance.vapor) {
2824
+ instance.hmrRerender();
2825
+ } else {
2826
+ const i = instance;
2827
+ i.renderCache = [];
2828
+ i.effect.run();
2829
+ }
2830
+ nextTick(() => {
2831
+ isHmrUpdating = false;
2832
+ });
2649
2833
  });
2650
2834
  }
2651
2835
  function reload(id, newComp) {
@@ -2654,42 +2838,54 @@ var VueRuntimeDOM = (function (exports) {
2654
2838
  newComp = normalizeClassComponent(newComp);
2655
2839
  updateComponentDef(record.initialDef, newComp);
2656
2840
  const instances = [...record.instances];
2657
- for (let i = 0; i < instances.length; i++) {
2658
- const instance = instances[i];
2659
- const oldComp = normalizeClassComponent(instance.type);
2660
- let dirtyInstances = hmrDirtyComponents.get(oldComp);
2661
- if (!dirtyInstances) {
2662
- if (oldComp !== record.initialDef) {
2663
- updateComponentDef(oldComp, newComp);
2664
- }
2665
- hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2666
- }
2667
- dirtyInstances.add(instance);
2668
- instance.appContext.propsCache.delete(instance.type);
2669
- instance.appContext.emitsCache.delete(instance.type);
2670
- instance.appContext.optionsCache.delete(instance.type);
2671
- if (instance.ceReload) {
2841
+ if (newComp.vapor) {
2842
+ for (const instance of instances) {
2843
+ instance.hmrReload(newComp);
2844
+ }
2845
+ } else {
2846
+ for (const instance of instances) {
2847
+ const oldComp = normalizeClassComponent(instance.type);
2848
+ let dirtyInstances = hmrDirtyComponents.get(oldComp);
2849
+ if (!dirtyInstances) {
2850
+ if (oldComp !== record.initialDef) {
2851
+ updateComponentDef(oldComp, newComp);
2852
+ }
2853
+ hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
2854
+ }
2672
2855
  dirtyInstances.add(instance);
2673
- instance.ceReload(newComp.styles);
2674
- dirtyInstances.delete(instance);
2675
- } else if (instance.parent) {
2676
- queueJob(() => {
2677
- isHmrUpdating = true;
2678
- instance.parent.update();
2679
- isHmrUpdating = false;
2856
+ instance.appContext.propsCache.delete(instance.type);
2857
+ instance.appContext.emitsCache.delete(instance.type);
2858
+ instance.appContext.optionsCache.delete(instance.type);
2859
+ if (instance.ceReload) {
2860
+ dirtyInstances.add(instance);
2861
+ instance.ceReload(newComp.styles);
2680
2862
  dirtyInstances.delete(instance);
2681
- });
2682
- } else if (instance.appContext.reload) {
2683
- instance.appContext.reload();
2684
- } else if (typeof window !== "undefined") {
2685
- window.location.reload();
2686
- } else {
2687
- console.warn(
2688
- "[HMR] Root or manually mounted instance modified. Full reload required."
2689
- );
2690
- }
2691
- if (instance.root.ce && instance !== instance.root) {
2692
- instance.root.ce._removeChildStyle(oldComp);
2863
+ } else if (instance.parent) {
2864
+ queueJob(() => {
2865
+ isHmrUpdating = true;
2866
+ const parent = instance.parent;
2867
+ if (parent.vapor) {
2868
+ parent.hmrRerender();
2869
+ } else {
2870
+ parent.effect.run();
2871
+ }
2872
+ nextTick(() => {
2873
+ isHmrUpdating = false;
2874
+ });
2875
+ dirtyInstances.delete(instance);
2876
+ });
2877
+ } else if (instance.appContext.reload) {
2878
+ instance.appContext.reload();
2879
+ } else if (typeof window !== "undefined") {
2880
+ window.location.reload();
2881
+ } else {
2882
+ console.warn(
2883
+ "[HMR] Root or manually mounted instance modified. Full reload required."
2884
+ );
2885
+ }
2886
+ if (instance.root.ce && instance !== instance.root) {
2887
+ instance.root.ce._removeChildStyle(oldComp);
2888
+ }
2693
2889
  }
2694
2890
  }
2695
2891
  queuePostFlushCb(() => {
@@ -2902,14 +3098,14 @@ var VueRuntimeDOM = (function (exports) {
2902
3098
  }
2903
3099
  let hook = binding.dir[name];
2904
3100
  if (hook) {
2905
- pauseTracking();
3101
+ const prevSub = setActiveSub();
2906
3102
  callWithAsyncErrorHandling(hook, instance, 8, [
2907
3103
  vnode.el,
2908
3104
  binding,
2909
3105
  vnode,
2910
3106
  prevVNode
2911
3107
  ]);
2912
- resetTracking();
3108
+ setActiveSub(prevSub);
2913
3109
  }
2914
3110
  }
2915
3111
  }
@@ -3009,29 +3205,37 @@ var VueRuntimeDOM = (function (exports) {
3009
3205
  }
3010
3206
  if (isTeleportDeferred(n2.props)) {
3011
3207
  n2.el.__isMounted = false;
3012
- queuePostRenderEffect(() => {
3013
- mountToTarget();
3014
- delete n2.el.__isMounted;
3015
- }, parentSuspense);
3208
+ queuePostRenderEffect(
3209
+ () => {
3210
+ mountToTarget();
3211
+ delete n2.el.__isMounted;
3212
+ },
3213
+ void 0,
3214
+ parentSuspense
3215
+ );
3016
3216
  } else {
3017
3217
  mountToTarget();
3018
3218
  }
3019
3219
  } else {
3020
3220
  if (isTeleportDeferred(n2.props) && n1.el.__isMounted === false) {
3021
- queuePostRenderEffect(() => {
3022
- TeleportImpl.process(
3023
- n1,
3024
- n2,
3025
- container,
3026
- anchor,
3027
- parentComponent,
3028
- parentSuspense,
3029
- namespace,
3030
- slotScopeIds,
3031
- optimized,
3032
- internals
3033
- );
3034
- }, parentSuspense);
3221
+ queuePostRenderEffect(
3222
+ () => {
3223
+ TeleportImpl.process(
3224
+ n1,
3225
+ n2,
3226
+ container,
3227
+ anchor,
3228
+ parentComponent,
3229
+ parentSuspense,
3230
+ namespace,
3231
+ slotScopeIds,
3232
+ optimized,
3233
+ internals
3234
+ );
3235
+ },
3236
+ void 0,
3237
+ parentSuspense
3238
+ );
3035
3239
  return;
3036
3240
  }
3037
3241
  n2.el = n1.el;
@@ -3078,6 +3282,7 @@ var VueRuntimeDOM = (function (exports) {
3078
3282
  container,
3079
3283
  mainAnchor,
3080
3284
  internals,
3285
+ parentComponent,
3081
3286
  1
3082
3287
  );
3083
3288
  } else {
@@ -3097,6 +3302,7 @@ var VueRuntimeDOM = (function (exports) {
3097
3302
  nextTarget,
3098
3303
  null,
3099
3304
  internals,
3305
+ parentComponent,
3100
3306
  0
3101
3307
  );
3102
3308
  } else {
@@ -3112,6 +3318,7 @@ var VueRuntimeDOM = (function (exports) {
3112
3318
  target,
3113
3319
  targetAnchor,
3114
3320
  internals,
3321
+ parentComponent,
3115
3322
  1
3116
3323
  );
3117
3324
  }
@@ -3151,7 +3358,7 @@ var VueRuntimeDOM = (function (exports) {
3151
3358
  move: moveTeleport,
3152
3359
  hydrate: hydrateTeleport
3153
3360
  };
3154
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
3361
+ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, parentComponent, moveType = 2) {
3155
3362
  if (moveType === 0) {
3156
3363
  insert(vnode.targetAnchor, container, parentAnchor);
3157
3364
  }
@@ -3167,7 +3374,8 @@ var VueRuntimeDOM = (function (exports) {
3167
3374
  children[i],
3168
3375
  container,
3169
3376
  parentAnchor,
3170
- 2
3377
+ 2,
3378
+ parentComponent
3171
3379
  );
3172
3380
  }
3173
3381
  }
@@ -3352,7 +3560,7 @@ var VueRuntimeDOM = (function (exports) {
3352
3560
  state.isLeaving = true;
3353
3561
  leavingHooks.afterLeave = () => {
3354
3562
  state.isLeaving = false;
3355
- if (!(instance.job.flags & 8)) {
3563
+ if (!(instance.job.flags & 4)) {
3356
3564
  instance.update();
3357
3565
  }
3358
3566
  delete leavingHooks.afterLeave;
@@ -3631,7 +3839,7 @@ var VueRuntimeDOM = (function (exports) {
3631
3839
  }
3632
3840
 
3633
3841
  function useId() {
3634
- const i = getCurrentInstance();
3842
+ const i = getCurrentGenericInstance();
3635
3843
  if (i) {
3636
3844
  return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
3637
3845
  } else {
@@ -3647,7 +3855,7 @@ var VueRuntimeDOM = (function (exports) {
3647
3855
 
3648
3856
  const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
3649
3857
  function useTemplateRef(key) {
3650
- const i = getCurrentInstance();
3858
+ const i = getCurrentGenericInstance();
3651
3859
  const r = shallowRef(null);
3652
3860
  if (i) {
3653
3861
  const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
@@ -3767,8 +3975,7 @@ var VueRuntimeDOM = (function (exports) {
3767
3975
  }
3768
3976
  };
3769
3977
  if (value) {
3770
- doSet.id = -1;
3771
- queuePostRenderEffect(doSet, parentSuspense);
3978
+ queuePostRenderEffect(doSet, -1, parentSuspense);
3772
3979
  } else {
3773
3980
  doSet();
3774
3981
  }
@@ -3936,6 +4143,9 @@ var VueRuntimeDOM = (function (exports) {
3936
4143
  );
3937
4144
  }
3938
4145
  } else if (shapeFlag & 6) {
4146
+ if (vnode.type.__vapor) {
4147
+ throw new Error("Vapor component hydration is not supported yet.");
4148
+ }
3939
4149
  vnode.slotScopeIds = slotScopeIds;
3940
4150
  const container = parentNode(node);
3941
4151
  if (isFragmentStart) {
@@ -4097,11 +4307,15 @@ Server rendered element contains more child nodes than client vdom.`
4097
4307
  invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
4098
4308
  }
4099
4309
  if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
4100
- queueEffectWithSuspense(() => {
4101
- vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
4102
- needCallTransitionHooks && transition.enter(el);
4103
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4104
- }, parentSuspense);
4310
+ queueEffectWithSuspense(
4311
+ () => {
4312
+ vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
4313
+ needCallTransitionHooks && transition.enter(el);
4314
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
4315
+ },
4316
+ void 0,
4317
+ parentSuspense
4318
+ );
4105
4319
  }
4106
4320
  }
4107
4321
  return el.nextSibling;
@@ -4381,14 +4595,16 @@ Server rendered element contains fewer child nodes than client vdom.`
4381
4595
  if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
4382
4596
  const cssVars = instance.getCssVars();
4383
4597
  for (const key in cssVars) {
4384
- expectedMap.set(
4385
- `--${getEscapedCssVarName(key)}`,
4386
- String(cssVars[key])
4387
- );
4598
+ const value = normalizeCssVarValue(cssVars[key]);
4599
+ expectedMap.set(`--${getEscapedCssVarName(key)}`, value);
4388
4600
  }
4389
4601
  }
4390
4602
  if (vnode === root && instance.parent) {
4391
- resolveCssVars(instance.parent, instance.vnode, expectedMap);
4603
+ resolveCssVars(
4604
+ instance.parent,
4605
+ instance.vnode,
4606
+ expectedMap
4607
+ );
4392
4608
  }
4393
4609
  }
4394
4610
  const allowMismatchAttr = "data-allow-mismatch";
@@ -4647,7 +4863,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4647
4863
  }
4648
4864
  load().then(() => {
4649
4865
  loaded.value = true;
4650
- if (instance.parent && isKeepAlive(instance.parent.vnode)) {
4866
+ if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) {
4651
4867
  instance.parent.update();
4652
4868
  }
4653
4869
  }).catch((err) => {
@@ -4690,15 +4906,15 @@ Server rendered element contains fewer child nodes than client vdom.`
4690
4906
  max: [String, Number]
4691
4907
  },
4692
4908
  setup(props, { slots }) {
4693
- const instance = getCurrentInstance();
4694
- const sharedContext = instance.ctx;
4909
+ const keepAliveInstance = getCurrentInstance();
4910
+ const sharedContext = keepAliveInstance.ctx;
4695
4911
  const cache = /* @__PURE__ */ new Map();
4696
4912
  const keys = /* @__PURE__ */ new Set();
4697
4913
  let current = null;
4698
4914
  {
4699
- instance.__v_cache = cache;
4915
+ keepAliveInstance.__v_cache = cache;
4700
4916
  }
4701
- const parentSuspense = instance.suspense;
4917
+ const parentSuspense = keepAliveInstance.suspense;
4702
4918
  const {
4703
4919
  renderer: {
4704
4920
  p: patch,
@@ -4709,58 +4925,80 @@ Server rendered element contains fewer child nodes than client vdom.`
4709
4925
  } = sharedContext;
4710
4926
  const storageContainer = createElement("div");
4711
4927
  sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
4712
- const instance2 = vnode.component;
4713
- move(vnode, container, anchor, 0, parentSuspense);
4928
+ const instance = vnode.component;
4929
+ move(
4930
+ vnode,
4931
+ container,
4932
+ anchor,
4933
+ 0,
4934
+ keepAliveInstance,
4935
+ parentSuspense
4936
+ );
4714
4937
  patch(
4715
- instance2.vnode,
4938
+ instance.vnode,
4716
4939
  vnode,
4717
4940
  container,
4718
4941
  anchor,
4719
- instance2,
4942
+ instance,
4720
4943
  parentSuspense,
4721
4944
  namespace,
4722
4945
  vnode.slotScopeIds,
4723
4946
  optimized
4724
4947
  );
4725
- queuePostRenderEffect(() => {
4726
- instance2.isDeactivated = false;
4727
- if (instance2.a) {
4728
- invokeArrayFns(instance2.a);
4729
- }
4730
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4731
- if (vnodeHook) {
4732
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4733
- }
4734
- }, parentSuspense);
4948
+ queuePostRenderEffect(
4949
+ () => {
4950
+ instance.isDeactivated = false;
4951
+ if (instance.a) {
4952
+ invokeArrayFns(instance.a);
4953
+ }
4954
+ const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
4955
+ if (vnodeHook) {
4956
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
4957
+ }
4958
+ },
4959
+ void 0,
4960
+ parentSuspense
4961
+ );
4735
4962
  {
4736
- devtoolsComponentAdded(instance2);
4963
+ devtoolsComponentAdded(instance);
4737
4964
  }
4738
4965
  };
4739
4966
  sharedContext.deactivate = (vnode) => {
4740
- const instance2 = vnode.component;
4741
- invalidateMount(instance2.m);
4742
- invalidateMount(instance2.a);
4743
- move(vnode, storageContainer, null, 1, parentSuspense);
4744
- queuePostRenderEffect(() => {
4745
- if (instance2.da) {
4746
- invokeArrayFns(instance2.da);
4747
- }
4748
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4749
- if (vnodeHook) {
4750
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
4751
- }
4752
- instance2.isDeactivated = true;
4753
- }, parentSuspense);
4967
+ const instance = vnode.component;
4968
+ invalidateMount(instance.m);
4969
+ invalidateMount(instance.a);
4970
+ move(
4971
+ vnode,
4972
+ storageContainer,
4973
+ null,
4974
+ 1,
4975
+ keepAliveInstance,
4976
+ parentSuspense
4977
+ );
4978
+ queuePostRenderEffect(
4979
+ () => {
4980
+ if (instance.da) {
4981
+ invokeArrayFns(instance.da);
4982
+ }
4983
+ const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
4984
+ if (vnodeHook) {
4985
+ invokeVNodeHook(vnodeHook, instance.parent, vnode);
4986
+ }
4987
+ instance.isDeactivated = true;
4988
+ },
4989
+ void 0,
4990
+ parentSuspense
4991
+ );
4754
4992
  {
4755
- devtoolsComponentAdded(instance2);
4993
+ devtoolsComponentAdded(instance);
4756
4994
  }
4757
4995
  {
4758
- instance2.__keepAliveStorageContainer = storageContainer;
4996
+ instance.__keepAliveStorageContainer = storageContainer;
4759
4997
  }
4760
4998
  };
4761
4999
  function unmount(vnode) {
4762
5000
  resetShapeFlag(vnode);
4763
- _unmount(vnode, instance, parentSuspense, true);
5001
+ _unmount(vnode, keepAliveInstance, parentSuspense, true);
4764
5002
  }
4765
5003
  function pruneCache(filter) {
4766
5004
  cache.forEach((vnode, key) => {
@@ -4792,12 +5030,19 @@ Server rendered element contains fewer child nodes than client vdom.`
4792
5030
  let pendingCacheKey = null;
4793
5031
  const cacheSubtree = () => {
4794
5032
  if (pendingCacheKey != null) {
4795
- if (isSuspense(instance.subTree.type)) {
4796
- queuePostRenderEffect(() => {
4797
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
4798
- }, instance.subTree.suspense);
5033
+ if (isSuspense(keepAliveInstance.subTree.type)) {
5034
+ queuePostRenderEffect(
5035
+ () => {
5036
+ cache.set(
5037
+ pendingCacheKey,
5038
+ getInnerChild(keepAliveInstance.subTree)
5039
+ );
5040
+ },
5041
+ void 0,
5042
+ keepAliveInstance.subTree.suspense
5043
+ );
4799
5044
  } else {
4800
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
5045
+ cache.set(pendingCacheKey, getInnerChild(keepAliveInstance.subTree));
4801
5046
  }
4802
5047
  }
4803
5048
  };
@@ -4805,12 +5050,12 @@ Server rendered element contains fewer child nodes than client vdom.`
4805
5050
  onUpdated(cacheSubtree);
4806
5051
  onBeforeUnmount(() => {
4807
5052
  cache.forEach((cached) => {
4808
- const { subTree, suspense } = instance;
5053
+ const { subTree, suspense } = keepAliveInstance;
4809
5054
  const vnode = getInnerChild(subTree);
4810
5055
  if (cached.type === vnode.type && cached.key === vnode.key) {
4811
5056
  resetShapeFlag(vnode);
4812
5057
  const da = vnode.component.da;
4813
- da && queuePostRenderEffect(da, suspense);
5058
+ da && queuePostRenderEffect(da, void 0, suspense);
4814
5059
  return;
4815
5060
  }
4816
5061
  unmount(cached);
@@ -4896,7 +5141,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4896
5141
  function onDeactivated(hook, target) {
4897
5142
  registerKeepAliveHook(hook, "da", target);
4898
5143
  }
4899
- function registerKeepAliveHook(hook, type, target = currentInstance) {
5144
+ function registerKeepAliveHook(hook, type, target = getCurrentInstance()) {
4900
5145
  const wrappedHook = hook.__wdc || (hook.__wdc = () => {
4901
5146
  let current = target;
4902
5147
  while (current) {
@@ -4910,7 +5155,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4910
5155
  injectHook(type, wrappedHook, target);
4911
5156
  if (target) {
4912
5157
  let current = target.parent;
4913
- while (current && current.parent) {
5158
+ while (current && current.parent && current.parent.vnode) {
4914
5159
  if (isKeepAlive(current.parent.vnode)) {
4915
5160
  injectToKeepAliveRoot(wrappedHook, type, target, current);
4916
5161
  }
@@ -4942,12 +5187,14 @@ Server rendered element contains fewer child nodes than client vdom.`
4942
5187
  if (target) {
4943
5188
  const hooks = target[type] || (target[type] = []);
4944
5189
  const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
4945
- pauseTracking();
4946
- const reset = setCurrentInstance(target);
4947
- const res = callWithAsyncErrorHandling(hook, target, type, args);
4948
- reset();
4949
- resetTracking();
4950
- return res;
5190
+ const prevSub = setActiveSub();
5191
+ const prev = setCurrentInstance(target);
5192
+ try {
5193
+ return callWithAsyncErrorHandling(hook, target, type, args);
5194
+ } finally {
5195
+ setCurrentInstance(...prev);
5196
+ setActiveSub(prevSub);
5197
+ }
4951
5198
  });
4952
5199
  if (prepend) {
4953
5200
  hooks.unshift(wrappedHook);
@@ -5018,7 +5265,11 @@ Server rendered element contains fewer child nodes than client vdom.`
5018
5265
  const res = (
5019
5266
  // local registration
5020
5267
  // check instance[type] first which is resolved for options API
5021
- resolve(instance[type] || Component[type], name) || // global registration
5268
+ resolve(
5269
+ instance[type] || Component[type],
5270
+ name
5271
+ ) || // global registration
5272
+ // @ts-expect-error filters only exist in compat mode
5022
5273
  resolve(instance.appContext[type], name)
5023
5274
  );
5024
5275
  if (!res && maybeSelfReference) {
@@ -5112,7 +5363,13 @@ If this is a native custom element, make sure to exclude it from component resol
5112
5363
  }
5113
5364
 
5114
5365
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5115
- if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5366
+ let slot = slots[name];
5367
+ if (slot && slot.__vapor) {
5368
+ const ret = (openBlock(), createBlock(VaporSlot, props));
5369
+ ret.vs = { slot, fallback };
5370
+ return ret;
5371
+ }
5372
+ if (currentRenderingInstance && (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce)) {
5116
5373
  if (name !== "default") props.name = name;
5117
5374
  return openBlock(), createBlock(
5118
5375
  Fragment,
@@ -5121,7 +5378,6 @@ If this is a native custom element, make sure to exclude it from component resol
5121
5378
  64
5122
5379
  );
5123
5380
  }
5124
- let slot = slots[name];
5125
5381
  if (slot && slot.length > 1) {
5126
5382
  warn$1(
5127
5383
  `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
@@ -5176,8 +5432,9 @@ If this is a native custom element, make sure to exclude it from component resol
5176
5432
  }
5177
5433
 
5178
5434
  const getPublicInstance = (i) => {
5179
- if (!i) return null;
5180
- if (isStatefulComponent(i)) return getComponentPublicInstance(i);
5435
+ if (!i || i.vapor) return null;
5436
+ if (isStatefulComponent(i))
5437
+ return getComponentPublicInstance(i);
5181
5438
  return getPublicInstance(i.parent);
5182
5439
  };
5183
5440
  const publicPropertiesMap = (
@@ -5470,11 +5727,16 @@ If this is a native custom element, make sure to exclude it from component resol
5470
5727
  return getContext().attrs;
5471
5728
  }
5472
5729
  function getContext() {
5473
- const i = getCurrentInstance();
5730
+ const i = getCurrentGenericInstance();
5474
5731
  if (!i) {
5475
5732
  warn$1(`useContext() called without active instance.`);
5476
5733
  }
5477
- return i.setupContext || (i.setupContext = createSetupContext(i));
5734
+ if (i.vapor) {
5735
+ return i;
5736
+ } else {
5737
+ const ii = i;
5738
+ return ii.setupContext || (ii.setupContext = createSetupContext(ii));
5739
+ }
5478
5740
  }
5479
5741
  function normalizePropsOrEmits(props) {
5480
5742
  return isArray(props) ? props.reduce(
@@ -5522,14 +5784,14 @@ If this is a native custom element, make sure to exclude it from component resol
5522
5784
  return ret;
5523
5785
  }
5524
5786
  function withAsyncContext(getAwaitable) {
5525
- const ctx = getCurrentInstance();
5787
+ const ctx = getCurrentGenericInstance();
5526
5788
  if (!ctx) {
5527
5789
  warn$1(
5528
5790
  `withAsyncContext called without active current instance. This is likely a bug.`
5529
5791
  );
5530
5792
  }
5531
5793
  let awaitable = getAwaitable();
5532
- unsetCurrentInstance();
5794
+ setCurrentInstance(null, void 0);
5533
5795
  if (isPromise(awaitable)) {
5534
5796
  awaitable = awaitable.catch((e) => {
5535
5797
  setCurrentInstance(ctx);
@@ -5973,7 +6235,7 @@ If this is a native custom element, make sure to exclude it from component resol
5973
6235
  };
5974
6236
  }
5975
6237
  let uid$1 = 0;
5976
- function createAppAPI(render, hydrate) {
6238
+ function createAppAPI(mount, unmount, getPublicInstance, render) {
5977
6239
  return function createApp(rootComponent, rootProps = null) {
5978
6240
  if (!isFunction(rootComponent)) {
5979
6241
  rootComponent = extend({}, rootComponent);
@@ -6066,33 +6328,15 @@ If this is a native custom element, make sure to exclude it from component resol
6066
6328
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
6067
6329
  );
6068
6330
  }
6069
- const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
6070
- vnode.appContext = context;
6071
- if (namespace === true) {
6072
- namespace = "svg";
6073
- } else if (namespace === false) {
6074
- namespace = void 0;
6075
- }
6331
+ const instance = mount(app, rootContainer, isHydrate, namespace);
6076
6332
  {
6077
- context.reload = () => {
6078
- const cloned = cloneVNode(vnode);
6079
- cloned.el = null;
6080
- render(cloned, rootContainer, namespace);
6081
- };
6082
- }
6083
- if (isHydrate && hydrate) {
6084
- hydrate(vnode, rootContainer);
6085
- } else {
6086
- render(vnode, rootContainer, namespace);
6333
+ app._instance = instance;
6334
+ devtoolsInitApp(app, version);
6087
6335
  }
6088
6336
  isMounted = true;
6089
6337
  app._container = rootContainer;
6090
6338
  rootContainer.__vue_app__ = app;
6091
- {
6092
- app._instance = vnode.component;
6093
- devtoolsInitApp(app, version);
6094
- }
6095
- return getComponentPublicInstance(vnode.component);
6339
+ return getPublicInstance(instance);
6096
6340
  } else {
6097
6341
  warn$1(
6098
6342
  `App has already been mounted.
@@ -6115,7 +6359,7 @@ If you want to remount the same app, move your app creation logic into a factory
6115
6359
  app._instance,
6116
6360
  16
6117
6361
  );
6118
- render(null, app._container);
6362
+ unmount(app);
6119
6363
  {
6120
6364
  app._instance = null;
6121
6365
  devtoolsUnmountApp(app);
@@ -6156,6 +6400,7 @@ If you want to remount the same app, move your app creation logic into a factory
6156
6400
  let currentApp = null;
6157
6401
 
6158
6402
  function provide(key, value) {
6403
+ const currentInstance = getCurrentGenericInstance();
6159
6404
  if (!currentInstance) {
6160
6405
  {
6161
6406
  warn$1(`provide() can only be used inside setup().`);
@@ -6170,9 +6415,9 @@ If you want to remount the same app, move your app creation logic into a factory
6170
6415
  }
6171
6416
  }
6172
6417
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
6173
- const instance = currentInstance || currentRenderingInstance;
6418
+ const instance = getCurrentGenericInstance();
6174
6419
  if (instance || currentApp) {
6175
- let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
6420
+ let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.appContext && instance.appContext.provides : instance.parent.provides : void 0;
6176
6421
  if (provides && key in provides) {
6177
6422
  return provides[key];
6178
6423
  } else if (arguments.length > 1) {
@@ -6185,7 +6430,7 @@ If you want to remount the same app, move your app creation logic into a factory
6185
6430
  }
6186
6431
  }
6187
6432
  function hasInjectionContext() {
6188
- return !!(currentInstance || currentRenderingInstance || currentApp);
6433
+ return !!(getCurrentGenericInstance() || currentApp);
6189
6434
  }
6190
6435
 
6191
6436
  const internalObjectProto = {};
@@ -6193,7 +6438,7 @@ If you want to remount the same app, move your app creation logic into a factory
6193
6438
  const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
6194
6439
 
6195
6440
  function initProps(instance, rawProps, isStateful, isSSR = false) {
6196
- const props = {};
6441
+ const props = instance.props = {};
6197
6442
  const attrs = createInternalObject();
6198
6443
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
6199
6444
  setFullProps(instance, rawProps, props, attrs);
@@ -6203,7 +6448,7 @@ If you want to remount the same app, move your app creation logic into a factory
6203
6448
  }
6204
6449
  }
6205
6450
  {
6206
- validateProps(rawProps || {}, props, instance);
6451
+ validateProps(rawProps || {}, props, instance.propsOptions[0]);
6207
6452
  }
6208
6453
  if (isStateful) {
6209
6454
  instance.props = isSSR ? props : shallowReactive(props);
@@ -6255,11 +6500,10 @@ If you want to remount the same app, move your app creation logic into a factory
6255
6500
  const camelizedKey = camelize(key);
6256
6501
  props[camelizedKey] = resolvePropValue(
6257
6502
  options,
6258
- rawCurrentProps,
6259
6503
  camelizedKey,
6260
6504
  value,
6261
6505
  instance,
6262
- false
6506
+ baseResolveDefault
6263
6507
  );
6264
6508
  }
6265
6509
  } else {
@@ -6286,10 +6530,10 @@ If you want to remount the same app, move your app creation logic into a factory
6286
6530
  rawPrevProps[kebabKey] !== void 0)) {
6287
6531
  props[key] = resolvePropValue(
6288
6532
  options,
6289
- rawCurrentProps,
6290
6533
  key,
6291
6534
  void 0,
6292
6535
  instance,
6536
+ baseResolveDefault,
6293
6537
  true
6294
6538
  );
6295
6539
  }
@@ -6311,7 +6555,7 @@ If you want to remount the same app, move your app creation logic into a factory
6311
6555
  trigger(instance.attrs, "set", "");
6312
6556
  }
6313
6557
  {
6314
- validateProps(rawProps || {}, props, instance);
6558
+ validateProps(rawProps || {}, props, instance.propsOptions[0]);
6315
6559
  }
6316
6560
  }
6317
6561
  function setFullProps(instance, rawProps, props, attrs) {
@@ -6340,39 +6584,37 @@ If you want to remount the same app, move your app creation logic into a factory
6340
6584
  }
6341
6585
  }
6342
6586
  if (needCastKeys) {
6343
- const rawCurrentProps = toRaw(props);
6344
6587
  const castValues = rawCastValues || EMPTY_OBJ;
6345
6588
  for (let i = 0; i < needCastKeys.length; i++) {
6346
6589
  const key = needCastKeys[i];
6347
6590
  props[key] = resolvePropValue(
6348
6591
  options,
6349
- rawCurrentProps,
6350
6592
  key,
6351
6593
  castValues[key],
6352
6594
  instance,
6595
+ baseResolveDefault,
6353
6596
  !hasOwn(castValues, key)
6354
6597
  );
6355
6598
  }
6356
6599
  }
6357
6600
  return hasAttrsChanged;
6358
6601
  }
6359
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
6602
+ function resolvePropValue(options, key, value, instance, resolveDefault, isAbsent = false) {
6360
6603
  const opt = options[key];
6361
6604
  if (opt != null) {
6362
6605
  const hasDefault = hasOwn(opt, "default");
6363
6606
  if (hasDefault && value === void 0) {
6364
6607
  const defaultValue = opt.default;
6365
6608
  if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
6366
- const { propsDefaults } = instance;
6367
- if (key in propsDefaults) {
6368
- value = propsDefaults[key];
6609
+ const cachedDefaults = instance.propsDefaults || (instance.propsDefaults = {});
6610
+ if (hasOwn(cachedDefaults, key)) {
6611
+ value = cachedDefaults[key];
6369
6612
  } else {
6370
- const reset = setCurrentInstance(instance);
6371
- value = propsDefaults[key] = defaultValue.call(
6372
- null,
6373
- props
6613
+ value = cachedDefaults[key] = resolveDefault(
6614
+ defaultValue,
6615
+ instance,
6616
+ key
6374
6617
  );
6375
- reset();
6376
6618
  }
6377
6619
  } else {
6378
6620
  value = defaultValue;
@@ -6391,6 +6633,17 @@ If you want to remount the same app, move your app creation logic into a factory
6391
6633
  }
6392
6634
  return value;
6393
6635
  }
6636
+ function baseResolveDefault(factory, instance, key) {
6637
+ let value;
6638
+ const prev = setCurrentInstance(instance);
6639
+ const props = toRaw(instance.props);
6640
+ value = factory.call(
6641
+ null,
6642
+ props
6643
+ );
6644
+ setCurrentInstance(...prev);
6645
+ return value;
6646
+ }
6394
6647
  const mixinPropsCache = /* @__PURE__ */ new WeakMap();
6395
6648
  function normalizePropsOptions(comp, appContext, asMixin = false) {
6396
6649
  const cache = asMixin ? mixinPropsCache : appContext.propsCache;
@@ -6425,6 +6678,14 @@ If you want to remount the same app, move your app creation logic into a factory
6425
6678
  }
6426
6679
  return EMPTY_ARR;
6427
6680
  }
6681
+ baseNormalizePropsOptions(raw, normalized, needCastKeys);
6682
+ const res = [normalized, needCastKeys];
6683
+ if (isObject(comp)) {
6684
+ cache.set(comp, res);
6685
+ }
6686
+ return res;
6687
+ }
6688
+ function baseNormalizePropsOptions(raw, normalized, needCastKeys) {
6428
6689
  if (isArray(raw)) {
6429
6690
  for (let i = 0; i < raw.length; i++) {
6430
6691
  if (!isString(raw[i])) {
@@ -6469,11 +6730,6 @@ If you want to remount the same app, move your app creation logic into a factory
6469
6730
  }
6470
6731
  }
6471
6732
  }
6472
- const res = [normalized, needCastKeys];
6473
- if (isObject(comp)) {
6474
- cache.set(comp, res);
6475
- }
6476
- return res;
6477
6733
  }
6478
6734
  function validatePropName(key) {
6479
6735
  if (key[0] !== "$" && !isReservedProp(key)) {
@@ -6495,26 +6751,26 @@ If you want to remount the same app, move your app creation logic into a factory
6495
6751
  }
6496
6752
  return "";
6497
6753
  }
6498
- function validateProps(rawProps, props, instance) {
6499
- const resolvedValues = toRaw(props);
6500
- const options = instance.propsOptions[0];
6754
+ function validateProps(rawProps, resolvedProps, options) {
6755
+ resolvedProps = toRaw(resolvedProps);
6501
6756
  const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
6502
6757
  for (const key in options) {
6503
- let opt = options[key];
6504
- if (opt == null) continue;
6505
- validateProp(
6506
- key,
6507
- resolvedValues[key],
6508
- opt,
6509
- shallowReadonly(resolvedValues) ,
6510
- !camelizePropsKey.includes(key)
6511
- );
6758
+ const opt = options[key];
6759
+ if (opt != null) {
6760
+ validateProp(
6761
+ key,
6762
+ resolvedProps[key],
6763
+ opt,
6764
+ resolvedProps,
6765
+ !camelizePropsKey.includes(key)
6766
+ );
6767
+ }
6512
6768
  }
6513
6769
  }
6514
- function validateProp(name, value, prop, props, isAbsent) {
6515
- const { type, required, validator, skipCheck } = prop;
6770
+ function validateProp(key, value, propOptions, resolvedProps, isAbsent) {
6771
+ const { type, required, validator, skipCheck } = propOptions;
6516
6772
  if (required && isAbsent) {
6517
- warn$1('Missing required prop: "' + name + '"');
6773
+ warn$1('Missing required prop: "' + key + '"');
6518
6774
  return;
6519
6775
  }
6520
6776
  if (value == null && !required) {
@@ -6530,12 +6786,12 @@ If you want to remount the same app, move your app creation logic into a factory
6530
6786
  isValid = valid;
6531
6787
  }
6532
6788
  if (!isValid) {
6533
- warn$1(getInvalidTypeMessage(name, value, expectedTypes));
6789
+ warn$1(getInvalidTypeMessage(key, value, expectedTypes));
6534
6790
  return;
6535
6791
  }
6536
6792
  }
6537
- if (validator && !validator(value, props)) {
6538
- warn$1('Invalid prop: custom validator check failed for prop "' + name + '".');
6793
+ if (validator && !validator(value, shallowReadonly(resolvedProps) )) {
6794
+ warn$1('Invalid prop: custom validator check failed for prop "' + key + '".');
6539
6795
  }
6540
6796
  }
6541
6797
  const isSimpleType = /* @__PURE__ */ makeMap(
@@ -6606,7 +6862,7 @@ If you want to remount the same app, move your app creation logic into a factory
6606
6862
  return rawSlot;
6607
6863
  }
6608
6864
  const normalized = withCtx((...args) => {
6609
- if (currentInstance && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
6865
+ if (currentInstance && !currentInstance.vapor && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance.root)) {
6610
6866
  warn$1(
6611
6867
  `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
6612
6868
  );
@@ -6703,12 +6959,15 @@ If you want to remount the same app, move your app creation logic into a factory
6703
6959
 
6704
6960
  let supported;
6705
6961
  let perf;
6962
+ let cachedNow$1 = 0;
6963
+ const p$1 = /* @__PURE__ */ Promise.resolve();
6964
+ const getNow$1 = () => cachedNow$1 || (p$1.then(() => cachedNow$1 = 0), cachedNow$1 = isSupported() ? perf.now() : Date.now());
6706
6965
  function startMeasure(instance, type) {
6707
6966
  if (instance.appContext.config.performance && isSupported()) {
6708
6967
  perf.mark(`vue-${type}-${instance.uid}`);
6709
6968
  }
6710
6969
  {
6711
- devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
6970
+ devtoolsPerfStart(instance, type, getNow$1());
6712
6971
  }
6713
6972
  }
6714
6973
  function endMeasure(instance, type) {
@@ -6725,7 +6984,7 @@ If you want to remount the same app, move your app creation logic into a factory
6725
6984
  perf.clearMarks(endTag);
6726
6985
  }
6727
6986
  {
6728
- devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
6987
+ devtoolsPerfEnd(instance, type, getNow$1());
6729
6988
  }
6730
6989
  }
6731
6990
  function isSupported() {
@@ -6809,6 +7068,9 @@ If you want to remount the same app, move your app creation logic into a factory
6809
7068
  optimized
6810
7069
  );
6811
7070
  break;
7071
+ case VaporSlot:
7072
+ getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor);
7073
+ break;
6812
7074
  default:
6813
7075
  if (shapeFlag & 1) {
6814
7076
  processElement(
@@ -7021,11 +7283,15 @@ If you want to remount the same app, move your app creation logic into a factory
7021
7283
  }
7022
7284
  hostInsert(el, container, anchor);
7023
7285
  if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
7024
- queuePostRenderEffect(() => {
7025
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7026
- needCallTransitionHooks && transition.enter(el);
7027
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7028
- }, parentSuspense);
7286
+ queuePostRenderEffect(
7287
+ () => {
7288
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
7289
+ needCallTransitionHooks && transition.enter(el);
7290
+ dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
7291
+ },
7292
+ void 0,
7293
+ parentSuspense
7294
+ );
7029
7295
  }
7030
7296
  };
7031
7297
  const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
@@ -7037,8 +7303,8 @@ If you want to remount the same app, move your app creation logic into a factory
7037
7303
  hostSetScopeId(el, slotScopeIds[i]);
7038
7304
  }
7039
7305
  }
7040
- if (parentComponent) {
7041
- let subTree = parentComponent.subTree;
7306
+ let subTree = parentComponent && parentComponent.subTree;
7307
+ if (subTree) {
7042
7308
  if (subTree.patchFlag > 0 && subTree.patchFlag & 2048) {
7043
7309
  subTree = filterSingleRoot(subTree.children) || subTree;
7044
7310
  }
@@ -7155,10 +7421,14 @@ If you want to remount the same app, move your app creation logic into a factory
7155
7421
  patchProps(el, oldProps, newProps, parentComponent, namespace);
7156
7422
  }
7157
7423
  if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
7158
- queuePostRenderEffect(() => {
7159
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7160
- dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7161
- }, parentSuspense);
7424
+ queuePostRenderEffect(
7425
+ () => {
7426
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
7427
+ dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
7428
+ },
7429
+ void 0,
7430
+ parentSuspense
7431
+ );
7162
7432
  }
7163
7433
  };
7164
7434
  const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
@@ -7286,7 +7556,22 @@ If you want to remount the same app, move your app creation logic into a factory
7286
7556
  };
7287
7557
  const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
7288
7558
  n2.slotScopeIds = slotScopeIds;
7289
- if (n1 == null) {
7559
+ if (n2.type.__vapor) {
7560
+ if (n1 == null) {
7561
+ getVaporInterface(parentComponent, n2).mount(
7562
+ n2,
7563
+ container,
7564
+ anchor,
7565
+ parentComponent
7566
+ );
7567
+ } else {
7568
+ getVaporInterface(parentComponent, n2).update(
7569
+ n1,
7570
+ n2,
7571
+ shouldUpdateComponent(n1, n2, optimized)
7572
+ );
7573
+ }
7574
+ } else if (n1 == null) {
7290
7575
  if (n2.shapeFlag & 512) {
7291
7576
  parentComponent.ctx.activate(
7292
7577
  n2,
@@ -7372,15 +7657,52 @@ If you want to remount the same app, move your app creation logic into a factory
7372
7657
  return;
7373
7658
  } else {
7374
7659
  instance.next = n2;
7375
- instance.update();
7660
+ instance.effect.run();
7376
7661
  }
7377
7662
  } else {
7378
7663
  n2.el = n1.el;
7379
7664
  instance.vnode = n2;
7380
7665
  }
7381
7666
  };
7382
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7383
- const componentUpdateFn = () => {
7667
+ class SetupRenderEffect extends ReactiveEffect {
7668
+ constructor(instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) {
7669
+ const prevScope = setCurrentScope(instance.scope);
7670
+ super();
7671
+ this.instance = instance;
7672
+ this.initialVNode = initialVNode;
7673
+ this.container = container;
7674
+ this.anchor = anchor;
7675
+ this.parentSuspense = parentSuspense;
7676
+ this.namespace = namespace;
7677
+ this.optimized = optimized;
7678
+ setCurrentScope(prevScope);
7679
+ this.job = instance.job = () => {
7680
+ if (this.dirty) {
7681
+ this.run();
7682
+ }
7683
+ };
7684
+ this.job.i = instance;
7685
+ {
7686
+ this.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
7687
+ this.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
7688
+ }
7689
+ }
7690
+ notify() {
7691
+ if (!(this.flags & 256)) {
7692
+ const job = this.job;
7693
+ queueJob(job, job.i.uid);
7694
+ }
7695
+ }
7696
+ fn() {
7697
+ const {
7698
+ instance,
7699
+ initialVNode,
7700
+ container,
7701
+ anchor,
7702
+ parentSuspense,
7703
+ namespace,
7704
+ optimized
7705
+ } = this;
7384
7706
  if (!instance.isMounted) {
7385
7707
  let vnodeHook;
7386
7708
  const { el, props } = initialVNode;
@@ -7456,23 +7778,24 @@ If you want to remount the same app, move your app creation logic into a factory
7456
7778
  initialVNode.el = subTree.el;
7457
7779
  }
7458
7780
  if (m) {
7459
- queuePostRenderEffect(m, parentSuspense);
7781
+ queuePostRenderEffect(m, void 0, parentSuspense);
7460
7782
  }
7461
7783
  if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
7462
7784
  const scopedInitialVNode = initialVNode;
7463
7785
  queuePostRenderEffect(
7464
7786
  () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
7787
+ void 0,
7465
7788
  parentSuspense
7466
7789
  );
7467
7790
  }
7468
- if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
7469
- instance.a && queuePostRenderEffect(instance.a, parentSuspense);
7791
+ if (initialVNode.shapeFlag & 256 || parent && parent.vnode && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
7792
+ instance.a && queuePostRenderEffect(instance.a, void 0, parentSuspense);
7470
7793
  }
7471
7794
  instance.isMounted = true;
7472
7795
  {
7473
7796
  devtoolsComponentAdded(instance);
7474
7797
  }
7475
- initialVNode = container = anchor = null;
7798
+ this.initialVNode = this.container = this.anchor = null;
7476
7799
  } else {
7477
7800
  let { next, bu, u, parent, vnode } = instance;
7478
7801
  {
@@ -7484,7 +7807,7 @@ If you want to remount the same app, move your app creation logic into a factory
7484
7807
  }
7485
7808
  nonHydratedAsyncRoot.asyncDep.then(() => {
7486
7809
  if (!instance.isUnmounted) {
7487
- componentUpdateFn();
7810
+ this.fn();
7488
7811
  }
7489
7812
  });
7490
7813
  return;
@@ -7540,11 +7863,12 @@ If you want to remount the same app, move your app creation logic into a factory
7540
7863
  updateHOCHostEl(instance, nextTree.el);
7541
7864
  }
7542
7865
  if (u) {
7543
- queuePostRenderEffect(u, parentSuspense);
7866
+ queuePostRenderEffect(u, void 0, parentSuspense);
7544
7867
  }
7545
7868
  if (vnodeHook = next.props && next.props.onVnodeUpdated) {
7546
7869
  queuePostRenderEffect(
7547
7870
  () => invokeVNodeHook(vnodeHook, parent, next, vnode),
7871
+ void 0,
7548
7872
  parentSuspense
7549
7873
  );
7550
7874
  }
@@ -7555,21 +7879,21 @@ If you want to remount the same app, move your app creation logic into a factory
7555
7879
  popWarningContext();
7556
7880
  }
7557
7881
  }
7558
- };
7559
- instance.scope.on();
7560
- const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
7561
- instance.scope.off();
7562
- const update = instance.update = effect.run.bind(effect);
7563
- const job = instance.job = effect.runIfDirty.bind(effect);
7564
- job.i = instance;
7565
- job.id = instance.uid;
7566
- effect.scheduler = () => queueJob(job);
7567
- toggleRecurse(instance, true);
7568
- {
7569
- effect.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0;
7570
- effect.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0;
7571
7882
  }
7572
- update();
7883
+ }
7884
+ const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
7885
+ const effect = instance.effect = new SetupRenderEffect(
7886
+ instance,
7887
+ initialVNode,
7888
+ container,
7889
+ anchor,
7890
+ parentSuspense,
7891
+ namespace,
7892
+ optimized
7893
+ );
7894
+ instance.update = effect.run.bind(effect);
7895
+ toggleRecurse(instance, true);
7896
+ effect.run();
7573
7897
  };
7574
7898
  const updateComponentPreRender = (instance, nextVNode, optimized) => {
7575
7899
  nextVNode.component = instance;
@@ -7578,9 +7902,9 @@ If you want to remount the same app, move your app creation logic into a factory
7578
7902
  instance.next = null;
7579
7903
  updateProps(instance, nextVNode.props, prevProps, optimized);
7580
7904
  updateSlots(instance, nextVNode.children, optimized);
7581
- pauseTracking();
7905
+ const prevSub = setActiveSub();
7582
7906
  flushPreFlushCbs(instance);
7583
- resetTracking();
7907
+ setActiveSub(prevSub);
7584
7908
  };
7585
7909
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
7586
7910
  const c1 = n1 && n1.children;
@@ -7857,7 +8181,13 @@ If you want to remount the same app, move your app creation logic into a factory
7857
8181
  );
7858
8182
  } else if (moved) {
7859
8183
  if (j < 0 || i !== increasingNewIndexSequence[j]) {
7860
- move(nextChild, container, anchor, 2);
8184
+ move(
8185
+ nextChild,
8186
+ container,
8187
+ anchor,
8188
+ 2,
8189
+ parentComponent
8190
+ );
7861
8191
  } else {
7862
8192
  j--;
7863
8193
  }
@@ -7865,10 +8195,20 @@ If you want to remount the same app, move your app creation logic into a factory
7865
8195
  }
7866
8196
  }
7867
8197
  };
7868
- const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
8198
+ const move = (vnode, container, anchor, moveType, parentComponent, parentSuspense = null) => {
7869
8199
  const { el, type, transition, children, shapeFlag } = vnode;
7870
8200
  if (shapeFlag & 6) {
7871
- move(vnode.component.subTree, container, anchor, moveType);
8201
+ if (type.__vapor) {
8202
+ getVaporInterface(parentComponent, vnode).move(vnode, container, anchor);
8203
+ } else {
8204
+ move(
8205
+ vnode.component.subTree,
8206
+ container,
8207
+ anchor,
8208
+ moveType,
8209
+ parentComponent
8210
+ );
8211
+ }
7872
8212
  return;
7873
8213
  }
7874
8214
  if (shapeFlag & 128) {
@@ -7876,13 +8216,25 @@ If you want to remount the same app, move your app creation logic into a factory
7876
8216
  return;
7877
8217
  }
7878
8218
  if (shapeFlag & 64) {
7879
- type.move(vnode, container, anchor, internals);
8219
+ type.move(
8220
+ vnode,
8221
+ container,
8222
+ anchor,
8223
+ internals,
8224
+ parentComponent
8225
+ );
7880
8226
  return;
7881
8227
  }
7882
8228
  if (type === Fragment) {
7883
8229
  hostInsert(el, container, anchor);
7884
8230
  for (let i = 0; i < children.length; i++) {
7885
- move(children[i], container, anchor, moveType);
8231
+ move(
8232
+ children[i],
8233
+ container,
8234
+ anchor,
8235
+ moveType,
8236
+ parentComponent
8237
+ );
7886
8238
  }
7887
8239
  hostInsert(vnode.anchor, container, anchor);
7888
8240
  return;
@@ -7896,7 +8248,11 @@ If you want to remount the same app, move your app creation logic into a factory
7896
8248
  if (moveType === 0) {
7897
8249
  transition.beforeEnter(el);
7898
8250
  hostInsert(el, container, anchor);
7899
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
8251
+ queuePostRenderEffect(
8252
+ () => transition.enter(el),
8253
+ void 0,
8254
+ parentSuspense
8255
+ );
7900
8256
  } else {
7901
8257
  const { leave, delayLeave, afterLeave } = transition;
7902
8258
  const remove2 = () => {
@@ -7938,9 +8294,9 @@ If you want to remount the same app, move your app creation logic into a factory
7938
8294
  optimized = false;
7939
8295
  }
7940
8296
  if (ref != null) {
7941
- pauseTracking();
8297
+ const prevSub = setActiveSub();
7942
8298
  setRef(ref, null, parentSuspense, vnode, true);
7943
- resetTracking();
8299
+ setActiveSub(prevSub);
7944
8300
  }
7945
8301
  if (cacheIndex != null) {
7946
8302
  parentComponent.renderCache[cacheIndex] = void 0;
@@ -7956,7 +8312,12 @@ If you want to remount the same app, move your app creation logic into a factory
7956
8312
  invokeVNodeHook(vnodeHook, parentComponent, vnode);
7957
8313
  }
7958
8314
  if (shapeFlag & 6) {
7959
- unmountComponent(vnode.component, parentSuspense, doRemove);
8315
+ if (type.__vapor) {
8316
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8317
+ return;
8318
+ } else {
8319
+ unmountComponent(vnode.component, parentSuspense, doRemove);
8320
+ }
7960
8321
  } else {
7961
8322
  if (shapeFlag & 128) {
7962
8323
  vnode.suspense.unmount(parentSuspense, doRemove);
@@ -7990,15 +8351,23 @@ If you want to remount the same app, move your app creation logic into a factory
7990
8351
  } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
7991
8352
  unmountChildren(children, parentComponent, parentSuspense);
7992
8353
  }
8354
+ if (type === VaporSlot) {
8355
+ getVaporInterface(parentComponent, vnode).unmount(vnode, doRemove);
8356
+ return;
8357
+ }
7993
8358
  if (doRemove) {
7994
8359
  remove(vnode);
7995
8360
  }
7996
8361
  }
7997
8362
  if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
7998
- queuePostRenderEffect(() => {
7999
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8000
- shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8001
- }, parentSuspense);
8363
+ queuePostRenderEffect(
8364
+ () => {
8365
+ vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
8366
+ shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
8367
+ },
8368
+ void 0,
8369
+ parentSuspense
8370
+ );
8002
8371
  }
8003
8372
  };
8004
8373
  const remove = (vnode) => {
@@ -8055,7 +8424,7 @@ If you want to remount the same app, move your app creation logic into a factory
8055
8424
  const {
8056
8425
  bum,
8057
8426
  scope,
8058
- job,
8427
+ effect,
8059
8428
  subTree,
8060
8429
  um,
8061
8430
  m,
@@ -8074,16 +8443,18 @@ If you want to remount the same app, move your app creation logic into a factory
8074
8443
  });
8075
8444
  }
8076
8445
  scope.stop();
8077
- if (job) {
8078
- job.flags |= 8;
8446
+ if (effect) {
8447
+ effect.stop();
8079
8448
  unmount(subTree, instance, parentSuspense, doRemove);
8080
8449
  }
8081
8450
  if (um) {
8082
- queuePostRenderEffect(um, parentSuspense);
8451
+ queuePostRenderEffect(um, void 0, parentSuspense);
8083
8452
  }
8084
- queuePostRenderEffect(() => {
8085
- instance.isUnmounted = true;
8086
- }, parentSuspense);
8453
+ queuePostRenderEffect(
8454
+ () => instance.isUnmounted = true,
8455
+ void 0,
8456
+ parentSuspense
8457
+ );
8087
8458
  if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
8088
8459
  parentSuspense.deps--;
8089
8460
  if (parentSuspense.deps === 0) {
@@ -8101,6 +8472,9 @@ If you want to remount the same app, move your app creation logic into a factory
8101
8472
  };
8102
8473
  const getNextHostNode = (vnode) => {
8103
8474
  if (vnode.shapeFlag & 6) {
8475
+ if (vnode.type.__vapor) {
8476
+ return hostNextSibling(vnode.component.block);
8477
+ }
8104
8478
  return getNextHostNode(vnode.component.subTree);
8105
8479
  }
8106
8480
  if (vnode.shapeFlag & 128) {
@@ -8110,7 +8484,6 @@ If you want to remount the same app, move your app creation logic into a factory
8110
8484
  const teleportEnd = el && el[TeleportEndKey];
8111
8485
  return teleportEnd ? hostNextSibling(teleportEnd) : el;
8112
8486
  };
8113
- let isFlushing = false;
8114
8487
  const render = (vnode, container, namespace) => {
8115
8488
  if (vnode == null) {
8116
8489
  if (container._vnode) {
@@ -8128,12 +8501,7 @@ If you want to remount the same app, move your app creation logic into a factory
8128
8501
  );
8129
8502
  }
8130
8503
  container._vnode = vnode;
8131
- if (!isFlushing) {
8132
- isFlushing = true;
8133
- flushPreFlushCbs();
8134
- flushPostFlushCbs();
8135
- isFlushing = false;
8136
- }
8504
+ flushOnAppMount();
8137
8505
  };
8138
8506
  const internals = {
8139
8507
  p: patch,
@@ -8141,6 +8509,7 @@ If you want to remount the same app, move your app creation logic into a factory
8141
8509
  m: move,
8142
8510
  r: remove,
8143
8511
  mt: mountComponent,
8512
+ umt: unmountComponent,
8144
8513
  mc: mountChildren,
8145
8514
  pc: patchChildren,
8146
8515
  pbc: patchBlockChildren,
@@ -8154,22 +8523,53 @@ If you want to remount the same app, move your app creation logic into a factory
8154
8523
  internals
8155
8524
  );
8156
8525
  }
8526
+ const mountApp = (app, container, isHydrate, namespace) => {
8527
+ const vnode = app._ceVNode || createVNode(app._component, app._props);
8528
+ vnode.appContext = app._context;
8529
+ if (namespace === true) {
8530
+ namespace = "svg";
8531
+ } else if (namespace === false) {
8532
+ namespace = void 0;
8533
+ }
8534
+ {
8535
+ app._context.reload = () => {
8536
+ const cloned = cloneVNode(vnode);
8537
+ cloned.el = null;
8538
+ render(cloned, container, namespace);
8539
+ };
8540
+ }
8541
+ if (isHydrate && hydrate) {
8542
+ hydrate(vnode, container);
8543
+ } else {
8544
+ render(vnode, container, namespace);
8545
+ }
8546
+ return vnode.component;
8547
+ };
8548
+ const unmountApp = (app) => {
8549
+ render(null, app._container);
8550
+ };
8157
8551
  return {
8158
8552
  render,
8159
8553
  hydrate,
8160
- createApp: createAppAPI(render, hydrate)
8554
+ internals,
8555
+ createApp: createAppAPI(
8556
+ mountApp,
8557
+ unmountApp,
8558
+ getComponentPublicInstance)
8161
8559
  };
8162
8560
  }
8163
8561
  function resolveChildrenNamespace({ type, props }, currentNamespace) {
8164
8562
  return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
8165
8563
  }
8166
- function toggleRecurse({ effect, job }, allowed) {
8167
- if (allowed) {
8168
- effect.flags |= 32;
8169
- job.flags |= 4;
8170
- } else {
8171
- effect.flags &= -33;
8172
- job.flags &= -5;
8564
+ function toggleRecurse({ effect, job, vapor }, allowed) {
8565
+ if (!vapor) {
8566
+ if (allowed) {
8567
+ effect.flags |= 128;
8568
+ job.flags |= 2;
8569
+ } else {
8570
+ effect.flags &= -129;
8571
+ job.flags &= -3;
8572
+ }
8173
8573
  }
8174
8574
  }
8175
8575
  function needTransition(parentSuspense, transition) {
@@ -8202,46 +8602,6 @@ If you want to remount the same app, move your app creation logic into a factory
8202
8602
  }
8203
8603
  }
8204
8604
  }
8205
- function getSequence(arr) {
8206
- const p = arr.slice();
8207
- const result = [0];
8208
- let i, j, u, v, c;
8209
- const len = arr.length;
8210
- for (i = 0; i < len; i++) {
8211
- const arrI = arr[i];
8212
- if (arrI !== 0) {
8213
- j = result[result.length - 1];
8214
- if (arr[j] < arrI) {
8215
- p[i] = j;
8216
- result.push(i);
8217
- continue;
8218
- }
8219
- u = 0;
8220
- v = result.length - 1;
8221
- while (u < v) {
8222
- c = u + v >> 1;
8223
- if (arr[result[c]] < arrI) {
8224
- u = c + 1;
8225
- } else {
8226
- v = c;
8227
- }
8228
- }
8229
- if (arrI < arr[result[u]]) {
8230
- if (u > 0) {
8231
- p[i] = result[u - 1];
8232
- }
8233
- result[u] = i;
8234
- }
8235
- }
8236
- }
8237
- u = result.length;
8238
- v = result[u - 1];
8239
- while (u-- > 0) {
8240
- result[u] = v;
8241
- v = p[v];
8242
- }
8243
- return result;
8244
- }
8245
8605
  function locateNonHydratedAsyncRoot(instance) {
8246
8606
  const subComponent = instance.subTree.component;
8247
8607
  if (subComponent) {
@@ -8255,8 +8615,22 @@ If you want to remount the same app, move your app creation logic into a factory
8255
8615
  function invalidateMount(hooks) {
8256
8616
  if (hooks) {
8257
8617
  for (let i = 0; i < hooks.length; i++)
8258
- hooks[i].flags |= 8;
8618
+ hooks[i].flags |= 4;
8619
+ }
8620
+ }
8621
+ function getVaporInterface(instance, vnode) {
8622
+ const ctx = instance ? instance.appContext : vnode.appContext;
8623
+ const res = ctx && ctx.vapor;
8624
+ if (!res) {
8625
+ warn$1(
8626
+ `Vapor component found in vdom tree but vapor-in-vdom interop was not installed. Make sure to install it:
8627
+ \`\`\`
8628
+ import { vaporInteropPlugin } from 'vue'
8629
+ app.use(vaporInteropPlugin)
8630
+ \`\`\``
8631
+ );
8259
8632
  }
8633
+ return res;
8260
8634
  }
8261
8635
 
8262
8636
  const ssrContextKey = Symbol.for("v-scx");
@@ -8291,8 +8665,41 @@ If you want to remount the same app, move your app creation logic into a factory
8291
8665
  }
8292
8666
  return doWatch(source, cb, options);
8293
8667
  }
8668
+ class RenderWatcherEffect extends WatcherEffect {
8669
+ constructor(instance, source, cb, options, flush) {
8670
+ super(source, cb, options);
8671
+ this.flush = flush;
8672
+ const job = () => {
8673
+ if (this.dirty) {
8674
+ this.run();
8675
+ }
8676
+ };
8677
+ if (cb) {
8678
+ this.flags |= 128;
8679
+ job.flags |= 2;
8680
+ }
8681
+ if (instance) {
8682
+ job.i = instance;
8683
+ }
8684
+ this.job = job;
8685
+ }
8686
+ notify() {
8687
+ const flags = this.flags;
8688
+ if (!(flags & 256)) {
8689
+ const flush = this.flush;
8690
+ const job = this.job;
8691
+ if (flush === "post") {
8692
+ queuePostRenderEffect(job, void 0, job.i ? job.i.suspense : null);
8693
+ } else if (flush === "pre") {
8694
+ queueJob(job, job.i ? job.i.uid : void 0, true);
8695
+ } else {
8696
+ job();
8697
+ }
8698
+ }
8699
+ }
8700
+ }
8294
8701
  function doWatch(source, cb, options = EMPTY_OBJ) {
8295
- const { immediate, deep, flush, once } = options;
8702
+ const { immediate, deep, flush = "pre", once } = options;
8296
8703
  if (!cb) {
8297
8704
  if (immediate !== void 0) {
8298
8705
  warn$1(
@@ -8314,35 +8721,25 @@ If you want to remount the same app, move your app creation logic into a factory
8314
8721
  baseWatchOptions.onWarn = warn$1;
8315
8722
  const instance = currentInstance;
8316
8723
  baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
8317
- let isPre = false;
8318
- if (flush === "post") {
8319
- baseWatchOptions.scheduler = (job) => {
8320
- queuePostRenderEffect(job, instance && instance.suspense);
8321
- };
8322
- } else if (flush !== "sync") {
8323
- isPre = true;
8324
- baseWatchOptions.scheduler = (job, isFirstRun) => {
8325
- if (isFirstRun) {
8326
- job();
8327
- } else {
8328
- queueJob(job);
8329
- }
8330
- };
8724
+ const effect = new RenderWatcherEffect(
8725
+ instance,
8726
+ source,
8727
+ cb,
8728
+ baseWatchOptions,
8729
+ flush
8730
+ );
8731
+ if (cb) {
8732
+ effect.run(true);
8733
+ } else if (flush === "post") {
8734
+ queuePostRenderEffect(effect.job, void 0, instance && instance.suspense);
8735
+ } else {
8736
+ effect.run(true);
8331
8737
  }
8332
- baseWatchOptions.augmentJob = (job) => {
8333
- if (cb) {
8334
- job.flags |= 4;
8335
- }
8336
- if (isPre) {
8337
- job.flags |= 2;
8338
- if (instance) {
8339
- job.id = instance.uid;
8340
- job.i = instance;
8341
- }
8342
- }
8343
- };
8344
- const watchHandle = watch$1(source, cb, baseWatchOptions);
8345
- return watchHandle;
8738
+ const stop = effect.stop.bind(effect);
8739
+ stop.pause = effect.pause.bind(effect);
8740
+ stop.resume = effect.resume.bind(effect);
8741
+ stop.stop = stop;
8742
+ return stop;
8346
8743
  }
8347
8744
  function instanceWatch(source, value, options) {
8348
8745
  const publicThis = this.proxy;
@@ -8354,9 +8751,9 @@ If you want to remount the same app, move your app creation logic into a factory
8354
8751
  cb = value.handler;
8355
8752
  options = value;
8356
8753
  }
8357
- const reset = setCurrentInstance(this);
8754
+ const prev = setCurrentInstance(this);
8358
8755
  const res = doWatch(getter, cb.bind(publicThis), options);
8359
- reset();
8756
+ setCurrentInstance(...prev);
8360
8757
  return res;
8361
8758
  }
8362
8759
  function createPathGetter(ctx, path) {
@@ -8371,7 +8768,7 @@ If you want to remount the same app, move your app creation logic into a factory
8371
8768
  }
8372
8769
 
8373
8770
  function useModel(props, name, options = EMPTY_OBJ) {
8374
- const i = getCurrentInstance();
8771
+ const i = getCurrentGenericInstance();
8375
8772
  if (!i) {
8376
8773
  warn$1(`useModel() called without active instance.`);
8377
8774
  return ref();
@@ -8382,7 +8779,7 @@ If you want to remount the same app, move your app creation logic into a factory
8382
8779
  return ref();
8383
8780
  }
8384
8781
  const hyphenatedName = hyphenate(name);
8385
- const modifiers = getModelModifiers(props, camelizedName);
8782
+ const modifiers = getModelModifiers(props, camelizedName, defaultPropGetter);
8386
8783
  const res = customRef((track, trigger) => {
8387
8784
  let localValue;
8388
8785
  let prevSetValue = EMPTY_OBJ;
@@ -8404,9 +8801,25 @@ If you want to remount the same app, move your app creation logic into a factory
8404
8801
  if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
8405
8802
  return;
8406
8803
  }
8407
- const rawProps = i.vnode.props;
8408
- if (!(rawProps && // check if parent has passed v-model
8409
- (name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps))) {
8804
+ let rawPropKeys;
8805
+ let parentPassedModelValue = false;
8806
+ let parentPassedModelUpdater = false;
8807
+ if (i.rawKeys) {
8808
+ rawPropKeys = i.rawKeys();
8809
+ } else {
8810
+ const rawProps = i.vnode.props;
8811
+ rawPropKeys = rawProps && Object.keys(rawProps);
8812
+ }
8813
+ if (rawPropKeys) {
8814
+ for (const key of rawPropKeys) {
8815
+ if (key === name || key === camelizedName || key === hyphenatedName) {
8816
+ parentPassedModelValue = true;
8817
+ } else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) {
8818
+ parentPassedModelUpdater = true;
8819
+ }
8820
+ }
8821
+ }
8822
+ if (!parentPassedModelValue || !parentPassedModelUpdater) {
8410
8823
  localValue = value;
8411
8824
  trigger();
8412
8825
  }
@@ -8433,21 +8846,26 @@ If you want to remount the same app, move your app creation logic into a factory
8433
8846
  };
8434
8847
  return res;
8435
8848
  }
8436
- const getModelModifiers = (props, modelName) => {
8437
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
8849
+ const getModelModifiers = (props, modelName, getter) => {
8850
+ return modelName === "modelValue" || modelName === "model-value" ? getter(props, "modelModifiers") : getter(props, `${modelName}Modifiers`) || getter(props, `${camelize(modelName)}Modifiers`) || getter(props, `${hyphenate(modelName)}Modifiers`);
8438
8851
  };
8439
8852
 
8440
8853
  function emit(instance, event, ...rawArgs) {
8854
+ return baseEmit(
8855
+ instance,
8856
+ instance.vnode.props || EMPTY_OBJ,
8857
+ defaultPropGetter,
8858
+ event,
8859
+ ...rawArgs
8860
+ );
8861
+ }
8862
+ function baseEmit(instance, props, getter, event, ...rawArgs) {
8441
8863
  if (instance.isUnmounted) return;
8442
- const props = instance.vnode.props || EMPTY_OBJ;
8443
8864
  {
8444
- const {
8445
- emitsOptions,
8446
- propsOptions: [propsOptions]
8447
- } = instance;
8865
+ const { emitsOptions, propsOptions } = instance;
8448
8866
  if (emitsOptions) {
8449
8867
  if (!(event in emitsOptions) && true) {
8450
- if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
8868
+ if (!propsOptions || !propsOptions[0] || !(toHandlerKey(camelize(event)) in propsOptions[0])) {
8451
8869
  warn$1(
8452
8870
  `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
8453
8871
  );
@@ -8467,7 +8885,7 @@ If you want to remount the same app, move your app creation logic into a factory
8467
8885
  }
8468
8886
  let args = rawArgs;
8469
8887
  const isModelListener = event.startsWith("update:");
8470
- const modifiers = isModelListener && getModelModifiers(props, event.slice(7));
8888
+ const modifiers = isModelListener && getModelModifiers(props, event.slice(7), getter);
8471
8889
  if (modifiers) {
8472
8890
  if (modifiers.trim) {
8473
8891
  args = rawArgs.map((a) => isString(a) ? a.trim() : a);
@@ -8481,7 +8899,7 @@ If you want to remount the same app, move your app creation logic into a factory
8481
8899
  }
8482
8900
  {
8483
8901
  const lowerCaseEvent = event.toLowerCase();
8484
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
8902
+ if (lowerCaseEvent !== event && getter(props, toHandlerKey(lowerCaseEvent))) {
8485
8903
  warn$1(
8486
8904
  `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
8487
8905
  instance,
@@ -8493,10 +8911,10 @@ If you want to remount the same app, move your app creation logic into a factory
8493
8911
  }
8494
8912
  }
8495
8913
  let handlerName;
8496
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
8497
- props[handlerName = toHandlerKey(camelize(event))];
8914
+ let handler = getter(props, handlerName = toHandlerKey(event)) || // also try camelCase event handler (#2249)
8915
+ getter(props, handlerName = toHandlerKey(camelize(event)));
8498
8916
  if (!handler && isModelListener) {
8499
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
8917
+ handler = getter(props, handlerName = toHandlerKey(hyphenate(event)));
8500
8918
  }
8501
8919
  if (handler) {
8502
8920
  callWithAsyncErrorHandling(
@@ -8506,7 +8924,7 @@ If you want to remount the same app, move your app creation logic into a factory
8506
8924
  args
8507
8925
  );
8508
8926
  }
8509
- const onceHandler = props[handlerName + `Once`];
8927
+ const onceHandler = getter(props, handlerName + `Once`);
8510
8928
  if (onceHandler) {
8511
8929
  if (!instance.emitted) {
8512
8930
  instance.emitted = {};
@@ -8522,6 +8940,9 @@ If you want to remount the same app, move your app creation logic into a factory
8522
8940
  );
8523
8941
  }
8524
8942
  }
8943
+ function defaultPropGetter(props, key) {
8944
+ return props[key];
8945
+ }
8525
8946
  function normalizeEmitsOptions(comp, appContext, asMixin = false) {
8526
8947
  const cache = appContext.emitsCache;
8527
8948
  const cached = cache.get(comp);
@@ -8849,7 +9270,7 @@ If you want to remount the same app, move your app creation logic into a factory
8849
9270
  return false;
8850
9271
  }
8851
9272
  function updateHOCHostEl({ vnode, parent }, el) {
8852
- while (parent) {
9273
+ while (parent && !parent.vapor) {
8853
9274
  const root = parent.subTree;
8854
9275
  if (root.suspense && root.suspense.activeBranch === vnode) {
8855
9276
  root.el = vnode.el;
@@ -9200,7 +9621,8 @@ If you want to remount the same app, move your app creation logic into a factory
9200
9621
  pendingBranch,
9201
9622
  container2,
9202
9623
  anchor === initialAnchor ? next(activeBranch) : anchor,
9203
- 0
9624
+ 0,
9625
+ parentComponent2
9204
9626
  );
9205
9627
  queuePostFlushCb(effects);
9206
9628
  }
@@ -9213,7 +9635,13 @@ If you want to remount the same app, move your app creation logic into a factory
9213
9635
  unmount(activeBranch, parentComponent2, suspense, true);
9214
9636
  }
9215
9637
  if (!delayEnter) {
9216
- move(pendingBranch, container2, anchor, 0);
9638
+ move(
9639
+ pendingBranch,
9640
+ container2,
9641
+ anchor,
9642
+ 0,
9643
+ parentComponent2
9644
+ );
9217
9645
  }
9218
9646
  }
9219
9647
  setActiveBranch(suspense, pendingBranch);
@@ -9286,7 +9714,7 @@ If you want to remount the same app, move your app creation logic into a factory
9286
9714
  }
9287
9715
  },
9288
9716
  move(container2, anchor2, type) {
9289
- suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
9717
+ suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type, parentComponent);
9290
9718
  suspense.container = container2;
9291
9719
  },
9292
9720
  next() {
@@ -9426,7 +9854,7 @@ If you want to remount the same app, move your app creation logic into a factory
9426
9854
  }
9427
9855
  return s;
9428
9856
  }
9429
- function queueEffectWithSuspense(fn, suspense) {
9857
+ function queueEffectWithSuspense(fn, id, suspense) {
9430
9858
  if (suspense && suspense.pendingBranch) {
9431
9859
  if (isArray(fn)) {
9432
9860
  suspense.effects.push(...fn);
@@ -9434,7 +9862,7 @@ If you want to remount the same app, move your app creation logic into a factory
9434
9862
  suspense.effects.push(fn);
9435
9863
  }
9436
9864
  } else {
9437
- queuePostFlushCb(fn);
9865
+ queuePostFlushCb(fn, id);
9438
9866
  }
9439
9867
  }
9440
9868
  function setActiveBranch(suspense, branch) {
@@ -9460,6 +9888,7 @@ If you want to remount the same app, move your app creation logic into a factory
9460
9888
  const Text = Symbol.for("v-txt");
9461
9889
  const Comment = Symbol.for("v-cmt");
9462
9890
  const Static = Symbol.for("v-stc");
9891
+ const VaporSlot = Symbol.for("v-vps");
9463
9892
  const blockStack = [];
9464
9893
  let currentBlock = null;
9465
9894
  function openBlock(disableTracking = false) {
@@ -9833,6 +10262,28 @@ Component that was made reactive: `,
9833
10262
  ]);
9834
10263
  }
9835
10264
 
10265
+ let currentInstance = null;
10266
+ const getCurrentGenericInstance = () => currentInstance || currentRenderingInstance;
10267
+ const getCurrentInstance = () => currentInstance && !currentInstance.vapor ? currentInstance : currentRenderingInstance;
10268
+ let isInSSRComponentSetup = false;
10269
+ let setInSSRSetupState;
10270
+ let simpleSetCurrentInstance;
10271
+ {
10272
+ simpleSetCurrentInstance = (i) => {
10273
+ currentInstance = i;
10274
+ };
10275
+ setInSSRSetupState = (v) => {
10276
+ isInSSRComponentSetup = v;
10277
+ };
10278
+ }
10279
+ const setCurrentInstance = (instance, scope = instance !== null ? instance.scope : void 0) => {
10280
+ try {
10281
+ return [currentInstance, setCurrentScope(scope)];
10282
+ } finally {
10283
+ simpleSetCurrentInstance(instance);
10284
+ }
10285
+ };
10286
+
9836
10287
  const emptyAppContext = createAppContext();
9837
10288
  let uid = 0;
9838
10289
  function createComponentInstance(vnode, parent, suspense) {
@@ -9877,7 +10328,7 @@ Component that was made reactive: `,
9877
10328
  // to be set immediately
9878
10329
  emitted: null,
9879
10330
  // props default value
9880
- propsDefaults: EMPTY_OBJ,
10331
+ propsDefaults: null,
9881
10332
  // inheritAttrs
9882
10333
  inheritAttrs: type.inheritAttrs,
9883
10334
  // state
@@ -9924,32 +10375,6 @@ Component that was made reactive: `,
9924
10375
  }
9925
10376
  return instance;
9926
10377
  }
9927
- let currentInstance = null;
9928
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
9929
- let internalSetCurrentInstance;
9930
- let setInSSRSetupState;
9931
- {
9932
- internalSetCurrentInstance = (i) => {
9933
- currentInstance = i;
9934
- };
9935
- setInSSRSetupState = (v) => {
9936
- isInSSRComponentSetup = v;
9937
- };
9938
- }
9939
- const setCurrentInstance = (instance) => {
9940
- const prev = currentInstance;
9941
- internalSetCurrentInstance(instance);
9942
- instance.scope.on();
9943
- return () => {
9944
- instance.scope.off();
9945
- internalSetCurrentInstance(prev);
9946
- };
9947
- };
9948
- const unsetCurrentInstance = () => {
9949
- currentInstance && currentInstance.scope.off();
9950
- internalSetCurrentInstance(null);
9951
- };
9952
- const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
9953
10378
  function validateComponentName(name, { isNativeTag }) {
9954
10379
  if (isBuiltInTag(name) || isNativeTag(name)) {
9955
10380
  warn$1(
@@ -9960,13 +10385,16 @@ Component that was made reactive: `,
9960
10385
  function isStatefulComponent(instance) {
9961
10386
  return instance.vnode.shapeFlag & 4;
9962
10387
  }
9963
- let isInSSRComponentSetup = false;
9964
10388
  function setupComponent(instance, isSSR = false, optimized = false) {
9965
10389
  isSSR && setInSSRSetupState(isSSR);
9966
- const { props, children } = instance.vnode;
10390
+ const { props, children, vi } = instance.vnode;
9967
10391
  const isStateful = isStatefulComponent(instance);
9968
- initProps(instance, props, isStateful, isSSR);
9969
- initSlots(instance, children, optimized || isSSR);
10392
+ if (vi) {
10393
+ vi(instance);
10394
+ } else {
10395
+ initProps(instance, props, isStateful, isSSR);
10396
+ initSlots(instance, children, optimized || isSSR);
10397
+ }
9970
10398
  const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
9971
10399
  isSSR && setInSSRSetupState(false);
9972
10400
  return setupResult;
@@ -10003,9 +10431,9 @@ Component that was made reactive: `,
10003
10431
  }
10004
10432
  const { setup } = Component;
10005
10433
  if (setup) {
10006
- pauseTracking();
10434
+ const prevSub = setActiveSub();
10007
10435
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
10008
- const reset = setCurrentInstance(instance);
10436
+ const prev = setCurrentInstance(instance);
10009
10437
  const setupResult = callWithErrorHandling(
10010
10438
  setup,
10011
10439
  instance,
@@ -10016,12 +10444,15 @@ Component that was made reactive: `,
10016
10444
  ]
10017
10445
  );
10018
10446
  const isAsyncSetup = isPromise(setupResult);
10019
- resetTracking();
10020
- reset();
10447
+ setActiveSub(prevSub);
10448
+ setCurrentInstance(...prev);
10021
10449
  if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
10022
10450
  markAsyncBoundary(instance);
10023
10451
  }
10024
10452
  if (isAsyncSetup) {
10453
+ const unsetCurrentInstance = () => {
10454
+ setCurrentInstance(null, void 0);
10455
+ };
10025
10456
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
10026
10457
  if (isSSR) {
10027
10458
  return setupResult.then((resolvedResult) => {
@@ -10114,13 +10545,13 @@ Component that was made reactive: `,
10114
10545
  }
10115
10546
  }
10116
10547
  {
10117
- const reset = setCurrentInstance(instance);
10118
- pauseTracking();
10548
+ const prevInstance = setCurrentInstance(instance);
10549
+ const prevSub = setActiveSub();
10119
10550
  try {
10120
10551
  applyOptions(instance);
10121
10552
  } finally {
10122
- resetTracking();
10123
- reset();
10553
+ setActiveSub(prevSub);
10554
+ setCurrentInstance(...prevInstance);
10124
10555
  }
10125
10556
  }
10126
10557
  if (!Component.render && instance.render === NOOP && !isSSR) {
@@ -10157,29 +10588,6 @@ Component that was made reactive: `,
10157
10588
  });
10158
10589
  }
10159
10590
  function createSetupContext(instance) {
10160
- const expose = (exposed) => {
10161
- {
10162
- if (instance.exposed) {
10163
- warn$1(`expose() should be called only once per setup().`);
10164
- }
10165
- if (exposed != null) {
10166
- let exposedType = typeof exposed;
10167
- if (exposedType === "object") {
10168
- if (isArray(exposed)) {
10169
- exposedType = "array";
10170
- } else if (isRef(exposed)) {
10171
- exposedType = "ref";
10172
- }
10173
- }
10174
- if (exposedType !== "object") {
10175
- warn$1(
10176
- `expose() should be passed a plain object, received ${exposedType}.`
10177
- );
10178
- }
10179
- }
10180
- }
10181
- instance.exposed = exposed || {};
10182
- };
10183
10591
  {
10184
10592
  let attrsProxy;
10185
10593
  let slotsProxy;
@@ -10193,10 +10601,33 @@ Component that was made reactive: `,
10193
10601
  get emit() {
10194
10602
  return (event, ...args) => instance.emit(event, ...args);
10195
10603
  },
10196
- expose
10604
+ expose: (exposed) => expose(instance, exposed)
10197
10605
  });
10198
10606
  }
10199
10607
  }
10608
+ function expose(instance, exposed) {
10609
+ {
10610
+ if (instance.exposed) {
10611
+ warn$1(`expose() should be called only once per setup().`);
10612
+ }
10613
+ if (exposed != null) {
10614
+ let exposedType = typeof exposed;
10615
+ if (exposedType === "object") {
10616
+ if (isArray(exposed)) {
10617
+ exposedType = "array";
10618
+ } else if (isRef(exposed)) {
10619
+ exposedType = "ref";
10620
+ }
10621
+ }
10622
+ if (exposedType !== "object") {
10623
+ warn$1(
10624
+ `expose() should be passed a plain object, received ${exposedType}.`
10625
+ );
10626
+ }
10627
+ }
10628
+ }
10629
+ instance.exposed = exposed || {};
10630
+ }
10200
10631
  function getComponentPublicInstance(instance) {
10201
10632
  if (instance.exposed) {
10202
10633
  return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
@@ -10204,7 +10635,9 @@ Component that was made reactive: `,
10204
10635
  if (key in target) {
10205
10636
  return target[key];
10206
10637
  } else if (key in publicPropertiesMap) {
10207
- return publicPropertiesMap[key](instance);
10638
+ return publicPropertiesMap[key](
10639
+ instance
10640
+ );
10208
10641
  }
10209
10642
  },
10210
10643
  has(target, key) {
@@ -10247,14 +10680,7 @@ Component that was made reactive: `,
10247
10680
  }
10248
10681
 
10249
10682
  const computed = (getterOrOptions, debugOptions) => {
10250
- const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
10251
- {
10252
- const i = getCurrentInstance();
10253
- if (i && i.appContext.config.warnRecursiveComputed) {
10254
- c._warnRecursive = true;
10255
- }
10256
- }
10257
- return c;
10683
+ return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
10258
10684
  };
10259
10685
 
10260
10686
  function h(type, propsOrChildren, children) {
@@ -10295,9 +10721,9 @@ Component that was made reactive: `,
10295
10721
  if (obj.__isVue) {
10296
10722
  return ["div", vueStyle, `VueInstance`];
10297
10723
  } else if (isRef(obj)) {
10298
- pauseTracking();
10724
+ const prevSub = setActiveSub();
10299
10725
  const value = obj.value;
10300
- resetTracking();
10726
+ setActiveSub(prevSub);
10301
10727
  return [
10302
10728
  "div",
10303
10729
  {},
@@ -10484,7 +10910,7 @@ Component that was made reactive: `,
10484
10910
  return true;
10485
10911
  }
10486
10912
 
10487
- const version = "3.5.17";
10913
+ const version = "3.6.0-alpha.1";
10488
10914
  const warn = warn$1 ;
10489
10915
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10490
10916
  const devtools = devtools$1 ;
@@ -10978,8 +11404,9 @@ Component that was made reactive: `,
10978
11404
  const style = el.style;
10979
11405
  let cssText = "";
10980
11406
  for (const key in vars) {
10981
- style.setProperty(`--${key}`, vars[key]);
10982
- cssText += `--${key}: ${vars[key]};`;
11407
+ const value = normalizeCssVarValue(vars[key]);
11408
+ style.setProperty(`--${key}`, value);
11409
+ cssText += `--${key}: ${value};`;
10983
11410
  }
10984
11411
  style[CSS_VAR_TEXT] = cssText;
10985
11412
  }
@@ -11036,11 +11463,11 @@ Component that was made reactive: `,
11036
11463
  }
11037
11464
  const semicolonRE = /[^\\];\s*$/;
11038
11465
  const importantRE = /\s*!important$/;
11039
- function setStyle(style, name, val) {
11040
- if (isArray(val)) {
11041
- val.forEach((v) => setStyle(style, name, v));
11466
+ function setStyle(style, name, rawVal) {
11467
+ if (isArray(rawVal)) {
11468
+ rawVal.forEach((v) => setStyle(style, name, v));
11042
11469
  } else {
11043
- if (val == null) val = "";
11470
+ const val = rawVal == null ? "" : String(rawVal);
11044
11471
  {
11045
11472
  if (semicolonRE.test(val)) {
11046
11473
  warn(
@@ -11113,8 +11540,7 @@ Component that was made reactive: `,
11113
11540
  return;
11114
11541
  }
11115
11542
  const tag = el.tagName;
11116
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11117
- !tag.includes("-")) {
11543
+ if (key === "value" && canSetValueDirectly(tag)) {
11118
11544
  const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
11119
11545
  const newValue = value == null ? (
11120
11546
  // #11647: value should be set as empty string for null and undefined,
@@ -11242,8 +11668,6 @@ Expected function or array of functions, received type ${typeof value}.`
11242
11668
  }
11243
11669
  }
11244
11670
 
11245
- const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11246
- key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11247
11671
  const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
11248
11672
  const isSVG = namespace === "svg";
11249
11673
  if (key === "class") {
@@ -11283,24 +11707,9 @@ Expected function or array of functions, received type ${typeof value}.`
11283
11707
  }
11284
11708
  return false;
11285
11709
  }
11286
- if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
11287
- return false;
11288
- }
11289
- if (key === "form") {
11290
- return false;
11291
- }
11292
- if (key === "list" && el.tagName === "INPUT") {
11293
- return false;
11294
- }
11295
- if (key === "type" && el.tagName === "TEXTAREA") {
11710
+ if (shouldSetAsAttr(el.tagName, key)) {
11296
11711
  return false;
11297
11712
  }
11298
- if (key === "width" || key === "height") {
11299
- const tag = el.tagName;
11300
- if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
11301
- return false;
11302
- }
11303
- }
11304
11713
  if (isNativeOn(key) && isString(value)) {
11305
11714
  return false;
11306
11715
  }
@@ -11894,28 +12303,12 @@ Expected function or array of functions, received type ${typeof value}.`
11894
12303
  const vModelText = {
11895
12304
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11896
12305
  el[assignKey] = getModelAssigner(vnode);
11897
- const castToNumber = number || vnode.props && vnode.props.type === "number";
11898
- addEventListener(el, lazy ? "change" : "input", (e) => {
11899
- if (e.target.composing) return;
11900
- let domValue = el.value;
11901
- if (trim) {
11902
- domValue = domValue.trim();
11903
- }
11904
- if (castToNumber) {
11905
- domValue = looseToNumber(domValue);
11906
- }
11907
- el[assignKey](domValue);
11908
- });
11909
- if (trim) {
11910
- addEventListener(el, "change", () => {
11911
- el.value = el.value.trim();
11912
- });
11913
- }
11914
- if (!lazy) {
11915
- addEventListener(el, "compositionstart", onCompositionStart);
11916
- addEventListener(el, "compositionend", onCompositionEnd);
11917
- addEventListener(el, "change", onCompositionEnd);
11918
- }
12306
+ vModelTextInit(
12307
+ el,
12308
+ trim,
12309
+ number || !!(vnode.props && vnode.props.type === "number"),
12310
+ lazy
12311
+ );
11919
12312
  },
11920
12313
  // set value on mounted so it's after min/max for type="range"
11921
12314
  mounted(el, { value }) {
@@ -11923,70 +12316,111 @@ Expected function or array of functions, received type ${typeof value}.`
11923
12316
  },
11924
12317
  beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number } }, vnode) {
11925
12318
  el[assignKey] = getModelAssigner(vnode);
11926
- if (el.composing) return;
11927
- const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
11928
- const newValue = value == null ? "" : value;
11929
- if (elValue === newValue) {
12319
+ vModelTextUpdate(el, oldValue, value, trim, number, lazy);
12320
+ }
12321
+ };
12322
+ const vModelTextInit = (el, trim, number, lazy, set) => {
12323
+ addEventListener(el, lazy ? "change" : "input", (e) => {
12324
+ if (e.target.composing) return;
12325
+ let domValue = el.value;
12326
+ if (trim) {
12327
+ domValue = domValue.trim();
12328
+ }
12329
+ if (number || el.type === "number") {
12330
+ domValue = looseToNumber(domValue);
12331
+ }
12332
+ (0, el[assignKey])(domValue);
12333
+ });
12334
+ if (trim) {
12335
+ addEventListener(el, "change", () => {
12336
+ el.value = el.value.trim();
12337
+ });
12338
+ }
12339
+ if (!lazy) {
12340
+ addEventListener(el, "compositionstart", onCompositionStart);
12341
+ addEventListener(el, "compositionend", onCompositionEnd);
12342
+ addEventListener(el, "change", onCompositionEnd);
12343
+ }
12344
+ };
12345
+ const vModelTextUpdate = (el, oldValue, value, trim, number, lazy) => {
12346
+ if (el.composing) return;
12347
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12348
+ const newValue = value == null ? "" : value;
12349
+ if (elValue === newValue) {
12350
+ return;
12351
+ }
12352
+ if (document.activeElement === el && el.type !== "range") {
12353
+ if (lazy && value === oldValue) {
11930
12354
  return;
11931
12355
  }
11932
- if (document.activeElement === el && el.type !== "range") {
11933
- if (lazy && value === oldValue) {
11934
- return;
11935
- }
11936
- if (trim && el.value.trim() === newValue) {
11937
- return;
11938
- }
12356
+ if (trim && el.value.trim() === newValue) {
12357
+ return;
11939
12358
  }
11940
- el.value = newValue;
11941
12359
  }
12360
+ el.value = newValue;
11942
12361
  };
11943
12362
  const vModelCheckbox = {
11944
12363
  // #4096 array checkboxes need to be deep traversed
11945
12364
  deep: true,
11946
12365
  created(el, _, vnode) {
11947
12366
  el[assignKey] = getModelAssigner(vnode);
11948
- addEventListener(el, "change", () => {
11949
- const modelValue = el._modelValue;
11950
- const elementValue = getValue(el);
11951
- const checked = el.checked;
11952
- const assign = el[assignKey];
11953
- if (isArray(modelValue)) {
11954
- const index = looseIndexOf(modelValue, elementValue);
11955
- const found = index !== -1;
11956
- if (checked && !found) {
11957
- assign(modelValue.concat(elementValue));
11958
- } else if (!checked && found) {
11959
- const filtered = [...modelValue];
11960
- filtered.splice(index, 1);
11961
- assign(filtered);
11962
- }
11963
- } else if (isSet(modelValue)) {
11964
- const cloned = new Set(modelValue);
11965
- if (checked) {
11966
- cloned.add(elementValue);
11967
- } else {
11968
- cloned.delete(elementValue);
11969
- }
11970
- assign(cloned);
11971
- } else {
11972
- assign(getCheckboxValue(el, checked));
11973
- }
11974
- });
12367
+ vModelCheckboxInit(el);
11975
12368
  },
11976
12369
  // set initial checked on mount to wait for true-value/false-value
11977
- mounted: setChecked,
12370
+ mounted(el, binding, vnode) {
12371
+ vModelCheckboxUpdate(
12372
+ el,
12373
+ binding.oldValue,
12374
+ binding.value,
12375
+ vnode.props.value
12376
+ );
12377
+ },
11978
12378
  beforeUpdate(el, binding, vnode) {
11979
12379
  el[assignKey] = getModelAssigner(vnode);
11980
- setChecked(el, binding, vnode);
12380
+ vModelCheckboxUpdate(
12381
+ el,
12382
+ binding.oldValue,
12383
+ binding.value,
12384
+ vnode.props.value
12385
+ );
11981
12386
  }
11982
12387
  };
11983
- function setChecked(el, { value, oldValue }, vnode) {
12388
+ const vModelCheckboxInit = (el, set) => {
12389
+ addEventListener(el, "change", () => {
12390
+ const assign = el[assignKey];
12391
+ const modelValue = el._modelValue;
12392
+ const elementValue = getValue(el);
12393
+ const checked = el.checked;
12394
+ if (isArray(modelValue)) {
12395
+ const index = looseIndexOf(modelValue, elementValue);
12396
+ const found = index !== -1;
12397
+ if (checked && !found) {
12398
+ assign(modelValue.concat(elementValue));
12399
+ } else if (!checked && found) {
12400
+ const filtered = [...modelValue];
12401
+ filtered.splice(index, 1);
12402
+ assign(filtered);
12403
+ }
12404
+ } else if (isSet(modelValue)) {
12405
+ const cloned = new Set(modelValue);
12406
+ if (checked) {
12407
+ cloned.add(elementValue);
12408
+ } else {
12409
+ cloned.delete(elementValue);
12410
+ }
12411
+ assign(cloned);
12412
+ } else {
12413
+ assign(getCheckboxValue(el, checked));
12414
+ }
12415
+ });
12416
+ };
12417
+ const vModelCheckboxUpdate = (el, oldValue, value, rawValue = getValue(el)) => {
11984
12418
  el._modelValue = value;
11985
12419
  let checked;
11986
12420
  if (isArray(value)) {
11987
- checked = looseIndexOf(value, vnode.props.value) > -1;
12421
+ checked = looseIndexOf(value, rawValue) > -1;
11988
12422
  } else if (isSet(value)) {
11989
- checked = value.has(vnode.props.value);
12423
+ checked = value.has(rawValue);
11990
12424
  } else {
11991
12425
  if (value === oldValue) return;
11992
12426
  checked = looseEqual(value, getCheckboxValue(el, true));
@@ -11994,7 +12428,7 @@ Expected function or array of functions, received type ${typeof value}.`
11994
12428
  if (el.checked !== checked) {
11995
12429
  el.checked = checked;
11996
12430
  }
11997
- }
12431
+ };
11998
12432
  const vModelRadio = {
11999
12433
  created(el, { value }, vnode) {
12000
12434
  el.checked = looseEqual(value, vnode.props.value);
@@ -12014,36 +12448,38 @@ Expected function or array of functions, received type ${typeof value}.`
12014
12448
  // <select multiple> value need to be deep traversed
12015
12449
  deep: true,
12016
12450
  created(el, { value, modifiers: { number } }, vnode) {
12017
- const isSetModel = isSet(value);
12018
- addEventListener(el, "change", () => {
12019
- const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
12020
- (o) => number ? looseToNumber(getValue(o)) : getValue(o)
12021
- );
12022
- el[assignKey](
12023
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12024
- );
12025
- el._assigning = true;
12026
- nextTick(() => {
12027
- el._assigning = false;
12028
- });
12029
- });
12451
+ vModelSelectInit(el, value, number);
12030
12452
  el[assignKey] = getModelAssigner(vnode);
12031
12453
  },
12032
12454
  // set value in mounted & updated because <select> relies on its children
12033
12455
  // <option>s.
12034
12456
  mounted(el, { value }) {
12035
- setSelected(el, value);
12457
+ vModelSetSelected(el, value);
12036
12458
  },
12037
12459
  beforeUpdate(el, _binding, vnode) {
12038
12460
  el[assignKey] = getModelAssigner(vnode);
12039
12461
  },
12040
12462
  updated(el, { value }) {
12041
- if (!el._assigning) {
12042
- setSelected(el, value);
12043
- }
12463
+ vModelSetSelected(el, value);
12044
12464
  }
12045
12465
  };
12046
- function setSelected(el, value) {
12466
+ const vModelSelectInit = (el, value, number, set) => {
12467
+ const isSetModel = isSet(value);
12468
+ addEventListener(el, "change", () => {
12469
+ const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
12470
+ (o) => number ? looseToNumber(getValue(o)) : getValue(o)
12471
+ );
12472
+ (0, el[assignKey])(
12473
+ el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12474
+ );
12475
+ el._assigning = true;
12476
+ nextTick(() => {
12477
+ el._assigning = false;
12478
+ });
12479
+ });
12480
+ };
12481
+ const vModelSetSelected = (el, value) => {
12482
+ if (el._assigning) return;
12047
12483
  const isMultiple = el.multiple;
12048
12484
  const isArrayValue = isArray(value);
12049
12485
  if (isMultiple && !isArrayValue && !isSet(value)) {
@@ -12074,13 +12510,20 @@ Expected function or array of functions, received type ${typeof value}.`
12074
12510
  if (!isMultiple && el.selectedIndex !== -1) {
12075
12511
  el.selectedIndex = -1;
12076
12512
  }
12077
- }
12513
+ };
12078
12514
  function getValue(el) {
12079
12515
  return "_value" in el ? el._value : el.value;
12080
12516
  }
12081
12517
  function getCheckboxValue(el, checked) {
12082
12518
  const key = checked ? "_trueValue" : "_falseValue";
12083
- return key in el ? el[key] : checked;
12519
+ if (key in el) {
12520
+ return el[key];
12521
+ }
12522
+ const attr = checked ? "true-value" : "false-value";
12523
+ if (el.hasAttribute(attr)) {
12524
+ return el.getAttribute(attr);
12525
+ }
12526
+ return checked;
12084
12527
  }
12085
12528
  const vModelDynamic = {
12086
12529
  created(el, binding, vnode) {