@mptool/all 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
for(var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,r=typeof Uint8Array>`u`?[]:new Uint8Array(256),i=0;i<n.length;i++)r[n.charCodeAt(i)]=i;const a=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function o(e){"@babel/helpers - typeof";return o=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},o(e)}function s(e,t){if(o(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(o(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c(e){var t=s(e,`string`);return o(t)==`symbol`?t:t+``}function l(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=class extends Error{constructor({code:e,message:t}){super(t),l(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},d=t({debug:()=>te,error:()=>ie,filter:()=>ae,info:()=>ne,warn:()=>re}),f,p;const m=a===`js`?console:((f=(p=wx).getRealtimeLogManager)==null?void 0:f.call(p))||wx.getLogManager({level:1}),ee=a!==`js`&&`getRealtimeLogManager`in wx,te=(...e)=>{wx.env.DEBUG&&(ee?m.info(`debug`,...e):m.debug(...e)),m!==console&&console.debug(...e)},ne=(...e)=>{m.info(...e),m!==console&&console.info(...e)},re=(...e)=>{m.warn(...e),m!==console&&console.warn(...e)},ie=(...e)=>{ee?m.error(...e):m.warn(`error`,...e),m!==console&&console.error(...e)},ae=e=>{ee&&m.setFilterMsg(e)};t({join:()=>ce,parse:()=>oe,stringify:()=>se});const oe=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},se=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),ce=(e,t,n=!1)=>{let r=se(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e},le=(e=``)=>e?new Promise((t,n)=>{wx.setClipboardData({data:e,success:()=>{t()},fail:({errMsg:e})=>{n(new u({message:e}))}})}):Promise.reject(Error(`data is empty`)),ue=(e,t,n,r)=>{wx.showModal({title:e,content:t,showCancel:!!r,theme:`day`,success:({confirm:e})=>{e?n==null||n():r==null||r()},fail:()=>r==null?void 0:r()})},de=(e,t,n=()=>void 0,r=``)=>{ue(`操作确认`,`您确定要${e}么?${r}`,t,n)},fe=(e,t,n,r=!1)=>{wx.showModal({title:e,content:t,confirmText:`重试`,theme:`day`,success:({confirm:e})=>{e?n():r&&getCurrentPages().length>1&&wx.navigateBack()}})},h=(e,t=1500,n=`none`)=>new Promise((r,i)=>{wx.showToast({title:e,icon:n,duration:t,success:()=>{r()},fail:({errMsg:e})=>{i(new u({message:e}))}})}),pe=()=>(wx.getWindowInfo||wx.getSystemInfoSync)();function me(e){"@babel/helpers - typeof";return me=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},me(e)}function he(e,t){if(me(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(me(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ge(e){var t=he(e,`string`);return me(t)==`symbol`?t:t+``}function _e(e,t,n){return(t=ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ve(Object(n),!0).forEach(function(t){_e(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const be=e=>new Promise((t,n)=>{if(a===`donut`){wx.addPhoneContact(ye(ye({},e),{},{success:()=>{t()}}));return}wx.getSetting({success:({authSetting:r})=>{r[`scope.addPhoneContact`]?wx.addPhoneContact(ye(ye({},e),{},{success:()=>{t()}})):wx.authorize({scope:`scope.addPhoneContact`,success:()=>{wx.addPhoneContact(ye(ye({},e),{},{success:()=>{t()}}))},fail:()=>{ue(`权限被拒`,`如果想要保存联系人,请在“权限设置”允许添加到联系人权限`,()=>{wx.openSetting(),n(new u({message:`用户拒绝权限`}))})}})}})}),xe=(e,t)=>{let n=e.split(`.`),r=t.split(`.`),i=Math.max(n.length,r.length);for(;n.length<i;)n.push(`0`);for(;r.length<i;)r.push(`0`);for(let e=0;e<i;e++){let t=Number.parseInt(n[e],10),i=Number.parseInt(r[e],10);if(t>i)return 1;if(t<i)return-1}return 0},Se=()=>{let e=getCurrentPages();return e[e.length-1]||null},Ce=()=>{var e,t;return(e=(t=Se())==null?void 0:t.route)==null?``:e},we=()=>{wx.getNetworkType({success:({networkType:e})=>{switch(e){case`wifi`:wx.startWifi({success:()=>{wx.getConnectedWifi({success:({wifi:e})=>{e.signalStrength<.5&&h(`Wifi 信号不佳`)},fail:()=>{h(`无法连接网络`)}})},fail:()=>{h(`无法连接网络`)}});break;case`2g`:case`3g`:h(`您的网络状态不佳`);break;case`none`:h(`您没有连接到网络`);break;default:h(`网络连接出现问题,请稍后重试`)}d.error(`Request fail with`,e)},fail:()=>{h(`网络连接出现问题,请稍后重试`),d.error(`Request fail and cannot get networkType`)}})},Te=(e,t=!1)=>new Promise((n,r)=>{wx.downloadFile({url:e,success:({statusCode:t,tempFilePath:i})=>{if(wx.hideLoading(),t===200)n(i);else{let n=`Download ${e} failed with statusCode: ${t}`;h(`下载失败`),d.warn(n),r(new u({code:t,message:n}))}},fail:({errMsg:t})=>{wx.hideLoading(),r(new u({message:t})),we(),d.warn(`Download ${e} failed:`,t)}}).onProgressUpdate(({progress:e})=>{wx.showLoading({title:`下载中...${Math.round(e)}%`,mask:t})})}),Ee=e=>{Te(e).then(e=>{wx.openDocument({filePath:e,showMenu:!0,success:()=>{d.debug(`打开文档 ${e} 成功`)},fail:({errMsg:t})=>{d.error(`打开文档 ${e} 失败`,t)}})}).catch(()=>{var t,n;h(`下载文档失败`),(t=(n=wx).reportEvent)==null||t.call(n,`resource_load_failed`,{broken_url:e})})},De=(e,t=(t=>{var n;return(t=(n=/\/([^/]+)\.[^/]+?$/.exec(e))==null?void 0:n[1])==null?`document`:t})())=>{wx.canIUse(`addFileToFavorites`)&&Te(e).then(n=>{let r=e.split(`.`).pop();wx.addFileToFavorites({fileName:`${t}.${r}`,filePath:n,success:()=>{ue(`文件已保存`,`文件已保存至“微信收藏”`),d.debug(e,`添加至收藏成功`)},fail:({errMsg:t})=>{d.error(e,`添加至收藏失败`,t)}})}).catch(()=>{var t,n;h(`下载文档失败`),(t=(n=wx).reportEvent)==null||t.call(n,`resource_load_failed`,{broken_url:e})})},Oe=e=>Te(e).then(e=>new Promise((t,n)=>{if(a===`donut`){wx.saveImageToPhotosAlbum({filePath:e,success:()=>{t()}});return}wx.getSetting({success:({authSetting:r})=>{r[`scope.writePhotosAlbum`]?wx.saveImageToPhotosAlbum({filePath:e,success:()=>{t()}}):wx.authorize({scope:`scope.writePhotosAlbum`,success:()=>{wx.saveImageToPhotosAlbum({filePath:e,success:()=>{t()}})},fail:()=>{ue(`权限被拒`,`如果想要保存图片,请在“权限设置”允许保存图片权限`,()=>{n(new u({message:`用户拒绝权限`})),wx.openSetting()})}})}})})),ke=e=>{if(!(`getUpdateManager`in wx))return;let t=wx.getUpdateManager();t.onCheckForUpdate(({hasUpdate:e})=>{e&&h(`发现小程序更新,下载中...`)}),t.onUpdateReady(()=>{e(()=>{t.applyUpdate()})}),t.onUpdateFailed(e=>{h(`小程序更新下载失败,请检查您的网络!`),d.error(`更新应用失败`,e)})};for(var Ae=Object.defineProperty,je=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:`Module`}),n},Me=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ne=typeof Uint8Array>`u`?[]:new Uint8Array(256),Pe=0;Pe<Me.length;Pe++)Ne[Me.charCodeAt(Pe)]=Pe;var Fe=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Me[t[n]>>2],i+=Me[(t[n]&3)<<4|t[n+1]>>4],i+=Me[(t[n+1]&15)<<2|t[n+2]>>6],i+=Me[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},Ie=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=Ne[e.charCodeAt(r)],o=Ne[e.charCodeAt(r+1)],s=Ne[e.charCodeAt(r+2)],c=Ne[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l};const Le=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function Re(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function ze(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Re(a,r,i,o,s,`next`,e)}function s(e){Re(a,r,i,o,s,`throw`,e)}o(void 0)})}}const Be=(e=new Map)=>({all:e,on:(t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},off:(t,n)=>{let r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:(t,n)=>{let r=e.get(t);r&&[...r].map(e=>e(n)),r=e.get(`*`),r&&[...r].map(e=>e(t,n))},emitAsync:function(){var t=ze(function*(t,n){var r,i;yield Promise.all([...(r=e.get(t))==null?[]:r].map(function(){var e=ze(function*(e){yield e(n)});return function(t){return e.apply(this,arguments)}}())),yield Promise.all([...(i=e.get(`*`))==null?[]:i].map(function(){var e=ze(function*(e){yield e(t,n)});return function(t){return e.apply(this,arguments)}}()))});return function(e,n){return t.apply(this,arguments)}}()});function Ve(e){"@babel/helpers - typeof";return Ve=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},Ve(e)}function He(e,t){if(Ve(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ve(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ue(e){var t=He(e,`string`);return Ve(t)==`symbol`?t:t+``}function We(e,t,n){return(t=Ue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ge=class extends Error{constructor({code:e,message:t}){super(t),We(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},g=je({debug:()=>Ye,error:()=>Qe,filter:()=>$e,info:()=>Xe,warn:()=>Ze}),Ke,qe;const _=Le===`js`?console:((Ke=(qe=wx).getRealtimeLogManager)==null?void 0:Ke.call(qe))||wx.getLogManager({level:1}),Je=Le!==`js`&&`getRealtimeLogManager`in wx,Ye=(...e)=>{wx.env.DEBUG&&(Je?_.info(`debug`,...e):_.debug(...e)),_!==console&&console.debug(...e)},Xe=(...e)=>{_.info(...e),_!==console&&console.info(...e)},Ze=(...e)=>{_.warn(...e),_!==console&&console.warn(...e)},Qe=(...e)=>{Je?_.error(...e):_.warn(`error`,...e),_!==console&&console.error(...e)},$e=e=>{Je&&_.setFilterMsg(e)};var et=je({join:()=>rt,parse:()=>tt,stringify:()=>nt});const tt=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},nt=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),rt=(e,t,n=!1)=>{let r=nt(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e},it=e=>{if(e===void 0)return`undefined`;let t=typeof e;if(t===`object`){if(e===null)return`null`;let t=/\[object (\w+)\]/u.exec(Object.prototype.toString.call(e));return t?t[1].toLowerCase():``}return t},at=e=>it(e)===`function`;function v(e,t){return function(...n){if(t.apply(this,n),e)return e.apply(this,n)}}const ot=(e,t)=>{let n;return function(...r){if(!n)return n=!0,e.apply(t==null?this:t,[()=>{n=!1},...r])}},st=(e,t)=>{let n;return function(...r){if(!n)return n=!0,e.apply(t==null?null:t,r)}};var ct=class{constructor(e=1){this.capacity=e,We(this,`funcQueue`,[]),We(this,`running`,0)}next(){let e=this.funcQueue.shift();if(e){let{func:t,ctx:n,args:r}=e;this.running+=1,t.apply(n,[()=>{--this.running,this.next()},...Array.prototype.slice.call(r,0)])}}add(e,t,...n){this.funcQueue.push({func:e,ctx:t,args:Array.prototype.slice.call(n,0)}),this.running<this.capacity&&this.next()}clear(){this.funcQueue=[]}};const lt=(e,t=1)=>{let n=new ct(t);return function(...t){n.add(e,this,...t)}},y=Be(),ut=Be(),b=Be(),dt={launch:!1,lOpt:{},hide:0},ft=e=>{dt.launch=!0,dt.lOpt=e,y.emit(`al`,e)},pt=()=>{dt.hide&&(y.emit(`a`,Date.now()-dt.hide),dt.hide=0)},mt=()=>{dt.hide=Date.now()},ht=e=>{e.onLaunch=v(e.onLaunch,ft),e.onShow=v(e.onShow,pt),e.onHide=v(e.onHide,mt),e.onAwake&&(y.on(`a`,t=>{g.debug(`App: awake after ${t}ms`),e.onAwake(t)}),g.debug(`App: registered onAwake`)),e.$on=b.on,e.$off=b.off,e.$emit=b.emit,e.$emitAsync=b.emitAsync,App(e)},gt=new Map,_t=e=>gt.get(e),vt=(e,t)=>{gt.set(e,t)},yt=e=>{gt.delete(e)};function bt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function xt(e,t){if(e==null)return{};var n,r,i=bt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function St(e){"@babel/helpers - typeof";return St=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},St(e)}function Ct(e,t){if(St(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(St(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wt(e){var t=Ct(e,`string`);return St(t)==`symbol`?t:t+``}function Tt(e,t,n){return(t=wt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Et(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Dt=[`defaultPage`,`pages`,`getPath`];let Ot;const kt=e=>{let t=e,{defaultPage:n,pages:r,getPath:i}=t,a=xt(t,Dt);if(at(i)){Ot=x(x({},a),{},{getPath:i});return}let o={},s={},c=(e,t)=>{let n=t.replace(/\$name/g,e);o[e]=n,s[n]=e};Array.isArray(r)?r.forEach(([e,t])=>{typeof e==`string`?c(e,t):e.forEach(e=>{c(e,t)})}):typeof r==`object`&&(o=r,s=Object.keys(r).reduce((e,t)=>(e[r[t]]=t,e),{})),Ot=x(x({},a),{},{getPath:e=>o[e]||n.replace(/\$name/g,e)})},At=()=>{if(!Ot)throw Error(`$Config is not called`);return Ot};let jt=!0;const Mt=e=>{let t=At(),[n,r]=e.split(`?`),i=n.startsWith(`/`)?n:t.getPath(n);return{path:i,query:et.parse(r),url:`${i}${r?`?${r}`:``}`}};function Nt(e){return t=>{if(jt){jt=!1;let{path:n,url:r,query:i}=Mt(t);return Promise.race([ut.emitAsync(`n:${n}`,i),new Promise(e=>{var t;setTimeout(()=>{e()},(t=At().maxDelay)==null?200:t)})]).then(()=>(jt=!0,wx[e]({url:r})))}}}y.on(`r`,()=>{var e;setTimeout(()=>{jt=!0},(e=At().minInterval)==null?100:e)}),y.on(`u`,()=>{jt=!0});function Pt(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Ft(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Pt(a,r,i,o,s,`next`,e)}function s(e){Pt(a,r,i,o,s,`throw`,e)}o(void 0)})}}const It=Nt(`navigateTo`),Lt=Nt(`redirectTo`),Rt=Nt(`switchTab`),zt=Nt(`reLaunch`),Bt=function(e){return function(){var t=Ft(function*(t){if(t){let{before:n,after:r,url:i}=t.currentTarget.dataset;this&&n&&typeof this[n]==`function`&&this[n](t),i&&(yield e(i),this&&r&&typeof this[r]==`function`&&this[r](t))}});function n(e){return t.apply(this,arguments)}return n}()},Vt=Bt(It),Ht=Bt(Lt),Ut=Bt(Rt),Wt=Bt(zt),Gt=(e=1)=>{let{home:t}=At();return getCurrentPages().length<=e&&t?zt(t):wx.navigateBack({delta:e})},Kt=function(){var e=Ft(function*(e){if(e){let{before:t,after:n,delta:r=1}=e.currentTarget.dataset;this&&t&&typeof this[t]==`function`&&this[t](e),yield Promise.resolve(Gt(Number(r))),this&&n&&typeof this[n]==`function`&&this[n](e)}});function t(t){return e.apply(this,arguments)}return t}(),qt=()=>[...getCurrentPages()].pop(),Jt=e=>{let{path:t,query:n}=Mt(e);ut.emit(`p:${t}`,n)},Yt=function(e){let{args:t,event:n,id:r}=e.detail;switch(n){case`$attached`:{let e=_t(r);if(!e)break;let t=e.$refID;t&&this.$refs.set(t,e),e.$attached(this);break}default:{let e=this[n];e&&e.apply(this,t)}}};function Xt(e){let t=At();e.$=Yt,e.$refs=new Map,e.$on=b.on,e.$off=b.off,e.$emit=b.emit,e.$emitAsync=b.emitAsync,e.$go=It,e.$redirect=Lt,e.$switch=Rt,e.$reLaunch=zt,e.$back=Gt,e.$preload=Jt,e.$currentPage=qt,e.$getPath=t.getPath,e.$bindGo=Vt,e.$bindRedirect=Ht,e.$bindSwitch=Ut,e.$bindRelaunch=Wt,e.$bindBack=Kt}let Zt=0;const Qt=(e={})=>{let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(r===null||typeof r==`function`)t[n]=r;else{let{type:e}=r;e===null?t[n]={type:null,value:r.default}:Array.isArray(e)?t[n]={type:e[0],value:r.default,optionalTypes:e.slice(1)}:t[n]={type:e,value:r.default}}}),x(x({},t),{},{ref:{type:String,value:``}})},$t=e=>{let{extendComponent:t,injectComponent:n}=At();return t&&t(e),e.lifetimes!=null||(e.lifetimes={}),e.lifetimes.created=v(e.lifetimes.created,function(){Xt(this),n&&n(e)}),e.lifetimes.attached=v(e.lifetimes.attached,function(){let e=Zt+=1;this.$id=e,vt(e,this),this.$refID=this.data.ref,this.triggerEvent(`ing`,{id:this.$id,event:`$attached`})}),e.lifetimes.detached=v(e.lifetimes.detached,function(){var e;yt(this.$id);let t=(e=this.$parent)==null?void 0:e.$refs,n=this.$refID;n&&t&&t.delete(n),delete this.$parent}),e.methods=x(x({},e.methods),{},{$call(e,...t){g.debug(`Component ${this.$id} call ${e}:`,t),this.triggerEvent(`ing`,{id:this.$id,event:e,args:t})},$getRef:_t,$attached(e){this.$root=e.$root||e,this.$parent=e},$:Yt}),e.observers=x(x({},e.observers),{},{ref(e){if(this.$refID&&this.$refID!==e){var t;(t=this.$parent)==null||t.$refs.delete(this.$refID),this.$refID=e,g.debug(`Component ${this.$id} ref: ${e}`)}}}),e.properties=Qt(e.props),delete e.props,Component(e)};let en=!0;const tn=(e,t)=>{let{getPath:n,extendPage:r,injectPage:i}=At(),a=n(e),o=(t,n)=>{g.debug(`Page ${e}: ${t} has been invoked`,n)},s=t=>{g.debug(`Page ${e}: registered ${t}`)};if(r&&r(e,t),t.$name=e,t.$state={firstOpen:!1},t.onAppLaunch){if(dt.launch){let{lOpt:e}=dt;o(`onAppLaunch`),t.onAppLaunch(e)}else y.on(`al`,e=>{o(`onAppLaunch`),t.onAppLaunch(e)});s(`onAppLaunch`)}t.onNavigate&&(ut.on(`n:${a}`,e=>(o(`onNavigate`,e),t.onNavigate(e))),s(`onNavigate`)),t.onPreload&&(ut.on(`p:${a}`,e=>(o(`onPreload`,e),t.onPreload(e))),s(`onPreload`)),t.onLoad=v(t.onLoad,()=>{t.onAwake&&(y.on(`a`,e=>{o(`onAwake`),t.onAwake(e)}),s(`onAwake`)),en&&(en=!1,t.$state.firstOpen=!0)}),t.onReady=v(t.onReady,()=>{y.emit(`r`)}),t.onUnload=v(t.onUnload,()=>{y.emit(`u`)}),Xt(t),i&&i(e,t),t.onRegister&&(o(`onRegister`),t.onRegister()),Page(t),g.debug(`Registered: Page ${e}`)};for(var nn=Object.defineProperty,rn=(e,t)=>{let n={};for(var r in e)nn(n,r,{get:e[r],enumerable:!0});return t||nn(n,Symbol.toStringTag,{value:`Module`}),n},an=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,on=typeof Uint8Array>`u`?[]:new Uint8Array(256),sn=0;sn<an.length;sn++)on[an.charCodeAt(sn)]=sn;const cn=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function ln(e){"@babel/helpers - typeof";return ln=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},ln(e)}function un(e,t){if(ln(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ln(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dn(e){var t=un(e,`string`);return ln(t)==`symbol`?t:t+``}function fn(e,t,n){return(t=dn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pn=class extends Error{constructor({code:e,message:t}){super(t),fn(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},S=rn({debug:()=>_n,error:()=>bn,filter:()=>xn,info:()=>vn,warn:()=>yn}),mn,hn;const C=cn===`js`?console:((mn=(hn=wx).getRealtimeLogManager)==null?void 0:mn.call(hn))||wx.getLogManager({level:1}),gn=cn!==`js`&&`getRealtimeLogManager`in wx,_n=(...e)=>{wx.env.DEBUG&&(gn?C.info(`debug`,...e):C.debug(...e)),C!==console&&console.debug(...e)},vn=(...e)=>{C.info(...e),C!==console&&console.info(...e)},yn=(...e)=>{C.warn(...e),C!==console&&console.warn(...e)},bn=(...e)=>{gn?C.error(...e):C.warn(`error`,...e),C!==console&&console.error(...e)},xn=e=>{gn&&C.setFilterMsg(e)};rn({join:()=>wn,parse:()=>Sn,stringify:()=>Cn});const Sn=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},Cn=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),wn=(e,t,n=!1)=>{let r=Cn(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e},w=wx.getFileSystemManager(),T=wx.env.USER_DATA_PATH,Tn=e=>e.split(`/`).slice(0,-1).join(`/`),En=e=>{try{return w.statSync(`${T}/${e}`,!1),!0}catch(e){return!1}},Dn=e=>En(e)&&w.statSync(`${T}/${e}`).isFile(),On=e=>En(e)&&w.statSync(`${T}/${e}`).isDirectory(),kn=(e,t=On(e)?`dir`:`file`)=>{let n=()=>{S.debug(`Deleted ${e}`)},r=t=>{S.error(`Error deleting ${e}:`,t)};if(t===`dir`)try{w.rmdirSync(`${T}/${e}`,!0),n()}catch(e){r(e)}else try{w.unlinkSync(`${T}/${e}`),n()}catch(e){r(e)}},An=e=>{try{let t=w.readdirSync(`${T}/${e}`);return S.debug(`Listing ${e} folder:`,t),t}catch(t){return S.error(`Error listing ${e} folder:`,t),[]}},jn=((e,t=`utf-8`)=>{try{return w.readFileSync(`${T}/${e}`,t)}catch(t){S.warn(`${e} don't exist`);return}}),Mn=(e,t=`utf-8`)=>{let n;try{let r=w.readFileSync(`${T}/${e}.json`,t);try{n=JSON.parse(r),S.debug(`Read ${e}.json success:`,n)}catch(t){S.warn(`Parse ${e}.json failed`)}}catch(t){S.warn(`${e}.json doesn't exist`)}return n},Nn=(e,t=!0)=>{try{w.mkdirSync(`${T}/${e}`,t)}catch(t){S.debug(`${e} folder already exists`)}},Pn=(e,t)=>{try{w.saveFileSync(e,`${T}/${t}`)}catch(e){S.error(`Saving to ${t} failed:`,e)}},Fn=(e,t)=>(Nn(Tn(t)),new Promise((n,r)=>{wx.downloadFile({url:e,filePath:`${T}/${t}`,success:({statusCode:t,tempFilePath:i})=>{if(t===200){S.debug(`${e} saved`),n(i);return}S.error(`Download ${e} failed with statusCode ${t}`),r(new pn({code:t}))},fail:({errMsg:t})=>{S.error(`Download ${e} failed:`,t),r(new pn({message:t}))}})})),In=(e,t,n=t instanceof ArrayBuffer?`binary`:`utf-8`)=>{Nn(Tn(e)),w.writeFileSync(`${T}/${e}`,t instanceof ArrayBuffer?t:JSON.stringify(t),n)},Ln=(e,t,n=`utf-8`)=>{let r=JSON.stringify(t);Nn(Tn(e)),w.writeFileSync(`${T}/${e}.json`,r,n)},Rn=(e,t)=>new Promise((n,r)=>{w.unzip({zipFilePath:`${T}/${e}`,targetPath:`${T}/${t}`,success:()=>{n()},fail:({errCode:t,errMsg:n})=>{S.error(`Unzip ${e} failed:`,n),r(new pn({code:t,message:n}))}})});function zn(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Bn(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){zn(a,r,i,o,s,`next`,e)}function s(e){zn(a,r,i,o,s,`throw`,e)}o(void 0)})}}const Vn=Date.now();S.debug(`Current sessionId is ${Vn}`);const E=`_cache_`,Hn=new Map,Un=(e,t)=>{Hn.set(e,t)},Wn=e=>{let t=Hn.get(e);return Hn.delete(e),t},Gn=(e,t)=>t?t.expired?t.expired===Vn||Date.now()<t.expired?t.data:(wx.removeStorageSync(`${E}${e}`),void 0):t.data:void 0,Kn=(e,t,n)=>{let r={expired:0,data:t};if(n===`keep`){let t=wx.getStorageSync(`${E}${e}`);if(!t)return;r.expired=t.expired||0}else n&&(r.expired=n===`once`?Vn:n+Date.now());return r},qn=(e,t,n=0)=>{wx.setStorageSync(`${E}${e}`,Kn(e,t,n))},Jn=(e,t,n=0)=>wx.setStorage({key:`${E}${e}`,data:Kn(e,t,n)}).catch(()=>{S.error(`set "${e}" fail`)}),Yn=e=>Gn(e,wx.getStorageSync(`${E}${e}`)),Xn=e=>wx.getStorage({key:`${E}${e}`}).then(({data:t})=>Gn(e,t)).catch(()=>{S.error(`set "${e}" fail`)}),Zn=e=>{wx.removeStorageSync(`${E}${e}`),Gn(e,null)},Qn=e=>wx.removeStorage({key:`${E}${e}`}),$n=()=>{wx.getStorageInfoSync().keys.forEach(e=>{if(e.startsWith(E)){let t=wx.getStorageSync(e);(!t||t.expired!==Vn&&Date.now()>=t.expired)&&wx.removeStorageSync(e)}})},er=function(){var e=Bn(function*(){let{keys:e}=yield wx.getStorageInfo();yield Promise.all(e.filter(e=>e.startsWith(E)).map(function(){var e=Bn(function*(e){let{data:t}=yield wx.getStorage({key:e});(!t||t.expired!==Vn&&Date.now()>=t.expired)&&(yield wx.removeStorage({key:e}))});return function(t){return e.apply(this,arguments)}}()))});return function(){return e.apply(this,arguments)}}(),tr=(e=``)=>e.replace(/^(\.*)?(?=\S)/gi,`.`).replace(/\.+$/,``),nr=e=>e.replace(/[#?].*$/,``),rr=e=>nr(e).replace(/^https?:\/\//,``).split(`/`).shift().replace(/:\d+$/,``),ir=(e=``)=>{if(!e)return[];let t=tr(e).replace(/^\.+/gi,``);return[t,...t.split(`.`).map(e=>[`.`,t.slice(t.indexOf(e))].join(``))]},ar=e=>{let t=rr(e);return{domain:t,path:nr(e).split(t)[1].replace(/^:\d+/,``)||`/`}},or=e=>{let{domain:t=``,path:n=`/`}=typeof e==`object`?e:typeof e==`string`?ar(e):{};return{domain:tr(t),path:n}};function sr(e){"@babel/helpers - typeof";return sr=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},sr(e)}function cr(e,t){if(sr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function lr(e){var t=cr(e,`string`);return sr(t)==`symbol`?t:t+``}function D(e,t,n){return(t=lr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}for(var ur=class{constructor(e){var t,n;D(this,`name`,void 0),D(this,`value`,void 0),D(this,`domain`,void 0),D(this,`path`,void 0),D(this,`expires`,`session`),D(this,`httpOnly`,void 0),this.name=e.name||``,this.value=e.value||``,this.domain=(t=e.domain)==null?``:t,this.path=(n=e.path)==null?`/`:n,this.httpOnly=!!e.httpOnly,this.expires=Number.isInteger(e.maxAge)?e.maxAge>0?new Date(Date.now()+e.maxAge*1e3):`outdate`:e.expires?new Date(e.expires):`session`}isExpired(){return this.expires===`outdate`||this.expires instanceof Date&&new Date>this.expires}isPersistence(){return this.expires!==`session`}isDomainMatched(e){return ir(e).includes(this.domain)}isPathMatched(e){return e.startsWith(this.path)||this.path.replace(/\/$/,``)===e}toString(){return`${this.name}=${this.value}`}toJSON(){let e={name:this.name,value:this.value,domain:this.domain};return this.path!==`/`&&(e.path=this.path),this.httpOnly&&(e.httpOnly=this.httpOnly),this.expires instanceof Date&&(e.expires=this.expires),e}},dr=Object.defineProperty,fr=(e,t)=>{let n={};for(var r in e)dr(n,r,{get:e[r],enumerable:!0});return t||dr(n,Symbol.toStringTag,{value:`Module`}),n},pr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,mr=typeof Uint8Array>`u`?[]:new Uint8Array(256),hr=0;hr<pr.length;hr++)mr[pr.charCodeAt(hr)]=hr;const gr=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function _r(e){"@babel/helpers - typeof";return _r=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},_r(e)}function vr(e,t){if(_r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_r(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function yr(e){var t=vr(e,`string`);return _r(t)==`symbol`?t:t+``}function br(e,t,n){return(t=yr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xr=class extends Error{constructor({code:e,message:t}){super(t),br(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},Sr=fr({debug:()=>Er,error:()=>kr,filter:()=>Ar,info:()=>Dr,warn:()=>Or}),Cr,wr;const O=gr===`js`?console:((Cr=(wr=wx).getRealtimeLogManager)==null?void 0:Cr.call(wr))||wx.getLogManager({level:1}),Tr=gr!==`js`&&`getRealtimeLogManager`in wx,Er=(...e)=>{wx.env.DEBUG&&(Tr?O.info(`debug`,...e):O.debug(...e)),O!==console&&console.debug(...e)},Dr=(...e)=>{O.info(...e),O!==console&&console.info(...e)},Or=(...e)=>{O.warn(...e),O!==console&&console.warn(...e)},kr=(...e)=>{Tr?O.error(...e):O.warn(`error`,...e),O!==console&&console.error(...e)},Ar=e=>{Tr&&O.setFilterMsg(e)};fr({join:()=>Nr,parse:()=>jr,stringify:()=>Mr});const jr=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},Mr=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),Nr=(e,t,n=!1)=>{let r=Mr(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e};var Pr={decodeValues:!0,map:!1,silent:!1,split:`auto`};function Fr(e){return typeof e!=`string`||e in{}}function Ir(){return Object.create(null)}function Lr(e){return typeof e==`string`&&!!e.trim()}function Rr(e,t){var n=e.split(`;`).filter(Lr),r=zr(n.shift()),i=r.name,a=r.value;if(t=t?Object.assign({},Pr,t):Pr,Fr(i))return null;try{a=t.decodeValues?decodeURIComponent(a):a}catch(e){console.error(`set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.`,e)}var o=Ir();return o.name=i,o.value=a,n.forEach(function(e){var t=e.split(`=`),n=t.shift().trimLeft().toLowerCase();if(!Fr(n)){var r=t.join(`=`);if(n===`expires`)o.expires=new Date(r);else if(n===`max-age`){var i=parseInt(r,10);Number.isNaN(i)||(o.maxAge=i)}else n===`secure`?o.secure=!0:n===`httponly`?o.httpOnly=!0:n===`samesite`?o.sameSite=r:n===`partitioned`?o.partitioned=!0:n&&(o[n]=r)}}),o}function zr(e){var t=``,n=``,r=e.split(`=`);return r.length>1?(t=r.shift(),n=r.join(`=`)):n=e,{name:t,value:n}}function Br(e,t){if(t=t?Object.assign({},Pr,t):Pr,!e)return t.map?Ir():[];if(e.headers)if(typeof e.headers.getSetCookie==`function`)e=e.headers.getSetCookie();else if(e.headers[`set-cookie`])e=e.headers[`set-cookie`];else{var n=e.headers[Object.keys(e.headers).find(function(e){return e.toLowerCase()===`set-cookie`})];!n&&e.headers.cookie&&!t.silent&&console.warn(`Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.`),e=n}var r=t.split,i=Array.isArray(e);if(r===`auto`&&(r=!i),i||(e=[e]),e=e.filter(Lr),r&&(e=e.map(Vr).flat()),t.map){var a=Ir();return e.reduce(function(e,n){var r=Rr(n,t);return r&&!Fr(r.name)&&(e[r.name]=r),e},a)}else return e.map(function(e){return Rr(e,t)}).filter(Boolean)}function Vr(e){if(Array.isArray(e))return e;if(typeof e!=`string`)return[];var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}Br.parseSetCookie=Br,Br.parse=Br,Br.parseString=Rr,Br.splitCookiesString=Vr;function Hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hr(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let Wr;const Gr=/[^a-z0-9\-#$%&'*+.^_`|~]/i,Kr=`
|
|
1
|
+
for(var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,r=typeof Uint8Array>`u`?[]:new Uint8Array(256),i=0;i<n.length;i++)r[n.charCodeAt(i)]=i;const a=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function o(e){"@babel/helpers - typeof";return o=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},o(e)}function s(e,t){if(o(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(o(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function c(e){var t=s(e,`string`);return o(t)==`symbol`?t:t+``}function l(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=class extends Error{constructor({code:e,message:t}){super(t),l(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},d=t({debug:()=>te,error:()=>ie,filter:()=>ae,info:()=>ne,warn:()=>re}),f,p;const m=a===`js`?console:((f=(p=wx).getRealtimeLogManager)==null?void 0:f.call(p))||wx.getLogManager({level:1}),ee=a!==`js`&&`getRealtimeLogManager`in wx,te=(...e)=>{wx.env.DEBUG&&(ee?m.info(`debug`,...e):m.debug(...e)),m!==console&&console.debug(...e)},ne=(...e)=>{m.info(...e),m!==console&&console.info(...e)},re=(...e)=>{m.warn(...e),m!==console&&console.warn(...e)},ie=(...e)=>{ee?m.error(...e):m.warn(`error`,...e),m!==console&&console.error(...e)},ae=e=>{ee&&m.setFilterMsg(e)};t({join:()=>ce,parse:()=>oe,stringify:()=>se});const oe=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},se=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),ce=(e,t,n=!1)=>{let r=se(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e},le=(e=``)=>e?new Promise((t,n)=>{wx.setClipboardData({data:e,success:()=>{t()},fail:({errMsg:e})=>{n(new u({message:e}))}})}):Promise.reject(Error(`data is empty`)),ue=(e,t,n,r)=>{wx.showModal({title:e,content:t,showCancel:!!r,theme:`day`,success:({confirm:e})=>{e?n==null||n():r==null||r()},fail:()=>r==null?void 0:r()})},de=(e,t,n=``,r=()=>void 0)=>{ue(`操作确认`,`您确定要${e}么?${n}`,t,r)},fe=(e,t,n,r=!1)=>{wx.showModal({title:e,content:t,confirmText:`重试`,theme:`day`,success:({confirm:e})=>{e?n():r&&getCurrentPages().length>1&&wx.navigateBack()}})},h=(e,t=1500,n=`none`)=>new Promise((r,i)=>{wx.showToast({title:e,icon:n,duration:t,success:()=>{r()},fail:({errMsg:e})=>{i(new u({message:e}))}})}),pe=()=>(wx.getWindowInfo||wx.getSystemInfoSync)();function me(e){"@babel/helpers - typeof";return me=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},me(e)}function he(e,t){if(me(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(me(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ge(e){var t=he(e,`string`);return me(t)==`symbol`?t:t+``}function _e(e,t,n){return(t=ge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ve(Object(n),!0).forEach(function(t){_e(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const be=e=>new Promise((t,n)=>{if(a===`donut`){wx.addPhoneContact(ye(ye({},e),{},{success:()=>{t()}}));return}wx.getSetting({success:({authSetting:r})=>{r[`scope.addPhoneContact`]?wx.addPhoneContact(ye(ye({},e),{},{success:()=>{t()}})):wx.authorize({scope:`scope.addPhoneContact`,success:()=>{wx.addPhoneContact(ye(ye({},e),{},{success:()=>{t()}}))},fail:()=>{ue(`权限被拒`,`如果想要保存联系人,请在“权限设置”允许添加到联系人权限`,()=>{wx.openSetting(),n(new u({message:`用户拒绝权限`}))})}})}})}),xe=(e,t)=>{let n=e.split(`.`),r=t.split(`.`),i=Math.max(n.length,r.length);for(;n.length<i;)n.push(`0`);for(;r.length<i;)r.push(`0`);for(let e=0;e<i;e++){let t=Number.parseInt(n[e],10),i=Number.parseInt(r[e],10);if(t>i)return 1;if(t<i)return-1}return 0},Se=()=>{let e=getCurrentPages();return e[e.length-1]||null},Ce=()=>{var e,t;return(e=(t=Se())==null?void 0:t.route)==null?``:e},we=()=>{wx.getNetworkType({success:({networkType:e})=>{switch(e){case`wifi`:wx.startWifi({success:()=>{wx.getConnectedWifi({success:({wifi:e})=>{e.signalStrength<.5&&h(`Wifi 信号不佳`)},fail:()=>{h(`无法连接网络`)}})},fail:()=>{h(`无法连接网络`)}});break;case`2g`:case`3g`:h(`您的网络状态不佳`);break;case`none`:h(`您没有连接到网络`);break;default:h(`网络连接出现问题,请稍后重试`)}d.error(`Request fail with`,e)},fail:()=>{h(`网络连接出现问题,请稍后重试`),d.error(`Request fail and cannot get networkType`)}})},Te=(e,t=!1)=>new Promise((n,r)=>{wx.downloadFile({url:e,success:({statusCode:t,tempFilePath:i})=>{if(wx.hideLoading(),t===200)n(i);else{let n=`Download ${e} failed with statusCode: ${t}`;h(`下载失败`),d.warn(n),r(new u({code:t,message:n}))}},fail:({errMsg:t})=>{wx.hideLoading(),r(new u({message:t})),we(),d.warn(`Download ${e} failed:`,t)}}).onProgressUpdate(({progress:e})=>{wx.showLoading({title:`下载中...${Math.round(e)}%`,mask:t})})}),Ee=e=>{Te(e).then(e=>{wx.openDocument({filePath:e,showMenu:!0,success:()=>{d.debug(`打开文档 ${e} 成功`)},fail:({errMsg:t})=>{d.error(`打开文档 ${e} 失败`,t)}})}).catch(()=>{var t,n;h(`下载文档失败`),(t=(n=wx).reportEvent)==null||t.call(n,`resource_load_failed`,{broken_url:e})})},De=(e,t=(t=>{var n;return(t=(n=/\/([^/]+)\.[^/]+?$/.exec(e))==null?void 0:n[1])==null?`document`:t})())=>{wx.canIUse(`addFileToFavorites`)&&Te(e).then(n=>{let r=e.split(`.`).pop();wx.addFileToFavorites({fileName:`${t}.${r}`,filePath:n,success:()=>{ue(`文件已保存`,`文件已保存至“微信收藏”`),d.debug(e,`添加至收藏成功`)},fail:({errMsg:t})=>{d.error(e,`添加至收藏失败`,t)}})}).catch(()=>{var t,n;h(`下载文档失败`),(t=(n=wx).reportEvent)==null||t.call(n,`resource_load_failed`,{broken_url:e})})},Oe=e=>Te(e).then(e=>new Promise((t,n)=>{if(a===`donut`){wx.saveImageToPhotosAlbum({filePath:e,success:()=>{t()}});return}wx.getSetting({success:({authSetting:r})=>{r[`scope.writePhotosAlbum`]?wx.saveImageToPhotosAlbum({filePath:e,success:()=>{t()}}):wx.authorize({scope:`scope.writePhotosAlbum`,success:()=>{wx.saveImageToPhotosAlbum({filePath:e,success:()=>{t()}})},fail:()=>{ue(`权限被拒`,`如果想要保存图片,请在“权限设置”允许保存图片权限`,()=>{n(new u({message:`用户拒绝权限`})),wx.openSetting()})}})}})})),ke=e=>{if(!(`getUpdateManager`in wx))return;let t=wx.getUpdateManager();t.onCheckForUpdate(({hasUpdate:e})=>{e&&h(`发现小程序更新,下载中...`)}),t.onUpdateReady(()=>{e(()=>{t.applyUpdate()})}),t.onUpdateFailed(e=>{h(`小程序更新下载失败,请检查您的网络!`),d.error(`更新应用失败`,e)})};for(var Ae=Object.defineProperty,je=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t||Ae(n,Symbol.toStringTag,{value:`Module`}),n},Me=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ne=typeof Uint8Array>`u`?[]:new Uint8Array(256),Pe=0;Pe<Me.length;Pe++)Ne[Me.charCodeAt(Pe)]=Pe;var Fe=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Me[t[n]>>2],i+=Me[(t[n]&3)<<4|t[n+1]>>4],i+=Me[(t[n+1]&15)<<2|t[n+2]>>6],i+=Me[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},Ie=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=Ne[e.charCodeAt(r)],o=Ne[e.charCodeAt(r+1)],s=Ne[e.charCodeAt(r+2)],c=Ne[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l};const Le=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function Re(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function ze(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Re(a,r,i,o,s,`next`,e)}function s(e){Re(a,r,i,o,s,`throw`,e)}o(void 0)})}}const Be=(e=new Map)=>({all:e,on:(t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])},off:(t,n)=>{let r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:(t,n)=>{let r=e.get(t);r&&[...r].map(e=>e(n)),r=e.get(`*`),r&&[...r].map(e=>e(t,n))},emitAsync:function(){var t=ze(function*(t,n){var r,i;yield Promise.all([...(r=e.get(t))==null?[]:r].map(function(){var e=ze(function*(e){yield e(n)});return function(t){return e.apply(this,arguments)}}())),yield Promise.all([...(i=e.get(`*`))==null?[]:i].map(function(){var e=ze(function*(e){yield e(t,n)});return function(t){return e.apply(this,arguments)}}()))});return function(e,n){return t.apply(this,arguments)}}()});function Ve(e){"@babel/helpers - typeof";return Ve=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},Ve(e)}function He(e,t){if(Ve(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ve(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ue(e){var t=He(e,`string`);return Ve(t)==`symbol`?t:t+``}function We(e,t,n){return(t=Ue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ge=class extends Error{constructor({code:e,message:t}){super(t),We(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},g=je({debug:()=>Ye,error:()=>Qe,filter:()=>$e,info:()=>Xe,warn:()=>Ze}),Ke,qe;const _=Le===`js`?console:((Ke=(qe=wx).getRealtimeLogManager)==null?void 0:Ke.call(qe))||wx.getLogManager({level:1}),Je=Le!==`js`&&`getRealtimeLogManager`in wx,Ye=(...e)=>{wx.env.DEBUG&&(Je?_.info(`debug`,...e):_.debug(...e)),_!==console&&console.debug(...e)},Xe=(...e)=>{_.info(...e),_!==console&&console.info(...e)},Ze=(...e)=>{_.warn(...e),_!==console&&console.warn(...e)},Qe=(...e)=>{Je?_.error(...e):_.warn(`error`,...e),_!==console&&console.error(...e)},$e=e=>{Je&&_.setFilterMsg(e)};var et=je({join:()=>rt,parse:()=>tt,stringify:()=>nt});const tt=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},nt=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),rt=(e,t,n=!1)=>{let r=nt(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e},it=e=>{if(e===void 0)return`undefined`;let t=typeof e;if(t===`object`){if(e===null)return`null`;let t=/\[object (\w+)\]/u.exec(Object.prototype.toString.call(e));return t?t[1].toLowerCase():``}return t},at=e=>it(e)===`function`;function v(e,t){return function(...n){if(t.apply(this,n),e)return e.apply(this,n)}}const ot=(e,t)=>{let n;return function(...r){if(!n)return n=!0,e.apply(t==null?this:t,[()=>{n=!1},...r])}},st=(e,t)=>{let n;return function(...r){if(!n)return n=!0,e.apply(t==null?null:t,r)}};var ct=class{constructor(e=1){this.capacity=e,We(this,`funcQueue`,[]),We(this,`running`,0)}next(){let e=this.funcQueue.shift();if(e){let{func:t,ctx:n,args:r}=e;this.running+=1,t.apply(n,[()=>{--this.running,this.next()},...Array.prototype.slice.call(r,0)])}}add(e,t,...n){this.funcQueue.push({func:e,ctx:t,args:Array.prototype.slice.call(n,0)}),this.running<this.capacity&&this.next()}clear(){this.funcQueue=[]}};const lt=(e,t=1)=>{let n=new ct(t);return function(...t){n.add(e,this,...t)}},y=Be(),ut=Be(),b=Be(),dt={launch:!1,lOpt:{},hide:0},ft=e=>{dt.launch=!0,dt.lOpt=e,y.emit(`al`,e)},pt=()=>{dt.hide&&(y.emit(`a`,Date.now()-dt.hide),dt.hide=0)},mt=()=>{dt.hide=Date.now()},ht=e=>{e.onLaunch=v(e.onLaunch,ft),e.onShow=v(e.onShow,pt),e.onHide=v(e.onHide,mt),e.onAwake&&(y.on(`a`,t=>{g.debug(`App: awake after ${t}ms`),e.onAwake(t)}),g.debug(`App: registered onAwake`)),e.$on=b.on,e.$off=b.off,e.$emit=b.emit,e.$emitAsync=b.emitAsync,App(e)},gt=new Map,_t=e=>gt.get(e),vt=(e,t)=>{gt.set(e,t)},yt=e=>{gt.delete(e)};function bt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function xt(e,t){if(e==null)return{};var n,r,i=bt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function St(e){"@babel/helpers - typeof";return St=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},St(e)}function Ct(e,t){if(St(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(St(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wt(e){var t=Ct(e,`string`);return St(t)==`symbol`?t:t+``}function Tt(e,t,n){return(t=wt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Et(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const Dt=[`defaultPage`,`pages`,`getPath`];let Ot;const kt=e=>{let t=e,{defaultPage:n,pages:r,getPath:i}=t,a=xt(t,Dt);if(at(i)){Ot=x(x({},a),{},{getPath:i});return}let o={},s={},c=(e,t)=>{let n=t.replace(/\$name/g,e);o[e]=n,s[n]=e};Array.isArray(r)?r.forEach(([e,t])=>{typeof e==`string`?c(e,t):e.forEach(e=>{c(e,t)})}):typeof r==`object`&&(o=r,s=Object.keys(r).reduce((e,t)=>(e[r[t]]=t,e),{})),Ot=x(x({},a),{},{getPath:e=>o[e]||n.replace(/\$name/g,e)})},At=()=>{if(!Ot)throw Error(`$Config is not called`);return Ot};let jt=!0;const Mt=e=>{let t=At(),[n,r]=e.split(`?`),i=n.startsWith(`/`)?n:t.getPath(n);return{path:i,query:et.parse(r),url:`${i}${r?`?${r}`:``}`}};function Nt(e){return t=>{if(jt){jt=!1;let{path:n,url:r,query:i}=Mt(t);return Promise.race([ut.emitAsync(`n:${n}`,i),new Promise(e=>{var t;setTimeout(()=>{e()},(t=At().maxDelay)==null?200:t)})]).then(()=>(jt=!0,wx[e]({url:r})))}}}y.on(`r`,()=>{var e;setTimeout(()=>{jt=!0},(e=At().minInterval)==null?100:e)}),y.on(`u`,()=>{jt=!0});function Pt(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Ft(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){Pt(a,r,i,o,s,`next`,e)}function s(e){Pt(a,r,i,o,s,`throw`,e)}o(void 0)})}}const It=Nt(`navigateTo`),Lt=Nt(`redirectTo`),Rt=Nt(`switchTab`),zt=Nt(`reLaunch`),Bt=function(e){return function(){var t=Ft(function*(t){if(t){let{before:n,after:r,url:i}=t.currentTarget.dataset;this&&n&&typeof this[n]==`function`&&this[n](t),i&&(yield e(i),this&&r&&typeof this[r]==`function`&&this[r](t))}});function n(e){return t.apply(this,arguments)}return n}()},Vt=Bt(It),Ht=Bt(Lt),Ut=Bt(Rt),Wt=Bt(zt),Gt=(e=1)=>{let{home:t}=At();return getCurrentPages().length<=e&&t?zt(t):wx.navigateBack({delta:e})},Kt=function(){var e=Ft(function*(e){if(e){let{before:t,after:n,delta:r=1}=e.currentTarget.dataset;this&&t&&typeof this[t]==`function`&&this[t](e),yield Promise.resolve(Gt(Number(r))),this&&n&&typeof this[n]==`function`&&this[n](e)}});function t(t){return e.apply(this,arguments)}return t}(),qt=()=>[...getCurrentPages()].pop(),Jt=e=>{let{path:t,query:n}=Mt(e);ut.emit(`p:${t}`,n)},Yt=function(e){let{args:t,event:n,id:r}=e.detail;switch(n){case`$attached`:{let e=_t(r);if(!e)break;let t=e.$refID;t&&this.$refs.set(t,e),e.$attached(this);break}default:{let e=this[n];e&&e.apply(this,t)}}};function Xt(e){let t=At();e.$=Yt,e.$refs=new Map,e.$on=b.on,e.$off=b.off,e.$emit=b.emit,e.$emitAsync=b.emitAsync,e.$go=It,e.$redirect=Lt,e.$switch=Rt,e.$reLaunch=zt,e.$back=Gt,e.$preload=Jt,e.$currentPage=qt,e.$getPath=t.getPath,e.$bindGo=Vt,e.$bindRedirect=Ht,e.$bindSwitch=Ut,e.$bindRelaunch=Wt,e.$bindBack=Kt}let Zt=0;const Qt=(e={})=>{let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(r===null||typeof r==`function`)t[n]=r;else{let{type:e}=r;e===null?t[n]={type:null,value:r.default}:Array.isArray(e)?t[n]={type:e[0],value:r.default,optionalTypes:e.slice(1)}:t[n]={type:e,value:r.default}}}),x(x({},t),{},{ref:{type:String,value:``}})},$t=e=>{let{extendComponent:t,injectComponent:n}=At();return t&&t(e),e.lifetimes!=null||(e.lifetimes={}),e.lifetimes.created=v(e.lifetimes.created,function(){Xt(this),n&&n(e)}),e.lifetimes.attached=v(e.lifetimes.attached,function(){let e=Zt+=1;this.$id=e,vt(e,this),this.$refID=this.data.ref,this.triggerEvent(`ing`,{id:this.$id,event:`$attached`})}),e.lifetimes.detached=v(e.lifetimes.detached,function(){var e;yt(this.$id);let t=(e=this.$parent)==null?void 0:e.$refs,n=this.$refID;n&&t&&t.delete(n),delete this.$parent}),e.methods=x(x({},e.methods),{},{$call(e,...t){g.debug(`Component ${this.$id} call ${e}:`,t),this.triggerEvent(`ing`,{id:this.$id,event:e,args:t})},$getRef:_t,$attached(e){this.$root=e.$root||e,this.$parent=e},$:Yt}),e.observers=x(x({},e.observers),{},{ref(e){if(this.$refID&&this.$refID!==e){var t;(t=this.$parent)==null||t.$refs.delete(this.$refID),this.$refID=e,g.debug(`Component ${this.$id} ref: ${e}`)}}}),e.properties=Qt(e.props),delete e.props,Component(e)};let en=!0;const tn=(e,t)=>{let{getPath:n,extendPage:r,injectPage:i}=At(),a=n(e),o=(t,n)=>{g.debug(`Page ${e}: ${t} has been invoked`,n)},s=t=>{g.debug(`Page ${e}: registered ${t}`)};if(r&&r(e,t),t.$name=e,t.$state={firstOpen:!1},t.onAppLaunch){if(dt.launch){let{lOpt:e}=dt;o(`onAppLaunch`),t.onAppLaunch(e)}else y.on(`al`,e=>{o(`onAppLaunch`),t.onAppLaunch(e)});s(`onAppLaunch`)}t.onNavigate&&(ut.on(`n:${a}`,e=>(o(`onNavigate`,e),t.onNavigate(e))),s(`onNavigate`)),t.onPreload&&(ut.on(`p:${a}`,e=>(o(`onPreload`,e),t.onPreload(e))),s(`onPreload`)),t.onLoad=v(t.onLoad,()=>{t.onAwake&&(y.on(`a`,e=>{o(`onAwake`),t.onAwake(e)}),s(`onAwake`)),en&&(en=!1,t.$state.firstOpen=!0)}),t.onReady=v(t.onReady,()=>{y.emit(`r`)}),t.onUnload=v(t.onUnload,()=>{y.emit(`u`)}),Xt(t),i&&i(e,t),t.onRegister&&(o(`onRegister`),t.onRegister()),Page(t),g.debug(`Registered: Page ${e}`)};for(var nn=Object.defineProperty,rn=(e,t)=>{let n={};for(var r in e)nn(n,r,{get:e[r],enumerable:!0});return t||nn(n,Symbol.toStringTag,{value:`Module`}),n},an=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,on=typeof Uint8Array>`u`?[]:new Uint8Array(256),sn=0;sn<an.length;sn++)on[an.charCodeAt(sn)]=sn;const cn=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function ln(e){"@babel/helpers - typeof";return ln=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},ln(e)}function un(e,t){if(ln(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ln(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dn(e){var t=un(e,`string`);return ln(t)==`symbol`?t:t+``}function fn(e,t,n){return(t=dn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pn=class extends Error{constructor({code:e,message:t}){super(t),fn(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},S=rn({debug:()=>_n,error:()=>bn,filter:()=>xn,info:()=>vn,warn:()=>yn}),mn,hn;const C=cn===`js`?console:((mn=(hn=wx).getRealtimeLogManager)==null?void 0:mn.call(hn))||wx.getLogManager({level:1}),gn=cn!==`js`&&`getRealtimeLogManager`in wx,_n=(...e)=>{wx.env.DEBUG&&(gn?C.info(`debug`,...e):C.debug(...e)),C!==console&&console.debug(...e)},vn=(...e)=>{C.info(...e),C!==console&&console.info(...e)},yn=(...e)=>{C.warn(...e),C!==console&&console.warn(...e)},bn=(...e)=>{gn?C.error(...e):C.warn(`error`,...e),C!==console&&console.error(...e)},xn=e=>{gn&&C.setFilterMsg(e)};rn({join:()=>wn,parse:()=>Sn,stringify:()=>Cn});const Sn=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},Cn=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),wn=(e,t,n=!1)=>{let r=Cn(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e},w=wx.getFileSystemManager(),T=wx.env.USER_DATA_PATH,Tn=e=>e.split(`/`).slice(0,-1).join(`/`),En=e=>{try{return w.statSync(`${T}/${e}`,!1),!0}catch(e){return!1}},Dn=e=>En(e)&&w.statSync(`${T}/${e}`).isFile(),On=e=>En(e)&&w.statSync(`${T}/${e}`).isDirectory(),kn=(e,t=On(e)?`dir`:`file`)=>{let n=()=>{S.debug(`Deleted ${e}`)},r=t=>{S.error(`Error deleting ${e}:`,t)};if(t===`dir`)try{w.rmdirSync(`${T}/${e}`,!0),n()}catch(e){r(e)}else try{w.unlinkSync(`${T}/${e}`),n()}catch(e){r(e)}},An=e=>{try{let t=w.readdirSync(`${T}/${e}`);return S.debug(`Listing ${e} folder:`,t),t}catch(t){return S.error(`Error listing ${e} folder:`,t),[]}},jn=((e,t=`utf-8`)=>{try{return w.readFileSync(`${T}/${e}`,t)}catch(t){S.warn(`${e} don't exist`);return}}),Mn=(e,t=`utf-8`)=>{let n;try{let r=w.readFileSync(`${T}/${e}.json`,t);try{n=JSON.parse(r),S.debug(`Read ${e}.json success:`,n)}catch(t){S.warn(`Parse ${e}.json failed`)}}catch(t){S.warn(`${e}.json doesn't exist`)}return n},Nn=(e,t=!0)=>{try{w.mkdirSync(`${T}/${e}`,t)}catch(t){S.debug(`${e} folder already exists`)}},Pn=(e,t)=>{try{w.saveFileSync(e,`${T}/${t}`)}catch(e){S.error(`Saving to ${t} failed:`,e)}},Fn=(e,t)=>(Nn(Tn(t)),new Promise((n,r)=>{wx.downloadFile({url:e,filePath:`${T}/${t}`,success:({statusCode:t,tempFilePath:i})=>{if(t===200){S.debug(`${e} saved`),n(i);return}S.error(`Download ${e} failed with statusCode ${t}`),r(new pn({code:t}))},fail:({errMsg:t})=>{S.error(`Download ${e} failed:`,t),r(new pn({message:t}))}})})),In=(e,t,n=t instanceof ArrayBuffer?`binary`:`utf-8`)=>{Nn(Tn(e)),w.writeFileSync(`${T}/${e}`,t instanceof ArrayBuffer?t:JSON.stringify(t),n)},Ln=(e,t,n=`utf-8`)=>{let r=JSON.stringify(t);Nn(Tn(e)),w.writeFileSync(`${T}/${e}.json`,r,n)},Rn=(e,t)=>new Promise((n,r)=>{w.unzip({zipFilePath:`${T}/${e}`,targetPath:`${T}/${t}`,success:()=>{n()},fail:({errCode:t,errMsg:n})=>{S.error(`Unzip ${e} failed:`,n),r(new pn({code:t,message:n}))}})});function zn(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Bn(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){zn(a,r,i,o,s,`next`,e)}function s(e){zn(a,r,i,o,s,`throw`,e)}o(void 0)})}}const Vn=Date.now();S.debug(`Current sessionId is ${Vn}`);const E=`_cache_`,Hn=new Map,Un=(e,t)=>{Hn.set(e,t)},Wn=e=>{let t=Hn.get(e);return Hn.delete(e),t},Gn=(e,t)=>t?t.expired?t.expired===Vn||Date.now()<t.expired?t.data:(wx.removeStorageSync(`${E}${e}`),void 0):t.data:void 0,Kn=(e,t,n)=>{let r={expired:0,data:t};if(n===`keep`){let t=wx.getStorageSync(`${E}${e}`);if(!t)return;r.expired=t.expired||0}else n&&(r.expired=n===`once`?Vn:n+Date.now());return r},qn=(e,t,n=0)=>{wx.setStorageSync(`${E}${e}`,Kn(e,t,n))},Jn=(e,t,n=0)=>wx.setStorage({key:`${E}${e}`,data:Kn(e,t,n)}).catch(()=>{S.error(`set "${e}" fail`)}),Yn=e=>Gn(e,wx.getStorageSync(`${E}${e}`)),Xn=e=>wx.getStorage({key:`${E}${e}`}).then(({data:t})=>Gn(e,t)).catch(()=>{S.error(`set "${e}" fail`)}),Zn=e=>{wx.removeStorageSync(`${E}${e}`),Gn(e,null)},Qn=e=>wx.removeStorage({key:`${E}${e}`}),$n=()=>{wx.getStorageInfoSync().keys.forEach(e=>{if(e.startsWith(E)){let t=wx.getStorageSync(e);(!t||t.expired!==Vn&&Date.now()>=t.expired)&&wx.removeStorageSync(e)}})},er=function(){var e=Bn(function*(){let{keys:e}=yield wx.getStorageInfo();yield Promise.all(e.filter(e=>e.startsWith(E)).map(function(){var e=Bn(function*(e){let{data:t}=yield wx.getStorage({key:e});(!t||t.expired!==Vn&&Date.now()>=t.expired)&&(yield wx.removeStorage({key:e}))});return function(t){return e.apply(this,arguments)}}()))});return function(){return e.apply(this,arguments)}}(),tr=(e=``)=>e.replace(/^(\.*)?(?=\S)/gi,`.`).replace(/\.+$/,``),nr=e=>e.replace(/[#?].*$/,``),rr=e=>nr(e).replace(/^https?:\/\//,``).split(`/`).shift().replace(/:\d+$/,``),ir=(e=``)=>{if(!e)return[];let t=tr(e).replace(/^\.+/gi,``);return[t,...t.split(`.`).map(e=>[`.`,t.slice(t.indexOf(e))].join(``))]},ar=e=>{let t=rr(e);return{domain:t,path:nr(e).split(t)[1].replace(/^:\d+/,``)||`/`}},or=e=>{let{domain:t=``,path:n=`/`}=typeof e==`object`?e:typeof e==`string`?ar(e):{};return{domain:tr(t),path:n}};function sr(e){"@babel/helpers - typeof";return sr=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},sr(e)}function cr(e,t){if(sr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function lr(e){var t=cr(e,`string`);return sr(t)==`symbol`?t:t+``}function D(e,t,n){return(t=lr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}for(var ur=class{constructor(e){var t,n;D(this,`name`,void 0),D(this,`value`,void 0),D(this,`domain`,void 0),D(this,`path`,void 0),D(this,`expires`,`session`),D(this,`httpOnly`,void 0),this.name=e.name||``,this.value=e.value||``,this.domain=(t=e.domain)==null?``:t,this.path=(n=e.path)==null?`/`:n,this.httpOnly=!!e.httpOnly,this.expires=Number.isInteger(e.maxAge)?e.maxAge>0?new Date(Date.now()+e.maxAge*1e3):`outdate`:e.expires?new Date(e.expires):`session`}isExpired(){return this.expires===`outdate`||this.expires instanceof Date&&new Date>this.expires}isPersistence(){return this.expires!==`session`}isDomainMatched(e){return ir(e).includes(this.domain)}isPathMatched(e){return e.startsWith(this.path)||this.path.replace(/\/$/,``)===e}toString(){return`${this.name}=${this.value}`}toJSON(){let e={name:this.name,value:this.value,domain:this.domain};return this.path!==`/`&&(e.path=this.path),this.httpOnly&&(e.httpOnly=this.httpOnly),this.expires instanceof Date&&(e.expires=this.expires),e}},dr=Object.defineProperty,fr=(e,t)=>{let n={};for(var r in e)dr(n,r,{get:e[r],enumerable:!0});return t||dr(n,Symbol.toStringTag,{value:`Module`}),n},pr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,mr=typeof Uint8Array>`u`?[]:new Uint8Array(256),hr=0;hr<pr.length;hr++)mr[pr.charCodeAt(hr)]=hr;const gr=typeof qq==`object`?`qq`:typeof wx==`object`?`miniapp`in wx?`donut`:`wx`:`js`;function _r(e){"@babel/helpers - typeof";return _r=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},_r(e)}function vr(e,t){if(_r(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_r(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function yr(e){var t=vr(e,`string`);return _r(t)==`symbol`?t:t+``}function br(e,t,n){return(t=yr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xr=class extends Error{constructor({code:e,message:t}){super(t),br(this,`code`,void 0),this.code=e==null?null:e,this.name=`MpError`}toString(){return`code: ${this.code}, message: ${this.message}`}},Sr=fr({debug:()=>Er,error:()=>kr,filter:()=>Ar,info:()=>Dr,warn:()=>Or}),Cr,wr;const O=gr===`js`?console:((Cr=(wr=wx).getRealtimeLogManager)==null?void 0:Cr.call(wr))||wx.getLogManager({level:1}),Tr=gr!==`js`&&`getRealtimeLogManager`in wx,Er=(...e)=>{wx.env.DEBUG&&(Tr?O.info(`debug`,...e):O.debug(...e)),O!==console&&console.debug(...e)},Dr=(...e)=>{O.info(...e),O!==console&&console.info(...e)},Or=(...e)=>{O.warn(...e),O!==console&&console.warn(...e)},kr=(...e)=>{Tr?O.error(...e):O.warn(`error`,...e),O!==console&&console.error(...e)},Ar=e=>{Tr&&O.setFilterMsg(e)};fr({join:()=>Nr,parse:()=>jr,stringify:()=>Mr});const jr=(e=``,t=`&`)=>{let n={},r=e?e.split(t):null;return r&&r.length>0&&r.forEach(e=>{let[t,r]=e.split(`=`);n[t]=r}),n},Mr=(e={},t=`&`,n=!1)=>Object.keys(e).map(t=>{let r=e[t];return`${t}=${n?r:encodeURIComponent(r)}`}).join(t),Nr=(e,t,n=!1)=>{let r=Mr(t,`&`,n);return r?`${e}${/[?&]$/u.test(e)?``:e.includes(`?`)?`&`:`?`}${r}`:e};var Pr={decodeValues:!0,map:!1,silent:!1,split:`auto`};function Fr(e){return typeof e!=`string`||e in{}}function Ir(){return Object.create(null)}function Lr(e){return typeof e==`string`&&!!e.trim()}function Rr(e,t){var n=e.split(`;`).filter(Lr),r=zr(n.shift()),i=r.name,a=r.value;if(t=t?Object.assign({},Pr,t):Pr,Fr(i))return null;try{a=t.decodeValues?decodeURIComponent(a):a}catch(e){console.error(`set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.`,e)}var o=Ir();return o.name=i,o.value=a,n.forEach(function(e){var t=e.split(`=`),n=t.shift().trimLeft().toLowerCase();if(!Fr(n)){var r=t.join(`=`);if(n===`expires`)o.expires=new Date(r);else if(n===`max-age`){var i=parseInt(r,10);Number.isNaN(i)||(o.maxAge=i)}else n===`secure`?o.secure=!0:n===`httponly`?o.httpOnly=!0:n===`samesite`?o.sameSite=r:n===`partitioned`?o.partitioned=!0:n&&(o[n]=r)}}),o}function zr(e){var t=``,n=``,r=e.split(`=`);return r.length>1?(t=r.shift(),n=r.join(`=`)):n=e,{name:t,value:n}}function Br(e,t){if(t=t?Object.assign({},Pr,t):Pr,!e)return t.map?Ir():[];if(e.headers)if(typeof e.headers.getSetCookie==`function`)e=e.headers.getSetCookie();else if(e.headers[`set-cookie`])e=e.headers[`set-cookie`];else{var n=e.headers[Object.keys(e.headers).find(function(e){return e.toLowerCase()===`set-cookie`})];!n&&e.headers.cookie&&!t.silent&&console.warn(`Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning.`),e=n}var r=t.split,i=Array.isArray(e);if(r===`auto`&&(r=!i),i||(e=[e]),e=e.filter(Lr),r&&(e=e.map(Vr).flat()),t.map){var a=Ir();return e.reduce(function(e,n){var r=Rr(n,t);return r&&!Fr(r.name)&&(e[r.name]=r),e},a)}else return e.map(function(e){return Rr(e,t)}).filter(Boolean)}function Vr(e){if(Array.isArray(e))return e;if(typeof e!=`string`)return[];var t=[],n=0,r,i,a,o,s;function c(){for(;n<e.length&&/\s/.test(e.charAt(n));)n+=1;return n<e.length}function l(){return i=e.charAt(n),i!==`=`&&i!==`;`&&i!==`,`}for(;n<e.length;){for(r=n,s=!1;c();)if(i=e.charAt(n),i===`,`){for(a=n,n+=1,c(),o=n;n<e.length&&l();)n+=1;n<e.length&&e.charAt(n)===`=`?(s=!0,n=o,t.push(e.substring(r,a)),r=n):n=a+1}else n+=1;(!s||n>=e.length)&&t.push(e.substring(r,e.length))}return t}Br.parseSetCookie=Br,Br.parse=Br,Br.parseString=Rr,Br.splitCookiesString=Vr;function Hr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hr(Object(n),!0).forEach(function(t){D(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}let Wr;const Gr=/[^a-z0-9\-#$%&'*+.^_`|~]/i,Kr=`
|
|
2
2
|
\r `,qr=RegExp(`(^[${Kr}]|$[${Kr}])`,`g`),Jr=e=>{if(typeof e!=`string`||e.length===0||e.length>128)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>127||n===32)return!1}return!0},Yr=e=>{if(Gr.test(e)||e.trim()===``)throw TypeError(`Invalid character in header field name`);return e.trim().toLowerCase()},Xr=e=>{if(typeof e!=`string`||e.trim()!==e)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n===0||n===10||n===13)return!1}return!0},Zr=e=>e.replace(qr,``),Qr=(e,t)=>Br(e).map(e=>new ur(Ur(Ur({},e),{},{domain:tr(e.domain)||t})));Wr=Symbol.iterator;var $r=class e{constructor(t){D(this,`headers`,{}),D(this,`headerNames`,new Map),t instanceof e?t.forEach((e,t)=>{this.append(t,e)},this):Array.isArray(t)?t.forEach(([e,t])=>{this.append(e,Array.isArray(t)?t.join(`, `):t)}):t&&Object.getOwnPropertyNames(t).forEach(e=>{let n=t[e];this.append(e,Array.isArray(n)?n.join(`, `):n)})}append(e,t){if(!Jr(e)||!Xr(t))return;let n=Yr(e),r=Zr(t),i=this.has(n)?`${this.get(n)}, ${r}`:r;this.set(e,i)}delete(e){if(!Jr(e)||!this.has(e))return;let t=Yr(e);delete this.headers[t],this.headerNames.delete(t)}get(e){var t;if(!Jr(e))throw TypeError(`Invalid header name "${e}"`);return(t=this.headers[Yr(e)])==null?null:t}getSetCookie(){let e=this.get(`set-cookie`);return e===null?[]:e===``?[``]:Vr(e)}has(e){if(!Jr(e))throw TypeError(`Invalid header name "${e}"`);return this.headers.hasOwnProperty(Yr(e))}set(e,t){if(!Jr(e)||!Xr(t))return;let n=Yr(e),r=Zr(t);this.headers[n]=Zr(r),this.headerNames.set(n,e)}forEach(e,t){for(let[n,r]of this.entries())e.call(t,r,n,this)}*keys(){for(let[e]of this.entries())yield e}*values(){for(let[,e]of this.entries())yield e}*entries(){let e=Object.keys(this.headers).sort((e,t)=>e.localeCompare(t));for(let t of e)if(t===`set-cookie`)for(let e of this.getSetCookie())yield[t,e];else yield[t,this.get(t)]}toObject(){return this.headers}[Wr](){return this.entries()}};function ei(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function ti(e,t){ei(e,t),t.add(e)}function ni(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}var ri=new WeakSet,ii=class{constructor(e=`__cookie_store__`){this.key=e,ti(this,ri),D(this,`store`,new Map),ni(ri,this,ai).call(this)}get(e,t){let{domain:n,path:r}=or(t),i=ir(n);for(let[t,a]of this.store.entries()){if(n&&!i.includes(t))continue;let o=a.get(e);if(o&&o.isPathMatched(r)&&!o.isExpired())return o}return null}getValue(e,t){var n;return(n=this.get(e,t))==null?void 0:n.value}has(e,t){return!!this.get(e,t)}set(e){var t;let{name:n,domain:r}=e,i=new ur(e),a=(t=this.store.get(r))==null?new Map:t;return a.set(n,i),this.store.set(r,a),ni(ri,this,oi).call(this),i}delete(e,t=``){if(t){let n=this.store.get(t);n&&n.delete(e);let r=this.store.get(tr(t));r&&r.delete(e)}else for(let t of this.store.values())t.delete(e);ni(ri,this,oi).call(this)}list(){let e={};for(let t of this.store.keys())e[t]=this.getCookiesMap(t);return e}getCookies(e){let{domain:t,path:n}=or(e),r=ir(t),i=[];for(let[e,a]of this.store.entries())if(!(t&&!r.includes(e)))for(let e of a.values())e.isPathMatched(n)&&!e.isExpired()&&i.push(e);return i}getAllCookies(){let e=[];for(let t of this.store.values())for(let n of t.values())n.isExpired()||e.push(n);return e}getCookiesMap(e){let t={};return this.getCookies(e).forEach(({name:e,value:n})=>{t[e]=n}),t}apply(e){e.forEach(e=>{let t=this.store.get(e.domain);t||(t=new Map,this.store.set(e.domain,t)),t.set(e.name,e)}),ni(ri,this,oi).call(this)}clear(e=``,t=!1){if(e){let n=this.store.get(e);if(n&&n.clear(),!t){let t=this.store.get(tr(e));t&&t.clear()}}else this.store.clear();ni(ri,this,oi).call(this)}applyHeader(e,t){if(gr===`js`){this.apply(Qr(e.getSetCookie().join(`,`),rr(t)));return}let n=e[`Set-Cookie`]||e[`set-cookie`]||``,r=Array.isArray(n)?n.filter(Boolean).join(`,`):gr===`qq`?n.replace(/;((?!Path|Expires|Max-Age|Domain|Path|SameSite)[^\s;]*?)=/gi,`,$1=`):n;this.apply(Qr(r,rr(t)))}applyResponse(e,t){this.applyHeader(gr===`js`?e.headers:e.header,t)}getHeader(e){return this.getCookies(e).map(e=>e.toString()).join(`; `)}};function ai(){try{let e=[];if(gr!==`js`){let t=wx.getStorageSync(this.key);Array.isArray(t)&&(e=t)}this.apply(e.map(e=>new ur(e)))}catch(e){console.warn(`Error applying cookie storage`,e)}}function oi(){try{let e=[];for(let t of this.store.values())for(let n of t.values())n.isExpired()?t.delete(n.name):n.isPersistence()&&e.push(n);gr!==`js`&&wx.setStorageSync(this.key,e)}catch(e){console.warn(`Error setting cookies`,e)}}let si;const ci={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`},li=e=>encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,e=>ci[e]),ui=e=>decodeURIComponent(e.replace(/\+/g,` `));si=Symbol.iterator;var di=class e{constructor(t){if(D(this,`params`,void 0),!t)this.params=new Map;else if(t instanceof e)this.params=new Map(t.params);else if(this.params=new Map,typeof t==`string`)(t.startsWith(`?`)?t.slice(1):t).split(`&`).forEach(e=>{var t;let[,n,r]=(t=/^([^=]+)=?(.*?)$/.exec(e))==null?[]:t;n&&this.append(ui(n),ui(r))});else if(Symbol.iterator in t)for(let e of t){if(e.length!==2)throw TypeError(`Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements`);let[t,n]=e;this.append(t,n)}else for(let e of Object.keys(t)){let n=t[e];this.params.set(e,[String(n)])}}get size(){let e=0;for(let t of this.params.values())e+=t.length;return e}append(e,t){this.params.set(e,[...this.getAll(e),String(t)])}delete(e){this.params.delete(e)}entries(){let e=new Set;return this.forEach((t,n)=>{e.add([n,t])}),e.values()}forEach(e,t){this.params.forEach((n,r)=>{n.forEach(n=>{e.bind(t)(n,r,this)})})}get(e){var t;return(t=this.getAll(e)[0])==null?null:t}getAll(e){var t;return[...(t=this.params.get(e))==null?[]:t]}has(e){return this.params.has(e)}keys(){return this.params.keys()}set(e,t){this.params.set(e,[t||``])}sort(){this.params=new Map([...this.params.entries()].sort(([e],[t])=>e.localeCompare(t)))}toString(){let e=[];for(let[t,n]of this.params){let r=li(t);for(let t of n)e.push(`${r}=${li(t)}`)}return e.join(`&`)}values(){let e=new Set;return this.forEach(t=>{e.add(t)}),e.values()}[si](){return this.entries()}};function fi(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function pi(e,t){if(e==null)return{};var n,r,i=fi(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const mi=[`method`,`headers`,`body`,`cookieScope`,`cookieStore`],hi=[`cookieStore`,`server`,`requestHandler`,`responseHandler`,`errorHandler`],gi=new ii(`__request_cookie__`),_i=(e,t={})=>{let{method:n=`GET`,headers:r,body:i,cookieScope:a=e,cookieStore:o=gi}=t,s=pi(t,mi);return new Promise((t,c)=>{let l=o.getHeader(a),u=new $r(r);l&&u.append(`Cookie`,l);let d=i instanceof di?i.toString():i==null?void 0:i;u.has(`Content-Type`)||(i instanceof di?u.set(`Content-Type`,`application/x-www-form-urlencoded; charset=UTF-8`):i instanceof ArrayBuffer?u.set(`Content-Type`,`application/octet-stream; charset=UTF-8`):Object.prototype.toString.call(i)===`[object Object]`&&u.set(`Content-Type`,`application/json; charset=UTF-8`)),Sr.debug(`\
|
|
3
3
|
Requesting ${e}:
|
|
4
4
|
Cookie: ${l}
|