@vue-mini/core 1.0.3 → 1.1.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.
- package/dist/vue-mini.cjs.js +1100 -618
- package/dist/vue-mini.cjs.prod.js +2 -2
- package/dist/vue-mini.d.ts +15 -19
- package/dist/vue-mini.esm-bundler.js +71 -236
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-mini v1.
|
|
2
|
+
* vue-mini v1.1.1
|
|
3
3
|
* https://github.com/vue-mini/vue-mini
|
|
4
4
|
* (c) 2019-present Yang Mingshan
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
7
|
"use strict";
|
|
8
|
-
/*! #__NO_SIDE_EFFECTS__ */function e(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const t=()=>{},n=Object.assign,s=Object.prototype.hasOwnProperty,i=(e,t)=>s.call(e,t),o=Array.isArray,r=e=>"[object Map]"===l(e),c=e=>"function"==typeof e,_=e=>"symbol"==typeof e,a=e=>null!==e&&"object"==typeof e,h=Object.prototype.toString,l=e=>h.call(e),u=e=>l(e).slice(8,-1),f=e=>"string"==typeof e&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,d=(e,t)=>!Object.is(e,t);let p,O;class E{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=p,!e&&p&&(this.index=(p.scopes||(p.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=p;try{return p=this,e()}finally{p=t}}}on(){p=this}off(){p=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0,this._active=!1}}}function v(e,t=p){t&&t.active&&t.effects.push(e)}function S(){return p}class N{constructor(e,t,n,s){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,v(this,s)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,I();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(A(t.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),D()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=y,t=O;try{return y=!0,O=this,this._runnings++,R(this),this.fn()}finally{g(this),this._runnings--,O=t,y=e}}stop(){this.active&&(R(this),g(this),this.onStop&&this.onStop(),this.active=!1)}}function A(e){return e.value}function R(e){e._trackId++,e._depsLength=0}function g(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)T(e.deps[t],e);e.deps.length=e._depsLength}}function T(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}let y=!0,m=0;const b=[];function I(){b.push(y),y=!1}function D(){const e=b.pop();y=void 0===e||e}function L(){m++}function P(){for(m--;!m&&x.length;)x.shift()()}function H(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&T(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const x=[];function w(e,t,n){L();for(const n of e.keys()){let s;n._dirtyLevel<t&&(null!=s?s:s=e.get(n)===n._trackId)&&(n._shouldSchedule||(n._shouldSchedule=0===n._dirtyLevel),n._dirtyLevel=t),n._shouldSchedule&&(null!=s?s:s=e.get(n)===n._trackId)&&(n.trigger(),n._runnings&&!n.allowRecurse||2===n._dirtyLevel||(n._shouldSchedule=!1,n.scheduler&&x.push(n.scheduler)))}P()}const M=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},C=new WeakMap,k=Symbol(""),j=Symbol("");function U(e,t,n){if(y&&O){let t=C.get(e);t||C.set(e,t=new Map);let s=t.get(n);s||t.set(n,s=M((()=>t.delete(n)))),H(O,s)}}function V(e,t,n,s,i,c){const a=C.get(e);if(!a)return;let h=[];if("clear"===t)h=[...a.values()];else if("length"===n&&o(e)){const e=Number(s);a.forEach(((t,n)=>{("length"===n||!_(n)&&n>=e)&&h.push(t)}))}else switch(void 0!==n&&h.push(a.get(n)),t){case"add":o(e)?f(n)&&h.push(a.get("length")):(h.push(a.get(k)),r(e)&&h.push(a.get(j)));break;case"delete":o(e)||(h.push(a.get(k)),r(e)&&h.push(a.get(j)));break;case"set":r(e)&&h.push(a.get(k))}L();for(const e of h)e&&w(e,4);P()}const F=e("__proto__,__v_isRef,__isVue"),G=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(_)),W=B();function B(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=xe(this);for(let e=0,t=this.length;e<t;e++)U(n,0,e+"");const s=n[t](...e);return-1===s||!1===s?n[t](...e.map(xe)):s}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){I(),L();const n=xe(this)[t].apply(this,e);return P(),D(),n}})),e}function Y(e){_(e)||(e=String(e));const t=xe(this);return U(t,0,e),t.hasOwnProperty(e)}class z{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?Te:ge:r?Re:Ae).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const c=o(e);if(!s){if(c&&i(W,t))return Reflect.get(W,t,n);if("hasOwnProperty"===t)return Y}const h=Reflect.get(e,t,n);return(_(t)?G.has(t):F(t))?h:(s||U(e,0,t),r?h:Ue(h)?c&&f(t)?h:h.value:a(h)?s?be(h):ye(h):h)}}class Q extends z{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const t=Le(r);if(Pe(n)||Le(n)||(r=xe(r),n=xe(n)),!o(e)&&Ue(r)&&!Ue(n))return!t&&(r.value=n,!0)}const c=o(e)&&f(t)?Number(t)<e.length:i(e,t),_=Reflect.set(e,t,n,s);return e===xe(s)&&(c?d(n,r)&&V(e,"set",t,n):V(e,"add",t,n)),_}deleteProperty(e,t){const n=i(e,t),s=Reflect.deleteProperty(e,t);return s&&n&&V(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return _(t)&&G.has(t)||U(e,0,t),n}ownKeys(e){return U(e,0,o(e)?"length":k),Reflect.ownKeys(e)}}class X extends z{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Z=new Q,J=new X,K=new Q(!0),$=new X(!0),q=e=>e,ee=e=>Reflect.getPrototypeOf(e);function te(e,t,n=!1,s=!1){const i=xe(e=e.__v_raw),o=xe(t);n||(d(t,o)&&U(i,0,t),U(i,0,o));const{has:r}=ee(i),c=s?q:n?Me:we;return r.call(i,t)?c(e.get(t)):r.call(i,o)?c(e.get(o)):void(e!==i&&e.get(t))}function ne(e,t=!1){const n=this.__v_raw,s=xe(n),i=xe(e);return t||(d(e,i)&&U(s,0,e),U(s,0,i)),e===i?n.has(e):n.has(e)||n.has(i)}function se(e,t=!1){return e=e.__v_raw,!t&&U(xe(e),0,k),Reflect.get(e,"size",e)}function ie(e,t=!1){t||Pe(e)||Le(e)||(e=xe(e));const n=xe(this);return ee(n).has.call(n,e)||(n.add(e),V(n,"add",e,e)),this}function oe(e,t,n=!1){n||Pe(t)||Le(t)||(t=xe(t));const s=xe(this),{has:i,get:o}=ee(s);let r=i.call(s,e);r||(e=xe(e),r=i.call(s,e));const c=o.call(s,e);return s.set(e,t),r?d(t,c)&&V(s,"set",e,t):V(s,"add",e,t),this}function re(e){const t=xe(this),{has:n,get:s}=ee(t);let i=n.call(t,e);i||(e=xe(e),i=n.call(t,e)),s&&s.call(t,e);const o=t.delete(e);return i&&V(t,"delete",e,void 0),o}function ce(){const e=xe(this),t=0!==e.size,n=e.clear();return t&&V(e,"clear",void 0,void 0),n}function _e(e,t){return function(n,s){const i=this,o=i.__v_raw,r=xe(o),c=t?q:e?Me:we;return!e&&U(r,0,k),o.forEach(((e,t)=>n.call(s,c(e),c(t),i)))}}function ae(e,t,n){return function(...s){const i=this.__v_raw,o=xe(i),c=r(o),_="entries"===e||e===Symbol.iterator&&c,a="keys"===e&&c,h=i[e](...s),l=n?q:t?Me:we;return!t&&U(o,0,a?j:k),{next(){const{value:e,done:t}=h.next();return t?{value:e,done:t}:{value:_?[l(e[0]),l(e[1])]:l(e),done:t}},[Symbol.iterator](){return this}}}}function he(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function le(){const e={get(e){return te(this,e)},get size(){return se(this)},has:ne,add:ie,set:oe,delete:re,clear:ce,forEach:_e(!1,!1)},t={get(e){return te(this,e,!1,!0)},get size(){return se(this)},has:ne,add(e){return ie.call(this,e,!0)},set(e,t){return oe.call(this,e,t,!0)},delete:re,clear:ce,forEach:_e(!1,!0)},n={get(e){return te(this,e,!0)},get size(){return se(this,!0)},has(e){return ne.call(this,e,!0)},add:he("add"),set:he("set"),delete:he("delete"),clear:he("clear"),forEach:_e(!0,!1)},s={get(e){return te(this,e,!0,!0)},get size(){return se(this,!0)},has(e){return ne.call(this,e,!0)},add:he("add"),set:he("set"),delete:he("delete"),clear:he("clear"),forEach:_e(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{e[i]=ae(i,!1,!1),n[i]=ae(i,!0,!1),t[i]=ae(i,!1,!0),s[i]=ae(i,!0,!0)})),[e,n,t,s]}const[ue,fe,de,pe]=le();function Oe(e,t){const n=t?e?pe:de:e?fe:ue;return(t,s,o)=>"__v_isReactive"===s?!e:"__v_isReadonly"===s?e:"__v_raw"===s?t:Reflect.get(i(n,s)&&s in t?n:t,s,o)}const Ee={get:Oe(!1,!1)},ve={get:Oe(!1,!0)},Se={get:Oe(!0,!1)},Ne={get:Oe(!0,!0)},Ae=new WeakMap,Re=new WeakMap,ge=new WeakMap,Te=new WeakMap;function ye(e){return Le(e)?e:Ie(e,!1,Z,Ee,Ae)}function me(e){return Ie(e,!1,K,ve,Re)}function be(e){return Ie(e,!0,J,Se,ge)}function Ie(e,t,n,s,i){if(!a(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const o=i.get(e);if(o)return o;const r=(c=e).__v_skip||!Object.isExtensible(c)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(u(c));var c;if(0===r)return e;const _=new Proxy(e,2===r?s:n);return i.set(e,_),_}function De(e){return Le(e)?De(e.__v_raw):!(!e||!e.__v_isReactive)}function Le(e){return!(!e||!e.__v_isReadonly)}function Pe(e){return!(!e||!e.__v_isShallow)}function He(e){return!!e&&!!e.__v_raw}function xe(e){const t=e&&e.__v_raw;return t?xe(t):e}const we=e=>a(e)?ye(e):e,Me=e=>a(e)?be(e):e;class Ce{constructor(e,t,n,s){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new N((()=>e(this._value)),(()=>je(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=n}get value(){const e=xe(this);return e._cacheable&&!e.effect.dirty||!d(e._value,e._value=e.effect.run())||je(e,4),ke(e),e.effect._dirtyLevel>=2&&je(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function ke(e){var t;y&&O&&(e=xe(e),H(O,null!=(t=e.dep)?t:e.dep=M((()=>e.dep=void 0),e instanceof Ce?e:void 0)))}function je(e,t=4,n,s){const i=(e=xe(e)).dep;i&&w(i,t)}function Ue(e){return!(!e||!0!==e.__v_isRef)}function Ve(e){return Fe(e,!1)}function Fe(e,t){return Ue(e)?e:new Ge(e,t)}class Ge{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:xe(e),this._value=t?e:we(e)}get value(){return ke(this),this._value}set value(e){const t=this.__v_isShallow||Pe(e)||Le(e);e=t?e:xe(e),d(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:we(e),je(this,4))}}function We(e){return Ue(e)?e.value:e}const Be={get:(e,t,n)=>We(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const i=e[t];return Ue(i)&&!Ue(n)?(i.value=n,!0):Reflect.set(e,t,n,s)}};class Ye{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>ke(this)),(()=>je(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}class ze{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=C.get(e);return n&&n.get(t)}(xe(this._object),this._key)}}class Qe{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Xe(e,t,n){const s=e[t];return Ue(s)?s:new ze(e,t,n)}const Ze={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw"},Je=()=>{},{isArray:Ke}=Array,$e=Object.assign;function qe(e,t){const n={};return Object.keys(e).forEach((s=>{t.includes(s)||(n[s]=e[s])})),n}function et(e){return Object.prototype.toString.call(e).slice(8,-1)}function tt(e){return null!==e&&"object"==typeof e}function nt(e){return"Object"===et(e)}function st(e){return"function"==typeof e}function it(e,t){return e!==t&&(e==e||t==t)}function ot(e){return`__${e}__`}let rt=!1,ct=!1;const _t=[];let at=0;const ht=[];let lt=null,ut=0;const ft=Promise.resolve();let dt=null;function pt(e){0!==_t.length&&_t.includes(e,rt&&e.allowRecurse?at+1:at)||(_t.push(e),rt||ct||(ct=!0,dt=ft.then(Et)))}function Ot(){if(ht.length>0){for(lt=[...new Set(ht)],ht.length=0,ut=0;ut<lt.length;ut++){const e=lt[ut];!1!==e.active&&e()}lt=null,ut=0}}function Et(e){ct=!1,rt=!0;try{for(at=0;at<_t.length;at++){const e=_t[at];!1!==e.active&&e()}}finally{at=0,_t.length=0,rt=!1,dt=null}}const vt={};function St(e,t,n){return Nt(e,t,n)}function Nt(e,t,{immediate:n,deep:s,flush:i,once:o}={}){if(t&&o){const e=t;t=(...t)=>{e(...t),E()}}const r=e=>!0===s?e:At(e,!1===s?1:void 0);let c,_,a=!1,h=!1;if(Ue(e)?(c=()=>e.value,a=Pe(e)):De(e)?(c=()=>r(e),a=!0):Ke(e)?(h=!0,a=e.some((e=>De(e)||Pe(e))),c=()=>e.map((e=>Ue(e)?e.value:De(e)?r(e):st(e)?e():void 0))):c=st(e)?t?()=>e():()=>(_&&_(),e(l)):Je,t&&s){const e=c;c=()=>At(e())}const l=e=>{_=p.onStop=()=>{e(),_=p.onStop=void 0}};let u=h?Array.from({length:e.length}).fill(vt):vt;const f=()=>{if(p.active&&p.dirty)if(t){const e=p.run();(s||a||(h?e.some(((e,t)=>it(e,u[t]))):it(e,u)))&&(_&&_(),t(e,u===vt?void 0:h&&u[0]===vt?[]:u,l),u=e)}else p.run()};let d;f.allowRecurse=Boolean(t),d="sync"===i?f:"post"===i?()=>{!function(e){lt&<.includes(e,e.allowRecurse?ut+1:ut)||ht.push(e)}(f)}:()=>{pt(f)};const p=new N(c,Je,d),O=S(),E=()=>{p.stop(),O&&function(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}(O.effects,p)};return t?n?f():u=p.run():p.run(),E}function At(e,t=Number.POSITIVE_INFINITY,n){if(t<=0||!tt(e)||e[Ze.SKIP])return e;if((n=n||new Set).has(e))return e;if(n.add(e),t--,Ue(e))At(e.value,t,n);else if(Ke(e))for(let s=0;s<e.length;s++)At(e[s],t,n);else if("Set"===et(e)||function(e){return"Map"===et(e)}(e))e.forEach((e=>{At(e,t,n)}));else if(nt(e)){for(const s in e)At(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&At(e[s],t,n)}return e}const Rt=Object.create(null);let gt=null,Tt=null,yt=null;function mt(){return Tt||yt}var bt,It,Dt;function Lt(e,t){const n=e[t];return function(...e){const s=this[ot(t)];s&&s.forEach((t=>t(...e))),void 0!==n&&n.call(this,...e)}}function Pt(e){if(function(e){const t=new Set(["undefined","boolean","number","string"]);return null===e||t.has(typeof e)}(e)||st(e))return e;if(Ue(e))return Pt(e.value);if(He(e))return Pt(xe(e));if(Ke(e))return e.map((e=>Pt(e)));if(nt(e)){const t={};return Object.keys(e).forEach((n=>{t[n]=Pt(e[n])})),t}throw new TypeError(`${et(e)} value is not supported`)}function Ht(e,t){tt(t)&&St(Ue(t)?t:()=>t,(()=>{this.setData({[e]:Pt(t)},Ot)}),{deep:!0})}function xt(e,t){const n=e[t];return function(...e){const s=this[ot(t)];s&&s.forEach((t=>t(...e))),void 0!==n&&n.call(this,...e)}}!function(e){e.ON_LAUNCH="onLaunch",e.ON_SHOW="onShow",e.ON_HIDE="onHide",e.ON_ERROR="onError",e.ON_PAGE_NOT_FOUND="onPageNotFound",e.ON_UNHANDLED_REJECTION="onUnhandledRejection",e.ON_THEME_CHANGE="onThemeChange"}(bt||(bt={})),function(e){e.ON_LOAD="onLoad",e.ON_SHOW="onShow",e.ON_READY="onReady",e.ON_HIDE="onHide",e.ON_UNLOAD="onUnload",e.ON_ROUTE_DONE="onRouteDone",e.ON_PULL_DOWN_REFRESH="onPullDownRefresh",e.ON_REACH_BOTTOM="onReachBottom",e.ON_PAGE_SCROLL="onPageScroll",e.ON_SHARE_APP_MESSAGE="onShareAppMessage",e.ON_SHARE_TIMELINE="onShareTimeline",e.ON_ADD_TO_FAVORITES="onAddToFavorites",e.ON_RESIZE="onResize",e.ON_TAB_ITEM_TAP="onTabItemTap",e.ON_SAVE_EXIT_STATE="onSaveExitState"}(It||(It={})),function(e){e.ATTACHED="attached",e.READY="ready",e.MOVED="moved",e.DETACHED="detached",e.ERROR="error"}(Dt||(Dt={}));const wt={[It.ON_SHOW]:"show",[It.ON_HIDE]:"hide",[It.ON_RESIZE]:"resize",[It.ON_ROUTE_DONE]:"routeDone",[Dt.READY]:It.ON_READY};function Mt(e,t){return jt(t,e.lifetimes[t]||e[t])}function Ct(e,t){return jt(t,e.methods[t])}function kt(e,t){return jt(t,e.pageLifetimes[wt[t]])}function jt(e,t){const n=ot(e);return function(...e){const s=this[n];s&&s.forEach((t=>t(...e))),void 0!==t&&t.call(this,...e)}}const Ut=sn(bt.ON_SHOW),Vt=sn(bt.ON_HIDE),Ft=sn(bt.ON_ERROR),Gt=sn(bt.ON_PAGE_NOT_FOUND),Wt=sn(bt.ON_UNHANDLED_REJECTION),Bt=sn(bt.ON_THEME_CHANGE),Yt=on(It.ON_SHOW),zt=on(It.ON_HIDE),Qt=on(It.ON_UNLOAD),Xt=on(It.ON_ROUTE_DONE),Zt=on(It.ON_PULL_DOWN_REFRESH),Jt=on(It.ON_REACH_BOTTOM),Kt=on(It.ON_RESIZE),$t=on(It.ON_TAB_ITEM_TAP),qt=rn(It.ON_LOAD),en=rn(Dt.MOVED),tn=rn(Dt.DETACHED),nn=rn(Dt.ERROR);function sn(e){return t=>{gt&&cn(gt,e,t)}}function on(e){return t=>{const n=mt();n&&cn(n,e,t)}}function rn(e){return t=>{yt&&cn(yt,e,t)}}function cn(e,t,n){const s=ot(t);void 0===e[s]&&(e[s]=[]),e[s].push(n)}exports.EffectScope=E,exports.ReactiveEffect=N,exports.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},exports.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},exports.computed=function(e,n,s=!1){let i,o;const r=c(e);return r?(i=e,o=t):(i=e.get,o=e.set),new Ce(i,o,r||!o,s)},exports.createApp=function(e){let t,n;if(st(e))t=e,n={};else{if(void 0===e.setup)return void App(e);t=e.setup,n=qe(e,["setup"])}const s=n[bt.ON_LAUNCH];n[bt.ON_LAUNCH]=function(e){gt=this;const n=t(e);void 0!==n&&Object.keys(n).forEach((e=>{this[e]=n[e]})),gt=null,void 0!==s&&s.call(this,e)},n[bt.ON_SHOW]=Lt(n,bt.ON_SHOW),n[bt.ON_HIDE]=Lt(n,bt.ON_HIDE),n[bt.ON_ERROR]=Lt(n,bt.ON_ERROR),n[bt.ON_PAGE_NOT_FOUND]=Lt(n,bt.ON_PAGE_NOT_FOUND),n[bt.ON_UNHANDLED_REJECTION]=Lt(n,bt.ON_UNHANDLED_REJECTION),n[bt.ON_THEME_CHANGE]=Lt(n,bt.ON_THEME_CHANGE),App(n)},exports.customRef=function(e){return new Ye(e)},exports.defineComponent=function(e,t){let n,s;t=$e({listenPageScroll:!1,canShareToOthers:!1,canShareToTimeline:!1},t);let i=null;if(st(e))n=e,s={};else{if(void 0===e.setup)return Component(e);n=e.setup,s=qe(e,["setup"]),s.properties&&(i=Object.keys(s.properties))}void 0===s.lifetimes&&(s.lifetimes={});const o=s.lifetimes[Dt.ATTACHED]||s[Dt.ATTACHED];s.lifetimes[Dt.ATTACHED]=function(){var e;this.__scope__=new E,yt=e=this,e.__scope__.on();const t={};i&&i.forEach((e=>{t[e]=this.data[e]})),this.__props__=me(t);const s={is:this.is,id:this.id,dataset:this.dataset,exitState:this.exitState,router:this.router,pageRouter:this.pageRouter,renderer:this.renderer,triggerEvent:this.triggerEvent.bind(this),createSelectorQuery:this.createSelectorQuery.bind(this),createIntersectionObserver:this.createIntersectionObserver.bind(this),createMediaQueryObserver:this.createMediaQueryObserver.bind(this),selectComponent:this.selectComponent.bind(this),selectAllComponents:this.selectAllComponents.bind(this),selectOwnerComponent:this.selectOwnerComponent.bind(this),getRelationNodes:this.getRelationNodes.bind(this),getTabBar:this.getTabBar.bind(this),getPageId:this.getPageId.bind(this),animate:this.animate.bind(this),clearAnimation:this.clearAnimation.bind(this),getOpenerEventChannel:this.getOpenerEventChannel.bind(this),applyAnimatedStyle:this.applyAnimatedStyle.bind(this),clearAnimatedStyle:this.clearAnimatedStyle.bind(this),setUpdatePerformanceListener:this.setUpdatePerformanceListener.bind(this),getPassiveEvent:this.getPassiveEvent.bind(this),setPassiveEvent:this.setPassiveEvent.bind(this)},r=n(this.__props__,s);void 0!==r&&Object.keys(r).forEach((e=>{const t=r[e];st(t)?this[e]=t:(this.setData({[e]:Pt(t)}),Ht.call(this,e,t))})),yt&&yt.__scope__.off(),yt=null,void 0!==o&&o.call(this)};const r=Mt(s,Dt.DETACHED);return s.lifetimes[Dt.DETACHED]=function(){r.call(this),this.__scope__.stop()},s.lifetimes[Dt.READY]=jt(wt[Dt.READY],s.lifetimes[Dt.READY]||s[Dt.READY]),s.lifetimes[Dt.MOVED]=Mt(s,Dt.MOVED),s.lifetimes[Dt.ERROR]=Mt(s,Dt.ERROR),void 0===s.methods&&(s.methods={}),(s.methods[It.ON_PAGE_SCROLL]||t.listenPageScroll)&&(s.methods[It.ON_PAGE_SCROLL]=Ct(s,It.ON_PAGE_SCROLL),s.methods.__listenPageScroll__=()=>!0),void 0===s.methods[It.ON_SHARE_APP_MESSAGE]&&t.canShareToOthers&&(s.methods[It.ON_SHARE_APP_MESSAGE]=function(e){const t=this[ot(It.ON_SHARE_APP_MESSAGE)];return t?t(e):{}},s.methods.__isInjectedShareToOthersHook__=()=>!0),void 0===s.methods[It.ON_SHARE_TIMELINE]&&t.canShareToTimeline&&(s.methods[It.ON_SHARE_TIMELINE]=function(){const e=this[ot(It.ON_SHARE_TIMELINE)];return e?e():{}},s.methods.__isInjectedShareToTimelineHook__=()=>!0),void 0===s.methods[It.ON_ADD_TO_FAVORITES]&&(s.methods[It.ON_ADD_TO_FAVORITES]=function(e){const t=this[ot(It.ON_ADD_TO_FAVORITES)];return t?t(e):{}},s.methods.__isInjectedFavoritesHook__=()=>!0),void 0===s.methods[It.ON_SAVE_EXIT_STATE]&&(s.methods[It.ON_SAVE_EXIT_STATE]=function(){const e=this[ot(It.ON_SAVE_EXIT_STATE)];return e?e():{data:void 0}},s.methods.__isInjectedExitStateHook__=()=>!0),s.methods[It.ON_LOAD]=Ct(s,It.ON_LOAD),s.methods[It.ON_PULL_DOWN_REFRESH]=Ct(s,It.ON_PULL_DOWN_REFRESH),s.methods[It.ON_REACH_BOTTOM]=Ct(s,It.ON_REACH_BOTTOM),s.methods[It.ON_TAB_ITEM_TAP]=Ct(s,It.ON_TAB_ITEM_TAP),void 0===s.pageLifetimes&&(s.pageLifetimes={}),s.pageLifetimes[wt[It.ON_SHOW]]=kt(s,It.ON_SHOW),s.pageLifetimes[wt[It.ON_HIDE]]=kt(s,It.ON_HIDE),s.pageLifetimes[wt[It.ON_RESIZE]]=kt(s,It.ON_RESIZE),s.pageLifetimes[wt[It.ON_ROUTE_DONE]]=kt(s,It.ON_ROUTE_DONE),i&&(void 0===s.observers&&(s.observers={}),i.forEach((e=>{const t=s.observers[e];s.observers[e]=function(n){this.__props__&&(this.__props__[e]=n),void 0!==t&&t.call(this,n)}}))),Component(s)},exports.definePage=function(e,t){let n,s;if(t=$e({listenPageScroll:!1,canShareToOthers:!1,canShareToTimeline:!1},t),st(e))n=e,s={};else{if(void 0===e.setup)return void Page(e);n=e.setup,s=qe(e,["setup"])}const i=s[It.ON_LOAD];s[It.ON_LOAD]=function(e){var t;this.__scope__=new E,Tt=t=this,t.__scope__.on();const s={is:this.is,route:this.route,options:this.options,exitState:this.exitState,router:this.router,pageRouter:this.pageRouter,renderer:this.renderer,createSelectorQuery:this.createSelectorQuery.bind(this),createIntersectionObserver:this.createIntersectionObserver.bind(this),createMediaQueryObserver:this.createMediaQueryObserver.bind(this),selectComponent:this.selectComponent.bind(this),selectAllComponents:this.selectAllComponents.bind(this),getTabBar:this.getTabBar.bind(this),getPageId:this.getPageId.bind(this),animate:this.animate.bind(this),clearAnimation:this.clearAnimation.bind(this),getOpenerEventChannel:this.getOpenerEventChannel.bind(this),applyAnimatedStyle:this.applyAnimatedStyle.bind(this),clearAnimatedStyle:this.clearAnimatedStyle.bind(this),setUpdatePerformanceListener:this.setUpdatePerformanceListener.bind(this),getPassiveEvent:this.getPassiveEvent.bind(this),setPassiveEvent:this.setPassiveEvent.bind(this)},o=n(e,s);void 0!==o&&Object.keys(o).forEach((e=>{const t=o[e];st(t)?this[e]=t:(this.setData({[e]:Pt(t)}),Ht.call(this,e,t))})),Tt&&Tt.__scope__.off(),Tt=null,void 0!==i&&i.call(this,e)};const o=xt(s,It.ON_UNLOAD);s[It.ON_UNLOAD]=function(){o.call(this),this.__scope__.stop()},(s[It.ON_PAGE_SCROLL]||t.listenPageScroll)&&(s[It.ON_PAGE_SCROLL]=xt(s,It.ON_PAGE_SCROLL),s.__listenPageScroll__=()=>!0),void 0===s[It.ON_SHARE_APP_MESSAGE]&&t.canShareToOthers&&(s[It.ON_SHARE_APP_MESSAGE]=function(e){const t=this[ot(It.ON_SHARE_APP_MESSAGE)];return t?t(e):{}},s.__isInjectedShareToOthersHook__=()=>!0),void 0===s[It.ON_SHARE_TIMELINE]&&t.canShareToTimeline&&(s[It.ON_SHARE_TIMELINE]=function(){const e=this[ot(It.ON_SHARE_TIMELINE)];return e?e():{}},s.__isInjectedShareToTimelineHook__=()=>!0),void 0===s[It.ON_ADD_TO_FAVORITES]&&(s[It.ON_ADD_TO_FAVORITES]=function(e){const t=this[ot(It.ON_ADD_TO_FAVORITES)];return t?t(e):{}},s.__isInjectedFavoritesHook__=()=>!0),void 0===s[It.ON_SAVE_EXIT_STATE]&&(s[It.ON_SAVE_EXIT_STATE]=function(){const e=this[ot(It.ON_SAVE_EXIT_STATE)];return e?e():{data:void 0}},s.__isInjectedExitStateHook__=()=>!0),s[It.ON_SHOW]=xt(s,It.ON_SHOW),s[It.ON_READY]=xt(s,It.ON_READY),s[It.ON_HIDE]=xt(s,It.ON_HIDE),s[It.ON_ROUTE_DONE]=xt(s,It.ON_ROUTE_DONE),s[It.ON_PULL_DOWN_REFRESH]=xt(s,It.ON_PULL_DOWN_REFRESH),s[It.ON_REACH_BOTTOM]=xt(s,It.ON_REACH_BOTTOM),s[It.ON_RESIZE]=xt(s,It.ON_RESIZE),s[It.ON_TAB_ITEM_TAP]=xt(s,It.ON_TAB_ITEM_TAP),Page(s)},exports.effect=function(e,s){e.effect instanceof N&&(e=e.effect.fn);const i=new N(e,t,(()=>{i.dirty&&i.run()}));s&&(n(i,s),s.scope&&v(i,s.scope)),s&&s.lazy||i.run();const o=i.run.bind(i);return o.effect=i,o},exports.effectScope=function(e){return new E(e)},exports.getCurrentScope=S,exports.inject=function(e,t,n=!1){return e in Rt?Rt[e]:arguments.length>1?n&&st(t)?t():t:void 0},exports.isProxy=He,exports.isReactive=De,exports.isReadonly=Le,exports.isRef=Ue,exports.isShallow=Pe,exports.markRaw=function(e){return Object.isExtensible(e)&&((e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})})(e,"__v_skip",!0),e},exports.nextTick=function(e){const t=dt||ft;return e?t.then(e):t},exports.onAddToFavorites=e=>{const t=mt();if(t&&t.__isInjectedFavoritesHook__){const n=ot(It.ON_ADD_TO_FAVORITES);void 0===t[n]&&(t[n]=e)}},exports.onAppError=Ft,exports.onAppHide=Vt,exports.onAppShow=Ut,exports.onDetach=tn,exports.onError=nn,exports.onHide=zt,exports.onLoad=qt,exports.onMove=en,exports.onPageNotFound=Gt,exports.onPageScroll=e=>{const t=mt();t&&t.__listenPageScroll__&&cn(t,It.ON_PAGE_SCROLL,e)},exports.onPullDownRefresh=Zt,exports.onReachBottom=Jt,exports.onReady=e=>{const t=mt();t&&cn(t,It.ON_READY,e)},exports.onResize=Kt,exports.onRouteDone=Xt,exports.onSaveExitState=e=>{const t=mt();if(t&&t.__isInjectedExitStateHook__){const n=ot(It.ON_SAVE_EXIT_STATE);void 0===t[n]&&(t[n]=e)}},exports.onScopeDispose=function(e){p&&p.cleanups.push(e)},exports.onShareAppMessage=e=>{const t=mt();if(t&&t[It.ON_SHARE_APP_MESSAGE]&&t.__isInjectedShareToOthersHook__){const n=ot(It.ON_SHARE_APP_MESSAGE);void 0===t[n]&&(t[n]=e)}},exports.onShareTimeline=e=>{const t=mt();if(t&&t[It.ON_SHARE_TIMELINE]&&t.__isInjectedShareToTimelineHook__){const n=ot(It.ON_SHARE_TIMELINE);void 0===t[n]&&(t[n]=e)}},exports.onShow=Yt,exports.onTabItemTap=$t,exports.onThemeChange=Bt,exports.onUnhandledRejection=Wt,exports.onUnload=Qt,exports.provide=function(e,t){Rt[e]=t},exports.proxyRefs=function(e){return De(e)?e:new Proxy(e,Be)},exports.reactive=ye,exports.readonly=be,exports.ref=Ve,exports.shallowReactive=me,exports.shallowReadonly=function(e){return Ie(e,!0,$,Ne,Te)},exports.shallowRef=function(e){return Fe(e,!0)},exports.stop=function(e){e.effect.stop()},exports.toRaw=xe,exports.toRef=function(e,t,n){return Ue(e)?e:c(e)?new Qe(e):a(e)&&arguments.length>1?Xe(e,t,n):Ve(e)},exports.toRefs=function(e){const t=o(e)?new Array(e.length):{};for(const n in e)t[n]=Xe(e,n);return t},exports.toValue=function(e){return c(e)?e():We(e)},exports.triggerRef=function(e){je(e,4)},exports.unref=We,exports.watch=St,exports.watchEffect=function(e,t){return Nt(e,null,t)},exports.watchPostEffect=function(e,t){return Nt(e,null,{flush:"post"})},exports.watchSyncEffect=function(e,t){return Nt(e,null,{flush:"sync"})};
|
|
8
|
+
/*! #__NO_SIDE_EFFECTS__ */function t(t){const e=Object.create(null);for(const s of t.split(","))e[s]=1;return t=>t in e}const e={},s=()=>{},n=Object.assign,i=Object.prototype.hasOwnProperty,o=(t,e)=>i.call(t,e),r=Array.isArray,c=t=>"[object Map]"===_(t),a=t=>"function"==typeof t,l=t=>"symbol"==typeof t,u=t=>null!==t&&"object"==typeof t,h=Object.prototype.toString,_=t=>h.call(t),f=t=>"string"==typeof t&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,p=(t,e)=>!Object.is(t,e);let d,E;class O{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=d,!t&&d&&(this.index=(d.scopes||(d.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let t,e;if(this._isPaused=!0,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].pause();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){let t,e;if(this._isPaused=!1,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].resume();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].resume()}}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 v(){return d}const g=new WeakSet;class S{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,d&&d.active&&d.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,g.has(this)&&(g.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||R(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,C(this),b(this);const t=E,e=P;E=this,P=!0;try{return this.fn()}finally{D(this),E=t,P=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)L(t);this.deps=this.depsTail=void 0,C(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?g.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){y(this)&&this.run()}get dirty(){return y(this)}}let N,A=0;function R(t){t.flags|=8,t.next=N,N=t}function T(){A++}function m(){if(--A>0)return;let t;for(;N;){let e=N;for(N=void 0;e;){const s=e.next;if(e.next=void 0,e.flags&=-9,1&e.flags)try{e.trigger()}catch(e){t||(t=e)}e=s}}if(t)throw t}function b(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function D(t){let e,s=t.depsTail,n=s;for(;n;){const t=n.prevDep;-1===n.version?(n===s&&(s=t),L(n),I(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=t}t.deps=e,t.depsTail=s}function y(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(x(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function x(t){if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===k)return;t.globalVersion=k;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!y(t))return void(t.flags&=-3);const s=E,n=P;E=t,P=!0;try{b(t);const s=t.fn(t._value);(0===e.version||p(s,t._value))&&(t._value=s,e.version++)}catch(t){throw e.version++,t}finally{E=s,P=n,D(t),t.flags&=-3}}function L(t,e=!1){const{dep:s,prevSub:n,nextSub:i}=t;if(n&&(n.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=n,t.nextSub=void 0),s.subs===t&&(s.subs=n),!s.subs)if(s.computed){s.computed.flags&=-5;for(let t=s.computed.deps;t;t=t.nextDep)L(t,!0)}else s.map&&!e&&(s.map.delete(s.key),s.map.size||V.delete(s.target))}function I(t){const{prevDep:e,nextDep:s}=t;e&&(e.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=e,t.nextDep=void 0)}let P=!0;const w=[];function H(){w.push(P),P=!1}function U(){const t=w.pop();P=void 0===t||t}function C(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=E;E=void 0;try{e()}finally{E=t}}}let k=0;class M{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class j{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.target=void 0,this.map=void 0,this.key=void 0}track(t){if(!E||!P||E===this.computed)return;let e=this.activeLink;if(void 0===e||e.sub!==E)e=this.activeLink=new M(E,this),E.deps?(e.prevDep=E.depsTail,E.depsTail.nextDep=e,E.depsTail=e):E.deps=E.depsTail=e,4&E.flags&&W(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=E.depsTail,e.nextDep=void 0,E.depsTail.nextDep=e,E.depsTail=e,E.deps===e&&(E.deps=t)}return e}trigger(t){this.version++,k++,this.notify(t)}notify(t){T();try{0;for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{m()}}}function W(t){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)W(t)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}const V=new WeakMap,G=Symbol(""),F=Symbol(""),Q=Symbol("");function B(t,e,s){if(P&&E){let e=V.get(t);e||V.set(t,e=new Map);let n=e.get(s);n||(e.set(s,n=new j),n.target=t,n.map=e,n.key=s),n.track()}}function Y(t,e,s,n,i,o){const a=V.get(t);if(!a)return void k++;const u=t=>{t&&t.trigger()};if(T(),"clear"===e)a.forEach(u);else{const i=r(t),o=i&&f(s);if(i&&"length"===s){const t=Number(n);a.forEach(((e,s)=>{("length"===s||s===Q||!l(s)&&s>=t)&&u(e)}))}else switch(void 0!==s&&u(a.get(s)),o&&u(a.get(Q)),e){case"add":i?o&&u(a.get("length")):(u(a.get(G)),c(t)&&u(a.get(F)));break;case"delete":i||(u(a.get(G)),c(t)&&u(a.get(F)));break;case"set":c(t)&&u(a.get(G))}}m()}function z(t){const e=zt(t);return e===t?e:(B(e,0,Q),Bt(t)?e:e.map(Xt))}function X(t){return B(t=zt(t),0,Q),t}const Z={__proto__:null,[Symbol.iterator](){return J(this,Symbol.iterator,Xt)},concat(...t){return z(this).concat(...t.map((t=>r(t)?z(t):t)))},entries(){return J(this,"entries",(t=>(t[1]=Xt(t[1]),t)))},every(t,e){return $(this,"every",t,e,void 0,arguments)},filter(t,e){return $(this,"filter",t,e,(t=>t.map(Xt)),arguments)},find(t,e){return $(this,"find",t,e,Xt,arguments)},findIndex(t,e){return $(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return $(this,"findLast",t,e,Xt,arguments)},findLastIndex(t,e){return $(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return $(this,"forEach",t,e,void 0,arguments)},includes(...t){return tt(this,"includes",t)},indexOf(...t){return tt(this,"indexOf",t)},join(t){return z(this).join(t)},lastIndexOf(...t){return tt(this,"lastIndexOf",t)},map(t,e){return $(this,"map",t,e,void 0,arguments)},pop(){return et(this,"pop")},push(...t){return et(this,"push",t)},reduce(t,...e){return q(this,"reduce",t,e)},reduceRight(t,...e){return q(this,"reduceRight",t,e)},shift(){return et(this,"shift")},some(t,e){return $(this,"some",t,e,void 0,arguments)},splice(...t){return et(this,"splice",t)},toReversed(){return z(this).toReversed()},toSorted(t){return z(this).toSorted(t)},toSpliced(...t){return z(this).toSpliced(...t)},unshift(...t){return et(this,"unshift",t)},values(){return J(this,"values",Xt)}};function J(t,e,s){const n=X(t),i=n[e]();return n===t||Bt(t)||(i._next=i.next,i.next=()=>{const t=i._next();return t.value&&(t.value=s(t.value)),t}),i}const K=Array.prototype;function $(t,e,s,n,i,o){const r=X(t),c=r!==t&&!Bt(t),a=r[e];if(a!==K[e]){const e=a.apply(t,o);return c?Xt(e):e}let l=s;r!==t&&(c?l=function(e,n){return s.call(this,Xt(e),n,t)}:s.length>2&&(l=function(e,n){return s.call(this,e,n,t)}));const u=a.call(r,l,n);return c&&i?i(u):u}function q(t,e,s,n){const i=X(t);let o=s;return i!==t&&(Bt(t)?s.length>3&&(o=function(e,n,i){return s.call(this,e,n,i,t)}):o=function(e,n,i){return s.call(this,e,Xt(n),i,t)}),i[e](o,...n)}function tt(t,e,s){const n=zt(t);B(n,0,Q);const i=n[e](...s);return-1!==i&&!1!==i||!Yt(s[0])?i:(s[0]=zt(s[0]),n[e](...s))}function et(t,e,s=[]){H(),T();const n=zt(t)[e].apply(t,s);return m(),U(),n}const st=t("__proto__,__v_isRef,__isVue"),nt=new Set(Object.getOwnPropertyNames(Symbol).filter((t=>"arguments"!==t&&"caller"!==t)).map((t=>Symbol[t])).filter(l));function it(t){l(t)||(t=String(t));const e=zt(this);return B(e,0,t),e.hasOwnProperty(t)}class ot{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?kt:Ct:i?Ut:Ht).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const o=r(t);if(!n){let t;if(o&&(t=Z[e]))return t;if("hasOwnProperty"===e)return it}const c=Reflect.get(t,e,Jt(t)?t:s);return(l(e)?nt.has(e):st(e))?c:(n||B(t,0,e),i?c:Jt(c)?o&&f(e)?c:c.value:u(c)?n?Vt(c):jt(c):c)}}class rt extends ot{constructor(t=!1){super(!1,t)}set(t,e,s,n){let i=t[e];if(!this._isShallow){const e=Qt(i);if(Bt(s)||Qt(s)||(i=zt(i),s=zt(s)),!r(t)&&Jt(i)&&!Jt(s))return!e&&(i.value=s,!0)}const c=r(t)&&f(e)?Number(e)<t.length:o(t,e),a=Reflect.set(t,e,s,Jt(t)?t:n);return t===zt(n)&&(c?p(s,i)&&Y(t,"set",e,s):Y(t,"add",e,s)),a}deleteProperty(t,e){const s=o(t,e),n=Reflect.deleteProperty(t,e);return n&&s&&Y(t,"delete",e,void 0),n}has(t,e){const s=Reflect.has(t,e);return l(e)&&nt.has(e)||B(t,0,e),s}ownKeys(t){return B(t,0,r(t)?"length":G),Reflect.ownKeys(t)}}class ct extends ot{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}}const at=new rt,lt=new ct,ut=new rt(!0),ht=new ct(!0),_t=t=>t,ft=t=>Reflect.getPrototypeOf(t);function pt(t,e,s=!1,n=!1){const i=zt(t=t.__v_raw),o=zt(e);s||(p(e,o)&&B(i,0,e),B(i,0,o));const{has:r}=ft(i),c=n?_t:s?Zt:Xt;return r.call(i,e)?c(t.get(e)):r.call(i,o)?c(t.get(o)):void(t!==i&&t.get(e))}function dt(t,e=!1){const s=this.__v_raw,n=zt(s),i=zt(t);return e||(p(t,i)&&B(n,0,t),B(n,0,i)),t===i?s.has(t):s.has(t)||s.has(i)}function Et(t,e=!1){return t=t.__v_raw,!e&&B(zt(t),0,G),Reflect.get(t,"size",t)}function Ot(t,e=!1){e||Bt(t)||Qt(t)||(t=zt(t));const s=zt(this);return ft(s).has.call(s,t)||(s.add(t),Y(s,"add",t,t)),this}function vt(t,e,s=!1){s||Bt(e)||Qt(e)||(e=zt(e));const n=zt(this),{has:i,get:o}=ft(n);let r=i.call(n,t);r||(t=zt(t),r=i.call(n,t));const c=o.call(n,t);return n.set(t,e),r?p(e,c)&&Y(n,"set",t,e):Y(n,"add",t,e),this}function gt(t){const e=zt(this),{has:s,get:n}=ft(e);let i=s.call(e,t);i||(t=zt(t),i=s.call(e,t)),n&&n.call(e,t);const o=e.delete(t);return i&&Y(e,"delete",t,void 0),o}function St(){const t=zt(this),e=0!==t.size,s=t.clear();return e&&Y(t,"clear",void 0,void 0),s}function Nt(t,e){return function(s,n){const i=this,o=i.__v_raw,r=zt(o),c=e?_t:t?Zt:Xt;return!t&&B(r,0,G),o.forEach(((t,e)=>s.call(n,c(t),c(e),i)))}}function At(t,e,s){return function(...n){const i=this.__v_raw,o=zt(i),r=c(o),a="entries"===t||t===Symbol.iterator&&r,l="keys"===t&&r,u=i[t](...n),h=s?_t:e?Zt:Xt;return!e&&B(o,0,l?F:G),{next(){const{value:t,done:e}=u.next();return e?{value:t,done:e}:{value:a?[h(t[0]),h(t[1])]:h(t),done:e}},[Symbol.iterator](){return this}}}}function Rt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Tt(){const t={get(t){return pt(this,t)},get size(){return Et(this)},has:dt,add:Ot,set:vt,delete:gt,clear:St,forEach:Nt(!1,!1)},e={get(t){return pt(this,t,!1,!0)},get size(){return Et(this)},has:dt,add(t){return Ot.call(this,t,!0)},set(t,e){return vt.call(this,t,e,!0)},delete:gt,clear:St,forEach:Nt(!1,!0)},s={get(t){return pt(this,t,!0)},get size(){return Et(this,!0)},has(t){return dt.call(this,t,!0)},add:Rt("add"),set:Rt("set"),delete:Rt("delete"),clear:Rt("clear"),forEach:Nt(!0,!1)},n={get(t){return pt(this,t,!0,!0)},get size(){return Et(this,!0)},has(t){return dt.call(this,t,!0)},add:Rt("add"),set:Rt("set"),delete:Rt("delete"),clear:Rt("clear"),forEach:Nt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{t[i]=At(i,!1,!1),s[i]=At(i,!0,!1),e[i]=At(i,!1,!0),n[i]=At(i,!0,!0)})),[t,s,e,n]}const[mt,bt,Dt,yt]=Tt();function xt(t,e){const s=e?t?yt:Dt:t?bt:mt;return(e,n,i)=>"__v_isReactive"===n?!t:"__v_isReadonly"===n?t:"__v_raw"===n?e:Reflect.get(o(s,n)&&n in e?s:e,n,i)}const Lt={get:xt(!1,!1)},It={get:xt(!1,!0)},Pt={get:xt(!0,!1)},wt={get:xt(!0,!0)},Ht=new WeakMap,Ut=new WeakMap,Ct=new WeakMap,kt=new WeakMap;function Mt(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>_(t).slice(8,-1))(t))}function jt(t){return Qt(t)?t:Gt(t,!1,at,Lt,Ht)}function Wt(t){return Gt(t,!1,ut,It,Ut)}function Vt(t){return Gt(t,!0,lt,Pt,Ct)}function Gt(t,e,s,n,i){if(!u(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const o=i.get(t);if(o)return o;const r=Mt(t);if(0===r)return t;const c=new Proxy(t,2===r?n:s);return i.set(t,c),c}function Ft(t){return Qt(t)?Ft(t.__v_raw):!(!t||!t.__v_isReactive)}function Qt(t){return!(!t||!t.__v_isReadonly)}function Bt(t){return!(!t||!t.__v_isShallow)}function Yt(t){return!!t&&!!t.__v_raw}function zt(t){const e=t&&t.__v_raw;return e?zt(e):t}const Xt=t=>u(t)?jt(t):t,Zt=t=>u(t)?Vt(t):t;function Jt(t){return!!t&&!0===t.__v_isRef}function Kt(t){return $t(t,!1)}function $t(t,e){return Jt(t)?t:new qt(t,e)}class qt{constructor(t,e){this.dep=new j,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:zt(t),this._value=e?t:Xt(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||Bt(t)||Qt(t);t=s?t:zt(t),p(t,e)&&(this._rawValue=t,this._value=s?t:Xt(t),this.dep.trigger())}}function te(t){return Jt(t)?t.value:t}const ee={get:(t,e,s)=>"__v_raw"===e?t:te(Reflect.get(t,e,s)),set:(t,e,s,n)=>{const i=t[e];return Jt(i)&&!Jt(s)?(i.value=s,!0):Reflect.set(t,e,s,n)}};class se{constructor(t){this.__v_isRef=!0,this._value=void 0;const e=this.dep=new j,{get:s,set:n}=t(e.track.bind(e),e.trigger.bind(e));this._get=s,this._set=n}get value(){return this._value=this._get()}set value(t){this._set(t)}}class ne{constructor(t,e,s){this._object=t,this._key=e,this._defaultValue=s,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=void 0===t?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return t=zt(this._object),e=this._key,null==(s=V.get(t))?void 0:s.get(e);var t,e,s}}class ie{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function oe(t,e,s){const n=t[e];return Jt(n)?n:new ne(t,e,s)}class re{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new j(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=k-1,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){if(this.flags|=16,!(8&this.flags)&&E!==this)return R(this),!0}get value(){const t=this.dep.track();return x(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}const ce={},ae=new WeakMap;let le;function ue(t,e=!1,s=le){if(s){let e=ae.get(s);e||ae.set(s,e=[]),e.push(t)}}function he(t,e=1/0,s){if(e<=0||!u(t)||t.__v_skip)return t;if((s=s||new Set).has(t))return t;if(s.add(t),e--,Jt(t))he(t.value,e,s);else if(r(t))for(let n=0;n<t.length;n++)he(t[n],e,s);else if("[object Set]"===_(t)||c(t))t.forEach((t=>{he(t,e,s)}));else if((t=>"[object Object]"===_(t))(t)){for(const n in t)he(t[n],e,s);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&he(t[n],e,s)}return t}const _e={},{isArray:fe}=Array,pe=Object.assign;function de(t,e){const s={};return Object.keys(t).forEach((n=>{e.includes(n)||(s[n]=t[n])})),s}function Ee(t){return Object.prototype.toString.call(t).slice(8,-1)}function Oe(t){return"function"==typeof t}function ve(t){return`__${t}__`}var ge;!function(t){t[t.QUEUED=1]="QUEUED",t[t.ALLOW_RECURSE=4]="ALLOW_RECURSE"}(ge||(ge={}));let Se=!1,Ne=!1;const Ae=[];let Re=0;const Te=[];let me=null,be=0;const De=Promise.resolve();let ye=null;function xe(t){t.flags&ge.QUEUED||(Ae.push(t),t.flags|=ge.QUEUED,Se||Ne||(Ne=!0,ye=De.then(Ie)))}function Le(){if(Te.length>0){for(me=[...new Set(Te)],Te.length=0,be=0;be<me.length;be++){const t=me[be];t.flags&ge.ALLOW_RECURSE&&(t.flags&=~ge.QUEUED),t(),t.flags&=~ge.QUEUED}me=null,be=0}}function Ie(t){Ne=!1,Se=!0;try{for(Re=0;Re<Ae.length;Re++){const t=Ae[Re];0,t.flags&ge.ALLOW_RECURSE&&(t.flags&=~ge.QUEUED),t(),t.flags&ge.ALLOW_RECURSE||(t.flags&=~ge.QUEUED)}}finally{for(;Re<Ae.length;Re++){Ae[Re].flags&=~ge.QUEUED}Re=0,Ae.length=0,Se=!1,ye=null}}function Pe(t,e,s){return we(t,e,s)}function we(t,n,i=_e){const{flush:o}=i,c=pe({},i);"post"===o?c.scheduler=t=>{!function(t){t.flags&ge.QUEUED||(Te.push(t),t.flags|=ge.QUEUED)}(t)}:"sync"!==o&&(c.scheduler=(t,e)=>{e?t():xe(t)}),c.augmentJob=t=>{n&&(t.flags|=ge.ALLOW_RECURSE)};const l=function(t,n,i=e){const{immediate:o,deep:c,once:l,scheduler:u,augmentJob:h,call:_}=i,f=t=>c?t:Bt(t)||!1===c||0===c?he(t,1):he(t);let d,E,O,g,N=!1,A=!1;if(Jt(t)?(E=()=>t.value,N=Bt(t)):Ft(t)?(E=()=>f(t),N=!0):r(t)?(A=!0,N=t.some((t=>Ft(t)||Bt(t))),E=()=>t.map((t=>Jt(t)?t.value:Ft(t)?f(t):a(t)?_?_(t,2):t():void 0))):E=a(t)?n?_?()=>_(t,2):t:()=>{if(O){H();try{O()}finally{U()}}const e=le;le=d;try{return _?_(t,3,[g]):t(g)}finally{le=e}}:s,n&&c){const t=E,e=!0===c?1/0:c;E=()=>he(t(),e)}const R=v(),T=()=>{d.stop(),R&&((t,e)=>{const s=t.indexOf(e);s>-1&&t.splice(s,1)})(R.effects,d)};if(l&&n){const t=n;n=(...e)=>{t(...e),T()}}let m=A?new Array(t.length).fill(ce):ce;const b=t=>{if(1&d.flags&&(d.dirty||t))if(n){const t=d.run();if(c||N||(A?t.some(((t,e)=>p(t,m[e]))):p(t,m))){O&&O();const e=le;le=d;try{const e=[t,m===ce?void 0:A&&m[0]===ce?[]:m,g];_?_(n,3,e):n(...e),m=t}finally{le=e}}}else d.run()};return h&&h(b),d=new S(E),d.scheduler=u?()=>u(b,!1):b,g=t=>ue(t,!1,d),O=d.onStop=()=>{const t=ae.get(d);if(t){if(_)_(t,4);else for(const e of t)e();ae.delete(d)}},n?o?b(!0):m=d.run():u?u(b.bind(null,!0),!0):d.run(),T.pause=d.pause.bind(d),T.resume=d.resume.bind(d),T.stop=T,T}(t,n,c);return l}const He=Object.create(null);let Ue=null,Ce=null,ke=null;function Me(){return Ce||ke}var je,We,Ve;function Ge(t,e){const s=t[e];return function(...t){const n=this[ve(e)];n&&n.forEach((e=>e(...t))),void 0!==s&&s.call(this,...t)}}function Fe(t){if(function(t){const e=new Set(["undefined","boolean","number","string"]);return null===t||e.has(typeof t)}(t)||Oe(t))return t;if(Jt(t))return Fe(t.value);if(Yt(t))return Fe(zt(t));if(fe(t))return t.map((t=>Fe(t)));if(function(t){return"Object"===Ee(t)}(t)){const e={};return Object.keys(t).forEach((s=>{e[s]=Fe(t[s])})),e}throw new TypeError(`${Ee(t)} value is not supported`)}function Qe(t,e){var s;null!==(s=e)&&"object"==typeof s&&Pe(Jt(e)?e:()=>e,(()=>{this.setData({[t]:Fe(e)},Le)}),{deep:!0})}function Be(t,e){const s=t[e];return function(...t){const n=this[ve(e)];n&&n.forEach((e=>e(...t))),void 0!==s&&s.call(this,...t)}}!function(t){t.ON_LAUNCH="onLaunch",t.ON_SHOW="onShow",t.ON_HIDE="onHide",t.ON_ERROR="onError",t.ON_PAGE_NOT_FOUND="onPageNotFound",t.ON_UNHANDLED_REJECTION="onUnhandledRejection",t.ON_THEME_CHANGE="onThemeChange"}(je||(je={})),function(t){t.ON_LOAD="onLoad",t.ON_SHOW="onShow",t.ON_READY="onReady",t.ON_HIDE="onHide",t.ON_UNLOAD="onUnload",t.ON_ROUTE_DONE="onRouteDone",t.ON_PULL_DOWN_REFRESH="onPullDownRefresh",t.ON_REACH_BOTTOM="onReachBottom",t.ON_PAGE_SCROLL="onPageScroll",t.ON_SHARE_APP_MESSAGE="onShareAppMessage",t.ON_SHARE_TIMELINE="onShareTimeline",t.ON_ADD_TO_FAVORITES="onAddToFavorites",t.ON_RESIZE="onResize",t.ON_TAB_ITEM_TAP="onTabItemTap",t.ON_SAVE_EXIT_STATE="onSaveExitState"}(We||(We={})),function(t){t.ATTACHED="attached",t.READY="ready",t.MOVED="moved",t.DETACHED="detached",t.ERROR="error"}(Ve||(Ve={}));const Ye={[We.ON_SHOW]:"show",[We.ON_HIDE]:"hide",[We.ON_RESIZE]:"resize",[We.ON_ROUTE_DONE]:"routeDone",[Ve.READY]:We.ON_READY};function ze(t,e){return Je(e,t.lifetimes[e]||t[e])}function Xe(t,e){return Je(e,t.methods[e])}function Ze(t,e){return Je(e,t.pageLifetimes[Ye[e]])}function Je(t,e){const s=ve(t);return function(...t){const n=this[s];n&&n.forEach((e=>e(...t))),void 0!==e&&e.call(this,...t)}}const Ke=ds(je.ON_SHOW),$e=ds(je.ON_HIDE),qe=ds(je.ON_ERROR),ts=ds(je.ON_PAGE_NOT_FOUND),es=ds(je.ON_UNHANDLED_REJECTION),ss=ds(je.ON_THEME_CHANGE),ns=Es(We.ON_SHOW),is=Es(We.ON_HIDE),os=Es(We.ON_UNLOAD),rs=Es(We.ON_ROUTE_DONE),cs=Es(We.ON_PULL_DOWN_REFRESH),as=Es(We.ON_REACH_BOTTOM),ls=Es(We.ON_RESIZE),us=Es(We.ON_TAB_ITEM_TAP),hs=Os(We.ON_LOAD),_s=Os(Ve.MOVED),fs=Os(Ve.DETACHED),ps=Os(Ve.ERROR);function ds(t){return e=>{Ue&&vs(Ue,t,e)}}function Es(t){return e=>{const s=Me();s&&vs(s,t,e)}}function Os(t){return e=>{ke&&vs(ke,t,e)}}function vs(t,e,s){const n=ve(e);void 0===t[n]&&(t[n]=[]),t[n].push(s)}exports.EffectScope=O,exports.ReactiveEffect=S,exports.TrackOpTypes={GET:"get",HAS:"has",ITERATE:"iterate"},exports.TriggerOpTypes={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},exports.computed=function(t,e,s=!1){let n,i;return a(t)?n=t:(n=t.get,i=t.set),new re(n,i,s)},exports.createApp=function(t){let e,s;if(Oe(t))e=t,s={};else{if(void 0===t.setup)return void App(t);e=t.setup,s=de(t,["setup"])}const n=s[je.ON_LAUNCH];s[je.ON_LAUNCH]=function(t){Ue=this;const s=e(t);void 0!==s&&Object.keys(s).forEach((t=>{this[t]=s[t]})),Ue=null,void 0!==n&&n.call(this,t)},s[je.ON_SHOW]=Ge(s,je.ON_SHOW),s[je.ON_HIDE]=Ge(s,je.ON_HIDE),s[je.ON_ERROR]=Ge(s,je.ON_ERROR),s[je.ON_PAGE_NOT_FOUND]=Ge(s,je.ON_PAGE_NOT_FOUND),s[je.ON_UNHANDLED_REJECTION]=Ge(s,je.ON_UNHANDLED_REJECTION),s[je.ON_THEME_CHANGE]=Ge(s,je.ON_THEME_CHANGE),App(s)},exports.customRef=function(t){return new se(t)},exports.defineComponent=function(t,e){let s,n;e=pe({listenPageScroll:!1,canShareToOthers:!1,canShareToTimeline:!1},e);let i=null;if(Oe(t))s=t,n={};else{if(void 0===t.setup)return Component(t);s=t.setup,n=de(t,["setup"]),n.properties&&(i=Object.keys(n.properties))}void 0===n.lifetimes&&(n.lifetimes={});const o=n.lifetimes[Ve.ATTACHED]||n[Ve.ATTACHED];n.lifetimes[Ve.ATTACHED]=function(){var t;this.__scope__=new O,ke=t=this,t.__scope__.on();const e={};i&&i.forEach((t=>{e[t]=this.data[t]})),this.__props__=Wt(e);const n={is:this.is,id:this.id,dataset:this.dataset,exitState:this.exitState,router:this.router,pageRouter:this.pageRouter,renderer:this.renderer,triggerEvent:this.triggerEvent.bind(this),createSelectorQuery:this.createSelectorQuery.bind(this),createIntersectionObserver:this.createIntersectionObserver.bind(this),createMediaQueryObserver:this.createMediaQueryObserver.bind(this),selectComponent:this.selectComponent.bind(this),selectAllComponents:this.selectAllComponents.bind(this),selectOwnerComponent:this.selectOwnerComponent.bind(this),getRelationNodes:this.getRelationNodes.bind(this),getTabBar:this.getTabBar.bind(this),getPageId:this.getPageId.bind(this),animate:this.animate.bind(this),clearAnimation:this.clearAnimation.bind(this),getOpenerEventChannel:this.getOpenerEventChannel.bind(this),applyAnimatedStyle:this.applyAnimatedStyle.bind(this),clearAnimatedStyle:this.clearAnimatedStyle.bind(this),setUpdatePerformanceListener:this.setUpdatePerformanceListener.bind(this),getPassiveEvent:this.getPassiveEvent.bind(this),setPassiveEvent:this.setPassiveEvent.bind(this)},r=s(this.__props__,n);if(void 0!==r){let t;Object.keys(r).forEach((e=>{const s=r[e];Oe(s)?this[e]=s:(t=t||{},t[e]=Fe(s),Qe.call(this,e,s))})),void 0!==t&&this.setData(t,Le)}ke&&ke.__scope__.off(),ke=null,void 0!==o&&o.call(this)};const r=ze(n,Ve.DETACHED);return n.lifetimes[Ve.DETACHED]=function(){r.call(this),this.__scope__.stop()},n.lifetimes[Ve.READY]=Je(Ye[Ve.READY],n.lifetimes[Ve.READY]||n[Ve.READY]),n.lifetimes[Ve.MOVED]=ze(n,Ve.MOVED),n.lifetimes[Ve.ERROR]=ze(n,Ve.ERROR),void 0===n.methods&&(n.methods={}),(n.methods[We.ON_PAGE_SCROLL]||e.listenPageScroll)&&(n.methods[We.ON_PAGE_SCROLL]=Xe(n,We.ON_PAGE_SCROLL),n.methods.__listenPageScroll__=()=>!0),void 0===n.methods[We.ON_SHARE_APP_MESSAGE]&&e.canShareToOthers&&(n.methods[We.ON_SHARE_APP_MESSAGE]=function(t){const e=this[ve(We.ON_SHARE_APP_MESSAGE)];return e?e(t):{}},n.methods.__isInjectedShareToOthersHook__=()=>!0),void 0===n.methods[We.ON_SHARE_TIMELINE]&&e.canShareToTimeline&&(n.methods[We.ON_SHARE_TIMELINE]=function(){const t=this[ve(We.ON_SHARE_TIMELINE)];return t?t():{}},n.methods.__isInjectedShareToTimelineHook__=()=>!0),void 0===n.methods[We.ON_ADD_TO_FAVORITES]&&(n.methods[We.ON_ADD_TO_FAVORITES]=function(t){const e=this[ve(We.ON_ADD_TO_FAVORITES)];return e?e(t):{}},n.methods.__isInjectedFavoritesHook__=()=>!0),void 0===n.methods[We.ON_SAVE_EXIT_STATE]&&(n.methods[We.ON_SAVE_EXIT_STATE]=function(){const t=this[ve(We.ON_SAVE_EXIT_STATE)];return t?t():{data:void 0}},n.methods.__isInjectedExitStateHook__=()=>!0),n.methods[We.ON_LOAD]=Xe(n,We.ON_LOAD),n.methods[We.ON_PULL_DOWN_REFRESH]=Xe(n,We.ON_PULL_DOWN_REFRESH),n.methods[We.ON_REACH_BOTTOM]=Xe(n,We.ON_REACH_BOTTOM),n.methods[We.ON_TAB_ITEM_TAP]=Xe(n,We.ON_TAB_ITEM_TAP),void 0===n.pageLifetimes&&(n.pageLifetimes={}),n.pageLifetimes[Ye[We.ON_SHOW]]=Ze(n,We.ON_SHOW),n.pageLifetimes[Ye[We.ON_HIDE]]=Ze(n,We.ON_HIDE),n.pageLifetimes[Ye[We.ON_RESIZE]]=Ze(n,We.ON_RESIZE),n.pageLifetimes[Ye[We.ON_ROUTE_DONE]]=Ze(n,We.ON_ROUTE_DONE),i&&(void 0===n.observers&&(n.observers={}),i.forEach((t=>{const e=n.observers[t];n.observers[t]=function(s){this.__props__&&(this.__props__[t]=s),void 0!==e&&e.call(this,s)}}))),Component(n)},exports.definePage=function(t,e){let s,n;if(e=pe({listenPageScroll:!1,canShareToOthers:!1,canShareToTimeline:!1},e),Oe(t))s=t,n={};else{if(void 0===t.setup)return void Page(t);s=t.setup,n=de(t,["setup"])}const i=n[We.ON_LOAD];n[We.ON_LOAD]=function(t){var e;this.__scope__=new O,Ce=e=this,e.__scope__.on();const n={is:this.is,route:this.route,options:this.options,exitState:this.exitState,router:this.router,pageRouter:this.pageRouter,renderer:this.renderer,createSelectorQuery:this.createSelectorQuery.bind(this),createIntersectionObserver:this.createIntersectionObserver.bind(this),createMediaQueryObserver:this.createMediaQueryObserver.bind(this),selectComponent:this.selectComponent.bind(this),selectAllComponents:this.selectAllComponents.bind(this),getTabBar:this.getTabBar.bind(this),getPageId:this.getPageId.bind(this),animate:this.animate.bind(this),clearAnimation:this.clearAnimation.bind(this),getOpenerEventChannel:this.getOpenerEventChannel.bind(this),applyAnimatedStyle:this.applyAnimatedStyle.bind(this),clearAnimatedStyle:this.clearAnimatedStyle.bind(this),setUpdatePerformanceListener:this.setUpdatePerformanceListener.bind(this),getPassiveEvent:this.getPassiveEvent.bind(this),setPassiveEvent:this.setPassiveEvent.bind(this)},o=s(t,n);if(void 0!==o){let t;Object.keys(o).forEach((e=>{const s=o[e];Oe(s)?this[e]=s:(t=t||{},t[e]=Fe(s),Qe.call(this,e,s))})),void 0!==t&&this.setData(t,Le)}Ce&&Ce.__scope__.off(),Ce=null,void 0!==i&&i.call(this,t)};const o=Be(n,We.ON_UNLOAD);n[We.ON_UNLOAD]=function(){o.call(this),this.__scope__.stop()},(n[We.ON_PAGE_SCROLL]||e.listenPageScroll)&&(n[We.ON_PAGE_SCROLL]=Be(n,We.ON_PAGE_SCROLL),n.__listenPageScroll__=()=>!0),void 0===n[We.ON_SHARE_APP_MESSAGE]&&e.canShareToOthers&&(n[We.ON_SHARE_APP_MESSAGE]=function(t){const e=this[ve(We.ON_SHARE_APP_MESSAGE)];return e?e(t):{}},n.__isInjectedShareToOthersHook__=()=>!0),void 0===n[We.ON_SHARE_TIMELINE]&&e.canShareToTimeline&&(n[We.ON_SHARE_TIMELINE]=function(){const t=this[ve(We.ON_SHARE_TIMELINE)];return t?t():{}},n.__isInjectedShareToTimelineHook__=()=>!0),void 0===n[We.ON_ADD_TO_FAVORITES]&&(n[We.ON_ADD_TO_FAVORITES]=function(t){const e=this[ve(We.ON_ADD_TO_FAVORITES)];return e?e(t):{}},n.__isInjectedFavoritesHook__=()=>!0),void 0===n[We.ON_SAVE_EXIT_STATE]&&(n[We.ON_SAVE_EXIT_STATE]=function(){const t=this[ve(We.ON_SAVE_EXIT_STATE)];return t?t():{data:void 0}},n.__isInjectedExitStateHook__=()=>!0),n[We.ON_SHOW]=Be(n,We.ON_SHOW),n[We.ON_READY]=Be(n,We.ON_READY),n[We.ON_HIDE]=Be(n,We.ON_HIDE),n[We.ON_ROUTE_DONE]=Be(n,We.ON_ROUTE_DONE),n[We.ON_PULL_DOWN_REFRESH]=Be(n,We.ON_PULL_DOWN_REFRESH),n[We.ON_REACH_BOTTOM]=Be(n,We.ON_REACH_BOTTOM),n[We.ON_RESIZE]=Be(n,We.ON_RESIZE),n[We.ON_TAB_ITEM_TAP]=Be(n,We.ON_TAB_ITEM_TAP),Page(n)},exports.effect=function(t,e){t.effect instanceof S&&(t=t.effect.fn);const s=new S(t);e&&n(s,e);try{s.run()}catch(t){throw s.stop(),t}const i=s.run.bind(s);return i.effect=s,i},exports.effectScope=function(t){return new O(t)},exports.getCurrentScope=v,exports.getCurrentWatcher=function(){return le},exports.inject=function(t,e,s=!1){return t in He?He[t]:arguments.length>1?s&&Oe(e)?e():e:void 0},exports.isProxy=Yt,exports.isReactive=Ft,exports.isReadonly=Qt,exports.isRef=Jt,exports.isShallow=Bt,exports.markRaw=function(t){return!o(t,"__v_skip")&&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},exports.nextTick=function(t){const e=ye||De;return t?e.then(t):e},exports.onAddToFavorites=t=>{const e=Me();if(e&&e.__isInjectedFavoritesHook__){const s=ve(We.ON_ADD_TO_FAVORITES);void 0===e[s]&&(e[s]=t)}},exports.onAppError=qe,exports.onAppHide=$e,exports.onAppShow=Ke,exports.onDetach=fs,exports.onError=ps,exports.onHide=is,exports.onLoad=hs,exports.onMove=_s,exports.onPageNotFound=ts,exports.onPageScroll=t=>{const e=Me();e&&e.__listenPageScroll__&&vs(e,We.ON_PAGE_SCROLL,t)},exports.onPullDownRefresh=cs,exports.onReachBottom=as,exports.onReady=t=>{const e=Me();e&&vs(e,We.ON_READY,t)},exports.onResize=ls,exports.onRouteDone=rs,exports.onSaveExitState=t=>{const e=Me();if(e&&e.__isInjectedExitStateHook__){const s=ve(We.ON_SAVE_EXIT_STATE);void 0===e[s]&&(e[s]=t)}},exports.onScopeDispose=function(t,e=!1){d&&d.cleanups.push(t)},exports.onShareAppMessage=t=>{const e=Me();if(e&&e[We.ON_SHARE_APP_MESSAGE]&&e.__isInjectedShareToOthersHook__){const s=ve(We.ON_SHARE_APP_MESSAGE);void 0===e[s]&&(e[s]=t)}},exports.onShareTimeline=t=>{const e=Me();if(e&&e[We.ON_SHARE_TIMELINE]&&e.__isInjectedShareToTimelineHook__){const s=ve(We.ON_SHARE_TIMELINE);void 0===e[s]&&(e[s]=t)}},exports.onShow=ns,exports.onTabItemTap=us,exports.onThemeChange=ss,exports.onUnhandledRejection=es,exports.onUnload=os,exports.onWatcherCleanup=ue,exports.provide=function(t,e){He[t]=e},exports.proxyRefs=function(t){return Ft(t)?t:new Proxy(t,ee)},exports.reactive=jt,exports.readonly=Vt,exports.ref=Kt,exports.shallowReactive=Wt,exports.shallowReadonly=function(t){return Gt(t,!0,ht,wt,kt)},exports.shallowRef=function(t){return $t(t,!0)},exports.stop=function(t){t.effect.stop()},exports.toRaw=zt,exports.toRef=function(t,e,s){return Jt(t)?t:a(t)?new ie(t):u(t)&&arguments.length>1?oe(t,e,s):Kt(t)},exports.toRefs=function(t){const e=r(t)?new Array(t.length):{};for(const s in t)e[s]=oe(t,s);return e},exports.toValue=function(t){return a(t)?t():te(t)},exports.triggerRef=function(t){t.dep&&t.dep.trigger()},exports.unref=te,exports.watch=Pe,exports.watchEffect=function(t,e){return we(t,null,e)},exports.watchPostEffect=function(t,e){return we(t,null,{flush:"post"})},exports.watchSyncEffect=function(t,e){return we(t,null,{flush:"sync"})};
|
package/dist/vue-mini.d.ts
CHANGED
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
/// <reference types="miniprogram-api-typings" />
|
|
2
|
-
import {
|
|
3
|
-
export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WritableComputedOptions, WritableComputedRef, computed, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
2
|
+
import { DebuggerOptions, WatchEffect, WatchHandle, WatchSource, WatchCallback, ReactiveMarker } from '@vue/reactivity';
|
|
3
|
+
export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WatchCallback, WatchEffect, WatchHandle, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, computed, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
4
4
|
|
|
5
|
-
type WatchEffect = (onCleanup: OnCleanup) => void;
|
|
6
|
-
type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
|
7
|
-
type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
8
5
|
type MaybeUndefined<T, I> = I extends true ? T | undefined : T;
|
|
9
6
|
type MapSources<T, Immediate> = {
|
|
10
7
|
[K in keyof T]: T[K] extends WatchSource<infer V> ? MaybeUndefined<V, Immediate> : T[K] extends object ? MaybeUndefined<T[K], Immediate> : never;
|
|
11
8
|
};
|
|
12
|
-
|
|
13
|
-
interface WatchOptionsBase extends DebuggerOptions {
|
|
9
|
+
interface WatchEffectOptions extends DebuggerOptions {
|
|
14
10
|
flush?: 'pre' | 'post' | 'sync';
|
|
15
11
|
}
|
|
16
|
-
interface WatchOptions<Immediate = boolean> extends
|
|
12
|
+
interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
|
17
13
|
immediate?: Immediate;
|
|
18
|
-
deep?: boolean;
|
|
14
|
+
deep?: boolean | number;
|
|
19
15
|
once?: boolean;
|
|
20
16
|
}
|
|
21
|
-
|
|
22
|
-
declare function
|
|
23
|
-
declare function
|
|
24
|
-
declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
17
|
+
declare function watchEffect(effect: WatchEffect, options?: WatchEffectOptions): WatchHandle;
|
|
18
|
+
declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
|
|
19
|
+
declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
|
|
25
20
|
type MultiWatchSources = Array<WatchSource<unknown> | object>;
|
|
26
|
-
declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>):
|
|
27
|
-
declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: readonly [...T] | T, cb: [T] extends [ReactiveMarker] ? WatchCallback<T, MaybeUndefined<T, Immediate>> : WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>):
|
|
28
|
-
declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>):
|
|
29
|
-
declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>):
|
|
21
|
+
declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
22
|
+
declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: readonly [...T] | T, cb: [T] extends [ReactiveMarker] ? WatchCallback<T, MaybeUndefined<T, Immediate>> : WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
23
|
+
declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
24
|
+
declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
30
25
|
|
|
31
26
|
declare function nextTick<R = void>(fn?: () => R): Promise<Awaited<R>>;
|
|
32
27
|
|
|
33
|
-
interface
|
|
28
|
+
interface InjectionConstraint<T> {
|
|
34
29
|
}
|
|
30
|
+
type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
35
31
|
declare function provide<T, K = InjectionKey<T> | string>(key: K, value: K extends InjectionKey<infer V> ? V : T): void;
|
|
36
32
|
declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
|
37
33
|
declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
|
@@ -105,4 +101,4 @@ declare const onMove: (hook: () => unknown) => void;
|
|
|
105
101
|
declare const onDetach: (hook: () => unknown) => void;
|
|
106
102
|
declare const onError: (hook: (error: WechatMiniprogram.Error) => unknown) => void;
|
|
107
103
|
|
|
108
|
-
export { type AppOptions, type AppSetup, type Bindings, type ComponentContext, type ComponentOptionsWithProps, type ComponentOptionsWithoutProps, type ComponentSetup, type Config, type InjectionKey, type PageContext, type PageOptions, type PageSetup, type Query, type
|
|
104
|
+
export { type AppOptions, type AppSetup, type Bindings, type ComponentContext, type ComponentOptionsWithProps, type ComponentOptionsWithoutProps, type ComponentSetup, type Config, type InjectionKey, type MultiWatchSources, type PageContext, type PageOptions, type PageSetup, type Query, type WatchOptions, type WatchEffectOptions as WatchOptionsBase, createApp, defineComponent, definePage, inject, nextTick, onAddToFavorites, onAppError, onAppHide, onAppShow, onDetach, onError, onHide, onLoad, onMove, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, provide, watch, watchEffect, watchPostEffect, watchSyncEffect };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-mini v1.
|
|
2
|
+
* vue-mini v1.1.1
|
|
3
3
|
* https://github.com/vue-mini/vue-mini
|
|
4
4
|
* (c) 2019-present Yang Mingshan
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, computed, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
7
|
+
import { watch as watch$1, isRef, isProxy, toRaw, EffectScope, shallowReactive, shallowReadonly } from '@vue/reactivity';
|
|
8
|
+
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, computed, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
9
9
|
|
|
10
|
+
const EMPTY_OBJ = (process.env.NODE_ENV !== 'production') ? Object.freeze({}) : /* istanbul ignore next -- @preserve */ {};
|
|
11
|
+
/* istanbul ignore next -- @preserve */
|
|
10
12
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
11
13
|
const NOOP = () => { };
|
|
12
14
|
const { isArray } = Array;
|
|
@@ -36,27 +38,16 @@ function isPlainObject(x) {
|
|
|
36
38
|
function isFunction(x) {
|
|
37
39
|
return typeof x === 'function';
|
|
38
40
|
}
|
|
39
|
-
function isMap(x) {
|
|
40
|
-
return getType(x) === 'Map';
|
|
41
|
-
}
|
|
42
|
-
function isSet(x) {
|
|
43
|
-
return getType(x) === 'Set';
|
|
44
|
-
}
|
|
45
|
-
// Compare whether a value has changed, accounting for NaN.
|
|
46
|
-
function hasChanged(value, oldValue) {
|
|
47
|
-
// eslint-disable-next-line no-self-compare
|
|
48
|
-
return value !== oldValue && (value === value || oldValue === oldValue);
|
|
49
|
-
}
|
|
50
|
-
function remove(arr, el) {
|
|
51
|
-
const i = arr.indexOf(el);
|
|
52
|
-
if (i > -1) {
|
|
53
|
-
arr.splice(i, 1);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
41
|
function toHiddenField(name) {
|
|
57
42
|
return `__${name}__`;
|
|
58
43
|
}
|
|
59
44
|
|
|
45
|
+
/* eslint-disable no-bitwise, unicorn/prefer-math-trunc, @typescript-eslint/prefer-literal-enum-member */
|
|
46
|
+
var SchedulerJobFlags;
|
|
47
|
+
(function (SchedulerJobFlags) {
|
|
48
|
+
SchedulerJobFlags[SchedulerJobFlags["QUEUED"] = 1] = "QUEUED";
|
|
49
|
+
SchedulerJobFlags[SchedulerJobFlags["ALLOW_RECURSE"] = 4] = "ALLOW_RECURSE";
|
|
50
|
+
})(SchedulerJobFlags || (SchedulerJobFlags = {}));
|
|
60
51
|
let isFlushing = false;
|
|
61
52
|
let isFlushPending = false;
|
|
62
53
|
const queue = [];
|
|
@@ -65,7 +56,7 @@ const pendingPostFlushCbs = [];
|
|
|
65
56
|
let activePostFlushCbs = null;
|
|
66
57
|
let postFlushIndex = 0;
|
|
67
58
|
// eslint-disable-next-line spaced-comment
|
|
68
|
-
const resolvedPromise =
|
|
59
|
+
const resolvedPromise = /*@__PURE__*/ Promise.resolve();
|
|
69
60
|
let currentFlushPromise = null;
|
|
70
61
|
const RECURSION_LIMIT = 100;
|
|
71
62
|
function nextTick(fn) {
|
|
@@ -74,15 +65,9 @@ function nextTick(fn) {
|
|
|
74
65
|
return fn ? p.then(fn) : p;
|
|
75
66
|
}
|
|
76
67
|
function queueJob(job) {
|
|
77
|
-
|
|
78
|
-
// by default the search index includes the current job that is being run
|
|
79
|
-
// so it cannot recursively trigger itself again.
|
|
80
|
-
// if the job is a watch() callback, the search will start with a +1 index to
|
|
81
|
-
// allow it recursively trigger itself - it is the user's responsibility to
|
|
82
|
-
// ensure it doesn't end up in an infinite loop.
|
|
83
|
-
if (queue.length === 0 ||
|
|
84
|
-
!queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) {
|
|
68
|
+
if (!(job.flags & SchedulerJobFlags.QUEUED)) {
|
|
85
69
|
queue.push(job);
|
|
70
|
+
job.flags |= SchedulerJobFlags.QUEUED;
|
|
86
71
|
queueFlush();
|
|
87
72
|
}
|
|
88
73
|
}
|
|
@@ -94,9 +79,9 @@ function queueFlush() {
|
|
|
94
79
|
}
|
|
95
80
|
}
|
|
96
81
|
function queuePostFlushCb(cb) {
|
|
97
|
-
if (!
|
|
98
|
-
!activePostFlushCbs.includes(cb, cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex)) {
|
|
82
|
+
if (!(cb.flags & SchedulerJobFlags.QUEUED)) {
|
|
99
83
|
pendingPostFlushCbs.push(cb);
|
|
84
|
+
cb.flags |= SchedulerJobFlags.QUEUED;
|
|
100
85
|
}
|
|
101
86
|
}
|
|
102
87
|
function flushPostFlushCbs() {
|
|
@@ -105,8 +90,11 @@ function flushPostFlushCbs() {
|
|
|
105
90
|
pendingPostFlushCbs.length = 0;
|
|
106
91
|
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
107
92
|
const cb = activePostFlushCbs[postFlushIndex];
|
|
108
|
-
if (cb.
|
|
109
|
-
cb
|
|
93
|
+
if (cb.flags & SchedulerJobFlags.ALLOW_RECURSE) {
|
|
94
|
+
cb.flags &= ~SchedulerJobFlags.QUEUED;
|
|
95
|
+
}
|
|
96
|
+
cb();
|
|
97
|
+
cb.flags &= ~SchedulerJobFlags.QUEUED;
|
|
110
98
|
}
|
|
111
99
|
activePostFlushCbs = null;
|
|
112
100
|
postFlushIndex = 0;
|
|
@@ -130,16 +118,25 @@ function flushJobs(seen) {
|
|
|
130
118
|
try {
|
|
131
119
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
132
120
|
const job = queue[flushIndex];
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
job
|
|
121
|
+
/* istanbul ignore if -- @preserve */
|
|
122
|
+
if ((process.env.NODE_ENV !== 'production') && check(job)) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (job.flags & SchedulerJobFlags.ALLOW_RECURSE) {
|
|
126
|
+
job.flags &= ~SchedulerJobFlags.QUEUED;
|
|
127
|
+
}
|
|
128
|
+
job();
|
|
129
|
+
if (!(job.flags & SchedulerJobFlags.ALLOW_RECURSE)) {
|
|
130
|
+
job.flags &= ~SchedulerJobFlags.QUEUED;
|
|
139
131
|
}
|
|
140
132
|
}
|
|
141
133
|
}
|
|
142
134
|
finally {
|
|
135
|
+
// If there was an error we still need to clear the QUEUED flags
|
|
136
|
+
for (; flushIndex < queue.length; flushIndex++) {
|
|
137
|
+
const job = queue[flushIndex];
|
|
138
|
+
job.flags &= ~SchedulerJobFlags.QUEUED;
|
|
139
|
+
}
|
|
143
140
|
flushIndex = 0;
|
|
144
141
|
queue.length = 0;
|
|
145
142
|
isFlushing = false;
|
|
@@ -173,8 +170,6 @@ function watchSyncEffect(effect, options) {
|
|
|
173
170
|
extend({}, options, { flush: 'sync' })
|
|
174
171
|
: /* istanbul ignore next -- @preserve */ { flush: 'sync' });
|
|
175
172
|
}
|
|
176
|
-
// Initial value for watchers to trigger on undefined initial values
|
|
177
|
-
const INITIAL_WATCHER_VALUE = {};
|
|
178
173
|
// Implementation
|
|
179
174
|
function watch(source, cb, options) {
|
|
180
175
|
if ((process.env.NODE_ENV !== 'production') && !isFunction(cb)) {
|
|
@@ -184,19 +179,8 @@ function watch(source, cb, options) {
|
|
|
184
179
|
}
|
|
185
180
|
return doWatch(source, cb, options);
|
|
186
181
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (cb && once) {
|
|
190
|
-
const _cb = cb;
|
|
191
|
-
cb = (...args) => {
|
|
192
|
-
_cb(...args);
|
|
193
|
-
unwatch();
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
if ((process.env.NODE_ENV !== 'production') && deep !== undefined && typeof deep === 'number') {
|
|
197
|
-
console.warn(`watch() "deep" option with number value will be used as watch depth in future versions. ` +
|
|
198
|
-
`Please use a boolean instead to avoid potential breakage.`);
|
|
199
|
-
}
|
|
182
|
+
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
183
|
+
const { immediate, deep, flush, once } = options;
|
|
200
184
|
if ((process.env.NODE_ENV !== 'production') && !cb) {
|
|
201
185
|
if (immediate !== undefined) {
|
|
202
186
|
console.warn(`watch() "immediate" option is only respected when using the ` +
|
|
@@ -211,193 +195,34 @@ function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger
|
|
|
211
195
|
`watch(source, callback, options?) signature.`);
|
|
212
196
|
}
|
|
213
197
|
}
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const reactiveGetter = (source) => deep === true ?
|
|
219
|
-
source // Traverse will happen in wrapped getter below
|
|
220
|
-
// For deep: false, only traverse root-level properties
|
|
221
|
-
: traverse(source, deep === false ? 1 : undefined);
|
|
222
|
-
let getter;
|
|
223
|
-
let forceTrigger = false;
|
|
224
|
-
let isMultiSource = false;
|
|
225
|
-
if (isRef(source)) {
|
|
226
|
-
getter = () => source.value;
|
|
227
|
-
forceTrigger = isShallow(source);
|
|
228
|
-
}
|
|
229
|
-
else if (isReactive(source)) {
|
|
230
|
-
getter = () => reactiveGetter(source);
|
|
231
|
-
forceTrigger = true;
|
|
232
|
-
}
|
|
233
|
-
else if (isArray(source)) {
|
|
234
|
-
isMultiSource = true;
|
|
235
|
-
forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
|
|
236
|
-
getter = () => source.map((s) => {
|
|
237
|
-
if (isRef(s)) {
|
|
238
|
-
return s.value;
|
|
239
|
-
}
|
|
240
|
-
if (isReactive(s)) {
|
|
241
|
-
return reactiveGetter(s);
|
|
242
|
-
}
|
|
243
|
-
if (isFunction(s)) {
|
|
244
|
-
return s();
|
|
245
|
-
}
|
|
246
|
-
/* istanbul ignore else -- @preserve */
|
|
247
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
248
|
-
warnInvalidSource(s);
|
|
249
|
-
}
|
|
250
|
-
return undefined;
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
else if (isFunction(source)) {
|
|
254
|
-
if (cb) {
|
|
255
|
-
// Getter with cb
|
|
256
|
-
getter = () => source();
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
// No cb -> simple effect
|
|
260
|
-
getter = () => {
|
|
261
|
-
if (cleanup) {
|
|
262
|
-
cleanup();
|
|
263
|
-
}
|
|
264
|
-
return source(onCleanup);
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
getter = NOOP;
|
|
270
|
-
/* istanbul ignore else -- @preserve */
|
|
271
|
-
if ((process.env.NODE_ENV !== 'production')) {
|
|
272
|
-
warnInvalidSource(source);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
if (cb && deep) {
|
|
276
|
-
const baseGetter = getter;
|
|
277
|
-
getter = () => traverse(baseGetter());
|
|
278
|
-
}
|
|
279
|
-
let cleanup;
|
|
280
|
-
const onCleanup = (fn) => {
|
|
281
|
-
// eslint-disable-next-line no-multi-assign
|
|
282
|
-
cleanup = effect.onStop = () => {
|
|
283
|
-
fn();
|
|
284
|
-
// eslint-disable-next-line no-multi-assign
|
|
285
|
-
cleanup = effect.onStop = undefined;
|
|
286
|
-
};
|
|
287
|
-
};
|
|
288
|
-
let oldValue = isMultiSource ?
|
|
289
|
-
Array.from({ length: source.length }).fill(INITIAL_WATCHER_VALUE)
|
|
290
|
-
: INITIAL_WATCHER_VALUE;
|
|
291
|
-
const job = () => {
|
|
292
|
-
if (!effect.active || !effect.dirty) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
if (cb) {
|
|
296
|
-
// Watch(source, cb)
|
|
297
|
-
const newValue = effect.run();
|
|
298
|
-
if (deep ||
|
|
299
|
-
forceTrigger ||
|
|
300
|
-
(isMultiSource ?
|
|
301
|
-
newValue.some((v, i) => hasChanged(v, oldValue[i]))
|
|
302
|
-
: hasChanged(newValue, oldValue))) {
|
|
303
|
-
// Cleanup before running cb again
|
|
304
|
-
if (cleanup) {
|
|
305
|
-
cleanup();
|
|
306
|
-
}
|
|
307
|
-
cb(newValue,
|
|
308
|
-
// Pass undefined as the old value when it's changed for the first time
|
|
309
|
-
oldValue === INITIAL_WATCHER_VALUE ? undefined
|
|
310
|
-
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? []
|
|
311
|
-
: oldValue, onCleanup);
|
|
312
|
-
oldValue = newValue;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
else {
|
|
316
|
-
// WatchEffect
|
|
317
|
-
effect.run();
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
// Important: mark the job as a watcher callback so that scheduler knows
|
|
321
|
-
// it is allowed to self-trigger
|
|
322
|
-
job.allowRecurse = Boolean(cb);
|
|
323
|
-
let scheduler;
|
|
324
|
-
if (flush === 'sync') {
|
|
325
|
-
scheduler = job; // The scheduler function gets called directly
|
|
326
|
-
}
|
|
327
|
-
else if (flush === 'post') {
|
|
328
|
-
scheduler = () => {
|
|
198
|
+
const baseWatchOptions = extend({}, options);
|
|
199
|
+
// Scheduler
|
|
200
|
+
if (flush === 'post') {
|
|
201
|
+
baseWatchOptions.scheduler = (job) => {
|
|
329
202
|
queuePostFlushCb(job);
|
|
330
203
|
};
|
|
331
204
|
}
|
|
332
|
-
else {
|
|
333
|
-
scheduler = () => {
|
|
334
|
-
|
|
205
|
+
else if (flush !== 'sync') {
|
|
206
|
+
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
207
|
+
if (isFirstRun) {
|
|
208
|
+
job();
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
queueJob(job);
|
|
212
|
+
}
|
|
335
213
|
};
|
|
336
214
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
if (
|
|
342
|
-
//
|
|
343
|
-
|
|
215
|
+
// @ts-expect-error
|
|
216
|
+
baseWatchOptions.augmentJob = (job) => {
|
|
217
|
+
// Important: mark the job as a watcher callback so that scheduler knows
|
|
218
|
+
// it is allowed to self-trigger
|
|
219
|
+
if (cb) {
|
|
220
|
+
// eslint-disable-next-line no-bitwise
|
|
221
|
+
job.flags |= SchedulerJobFlags.ALLOW_RECURSE;
|
|
344
222
|
}
|
|
345
223
|
};
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
effect.onTrack = onTrack;
|
|
349
|
-
effect.onTrigger = onTrigger;
|
|
350
|
-
}
|
|
351
|
-
// Initial run
|
|
352
|
-
if (cb) {
|
|
353
|
-
if (immediate) {
|
|
354
|
-
job();
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
oldValue = effect.run();
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
effect.run();
|
|
362
|
-
}
|
|
363
|
-
return unwatch;
|
|
364
|
-
}
|
|
365
|
-
function traverse(value, depth = Number.POSITIVE_INFINITY, seen) {
|
|
366
|
-
if (depth <= 0 || !isObject(value) || value[ReactiveFlags.SKIP]) {
|
|
367
|
-
return value;
|
|
368
|
-
}
|
|
369
|
-
seen = seen || new Set();
|
|
370
|
-
if (seen.has(value)) {
|
|
371
|
-
return value;
|
|
372
|
-
}
|
|
373
|
-
seen.add(value);
|
|
374
|
-
depth--;
|
|
375
|
-
/* istanbul ignore else -- @preserve */
|
|
376
|
-
if (isRef(value)) {
|
|
377
|
-
traverse(value.value, depth, seen);
|
|
378
|
-
}
|
|
379
|
-
else if (isArray(value)) {
|
|
380
|
-
for (let i = 0; i < value.length; i++) {
|
|
381
|
-
traverse(value[i], depth, seen);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
else if (isSet(value) || isMap(value)) {
|
|
385
|
-
value.forEach((v) => {
|
|
386
|
-
traverse(v, depth, seen);
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
else if (isPlainObject(value)) {
|
|
390
|
-
// eslint-disable-next-line guard-for-in
|
|
391
|
-
for (const key in value) {
|
|
392
|
-
traverse(value[key], depth, seen);
|
|
393
|
-
}
|
|
394
|
-
for (const key of Object.getOwnPropertySymbols(value)) {
|
|
395
|
-
if (Object.prototype.propertyIsEnumerable.call(value, key)) {
|
|
396
|
-
traverse(value[key], depth, seen);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
return value;
|
|
224
|
+
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
225
|
+
return watchHandle;
|
|
401
226
|
}
|
|
402
227
|
|
|
403
228
|
const provides = Object.create(null);
|
|
@@ -623,15 +448,20 @@ function definePage(optionsOrSetup, config) {
|
|
|
623
448
|
};
|
|
624
449
|
const bindings = setup(query, context);
|
|
625
450
|
if (bindings !== undefined) {
|
|
451
|
+
let data;
|
|
626
452
|
Object.keys(bindings).forEach((key) => {
|
|
627
453
|
const value = bindings[key];
|
|
628
454
|
if (isFunction(value)) {
|
|
629
455
|
this[key] = value;
|
|
630
456
|
return;
|
|
631
457
|
}
|
|
632
|
-
|
|
458
|
+
data = data || {};
|
|
459
|
+
data[key] = deepToRaw(value);
|
|
633
460
|
deepWatch.call(this, key, value);
|
|
634
461
|
});
|
|
462
|
+
if (data !== undefined) {
|
|
463
|
+
this.setData(data, flushPostFlushCbs);
|
|
464
|
+
}
|
|
635
465
|
}
|
|
636
466
|
unsetCurrentPage();
|
|
637
467
|
if (originOnLoad !== undefined) {
|
|
@@ -803,15 +633,20 @@ function defineComponent(optionsOrSetup, config) {
|
|
|
803
633
|
shallowReadonly(this.__props__)
|
|
804
634
|
: /* istanbul ignore next -- @preserve */ this.__props__, context);
|
|
805
635
|
if (bindings !== undefined) {
|
|
636
|
+
let data;
|
|
806
637
|
Object.keys(bindings).forEach((key) => {
|
|
807
638
|
const value = bindings[key];
|
|
808
639
|
if (isFunction(value)) {
|
|
809
640
|
this[key] = value;
|
|
810
641
|
return;
|
|
811
642
|
}
|
|
812
|
-
|
|
643
|
+
data = data || {};
|
|
644
|
+
data[key] = deepToRaw(value);
|
|
813
645
|
deepWatch.call(this, key, value);
|
|
814
646
|
});
|
|
647
|
+
if (data !== undefined) {
|
|
648
|
+
this.setData(data, flushPostFlushCbs);
|
|
649
|
+
}
|
|
815
650
|
}
|
|
816
651
|
unsetCurrentComponent();
|
|
817
652
|
if (originAttached !== undefined) {
|