wevu 6.17.7 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-BxKbbKVO.mjs +1 -0
- package/dist/computed-Xoi9XEUx.mjs +1 -0
- package/dist/dev/{base-ii6cqKIl.mjs → base-CYkvI7w8.mjs} +2 -2
- package/dist/dev/{base-ii6cqKIl.mjs.map → base-CYkvI7w8.mjs.map} +1 -1
- package/dist/dev/computed-BxRsUJgi.mjs +128 -0
- package/dist/dev/computed-BxRsUJgi.mjs.map +1 -0
- package/dist/dev/index.mjs +9 -9
- package/dist/dev/internal-reactivity.mjs +5 -5
- package/dist/dev/internal-runtime.mjs +3 -3
- package/dist/dev/internal-template.mjs +1 -1
- package/dist/dev/{ref-Bxwe2Kfo.mjs → ref-DRZC3Kc5.mjs} +6 -202
- package/dist/dev/ref-DRZC3Kc5.mjs.map +1 -0
- package/dist/dev/{router-D6H7HviN.mjs → router-BD-ovqV2.mjs} +69 -5
- package/dist/dev/router-BD-ovqV2.mjs.map +1 -0
- package/dist/dev/router.mjs +36 -13
- package/dist/dev/router.mjs.map +1 -1
- package/dist/dev/{store-7lzhCASj.mjs → store-HNsiQJ4d.mjs} +14 -10
- package/dist/dev/store-HNsiQJ4d.mjs.map +1 -0
- package/dist/dev/store.mjs +1 -1
- package/dist/dev/{template-DLHZbQ3E.mjs → template-n_iVr0ey.mjs} +2 -2
- package/dist/dev/{template-DLHZbQ3E.mjs.map → template-n_iVr0ey.mjs.map} +1 -1
- package/dist/dev/{templateRef-D6APbgBW.mjs → templateRef-DuFamxmB.mjs} +108 -16
- package/dist/dev/templateRef-DuFamxmB.mjs.map +1 -0
- package/dist/dev/{toRefs-BVrN7XKZ.mjs → toRefs-D06VmFK2.mjs} +2 -2
- package/dist/dev/{toRefs-BVrN7XKZ.mjs.map → toRefs-D06VmFK2.mjs.map} +1 -1
- package/dist/dev/vue-demi.mjs +9 -9
- package/dist/dev/{watch-B46crqgs.mjs → watch-jrgL5ald.mjs} +121 -4
- package/dist/dev/watch-jrgL5ald.mjs.map +1 -0
- package/dist/fetch.d.mts +0 -1
- package/dist/{index-C6Jyiw-u.d.mts → index-CCET_bCY.d.mts} +3 -4
- package/dist/{index-HS9xxiUI.d.mts → index-Dg1-jV9L.d.mts} +17 -17
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +1 -1
- package/dist/internal-reactivity.d.mts +2 -1
- package/dist/internal-reactivity.mjs +1 -1
- package/dist/internal-runtime.d.mts +1 -1
- package/dist/internal-runtime.mjs +1 -1
- package/dist/internal-template.mjs +1 -1
- package/dist/jsx-runtime.d.mts +1 -2
- package/dist/ref-D37CknuD.mjs +1 -0
- package/dist/router-DLOOLAqv.mjs +1 -0
- package/dist/router.d.mts +1 -2
- package/dist/router.mjs +1 -1
- package/dist/store-eHrHBQiv.mjs +1 -0
- package/dist/store.d.mts +1 -1
- package/dist/store.mjs +1 -1
- package/dist/{template-CFhlojaH.mjs → template-CNzlwH-E.mjs} +1 -1
- package/dist/templateRef-C4R74tUR.mjs +1 -0
- package/dist/{toRefs-COgMIEoC.mjs → toRefs-CoytPyo0.mjs} +1 -1
- package/dist/traverse-B4Ez44Gd.d.mts +108 -0
- package/dist/vue-demi.d.mts +5 -6
- package/dist/vue-demi.mjs +1 -1
- package/dist/{vue-types-xMdYZRuG.d.mts → vue-types-B3N60cGV.d.mts} +13 -121
- package/dist/watch-Bbd-gmEg.mjs +1 -0
- package/dist/{weappIntrinsicElements-BjaNcUW3.d.mts → weappIntrinsicElements-BgDtC53_.d.mts} +1 -1
- package/package.json +2 -2
- package/dist/base-D-o2Hv6z.mjs +0 -1
- package/dist/computed-DdPJb4_M.mjs +0 -1
- package/dist/dev/computed-4hT2jDra.mjs +0 -48
- package/dist/dev/computed-4hT2jDra.mjs.map +0 -1
- package/dist/dev/ref-Bxwe2Kfo.mjs.map +0 -1
- package/dist/dev/router-D6H7HviN.mjs.map +0 -1
- package/dist/dev/store-7lzhCASj.mjs.map +0 -1
- package/dist/dev/templateRef-D6APbgBW.mjs.map +0 -1
- package/dist/dev/watch-B46crqgs.mjs.map +0 -1
- package/dist/ref-CRwjgX_d.mjs +0 -1
- package/dist/router-BiJKkvy7.mjs +0 -1
- package/dist/store-B9C0AuaO.mjs +0 -1
- package/dist/templateRef-CMx7kneh.mjs +0 -1
- package/dist/watch-6_s3_f8q.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,n,r,s as i,u as a}from"./base-
|
|
1
|
+
import{c as e,d as t,n,r,s as i,u as a}from"./base-BxKbbKVO.mjs";import{$ as o,B as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,N as h,P as g,Q as _,R as v,U as y,V as b,W as x,X as S,Y as C,Z as w,_ as T,b as E,et as D,n as O,nt as k,q as A,rt as j,t as M,tt as N,v as P,x as F,y as I,z as L}from"./router-DLOOLAqv.mjs";import{$ as R,B as z,C as B,D as V,E as H,G as U,H as W,I as G,J as K,K as q,L as J,M as Y,N as X,O as Z,Q,R as $,S as ee,T as te,U as ne,V as re,W as ie,X as ae,Y as oe,Z as se,_ as ce,a as le,at as ue,b as de,c as fe,ct as pe,d as me,f as he,g as ge,h as _e,i as ve,it as ye,k as be,l as xe,lt as Se,m as Ce,n as we,nt as Te,o as Ee,ot as De,p as Oe,q as ke,r as Ae,rt as je,s as Me,st as Ne,t as Pe,tt as Fe,u as Ie,ut as Le,v as Re,w as ze,x as Be,y as Ve,z as He}from"./templateRef-C4R74tUR.mjs";export{n as callHookList,r as callHookReturn,Z as createApp,te as createWevuComponent,H as createWevuScopedSlotComponent,xe as defineAppSetup,V as defineComponent,i as getCurrentInstance,Re as getCurrentPageStackSnapshot,e as getCurrentSetupContext,Ve as getNavigationBarMetrics,T as hasInjectionContext,P as inject,I as injectGlobal,se as isNoSetData,Q as markNoSetData,we as mergeModels,z as mountRuntimeInstance,Fe as onActivated,g as onAddToFavorites,c as onAttached,Te as onBeforeMount,je as onBeforeUnmount,ye as onBeforeUpdate,ue as onDeactivated,d as onDetached,m as onError,De as onErrorCaptured,v as onHide,L as onLaunch,s as onLoad,b as onMemoryWarning,Ne as onMounted,u as onMoved,y as onPageNotFound,x as onPageScroll,l as onPullDownRefresh,p as onReachBottom,A as onReady,f as onResize,C as onRouteDone,S as onSaveExitState,pe as onServerPrefetch,w as onShareAppMessage,_ as onShareTimeline,o as onShow,D as onTabItemTap,N as onThemeChange,k as onUnhandledRejection,j as onUnload,Se as onUnmounted,Le as onUpdated,E as provide,F as provideGlobal,He as registerApp,be as registerComponent,oe as resetWevuDefaults,Y as resolveLayoutBridge,X as resolveLayoutHost,ie as resolveRuntimePageLayoutName,ne as runSetupFunction,a as setCurrentInstance,t as setCurrentSetupContext,h as setGlobalProvidedValue,U as setPageLayout,re as setRuntimeSetDataVisibility,ae as setWevuDefaults,q as syncRuntimePageLayoutState,ke as syncRuntimePageLayoutStateFromRuntime,W as teardownRuntimeInstance,Ie as use,ge as useAsyncPullDownRefresh,Ee as useAttrs,Ae as useBindModel,he as useBoundingClientRect,ve as useChangeModel,ze as useDisposables,B as useElementIntersectionObserver,ee as useIntersectionObserver,G as useLayoutBridge,J as useLayoutHosts,le as useModel,Me as useNativeInstance,M as useNativePageRouter,O as useNativeRouter,de as useNavigationBarMetrics,K as usePageLayout,ce as usePageScrollThrottle,Be as usePageStack,Oe as useScrollOffset,Ce as useSelectorFields,_e as useSelectorQuery,fe as useSlots,Pe as useTemplateRef,me as useUpdatePerformanceListener,R as version,$ as waitForLayoutHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./template-
|
|
1
|
+
import{n as e,r as t,t as n}from"./template-CNzlwH-E.mjs";export{n as normalizeClass,e as normalizeStyle,t as resolvePropValue};
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as MiniProgramIntrinsicElements } from "./weappIntrinsicElements-
|
|
1
|
+
import { n as MiniProgramIntrinsicElements } from "./weappIntrinsicElements-BgDtC53_.mjs";
|
|
2
2
|
import { GlobalComponents } from "wevu";
|
|
3
|
-
|
|
4
3
|
//#region src/jsx-runtime.d.ts
|
|
5
4
|
declare namespace JSX {
|
|
6
5
|
type Element = any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(t,n){if(e(t)!=`object`||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,n||`default`);if(e(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(t)}function n(n){var r=t(n,`string`);return e(r)==`symbol`?r:r+``}function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const i=new WeakMap;let a=null;const o=[];let s=0;const c=new Set;function l(){s++}function u(){for(;c.size;){let e=[...c];c.clear();for(let t of e)t()}}function d(){s!==0&&(s--,s===0&&u())}function f(e){l();try{return e()}finally{d()}}function p(e){let{deps:t}=e;for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}function m(e){var t;e.active&&(e.active=!1,p(e),(t=e.onStop)==null||t.call(e))}let h;var ee=class{constructor(e=!1){if(this.detached=e,r(this,`active`,!0),r(this,`effects`,[]),r(this,`cleanups`,[]),r(this,`parent`,void 0),r(this,`scopes`,void 0),!e&&h){var t;this.parent=h,((t=h).scopes||(t.scopes=[])).push(this)}}run(e){if(!this.active)return;let t=h;h=this;try{return e()}finally{h=t}}stop(){var e;if(this.active){this.active=!1;for(let e of this.effects)m(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((e=this.parent)!=null&&e.scopes){let e=this.parent.scopes.indexOf(this);e>=0&&this.parent.scopes.splice(e,1)}this.parent=void 0}}};function te(e=!1){return new ee(e)}function ne(){return h}function re(e){h!=null&&h.active&&h.cleanups.push(e)}function g(e){h!=null&&h.active&&h.effects.push(e)}function ie(e,t={}){let n=function(){if(!n.active||n._running)return e();p(n);try{return n._running=!0,o.push(n),a=n,e()}finally{var t;o.pop(),a=(t=o[o.length-1])==null?null:t,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 ae(e,t={}){let n=ie(e,t);return g(n),t.lazy||n(),n}function _(e,t){if(!a)return;let n=i.get(e);n||(n=new Map,i.set(e,n));let r=n.get(t);r||(r=new Set,n.set(t,r)),r.has(a)||(r.add(a),a.deps.push(r))}function v(e){if(e.scheduler){e.scheduler();return}if(s>0){c.add(e);return}e()}function y(e,t){let n=i.get(e);if(!n)return;let r=n.get(t);if(!r)return;let o=new Set;r.forEach(e=>{e!==a&&o.add(e)}),o.forEach(v)}function b(e){a&&(e.has(a)||(e.add(a),a.deps.push(e)))}function x(e){new Set(e).forEach(v)}const S=new Set;function oe(e){S.add(e)}function se(e){S.delete(e)}const C=new WeakMap,w=new WeakMap,T=new WeakMap,E=new WeakMap,D=new WeakSet,O=new WeakMap,k=new WeakMap;function ce(e){let t=k.get(e);return t||(t=new Set,k.set(e,t)),t}function A(e,t){ce(e).add(t)}function j(e){var t;w.set(e,((t=w.get(e))==null?0:t)+1)}function le(e){var t;return(t=w.get(e))==null?0:t}function M(e){let t=new Set,n=[e];for(let e=0;e<2e3&&n.length;e++){let e=n.pop(),r=E.get(e);if(r)for(let e of r.keys())t.has(e)||(t.add(e),j(e),n.push(e))}}function N(e){let t=E.get(e);if(!t){D.delete(e),T.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){D.delete(e),T.set(e,{parent:n,key:r});return}D.add(e),T.delete(e)}function P(e,t,n){if(typeof n!=`string`){D.add(e),T.delete(e);return}if(S.size){var r;let n=(r=C.get(t))==null?t:r;A(n,t),A(n,e)}let i=E.get(e);i||(i=new Map,E.set(e,i));let a=i.get(t);a||(a=new Set,i.set(t,a)),a.add(n),N(e)}function F(e,t,n){let r=E.get(e);if(!r)return;let i=r.get(t);i&&(i.delete(n),i.size||r.delete(t),r.size||E.delete(e),N(e))}function I(e,t){if(t===e)return[];if(D.has(t))return;let n=[],r=t;for(let t=0;t<2e3;t++){if(r===e)return n.reverse();if(D.has(r))return;let t=T.get(r);if(!t||typeof t.key!=`string`)return;n.push(t.key),r=t.parent}}function L(e){return typeof e==`object`&&!!e}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ue(e){return Object.prototype.toString.call(e).slice(8,-1)}function de(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 0;default:return 0}}function z(e){return e.__r_skip?0:de(ue(e))}const B=Symbol(`wevu.version`);function V(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 H(e){var t;return(t=e==null?void 0:e.__r_raw)==null?e:t}const U=new WeakMap,W=new WeakMap,fe=new WeakMap;function pe(e){return le(H(e))}function G(e,t,n){var r;if(!S.size||typeof t!=`string`||t.startsWith(`__r_`))return;let i=(r=C.get(e))==null?e:r,a=Array.isArray(e)&&(t===`length`||V(t))?`array`:`property`,o=I(i,e);if(!o){let r=new Set,o=E.get(e);if(o)for(let[e,t]of o){var s;let n=O.get(e),a=n?n.split(`.`,1)[0]:void 0,o=a||(s=I(i,e))==null?void 0:s[0];for(let e of t){var c;typeof e==`string`&&r.add((c=a==null?o:a)==null?e:c)}}else r.add(t);for(let e of S)e({root:i,kind:a,op:n,path:void 0,fallbackTopKeys:r.size?[...r]:void 0});return}let l=o.findIndex(e=>V(e));if(l!==-1){let e=o.slice(0,l).join(`.`)||void 0;for(let t of S)t({root:i,kind:`array`,op:n,path:e});return}let u=o.length?o.join(`.`):``,d=a===`array`?u||void 0:u?`${u}.${t}`:t;for(let e of S)e({root:i,kind:a,op:n,path:d})}const me={get(e,t,n){if(t===`__r_isReactive`)return!0;if(t===`__r_raw`)return e;let r=Reflect.get(e,t,n);if(_(e,t),L(r)){var i,a;if(r.__r_skip)return r;let n=(i=C.get(e))==null?e:i,o=(a=r==null?void 0:r.__r_raw)==null?r:a;C.has(o)||C.set(o,n),P(o,e,t);let s=O.get(e);if(S.size&&typeof t==`string`&&s!=null&&!D.has(o)){let e=s?`${s}.${t}`:t;O.set(o,e)}return K(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)){var c;let r=L(o)?(c=o==null?void 0:o.__r_raw)==null?o:c:void 0;if(r&&F(r,e,t),L(n)&&!n.__r_skip){var l,u;let r=(l=C.get(e))==null?e:l,i=(u=n==null?void 0:n.__r_raw)==null?n:u;C.has(i)||C.set(i,r),P(i,e,t);let a=O.get(e);if(S.size&&typeof t==`string`&&a!=null&&!D.has(i)){let e=a?`${a}.${t}`:t;O.set(i,e)}}y(e,t),i&&typeof t==`string`&&V(t)&&Number(t)>=a&&y(e,`length`),y(e,B),j(e),M(e);let s=C.get(e);s&&s!==e&&(y(s,B),j(s)),G(e,t,`set`)}return s},deleteProperty(e,t){let n=R(e,t),r=n?e[t]:void 0,i=Reflect.deleteProperty(e,t);if(n&&i){var a;let n=L(r)?(a=r==null?void 0:r.__r_raw)==null?r:a:void 0;n&&F(n,e,t),y(e,t),y(e,B),j(e),M(e);let i=C.get(e);i&&i!==e&&(y(i,B),j(i)),G(e,t,`delete`)}return i},ownKeys(e){return _(e,Symbol.iterator),_(e,B),Reflect.ownKeys(e)}};function K(e){if(!L(e)||e.__r_isReactive)return e;let t=U.get(e);if(t)return t;if(z(e)===0)return e;let n=new Proxy(e,me);return U.set(e,n),W.set(n,e),w.has(e)||w.set(e,0),C.has(e)||C.set(e,e),n}function he(e){return!!(e&&e.__r_isReactive)}function q(e){return L(e)?K(e):e}function J(e){return L(e)&&Object.defineProperty(e,"__r_skip",{value:!0,configurable:!0,enumerable:!1,writable:!0}),e}function ge(e){return L(e)&&`__r_skip`in e}const Y=`__v_isRef`;function X(e){try{Object.defineProperty(e,Y,{value:!0,configurable:!0})}catch(t){e[Y]=!0}return e}function Z(e){return!!(e&&typeof e==`object`&&e.__v_isRef===!0)}var _e=class{constructor(e){r(this,`_value`,void 0),r(this,`_rawValue`,void 0),r(this,`dep`,void 0),X(this),this._rawValue=e,this._value=q(e)}get value(){return this.dep||(this.dep=new Set),b(this.dep),this._value}set value(e){Object.is(e,this._rawValue)||(this._rawValue=e,this._value=q(e),this.dep&&x(this.dep))}};function Q(e){return Z(e)?e:J(new _e(e))}function $(e){return Z(e)?e.value:e}function ve(e){return typeof e==`function`?e():$(e)}var ye=class{constructor(e,t){r(this,`_getValue`,void 0),r(this,`_setValue`,void 0),r(this,`dep`,void 0),X(this);let n=t,i=()=>{this.dep||(this.dep=new Set),b(this.dep)},a=()=>{this.dep&&x(this.dep)},o=e=>e===void 0&&n!==void 0?n:e;if(typeof e==`function`){let t=e(i,a);this._getValue=()=>o(t.get()),this._setValue=e=>t.set(e);return}let s=e;this._getValue=()=>(i(),o(s.get())),this._setValue=e=>{s.set(e),a()}}get value(){return this._getValue()}set value(e){this._setValue(e)}};function be(e,t){return J(new ye(e,t))}export{se as A,y as B,E as C,P as D,w as E,ne as F,re as I,l as L,ae as M,te as N,k as O,d as P,m as R,T as S,C as T,x as V,L as _,ve as a,A as b,ge as c,K as d,W as f,R as g,z as h,Q as i,f as j,oe as k,he as l,B as m,Z as n,$ as o,fe as p,X as r,pe as s,be as t,J as u,H as v,O as w,D as x,j as y,_ as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t,f as n,g as r,h as i,i as a,l as o,m as s,n as c,o as l,s as u,t as d,v as f}from"./base-BxKbbKVO.mjs";import{WEVU_APP_PROVIDES_KEY as p,WEVU_IS_APP_INSTANCE_KEY as ee,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as m,WEVU_PARENT_INSTANCE_KEY as h,WEVU_PROVIDES_KEY as g,WEVU_RUNTIME_APP_KEY as te}from"@weapp-core/constants";function _(e,t,n){o(d(e),e,t,n)}function ne(e){_(`onLaunch`,e)}function re(e){_(`onPageNotFound`,e)}function ie(e){_(`onUnhandledRejection`,e)}function ae(e){_(`onThemeChange`,e)}function oe(e){_(`onMemoryWarning`,e)}function se(e){_(`onShow`,e)}function ce(e){_(`onLoad`,e)}function le(e){_(`onHide`,e)}function ue(e){_(`onUnload`,e)}function de(e){_(`onReady`,e)}function fe(e){_(`onPullDownRefresh`,e)}function pe(e){_(`onReachBottom`,e)}function me(e){let t=d(`onPageScroll`);o(t,`onPageScroll`,e),a(t,`onPageScroll`)}function he(e){_(`onRouteDone`,e)}function ge(e){_(`onTabItemTap`,e)}function _e(e){_(`onResize`,e)}function ve(e){_(`onMoved`,e)}function ye(e){_(`onAttached`,e)}function be(e){_(`onDetached`,e)}function xe(e){_(`onError`,e)}function Se(e){_(`onSaveExitState`,e,{single:!0})}function Ce(t){let n=d(`onShareAppMessage`);o(n,`onShareAppMessage`,t,{single:!0}),l(n,`onShareAppMessage`),e(n)}function we(t){let n=d(`onShareTimeline`);o(n,`onShareTimeline`,t,{single:!0}),l(n,`onShareTimeline`),e(n)}function Te(e){let t=d(`onAddToFavorites`);o(t,`onAddToFavorites`,e,{single:!0}),l(t,`onAddToFavorites`)}const v=new Map;function y(e,t){v.set(e,t)}function b(e){return v.has(e)}function x(e){return v.get(e)}function S(e){return!!(e&&typeof e==`object`&&e[ee]===!0)}function C(e){return Object.create(e==null?null:e)}function w(e){if(!e)return C();let t=e[p];if(t&&typeof t==`object`)return t;let n=C();try{Object.defineProperty(e,p,{value:n,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[p]=n}return n}function T(e,t){try{Object.defineProperty(e,g,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){e[g]=t}}function E(e){var t,n;let r=e[g];if(r&&typeof r==`object`)return r;let i=e[te],a=(t=(n=e[h])==null?void 0:n[g])==null?w(i):t,o=S(e)?w(i):C(a);return T(e,o),o}function Ee(e){return w(e)}function De(e,t,n){w(e)[t]=n,y(t,n)}function Oe(e,t,n){var r;let i=w(t),a=(r=n==null?void 0:n[g])==null?i:r,o=S(e)?i:C(a);if(n)try{Object.defineProperty(e,h,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(t){e[h]=n}T(e,o)}function D(e,t){let n=Object.getPrototypeOf(e);for(;n;){if(n===t)return!0;n=Object.getPrototypeOf(n)}return!1}function ke(e,t){let n=E(e),r=E(t);if(!(n===r||D(n,r)||D(r,n))){Object.setPrototypeOf(r,n);try{Object.defineProperty(t,h,{value:e,configurable:!0,enumerable:!1,writable:!0})}catch(n){t[h]=e}}}let O=!1,k;function A(){return k}function Ae(e){k=e}function je(e){k===e&&(k=void 0)}function j(e,t){var n;e[m]=Number((n=e[m])==null?0:n)+1;try{return t()}finally{var r;let t=Number((r=e[m])==null?1:r)-1;t<=0?delete e[m]:e[m]=t}}function Me(e){let t=e.options;if(t&&typeof t==`object`)return t;let n=s(),r=n[n.length-1],i=r&&typeof r==`object`?r.options:void 0;return i&&typeof i==`object`?i:{}}function Ne(){if(O)return;O=!0;let e=r();if(!(!e||typeof e!=`object`)){if(f(`pullDownRefreshApi`)){let t=e.startPullDownRefresh;typeof t==`function`&&(e.startPullDownRefresh=function(...e){let n=t.apply(this,e);return k&&c(k,`onPullDownRefresh`,[]),n})}if(f(`pageScrollApi`)){let t=e.pageScrollTo;typeof t==`function`&&(e.pageScrollTo=function(e,...n){let r=t.apply(this,[e,...n]);if(k){let t=k;j(t,()=>{c(t,`onPageScroll`,[e==null?{}:e])})}return r})}}}function Pe(e){let{enableOnShareAppMessage:t,enableOnShareTimeline:n}=e;if(!t&&!n||!f(`pageShareMenu`))return;let a=r();if(!a||typeof a.showShareMenu!=`function`)return;let o=i().shareTimelineRequiresShareAppMessage?t||n:t;if(!o&&!n)return;let s=[];o&&s.push(`shareAppMessage`),n&&s.push(`shareTimeline`);let c=[{withShareTicket:!0,menus:s},{menus:s},n?{withShareTicket:!0}:void 0,n?{}:void 0,void 0];for(let e of c)try{e===void 0?a.showShareMenu():a.showShareMenu(e);break}catch(e){}}function Fe(){return!!u()}function Ie(e,t){let n=u();n?(E(n)[e]=t,S(n)&&y(e,t)):y(e,t)}function Le(e,t){var n;let r=u();if(r){let t=E(r);if(e in t)return t[e]}if(b(e))return x(e);if(arguments.length>=2)return t;let i=(n=globalThis.console)==null?void 0:n.warn;typeof i==`function`&&i(`wevu.inject:未找到对应 key 的值:${String(e)}`)}function Re(e,t){y(e,t)}function ze(e,t){if(b(e))return x(e);if(arguments.length>=2)return t;throw Error(`injectGlobal():未找到对应 key 的 provider:${String(e)}`)}const Be=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],M=new Set,N=new WeakSet;function Ve(e){return M.add(e),()=>{M.delete(e)}}function P(e){for(let t of M)try{t(e)}catch(e){}}function He(e,t){if(e!==`navigateBack`&&t&&typeof t==`object`){let e=t.url;if(typeof e==`string`)return{url:e}}}function Ue(e){if(!e||typeof e!=`object`)return;let t=e;if(!N.has(t)){N.add(t);for(let e of Be){let n=t[e];typeof n==`function`&&(t[e]=function(t,...r){let i=!1,a=()=>{i||(i=!0,P(He(e,t)))},o=t&&typeof t==`object`?{...t,success:(...e)=>{a();let n=t.success;return typeof n==`function`?n(...e):void 0}}:t,s=n.call(this,o,...r);return s&&typeof s.then==`function`&&s.then(a,()=>{}),s})}}}function F(e){let t=[];for(let n of e.split(`/`))if(!(!n||n===`.`)){if(n===`..`){t.length>0&&t.pop();continue}t.push(n)}return t}function I(e,t){if(!e)return F(t).join(`/`);if(e.startsWith(`/`))return F(e).join(`/`);if(e.startsWith(`./`)||e.startsWith(`../`)){let n=F(t);n.length>0&&n.pop();for(let t of e.split(`/`))if(!(!t||t===`.`)){if(t===`..`){n.length>0&&n.pop();continue}n.push(t)}return n.join(`/`)}return F(e).join(`/`)}function L(e){return e?`/${e}`:`/`}const We=/(?:^|\/):/;function Ge(e){return We.test(e)}const Ke=/\+/g;function R(e){return decodeURIComponent(e.replace(Ke,` `))}function z(e){return encodeURIComponent(e)}function B(e,t,n){let r=e[t];if(r===void 0){e[t]=n;return}if(Array.isArray(r)){r.push(n);return}e[t]=[r,n]}function V(e,t,n){let r=e[t];if(r===void 0){e[t]=n;return}if(Array.isArray(r)){r.push(n);return}e[t]=[r,n]}function H(e){if(e!==void 0)return e===null?null:String(e)}function U(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r)){for(let e of r){let r=H(e);r!==void 0&&B(t,n,r)}continue}let i=H(r);i!==void 0&&B(t,n,i)}return t}function W(e){if(e!=null)return String(e)}function qe(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r)){for(let e of r){let r=W(e);r!==void 0&&V(t,n,r)}continue}let i=W(r);i!==void 0&&V(t,n,i)}return t}function G(e){return e?e.startsWith(`#`)?e:`#${e}`:``}function K(e){let t=e.startsWith(`?`)?e.slice(1):e,n={};if(!t)return n;for(let e of t.split(`&`)){if(!e)continue;let t=e.indexOf(`=`),r=t>=0?e.slice(0,t):e;r&&B(n,R(r),t>=0?R(e.slice(t+1)):null)}return n}function q(e={}){let t=U(e),n=[];for(let e of Object.keys(t)){let r=z(e),i=t[e];if(Array.isArray(i)){for(let e of i)e===null?n.push(r):n.push(`${r}=${z(e)}`);continue}if(i===null){n.push(r);continue}n.push(`${r}=${z(i)}`)}return n.join(`&`)}const Je={parseQuery:K,stringifyQuery:q};function J(e,t=Je){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,i=n>=0?G(e.slice(n+1)):``,a=r.indexOf(`?`);return a<0?{path:r,query:{},hash:i}:{path:r.slice(0,a),query:U(t.parseQuery(r.slice(a+1))),hash:i}}function Y(e,t,n=``,r,i={},a=q){let o=I(e,``),s=a(t),c=L(o),l=G(n),u=s?`${c}?${s}`:c,d={path:o,fullPath:l?`${u}${l}`:u,query:t,hash:l,params:i};return r!==void 0&&(d.name=r),d}function X(e){return typeof(e==null?void 0:e.route)==`string`&&e.route.length>0||typeof(e==null?void 0:e.__route__)==`string`&&e.__route__.length>0}function Ye(e){let t=s();if(Array.isArray(t)&&t.length>0){let e=t[t.length-1];if(X(e))return e}let n=A();return X(n)?n:e}function Xe(e,t){var n;let r=Ye(t);return r?Y(typeof r.route==`string`?r.route:typeof r.__route__==`string`?r.__route__:``,U(e==null?(n=r.options)==null?{}:n:e),``,void 0,{}):Y(``,{})}const Z=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],Ze=new WeakMap;function Qe(e){return!e||typeof e!=`object`?!1:Z.every(t=>typeof e[t]==`function`)}function $e(){return n()}function et(e){if(!(typeof e!=`string`||!e))return I(e,``)||void 0}function tt(e,t){let n=t===`pageRouter`?[e.route,e.__route__,e.is]:[e.is,e.route,e.__route__];for(let e of n){let t=et(e);if(t)return t}}function nt(e,t){if(!t||!e.startsWith(`./`)&&!e.startsWith(`../`))return e;let{path:n,query:r,hash:i}=J(e),a=L(I(n,t)),o=q(r);return`${a}${o?`?${o}`:``}${i}`}function Q(e,t){let n=t==null?``:t,r=Ze.get(e),i=r==null?void 0:r.get(n);if(i)return i;let a=Object.create(null);for(let n of Z)a[n]=r=>{let i=e[n];if(n===`navigateBack`||!r||typeof r!=`object`)return i.call(e,r);let a=typeof r.url==`string`?nt(r.url,t):r.url,o=r.success,s={...r,url:a,success:(...e)=>(typeof a==`string`&&P({url:a}),typeof o==`function`?o(...e):void 0)};return i.call(e,s)};let o=r==null?new Map:r;return o.set(n,a),Ze.set(e,o),a}function $(e,n,r){let i=t();if(!(i!=null&&i.instance))throw Error(`${r}() 必须在 setup() 的同步阶段调用`);let a=i.instance,o=tt(a,e),s=a[e];if(Qe(s))return Q(s,o);let c=a[n];if(Qe(c))return Q(c,o);let l=$e();if(l)return Q(l,o);throw Error(`当前运行环境不支持 Router,请升级宿主基础库或检查平台路由能力`)}function rt(){return $(`router`,`pageRouter`,`useNativeRouter`)}function it(){return $(`pageRouter`,`router`,`useNativePageRouter`)}export{se as $,Oe as A,ce as B,Ne as C,Me as D,je as E,ye as F,fe as G,ve as H,be as I,_e as J,pe as K,xe as L,De as M,y as N,j as O,Te as P,we as Q,le as R,Ae as S,A as T,re as U,oe as V,me as W,Se as X,he as Y,Ce as Z,Fe as _,Xe as a,Ie as b,qe as c,L as d,ge as et,Ge as f,Ve as g,P as h,J as i,Ee as j,ke as k,K as l,Ue as m,rt as n,ie as nt,G as o,I as p,de as q,Y as r,ue as rt,U as s,it as t,ae as tt,q as u,Le as v,Pe as w,Re as x,ze as y,ne as z};
|
package/dist/router.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Bt as TypedRouterTabBarUrl, Ft as RouterNavigateToOption, Ht as WevuTypedRouterRouteMap, It as RouterReLaunchOption, Lt as RouterRedirectToOption, Rt as RouterSwitchTabOption, Vt as TypedRouterUrl, zt as SetupContextRouter } from "./vue-types-B3N60cGV.mjs";
|
|
3
2
|
//#region src/routerInternal/types.d.ts
|
|
4
3
|
interface RouteResolveCodec {
|
|
5
4
|
parseQuery: RouteQueryParser;
|
package/dist/router.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./ref-CRwjgX_d.mjs";import{c as t,x as n}from"./base-D-o2Hv6z.mjs";import{K as r,L as i,W as a,X as o,a as s,c,d as l,f as u,g as d,i as f,l as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,v as x}from"./router-BiJKkvy7.mjs";const S=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function C(e){var t;let n=S.exec(e);if(n)return{key:n[1],modifier:(t=n[2])==null?``:t}}function w(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function T(e){return encodeURIComponent(e)}function E(e){try{return decodeURIComponent(e)}catch(t){return e}}function D(e,t,n){let r=[],i=new Set;for(let a of e.split(`/`)){if(!a)continue;let e=C(a);if(!e){r.push(a);continue}let o=w(t[e.key]);if(e.modifier===``){if(o.length!==1)throw Error(`Missing required param "${e.key}" for named route "${n}"`);i.add(e.key),r.push(T(o[0]));continue}if(e.modifier===`?`){if(o.length===0)continue;if(o.length>1)throw Error(`Param "${e.key}" for named route "${n}" must be a single value`);i.add(e.key),r.push(T(o[0]));continue}if(e.modifier===`+`){if(o.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${n}"`);i.add(e.key);for(let e of o)r.push(T(e));continue}o.length>0&&i.add(e.key);for(let e of o)r.push(T(e))}return{path:r.join(`/`),consumedKeys:i}}function O(e){return e===void 0?!1:Array.isArray(e)?e.length>0:!0}function ee(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>O(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function te(e,t,n){let r=e.name;if(typeof r!=`string`||!r||e.path!==void 0||e.fullPath!==void 0)return e;let i=t.recordByName.get(r);if(!i)throw Error(`Named route "${r}" is not defined in createRouter({ routes | namedRoutes })`);let a=e.params?c(e.params):{},o=D(i.path,a,r);return n===`strict`&&ee(a,o.consumedKeys,r),{...e,path:o.path?`/${o.path}`:`/`,params:a}}function k(e){return e.split(`/`).filter(Boolean)}function ne(e){return[e.path,...e.aliasPaths]}function A(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function re(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function j(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())!i.parentName||n.has(e)||n.has(i.parentName)&&(n.add(e),r=!0)}return n}function ie(e){let t={};for(let[n,r]of e.entries())r.length!==0&&(t[n]=r.length===1?r[0]:r);return t}function M(e,t){let n=k(e),r=k(t),i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.push(t);return}i.set(e,[t])},o=e=>{let t=i.get(e);!t||t.length===0||(t.pop(),t.length===0&&i.delete(e))},s=(e,t,n)=>{for(let i=0;i<n;i+=1)a(e,E(r[t+i]));return()=>{for(let t=0;t<n;t+=1)o(e)}},c=(e,t)=>{if(e>=n.length)return t>=r.length;let i=n[e],l=C(i);if(!l)return t>=r.length||i!==r[t]?!1:c(e+1,t+1);if(l.modifier===``){if(t>=r.length)return!1;a(l.key,E(r[t]));let n=c(e+1,t+1);return n||o(l.key),n}if(l.modifier===`?`){if(t<r.length){if(a(l.key,E(r[t])),c(e+1,t+1))return!0;o(l.key)}return c(e+1,t)}let u=+(l.modifier===`+`),d=r.length-t;for(let n=d;n>=u;--n){let r=s(l.key,t,n);if(c(e+1,t+n))return!0;r()}return!1};if(c(0,0))return ie(i)}function ae(e,t){if(e.name){let n=t.recordByName.get(e.name);if(n)return{record:n,matchedRecords:A(n,t)}}let n=t.nameByStaticPath.get(e.path);if(n){let r=t.recordByName.get(n);if(r)return{record:r,matchedRecords:A(r,t),matchedPath:e.path}}for(let n of t.recordByName.values())for(let r of ne(n)){if(!u(r))continue;let i=M(r,e.path);if(i)return{record:n,matchedRecords:A(n,t),matchedPath:r,params:i}}}function N(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`[wevu/router] ${e}`)}function oe(e){let t=g(e,``);return t?l(t):`/`}function P(e,t=new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(P(t,n))return!0;return!1}function se(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(P(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function ce(e){let t=new Map,n=[];for(let i of e){var r;let e=typeof i.route.name==`string`?i.route.name.trim():``;if(!e)continue;let a=(r=i.source)==null?`namedRoutes`:r,o=oe(i.route.path),s=t.get(e);s&&n.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}n.length!==0&&N(`duplicate route names detected, later entries override earlier ones: ${n.join(`, `)}`)}function le(e){return e?Array.isArray(e)?e:[e]:[]}function ue(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function de(e,t){if(!e)return[];let n=Array.isArray(e)?e:[e],r=[];for(let e of n){if(typeof e!=`string`)continue;let n=g(e,``);!n||n===t||r.includes(n)||r.push(n)}return r}function fe(e,t,n=`namedRoutes`){let r=g(e.path,``);if(!r&&e.path!==`/`)return;let i=ue(e,r,n);if(i)return{name:i,path:r,aliasPaths:de(e.alias,r),parentName:t,meta:e.meta,beforeEnterGuards:le(e.beforeEnter),redirect:e.redirect}}function F(e,t){return!t||e.startsWith(`/`)?g(e,``):g(`${l(t)}/${e}`,``)}function pe(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function me(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function he(e){if(e.length!==0)return e.length===1?l(e[0]):e.map(e=>l(e))}function I(e,t,n,r=[],i,a=`namedRoutes`,o=new Set){let s=[];for(let[c,u]of e.entries()){let e=`${a}[${c}]`;if(o.has(u)){N(`ignored route record at ${e}: detected circular children reference`);continue}if(typeof u.path!=`string`||!u.path){N(`ignored route record "${typeof(u==null?void 0:u.name)==`string`?u.name.trim():``}" at ${e}: route path is required`);continue}let d=F(u.path,t),f=ue(u,d,i);if(!f){N(`ignored route record at ${e}: route name is required`);continue}let p=[],m=new Map;for(let n of pe(u.alias)){let r=F(n,t);if(!r)continue;if(r===d){N(`ignored alias "${l(r)}" for route "${f}" at ${e}: alias is same as route path`);continue}let i=m.get(r);if(i){N(`ignored duplicate alias "${l(r)}" for route "${f}" at ${e}: already declared by "${i}"`);continue}m.set(r,n),p.push(r)}let h=u.path.startsWith(`/`)?[]:r.map(e=>F(u.path,e)).filter(Boolean).filter(e=>e!==d),g=me([...p,...h]),_={name:f,path:d?l(d):`/`,alias:he(g),meta:u.meta,beforeEnter:u.beforeEnter,redirect:u.redirect};if(s.push({route:_,parentName:n,source:i}),Array.isArray(u.children)&&u.children.length>0){let t=new Set(o);t.add(u),s.push(...I(u.children,d,f,g,i,`${e}.children`,t))}}return s}function ge(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return I(e,void 0,void 0,[],t,t);let n=[];for(let[r,i]of Object.entries(e)){let e=typeof r==`string`?r.trim():``;if(!e){N(`ignored route record at ${t}: route name is required`);continue}if(typeof i!=`string`||!i){N(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:i},source:t})}return n}function _e(e){return[...ge(e.routes,`routes`),...ge(e.namedRoutes,`namedRoutes`)]}function L(e){let t=new Map;for(let[n,r]of e.entries()){!u(r.path)&&!t.has(r.path)&&t.set(r.path,n);for(let e of r.aliasPaths)!u(e)&&!t.has(e)&&t.set(e,n)}return t}function ve(e){let t=new Map;for(let n of e){let e=fe(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:L(t)}}function R(e){if(e)return{...e}}function ye(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=R(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function be(e,t,n,r,i,a){let o=Object.freeze(e.map(e=>l(e))),s=Object.freeze(t.map(ye));return Object.freeze({tabBarEntries:o,routes:s,namedRoutes:s,paramsMode:n,maxRedirects:r,parseQuery:i.parseQuery,stringifyQuery:i.stringifyQuery,rejectOnError:a})}function xe(e,t){let n={name:e.name,path:l(e.path)},r=typeof t==`string`&&t?l(g(t,``)):void 0;return r&&r!==n.path&&(n.aliasPath=r),e.meta!==void 0&&(n.meta=R(e.meta)),n}function z(e){if(e)return e.map(e=>({name:e.name,path:e.path,aliasPath:e.aliasPath,meta:R(e.meta)}))}function B(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function V(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function H(e){if(!e)return;let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),t}function Se(e){let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),t}function U(e){let t={path:e.path,fullPath:e.fullPath,query:B(e.query),hash:e.hash,params:V(e.params)};return e.meta!==void 0&&(t.meta=R(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=z(e.matched)),e.redirectedFrom!==void 0&&(t.redirectedFrom=H(e.redirectedFrom)),e.name!==void 0&&(t.name=e.name),t}function W(e,t=b){let n=l(e.path),r=t(e.query);return r?`${n}?${r}`:n}function Ce(e){return Object.keys(e).length>0}const we=Symbol(`wevu.router.instance`);let Te;function Ee(e){Te=e,x(we,e)}function De(){var e;return(e=Te)==null?d(we,void 0):e}const G={unknown:1,aborted:4,cancelled:8,duplicated:16},Oe=/already|same|duplicat|重复/,ke=/cancel|取消/,Ae=/abort|interrupt|中断/;function je(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function K(e){let t=je(e).toLowerCase();return Oe.test(t)?G.duplicated:ke.test(t)?G.cancelled:Ae.test(t)?G.aborted:G.unknown}function q(e,t,n,r){let i=je(r)||`Navigation failed`,a=Error(i);return a.__wevuNavigationFailure=!0,a.type=e,a.to=t,a.from=n,a.cause=r,a}function J(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0?!0:n.type===t:!1}function Me(e){return!e||typeof e!=`object`?!1:`to`in e}function Ne(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function Y(e,t,n){for(let r of e)try{let e=await r(t.to,t.from,t);if(J(e))return{status:`failure`,failure:e};if(e===!1)return{status:`failure`,failure:q(G.aborted,t.to,t.from,`Navigation aborted by guard`)};if(Me(e))return t.to?{status:`redirect`,target:n(e.to,t.to.path),replace:e.replace}:{status:`failure`,failure:q(G.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)};if(Ne(e))return t.to?{status:`redirect`,target:n(e,t.to.path)}:{status:`failure`,failure:q(G.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)}}catch(e){return{status:`failure`,failure:q(G.aborted,t.to,t.from,e)}}return{status:`continue`}}function X(e,t,n,r){return new Promise(i=>{let a=!1,o=e=>{a||(a=!0,i(e))};try{let i=e({...t,success:()=>o(),fail:e=>{o(q(K(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>o(),e=>o(q(K(e),n,r,e)))}catch(e){o(q(K(e),n,r,e))}})}async function Pe(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function Fe(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function Ie(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function Le(e){return e.type===G.unknown||e.cause instanceof Error?!0:e.type===G.aborted&&e.cause!==void 0?!(typeof e.cause==`string`||Ie(e.cause)):!1}function Z(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function Re(e){let{afterEachHooks:t,errorHandlers:n,nativeRouter:r,rejectOnError:i}=e;async function a(e){if(await Pe(t,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure}),e.failure&&Le(e.failure)){var i;await Fe(n,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure})}}function o(e){return i&&Le(e)}async function s(e){if(await a(e),e.failure&&o(e.failure))throw e.failure;return e.failure}return{settleNavigationResult:s}}function ze(e,t){return q(G.duplicated,e,t,`Avoided redundant navigation to current location`)}function Be(e,t){return q(G.aborted,e,t,`switchTab does not support query parameters`)}function Q(e,t,n){return q(G.aborted,e,t,`Navigation redirected more than ${n} times`)}function Ve(e,t){return q(G.aborted,e,t,`Hash-only navigation is not supported in mini-program router`)}function He(e){return q(G.aborted,void 0,e,`Forward navigation is not supported in mini-program router`)}function $(e,t){e.redirectedFrom=t.redirectedFrom?H(t.redirectedFrom):Se(t)}async function Ue(e,t,n,r){let i=typeof e==`function`?await e(t,n):e;return Me(i)?{target:r(i.to,t.path),replace:i.replace}:{target:r(i,t.path),replace:!0}}async function We(e){let{mode:t,target:n,from:r,nativeRouter:i,routeResolveCodec:a,namedRouteLookup:o,beforeEachGuards:s,beforeResolveGuards:c,maxRedirects:u,tabBarPathSet:d,resolveWithCodec:f}=e,p=n,m=t,h=0;for(;;){var g;let e=d.has(p.path);if(W(p,a.stringifyQuery)===W(r,a.stringifyQuery)&&p.hash!==r.hash)return Z(m,r,p,Ve(p,r));if(e?p.path===r.path:p.fullPath===r.fullPath)return Z(m,r,p,ze(p,r));if(e&&Ce(p.query))return Z(m,r,p,Be(p,r));let t=await Y(s,{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return Z(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if($(e,p),p=e,m=n,h+=1,h>u)return Z(m,r,p,Q(p,r,u));continue}}let n=ae(p,o),_=(g=n==null?void 0:n.matchedRecords)==null?[]:g,v=!1;for(let e of _){if(e.redirect===void 0)continue;let t;try{t=await Ue(e.redirect,p,r,f)}catch(e){return Z(m,r,p,q(G.aborted,p,r,e))}let n=t.replace===!1?`push`:`replace`,i=t.target;if(i.fullPath!==p.fullPath||n!==m){if($(i,p),p=i,m=n,h+=1,h>u)return Z(m,r,p,Q(p,r,u));v=!0;break}}if(v)continue;let y=!1;for(let e of _){if(e.beforeEnterGuards.length===0)continue;let t=await Y(new Set(e.beforeEnterGuards),{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return Z(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if($(e,p),p=e,m=n,h+=1,h>u)return Z(m,r,p,Q(p,r,u));y=!0;break}}}if(y)continue;let b=await Y(c,{mode:m,to:p,from:r,nativeRouter:i},f);if(b.status===`failure`)return Z(m,r,p,b.failure);if(b.status===`redirect`){let e=b.target,t=b.replace===!0?`replace`:b.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||t!==m){if($(e,p),p=e,m=t,h+=1,h>u)return Z(m,r,p,Q(p,r,u));continue}}if(e){let e=await X(i.switchTab,{url:l(p.path)},p,r);return J(e)?Z(m,r,p,e):Z(m,r,p)}let x=await X(m===`push`?i.navigateTo:i.redirectTo,{url:W(p,a.stringifyQuery)},p,r);return J(x)?Z(m,r,p,x):Z(m,r,p)}}function Ge(e){let{nativeRouter:t,route:n,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l,settleNavigationResult:u}=e;async function d(e){let d=U(n),f;try{f=l(e,d.path)}catch(e){return u(Z(`push`,d,void 0,q(G.unknown,void 0,d,e)))}return u(await We({mode:`push`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l}))}async function f(e){let d=U(n),f;try{f=l(e,d.path)}catch(e){return u(Z(`replace`,d,void 0,q(G.unknown,void 0,d,e)))}return u(await We({mode:`replace`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l}))}async function p(e=1){let r=U(n),i=await Y(a,{mode:`back`,from:r,nativeRouter:t},l);if(i.status===`failure`)return u(Z(`back`,r,void 0,i.failure));if(i.status===`redirect`)return u(Z(`back`,r,void 0,q(G.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let s=await Y(o,{mode:`back`,from:r,nativeRouter:t},l);if(s.status===`failure`)return u(Z(`back`,r,void 0,s.failure));if(s.status===`redirect`)return u(Z(`back`,r,void 0,q(G.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let c=await X(t.navigateBack,{delta:e},void 0,r);return u(J(c)?Z(`back`,r,void 0,c):Z(`back`,r))}async function m(e){if(e<0)return p(Math.abs(e));if(e===0)return;let t=U(n);return u(Z(`back`,t,void 0,He(t)))}async function h(){return m(1)}return{push:d,replace:f,back:p,go:m,forward:h}}const Ke={parseQuery:p,stringifyQuery:b};function qe(e,t=``,n=Ke){var r,i,a,o;if(typeof e==`string`){let r=f(e,n);return _(g(r.path,t),r.query,r.hash,void 0,{},n.stringifyQuery)}let s=typeof e.fullPath==`string`?f(e.fullPath,n):void 0;return _(g((r=(i=e.path)==null?s==null?void 0:s.path:i)==null?t:r,t),e.query?v(e.query):(a=s==null?void 0:s.query)==null?{}:a,h((o=e.hash)==null?s==null?void 0:s.hash:o),typeof e.name==`string`?e.name:void 0,e.params?c(e.params):{},n.stringifyQuery)}function Je(e){let t={name:e.name,path:e.path?`/${e.path}`:`/`};return e.meta!==void 0&&(t.meta=R(e.meta)),e.aliasPaths.length===1?t.alias=l(e.aliasPaths[0]):e.aliasPaths.length>1&&(t.alias=e.aliasPaths.map(e=>l(e))),e.beforeEnterGuards.length===1?t.beforeEnter=e.beforeEnterGuards[0]:e.beforeEnterGuards.length>1&&(t.beforeEnter=e.beforeEnterGuards.slice()),e.redirect!==void 0&&(t.redirect=e.redirect),t}function Ye(e){let t=t=>e.recordByName.has(t),n=()=>Array.from(e.recordByName.values(),Je),r=((t,n)=>{let r=typeof t==`string`?n:t;if(!r)throw Error(`Route record is required when adding a child route`);se(r);let i=typeof t==`string`?t:void 0,a=i?e.recordByName.get(i):void 0;if(i&&!a)throw Error(`Parent route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let o=I([r],a==null?void 0:a.path,i,a==null?void 0:a.aliasPaths,void 0,`addRoute`);if(o.length===0)throw Error(`Route name and path are required when adding a named route`);let s=[];for(let t of o){let n=fe(t.route,t.parentName);if(!n)continue;let r=e.recordByName.get(n.name);if(r){let t=j(r.name,e.recordByName);for(let n of t)e.recordByName.delete(n);N(`addRoute() replaced existing route "${n.name}" (${l(r.path)} -> ${l(n.path)}) and removed ${t.size-1} nested route(s)`)}e.recordByName.set(n.name,n),s.push(n)}return e.nameByStaticPath=L(e.recordByName),()=>{let t=!1;for(let n of s)e.recordByName.get(n.name)===n&&(e.recordByName.delete(n.name),t=!0);t&&(e.nameByStaticPath=L(e.recordByName))}});function i(t){let n=j(t,e.recordByName);if(n.size===0)return;let r=!1;for(let t of n)r=e.recordByName.delete(t)||r;r&&(e.nameByStaticPath=L(e.recordByName))}function a(){e.recordByName.clear(),e.nameByStaticPath.clear()}return{hasRoute:t,getRoutes:n,addRoute:r,removeRoute:i,clearRoutes:a}}function Xe(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=B(t.query),e.hash=t.hash,e.params=V(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=R(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=z(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=H(t.redirectedFrom)}function Ze(c={}){var l;let u=t();if(!u)throw Error(`useRoute() 必须在 setup() 的同步阶段调用`);let d=u.instance,f=(l=c.resolveRoute)==null?(e=>{var t,n;return(t=(n=De())==null?void 0:n.resolve(e))==null?e:t}):l,p=f(s(void 0,d)),m=e({path:p.path,fullPath:p.fullPath,query:B(p.query),hash:p.hash,params:V(p.params)});Xe(m,p);function h(e){Xe(m,f(s(e,d)))}return i(e=>{h(e)}),a(()=>{h()}),o(()=>{h()}),r(()=>{h()}),n(m)}function Qe(){return m()}function $e(){return y()}function et(e={}){var t,n,r,i,a,o;let s=Qe(),c=new Set,l=new Set,u=new Set,d=new Set,f=(t=e.maxRedirects)==null?10:t,m=(n=e.paramsMode)==null?`loose`:n,h=(r=e.rejectOnError)==null?!0:r,_={parseQuery:(i=e.parseQuery)==null?p:i,stringifyQuery:(a=e.stringifyQuery)==null?b:a},v=Promise.resolve(),y=_e(e);ce(y);let x=ve(y),S=((o=e.tabBarEntries)==null?[]:o).map(e=>g(e,``)).filter(Boolean),C=new Set(S),w=Ye(x),T=be(S,w.getRoutes(),m,f,_,h);function E(e){let t={...e};t.href=t.fullPath;let n=ae(t,x);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=re(n.matchedRecords);r!==void 0&&(t.meta=R(r)),n.params&&Object.keys(t.params).length===0&&(t.params=V(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>xe(e,t===r.length-1?n.matchedPath:void 0))}else t.matched=[];return t}function D(e,t){return E(qe(typeof e==`string`?e:te(e,x,m),t,_))}let O=Ze({resolveRoute:E});function ee(e){return D(e,O.path)}let k=Ge({nativeRouter:s,route:O,routeResolveCodec:_,namedRouteLookup:x,beforeEachGuards:c,beforeResolveGuards:l,maxRedirects:f,tabBarPathSet:C,resolveWithCodec:D,settleNavigationResult:Re({afterEachHooks:u,errorHandlers:d,nativeRouter:s,rejectOnError:h}).settleNavigationResult});function ne(e){return c.add(e),()=>{c.delete(e)}}function A(e){return l.add(e),()=>{l.delete(e)}}function j(e){return u.add(e),()=>{u.delete(e)}}function ie(e){return d.add(e),()=>{d.delete(e)}}let M={nativeRouter:s,options:T,currentRoute:O,install(e){var t;Ee(M);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=M)},resolve:ee,isReady(){return v},push:k.push,replace:k.replace,back:k.back,go:k.go,forward:k.forward,hasRoute:w.hasRoute,getRoutes:w.getRoutes,addRoute:w.addRoute,removeRoute:w.removeRoute,clearRoutes:w.clearRoutes,beforeEach:ne,beforeResolve:A,afterEach:j,onError:ie};return Ee(M),M}function tt(){let e=De();if(e)return e;throw Error(`useRouter() 未找到已创建的 router 实例。请先在 setup() 中调用 createRouter()。`)}export{G as NavigationFailureType,q as createNavigationFailure,et as createRouter,J as isNavigationFailure,p as parseQuery,qe as resolveRouteLocation,b as stringifyQuery,$e as useNativePageRouter,Qe as useNativeRouter,Ze as useRoute,tt as useRouter};
|
|
1
|
+
import{d as e}from"./ref-D37CknuD.mjs";import{c as t,g as n,x as r}from"./base-BxKbbKVO.mjs";import{$ as i,B as a,Y as o,a as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,q as y,r as b,rt as x,s as S,t as C,u as w,x as ee,y as T}from"./router-DLOOLAqv.mjs";const te=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function E(e){var t;let n=te.exec(e);if(n)return{key:n[1],modifier:(t=n[2])==null?``:t}}function D(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function O(e){return encodeURIComponent(e)}function k(e){try{return decodeURIComponent(e)}catch(t){return e}}function A(e,t,n){let r=[],i=new Set;for(let a of e.split(`/`)){if(!a)continue;let e=E(a);if(!e){r.push(a);continue}let o=D(t[e.key]);if(e.modifier===``){if(o.length!==1)throw Error(`Missing required param "${e.key}" for named route "${n}"`);i.add(e.key),r.push(O(o[0]));continue}if(e.modifier===`?`){if(o.length===0)continue;if(o.length>1)throw Error(`Param "${e.key}" for named route "${n}" must be a single value`);i.add(e.key),r.push(O(o[0]));continue}if(e.modifier===`+`){if(o.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${n}"`);i.add(e.key);for(let e of o)r.push(O(e));continue}o.length>0&&i.add(e.key);for(let e of o)r.push(O(e))}return{path:r.join(`/`),consumedKeys:i}}function ne(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function re(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>ne(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function ie(e,t,n){let r=e.name;if(typeof r!=`string`||!r||e.path!==void 0||e.fullPath!==void 0)return e;let i=t.recordByName.get(r);if(!i)throw Error(`Named route "${r}" is not defined in createRouter({ routes | namedRoutes })`);let a=e.params?c(e.params):{},o=A(i.path,a,r);return n===`strict`&&re(a,o.consumedKeys,r),{...e,path:o.path?`/${o.path}`:`/`,params:a}}function j(e){return e.split(`/`).filter(Boolean)}function ae(e){return[e.path,...e.aliasPaths]}function M(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function oe(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function se(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())!i.parentName||n.has(e)||n.has(i.parentName)&&(n.add(e),r=!0)}return n}function ce(e){let t={};for(let[n,r]of e.entries())r.length!==0&&(t[n]=r.length===1?r[0]:r);return t}function le(e,t){let n=j(e),r=j(t),i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.push(t);return}i.set(e,[t])},o=e=>{let t=i.get(e);!t||t.length===0||(t.pop(),t.length===0&&i.delete(e))},s=(e,t,n)=>{for(let i=0;i<n;i+=1)a(e,k(r[t+i]));return()=>{for(let t=0;t<n;t+=1)o(e)}},c=(e,t)=>{if(e>=n.length)return t>=r.length;let i=n[e],l=E(i);if(!l)return t>=r.length||i!==r[t]?!1:c(e+1,t+1);if(l.modifier===``){if(t>=r.length)return!1;a(l.key,k(r[t]));let n=c(e+1,t+1);return n||o(l.key),n}if(l.modifier===`?`){if(t<r.length){if(a(l.key,k(r[t])),c(e+1,t+1))return!0;o(l.key)}return c(e+1,t)}let u=+(l.modifier===`+`),d=r.length-t;for(let n=d;n>=u;--n){let r=s(l.key,t,n);if(c(e+1,t+n))return!0;r()}return!1};if(c(0,0))return ce(i)}function ue(e,t){if(e.name){let n=t.recordByName.get(e.name);if(n)return{record:n,matchedRecords:M(n,t)}}let n=t.nameByStaticPath.get(e.path);if(n){let r=t.recordByName.get(n);if(r)return{record:r,matchedRecords:M(r,t),matchedPath:e.path}}for(let n of t.recordByName.values())for(let r of ae(n)){if(!u(r))continue;let i=le(r,e.path);if(i)return{record:n,matchedRecords:M(n,t),matchedPath:r,params:i}}}function N(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`[wevu/router] ${e}`)}function de(e){let t=v(e,``);return t?l(t):`/`}function fe(e,t=new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(fe(t,n))return!0;return!1}function pe(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(fe(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function me(e){let t=new Map,n=[];for(let i of e){var r;let e=typeof i.route.name==`string`?i.route.name.trim():``;if(!e)continue;let a=(r=i.source)==null?`namedRoutes`:r,o=de(i.route.path),s=t.get(e);s&&n.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}n.length!==0&&N(`duplicate route names detected, later entries override earlier ones: ${n.join(`, `)}`)}function he(e){return e?Array.isArray(e)?e:[e]:[]}function ge(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function _e(e,t){if(!e)return[];let n=Array.isArray(e)?e:[e],r=[];for(let e of n){if(typeof e!=`string`)continue;let n=v(e,``);!n||n===t||r.includes(n)||r.push(n)}return r}function ve(e,t,n=`namedRoutes`){let r=v(e.path,``);if(!r&&e.path!==`/`)return;let i=ge(e,r,n);if(i)return{name:i,path:r,aliasPaths:_e(e.alias,r),parentName:t,meta:e.meta,beforeEnterGuards:he(e.beforeEnter),redirect:e.redirect}}function P(e,t){return!t||e.startsWith(`/`)?v(e,``):v(`${l(t)}/${e}`,``)}function ye(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function be(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function xe(e){if(e.length!==0)return e.length===1?l(e[0]):e.map(e=>l(e))}function F(e,t,n,r=[],i,a=`namedRoutes`,o=new Set){let s=[];for(let[c,u]of e.entries()){let e=`${a}[${c}]`;if(o.has(u)){N(`ignored route record at ${e}: detected circular children reference`);continue}if(typeof u.path!=`string`||!u.path){N(`ignored route record "${typeof(u==null?void 0:u.name)==`string`?u.name.trim():``}" at ${e}: route path is required`);continue}let d=P(u.path,t),f=ge(u,d,i);if(!f){N(`ignored route record at ${e}: route name is required`);continue}let p=[],m=new Map;for(let n of ye(u.alias)){let r=P(n,t);if(!r)continue;if(r===d){N(`ignored alias "${l(r)}" for route "${f}" at ${e}: alias is same as route path`);continue}let i=m.get(r);if(i){N(`ignored duplicate alias "${l(r)}" for route "${f}" at ${e}: already declared by "${i}"`);continue}m.set(r,n),p.push(r)}let h=u.path.startsWith(`/`)?[]:r.map(e=>P(u.path,e)).filter(Boolean).filter(e=>e!==d),g=be([...p,...h]),_={name:f,path:d?l(d):`/`,alias:xe(g),meta:u.meta,beforeEnter:u.beforeEnter,redirect:u.redirect};if(s.push({route:_,parentName:n,source:i}),Array.isArray(u.children)&&u.children.length>0){let t=new Set(o);t.add(u),s.push(...F(u.children,d,f,g,i,`${e}.children`,t))}}return s}function Se(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return F(e,void 0,void 0,[],t,t);let n=[];for(let[r,i]of Object.entries(e)){let e=typeof r==`string`?r.trim():``;if(!e){N(`ignored route record at ${t}: route name is required`);continue}if(typeof i!=`string`||!i){N(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:i},source:t})}return n}function Ce(e){return[...Se(e.routes,`routes`),...Se(e.namedRoutes,`namedRoutes`)]}function I(e){let t=new Map;for(let[n,r]of e.entries()){!u(r.path)&&!t.has(r.path)&&t.set(r.path,n);for(let e of r.aliasPaths)!u(e)&&!t.has(e)&&t.set(e,n)}return t}function we(e){let t=new Map;for(let n of e){let e=ve(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:I(t)}}function L(e){if(e)return{...e}}function Te(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=L(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function Ee(e,t,n,r,i,a){let o=Object.freeze(e.map(e=>l(e))),s=Object.freeze(t.map(Te));return Object.freeze({tabBarEntries:o,routes:s,namedRoutes:s,paramsMode:n,maxRedirects:r,parseQuery:i.parseQuery,stringifyQuery:i.stringifyQuery,rejectOnError:a})}function De(e,t){let n={name:e.name,path:l(e.path)},r=typeof t==`string`&&t?l(v(t,``)):void 0;return r&&r!==n.path&&(n.aliasPath=r),e.meta!==void 0&&(n.meta=L(e.meta)),n}function R(e){if(e)return e.map(e=>({name:e.name,path:e.path,aliasPath:e.aliasPath,meta:L(e.meta)}))}function z(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function B(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function V(e){if(!e)return;let t={path:e.path,fullPath:e.fullPath,query:z(e.query),hash:e.hash,params:B(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=L(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=R(e.matched)),t}function Oe(e){let t={path:e.path,fullPath:e.fullPath,query:z(e.query),hash:e.hash,params:B(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=L(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=R(e.matched)),t}function H(e){let t={path:e.path,fullPath:e.fullPath,query:z(e.query),hash:e.hash,params:B(e.params)};return e.meta!==void 0&&(t.meta=L(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=R(e.matched)),e.redirectedFrom!==void 0&&(t.redirectedFrom=V(e.redirectedFrom)),e.name!==void 0&&(t.name=e.name),t}function U(e,t=w){let n=l(e.path),r=t(e.query);return r?`${n}?${r}`:n}function ke(e){return Object.keys(e).length>0}const Ae=Symbol(`wevu.router.instance`);let je;function Me(e){je=e,ee(Ae,e)}function Ne(){var e;return(e=je)==null?T(Ae,void 0):e}const W={unknown:1,aborted:4,cancelled:8,duplicated:16},Pe=/already|same|duplicat|重复/,Fe=/cancel|取消/,Ie=/abort|interrupt|中断/;function Le(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function G(e){let t=Le(e).toLowerCase();return Pe.test(t)?W.duplicated:Fe.test(t)?W.cancelled:Ie.test(t)?W.aborted:W.unknown}function K(e,t,n,r){let i=Le(r)||`Navigation failed`,a=Error(i);return a.__wevuNavigationFailure=!0,a.type=e,a.to=t,a.from=n,a.cause=r,a}function q(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function Re(e){return!e||typeof e!=`object`?!1:`to`in e}function ze(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function J(e,t,n){for(let r of e)try{let e=await r(t.to,t.from,t);if(q(e))return{status:`failure`,failure:e};if(e===!1)return{status:`failure`,failure:K(W.aborted,t.to,t.from,`Navigation aborted by guard`)};if(Re(e))return t.to?{status:`redirect`,target:n(e.to,t.to.path),replace:e.replace}:{status:`failure`,failure:K(W.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)};if(ze(e))return t.to?{status:`redirect`,target:n(e,t.to.path)}:{status:`failure`,failure:K(W.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)}}catch(e){return{status:`failure`,failure:K(W.aborted,t.to,t.from,e)}}return{status:`continue`}}function Y(e,t,n,r){return new Promise(i=>{let a=!1,o=e=>{a||(a=!0,i(e))};try{let i=e({...t,success:()=>o(),fail:e=>{o(K(G(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>o(),e=>o(K(G(e),n,r,e)))}catch(e){o(K(G(e),n,r,e))}})}async function Be(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function Ve(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function He(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function Ue(e){return e.type===W.unknown||e.cause instanceof Error||e.type===W.aborted&&e.cause!==void 0&&!(typeof e.cause==`string`||He(e.cause))}function X(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function We(e){let{afterEachHooks:t,errorHandlers:n,nativeRouter:r,rejectOnError:i}=e;async function a(e){if(await Be(t,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure}),e.failure&&Ue(e.failure)){var i;await Ve(n,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure})}}function o(e){return i&&Ue(e)}async function s(e){if(!e.failure&&e.to&&f({route:e.to}),await a(e),e.failure&&o(e.failure))throw e.failure;return e.failure}return{settleNavigationResult:s}}function Ge(e,t){return K(W.duplicated,e,t,`Avoided redundant navigation to current location`)}function Ke(e,t){return K(W.aborted,e,t,`switchTab does not support query parameters`)}function Z(e,t,n){return K(W.aborted,e,t,`Navigation redirected more than ${n} times`)}function qe(e,t){return K(W.aborted,e,t,`Hash-only navigation is not supported in mini-program router`)}function Je(e){return K(W.aborted,void 0,e,`Forward navigation is not supported in mini-program router`)}function Q(e,t){e.redirectedFrom=t.redirectedFrom?V(t.redirectedFrom):Oe(t)}async function Ye(e,t,n,r){let i=typeof e==`function`?await e(t,n):e;return Re(i)?{target:r(i.to,t.path),replace:i.replace}:{target:r(i,t.path),replace:!0}}async function Xe(e){let{mode:t,target:n,from:r,nativeRouter:i,routeResolveCodec:a,namedRouteLookup:o,beforeEachGuards:s,beforeResolveGuards:c,maxRedirects:u,tabBarPathSet:d,resolveWithCodec:f}=e,p=n,m=t,h=0;for(;;){var g;let e=d.has(p.path);if(U(p,a.stringifyQuery)===U(r,a.stringifyQuery)&&p.hash!==r.hash)return X(m,r,p,qe(p,r));if(e?p.path===r.path:p.fullPath===r.fullPath)return X(m,r,p,Ge(p,r));if(e&&ke(p.query))return X(m,r,p,Ke(p,r));let t=await J(s,{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return X(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if(Q(e,p),p=e,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));continue}}let n=ue(p,o),_=(g=n==null?void 0:n.matchedRecords)==null?[]:g,v=!1;for(let e of _){if(e.redirect===void 0)continue;let t;try{t=await Ye(e.redirect,p,r,f)}catch(e){return X(m,r,p,K(W.aborted,p,r,e))}let n=t.replace===!1?`push`:`replace`,i=t.target;if(i.fullPath!==p.fullPath||n!==m){if(Q(i,p),p=i,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));v=!0;break}}if(v)continue;let y=!1;for(let e of _){if(e.beforeEnterGuards.length===0)continue;let t=await J(new Set(e.beforeEnterGuards),{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return X(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if(Q(e,p),p=e,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));y=!0;break}}}if(y)continue;let b=await J(c,{mode:m,to:p,from:r,nativeRouter:i},f);if(b.status===`failure`)return X(m,r,p,b.failure);if(b.status===`redirect`){let e=b.target,t=b.replace===!0?`replace`:b.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||t!==m){if(Q(e,p),p=e,m=t,h+=1,h>u)return X(m,r,p,Z(p,r,u));continue}}if(e){let e=await Y(i.switchTab,{url:l(p.path)},p,r);return q(e)?X(m,r,p,e):X(m,r,p)}let x=await Y(m===`push`?i.navigateTo:i.redirectTo,{url:U(p,a.stringifyQuery)},p,r);return q(x)?X(m,r,p,x):X(m,r,p)}}function Ze(e){let{nativeRouter:t,route:n,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l,settleNavigationResult:u}=e;async function d(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(X(`push`,d,void 0,K(W.unknown,void 0,d,e)))}let p=await Xe({mode:`push`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l});return u(p)}async function f(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(X(`replace`,d,void 0,K(W.unknown,void 0,d,e)))}let p=await Xe({mode:`replace`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l});return u(p)}async function p(e=1){let r=H(n),i=await J(a,{mode:`back`,from:r,nativeRouter:t},l);if(i.status===`failure`)return u(X(`back`,r,void 0,i.failure));if(i.status===`redirect`)return u(X(`back`,r,void 0,K(W.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let s=await J(o,{mode:`back`,from:r,nativeRouter:t},l);if(s.status===`failure`)return u(X(`back`,r,void 0,s.failure));if(s.status===`redirect`)return u(X(`back`,r,void 0,K(W.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let c=await Y(t.navigateBack,{delta:e},void 0,r),d=q(c)?X(`back`,r,void 0,c):X(`back`,r);return u(d)}async function m(e){if(e<0)return p(Math.abs(e));if(e===0)return;let t=H(n);return u(X(`back`,t,void 0,Je(t)))}async function h(){return m(1)}return{push:d,replace:f,back:p,go:m,forward:h}}const Qe={parseQuery:m,stringifyQuery:w};function $(e,t=``,n=Qe){var r,i,a,o;if(typeof e==`string`){let r=p(e,n);return b(v(r.path,t),r.query,r.hash,void 0,{},n.stringifyQuery)}let s=typeof e.fullPath==`string`?p(e.fullPath,n):void 0;return b(v((r=(i=e.path)==null?s==null?void 0:s.path:i)==null?t:r,t),e.query?S(e.query):(a=s==null?void 0:s.query)==null?{}:a,_((o=e.hash)==null?s==null?void 0:s.hash:o),typeof e.name==`string`?e.name:void 0,e.params?c(e.params):{},n.stringifyQuery)}function $e(e){let t={name:e.name,path:e.path?`/${e.path}`:`/`};return e.meta!==void 0&&(t.meta=L(e.meta)),e.aliasPaths.length===1?t.alias=l(e.aliasPaths[0]):e.aliasPaths.length>1&&(t.alias=e.aliasPaths.map(e=>l(e))),e.beforeEnterGuards.length===1?t.beforeEnter=e.beforeEnterGuards[0]:e.beforeEnterGuards.length>1&&(t.beforeEnter=e.beforeEnterGuards.slice()),e.redirect!==void 0&&(t.redirect=e.redirect),t}function et(e){let t=t=>e.recordByName.has(t),n=()=>Array.from(e.recordByName.values(),$e),r=((t,n)=>{let r=typeof t==`string`?n:t;if(!r)throw Error(`Route record is required when adding a child route`);pe(r);let i=typeof t==`string`?t:void 0,a=i?e.recordByName.get(i):void 0;if(i&&!a)throw Error(`Parent route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let o=F([r],a==null?void 0:a.path,i,a==null?void 0:a.aliasPaths,void 0,`addRoute`);if(o.length===0)throw Error(`Route name and path are required when adding a named route`);let s=[];for(let t of o){let n=ve(t.route,t.parentName);if(!n)continue;let r=e.recordByName.get(n.name);if(r){let t=se(r.name,e.recordByName);for(let n of t)e.recordByName.delete(n);N(`addRoute() replaced existing route "${n.name}" (${l(r.path)} -> ${l(n.path)}) and removed ${t.size-1} nested route(s)`)}e.recordByName.set(n.name,n),s.push(n)}return e.nameByStaticPath=I(e.recordByName),()=>{let t=!1;for(let n of s)e.recordByName.get(n.name)===n&&(e.recordByName.delete(n.name),t=!0);t&&(e.nameByStaticPath=I(e.recordByName))}});function i(t){let n=se(t,e.recordByName);if(n.size===0)return;let r=!1;for(let t of n)r=e.recordByName.delete(t)||r;r&&(e.nameByStaticPath=I(e.recordByName))}function a(){e.recordByName.clear(),e.nameByStaticPath.clear()}return{hasRoute:t,getRoutes:n,addRoute:r,removeRoute:i,clearRoutes:a}}function tt(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=z(t.query),e.hash=t.hash,e.params=B(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=L(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=R(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=V(t.redirectedFrom)}function nt(n={}){var c;let l=t();if(!l)throw Error(`useRoute() 必须在 setup() 的同步阶段调用`);let u=l.instance,f=(c=n.resolveRoute)==null?(e=>{var t,n;return(t=(n=Ne())==null?void 0:n.resolve(e))==null?e:t}):c,p=f(s(void 0,u)),m=e({path:p.path,fullPath:p.fullPath,query:z(p.query),hash:p.hash,params:B(p.params)});tt(m,p);function h(e,t){let n=f(t||s(e,u));tt(m,n)}a(e=>{h(e)}),y(()=>{h()}),i(()=>{h()}),o(()=>{h()});let g=d(e=>{if(e!=null&&e.route){h(void 0,e.route);return}if(e!=null&&e.url){h(void 0,$(e.url,m.path));return}h()});return x(()=>{g()}),{route:r(m)}}function rt(e={}){return nt(e).route}function it(){return g()}function at(){return C()}function ot(e={}){var t,r,i,a,o,s;let c=it();h(n());let l=new Set,u=new Set,d=new Set,f=new Set,p=(t=e.maxRedirects)==null?10:t,g=(r=e.paramsMode)==null?`loose`:r,_=(i=e.rejectOnError)==null||i,y={parseQuery:(a=e.parseQuery)==null?m:a,stringifyQuery:(o=e.stringifyQuery)==null?w:o},b=Promise.resolve(),x=Ce(e);me(x);let S=we(x),C=((s=e.tabBarEntries)==null?[]:s).map(e=>v(e,``)).filter(Boolean),ee=new Set(C),T=et(S),te=Ee(C,T.getRoutes(),g,p,y,_);function E(e){let t={...e};t.href=t.fullPath;let n=ue(t,S);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=oe(n.matchedRecords);r!==void 0&&(t.meta=L(r)),n.params&&Object.keys(t.params).length===0&&(t.params=B(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>De(e,t===r.length-1?n.matchedPath:void 0))}else t.matched=[];return t}function D(e,t){return E($(typeof e==`string`?e:ie(e,S,g),t,y))}let O=nt({resolveRoute:E}).route;function k(e){return D(e,O.path)}let A=Ze({nativeRouter:c,route:O,routeResolveCodec:y,namedRouteLookup:S,beforeEachGuards:l,beforeResolveGuards:u,maxRedirects:p,tabBarPathSet:ee,resolveWithCodec:D,settleNavigationResult:We({afterEachHooks:d,errorHandlers:f,nativeRouter:c,rejectOnError:_}).settleNavigationResult});function ne(e){return l.add(e),()=>{l.delete(e)}}function re(e){return u.add(e),()=>{u.delete(e)}}function j(e){return d.add(e),()=>{d.delete(e)}}function ae(e){return f.add(e),()=>{f.delete(e)}}let M={nativeRouter:c,options:te,currentRoute:O,install(e){var t;Me(M);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=M)},resolve:k,isReady(){return b},push:A.push,replace:A.replace,back:A.back,go:A.go,forward:A.forward,hasRoute:T.hasRoute,getRoutes:T.getRoutes,addRoute:T.addRoute,removeRoute:T.removeRoute,clearRoutes:T.clearRoutes,beforeEach:ne,beforeResolve:re,afterEach:j,onError:ae};return Me(M),M}function st(){let e=Ne();if(e)return e;throw Error(`useRouter() 未找到已创建的 router 实例。请先在 setup() 中调用 createRouter()。`)}export{W as NavigationFailureType,K as createNavigationFailure,ot as createRouter,q as isNavigationFailure,m as parseQuery,$ as resolveRouteLocation,w as stringifyQuery,at as useNativePageRouter,it as useNativeRouter,rt as useRoute,st as useRouter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as e,N as t,d as n,l as r,n as i,v as a}from"./ref-D37CknuD.mjs";import{i as o,t as s}from"./computed-Xoi9XEUx.mjs";function c(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(e){}});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 l(e){return typeof e==`object`&&!!e}function u(e){if(!l(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function d(e,t){for(let n in t)e[n]=t[n]}function f(e){if(Array.isArray(e))return e.map(e=>f(e));if(u(e)){let t={};for(let n in e)t[n]=f(e[n]);return t}return e}function p(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=0,t.forEach((t,n)=>{e[n]=f(t)});return}if(l(t)){for(let n in e)n in t||delete e[n];for(let n in t){let r=t[n],i=e[n];if(Array.isArray(r)&&Array.isArray(i)){p(i,r);continue}if(u(r)&&u(i)){p(i,r);continue}e[n]=f(r)}}}function m(e,t,n,r){let i={$id:e};Object.defineProperty(i,"$state",{get(){return t},set(e){t&&l(e)&&(d(t,e),n(`patch object`))}}),i.$patch=e=>{if(!t){typeof e==`function`?(e(i),n(`patch function`)):(d(i,e),n(`patch object`));return}typeof e==`function`?(e(t),n(`patch function`)):(d(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 h(e){return i(e)}function g(e){return r(e)?f(a(e)):h(e)?f(e.value):f(e)}function _(e,t,n){let r=!1;return i=>{if(!r){r=!0;try{let r=n();t.forEach(t=>{try{t({type:i,storeId:e},r)}catch(e){}})}finally{r=!1}}}}function v(t,r,i){var l,u,d;let h=r.state?r.state():{},g=n(h),v=f(a(h)),y=()=>{},b=m(t,g,e=>y(e),()=>{p(g,v),y(`patch object`)}),x=!1,S=b.api.$patch;if(b.api.$patch=e=>{x=!0;try{S(e)}finally{x=!1}},typeof b.api.$reset==`function`){let e=b.api.$reset;b.api.$reset=()=>{x=!0;try{e()}finally{x=!1}}}y=_(t,b.subs,()=>g);let C={};for(let e of Object.getOwnPropertyNames(b.api)){let t=Object.getOwnPropertyDescriptor(b.api,e);t&&(e===`$state`?Object.defineProperty(C,e,{enumerable:t.enumerable,configurable:t.configurable,get(){return b.api.$state},set(e){x=!0;try{b.api.$state=e}finally{x=!1}}}):Object.defineProperty(C,e,t))}let w=(l=r.getters)==null?{}:l;Object.keys(w).forEach(e=>{let t=w[e];if(typeof t==`function`){let n=s(()=>t.call(C,g));Object.defineProperty(C,e,{enumerable:!0,configurable:!0,get(){return n.value}})}});let T=(u=r.actions)==null?{}:u;Object.keys(T).forEach(e=>{let t=T[e];if(typeof t==`function`){let n=c(C,e,(...e)=>t.apply(C,e),b.actionSubs);C[e]=n}}),Object.keys(g).forEach(e=>{Object.defineProperty(C,e,{enumerable:!0,configurable:!0,get(){return g[e]},set(t){g[e]=t}})});let E=!1,D=!1;e(()=>{if(o(g),!E){E=!0;return}if(!(x||D)){D=!0;try{y(`direct`)}finally{D=!1}}});let O=(d=i==null?void 0:i._plugins)==null?[]:d;for(let e of O)try{e({store:C})}catch(e){}return C}function y(t,n,a){var s;let l=n(),u=()=>{},d=new Map;Object.keys(l).forEach(e=>{let t=l[e];typeof t==`function`||e.startsWith(`$`)||i(t)&&!h(t)||d.set(e,g(t))});let v={},y=m(t,void 0,e=>u(e),()=>{d.forEach((e,t)=>{let n=v[t];if(h(n)){try{n.value=f(e)}catch(e){}return}if(r(n)){p(n,e);return}i(n)||(v[t]=f(e))}),u(`patch object`)}),b=!1,x=y.api.$patch;if(y.api.$patch=e=>{b=!0;try{x(e)}finally{b=!1}},typeof y.api.$reset==`function`){let e=y.api.$reset;y.api.$reset=()=>{b=!0;try{e()}finally{b=!1}}}v={...l},u=_(t,y.subs,()=>v);for(let e of Object.getOwnPropertyNames(y.api)){let t=Object.getOwnPropertyDescriptor(y.api,e);t&&(e===`$state`?Object.defineProperty(v,e,{enumerable:t.enumerable,configurable:t.configurable,get(){return y.api.$state},set(e){b=!0;try{y.api.$state=e}finally{b=!1}}}):Object.defineProperty(v,e,t))}let S=[];Object.keys(l).forEach(e=>{let t=l[e];if(typeof t==`function`&&!e.startsWith(`$`)){v[e]=c(v,e,t,y.actionSubs);return}if(h(t)){S.push(t);return}if(r(t)){S.push(t);return}if(!i(t)&&!e.startsWith(`$`)){let n=t;Object.defineProperty(v,e,{enumerable:!0,configurable:!0,get(){return n},set(e){n=e,b||u(`direct`)}})}});let C=!1;if(S.length>0){let t=!1;e(()=>{if(S.forEach(e=>{h(e)?e.value:o(e)}),!t){t=!0;return}if(!(b||C)){C=!0;try{u(`direct`)}finally{C=!1}}})}let w=(s=a==null?void 0:a._plugins)==null?[]:s;for(let e of w)try{e({store:v})}catch(e){}return v}function b(){let e={_stores:new Map,_plugins:[],install(e){},use(t){return typeof t==`function`&&e._plugins.push(t),e}};return b._instance=e,e}function x(e,n){let r,i=!1,a=b._instance;return function(){return i&&r?r:(i=!0,r=t(!0).run(()=>typeof n==`function`?y(e,n,a):v(e,n,a)),r)}}function S(e){let t={};for(let n in e){let r=e[n];if(typeof r==`function`){t[n]=r;continue}i(r)?t[n]=r:t[n]=s({get:()=>e[n],set:t=>{e[n]=t}})}return t}export{x as n,b as r,S as t};
|
package/dist/store.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ActionContext, c as MutationType, d as SubscriptionCallback, i as defineStore, l as StoreManager, n as storeToRefs, o as ActionSubscriber, r as createStore, s as DefineStoreOptions, t as StoreToRefsResult, u as StoreSubscribeOptions } from "./index-
|
|
1
|
+
import { a as ActionContext, c as MutationType, d as SubscriptionCallback, i as defineStore, l as StoreManager, n as storeToRefs, o as ActionSubscriber, r as createStore, s as DefineStoreOptions, t as StoreToRefsResult, u as StoreSubscribeOptions } from "./index-CCET_bCY.mjs";
|
|
2
2
|
export { type ActionContext, type ActionSubscriber, type DefineStoreOptions, type MutationType, type StoreManager, type StoreSubscribeOptions, type StoreToRefsResult, type SubscriptionCallback, createStore, defineStore, storeToRefs };
|
package/dist/store.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./store-
|
|
1
|
+
import{n as e,r as t,t as n}from"./store-eHrHBQiv.mjs";export{t as createStore,e as defineStore,n as storeToRefs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./ref-
|
|
1
|
+
import{o as e}from"./ref-D37CknuD.mjs";const t=/\B([A-Z])/g;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e){return e?e.startsWith(`--`)?e:e.replace(t,`-$1`).toLowerCase():``}function i(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 a(t){let n=``;for(let a of Object.keys(t)){let o=e(t[a]);if(o==null)continue;let s=r(a);if(Array.isArray(o))for(let t of o){let r=e(t);r!=null&&(n=i(n,`${s}:${r}`))}else n=i(n,`${s}:${o}`)}return n}function o(t){let n=e(t);if(n==null)return``;if(typeof n==`string`)return n;if(Array.isArray(n)){let e=``;for(let t of n){let n=o(t);n&&(e=i(e,n))}return e}return typeof n==`object`?a(n):``}function s(t){let n=e(t),r=``;if(!n)return r;if(typeof n==`string`)return n;if(Array.isArray(n)){for(let e of n){let t=s(e);t&&(r+=`${t} `)}return r.trim()}if(typeof n==`object`){for(let t of Object.keys(n))e(n[t])&&(r+=`${t} `);return r.trim()}return r}function c(t,r,i,a=!1){if(t==null)return i;let o=e(t.__wevuProps);if(r===`data`)return o!=null&&(o[r]!==void 0||n(o,r))?o[r]:r in t?t[r]:i;let s=o!=null&&(o[r]!==void 0||n(o,r));if(a)return s?o[r]:r in t?t[r]:i;let c=e(t.$state);return c!=null&&n(c,r)?t[r]:s?o[r]:r in t?t[r]:i}export{o as n,c as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,l as t,m as n,p as r,t as i}from"./watch-Bbd-gmEg.mjs";import{A as a,B as o,M as s,N as c,R as l,a as u,d,i as f,k as p,l as m,n as h,o as g,r as _,s as v,t as y,v as b,z as x}from"./ref-D37CknuD.mjs";import{i as S,n as C,r as w,t as T}from"./computed-Xoi9XEUx.mjs";import{_ as E,c as D,d as O,g as k,h as A,l as j,m as M,n as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B}from"./base-BxKbbKVO.mjs";import{$ as V,A as H,C as U,D as W,E as G,F as ee,G as te,I as K,M as ne,O as re,S as ie,T as q,W as ae,j as oe,k as se,rt as ce,w as le}from"./router-DLOOLAqv.mjs";import{WEVU_ATTRS_KEY as ue,WEVU_EFFECT_SCOPE_KEY as de,WEVU_EXPOSED_KEY as fe,WEVU_FUNCTION_PROP_PATHS_KEY as pe,WEVU_HOOKS_KEY as me,WEVU_INLINE_HANDLER as he,WEVU_INLINE_MAP_KEY as ge,WEVU_IS_APP_INSTANCE_KEY as _e,WEVU_LAYOUT_BRIDGE_PAGE_KEYS as ve,WEVU_LAYOUT_HOST_BRIDGE_KEY as ye,WEVU_MODEL_HANDLER as be,WEVU_NATIVE_INSTANCE_KEY as J,WEVU_ON_BEFORE_UPDATE_HOOK as xe,WEVU_ON_LOAD_CALLED_KEY as Se,WEVU_ON_UPDATED_HOOK as Ce,WEVU_OWNER_HANDLER as we,WEVU_PAGE_LAYOUT_NAME_KEY as Te,WEVU_PAGE_LAYOUT_NONE as Y,WEVU_PAGE_LAYOUT_PROPS_KEY as Ee,WEVU_PAGE_LAYOUT_SETTER_KEY as De,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as Oe,WEVU_PARENT_INSTANCE_KEY as ke,WEVU_PENDING_PROP_VALUES_KEY as Ae,WEVU_PROPS_ALIASES_KEY as je,WEVU_PROPS_DERIVED_KEYS_KEY as Me,WEVU_PROPS_KEY as X,WEVU_PROP_KEYS_KEY as Ne,WEVU_PUBLIC_RUNTIME_KEY as Pe,WEVU_READY_CALLED_KEY as Fe,WEVU_RESERVED_METHOD_PREFIX as Ie,WEVU_ROUTE_DONE_CALLED_KEY as Le,WEVU_ROUTE_DONE_IN_TICK_KEY as Re,WEVU_RUNTIME_APP_KEY as ze,WEVU_RUNTIME_KEY as Be,WEVU_SCOPED_SLOT_CREATOR_KEY as Ve,WEVU_SCOPED_SLOT_OWNER_SEED_KEY as He,WEVU_SCOPED_SLOT_OWNER_STORE_KEY as Ue,WEVU_SETUP_CONTEXT_INSTANCE_KEY as We,WEVU_SETUP_STATE_KEY as Ge,WEVU_SLOT_NAMES_PROP as Ke,WEVU_SLOT_OWNER_ID_KEY as Z,WEVU_SLOT_OWNER_ID_PROP as qe,WEVU_SLOT_OWNER_KEY as Je,WEVU_SLOT_OWNER_PROXY_KEY as Ye,WEVU_SLOT_PROPS_DATA_KEY as Xe,WEVU_SLOT_PROPS_KEY as Ze,WEVU_SLOT_SCOPE_KEY as Qe,WEVU_TEMPLATE_REFS_CALLBACKS_KEY as $e,WEVU_TEMPLATE_REFS_KEY as et,WEVU_TEMPLATE_REFS_PENDING_KEY as tt,WEVU_TEMPLATE_REF_MAP_KEY as nt,WEVU_WATCH_STOPS_KEY as rt}from"@weapp-core/constants";import{wpi as it}from"@wevu/api";function at(e){j(L(`onMounted`),`onReady`,e)}function ot(e){j(L(`onUpdated`),Ce,e)}function st(e){L(`onBeforeUnmount`),e()}function ct(e){j(L(`onUnmounted`),`onUnload`,e)}function lt(e){L(`onBeforeMount`),e()}function ut(e){j(L(`onBeforeUpdate`),xe,e)}function dt(e){let t=L(`onErrorCaptured`);j(t,`onError`,n=>e(n,t,``))}function ft(e){j(L(`onActivated`),`onShow`,e)}function pt(e){j(L(`onDeactivated`),`onHide`,e)}function mt(e){L(`onServerPrefetch`)}function ht(e,t){N(e,t===`before`?xe:Ce)}const gt=`6.18.0`;function _t(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}function vt(e){return e?e.split(`.`).map(e=>e.trim()).filter(Boolean):[]}function Q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function yt(e,t,n){let r=e[t];if(!r)throw Error(`计算属性 "${t}" 是只读的`);r(n)}function bt(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 xt(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 St(e,t,n,r,i,a){if(!i.length)return;let[o,...s]=i;if(!s.length){if(n[o])yt(r,o,a);else{let n=t&&Object.prototype.hasOwnProperty.call(t,o)?t:e,r=n[o];h(r)?r.value=a:n[o]=a}return}if(n[o]){yt(r,o,a);return}let c=t&&Object.prototype.hasOwnProperty.call(t,o)?t:e;(c[o]==null||typeof c[o]!=`object`)&&(c[o]={}),xt(c[o],s,a)}function Ct(e,t){return t.reduce((e,t)=>e==null?e:e[t],e)}function wt(e){return bt(e)}function Tt(e,t,n,r,i){return(a,o)=>{let s=vt(a);if(!s.length)throw Error(`bindModel 需要非空路径`);let c=()=>Ct(e,s),l=e=>{St(t,i,n,r,s,e)},u={event:`input`,valueProp:`value`,parser:wt,formatter:e=>e,...o};return{get value(){return c()},set value(e){l(e)},update(e){l(e)},model(e){let t={...u,...e},n=`on${_t(t.event)}`,r=e=>{let n=t.parser(e);l(n)};return{[t.valueProp]:t.formatter(c()),[n]:r}}}}}function Et(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Dt(e){return Array.isArray(e)||Et(e)}function Ot(e){if(Array.isArray(e))return e;let t=[];for(let n of Object.keys(e)){let r=Object.getOwnPropertyDescriptor(e,n);!r||typeof r.get==`function`||t.push(r.value)}return t}function kt(e,t=new WeakSet){return h(e)||m(e)?!0:!e||typeof e!=`object`||t.has(e)||(t.add(e),!Dt(e))?!1:Ot(e).some(e=>kt(e,t))}function At(e,t=new WeakSet){if(h(e)){let n=e.value;m(n)&&S(n),At(n,t);return}if(m(e)){S(e),At(b(e),t);return}!e||typeof e!=`object`||t.has(e)||!Dt(e)||(t.add(e),Ot(e).forEach(e=>At(e,t)))}const jt=`__wevu_native_bridge__`;function Mt(e){try{Object.defineProperty(e,jt,{value:!0,configurable:!1,enumerable:!1,writable:!1})}catch(t){e[jt]=!0}}function Nt(e){return typeof e==`function`&&!!e[jt]}function Pt(e){let t=Object.create(null),n=Object.create(null),r=new Set;return{computedRefs:t,computedSetters:n,dirtyComputedKeys:r,createTrackedComputed:(t,n,i)=>{let a,c=!0,l,u={get value(){return c&&(a=l(),c=!1),x(u,`value`),a},set value(e){if(!i)throw Error(`计算属性是只读的`);i(e)}};return _(u),l=s(n,{lazy:!0,scheduler:()=>{c||(c=!0,e.setDataStrategy===`patch`&&e.includeComputed&&r.add(t),o(u,`value`))}}),u},computedProxy:new Proxy({},{get(e,n){if(typeof n==`string`&&t[n])return t[n].value},has(e,n){return typeof n==`string`&&!!t[n]},ownKeys(){return Object.keys(t)},getOwnPropertyDescriptor(e,n){if(typeof n==`string`&&t[n])return{configurable:!0,enumerable:!0,value:t[n].value}}})}}function Ft(e){let{state:t,setupState:n,computedDefs:r,methodDefs:i,appConfig:a,includeComputed:o,setDataStrategy:s}=e,c={},{computedRefs:l,computedSetters:u,dirtyComputedKeys:d,createTrackedComputed:p,computedProxy:m}=Pt({includeComputed:o,setDataStrategy:s}),g=f(0),_=(e,t)=>{let n=b(e),r=n[Be],i=r==null?void 0:r.proxy,a=(e,t)=>{let n=e[t];return Nt(n)},o=n=>!(!n||typeof n!=`object`||n===e||n===t||n===i||a(n,`triggerEvent`)||a(n,`createSelectorQuery`)||a(n,`createIntersectionObserver`)||a(n,`setData`)),s=n[J];if(o(s))return s;let c=r==null?void 0:r.instance;if(o(c))return c},v=e=>{if(Q(c,e))return;let n=(...n)=>{let r=_(t,t);if(!r)return;let i=Reflect.get(r,e);if(typeof i==`function`)return i.apply(r,n)};Mt(n),c[e]=n},y=new Proxy(t,{get(e,r,i){if(typeof r==`string`){if(g.value,Q(n,r))return Reflect.get(n,r,i);if(r===`props`){let t=e[X];if(t&&typeof t==`object`)return t}if(r===`data`||r===`$state`)return t;if(r===`$computed`)return m;if(Q(c,r))return c[r];if(l[r])return l[r].value;if(Q(a.globalProperties,r))return a.globalProperties[r]}if(!Reflect.has(e,r)){let t=_(e,i);if(t&&Reflect.has(t,r)){let e=Reflect.get(t,r);return typeof e==`function`?e.bind(t):e}}let o=Reflect.get(e,r,i);return typeof r==`string`&&Q(n,r)?Reflect.get(n,r,i):o},set(e,t,r,i){if(typeof t==`string`&&l[t])return yt(u,t,r),!0;if(Q(n,t)){let e=Reflect.get(n,t,i);return h(e)&&!h(r)?(e.value=r,!0):Reflect.set(n,t,r,i)}if(Reflect.has(e,t)){var a;let o=Reflect.get(e,t,i);return h(o)&&!h(r)?(o.value=r,!0):Q((a=e[X])==null?{}:a,t)?Reflect.set(n,t,r,i):Reflect.set(e,t,r,i)}let o=_(e,i);return o&&Reflect.has(o,t)?Reflect.set(o,t,r):Reflect.set(e,t,r,i)},has(e,t){if(t===`data`||typeof t==`string`&&(Q(n,t)||l[t]||Q(c,t)))return!0;let r=_(e,e);return r&&Reflect.has(r,t)?!0:Reflect.has(e,t)},ownKeys(e){let t=new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Reflect.ownKeys(n).forEach(e=>{t.add(e)}),Object.keys(c).forEach(e=>t.add(e)),Object.keys(l).forEach(e=>t.add(e)),[...t]},getOwnPropertyDescriptor(e,r){if(typeof r==`string`&&Q(n,r))return Object.getOwnPropertyDescriptor(n,r);if(Reflect.has(e,r))return Object.getOwnPropertyDescriptor(e,r);if(typeof r==`string`){if(r===`data`)return{configurable:!0,enumerable:!1,get(){return t}};if(l[r])return{configurable:!0,enumerable:!0,get(){return l[r].value},set(e){yt(u,r,e)}};if(Q(c,r))return{configurable:!0,enumerable:!1,value:c[r]}}}});return Object.keys(i).forEach(e=>{let t=i[e];if(typeof t==`function`){c[e]=(...e)=>t.apply(y,e);return}e===ge&&t&&typeof t==`object`&&(c[e]=t)}),v(`triggerEvent`),v(`createSelectorQuery`),v(`createIntersectionObserver`),v(`setData`),Object.keys(r).forEach(e=>{let t=r[e];if(typeof t==`function`)l[e]=p(e,()=>t.call(y));else{var n,i;let r=(n=t.get)==null?void 0:n.bind(y);if(!r)throw Error(`计算属性 "${e}" 需要提供 getter`);let a=(i=t.set)==null?void 0:i.bind(y);a?(u[e]=a,l[e]=p(e,r,a)):l[e]=p(e,r)}}),{boundMethods:c,computedRefs:l,computedSetters:u,dirtyComputedKeys:d,computedProxy:m,publicInstance:y,touchSetupMethodsVersion(){g.value+=1}}}function It(e){return e!==`patch`&&e!==`diff`}function Lt(e){if(e!==`off`)return t=>{if(e===`fallback`&&!It(t.reason))return;let n=typeof t.bytes==`number`?t.bytes:t.estimatedBytes,r=typeof n==`number`?`${n}B`:`unknown`,i=[`mode=${t.mode}`,`reason=${t.reason}`,`pending=${t.pendingPatchKeys}`,`keys=${t.payloadKeys}`,`bytes=${r}`];typeof t.mergedSiblingParents==`number`&&i.push(`mergedParents=${t.mergedSiblingParents}`),typeof t.computedDirtyKeys==`number`&&i.push(`computedDirty=${t.computedDirtyKeys}`),typeof t.flushCount==`number`&&i.push(`flushes=${t.flushCount}`),typeof t.windowMs==`number`&&i.push(`window=${t.windowMs}ms`);let a=`[wevu:setData] ${i.join(` `)}`;if(It(t.reason)){console.warn(a);return}console.info(a)}}const Rt=Symbol(`wevu.noSetData`);function $(e){return Object.defineProperty(e,Rt,{value:!0,configurable:!0,enumerable:!1,writable:!1}),e}function zt(e){return typeof e==`object`&&!!e&&e[Rt]===!0}function Bt(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Vt(e,t,n,r,i,a,o,s,c,l){let u=g(e);if(typeof u==`bigint`){let e=Number(u);return Number.isSafeInteger(e)?e:u.toString()}if(typeof u==`symbol`)return u.toString();if(typeof u==`function`)return s||c!=null&&c.has(l)?u:void 0;if(typeof u!=`object`||!u)return u;if(zt(u))return;let d=m(u),f=d?b(u):u,p=!!r&&d;if(r&&!p){let e=i==null?void 0:i.get(f);p=e==null?!kt(f):e,i==null||i.set(f,p)}let h=p?r:void 0;if(a<=0||o.keys<=0)return f;if(h){let e=v(f),t=h.get(f);if(t&&t.version===e)return t.value}if(n.has(f))return;if(t.has(f))return t.get(f);if(f instanceof Date)return f.getTime();if(f instanceof RegExp)return f.toString();if(f instanceof Map){let e=[];return t.set(f,e),n.add(f),f.forEach((r,i)=>{e.push([Vt(i,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``),Vt(r,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``)])}),n.delete(f),e}if(f instanceof Set){let e=[];return t.set(f,e),n.add(f),f.forEach(r=>{e.push(Vt(r,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``))}),n.delete(f),e}if(typeof ArrayBuffer<`u`){if(f instanceof ArrayBuffer)return f.byteLength;if(ArrayBuffer.isView(f)){let e=f;if(typeof e[Symbol.iterator]==`function`){let r=[...e];return t.set(f,r),r.map(e=>Vt(e,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``))}let r=[...new Uint8Array(e.buffer,e.byteOffset,e.byteLength)];return t.set(f,r),r}}if(f instanceof Error)return{name:f.name,message:f.message};if(Array.isArray(f)){let e=[];t.set(f,e),n.add(f);let u=a-1;for(let a=0;a<f.length;a+=1){let d=l?`${l}.${a}`:String(a),p=Vt(f[a],t,n,r,i,u,o,s,c,d);e[a]=p===void 0?null:p}return n.delete(f),h&&h.set(f,{version:v(f),value:e}),e}let _={};t.set(f,_),n.add(f);let y=a-1;for(let e of Object.keys(f)){if(--o.keys,o.keys<=0)break;let a=l?`${l}.${e}`:e,u=Vt(f[e],t,n,r,i,y,o,s,c,a);u!==void 0&&(_[e]=u)}return n.delete(f),h&&h.set(f,{version:v(f),value:_}),_}function Ht(e,t=new WeakMap,n){var r,i,a;let o=(r=n==null?void 0:n._depth)==null?typeof(n==null?void 0:n.maxDepth)==`number`?Math.max(0,Math.floor(n.maxDepth)):1/0:r,s=(i=n==null?void 0:n._budget)==null?typeof(n==null?void 0:n.maxKeys)==`number`?{keys:Math.max(0,Math.floor(n.maxKeys))}:{keys:1/0}:i,c=Array.isArray(n==null?void 0:n.functionPaths)&&n.functionPaths.length?new Set(n.functionPaths):void 0;return Vt(e,t,new WeakSet,n==null?void 0:n.cache,n==null?void 0:n.cacheEligibility,o,s,!!(n!=null&&n.includeFunctions),c,(a=n==null?void 0:n._path)==null?``:a)}function Ut(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Wt(e,t,n){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let i of r)if(!Q(t,i)||!n(e[i],t[i]))return!1;return!0}function Gt(e,t){return Object.is(e,t)?!0:Array.isArray(e)&&Array.isArray(t)?Ut(e,t,Gt):Bt(e)&&Bt(t)?Wt(e,t,Gt):!1}function Kt(e){return e===void 0?null:e}function qt(e,t,n,r){if(!Gt(e,t)){if(Bt(e)&&Bt(t)){for(let i of Object.keys(t)){if(!Q(e,i)){r[`${n}.${i}`]=Kt(t[i]);continue}qt(e[i],t[i],`${n}.${i}`,r)}for(let i of Object.keys(e))Q(t,i)||(r[`${n}.${i}`]=null);return}if(Array.isArray(e)&&Array.isArray(t)){Ut(e,t,Gt)||(r[n]=Kt(t));return}r[n]=Kt(t)}}function Jt(e,t,n){let r={},i=n==null?void 0:n.skipKeys;for(let n of Object.keys(t))i!=null&&i.has(n)||qt(e[n],t[n],n,r);for(let n of Object.keys(e))i!=null&&i.has(n)||Q(t,n)||(r[n]=null);return r}function Yt(e){let t=Object.keys(e).sort();if(t.length<=1)return e;let n={},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}function Xt(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+=Xt(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+=Xt(a,t-i,n),i>t)return i;return i}function Zt(e,t){if(t===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let n=t,r=Object.keys(e).length,i=Xt(e,n+1,new WeakSet);if(i>n)return{fallback:!0,estimatedBytes:i,bytes:void 0};if(i>=n*.85&&r>2)try{let t=JSON.stringify(e).length;return{fallback:t>n,estimatedBytes:i,bytes:t}}catch(e){return{fallback:!1,estimatedBytes:i,bytes:void 0}}return{fallback:!1,estimatedBytes:i,bytes:void 0}}function Qt(e){let{input:t,entryMap:n,getPlainByPath:r,mergeSiblingThreshold:i,mergeSiblingSkipArray:a,mergeSiblingMaxParentBytes:o,mergeSiblingMaxInflationRatio:s}=e;if(!i)return{out:t,merged:0};let c=Object.keys(t);if(c.length<i)return{out:t,merged:0};let l=new Map,u=new Set;for(let e of c){var d;let r=n.get(e);if(!r)continue;if(t[e]===null||r.op===`delete`){let t=e.lastIndexOf(`.`);t>0&&u.add(e.slice(0,t));continue}let i=e.lastIndexOf(`.`);if(i<=0)continue;let a=e.slice(0,i),o=(d=l.get(a))==null?[]:d;o.push(e),l.set(a,o)}let f=[...l.entries()].filter(([e,t])=>t.length>=i&&!u.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!f.length)return{out:t,merged:0};let p={};Object.assign(p,t);let m=0,h=new WeakMap,g=e=>{if(e&&typeof e==`object`){let t=h.get(e);if(t!==void 0)return t;let n=Xt(e,1/0,new WeakSet);return h.set(e,n),n}return Xt(e,1/0,new WeakSet)},_=(e,t)=>2+e.length+1+g(t);for(let[e,t]of f){if(Q(p,e))continue;let n=t.filter(e=>Q(p,e));if(n.length<i)continue;let c=r(e);if(!(a&&Array.isArray(c))&&!(o!==1/0&&_(e,c)>o)){if(s!==1/0){let t=0;for(let e of n)t+=_(e,p[e]);if(_(e,c)>t*s)continue}p[e]=c;for(let e of n)delete p[e];m+=1}}return{out:p,merged:m}}function $t(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function en(e){return e===void 0?null:e}function tn(e){if(Array.isArray(e))return e.map(e=>tn(e));if(!$t(e))return e;let t={};for(let n of Object.keys(e))t[n]=tn(e[n]);return t}function nn(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(!$t(e)||!$t(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Q(t,r)||!Object.is(e[r],t[r]))return!1;return!0}function rn(e,t,n,r){if(Object.is(e,t))return!0;if(n<=0)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(!rn(e[i],t[i],n-1,r))return!1;return!0}if(!$t(e)||!$t(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||!Q(t,a)||!rn(e[a],t[a],n-1,r))return!1;return!0}function an(e,t,n,r,i){var a;let o=(a=i==null?void 0:i.cloneValue)==null||a,s=t.split(`.`).filter(Boolean);if(!s.length)return;let c=e;for(let e=0;e<s.length-1;e++){let t=s[e];(!Q(c,t)||c[t]==null||typeof c[t]!=`object`)&&(c[t]={}),c=c[t]}let l=s[s.length-1];if(r===`delete`)try{delete c[l]}catch(e){c[l]=null}else c[l]=o?tn(n):n}function on(e){let{state:t,setupState:n,computedRefs:r,includeComputed:i,shouldIncludeKey:a,plainCache:o,plainCacheEligibility:s,toPlainMaxDepth:c,toPlainMaxKeys:l,includeFunctions:u=!1,functionPaths:d=[]}=e,f=new WeakMap,p={},h=Number.isFinite(l)?{keys:l}:void 0,g=m(t)?b(t):t,_=n&&typeof n==`object`?m(n)?b(n):n:void 0,v=Object.keys(g),y=_?Object.keys(_):[],x=i?Object.keys(r):[];for(let e of v)a(e)&&(p[e]=Ht(g[e],f,{cache:o,cacheEligibility:s,maxDepth:c,includeFunctions:u,functionPaths:d,_budget:h,_path:e}));for(let e of y)a(e)&&(p[e]=Ht(_[e],f,{cache:o,cacheEligibility:s,maxDepth:c,includeFunctions:u,functionPaths:d,_budget:h,_path:e}));for(let e of x)a(e)&&(p[e]=Ht(r[e].value,f,{cache:o,cacheEligibility:s,maxDepth:c,includeFunctions:u,functionPaths:d,_budget:h,_path:e}));return p}function sn(e){let{state:t,computedRefs:n,dirtyComputedKeys:r,includeComputed:i,computedCompare:a,computedCompareMaxDepth:o,computedCompareMaxKeys:s,currentAdapter:c,shouldIncludeKey:l,maxPatchKeys:u,maxPayloadBytes:d,mergeSiblingThreshold:f,mergeSiblingMaxInflationRatio:p,mergeSiblingMaxParentBytes:m,mergeSiblingSkipArray:h,elevateTopKeyThreshold:g,toPlainMaxDepth:_,toPlainMaxKeys:v,includeFunctions:y=!1,functionPaths:b,plainCache:x,plainCacheEligibility:S,pendingPatches:C,fallbackTopKeys:w,latestSnapshot:T,latestComputedSnapshot:E,needsFullSnapshot:D,emitDebug:O,runDiffUpdate:k}=e;if(C.size>u){D.value=!0;let e=C.size;C.clear(),r.clear(),O({mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}),k(`maxPatchKeys`);return}let A=new WeakMap,j=new Map,M=Object.create(null),N=[...C.entries()];if(Number.isFinite(g)&&g>0){let e=new Map;for(let[t]of N){var P;let n=t.split(`.`,1)[0];e.set(n,((P=e.get(n))==null?0:P)+1)}for(let[t,n]of e)n>=g&&w.add(t)}let F=N.filter(([e])=>{for(let t of w)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),I=new Map(F);C.clear();let L=e=>{let n=e.split(`.`).filter(Boolean),r=t;for(let e of n){if(r==null)return r;r=r[e]}return r},R=e=>{if(j.has(e))return j.get(e);let t=en(Ht(L(e),A,{cache:x,cacheEligibility:S,maxDepth:_,maxKeys:v,includeFunctions:y,functionPaths:b,_path:e}));return j.set(e,t),t};if(w.size){for(let e of w)l(e)&&(M[e]=R(e),I.set(e,{kind:`property`,op:`set`}));w.clear()}for(let[e,t]of F){if((t.kind===`array`?`set`:t.op)===`delete`){M[e]=null;continue}M[e]=R(e)}let z=0;if(i&&r.size){let e=Object.create(null),t=[...r];r.clear(),z=t.length;for(let r of t){if(!l(r))continue;let t=Ht(n[r].value,A,{cache:x,cacheEligibility:S,maxDepth:_,maxKeys:v,includeFunctions:y,functionPaths:b,_path:r}),i=E[r];(a===`deep`?rn(i,t,o,{keys:s}):a===`shallow`?nn(i,t):Object.is(i,t))||(e[r]=en(t),E[r]=tn(t))}Object.assign(M,e)}let B=Yt(M),V=0;if(f){let e=Qt({input:B,entryMap:I,getPlainByPath:R,mergeSiblingThreshold:f,mergeSiblingSkipArray:h,mergeSiblingMaxParentBytes:m,mergeSiblingMaxInflationRatio:p});V=e.merged,B=Yt(e.out)}let H=Zt(B,d),U=H.fallback;if(O({mode:U?`diff`:`patch`,reason:U?`maxPayloadBytes`:`patch`,pendingPatchKeys:F.length,payloadKeys:Object.keys(B).length,mergedSiblingParents:V||void 0,computedDirtyKeys:z||void 0,estimatedBytes:H.estimatedBytes,bytes:H.bytes}),U){D.value=!0,C.clear(),r.clear(),k(`maxPayloadBytes`);return}if(Object.keys(B).length){for(let[e,t]of Object.entries(B)){let n=I.get(e);n?an(T,e,t,n.kind===`array`?`set`:n.op,{cloneValue:!1}):an(T,e,t,`set`,{cloneValue:!1})}if(typeof c.setData==`function`){let e=c.setData(B);e&&typeof e.then==`function`&&e.catch(()=>{})}O({mode:`patch`,reason:`patch`,pendingPatchKeys:F.length,payloadKeys:Object.keys(B).length})}}function cn(e){let{state:t,setupState:n,snapshotOmitKeys:r,computedRefs:i,dirtyComputedKeys:a,includeComputed:o,setDataStrategy:s,computedCompare:c,computedCompareMaxDepth:l,computedCompareMaxKeys:u,currentAdapter:d,shouldIncludeKey:f,maxPatchKeys:p,maxPayloadBytes:g,mergeSiblingThreshold:_,mergeSiblingMaxInflationRatio:y,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E=!1,functionPaths:D,debug:O,debugWhen:k,debugSampleRate:A,loopWarning:j,runTracker:M,isMounted:N,initialSnapshot:P,initialState:F}=e,I=new WeakMap,L=new WeakMap,R={},z=Object.create(null),B=Object.create(null),V=Object.create(null),H={value:s===`patch`},U=new Map,W=new Set,G=[],ee=-1/0,te=new Set(F&&typeof F==`object`?Object.keys(F):[]),K=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},ne=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>ne(e,t[n]));if(K(e)&&K(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Q(t,n)&&ne(e[n],t[n]))}return!1},re=e=>{let t=h(e)?e.value:e;if(typeof t!=`object`||!t)return t;if(!m(t)&&kt(t))return{snapshot:Ht(t,new WeakMap,{cacheEligibility:L,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D})};let n=m(t)?b(t):t;return{raw:n,version:v(n)}},ie=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!Q(e,`raw`)||!Q(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&Q(e,`snapshot`)&&Q(t,`snapshot`)?ne(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,q=e=>f(e)&&!(r!=null&&r.has(e));if(P)for(let[e,t]of Object.entries(P))q(e)&&(R[e]=t);let ae=()=>{if(!P)return;let e=m(t)?b(t):t,r=n&&typeof n==`object`?m(n)?b(n):n:void 0;for(let t of Object.keys(P))if(q(t)){if(r&&Q(r,t)){B[t]=re(r[t]);continue}if(Q(e,t)){if(te.has(t))continue;e[t]=P[t],B[t]=re(e[t])}}},oe=e=>{let r=[],i=n&&typeof n==`object`?m(n)?b(n):n:void 0;for(let n of new Set([...Object.keys(t),...i?Object.keys(i):[]])){if(!q(n))continue;let a=i&&Q(i,n)?i[n]:t[n],o=h(a)?a.value:a;!o||typeof o!=`object`||b(o)===e&&r.push(n)}return r},se=e=>{if(!O)return;let t=e.reason!==`patch`&&e.reason!==`diff`;if(!(k===`fallback`&&!t)&&!(A<1&&Math.random()>A))try{O(e)}catch(e){}},ce=()=>{if(!j)return;let e=Date.now();G.push(e);let t=e-j.sampleWindowMs;for(;G.length&&G[0]<t;)G.shift();G.length<=j.maxFlushes||j.coolDownMs>0&&e-ee<j.coolDownMs||(ee=e,se({mode:s,reason:`loopWarning`,pendingPatchKeys:U.size+W.size,payloadKeys:0,computedDirtyKeys:o?a.size:0,flushCount:G.length,windowMs:j.sampleWindowMs,message:`疑似运行时更新循环:${G.length} 次 setData flush/${j.sampleWindowMs}ms`}))},le=()=>on({state:t,setupState:n,computedRefs:i,includeComputed:o,shouldIncludeKey:q,plainCache:I,plainCacheEligibility:L,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D});ae();let ue=()=>{let e=m(t)?b(t):t,r=n&&typeof n==`object`?m(n)?b(n):n:void 0,a={...R},s=new WeakMap,c=new Set,l=new Set,u=new Set;for(let t of new Set([...Object.keys(e),...r?Object.keys(r):[]])){if(!q(t))continue;c.add(t);let n=r&&Q(r,t)?r:e,i=re(n[t]),o=B[t];o&&i&&typeof o==`object`&&typeof i==`object`&&Q(o,`raw`)&&Q(i,`raw`)&&Array.isArray(o.raw)&&Array.isArray(i.raw)&&o.raw!==i.raw&&u.add(t),(!ie(o,i)||!Q(R,t))&&(a[t]=Ht(n[t],s,{cache:I,cacheEligibility:L,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:t})),B[t]=i}for(let e of Object.keys(B))c.has(e)||(delete B[e],(!o||!Q(i,e))&&delete a[e]);if(!o){for(let e of Object.keys(V))delete V[e];return{snapshot:a,replacedTopLevelKeys:u}}for(let e of Object.keys(i)){if(!q(e))continue;l.add(e);let t=i[e].value,n=re(t);(!ie(V[e],n)||!Q(R,e))&&(a[e]=Ht(t,s,{cache:I,cacheEligibility:L,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:e})),V[e]=n}for(let t of Object.keys(V))l.has(t)||(delete V[t],(!Q(e,t)||!q(t))&&delete a[t]);return{snapshot:a,replacedTopLevelKeys:u}},de=(e=`diff`)=>{var t;let n=s===`diff`?ue():void 0,r=(t=n==null?void 0:n.snapshot)==null?le():t,c=n?(()=>{let e={};for(let t of n.replacedTopLevelKeys)e[t]=r[t];return{...Jt(R,r,{skipKeys:n.replacedTopLevelKeys}),...e}})():Jt(R,r);if(R=r,H.value=!1,U.clear(),s===`patch`&&o){z=Object.create(null);for(let e of Object.keys(i))q(e)&&(z[e]=r[e]);a.clear()}if(Object.keys(c).length){if(typeof d.setData==`function`){let e=d.setData(c);e&&typeof e.then==`function`&&e.catch(()=>{})}se({mode:`diff`,reason:e,pendingPatchKeys:0,payloadKeys:Object.keys(c).length})}};return{job:e=>{if(N())if(ce(),M(),s===`patch`&&!H.value){if(!(U.size>0||W.size>0||o&&a.size>0)){de(`diff`);return}sn({state:t,computedRefs:i,dirtyComputedKeys:a,includeComputed:o,computedCompare:c,computedCompareMaxDepth:l,computedCompareMaxKeys:u,currentAdapter:d,shouldIncludeKey:q,maxPatchKeys:p,maxPayloadBytes:g,mergeSiblingThreshold:_,mergeSiblingMaxInflationRatio:y,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D,plainCache:I,plainCacheEligibility:L,pendingPatches:U,fallbackTopKeys:W,latestSnapshot:R,latestComputedSnapshot:z,needsFullSnapshot:H,emitDebug:se,runDiffUpdate:de})}else de(H.value?`needsFullSnapshot`:`diff`)},mutationRecorder:(e,t)=>{if(!N())return;if(e.root!==t){let t=oe(e.root);if(t.length)for(let e of t)W.add(e);return}if(!e.path){if(Array.isArray(e.fallbackTopKeys)&&e.fallbackTopKeys.length)for(let t of e.fallbackTopKeys)W.add(t);else H.value=!0;return}let n=e.path.split(`.`,1)[0];q(n)&&U.set(e.path,{kind:e.kind,op:e.op})},snapshot:()=>s===`patch`?le():{...R},cloneLatestSnapshot:()=>({...R}),getLatestSnapshot:()=>R}}function ln(e){var t,n,r,i,a,o,s;let c=(t=e==null?void 0:e.includeComputed)==null||t,l=(n=e==null?void 0:e.suspendWhenHidden)!=null&&n,u=(r=e==null?void 0:e.strategy)==null?`diff`:r,d=typeof(e==null?void 0:e.maxPatchKeys)==`number`?Math.max(0,e.maxPatchKeys):1/0,f=typeof(e==null?void 0:e.maxPayloadBytes)==`number`?Math.max(0,e.maxPayloadBytes):1/0,p=typeof(e==null?void 0:e.mergeSiblingThreshold)==`number`?Math.max(2,Math.floor(e.mergeSiblingThreshold)):0,m=typeof(e==null?void 0:e.mergeSiblingMaxInflationRatio)==`number`?Math.max(0,e.mergeSiblingMaxInflationRatio):1.25,h=typeof(e==null?void 0:e.mergeSiblingMaxParentBytes)==`number`?Math.max(0,e.mergeSiblingMaxParentBytes):1/0,g=(i=e==null?void 0:e.mergeSiblingSkipArray)==null||i,_=(a=e==null?void 0:e.computedCompare)==null?u===`patch`?`deep`:`reference`:a,v=typeof(e==null?void 0:e.computedCompareMaxDepth)==`number`?Math.max(0,Math.floor(e.computedCompareMaxDepth)):4,y=typeof(e==null?void 0:e.computedCompareMaxKeys)==`number`?Math.max(0,Math.floor(e.computedCompareMaxKeys)):200,b=e==null?void 0:e.prelinkMaxDepth,x=e==null?void 0:e.prelinkMaxKeys,S=e==null?void 0:e.debug,C=(o=e==null?void 0:e.diagnostics)==null?`off`:o,w=e==null?void 0:e.loopWarning,T=w===!1||w&&typeof w==`object`&&w.enabled===!1?!1:{sampleWindowMs:typeof w==`object`&&typeof w.sampleWindowMs==`number`?Math.max(100,Math.floor(w.sampleWindowMs)):1e3,maxFlushes:typeof w==`object`&&typeof w.maxFlushes==`number`?Math.max(1,Math.floor(w.maxFlushes)):50,coolDownMs:typeof w==`object`&&typeof w.coolDownMs==`number`?Math.max(0,Math.floor(w.coolDownMs)):5e3},E=(s=e==null?void 0:e.debugWhen)==null?`fallback`:s,D=typeof(e==null?void 0:e.debugSampleRate)==`number`?Math.min(1,Math.max(0,e.debugSampleRate)):1,O=typeof(e==null?void 0:e.elevateTopKeyThreshold)==`number`?Math.max(0,Math.floor(e.elevateTopKeyThreshold)):1/0,k=typeof(e==null?void 0:e.toPlainMaxDepth)==`number`?Math.max(0,Math.floor(e.toPlainMaxDepth)):1/0,A=typeof(e==null?void 0:e.toPlainMaxKeys)==`number`?Math.max(0,Math.floor(e.toPlainMaxKeys)):1/0,j=!!(e!=null&&e.includeFunctions),M=Array.isArray(e==null?void 0:e.functionPaths)?[...new Set(e.functionPaths.filter(e=>typeof e==`string`&&e.length>0))]:[],N=Array.isArray(e==null?void 0:e.pick)&&e.pick.length>0?new Set(e.pick):void 0,P=Array.isArray(e==null?void 0:e.omit)&&e.omit.length>0?new Set(e.omit):void 0;return{includeComputed:c,suspendWhenHidden:l,setDataStrategy:u,maxPatchKeys:d,maxPayloadBytes:f,mergeSiblingThreshold:p,mergeSiblingMaxInflationRatio:m,mergeSiblingMaxParentBytes:h,mergeSiblingSkipArray:g,computedCompare:_,computedCompareMaxDepth:v,computedCompareMaxKeys:y,prelinkMaxDepth:b,prelinkMaxKeys:x,debug:S,diagnostics:C,loopWarning:T,debugWhen:E,debugSampleRate:D,elevateTopKeyThreshold:O,toPlainMaxDepth:k,toPlainMaxKeys:A,includeFunctions:j,functionPaths:M,pickSet:N,omitSet:P,shouldIncludeKey:e=>!(N&&!N.has(e)||P&&P.has(e))}}function un(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{var e;t==null||(e=t.pause)==null||e.call(t)},n.resume=()=>{var e;t==null||(e=t.resume)==null||e.call(t)},n}function dn(e){return typeof e==`function`?e():e==null?{}:e}function fn(t){let{data:r,resolvedComputed:o,resolvedMethods:c,appConfig:u,setDataOptions:f}=t;return t=>{let h=dn(r);if(h&&typeof h==`object`&&!Q(h,X))try{Object.defineProperty(h,X,{value:e(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch(e){}let g=d(h),_=d(Object.create(null)),v=t==null?void 0:t.__wevu_snapshotOmitKeys,y=!!(t!=null&&t.__wevu_deferInitialSnapshot),x=t==null?void 0:t.__wevu_initialSnapshot,T=t==null?void 0:t.__wevu_initialState,E=new Set(v instanceof Set||Array.isArray(v)?v:[]);if(h&&typeof h==`object`&&!Q(h,Ge))try{Object.defineProperty(h,Ge,{value:_,configurable:!0,enumerable:!1,writable:!1})}catch(e){}if(h&&typeof h==`object`&&T&&typeof T==`object`)for(let[e,t]of Object.entries(T))E.has(e)||(h[e]=t);let D=o,O=c,k=!0,A=[],j=new Set;Object.keys(g).forEach(e=>{let t=g[e];kt(t)&&j.add(e)});let{includeComputed:M,setDataStrategy:N,maxPatchKeys:P,maxPayloadBytes:F,mergeSiblingThreshold:I,mergeSiblingMaxInflationRatio:L,mergeSiblingMaxParentBytes:R,mergeSiblingSkipArray:z,computedCompare:B,computedCompareMaxDepth:V,computedCompareMaxKeys:H,prelinkMaxDepth:U,prelinkMaxKeys:W,debug:G,diagnostics:ee,loopWarning:te,debugWhen:K,debugSampleRate:ne,elevateTopKeyThreshold:re,toPlainMaxDepth:ie,toPlainMaxKeys:q,includeFunctions:ae,functionPaths:oe,shouldIncludeKey:se}=ln(f),ce=Lt(ee),le=ee===`off`&&te?Lt(`fallback`):void 0,de=G||ce||le?e=>{typeof G==`function`&&G(e),ce==null||ce(e),e.reason===`loopWarning`&&(le==null||le(e))}:void 0,fe=ee===`always`?`always`:K,{boundMethods:pe,computedRefs:me,computedSetters:he,dirtyComputedKeys:ge,computedProxy:_e,publicInstance:ve,touchSetupMethodsVersion:ye}=Ft({state:g,setupState:_,computedDefs:D,methodDefs:O,appConfig:u,includeComputed:M,setDataStrategy:N}),be=t==null?{setData:()=>{}}:t,J=b(g),xe,Se=cn({state:g,setupState:_,snapshotOmitKeys:E,computedRefs:me,dirtyComputedKeys:ge,includeComputed:M,setDataStrategy:N,computedCompare:B,computedCompareMaxDepth:V,computedCompareMaxKeys:H,currentAdapter:be,shouldIncludeKey:se,maxPatchKeys:P,maxPayloadBytes:F,mergeSiblingThreshold:I,mergeSiblingMaxInflationRatio:L,mergeSiblingMaxParentBytes:R,mergeSiblingSkipArray:z,elevateTopKeyThreshold:re,toPlainMaxDepth:ie,toPlainMaxKeys:q,includeFunctions:ae,functionPaths:oe,debug:de,debugWhen:fe,debugSampleRate:ne,loopWarning:te,runTracker:()=>xe==null?void 0:xe(),isMounted:()=>k,initialSnapshot:x&&typeof x==`object`?x:void 0,initialState:T&&typeof T==`object`?T:void 0}),Ce=()=>Se.job(J),we=e=>Se.mutationRecorder(e,J);xe=s(()=>{S(g);let e=g[X];m(e)&&S(e);let t=g[ue];m(t)&&S(t),j.forEach(e=>{var t;At((t=_[e])==null?g[e]:t)})},{lazy:!0,scheduler:()=>n(Ce)}),y||Ce(),A.push(un(()=>l(xe))),N===`patch`&&(w(g,{shouldIncludeTopKey:se,maxDepth:U,maxKeys:W}),p(we),A.push(un(()=>a(we))),A.push(un(()=>C(g))));function Te(e,t,n){let r=i(e,(e,n)=>t(e,n),n);return A.push(r),un(()=>{r();let e=A.indexOf(r);e>=0&&A.splice(e,1)},r)}let Y={get state(){return g},get setupState(){return _},get proxy(){return ve},get methods(){return pe},get computed(){return _e},get adapter(){return be},bindModel:Tt(ve,g,me,he,_),watch:Te,snapshot:()=>Se.snapshot(),unmount:()=>{k&&(k=!1,A.forEach(e=>{try{e()}catch(e){}}),A.length=0)}};try{Object.defineProperty(Y,"__wevu_touchSetupMethodsVersion",{value:ye,configurable:!0,enumerable:!1,writable:!1})}catch(e){Y.__wevu_touchSetupMethodsVersion=ye}try{Object.defineProperty(Y,"__wevu_flushSetupSnapshotSync",{value:Ce,configurable:!0,enumerable:!1,writable:!1})}catch(e){Y.__wevu_flushSetupSnapshotSync=Ce}try{Object.defineProperty(Y,"__wevu_cloneLatestSnapshot",{value:Se.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch(e){Y.__wevu_cloneLatestSnapshot=Se.cloneLatestSnapshot}try{Object.defineProperty(Y,"__wevu_trackSetupReactiveKey",{value:e=>{j.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch(e){Y.__wevu_trackSetupReactiveKey=e=>{j.add(e)}}try{Object.defineProperty(Y,Me,{value:E,configurable:!0,enumerable:!1,writable:!1})}catch(e){Y[Me]=E}return Y}}const pn=`__wevuDefaultsScope`;let mn={};function hn(e){if(!(!e||typeof e!=`object`||Array.isArray(e)))return e}function gn(e,t){if(!e)return t;if(!t)return e;let n={...e,...t},r=hn(e.setData),i=hn(t.setData);(r||i)&&(n.setData={...r==null?{}:r,...i==null?{}:i});let a=hn(e.options),o=hn(t.options);return(a||o)&&(n.options={...a==null?{}:a,...o==null?{}:o}),n}function _n(e,t){return gn(e,t)}function vn(e,t){return{app:gn(e.app,t.app),component:gn(e.component,t.component)}}function yn(e){mn=vn(mn,e)}function bn(){mn={}}function xn(e){return _n(mn.app,e)}function Sn(e){return _n(mn.component,e)}const Cn=/&/g,wn=/"/g,Tn=/"/g,En=/'/g,Dn=/'/g,On=/</g,kn=/>/g;function An(e){return e.replace(Cn,`&`).replace(wn,`"`).replace(Tn,`"`).replace(En,`'`).replace(Dn,`'`).replace(On,`<`).replace(kn,`>`)}function jn(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim()){let t=Number(e);if(Number.isFinite(t))return t}}const Mn=/[^a-z0-9]+/gi,Nn=/^-+|-+$/g;function Pn(e){return e.trim().replace(Mn,`-`).replace(Nn,``).toLowerCase()}const Fn=/-([a-z0-9])/g;function In(e,t){let n=Pn(typeof(t==null?void 0:t.type)==`string`?t.type:``);if(!n)return;let r=n.replace(Fn,(e,t)=>t.toUpperCase());if(r)return`${e}${r[0].toUpperCase()}${r.slice(1)}`}const Ln={wvEventDetail:[`wd`,`wvEventDetail`],wvHandler:[`wh`,`wvHandler`],wvInlineId:[`wi`,`wvInlineId`]};function Rn(e,t,n){var r;let i=(r=Ln[t])==null?[t]:r;for(let t of i){let r=In(t,n);if(r&&(e==null?void 0:e[r])!==void 0)return e[r]}for(let t of i)if((e==null?void 0:e[t])!==void 0)return e[t]}function zn(e,t,n){return Rn(e,t,n)}function Bn(e,t){let n=zn(e,`wvEventDetail`,t);return n===!0||n===1||n===`1`||n===`true`}function Vn(e,t){if(!Bn(t,e))return e;if(!(!e||typeof e!=`object`||!(`detail`in e)))return e.detail}function Hn(e,t){if(!t)return;let n=t.split(`.`).filter(Boolean),r=h(e)?e.value:e;for(let e of n){if(h(r)&&(r=r.value),r==null)return;r=r[e]}return h(r)?r.value:r}function Un(e){if(typeof e!=`object`||!e||h(e)||m(e))return e;try{return d(e)}catch(t){return e}}function Wn(e,t,n,r){var i,a,o,s;let c=(i=(a=n==null||(o=n.currentTarget)==null?void 0:o.dataset)==null?n==null||(s=n.target)==null?void 0:s.dataset:a)==null?{}:i,l=Vn(n,c),u=zn(c,`wvInlineId`,n);if(u&&r){let t=r[u];if(t&&typeof t.fn==`function`){let n={},r=Array.isArray(t.keys)?t.keys:[];for(let e=0;e<r.length;e+=1){let t=r[e];n[t]=c==null?void 0:c[`wvS${e}`]}let i=Array.isArray(t.indexKeys)?t.indexKeys:[];for(let e=0;e<i.length;e+=1){let t=i[e],r=jn(c==null?void 0:c[`wvI${e}`]);r!==void 0&&(n[t]=r)}let a=Array.isArray(t.scopeResolvers)?t.scopeResolvers:[];for(let t=0;t<r.length;t+=1){let i=r[t],o=a[t];try{let t;if(typeof o==`function`)t=o(e,n,l);else if(o&&typeof o==`object`&&o.type===`for-item`){let r=n[o.indexKey],i=Hn(e,o.path);t=i==null?void 0:i[r]}else continue;t!==void 0&&(n[i]=Un(t))}catch(e){}}let o=t.fn(e,n,l);return typeof o==`function`?o.call(e,l):o}}let d=zn(c,`wvHandler`,n),f=typeof t==`string`&&t?t:typeof d==`string`?d:void 0;if(!f)return;let p=zn(c,`wvArgs`,n),m=[];if(Array.isArray(p))m=p;else if(typeof p==`string`)try{m=JSON.parse(p)}catch(e){try{m=JSON.parse(An(p))}catch(e){m=[]}}Array.isArray(m)||(m=[]);let h=m.map(e=>e===`$event`?l:e),g=e==null?void 0:e[f];if(typeof g==`function`)return g.apply(e,h)}function Gn(){let e=q();if(e)return e;let t=M();return t[t.length-1]}function Kn(e){return e!==Y&&e}function qn(){var e,t;if(!D())throw Error(`usePageLayout() 必须在 setup() 的同步阶段调用`);let n=I(),r=n==null||(e=n.__wevu)==null?void 0:e.state,i=d({name:Kn(r==null?void 0:r[Te]),props:{...(t=r==null?void 0:r[Ee])==null?{}:t}});return n&&(n.__wevuPageLayoutState=i),B(i)}function Jn(e,t,n){let r=e.__wevuPageLayoutState;r&&(r.name=t,r.props={...n})}function Yn(e){var t,n;let r=e.__wevuPageLayoutState,i=(t=e.__wevu)==null?void 0:t.state;!r||!i||(r.name=Kn(i[Te]),r.props={...(n=i[Ee])==null?{}:n})}function Xn(e,t){let n=I(),r=n==null?void 0:n[De];if(typeof r==`function`){r(e,t);return}let i=Gn(),a=i==null?void 0:i[De];if(typeof a==`function`){a(e,t);return}throw Error(`setPageLayout() 未找到当前页面实例。请在页面 setup()、事件回调或当前页面上下文中调用。`)}function Zn(e){return e===!1?Y:e}function Qn(){let e=globalThis;return e[Ue]instanceof Map||(e[Ue]=new Map),typeof e[He]!=`number`&&(e[He]=0),{globalObject:e,ownerStore:e[Ue]}}function $n(){let{globalObject:e}=Qn();return e[He]+=1,`wv${e[He]}`}function er(e,t,n){var r;let{ownerStore:i}=Qn(),a=(r=i.get(e))==null?{snapshot:{},proxy:n,subscribers:new Set}:r;if(a.snapshot=t,a.proxy=n,i.set(e,a),a.subscribers.size)for(let e of a.subscribers)try{e(t,n)}catch(e){}}function tr(e){let{ownerStore:t}=Qn();t.delete(e)}function nr(e,t){var n;let{ownerStore:r}=Qn(),i=(n=r.get(e))==null?{snapshot:{},proxy:void 0,subscribers:new Set}:n;return i.subscribers.add(t),r.set(e,i),()=>{let n=r.get(e);n&&n.subscribers.delete(t)}}function rr(e){var t;let{ownerStore:n}=Qn();return(t=n.get(e))==null?void 0:t.proxy}function ir(e){var t;let{ownerStore:n}=Qn();return(t=n.get(e))==null?void 0:t.snapshot}function ar(e){let t=e.__wevu_cloneLatestSnapshot;return typeof t==`function`?t():typeof e.snapshot==`function`?e.snapshot():{}}function or(e,t){let n=e[Me];return!(n instanceof Set&&n.has(t))}function sr(e,t,n){if(!(!t||typeof t!=`object`))for(let[r,i]of Object.entries(t))or(n,r)&&(e[r]=i)}function cr(e,t,n){var r;try{t.state[Z]=n}catch(e){}try{e[Z]=n}catch(e){}try{let t=e.data;t&&typeof t==`object`&&(t[Z]=n)}catch(e){}let i=ar(t);sr(i,(r=e[X])==null?e.properties:r,t),er(n,i,t.proxy)}function lr(e){return e.kind===`component`}function ur(e){return new Proxy(e,{get(e,t,n){let r=Reflect.get(e,t,n);return h(r)?r.value:r},set(e,t,n,r){let i=e[t];return h(i)&&!h(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}})}function dr(e,t){let n=e.__wevuExposeProxy;if(n&&e.__wevuExposeRaw===t)return n;let r=ur(t);try{Object.defineProperty(e,"__wevuExposeProxy",{value:r,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(e,"__wevuExposeRaw",{value:t,configurable:!0,enumerable:!1,writable:!1})}catch(n){e.__wevuExposeProxy=r,e.__wevuExposeRaw=t}return r}function fr(e,t){if(!t||typeof t!=`object`)return e;let n=t;return $(new Proxy(e,{get(e,t,r){if(Reflect.has(e,t))return Reflect.get(e,t,r);let i=n[t];return typeof i==`function`?i.bind(n):i},set(e,t,r,i){return Reflect.has(e,t)?Reflect.set(e,t,r,i):(t in n,n[t]=r,!0)},has(e,t){return Reflect.has(e,t)||t in n},ownKeys(e){return[...new Set([...Reflect.ownKeys(e),...Reflect.ownKeys(n)])]},getOwnPropertyDescriptor(e,t){if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);let r=Object.getOwnPropertyDescriptor(n,t);return r&&{...r,configurable:!0}}}))}function pr(e){var t;if(!e||typeof e!=`object`)return e==null?null:e;let n=e,r=n[fe];return r&&typeof r==`object`?dr(n,r):(t=n[Pe])!=null&&t.proxy?n[Pe].proxy:e}function mr(e){return e[nt]}function hr(e,t,n){if(!e)return;let r=e.get(t);r&&(r.value=n)}function gr(e,t){var n,r;let i=(n=(r=e.__wevu)==null?void 0:r.proxy)==null?e:n,a;if(t.get)try{a=t.get.call(i)}catch(e){a=void 0}return a==null&&t.name&&(a=t.name),typeof a==`function`?{type:`function`,fn:a}:h(a)?{type:`ref`,ref:a}:typeof a==`string`&&a?{type:`name`,name:a}:t.name?{type:`name`,name:t.name}:{type:`skip`}}function _r(e){var t,n;let r=(t=(n=e.__wevu)==null?void 0:n.state)==null?e:t,i=r.$refs;if(i&&typeof i==`object`)return i;let a=$(Object.create(null));return Object.defineProperty(r,"$refs",{value:a,configurable:!0,enumerable:!1,writable:!1}),a}function vr(e){let t=e;if(t&&typeof t.createSelectorQuery==`function`)return t.createSelectorQuery();if(!z(`globalCreateSelectorQuery`))return null;let n=k();if(n&&typeof n.createSelectorQuery==`function`){let e=n.createSelectorQuery();return e?A().selectorQueryScopeByIn&&typeof e.in==`function`?e.in(t):e:null}return null}function yr(e,t,n,r,i){let a=vr(e);return a?(r(n.multiple?a.selectAll(t):a.select(t)),new Promise(e=>{a.exec(t=>{var r;let a=Array.isArray(t)?t[0]:null;if(n.index!=null&&Array.isArray(a)){var o;a=(o=a[n.index])==null?null:o}if(i){var s;i((s=a)==null?null:s)}e((r=a)==null?null:r)})})):(i&&i(null),Promise.resolve(null))}function br(e,t,n){return $({selector:t,boundingClientRect:r=>yr(e,t,n,e=>e.boundingClientRect(),r),scrollOffset:r=>yr(e,t,n,e=>e.scrollOffset(),r),fields:(r,i)=>yr(e,t,n,e=>e.fields(r),i),node:r=>yr(e,t,n,e=>e.node(),r)})}function xr(e,t){let n=e;if(!n)return t.inFor?$([]):null;if(t.inFor){if(typeof n.selectAllComponents==`function`){let r=n.selectAllComponents(t.selector);return $((Array.isArray(r)?r:[]).map((n,r)=>fr(br(e,t.selector,{multiple:!0,index:r}),pr(n))))}return $([])}let r=br(e,t.selector,{multiple:!1});return typeof n.selectComponent==`function`?fr(r,pr(n.selectComponent(t.selector))):r}function Sr(e,t,n){return t.inFor?$((Array.isArray(n)?n:[]).map((n,r)=>br(e,t.selector,{multiple:!0,index:r}))):n?br(e,t.selector,{multiple:!1}):null}function Cr(e,t){let n=e[et];if(!n||!n.length){t==null||t();return}if(!e[Fe]){t==null||t();return}if(!e.__wevu){t==null||t();return}let r=mr(e),i=n.filter(e=>!lr(e)),a=n.filter(e=>lr(e)).map(t=>({binding:t,value:xr(e,t)})),o=n=>{var i,a;let o=_r(e),s=new Map,c=new Set,l=(i=(a=e.__wevu)==null?void 0:a.proxy)==null?e:i;n.forEach(t=>{let n=t.binding,r=t.value,i=gr(e,n);if(i.type===`function`){n.inFor&&Array.isArray(r)?r.length?r.forEach(e=>i.fn.call(l,e)):i.fn.call(l,null):i.fn.call(l,r==null?null:r);return}if(i.type===`ref`){i.ref.value=r;return}if(i.type===`name`){var a;c.add(i.name);let e=(a=s.get(i.name))==null?{values:[],count:0,hasFor:!1}:a;e.count+=1,e.hasFor=e.hasFor||n.inFor,n.inFor?Array.isArray(r)&&e.values.push(...r):r!=null&&e.values.push(r),s.set(i.name,e)}});for(let[e,t]of s){let n;n=t.values.length?t.hasFor||t.values.length>1||t.count>1?$(t.values):t.values[0]:t.hasFor?$([]):null,o[e]=n,hr(r,e,n)}for(let e of Object.keys(o))c.has(e)||delete o[e];t==null||t()};if(!i.length){o(a);return}let s=vr(e);if(!s){o(a);return}let c=[];for(let e of i)(e.inFor?s.selectAll(e.selector):s.select(e.selector)).boundingClientRect(),c.push({binding:e});s.exec(t=>{let n=c.map((n,r)=>{let i=Array.isArray(t)?t[r]:null;return{binding:n.binding,value:Sr(e,n.binding,i)}});o([...a,...n])})}function wr(e,t){let n=e[et];if(!n||!n.length){t==null||t();return}if(t){var i;let n=(i=e[$e])==null?[]:i;n.push(t),e[$e]||Object.defineProperty(e,$e,{value:n,configurable:!0,enumerable:!1,writable:!0})}e[tt]||(e[tt]=!0,r(()=>{e[tt]=!1,Cr(e,()=>{let t=e[$e];!t||!t.length||t.splice(0).forEach(e=>{try{e()}catch(e){}})})}))}function Tr(e){var t,n;let r=e[et];if(!r||!r.length)return;let i=_r(e),a=(t=(n=e.__wevu)==null?void 0:n.proxy)==null?e:t,o=new Set,s=mr(e);for(let t of r){let n=gr(e,t),r=t.inFor?$([]):null;if(n.type===`function`){n.fn.call(a,null);continue}if(n.type===`ref`){n.ref.value=r;continue}n.type===`name`&&(o.add(n.name),i[n.name]=r,hr(s,n.name,r))}for(let e of Object.keys(i))o.has(e)||delete i[e]}const Er=[`triggerEvent`,`createSelectorQuery`,`createIntersectionObserver`,`setData`,`setUpdatePerformanceListener`];function Dr(){return Object.freeze(Object.create(null))}const Or=()=>[];function kr(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&e.length>0))]:!e||typeof e!=`object`?[]:Object.entries(e).filter(([,e])=>!!e).map(([e])=>e)}function Ar(e){if(!Q(e,Ke))return Dr();let t=()=>kr(e[Ke]),n=e=>typeof e==`string`&&t().includes(e);return new Proxy(Object.create(null),{get(e,t){if(n(t))return Or},has(e,t){return n(t)},ownKeys(){return t()},getOwnPropertyDescriptor(e,t){if(n(t))return{configurable:!0,enumerable:!0,value:Or}},set(){return!1},deleteProperty(){return!1}})}function jr(){let e=(()=>{});return e.stop=()=>{},e.pause=()=>{},e.resume=()=>{},e}function Mr(e){try{return $(e)}catch(t){return e}}function Nr(e){return!e||typeof e!=`object`||Array.isArray(e)?!1:Q(e,`bubbles`)||Q(e,`composed`)||Q(e,`capturePhase`)}function Pr(e){if(e.length===0)return{detail:void 0,options:void 0};if(e.length===1)return{detail:e[0],options:void 0};let t=e[e.length-1];if(Nr(t)){let n=e.slice(0,-1);return{detail:n.length<=1?n[0]:n,options:t}}return{detail:e,options:void 0}}function Fr(e,t,n){let r=e==null?void 0:e.state,i=r&&typeof r==`object`?b(r):void 0,a=e==null?void 0:e.proxy,o=e=>{let r=e[n];if(typeof r!=`function`)return!1;if(Nt(r))return!0;let i=t[n];return typeof i==`function`&&r===i},s=e=>!e||typeof e!=`object`||e===t||e===a||o(e)?!1:typeof e[n]==`function`,c=i?i[J]:void 0;if(s(c))return c;let l=e==null?void 0:e.instance;if(s(l))return l}function Ir(e,t,n){Mt(n);try{Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(r){e[t]=n}}function Lr(e,t){let n=e[We];if(n&&typeof n==`object`)return n;let r=Object.create(null),i=n=>{let r=Fr(t,e,n);if(r)return r;let i=e[n];if(typeof i==`function`&&!Nt(i))return e};Ir(r,`triggerEvent`,(...e)=>{let[t,n,r]=e,a=i(`triggerEvent`);a&&typeof a.triggerEvent==`function`&&(e.length>=3?a.triggerEvent(t,n,r):a.triggerEvent(t,n))}),Ir(r,`createSelectorQuery`,()=>{var n;let r=i(`createSelectorQuery`);if(r&&typeof r.createSelectorQuery==`function`)return r.createSelectorQuery();let a=k();if(!z(`globalCreateSelectorQuery`)||!a||typeof a.createSelectorQuery!=`function`)return;let o=a.createSelectorQuery();if(!o||!A().selectorQueryScopeByIn||typeof o.in!=`function`)return o;let s=(n=Fr(t,e,`setData`))==null?e:n;return o.in(s)}),Ir(r,`createIntersectionObserver`,n=>{var r;let a=i(`createIntersectionObserver`);if(a&&typeof a.createIntersectionObserver==`function`)return a.createIntersectionObserver(n==null?{}:n);let o=k();if(!z(`globalCreateIntersectionObserver`)||!o||typeof o.createIntersectionObserver!=`function`)return;let s=(r=Fr(t,e,`setData`))==null?e:r;return A().intersectionObserverScopeByParameter?o.createIntersectionObserver(s,n==null?{}:n):o.createIntersectionObserver(n==null?{}:n)}),Ir(r,`setData`,(e,n)=>{let r=i(`setData`);if(r&&typeof r.setData==`function`)return r.setData(e,n);let a=t==null?void 0:t.adapter,o=typeof(a==null?void 0:a.setData)==`function`?a.setData(e):void 0;return typeof n==`function`&&n(),o}),Ir(r,`setUpdatePerformanceListener`,e=>{let t=i(`setUpdatePerformanceListener`);if(t&&typeof t.setUpdatePerformanceListener==`function`)return t.setUpdatePerformanceListener(e)});let a=Mr(new Proxy(r,{get(t,n,r){if(Reflect.has(t,n))return Reflect.get(t,n,r);let i=e[n];return typeof i==`function`?i.bind(e):i},has(t,n){return Reflect.has(t,n)||n in e},set(t,n,r){return Reflect.has(t,n)?(t[n]=r,!0):(e[n]=r,!0)}}));try{Object.defineProperty(e,We,{value:a,configurable:!0,enumerable:!1,writable:!0})}catch(t){e[We]=a}return a}function Rr(e){return!e||typeof e!=`object`?!1:typeof e.triggerEvent==`function`||typeof e.createSelectorQuery==`function`||typeof e.createIntersectionObserver==`function`||typeof e.setData==`function`}function zr(e,t,n){let r=t==null?void 0:t[n];if(typeof r!=`function`)return!1;if(Nt(r))return!0;let i=e==null?void 0:e.proxy;return typeof(i==null?void 0:i[n])==`function`&&r===i[n]}function Br(e,t){if(!e||!Rr(t)||t===e.proxy)return;let n=t;if(zr(e,n,`triggerEvent`)||zr(e,n,`createSelectorQuery`)||zr(e,n,`createIntersectionObserver`)||zr(e,n,`setData`))return;let r=e.state;if(!(!r||typeof r!=`object`))try{Object.defineProperty(r,J,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(e){r[J]=n}}function Vr(e,t){try{let n=t.methods;for(let t of Object.keys(n))Er.includes(t)||typeof e[t]!=`function`&&(e[t]=function(...n){var r,i;let a=(r=this[Pe])==null?e[Pe]:r;Br(a,this);let o=a==null||(i=a.methods)==null?void 0:i[t];if(typeof o==`function`)return o.apply(a.proxy,n)})}catch(e){}}let Hr=e=>e.startsWith(`layouts/`);function Ur(e){let t=e.is;return typeof t==`string`&&Hr(t,e)}function Wr(e){if(Ur(e))return;let t=e[ke];if(t&&typeof t==`object`)return t;let n=e.selectOwnerComponent;if(typeof n==`function`)try{let t=n.call(e);if(t&&t!==e&&typeof t==`object`&&t.__wevu)return t}catch(e){}let r=M(),i=r[r.length-1];if(i&&i!==e&&typeof i==`object`&&i.__wevu)return i}function Gr(e){if(!Ur(e))return;let t=M(),n=t[t.length-1];n&&n!==e&&typeof n==`object`&&n.__wevu&&se(e,n)}function Kr(e,t){e[ze]=t,H(e,t,Wr(e)),Gr(e)}function qr(e,t,n){var r;if(typeof e!=`function`)return;let i=(r=n==null?void 0:n.runtime)==null?{methods:Object.create(null),state:{},setupState:{},proxy:{},watch:()=>()=>{},bindModel:()=>{}}:r;return n&&(n.runtime=i),e(t,{...n==null?{}:n,runtime:i})}function Jr(e,t){try{Object.defineProperty(e,X,{value:t,configurable:!0,enumerable:!1,writable:!1})}catch(n){e[X]=t}}function Yr(e,t){try{Object.defineProperty(e,Ge,{value:t,configurable:!0,enumerable:!1,writable:!1})}catch(n){e[Ge]=t}}function Xr(e,t){try{Object.defineProperty(e,J,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){e[J]=t}}function Zr(e,t){try{Object.defineProperty(e,Be,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){e[Be]=t}}function Qr(e,t){try{Object.defineProperty(e,"instance",{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){try{e.instance=t}catch(e){}}}function $r(e){let t=e[We],n=t&&typeof t.setData==`function`?t.setData:void 0;if(typeof n==`function`&&!Nt(n))return n;let r=e.setData;if(typeof r==`function`&&!Nt(r))return r}function ei(e){let t=e.route;if(typeof t==`string`&&t)return t;let n=e.is;return typeof n==`string`&&n?n:`unknown`}function ti(e,t,n){try{return t.call(e,n)}catch(t){let n=ei(e);throw Error(`[wevu] setData failed (${n}): ${t instanceof Error?t.message:String(t)}`)}}function ni(e,t){let n=Object.keys(e);for(let r of n)if(!Q(t,r))try{delete e[r]}catch(e){}for(let[n,r]of Object.entries(t))e[n]=r}function ri(t,n,r=t.properties||{}){let i=n&&typeof n==`object`?n[X]:void 0,a=i&&typeof i==`object`?i:e({});ni(a,r),n&&typeof n==`object`&&Jr(n,a);try{Object.defineProperty(t,X,{value:a,configurable:!0,enumerable:!1,writable:!0})}catch(e){t[X]=a}return a}function ii(e){return e.includes(`:`)?e.replaceAll(`:`,`-`).toLowerCase():e}function ai(e){return e.startsWith(`__wv_`)}function oi(t){var n;let{target:r,runtime:i,runtimeWithDefaults:a,runtimeState:o,runtimeProxy:s,setup:l}=t,u=ri(r,o,r.properties||{}),d=e(Object.create(null)),f=new Set(Array.isArray(r[Ne])?r[Ne]:[]),p=e=>typeof o==`object`&&!!o&&Q(o,e);(()=>{let e=r.properties&&typeof r.properties==`object`?r.properties:void 0;for(let t of Object.keys(d))(!e||!Q(e,t)||ai(t)||f.has(t)||p(t))&&delete d[t];if(e)for(let[t,n]of Object.entries(e))ai(t)||f.has(t)||p(t)||(d[t]=n)})();try{Object.defineProperty(r,ue,{value:d,configurable:!0,enumerable:!1,writable:!1})}catch(e){r[ue]=d}let h=Lr(r,a),g=Ar(u);Yr(o,(n=a.setupState)==null?Object.create(null):n);try{Object.defineProperty(o,"$slots",{value:g,configurable:!0,enumerable:!1,writable:!1})}catch(e){o.$slots=g}let _=Mr({props:u,runtime:a,state:o,proxy:s,bindModel:i.bindModel.bind(a),watch:i.watch.bind(a),instance:h,emit:(e,...t)=>{let{detail:n,options:r}=Pr(t),i=ii(e);h.triggerEvent(i,n,r)},expose:e=>{r[fe]=e},attrs:d,slots:g}),v=c(!0);r[de]=v,R(r),O(_);try{let e=v.run(()=>qr(l,u,_)),t=!1;if(e&&typeof e==`object`){let n=i.setupState&&typeof i.setupState==`object`?m(i.setupState)?b(i.setupState):i.setupState:Object.create(null);Object.keys(e).forEach(r=>{let a=e[r];if(typeof a==`function`)i.methods[r]=(...e)=>a.apply(i.proxy,e),i.state[r]=(...e)=>a.apply(i.proxy,e),t=!0;else{if(kt(a)){var o;(o=i.__wevu_trackSetupReactiveKey)==null||o.call(i,r)}i.state[r]=a,n[r]=a}})}if(t){var y;(y=i.__wevu_touchSetupMethodsVersion)==null||y.call(i)}}catch(e){throw v.stop(),r[de]=void 0,e}finally{O(void 0),R(void 0)}}function si(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function ci(e){var t,n,r;let i={devOnly:!0,sampleWindowMs:1e3,maxCalls:30,coolDownMs:5e3,warnOnPageScroll:!0,pageScrollCoolDownMs:2e3};return e===void 0||e===!1?{...i,enabled:!1}:e===!0?{...i,enabled:!0}:si(e)?{enabled:(t=e.enabled)==null||t,devOnly:(n=e.devOnly)==null?i.devOnly:n,sampleWindowMs:typeof e.sampleWindowMs==`number`?Math.max(100,Math.floor(e.sampleWindowMs)):i.sampleWindowMs,maxCalls:typeof e.maxCalls==`number`?Math.max(1,Math.floor(e.maxCalls)):i.maxCalls,coolDownMs:typeof e.coolDownMs==`number`?Math.max(0,Math.floor(e.coolDownMs)):i.coolDownMs,warnOnPageScroll:(r=e.warnOnPageScroll)==null?i.warnOnPageScroll:r,pageScrollCoolDownMs:typeof e.pageScrollCoolDownMs==`number`?Math.max(0,Math.floor(e.pageScrollCoolDownMs)):i.pageScrollCoolDownMs}:{...i,enabled:!1}}function li(){let e=P();if((e==null?void 0:e.debug)===!0||(e==null?void 0:e.envVersion)===`develop`)return!0;let t=k();try{var n;if((t==null||(n=t.getAccountInfoSync)==null||(n=n.call(t))==null||(n=n.miniProgram)==null?void 0:n.envVersion)===`develop`)return!0}catch(e){}return!1}function ui(e){var t,n;let r=ci(e.option);if(!r.enabled)return;let i=li();if(r.devOnly&&!i)return;let a=(t=e.now)==null?(()=>Date.now()):t,o=(n=e.logger)==null?(e=>{var t;let n=(t=globalThis)==null||(t=t.console)==null?void 0:t.warn;typeof n==`function`&&n(e)}):n,s=[],c=-1/0,l=-1/0;return()=>{var t,n;let i=a();s.push(i);let u=i-r.sampleWindowMs;for(;s.length>0&&s[0]<u;)s.shift();let d=(t=(n=e.isInPageScrollHook)==null?void 0:n.call(e))!=null&&t;r.warnOnPageScroll&&d&&(r.pageScrollCoolDownMs<=0||i-l>=r.pageScrollCoolDownMs)&&(l=i,o(`[wevu:setData] 检测到 onPageScroll 回调内调用 setData(${e.targetLabel})。建议改用 IntersectionObserver 监听可见性,或对滚动更新做节流。`)),!(s.length<=r.maxCalls)&&(r.coolDownMs>0&&i-c<r.coolDownMs||(c=i,o(`[wevu:setData] 检测到高频 setData 调用:${s.length} 次/${r.sampleWindowMs}ms(${e.targetLabel})。建议合并更新或降低调用频率。`)))}}function di(e,t,n){if(typeof e==`function`)return{handler:e.bind(t.proxy),options:{}};if(typeof e==`string`){var r,i;let a=(r=(i=t.methods)==null?void 0:i[e])==null?n[e]:r;return typeof a==`function`?{handler:a.bind(t.proxy),options:{}}:void 0}if(!e||typeof e!=`object`)return;let a=di(e.handler,t,n);if(!a)return;let o={...a.options};return e.immediate!==void 0&&(o.immediate=e.immediate),e.deep!==void 0&&(o.deep=e.deep),{handler:a.handler,options:o}}function fi(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 pi(e,t,n){let r=[],i=e.proxy;for(let[a,o]of Object.entries(t)){let t=di(o,e,n);if(!t)continue;let s=fi(i,a),c=e.watch(s,t.handler,t.options);r.push(c)}return r}function mi(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(mi(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=mi(i,t);return n}function hi(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i!=null&&i.has(e)||(a[e]=mi(t));if(n)for(let[e,t]of Object.entries(n))i!=null&&i.has(e)||(a[e]=mi(t));return a}function gi(e){return!!(e!=null&&e.__wevuHasTemplateRuntimeBindings)}function _i(e){typeof e.route!=`string`||!e.route||(e[De]=(t,n)=>{var r;let i=(r=e.__wevu)==null?void 0:r.state;if(!i||typeof i!=`object`)return;i[Te]=Zn(t);let a=t===!1||n==null?{}:n;i[Ee]=a,Jn(e,t,a)})}function vi(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h,g;if(e.__wevu)return e.__wevu;Kr(e,t),Mr(e);let _=(a=e.data)==null?void 0:a[Z],v=typeof _==`string`&&_?_:$n(),y=typeof _==`string`&&_!==v,b=!!(!(t==null||(o=t.__wevuSetDataOptions)==null)&&o.suspendWhenHidden),x=typeof e.route==`string`&&e.route?`page:${e.route}`:typeof e.is==`string`&&e.is?`component:${e.is}`:`unknown-target`,S=ui({option:t==null||(s=t.__wevuSetDataOptions)==null?void 0:s.highFrequencyWarning,targetLabel:x,isInPageScrollHook:()=>{var t;return Number((t=e[Oe])==null?0:t)>0}}),C=i!=null&&i.deferSetData?(e=>{let t,n=!1,r={setData(r){if(!n){var i;t={...(i=t)==null?{}:i,...r};return}let a=$r(e);if(a)return ti(e,a,r)}};return r.__wevu_enableSetData=()=>{n=!0;let r=$r(e);if(t&&Object.keys(t).length&&r){let n=t;t=void 0,ti(e,r,n)}},r})(e):{setData(t){let n=$r(e);if(n)return ti(e,n,t)}},w,T=!0,E,D=(e,t)=>({...e==null?{}:e,...t}),O=()=>{var t;if(!w)return;let n=ar(w);sr(n,(t=e[X])==null?e.properties:t,w),er(v,n,w.proxy)},k=()=>{if(!y)return;let t=e.data;try{t&&typeof t==`object`&&(t[Z]=v)}catch(e){}let n=$r(e);n&&ti(e,n,{[Z]:v})},A={...C,setData(t){if(S==null||S(),b&&!T){E=D(E,t),O(),wr(e);return}let n=C.setData(t);return O(),wr(e),n},__wevu_setVisibility(t){if(T=t,!T||!E)return;let n=E;E=void 0;let r=C.setData(n);return O(),wr(e),r}};Array.isArray(i==null?void 0:i.snapshotOmitKeys)&&i.snapshotOmitKeys.length&&Object.defineProperty(A,"__wevu_snapshotOmitKeys",{configurable:!0,enumerable:!1,value:i.snapshotOmitKeys,writable:!1});let j=hi(e,i==null?void 0:i.snapshotOmitKeys,gi(t)?void 0:{[Z]:v});j&&Object.keys(j).length&&Object.defineProperty(A,"__wevu_initialSnapshot",{configurable:!0,enumerable:!1,value:j,writable:!1}),Object.defineProperty(A,"__wevu_initialState",{configurable:!0,enumerable:!1,value:{[Z]:v},writable:!1});let M=e.properties;(r||M&&typeof M==`object`&&Object.keys(M).length>0)&&Object.defineProperty(A,"__wevu_deferInitialSnapshot",{configurable:!0,enumerable:!1,value:!0,writable:!1});let N=t.mount(A);w=N,Qr(N,e);let P=(c=N==null?void 0:N.proxy)==null?{}:c,F=(l=N==null?void 0:N.state)==null?{}:l,I=(u=N==null?void 0:N.setupState)==null?Object.create(null):u;F&&typeof F==`object`&&(Zr(F,N),Xr(F,e));let L=(d=N==null?void 0:N.computed)==null?Object.create(null):d;if(!(N!=null&&N.methods))try{N.methods=Object.create(null)}catch(e){}let R=(f=N==null?void 0:N.methods)==null?Object.create(null):f,z=(p=N==null?void 0:N.watch)==null?(()=>jr()):p,B=(m=N==null?void 0:N.bindModel)==null?(()=>{}):m,V={...N==null?{}:N,state:F,setupState:I,proxy:P,methods:R,computed:L,watch:z,bindModel:B,snapshot:(h=N==null?void 0:N.snapshot)==null?(()=>Object.create(null)):h,unmount:(g=N==null?void 0:N.unmount)==null?(()=>{}):g},H=V,U={__wevu_flushSetupSnapshotSync:N.__wevu_flushSetupSnapshotSync,__wevu_touchSetupMethodsVersion:N.__wevu_touchSetupMethodsVersion,__wevu_trackSetupReactiveKey:N.__wevu_trackSetupReactiveKey,[Me]:N[Me]};for(let[e,t]of Object.entries(U))t&&Object.defineProperty(V,e,{configurable:!0,enumerable:!1,value:t,writable:!0});if(Object.defineProperty(e,Pe,{value:V,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=V,_i(e),ri(e,F),cr(e,V,v),k(),n){let t=pi(V,n,e);t.length&&(e[rt]=t)}if(r){if(oi({target:e,runtime:N,runtimeWithDefaults:V,runtimeState:F,runtimeProxy:P,setup:r}),!(i!=null&&i.deferSetData)){var W;(W=H.__wevu_flushSetupSnapshotSync)==null||W.call(H)}O()}else if(e.properties&&typeof e.properties==`object`&&Object.keys(e.properties).length>0){var G;(G=H.__wevu_flushSetupSnapshotSync)==null||G.call(H),O()}return Vr(e,N),N}function yi(e){var t;let n=(t=e.__wevu)==null?void 0:t.state,r=e.data;if(!(!n||typeof n!=`object`||!r||typeof r!=`object`)){for(let[e,t]of Object.entries(r))if(!(!e||e===`undefined`)&&Object.prototype.hasOwnProperty.call(n,e))try{n[e]=t}catch(e){}}}function bi(e){var t,n,r;let i=(t=e.__wevu)==null?void 0:t.adapter;yi(e),(n=e.__wevu)==null||(r=n.__wevu_flushSetupSnapshotSync)==null||r.call(n),i&&typeof i.__wevu_enableSetData==`function`&&i.__wevu_enableSetData()}function xi(e,t){var n;let r=(n=e.__wevu)==null?void 0:n.adapter;r&&typeof r.__wevu_setVisibility==`function`&&r.__wevu_setVisibility(t)}function Si(e){var t;let n=e.__wevu,r=e[Z];r&&tr(r),Tr(e),n&&e[me]&&N(e,`onUnload`,[]),e[me]&&(e[me]=void 0);let i=e[rt];if(Array.isArray(i))for(let e of i)try{e()}catch(e){}e[rt]=void 0,(t=e[de])==null||t.stop(),e[de]=void 0,n&&n.unmount(),delete e.__wevu,Pe in e&&delete e[Pe]}const Ci=`__wevuAppGlobalListeners`,wi=`__wevuOnMemoryWarningListener`;function Ti(e){let t=e[me],n=!!(t!=null&&t.onMemoryWarning);if(!z(`appMemoryWarningListener`)){delete e[wi];return}let r=k(),i=r==null?void 0:r.onMemoryWarning,a=r==null?void 0:r.offMemoryWarning;if(typeof i!=`function`)return;let o=e[wi];if(typeof o==`function`&&typeof a==`function`)try{a(o)}catch(e){}if(!n){delete e[wi];return}let s=t=>{N(e,`onMemoryWarning`,[t])};e[wi]=s,i(s)}function Ei(e,t){var n,r;let{hookName:i,onApiName:a,offApiName:o,capabilityName:s,userHandler:c}=t,l=e[me],u=!!(l!=null&&l[i]),d=(r=(n=e)[Ci])==null?n[Ci]=Object.create(null):r,f=d[i];if(!z(s)){delete d[i],delete e[i];return}let p=k(),m=p==null?void 0:p[a],h=p==null?void 0:p[o];if(typeof f==`function`&&typeof h==`function`)try{h(f)}catch(e){}if(!u&&typeof c!=`function`){delete d[i];return}let g=(...t)=>{N(e,i,t),typeof c==`function`&&c.apply(e,t)};e[i]=g,d[i]=g,typeof m==`function`&&m(g)}function Di(e,t){Ei(e,{hookName:`onError`,onApiName:`onError`,offApiName:`offError`,capabilityName:`appErrorListener`,userHandler:t.onError}),Ei(e,{hookName:`onPageNotFound`,onApiName:`onPageNotFound`,offApiName:`offPageNotFound`,capabilityName:`appPageNotFoundListener`,userHandler:t.onPageNotFound}),Ei(e,{hookName:`onUnhandledRejection`,onApiName:`onUnhandledRejection`,offApiName:`offUnhandledRejection`,capabilityName:`appUnhandledRejectionListener`,userHandler:t.onUnhandledRejection}),Ei(e,{hookName:`onThemeChange`,onApiName:`onThemeChange`,offApiName:`offThemeChange`,capabilityName:`appThemeChangeListener`,userHandler:t.onThemeChange})}function Oi(e,t,n,r,i){var a;if(typeof App!=`function`)throw TypeError(`createApp 需要全局 App 构造器可用`);let o=Object.keys(t==null?{}:t),s={...i};s.globalData=(a=s.globalData)==null?{}:a,s[he]||(s[he]=function(e){var t,n;let r=this.__wevu;return Wn((t=r==null?void 0:r.proxy)==null?this:t,void 0,e,r==null||(n=r.methods)==null?void 0:n[ge])});let c=s.onLaunch,l=s.onError,u=s.onPageNotFound,d=s.onUnhandledRejection,f=s.onThemeChange;s.onLaunch=function(...t){this[_e]=!0,vi(this,e,n,r),Ti(this),Di(this,{onError:l,onPageNotFound:u,onUnhandledRejection:d,onThemeChange:f}),N(this,`onLaunch`,t),typeof c==`function`&&c.apply(this,t)};let p=s.onShow;s.onShow=function(...e){N(this,`onShow`,e),typeof p==`function`&&p.apply(this,e)};let m=s.onHide;s.onHide=function(...e){N(this,`onHide`,e),typeof m==`function`&&m.apply(this,e)},delete s.onError,delete s.onPageNotFound,delete s.onUnhandledRejection,delete s.onThemeChange;for(let e of o){let t=s[e];s[e]=function(...n){var r;let i=this.__wevu,a,o=i==null||(r=i.methods)==null?void 0:r[e];return o&&(a=o.apply(i.proxy,n)),typeof t==`function`?t.apply(this,n):a}}App(s)}function ki(e){let{features:t,userOnSaveExitState:n,userOnPullDownRefresh:r,userOnReachBottom:i,userOnPageScroll:a,userOnRouteDone:o,userOnTabItemTap:s,userOnResize:c,userOnShareAppMessage:l,userOnShareTimeline:u,userOnAddToFavorites:d}=e,f=typeof r==`function`||!!t.enableOnPullDownRefresh,p=typeof i==`function`||!!t.enableOnReachBottom,m=typeof a==`function`||!!t.enableOnPageScroll,h=typeof o==`function`||!!t.enableOnRouteDone,g=!!t.enableOnRouteDoneFallback,_=typeof s==`function`||!!t.enableOnTabItemTap,v=typeof c==`function`||!!t.enableOnResize,y=typeof u==`function`||!!t.enableOnShareTimeline,b=typeof l==`function`||!!t.enableOnShareAppMessage,x=typeof d==`function`||!!t.enableOnAddToFavorites,S=typeof n==`function`||!!t.enableOnSaveExitState,C=()=>{};return{enableOnPullDownRefresh:f,enableOnReachBottom:p,enableOnPageScroll:m,enableOnRouteDone:h,enableOnRouteDoneFallback:g,enableOnTabItemTap:_,enableOnResize:v,enableOnShareAppMessage:b,enableOnShareTimeline:y,enableOnAddToFavorites:x,enableOnSaveExitState:S,effectiveOnSaveExitState:typeof n==`function`?n:(()=>({data:void 0})),effectiveOnPullDownRefresh:typeof r==`function`?r:C,effectiveOnReachBottom:typeof i==`function`?i:C,effectiveOnPageScroll:typeof a==`function`?a:C,effectiveOnRouteDone:typeof o==`function`?o:C,effectiveOnTabItemTap:typeof s==`function`?s:C,effectiveOnResize:typeof c==`function`?c:C,effectiveOnShareAppMessage:typeof l==`function`?l:C,effectiveOnShareTimeline:typeof u==`function`?u:C,effectiveOnAddToFavorites:typeof d==`function`?d:(()=>({}))}}function Ai(e,t){let{enableOnSaveExitState:n,enableOnPullDownRefresh:r,enableOnReachBottom:i,enableOnPageScroll:a,enableOnRouteDone:o,enableOnTabItemTap:s,enableOnResize:c,enableOnShareAppMessage:l,enableOnShareTimeline:u,enableOnAddToFavorites:d,effectiveOnSaveExitState:f,effectiveOnPullDownRefresh:p,effectiveOnReachBottom:m,effectiveOnPageScroll:h,effectiveOnRouteDone:g,effectiveOnTabItemTap:_,effectiveOnResize:v,effectiveOnShareAppMessage:y,effectiveOnShareTimeline:b,effectiveOnAddToFavorites:x,hasHook:S}=t;n&&(e.onSaveExitState=function(...e){let t=F(this,`onSaveExitState`,e);return t===void 0?f.apply(this,e):t}),r&&(e.onPullDownRefresh=function(...e){if(N(this,`onPullDownRefresh`,e),!S(this,`onPullDownRefresh`))return p.apply(this,e)}),i&&(e.onReachBottom=function(...e){if(N(this,`onReachBottom`,e),!S(this,`onReachBottom`))return m.apply(this,e)}),a&&(e.onPageScroll=function(...e){return re(this,()=>{if(N(this,`onPageScroll`,e),!S(this,`onPageScroll`))return h.apply(this,e)})}),o&&(e.onRouteDone=function(...e){if(!this[Re]&&(this[Re]=!0,Promise.resolve().then(()=>{this[Re]=!1}),this[Le]=!0,N(this,`onRouteDone`,e),!S(this,`onRouteDone`)))return g.apply(this,e)}),s&&(e.onTabItemTap=function(...e){if(N(this,`onTabItemTap`,e),!S(this,`onTabItemTap`))return _.apply(this,e)}),c&&(e.onResize=function(...e){if(N(this,`onResize`,e),!S(this,`onResize`))return v.apply(this,e)}),l&&(e.onShareAppMessage=function(...e){let t=F(this,`onShareAppMessage`,e);return t===void 0?y.apply(this,e):t}),u&&(e.onShareTimeline=function(...e){let t=F(this,`onShareTimeline`,e);return t===void 0?b.apply(this,e):t}),d&&(e.onAddToFavorites=function(...e){let t=F(this,`onAddToFavorites`,e);return t===void 0?x.apply(this,e):t})}function ji(e){let{runtimeApp:t,watch:n,setup:r,userOnLoad:i,userOnUnload:a,userOnShow:o,userOnHide:s,userOnReady:c,isPage:l,enableOnSaveExitState:u,enableOnPullDownRefresh:d,enableOnReachBottom:f,enableOnPageScroll:p,enableOnRouteDone:m,enableOnRouteDoneFallback:h,enableOnTabItemTap:g,enableOnResize:_,enableOnShareAppMessage:v,enableOnShareTimeline:y,enableOnAddToFavorites:b,syncWevuPropsFromValues:x,effectiveOnSaveExitState:S,effectiveOnPullDownRefresh:C,effectiveOnReachBottom:w,effectiveOnPageScroll:T,effectiveOnRouteDone:E,effectiveOnTabItemTap:D,effectiveOnResize:O,effectiveOnShareAppMessage:k,effectiveOnShareTimeline:A,effectiveOnAddToFavorites:j,hasHook:M}=e,P=e=>{var t,n;(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)},F={onLoad(...e){if(this[Se])return;this[Se]=!0,vi(this,t,n,r);let a=e[0]&&typeof e[0]==`object`?e[0]:W(this);if(x==null||x(this,a),P(this),bi(this),l&&le({enableOnShareAppMessage:v,enableOnShareTimeline:y}),N(this,`onLoad`,e),typeof i==`function`)return i.apply(this,e.length?e:[a])},onUnload(...e){if(l&&G(this),Si(this),typeof a==`function`)return a.apply(this,e)},onShow(...e){if(l&&(U(),ie(this),this[Se]||F.onLoad.call(this,W(this)),x==null||x(this,W(this)),P(this),le({enableOnShareAppMessage:v,enableOnShareTimeline:y}),this[Le]=!1),xi(this,!0),N(this,`onShow`,e),typeof o==`function`)return o.apply(this,e)},onHide(...e){if(l&&G(this),xi(this,!1),N(this,`onHide`,e),typeof s==`function`)return s.apply(this,e)},onReady(...e){if(l&&(this[Se]||F.onLoad.call(this,W(this)),x==null||x(this,W(this)),P(this),le({enableOnShareAppMessage:v,enableOnShareTimeline:y})),!this[Fe]){if(this[Fe]=!0,l&&m&&h){let e=this;setTimeout(()=>{if(!e[Le]){var t;(t=F.onRouteDone)==null||t.call(e)}},0)}wr(this,()=>{N(this,`onReady`,e),typeof c==`function`&&c.apply(this,e)});return}if(typeof c==`function`)return c.apply(this,e)}};return Ai(F,{enableOnSaveExitState:u,enableOnPullDownRefresh:d,enableOnReachBottom:f,enableOnPageScroll:p,enableOnRouteDone:m,enableOnTabItemTap:g,enableOnResize:_,enableOnShareAppMessage:v,enableOnShareTimeline:y,enableOnAddToFavorites:b,effectiveOnSaveExitState:S,effectiveOnPullDownRefresh:C,effectiveOnReachBottom:w,effectiveOnPageScroll:T,effectiveOnRouteDone:E,effectiveOnTabItemTap:D,effectiveOnResize:O,effectiveOnShareAppMessage:k,effectiveOnShareTimeline:A,effectiveOnAddToFavorites:j,hasHook:M}),F}function Mi(e){let{userMethods:t,runtimeMethods:n}=e,r={...t};r[he]||(r[he]=function(e){var t,n;let r=this.__wevu;return Wn((t=r==null?void 0:r.proxy)==null?this:t,void 0,e,r==null||(n=r.methods)==null?void 0:n[ge])}),r[be]||(r[be]=function(e){var t,n,r;let i=(t=e==null||(n=e.currentTarget)==null||(n=n.dataset)==null?void 0:n.wvModel)==null?e==null||(r=e.target)==null||(r=r.dataset)==null?void 0:r.wvModel:t;if(typeof i!=`string`||!i)return;let a=this.__wevu;if(!a||typeof a.bindModel!=`function`)return;let o=bt(e);try{a.bindModel(i).update(o)}catch(e){}}),!r[we]&&typeof(n==null?void 0:n[we])==`function`&&(r[we]=n[we]);let i=Object.keys(n==null?{}:n);function a(e){let t=e.__wevu;if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[Be]}function o(e,t){if((e==null?void 0:e.proxy)===t)return;let n=e==null?void 0:e.proxy,r=e=>{let r=t[e];if(typeof r!=`function`)return!1;let i=n==null?void 0:n[e];return typeof i==`function`&&r===i};if(r(`triggerEvent`)||r(`createSelectorQuery`)||r(`createIntersectionObserver`)||r(`setData`)||!(typeof t.triggerEvent==`function`||typeof t.createSelectorQuery==`function`||typeof t.createIntersectionObserver==`function`||typeof t.setData==`function`))return;let i=e==null?void 0:e.state;if(!(!i||typeof i!=`object`)&&t.$state!==i)try{Object.defineProperty(i,J,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[J]=t}}for(let e of i){if(e===ge||e.startsWith(Ie))continue;let t=r[e];r[e]=function(...n){var r;let i=a(this);o(i,this);let s,c=i==null||(r=i.methods)==null?void 0:r[e];if(c&&(s=c.apply(i.proxy,n)),typeof t==`function`){let e=t.apply(this,n);return e===void 0?s:e}return s}}return{finalMethods:r}}function Ni(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(Ni(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=Ni(i,t);return n}function Pi(e){let t=e.route;if(typeof t==`string`&&t)return t;let n=e.is;return typeof n==`string`&&n?n:`unknown`}function Fi(e){var t;let{methods:n={},lifetimes:r={},pageLifetimes:i={},options:a={},...o}=e,s=o.onLoad,c=o.onUnload,l=o.onShow,u=o.onHide,d=o.onReady,f=o.onSaveExitState,p=o.onPullDownRefresh,m=o.onReachBottom,h=o.onPageScroll,g=o.onRouteDone,_=o.onTabItemTap,v=o.onResize,y=o.onShareAppMessage,b=o.onShareTimeline,x=o.onAddToFavorites,S=(t=o.features)==null?{}:t,C=[s,c,l,u,d,f,p,m,h,g,_,v,y,b,x].some(e=>typeof e==`function`),w=!!o.__wevu_isPage||Object.keys(S==null?{}:S).length>0||C,T={...o},E=new Set([`data`,`behaviors`,`relations`,`externalClasses`,`options`,`properties`,`observers`,`pureDataPattern`,`virtualHost`,`definitionFilter`,`export`,`__wevuTemplateRefs`,`__wevuLayoutHosts`,je,Me,`setupLifecycle`,`features`,`__wevu_isPage`]),D=[];for(let[e,t]of Object.entries(T))E.has(e)||typeof t!=`function`&&(D.push([e,t]),delete T[e]);let O=e=>{if(D.length){for(let[t,n]of D)if(!Q(e,t))try{e[t]=Ni(n)}catch(e){}}},k=new Set([`data`,`export`,`definitionFilter`,`onLoad`,`onUnload`,`onShow`,`onHide`,`onReady`,`onSaveExitState`,`onPullDownRefresh`,`onReachBottom`,`onPageScroll`,`onRouteDone`,`onTabItemTap`,`onResize`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]),A={};for(let[e,t]of Object.entries(T))typeof t!=`function`||k.has(e)||(A[e]=t,delete T[e]);let j=T.__wevuTemplateRefs;delete T.__wevuTemplateRefs;let M=T.__wevuLayoutHosts;delete T.__wevuLayoutHosts;let N=T[je];delete T[je];let P=T[Me];delete T[Me];let F=T.observers,I=T.setupLifecycle===`created`?`created`:`attached`;delete T.setupLifecycle;let L=T.created;return delete T.features,delete T.created,delete T.onLoad,delete T.onUnload,delete T.onShow,delete T.onHide,delete T.onReady,{userMethods:n,userLifetimes:r,userPageLifetimes:i,userOptions:a,restOptions:T,topLevelMethods:A,templateRefs:j,layoutHosts:M,propsAliases:N,propsDerivedKeys:P,userObservers:F,setupLifecycle:I,legacyCreated:L,isPage:w,features:S,userOnLoad:s,userOnUnload:c,userOnShow:l,userOnHide:u,userOnReady:d,userOnSaveExitState:f,userOnPullDownRefresh:p,userOnReachBottom:m,userOnPageScroll:h,userOnRouteDone:g,userOnTabItemTap:_,userOnResize:v,userOnShareAppMessage:y,userOnShareTimeline:b,userOnAddToFavorites:x,applyExtraInstanceFields:O}}function Ii(e){var t;let n=e.__wevu,r=e[Z];if(!n||!r||typeof n.snapshot!=`function`)return;let i=n.snapshot();sr(i,(t=e[X])==null?e.properties:t,n),er(r,i,n.proxy)}function Li(e){let{restOptions:t,propsAliases:n,propsDerivedKeys:r,userObservers:i}=e,a=t.properties&&typeof t.properties==`object`?Object.keys(t.properties):[],o=new Set(a),s=new Set(r==null?[]:r),c=Object.entries(n==null?{}:n).filter(([e,t])=>e&&t),l=new Set(c.map(([e])=>e)),u=[...s].filter(e=>o.has(e)&&!l.has(e)),d=new Set([Ke,qe,Qe]),f=new WeakMap,p=e=>e.startsWith(`__wv_`),m=e=>{let t=e.__wevu,n=t==null?void 0:t[Me];if(n instanceof Set)for(let e of u)n.add(e)},h=(e,t,n)=>Q(e,t)&&Object.is(e[t],n)?!1:(e[t]=n,!0),g=(e,t,n)=>{var r;if(!d.has(t))return;let i=!1,a=(r=e.__wevu)==null?void 0:r.state;try{a&&typeof a==`object`&&h(a,t,n);let r=e.data;r&&typeof r==`object`&&(i=h(r,t,n))}catch(e){}if(!(!i||typeof e.setData!=`function`))try{e.setData({[t]:n})}catch(e){}},_=(e,t)=>{var n;if(!c.length)return;let r=e.__wevu,i=r==null?void 0:r.setupState,a=r==null?void 0:r.state;if(!i||typeof i!=`object`)return;m(e);let o=(n=f.get(e))==null?new Set:n;f.set(e,o);for(let[e,n]of c){if(Q(i,e)&&!o.has(e))continue;let r=t[n];try{h(i,e,r),o.add(e)}catch(e){}if(a&&typeof a==`object`&&(!Q(a,e)||o.has(e)))try{h(a,e,r)}catch(e){}}},v=(e,t)=>{if(!s.size)return;let n=e.__wevu,r=n==null?void 0:n.setupState;if(!r||typeof r!=`object`)return;m(e);let i=new Map(c);for(let e of s){var a;let n=(a=i.get(e))==null?e:a;if(Q(t,n))try{h(r,e,t[n])}catch(e){}}},y=e=>{try{Object.defineProperty(e,Ne,{value:a,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[Ne]=a}},b=e=>{let t=e[ue];if(!t||typeof t!=`object`)return;let n=t=>{var n;let r=(n=e.__wevu)==null?void 0:n.state;return typeof r==`object`&&!!r&&Q(r,t)},r=e.properties,i=r&&typeof r==`object`?r:void 0,a=Object.keys(t);for(let e of a)if(!i||!Q(i,e)||p(e)||o.has(e)||n(e))try{delete t[e]}catch(e){}if(!i){Ii(e);return}for(let[e,r]of Object.entries(i))if(!(p(e)||o.has(e)||n(e)))try{t[e]=r}catch(e){}Ii(e)},x=e=>{let t=e[X],n=e.properties,r=e[Ae];if(t&&typeof t==`object`&&n&&typeof n==`object`){let i=n,a=Object.keys(t);for(let e of a)if(!Q(i,e))try{delete t[e]}catch(e){}for(let[n,a]of Object.entries(i)){let i=r&&Q(r,n)?r[n]:a;try{t[n]=i}catch(e){}g(e,n,i)}if(r){for(let[n,a]of Object.entries(r))if(!Q(i,n)){try{t[n]=a}catch(e){}g(e,n,a)}}v(e,t),_(e,t),Ii(e)}r&&delete e[Ae],b(e)},S=(e,t)=>{if(!t||typeof t!=`object`)return;let n=e[X];if(!n||typeof n!=`object`)return;let r=!1;for(let i of a)if(Q(t,i)){try{n[i]=t[i],r=!0}catch(e){}g(e,i,t[i])}r&&(v(e,n),_(e,n),Ii(e),b(e))},C=(e,t,n)=>{var r,i;let a=e[X];if(!a||typeof a!=`object`)return;try{a[t]=n}catch(e){}g(e,t,n);let o=(i=(r=e)[Ae])==null?r[Ae]=Object.create(null):i;o[t]=n,v(e,a),_(e,a),Ii(e),b(e)},w={};if(a.length)for(let e of a)w[e]=function(t){C(this,e,t)};let T={...i==null?{}:i};for(let[e,t]of Object.entries(w)){let n=T[e];typeof n==`function`?T[e]=function(...e){n.apply(this,e),t.apply(this,e)}:T[e]=t}let E=T[`**`];return T[`**`]=function(...e){typeof E==`function`&&E.apply(this,e),x(this)},{attachWevuPropKeys:y,directPropsDerivedKeys:u,syncWevuPropsFromInstance:x,syncWevuPropsFromValues:S,finalObservers:T}}function Ri(e){return Array.from(new Set(Array.isArray(e)?e:[e])).filter(e=>typeof e==`string`&&e.length>0)}function zi(e){if(!e||typeof e!=`object`)return[];let t=[],n=typeof e.route==`string`?e.route.replace(/^\/+/,``):``;n&&t.push(`route:${n}`);for(let[n,r]of[[`webview`,`__wxWebviewId__`],[`exparser`,`__wxExparserNodeId__`]]){let i=e[r];(typeof i==`number`||typeof i==`string`)&&t.push(`${n}:${String(i)}`)}return Array.from(new Set(t))}function Bi(){let e=new Map;function t(t,n,r){let i=Ri(t);if(i.length===0||r.length===0)return null;for(let t of r){var a;let r=(a=e.get(t))==null?new Map:a;for(let e of i)r.set(e,n);e.set(t,r)}return i}function n(t,n,r){let i=Ri(t);if(i.length===0||r.length===0)return!1;let a=!1;for(let t of r){let r=e.get(t);if(r){for(let e of i)r.get(e)===n&&(r.delete(e),a=!0);r.size===0&&e.delete(t)}}return a}function r(t,n){return n.map(n=>{var r;return(r=e.get(n))==null?void 0:r.get(t)}).find(Boolean)}function i(e,t,n){var i;let a=r(e,t);return a?(i=n(a,e))==null?null:i:null}function a(e,t,n,r={}){var o,s;let c=(o=r.retries)==null?20:o,l=(s=r.interval)==null?16:s,u=i(e,t(),n);return u||c<=0?Promise.resolve(u):new Promise(i=>{setTimeout(()=>{i(a(e,t,n,{...r,retries:c-1}))},l)})}return{register:t,resolveBridge:r,resolveHost:i,unregister:n,waitForHost:a}}const Vi=Bi();function Hi(){let e=M();return e[e.length-1]}function Ui(e){return zi(e)}function Wi(e){return e&&typeof e.__wevuSetPageLayout==`function`?e:Hi()}function Gi(e){var t,n;if(!e||typeof e!=`object`)return;let r=(t=e[Pe])==null||(t=t.state)==null?void 0:t[J];if(r&&typeof r==`object`)return r;let i=(n=e.$state)==null?void 0:n[J];return i&&typeof i==`object`?i:e[J]&&typeof e[J]==`object`?e[J]:e}function Ki(e){return typeof e==`function`?e():h(e)?e.value:e}function qi(e,t){return e.find(e=>e.key===t)}function Ji(e,t){let n=e==null?void 0:e.selectComponent;if(typeof n!=`function`)return null;try{var r;return(r=n.call(e,t))==null?null:r}catch(e){return null}}function Yi(e,t){var n,r,i,a,o,s,c,l;if(!e.refName)return null;let u=mr(t),d=(n=(r=(i=(a=t[Pe])==null||(a=a.state)==null?void 0:a.$refs)==null?(o=t.__wevu)==null||(o=o.state)==null?void 0:o.$refs:i)==null?(s=t.$state)==null?void 0:s.$refs:r)==null?t.$refs:n,f=(c=u==null||(l=u.get(e.refName))==null?void 0:l.value)==null?d==null?void 0:d[e.refName]:c;if(Array.isArray(f)){var p;return(p=f[0])==null?null:p}return f==null?null:f}function Xi(e,t){let n=Gi(t),r=n&&typeof n==`object`?Object.create(n):{};return Object.assign(r,{selectComponent(r){let i=qi(e,r);if(!i)return null;if(i.kind===`component`||!i.kind){var a,o;return Yi(i,t)||((a=(o=Ji(n,i.selector))==null?Ji(Hi(),i.selector):o)==null?null:a)}return null}})}function Zi(e,t){let n=t==null?I():t,r=Wi(n),i=Ui(r);return!n||!r||i.length===0||!Vi.register(e,n,i)?!1:(n[ve]=i,!0)}function Qi(e,t){var n;let r=t==null?I():t,i=Wi(r),a=(n=r==null?void 0:r[ve])==null?Ui(i):n;if(!r||!Array.isArray(a)||a.length===0)return!1;let o=Vi.unregister(e,r,a);return delete r[ve],o}function $i(e,t){var n,r;let i=(n=Hi())==null?Wi(t):n,a=Vi.resolveBridge(e,Ui(i));return(r=a==null?t:a)==null?I():r}function ea(e,t={}){var n,r;let i=(n=t.context)==null?t.fallbackContext:n,a=(r=Hi())==null?Wi(i):r;return Vi.resolveHost(e,Ui(a),(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)})}function ta(e,t={}){var n;let r=(n=t.context)==null?t.fallbackContext:n;return Vi.waitForHost(e,()=>{var e;return Ui((e=Hi())==null?Wi(r):e)},(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)},t)}function na(e,t={}){if(!D())throw Error(`useLayoutBridge() 必须在 setup() 的同步阶段调用`);let n=I(),r=Ri(e),i=t.resolveComponent,a=Gi(n),o=a&&typeof a==`object`?Object.create(a):{},s=Object.assign(o,{selectComponent(e){var t,a,o;if(!r.includes(e))return null;let s=i==null?void 0:i(e);if(s!==void 0)return s;let c=Gi(n),l=c==null||(t=c.selectComponent)==null?void 0:t.call(c,e);if(l)return l;let u=Hi();return(a=u==null||(o=u.selectComponent)==null?void 0:o.call(u,e))==null?null:a}});Zi(r,s),ee(()=>{Zi(r,s)}),K(()=>{Qi(r,s)})}function ra(e,t){if(!e.length)return null;let n=t==null?I():t;if(!n)return null;let r=Xi(e,n);return Zi(e.map(e=>e.key),r),r}function ia(e,t){if(!e.length)return!1;let n=t==null?I():t;return n?Qi(e.map(e=>e.key),n):!1}function aa(e){na(Object.keys(e),{resolveComponent(t){return Ki(e[t])}})}function oa(e){let{runtimeApp:t,watch:n,setup:r,restOptions:i,pageLifecycleHooks:a,finalObservers:o,userLifetimes:s,userPageLifetimes:c,finalMethods:l,finalOptions:u,applyExtraInstanceFields:d,templateRefs:f,layoutHosts:p,attachWevuPropKeys:m,setupLifecycle:h,syncWevuPropsFromInstance:g,directPropsDerivedKeys:_,isPage:v,legacyCreated:y,getRuntimeOwnerLabel:b}=e,x={},S=e=>{if(!Array.isArray(p)||!p.length||e[ye])return;let t=ra(p,e);t&&(e[ye]=t)},C=e=>{v&&(e[De]=(t,n)=>{var r;let i=(r=e.__wevu)==null?void 0:r.state;if(!i||typeof i!=`object`)return;i[Te]=Zn(t);let a=t===!1||n==null?{}:n;i[Ee]=a,Jn(e,t,a)})};if(v)for(let e of[`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=a[e];typeof t==`function`&&typeof l[e]!=`function`&&(x[e]=function(...e){return t.apply(this,e)})}Component({...i,...a,observers:o,lifetimes:{...s,created:function(...e){if(d(this),Array.isArray(f)&&f.length&&Object.defineProperty(this,et,{value:f,configurable:!0,enumerable:!1,writable:!1}),m(this),h===`created`){try{vi(this,t,n,r,{deferSetData:!0,snapshotOmitKeys:_})}catch(e){let t=b(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}g(this),C(this)}typeof y==`function`&&y.apply(this,e),typeof s.created==`function`&&s.created.apply(this,e)},moved:function(...e){N(this,`onMoved`,e),typeof s.moved==`function`&&s.moved.apply(this,e)},attached:function(...e){if(d(this),Array.isArray(f)&&f.length&&!this[et]&&Object.defineProperty(this,et,{value:f,configurable:!0,enumerable:!1,writable:!1}),m(this),h!==`created`||!this.__wevu)try{vi(this,t,n,r,{snapshotOmitKeys:_})}catch(e){let t=b(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}g(this),C(this),S(this),h===`created`&&bi(this),N(this,`onAttached`,e),typeof s.attached==`function`&&s.attached.apply(this,e)},ready:function(...e){if(v&&typeof a.onReady==`function`){a.onReady.call(this,...e),typeof s.ready==`function`&&s.ready.apply(this,e);return}if(!this[Fe]){this[Fe]=!0,g(this),wr(this,()=>{N(this,`onReady`,e),typeof s.ready==`function`&&s.ready.apply(this,e)});return}typeof s.ready==`function`&&s.ready.apply(this,e)},detached:function(...e){if(N(this,`onDetached`,e),v&&typeof a.onUnload==`function`){a.onUnload.call(this,...e),typeof s.detached==`function`&&s.detached.apply(this,e);return}Tr(this),Array.isArray(p)&&p.length&&this[ye]&&(ia(p,this[ye]),delete this[ye]),Si(this),typeof s.detached==`function`&&s.detached.apply(this,e)},error:function(...e){N(this,`onError`,e),typeof s.error==`function`&&s.error.apply(this,e)}},pageLifetimes:{...c,show:function(...e){if(v&&typeof a.onShow==`function`){a.onShow.call(this,...e),typeof c.show==`function`&&c.show.apply(this,e);return}xi(this,!0),N(this,`onShow`,e),typeof c.show==`function`&&c.show.apply(this,e)},hide:function(...e){if(v&&typeof a.onHide==`function`){a.onHide.call(this,...e),typeof c.hide==`function`&&c.hide.apply(this,e);return}xi(this,!1),N(this,`onHide`,e),typeof c.hide==`function`&&c.hide.apply(this,e)},resize:function(...e){if(v&&typeof a.onResize==`function`){a.onResize.call(this,...e),typeof c.resize==`function`&&c.resize.apply(this,e);return}N(this,`onResize`,e),typeof c.resize==`function`&&c.resize.apply(this,e)},routeDone:function(...e){if(v&&typeof a.onRouteDone==`function`){a.onRouteDone.call(this,...e),typeof c.routeDone==`function`&&c.routeDone.apply(this,e);return}N(this,`onRouteDone`,e),typeof c.routeDone==`function`&&c.routeDone.apply(this,e)}},methods:{...x,...l},options:u})}function sa(e,t,n,r,i){var a;let{userMethods:o,userLifetimes:s,userPageLifetimes:c,userOptions:l,restOptions:u,topLevelMethods:d,templateRefs:f,layoutHosts:p,propsAliases:m,propsDerivedKeys:h,userObservers:g,setupLifecycle:_,legacyCreated:v,isPage:y,features:b,userOnLoad:x,userOnUnload:S,userOnShow:C,userOnHide:w,userOnReady:T,userOnSaveExitState:E,userOnPullDownRefresh:D,userOnReachBottom:O,userOnPageScroll:k,userOnRouteDone:A,userOnTabItemTap:j,userOnResize:M,userOnShareAppMessage:N,userOnShareTimeline:P,userOnAddToFavorites:F,applyExtraInstanceFields:I}=Fi(i),{enableOnPullDownRefresh:L,enableOnReachBottom:R,enableOnPageScroll:z,enableOnRouteDone:B,enableOnRouteDoneFallback:V,enableOnTabItemTap:H,enableOnResize:U,enableOnShareAppMessage:W,enableOnShareTimeline:G,enableOnAddToFavorites:ee,enableOnSaveExitState:te,effectiveOnSaveExitState:K,effectiveOnPullDownRefresh:ne,effectiveOnReachBottom:re,effectiveOnPageScroll:ie,effectiveOnRouteDone:q,effectiveOnTabItemTap:ae,effectiveOnResize:oe,effectiveOnShareAppMessage:se,effectiveOnShareTimeline:ce,effectiveOnAddToFavorites:le}=ki({features:b,userOnSaveExitState:E,userOnPullDownRefresh:D,userOnReachBottom:O,userOnPageScroll:k,userOnRouteDone:A,userOnTabItemTap:j,userOnResize:M,userOnShareAppMessage:N,userOnShareTimeline:P,userOnAddToFavorites:F}),ue=(e,t)=>{let n=e[me];if(!n)return!1;let r=n[t];return r?Array.isArray(r)?r.length>0:typeof r==`function`:!1};{let e=u.export;u.export=function(){var t;let n=(t=this[fe])==null?{}:t,r=typeof e==`function`?e.call(this):{};return r&&typeof r==`object`&&!Array.isArray(r)?{...n,...r}:r==null?n:r}}let de={multipleSlots:(a=l.multipleSlots)==null||a,...l},{attachWevuPropKeys:pe,directPropsDerivedKeys:he,syncWevuPropsFromInstance:ge,syncWevuPropsFromValues:_e,finalObservers:ve}=Li({restOptions:u,propsAliases:m,propsDerivedKeys:h,userObservers:g}),{finalMethods:ye}=Mi({userMethods:{...d,...o},runtimeMethods:t});oa({runtimeApp:e,watch:n,setup:r,restOptions:u,pageLifecycleHooks:ji({runtimeApp:e,watch:n,setup:r,userOnLoad:x,userOnUnload:S,userOnShow:C,userOnHide:w,userOnReady:T,isPage:y,enableOnSaveExitState:te,enableOnPullDownRefresh:L,enableOnReachBottom:R,enableOnPageScroll:z,enableOnRouteDone:B,enableOnRouteDoneFallback:V,enableOnTabItemTap:H,enableOnResize:U,enableOnShareAppMessage:W,enableOnShareTimeline:G,enableOnAddToFavorites:ee,syncWevuPropsFromValues:_e,effectiveOnSaveExitState:K,effectiveOnPullDownRefresh:ne,effectiveOnReachBottom:re,effectiveOnPageScroll:ie,effectiveOnRouteDone:q,effectiveOnTabItemTap:ae,effectiveOnResize:oe,effectiveOnShareAppMessage:se,effectiveOnShareTimeline:ce,effectiveOnAddToFavorites:le,hasHook:ue}),finalObservers:ve,userLifetimes:s,userPageLifetimes:c,finalMethods:ye,finalOptions:de,applyExtraInstanceFields:I,templateRefs:f,layoutHosts:p,attachWevuPropKeys:pe,setupLifecycle:_,syncWevuPropsFromInstance:ge,syncWevuPropsFromValues:_e,directPropsDerivedKeys:he,isPage:y,legacyCreated:v,getRuntimeOwnerLabel:Pi})}function ca(e){let{[pn]:t,data:n,computed:r,methods:i,setData:a,watch:o,setup:s,...c}=e.__wevuDefaultsScope===`component`?e:xn(e),l=i==null?{}:i,u=r==null?{}:r,d=new Set,f=new Set,p=!1,m={globalProperties:{}},h={mount:fn({data:n,resolvedComputed:u,resolvedMethods:l,appConfig:m,setDataOptions:a}),use(e,...t){if(!e||d.has(e))return h;if(d.add(e),typeof e==`function`)e(h,...t);else if(typeof e.install==`function`)e.install(h,...t);else throw TypeError(`插件必须是函数,或包含 install 方法的对象`);return h},provide(e,t){return ne(h,e,t),h},onUnmount(e){if(typeof e!=`function`)throw TypeError(`onUnmount 只接受函数`);return p?(e(),h):(f.add(e),h)},unmount(){if(!p){p=!0;for(let e of f)e();f.clear()}},config:m,version:gt},g=typeof App==`function`;try{oe(h),Object.defineProperty(h,"__wevuSetDataOptions",{value:a,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(h,"__wevuHasTemplateRuntimeBindings",{value:Object.keys(u).some(e=>e.startsWith(`__wv_bind_`)),configurable:!0,enumerable:!1,writable:!1})}catch(e){h.__wevuSetDataOptions=a,h.__wevuHasTemplateRuntimeBindings=Object.keys(u).some(e=>e.startsWith(`__wv_bind_`))}if(g){let e=k(),t=`__wevuAppRegistered`;e&&e[t]||(e&&(e[t]=!0),Oi(h,i==null?{}:i,o,s,c))}return h}var la=class extends Error{};function ua(e){if(typeof e==`function`)return e;let t=e==null?void 0:e.get;return typeof t==`function`?t:void 0}function da(e){return e.startsWith(`__wv_bind_`)||e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`)}function fa(e,t){if(!e.startsWith(`__wv_bind_`))return!1;try{return!/\bthis\b/.test(Function.prototype.toString.call(t))}catch(e){return!1}}function pa(e){if(e===Z)return``;if(e.startsWith(`__wv_bind_`))return null;if(e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`))return``}function ma(e,t){let n=Array.isArray(t==null?void 0:t.pick)?t.pick:[];if(!n.length)return;let r=new Set(Array.isArray(t==null?void 0:t.omit)?t.omit:[]),i={};for(let t of n){if(r.has(t)||Q(e,t))continue;let n=pa(t);n!==void 0&&(i[t]=n)}return Object.keys(i).length?i:void 0}function ha(e){let{data:t,computed:n,setData:r}=e,i=n?Object.keys(n):[];if(!i.length)return;let{includeComputed:a,shouldIncludeKey:o,toPlainMaxDepth:s,toPlainMaxKeys:c,includeFunctions:l,functionPaths:u}=ln(r);if(!a)return;let d={},f=new Set,p,m=e=>{if(Q(t,e)||!o(e))return{ok:!1};if(Q(d,e))return{ok:!0,value:d[e]};if(f.has(e))return{ok:!1};let r=ua(n[e]);if(!r)return{ok:!1};f.add(e);try{let t=r.call(p);if(t===void 0)return{ok:!1};let n=Ht(t,new WeakMap,{maxDepth:s,maxKeys:c,includeFunctions:l,functionPaths:u,_path:e});return n===void 0?{ok:!1}:(d[e]=n,{ok:!0,value:n})}catch(e){return{ok:!1}}finally{f.delete(e)}};p=new Proxy(t,{get(e,r,i){if(typeof r==`string`){if(r===`data`||r===`$state`)return t;if(r===`props`||r===`$props`||r===`$attrs`)throw new la;if(Q(t,r))return Reflect.get(e,r,i);if(n&&Q(n,r)){let e=m(r);if(e.ok)return e.value;throw new la}throw new la}return Reflect.get(e,r,i)},has(e,t){return Reflect.has(e,t)||typeof t==`string`&&!!(n&&Q(n,t))}});for(let e of i){let t=ua(n[e]);da(e)&&(!t||!fa(e,t))||m(e)}return Object.keys(d).length?d:void 0}function ga(e,t,n){if(!e||typeof e!=`object`)return e;let r=ha({data:e,computed:t,setData:n}),i=ma(e,n);return r||i?{...e,...i,...r}:e}const _a=`__wevu_allowNullPropInput`,va=`allowNullPropInput`,ya=new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function ba(e){return ya.get(e)}function xa(e){if(e===void 0)return[];let t=Array.isArray(e)?e:[e],n=[];t.forEach(e=>{let t=ba(e);t!==void 0&&(n.includes(t)||n.push(t))});let r=n.filter(e=>e!==null);return r.length>0?r:(n.includes(null),[null])}function Sa(e,t){let n=xa(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function Ca(e,t){if(t===void 0||e.type===t)return;let n=Array.isArray(e.optionalTypes)?[...e.optionalTypes]:[];n.includes(t)||(n.push(t),e.optionalTypes=n)}function wa(e){if(!Array.isArray(e))return[];let t=[];return e.forEach(e=>{let n=ba(e);n==null||t.includes(n)||t.push(n)}),t}function Ta(e,t){if(e===void 0)return;if(e===null)return{type:null};if(Array.isArray(e)||typeof e==`function`){let n={};return Sa(n,e),t&&n.type!==null&&Ca(n,null),Q(n,`type`)||(n.type=null),n}if(typeof e!=`object`)return e;let n={...e};if(`type`in n){var r;let e=xa(n.type);n.type=(r=e[0])==null?null:r;let t=wa(n.optionalTypes);for(let n of e.slice(1))n!==null&&!t.includes(n)&&t.push(n);t.length>0?n.optionalTypes=t:delete n.optionalTypes}return Q(n,`type`)||(n.type=null),t&&n.type!==null&&Ca(n,null),n}function Ea(e,t){let n={};return Object.entries(e).forEach(([e,r])=>{let i=Ta(r,t);i!==void 0&&(n[e]=i)}),n}function Da(e,t){let n={};return e&&Object.entries(e).forEach(([e,r])=>{if(r!==void 0){if(r===null){n[e]={type:null};return}if(Array.isArray(r)||typeof r==`function`){let i={};Sa(i,r),t&&i.type!==null&&Ca(i,null),Q(i,`type`)||(i.type=null),n[e]=i;return}if(typeof r==`object`){if(e.endsWith(`Modifiers`)&&Object.keys(r).length===0){n[e]={type:Object,value:{}};return}let i={};if(`type`in r&&r.type!==void 0&&Sa(i,r.type),Array.isArray(r.optionalTypes)){let e=r.optionalTypes.map(e=>ba(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(i.optionalTypes)?i.optionalTypes:[];for(let n of e)n!==i.type&&(t.includes(n)||t.push(n));t.length>0&&(i.optionalTypes=t)}}`observer`in r&&(typeof r.observer==`function`||typeof r.observer==`string`)&&(i.observer=r.observer);let a=`default`in r?r.default:r.value;a!==void 0&&(i.value=typeof a==`function`?a():a),t&&i.type!==null&&Ca(i,null),Q(i,`type`)||(i.type=null),n[e]=i}}}),n}function Oa(e,t,n){var r;let i=!!((r=e[_a])==null?e[va]:r),{[_a]:a,[va]:o,...s}=e,c=e.properties,l=c&&typeof c==`object`&&Object.keys(c).length>0?c:void 0,u=n==null?l:n,d=!!(t||u),f=e=>{let t={...e==null?{}:e};return d?(Q(t,qe)||(t[qe]={type:String,value:``}),Q(t,Qe)||(t[Qe]={type:null,value:null}),Q(t,Ke)||(t[Ke]={type:null,value:null}),t):t};if(u){let{properties:e,...n}=s,r=u?i?Ea(u,i):u:void 0,a=Da(t,i);return{...n,properties:f({...a,...r})}}return{...s,properties:f(Da(t,i))}}const ka=[Z,qe,Ye,Je,Xe,Ze,Qe],Aa=/&/g,ja=/"/g,Ma=/"/g,Na=/'/g,Pa=/'/g,Fa=/</g,Ia=/>/g;function La(e){return e.replace(Aa,`&`).replace(ja,`"`).replace(Ma,`"`).replace(Na,`'`).replace(Pa,`'`).replace(Fa,`<`).replace(Ia,`>`)}function Ra(e){var t,n,r,i;let a=zn((t=(n=e==null||(r=e.currentTarget)==null?void 0:r.dataset)==null?e==null||(i=e.target)==null?void 0:i.dataset:n)==null?{}:t,`wvArgs`,e),o=[];if(Array.isArray(a))o=a;else if(typeof a==`string`)try{o=JSON.parse(a)}catch(e){try{o=JSON.parse(La(a))}catch(e){o=[]}}return Array.isArray(o)||(o=[]),o.map(t=>t===`$event`?e:t)}function za(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}function Ba(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[Pe])==null?void 0:i.proxy:n)==null?e:t}function Va(e,t){if(!t||Object.keys(t).length===0)return;let n=Ba(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function Ha(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function Ua(e,t){Ha(e);let n=Va(e,t);n&&Object.keys(n).length>0&&typeof(e==null?void 0:e.setData)==`function`&&e.setData(n)}function Wa(e,t){var n,r,i;let a=Q(t==null?{}:t,Qe)?t[Qe]:e==null||(n=e.properties)==null?void 0:n[Qe],o=Q(t==null?{}:t,Ze)?t[Ze]:e==null||(r=e.properties)==null?void 0:r[Ze],s=za(a),c=za(o),l={...s,...c};e[Xe]=l;let u=e==null||(i=e.__wevu)==null?void 0:i.state;return u&&typeof u==`object`&&(u[Xe]=l),l}function Ga(e,t,n){let r=Wa(e,n);typeof(e==null?void 0:e.setData)==`function`&&e.setData({[Xe]:r}),Ua(e,t)}function Ka(e,t){var n;e[Ye]=t;let r=e==null?void 0:e.data;if(r&&typeof r==`object`)try{Object.defineProperty(r,Ye,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){r[Ye]=t}let i=e==null||(n=e.__wevu)==null?void 0:n.state;i&&typeof i==`object`&&(i[Ye]=t)}function qa(e,t,n,r){var i;Ka(e,n),Wa(e),e[Je]=t||{};let a=e==null||(i=e.__wevu)==null?void 0:i.state;a&&typeof a==`object`&&(a[Je]=t||{}),typeof(e==null?void 0:e.setData)==`function`&&e.setData({[Je]:t||{}}),Ua(e,r)}function Ja(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,Ka(e,void 0);return}let r=(t,r)=>{qa(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=nr(t,r));let i=ir(t);i&&r(i,rr(t))}function Ya(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[qe])==null?e==null||(i=e.properties)==null?void 0:i[Z]:n)==null?``:t}function Xa(e,t){Ga(e,t);let n=Ya(e);n&&Ja(e,n,t)}function Za(){let e={[Je]:{},[Xe]:{}};return Object.defineProperty(e,Ye,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function Qa(e){let t=e==null?void 0:e.computed,n={options:{virtualHost:!0},setData:{omit:ka},[Me]:ka,properties:{[qe]:{type:String,value:``,observer(e){Ja(this,e||``,t)}},[Z]:{type:String,value:``,observer(e){Ja(this,e||``,t)}},[Ze]:{type:null,value:null,observer(e){Ga(this,t,{[Ze]:e})}},[Qe]:{type:null,value:null,observer(e){Ga(this,t,{[Qe]:e})}}},data:Za,lifetimes:{attached(){Xa(this,t)},ready(){Xa(this,t)},detached(){typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``,Ka(this,void 0)}},methods:{[we](e){var t,n,r,i,a;let o=this[Ye],s=Wn(o,void 0,e,(t=this.__wevu)==null||(t=t.methods)==null?void 0:t[ge]);if(s!==void 0)return s;if(!o)return;let c=zn((n=(r=e==null||(i=e.currentTarget)==null?void 0:i.dataset)==null?e==null||(a=e.target)==null?void 0:a.dataset:r)==null?{}:n,`wvHandler`,e);if(typeof c!=`string`||!c)return;let l=o==null?void 0:o[c];if(typeof l!=`function`)return;let u=Ra(e);return l.apply(o,u)}}};return e!=null&&e.computed&&Object.keys(e.computed).length>0&&(n.computed=e.computed),e!=null&&e.inlineMap&&Object.keys(e.inlineMap).length>0&&(n.methods={...n.methods,[ge]:e.inlineMap}),n}function $a(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function eo(e){return typeof e!=`object`||!e||h(e)||m(e)||Array.isArray(e)?!0:$a(e)}function to(e,t,n,r){var i,a,o;let s=!!(r!=null&&r.includeFunctionsInState),c=r==null?void 0:r.functionPropPaths,l=(i=e==null?void 0:e.methods)==null?Object.create(null):i,u=(a=e==null?void 0:e.state)==null?Object.create(null):a,d=(o=e==null?void 0:e.setupState)==null?Object.create(null):o,f=m(u)?b(u):u,p=!1;if(e&&!e.methods)try{e.methods=l}catch(e){}if(e&&!e.state)try{e.state=u}catch(e){}if(e&&!e.setupState)try{e.setupState=d}catch(e){}if(Object.keys(n).forEach(r=>{let i=n[r];if(typeof i==`function`){let t=(...t)=>{var n;return i.apply((n=e==null?void 0:e.proxy)==null?e:n,t)};l[r]=t,u[r]=t,(s||c!=null&&c.has(r))&&(d[r]=t),p=!0}else{if(kt(i)){var a;e==null||(a=e.__wevu_trackSetupReactiveKey)==null||a.call(e,r)}if(u[r]=i,i===t||!eo(i))try{Object.defineProperty(f,r,{value:i,configurable:!0,enumerable:!1,writable:!0})}catch(e){}d[r]=i}}),e){var h,g;if(e.methods=(h=e.methods)==null?l:h,e.state=(g=e.state)==null?u:g,p){var _;(_=e.__wevu_touchSetupMethodsVersion)==null||_.call(e)}}}let no;function ro(){let e=E();if(!e)return;let t=e;no&&t[Ve]!==no&&(t[Ve]=no)}function io(e,t){return!!e.__wevu_isPage&&Array.isArray(t==null?void 0:t.pick)&&t.pick.includes(Z)}function ao(e){return Array.isArray(e==null?void 0:e.pick)&&e.pick.includes(Z)}function oo(e){let t=e.properties;return!!(t&&typeof t==`object`&&(qe in t||Qe in t))}function so(e,t){return(t==null?void 0:t.strategy)!==`patch`||!oo(e)?t:{...t,strategy:`diff`}}function co(e){ro();let{__typeProps:t,data:n,computed:r,methods:i,setData:a,watch:o,setup:s,props:c,allowFunctionProps:l,...u}=Sn(e),d=u[pe],f=Array.isArray(d)?[...new Set(d.filter(e=>typeof e==`string`&&e.length>0))]:[];delete u[pe];let p=so(u,l===!0?{...a==null?{}:a,includeFunctions:!0,functionPaths:f}:l===!1?a:f.length?{...a==null?{}:a,functionPaths:f}:a),m=new Set(f.filter(e=>!e.includes(`.`))),h=ca({data:n,computed:r,methods:i,setData:p,[pn]:`component`}),g=typeof s==`function`?((e,t)=>{let n=qr(s,e,t);return n&&t&&to(t.runtime,t.instance,n,{includeFunctionsInState:l===!0,functionPropPaths:l===!1?void 0:m}),n}):void 0,_=typeof n==`function`?n():n,v=ga(ao(p)?{..._&&typeof _==`object`?_:{},[Z]:io(u,p)?(_==null?void 0:_[Z])||$n():(_==null?void 0:_[Z])||``}:_,r,p),y=Oa(v===void 0?u:{...u,data:v},c),b={data:n,computed:r,methods:i,setData:p,watch:o,setup:g,mpOptions:y};return sa(h,i==null?{}:i,o,g,y),{__wevu_runtime:h,__wevu_options:b}}function lo(e){var t;ro();let{properties:n,props:r,...i}=e;co(Oa({...i,allowNullPropInput:(t=i.allowNullPropInput)==null||t,__wevu_allowNullPropInput:!0},r,n))}function uo(e){lo(Qa(e))}no=uo,ro();const fo=[`dispose`,`abort`,`cancel`,`stop`,`disconnect`,`destroy`,`close`];function po(e){if(e){if(typeof e==`function`)return e;for(let t of fo){let n=e[t];if(typeof n==`function`)return()=>n.call(e)}}}function mo(){if(!I())throw Error(`useDisposables() 必须在 setup() 的同步阶段调用`);let e=new Set,t=!1,n=n=>{let r=po(n);if(!r)return()=>{};if(t){try{r()}catch(e){}return()=>{}}return e.add(r),()=>{e.delete(r)}},r=()=>{if(t)return;t=!0;let n=[...e];e.clear();for(let e of n)try{e()}catch(e){}};return ce(r),K(r),{add:n,dispose:r,setTimeout:(e,t,...r)=>{let i=setTimeout(e,t,...r);return n(()=>{clearTimeout(i)}),i},setInterval:(e,t,...r)=>{let i=setInterval(e,t,...r);return n(()=>{clearInterval(i)}),i}}}function ho(e,t){let n=e,r=n.createIntersectionObserver;if(typeof r==`function`)return r.call(n,t);if(!z(`globalCreateIntersectionObserver`))return;let i=k(),a=i==null?void 0:i.createIntersectionObserver;if(typeof a==`function`)return A().intersectionObserverScopeByParameter?a.call(i,e,t):a.call(i,t)}function go(e,t){var n;if(t===!1||typeof e.relativeToViewport!=`function`)return e;let r=t&&typeof t==`object`?t:void 0;return(n=e.relativeToViewport(r))==null?e:n}function _o(e){var t;let n=(t=e.context)==null?I():t;if(!n||!D())throw Error(`useElementIntersectionObserver() 必须在 setup() 的同步阶段调用`);let r=null,a=()=>{if(r){try{r.disconnect()}catch(e){}r=null}},o=()=>{var t,i;a();let o=u(e.selector);if(!(e.enabled==null||u(e.enabled))||!o)return null;let s=ho(n,u((t=e.observerOptions)==null?{}:t));return!s||typeof s.observe!=`function`?null:(r=go(s,(i=e.relativeToViewport)==null||i),r.observe(o,t=>{var n;return(n=e.onObserve)==null?void 0:n.call(e,t)}),r)};return i(()=>{var t;return[u(e.selector),e.enabled==null||u(e.enabled),u((t=e.observerOptions)==null?{}:t),e.relativeToViewport]},()=>{o()},{deep:!0}),at(o),ct(a),ce(a),K(a),{disconnect:a,observe:o,get observer(){return r}}}function vo(e,t){let n=e,r=n.createIntersectionObserver;if(typeof r==`function`)return r.call(n,t)}function yo(e,t){if(!z(`globalCreateIntersectionObserver`))return;let n=k(),r=n==null?void 0:n.createIntersectionObserver;if(typeof r==`function`)return A().intersectionObserverScopeByParameter?r.call(n,e,t):r.call(n,t)}function bo(e={}){var t;let n=I();if(!n)throw Error(`useIntersectionObserver() 必须在 setup() 的同步阶段调用`);let r=(t=vo(n,e))==null?yo(n,e):t;if(!r||typeof r.disconnect!=`function`)throw Error(`当前运行环境不支持 IntersectionObserver,请检查基础库版本或平台能力`);let i=!1,a=()=>{if(!i){i=!0;try{r.disconnect()}catch(e){}}};return ce(a),K(a),r}function xo(e){var t,n;return e?(t=(n=e.split(`?`)[0])==null?void 0:n.replace(/^\/+/,``))==null?``:t:``}function So(){let e=M(),t=e[e.length-1],n=e.length||1;return{canGoBack:n>1,currentRoute:xo(t==null?void 0:t.route),stackLength:n}}function Co(e={}){var t;if(!D())throw Error(`usePageStack() 必须在 setup() 的同步阶段调用`);let n=So(),r=f(n.currentRoute),i=f(n.stackLength),a=T(()=>i.value>1),o=()=>{let e=So();r.value=e.currentRoute,i.value=e.stackLength};return((t=e.autoRefresh)==null||t)&&(ee(o),V(o)),{canGoBack:a,currentRoute:r,refresh:o,stackLength:i}}function wo(e={}){var t,n;let r=(t=e.defaultStatusBarHeight)==null?20:t,i=(n=e.defaultNavigationBarHeight)==null?44:n,a=k(),o=typeof(a==null?void 0:a.getSystemInfoSync)==`function`?a.getSystemInfoSync():{},s=Number((o==null?void 0:o.statusBarHeight)||r),c;try{c=typeof(a==null?void 0:a.getMenuButtonBoundingClientRect)==`function`?a.getMenuButtonBoundingClientRect():void 0}catch(e){}let l=Number((c==null?void 0:c.top)||0),u=Number((c==null?void 0:c.height)||0),d=l>s&&u>0?(l-s)*2+u:i;return{navigationBarHeight:d,navigationHeight:s+d,statusBarHeight:s}}function To(e={}){var t;if(!D())throw Error(`useNavigationBarMetrics() 必须在 setup() 的同步阶段调用`);let n=wo(e),r=f(n.statusBarHeight),i=f(n.navigationBarHeight),a=T(()=>r.value+i.value),o=()=>{let t=wo(e);r.value=t.statusBarHeight,i.value=t.navigationBarHeight};return((t=e.autoRefresh)==null||t)&&ee(o),{navigationBarHeight:i,navigationHeight:a,refresh:o,statusBarHeight:r}}function Eo(e){return typeof e!=`number`||!Number.isFinite(e)?80:Math.max(0,e)}function Do(e){if(!(typeof e!=`number`||!Number.isFinite(e)))return Math.max(0,e)}function Oo(e,t={}){var n,r;if(!I())throw Error(`usePageScrollThrottle() 必须在 setup() 的同步阶段调用`);if(typeof e!=`function`)throw TypeError(`usePageScrollThrottle() 需要传入回调函数`);let i=Eo(t.interval),a=(n=t.leading)==null||n,o=(r=t.trailing)==null||r,s=Do(t.maxWait),c,l,u=!1,d=0,f,p=()=>{c&&(clearTimeout(c),c=void 0)},m=()=>{l&&(clearTimeout(l),l=void 0)},h=t=>{p(),m(),f=void 0,d=Date.now(),e(t)},g=()=>{let e=f;f=void 0,c=void 0,!(!e||u)&&h(e)},_=()=>{let e=f;l=void 0,!(!e||u)&&h(e)},v=e=>{if(!o||c)return;let t=Math.max(0,i-(e-(d===0?e:d)));c=setTimeout(g,t)},y=e=>{if(typeof s!=`number`||l)return;let t=s-(e-(d===0?e:d));if(t<=0){_();return}l=setTimeout(_,t)};ae(e=>{if(u)return;if(i===0){h(e);return}let t=Date.now();if(f=e,a&&(d===0||t-d>=i)){h(e);return}if(typeof s==`number`&&t-(d===0?t:d)>=s){h(e);return}!o&&typeof s!=`number`||(v(t),y(t))});let b=()=>{u||(u=!0,f=void 0,p(),m())};return ce(b),K(b),b}function ko(e,t={}){te(async()=>{try{await e()}catch(e){var n;await((n=t.onError)==null?void 0:n.call(t,e))}finally{var r;await((r=t.stopPullDownRefresh)==null?(()=>it.stopPullDownRefresh()):r)()}})}function Ao(e,t){let n=t==null?I():t;if(!n||!D())throw Error(`${e}() 必须在 setup() 的同步阶段调用`);return n}function jo(e,t,n,r){let i=vr(e);return!i||!t?Promise.resolve(null):(r(n?i.selectAll(t):i.select(t)),new Promise(e=>{i.exec(t=>{let n=Array.isArray(t)?t[0]:null;e(n==null?null:n)})}))}function Mo(e={}){let t=Ao(`useSelectorQuery`,e.context);return()=>vr(t)}function No(e={}){var t;let n=Ao(`useBoundingClientRect`,e.context),r=(t=e.all)!=null&&t;return e=>jo(n,e,r,e=>e.boundingClientRect())}function Po(e){var t;let n=Ao(`useSelectorFields`,e.context),r=(t=e.all)!=null&&t;return t=>jo(n,t,r,t=>t.fields(e.fields))}function Fo(e={}){var t;let n=Ao(`useScrollOffset`,e.context),r=(t=e.all)!=null&&t;return e=>jo(n,e,r,e=>e.scrollOffset())}function Io(e){let t=e,n=t.setUpdatePerformanceListener;if(typeof n==`function`)return e=>{n.call(t,e)}}function Lo(e){let t=I();if(!t)throw Error(`useUpdatePerformanceListener() 必须在 setup() 的同步阶段调用`);if(typeof e!=`function`)throw TypeError(`useUpdatePerformanceListener() 需要传入监听函数`);let n=Io(t);if(!n)throw Error(`当前实例不支持 setUpdatePerformanceListener,请检查基础库版本或组件上下文`);n(e);let r=!1,i=()=>{if(!r){r=!0;try{n(void 0)}catch(e){}}};return ce(i),K(i),i}function Ro(){let e=I();if(e!=null&&e[_e]&&e[ze])return e[ze];throw Error(`defineAppSetup() / use() 只能在 app setup 上下文中调用`)}function zo(e){return e(Ro())}function Bo(e,...t){return Ro().use(e,...t)}const Vo=Object.freeze(Object.create(null));function Ho(){var e;let t=D();if(!t)throw Error(`useAttrs() 必须在 setup() 的同步阶段调用`);return(e=t.attrs)==null?{}:e}function Uo(){var e;let t=D();if(!t)throw Error(`useSlots() 必须在 setup() 的同步阶段调用`);return(e=t.slots)==null?Vo:e}function Wo(){let e=D();if(!(e!=null&&e.instance))throw Error(`useNativeInstance() 必须在 setup() 的同步阶段调用`);return e.instance}const Go=Object.freeze(Object.create(null));function Ko(e,t){let n=t===`modelValue`?`modelModifiers`:`${t}Modifiers`,r=e==null?void 0:e[n];return!r||typeof r!=`object`?Go:r}function qo(e,t){let n=e;try{Object.defineProperty(n,Symbol.iterator,{configurable:!0,value:()=>{let e=0;return{next:()=>e===0?(e+=1,{value:n,done:!1}):e===1?(e+=1,{value:t(),done:!1}):{value:void 0,done:!0}}}})}catch(e){}return n}function Jo(e,t,n={}){let r=D();if(!r)throw Error(`useModel() 必须在 setup() 的同步阶段调用`);let i=r.emit,a=`update:${t}`,o=()=>Ko(e,t);return qo(y({get:()=>{let r=e==null?void 0:e[t];return n.get?n.get(r,o()):r},set:e=>{let t=n.set?n.set(e,o()):e;i==null||i(a,t)}}),o)}function Yo(e){let t=I();if(!(t!=null&&t.__wevu)||typeof t.__wevu.bindModel!=`function`)throw Error(`useBindModel() 必须在 setup() 的同步阶段调用`);let n=t.__wevu.bindModel.bind(t.__wevu),r=((t,r)=>{if(!e)return n(t,r);let i={...e,...r};return n(t,i)});return r.model=(e,t)=>r(e).model(t),r.value=(t,n)=>{var i;let a={...e,...n},o=(i=a==null?void 0:a.valueProp)==null?`value`:i;return r.model(t,n)[o]},r.on=(t,n)=>{var i;let a={...e,...n},o=`on${_t((i=a==null?void 0:a.event)==null?`input`:i)}`;return r.model(t,n)[o]},r}function Xo(){let e=Yo({event:`change`});return function(t,n){return e.model(t,n)}}function Zo(e,t){return e==null?t:t==null?e:Array.isArray(e)&&Array.isArray(t)?[...new Set([...e,...t])]:typeof e==`object`&&typeof t==`object`?{...e,...t}:t}function Qo(e){let t=e[nt];if(t)return t;let n=new Map;try{Object.defineProperty(e,nt,{value:n,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[nt]=n}return n}function $o(e){let n=I();if(!n)throw Error(`useTemplateRef() 必须在 setup() 的同步阶段调用`);let r=typeof e==`string`?e.trim():``;if(!r)throw Error(`useTemplateRef() 需要传入有效的模板 ref 名称`);let i=Qo(n),a=i.get(r);if(a)return a;let o=t(null);return i.set(r,o),o}export{gt as $,Zi as A,vi as B,_o as C,co as D,uo as E,ia as F,Xn as G,Si as H,na as I,qn as J,Jn as K,aa as L,$i as M,ea as N,ca as O,Qi as P,$ as Q,ta as R,bo as S,lo as T,qr as U,xi as V,Zn as W,yn as X,bn as Y,zt as Z,Oo as _,Jo as a,pt as at,To as b,Uo as c,mt as ct,Lo as d,ht as et,No as f,ko as g,Mo as h,Xo as i,ut as it,ra as j,sa as k,zo as l,ct as lt,Po as m,Zo as n,lt as nt,Ho as o,dt as ot,Fo as p,Yn as q,Yo as r,st as rt,Wo as s,at as st,$o as t,ft as tt,Bo as u,ot as ut,So as v,mo as w,Co as x,wo as y,Oi as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,n as t,t as n}from"./ref-
|
|
1
|
+
import{l as e,n as t,t as n}from"./ref-D37CknuD.mjs";function r(e,r,i){let a=e[r];return t(a)?a:n((t,n)=>({get(){return t(),e[r]},set(t){e[r]=t,n()}}),i)}function i(t){e(t)||console.warn(`toRefs() 需要响应式对象,但收到的是普通对象。`);let n=Array.isArray(t)?Array.from({length:t.length}):{};for(let e in t)n[e]=r(t,e);return n}export{i as n,r as t};
|