wevu 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +202 -10
- package/dist/index.d.mts +202 -10
- package/dist/index.mjs +1 -1
- package/dist/jsx-runtime.cjs +0 -0
- package/dist/jsx-runtime.d.cts +586 -0
- package/dist/jsx-runtime.d.mts +586 -0
- package/dist/jsx-runtime.mjs +1 -0
- package/package.json +12 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Vue 3 风格的小程序运行时,复用同款响应式与调度器,通过
|
|
|
6
6
|
|
|
7
7
|
- `ref`/`reactive`/`computed`/`watch` 与 `nextTick` 同源于 Vue 3 的响应式核心
|
|
8
8
|
- `defineComponent` + `setup` 生命周期钩子(onShow/onPageScroll/onShareAppMessage 等)自动注册微信小程序 `Component`(在微信中可用于页面/组件)
|
|
9
|
-
- 快照 diff + 去重调度,最小化 `setData` 体积,支持 `bindModel` 的双向绑定语法
|
|
9
|
+
- 快照 diff + 去重调度,最小化 `setData` 体积,支持 `bindModel` / `useBindModel` 的双向绑定语法
|
|
10
10
|
- 插件、`app.config.globalProperties` 及小程序原生选项可自由组合
|
|
11
11
|
- 内置 `defineStore`/`storeToRefs`/`createStore`,支持 getters、actions、订阅与补丁
|
|
12
12
|
- TypeScript first,输出 ESM/CJS/types
|
|
@@ -108,6 +108,21 @@ counter.inc()
|
|
|
108
108
|
|
|
109
109
|
与 Vue 3 不同:小程序事件只有一个 `detail` 载荷,不支持 `emit(event, ...args)` 的多参数透传。
|
|
110
110
|
|
|
111
|
+
## 双向绑定(bindModel / useBindModel)
|
|
112
|
+
|
|
113
|
+
在 `setup(props, ctx)` 中使用 `ctx.bindModel()`;在 `<script setup>` 中使用 `useBindModel()`:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { useBindModel } from 'wevu'
|
|
117
|
+
|
|
118
|
+
const bindModel = useBindModel()
|
|
119
|
+
const titleModel = bindModel<string>('form.title').model({ event: 'change' })
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```vue
|
|
123
|
+
<t-input v-bind="titleModel" />
|
|
124
|
+
```
|
|
125
|
+
|
|
111
126
|
## 调度与适配
|
|
112
127
|
|
|
113
128
|
- 更新被批量加入微任务队列,`nextTick` 与 Vue 3 行为一致。
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=Promise.resolve(),t=new Set;let n=!1,r=!1;function i(){r=!1,n=!0;try{t.forEach(e=>e())}finally{t.clear(),n=!1}}function a(a){t.add(a),!n&&!r&&(r=!0,e.then(i))}function o(t){return t?e.then(t):e}const s=new WeakMap;let c=null;const l=[];let u=0;const d=new Set;function f(){u++}function p(){u!==0&&(u--,u===0&&h())}function m(e){f();try{return e()}finally{p()}}function h(){for(;d.size;){let e=Array.from(d);d.clear();for(let t of e)t()}}let g;var _=class{active=!0;effects=[];cleanups=[];parent;scopes;constructor(e=!1){this.detached=e,!e&&g&&(this.parent=g,(g.scopes||=[]).push(this))}run(e){if(!this.active)return;let t=g;g=this;try{return e()}finally{g=t}}stop(){if(this.active){this.active=!1;for(let e of this.effects)x(e);this.effects.length=0;for(let e of this.cleanups)e();if(this.cleanups.length=0,this.scopes){for(let e of this.scopes)e.stop();this.scopes.length=0}if(this.parent?.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0}}};function ee(e=!1){return new _(e)}function te(){return g}function v(e){g?.active&&g.cleanups.push(e)}function ne(e){g?.active&&g.effects.push(e)}function y(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function re(e,t={}){let n=function(){if(!n.active||n._running)return e();y(n);try{return n._running=!0,l.push(n),c=n,e()}finally{l.pop(),c=l[l.length-1]??null,n._running=!1}};return n.deps=[],n.scheduler=t.scheduler,n.onStop=t.onStop,n.active=!0,n._running=!1,n._fn=e,n}function b(e,t={}){let n=re(e,t);return ne(n),t.lazy||n(),n}function x(e){e.active&&(e.active=!1,y(e),e.onStop?.())}function S(e,t){if(!c)return;let n=s.get(e);n||(n=new Map,s.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),r.has(c)||(r.add(c),c.deps.push(r))}function C(e,t){let n=s.get(e);if(!n)return;let r=n.get(t);if(!r)return;let i=new Set;r.forEach(e=>{e!==c&&i.add(e)}),i.forEach(oe)}function ie(e){c&&(e.has(c)||(e.add(c),c.deps.push(e)))}function ae(e){new Set(e).forEach(oe)}function oe(e){if(e.scheduler){e.scheduler();return}if(u>0){d.add(e);return}e()}const se=new WeakMap,ce=new WeakMap,w=new WeakMap,T=new WeakMap,E=new WeakMap,D=new WeakMap,O=new WeakSet,k=new WeakMap,A=new WeakMap;function le(e){let t=A.get(e);return t||(t=new Set,A.set(e,t)),t}function j(e,t){le(e).add(t)}function M(e){T.set(e,(T.get(e)??0)+1)}function N(e){let t=G(e);return T.get(t)??0}function ue(e){let t=new Set,n=[e];for(let e=0;e<2e3&&n.length;e++){let e=n.pop(),r=D.get(e);if(r)for(let e of r.keys())t.has(e)||(t.add(e),M(e),n.push(e))}}const P=new Set;function de(e){P.add(e)}function fe(e){P.delete(e)}let F=function(e){return e.IS_REACTIVE=`__r_isReactive`,e.RAW=`__r_raw`,e.SKIP=`__r_skip`,e}({});function I(e){return typeof e==`object`&&!!e}const L=Symbol(`wevu.version`);function R(e){if(!e)return!1;let t=e.charCodeAt(0);if(t<48||t>57)return!1;let n=Number(e);return Number.isInteger(n)&&n>=0&&String(n)===e}function z(e,t,n){if(typeof n!=`string`){O.add(e),E.delete(e);return}if(P.size){let n=w.get(t)??t;j(n,t),j(n,e)}let r=D.get(e);r||(r=new Map,D.set(e,r));let i=r.get(t);i||(i=new Set,r.set(t,i)),i.add(n),B(e)}function pe(e,t,n){let r=D.get(e);if(!r)return;let i=r.get(t);i&&(i.delete(n),i.size||r.delete(t),r.size||D.delete(e),B(e))}function B(e){let t=D.get(e);if(!t){O.delete(e),E.delete(e);return}let n,r,i=0;for(let[e,a]of t){for(let t of a){if(i+=1,i>1)break;n=e,r=t}if(i>1)break}if(i===1&&n&&r){O.delete(e),E.set(e,{parent:n,key:r});return}O.add(e),E.delete(e)}function me(e,t){if(t===e)return[];if(O.has(t))return;let n=[],r=t;for(let t=0;t<2e3;t++){if(r===e)return n.reverse();if(O.has(r))return;let t=E.get(r);if(!t||typeof t.key!=`string`)return;n.push(t.key),r=t.parent}}function V(e,t,n){if(!P.size||typeof t!=`string`||t.startsWith(`__r_`))return;let r=w.get(e)??e,i=Array.isArray(e)&&(t===`length`||R(t))?`array`:`property`,a=me(r,e);if(!a){let a=new Set,o=D.get(e);if(o)for(let[e,t]of o){let n=k.get(e),i=n?n.split(`.`,1)[0]:void 0,o=i?void 0:me(r,e)?.[0];for(let e of t)typeof e==`string`&&a.add(i??o??e)}else a.add(t);for(let e of P)e({root:r,kind:i,op:n,path:void 0,fallbackTopKeys:a.size?Array.from(a):void 0});return}let o=a.findIndex(e=>R(e));if(o!==-1){let e=a.slice(0,o).join(`.`)||void 0;for(let t of P)t({root:r,kind:`array`,op:n,path:e});return}let s=a.length?a.join(`.`):``,c=i===`array`?s||void 0:s?`${s}.${t}`:t;for(let e of P)e({root:r,kind:i,op:n,path:c})}const H={get(e,t,n){if(t===F.IS_REACTIVE)return!0;if(t===F.RAW)return e;let r=Reflect.get(e,t,n);if(S(e,t),I(r)){if(r[F.SKIP])return r;let n=w.get(e)??e,i=r?.[F.RAW]??r;w.has(i)||w.set(i,n),z(i,e,t);let a=k.get(e);if(P.size&&typeof t==`string`&&a!=null&&!O.has(i)){let e=a?`${a}.${t}`:t;k.set(i,e)}return U(r)}return r},set(e,t,n,r){let i=Array.isArray(e),a=i?e.length:0,o=Reflect.get(e,t,r),s=Reflect.set(e,t,n,r);if(!Object.is(o,n)){let r=I(o)?o?.[F.RAW]??o:void 0;if(r&&pe(r,e,t),I(n)&&!n[F.SKIP]){let r=w.get(e)??e,i=n?.[F.RAW]??n;w.has(i)||w.set(i,r),z(i,e,t);let a=k.get(e);if(P.size&&typeof t==`string`&&a!=null&&!O.has(i)){let e=a?`${a}.${t}`:t;k.set(i,e)}}C(e,t),i&&typeof t==`string`&&R(t)&&Number(t)>=a&&C(e,`length`),C(e,L),M(e),ue(e);let s=w.get(e);s&&s!==e&&(C(s,L),M(s)),V(e,t,`set`)}return s},deleteProperty(e,t){let n=Object.prototype.hasOwnProperty.call(e,t),r=n?e[t]:void 0,i=Reflect.deleteProperty(e,t);if(n&&i){let n=I(r)?r?.[F.RAW]??r:void 0;n&&pe(n,e,t),C(e,t),C(e,L),M(e),ue(e);let i=w.get(e);i&&i!==e&&(C(i,L),M(i)),V(e,t,`delete`)}return i},ownKeys(e){return S(e,Symbol.iterator),S(e,L),Reflect.ownKeys(e)}};function U(e){if(!I(e))return e;let t=se.get(e);if(t)return t;if(e[F.IS_REACTIVE])return e;let n=new Proxy(e,H);return se.set(e,n),ce.set(n,e),T.has(e)||T.set(e,0),w.has(e)||w.set(e,e),n}function W(e){return!!(e&&e[F.IS_REACTIVE])}function G(e){return e?.[F.RAW]??e}function K(e){return I(e)?U(e):e}function he(e,t){let n=G(e);k.set(n,``),j(n,n);let r=t?.shouldIncludeTopKey,i=typeof t?.maxDepth==`number`?Math.max(0,Math.floor(t.maxDepth)):1/0,a=typeof t?.maxKeys==`number`?Math.max(0,Math.floor(t.maxKeys)):1/0,o=new WeakSet,s=[{current:n,path:``,depth:0}],c=0;for(;s.length;){let e=s.pop();if(o.has(e.current)||(o.add(e.current),k.set(e.current,e.path),j(n,e.current),c+=1,c>=a)||e.depth>=i||Array.isArray(e.current))continue;let t=Object.entries(e.current);for(let[i,a]of t){if(e.path===``&&r&&!r(i)||!I(a)||a[F.SKIP])continue;let t=G(a);if(w.has(t)||w.set(t,n),z(t,e.current,i),!O.has(t)){let n=e.path?`${e.path}.${i}`:i;k.set(t,n)}j(n,t),s.push({current:t,path:e.path?`${e.path}.${i}`:i,depth:e.depth+1})}}}function ge(e){let t=G(e),n=A.get(t);if(!n){k.delete(t);return}for(let e of n)E.delete(e),D.delete(e),k.delete(e),O.delete(e),w.delete(e),T.delete(e);A.delete(t)}function _e(e){S(G(e),L)}const q=new WeakMap,ve={get(e,t,n){if(t===F.IS_REACTIVE)return!0;if(t===F.RAW)return e;let r=Reflect.get(e,t,n);return S(e,t),r},set(e,t,n,r){let i=Reflect.get(e,t,r),a=Reflect.set(e,t,n,r);return Object.is(i,n)||(C(e,t),C(e,L),M(e)),a},deleteProperty(e,t){let n=Object.prototype.hasOwnProperty.call(e,t),r=Reflect.deleteProperty(e,t);return n&&r&&(C(e,t),C(e,L),M(e)),r},ownKeys(e){return S(e,Symbol.iterator),S(e,L),Reflect.ownKeys(e)}};function ye(e){if(!I(e))return e;let t=q.get(e);if(t)return t;if(e[F.IS_REACTIVE])return e;let n=new Proxy(e,ve);return q.set(e,n),ce.set(n,e),T.has(e)||T.set(e,0),n}function be(e){let t=G(e);return q.has(t)}function xe(e){return I(e)&&Object.defineProperty(e,F.SKIP,{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function Se(e){return I(e)&&F.SKIP in e}const Ce=`__v_isRef`;function we(e){try{Object.defineProperty(e,Ce,{value:!0,configurable:!0})}catch{e[Ce]=!0}return e}function J(e){return!!(e&&typeof e==`object`&&e[Ce]===!0)}var Te=class{_value;_rawValue;dep;constructor(e){we(this),this._rawValue=e,this._value=K(e)}get value(){return this.dep||=new Set,ie(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=K(e),this.dep&&ae(this.dep))}};function Ee(e){return J(e)?e:xe(new Te(e))}function De(e){return J(e)?e.value:e}var Oe=class{_getValue;_setValue;dep;constructor(e,t){we(this);let n=t,r=()=>{this.dep||=new Set,ie(this.dep)},i=()=>{this.dep&&ae(this.dep)},a=e=>e===void 0&&n!==void 0?n:e;if(typeof e==`function`){let t=e(r,i);this._getValue=()=>a(t.get()),this._setValue=e=>t.set(e);return}let o=e;this._getValue=()=>(r(),a(o.get())),this._setValue=e=>{o.set(e),i()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function ke(e,t){return xe(new Oe(e,t))}function Ae(e){let t,n;typeof e==`function`?(t=e,n=()=>{throw Error(`Computed value is readonly`)}):(t=e.get,n=e.set);let r,i=!0,a,o={get value(){return i&&=(r=a(),!1),S(o,`value`),r},set value(e){n(e)}};return we(o),a=b(t,{lazy:!0,scheduler:()=>{i||(i=!0,C(o,`value`))}}),o}function je(e){if(J(e)){let t=e;return we({get value(){return t.value},set value(e){throw Error(`Cannot assign to a readonly ref`)}})}return I(e)?new Proxy(e,{set(){throw Error(`Cannot set property on readonly object`)},deleteProperty(){throw Error(`Cannot delete property on readonly object`)},defineProperty(){throw Error(`Cannot define property on readonly object`)},get(e,t,n){return Reflect.get(e,t,n)}}):e}function Me(e,t){return ke((t,n)=>({get(){return t(),e},set(t){Object.is(e,t)||(e=t,n())}}),t)}function Ne(e){return J(e)&&typeof e.value!=`function`}function Pe(e){if(J(e)){let t=e.dep;if(t){ae(t);return}e.value=e.value}}function Fe(e){W(e)||console.warn(`toRefs() expects a reactive object but received a plain one.`);let t=Array.isArray(e)?Array.from({length:e.length}):{};for(let n in e)t[n]=Ie(e,n);return t}function Ie(e,t,n){let r=e[t];return J(r)?r:ke((n,r)=>({get(){return n(),e[t]},set(n){e[t]=n,r()}}),n)}function Le(e,t=new Set){if(!I(e)||t.has(e))return e;for(let n in t.add(e),e)Le(e[n],t);return e}let Re=`version`;function ze(e){Re=e}function Be(){return Re}function Ve(e,t,n={}){let r,i=W(e);if(typeof e==`function`)r=e;else if(J(e))r=()=>e.value;else if(i)r=()=>e;else throw Error(`Invalid watch source`);if(n.deep??i){let e=r;r=()=>{let t=e();return Re===`version`&&W(t)?(_e(t),t):Le(t)}}let o,s=e=>{o=e},c,l,u=()=>{if(!l.active)return;let e=l();o?.(),t(e,c,s),c=e};l=b(()=>r(),{scheduler:()=>a(u),lazy:!0}),n.immediate?u():c=l();let d=()=>{o?.(),o=void 0,x(l)};return v(d),d}function He(e){let t,n=e=>{t=e},r,i=()=>{r.active&&r()};r=b(()=>{t?.(),t=void 0,e(n)},{lazy:!0,scheduler:()=>a(i)}),r();let o=()=>{t?.(),t=void 0,x(r)};return v(o),o}function Ue(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}function We(e){return e?e.split(`.`).map(e=>e.trim()).filter(Boolean):[]}function Ge(e,t,n){let r=e[t];if(!r)throw Error(`Computed property "${t}" is readonly`);r(n)}function Ke(e){if(e==null)return e;if(typeof e==`object`){if(`detail`in e&&e.detail&&`value`in e.detail)return e.detail.value;if(`target`in e&&e.target&&`value`in e.target)return e.target.value}return e}function qe(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];(r[n]==null||typeof r[n]!=`object`)&&(r[n]={}),r=r[n]}r[t[t.length-1]]=n}function Je(e,t,n,r,i){if(!r.length)return;let[a,...o]=r;if(!o.length){if(t[a])Ge(n,a,i);else{let t=e[a];J(t)?t.value=i:e[a]=i}return}if(t[a]){Ge(n,a,i);return}(e[a]==null||typeof e[a]!=`object`)&&(e[a]={}),qe(e[a],o,i)}function Ye(e,t){return t.reduce((e,t)=>e==null?e:e[t],e)}function Xe(e){return Ke(e)}function Ze(e,t,n,r){return(i,a)=>{let o=We(i);if(!o.length)throw Error(`bindModel requires a non-empty path`);let s=()=>Ye(e,o),c=e=>{Je(t,n,r,o,e)},l={event:`input`,valueProp:`value`,parser:Xe,formatter:e=>e,...a};return{get value(){return s()},set value(e){c(e)},update(e){c(e)},model(e){let t={...l,...e},n=`on${Ue(t.event)}`,r={[t.valueProp]:t.formatter(s())};return r[n]=e=>{c(t.parser(e))},r}}}}const Qe=`__wevuDefaultsScope`;let $e={};function et(e){$e=it($e,e)}function tt(){$e={}}function nt(e){return at($e.app,e)}function rt(e){return at($e.component,e)}function it(e,t){return{app:ot(e.app,t.app),component:ot(e.component,t.component)}}function at(e,t){return ot(e,t)}function ot(e,t){if(!e)return t;if(!t)return e;let n={...e,...t},r=st(e.setData),i=st(t.setData);(r||i)&&(n.setData={...r??{},...i??{}});let a=st(e.options),o=st(t.options);return(a||o)&&(n.options={...a??{},...o??{}}),n}function st(e){if(!(!e||typeof e!=`object`||Array.isArray(e)))return e}const ct=Symbol(`wevu.noSetData`);function lt(e){return Object.defineProperty(e,ct,{value:!0,configurable:!0,enumerable:!1,writable:!1}),e}function ut(e){return typeof e==`object`&&!!e&&e[ct]===!0}function dt(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Y(e,t=new WeakMap,n){let r=De(e);if(typeof r==`bigint`){let e=Number(r);return Number.isSafeInteger(e)?e:r.toString()}if(typeof r==`symbol`)return r.toString();if(typeof r==`function`)return;if(typeof r!=`object`||!r)return r;if(ut(r))return;let i=W(r)?G(r):r,a=n?._depth??(typeof n?.maxDepth==`number`?Math.max(0,Math.floor(n.maxDepth)):1/0),o=n?._budget??(typeof n?.maxKeys==`number`?{keys:Math.max(0,Math.floor(n.maxKeys))}:{keys:1/0});if(a<=0||o.keys<=0)return i;let s=n?.cache;if(s){let e=N(i),t=s.get(i);if(t&&t.version===e)return t.value}if(t.has(i))return t.get(i);if(i instanceof Date)return i.getTime();if(i instanceof RegExp)return i.toString();if(i instanceof Map){let e=[];return t.set(i,e),i.forEach((n,r)=>{e.push([Y(r,t),Y(n,t)])}),e}if(i instanceof Set){let e=[];return t.set(i,e),i.forEach(n=>{e.push(Y(n,t))}),e}if(typeof ArrayBuffer<`u`){if(i instanceof ArrayBuffer)return i.byteLength;if(ArrayBuffer.isView(i)){let e=i;if(typeof e[Symbol.iterator]==`function`){let n=Array.from(e);return t.set(i,n),n.map(e=>Y(e,t))}let n=Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));return t.set(i,n),n}}if(i instanceof Error)return{name:i.name,message:i.message};if(Array.isArray(i)){let e=[];return t.set(i,e),i.forEach((r,i)=>{let s=Y(r,t,{...n,_depth:a-1,_budget:o});e[i]=s===void 0?null:s}),s&&s.set(i,{version:N(i),value:e}),e}let c={};return t.set(i,c),Object.keys(i).forEach(e=>{if(--o.keys,o.keys<=0)return;let r=Y(i[e],t,{...n,_depth:a-1,_budget:o});r!==void 0&&(c[e]=r)}),s&&s.set(i,{version:N(i),value:c}),c}function ft(e,t){return Object.is(e,t)?!0:Array.isArray(e)&&Array.isArray(t)?pt(e,t):dt(e)&&dt(t)?mt(e,t):!1}function pt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function mt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!ft(e[r],t[r]))return!1;return!0}function ht(e){return e===void 0?null:e}function gt(e,t,n,r){if(!ft(e,t)){if(dt(e)&&dt(t)){for(let i of Object.keys(t)){if(!Object.prototype.hasOwnProperty.call(e,i)){r[`${n}.${i}`]=ht(t[i]);continue}gt(e[i],t[i],`${n}.${i}`,r)}for(let i of Object.keys(e))Object.prototype.hasOwnProperty.call(t,i)||(r[`${n}.${i}`]=null);return}if(Array.isArray(e)&&Array.isArray(t)){pt(e,t)||(r[n]=ht(t));return}r[n]=ht(t)}}function _t(e,t){let n={};for(let r of Object.keys(t))gt(e[r],t[r],r,n);for(let r of Object.keys(e))Object.prototype.hasOwnProperty.call(t,r)||(n[r]=null);return n}let vt,yt;function bt(){return vt}function xt(e){vt=e}function St(){return yt}function Ct(e){yt=e}function X(e){if(!vt)throw Error(`${e}() must be called synchronously inside setup()`);return vt}function wt(e){return e.__wevuHooks||=Object.create(null),e.__wevuHooks}function Z(e,t,n,{single:r=!1}={}){let i=wt(e);r?i[t]=n:(i[t]??(i[t]=[])).push(n)}function Q(e,t,n=[]){let r=e.__wevuHooks;if(!r)return;let i=r[t];if(!i)return;let a=e.__wevu?.proxy??e;if(Array.isArray(i))for(let e of i)try{e.apply(a,n)}catch{}else if(typeof i==`function`)try{i.apply(a,n)}catch{}}function Tt(e,t,n=[]){let r=e.__wevuHooks;if(!r)return;let i=r[t];if(!i)return;let a=e.__wevu?.proxy??e;if(typeof i==`function`)try{return i.apply(a,n)}catch{return}if(Array.isArray(i)){let e;for(let t of i)try{e=t.apply(a,n)}catch{}return e}}function Et(e){Z(X(`onLaunch`),`onLaunch`,e)}function Dt(e){Z(X(`onPageNotFound`),`onPageNotFound`,e)}function Ot(e){Z(X(`onUnhandledRejection`),`onUnhandledRejection`,e)}function kt(e){Z(X(`onThemeChange`),`onThemeChange`,e)}function At(e){Z(X(`onShow`),`onShow`,e)}function jt(e){Z(X(`onLoad`),`onLoad`,e)}function Mt(e){Z(X(`onHide`),`onHide`,e)}function Nt(e){Z(X(`onUnload`),`onUnload`,e)}function Pt(e){Z(X(`onReady`),`onReady`,e)}function Ft(e){Z(X(`onPullDownRefresh`),`onPullDownRefresh`,e)}function It(e){Z(X(`onReachBottom`),`onReachBottom`,e)}function Lt(e){Z(X(`onPageScroll`),`onPageScroll`,e)}function Rt(e){Z(X(`onRouteDone`),`onRouteDone`,e)}function zt(e){Z(X(`onTabItemTap`),`onTabItemTap`,e)}function Bt(e){Z(X(`onResize`),`onResize`,e)}function Vt(e){Z(X(`onMoved`),`onMoved`,e)}function Ht(e){Z(X(`onError`),`onError`,e)}function Ut(e){Z(X(`onSaveExitState`),`onSaveExitState`,e,{single:!0})}function Wt(e){Z(X(`onShareAppMessage`),`onShareAppMessage`,e,{single:!0})}function Gt(e){Z(X(`onShareTimeline`),`onShareTimeline`,e,{single:!0})}function Kt(e){Z(X(`onAddToFavorites`),`onAddToFavorites`,e,{single:!0})}function qt(e){Z(X(`onMounted`),`onReady`,e)}function Jt(e){Z(X(`onUpdated`),`__wevuOnUpdated`,e)}function Yt(e){X(`onBeforeUnmount`),e()}function Xt(e){Z(X(`onUnmounted`),`onUnload`,e)}function Zt(e){X(`onBeforeMount`),e()}function Qt(e){Z(X(`onBeforeUpdate`),`__wevuOnBeforeUpdate`,e)}function $t(e){let t=X(`onErrorCaptured`);Z(t,`onError`,n=>e(n,t,``))}function en(e){Z(X(`onActivated`),`onShow`,e)}function tn(e){Z(X(`onDeactivated`),`onHide`,e)}function nn(e){X(`onServerPrefetch`)}function rn(e,t){Q(e,t===`before`?`__wevuOnBeforeUpdate`:`__wevuOnUpdated`)}const $=new Map;let an=0;function on(){return an+=1,`wv${an}`}function sn(e,t,n){let r=$.get(e)??{snapshot:{},proxy:n,subscribers:new Set};if(r.snapshot=t,r.proxy=n,$.set(e,r),r.subscribers.size)for(let e of r.subscribers)try{e(t,n)}catch{}}function cn(e){$.delete(e)}function ln(e,t){let n=$.get(e)??{snapshot:{},proxy:void 0,subscribers:new Set};return n.subscribers.add(t),$.set(e,n),()=>{let n=$.get(e);n&&n.subscribers.delete(t)}}function un(e){return $.get(e)?.proxy}function dn(e){return $.get(e)?.snapshot}function fn(e,t,n){try{t.state.__wvOwnerId=n}catch{}try{e.__wvOwnerId=n}catch{}let r=typeof t.snapshot==`function`?t.snapshot():{},i=e.__wevuProps??e.properties;if(i&&typeof i==`object`)for(let[e,t]of Object.entries(i))r[e]=t;sn(n,r,t.proxy)}function pn(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function mn(e,t,n){let r=typeof t==`string`?t:void 0;if(!r)return;let i=(n?.currentTarget)?.dataset?.wvArgs??(n?.target)?.dataset?.wvArgs,a=[];if(typeof i==`string`)try{a=JSON.parse(i)}catch{try{a=JSON.parse(pn(i))}catch{a=[]}}Array.isArray(a)||(a=[]);let o=a.map(e=>e===`$event`?n:e),s=e?.[r];if(typeof s==`function`)return s.apply(e,o)}function hn(e){let t=e.__wevu,n=e.__wvOwnerId;if(!t||!n||typeof t.snapshot!=`function`)return;let r=t.snapshot(),i=e.__wevuProps??e.properties;if(i&&typeof i==`object`)for(let[e,t]of Object.entries(i))r[e]=t;sn(n,r,t.proxy)}function gn(e,t,n){if(typeof e!=`function`)return;let r=n?.runtime??{methods:Object.create(null),state:{},proxy:{},watch:()=>()=>{},bindModel:()=>{}};n&&(n.runtime=r);let i={...n??{},runtime:r};return e.length>=2?e(t,i):e(i)}function _n(e,t,n){if(typeof e==`function`)return{handler:e.bind(t.proxy),options:{}};if(typeof e==`string`){let r=t.methods?.[e]??n[e];return typeof r==`function`?{handler:r.bind(t.proxy),options:{}}:void 0}if(!e||typeof e!=`object`)return;let r=_n(e.handler,t,n);if(!r)return;let i={...r.options};return e.immediate!==void 0&&(i.immediate=e.immediate),e.deep!==void 0&&(i.deep=e.deep),{handler:r.handler,options:i}}function vn(e,t){let n=t.split(`.`).map(e=>e.trim()).filter(Boolean);return n.length?()=>{let t=e;for(let e of n){if(t==null)return t;t=t[e]}return t}:()=>e}function yn(e,t,n){let r=[],i=e.proxy;for(let[a,o]of Object.entries(t)){let t=_n(o,e,n);if(!t)continue;let s=vn(i,a),c=e.watch(s,t.handler,t.options);r.push(c)}return r}function bn(e,t,n,r,i){if(e.__wevu)return e.__wevu;let a=on(),o=i?.deferSetData?(e=>{let t,n=!1,r={setData(r){if(!n){t={...t??{},...r};return}if(typeof e.setData==`function`)return e.setData(r)}};return r.__wevu_enableSetData=()=>{if(n=!0,t&&Object.keys(t).length&&typeof e.setData==`function`){let n=t;t=void 0,e.setData(n)}},r})(e):{setData(t){if(typeof e.setData==`function`)return e.setData(t)}},s,c=()=>{if(!s||typeof s.snapshot!=`function`)return;let t=s.snapshot(),n=e.__wevuProps??e.properties;if(n&&typeof n==`object`)for(let[e,r]of Object.entries(n))t[e]=r;sn(a,t,s.proxy)},l={...o,setData(e){let t=o.setData(e);return c(),t}},u=t.mount({...l});s=u;let d=u?.proxy??{},f=u?.state??{};if(!u?.methods)try{u.methods=Object.create(null)}catch{}let p=u?.methods??Object.create(null),m=u?.watch??(()=>()=>{}),h=u?.bindModel??(()=>{}),g={...u??{},state:f,proxy:d,methods:p,watch:m,bindModel:h};if(Object.defineProperty(e,`$wevu`,{value:g,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=g,fn(e,g,a),n){let t=yn(g,n,e);t.length&&(e.__wevuWatchStops=t)}if(r){let t=ye({...e.properties||{}});try{Object.defineProperty(e,`__wevuProps`,{value:t,configurable:!0,enumerable:!1,writable:!1})}catch{e.__wevuProps=t}let n={props:t,runtime:g,state:f,proxy:d,bindModel:h.bind(g),watch:m.bind(g),instance:e,emit:(t,n,r)=>{typeof e.triggerEvent==`function`&&e.triggerEvent(t,n,r)},expose:t=>{e.__wevuExposed=t},attrs:{},slots:Object.create(null)};xt(e),Ct(n);try{let e=gn(r,t,n);e&&typeof e==`object`&&Object.keys(e).forEach(t=>{let n=e[t];typeof n==`function`?u.methods[t]=(...e)=>n.apply(u.proxy,e):u.state[t]=n})}finally{Ct(void 0),xt(void 0)}}try{let t=u.methods;for(let n of Object.keys(t))typeof e[n]!=`function`&&(e[n]=function(...e){let t=this.$wevu?.methods?.[n];if(typeof t==`function`)return t.apply(this.$wevu.proxy,e)})}catch{}return u}function xn(e){let t=e.__wevu?.adapter;t&&typeof t.__wevu_enableSetData==`function`&&t.__wevu_enableSetData()}function Sn(e){let t=e.__wevu,n=e.__wvOwnerId;n&&cn(n),t&&e.__wevuHooks&&Q(e,`onUnload`,[]),e.__wevuHooks&&=void 0;let r=e.__wevuWatchStops;if(Array.isArray(r))for(let e of r)try{e()}catch{}e.__wevuWatchStops=void 0,t&&t.unmount(),delete e.__wevu,`$wevu`in e&&delete e.$wevu}function Cn(e,t,n,r,i){if(typeof App!=`function`)throw TypeError(`createApp requires the global App constructor to be available`);let a=Object.keys(t??{}),o={...i};o.globalData=o.globalData??{},o.__weapp_vite_inline||=function(e){let t=e?.currentTarget?.dataset?.wvHandler??e?.target?.dataset?.wvHandler;return mn(this.__wevu?.proxy??this,t,e)};let s=o.onLaunch;o.onLaunch=function(...t){bn(this,e,n,r),Q(this,`onLaunch`,t),typeof s==`function`&&s.apply(this,t)};let c=o.onShow;o.onShow=function(...e){Q(this,`onShow`,e),typeof c==`function`&&c.apply(this,e)};let l=o.onHide;o.onHide=function(...e){Q(this,`onHide`,e),typeof l==`function`&&l.apply(this,e)};let u=o.onError;o.onError=function(...e){Q(this,`onError`,e),typeof u==`function`&&u.apply(this,e)};let d=o.onPageNotFound;o.onPageNotFound=function(...e){Q(this,`onPageNotFound`,e),typeof d==`function`&&d.apply(this,e)};let f=o.onUnhandledRejection;o.onUnhandledRejection=function(...e){Q(this,`onUnhandledRejection`,e),typeof f==`function`&&f.apply(this,e)};let p=o.onThemeChange;o.onThemeChange=function(...e){Q(this,`onThemeChange`,e),typeof p==`function`&&p.apply(this,e)};for(let e of a){let t=o[e];o[e]=function(...n){let r=this.__wevu,i,a=r?.methods?.[e];return a&&(i=a.apply(r.proxy,n)),typeof t==`function`?t.apply(this,n):i}}App(o)}function wn(e,t,n,r,i){let{methods:a={},lifetimes:o={},pageLifetimes:s={},options:c={},...l}=i,u=l.onLoad,d=l.onUnload,f=l.onShow,p=l.onHide,m=l.onReady,h=l.onSaveExitState,g=l.onPullDownRefresh,_=l.onReachBottom,ee=l.onPageScroll,te=l.onRouteDone,v=l.onTabItemTap,ne=l.onResize,y=l.onShareAppMessage,re=l.onShareTimeline,b=l.onAddToFavorites,x=l.features??{},S={...l},C=S.observers,ie=S.created;delete S.features,delete S.created,delete S.onLoad,delete S.onUnload,delete S.onShow,delete S.onHide,delete S.onReady;let ae=typeof g==`function`||!!x.enableOnPullDownRefresh,oe=typeof _==`function`||!!x.enableOnReachBottom,se=typeof ee==`function`||!!x.enableOnPageScroll,ce=typeof te==`function`||!!x.enableOnRouteDone,w=typeof v==`function`||!!x.enableOnTabItemTap,T=typeof ne==`function`||!!x.enableOnResize,E=typeof y==`function`||!!x.enableOnShareAppMessage,D=typeof re==`function`||!!x.enableOnShareTimeline,O=typeof b==`function`||!!x.enableOnAddToFavorites,k=typeof h==`function`||!!x.enableOnSaveExitState,A=()=>{},le=()=>({}),j=()=>({}),M=typeof h==`function`?h:(()=>({data:void 0})),N=typeof g==`function`?g:A,ue=typeof _==`function`?_:A,P=typeof ee==`function`?ee:A,de=typeof te==`function`?te:A,fe=typeof v==`function`?v:A,F=typeof ne==`function`?ne:A,I=typeof y==`function`?y:le,L=typeof re==`function`?re:j,R=typeof b==`function`?b:(()=>({})),z=(e,t)=>{let n=e.__wevuHooks;if(!n)return!1;let r=n[t];return r?Array.isArray(r)?r.length>0:typeof r==`function`:!1};{let e=S.export;S.export=function(){let t=this.__wevuExposed??{},n=typeof e==`function`?e.call(this):{};return n&&typeof n==`object`&&!Array.isArray(n)?{...t,...n}:n??t}}let pe={multipleSlots:c.multipleSlots??!0,...c},B=e=>{let t=e.__wevuProps,n=e.properties;if(!t||typeof t!=`object`||!n||typeof n!=`object`)return;let r=n,i=Object.keys(t);for(let e of i)if(!Object.prototype.hasOwnProperty.call(r,e))try{delete t[e]}catch{}for(let[e,n]of Object.entries(r))try{t[e]=n}catch{}hn(e)},me=(e,t,n)=>{let r=e.__wevuProps;if(!(!r||typeof r!=`object`)){try{r[t]=n}catch{}hn(e)}},V=S.properties&&typeof S.properties==`object`?Object.keys(S.properties):[],H={};if(V.length)for(let e of V)H[e]=function(t){me(this,e,t)};let U={...C??{}};for(let[e,t]of Object.entries(H)){let n=U[e];typeof n==`function`?U[e]=function(...e){n.apply(this,e),t.apply(this,e)}:U[e]=t}let W={...a};W.__weapp_vite_inline||=function(e){let t=e?.currentTarget?.dataset?.wvHandler??e?.target?.dataset?.wvHandler;return mn(this.__wevu?.proxy??this,t,e)},W.__weapp_vite_model||=function(e){let t=e?.currentTarget?.dataset?.wvModel??e?.target?.dataset?.wvModel;if(typeof t!=`string`||!t)return;let n=this.__wevu;if(!n||typeof n.bindModel!=`function`)return;let r=Ke(e);try{n.bindModel(t).update(r)}catch{}},!W.__weapp_vite_owner&&typeof t?.__weapp_vite_owner==`function`&&(W.__weapp_vite_owner=t.__weapp_vite_owner);let G=Object.keys(t??{});for(let e of G){let t=W[e];W[e]=function(...n){let r=this.__wevu,i,a=r?.methods?.[e];return a&&(i=a.apply(r.proxy,n)),typeof t==`function`?t.apply(this,n):i}}let K={onLoad(...t){if(bn(this,e,n,r),xn(this),Q(this,`onLoad`,t),typeof u==`function`)return u.apply(this,t)},onUnload(...e){if(Sn(this),typeof d==`function`)return d.apply(this,e)},onShow(...e){if(Q(this,`onShow`,e),typeof f==`function`)return f.apply(this,e)},onHide(...e){if(Q(this,`onHide`,e),typeof p==`function`)return p.apply(this,e)},onReady(...e){if(this.__wevuReadyCalled||(this.__wevuReadyCalled=!0,Q(this,`onReady`,e)),typeof m==`function`)return m.apply(this,e)}};k&&(K.onSaveExitState=function(...e){let t=Tt(this,`onSaveExitState`,e);return t===void 0?M.apply(this,e):t}),ae&&(K.onPullDownRefresh=function(...e){if(Q(this,`onPullDownRefresh`,e),!z(this,`onPullDownRefresh`))return N.apply(this,e)}),oe&&(K.onReachBottom=function(...e){if(Q(this,`onReachBottom`,e),!z(this,`onReachBottom`))return ue.apply(this,e)}),se&&(K.onPageScroll=function(...e){if(Q(this,`onPageScroll`,e),!z(this,`onPageScroll`))return P.apply(this,e)}),ce&&(K.onRouteDone=function(...e){if(Q(this,`onRouteDone`,e),!z(this,`onRouteDone`))return de.apply(this,e)}),w&&(K.onTabItemTap=function(...e){if(Q(this,`onTabItemTap`,e),!z(this,`onTabItemTap`))return fe.apply(this,e)}),T&&(K.onResize=function(...e){if(Q(this,`onResize`,e),!z(this,`onResize`))return F.apply(this,e)}),E&&(K.onShareAppMessage=function(...e){let t=Tt(this,`onShareAppMessage`,e);return t===void 0?I.apply(this,e):t}),D&&(K.onShareTimeline=function(...e){let t=Tt(this,`onShareTimeline`,e);return t===void 0?L.apply(this,e):t}),O&&(K.onAddToFavorites=function(...e){let t=Tt(this,`onAddToFavorites`,e);return t===void 0?R.apply(this,e):t}),Component({...S,...K,observers:U,lifetimes:{...o,created:function(...t){bn(this,e,n,r,{deferSetData:!0}),B(this),typeof ie==`function`&&ie.apply(this,t),typeof o.created==`function`&&o.created.apply(this,t)},moved:function(...e){Q(this,`onMoved`,e),typeof o.moved==`function`&&o.moved.apply(this,e)},attached:function(...t){bn(this,e,n,r),B(this),xn(this),typeof o.attached==`function`&&o.attached.apply(this,t)},ready:function(...e){this.__wevuReadyCalled||(this.__wevuReadyCalled=!0,B(this),Q(this,`onReady`,e)),typeof o.ready==`function`&&o.ready.apply(this,e)},detached:function(...e){Sn(this),typeof o.detached==`function`&&o.detached.apply(this,e)},error:function(...e){Q(this,`onError`,e),typeof o.error==`function`&&o.error.apply(this,e)}},pageLifetimes:{...s,show:function(...e){Q(this,`onShow`,e),typeof s.show==`function`&&s.show.apply(this,e)},hide:function(...e){Q(this,`onHide`,e),typeof s.hide==`function`&&s.hide.apply(this,e)},resize:function(...e){Q(this,`onResize`,e),typeof s.resize==`function`&&s.resize.apply(this,e)}},methods:W,options:pe})}function Tn(e){let{[Qe]:t,data:n,computed:r,methods:i,setData:o,watch:s,setup:c,...l}=e[Qe]===`component`?e:nt(e),u=i??{},d=r??{},f=new Set,p={globalProperties:{}},m={mount(e){let t=U((n??(()=>({})))()),r=d,i=u,s=Object.create(null),c=Object.create(null),l={},f=!0,m={},h=[],g=o?.includeComputed??!0,_=o?.strategy??`diff`,ee=typeof o?.maxPatchKeys==`number`?Math.max(0,o.maxPatchKeys):1/0,te=typeof o?.maxPayloadBytes==`number`?Math.max(0,o.maxPayloadBytes):1/0,v=typeof o?.mergeSiblingThreshold==`number`?Math.max(2,Math.floor(o.mergeSiblingThreshold)):0,ne=typeof o?.mergeSiblingMaxInflationRatio==`number`?Math.max(0,o.mergeSiblingMaxInflationRatio):1.25,y=typeof o?.mergeSiblingMaxParentBytes==`number`?Math.max(0,o.mergeSiblingMaxParentBytes):1/0,re=o?.mergeSiblingSkipArray??!0,ie=o?.computedCompare??(_===`patch`?`deep`:`reference`),ae=typeof o?.computedCompareMaxDepth==`number`?Math.max(0,Math.floor(o.computedCompareMaxDepth)):4,oe=typeof o?.computedCompareMaxKeys==`number`?Math.max(0,Math.floor(o.computedCompareMaxKeys)):200,se=o?.prelinkMaxDepth,ce=o?.prelinkMaxKeys,w=o?.debug,T=o?.debugWhen??`fallback`,E=typeof o?.debugSampleRate==`number`?Math.min(1,Math.max(0,o.debugSampleRate)):1,D=typeof o?.elevateTopKeyThreshold==`number`?Math.max(0,Math.floor(o.elevateTopKeyThreshold)):1/0,O=typeof o?.toPlainMaxDepth==`number`?Math.max(0,Math.floor(o.toPlainMaxDepth)):1/0,k=typeof o?.toPlainMaxKeys==`number`?Math.max(0,Math.floor(o.toPlainMaxKeys)):1/0,A=Array.isArray(o?.pick)&&o.pick.length>0?new Set(o.pick):void 0,le=Array.isArray(o?.omit)&&o.omit.length>0?new Set(o.omit):void 0,j=e=>!(A&&!A.has(e)||le&&le.has(e)),M=new Set,N=(e,t,n)=>{let r,i=!0,a,o={get value(){return i&&=(r=a(),!1),S(o,`value`),r},set value(e){if(!n)throw Error(`Computed value is readonly`);n(e)}};return we(o),a=b(t,{lazy:!0,scheduler:()=>{i||(i=!0,_===`patch`&&g&&M.add(e),C(o,`value`))}}),o},ue=new Proxy({},{get(e,t){if(typeof t==`string`&&s[t])return s[t].value},has(e,t){return typeof t==`string`&&!!s[t]},ownKeys(){return Object.keys(s)},getOwnPropertyDescriptor(e,t){if(typeof t==`string`&&s[t])return{configurable:!0,enumerable:!0,value:s[t].value}}}),P=new Proxy(t,{get(e,n,r){if(typeof n==`string`){if(n===`$state`)return t;if(n===`$computed`)return ue;if(Object.prototype.hasOwnProperty.call(l,n))return l[n];if(s[n])return s[n].value;if(Object.prototype.hasOwnProperty.call(p.globalProperties,n))return p.globalProperties[n]}return Reflect.get(e,n,r)},set(e,t,n,r){return typeof t==`string`&&s[t]?(Ge(c,t,n),!0):Reflect.set(e,t,n,r)},has(e,t){return typeof t==`string`&&(s[t]||Object.prototype.hasOwnProperty.call(l,t))?!0:Reflect.has(e,t)},ownKeys(e){let t=new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Object.keys(l).forEach(e=>t.add(e)),Object.keys(s).forEach(e=>t.add(e)),Array.from(t)},getOwnPropertyDescriptor(e,t){if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);if(typeof t==`string`){if(s[t])return{configurable:!0,enumerable:!0,get(){return s[t].value},set(e){Ge(c,t,e)}};if(Object.prototype.hasOwnProperty.call(l,t))return{configurable:!0,enumerable:!1,value:l[t]}}}});Object.keys(i).forEach(e=>{let t=i[e];typeof t==`function`&&(l[e]=(...e)=>t.apply(P,e))}),Object.keys(r).forEach(e=>{let t=r[e];if(typeof t==`function`)s[e]=N(e,()=>t.call(P));else{let n=t.get?.bind(P);if(!n)throw Error(`Computed property "${e}" requires a getter`);let r=t.set?.bind(P);r?(c[e]=r,s[e]=N(e,n,r)):s[e]=N(e,n)}});let F=e??{setData:()=>{}},I=new WeakMap,L=e=>e===void 0?null:e,R=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},z=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(R(e)&&R(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}return!1},pe=(e,t,n,r)=>{if(Object.is(e,t))return!0;if(n<=0||r.keys<=0||typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!pe(e[i],t[i],n-1,r))return!1;return!0}if(!R(e)||!R(t))return!1;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let a of i)if(--r.keys,r.keys<=0||!Object.prototype.hasOwnProperty.call(t,a)||!pe(e[a],t[a],n-1,r))return!1;return!0},B=(e,t,n,r)=>{let i=t.split(`.`).filter(Boolean);if(!i.length)return;let a=e;for(let e=0;e<i.length-1;e++){let t=i[e];(!Object.prototype.hasOwnProperty.call(a,t)||a[t]==null||typeof a[t]!=`object`)&&(a[t]=Object.create(null)),a=a[t]}let o=i[i.length-1];if(r===`delete`)try{delete a[o]}catch{a[o]=null}else a[o]=n},me=()=>{let e=new WeakMap,n=Object.create(null),r=Number.isFinite(k)?{keys:k}:void 0,i=W(t)?G(t):t,a=Object.keys(i),o=g?Object.keys(s):[];for(let t of a)j(t)&&(n[t]=Y(i[t],e,{cache:I,maxDepth:O,_budget:r}));for(let t of o)j(t)&&(n[t]=Y(s[t].value,e,{cache:I,maxDepth:O,_budget:r}));return n},V=_===`patch`,H=new Map,K=G(t),q=new Set,ve=e=>{if(!f||e.root!==K)return;if(!e.path){if(Array.isArray(e.fallbackTopKeys)&&e.fallbackTopKeys.length)for(let t of e.fallbackTopKeys)q.add(t);else V=!0;return}let t=e.path.split(`.`,1)[0];j(t)&&H.set(e.path,{kind:e.kind,op:e.op})},ye=Object.create(null),be=e=>{if(!w)return;let t=e.reason!==`patch`&&e.reason!==`diff`;if(!(T===`fallback`&&!t)&&!(E<1&&Math.random()>E))try{w(e)}catch{}},xe=(e=`diff`)=>{let t=me(),n=_t(m,t);if(m=t,V=!1,H.clear(),_===`patch`&&g){ye=Object.create(null);for(let e of Object.keys(s))j(e)&&(ye[e]=t[e]);M.clear()}if(Object.keys(n).length){if(typeof F.setData==`function`){let e=F.setData(n);e&&typeof e.then==`function`&&e.catch(()=>{})}be({mode:`diff`,reason:e,pendingPatchKeys:0,payloadKeys:Object.keys(n).length})}},Se,Ce=()=>{if(f)if(Se?.(),_===`patch`&&!V){if(H.size>ee){V=!0;let e=H.size;H.clear(),M.clear(),be({mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}),xe(`maxPatchKeys`);return}let e=new WeakMap,n=new Map,r=Object.create(null),i=Array.from(H.entries());if(Number.isFinite(D)&&D>0){let e=new Map;for(let[t]of i){let n=t.split(`.`,1)[0];e.set(n,(e.get(n)??0)+1)}for(let[t,n]of e)n>=D&&q.add(t)}let a=i.filter(([e])=>{for(let t of q)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),o=new Map(a);H.clear();let c=e=>{let n=e.split(`.`).filter(Boolean),r=t;for(let e of n){if(r==null)return r;r=r[e]}return r},l=t=>{if(n.has(t))return n.get(t);let r=L(Y(c(t),e,{cache:I,maxDepth:O,maxKeys:k}));return n.set(t,r),r};if(q.size){for(let e of q)j(e)&&(r[e]=l(e),o.set(e,{kind:`property`,op:`set`}));q.clear()}for(let[e,t]of a){if((t.kind===`array`?`set`:t.op)===`delete`){r[e]=null;continue}r[e]=l(e)}let u=0;if(g&&M.size){let t=Object.create(null),n=Array.from(M);M.clear(),u=n.length;for(let r of n){if(!j(r))continue;let n=Y(s[r].value,e,{cache:I,maxDepth:O,maxKeys:k}),i=ye[r];(ie===`deep`?pe(i,n,ae,{keys:oe}):ie===`shallow`?z(i,n):Object.is(i,n))||(t[r]=L(n),ye[r]=n)}Object.assign(r,t)}let d=e=>{let t=Object.keys(e).sort();if(t.length<=1)return e;let n=Object.create(null),r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n},f=(e,t,n)=>{if(t<=0)return t+1;if(e===null)return 4;let r=typeof e;if(r===`string`)return 2+e.length;if(r===`number`)return Number.isFinite(e)?String(e).length:4;if(r===`boolean`)return e?4:5;if(r===`undefined`||r===`function`||r===`symbol`||r!==`object`||n.has(e))return 4;if(n.add(e),Array.isArray(e)){let r=2;for(let i=0;i<e.length;i++)if(i&&(r+=1),r+=f(e[i],t-r,n),r>t)return r;return r}let i=2;for(let[r,a]of Object.entries(e))if(i>2&&(i+=1),i+=2+r.length+1,i+=f(a,t-i,n),i>t)return i;return i},p=e=>{if(te===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let t=te,n=Object.keys(e).length,r=f(e,t+1,new WeakSet);if(r>t)return{fallback:!0,estimatedBytes:r,bytes:void 0};if(r>=t*.85&&n>2)try{let n=JSON.stringify(e).length;return{fallback:n>t,estimatedBytes:r,bytes:n}}catch{return{fallback:!1,estimatedBytes:r,bytes:void 0}}return{fallback:!1,estimatedBytes:r,bytes:void 0}},h=e=>{if(!v)return{out:e,merged:0};let t=Object.keys(e);if(t.length<v)return{out:e,merged:0};let n=new Map,r=new Set;for(let i of t){let t=o.get(i);if(!t)continue;if(e[i]===null||t.op===`delete`){let e=i.lastIndexOf(`.`);e>0&&r.add(i.slice(0,e));continue}let a=i.lastIndexOf(`.`);if(a<=0)continue;let s=i.slice(0,a),c=n.get(s)??[];c.push(i),n.set(s,c)}let i=Array.from(n.entries()).filter(([e,t])=>t.length>=v&&!r.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!i.length)return{out:e,merged:0};let a=Object.create(null);Object.assign(a,e);let s=0,c=new WeakMap,u=e=>{if(e&&typeof e==`object`){let t=c.get(e);if(t!==void 0)return t;let n=f(e,1/0,new WeakSet);return c.set(e,n),n}return f(e,1/0,new WeakSet)},d=(e,t)=>2+e.length+1+u(t);for(let[e,t]of i){if(Object.prototype.hasOwnProperty.call(a,e))continue;let n=t.filter(e=>Object.prototype.hasOwnProperty.call(a,e));if(n.length<v)continue;let r=l(e);if(!(re&&Array.isArray(r))&&!(y!==1/0&&d(e,r)>y)){if(ne!==1/0){let t=0;for(let e of n)t+=d(e,a[e]);if(d(e,r)>t*ne)continue}a[e]=r;for(let e of n)delete a[e];s+=1}}return{out:a,merged:s}},_=d(r),b=0;if(v){let e=h(_);b=e.merged,_=d(e.out)}let x=p(_),S=x.fallback;if(be({mode:S?`diff`:`patch`,reason:S?`maxPayloadBytes`:`patch`,pendingPatchKeys:a.length,payloadKeys:Object.keys(_).length,mergedSiblingParents:b||void 0,computedDirtyKeys:u||void 0,estimatedBytes:x.estimatedBytes,bytes:x.bytes}),S){V=!0,H.clear(),M.clear(),xe(`maxPayloadBytes`);return}if(!Object.keys(_).length)return;for(let[e,t]of Object.entries(_)){let n=o.get(e);n?B(m,e,t,n.kind===`array`?`set`:n.op):B(m,e,t,`set`)}if(typeof F.setData==`function`){let e=F.setData(_);e&&typeof e.then==`function`&&e.catch(()=>{})}be({mode:`patch`,reason:`patch`,pendingPatchKeys:a.length,payloadKeys:Object.keys(_).length})}else xe(V?`needsFullSnapshot`:`diff`)};Se=b(()=>{_e(t),Object.keys(t).forEach(e=>{let n=t[e];J(n)?n.value:W(n)&&_e(n)})},{lazy:!0,scheduler:()=>a(Ce)}),Ce(),h.push(()=>x(Se)),_===`patch`&&(he(t,{shouldIncludeTopKey:j,maxDepth:se,maxKeys:ce}),de(ve),h.push(()=>fe(ve)),h.push(()=>ge(t)));function Te(e,t,n){let r=Ve(e,(e,n)=>t(e,n),n);return h.push(r),()=>{r();let e=h.indexOf(r);e>=0&&h.splice(e,1)}}return{get state(){return t},get proxy(){return P},get methods(){return l},get computed(){return ue},get adapter(){return F},bindModel:Ze(P,t,s,c),watch:Te,snapshot:()=>_===`patch`?me():{...m},unmount:()=>{f&&(f=!1,h.forEach(e=>{try{e()}catch{}}),h.length=0)}}},use(e,...t){if(!e||f.has(e))return m;if(f.add(e),typeof e==`function`)e(m,...t);else if(typeof e.install==`function`)e.install(m,...t);else throw TypeError(`A plugin must be a function or an object with an install method`);return m},config:p};if(typeof globalThis.App==`function`){let e=globalThis,t=e.__wxConfig!==void 0,n=`__wevuAppRegistered`;(!t||!e[n])&&(t&&(e[n]=!0),Cn(m,i??{},s,c,l))}return m}function En(e){Pn();let{data:t,computed:n,methods:r,setData:i,watch:a,setup:o,props:s,...c}=rt(e),l=Tn({data:t,computed:n,methods:r,setData:i,[Qe]:`component`}),u=e=>{let t=gn(o,e?.props??{},e);t&&Dn(e.runtime,e.instance,t)},d=Fn(c,s),f={data:t,computed:n,methods:r,setData:i,watch:a,setup:u,mpOptions:d};return wn(l,r??{},a,u,d),{__wevu_runtime:l,__wevu_options:f}}function Dn(e,t,n){let r=e?.methods??Object.create(null),i=e?.state??Object.create(null),a=W(i)?G(i):i;if(e&&!e.methods)try{e.methods=r}catch{}if(e&&!e.state)try{e.state=i}catch{}Object.keys(n).forEach(o=>{let s=n[o];if(typeof s==`function`)r[o]=(...t)=>s.apply(e?.proxy??e,t);else if(s===t||!kn(s))try{Object.defineProperty(a,o,{value:s,configurable:!0,enumerable:!1,writable:!0})}catch{i[o]=s}else i[o]=s}),e&&(e.methods=e.methods??r,e.state=e.state??i)}function On(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function kn(e){return typeof e!=`object`||!e||J(e)||W(e)||Array.isArray(e)?!0:On(e)}function An(e){Pn();let{properties:t,props:n,...r}=e;En(Fn(r,n,t))}function jn(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function Mn(e){let t=e?.currentTarget?.dataset?.wvArgs??e?.target?.dataset?.wvArgs,n=[];if(typeof t==`string`)try{n=JSON.parse(t)}catch{try{n=JSON.parse(jn(t))}catch{n=[]}}return Array.isArray(n)||(n=[]),n.map(t=>t===`$event`?e:t)}function Nn(){let e=e=>{if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e},t=(t,n)=>{let r=Object.prototype.hasOwnProperty.call(n??{},`__wvSlotScope`)?n.__wvSlotScope:t?.properties?.__wvSlotScope,i=Object.prototype.hasOwnProperty.call(n??{},`__wvSlotProps`)?n.__wvSlotProps:t?.properties?.__wvSlotProps,a=e(r),o=e(i),s={...a,...o};typeof t?.setData==`function`&&t.setData({__wvSlotPropsData:s})};An({properties:{__wvOwnerId:{type:String,value:``},__wvSlotProps:{type:null,value:null,observer(e){t(this,{__wvSlotProps:e})}},__wvSlotScope:{type:null,value:null,observer(e){t(this,{__wvSlotScope:e})}}},data:()=>({__wvOwner:{},__wvSlotPropsData:{}}),lifetimes:{attached(){let e=this.properties?.__wvOwnerId??``;if(t(this),!e)return;let n=(e,t)=>{this.__wvOwnerProxy=t,typeof this.setData==`function`&&this.setData({__wvOwner:e||{}})};this.__wvOwnerUnsub=ln(e,n);let r=dn(e);r&&n(r,un(e))},detached(){typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerProxy=void 0}},methods:{__weapp_vite_owner(e){let t=e?.currentTarget?.dataset?.wvHandler??e?.target?.dataset?.wvHandler;if(typeof t!=`string`||!t)return;let n=this.__wvOwnerProxy,r=n?.[t];if(typeof r!=`function`)return;let i=Mn(e);return r.apply(n,i)}}})}Pn();function Pn(){let e=typeof globalThis<`u`?globalThis:void 0;if(!e)return;let t=e;t.__weapp_vite_createScopedSlotComponent||=Nn}function Fn(e,t,n){let r=e.properties,i=n??(r&&typeof r==`object`?r:void 0),a=e=>{let t={...e??{}};return Object.prototype.hasOwnProperty.call(t,`__wvSlotOwnerId`)||(t.__wvSlotOwnerId={type:String,value:``}),Object.prototype.hasOwnProperty.call(t,`__wvSlotScope`)||(t.__wvSlotScope={type:null,value:null}),t};if(i||!t){let{properties:t,...n}=e;return{...n,properties:a(i)}}let o={};return Object.entries(t).forEach(([e,t])=>{if(t!=null){if(Array.isArray(t)||typeof t==`function`){o[e]={type:t};return}if(typeof t==`object`){if(e.endsWith(`Modifiers`)&&Object.keys(t).length===0){o[e]={type:Object,value:{}};return}let n={};`type`in t&&t.type!==void 0&&(n.type=t.type);let r=`default`in t?t.default:t.value;r!==void 0&&(n.value=typeof r==`function`?r():r),o[e]=n}}}),{...e,properties:a(o)}}const In=Symbol(`wevu.provideScope`),Ln=new Map;function Rn(e,t){let n=bt();if(n){let r=n[In];r||(r=new Map,n[In]=r),r.set(e,t)}else Ln.set(e,t)}function zn(e,t){let n=bt();if(n){let t=n;for(;t;){let n=t[In];if(n&&n.has(e))return n.get(e);t=null}}if(Ln.has(e))return Ln.get(e);if(arguments.length>=2)return t;throw Error(`wevu.inject: no value found for key`)}function Bn(e,t){Ln.set(e,t)}function Vn(e,t){if(Ln.has(e))return Ln.get(e);if(arguments.length>=2)return t;throw Error(`injectGlobal() no matching provider for key: ${String(e)}`)}function Hn(){let e=St();if(!e)throw Error(`useAttrs() must be called synchronously inside setup()`);return e.attrs??{}}function Un(){let e=St();if(!e)throw Error(`useSlots() must be called synchronously inside setup()`);return e.slots??Object.create(null)}function Wn(e,t){let n=St();if(!n)throw Error(`useModel() must be called synchronously inside setup()`);let r=n.emit,i=`update:${t}`;return ke({get:()=>e?.[t],set:e=>{r?.(i,e)}})}function Gn(e,t){return e==null?t:t==null?e:Array.isArray(e)&&Array.isArray(t)?Array.from(new Set([...e,...t])):typeof e==`object`&&typeof t==`object`?{...e,...t}:t}function Kn(e,t,n,r){return function(...i){let a=[],o=[],s=e=>a.push(e),c=e=>o.push(e);r.forEach(n=>{try{n({name:t,store:e,args:i,after:s,onError:c})}catch{}});let l;try{l=n.apply(e,i)}catch(e){throw o.forEach(t=>t(e)),e}let u=e=>(a.forEach(t=>t(e)),e);return l&&typeof l.then==`function`?l.then(e=>u(e),e=>(o.forEach(t=>t(e)),Promise.reject(e))):u(l)}}function qn(e){return typeof e==`object`&&!!e}function Jn(e,t){for(let n in t)e[n]=t[n]}function Yn(e,t,n,r){let i={$id:e};Object.defineProperty(i,`$state`,{get(){return t},set(e){t&&qn(e)&&(Jn(t,e),n(`patch object`))}}),i.$patch=e=>{if(!t){typeof e==`function`?(e(i),n(`patch function`)):(Jn(i,e),n(`patch object`));return}typeof e==`function`?(e(t),n(`patch function`)):(Jn(t,e),n(`patch object`))},r&&(i.$reset=()=>r());let a=new Set;i.$subscribe=(e,t)=>(a.add(e),()=>a.delete(e));let o=new Set;return i.$onAction=e=>(o.add(e),()=>o.delete(e)),{api:i,subs:a,actionSubs:o}}function Xn(){let e={_stores:new Map,_plugins:[],install(e){},use(t){return typeof t==`function`&&e._plugins.push(t),e}};return Xn._instance=e,e}function Zn(e,t){let n,r=!1,i=Xn._instance;return function(){if(r&&n)return n;if(r=!0,typeof t==`function`){let r=t(),a=()=>{},o=Yn(e,void 0,e=>a(e));a=t=>{o.subs.forEach(r=>{try{r({type:t,storeId:e},n)}catch{}})},n=Object.assign({},r);for(let e of Object.getOwnPropertyNames(o.api)){let t=Object.getOwnPropertyDescriptor(o.api,e);t&&Object.defineProperty(n,e,t)}Object.keys(r).forEach(e=>{let t=r[e];typeof t==`function`&&!e.startsWith(`$`)&&(n[e]=Kn(n,e,t,o.actionSubs))});let s=i?._plugins??[];for(let e of s)try{e({store:n})}catch{}return n}let a=t,o=a.state?a.state():{},s=U(o),c={...G(o)},l=()=>{},u=Yn(e,s,e=>l(e),()=>{Jn(s,c),l(`patch object`)});l=t=>{u.subs.forEach(n=>{try{n({type:t,storeId:e},s)}catch{}})};let d={};for(let e of Object.getOwnPropertyNames(u.api)){let t=Object.getOwnPropertyDescriptor(u.api,e);t&&Object.defineProperty(d,e,t)}let f=a.getters??{},p={};Object.keys(f).forEach(e=>{let t=f[e];if(typeof t==`function`){let n=Ae(()=>t.call(d,s));p[e]=n,Object.defineProperty(d,e,{enumerable:!0,configurable:!0,get(){return n.value}})}});let m=a.actions??{};Object.keys(m).forEach(e=>{let t=m[e];typeof t==`function`&&(d[e]=Kn(d,e,(...e)=>t.apply(d,e),u.actionSubs))}),Object.keys(s).forEach(e=>{Object.defineProperty(d,e,{enumerable:!0,configurable:!0,get(){return s[e]},set(t){s[e]=t}})}),n=d;let h=i?._plugins??[];for(let e of h)try{e({store:n})}catch{}return n}}function Qn(e){let t={};for(let n in e){let r=e[n];if(typeof r==`function`){t[n]=r;continue}J(r)?t[n]=r:t[n]=Ae({get:()=>e[n],set:t=>{e[n]=t}})}return t}exports.addMutationRecorder=de,exports.batch=m,exports.callHookList=Q,exports.callHookReturn=Tt,exports.callUpdateHooks=rn,exports.computed=Ae,exports.createApp=Tn,exports.createStore=Xn,exports.createWevuComponent=An,exports.createWevuScopedSlotComponent=Nn,exports.defineComponent=En,exports.defineStore=Zn,exports.effect=b,exports.effectScope=ee,exports.endBatch=p,exports.getCurrentInstance=bt,exports.getCurrentScope=te,exports.getCurrentSetupContext=St,exports.getDeepWatchStrategy=Be,exports.getReactiveVersion=N,exports.inject=zn,exports.injectGlobal=Vn,exports.isNoSetData=ut,exports.isRaw=Se,exports.isReactive=W,exports.isRef=J,exports.isShallowReactive=be,exports.isShallowRef=Ne,exports.markNoSetData=lt,exports.markRaw=xe,exports.mergeModels=Gn,exports.mountRuntimeInstance=bn,exports.nextTick=o,exports.onActivated=en,exports.onAddToFavorites=Kt,exports.onBeforeMount=Zt,exports.onBeforeUnmount=Yt,exports.onBeforeUpdate=Qt,exports.onDeactivated=tn,exports.onError=Ht,exports.onErrorCaptured=$t,exports.onHide=Mt,exports.onLaunch=Et,exports.onLoad=jt,exports.onMounted=qt,exports.onMoved=Vt,exports.onPageNotFound=Dt,exports.onPageScroll=Lt,exports.onPullDownRefresh=Ft,exports.onReachBottom=It,exports.onReady=Pt,exports.onResize=Bt,exports.onRouteDone=Rt,exports.onSaveExitState=Ut,exports.onScopeDispose=v,exports.onServerPrefetch=nn,exports.onShareAppMessage=Wt,exports.onShareTimeline=Gt,exports.onShow=At,exports.onTabItemTap=zt,exports.onThemeChange=kt,exports.onUnhandledRejection=Ot,exports.onUnload=Nt,exports.onUnmounted=Xt,exports.onUpdated=Jt,exports.prelinkReactiveTree=he,exports.provide=Rn,exports.provideGlobal=Bn,exports.reactive=U,exports.readonly=je,exports.ref=Ee,exports.registerApp=Cn,exports.registerComponent=wn,exports.removeMutationRecorder=fe,exports.resetWevuDefaults=tt,exports.runSetupFunction=gn,exports.setCurrentInstance=xt,exports.setCurrentSetupContext=Ct,exports.setDeepWatchStrategy=ze,exports.setWevuDefaults=et,exports.shallowReactive=ye,exports.shallowRef=Me,exports.startBatch=f,exports.stop=x,exports.storeToRefs=Qn,exports.teardownRuntimeInstance=Sn,exports.toRaw=G,exports.toRef=Ie,exports.toRefs=Fe,exports.touchReactive=_e,exports.traverse=Le,exports.triggerRef=Pe,exports.unref=De,exports.useAttrs=Hn,exports.useModel=Wn,exports.useSlots=Un,exports.watch=Ve,exports.watchEffect=He;
|
|
1
|
+
const e=Promise.resolve(),t=new Set;let n=!1,r=!1;function i(){r=!1,n=!0;try{t.forEach(e=>e())}finally{t.clear(),n=!1}}function a(a){t.add(a),!n&&!r&&(r=!0,e.then(i))}function o(t){return t?e.then(t):e}const s=new WeakMap;let c=null;const l=[];let u=0;const d=new Set;function f(){u++}function p(){u!==0&&(u--,u===0&&h())}function m(e){f();try{return e()}finally{p()}}function h(){for(;d.size;){let e=Array.from(d);d.clear();for(let t of e)t()}}let g;var _=class{active=!0;effects=[];cleanups=[];parent;scopes;constructor(e=!1){this.detached=e,!e&&g&&(this.parent=g,(g.scopes||=[]).push(this))}run(e){if(!this.active)return;let t=g;g=this;try{return e()}finally{g=t}}stop(){if(this.active){this.active=!1;for(let e of this.effects)x(e);this.effects.length=0;for(let e of this.cleanups)e();if(this.cleanups.length=0,this.scopes){for(let e of this.scopes)e.stop();this.scopes.length=0}if(this.parent?.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0}}};function ee(e=!1){return new _(e)}function te(){return g}function v(e){g?.active&&g.cleanups.push(e)}function ne(e){g?.active&&g.effects.push(e)}function y(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function re(e,t={}){let n=function(){if(!n.active||n._running)return e();y(n);try{return n._running=!0,l.push(n),c=n,e()}finally{l.pop(),c=l[l.length-1]??null,n._running=!1}};return n.deps=[],n.scheduler=t.scheduler,n.onStop=t.onStop,n.active=!0,n._running=!1,n._fn=e,n}function b(e,t={}){let n=re(e,t);return ne(n),t.lazy||n(),n}function x(e){e.active&&(e.active=!1,y(e),e.onStop?.())}function S(e,t){if(!c)return;let n=s.get(e);n||(n=new Map,s.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),r.has(c)||(r.add(c),c.deps.push(r))}function C(e,t){let n=s.get(e);if(!n)return;let r=n.get(t);if(!r)return;let i=new Set;r.forEach(e=>{e!==c&&i.add(e)}),i.forEach(oe)}function ie(e){c&&(e.has(c)||(e.add(c),c.deps.push(e)))}function ae(e){new Set(e).forEach(oe)}function oe(e){if(e.scheduler){e.scheduler();return}if(u>0){d.add(e);return}e()}const se=new WeakMap,ce=new WeakMap,w=new WeakMap,T=new WeakMap,E=new WeakMap,D=new WeakMap,O=new WeakSet,k=new WeakMap,A=new WeakMap;function le(e){let t=A.get(e);return t||(t=new Set,A.set(e,t)),t}function j(e,t){le(e).add(t)}function M(e){T.set(e,(T.get(e)??0)+1)}function N(e){let t=G(e);return T.get(t)??0}function ue(e){let t=new Set,n=[e];for(let e=0;e<2e3&&n.length;e++){let e=n.pop(),r=D.get(e);if(r)for(let e of r.keys())t.has(e)||(t.add(e),M(e),n.push(e))}}const P=new Set;function de(e){P.add(e)}function fe(e){P.delete(e)}let F=function(e){return e.IS_REACTIVE=`__r_isReactive`,e.RAW=`__r_raw`,e.SKIP=`__r_skip`,e}({});function I(e){return typeof e==`object`&&!!e}const L=Symbol(`wevu.version`);function R(e){if(!e)return!1;let t=e.charCodeAt(0);if(t<48||t>57)return!1;let n=Number(e);return Number.isInteger(n)&&n>=0&&String(n)===e}function z(e,t,n){if(typeof n!=`string`){O.add(e),E.delete(e);return}if(P.size){let n=w.get(t)??t;j(n,t),j(n,e)}let r=D.get(e);r||(r=new Map,D.set(e,r));let i=r.get(t);i||(i=new Set,r.set(t,i)),i.add(n),B(e)}function pe(e,t,n){let r=D.get(e);if(!r)return;let i=r.get(t);i&&(i.delete(n),i.size||r.delete(t),r.size||D.delete(e),B(e))}function B(e){let t=D.get(e);if(!t){O.delete(e),E.delete(e);return}let n,r,i=0;for(let[e,a]of t){for(let t of a){if(i+=1,i>1)break;n=e,r=t}if(i>1)break}if(i===1&&n&&r){O.delete(e),E.set(e,{parent:n,key:r});return}O.add(e),E.delete(e)}function me(e,t){if(t===e)return[];if(O.has(t))return;let n=[],r=t;for(let t=0;t<2e3;t++){if(r===e)return n.reverse();if(O.has(r))return;let t=E.get(r);if(!t||typeof t.key!=`string`)return;n.push(t.key),r=t.parent}}function V(e,t,n){if(!P.size||typeof t!=`string`||t.startsWith(`__r_`))return;let r=w.get(e)??e,i=Array.isArray(e)&&(t===`length`||R(t))?`array`:`property`,a=me(r,e);if(!a){let a=new Set,o=D.get(e);if(o)for(let[e,t]of o){let n=k.get(e),i=n?n.split(`.`,1)[0]:void 0,o=i?void 0:me(r,e)?.[0];for(let e of t)typeof e==`string`&&a.add(i??o??e)}else a.add(t);for(let e of P)e({root:r,kind:i,op:n,path:void 0,fallbackTopKeys:a.size?Array.from(a):void 0});return}let o=a.findIndex(e=>R(e));if(o!==-1){let e=a.slice(0,o).join(`.`)||void 0;for(let t of P)t({root:r,kind:`array`,op:n,path:e});return}let s=a.length?a.join(`.`):``,c=i===`array`?s||void 0:s?`${s}.${t}`:t;for(let e of P)e({root:r,kind:i,op:n,path:c})}const H={get(e,t,n){if(t===F.IS_REACTIVE)return!0;if(t===F.RAW)return e;let r=Reflect.get(e,t,n);if(S(e,t),I(r)){if(r[F.SKIP])return r;let n=w.get(e)??e,i=r?.[F.RAW]??r;w.has(i)||w.set(i,n),z(i,e,t);let a=k.get(e);if(P.size&&typeof t==`string`&&a!=null&&!O.has(i)){let e=a?`${a}.${t}`:t;k.set(i,e)}return U(r)}return r},set(e,t,n,r){let i=Array.isArray(e),a=i?e.length:0,o=Reflect.get(e,t,r),s=Reflect.set(e,t,n,r);if(!Object.is(o,n)){let r=I(o)?o?.[F.RAW]??o:void 0;if(r&&pe(r,e,t),I(n)&&!n[F.SKIP]){let r=w.get(e)??e,i=n?.[F.RAW]??n;w.has(i)||w.set(i,r),z(i,e,t);let a=k.get(e);if(P.size&&typeof t==`string`&&a!=null&&!O.has(i)){let e=a?`${a}.${t}`:t;k.set(i,e)}}C(e,t),i&&typeof t==`string`&&R(t)&&Number(t)>=a&&C(e,`length`),C(e,L),M(e),ue(e);let s=w.get(e);s&&s!==e&&(C(s,L),M(s)),V(e,t,`set`)}return s},deleteProperty(e,t){let n=Object.prototype.hasOwnProperty.call(e,t),r=n?e[t]:void 0,i=Reflect.deleteProperty(e,t);if(n&&i){let n=I(r)?r?.[F.RAW]??r:void 0;n&&pe(n,e,t),C(e,t),C(e,L),M(e),ue(e);let i=w.get(e);i&&i!==e&&(C(i,L),M(i)),V(e,t,`delete`)}return i},ownKeys(e){return S(e,Symbol.iterator),S(e,L),Reflect.ownKeys(e)}};function U(e){if(!I(e))return e;let t=se.get(e);if(t)return t;if(e[F.IS_REACTIVE])return e;let n=new Proxy(e,H);return se.set(e,n),ce.set(n,e),T.has(e)||T.set(e,0),w.has(e)||w.set(e,e),n}function W(e){return!!(e&&e[F.IS_REACTIVE])}function G(e){return e?.[F.RAW]??e}function K(e){return I(e)?U(e):e}function he(e,t){let n=G(e);k.set(n,``),j(n,n);let r=t?.shouldIncludeTopKey,i=typeof t?.maxDepth==`number`?Math.max(0,Math.floor(t.maxDepth)):1/0,a=typeof t?.maxKeys==`number`?Math.max(0,Math.floor(t.maxKeys)):1/0,o=new WeakSet,s=[{current:n,path:``,depth:0}],c=0;for(;s.length;){let e=s.pop();if(o.has(e.current)||(o.add(e.current),k.set(e.current,e.path),j(n,e.current),c+=1,c>=a)||e.depth>=i||Array.isArray(e.current))continue;let t=Object.entries(e.current);for(let[i,a]of t){if(e.path===``&&r&&!r(i)||!I(a)||a[F.SKIP])continue;let t=G(a);if(w.has(t)||w.set(t,n),z(t,e.current,i),!O.has(t)){let n=e.path?`${e.path}.${i}`:i;k.set(t,n)}j(n,t),s.push({current:t,path:e.path?`${e.path}.${i}`:i,depth:e.depth+1})}}}function ge(e){let t=G(e),n=A.get(t);if(!n){k.delete(t);return}for(let e of n)E.delete(e),D.delete(e),k.delete(e),O.delete(e),w.delete(e),T.delete(e);A.delete(t)}function _e(e){S(G(e),L)}const q=new WeakMap,ve={get(e,t,n){if(t===F.IS_REACTIVE)return!0;if(t===F.RAW)return e;let r=Reflect.get(e,t,n);return S(e,t),r},set(e,t,n,r){let i=Reflect.get(e,t,r),a=Reflect.set(e,t,n,r);return Object.is(i,n)||(C(e,t),C(e,L),M(e)),a},deleteProperty(e,t){let n=Object.prototype.hasOwnProperty.call(e,t),r=Reflect.deleteProperty(e,t);return n&&r&&(C(e,t),C(e,L),M(e)),r},ownKeys(e){return S(e,Symbol.iterator),S(e,L),Reflect.ownKeys(e)}};function ye(e){if(!I(e))return e;let t=q.get(e);if(t)return t;if(e[F.IS_REACTIVE])return e;let n=new Proxy(e,ve);return q.set(e,n),ce.set(n,e),T.has(e)||T.set(e,0),n}function be(e){let t=G(e);return q.has(t)}function xe(e){return I(e)&&Object.defineProperty(e,F.SKIP,{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function Se(e){return I(e)&&F.SKIP in e}const Ce=`__v_isRef`;function we(e){try{Object.defineProperty(e,Ce,{value:!0,configurable:!0})}catch{e[Ce]=!0}return e}function J(e){return!!(e&&typeof e==`object`&&e[Ce]===!0)}var Te=class{_value;_rawValue;dep;constructor(e){we(this),this._rawValue=e,this._value=K(e)}get value(){return this.dep||=new Set,ie(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=K(e),this.dep&&ae(this.dep))}};function Ee(e){return J(e)?e:xe(new Te(e))}function De(e){return J(e)?e.value:e}var Oe=class{_getValue;_setValue;dep;constructor(e,t){we(this);let n=t,r=()=>{this.dep||=new Set,ie(this.dep)},i=()=>{this.dep&&ae(this.dep)},a=e=>e===void 0&&n!==void 0?n:e;if(typeof e==`function`){let t=e(r,i);this._getValue=()=>a(t.get()),this._setValue=e=>t.set(e);return}let o=e;this._getValue=()=>(r(),a(o.get())),this._setValue=e=>{o.set(e),i()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function ke(e,t){return xe(new Oe(e,t))}function Ae(e){let t,n;typeof e==`function`?(t=e,n=()=>{throw Error(`计算属性是只读的`)}):(t=e.get,n=e.set);let r,i=!0,a,o={get value(){return i&&=(r=a(),!1),S(o,`value`),r},set value(e){n(e)}};return we(o),a=b(t,{lazy:!0,scheduler:()=>{i||(i=!0,C(o,`value`))}}),o}function je(e){if(J(e)){let t=e;return we({get value(){return t.value},set value(e){throw Error(`无法给只读 ref 赋值`)}})}return I(e)?new Proxy(e,{set(){throw Error(`无法在只读对象上设置属性`)},deleteProperty(){throw Error(`无法在只读对象上删除属性`)},defineProperty(){throw Error(`无法在只读对象上定义属性`)},get(e,t,n){return Reflect.get(e,t,n)}}):e}function Me(e,t){return ke((t,n)=>({get(){return t(),e},set(t){Object.is(e,t)||(e=t,n())}}),t)}function Ne(e){return J(e)&&typeof e.value!=`function`}function Pe(e){if(J(e)){let t=e.dep;if(t){ae(t);return}e.value=e.value}}function Fe(e){W(e)||console.warn(`toRefs() expects a reactive object but received a plain one.`);let t=Array.isArray(e)?Array.from({length:e.length}):{};for(let n in e)t[n]=Ie(e,n);return t}function Ie(e,t,n){let r=e[t];return J(r)?r:ke((n,r)=>({get(){return n(),e[t]},set(n){e[t]=n,r()}}),n)}function Le(e,t=new Set){if(!I(e)||t.has(e))return e;for(let n in t.add(e),e)Le(e[n],t);return e}let Re=`version`;function ze(e){Re=e}function Be(){return Re}function Ve(e,t,n={}){let r,i=W(e),o=Array.isArray(e)&&!i,s=e=>{if(typeof e==`function`)return e();if(J(e))return e.value;if(W(e))return e;throw Error(`无效的 watch 源`)};if(o){let t=e;r=()=>t.map(e=>s(e))}else if(typeof e==`function`)r=e;else if(J(e))r=()=>e.value;else if(i)r=()=>e;else throw Error(`无效的 watch 源`);let c=o?e.some(e=>W(e)):i;if(n.deep??c){let e=r;r=()=>{let t=e();return o&&Array.isArray(t)?t.map(e=>Re===`version`&&W(e)?(_e(e),e):Le(e)):Re===`version`&&W(t)?(_e(t),t):Le(t)}}let l,u=e=>{l=e},d,f,p=()=>{if(!f.active)return;let e=f();l?.(),t(e,d,u),d=e};f=b(()=>r(),{scheduler:()=>a(p),lazy:!0}),n.immediate?p():d=f();let m=()=>{l?.(),l=void 0,x(f)};return v(m),m}function He(e){let t,n=e=>{t=e},r,i=()=>{r.active&&r()};r=b(()=>{t?.(),t=void 0,e(n)},{lazy:!0,scheduler:()=>a(i)}),r();let o=()=>{t?.(),t=void 0,x(r)};return v(o),o}function Ue(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}function We(e){return e?e.split(`.`).map(e=>e.trim()).filter(Boolean):[]}function Ge(e,t,n){let r=e[t];if(!r)throw Error(`计算属性 "${t}" 是只读的`);r(n)}function Ke(e){if(e==null)return e;if(typeof e==`object`){if(`detail`in e&&e.detail&&`value`in e.detail)return e.detail.value;if(`target`in e&&e.target&&`value`in e.target)return e.target.value}return e}function qe(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];(r[n]==null||typeof r[n]!=`object`)&&(r[n]={}),r=r[n]}r[t[t.length-1]]=n}function Je(e,t,n,r,i){if(!r.length)return;let[a,...o]=r;if(!o.length){if(t[a])Ge(n,a,i);else{let t=e[a];J(t)?t.value=i:e[a]=i}return}if(t[a]){Ge(n,a,i);return}(e[a]==null||typeof e[a]!=`object`)&&(e[a]={}),qe(e[a],o,i)}function Ye(e,t){return t.reduce((e,t)=>e==null?e:e[t],e)}function Xe(e){return Ke(e)}function Ze(e,t,n,r){return(i,a)=>{let o=We(i);if(!o.length)throw Error(`bindModel 需要非空路径`);let s=()=>Ye(e,o),c=e=>{Je(t,n,r,o,e)},l={event:`input`,valueProp:`value`,parser:Xe,formatter:e=>e,...a};return{get value(){return s()},set value(e){c(e)},update(e){c(e)},model(e){let t={...l,...e},n=`on${Ue(t.event)}`,r=e=>{c(t.parser(e))};return{[t.valueProp]:t.formatter(s()),[n]:r}}}}}const Qe=`__wevuDefaultsScope`;let $e={};function et(e){$e=it($e,e)}function tt(){$e={}}function nt(e){return at($e.app,e)}function rt(e){return at($e.component,e)}function it(e,t){return{app:ot(e.app,t.app),component:ot(e.component,t.component)}}function at(e,t){return ot(e,t)}function ot(e,t){if(!e)return t;if(!t)return e;let n={...e,...t},r=st(e.setData),i=st(t.setData);(r||i)&&(n.setData={...r??{},...i??{}});let a=st(e.options),o=st(t.options);return(a||o)&&(n.options={...a??{},...o??{}}),n}function st(e){if(!(!e||typeof e!=`object`||Array.isArray(e)))return e}const ct=Symbol(`wevu.noSetData`);function lt(e){return Object.defineProperty(e,ct,{value:!0,configurable:!0,enumerable:!1,writable:!1}),e}function ut(e){return typeof e==`object`&&!!e&&e[ct]===!0}function dt(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Y(e,t=new WeakMap,n){let r=De(e);if(typeof r==`bigint`){let e=Number(r);return Number.isSafeInteger(e)?e:r.toString()}if(typeof r==`symbol`)return r.toString();if(typeof r==`function`)return;if(typeof r!=`object`||!r)return r;if(ut(r))return;let i=W(r)?G(r):r,a=n?._depth??(typeof n?.maxDepth==`number`?Math.max(0,Math.floor(n.maxDepth)):1/0),o=n?._budget??(typeof n?.maxKeys==`number`?{keys:Math.max(0,Math.floor(n.maxKeys))}:{keys:1/0});if(a<=0||o.keys<=0)return i;let s=n?.cache;if(s){let e=N(i),t=s.get(i);if(t&&t.version===e)return t.value}if(t.has(i))return t.get(i);if(i instanceof Date)return i.getTime();if(i instanceof RegExp)return i.toString();if(i instanceof Map){let e=[];return t.set(i,e),i.forEach((n,r)=>{e.push([Y(r,t),Y(n,t)])}),e}if(i instanceof Set){let e=[];return t.set(i,e),i.forEach(n=>{e.push(Y(n,t))}),e}if(typeof ArrayBuffer<`u`){if(i instanceof ArrayBuffer)return i.byteLength;if(ArrayBuffer.isView(i)){let e=i;if(typeof e[Symbol.iterator]==`function`){let n=Array.from(e);return t.set(i,n),n.map(e=>Y(e,t))}let n=Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength));return t.set(i,n),n}}if(i instanceof Error)return{name:i.name,message:i.message};if(Array.isArray(i)){let e=[];return t.set(i,e),i.forEach((r,i)=>{let s=Y(r,t,{...n,_depth:a-1,_budget:o});e[i]=s===void 0?null:s}),s&&s.set(i,{version:N(i),value:e}),e}let c={};return t.set(i,c),Object.keys(i).forEach(e=>{if(--o.keys,o.keys<=0)return;let r=Y(i[e],t,{...n,_depth:a-1,_budget:o});r!==void 0&&(c[e]=r)}),s&&s.set(i,{version:N(i),value:c}),c}function ft(e,t){return Object.is(e,t)?!0:Array.isArray(e)&&Array.isArray(t)?pt(e,t):dt(e)&&dt(t)?mt(e,t):!1}function pt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ft(e[n],t[n]))return!1;return!0}function mt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!ft(e[r],t[r]))return!1;return!0}function ht(e){return e===void 0?null:e}function gt(e,t,n,r){if(!ft(e,t)){if(dt(e)&&dt(t)){for(let i of Object.keys(t)){if(!Object.prototype.hasOwnProperty.call(e,i)){r[`${n}.${i}`]=ht(t[i]);continue}gt(e[i],t[i],`${n}.${i}`,r)}for(let i of Object.keys(e))Object.prototype.hasOwnProperty.call(t,i)||(r[`${n}.${i}`]=null);return}if(Array.isArray(e)&&Array.isArray(t)){pt(e,t)||(r[n]=ht(t));return}r[n]=ht(t)}}function _t(e,t){let n={};for(let r of Object.keys(t))gt(e[r],t[r],r,n);for(let r of Object.keys(e))Object.prototype.hasOwnProperty.call(t,r)||(n[r]=null);return n}let vt,yt;function bt(){return vt}function xt(e){vt=e}function St(){return yt}function Ct(e){yt=e}function X(e){if(!vt)throw Error(`${e}() 必须在 setup() 的同步阶段调用`);return vt}function wt(e){return e.__wevuHooks||=Object.create(null),e.__wevuHooks}function Z(e,t,n,{single:r=!1}={}){let i=wt(e);r?i[t]=n:(i[t]??(i[t]=[])).push(n)}function Q(e,t,n=[]){let r=e.__wevuHooks;if(!r)return;let i=r[t];if(!i)return;let a=e.__wevu?.proxy??e;if(Array.isArray(i))for(let e of i)try{e.apply(a,n)}catch{}else if(typeof i==`function`)try{i.apply(a,n)}catch{}}function Tt(e,t,n=[]){let r=e.__wevuHooks;if(!r)return;let i=r[t];if(!i)return;let a=e.__wevu?.proxy??e;if(typeof i==`function`)try{return i.apply(a,n)}catch{return}if(Array.isArray(i)){let e;for(let t of i)try{e=t.apply(a,n)}catch{}return e}}function Et(e){Z(X(`onLaunch`),`onLaunch`,e)}function Dt(e){Z(X(`onPageNotFound`),`onPageNotFound`,e)}function Ot(e){Z(X(`onUnhandledRejection`),`onUnhandledRejection`,e)}function kt(e){Z(X(`onThemeChange`),`onThemeChange`,e)}function At(e){Z(X(`onShow`),`onShow`,e)}function jt(e){Z(X(`onLoad`),`onLoad`,e)}function Mt(e){Z(X(`onHide`),`onHide`,e)}function Nt(e){Z(X(`onUnload`),`onUnload`,e)}function Pt(e){Z(X(`onReady`),`onReady`,e)}function Ft(e){Z(X(`onPullDownRefresh`),`onPullDownRefresh`,e)}function It(e){Z(X(`onReachBottom`),`onReachBottom`,e)}function Lt(e){Z(X(`onPageScroll`),`onPageScroll`,e)}function Rt(e){Z(X(`onRouteDone`),`onRouteDone`,e)}function zt(e){Z(X(`onTabItemTap`),`onTabItemTap`,e)}function Bt(e){Z(X(`onResize`),`onResize`,e)}function Vt(e){Z(X(`onMoved`),`onMoved`,e)}function Ht(e){Z(X(`onError`),`onError`,e)}function Ut(e){Z(X(`onSaveExitState`),`onSaveExitState`,e,{single:!0})}function Wt(e){Z(X(`onShareAppMessage`),`onShareAppMessage`,e,{single:!0})}function Gt(e){Z(X(`onShareTimeline`),`onShareTimeline`,e,{single:!0})}function Kt(e){Z(X(`onAddToFavorites`),`onAddToFavorites`,e,{single:!0})}function qt(e){Z(X(`onMounted`),`onReady`,e)}function Jt(e){Z(X(`onUpdated`),`__wevuOnUpdated`,e)}function Yt(e){X(`onBeforeUnmount`),e()}function Xt(e){Z(X(`onUnmounted`),`onUnload`,e)}function Zt(e){X(`onBeforeMount`),e()}function Qt(e){Z(X(`onBeforeUpdate`),`__wevuOnBeforeUpdate`,e)}function $t(e){let t=X(`onErrorCaptured`);Z(t,`onError`,n=>e(n,t,``))}function en(e){Z(X(`onActivated`),`onShow`,e)}function tn(e){Z(X(`onDeactivated`),`onHide`,e)}function nn(e){X(`onServerPrefetch`)}function rn(e,t){Q(e,t===`before`?`__wevuOnBeforeUpdate`:`__wevuOnUpdated`)}const $=new Map;let an=0;function on(){return an+=1,`wv${an}`}function sn(e,t,n){let r=$.get(e)??{snapshot:{},proxy:n,subscribers:new Set};if(r.snapshot=t,r.proxy=n,$.set(e,r),r.subscribers.size)for(let e of r.subscribers)try{e(t,n)}catch{}}function cn(e){$.delete(e)}function ln(e,t){let n=$.get(e)??{snapshot:{},proxy:void 0,subscribers:new Set};return n.subscribers.add(t),$.set(e,n),()=>{let n=$.get(e);n&&n.subscribers.delete(t)}}function un(e){return $.get(e)?.proxy}function dn(e){return $.get(e)?.snapshot}function fn(e,t,n){try{t.state.__wvOwnerId=n}catch{}try{e.__wvOwnerId=n}catch{}let r=typeof t.snapshot==`function`?t.snapshot():{},i=e.__wevuProps??e.properties;if(i&&typeof i==`object`)for(let[e,t]of Object.entries(i))r[e]=t;sn(n,r,t.proxy)}function pn(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function mn(e,t,n){let r=typeof t==`string`?t:void 0;if(!r)return;let i=(n?.currentTarget)?.dataset?.wvArgs??(n?.target)?.dataset?.wvArgs,a=[];if(typeof i==`string`)try{a=JSON.parse(i)}catch{try{a=JSON.parse(pn(i))}catch{a=[]}}Array.isArray(a)||(a=[]);let o=a.map(e=>e===`$event`?n:e),s=e?.[r];if(typeof s==`function`)return s.apply(e,o)}function hn(e){let t=e.__wevu,n=e.__wvOwnerId;if(!t||!n||typeof t.snapshot!=`function`)return;let r=t.snapshot(),i=e.__wevuProps??e.properties;if(i&&typeof i==`object`)for(let[e,t]of Object.entries(i))r[e]=t;sn(n,r,t.proxy)}function gn(e,t,n){if(typeof e!=`function`)return;let r=n?.runtime??{methods:Object.create(null),state:{},proxy:{},watch:()=>()=>{},bindModel:()=>{}};n&&(n.runtime=r);let i={...n??{},runtime:r};return e.length>=2?e(t,i):e(i)}function _n(e,t,n){if(typeof e==`function`)return{handler:e.bind(t.proxy),options:{}};if(typeof e==`string`){let r=t.methods?.[e]??n[e];return typeof r==`function`?{handler:r.bind(t.proxy),options:{}}:void 0}if(!e||typeof e!=`object`)return;let r=_n(e.handler,t,n);if(!r)return;let i={...r.options};return e.immediate!==void 0&&(i.immediate=e.immediate),e.deep!==void 0&&(i.deep=e.deep),{handler:r.handler,options:i}}function vn(e,t){let n=t.split(`.`).map(e=>e.trim()).filter(Boolean);return n.length?()=>{let t=e;for(let e of n){if(t==null)return t;t=t[e]}return t}:()=>e}function yn(e,t,n){let r=[],i=e.proxy;for(let[a,o]of Object.entries(t)){let t=_n(o,e,n);if(!t)continue;let s=vn(i,a),c=e.watch(s,t.handler,t.options);r.push(c)}return r}function bn(e,t,n,r,i){if(e.__wevu)return e.__wevu;let a=on(),o=i?.deferSetData?(e=>{let t,n=!1,r={setData(r){if(!n){t={...t??{},...r};return}if(typeof e.setData==`function`)return e.setData(r)}};return r.__wevu_enableSetData=()=>{if(n=!0,t&&Object.keys(t).length&&typeof e.setData==`function`){let n=t;t=void 0,e.setData(n)}},r})(e):{setData(t){if(typeof e.setData==`function`)return e.setData(t)}},s,c=()=>{if(!s||typeof s.snapshot!=`function`)return;let t=s.snapshot(),n=e.__wevuProps??e.properties;if(n&&typeof n==`object`)for(let[e,r]of Object.entries(n))t[e]=r;sn(a,t,s.proxy)},l={...o,setData(e){let t=o.setData(e);return c(),t}},u=t.mount({...l});s=u;let d=u?.proxy??{},f=u?.state??{};if(!u?.methods)try{u.methods=Object.create(null)}catch{}let p=u?.methods??Object.create(null),m=u?.watch??(()=>()=>{}),h=u?.bindModel??(()=>{}),g={...u??{},state:f,proxy:d,methods:p,watch:m,bindModel:h};if(Object.defineProperty(e,`$wevu`,{value:g,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=g,fn(e,g,a),n){let t=yn(g,n,e);t.length&&(e.__wevuWatchStops=t)}if(r){let t=ye({...e.properties||{}});try{Object.defineProperty(e,`__wevuProps`,{value:t,configurable:!0,enumerable:!1,writable:!1})}catch{e.__wevuProps=t}let n={props:t,runtime:g,state:f,proxy:d,bindModel:h.bind(g),watch:m.bind(g),instance:e,emit:(t,n,r)=>{typeof e.triggerEvent==`function`&&e.triggerEvent(t,n,r)},expose:t=>{e.__wevuExposed=t},attrs:{},slots:Object.create(null)};xt(e),Ct(n);try{let e=gn(r,t,n);e&&typeof e==`object`&&Object.keys(e).forEach(t=>{let n=e[t];typeof n==`function`?u.methods[t]=(...e)=>n.apply(u.proxy,e):u.state[t]=n})}finally{Ct(void 0),xt(void 0)}}try{let t=u.methods;for(let n of Object.keys(t))typeof e[n]!=`function`&&(e[n]=function(...e){let t=this.$wevu?.methods?.[n];if(typeof t==`function`)return t.apply(this.$wevu.proxy,e)})}catch{}return u}function xn(e){let t=e.__wevu?.adapter;t&&typeof t.__wevu_enableSetData==`function`&&t.__wevu_enableSetData()}function Sn(e){let t=e.__wevu,n=e.__wvOwnerId;n&&cn(n),t&&e.__wevuHooks&&Q(e,`onUnload`,[]),e.__wevuHooks&&=void 0;let r=e.__wevuWatchStops;if(Array.isArray(r))for(let e of r)try{e()}catch{}e.__wevuWatchStops=void 0,t&&t.unmount(),delete e.__wevu,`$wevu`in e&&delete e.$wevu}function Cn(e,t,n,r,i){if(typeof App!=`function`)throw TypeError(`createApp 需要全局 App 构造器可用`);let a=Object.keys(t??{}),o={...i};o.globalData=o.globalData??{},o.__weapp_vite_inline||=function(e){let t=e?.currentTarget?.dataset?.wvHandler??e?.target?.dataset?.wvHandler;return mn(this.__wevu?.proxy??this,t,e)};let s=o.onLaunch;o.onLaunch=function(...t){bn(this,e,n,r),Q(this,`onLaunch`,t),typeof s==`function`&&s.apply(this,t)};let c=o.onShow;o.onShow=function(...e){Q(this,`onShow`,e),typeof c==`function`&&c.apply(this,e)};let l=o.onHide;o.onHide=function(...e){Q(this,`onHide`,e),typeof l==`function`&&l.apply(this,e)};let u=o.onError;o.onError=function(...e){Q(this,`onError`,e),typeof u==`function`&&u.apply(this,e)};let d=o.onPageNotFound;o.onPageNotFound=function(...e){Q(this,`onPageNotFound`,e),typeof d==`function`&&d.apply(this,e)};let f=o.onUnhandledRejection;o.onUnhandledRejection=function(...e){Q(this,`onUnhandledRejection`,e),typeof f==`function`&&f.apply(this,e)};let p=o.onThemeChange;o.onThemeChange=function(...e){Q(this,`onThemeChange`,e),typeof p==`function`&&p.apply(this,e)};for(let e of a){let t=o[e];o[e]=function(...n){let r=this.__wevu,i,a=r?.methods?.[e];return a&&(i=a.apply(r.proxy,n)),typeof t==`function`?t.apply(this,n):i}}App(o)}function wn(e,t,n,r,i){let{methods:a={},lifetimes:o={},pageLifetimes:s={},options:c={},...l}=i,u=l.onLoad,d=l.onUnload,f=l.onShow,p=l.onHide,m=l.onReady,h=l.onSaveExitState,g=l.onPullDownRefresh,_=l.onReachBottom,ee=l.onPageScroll,te=l.onRouteDone,v=l.onTabItemTap,ne=l.onResize,y=l.onShareAppMessage,re=l.onShareTimeline,b=l.onAddToFavorites,x=l.features??{},S={...l},C=S.observers,ie=S.created;delete S.features,delete S.created,delete S.onLoad,delete S.onUnload,delete S.onShow,delete S.onHide,delete S.onReady;let ae=typeof g==`function`||!!x.enableOnPullDownRefresh,oe=typeof _==`function`||!!x.enableOnReachBottom,se=typeof ee==`function`||!!x.enableOnPageScroll,ce=typeof te==`function`||!!x.enableOnRouteDone,w=typeof v==`function`||!!x.enableOnTabItemTap,T=typeof ne==`function`||!!x.enableOnResize,E=typeof y==`function`||!!x.enableOnShareAppMessage,D=typeof re==`function`||!!x.enableOnShareTimeline,O=typeof b==`function`||!!x.enableOnAddToFavorites,k=typeof h==`function`||!!x.enableOnSaveExitState,A=()=>{},le=()=>({}),j=()=>({}),M=typeof h==`function`?h:(()=>({data:void 0})),N=typeof g==`function`?g:A,ue=typeof _==`function`?_:A,P=typeof ee==`function`?ee:A,de=typeof te==`function`?te:A,fe=typeof v==`function`?v:A,F=typeof ne==`function`?ne:A,I=typeof y==`function`?y:le,L=typeof re==`function`?re:j,R=typeof b==`function`?b:(()=>({})),z=(e,t)=>{let n=e.__wevuHooks;if(!n)return!1;let r=n[t];return r?Array.isArray(r)?r.length>0:typeof r==`function`:!1};{let e=S.export;S.export=function(){let t=this.__wevuExposed??{},n=typeof e==`function`?e.call(this):{};return n&&typeof n==`object`&&!Array.isArray(n)?{...t,...n}:n??t}}let pe={multipleSlots:c.multipleSlots??!0,...c},B=e=>{let t=e.__wevuProps,n=e.properties;if(!t||typeof t!=`object`||!n||typeof n!=`object`)return;let r=n,i=Object.keys(t);for(let e of i)if(!Object.prototype.hasOwnProperty.call(r,e))try{delete t[e]}catch{}for(let[e,n]of Object.entries(r))try{t[e]=n}catch{}hn(e)},me=(e,t,n)=>{let r=e.__wevuProps;if(!(!r||typeof r!=`object`)){try{r[t]=n}catch{}hn(e)}},V=S.properties&&typeof S.properties==`object`?Object.keys(S.properties):[],H={};if(V.length)for(let e of V)H[e]=function(t){me(this,e,t)};let U={...C??{}};for(let[e,t]of Object.entries(H)){let n=U[e];typeof n==`function`?U[e]=function(...e){n.apply(this,e),t.apply(this,e)}:U[e]=t}let W={...a};W.__weapp_vite_inline||=function(e){let t=e?.currentTarget?.dataset?.wvHandler??e?.target?.dataset?.wvHandler;return mn(this.__wevu?.proxy??this,t,e)},W.__weapp_vite_model||=function(e){let t=e?.currentTarget?.dataset?.wvModel??e?.target?.dataset?.wvModel;if(typeof t!=`string`||!t)return;let n=this.__wevu;if(!n||typeof n.bindModel!=`function`)return;let r=Ke(e);try{n.bindModel(t).update(r)}catch{}},!W.__weapp_vite_owner&&typeof t?.__weapp_vite_owner==`function`&&(W.__weapp_vite_owner=t.__weapp_vite_owner);let G=Object.keys(t??{});for(let e of G){let t=W[e];W[e]=function(...n){let r=this.__wevu,i,a=r?.methods?.[e];return a&&(i=a.apply(r.proxy,n)),typeof t==`function`?t.apply(this,n):i}}let K={onLoad(...t){if(bn(this,e,n,r),xn(this),Q(this,`onLoad`,t),typeof u==`function`)return u.apply(this,t)},onUnload(...e){if(Sn(this),typeof d==`function`)return d.apply(this,e)},onShow(...e){if(Q(this,`onShow`,e),typeof f==`function`)return f.apply(this,e)},onHide(...e){if(Q(this,`onHide`,e),typeof p==`function`)return p.apply(this,e)},onReady(...e){if(this.__wevuReadyCalled||(this.__wevuReadyCalled=!0,Q(this,`onReady`,e)),typeof m==`function`)return m.apply(this,e)}};k&&(K.onSaveExitState=function(...e){let t=Tt(this,`onSaveExitState`,e);return t===void 0?M.apply(this,e):t}),ae&&(K.onPullDownRefresh=function(...e){if(Q(this,`onPullDownRefresh`,e),!z(this,`onPullDownRefresh`))return N.apply(this,e)}),oe&&(K.onReachBottom=function(...e){if(Q(this,`onReachBottom`,e),!z(this,`onReachBottom`))return ue.apply(this,e)}),se&&(K.onPageScroll=function(...e){if(Q(this,`onPageScroll`,e),!z(this,`onPageScroll`))return P.apply(this,e)}),ce&&(K.onRouteDone=function(...e){if(Q(this,`onRouteDone`,e),!z(this,`onRouteDone`))return de.apply(this,e)}),w&&(K.onTabItemTap=function(...e){if(Q(this,`onTabItemTap`,e),!z(this,`onTabItemTap`))return fe.apply(this,e)}),T&&(K.onResize=function(...e){if(Q(this,`onResize`,e),!z(this,`onResize`))return F.apply(this,e)}),E&&(K.onShareAppMessage=function(...e){let t=Tt(this,`onShareAppMessage`,e);return t===void 0?I.apply(this,e):t}),D&&(K.onShareTimeline=function(...e){let t=Tt(this,`onShareTimeline`,e);return t===void 0?L.apply(this,e):t}),O&&(K.onAddToFavorites=function(...e){let t=Tt(this,`onAddToFavorites`,e);return t===void 0?R.apply(this,e):t}),Component({...S,...K,observers:U,lifetimes:{...o,created:function(...t){bn(this,e,n,r,{deferSetData:!0}),B(this),typeof ie==`function`&&ie.apply(this,t),typeof o.created==`function`&&o.created.apply(this,t)},moved:function(...e){Q(this,`onMoved`,e),typeof o.moved==`function`&&o.moved.apply(this,e)},attached:function(...t){bn(this,e,n,r),B(this),xn(this),typeof o.attached==`function`&&o.attached.apply(this,t)},ready:function(...e){this.__wevuReadyCalled||(this.__wevuReadyCalled=!0,B(this),Q(this,`onReady`,e)),typeof o.ready==`function`&&o.ready.apply(this,e)},detached:function(...e){Sn(this),typeof o.detached==`function`&&o.detached.apply(this,e)},error:function(...e){Q(this,`onError`,e),typeof o.error==`function`&&o.error.apply(this,e)}},pageLifetimes:{...s,show:function(...e){Q(this,`onShow`,e),typeof s.show==`function`&&s.show.apply(this,e)},hide:function(...e){Q(this,`onHide`,e),typeof s.hide==`function`&&s.hide.apply(this,e)},resize:function(...e){Q(this,`onResize`,e),typeof s.resize==`function`&&s.resize.apply(this,e)}},methods:W,options:pe})}function Tn(e){let{[Qe]:t,data:n,computed:r,methods:i,setData:o,watch:s,setup:c,...l}=e[Qe]===`component`?e:nt(e),u=i??{},d=r??{},f=new Set,p={globalProperties:{}},m={mount(e){let t=U((n??(()=>({})))()),r=d,i=u,s=Object.create(null),c=Object.create(null),l={},f=!0,m={},h=[],g=o?.includeComputed??!0,_=o?.strategy??`diff`,ee=typeof o?.maxPatchKeys==`number`?Math.max(0,o.maxPatchKeys):1/0,te=typeof o?.maxPayloadBytes==`number`?Math.max(0,o.maxPayloadBytes):1/0,v=typeof o?.mergeSiblingThreshold==`number`?Math.max(2,Math.floor(o.mergeSiblingThreshold)):0,ne=typeof o?.mergeSiblingMaxInflationRatio==`number`?Math.max(0,o.mergeSiblingMaxInflationRatio):1.25,y=typeof o?.mergeSiblingMaxParentBytes==`number`?Math.max(0,o.mergeSiblingMaxParentBytes):1/0,re=o?.mergeSiblingSkipArray??!0,ie=o?.computedCompare??(_===`patch`?`deep`:`reference`),ae=typeof o?.computedCompareMaxDepth==`number`?Math.max(0,Math.floor(o.computedCompareMaxDepth)):4,oe=typeof o?.computedCompareMaxKeys==`number`?Math.max(0,Math.floor(o.computedCompareMaxKeys)):200,se=o?.prelinkMaxDepth,ce=o?.prelinkMaxKeys,w=o?.debug,T=o?.debugWhen??`fallback`,E=typeof o?.debugSampleRate==`number`?Math.min(1,Math.max(0,o.debugSampleRate)):1,D=typeof o?.elevateTopKeyThreshold==`number`?Math.max(0,Math.floor(o.elevateTopKeyThreshold)):1/0,O=typeof o?.toPlainMaxDepth==`number`?Math.max(0,Math.floor(o.toPlainMaxDepth)):1/0,k=typeof o?.toPlainMaxKeys==`number`?Math.max(0,Math.floor(o.toPlainMaxKeys)):1/0,A=Array.isArray(o?.pick)&&o.pick.length>0?new Set(o.pick):void 0,le=Array.isArray(o?.omit)&&o.omit.length>0?new Set(o.omit):void 0,j=e=>!(A&&!A.has(e)||le&&le.has(e)),M=new Set,N=(e,t,n)=>{let r,i=!0,a,o={get value(){return i&&=(r=a(),!1),S(o,`value`),r},set value(e){if(!n)throw Error(`计算属性是只读的`);n(e)}};return we(o),a=b(t,{lazy:!0,scheduler:()=>{i||(i=!0,_===`patch`&&g&&M.add(e),C(o,`value`))}}),o},ue=new Proxy({},{get(e,t){if(typeof t==`string`&&s[t])return s[t].value},has(e,t){return typeof t==`string`&&!!s[t]},ownKeys(){return Object.keys(s)},getOwnPropertyDescriptor(e,t){if(typeof t==`string`&&s[t])return{configurable:!0,enumerable:!0,value:s[t].value}}}),P=new Proxy(t,{get(e,n,r){if(typeof n==`string`){if(n===`$state`)return t;if(n===`$computed`)return ue;if(Object.prototype.hasOwnProperty.call(l,n))return l[n];if(s[n])return s[n].value;if(Object.prototype.hasOwnProperty.call(p.globalProperties,n))return p.globalProperties[n]}return Reflect.get(e,n,r)},set(e,t,n,r){return typeof t==`string`&&s[t]?(Ge(c,t,n),!0):Reflect.set(e,t,n,r)},has(e,t){return typeof t==`string`&&(s[t]||Object.prototype.hasOwnProperty.call(l,t))?!0:Reflect.has(e,t)},ownKeys(e){let t=new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Object.keys(l).forEach(e=>t.add(e)),Object.keys(s).forEach(e=>t.add(e)),Array.from(t)},getOwnPropertyDescriptor(e,t){if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);if(typeof t==`string`){if(s[t])return{configurable:!0,enumerable:!0,get(){return s[t].value},set(e){Ge(c,t,e)}};if(Object.prototype.hasOwnProperty.call(l,t))return{configurable:!0,enumerable:!1,value:l[t]}}}});Object.keys(i).forEach(e=>{let t=i[e];typeof t==`function`&&(l[e]=(...e)=>t.apply(P,e))}),Object.keys(r).forEach(e=>{let t=r[e];if(typeof t==`function`)s[e]=N(e,()=>t.call(P));else{let n=t.get?.bind(P);if(!n)throw Error(`计算属性 "${e}" 需要提供 getter`);let r=t.set?.bind(P);r?(c[e]=r,s[e]=N(e,n,r)):s[e]=N(e,n)}});let F=e??{setData:()=>{}},I=new WeakMap,L=e=>e===void 0?null:e,R=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},z=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(R(e)&&R(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}return!1},pe=(e,t,n,r)=>{if(Object.is(e,t))return!0;if(n<=0||r.keys<=0||typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!pe(e[i],t[i],n-1,r))return!1;return!0}if(!R(e)||!R(t))return!1;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let a of i)if(--r.keys,r.keys<=0||!Object.prototype.hasOwnProperty.call(t,a)||!pe(e[a],t[a],n-1,r))return!1;return!0},B=(e,t,n,r)=>{let i=t.split(`.`).filter(Boolean);if(!i.length)return;let a=e;for(let e=0;e<i.length-1;e++){let t=i[e];(!Object.prototype.hasOwnProperty.call(a,t)||a[t]==null||typeof a[t]!=`object`)&&(a[t]=Object.create(null)),a=a[t]}let o=i[i.length-1];if(r===`delete`)try{delete a[o]}catch{a[o]=null}else a[o]=n},me=()=>{let e=new WeakMap,n=Object.create(null),r=Number.isFinite(k)?{keys:k}:void 0,i=W(t)?G(t):t,a=Object.keys(i),o=g?Object.keys(s):[];for(let t of a)j(t)&&(n[t]=Y(i[t],e,{cache:I,maxDepth:O,_budget:r}));for(let t of o)j(t)&&(n[t]=Y(s[t].value,e,{cache:I,maxDepth:O,_budget:r}));return n},V=_===`patch`,H=new Map,K=G(t),q=new Set,ve=e=>{if(!f||e.root!==K)return;if(!e.path){if(Array.isArray(e.fallbackTopKeys)&&e.fallbackTopKeys.length)for(let t of e.fallbackTopKeys)q.add(t);else V=!0;return}let t=e.path.split(`.`,1)[0];j(t)&&H.set(e.path,{kind:e.kind,op:e.op})},ye=Object.create(null),be=e=>{if(!w)return;let t=e.reason!==`patch`&&e.reason!==`diff`;if(!(T===`fallback`&&!t)&&!(E<1&&Math.random()>E))try{w(e)}catch{}},xe=(e=`diff`)=>{let t=me(),n=_t(m,t);if(m=t,V=!1,H.clear(),_===`patch`&&g){ye=Object.create(null);for(let e of Object.keys(s))j(e)&&(ye[e]=t[e]);M.clear()}if(Object.keys(n).length){if(typeof F.setData==`function`){let e=F.setData(n);e&&typeof e.then==`function`&&e.catch(()=>{})}be({mode:`diff`,reason:e,pendingPatchKeys:0,payloadKeys:Object.keys(n).length})}},Se,Ce=()=>{if(f)if(Se?.(),_===`patch`&&!V){if(H.size>ee){V=!0;let e=H.size;H.clear(),M.clear(),be({mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}),xe(`maxPatchKeys`);return}let e=new WeakMap,n=new Map,r=Object.create(null),i=Array.from(H.entries());if(Number.isFinite(D)&&D>0){let e=new Map;for(let[t]of i){let n=t.split(`.`,1)[0];e.set(n,(e.get(n)??0)+1)}for(let[t,n]of e)n>=D&&q.add(t)}let a=i.filter(([e])=>{for(let t of q)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),o=new Map(a);H.clear();let c=e=>{let n=e.split(`.`).filter(Boolean),r=t;for(let e of n){if(r==null)return r;r=r[e]}return r},l=t=>{if(n.has(t))return n.get(t);let r=L(Y(c(t),e,{cache:I,maxDepth:O,maxKeys:k}));return n.set(t,r),r};if(q.size){for(let e of q)j(e)&&(r[e]=l(e),o.set(e,{kind:`property`,op:`set`}));q.clear()}for(let[e,t]of a){if((t.kind===`array`?`set`:t.op)===`delete`){r[e]=null;continue}r[e]=l(e)}let u=0;if(g&&M.size){let t=Object.create(null),n=Array.from(M);M.clear(),u=n.length;for(let r of n){if(!j(r))continue;let n=Y(s[r].value,e,{cache:I,maxDepth:O,maxKeys:k}),i=ye[r];(ie===`deep`?pe(i,n,ae,{keys:oe}):ie===`shallow`?z(i,n):Object.is(i,n))||(t[r]=L(n),ye[r]=n)}Object.assign(r,t)}let d=e=>{let t=Object.keys(e).sort();if(t.length<=1)return e;let n=Object.create(null),r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n},f=(e,t,n)=>{if(t<=0)return t+1;if(e===null)return 4;let r=typeof e;if(r===`string`)return 2+e.length;if(r===`number`)return Number.isFinite(e)?String(e).length:4;if(r===`boolean`)return e?4:5;if(r===`undefined`||r===`function`||r===`symbol`||r!==`object`||n.has(e))return 4;if(n.add(e),Array.isArray(e)){let r=2;for(let i=0;i<e.length;i++)if(i&&(r+=1),r+=f(e[i],t-r,n),r>t)return r;return r}let i=2;for(let[r,a]of Object.entries(e))if(i>2&&(i+=1),i+=2+r.length+1,i+=f(a,t-i,n),i>t)return i;return i},p=e=>{if(te===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let t=te,n=Object.keys(e).length,r=f(e,t+1,new WeakSet);if(r>t)return{fallback:!0,estimatedBytes:r,bytes:void 0};if(r>=t*.85&&n>2)try{let n=JSON.stringify(e).length;return{fallback:n>t,estimatedBytes:r,bytes:n}}catch{return{fallback:!1,estimatedBytes:r,bytes:void 0}}return{fallback:!1,estimatedBytes:r,bytes:void 0}},h=e=>{if(!v)return{out:e,merged:0};let t=Object.keys(e);if(t.length<v)return{out:e,merged:0};let n=new Map,r=new Set;for(let i of t){let t=o.get(i);if(!t)continue;if(e[i]===null||t.op===`delete`){let e=i.lastIndexOf(`.`);e>0&&r.add(i.slice(0,e));continue}let a=i.lastIndexOf(`.`);if(a<=0)continue;let s=i.slice(0,a),c=n.get(s)??[];c.push(i),n.set(s,c)}let i=Array.from(n.entries()).filter(([e,t])=>t.length>=v&&!r.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!i.length)return{out:e,merged:0};let a=Object.create(null);Object.assign(a,e);let s=0,c=new WeakMap,u=e=>{if(e&&typeof e==`object`){let t=c.get(e);if(t!==void 0)return t;let n=f(e,1/0,new WeakSet);return c.set(e,n),n}return f(e,1/0,new WeakSet)},d=(e,t)=>2+e.length+1+u(t);for(let[e,t]of i){if(Object.prototype.hasOwnProperty.call(a,e))continue;let n=t.filter(e=>Object.prototype.hasOwnProperty.call(a,e));if(n.length<v)continue;let r=l(e);if(!(re&&Array.isArray(r))&&!(y!==1/0&&d(e,r)>y)){if(ne!==1/0){let t=0;for(let e of n)t+=d(e,a[e]);if(d(e,r)>t*ne)continue}a[e]=r;for(let e of n)delete a[e];s+=1}}return{out:a,merged:s}},_=d(r),b=0;if(v){let e=h(_);b=e.merged,_=d(e.out)}let x=p(_),S=x.fallback;if(be({mode:S?`diff`:`patch`,reason:S?`maxPayloadBytes`:`patch`,pendingPatchKeys:a.length,payloadKeys:Object.keys(_).length,mergedSiblingParents:b||void 0,computedDirtyKeys:u||void 0,estimatedBytes:x.estimatedBytes,bytes:x.bytes}),S){V=!0,H.clear(),M.clear(),xe(`maxPayloadBytes`);return}if(!Object.keys(_).length)return;for(let[e,t]of Object.entries(_)){let n=o.get(e);n?B(m,e,t,n.kind===`array`?`set`:n.op):B(m,e,t,`set`)}if(typeof F.setData==`function`){let e=F.setData(_);e&&typeof e.then==`function`&&e.catch(()=>{})}be({mode:`patch`,reason:`patch`,pendingPatchKeys:a.length,payloadKeys:Object.keys(_).length})}else xe(V?`needsFullSnapshot`:`diff`)};Se=b(()=>{_e(t),Object.keys(t).forEach(e=>{let n=t[e];J(n)?n.value:W(n)&&_e(n)})},{lazy:!0,scheduler:()=>a(Ce)}),Ce(),h.push(()=>x(Se)),_===`patch`&&(he(t,{shouldIncludeTopKey:j,maxDepth:se,maxKeys:ce}),de(ve),h.push(()=>fe(ve)),h.push(()=>ge(t)));function Te(e,t,n){let r=Ve(e,(e,n)=>t(e,n),n);return h.push(r),()=>{r();let e=h.indexOf(r);e>=0&&h.splice(e,1)}}return{get state(){return t},get proxy(){return P},get methods(){return l},get computed(){return ue},get adapter(){return F},bindModel:Ze(P,t,s,c),watch:Te,snapshot:()=>_===`patch`?me():{...m},unmount:()=>{f&&(f=!1,h.forEach(e=>{try{e()}catch{}}),h.length=0)}}},use(e,...t){if(!e||f.has(e))return m;if(f.add(e),typeof e==`function`)e(m,...t);else if(typeof e.install==`function`)e.install(m,...t);else throw TypeError(`插件必须是函数,或包含 install 方法的对象`);return m},config:p};if(typeof globalThis.App==`function`){let e=globalThis,t=e.__wxConfig!==void 0,n=`__wevuAppRegistered`;(!t||!e[n])&&(t&&(e[n]=!0),Cn(m,i??{},s,c,l))}return m}function En(e){Pn();let{data:t,computed:n,methods:r,setData:i,watch:a,setup:o,props:s,...c}=rt(e),l=Tn({data:t,computed:n,methods:r,setData:i,[Qe]:`component`}),u=e=>{let t=gn(o,e?.props??{},e);t&&Dn(e.runtime,e.instance,t)},d=Fn(c,s),f={data:t,computed:n,methods:r,setData:i,watch:a,setup:u,mpOptions:d};return wn(l,r??{},a,u,d),{__wevu_runtime:l,__wevu_options:f}}function Dn(e,t,n){let r=e?.methods??Object.create(null),i=e?.state??Object.create(null),a=W(i)?G(i):i;if(e&&!e.methods)try{e.methods=r}catch{}if(e&&!e.state)try{e.state=i}catch{}Object.keys(n).forEach(o=>{let s=n[o];if(typeof s==`function`)r[o]=(...t)=>s.apply(e?.proxy??e,t);else if(s===t||!kn(s))try{Object.defineProperty(a,o,{value:s,configurable:!0,enumerable:!1,writable:!0})}catch{i[o]=s}else i[o]=s}),e&&(e.methods=e.methods??r,e.state=e.state??i)}function On(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function kn(e){return typeof e!=`object`||!e||J(e)||W(e)||Array.isArray(e)?!0:On(e)}function An(e){Pn();let{properties:t,props:n,...r}=e;En(Fn(r,n,t))}function jn(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`)}function Mn(e){let t=e?.currentTarget?.dataset?.wvArgs??e?.target?.dataset?.wvArgs,n=[];if(typeof t==`string`)try{n=JSON.parse(t)}catch{try{n=JSON.parse(jn(t))}catch{n=[]}}return Array.isArray(n)||(n=[]),n.map(t=>t===`$event`?e:t)}function Nn(e){let t=e=>{if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e},n=(e,n)=>{let r=Object.prototype.hasOwnProperty.call(n??{},`__wvSlotScope`)?n.__wvSlotScope:e?.properties?.__wvSlotScope,i=Object.prototype.hasOwnProperty.call(n??{},`__wvSlotProps`)?n.__wvSlotProps:e?.properties?.__wvSlotProps,a=t(r),o=t(i),s={...a,...o};typeof e?.setData==`function`&&e.setData({__wvSlotPropsData:s})},r={properties:{__wvOwnerId:{type:String,value:``},__wvSlotProps:{type:null,value:null,observer(e){n(this,{__wvSlotProps:e})}},__wvSlotScope:{type:null,value:null,observer(e){n(this,{__wvSlotScope:e})}}},data:()=>({__wvOwner:{},__wvSlotPropsData:{}}),lifetimes:{attached(){let e=this.properties?.__wvOwnerId??``;if(n(this),!e)return;let t=(e,t)=>{this.__wvOwnerProxy=t,typeof this.setData==`function`&&this.setData({__wvOwner:e||{}})};this.__wvOwnerUnsub=ln(e,t);let r=dn(e);r&&t(r,un(e))},detached(){typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerProxy=void 0}},methods:{__weapp_vite_owner(e){let t=e?.currentTarget?.dataset?.wvHandler??e?.target?.dataset?.wvHandler;if(typeof t!=`string`||!t)return;let n=this.__wvOwnerProxy,r=n?.[t];if(typeof r!=`function`)return;let i=Mn(e);return r.apply(n,i)}}};e?.computed&&Object.keys(e.computed).length>0&&(r.computed=e.computed),An(r)}Pn();function Pn(){let e=typeof globalThis<`u`?globalThis:void 0;if(!e)return;let t=e;t.__weapp_vite_createScopedSlotComponent||=Nn}function Fn(e,t,n){let r=e.properties,i=n??(r&&typeof r==`object`?r:void 0),a=e=>{let t={...e??{}};return Object.prototype.hasOwnProperty.call(t,`__wvSlotOwnerId`)||(t.__wvSlotOwnerId={type:String,value:``}),Object.prototype.hasOwnProperty.call(t,`__wvSlotScope`)||(t.__wvSlotScope={type:null,value:null}),t};if(i||!t){let{properties:t,...n}=e;return{...n,properties:a(i)}}let o={};return Object.entries(t).forEach(([e,t])=>{if(t!=null){if(Array.isArray(t)||typeof t==`function`){o[e]={type:t};return}if(typeof t==`object`){if(e.endsWith(`Modifiers`)&&Object.keys(t).length===0){o[e]={type:Object,value:{}};return}let n={};`type`in t&&t.type!==void 0&&(n.type=t.type);let r=`default`in t?t.default:t.value;r!==void 0&&(n.value=typeof r==`function`?r():r),o[e]=n}}}),{...e,properties:a(o)}}const In=Symbol(`wevu.provideScope`),Ln=new Map;function Rn(e,t){let n=bt();if(n){let r=n[In];r||(r=new Map,n[In]=r),r.set(e,t)}else Ln.set(e,t)}function zn(e,t){let n=bt();if(n){let t=n;for(;t;){let n=t[In];if(n&&n.has(e))return n.get(e);t=null}}if(Ln.has(e))return Ln.get(e);if(arguments.length>=2)return t;throw Error(`wevu.inject:未找到对应 key 的值`)}function Bn(e,t){Ln.set(e,t)}function Vn(e,t){if(Ln.has(e))return Ln.get(e);if(arguments.length>=2)return t;throw Error(`injectGlobal():未找到对应 key 的 provider:${String(e)}`)}const Hn=/\B([A-Z])/g;function Un(e){return e?e.startsWith(`--`)?e:e.replace(Hn,`-$1`).toLowerCase():``}function Wn(e,t){if(!t)return e;if(!e)return t;let n=e;n.endsWith(`;`)||(n+=`;`);let r=t.startsWith(`;`)?t.slice(1):t;return n+r}function Gn(e){let t=``;for(let n of Object.keys(e)){let r=e[n];if(r==null)continue;let i=Un(n);if(Array.isArray(r))for(let e of r)e!=null&&(t=Wn(t,`${i}:${e}`));else t=Wn(t,`${i}:${r}`)}return t}function Kn(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e)){let t=``;for(let n of e){let e=Kn(n);e&&(t=Wn(t,e))}return t}return typeof e==`object`?Gn(e):``}function qn(e){let t=``;if(!e)return t;if(typeof e==`string`)return e;if(Array.isArray(e)){for(let n of e){let e=qn(n);e&&(t+=`${e} `)}return t.trim()}if(typeof e==`object`){for(let n of Object.keys(e))e[n]&&(t+=`${n} `);return t.trim()}return t}function Jn(){let e=St();if(!e)throw Error(`useAttrs() 必须在 setup() 的同步阶段调用`);return e.attrs??{}}function Yn(){let e=St();if(!e)throw Error(`useSlots() 必须在 setup() 的同步阶段调用`);return e.slots??Object.create(null)}function Xn(e,t){let n=St();if(!n)throw Error(`useModel() 必须在 setup() 的同步阶段调用`);let r=n.emit,i=`update:${t}`;return ke({get:()=>e?.[t],set:e=>{r?.(i,e)}})}function Zn(){let e=bt();if(!e?.__wevu||typeof e.__wevu.bindModel!=`function`)throw Error(`useBindModel() 必须在 setup() 的同步阶段调用`);return e.__wevu.bindModel.bind(e.__wevu)}function Qn(e,t){return e==null?t:t==null?e:Array.isArray(e)&&Array.isArray(t)?Array.from(new Set([...e,...t])):typeof e==`object`&&typeof t==`object`?{...e,...t}:t}function $n(e,t,n,r){return function(...i){let a=[],o=[],s=e=>a.push(e),c=e=>o.push(e);r.forEach(n=>{try{n({name:t,store:e,args:i,after:s,onError:c})}catch{}});let l;try{l=n.apply(e,i)}catch(e){throw o.forEach(t=>t(e)),e}let u=e=>(a.forEach(t=>t(e)),e);return l&&typeof l.then==`function`?l.then(e=>u(e),e=>(o.forEach(t=>t(e)),Promise.reject(e))):u(l)}}function er(e){return typeof e==`object`&&!!e}function tr(e,t){for(let n in t)e[n]=t[n]}function nr(e,t,n,r){let i={$id:e};Object.defineProperty(i,`$state`,{get(){return t},set(e){t&&er(e)&&(tr(t,e),n(`patch object`))}}),i.$patch=e=>{if(!t){typeof e==`function`?(e(i),n(`patch function`)):(tr(i,e),n(`patch object`));return}typeof e==`function`?(e(t),n(`patch function`)):(tr(t,e),n(`patch object`))},r&&(i.$reset=()=>r());let a=new Set;i.$subscribe=(e,t)=>(a.add(e),()=>a.delete(e));let o=new Set;return i.$onAction=e=>(o.add(e),()=>o.delete(e)),{api:i,subs:a,actionSubs:o}}function rr(){let e={_stores:new Map,_plugins:[],install(e){},use(t){return typeof t==`function`&&e._plugins.push(t),e}};return rr._instance=e,e}function ir(e,t){let n,r=!1,i=rr._instance;return function(){if(r&&n)return n;if(r=!0,typeof t==`function`){let r=t(),a=()=>{},o=nr(e,void 0,e=>a(e));a=t=>{o.subs.forEach(r=>{try{r({type:t,storeId:e},n)}catch{}})},n=Object.assign({},r);for(let e of Object.getOwnPropertyNames(o.api)){let t=Object.getOwnPropertyDescriptor(o.api,e);t&&Object.defineProperty(n,e,t)}Object.keys(r).forEach(e=>{let t=r[e];typeof t==`function`&&!e.startsWith(`$`)&&(n[e]=$n(n,e,t,o.actionSubs))});let s=i?._plugins??[];for(let e of s)try{e({store:n})}catch{}return n}let a=t,o=a.state?a.state():{},s=U(o),c={...G(o)},l=()=>{},u=nr(e,s,e=>l(e),()=>{tr(s,c),l(`patch object`)});l=t=>{u.subs.forEach(n=>{try{n({type:t,storeId:e},s)}catch{}})};let d={};for(let e of Object.getOwnPropertyNames(u.api)){let t=Object.getOwnPropertyDescriptor(u.api,e);t&&Object.defineProperty(d,e,t)}let f=a.getters??{},p={};Object.keys(f).forEach(e=>{let t=f[e];if(typeof t==`function`){let n=Ae(()=>t.call(d,s));p[e]=n,Object.defineProperty(d,e,{enumerable:!0,configurable:!0,get(){return n.value}})}});let m=a.actions??{};Object.keys(m).forEach(e=>{let t=m[e];typeof t==`function`&&(d[e]=$n(d,e,(...e)=>t.apply(d,e),u.actionSubs))}),Object.keys(s).forEach(e=>{Object.defineProperty(d,e,{enumerable:!0,configurable:!0,get(){return s[e]},set(t){s[e]=t}})}),n=d;let h=i?._plugins??[];for(let e of h)try{e({store:n})}catch{}return n}}function ar(e){let t={};for(let n in e){let r=e[n];if(typeof r==`function`){t[n]=r;continue}J(r)?t[n]=r:t[n]=Ae({get:()=>e[n],set:t=>{e[n]=t}})}return t}exports.addMutationRecorder=de,exports.batch=m,exports.callHookList=Q,exports.callHookReturn=Tt,exports.callUpdateHooks=rn,exports.computed=Ae,exports.createApp=Tn,exports.createStore=rr,exports.createWevuComponent=An,exports.createWevuScopedSlotComponent=Nn,exports.defineComponent=En,exports.defineStore=ir,exports.effect=b,exports.effectScope=ee,exports.endBatch=p,exports.getCurrentInstance=bt,exports.getCurrentScope=te,exports.getCurrentSetupContext=St,exports.getDeepWatchStrategy=Be,exports.getReactiveVersion=N,exports.inject=zn,exports.injectGlobal=Vn,exports.isNoSetData=ut,exports.isRaw=Se,exports.isReactive=W,exports.isRef=J,exports.isShallowReactive=be,exports.isShallowRef=Ne,exports.markNoSetData=lt,exports.markRaw=xe,exports.mergeModels=Qn,exports.mountRuntimeInstance=bn,exports.nextTick=o,exports.normalizeClass=qn,exports.normalizeStyle=Kn,exports.onActivated=en,exports.onAddToFavorites=Kt,exports.onBeforeMount=Zt,exports.onBeforeUnmount=Yt,exports.onBeforeUpdate=Qt,exports.onDeactivated=tn,exports.onError=Ht,exports.onErrorCaptured=$t,exports.onHide=Mt,exports.onLaunch=Et,exports.onLoad=jt,exports.onMounted=qt,exports.onMoved=Vt,exports.onPageNotFound=Dt,exports.onPageScroll=Lt,exports.onPullDownRefresh=Ft,exports.onReachBottom=It,exports.onReady=Pt,exports.onResize=Bt,exports.onRouteDone=Rt,exports.onSaveExitState=Ut,exports.onScopeDispose=v,exports.onServerPrefetch=nn,exports.onShareAppMessage=Wt,exports.onShareTimeline=Gt,exports.onShow=At,exports.onTabItemTap=zt,exports.onThemeChange=kt,exports.onUnhandledRejection=Ot,exports.onUnload=Nt,exports.onUnmounted=Xt,exports.onUpdated=Jt,exports.prelinkReactiveTree=he,exports.provide=Rn,exports.provideGlobal=Bn,exports.reactive=U,exports.readonly=je,exports.ref=Ee,exports.registerApp=Cn,exports.registerComponent=wn,exports.removeMutationRecorder=fe,exports.resetWevuDefaults=tt,exports.runSetupFunction=gn,exports.setCurrentInstance=xt,exports.setCurrentSetupContext=Ct,exports.setDeepWatchStrategy=ze,exports.setWevuDefaults=et,exports.shallowReactive=ye,exports.shallowRef=Me,exports.startBatch=f,exports.stop=x,exports.storeToRefs=ar,exports.teardownRuntimeInstance=Sn,exports.toRaw=G,exports.toRef=Ie,exports.toRefs=Fe,exports.touchReactive=_e,exports.traverse=Le,exports.triggerRef=Pe,exports.unref=De,exports.useAttrs=Jn,exports.useBindModel=Zn,exports.useModel=Xn,exports.useSlots=Yn,exports.watch=Ve,exports.watchEffect=He;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ref as Ref$1 } from "@vue/reactivity";
|
|
2
|
-
import { ComponentOptionsMixin, DefineComponent, PublicProps } from "vue";
|
|
2
|
+
import { AllowedComponentProps, ComponentCustomProps, ComponentOptionsMixin, DefineComponent, ObjectDirective, PublicProps, ShallowUnwrapRef, VNode, VNodeProps } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/reactivity/ref.d.ts
|
|
5
5
|
type Ref<T$1 = any, S = T$1> = Ref$1<T$1, S>;
|
|
@@ -230,12 +230,16 @@ interface WatchOptions {
|
|
|
230
230
|
immediate?: boolean;
|
|
231
231
|
deep?: boolean;
|
|
232
232
|
}
|
|
233
|
-
type WatchSource<T$1 = any> = (() => T$1) | Ref<T$1> | object;
|
|
233
|
+
type WatchSource<T$1 = any> = (() => T$1) | Ref<T$1> | (T$1 extends object ? T$1 : never);
|
|
234
|
+
type WatchSourceValue<S> = S extends Ref<infer V> ? V : S extends (() => infer V) ? V : S extends object ? S : never;
|
|
235
|
+
type IsTuple<T$1 extends ReadonlyArray<any>> = number extends T$1['length'] ? false : true;
|
|
236
|
+
type WatchMultiSources<T$1 extends ReadonlyArray<WatchSource<any>>> = IsTuple<T$1> extends true ? { [K in keyof T$1]: WatchSourceValue<T$1[K]> } : Array<WatchSourceValue<T$1[number]>>;
|
|
234
237
|
type WatchStopHandle = () => void;
|
|
235
238
|
type DeepWatchStrategy = 'version' | 'traverse';
|
|
236
239
|
declare function setDeepWatchStrategy(strategy: DeepWatchStrategy): void;
|
|
237
240
|
declare function getDeepWatchStrategy(): DeepWatchStrategy;
|
|
238
241
|
declare function watch<T$1>(source: WatchSource<T$1>, cb: (value: T$1, oldValue: T$1, onCleanup: (cleanupFn: () => void) => void) => void, options?: WatchOptions): WatchStopHandle;
|
|
242
|
+
declare function watch<T$1 extends ReadonlyArray<WatchSource<any>>>(source: T$1, cb: (value: WatchMultiSources<T$1>, oldValue: WatchMultiSources<T$1>, onCleanup: (cleanupFn: () => void) => void) => void, options?: WatchOptions): WatchStopHandle;
|
|
239
243
|
/**
|
|
240
244
|
* watchEffect 注册一个响应式副作用,可选清理函数。
|
|
241
245
|
* 副作用会立即执行,并在依赖变化时重新运行。
|
|
@@ -247,7 +251,9 @@ type ComputedDefinitions = Record<string, ComputedGetter<any> | WritableComputed
|
|
|
247
251
|
type MethodDefinitions = Record<string, (...args: any[]) => any>;
|
|
248
252
|
type ExtractComputed<C extends ComputedDefinitions> = { [K in keyof C]: C[K] extends ComputedGetter<infer R> ? R : C[K] extends WritableComputedOptions<infer R> ? R : never };
|
|
249
253
|
type ExtractMethods<M extends MethodDefinitions> = { [K in keyof M]: M[K] extends ((...args: infer P) => infer R) ? (...args: P) => R : never };
|
|
250
|
-
type ComponentPublicInstance<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = D & ExtractComputed<C> & ExtractMethods<M
|
|
254
|
+
type ComponentPublicInstance<D extends object = Record<string, any>, C extends ComputedDefinitions = ComputedDefinitions, M extends MethodDefinitions = MethodDefinitions> = D & ExtractComputed<C> & ExtractMethods<M> & {
|
|
255
|
+
$attrs: Record<string, any>;
|
|
256
|
+
};
|
|
251
257
|
interface MiniProgramAdapter {
|
|
252
258
|
setData?: (payload: Record<string, any>) => void | Promise<void>;
|
|
253
259
|
}
|
|
@@ -428,16 +434,17 @@ interface MiniProgramComponentOptions {
|
|
|
428
434
|
detached?: MpComponentOptions['detached'];
|
|
429
435
|
error?: MpComponentOptions['error'];
|
|
430
436
|
}
|
|
431
|
-
interface ModelBindingOptions<T$1 = any> {
|
|
432
|
-
event?:
|
|
433
|
-
valueProp?:
|
|
437
|
+
interface ModelBindingOptions<T$1 = any, Event extends string = string, ValueProp extends string = string, Formatted = T$1> {
|
|
438
|
+
event?: Event;
|
|
439
|
+
valueProp?: ValueProp;
|
|
434
440
|
parser?: (payload: any) => T$1;
|
|
435
|
-
formatter?: (value: T$1) =>
|
|
441
|
+
formatter?: (value: T$1) => Formatted;
|
|
436
442
|
}
|
|
443
|
+
type ModelBindingPayload<T$1 = any, Event extends string = 'input', ValueProp extends string = 'value', Formatted = T$1> = { [K in ValueProp]: Formatted } & { [K in `on${Capitalize<Event>}`]: (event: any) => void };
|
|
437
444
|
interface ModelBinding<T$1 = any> {
|
|
438
445
|
value: T$1;
|
|
439
446
|
update: (value: T$1) => void;
|
|
440
|
-
model: (options?: ModelBindingOptions<T$1>) =>
|
|
447
|
+
model: <Event extends string = 'input', ValueProp extends string = 'value', Formatted = T$1>(options?: ModelBindingOptions<T$1, Event, ValueProp, Formatted>) => ModelBindingPayload<T$1, Event, ValueProp, Formatted>;
|
|
441
448
|
}
|
|
442
449
|
interface AppConfig {
|
|
443
450
|
globalProperties: Record<string, any>;
|
|
@@ -503,6 +510,8 @@ type InferPropType<O> = O extends null ? any : O extends {
|
|
|
503
510
|
} ? InferPropConstructor<T> : O extends PropType<infer V> ? V : InferPropConstructor<O>;
|
|
504
511
|
type InferPropConstructor<T$1> = T$1 extends readonly any[] ? InferPropConstructor<T$1[number]> : T$1 extends undefined ? any : T$1 extends null ? any : T$1 extends BooleanConstructor ? boolean : T$1 extends NumberConstructor ? number : T$1 extends StringConstructor ? string : T$1 extends DateConstructor ? Date : T$1 extends ArrayConstructor ? any[] : T$1 extends ObjectConstructor ? Record<string, any> : T$1 extends PropConstructor<infer V> ? V : any;
|
|
505
512
|
type InferProps<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = { [K in keyof Pick<P$1, RequiredKeys<P$1>>]: HasDefault<P$1[K]> extends true ? Exclude<InferPropType<P$1[K]>, undefined> : InferPropType<P$1[K]> } & { [K in keyof Pick<P$1, OptionalKeys<P$1>>]?: InferPropType<P$1[K]> };
|
|
513
|
+
type ExtractPropTypes<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P$1>;
|
|
514
|
+
type ExtractPublicPropTypes<P$1 extends ComponentPropsOptions = ComponentPropsOptions> = InferProps<P$1>;
|
|
506
515
|
type SetupFunction<P$1 extends ComponentPropsOptions, D extends object, C extends ComputedDefinitions, M extends MethodDefinitions> = (props: InferProps<P$1>, ctx: SetupContext<D, C, M, P$1>) => Record<string, any> | void;
|
|
507
516
|
interface SetupContext<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions, P$1 extends ComponentPropsOptions = ComponentPropsOptions> {
|
|
508
517
|
/**
|
|
@@ -663,6 +672,8 @@ interface PageFeatures {
|
|
|
663
672
|
*/
|
|
664
673
|
enableOnSaveExitState?: boolean;
|
|
665
674
|
}
|
|
675
|
+
interface GlobalComponents {}
|
|
676
|
+
interface GlobalDirectives {}
|
|
666
677
|
//#endregion
|
|
667
678
|
//#region src/runtime/app.d.ts
|
|
668
679
|
declare function createApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: CreateAppOptions<D, C, M>): RuntimeApp<D, C, M>;
|
|
@@ -735,7 +746,9 @@ declare function defineComponent<P$1 extends ComponentPropsOptions = ComponentPr
|
|
|
735
746
|
declare function createWevuComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(options: DefineComponentOptions<ComponentPropsOptions, D, C, M> & {
|
|
736
747
|
properties?: WechatMiniprogram.Component.PropertyOption;
|
|
737
748
|
}): void;
|
|
738
|
-
declare function createWevuScopedSlotComponent(
|
|
749
|
+
declare function createWevuScopedSlotComponent(overrides?: {
|
|
750
|
+
computed?: ComputedDefinitions;
|
|
751
|
+
}): void;
|
|
739
752
|
//#endregion
|
|
740
753
|
//#region src/runtime/hooks.d.ts
|
|
741
754
|
declare function getCurrentInstance<T$1 extends InternalRuntimeState = InternalRuntimeState>(): T$1 | undefined;
|
|
@@ -876,10 +889,19 @@ declare function teardownRuntimeInstance(target: InternalRuntimeState): void;
|
|
|
876
889
|
declare function registerApp<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineAppOptions<D, C, M>['setup'], mpOptions: MiniProgramAppOptions): void;
|
|
877
890
|
declare function registerComponent<D extends object, C extends ComputedDefinitions, M extends MethodDefinitions>(runtimeApp: RuntimeApp<D, C, M>, methods: MethodDefinitions, watch: WatchMap | undefined, setup: DefineComponentOptions<ComponentPropsOptions, D, C, M>['setup'], mpOptions: MiniProgramComponentRawOptions): void;
|
|
878
891
|
//#endregion
|
|
892
|
+
//#region src/runtime/template.d.ts
|
|
893
|
+
declare function normalizeStyle(value: any): string;
|
|
894
|
+
declare function normalizeClass(value: any): string;
|
|
895
|
+
//#endregion
|
|
879
896
|
//#region src/runtime/vueCompat.d.ts
|
|
880
897
|
declare function useAttrs(): Record<string, any>;
|
|
881
898
|
declare function useSlots(): Record<string, any>;
|
|
882
899
|
declare function useModel<T$1 = any>(props: Record<string, any>, name: string): Ref<T$1>;
|
|
900
|
+
/**
|
|
901
|
+
* useBindModel 返回绑定到当前运行时实例的 bindModel。
|
|
902
|
+
* 该方法必须在 setup() 的同步阶段调用。
|
|
903
|
+
*/
|
|
904
|
+
declare function useBindModel(): <T$1 = any>(path: string, options?: ModelBindingOptions<T$1>) => ModelBinding<T$1>;
|
|
883
905
|
declare function mergeModels<T$1>(a: T$1, b: T$1): T$1;
|
|
884
906
|
//#endregion
|
|
885
907
|
//#region src/store/types.d.ts
|
|
@@ -951,4 +973,174 @@ declare function createStore(): StoreManager;
|
|
|
951
973
|
type StoreToRefsResult<T$1 extends Record<string, any>> = { [K in keyof T$1]: T$1[K] extends ((...args: any[]) => any) ? T$1[K] : T$1[K] extends Ref<infer V> ? Ref<V> : Ref<T$1[K]> };
|
|
952
974
|
declare function storeToRefs<T$1 extends Record<string, any>>(store: T$1): StoreToRefsResult<T$1>;
|
|
953
975
|
//#endregion
|
|
954
|
-
|
|
976
|
+
//#region src/index.d.ts
|
|
977
|
+
type Prettify<T$1> = { [K in keyof T$1]: T$1[K] } & {};
|
|
978
|
+
type LooseRequired<T$1> = { [P in keyof (T$1 & Required<T$1>)]: T$1[P] };
|
|
979
|
+
type IfAny<T$1, Y, N> = 0 extends 1 & T$1 ? Y : N;
|
|
980
|
+
type ComponentObjectPropsOptions = ComponentPropsOptions;
|
|
981
|
+
type ExtractPropTypes$1<P$1 extends ComponentObjectPropsOptions> = InferProps<P$1>;
|
|
982
|
+
type DefineProps<T$1, BKeys extends keyof T$1> = Readonly<T$1> & { readonly [K in BKeys]-?: boolean };
|
|
983
|
+
type BooleanKey<T$1, K$1 extends keyof T$1 = keyof T$1> = K$1 extends any ? T$1[K$1] extends boolean | undefined ? T$1[K$1] extends never | undefined ? never : K$1 : never : never;
|
|
984
|
+
/**
|
|
985
|
+
* wevu + Volar 类型检查使用的 script-setup 宏。
|
|
986
|
+
*
|
|
987
|
+
* 这些只是类型声明,运行时不存在。
|
|
988
|
+
* 请确保 `vueCompilerOptions.lib = "wevu"`,让 Volar 从本文件解析它们。
|
|
989
|
+
*
|
|
990
|
+
* 常见搭配示例(仅类型层):
|
|
991
|
+
* - defineProps + withDefaults:声明 Props 并补默认值
|
|
992
|
+
* - defineEmits:约束事件与负载类型
|
|
993
|
+
* - defineSlots:约束插槽与插槽参数
|
|
994
|
+
* - defineModel:声明双向绑定字段
|
|
995
|
+
*/
|
|
996
|
+
/**
|
|
997
|
+
* defineProps 数组语法。
|
|
998
|
+
*
|
|
999
|
+
* @example
|
|
1000
|
+
* ```ts
|
|
1001
|
+
* const props = defineProps(['title', 'count'])
|
|
1002
|
+
* const { title } = defineProps(['title'])
|
|
1003
|
+
* ```
|
|
1004
|
+
*/
|
|
1005
|
+
declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{ [key in PropNames]?: any }>>;
|
|
1006
|
+
/**
|
|
1007
|
+
* defineProps 运行时 props 配置。
|
|
1008
|
+
*
|
|
1009
|
+
* @example
|
|
1010
|
+
* ```ts
|
|
1011
|
+
* const props = defineProps({
|
|
1012
|
+
* title: String,
|
|
1013
|
+
* count: Number,
|
|
1014
|
+
* active: Boolean,
|
|
1015
|
+
* color: {
|
|
1016
|
+
* type: String,
|
|
1017
|
+
* default: 'red',
|
|
1018
|
+
* },
|
|
1019
|
+
* })
|
|
1020
|
+
* ```
|
|
1021
|
+
*/
|
|
1022
|
+
declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes$1<PP>>>;
|
|
1023
|
+
/**
|
|
1024
|
+
* defineProps 泛型类型声明。
|
|
1025
|
+
*
|
|
1026
|
+
* @example
|
|
1027
|
+
* ```ts
|
|
1028
|
+
* const props = defineProps<{
|
|
1029
|
+
* title?: string
|
|
1030
|
+
* count: number
|
|
1031
|
+
* active?: boolean
|
|
1032
|
+
* }>()
|
|
1033
|
+
*
|
|
1034
|
+
* const props2 = defineProps<{
|
|
1035
|
+
* size?: 'sm' | 'md' | 'lg'
|
|
1036
|
+
* }>()
|
|
1037
|
+
* ```
|
|
1038
|
+
*/
|
|
1039
|
+
declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
|
|
1040
|
+
type NotUndefined<T$1> = T$1 extends undefined ? never : T$1;
|
|
1041
|
+
type MappedOmit<T$1, K$1 extends keyof any> = { [P in keyof T$1 as P extends K$1 ? never : P]: T$1[P] };
|
|
1042
|
+
type InferDefaults<T$1> = { [K in keyof T$1]?: InferDefault<T$1, T$1[K]> };
|
|
1043
|
+
type NativeType = null | undefined | number | string | boolean | symbol | Function;
|
|
1044
|
+
type InferDefault<P$1, T$1> = ((props: P$1) => T$1 & {}) | (T$1 extends NativeType ? T$1 : never);
|
|
1045
|
+
type PropsWithDefaults<T$1, Defaults extends InferDefaults<T$1>, BKeys extends keyof T$1> = T$1 extends unknown ? Readonly<MappedOmit<T$1, keyof Defaults>> & { readonly [K in keyof Defaults as K extends keyof T$1 ? K : never]-?: K extends keyof T$1 ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T$1[K]>, T$1[K]> : NotUndefined<T$1[K]> : never } & { readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean } : never;
|
|
1046
|
+
/**
|
|
1047
|
+
* withDefaults 为 defineProps 指定默认值(仅类型层)。
|
|
1048
|
+
* 默认值会影响可选/必选推导,但不生成运行时代码。
|
|
1049
|
+
*
|
|
1050
|
+
* @example
|
|
1051
|
+
* ```ts
|
|
1052
|
+
* const props = withDefaults(defineProps<{
|
|
1053
|
+
* title?: string
|
|
1054
|
+
* size?: 'sm' | 'md' | 'lg'
|
|
1055
|
+
* }>(), {
|
|
1056
|
+
* title: 'Empty',
|
|
1057
|
+
* size: 'md',
|
|
1058
|
+
* })
|
|
1059
|
+
* ```
|
|
1060
|
+
*/
|
|
1061
|
+
declare function withDefaults<T$1, BKeys extends keyof T$1, Defaults extends InferDefaults<T$1>>(props: DefineProps<T$1, BKeys>, defaults: Defaults): PropsWithDefaults<T$1, Defaults, BKeys>;
|
|
1062
|
+
type EmitsOptions = Record<string, ((...args: any[]) => any) | null> | string[];
|
|
1063
|
+
/**
|
|
1064
|
+
* defineEmits 字符串数组或映射写法。
|
|
1065
|
+
*
|
|
1066
|
+
* @example
|
|
1067
|
+
* ```ts
|
|
1068
|
+
* const emit = defineEmits(['change', 'open'])
|
|
1069
|
+
* emit('change', { id: 1 })
|
|
1070
|
+
*
|
|
1071
|
+
* const emit2 = defineEmits({
|
|
1072
|
+
* change: (payload: { id: number }) => true,
|
|
1073
|
+
* close: null,
|
|
1074
|
+
* })
|
|
1075
|
+
* emit2('change', { id: 2 })
|
|
1076
|
+
*
|
|
1077
|
+
* const emit3 = defineEmits(['tap', 'confirm'])
|
|
1078
|
+
* emit3('confirm')
|
|
1079
|
+
* ```
|
|
1080
|
+
*/
|
|
1081
|
+
declare function defineEmits<EE extends string = string>(emits?: EE[]): (event: EE, detail?: any) => void;
|
|
1082
|
+
declare function defineEmits<E extends Record<string, ((...args: any[]) => any) | null>>(emits?: E): (event: keyof E & string, detail?: any) => void;
|
|
1083
|
+
/**
|
|
1084
|
+
* defineEmits 显式签名写法。
|
|
1085
|
+
*
|
|
1086
|
+
* @example
|
|
1087
|
+
* ```ts
|
|
1088
|
+
* const emit = defineEmits<(e: 'save' | 'cancel', id?: number) => void>()
|
|
1089
|
+
* emit('save', 1)
|
|
1090
|
+
* ```
|
|
1091
|
+
*/
|
|
1092
|
+
declare function defineEmits<T$1 extends (...args: any[]) => any>(): T$1;
|
|
1093
|
+
/**
|
|
1094
|
+
* defineExpose 向父级 ref 暴露成员。
|
|
1095
|
+
* 仅影响类型提示,不会生成运行时代码。
|
|
1096
|
+
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```ts
|
|
1099
|
+
* defineExpose({
|
|
1100
|
+
* focus,
|
|
1101
|
+
* reset,
|
|
1102
|
+
* })
|
|
1103
|
+
* ```
|
|
1104
|
+
*/
|
|
1105
|
+
declare function defineExpose<T$1 extends Record<string, any> = Record<string, any>>(exposed?: T$1): void;
|
|
1106
|
+
/**
|
|
1107
|
+
* defineOptions 设置组件选项。
|
|
1108
|
+
* 适合声明组件名、样式隔离等静态选项。
|
|
1109
|
+
*
|
|
1110
|
+
* @example
|
|
1111
|
+
* ```ts
|
|
1112
|
+
* defineOptions({
|
|
1113
|
+
* name: 'EmptyState',
|
|
1114
|
+
* inheritAttrs: false,
|
|
1115
|
+
* virtualHost: true,
|
|
1116
|
+
* })
|
|
1117
|
+
* ```
|
|
1118
|
+
*/
|
|
1119
|
+
declare function defineOptions(options: Record<string, any>): void;
|
|
1120
|
+
/**
|
|
1121
|
+
* defineSlots 声明 slots 类型。
|
|
1122
|
+
* 用于限定插槽名称与插槽参数结构。
|
|
1123
|
+
*
|
|
1124
|
+
* @example
|
|
1125
|
+
* ```ts
|
|
1126
|
+
* const slots = defineSlots<{
|
|
1127
|
+
* default?: (props: { text: string }) => any
|
|
1128
|
+
* footer?: () => any
|
|
1129
|
+
* }>()
|
|
1130
|
+
* ```
|
|
1131
|
+
*/
|
|
1132
|
+
declare function defineSlots<T$1 extends Record<string, any> = Record<string, any>>(): T$1;
|
|
1133
|
+
/**
|
|
1134
|
+
* defineModel 声明 v-model 绑定(weapp 变体)。
|
|
1135
|
+
* 支持默认字段与自定义字段名。
|
|
1136
|
+
*
|
|
1137
|
+
* @example
|
|
1138
|
+
* ```ts
|
|
1139
|
+
* const modelValue = defineModel<string>()
|
|
1140
|
+
* const checked = defineModel<boolean>('checked')
|
|
1141
|
+
* const count = defineModel<number>('count', { default: 0 })
|
|
1142
|
+
* ```
|
|
1143
|
+
*/
|
|
1144
|
+
declare function defineModel<T$1 = any>(name?: string, options?: Record<string, any>): Ref<T$1 | undefined>;
|
|
1145
|
+
//#endregion
|
|
1146
|
+
export { ActionSubscriber, type AllowedComponentProps, AppConfig, type ComponentCustomProps, ComponentDefinition, type ComponentOptionsMixin, ComponentPropsOptions, ComponentPublicInstance, ComputedDefinitions, ComputedGetter, ComputedRef, ComputedSetter, CreateAppOptions, DefineAppOptions, type DefineComponent, DefineComponentOptions, DefineStoreOptions, EffectScope, EmitsOptions, ExtractComputed, ExtractMethods, ExtractPropTypes, ExtractPublicPropTypes, GlobalComponents, GlobalDirectives, InferPropType, InferProps, InternalRuntimeState, InternalRuntimeStateFields, MethodDefinitions, MiniProgramAdapter, MiniProgramAppOptions, MiniProgramBehaviorIdentifier, MiniProgramComponentBehaviorOptions, MiniProgramComponentOptions, MiniProgramComponentRawOptions, MiniProgramInstance, MiniProgramPageLifetimes, ModelBinding, ModelBindingOptions, ModelBindingPayload, MutationKind, MutationOp, MutationRecord, MutationType, type ObjectDirective, PageFeatures, PrelinkReactiveTreeOptions, PropConstructor, PropOptions, PropType, type PublicProps, Ref, RuntimeApp, RuntimeInstance, SetDataDebugInfo, SetDataSnapshotOptions, SetupContext, SetupFunction, type ShallowUnwrapRef, StoreManager, SubscriptionCallback, ToRefs, TriggerEventOptions, type VNode, type VNodeProps, WatchOptions, WatchStopHandle, WevuDefaults, WevuPlugin, WritableComputedOptions, WritableComputedRef, addMutationRecorder, batch, callHookList, callHookReturn, callUpdateHooks, computed, createApp, createStore, createWevuComponent, createWevuScopedSlotComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, defineStore, effect, effectScope, endBatch, getCurrentInstance, getCurrentScope, getCurrentSetupContext, getDeepWatchStrategy, getReactiveVersion, inject, injectGlobal, isNoSetData, isRaw, isReactive, isRef, isShallowReactive, isShallowRef, markNoSetData, markRaw, mergeModels, mountRuntimeInstance, nextTick, normalizeClass, normalizeStyle, onActivated, onAddToFavorites, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onScopeDispose, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, prelinkReactiveTree, provide, provideGlobal, reactive, readonly, ref, registerApp, registerComponent, removeMutationRecorder, resetWevuDefaults, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setDeepWatchStrategy, setWevuDefaults, shallowReactive, shallowRef, startBatch, stop, storeToRefs, teardownRuntimeInstance, toRaw, toRef, toRefs, touchReactive, traverse, triggerRef, unref, useAttrs, useBindModel, useModel, useSlots, watch, watchEffect, withDefaults };
|