@vue/reactivity 3.5.0-alpha.1 → 3.5.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/reactivity.cjs.js +1 -1
- package/dist/reactivity.cjs.prod.js +1 -1
- package/dist/reactivity.esm-browser.js +3 -2
- package/dist/reactivity.esm-browser.prod.js +2 -2
- package/dist/reactivity.esm-bundler.js +1 -1
- package/dist/reactivity.global.js +3 -2
- package/dist/reactivity.global.prod.js +2 -2
- package/package.json +2 -2
package/dist/reactivity.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.5.0-alpha.
|
|
2
|
+
* @vue/reactivity v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -36,10 +36,11 @@ const capitalize = cacheStringFunction((str) => {
|
|
|
36
36
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
37
37
|
});
|
|
38
38
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
39
|
-
const def = (obj, key, value) => {
|
|
39
|
+
const def = (obj, key, value, writable = false) => {
|
|
40
40
|
Object.defineProperty(obj, key, {
|
|
41
41
|
configurable: true,
|
|
42
42
|
enumerable: false,
|
|
43
|
+
writable,
|
|
43
44
|
value
|
|
44
45
|
});
|
|
45
46
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.5.0-alpha.
|
|
2
|
+
* @vue/reactivity v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
7
|
-
function t(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const e=Object.assign,s=Object.prototype.hasOwnProperty,n=(t,e)=>s.call(t,e),i=Array.isArray,r=t=>"[object Map]"===l(t),o=t=>"function"==typeof t,c=t=>"symbol"==typeof t,u=t=>null!==t&&"object"==typeof t,a=Object.prototype.toString,l=t=>a.call(t),h=t=>l(t).slice(8,-1),f=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,p=(t,e)=>!Object.is(t,e);let d,v;class _{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=d,!t&&d&&(this.index=(d.scopes||(d.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=d;try{return d=this,t()}finally{d=e}}}on(){d=this}off(){d=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function g(t){return new _(t)}function y(){return d}function b(t,e=!1){d&&d.cleanups.push(t)}const w={ACTIVE:1,1:"ACTIVE",RUNNING:2,2:"RUNNING",TRACKING:4,4:"TRACKING",NOTIFIED:8,8:"NOTIFIED",DIRTY:16,16:"DIRTY",ALLOW_RECURSE:32,32:"ALLOW_RECURSE",NO_BATCH:64,64:"NO_BATCH"};class S{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.nextEffect=void 0,this.cleanup=void 0,this.scheduler=void 0,d&&d.active&&d.effects.push(this)}notify(){if(!(2&this.flags)||32&this.flags)return 64&this.flags?this.trigger():void(8&this.flags||(this.flags|=8,this.nextEffect=R,R=this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,z(this),k(this);const t=v,e=N;v=this,N=!0;try{return this.fn()}finally{m(this),v=t,N=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)I(t);this.deps=this.depsTail=void 0,z(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){O(this)&&this.run()}get dirty(){return O(this)}}let R,x=0;function D(){x++}function E(){if(x>1)return void x--;let t;for(;R;){let s=R;for(R=void 0;s;){const n=s.nextEffect;if(s.nextEffect=void 0,s.flags&=-9,1&s.flags)try{s.trigger()}catch(e){t||(t=e)}s=n}}if(x--,t)throw t}function k(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function m(t){let e,s=t.depsTail;for(let n=s;n;n=n.prevDep)-1===n.version?(n===s&&(s=n.prevDep),I(n),A(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0;t.deps=e,t.depsTail=s}function O(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&!1===T(e.dep.computed)||e.dep.version!==e.version)return!0;return!!t._dirty}function T(t){if(2&t.flags)return!1;if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===G)return;t.globalVersion=G;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&!O(t))return void(t.flags&=-3);const s=v,n=N;v=t,N=!0;try{k(t);const s=t.fn();(0===e.version||p(s,t._value))&&(t._value=s,e.version++)}catch(i){throw e.version++,i}finally{v=s,N=n,m(t),t.flags&=-3}}function I(t){const{dep:e,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),e.subs===t&&(e.subs=s),!e.subs&&e.computed){e.computed.flags&=-5;for(let t=e.computed.deps;t;t=t.nextDep)I(t)}}function A(t){const{prevDep:e,nextDep:s}=t;e&&(e.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=e,t.nextDep=void 0)}function L(t,s){t.effect instanceof S&&(t=t.effect.fn);const n=new S(t);s&&e(n,s);try{n.run()}catch(r){throw n.stop(),r}const i=n.run.bind(n);return i.effect=n,i}function j(t){t.effect.stop()}let N=!0;const P=[];function V(){P.push(N),N=!1}function W(){P.push(N),N=!0}function C(){const t=P.pop();N=void 0===t||t}function M(t,e=!1){v instanceof S&&(v.cleanup=t)}function z(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=v;v=void 0;try{e()}finally{v=t}}}let G=0;class K{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0}track(t){if(!v||!N)return;let e=this.activeLink;if(void 0===e||e.sub!==v)e=this.activeLink={dep:this,sub:v,version:this.version,nextDep:void 0,prevDep:void 0,nextSub:void 0,prevSub:void 0,prevActiveLink:void 0},v.deps?(e.prevDep=v.depsTail,v.depsTail.nextDep=e,v.depsTail=e):v.deps=v.depsTail=e,4&v.flags&&H(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=v.depsTail,e.nextDep=void 0,v.depsTail.nextDep=e,v.depsTail=e,v.deps===e&&(v.deps=t)}return e}trigger(t){this.version++,G++,this.notify(t)}notify(t){D();try{0;for(let t=this.subs;t;t=t.prevSub)t.sub.notify()}finally{E()}}}function H(t){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)H(t)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}const U=new WeakMap,Y=Symbol(""),B=Symbol(""),F=Symbol("");function q(t,e,s){if(N&&v){let e=U.get(t);e||U.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=new K),n.track()}}function J(t,e,s,n,o,u){const a=U.get(t);if(!a)return void G++;let l=[];if("clear"===e)l=[...a.values()];else{const o=i(t),u=o&&f(s);if(o&&"length"===s){const t=Number(n);a.forEach(((e,s)=>{("length"===s||s===F||!c(s)&&s>=t)&&l.push(e)}))}else{const n=t=>t&&l.push(t);switch(void 0!==s&&n(a.get(s)),u&&n(a.get(F)),e){case"add":o?u&&n(a.get("length")):(n(a.get(Y)),r(t)&&n(a.get(B)));break;case"delete":o||(n(a.get(Y)),r(t)&&n(a.get(B)));break;case"set":r(t)&&n(a.get(Y))}}}D();for(const i of l)i.trigger();E()}function Q(t){const e=Jt(t);return e===t?e:(q(e,0,F),Ft(t)?e:e.map(Xt))}function X(t){return q(t=Jt(t),0,F),t}const Z={__proto__:null,[Symbol.iterator](){return $(this,Symbol.iterator,Xt)},concat(...t){return Q(this).concat(...t.map((t=>Q(t))))},entries(){return $(this,"entries",(t=>(t[1]=Xt(t[1]),t)))},every(t,e){return tt(this,"every",t,e)},filter(t,e){const s=tt(this,"filter",t,e);return qt(this)&&!Ft(this)?s.map(Xt):s},find(t,e){const s=tt(this,"find",t,e);return qt(this)&&!Ft(this)?Xt(s):s},findIndex(t,e){return tt(this,"findIndex",t,e)},findLast(t,e){const s=tt(this,"findLast",t,e);return qt(this)&&!Ft(this)?Xt(s):s},findLastIndex(t,e){return tt(this,"findLastIndex",t,e)},forEach(t,e){return tt(this,"forEach",t,e)},includes(...t){return st(this,"includes",t)},indexOf(...t){return st(this,"indexOf",t)},join(t){return Q(this).join(t)},lastIndexOf(...t){return st(this,"lastIndexOf",t)},map(t,e){return tt(this,"map",t,e)},pop(){return nt(this,"pop")},push(...t){return nt(this,"push",t)},reduce(t,...e){return et(this,"reduce",t,e)},reduceRight(t,...e){return et(this,"reduceRight",t,e)},shift(){return nt(this,"shift")},some(t,e){return tt(this,"some",t,e)},splice(...t){return nt(this,"splice",t)},toReversed(){return Q(this).toReversed()},toSorted(t){return Q(this).toSorted(t)},toSpliced(...t){return Q(this).toSpliced(...t)},unshift(...t){return nt(this,"unshift",t)},values(){return $(this,"values",Xt)}};function $(t,e,s){const n=X(t),i=n[e]();return n===t||Ft(t)||(i._next=i.next,i.next=()=>{const t=i._next();return t.value&&(t.value=s(t.value)),t}),i}function tt(t,e,s,n){const i=X(t);let r=s;return i!==t&&(Ft(t)?s.length>2&&(r=function(e,n){return s.call(this,e,n,t)}):r=function(e,n){return s.call(this,Xt(e),n,t)}),i[e](r,n)}function et(t,e,s,n){const i=X(t);let r=s;return i!==t&&(Ft(t)?s.length>3&&(r=function(e,n,i){return s.call(this,e,n,i,t)}):r=function(e,n,i){return s.call(this,e,Xt(n),i,t)}),i[e](r,...n)}function st(t,e,s){const n=Jt(t);q(n,0,F);const i=n[e](...s);return-1!==i&&!1!==i||!qt(s[0])?i:(s[0]=Jt(s[0]),n[e](...s))}function nt(t,e,s=[]){V(),D();const n=Jt(t)[e].apply(t,s);return E(),C(),n}const it=t("__proto__,__v_isRef,__isVue"),rt=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(c));function ot(t){c(t)||(t=String(t));const e=Jt(this);return q(e,0,t),e.hasOwnProperty(t)}class ct{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,r=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return r;if("__v_raw"===e)return s===(n?r?Mt:Ct:r?Wt:Vt).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=i(t);if(!n){let t;if(o&&(t=Z[e]))return t;if("hasOwnProperty"===e)return ot}const a=Reflect.get(t,e,$t(t)?t:s);return(c(e)?rt.has(e):it(e))?a:(n||q(t,0,e),r?a:$t(a)?o&&f(e)?a:a.value:u(a)?n?Kt(a):zt(a):a)}}class ut extends ct{constructor(t=!1){super(!1,t)}set(t,e,s,r){let o=t[e];if(!this._isShallow){const e=Bt(o);if(Ft(s)||Bt(s)||(o=Jt(o),s=Jt(s)),!i(t)&&$t(o)&&!$t(s))return!e&&(o.value=s,!0)}const c=i(t)&&f(e)?Number(e)<t.length:n(t,e),u=Reflect.set(t,e,s,r);return t===Jt(r)&&(c?p(s,o)&&J(t,"set",e,s):J(t,"add",e,s)),u}deleteProperty(t,e){const s=n(t,e),i=Reflect.deleteProperty(t,e);return i&&s&&J(t,"delete",e,void 0),i}has(t,e){const s=Reflect.has(t,e);return c(e)&&rt.has(e)||q(t,0,e),s}ownKeys(t){return q(t,0,i(t)?"length":Y),Reflect.ownKeys(t)}}class at extends ct{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const lt=new ut,ht=new at,ft=new ut(!0),pt=new at(!0),dt=t=>t,vt=t=>Reflect.getPrototypeOf(t);function _t(t,e,s=!1,n=!1){const i=Jt(t=t.__v_raw),r=Jt(e);s||(p(e,r)&&q(i,0,e),q(i,0,r));const{has:o}=vt(i),c=n?dt:s?Zt:Xt;return o.call(i,e)?c(t.get(e)):o.call(i,r)?c(t.get(r)):void(t!==i&&t.get(e))}function gt(t,e=!1){const s=this.__v_raw,n=Jt(s),i=Jt(t);return e||(p(t,i)&&q(n,0,t),q(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function yt(t,e=!1){return t=t.__v_raw,!e&&q(Jt(t),0,Y),Reflect.get(t,"size",t)}function bt(t){t=Jt(t);const e=Jt(this);return vt(e).has.call(e,t)||(e.add(t),J(e,"add",t,t)),this}function wt(t,e){e=Jt(e);const s=Jt(this),{has:n,get:i}=vt(s);let r=n.call(s,t);r||(t=Jt(t),r=n.call(s,t));const o=i.call(s,t);return s.set(t,e),r?p(e,o)&&J(s,"set",t,e):J(s,"add",t,e),this}function St(t){const e=Jt(this),{has:s,get:n}=vt(e);let i=s.call(e,t);i||(t=Jt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&J(e,"delete",t,void 0),r}function Rt(){const t=Jt(this),e=0!==t.size,s=t.clear();return e&&J(t,"clear",void 0,void 0),s}function xt(t,e){return function(s,n){const i=this,r=i.__v_raw,o=Jt(r),c=e?dt:t?Zt:Xt;return!t&&q(o,0,Y),r.forEach(((t,e)=>s.call(n,c(t),c(e),i)))}}function Dt(t,e,s){return function(...n){const i=this.__v_raw,o=Jt(i),c=r(o),u="entries"===t||t===Symbol.iterator&&c,a="keys"===t&&c,l=i[t](...n),h=s?dt:e?Zt:Xt;return!e&&q(o,0,a?B:Y),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[h(t[0]),h(t[1])]:h(t),done:e}},[Symbol.iterator](){return this}}}}function Et(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function kt(){const t={get(t){return _t(this,t)},get size(){return yt(this)},has:gt,add:bt,set:wt,delete:St,clear:Rt,forEach:xt(!1,!1)},e={get(t){return _t(this,t,!1,!0)},get size(){return yt(this)},has:gt,add:bt,set:wt,delete:St,clear:Rt,forEach:xt(!1,!0)},s={get(t){return _t(this,t,!0)},get size(){return yt(this,!0)},has(t){return gt.call(this,t,!0)},add:Et("add"),set:Et("set"),delete:Et("delete"),clear:Et("clear"),forEach:xt(!0,!1)},n={get(t){return _t(this,t,!0,!0)},get size(){return yt(this,!0)},has(t){return gt.call(this,t,!0)},add:Et("add"),set:Et("set"),delete:Et("delete"),clear:Et("clear"),forEach:xt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=Dt(i,!1,!1),s[i]=Dt(i,!0,!1),e[i]=Dt(i,!1,!0),n[i]=Dt(i,!0,!0)})),[t,s,e,n]}const[mt,Ot,Tt,It]=kt();function At(t,e){const s=e?t?It:Tt:t?Ot:mt;return(e,i,r)=>"__v_isReactive"===i?!t:"__v_isReadonly"===i?t:"__v_raw"===i?e:Reflect.get(n(s,i)&&i in e?s:e,i,r)}const Lt={get:At(!1,!1)},jt={get:At(!1,!0)},Nt={get:At(!0,!1)},Pt={get:At(!0,!0)},Vt=new WeakMap,Wt=new WeakMap,Ct=new WeakMap,Mt=new WeakMap;function zt(t){return Bt(t)?t:Ut(t,!1,lt,Lt,Vt)}function Gt(t){return Ut(t,!1,ft,jt,Wt)}function Kt(t){return Ut(t,!0,ht,Nt,Ct)}function Ht(t){return Ut(t,!0,pt,Pt,Mt)}function Ut(t,e,s,n,i){if(!u(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const o=(c=t).__v_skip||!Object.isExtensible(c)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(h(c));var c;if(0===o)return t;const a=new Proxy(t,2===o?n:s);return i.set(t,a),a}function Yt(t){return Bt(t)?Yt(t.__v_raw):!(!t||!t.__v_isReactive)}function Bt(t){return!(!t||!t.__v_isReadonly)}function Ft(t){return!(!t||!t.__v_isShallow)}function qt(t){return!!t&&!!t.__v_raw}function Jt(t){const e=t&&t.__v_raw;return e?Jt(e):t}function Qt(t){return Object.isExtensible(t)&&((t,e,s)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:s})})(t,"__v_skip",!0),t}const Xt=t=>u(t)?zt(t):t,Zt=t=>u(t)?Kt(t):t;function $t(t){return!!t&&!0===t.__v_isRef}function te(t){return se(t,!1)}function ee(t){return se(t,!0)}function se(t,e){return $t(t)?t:new ne(t,e)}class ne{constructor(t,e){this.__v_isShallow=e,this.dep=new K,this.__v_isRef=!0,this._rawValue=e?t:Jt(t),this._value=e?t:Xt(t)}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||Ft(t)||Bt(t);t=s?t:Jt(t),p(t,e)&&(this._rawValue=t,this._value=s?t:Xt(t),this.dep.trigger())}}function ie(t){t.dep.trigger()}function re(t){return $t(t)?t.value:t}function oe(t){return o(t)?t():re(t)}const ce={get:(t,e,s)=>re(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return $t(i)&&!$t(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};function ue(t){return Yt(t)?t:new Proxy(t,ce)}class ae{constructor(t){this.__v_isRef=!0;const e=this.dep=new K,{get:s,set:n}=t(e.track.bind(e),e.trigger.bind(e));this._get=s,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}function le(t){return new ae(t)}function he(t){const e=i(t)?new Array(t.length):{};for(const s in t)e[s]=ve(t,s);return e}class fe{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return t=Jt(this._object),e=this._key,null==(s=U.get(t))?void 0:s.get(e);var t,e,s}}class pe{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function de(t,e,s){return $t(t)?t:o(t)?new pe(t):u(t)&&arguments.length>1?ve(t,e,s):te(t)}function ve(t,e,s){const n=t[e];return $t(n)?n:new fe(t,e,s)}class _e{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new K(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=G-1,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){v!==this&&(this.flags|=16,this.dep.notify())}get value(){const t=this.dep.track();return T(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ge(t,e,s=!1){let n,i;o(t)?n=t:(n=t.get,i=t.set);return new _e(n,i,s)}const ye={GET:"get",HAS:"has",ITERATE:"iterate"},be={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},we={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"};export{F as ARRAY_ITERATE_KEY,w as EffectFlags,_ as EffectScope,Y as ITERATE_KEY,B as MAP_KEY_ITERATE_KEY,S as ReactiveEffect,we as ReactiveFlags,ye as TrackOpTypes,be as TriggerOpTypes,ge as computed,le as customRef,L as effect,g as effectScope,W as enableTracking,y as getCurrentScope,qt as isProxy,Yt as isReactive,Bt as isReadonly,$t as isRef,Ft as isShallow,Qt as markRaw,M as onEffectCleanup,b as onScopeDispose,V as pauseTracking,ue as proxyRefs,zt as reactive,Q as reactiveReadArray,Kt as readonly,te as ref,C as resetTracking,Gt as shallowReactive,X as shallowReadArray,Ht as shallowReadonly,ee as shallowRef,j as stop,Jt as toRaw,Xt as toReactive,Zt as toReadonly,de as toRef,he as toRefs,oe as toValue,q as track,J as trigger,ie as triggerRef,re as unref};
|
|
7
|
+
function t(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const e=Object.assign,s=Object.prototype.hasOwnProperty,n=(t,e)=>s.call(t,e),i=Array.isArray,r=t=>"[object Map]"===l(t),o=t=>"function"==typeof t,c=t=>"symbol"==typeof t,u=t=>null!==t&&"object"==typeof t,a=Object.prototype.toString,l=t=>a.call(t),h=t=>l(t).slice(8,-1),f=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,p=(t,e)=>!Object.is(t,e);let d,v;class _{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=d,!t&&d&&(this.index=(d.scopes||(d.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=d;try{return d=this,t()}finally{d=e}}}on(){d=this}off(){d=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}function g(t){return new _(t)}function y(){return d}function b(t,e=!1){d&&d.cleanups.push(t)}const w={ACTIVE:1,1:"ACTIVE",RUNNING:2,2:"RUNNING",TRACKING:4,4:"TRACKING",NOTIFIED:8,8:"NOTIFIED",DIRTY:16,16:"DIRTY",ALLOW_RECURSE:32,32:"ALLOW_RECURSE",NO_BATCH:64,64:"NO_BATCH"};class S{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.nextEffect=void 0,this.cleanup=void 0,this.scheduler=void 0,d&&d.active&&d.effects.push(this)}notify(){if(!(2&this.flags)||32&this.flags)return 64&this.flags?this.trigger():void(8&this.flags||(this.flags|=8,this.nextEffect=R,R=this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,z(this),k(this);const t=v,e=N;v=this,N=!0;try{return this.fn()}finally{m(this),v=t,N=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)I(t);this.deps=this.depsTail=void 0,z(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){O(this)&&this.run()}get dirty(){return O(this)}}let R,x=0;function D(){x++}function E(){if(x>1)return void x--;let t;for(;R;){let s=R;for(R=void 0;s;){const n=s.nextEffect;if(s.nextEffect=void 0,s.flags&=-9,1&s.flags)try{s.trigger()}catch(e){t||(t=e)}s=n}}if(x--,t)throw t}function k(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function m(t){let e,s=t.depsTail;for(let n=s;n;n=n.prevDep)-1===n.version?(n===s&&(s=n.prevDep),I(n),A(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0;t.deps=e,t.depsTail=s}function O(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&!1===T(e.dep.computed)||e.dep.version!==e.version)return!0;return!!t._dirty}function T(t){if(2&t.flags)return!1;if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===G)return;t.globalVersion=G;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&!O(t))return void(t.flags&=-3);const s=v,n=N;v=t,N=!0;try{k(t);const s=t.fn();(0===e.version||p(s,t._value))&&(t._value=s,e.version++)}catch(i){throw e.version++,i}finally{v=s,N=n,m(t),t.flags&=-3}}function I(t){const{dep:e,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),e.subs===t&&(e.subs=s),!e.subs&&e.computed){e.computed.flags&=-5;for(let t=e.computed.deps;t;t=t.nextDep)I(t)}}function A(t){const{prevDep:e,nextDep:s}=t;e&&(e.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=e,t.nextDep=void 0)}function L(t,s){t.effect instanceof S&&(t=t.effect.fn);const n=new S(t);s&&e(n,s);try{n.run()}catch(r){throw n.stop(),r}const i=n.run.bind(n);return i.effect=n,i}function j(t){t.effect.stop()}let N=!0;const P=[];function V(){P.push(N),N=!1}function W(){P.push(N),N=!0}function C(){const t=P.pop();N=void 0===t||t}function M(t,e=!1){v instanceof S&&(v.cleanup=t)}function z(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=v;v=void 0;try{e()}finally{v=t}}}let G=0;class K{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0}track(t){if(!v||!N)return;let e=this.activeLink;if(void 0===e||e.sub!==v)e=this.activeLink={dep:this,sub:v,version:this.version,nextDep:void 0,prevDep:void 0,nextSub:void 0,prevSub:void 0,prevActiveLink:void 0},v.deps?(e.prevDep=v.depsTail,v.depsTail.nextDep=e,v.depsTail=e):v.deps=v.depsTail=e,4&v.flags&&H(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=v.depsTail,e.nextDep=void 0,v.depsTail.nextDep=e,v.depsTail=e,v.deps===e&&(v.deps=t)}return e}trigger(t){this.version++,G++,this.notify(t)}notify(t){D();try{0;for(let t=this.subs;t;t=t.prevSub)t.sub.notify()}finally{E()}}}function H(t){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)H(t)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}const U=new WeakMap,Y=Symbol(""),B=Symbol(""),F=Symbol("");function q(t,e,s){if(N&&v){let e=U.get(t);e||U.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=new K),n.track()}}function J(t,e,s,n,o,u){const a=U.get(t);if(!a)return void G++;let l=[];if("clear"===e)l=[...a.values()];else{const o=i(t),u=o&&f(s);if(o&&"length"===s){const t=Number(n);a.forEach(((e,s)=>{("length"===s||s===F||!c(s)&&s>=t)&&l.push(e)}))}else{const n=t=>t&&l.push(t);switch(void 0!==s&&n(a.get(s)),u&&n(a.get(F)),e){case"add":o?u&&n(a.get("length")):(n(a.get(Y)),r(t)&&n(a.get(B)));break;case"delete":o||(n(a.get(Y)),r(t)&&n(a.get(B)));break;case"set":r(t)&&n(a.get(Y))}}}D();for(const i of l)i.trigger();E()}function Q(t){const e=Jt(t);return e===t?e:(q(e,0,F),Ft(t)?e:e.map(Xt))}function X(t){return q(t=Jt(t),0,F),t}const Z={__proto__:null,[Symbol.iterator](){return $(this,Symbol.iterator,Xt)},concat(...t){return Q(this).concat(...t.map((t=>Q(t))))},entries(){return $(this,"entries",(t=>(t[1]=Xt(t[1]),t)))},every(t,e){return tt(this,"every",t,e)},filter(t,e){const s=tt(this,"filter",t,e);return qt(this)&&!Ft(this)?s.map(Xt):s},find(t,e){const s=tt(this,"find",t,e);return qt(this)&&!Ft(this)?Xt(s):s},findIndex(t,e){return tt(this,"findIndex",t,e)},findLast(t,e){const s=tt(this,"findLast",t,e);return qt(this)&&!Ft(this)?Xt(s):s},findLastIndex(t,e){return tt(this,"findLastIndex",t,e)},forEach(t,e){return tt(this,"forEach",t,e)},includes(...t){return st(this,"includes",t)},indexOf(...t){return st(this,"indexOf",t)},join(t){return Q(this).join(t)},lastIndexOf(...t){return st(this,"lastIndexOf",t)},map(t,e){return tt(this,"map",t,e)},pop(){return nt(this,"pop")},push(...t){return nt(this,"push",t)},reduce(t,...e){return et(this,"reduce",t,e)},reduceRight(t,...e){return et(this,"reduceRight",t,e)},shift(){return nt(this,"shift")},some(t,e){return tt(this,"some",t,e)},splice(...t){return nt(this,"splice",t)},toReversed(){return Q(this).toReversed()},toSorted(t){return Q(this).toSorted(t)},toSpliced(...t){return Q(this).toSpliced(...t)},unshift(...t){return nt(this,"unshift",t)},values(){return $(this,"values",Xt)}};function $(t,e,s){const n=X(t),i=n[e]();return n===t||Ft(t)||(i._next=i.next,i.next=()=>{const t=i._next();return t.value&&(t.value=s(t.value)),t}),i}function tt(t,e,s,n){const i=X(t);let r=s;return i!==t&&(Ft(t)?s.length>2&&(r=function(e,n){return s.call(this,e,n,t)}):r=function(e,n){return s.call(this,Xt(e),n,t)}),i[e](r,n)}function et(t,e,s,n){const i=X(t);let r=s;return i!==t&&(Ft(t)?s.length>3&&(r=function(e,n,i){return s.call(this,e,n,i,t)}):r=function(e,n,i){return s.call(this,e,Xt(n),i,t)}),i[e](r,...n)}function st(t,e,s){const n=Jt(t);q(n,0,F);const i=n[e](...s);return-1!==i&&!1!==i||!qt(s[0])?i:(s[0]=Jt(s[0]),n[e](...s))}function nt(t,e,s=[]){V(),D();const n=Jt(t)[e].apply(t,s);return E(),C(),n}const it=t("__proto__,__v_isRef,__isVue"),rt=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(c));function ot(t){c(t)||(t=String(t));const e=Jt(this);return q(e,0,t),e.hasOwnProperty(t)}class ct{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,r=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return r;if("__v_raw"===e)return s===(n?r?Mt:Ct:r?Wt:Vt).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=i(t);if(!n){let t;if(o&&(t=Z[e]))return t;if("hasOwnProperty"===e)return ot}const a=Reflect.get(t,e,$t(t)?t:s);return(c(e)?rt.has(e):it(e))?a:(n||q(t,0,e),r?a:$t(a)?o&&f(e)?a:a.value:u(a)?n?Kt(a):zt(a):a)}}class ut extends ct{constructor(t=!1){super(!1,t)}set(t,e,s,r){let o=t[e];if(!this._isShallow){const e=Bt(o);if(Ft(s)||Bt(s)||(o=Jt(o),s=Jt(s)),!i(t)&&$t(o)&&!$t(s))return!e&&(o.value=s,!0)}const c=i(t)&&f(e)?Number(e)<t.length:n(t,e),u=Reflect.set(t,e,s,r);return t===Jt(r)&&(c?p(s,o)&&J(t,"set",e,s):J(t,"add",e,s)),u}deleteProperty(t,e){const s=n(t,e),i=Reflect.deleteProperty(t,e);return i&&s&&J(t,"delete",e,void 0),i}has(t,e){const s=Reflect.has(t,e);return c(e)&&rt.has(e)||q(t,0,e),s}ownKeys(t){return q(t,0,i(t)?"length":Y),Reflect.ownKeys(t)}}class at extends ct{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const lt=new ut,ht=new at,ft=new ut(!0),pt=new at(!0),dt=t=>t,vt=t=>Reflect.getPrototypeOf(t);function _t(t,e,s=!1,n=!1){const i=Jt(t=t.__v_raw),r=Jt(e);s||(p(e,r)&&q(i,0,e),q(i,0,r));const{has:o}=vt(i),c=n?dt:s?Zt:Xt;return o.call(i,e)?c(t.get(e)):o.call(i,r)?c(t.get(r)):void(t!==i&&t.get(e))}function gt(t,e=!1){const s=this.__v_raw,n=Jt(s),i=Jt(t);return e||(p(t,i)&&q(n,0,t),q(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function yt(t,e=!1){return t=t.__v_raw,!e&&q(Jt(t),0,Y),Reflect.get(t,"size",t)}function bt(t){t=Jt(t);const e=Jt(this);return vt(e).has.call(e,t)||(e.add(t),J(e,"add",t,t)),this}function wt(t,e){e=Jt(e);const s=Jt(this),{has:n,get:i}=vt(s);let r=n.call(s,t);r||(t=Jt(t),r=n.call(s,t));const o=i.call(s,t);return s.set(t,e),r?p(e,o)&&J(s,"set",t,e):J(s,"add",t,e),this}function St(t){const e=Jt(this),{has:s,get:n}=vt(e);let i=s.call(e,t);i||(t=Jt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&J(e,"delete",t,void 0),r}function Rt(){const t=Jt(this),e=0!==t.size,s=t.clear();return e&&J(t,"clear",void 0,void 0),s}function xt(t,e){return function(s,n){const i=this,r=i.__v_raw,o=Jt(r),c=e?dt:t?Zt:Xt;return!t&&q(o,0,Y),r.forEach(((t,e)=>s.call(n,c(t),c(e),i)))}}function Dt(t,e,s){return function(...n){const i=this.__v_raw,o=Jt(i),c=r(o),u="entries"===t||t===Symbol.iterator&&c,a="keys"===t&&c,l=i[t](...n),h=s?dt:e?Zt:Xt;return!e&&q(o,0,a?B:Y),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[h(t[0]),h(t[1])]:h(t),done:e}},[Symbol.iterator](){return this}}}}function Et(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function kt(){const t={get(t){return _t(this,t)},get size(){return yt(this)},has:gt,add:bt,set:wt,delete:St,clear:Rt,forEach:xt(!1,!1)},e={get(t){return _t(this,t,!1,!0)},get size(){return yt(this)},has:gt,add:bt,set:wt,delete:St,clear:Rt,forEach:xt(!1,!0)},s={get(t){return _t(this,t,!0)},get size(){return yt(this,!0)},has(t){return gt.call(this,t,!0)},add:Et("add"),set:Et("set"),delete:Et("delete"),clear:Et("clear"),forEach:xt(!0,!1)},n={get(t){return _t(this,t,!0,!0)},get size(){return yt(this,!0)},has(t){return gt.call(this,t,!0)},add:Et("add"),set:Et("set"),delete:Et("delete"),clear:Et("clear"),forEach:xt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=Dt(i,!1,!1),s[i]=Dt(i,!0,!1),e[i]=Dt(i,!1,!0),n[i]=Dt(i,!0,!0)})),[t,s,e,n]}const[mt,Ot,Tt,It]=kt();function At(t,e){const s=e?t?It:Tt:t?Ot:mt;return(e,i,r)=>"__v_isReactive"===i?!t:"__v_isReadonly"===i?t:"__v_raw"===i?e:Reflect.get(n(s,i)&&i in e?s:e,i,r)}const Lt={get:At(!1,!1)},jt={get:At(!1,!0)},Nt={get:At(!0,!1)},Pt={get:At(!0,!0)},Vt=new WeakMap,Wt=new WeakMap,Ct=new WeakMap,Mt=new WeakMap;function zt(t){return Bt(t)?t:Ut(t,!1,lt,Lt,Vt)}function Gt(t){return Ut(t,!1,ft,jt,Wt)}function Kt(t){return Ut(t,!0,ht,Nt,Ct)}function Ht(t){return Ut(t,!0,pt,Pt,Mt)}function Ut(t,e,s,n,i){if(!u(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const o=(c=t).__v_skip||!Object.isExtensible(c)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(h(c));var c;if(0===o)return t;const a=new Proxy(t,2===o?n:s);return i.set(t,a),a}function Yt(t){return Bt(t)?Yt(t.__v_raw):!(!t||!t.__v_isReactive)}function Bt(t){return!(!t||!t.__v_isReadonly)}function Ft(t){return!(!t||!t.__v_isShallow)}function qt(t){return!!t&&!!t.__v_raw}function Jt(t){const e=t&&t.__v_raw;return e?Jt(e):t}function Qt(t){return Object.isExtensible(t)&&((t,e,s,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:s})})(t,"__v_skip",!0),t}const Xt=t=>u(t)?zt(t):t,Zt=t=>u(t)?Kt(t):t;function $t(t){return!!t&&!0===t.__v_isRef}function te(t){return se(t,!1)}function ee(t){return se(t,!0)}function se(t,e){return $t(t)?t:new ne(t,e)}class ne{constructor(t,e){this.__v_isShallow=e,this.dep=new K,this.__v_isRef=!0,this._rawValue=e?t:Jt(t),this._value=e?t:Xt(t)}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||Ft(t)||Bt(t);t=s?t:Jt(t),p(t,e)&&(this._rawValue=t,this._value=s?t:Xt(t),this.dep.trigger())}}function ie(t){t.dep.trigger()}function re(t){return $t(t)?t.value:t}function oe(t){return o(t)?t():re(t)}const ce={get:(t,e,s)=>re(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return $t(i)&&!$t(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};function ue(t){return Yt(t)?t:new Proxy(t,ce)}class ae{constructor(t){this.__v_isRef=!0;const e=this.dep=new K,{get:s,set:n}=t(e.track.bind(e),e.trigger.bind(e));this._get=s,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}function le(t){return new ae(t)}function he(t){const e=i(t)?new Array(t.length):{};for(const s in t)e[s]=ve(t,s);return e}class fe{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return t=Jt(this._object),e=this._key,null==(s=U.get(t))?void 0:s.get(e);var t,e,s}}class pe{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function de(t,e,s){return $t(t)?t:o(t)?new pe(t):u(t)&&arguments.length>1?ve(t,e,s):te(t)}function ve(t,e,s){const n=t[e];return $t(n)?n:new fe(t,e,s)}class _e{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new K(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=G-1,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){v!==this&&(this.flags|=16,this.dep.notify())}get value(){const t=this.dep.track();return T(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ge(t,e,s=!1){let n,i;o(t)?n=t:(n=t.get,i=t.set);return new _e(n,i,s)}const ye={GET:"get",HAS:"has",ITERATE:"iterate"},be={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},we={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"};export{F as ARRAY_ITERATE_KEY,w as EffectFlags,_ as EffectScope,Y as ITERATE_KEY,B as MAP_KEY_ITERATE_KEY,S as ReactiveEffect,we as ReactiveFlags,ye as TrackOpTypes,be as TriggerOpTypes,ge as computed,le as customRef,L as effect,g as effectScope,W as enableTracking,y as getCurrentScope,qt as isProxy,Yt as isReactive,Bt as isReadonly,$t as isRef,Ft as isShallow,Qt as markRaw,M as onEffectCleanup,b as onScopeDispose,V as pauseTracking,ue as proxyRefs,zt as reactive,Q as reactiveReadArray,Kt as readonly,te as ref,C as resetTracking,Gt as shallowReactive,X as shallowReadArray,Ht as shallowReadonly,ee as shallowRef,j as stop,Jt as toRaw,Xt as toReactive,Zt as toReadonly,de as toRef,he as toRefs,oe as toValue,q as track,J as trigger,ie as triggerRef,re as unref};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.5.0-alpha.
|
|
2
|
+
* @vue/reactivity v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -39,10 +39,11 @@ var VueReactivity = (function (exports) {
|
|
|
39
39
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
40
40
|
});
|
|
41
41
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
42
|
-
const def = (obj, key, value) => {
|
|
42
|
+
const def = (obj, key, value, writable = false) => {
|
|
43
43
|
Object.defineProperty(obj, key, {
|
|
44
44
|
configurable: true,
|
|
45
45
|
enumerable: false,
|
|
46
|
+
writable,
|
|
46
47
|
value
|
|
47
48
|
});
|
|
48
49
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/reactivity v3.5.0-alpha.
|
|
2
|
+
* @vue/reactivity v3.5.0-alpha.2
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
var VueReactivity=function(t){"use strict";
|
|
7
|
-
/*! #__NO_SIDE_EFFECTS__ */function e(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const s=Object.assign,n=Object.prototype.hasOwnProperty,i=(t,e)=>n.call(t,e),r=Array.isArray,o=t=>"[object Map]"===f(t),c=t=>"function"==typeof t,u=t=>"symbol"==typeof t,a=t=>null!==t&&"object"==typeof t,l=Object.prototype.toString,f=t=>l.call(t),h=t=>f(t).slice(8,-1),p=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,d=(t,e)=>!Object.is(t,e);let v,_;class g{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=v,!t&&v&&(this.index=(v.scopes||(v.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=v;try{return v=this,t()}finally{v=e}}}on(){v=this}off(){v=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}class y{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.nextEffect=void 0,this.cleanup=void 0,this.scheduler=void 0,v&&v.active&&v.effects.push(this)}notify(){if(!(2&this.flags)||32&this.flags)return 64&this.flags?this.trigger():void(8&this.flags||(this.flags|=8,this.nextEffect=R,R=this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,j(this),x(this);const t=_,e=A;_=this,A=!0;try{return this.fn()}finally{E(this),_=t,A=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)D(t);this.deps=this.depsTail=void 0,j(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){T(this)&&this.run()}get dirty(){return T(this)}}let R,w=0;function b(){w++}function S(){if(w>1)return void w--;let t;for(;R;){let s=R;for(R=void 0;s;){const n=s.nextEffect;if(s.nextEffect=void 0,s.flags&=-9,1&s.flags)try{s.trigger()}catch(e){t||(t=e)}s=n}}if(w--,t)throw t}function x(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function E(t){let e,s=t.depsTail;for(let n=s;n;n=n.prevDep)-1===n.version?(n===s&&(s=n.prevDep),D(n),m(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0;t.deps=e,t.depsTail=s}function T(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&!1===k(e.dep.computed)||e.dep.version!==e.version)return!0;return!!t._dirty}function k(t){if(2&t.flags)return!1;if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===N)return;t.globalVersion=N;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&!T(t))return void(t.flags&=-3);const s=_,n=A;_=t,A=!0;try{x(t);const s=t.fn();(0===e.version||d(s,t._value))&&(t._value=s,e.version++)}catch(i){throw e.version++,i}finally{_=s,A=n,E(t),t.flags&=-3}}function D(t){const{dep:e,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),e.subs===t&&(e.subs=s),!e.subs&&e.computed){e.computed.flags&=-5;for(let t=e.computed.deps;t;t=t.nextDep)D(t)}}function m(t){const{prevDep:e,nextDep:s}=t;e&&(e.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=e,t.nextDep=void 0)}let A=!0;const O=[];function I(){O.push(A),A=!1}function L(){const t=O.pop();A=void 0===t||t}function j(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=_;_=void 0;try{e()}finally{_=t}}}let N=0;class P{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0}track(t){if(!_||!A)return;let e=this.activeLink;if(void 0===e||e.sub!==_)e=this.activeLink={dep:this,sub:_,version:this.version,nextDep:void 0,prevDep:void 0,nextSub:void 0,prevSub:void 0,prevActiveLink:void 0},_.deps?(e.prevDep=_.depsTail,_.depsTail.nextDep=e,_.depsTail=e):_.deps=_.depsTail=e,4&_.flags&&V(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=_.depsTail,e.nextDep=void 0,_.depsTail.nextDep=e,_.depsTail=e,_.deps===e&&(_.deps=t)}return e}trigger(t){this.version++,N++,this.notify(t)}notify(t){b();try{0;for(let t=this.subs;t;t=t.prevSub)t.sub.notify()}finally{S()}}}function V(t){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)V(t)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}const C=new WeakMap,W=Symbol(""),M=Symbol(""),K=Symbol("");function Y(t,e,s){if(A&&_){let e=C.get(t);e||C.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=new P),n.track()}}function z(t,e,s,n,i,c){const a=C.get(t);if(!a)return void N++;let l=[];if("clear"===e)l=[...a.values()];else{const i=r(t),c=i&&p(s);if(i&&"length"===s){const t=Number(n);a.forEach(((e,s)=>{("length"===s||s===K||!u(s)&&s>=t)&&l.push(e)}))}else{const n=t=>t&&l.push(t);switch(void 0!==s&&n(a.get(s)),c&&n(a.get(K)),e){case"add":i?c&&n(a.get("length")):(n(a.get(W)),o(t)&&n(a.get(M)));break;case"delete":i||(n(a.get(W)),o(t)&&n(a.get(M)));break;case"set":o(t)&&n(a.get(W))}}}b();for(const r of l)r.trigger();S()}function G(t){const e=Kt(t);return e===t?e:(Y(e,0,K),Wt(t)?e:e.map(Yt))}function F(t){return Y(t=Kt(t),0,K),t}const H={__proto__:null,[Symbol.iterator](){return U(this,Symbol.iterator,Yt)},concat(...t){return G(this).concat(...t.map((t=>G(t))))},entries(){return U(this,"entries",(t=>(t[1]=Yt(t[1]),t)))},every(t,e){return B(this,"every",t,e)},filter(t,e){const s=B(this,"filter",t,e);return Mt(this)&&!Wt(this)?s.map(Yt):s},find(t,e){const s=B(this,"find",t,e);return Mt(this)&&!Wt(this)?Yt(s):s},findIndex(t,e){return B(this,"findIndex",t,e)},findLast(t,e){const s=B(this,"findLast",t,e);return Mt(this)&&!Wt(this)?Yt(s):s},findLastIndex(t,e){return B(this,"findLastIndex",t,e)},forEach(t,e){return B(this,"forEach",t,e)},includes(...t){return J(this,"includes",t)},indexOf(...t){return J(this,"indexOf",t)},join(t){return G(this).join(t)},lastIndexOf(...t){return J(this,"lastIndexOf",t)},map(t,e){return B(this,"map",t,e)},pop(){return Q(this,"pop")},push(...t){return Q(this,"push",t)},reduce(t,...e){return q(this,"reduce",t,e)},reduceRight(t,...e){return q(this,"reduceRight",t,e)},shift(){return Q(this,"shift")},some(t,e){return B(this,"some",t,e)},splice(...t){return Q(this,"splice",t)},toReversed(){return G(this).toReversed()},toSorted(t){return G(this).toSorted(t)},toSpliced(...t){return G(this).toSpliced(...t)},unshift(...t){return Q(this,"unshift",t)},values(){return U(this,"values",Yt)}};function U(t,e,s){const n=F(t),i=n[e]();return n===t||Wt(t)||(i._next=i.next,i.next=()=>{const t=i._next();return t.value&&(t.value=s(t.value)),t}),i}function B(t,e,s,n){const i=F(t);let r=s;return i!==t&&(Wt(t)?s.length>2&&(r=function(e,n){return s.call(this,e,n,t)}):r=function(e,n){return s.call(this,Yt(e),n,t)}),i[e](r,n)}function q(t,e,s,n){const i=F(t);let r=s;return i!==t&&(Wt(t)?s.length>3&&(r=function(e,n,i){return s.call(this,e,n,i,t)}):r=function(e,n,i){return s.call(this,e,Yt(n),i,t)}),i[e](r,...n)}function J(t,e,s){const n=Kt(t);Y(n,0,K);const i=n[e](...s);return-1!==i&&!1!==i||!Mt(s[0])?i:(s[0]=Kt(s[0]),n[e](...s))}function Q(t,e,s=[]){I(),b();const n=Kt(t)[e].apply(t,s);return S(),L(),n}const X=e("__proto__,__v_isRef,__isVue"),Z=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(u));function $(t){u(t)||(t=String(t));const e=Kt(this);return Y(e,0,t),e.hasOwnProperty(t)}class tt{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,i=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return i;if("__v_raw"===e)return s===(n?i?Lt:It:i?Ot:At).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=r(t);if(!n){let t;if(o&&(t=H[e]))return t;if("hasOwnProperty"===e)return $}const c=Reflect.get(t,e,Gt(t)?t:s);return(u(e)?Z.has(e):X(e))?c:(n||Y(t,0,e),i?c:Gt(c)?o&&p(e)?c:c.value:a(c)?n?Nt(c):jt(c):c)}}class et extends tt{constructor(t=!1){super(!1,t)}set(t,e,s,n){let o=t[e];if(!this._isShallow){const e=Ct(o);if(Wt(s)||Ct(s)||(o=Kt(o),s=Kt(s)),!r(t)&&Gt(o)&&!Gt(s))return!e&&(o.value=s,!0)}const c=r(t)&&p(e)?Number(e)<t.length:i(t,e),u=Reflect.set(t,e,s,n);return t===Kt(n)&&(c?d(s,o)&&z(t,"set",e,s):z(t,"add",e,s)),u}deleteProperty(t,e){const s=i(t,e),n=Reflect.deleteProperty(t,e);return n&&s&&z(t,"delete",e,void 0),n}has(t,e){const s=Reflect.has(t,e);return u(e)&&Z.has(e)||Y(t,0,e),s}ownKeys(t){return Y(t,0,r(t)?"length":W),Reflect.ownKeys(t)}}class st extends tt{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const nt=new et,it=new st,rt=new et(!0),ot=new st(!0),ct=t=>t,ut=t=>Reflect.getPrototypeOf(t);function at(t,e,s=!1,n=!1){const i=Kt(t=t.__v_raw),r=Kt(e);s||(d(e,r)&&Y(i,0,e),Y(i,0,r));const{has:o}=ut(i),c=n?ct:s?zt:Yt;return o.call(i,e)?c(t.get(e)):o.call(i,r)?c(t.get(r)):void(t!==i&&t.get(e))}function lt(t,e=!1){const s=this.__v_raw,n=Kt(s),i=Kt(t);return e||(d(t,i)&&Y(n,0,t),Y(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function ft(t,e=!1){return t=t.__v_raw,!e&&Y(Kt(t),0,W),Reflect.get(t,"size",t)}function ht(t){t=Kt(t);const e=Kt(this);return ut(e).has.call(e,t)||(e.add(t),z(e,"add",t,t)),this}function pt(t,e){e=Kt(e);const s=Kt(this),{has:n,get:i}=ut(s);let r=n.call(s,t);r||(t=Kt(t),r=n.call(s,t));const o=i.call(s,t);return s.set(t,e),r?d(e,o)&&z(s,"set",t,e):z(s,"add",t,e),this}function dt(t){const e=Kt(this),{has:s,get:n}=ut(e);let i=s.call(e,t);i||(t=Kt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&z(e,"delete",t,void 0),r}function vt(){const t=Kt(this),e=0!==t.size,s=t.clear();return e&&z(t,"clear",void 0,void 0),s}function _t(t,e){return function(s,n){const i=this,r=i.__v_raw,o=Kt(r),c=e?ct:t?zt:Yt;return!t&&Y(o,0,W),r.forEach(((t,e)=>s.call(n,c(t),c(e),i)))}}function gt(t,e,s){return function(...n){const i=this.__v_raw,r=Kt(i),c=o(r),u="entries"===t||t===Symbol.iterator&&c,a="keys"===t&&c,l=i[t](...n),f=s?ct:e?zt:Yt;return!e&&Y(r,0,a?M:W),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[f(t[0]),f(t[1])]:f(t),done:e}},[Symbol.iterator](){return this}}}}function yt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Rt(){const t={get(t){return at(this,t)},get size(){return ft(this)},has:lt,add:ht,set:pt,delete:dt,clear:vt,forEach:_t(!1,!1)},e={get(t){return at(this,t,!1,!0)},get size(){return ft(this)},has:lt,add:ht,set:pt,delete:dt,clear:vt,forEach:_t(!1,!0)},s={get(t){return at(this,t,!0)},get size(){return ft(this,!0)},has(t){return lt.call(this,t,!0)},add:yt("add"),set:yt("set"),delete:yt("delete"),clear:yt("clear"),forEach:_t(!0,!1)},n={get(t){return at(this,t,!0,!0)},get size(){return ft(this,!0)},has(t){return lt.call(this,t,!0)},add:yt("add"),set:yt("set"),delete:yt("delete"),clear:yt("clear"),forEach:_t(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=gt(i,!1,!1),s[i]=gt(i,!0,!1),e[i]=gt(i,!1,!0),n[i]=gt(i,!0,!0)})),[t,s,e,n]}const[wt,bt,St,xt]=Rt();function Et(t,e){const s=e?t?xt:St:t?bt:wt;return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(i(s,n)&&n in e?s:e,n,r)}const Tt={get:Et(!1,!1)},kt={get:Et(!1,!0)},Dt={get:Et(!0,!1)},mt={get:Et(!0,!0)},At=new WeakMap,Ot=new WeakMap,It=new WeakMap,Lt=new WeakMap;function jt(t){return Ct(t)?t:Pt(t,!1,nt,Tt,At)}function Nt(t){return Pt(t,!0,it,Dt,It)}function Pt(t,e,s,n,i){if(!a(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const o=(c=t).__v_skip||!Object.isExtensible(c)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(h(c));var c;if(0===o)return t;const u=new Proxy(t,2===o?n:s);return i.set(t,u),u}function Vt(t){return Ct(t)?Vt(t.__v_raw):!(!t||!t.__v_isReactive)}function Ct(t){return!(!t||!t.__v_isReadonly)}function Wt(t){return!(!t||!t.__v_isShallow)}function Mt(t){return!!t&&!!t.__v_raw}function Kt(t){const e=t&&t.__v_raw;return e?Kt(e):t}const Yt=t=>a(t)?jt(t):t,zt=t=>a(t)?Nt(t):t;function Gt(t){return!!t&&!0===t.__v_isRef}function Ft(t){return Ht(t,!1)}function Ht(t,e){return Gt(t)?t:new Ut(t,e)}class Ut{constructor(t,e){this.__v_isShallow=e,this.dep=new P,this.__v_isRef=!0,this._rawValue=e?t:Kt(t),this._value=e?t:Yt(t)}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||Wt(t)||Ct(t);t=s?t:Kt(t),d(t,e)&&(this._rawValue=t,this._value=s?t:Yt(t),this.dep.trigger())}}function Bt(t){return Gt(t)?t.value:t}const qt={get:(t,e,s)=>Bt(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return Gt(i)&&!Gt(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};class Jt{constructor(t){this.__v_isRef=!0;const e=this.dep=new P,{get:s,set:n}=t(e.track.bind(e),e.trigger.bind(e));this._get=s,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}class Qt{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return t=Kt(this._object),e=this._key,null==(s=C.get(t))?void 0:s.get(e);var t,e,s}}class Xt{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Zt(t,e,s){const n=t[e];return Gt(n)?n:new Qt(t,e,s)}class $t{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new P(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=N-1,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){_!==this&&(this.flags|=16,this.dep.notify())}get value(){const t=this.dep.track();return k(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}return t.ARRAY_ITERATE_KEY=K,t.EffectFlags={ACTIVE:1,1:"ACTIVE",RUNNING:2,2:"RUNNING",TRACKING:4,4:"TRACKING",NOTIFIED:8,8:"NOTIFIED",DIRTY:16,16:"DIRTY",ALLOW_RECURSE:32,32:"ALLOW_RECURSE",NO_BATCH:64,64:"NO_BATCH"},t.EffectScope=g,t.ITERATE_KEY=W,t.MAP_KEY_ITERATE_KEY=M,t.ReactiveEffect=y,t.ReactiveFlags={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"},t.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},t.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},t.computed=function(t,e,s=!1){let n,i;return c(t)?n=t:(n=t.get,i=t.set),new $t(n,i,s)},t.customRef=function(t){return new Jt(t)},t.effect=function(t,e){t.effect instanceof y&&(t=t.effect.fn);const n=new y(t);e&&s(n,e);try{n.run()}catch(r){throw n.stop(),r}const i=n.run.bind(n);return i.effect=n,i},t.effectScope=function(t){return new g(t)},t.enableTracking=function(){O.push(A),A=!0},t.getCurrentScope=function(){return v},t.isProxy=Mt,t.isReactive=Vt,t.isReadonly=Ct,t.isRef=Gt,t.isShallow=Wt,t.markRaw=function(t){return Object.isExtensible(t)&&((t,e,s)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:s})})(t,"__v_skip",!0),t},t.onEffectCleanup=function(t,e=!1){_ instanceof y&&(_.cleanup=t)},t.onScopeDispose=function(t,e=!1){v&&v.cleanups.push(t)},t.pauseTracking=I,t.proxyRefs=function(t){return Vt(t)?t:new Proxy(t,qt)},t.reactive=jt,t.reactiveReadArray=G,t.readonly=Nt,t.ref=Ft,t.resetTracking=L,t.shallowReactive=function(t){return Pt(t,!1,rt,kt,Ot)},t.shallowReadArray=F,t.shallowReadonly=function(t){return Pt(t,!0,ot,mt,Lt)},t.shallowRef=function(t){return Ht(t,!0)},t.stop=function(t){t.effect.stop()},t.toRaw=Kt,t.toReactive=Yt,t.toReadonly=zt,t.toRef=function(t,e,s){return Gt(t)?t:c(t)?new Xt(t):a(t)&&arguments.length>1?Zt(t,e,s):Ft(t)},t.toRefs=function(t){const e=r(t)?new Array(t.length):{};for(const s in t)e[s]=Zt(t,s);return e},t.toValue=function(t){return c(t)?t():Bt(t)},t.track=Y,t.trigger=z,t.triggerRef=function(t){t.dep.trigger()},t.unref=Bt,t}({});
|
|
7
|
+
/*! #__NO_SIDE_EFFECTS__ */function e(t,e){const s=new Set(t.split(","));return t=>s.has(t)}const s=Object.assign,n=Object.prototype.hasOwnProperty,i=(t,e)=>n.call(t,e),r=Array.isArray,o=t=>"[object Map]"===f(t),c=t=>"function"==typeof t,u=t=>"symbol"==typeof t,a=t=>null!==t&&"object"==typeof t,l=Object.prototype.toString,f=t=>l.call(t),h=t=>f(t).slice(8,-1),p=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,d=(t,e)=>!Object.is(t,e);let v,_;class g{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=v,!t&&v&&(this.index=(v.scopes||(v.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const e=v;try{return v=this,t()}finally{v=e}}}on(){v=this}off(){v=this.parent}stop(t){if(this._active){let e,s;for(e=0,s=this.effects.length;e<s;e++)this.effects[e].stop();for(e=0,s=this.cleanups.length;e<s;e++)this.cleanups[e]();if(this.scopes)for(e=0,s=this.scopes.length;e<s;e++)this.scopes[e].stop(!0);if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0,this._active=!1}}}class y{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.nextEffect=void 0,this.cleanup=void 0,this.scheduler=void 0,v&&v.active&&v.effects.push(this)}notify(){if(!(2&this.flags)||32&this.flags)return 64&this.flags?this.trigger():void(8&this.flags||(this.flags|=8,this.nextEffect=R,R=this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,j(this),x(this);const t=_,e=A;_=this,A=!0;try{return this.fn()}finally{E(this),_=t,A=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)D(t);this.deps=this.depsTail=void 0,j(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){T(this)&&this.run()}get dirty(){return T(this)}}let R,w=0;function b(){w++}function S(){if(w>1)return void w--;let t;for(;R;){let s=R;for(R=void 0;s;){const n=s.nextEffect;if(s.nextEffect=void 0,s.flags&=-9,1&s.flags)try{s.trigger()}catch(e){t||(t=e)}s=n}}if(w--,t)throw t}function x(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function E(t){let e,s=t.depsTail;for(let n=s;n;n=n.prevDep)-1===n.version?(n===s&&(s=n.prevDep),D(n),m(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0;t.deps=e,t.depsTail=s}function T(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&!1===k(e.dep.computed)||e.dep.version!==e.version)return!0;return!!t._dirty}function k(t){if(2&t.flags)return!1;if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===N)return;t.globalVersion=N;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&!T(t))return void(t.flags&=-3);const s=_,n=A;_=t,A=!0;try{x(t);const s=t.fn();(0===e.version||d(s,t._value))&&(t._value=s,e.version++)}catch(i){throw e.version++,i}finally{_=s,A=n,E(t),t.flags&=-3}}function D(t){const{dep:e,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),e.subs===t&&(e.subs=s),!e.subs&&e.computed){e.computed.flags&=-5;for(let t=e.computed.deps;t;t=t.nextDep)D(t)}}function m(t){const{prevDep:e,nextDep:s}=t;e&&(e.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=e,t.nextDep=void 0)}let A=!0;const O=[];function I(){O.push(A),A=!1}function L(){const t=O.pop();A=void 0===t||t}function j(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=_;_=void 0;try{e()}finally{_=t}}}let N=0;class P{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0}track(t){if(!_||!A)return;let e=this.activeLink;if(void 0===e||e.sub!==_)e=this.activeLink={dep:this,sub:_,version:this.version,nextDep:void 0,prevDep:void 0,nextSub:void 0,prevSub:void 0,prevActiveLink:void 0},_.deps?(e.prevDep=_.depsTail,_.depsTail.nextDep=e,_.depsTail=e):_.deps=_.depsTail=e,4&_.flags&&V(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=_.depsTail,e.nextDep=void 0,_.depsTail.nextDep=e,_.depsTail=e,_.deps===e&&(_.deps=t)}return e}trigger(t){this.version++,N++,this.notify(t)}notify(t){b();try{0;for(let t=this.subs;t;t=t.prevSub)t.sub.notify()}finally{S()}}}function V(t){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)V(t)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}const C=new WeakMap,W=Symbol(""),M=Symbol(""),K=Symbol("");function Y(t,e,s){if(A&&_){let e=C.get(t);e||C.set(t,e=new Map);let n=e.get(s);n||e.set(s,n=new P),n.track()}}function z(t,e,s,n,i,c){const a=C.get(t);if(!a)return void N++;let l=[];if("clear"===e)l=[...a.values()];else{const i=r(t),c=i&&p(s);if(i&&"length"===s){const t=Number(n);a.forEach(((e,s)=>{("length"===s||s===K||!u(s)&&s>=t)&&l.push(e)}))}else{const n=t=>t&&l.push(t);switch(void 0!==s&&n(a.get(s)),c&&n(a.get(K)),e){case"add":i?c&&n(a.get("length")):(n(a.get(W)),o(t)&&n(a.get(M)));break;case"delete":i||(n(a.get(W)),o(t)&&n(a.get(M)));break;case"set":o(t)&&n(a.get(W))}}}b();for(const r of l)r.trigger();S()}function G(t){const e=Kt(t);return e===t?e:(Y(e,0,K),Wt(t)?e:e.map(Yt))}function F(t){return Y(t=Kt(t),0,K),t}const H={__proto__:null,[Symbol.iterator](){return U(this,Symbol.iterator,Yt)},concat(...t){return G(this).concat(...t.map((t=>G(t))))},entries(){return U(this,"entries",(t=>(t[1]=Yt(t[1]),t)))},every(t,e){return B(this,"every",t,e)},filter(t,e){const s=B(this,"filter",t,e);return Mt(this)&&!Wt(this)?s.map(Yt):s},find(t,e){const s=B(this,"find",t,e);return Mt(this)&&!Wt(this)?Yt(s):s},findIndex(t,e){return B(this,"findIndex",t,e)},findLast(t,e){const s=B(this,"findLast",t,e);return Mt(this)&&!Wt(this)?Yt(s):s},findLastIndex(t,e){return B(this,"findLastIndex",t,e)},forEach(t,e){return B(this,"forEach",t,e)},includes(...t){return J(this,"includes",t)},indexOf(...t){return J(this,"indexOf",t)},join(t){return G(this).join(t)},lastIndexOf(...t){return J(this,"lastIndexOf",t)},map(t,e){return B(this,"map",t,e)},pop(){return Q(this,"pop")},push(...t){return Q(this,"push",t)},reduce(t,...e){return q(this,"reduce",t,e)},reduceRight(t,...e){return q(this,"reduceRight",t,e)},shift(){return Q(this,"shift")},some(t,e){return B(this,"some",t,e)},splice(...t){return Q(this,"splice",t)},toReversed(){return G(this).toReversed()},toSorted(t){return G(this).toSorted(t)},toSpliced(...t){return G(this).toSpliced(...t)},unshift(...t){return Q(this,"unshift",t)},values(){return U(this,"values",Yt)}};function U(t,e,s){const n=F(t),i=n[e]();return n===t||Wt(t)||(i._next=i.next,i.next=()=>{const t=i._next();return t.value&&(t.value=s(t.value)),t}),i}function B(t,e,s,n){const i=F(t);let r=s;return i!==t&&(Wt(t)?s.length>2&&(r=function(e,n){return s.call(this,e,n,t)}):r=function(e,n){return s.call(this,Yt(e),n,t)}),i[e](r,n)}function q(t,e,s,n){const i=F(t);let r=s;return i!==t&&(Wt(t)?s.length>3&&(r=function(e,n,i){return s.call(this,e,n,i,t)}):r=function(e,n,i){return s.call(this,e,Yt(n),i,t)}),i[e](r,...n)}function J(t,e,s){const n=Kt(t);Y(n,0,K);const i=n[e](...s);return-1!==i&&!1!==i||!Mt(s[0])?i:(s[0]=Kt(s[0]),n[e](...s))}function Q(t,e,s=[]){I(),b();const n=Kt(t)[e].apply(t,s);return S(),L(),n}const X=e("__proto__,__v_isRef,__isVue"),Z=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(u));function $(t){u(t)||(t=String(t));const e=Kt(this);return Y(e,0,t),e.hasOwnProperty(t)}class tt{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){const n=this._isReadonly,i=this._isShallow;if("__v_isReactive"===e)return!n;if("__v_isReadonly"===e)return n;if("__v_isShallow"===e)return i;if("__v_raw"===e)return s===(n?i?Lt:It:i?Ot:At).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=r(t);if(!n){let t;if(o&&(t=H[e]))return t;if("hasOwnProperty"===e)return $}const c=Reflect.get(t,e,Gt(t)?t:s);return(u(e)?Z.has(e):X(e))?c:(n||Y(t,0,e),i?c:Gt(c)?o&&p(e)?c:c.value:a(c)?n?Nt(c):jt(c):c)}}class et extends tt{constructor(t=!1){super(!1,t)}set(t,e,s,n){let o=t[e];if(!this._isShallow){const e=Ct(o);if(Wt(s)||Ct(s)||(o=Kt(o),s=Kt(s)),!r(t)&&Gt(o)&&!Gt(s))return!e&&(o.value=s,!0)}const c=r(t)&&p(e)?Number(e)<t.length:i(t,e),u=Reflect.set(t,e,s,n);return t===Kt(n)&&(c?d(s,o)&&z(t,"set",e,s):z(t,"add",e,s)),u}deleteProperty(t,e){const s=i(t,e),n=Reflect.deleteProperty(t,e);return n&&s&&z(t,"delete",e,void 0),n}has(t,e){const s=Reflect.has(t,e);return u(e)&&Z.has(e)||Y(t,0,e),s}ownKeys(t){return Y(t,0,r(t)?"length":W),Reflect.ownKeys(t)}}class st extends tt{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const nt=new et,it=new st,rt=new et(!0),ot=new st(!0),ct=t=>t,ut=t=>Reflect.getPrototypeOf(t);function at(t,e,s=!1,n=!1){const i=Kt(t=t.__v_raw),r=Kt(e);s||(d(e,r)&&Y(i,0,e),Y(i,0,r));const{has:o}=ut(i),c=n?ct:s?zt:Yt;return o.call(i,e)?c(t.get(e)):o.call(i,r)?c(t.get(r)):void(t!==i&&t.get(e))}function lt(t,e=!1){const s=this.__v_raw,n=Kt(s),i=Kt(t);return e||(d(t,i)&&Y(n,0,t),Y(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function ft(t,e=!1){return t=t.__v_raw,!e&&Y(Kt(t),0,W),Reflect.get(t,"size",t)}function ht(t){t=Kt(t);const e=Kt(this);return ut(e).has.call(e,t)||(e.add(t),z(e,"add",t,t)),this}function pt(t,e){e=Kt(e);const s=Kt(this),{has:n,get:i}=ut(s);let r=n.call(s,t);r||(t=Kt(t),r=n.call(s,t));const o=i.call(s,t);return s.set(t,e),r?d(e,o)&&z(s,"set",t,e):z(s,"add",t,e),this}function dt(t){const e=Kt(this),{has:s,get:n}=ut(e);let i=s.call(e,t);i||(t=Kt(t),i=s.call(e,t)),n&&n.call(e,t);const r=e.delete(t);return i&&z(e,"delete",t,void 0),r}function vt(){const t=Kt(this),e=0!==t.size,s=t.clear();return e&&z(t,"clear",void 0,void 0),s}function _t(t,e){return function(s,n){const i=this,r=i.__v_raw,o=Kt(r),c=e?ct:t?zt:Yt;return!t&&Y(o,0,W),r.forEach(((t,e)=>s.call(n,c(t),c(e),i)))}}function gt(t,e,s){return function(...n){const i=this.__v_raw,r=Kt(i),c=o(r),u="entries"===t||t===Symbol.iterator&&c,a="keys"===t&&c,l=i[t](...n),f=s?ct:e?zt:Yt;return!e&&Y(r,0,a?M:W),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[f(t[0]),f(t[1])]:f(t),done:e}},[Symbol.iterator](){return this}}}}function yt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Rt(){const t={get(t){return at(this,t)},get size(){return ft(this)},has:lt,add:ht,set:pt,delete:dt,clear:vt,forEach:_t(!1,!1)},e={get(t){return at(this,t,!1,!0)},get size(){return ft(this)},has:lt,add:ht,set:pt,delete:dt,clear:vt,forEach:_t(!1,!0)},s={get(t){return at(this,t,!0)},get size(){return ft(this,!0)},has(t){return lt.call(this,t,!0)},add:yt("add"),set:yt("set"),delete:yt("delete"),clear:yt("clear"),forEach:_t(!0,!1)},n={get(t){return at(this,t,!0,!0)},get size(){return ft(this,!0)},has(t){return lt.call(this,t,!0)},add:yt("add"),set:yt("set"),delete:yt("delete"),clear:yt("clear"),forEach:_t(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=gt(i,!1,!1),s[i]=gt(i,!0,!1),e[i]=gt(i,!1,!0),n[i]=gt(i,!0,!0)})),[t,s,e,n]}const[wt,bt,St,xt]=Rt();function Et(t,e){const s=e?t?xt:St:t?bt:wt;return(e,n,r)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(i(s,n)&&n in e?s:e,n,r)}const Tt={get:Et(!1,!1)},kt={get:Et(!1,!0)},Dt={get:Et(!0,!1)},mt={get:Et(!0,!0)},At=new WeakMap,Ot=new WeakMap,It=new WeakMap,Lt=new WeakMap;function jt(t){return Ct(t)?t:Pt(t,!1,nt,Tt,At)}function Nt(t){return Pt(t,!0,it,Dt,It)}function Pt(t,e,s,n,i){if(!a(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=i.get(t);if(r)return r;const o=(c=t).__v_skip||!Object.isExtensible(c)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(h(c));var c;if(0===o)return t;const u=new Proxy(t,2===o?n:s);return i.set(t,u),u}function Vt(t){return Ct(t)?Vt(t.__v_raw):!(!t||!t.__v_isReactive)}function Ct(t){return!(!t||!t.__v_isReadonly)}function Wt(t){return!(!t||!t.__v_isShallow)}function Mt(t){return!!t&&!!t.__v_raw}function Kt(t){const e=t&&t.__v_raw;return e?Kt(e):t}const Yt=t=>a(t)?jt(t):t,zt=t=>a(t)?Nt(t):t;function Gt(t){return!!t&&!0===t.__v_isRef}function Ft(t){return Ht(t,!1)}function Ht(t,e){return Gt(t)?t:new Ut(t,e)}class Ut{constructor(t,e){this.__v_isShallow=e,this.dep=new P,this.__v_isRef=!0,this._rawValue=e?t:Kt(t),this._value=e?t:Yt(t)}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||Wt(t)||Ct(t);t=s?t:Kt(t),d(t,e)&&(this._rawValue=t,this._value=s?t:Yt(t),this.dep.trigger())}}function Bt(t){return Gt(t)?t.value:t}const qt={get:(t,e,s)=>Bt(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return Gt(i)&&!Gt(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};class Jt{constructor(t){this.__v_isRef=!0;const e=this.dep=new P,{get:s,set:n}=t(e.track.bind(e),e.trigger.bind(e));this._get=s,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}class Qt{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0}get value(){const t=this._object[this._key];return void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return t=Kt(this._object),e=this._key,null==(s=C.get(t))?void 0:s.get(e);var t,e,s}}class Xt{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Zt(t,e,s){const n=t[e];return Gt(n)?n:new Qt(t,e,s)}class $t{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new P(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=N-1,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){_!==this&&(this.flags|=16,this.dep.notify())}get value(){const t=this.dep.track();return k(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}return t.ARRAY_ITERATE_KEY=K,t.EffectFlags={ACTIVE:1,1:"ACTIVE",RUNNING:2,2:"RUNNING",TRACKING:4,4:"TRACKING",NOTIFIED:8,8:"NOTIFIED",DIRTY:16,16:"DIRTY",ALLOW_RECURSE:32,32:"ALLOW_RECURSE",NO_BATCH:64,64:"NO_BATCH"},t.EffectScope=g,t.ITERATE_KEY=W,t.MAP_KEY_ITERATE_KEY=M,t.ReactiveEffect=y,t.ReactiveFlags={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"},t.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},t.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},t.computed=function(t,e,s=!1){let n,i;return c(t)?n=t:(n=t.get,i=t.set),new $t(n,i,s)},t.customRef=function(t){return new Jt(t)},t.effect=function(t,e){t.effect instanceof y&&(t=t.effect.fn);const n=new y(t);e&&s(n,e);try{n.run()}catch(r){throw n.stop(),r}const i=n.run.bind(n);return i.effect=n,i},t.effectScope=function(t){return new g(t)},t.enableTracking=function(){O.push(A),A=!0},t.getCurrentScope=function(){return v},t.isProxy=Mt,t.isReactive=Vt,t.isReadonly=Ct,t.isRef=Gt,t.isShallow=Wt,t.markRaw=function(t){return Object.isExtensible(t)&&((t,e,s,n=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:s})})(t,"__v_skip",!0),t},t.onEffectCleanup=function(t,e=!1){_ instanceof y&&(_.cleanup=t)},t.onScopeDispose=function(t,e=!1){v&&v.cleanups.push(t)},t.pauseTracking=I,t.proxyRefs=function(t){return Vt(t)?t:new Proxy(t,qt)},t.reactive=jt,t.reactiveReadArray=G,t.readonly=Nt,t.ref=Ft,t.resetTracking=L,t.shallowReactive=function(t){return Pt(t,!1,rt,kt,Ot)},t.shallowReadArray=F,t.shallowReadonly=function(t){return Pt(t,!0,ot,mt,Lt)},t.shallowRef=function(t){return Ht(t,!0)},t.stop=function(t){t.effect.stop()},t.toRaw=Kt,t.toReactive=Yt,t.toReadonly=zt,t.toRef=function(t,e,s){return Gt(t)?t:c(t)?new Xt(t):a(t)&&arguments.length>1?Zt(t,e,s):Ft(t)},t.toRefs=function(t){const e=r(t)?new Array(t.length):{};for(const s in t)e[s]=Zt(t,s);return e},t.toValue=function(t){return c(t)?t():Bt(t)},t.track=Y,t.trigger=z,t.triggerRef=function(t){t.dep.trigger()},t.unref=Bt,t}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/reactivity",
|
|
3
|
-
"version": "3.5.0-alpha.
|
|
3
|
+
"version": "3.5.0-alpha.2",
|
|
4
4
|
"description": "@vue/reactivity",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/reactivity.esm-bundler.js",
|
|
@@ -50,6 +50,6 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@vue/shared": "3.5.0-alpha.
|
|
53
|
+
"@vue/shared": "3.5.0-alpha.2"
|
|
54
54
|
}
|
|
55
55
|
}
|