You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
11 KiB

11 months ago
function t(t,e){const n=Object.create(null),s=t.split(",");for(let i=0;i<s.length;i++)n[s[i]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}const e=()=>{},n=Object.assign,s=Object.prototype.hasOwnProperty,i=(t,e)=>s.call(t,e),r=Array.isArray,c=t=>"[object Map]"===a(t),o=t=>"function"==typeof t,u=t=>"symbol"==typeof t,h=t=>null!==t&&"object"==typeof t,l=Object.prototype.toString,a=t=>l.call(t),f=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,_=(t,e)=>!Object.is(t,e);let d;const p=[];class v{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&d&&(this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1)}run(t){if(this.active)try{return this.on(),t()}finally{this.off()}}on(){this.active&&(p.push(this),d=this)}off(){this.active&&(p.pop(),d=p[p.length-1])}stop(t){if(this.active){if(this.effects.forEach((t=>t.stop())),this.cleanups.forEach((t=>t())),this.scopes&&this.scopes.forEach((t=>t.stop(!0))),this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.active=!1}}}function g(t){return new v(t)}function y(t,e){(e=e||d)&&e.active&&e.effects.push(t)}function w(){return d}function b(t){d&&d.cleanups.push(t)}const R=t=>{const e=new Set(t);return e.w=0,e.n=0,e},k=t=>(t.w&S)>0,m=t=>(t.n&S)>0,j=new WeakMap;let O=0,S=1;const E=[];let x;const P=Symbol(""),M=Symbol("");class z{constructor(t,e=null,n){this.fn=t,this.scheduler=e,this.active=!0,this.deps=[],y(this,n)}run(){if(!this.active)return this.fn();if(!E.includes(this))try{return E.push(x=this),B(),S=1<<++O,O<=30?(({deps:t})=>{if(t.length)for(let e=0;e<t.length;e++)t[e].w|=S})(this):W(this),this.fn()}finally{O<=30&&(t=>{const{deps:e}=t;if(e.length){let n=0;for(let s=0;s<e.length;s++){const i=e[s];k(i)&&!m(i)?i.delete(t):e[n++]=i,i.w&=~S,i.n&=~S}e.length=n}})(this),S=1<<--O,C(),E.pop();const t=E.length;x=t>0?E[t-1]:void 0}}stop(){this.active&&(W(this),this.onStop&&this.onStop(),this.active=!1)}}function W(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}function A(t,e){t.effect&&(t=t.effect.fn);const s=new z(t);e&&(n(s,e),e.scope&&y(s,e.scope)),e&&e.lazy||s.run();const i=s.run.bind(s);return i.effect=s,i}function N(t){t.effect.stop()}let V=!0;const I=[];function K(){I.push(V),V=!1}function B(){I.push(V),V=!0}function C(){const t=I.pop();V=void 0===t||t}function L(t,e,n){if(!q())return;let s=j.get(t);s||j.set(t,s=new Map);let i=s.get(n);i||s.set(n,i=R()),D(i)}function q(){return V&&void 0!==x}function D(t,e){let n=!1;O<=30?m(t)||(t.n|=S,n=!k(t)):n=!t.has(x),n&&(t.add(x),x.deps.push(t))}function F(t,e,n,s,i,o){const u=j.get(t);if(!u)return;let h=[];if("clear"===e)h=[...u.values()];else if("length"===n&&r(t))u.forEach(((t,e)=>{("length"===e||e>=s)&&h.push(t)}));else switch(void 0!==n&&h.push(u.get(n)),e){case"add":r(t)?f(n)&&h.push(u.get("length")):(h.push(u.get(P)),c(t)&&h.push(u.get(M)));break;case"delete":r(t)||(h.push(u.get(P)),c(t)&&h.push(u.get(M)));break;case"set":c(t)&&h.push(u.get(P))}if(1===h.length)h[0]&&G(h[0]);else{const t=[];for(const e of h)e&&t.push(...e);G(R(t))}}function G(t,e){for(const n of r(t)?t:[...t])(n!==x||n.allowRecurse)&&(n.scheduler?n.scheduler():n.run())}const H=t("__proto__,__v_isRef,__isVue"),J=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(u)),Q=$(),T=$(!1,!0),U=$(!0),X=$(!0,!0),Y=Z();function Z(){const t={};return["includes","indexOf","lastIndexOf"].forEach((e=>{t[e]=function(...t){const n=Dt(this);for(let e=0,i=this.length;e<i;e++)L(n,0,e+"");const s=n[e](...t);return-1===s||!1===s?n[e](...t.map(Dt)):s}})),["push","pop","shift","unshift","splice"].forEach((e=>{t[e]=function(...t){K();const n=Dt(this)[e].apply(this,t);return C(),n}})),t}function $(t=!1,e=!1){return function(n,s,c){if("__v_isReactive"===s)return!t;if("__v_isReadonly"===s)return t;if("__v_raw"===s&&c===(t?e?Wt:zt:e?Mt:Pt).get(n))return n;const o=r(n);if(!t&&o&&i(Y,s))return Reflect.get(Y,s,c);const l=Reflect.get(n,s,c);if(u(s)?J.has(s):H(s))return l;if(t||L(n,0,s),e)return l;if(Qt(l)){return!o||!f(s)?l.value:l}return h