@dimina-kit/devkit 0.1.1 → 0.1.2-dev.20260522085907
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -9
- package/dist/project-watcher.test.d.ts +2 -0
- package/dist/project-watcher.test.d.ts.map +1 -0
- package/dist/project-watcher.test.js +152 -0
- package/fe/dimina-fe-container/assets/container-api.js +1 -1
- package/fe/dimina-fe-container/assets/container.css +1 -1
- package/fe/dimina-fe-container/assets/index.css +1 -1
- package/fe/dimina-fe-container/assets/index.js +28 -42
- package/fe/dimina-fe-container/assets/pageFrame.css +1 -1
- package/fe/dimina-fe-container/assets/pageFrame.js +937 -14
- package/fe/dimina-fe-container/assets/service.js +2 -2
- package/fe/dimina-fe-container/dimina-version.json +2 -2
- package/fe/dimina-fe-container/index.html +1 -1
- package/package.json +6 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var service=(function(){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};function n(e){return e===`__proto__`}function
|
|
1
|
+
var service=(function(){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};function n(e){return typeof e==`function`}function r(e){return typeof e==`string`}function i(e){return e==null}function a(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>a(e[n],t[n])):!1}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){return e===`__proto__`}function c(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function l(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return/^(?:0|[1-9]\d*)$/.test(e)}}function u(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function d(e){return typeof e==`symbol`||Object.prototype.toString.call(e)===`[object Symbol]`}function ee(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function f(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function p(e){if(Array.isArray(e))return e.map(f);if(typeof e==`symbol`)return[e];e=m(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&(t.push(``),r++);r<n;){let s=e[r];a?s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s:o?s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s:s===`[`?(o=!0,i&&=(t.push(i),``)):s===`.`?i&&=(t.push(i),``):i+=s,r++}return i&&t.push(i),t}function m(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(m).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function te(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||d(e)?!0:typeof e==`string`&&(/^\w*$/.test(e)||!/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/.test(e))||t!=null&&o(t,e)}function ne(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||s(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function h(e,t){if(e!=null)switch(typeof t){case`string`:{if(s(t))return;let n=e[t];return n===void 0?c(t)?h(e,p(t)):void 0:n}case`number`:case`symbol`:{typeof t==`number`&&(t=f(t));let n=e[t];return n===void 0?void 0:n}default:{if(Array.isArray(t))return ne(e,t);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),s(t))return;let n=e[t];return n===void 0?void 0:n}}}function re(e,t,n){ie(e,t,()=>n,()=>void 0)}function ie(e,t,n,r){if(e==null&&!u(e))return e;let i;i=te(t,e)?[t]:Array.isArray(t)?t:p(t);let a=n(h(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=f(i[t]);if(s(n))continue;let c;if(t===i.length-1)c=a;else{let a=o[n],s=r?.(a,n,e);c=s===void 0?u(a)?a:l(i[t+1])?[]:{}:s}ae(o,n,c),o=o[n]}return e}function ae(e,t,n){let r=e[t];(!(o(e,t)&&ee(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function g(){return Math.random().toString(36).slice(2,7)}function oe(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function se(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}var _=typeof window<`u`&&typeof navigator<`u`;_&&/Android/i.test(navigator.userAgent),_&&/iPad|iPhone|iPod/.test(navigator.userAgent),_&&/OpenHarmony|harmony/.test(navigator.userAgent),_&&/Android|iPad|iPhone|iPod|OpenHarmony|harmony|Mobile/.test(navigator.userAgent);var v=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function ce(e,t){if(t.startsWith(`/`))return t.slice(1);let n=e.split(`/`),r=t.split(`/`);for(let e of r){let t=e;t===`..`?n.length>0&&n.pop():t!==`.`&&t!==``&&n.push(t)}return n.join(`/`)}function y(e,t){let n=e.split(`/`).slice(0,-1).join(`/`),r=t.split(`?`),i=r[0],a=r[1],o=ce(n,i);return a&&(o+=`?${a}`),o}function b(e){return typeof e==`number`&&Number.isFinite(e)&&!Number.isNaN(e)?`${e}px`:e}function le(e){if(typeof e!=`object`||!e)return e;let t=new WeakMap;function n(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e)){if(t.has(e))return t.get(e);let r=[];return t.set(e,r),r.push(...e.map(n)),r}if(t.has(e))return t.get(e);let r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.assign(r,...Object.keys(e).map(t=>({[t]:n(e[t])})))}return n(e)}var x={},S=1,ue=2;function de(e,t){x[e]||(x[e]={factory:t,status:S,exports:void 0})}function C(e,t,r){if(typeof e!=`string`)throw TypeError(`require args must be a string`);let i=x[e];if(!i)throw Error(`module ${e} not found`);if(i.status===S){i.status=ue;let t={exports:{}},a;try{i.factory&&(a=i.factory.call(null,C,t,t.exports))}catch(t){i.status=S;let a=`
|
|
2
2
|
name: ${t.name}
|
|
3
3
|
msg: ${t.message}
|
|
4
4
|
stack:
|
|
5
5
|
${t.stack}
|
|
6
|
-
`;console.error(`require ${e} error: ${i}`),h(n)&&n({mod:e,errMsg:t.message})}r.exports=t.exports===void 0?i:t.exports}return h(t)&&t(r.exports),r.exports}C.async=async e=>new Promise((t,n)=>{try{t(C(e))}catch(t){n(Error(`${t.message}: Failed to initialize asynchronous loading for module '${e}'`))}});var w=new class{constructor(){this.callbacks={}}store(e,t,n=le()){if(t){for(let[t,n]of Object.entries(this.callbacks))if(n.callback===e)return t}return this.callbacks[n]={callback:e,keep:t},n}invoke(e,t){if(e===void 0)return;let n=this.callbacks[e];n&&h(n.callback)&&(n.callback(t),n.keep||delete this.callbacks[e])}remove(e){e?Object.keys(this.callbacks).forEach(t=>{e===t&&delete this.callbacks[t]}):Object.entries(this.callbacks).forEach(([e,t])=>{t.keep&&delete this.callbacks[e]})}},T=new class{constructor(){this.reset()}reset(){this.active=!1,this.snapshot={systemInfo:null,menuRect:null}}init(e={}){this.active=!0,this.snapshot={...this.snapshot,...e}}update(e={}){this.snapshot={...this.snapshot,...e}}get(e){return this.active?this.snapshot[e]??null:null}getSystemInfo(){return this.get(`systemInfo`)}getMenuRect(){return this.get(`menuRect`)}};function ge(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var E=new class e{constructor(){this.event=ge(),this.init()}init(){v?globalThis.onmessage=e=>{this.handleMsg(e.data)}:DiminaServiceBridge.onMessage=this.handleMsg.bind(this)}handleMsg(e){console.log(`[service] receive msg: `,v?e:JSON.stringify(e));let{type:t,body:n}=e;this.event.emit(t,n)}on(e,t){this.event.on(e,t)}off(e){this.event.off(e)}send(t){return v?e.prototype.send=function(e){e.method=`publish`,globalThis.postMessage(e)}:e.prototype.send=function(e){return DiminaServiceBridge.publish(e.body.bridgeId||``,e)},this.send(t)}invoke(t){return v?e.prototype.invoke=function(e){e.method=`invoke`,globalThis.postMessage(e)}:e.prototype.invoke=function(e){return DiminaServiceBridge.invoke(e)},this.invoke(t)}},D=new class{#e=[];#t=``;setInitId(e){this.#t=e}push(e,t){this.stack(t).push(e)}pop(){this.stack().length>0&&this.stack().pop()}getPageInfo(){return this.stack().at(-1)||{id:this.#t}}pushStack(e){let t={id:e,pages:[]};return this.#e.push(t),t}popStack(e){if(e){let t=this.#e.findIndex(t=>t.id===e);t!==-1&&this.#e.splice(t,1)}else this.#e.length>0&&this.#e.pop()}stack(e){if(e){let t=this.#e.find(t=>t.id===e);return t||=this.pushStack(e),t.pages}else{let e=this.#e.at(-1);return e?e.pages:this.pushStack(Date.now()).pages}}},_e={getWindowInfo:()=>T.getSystemInfo(),getSystemInfoSync:()=>T.getSystemInfo(),getAppBaseInfo:()=>T.getSystemInfo(),getDeviceInfo:()=>T.getSystemInfo(),getMenuButtonBoundingClientRect:()=>T.getMenuRect()};function O(e,t,n=`container`){let r=_e[e];if(n===`container`&&r){let e=r();if(e)return e}let i;if(t===void 0||typeof t==`string`||Array.isArray(t))i=t;else if(h(t))i={success:w.store(t,!0)};else{let{success:e,fail:n,complete:r,keep:a,evtId:o,...s}=t;i=s,h(e)?i.success=w.store(e,a,o):i.success=e,h(n)&&(i.fail=w.store(n,a,o)),h(r)&&(i.complete=w.store(r,a,o))}let a={type:`invokeAPI`,target:n,body:{name:e,bridgeId:D.getPageInfo().id,params:i}};return n===`container`?E.invoke(a):E.send(a)}var ve=t({navigateBack:()=>Ce,navigateTo:()=>Se,reLaunch:()=>be,redirectTo:()=>xe,switchTab:()=>ye});function ye(e){e.url=y(D.getPageInfo().route,e.url),O(`switchTab`,e)}function be(e){e.url=y(D.getPageInfo().route,e.url),O(`reLaunch`,e)}function xe(e){let t=y(D.getPageInfo().route,e.url);D.getPageInfo().route!==t&&(e.url=t,O(`redirectTo`,e))}function Se(e){e.url=y(D.getPageInfo().route,e.url),O(`navigateTo`,e)}function Ce(e){O(`navigateBack`,e)}var we=t({offAppHide:()=>Ae,offAppShow:()=>ke,offError:()=>Ee,onAppHide:()=>Oe,onAppRoute:()=>Ne,onAppShow:()=>De,onError:()=>Te,onPageNotFound:()=>Me,onUnhandledRejection:()=>je});function Te(e){O(`onError`,e)}function Ee(e){O(`offError`,e)}function De(e){O(`onAppShow`,e)}function Oe(e){O(`onAppHide`,e)}function ke(e){O(`offAppShow`,e)}function Ae(e){O(`offAppHide`,e)}function je(){}function Me(){}function Ne(){}var Pe=t({canIUse:()=>Le,env:()=>Fe});function Fe(){return{USER_DATA_PATH:`difile://`}}var Ie=new Set([`nextTick`,`getUpdateManager`,`getPerformance`]);function Le(e){if(Ie.has(e))return!0;try{return O(`canIUse`,e)}catch(t){return console.warn(`[canIUse] check ${e} error:`,t),!1}}var Re=t({getPerformance:()=>ze});function ze(){return Be.getInstance()}var Be=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one Performance instance.`);this.entryList=new Ve,e.#e=this}static getInstance(){return e.#e||=new e,e.#e}createObserver(e){let t=new He(e);return e&&O(`addPerformanceObserver`,{success:w.store(e=>{let n=e?.data?.entryList&&JSON.parse(e?.data?.entryList)||[];n&&(this.entryList.push(n),t.notify(n))},!0)},`render`),t}getEntries(){return this.entryList.getEntries()}getEntriesByName(e,t){return this.entryList.getEntriesByName(e,t)}getEntriesByType(e){return this.entryList.getEntriesByType(e)}setBufferSize(e){this.entryList.maxEntrySize=e}},Ve=class{constructor(){this._list=[],this.maxEntrySize=30}push(e){for(let t of e)this._list.length>=this.maxEntrySize&&this._list.shift(),this._list.push(t)}getEntriesByName(e,t){return this._entryFilter(e,t)}getEntriesByType(e){return this._entryFilter(null,e)}_entryFilter(e,t){return this._list.filter(n=>!(e&&e!==n.name||t&&t!==n.entryType))}getEntries(){return this._list}},He=class{constructor(e){this.entryTypes=[],this.callback=e}observe(e){this.connected=!0,this.entryTypes=e.entryTypes}notify(e){if(this.connected){let t=new Ve;t.push(e.filter(e=>{let t=!1;return this.entryTypes&&this.entryTypes.length>0&&this.entryTypes.forEach(n=>{e.entryType===n&&(t=!0)}),t})),this.callback(t)}}disconnect(){this.connected=!1}},Ue=t({loadSubpackage:()=>Ge,preDownloadSubpackage:()=>We});function We(e){O(`preDownloadSubpackage`,e)}function Ge(e){O(`loadSubpackage`,e)}var Ke=t({getAppBaseInfo:()=>$e,getDeviceInfo:()=>et,getSystemInfo:()=>Xe,getSystemInfoAsync:()=>Qe,getSystemInfoSync:()=>Ze,getWindowInfo:()=>Je,openAppAuthorizeSetting:()=>Ye,openSystemBluetoothSetting:()=>qe});function qe(e){O(`openSystemBluetoothSetting`,e)}function Je(e){return O(`getWindowInfo`,e)}function Ye(e){O(`openAppAuthorizeSetting`,e)}function Xe(e){return new Promise(t=>{t(O(`getSystemInfo`,e))})}function Ze(){return O(`getSystemInfoSync`)}function Qe(e){O(`getSystemInfoAsync`,e)}function $e(){return O(`getAppBaseInfo`)}function et(){return O(`getDeviceInfo`)}var tt=t({getUpdateManager:()=>nt});function nt(){return rt.getInstance()}var rt=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one UpdateManager instance.`);this.hasApplyUpdate=!1,this.updateFailFlag=null,this.updateFailCbQueue=[],this.updateReadyCbQueue=[],this.updateReadyStatus=null,this.updateReadyFlag=!1,this.updateStatus=null,this.updateStatusCbQueue=[],E.on(`onUpdateStatusChange`,e=>{let{event:t,strategy:n}=e;t===`updatefail`?(this.updateFailFlag={},this.flashUpdateFailCb()):t===`updateready`?(this.updateReadyFlag=!0,this.updateReadyStatus={strategy:n},this.flushUpdateReadyCb()):t===`noupdate`?(this.updateStatus={hasUpdate:!0},this.flushUpdateStatusCb()):t===`updating`&&(this.updateStatus={hasUpdate:!1},this.flushUpdateStatusCb())}),e.#e=this}flashUpdateFailCb(){this.updateFailCbQueue.forEach(e=>{typeof e==`function`&&e()}),this.updateFailCbQueue.length=0}flushUpdateStatusCb(){this.updateStatusCbQueue.forEach(e=>{typeof e==`function`&&e(this.updateStatus)}),this.updateStatusCbQueue.length=0}flushUpdateReadyCb(){this.updateReadyCbQueue.forEach(e=>{typeof e==`function`&&e(this.updateReadyStatus)}),this.updateReadyCbQueue.length=0}static getInstance(){return e.#e||=new e,e.#e}applyUpdate(){this.updateReadyFlag&&this.hasApplyUpdate?console.error(`[applyUpdate]: applyUpdate has been called`):this.updateReadyFlag?O(`applyUpdate`):console.error(`[applyUpdate]: update is not ready`)}onCheckForUpdate(e){this.updateStatus?typeof e==`function`&&e(this.updateStatus):this.updateStatusCbQueue.push(e)}onUpdateFailed(e){this.updateFailFlag?typeof e==`function`&&e(this.updateFailFlag):this.updateFailCbQueue.push(e)}onUpdateReady(e){this.updateReadyFlag?typeof e==`function`&&e(this.updateReadyStatus):this.updateReadyCbQueue.push(e)}},it=t({createCameraContext:()=>at});function at(){return new ot}var ot=class{constructor(){this.bridgeId=D.getPageInfo().id}takePhoto(e){O(`takePhoto`,e)}startRecord(){O(`startRecord`)}stopRecord(){O(`stopRecord`)}},st=t({reportAnalytics:()=>ct,reportEvent:()=>lt});function ct(...e){O(`reportAnalytics`,e)}function lt(e,t){O(`reportAnalytics`,{eventId:e,data:t})}var ut=t({closeBluetoothAdapter:()=>xt,getBluetoothAdapterState:()=>bt,getBluetoothDevices:()=>yt,getConnectedBluetoothDevices:()=>vt,offBluetoothAdapterStateChange:()=>_t,offBluetoothDeviceFound:()=>gt,onBluetoothAdapterStateChange:()=>ht,onBluetoothDeviceFound:()=>mt,openBluetoothAdapter:()=>pt,startBluetoothDevicesDiscovery:()=>ft,stopBluetoothDevicesDiscovery:()=>dt});function dt(e){O(`stopBluetoothDevicesDiscovery`,e)}function ft(e){O(`startBluetoothDevicesDiscovery`,e)}function pt(e){O(`openBluetoothAdapter`,e)}function mt(e){O(`onBluetoothDeviceFound`,e)}function ht(e){O(`onBluetoothAdapterStateChange`,e)}function gt(){O(`offBluetoothDeviceFound`)}function _t(){O(`offBluetoothAdapterStateChange`)}function vt(e){O(`getConnectedBluetoothDevices`,e)}function yt(e){O(`getBluetoothDevices`,e)}function bt(e){O(`getBluetoothAdapterState`,e)}function xt(e){O(`closeBluetoothAdapter`,e)}var St=t({closeBLEConnection:()=>Ft,createBLEConnection:()=>Pt,getBLEDeviceCharacteristics:()=>Nt,getBLEDeviceRSSI:()=>Mt,getBLEDeviceServices:()=>jt,notifyBLECharacteristicValueChange:()=>At,offBLECharacteristicValueChange:()=>kt,offBLEConnectionStateChange:()=>Ot,onBLECharacteristicValueChange:()=>Dt,onBLEConnectionStateChange:()=>Et,readBLECharacteristicValue:()=>Tt,setBLEMTU:()=>wt,writeBLECharacteristicValue:()=>Ct});function Ct(e){O(`writeBLECharacteristicValue`,e)}function wt(e){O(`setBLEMTU`,e)}function Tt(e){O(`readBLECharacteristicValue`,e)}function Et(e){O(`onBLEConnectionStateChange`,e)}function Dt(e){O(`onBLECharacteristicValueChange`,e)}function Ot(e){O(`offBLEConnectionStateChange`,e)}function kt(){O(`offBLECharacteristicValueChange`)}function At(e){O(`notifyBLECharacteristicValueChange`,e)}function jt(e){O(`getBLEDeviceServices`,e)}function Mt(e){O(`getBLEDeviceRSSI`,e)}function Nt(e){O(`getBLEDeviceCharacteristics`,e)}function Pt(e){O(`createBLEConnection`,e)}function Ft(e){O(`closeBLEConnection`,e)}var It=t({getClipboardData:()=>Rt,setClipboardData:()=>Lt});function Lt(e){O(`setClipboardData`,e)}function Rt(e){O(`getClipboardData`,e)}var zt=t({addPhoneContact:()=>Vt,chooseContact:()=>Bt});function Bt(e){O(`chooseContact`,e)}function Vt(e){O(`addPhoneContact`,e)}var Ht=t({hideKeyboard:()=>Ut});function Ut(e){O(`hideKeyboard`,e)}var Wt=t({offMemoryWarning:()=>Kt,onMemoryWarning:()=>Gt});function Gt(e){O(`onMemoryWarning`,e)}function Kt(e){O(`offMemoryWarning`,e)}var qt=t({getNetworkType:()=>Jt});function Jt(e){O(`getNetworkType`,e)}var Yt=t({makePhoneCall:()=>Xt});function Xt(e){O(`makePhoneCall`,e)}var Zt=t({scanCode:()=>Qt});function Qt(e){O(`scanCode`,e)}var $t=t({vibrateLong:()=>tn,vibrateShort:()=>en});function en(e){O(`vibrateShort`,e)}function tn(e){O(`vibrateLong`,e)}var nn=t({extBridge:()=>rn,extOffBridge:()=>on,extOnBridge:()=>an,offLoginStatusChanged:()=>cn,onLoginStatusChanged:()=>sn});function rn({event:e,module:t,data:n={},success:r,fail:i,complete:a},o){let s,c,l;h(o)?(s=o,c=o):(s=r,c=i,l=a),O(e,{module:t,data:n,keep:n.isSustain??!0,success:s,fail:c,complete:l})}function an({event:e,module:t,callBack:n,isSustain:r=!0}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOnBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOnBridge 参数 event 为空`);return}if(!n){console.error(`[ERROR]: extOnBridge 参数 callBack 为空`);return}let i=`${t}_${e}`;O(i,{evtId:i,keep:r,success:n})}function on({event:e,module:t,callBack:n}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOffBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOffBridge 参数 event 为空`);return}O(`${t}_${e}`,{success:n})}function sn(e){E.on(`notifyLoginStatusChanged`,t=>{e?.(t)})}function cn(){E.off(`notifyLoginStatusChanged`)}var ln=t({USER_DATA_PATH:()=>un,getFileSystemManager:()=>gn}),un=`difile://`,k=`not supported in simulator`,dn=class{constructor(e){this.size=e.size||0,this.mode=e.mode||438,this.lastAccessedTime=e.lastAccessedTime||0,this.lastModifiedTime=e.lastModifiedTime||0,this._isFile=e.isFile===void 0?!0:e.isFile,this._isDirectory=e.isDirectory===void 0?!1:e.isDirectory}isFile(){return this._isFile}isDirectory(){return this._isDirectory}};function A(e){throw Error(`FileSystemManager.${e} ${k}`)}function j(e,t={}){let{fail:n,complete:r}=t;n?.({errMsg:`${e}:fail ${k}`}),r?.()}function fn(e){return e&&new dn(e)}function pn(e){if(!e||typeof e!=`object`)return e;let t={};for(let[n,r]of Object.entries(e))t[n]=new dn(r);return t}var mn=class{access(e){O(`fsAccess`,e)}accessSync(){A(`accessSync`)}stat(e={}){let{success:t,recursive:n,...r}=e;O(`fsStat`,{...r,recursive:n,success:e=>{if(!t)return;let r=n?pn(e?.stats):fn(e?.stats);t({...e,stats:r})}})}statSync(){A(`statSync`)}readFile(e){O(`fsReadFile`,e)}readFileSync(){A(`readFileSync`)}writeFile(e){O(`fsWriteFile`,e)}writeFileSync(){A(`writeFileSync`)}appendFile(e){O(`fsAppendFile`,e)}appendFileSync(){A(`appendFileSync`)}copyFile(e){O(`fsCopyFile`,e)}copyFileSync(){A(`copyFileSync`)}rename(e){O(`fsRename`,e)}renameSync(){A(`renameSync`)}unlink(e){O(`fsUnlink`,e)}unlinkSync(){A(`unlinkSync`)}mkdir(e){O(`fsMkdir`,e)}mkdirSync(){A(`mkdirSync`)}rmdir(e){O(`fsRmdir`,e)}rmdirSync(){A(`rmdirSync`)}readdir(e){O(`fsReaddir`,e)}readdirSync(){A(`readdirSync`)}getFileInfo(e){O(`fsGetFileInfo`,e)}saveFile(e){O(`fsSaveFile`,e)}saveFileSync(){A(`saveFileSync`)}getSavedFileList(e){O(`fsGetSavedFileList`,e)}removeSavedFile(e){O(`fsRemoveSavedFile`,e)}truncate(e){O(`fsTruncate`,e)}truncateSync(){A(`truncateSync`)}unzip(e){O(`fsUnzip`,e)}open(e){j(`open`,e)}openSync(){A(`openSync`)}close(e){j(`close`,e)}closeSync(){A(`closeSync`)}read(e){j(`read`,e)}readSync(){A(`readSync`)}write(e){j(`write`,e)}writeSync(){A(`writeSync`)}fstat(e){j(`fstat`,e)}fstatSync(){A(`fstatSync`)}ftruncate(e){j(`ftruncate`,e)}ftruncateSync(){A(`ftruncateSync`)}readCompressedFile(e){j(`readCompressedFile`,e)}readCompressedFileSync(){A(`readCompressedFileSync`)}readZipEntry(e){j(`readZipEntry`,e)}},hn;function gn(){return hn||=new mn,hn}var _n=[`onLaunch`,`onShow`,`onHide`],vn=[`globalData`],yn=class{constructor(e,t){this.appModule=e,this.options=t,this.init()}init(){this.initGlobalData(),this.initLifecycle(),this.initCustomMethods(),this.invokeSomeLifecycle()}initGlobalData(){this.globalData=this.appModule.moduleInfo.globalData}initLifecycle(){_n.forEach(e=>{let t=this.appModule.moduleInfo[e];h(t)&&(this[e]=t.bind(this))})}initCustomMethods(){let e=this.appModule.moduleInfo;for(let t in e)_n.includes(t)||vn.includes(t)||(h(e[t])?this[t]=e[t].bind(this):this[t]=e[t])}invokeSomeLifecycle(){this.onLaunch?.(this.options),this.onShow?.(this.options)}appShow(){this.onShow?.(this.options)}appHide(){this.onHide?.()}},bn=t({createSelectorQuery:()=>M});function M(){return new xn}var xn=class{constructor(){this.__componentId=D.getPageInfo().id,this.__taskQueue=[],this.__cbQueue=[]}in(e){return this.__componentId=e.__id__,this}select(e){return new N(this,this.__componentId,e,!0)}selectAll(e){return new N(this,this.__componentId,e,!1)}selectViewport(){return new N(this,D.getPageInfo().id,``,!0)}__push(e,t,n,r,i){this.__taskQueue.push({moduleId:t,selector:e,single:n,fields:r}),this.__cbQueue.push(i)}exec(e){let t=this;O(`selectorQuery`,{tasks:this.__taskQueue,success:n=>{n.forEach((e,n)=>{let r=t.__cbQueue[n];h(r)&&r.call(t,e)}),h(e)&&e.call(t,n)}},`render`)}},N=class{constructor(e,t,n,r){this.__selectorQuery=e,this.__moduleId=t,this.__selector=n,this.__single=r}fields(e,t){return this.__selectorQuery.__push(this.__selector,this.__moduleId,this.__single,e,t),this.__selectorQuery}boundingClientRect(e){return this.fields({id:!0,dataset:!0,rect:!0,size:!0},e)}context(e){return this.fields({context:!0},e)}node(e){return this.fields({node:!0},e)}scrollOffset(e){return this.fields({id:!0,dataset:!0,scrollOffset:!0},e)}},Sn=t({createIntersectionObserver:()=>Cn});function Cn(e,t={}){let{thresholds:n=[0],initialRatio:r=0,observeAll:i=!1}=t;return new wn(e,{thresholds:n,initialRatio:r,observeAll:i})}var wn=class{constructor(e,t){this._component=e,this._options=t,this._relativeInfo=[],this._observerId=null,this._disconnected=!1}relativeTo(e,t={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:e,margins:[`left`,`right`,`top`,`bottom`].map(e=>`${t[e]===void 0?0:t[e]}px`).join(` `)}),this}relativeToViewport(e={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:null,margins:[`left`,`right`,`top`,`bottom`].map(t=>`${e[t]===void 0?0:e[t]}px`).join(` `)}),this}observe(e,t){let n=this,r=w.store(e=>{n._disconnected||(n._observerId=e.observerId),e.info&&t.call(n,e.info)},!0);O(`addIntersectionObserver`,{moduleId:this._component.__id__,targetSelector:e,relativeInfo:this._relativeInfo,options:this._options,success:r},`render`)}disconnect(){O(`removeIntersectionObserver`,{observerId:this._observerId},`render`),this._disconnected=!0}},P=new Map;function F(e){return P.has(e)||P.set(e,{depth:0,scheduled:!1,updates:[],byModuleId:new Map,callbackIds:[]}),P.get(e)}function I(e,t){let n=(Array.isArray(t)?t:[t]).filter(h);if(n.length!==0)return w.store(()=>{n.forEach(t=>t.call(e))})}function Tn(e){let t=F(e);t.depth++}function En(e){let t=F(e);t.depth>0&&t.depth--,t.depth===0&&R(e)}function L(e,t,n,r){let i=F(e),a=i.byModuleId.get(t);if(a)Object.assign(a.data,n);else{let e={moduleId:t,data:{...n}};i.byModuleId.set(t,e),i.updates.push(e)}r&&i.callbackIds.push(r),i.depth===0&&!i.scheduled&&(i.scheduled=!0,Promise.resolve().then(()=>{i.scheduled=!1,i.depth===0&&R(e)}))}function R(e){let t=P.get(e);if(!t||t.updates.length===0)return;let n=t.updates,r=t.callbackIds;t.updates=[],t.byModuleId=new Map,t.callbackIds=[],t.scheduled=!1,E.send({type:`ub`,target:`render`,body:{bridgeId:e,updates:n,callbackIds:r}})}function Dn(e){let t=e.__mpxProxy?.options?.computed;if(t)for(let n of Object.keys(t))Object.hasOwn(e.data,n)||(e.data[n]=null)}function z(e){return oe(e)?e:Object.entries(e).reduce((e,[t,n])=>t.startsWith(`$`)?e:h(n)?(console.warn(`[service] 值不支持函数引用`,t),e):(Array.isArray(n)?e[t]=n.map(e=>typeof e==`object`&&e?e instanceof Date?e.getTime():z(e):e):n&&typeof n==`object`&&!Array.isArray(n)?n instanceof Date?e[t]=n.getTime():e[t]=z(n):e[t]=n,e),{})}function On(e){if(e){let t={};for(let n in e){let r=e[n];t[n]=t[n]||{};let i=B(r&&typeof r==`object`&&Object.hasOwn(r,`type`)?r.type:r),a=null;if(a=Array.isArray(i)?[...i]:[i],r&&r.optionalTypes){let e=B(r.optionalTypes);Array.isArray(e)?a=[...e]:a.push(e)}t[n].type=a,t[n].type.length>0&&(r&&h(r.value)?t[n].default=r.value():r&&(t[n].default=r.value))}return t}}var kn=new Map([[String,`s`],[Number,`n`],[Boolean,`b`],[Object,`o`],[Array,`a`],[Function,`f`]]);function B(e){return Array.isArray(e)?e.map(e=>B(e)):e===null||e===``?null:kn.get(e)||(console.warn(`[service] ignore unknown props type ${e}`),null)}function An(e,t,n,r,i){let a=new Set;for(let o of e)for(let e in t){if(a.has(e))continue;let s=e.split(`,`).map(e=>e.trim());if(s.includes(o)){a.add(e);let c=t[e],l=s.map(e=>g(n,e));s.length===1?c.call(r,...l,i[o]):c.call(r,...l);continue}if(e===`**`){a.add(e),t[e].call(r,n);continue}let c=e.split(`.`),l=o.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u&&c.length>1){a.add(e);let s=n;for(let e of c)e!==`**`&&(s=s?.[e]);e===o?t[e].call(r,s,i[o]):t[e].call(r,s)}}}function jn(e,t,n,r,i){for(let a in t){let o=t[a],s=a.split(`,`).map(e=>e.trim());if(s.includes(e)){let t=s.map(e=>g(n,e));s.length===1&&s[0]===e?o.call(r,...t,i):o.call(r,...t);continue}if(a===`**`){o.call(r,n);continue}let c=a.split(`.`),l=e.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u){let t=n;for(let e of c)e!==`**`&&(t=t[e]);a===e?o.call(r,t,i):o.call(r,t);continue}let d=a.match(/^(.+)\[(\d+)\]$/);if(d){let t=d[1],i=Number.parseInt(d[2],10);if(t===e.split(`[`)[0]&&n[t]&&n[t][i]!==void 0){o.call(r,n[t][i]);continue}}if(e.startsWith(a)){let e=a.split(`.`).reduce((e,t)=>e&&e[t],n);if(e!==void 0){o.call(r,e);continue}}}}function Mn(e={},t=``){let n=t.trim();if(!n)return;let r=n.replace(/-/g,``).toLowerCase(),i=[n,ue(n),de(n),r];for(let t of i)if(t&&e[t]!==void 0)return e[t]}function V(e,t,n){let r=e.__info__||{};if(r.behaviorObservers)for(let i in r.behaviorObservers){let a=r.behaviorObservers[i];if(!(!Array.isArray(a)||a.length===0))for(let r of t)a.forEach(t=>{jn(r,{[i]:t},e.data,e,n[r])})}}function Nn(e,t,n){Fn(e,t,n)}function Pn(e,t,n){let r=[];for(let i of t){let t=e.__info__.properties?.[i]?.observer,a=e.data[i],o=n[i];ae(t)?r.push(()=>e[t]?.(a,o)):h(t)&&r.push(()=>t.call(e,a,o))}return r}function Fn(e,t,n){Pn(e,t,n).reverse().forEach(e=>e())}function In(e,t){if(!Array.isArray(t))return;let n=new WeakMap;function r(e,t){let n={...e};for(let e in t)if(Object.hasOwn(t,e)){let i=n[e],a=t[e];i&&typeof i==`object`&&!Array.isArray(i)&&a&&typeof a==`object`&&!Array.isArray(a)?n[e]=r(i,a):n[e]=a}return n}function i(e,t){if(typeof t==`string`){a(e,t);return}if(!t||typeof t!=`object`||n.has(t))return;n.set(t,!0),Array.isArray(t.behaviors)&&t.behaviors.forEach(t=>i(e,t)),t.properties&&(e.properties={...t.properties,...e.properties}),t.data&&(e.data||={},e.data=r(t.data,e.data));let o=[`created`,`attached`,`ready`,`detached`];e.behaviorLifetimes=e.behaviorLifetimes||{};for(let n of o)h(t[n])&&(e.behaviorLifetimes[n]=e.behaviorLifetimes[n]||[],e.behaviorLifetimes[n].push(t[n]));if(t.observers){e.behaviorObservers=e.behaviorObservers||{};for(let n in t.observers)e.behaviorObservers[n]||(e.behaviorObservers[n]=[]),e.behaviorObservers[n].push(t.observers[n])}if(t.methods&&(e.methods={...t.methods,...e.methods}),t.relations&&(e.relations={...e.relations,...t.relations}),t.export&&(e.export=t.export),t.pageLifetimes){e.behaviorPageLifetimes=e.behaviorPageLifetimes||{};for(let n of[`show`,`hide`,`resize`,`routeDone`])h(t.pageLifetimes[n])&&(e.behaviorPageLifetimes[n]=e.behaviorPageLifetimes[n]||[],e.behaviorPageLifetimes[n].push(t.pageLifetimes[n]))}}function a(e,t){switch(t){case`wx://component-export`:break;case`wx://form-field`:break;case`wx://form-field-button`:break;default:console.warn(`[service] 未知的内置 behavior: ${t}`)}}t.forEach(t=>i(e,t))}function H(e,t,n){let r=e;for(;r&&r.__parentId__;){if(r.__parentId__===t)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}function U(e,t){if(!e||!t)return!1;if(e.startsWith(`#`)){let n=e.slice(1);return t.id===n}if(e.startsWith(`.`)){let n=e.slice(1);return t.__targetInfo__?.class&&t.__targetInfo__.class.split(` `).includes(n)}if(e.startsWith(`[`)&&e.endsWith(`]`)){let n=e.slice(1,-1).match(/^(\w+)(?:=["']?([^"']*)["']?)?$/);if(n){let[,e,r]=n,i=t.__targetInfo__?.dataset||{};return r===void 0?Object.hasOwn(i,e):i[e]===r}return!1}return t.is?t.is.split(`/`).pop()===e||t.is===e:!1}function Ln(e,t){if(!e||!Array.isArray(e.dependencies))return!1;for(let n of e.dependencies){if(n in t)return!0;for(let e of Object.keys(t))if(e.startsWith(n+`.`)||e.startsWith(n+`[`)||n.startsWith(e+`.`)||n.startsWith(e+`[`))return!0}return!1}function Rn(e,t){if(!(!e||!e.expression)){if(e.isSimple)return g(t,e.expression);try{return Function(`data`,`with(data) { return ${e.expression} }`)(t)}catch(t){console.warn(`[service] 计算表达式失败:`,e.expression,t);return}}}function W(e,t,n){let r=Object.values(t||{}),i=[];for(let t of r){if(!H(t,e.__id__,r)||t.__parentId__!==e.__id__)continue;let a=t.__info__?.properties||{},o={};for(let r in a){let i=e.__childPropsBindings__?.[t.__id__]?.[r];i&&Ln(i,n)&&(o[r]=Rn(i,e.data))}Object.keys(o).length>0&&(t.tO?.(o),t.__pendingSyncedProps__=t.__pendingSyncedProps__||{},Object.assign(t.__pendingSyncedProps__,o),i.push({child:t,data:o}))}return i}var zn=[`created`,`attached`,`ready`,`moved`,`detached`,`error`],Bn=[`show`,`hide`,`resize`,`routeDone`],Vn=class{constructor(e,t){this.initd=!1,this.opts=t,t.targetInfo&&(this.id=t.targetInfo.id,this.dataset=t.targetInfo.dataset,this.__targetInfo__=t.targetInfo),this.is=t.path,this.route=t.path,this.query=t.query,this.renderer=`webview`,this.bridgeId=t.bridgeId,this.id||=t.bridgeId,this.behaviors=e.behaviors,this.data=pe(e.noReferenceData),Object.defineProperty(this,`properties`,{get(){return this.data},enumerable:!0,configurable:!1}),this.__isComponent__=e.isComponent,this.__type__=e.type,this.__id__=this.opts.moduleId,this.__info__=e.moduleInfo,this.__eventAttr__=t.eventAttr,this.__pageId__=t.pageId,this.__parentId__=t.parentId,this.__relations__=new Map,this.__relationPaths__=new Map,this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[],this.__pendingInitSetDataCallbacks__=[],this.__childPropsBindings__={},this.__pendingSyncedProps__={},this.__initialPropertyObserversInvoked__=!1}init(){if(this.__isComponent__)for(let e in this.__info__.properties)!Object.hasOwn(this.opts.properties,e)||this.opts.properties[e]===void 0?this.data[e]=this.__info__.properties[e]?.value??null:this.data[e]=this.opts.properties[e];return this.#d(),this.#f(),this.#t(),this.#e(),this.#m().then(()=>{Dn(this),E.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],L(this.bridgeId,this.__id__,{},I(this,e))}#e(){this.hasBehavior(`wx://component-export`)&&this.__info__.export&&h(this.__info__.export)&&(this.export=this.__info__.export.bind(this))}#t(){let e=this.__info__.relations;if(!(!e||typeof e!=`object`))for(let[t]of Object.entries(e)){let e=this.#n(t);this.__relationPaths__.set(t,e),this.__relations__.has(t)||this.__relations__.set(t,[])}}#n(e){if(e.startsWith(`./`)){let t=this.is.lastIndexOf(`/`);return t===-1?e.substring(2):`${this.is.substring(0,t)}/${e.substring(2)}`}else if(e.startsWith(`../`)){let t=this.is.split(`/`),n=e.split(`/`),r=t.slice(0,-1);for(let e of n)e===`..`?r.pop():e!==`.`&&r.push(e);return r.join(`/`)}else return e}#r(){let e=this.__info__.relations;if(!e)return;let t=Object.values(Y.instances[this.bridgeId]||{});for(let[n,r]of Object.entries(e)){let{type:e,target:i}=r,a=this.__relationPaths__.get(n),o=t.filter(e=>i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`)).filter(t=>this.#o(t,e)||this.#a(t,e));for(let e of o)this.#c(n,e,r)}this.#i()}#i(){let e=Object.values(Y.instances[this.bridgeId]||{});for(let t of e)t!==this&&t._checkRelationsWithTarget&&t._checkRelationsWithTarget(this)}_checkRelationsWithTarget(e){let t=this.__info__.relations;if(t)for(let[n,r]of Object.entries(t)){let{type:t,target:i}=r,a=this.__relationPaths__.get(n),o=!1;o=i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`);let s=this.#o(e,t),c=this.#a(e,t);o&&(s||c)&&this.#c(n,e,r)}}#a(e,t){if(t!==`descendant`&&t!==`ancestor`)return!1;let n=t===`descendant`?`ancestor`:`descendant`,r=e.__info__?.relations;return r?Object.entries(r).some(([t,r])=>{let i=e.__relationPaths__?.get(t);return r.type===n&&(this.is===i||this.is.endsWith(`/${i}`))}):!1}#o(e,t){let n=Object.values(Y.instances[this.bridgeId]||{});switch(t){case`parent`:return e.__id__===this.__parentId__;case`child`:return e.__parentId__===this.__id__;case`ancestor`:return this.#s(e.__id__,this.__id__,n);case`descendant`:return this.#s(this.__id__,e.__id__,n);default:return!1}}#s(e,t,n){let r=n.find(e=>e.__id__===t);for(;r&&r.__parentId__;){if(r.__parentId__===e)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}#c(e,t,n){let r=this.__relations__.get(e)||[];if(!r.includes(t)&&(r.push(t),this.__relations__.set(e,r),h(n.linked)))try{n.linked.call(this,t)}catch(e){console.error(`[service] relation linked error:`,e)}}#l(e,t,n){let r=this.__relations__.get(e)||[],i=r.indexOf(t);if(i!==-1&&(r.splice(i,1),this.__relations__.set(e,r),h(n.unlinked)))try{n.unlinked.call(this,t)}catch(e){console.error(`[service] relation unlinked error:`,e)}}#u(e,t,n){if(h(n.linkChanged))try{n.linkChanged.call(this,t)}catch(e){console.error(`[service] relation linkChanged error:`,e)}}setData(e,t){let n=z(e),r={};for(let e in n)r[e]=this.data[e],ce(this.data,e,n[e]);if(this.__info__.observers&&An(Object.keys(n),this.__info__.observers,this.data,this,r),V(this,Object.keys(n),r),Nn(this,Object.keys(n),r),!this.initd){h(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}if(this.__groupSetDataMode__){for(let e in n)this.__groupSetDataBuffer__[e]=n[e];h(t)&&this.__groupSetDataCallbacks__.push(t);return}let i=W(this,Y.instances[this.bridgeId],n);L(this.bridgeId,this.__id__,n,I(this,t)),i.forEach(({child:e,data:t})=>{L(this.bridgeId,e.__id__,t)})}#d(){zn.forEach(e=>{let t=this.__info__.lifetimes?.[e]||this.__info__[e];h(t)&&(this[e]=t.bind(this))}),this.__isComponent__&&Bn.forEach(e=>{let t=this.__info__.pageLifetimes?.[e];h(t)&&(e===`show`?e=`onShow`:e===`hide`&&(e=`onHide`),this[e]=t.bind(this))})}#f(){let e=this.__info__.methods;for(let t in e)h(e[t])&&(this[t]=e[t].bind(this))}#p(){if(!this.__isComponent__||!this.__info__.properties||this.__initialPropertyObserversInvoked__)return;let e=[];for(let t of Object.keys(this.__info__.properties)){let n=this.__info__.properties[t]?.observer,r=this.data[t];ae(n)?e.push(()=>this[n]?.(r,void 0)):h(n)&&e.push(()=>n.call(this,r,void 0))}e.forEach(e=>e()),this.__initialPropertyObserversInvoked__=!0}async#m(){this.__isComponent__?(await this.componentCreated(),await this.componentAttached()):(await this.componentCreated(),await this.componentAttached(),await this.onLoad?.(this.opts.query||{})),this.initd=!0}tO(e){let t={};for(let[n,r]of Object.entries(e)){if(this.__pendingSyncedProps__&&Object.hasOwn(this.__pendingSyncedProps__,n)&&se(this.__pendingSyncedProps__[n],r)){this.data[n]=r,delete this.__pendingSyncedProps__[n];continue}t[n]=r}if(Object.keys(t).length===0)return;let n=[],r={};for(let[e,i]of Object.entries(t)){let t=this.data[e];r[e]=t,this.data[e]=i,this.__info__.observers&&n.push(()=>jn(e,this.__info__.observers,this.data,this,t))}n.forEach(e=>e()),V(this,Object.keys(t),Object.fromEntries(Object.keys(t).map(e=>[e,void 0]))),Fn(this,Object.keys(t),r)}getPageId(){return this.__id__}hasBehavior(e){let t=function(n){if(!Array.isArray(n))return!1;if(n.includes(e))return!0;for(let e of n)if(e&&e.behaviors&&t(e.behaviors))return!0;return!1};return t(this.behaviors)}createSelectorQuery(){return M().in(this)}selectComponent(e){let t=Object.values(Y.instances[this.bridgeId]),n=t.find(n=>H(n,this.__id__,t)&&U(e,n));return n?n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(Y.instances[this.bridgeId]);return t.filter(n=>H(n,this.__id__,t)&&U(e,n))}selectOwnerComponent(){let e=Object.values(Y.instances[this.bridgeId]);for(let t of e)if(t.id===this.__parentId__)return t;return null}createIntersectionObserver(e){return Cn(this,e)}groupSetData(e){if(!h(e)){console.warn(`[service] groupSetData callback must be a function`);return}this.__groupSetDataMode__=!0,Tn(this.bridgeId),this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];try{e.call(this)}catch(e){console.error(`[service] groupSetData callback error:`,e)}finally{if(this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__&&Object.keys(this.__groupSetDataBuffer__).length>0){let e=this.__groupSetDataBuffer__,t=this.__groupSetDataCallbacks__;this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];let n=W(this,Y.instances[this.bridgeId],e);L(this.bridgeId,this.__id__,e,I(this,t)),n.forEach(({child:e,data:t})=>{L(this.bridgeId,e.__id__,t)})}else this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];En(this.bridgeId)}}createMediaQueryObserver(){console.warn(`[service] 暂不支持 createMediaQueryObserver`)}getRelationNodes(e){return e?[...this.__relations__.get(e)||[]]:(console.warn(`[service] getRelationNodes 需要传入关系路径参数`),[])}animate(){console.warn(`[service] 暂不支持 animate`)}clearAnimation(){console.warn(`[service] 暂不支持 clearAnimation`)}async triggerEvent(e,t,n={}){if(!e)return;let r=e.trim(),i=Mn(this.__eventAttr__,r);i&&await Y.triggerEvent({bridgeId:this.bridgeId,moduleId:this.__pageId__,methodName:i,event:{type:r,detail:t,currentTarget:{id:this.id,dataset:this.dataset},target:{id:this.id,dataset:this.dataset}}}),n.bubbles&&await Y.instances[this.bridgeId][this.__parentId__]?.triggerEvent(e,t),n.composed,n.capturePhase}pageReady(){this.__isComponent__||this.ready?.()}pageUnload(){this.__isComponent__||this.onUnload?.()}pageScrollTop(e){if(!this.__isComponent__){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.resize?.(e)}componentRouteDone(){this.__info__.behaviorPageLifetimes?.routeDone?.forEach(e=>e.call(this)),this.routeDone?.()}async componentCreated(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.()}async componentAttached(){this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),this.#r()}componentReadied(){this.#p(),this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.()}componentMoved(){this.moved?.();let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=this.__relations__.get(t)||[];for(let r of e)this.#u(t,r,n)}}componentDetached(){let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=[...this.__relations__.get(t)||[]];for(let r of e)this.#l(t,r,n)}this.#h(),this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.initd=!1}#h(){let e=Object.values(Y.instances[this.bridgeId]||{});for(let t of e)if(!(t===this||!t.__relations__))for(let[e,n]of t.__relations__.entries()){let r=n.indexOf(this);if(r!==-1){n.splice(r,1),t.__relations__.set(e,n);let i=t.__info__.relations?.[e];if(i&&h(i.unlinked))try{i.unlinked.call(t,this)}catch(e){console.error(`[service] relation unlinked error:`,e)}}}}componentError(e){this.error?.(e)}},G=class e{static type=`component`;constructor(t,n){this.moduleInfo=t,this.extraInfo=n,this.type=e.type,this.isComponent=this.extraInfo.component,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,In(this.moduleInfo,this.behaviors),this.noReferenceData=z(this.moduleInfo.data||{})}getProps(){let e=On(this.moduleInfo.properties);if(Array.isArray(this.moduleInfo.externalClasses)&&this.moduleInfo.externalClasses.length>0){e||={};for(let t of this.moduleInfo.externalClasses)e[t]={type:[`s`],cls:!0}}return e}},Hn=class{constructor(e,t){this.initd=!1,this.opts=t,this.is=t.path,this.route=t.path,this.bridgeId=t.bridgeId,this.id=t.bridgeId,this.query=t.query,this.data=pe(e.noReferenceData),this.__type__=e.type,this.__id__=t.moduleId,this.__info__=e.moduleInfo,this.__childPropsBindings__={},this.__pendingInitSetDataCallbacks__=[]}init(){return this.#e(),this.#t().then(()=>{Dn(this),E.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],L(this.bridgeId,this.__id__,{},I(this,e))}setData(e,t){let n=z(e),r={},i=this.__info__||{};for(let e in n)r[e]=this.data[e],ce(this.data,e,n[e]);if(i.observers&&An(Object.keys(n),i.observers,this.data,this,r),V(this,Object.keys(n),r),!this.initd){h(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}let a=W(this,Y.instances[this.bridgeId],n);L(this.bridgeId,this.__id__,n,I(this,t)),a.forEach(({child:e,data:t})=>{L(this.bridgeId,e.__id__,t)})}createSelectorQuery(){return M().in(this)}selectComponent(e){let t=Object.values(Y.instances[this.bridgeId]||{}),n=t.find(n=>H(n,this.__id__,t)&&U(e,n));return n?n.hasBehavior&&n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(Y.instances[this.bridgeId]||{});return t.filter(n=>H(n,this.__id__,t)&&U(e,n)).map(e=>e.hasBehavior&&e.hasBehavior(`wx://component-export`)&&e.export?e.export():e)}#e(){for(let e in this.__info__){let t=this.__info__[e];h(t)?this[e]=t.bind(this):this[e]=t}}async#t(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.(),this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),await this.onLoad?.(this.opts.query||{}),this.initd=!0}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageReady(){this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.(),this.onReady?.()}pageUnload(){this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.onUnload?.(),this.initd=!1}pageScrollTop(e){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.onResize?.(e)}},K=class e{static type=`page`;constructor(t,n){if(this.moduleInfo=t,this.extraInfo=n,this.type=e.type,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,In(this.moduleInfo,this.behaviors),this.moduleInfo.methods)for(let[e,t]of Object.entries(this.moduleInfo.methods))!(e in this.moduleInfo)&&h(t)&&(this.moduleInfo[e]=t);this.noReferenceData=z(this.moduleInfo.data||{})}},q=class{static type=`app`;constructor(e){this.moduleInfo=e}},J=new class{constructor(){this.staticModules={}}loadResource(e){let{appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a}=e;if(v&&(this.isScriptLoaded=this.isScriptLoaded||{},!this.isScriptLoaded[i])){let e=`${a}${t}/${i}/logic.js`;globalThis.importScripts(e),this.isScriptLoaded[i]=!0}D.setInitId(n),C(`app`),C(r),E.invoke({type:`serviceResourceLoaded`,target:`service`,body:{bridgeId:n}})}createAppModule(e){let t=new q(e);this.staticModules[q.type]=t}createModule(e,t,n){let{path:r,usingComponents:i}=t;if(!this.staticModules[r]){if(i)for(let e of Object.values(i))C(e);if(n===K.type){let n=new K(e,t);this.staticModules[r]=n}else if(n===G.type){let n=new G(e,t);this.staticModules[r]=n}else console.error(`[service] createModule ${n} error`)}}getPropsByPath(e){let t={};return this.getComponentProps(t,e),t}getComponentProps(e,t){if(t)for(let n of Object.values(t)){let t=this.staticModules[n];!t||e[n]||(e[n]=t.getProps(),this.getComponentProps(e,t.usingComponents))}}getAppModule(){return this.staticModules[q.type]}getModuleByPath(e){return this.staticModules[e]}},Y=new class{constructor(){this.app=null,this.instances={}}queuePendingEvent(e,t){return e.__pendingRuntimeEvents__=e.__pendingRuntimeEvents__||[],new Promise((n,r)=>{e.__pendingRuntimeEvents__.push({...t,resolve:n,reject:r})})}async flushPendingEvents(e){let t=e?.__pendingRuntimeEvents__||[];e.__pendingRuntimeEvents__=[];for(let e of t)try{let t=await this.dispatchEvent(e);e.resolve(t)}catch(t){e.reject(t)}}async dispatchEvent({instance:e,bridgeId:t,moduleId:n,methodName:r,event:i}){if(h(e[r]))return await e[r](i);console.warn(`[service] triggerEvent ${t} ${n}, is: ${e.is}, method: ${r} is not exist`)}createApp(e){if(this.app){console.log(`[service] app instance already existed`);return}let{scene:t,pagePath:n,query:r}=e,i=J.getAppModule();if(!i){console.log(`[service] app instance is not exist`);return}console.log(`[service] create app instance`),this.app=new yn(i,{scene:t,path:n,query:r})}appShow(){this.app?.appShow()}appHide(){this.app?.appHide()}stackShow(e){D.pushStack(e)}stackHide(e){D.popStack(e)}createInstance(e){let{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l,stackId:u}=e,d=J.getModuleByPath(r);if(!d){console.error(`[service] ${r} not exist`);return}if(console.log(`[service] create instance ${r}`),this.instances[t]=this.instances[t]||{},d.type===G.type){let e=new Vn(d,{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l});return this.instances[t][n]=e,d.isComponent||D.push(e,u),e.init(),e}else if(d.type===K.type){let e=new Hn(d,{bridgeId:t,moduleId:n,path:r,query:i});return this.instances[t][n]=e,D.push(e,u),e.init(),e}else console.error(`[service] ${d.type} instance is not exist.`)}moduleReady(e){let{bridgeId:t,moduleId:n,propBindings:r}=e,i=this.instances[t][n];if(i){if(r&&i.__parentId__){let e=this.instances[t]?.[i.__parentId__];e&&(e.__childPropsBindings__||={},e.__childPropsBindings__[n]=r)}if(i.__type__===G.type){i.componentReadied(),i.__componentReadied__=!0,this.flushPendingEvents(i),i.flushInitSetDataCallbacks?.();let e=this.getPageInstance(t);e&&this.checkAndCallPageReady(t,e.__id__)}}}moduleUnmounted(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(r.__type__===G.type&&r.componentDetached(),delete this.instances[t][n])}pageShow(e){let{bridgeId:t}=e,n=this.instances[t];if(!n)return;let r=[];Object.values(n).forEach(e=>{e&&(e.__type__===K.type?r.push(e):e.__type__===G.type&&(e.__isComponent__?e.pageShow():r.push(e)))}),r.forEach(e=>{e.pageShow()})}pageReady(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(this.pageShow(e),r.__pageReadyPending__=!0,r.flushInitSetDataCallbacks?.(),this.checkAndCallPageReady(t,n))}getPageInstance(e){let t=this.instances[e];return t?Object.values(t).find(e=>e&&(e.__type__===K.type||e.__type__===G.type&&!e.__isComponent__)):null}checkAndCallPageReady(e,t){let n=this.instances[e][t];if(!n||!n.__pageReadyPending__)return;let r=this.instances[e];if(!r){n.__pageReadyPending__=!1,n.pageReady();return}Object.values(r).filter(e=>e&&e.__type__===G.type&&e.__isComponent__&&e.initd&&!e.__componentReadied__).length===0&&(n.__pageReadyPending__=!1,n.pageReady())}pageHide(e){let{bridgeId:t}=e,n=this.instances[t],r=[];Object.values(n).forEach(e=>{e&&(e.__type__===K.type?r.push(e):e.__type__===G.type&&(e.__isComponent__?e.pageHide():r.push(e)))}),r.forEach(e=>{e&&e.pageHide()})}pageUnload(e){let{bridgeId:t}=e,n=this.instances[t];n&&(Object.values(n).forEach(e=>{e&&(e.__type__===G.type&&e.componentDetached(),e.pageUnload())}),D.pop(),delete this.instances[t])}pageScroll(e){let{bridgeId:t,moduleId:n,scrollTop:r}=e,i=this.instances[t][n];i&&i.pageScrollTop({scrollTop:r})}pageResize(e){let{bridgeId:t,size:n}=e,r=this.instances[t];r&&Object.values(r).forEach(e=>{e&&(e.__type__===K.type?e.pageResize(n):e.__type__===G.type&&(e.__isComponent__,e.pageResize(n)))})}componentError(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&r.__type__===G.type&&r.componentError()}componentRouteDone(e){let{bridgeId:t}=e,n=this.instances[t];n&&Object.values(n).forEach(e=>{e?.__type__===G.type&&e.componentRouteDone()})}async triggerEvent(e){let{bridgeId:t,moduleId:n,methodName:r,event:i}=e;if(r===void 0)return;let a=this.instances[t];if(!a){console.warn(`[service] No instances found for bridgeId: ${t}`);return}let o=a[n];if(!o){console.warn(`[service] triggerEvent ${t} ${n} ${r}, instance is not exist`);return}return o.__type__===G.type&&o.__isComponent__&&!o.__componentReadied__?this.queuePendingEvent(o,{instance:o,bridgeId:t,moduleId:n,methodName:r,event:i}):this.dispatchEvent({instance:o,bridgeId:t,moduleId:n,methodName:r,event:i})}},Un=t({getEnterOptionsSync:()=>Gn,getLaunchOptionsSync:()=>Wn});function Wn(){return Y.app?.options}function Gn(){return Y.app?.options}var Kn=t({getLocation:()=>qn,offLocationChange:()=>Qn,onLocationChange:()=>Zn,openLocation:()=>Yn,startLocationUpdate:()=>Jn,stopLocationUpdate:()=>Xn});function qn(e){O(`getLocation`,e)}function Jn(e){O(`startLocationUpdate`,e)}function Yn(e){O(`openLocation`,e)}function Xn(e){O(`stopLocationUpdate`,e)}function Zn(e){e&&O(`onLocationChange`,{success:w.store(e,!0)})}function Qn(e){if(e){let t=w.store(e,!0);O(`offLocationChange`,{success:t}),w.remove(t)}else O(`offLocationChange`),w.remove()}var $n=t({createMapContext:()=>er});function er(e,t){return new tr({mapId:e,obj:t})}var tr=class{constructor(e){this.opts=e}addMarkers(e){O(`addMarkers`,e)}removeMarkers(e){O(`removeMarkers`,e)}includePoints(e){O(`includePoints`,e)}setCenterOffset(e){O(`setCenterOffset`,e)}getCenterLocation(e){O(`getCenterLocation`,e)}getScale(e){O(`getScale`,e)}moveToLocation(e){O(`moveToLocation`,e)}translateMarker(e){O(`translateMarker`,e)}addArc(e){O(`addArc`,e)}removeArc(e){O(`removeArc`,e)}},nr=t({createInnerAudioContext:()=>ar}),rr=1,ir=class{constructor(){this._audioId=rr++,this._src=``,this._startTime=0,this._autoplay=!1,this._loop=!1,this._volume=1,this._playbackRate=1,this._paused=!0,this._listeners={},O(`audioCreate`,{audioId:this._audioId})}get src(){return this._src}set src(e){this._src=e,O(`audioSetProp`,{audioId:this._audioId,prop:`src`,value:e,startTime:this._startTime,loop:this._loop,volume:this._volume,playbackRate:this._playbackRate,autoplay:this._autoplay})}get startTime(){return this._startTime}set startTime(e){this._startTime=Number(e)||0,O(`audioSetProp`,{audioId:this._audioId,prop:`startTime`,value:this._startTime})}get autoplay(){return this._autoplay}set autoplay(e){this._autoplay=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`autoplay`,value:this._autoplay})}get loop(){return this._loop}set loop(e){this._loop=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`loop`,value:this._loop})}get volume(){return this._volume}set volume(e){this._volume=Math.max(0,Math.min(1,Number(e)||0)),O(`audioSetProp`,{audioId:this._audioId,prop:`volume`,value:this._volume})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=Number(e)||1,O(`audioSetProp`,{audioId:this._audioId,prop:`playbackRate`,value:this._playbackRate})}get duration(){return 0}get currentTime(){return 0}get paused(){return this._paused}get buffered(){return 0}play(){this._paused=!1,O(`audioPlay`,{audioId:this._audioId,src:this._src})}pause(){this._paused=!0,O(`audioPause`,{audioId:this._audioId})}stop(){this._paused=!0,O(`audioStop`,{audioId:this._audioId})}seek(e){O(`audioSeek`,{audioId:this._audioId,position:Number(e)||0})}destroy(){O(`audioDestroy`,{audioId:this._audioId}),this._listeners={}}_on(e,t){typeof t==`function`&&(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t))}_off(e,t){this._listeners[e]&&(t?this._listeners[e]=this._listeners[e].filter(e=>e!==t):this._listeners[e]=[])}onPlay(e){this._on(`play`,e)}onPause(e){this._on(`pause`,e)}onStop(e){this._on(`stop`,e)}onEnded(e){this._on(`ended`,e)}onError(e){this._on(`error`,e)}onTimeUpdate(e){this._on(`timeUpdate`,e)}onWaiting(e){this._on(`waiting`,e)}onSeeking(e){this._on(`seeking`,e)}onSeeked(e){this._on(`seeked`,e)}onCanplay(e){this._on(`canplay`,e)}offPlay(e){this._off(`play`,e)}offPause(e){this._off(`pause`,e)}offStop(e){this._off(`stop`,e)}offEnded(e){this._off(`ended`,e)}offError(e){this._off(`error`,e)}offTimeUpdate(e){this._off(`timeUpdate`,e)}offWaiting(e){this._off(`waiting`,e)}offSeeking(e){this._off(`seeking`,e)}offSeeked(e){this._off(`seeked`,e)}offCanplay(e){this._off(`canplay`,e)}};function ar(){return new ir}var or=t({chooseImage:()=>ur,compressImage:()=>lr,previewImage:()=>cr,saveImageToPhotosAlbum:()=>sr});function sr(e){O(`saveImageToPhotosAlbum`,e)}function cr(e){O(`previewImage`,e)}function lr(e){O(`compressImage`,e)}function ur(e){O(`chooseImage`,e)}var dr=t({chooseMedia:()=>pr,chooseVideo:()=>fr});function fr(e){O(`chooseVideo`,e)}function pr(e){O(`chooseMedia`,e)}var mr=t({exitMiniProgram:()=>vr,navigateBackMiniProgram:()=>_r,navigateToMiniProgram:()=>gr,restartMiniProgram:()=>hr});function hr(e){O(`restartMiniProgram`,e)}function gr(e){O(`navigateToMiniProgram`,e)}function _r(e){O(`navigateBackMiniProgram`,e)}function vr(e){O(`exitMiniProgram`,e)}var yr=t({downloadFile:()=>br});function br(e){O(`downloadFile`,e)}var xr=t({request:()=>Sr});function Sr(e){O(`request`,e)}var Cr=t({uploadFile:()=>wr});function wr(e){O(`uploadFile`,e)}var Tr=t({closeSocket:()=>Or,connectSocket:()=>Er,onSocketClose:()=>Mr,onSocketError:()=>jr,onSocketMessage:()=>Ar,onSocketOpen:()=>kr,sendSocketMessage:()=>Dr}),X=class{constructor(e){this.socketId=e,this._readyState=0}send(e={}){let{data:t,success:n,fail:r,complete:i,...a}=e,o={socketId:this.socketId,data:t,...a};return h(n)&&(o.success=w.store(n)),h(r)&&(o.fail=w.store(r)),h(i)&&(o.complete=w.store(i)),O(`sendSocketMessage`,o)}close(e={}){let{code:t=1e3,reason:n=``,success:r,fail:i,complete:a,...o}=e,s={socketId:this.socketId,code:t,reason:n,...o};return h(r)&&(s.success=w.store(r)),h(i)&&(s.fail=w.store(i)),h(a)&&(s.complete=w.store(a)),O(`closeSocket`,s)}onOpen(e){if(h(e))return O(`onSocketOpen`,{socketId:this.socketId,callback:w.store(e,!0)})}offOpen(e){return O(`offSocketOpen`,{socketId:this.socketId,callback:e})}onMessage(e){if(h(e))return O(`onSocketMessage`,{socketId:this.socketId,callback:w.store(e,!0)})}offMessage(e){return O(`offSocketMessage`,{socketId:this.socketId,callback:e})}onError(e){if(h(e))return O(`onSocketError`,{socketId:this.socketId,callback:w.store(e,!0)})}offError(e){return O(`offSocketError`,{socketId:this.socketId,callback:e})}onClose(e){if(h(e))return O(`onSocketClose`,{socketId:this.socketId,callback:w.store(e,!0)})}offClose(e){return O(`offSocketClose`,{socketId:this.socketId,callback:e})}get readyState(){return this._readyState}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}};function Er(e={}){let{url:t,header:n={},protocols:r=[],tcpNoDelay:i=!1,perMessageDeflate:a=!1,timeout:o,forceCellularNetwork:s=!1,success:c,fail:l,complete:u,...d}=e;if(!t){let e=Error(`url is required`);throw h(l)&&l(e),h(u)&&u(e),e}let f=`socket_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,p=new X(f),m={socketId:f,url:t,header:n,protocols:r,tcpNoDelay:i,perMessageDeflate:a,timeout:o,forceCellularNetwork:s,...d};return h(c)&&(m.success=w.store(e=>{p._readyState=X.OPEN,c(e)})),h(l)&&(m.fail=w.store(e=>{p._readyState=X.CLOSED,l(e)})),h(u)&&(m.complete=w.store(u)),O(`connectSocket`,m),p}function Dr(e){return O(`sendSocketMessage`,e)}function Or(e){return O(`closeSocket`,e)}function kr(e){return O(`onSocketOpen`,{callback:w.store(e,!0)})}function Ar(e){return O(`onSocketMessage`,{callback:w.store(e,!0)})}function jr(e){return O(`onSocketError`,{callback:w.store(e,!0)})}function Mr(e){return O(`onSocketClose`,{callback:w.store(e,!0)})}var Nr=t({getAccountInfoSync:()=>Pr});function Pr(){return O(`getAccountInfoSync`)}var Fr=t({authorize:()=>Ir});function Ir(e){O(`authorize`,e)}var Lr=t({login:()=>Rr});function Rr(e){O(`login`,e)}var zr=t({login:()=>Br});function Br(e){O(`login`,e)}var Vr=t({getPrivacySetting:()=>Hr});function Hr(e){O(`getPrivacySetting`,e)}var Ur=t({getSetting:()=>Gr,openSetting:()=>Wr});function Wr(e){O(`openSetting`,e)}function Gr(e){O(`getSetting`,e)}var Kr=t({getUserInfo:()=>qr});function qr(e){O(`getUserInfo`,e)}var Jr=t({requestPayment:()=>Yr});function Yr(e){O(`requestPayment`,e)}var Xr=t({hideShareMenu:()=>$r,showShareImageMenu:()=>Qr,showShareMenu:()=>Zr});function Zr(e){O(`shareShareMenu`,e)}function Qr(e){O(`showShareImageMenu`,e)}function $r(e){O(`hideShareMenu`,e)}var ei=t({clearStorage:()=>ci,clearStorageSync:()=>ii,getStorage:()=>oi,getStorageInfo:()=>ui,getStorageInfoSync:()=>li,getStorageSync:()=>ni,removeStorage:()=>si,removeStorageSync:()=>ri,setStorage:()=>ai,setStorageSync:()=>ti});function ti(...e){O(`setStorageSync`,e)}function ni(e){return O(`getStorageSync`,e)}function ri(e){return O(`removeStorageSync`,e)}function ii(){O(`clearStorageSync`)}function ai(e){O(`setStorage`,e)}function oi(e){O(`getStorage`,e)}function si(e){O(`removeStorage`,e)}function ci(){O(`clearStorage`)}function li(){return O(`getStorageInfoSync`)}function ui(e){O(`getStorageInfo`,e)}var di=t({createAnimation:()=>fi});function fi(e={}){return new pi(e)}var pi=class{constructor({duration:e=400,timingFunction:t=`linear`,delay:n=0,transformOrigin:r=`50% 50% 0`}={}){this.actions=[],this.currentTransform={},this.currentStepAnimates=[],this.option={transition:{duration:e,timingFunction:t,delay:n},transformOrigin:r}}export(){let e=this.actions;return this.actions=[],{actions:e}}step(e={}){for(let e of this.currentStepAnimates)e.type===`style`?this.currentTransform[`${e.type}.${e.args[0]}`]=e:this.currentTransform[e.type]=e;return this.actions.push({animates:Object.keys(this.currentTransform).reduce((e,t)=>[].concat(...e,[this.currentTransform[t]]),[]),option:{transformOrigin:e.transformOrigin===void 0?this.option.transformOrigin:e.transformOrigin,transition:{duration:e.duration===void 0?this.option.transition.duration:e.duration,timingFunction:e.timingFunction===void 0?this.option.transition.timingFunction:e.timingFunction,delay:e.delay===void 0?this.option.transition.delay:e.delay}}}),this.currentStepAnimates=[],this}backgroundColor(e){return this.currentStepAnimates.push({type:`style`,args:[`background-color`,e]}),this}bottom(e){return this.currentStepAnimates.push({type:`style`,args:[`bottom`,b(e)]}),this}height(e){return this.currentStepAnimates.push({type:`style`,args:[`height`,b(e)]}),this}left(e){return this.currentStepAnimates.push({type:`style`,args:[`left`,b(e)]}),this}matrix(e=1,t=0,n=0,r=1,i=1,a=1){return this.currentStepAnimates.push({type:`matrix`,args:[e,t,n,r,i,a]}),this}matrix3d(e=1,t=0,n=0,r=0,i=0,a=1,o=0,s=0,c=0,l=0,u=1,d=0,f=0,p=0,m=0,ee=1){return this.currentStepAnimates.push({type:`matrix3d`,args:[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,ee]}),this}opacity(e){return this.currentStepAnimates.push({type:`style`,args:[`opacity`,e]}),this}right(e){return this.currentStepAnimates.push({type:`style`,args:[`right`,b(e)]}),this}rotate(e=0){return this.currentStepAnimates.push({type:`rotate`,args:[e]}),this}rotate3d(e=0,t=0,n=0,r=0){return this.currentStepAnimates.push({type:`rotate3d`,args:[e,t,n,r]}),this}rotateX(e){return this.currentStepAnimates.push({type:`rotateX`,args:[e]}),this}rotateY(e){return this.currentStepAnimates.push({type:`rotateY`,args:[e]}),this}rotateZ(e){return this.currentStepAnimates.push({type:`rotateZ`,args:[e]}),this}scale(e=1,t=1){return this.currentStepAnimates.push({type:`scale`,args:[e,t]}),this}scale3d(e=1,t=1,n=1){return this.currentStepAnimates.push({type:`scale3d`,args:[e,t,n]}),this}scaleX(e=1){return this.currentStepAnimates.push({type:`scaleX`,args:[e]}),this}scaleY(e=1){return this.currentStepAnimates.push({type:`scaleY`,args:[e]}),this}scaleZ(e=1){return this.currentStepAnimates.push({type:`scaleZ`,args:[e]}),this}skew(e=0,t=0){return this.currentStepAnimates.push({type:`skew`,args:[e,t]}),this}skewX(e=0){return this.currentStepAnimates.push({type:`skewX`,args:[e]}),this}skewY(e=0){return this.currentStepAnimates.push({type:`skewY`,args:[e]}),this}top(e){return this.currentStepAnimates.push({type:`style`,args:[`top`,b(e)]}),this}translate(e=0,t=0){return this.currentStepAnimates.push({type:`translate`,args:[e,t]}),this}translate3d(e=0,t=0,n=0){return this.currentStepAnimates.push({type:`translate3d`,args:[e,t,n]}),this}translateX(e=0){return this.currentStepAnimates.push({type:`translateX`,args:[e]}),this}translateY(e=0){return this.currentStepAnimates.push({type:`translateY`,args:[e]}),this}width(e){return this.currentStepAnimates.push({type:`style`,args:[`width`,b(e)]}),this}},mi=t({setBackgroundColor:()=>gi,setBackgroundTextStyle:()=>hi});function hi(e){O(`setBackgroundTextStyle`,e)}function gi(e){O(`setBackgroundColor`,e)}var _i=t({canvasToTempFilePath:()=>xi,createCanvasContext:()=>yi,createContext:()=>vi,drawCanvas:()=>bi});function vi(){return new Si}function yi(e,t){return new Si(e,Z(t))}function bi(e={}){let t={...e,moduleId:e.moduleId||Z(e.component)};delete t.component,O(`drawCanvas`,t,`render`)}function xi(e={},t){let n={...e,moduleId:e.moduleId||Z(t||e.component)};delete n.component,O(`canvasToTempFilePath`,n,`render`)}function Z(e){return e?.__id__||D.getPageInfo()?.id}var Si=class{constructor(e=``,t=null){this.canvasId=e,this.moduleId=t,this.actions=[]}pushAction(e,...t){return this.actions.push({type:e,args:t}),this}getActions(){return this.actions.slice()}draw(e=!1,t){this.canvasId&&(bi({canvasId:this.canvasId,moduleId:this.moduleId,actions:this.getActions(),reserve:e,success:t}),this.actions=[])}beginPath(){return this.pushAction(`beginPath`)}closePath(){return this.pushAction(`closePath`)}moveTo(e,t){return this.pushAction(`moveTo`,e,t)}lineTo(e,t){return this.pushAction(`lineTo`,e,t)}rect(e,t,n,r){return this.pushAction(`rect`,e,t,n,r)}arc(e,t,n,r,i,a=!1){return this.pushAction(`arc`,e,t,n,r,i,a)}quadraticCurveTo(e,t,n,r){return this.pushAction(`quadraticCurveTo`,e,t,n,r)}bezierCurveTo(e,t,n,r,i,a){return this.pushAction(`bezierCurveTo`,e,t,n,r,i,a)}fill(){return this.pushAction(`fill`)}stroke(){return this.pushAction(`stroke`)}clearRect(e,t,n,r){return this.pushAction(`clearRect`,e,t,n,r)}fillText(e,t,n,r){return this.pushAction(`fillText`,e,t,n,r)}drawImage(e,...t){return this.pushAction(`drawImage`,e,...t)}save(){return this.pushAction(`save`)}restore(){return this.pushAction(`restore`)}translate(e,t){return this.pushAction(`translate`,e,t)}rotate(e){return this.pushAction(`rotate`,e)}scale(e,t){return this.pushAction(`scale`,e,t)}setShadow(e,t,n,r){return this.pushAction(`setShadow`,e,t,n,r)}setFillStyle(e){return this.pushAction(`setFillStyle`,e)}setStrokeStyle(e){return this.pushAction(`setStrokeStyle`,e)}setGlobalAlpha(e){return this.pushAction(`setGlobalAlpha`,e)}setLineCap(e){return this.pushAction(`setLineCap`,e)}setLineJoin(e){return this.pushAction(`setLineJoin`,e)}setLineWidth(e){return this.pushAction(`setLineWidth`,e)}setMiterLimit(e){return this.pushAction(`setMiterLimit`,e)}setFontSize(e){return this.pushAction(`setFontSize`,e)}},Ci=t({nextTick:()=>Ei}),Q=[],wi=null;function Ti(){let e=Q;Q=[],wi=null;for(let t=0;t<e.length;t++)e[t]()}function Ei(e){h(e)&&(Q.push(e),wi||=setTimeout(Ti,0))}var Di=t({disableAlertBeforeUnload:()=>Fi,enableAlertBeforeUnload:()=>Pi,hideLoading:()=>Ni,hideToast:()=>ki,showActionSheet:()=>Mi,showLoading:()=>ji,showModal:()=>Ai,showToast:()=>Oi});function Oi(e){O(`showToast`,e)}function ki(e){O(`hideToast`,e)}function Ai(e){O(`showModal`,e)}function ji(e){O(`showLoading`,e)}function Mi(e){O(`showActionSheet`,e)}function Ni(e){O(`hideLoading`,e)}function Pi(e){O(`enableAlertBeforeUnload`,e)}function Fi(e){O(`disableAlertBeforeUnload`,e)}var Ii=t({getMenuButtonBoundingClientRect:()=>Li,offMenuButtonBoundingClientRectWeightChange:()=>zi,onMenuButtonBoundingClientRectWeightChange:()=>Ri}),$=new Set;function Li(){return O(`getMenuButtonBoundingClientRect`)}function Ri(e){h(e)&&$.add(e)}function zi(e){h(e)?$.delete(e):$.clear()}var Bi=t({hideNavigationBarLoading:()=>Wi,setNavigationBarColor:()=>Ui,setNavigationBarTitle:()=>Hi,showNavigationBarLoading:()=>Vi});function Vi(e){O(`showNavigationBarLoading`,e)}function Hi(e){O(`setNavigationBarTitle`,e)}function Ui(e){O(`setNavigationBarColor`,e)}function Wi(e){O(`hideNavigationBarLoading`,e)}var Gi=t({startPullDownRefresh:()=>qi,stopPullDownRefresh:()=>Ki});function Ki(e){O(`stopPullDownRefresh`,e)}function qi(e){O(`startPullDownRefresh`,e)}var Ji=t({pageScrollTo:()=>Yi});function Yi(e){O(`pageScrollTo`,e)}var Xi=t({onWindowResize:()=>Zi});function Zi(e){e&&O(`onWindowResize`,{success:e})}var Qi=Object.assign({"./core/base/app-event/index.js":we,"./core/base/index.js":Pe,"./core/base/performance/index.js":Re,"./core/base/subpackage/index.js":Ue,"./core/base/system/index.js":Ke,"./core/base/update/index.js":tt,"./core/camera/index.js":it,"./core/data-analysis/index.js":st,"./core/device/bluetooth/index.js":ut,"./core/device/bluetooth-ble/index.js":St,"./core/device/clipboard/index.js":It,"./core/device/contact/index.js":zt,"./core/device/keyboard/index.js":Ht,"./core/device/memory/index.js":Wt,"./core/device/network/index.js":qt,"./core/device/phone/index.js":Yt,"./core/device/scan/index.js":Zt,"./core/device/vibrate/index.js":$t,"./core/ext/index.js":nn,"./core/file/index.js":ln,"./core/life-cycle/index.js":Un,"./core/location/index.js":Kn,"./core/map/index.js":$n,"./core/media/audio/index.js":nr,"./core/media/image/index.js":or,"./core/media/video/index.js":dr,"./core/navigate/index.js":mr,"./core/network/download/index.js":yr,"./core/network/request/index.js":xr,"./core/network/upload/index.js":Cr,"./core/network/websocket/index.js":Tr,"./core/open-api/account-info/index.js":Nr,"./core/open-api/authorize/index.js":Fr,"./core/open-api/index.js":Lr,"./core/open-api/login/index.js":zr,"./core/open-api/privacy/index.js":Vr,"./core/open-api/setting/index.js":Ur,"./core/open-api/user-info/index.js":Kr,"./core/payment/index.js":Jr,"./core/route/index.js":ve,"./core/share/index.js":Xr,"./core/storage/index.js":ei,"./core/ui/animation/index.js":di,"./core/ui/background/index.js":mi,"./core/ui/canvas/index.js":_i,"./core/ui/custom-component/index.js":Ci,"./core/ui/interaction/index.js":Di,"./core/ui/menu/index.js":Ii,"./core/ui/navigation-bar/index.js":Bi,"./core/ui/pull-down-refresh/index.js":Gi,"./core/ui/scroll/index.js":Ji,"./core/ui/window/index.js":Xi,"./core/wxml/intersection-observer/index.js":Sn,"./core/wxml/selector-query/index.js":bn}),$i={};for(let e of Object.values(Qi))for(let[t,n]of Object.entries(e))$i[t]=n;var ea=new Proxy($i,{get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`||r!==void 0||t===`webpackJsonp`?r:(...e)=>O(t,...e)},set(e,t,n,r){return Reflect.set(e,t,n,r)}}),ta=new class{constructor(){this.init()}init(){let e=globalThis.__diminaApiNamespaces||[];if(e.length===0&&globalThis.name)try{e=JSON.parse(globalThis.name).apiNamespaces||[]}catch{}for(let t of[`dd`,`wx`,...e])globalThis[t]=ea;globalThis.modRequire=C,globalThis.modDefine=he,globalThis.global={},globalThis.App=e=>J.createAppModule(e),globalThis.Page=e=>{J.createModule(e,globalThis.__extraInfo,K.type)},globalThis.Component=e=>{J.createModule(e,globalThis.__extraInfo,G.type)},globalThis.Behavior=e=>e,globalThis.getApp=e=>{let t=Y.app;return!t&&e?.allowDefault?{}:t},globalThis.getCurrentPages=()=>D.stack()}},na={navigateBack:Ce,navigateTo:Se,reLaunch:be,redirectTo:xe,switchTab:ye};return new class{constructor(){console.log(`[service] init`),this.env=ta,this.message=E,this.init()}init(){this.message.on(`loadResource`,e=>{let{appId:t,bridgeId:n,pagePath:r,root:i=`.`,baseUrl:a=`/`,hostEnv:o}=e;o&&T.init(o),J.loadResource({appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a})}),this.message.on(`t`,async e=>{let{bridgeId:t,moduleId:n,methodName:r,event:i,success:a}=e;if(r===void 0)return;let o=await Y.triggerEvent({bridgeId:t,moduleId:n,methodName:r,event:i});o!==void 0&&this.message.send({type:`triggerCallback`,target:`render`,body:{bridgeId:t,moduleId:n,success:a,data:o}})}),this.message.on(`triggerCallback`,e=>{let{id:t,args:n}=e;w.invoke(t,n)}),this.onAppMsg(),this.onModuleMsg()}onAppMsg(){this.message.on(`resourceLoaded`,e=>{let{bridgeId:t,scene:n,pagePath:r,query:i,stackId:a}=e;Y.createApp({scene:n,pagePath:r,query:i});let o=J.getModuleByPath(r);if(!o){console.error(`[service] resourceLoaded: module not found, pagePath: ${r}`);return}let s=J.getPropsByPath(o.usingComponents),c=`page_${le()}`;Y.createInstance({bridgeId:t,moduleId:c,path:r,query:i,stackId:a}),E.send({type:`firstRender`,target:`render`,body:{bridgeId:t,pageId:c,pagePath:r,initialProps:s,query:i}})}),this.message.on(`appShow`,()=>{Y.appShow()}),this.message.on(`appHide`,()=>{Y.appHide()}),this.message.on(`stackShow`,({stackId:e})=>{Y.stackShow(e)}),this.message.on(`stackHide`,({stackId:e})=>{Y.stackHide(e)})}onModuleMsg(){this.message.on(`mC`,e=>{Y.createInstance(e)}),this.message.on(`mR`,e=>{Y.moduleReady(e)}),this.message.on(`mU`,e=>{Y.moduleUnmounted(e)}),this.message.on(`pageUnload`,e=>{Y.pageUnload(e)}),this.message.on(`pageShow`,e=>{Y.pageShow(e)}),this.message.on(`pageReady`,e=>{Y.pageReady(e)}),this.message.on(`pageHide`,e=>{Y.pageHide(e)}),this.message.on(`pagePullDownRefresh`,()=>{}),this.message.on(`pageReachBottom`,()=>{}),this.message.on(`pageShareAppMessage`,()=>{}),this.message.on(`pageScroll`,e=>{Y.pageScroll(e)}),this.message.on(`pageResize`,e=>{Y.pageResize(e)}),this.message.on(`onTabItemTap`,()=>{}),this.message.on(`pageRouteDone`,e=>{let{bridgeId:t}=e;Y.componentRouteDone({bridgeId:t})}),this.message.on(`componentError`,e=>{Y.componentError(e)}),this.message.on(`h5SdkAction`,async(e={})=>{let t=e?.name?.replace(/h5/i,``),{url:n}=e?.params?.data?.params||{};if(e.params&&(e.params.data={...e.params?.data,...e.params?.data?.params||{}}),t===`postMessage`&&e.parentWebViewId){let{moduleId:t,attrs:n,params:r}=e,i={detail:{data:[r?.data?.params?.data]}},a=n.message,o=e.parentWebViewId,s=await Y.triggerEvent({bridgeId:o,moduleId:t,methodName:a,event:i});s!==void 0&&this.message.send({type:`triggerCallback`,target:`service`,body:{bridgeId:o,moduleId:t,success:r?.success,data:s}})}na[t]?.({url:n,...e.params})})}}})();
|
|
6
|
+
`;console.error(`require ${e} error: ${a}`),n(r)&&r({mod:e,errMsg:t.message})}i.exports=t.exports===void 0?a:t.exports}return n(t)&&t(i.exports),i.exports}C.async=async e=>new Promise((t,n)=>{try{t(C(e))}catch(t){n(Error(`${t.message}: Failed to initialize asynchronous loading for module '${e}'`))}});var w=new class{constructor(){this.callbacks={}}store(e,t,n=g()){if(t){for(let[t,n]of Object.entries(this.callbacks))if(n.callback===e)return t}return this.callbacks[n]={callback:e,keep:t},n}invoke(e,t){if(e===void 0)return;let r=this.callbacks[e];r&&n(r.callback)&&(r.callback(t),r.keep||delete this.callbacks[e])}remove(e){e?Object.keys(this.callbacks).forEach(t=>{e===t&&delete this.callbacks[t]}):Object.entries(this.callbacks).forEach(([e,t])=>{t.keep&&delete this.callbacks[e]})}},T=new class{constructor(){this.reset()}reset(){this.active=!1,this.snapshot={systemInfo:null,menuRect:null}}init(e={}){this.active=!0,this.snapshot={...this.snapshot,...e}}update(e={}){this.snapshot={...this.snapshot,...e}}get(e){return this.active?this.snapshot[e]??null:null}getSystemInfo(){return this.get(`systemInfo`)}getMenuRect(){return this.get(`menuRect`)}};function fe(e){return{all:e||=new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(e){e(n)}),(r=e.get(`*`))&&r.slice().map(function(e){e(t,n)})}}}var E=new class e{constructor(){this.event=fe(),this.init()}init(){v?globalThis.onmessage=e=>{this.handleMsg(e.data)}:DiminaServiceBridge.onMessage=this.handleMsg.bind(this)}handleMsg(e){console.log(`[service] receive msg: `,v?e:JSON.stringify(e));let{type:t,body:n}=e;this.event.emit(t,n)}on(e,t){this.event.on(e,t)}off(e){this.event.off(e)}send(t){return v?e.prototype.send=function(e){e.method=`publish`,globalThis.postMessage(e)}:e.prototype.send=function(e){return DiminaServiceBridge.publish(e.body.bridgeId||``,e)},this.send(t)}invoke(t){return v?e.prototype.invoke=function(e){e.method=`invoke`,globalThis.postMessage(e)}:e.prototype.invoke=function(e){return DiminaServiceBridge.invoke(e)},this.invoke(t)}},D=new class{#e=[];#t=``;setInitId(e){this.#t=e}push(e,t){this.stack(t).push(e)}pop(){this.stack().length>0&&this.stack().pop()}getPageInfo(){let e=this.stack();return e[e.length-1]||{id:this.#t}}pushStack(e){let t={id:e,pages:[]};return this.#e.push(t),t}popStack(e){if(e){let t=this.#e.findIndex(t=>t.id===e);t!==-1&&this.#e.splice(t,1)}else this.#e.length>0&&this.#e.pop()}stack(e){if(e){let t=this.#e.find(t=>t.id===e);return t||=this.pushStack(e),t.pages}else{let e=this.#e[this.#e.length-1];return e?e.pages:this.pushStack(Date.now()).pages}}},pe={getWindowInfo:()=>T.getSystemInfo(),getSystemInfoSync:()=>T.getSystemInfo(),getAppBaseInfo:()=>T.getSystemInfo(),getDeviceInfo:()=>T.getSystemInfo(),getMenuButtonBoundingClientRect:()=>T.getMenuRect()};function O(e,t,r=`container`){let i=pe[e];if(r===`container`&&i){let e=i();if(e)return e}let a;if(t===void 0||typeof t==`string`||Array.isArray(t))a=t;else if(n(t))a={success:w.store(t,!0)};else{let{success:e,fail:r,complete:i,keep:o,evtId:s,...c}=t;a=c,n(e)?a.success=w.store(e,o,s):a.success=e,n(r)&&(a.fail=w.store(r,o,s)),n(i)&&(a.complete=w.store(i,o,s))}let o={type:`invokeAPI`,target:r,body:{name:e,bridgeId:D.getPageInfo().id,params:a}};return r===`container`?E.invoke(o):E.send(o)}var me=t({navigateBack:()=>ye,navigateTo:()=>ve,reLaunch:()=>ge,redirectTo:()=>_e,switchTab:()=>he});function he(e){e.url=y(D.getPageInfo().route,e.url),O(`switchTab`,e)}function ge(e){e.url=y(D.getPageInfo().route,e.url),O(`reLaunch`,e)}function _e(e){let t=y(D.getPageInfo().route,e.url);D.getPageInfo().route!==t&&(e.url=t,O(`redirectTo`,e))}function ve(e){e.url=y(D.getPageInfo().route,e.url),O(`navigateTo`,e)}function ye(e){O(`navigateBack`,e)}var be=t({offAppHide:()=>Ee,offAppShow:()=>Te,offError:()=>Se,onAppHide:()=>we,onAppRoute:()=>ke,onAppShow:()=>Ce,onError:()=>xe,onPageNotFound:()=>Oe,onUnhandledRejection:()=>De});function xe(e){O(`onError`,e)}function Se(e){O(`offError`,e)}function Ce(e){O(`onAppShow`,e)}function we(e){O(`onAppHide`,e)}function Te(e){O(`offAppShow`,e)}function Ee(e){O(`offAppHide`,e)}function De(){}function Oe(){}function ke(){}var Ae=t({canIUse:()=>Ne,env:()=>je});function je(){return{USER_DATA_PATH:`difile://`}}var Me=new Set([`nextTick`,`getUpdateManager`,`UpdateManager`,`UpdateManager.applyUpdate`,`UpdateManager.onCheckForUpdate`,`UpdateManager.onUpdateFailed`,`UpdateManager.onUpdateReady`,`getPerformance`]);function Ne(e){if(Me.has(e))return!0;try{return O(`canIUse`,e)}catch(t){return console.warn(`[canIUse] check ${e} error:`,t),!1}}var Pe=t({getPerformance:()=>Fe});function Fe(){return Ie.getInstance()}var Ie=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one Performance instance.`);this.entryList=new Le,e.#e=this}static getInstance(){return e.#e||=new e,e.#e}createObserver(e){let t=new Re(e);return e&&O(`addPerformanceObserver`,{success:w.store(e=>{let n=e?.data?.entryList&&JSON.parse(e?.data?.entryList)||[];n&&(this.entryList.push(n),t.notify(n))},!0)},`render`),t}getEntries(){return this.entryList.getEntries()}getEntriesByName(e,t){return this.entryList.getEntriesByName(e,t)}getEntriesByType(e){return this.entryList.getEntriesByType(e)}setBufferSize(e){this.entryList.maxEntrySize=e}},Le=class{constructor(){this._list=[],this.maxEntrySize=30}push(e){for(let t of e)this._list.length>=this.maxEntrySize&&this._list.shift(),this._list.push(t)}getEntriesByName(e,t){return this._entryFilter(e,t)}getEntriesByType(e){return this._entryFilter(null,e)}_entryFilter(e,t){return this._list.filter(n=>!(e&&e!==n.name||t&&t!==n.entryType))}getEntries(){return this._list}},Re=class{constructor(e){this.entryTypes=[],this.callback=e}observe(e){this.connected=!0,this.entryTypes=e.entryTypes}notify(e){if(this.connected){let t=new Le;t.push(e.filter(e=>{let t=!1;return this.entryTypes&&this.entryTypes.length>0&&this.entryTypes.forEach(n=>{e.entryType===n&&(t=!0)}),t})),this.callback(t)}}disconnect(){this.connected=!1}},ze=t({loadSubpackage:()=>Ve,preDownloadSubpackage:()=>Be});function Be(e){O(`preDownloadSubpackage`,e)}function Ve(e){O(`loadSubpackage`,e)}var He=t({getAppBaseInfo:()=>Ye,getDeviceInfo:()=>Xe,getSystemInfo:()=>Ke,getSystemInfoAsync:()=>Je,getSystemInfoSync:()=>qe,getWindowInfo:()=>We,openAppAuthorizeSetting:()=>Ge,openSystemBluetoothSetting:()=>Ue});function Ue(e){O(`openSystemBluetoothSetting`,e)}function We(e){return O(`getWindowInfo`,e)}function Ge(e){O(`openAppAuthorizeSetting`,e)}function Ke(e){return new Promise(t=>{t(O(`getSystemInfo`,e))})}function qe(){return O(`getSystemInfoSync`)}function Je(e){O(`getSystemInfoAsync`,e)}function Ye(){return O(`getAppBaseInfo`)}function Xe(){return O(`getDeviceInfo`)}var Ze=t({getUpdateManager:()=>rt}),Qe=`onUpdateStatusChange`,$e=`updatefail`,et=`updateready`,tt=`noupdate`,nt=`updating`;function rt(){return it.getInstance()}var it=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one UpdateManager instance.`);this.hasAppliedUpdate=!1,this.updateFailed=!1,this.updateReady=!1,this.checkForUpdateResult=null,this.updateFailedListeners=[],this.updateReadyListeners=[],this.checkForUpdateListeners=[],E.on(Qe,e=>this.handleUpdateStatusChange(e)),e.#e=this}handleUpdateStatusChange(e={}){let{event:t}=e;if(t===$e){this.updateFailed=!0,this.emit(this.updateFailedListeners);return}if(t===et){this.updateReady=!0,this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult),this.emit(this.updateReadyListeners);return}if(t===nt){this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}if(t===tt){this.checkForUpdateResult={hasUpdate:!1},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}typeof e.hasUpdate==`boolean`&&(this.checkForUpdateResult={hasUpdate:e.hasUpdate},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult))}emit(e,...t){e.slice().forEach(e=>{e(...t)})}static getInstance(){return e.#e||=new e,e.#e}applyUpdate(){if(!this.updateReady)console.error(`[applyUpdate]: update is not ready`);else if(this.hasAppliedUpdate)console.error(`[applyUpdate]: applyUpdate has been called`);else return this.hasAppliedUpdate=!0,O(`applyUpdate`)}onCheckForUpdate(e){typeof e==`function`&&(this.checkForUpdateListeners.push(e),this.checkForUpdateResult&&e(this.checkForUpdateResult))}onUpdateFailed(e){typeof e==`function`&&(this.updateFailedListeners.push(e),this.updateFailed&&e())}onUpdateReady(e){typeof e==`function`&&(this.updateReadyListeners.push(e),this.updateReady&&e())}};it.getInstance();var at=t({createCameraContext:()=>ot});function ot(){return new st}var st=class{constructor(){this.bridgeId=D.getPageInfo().id}takePhoto(e){O(`takePhoto`,e)}startRecord(){O(`startRecord`)}stopRecord(){O(`stopRecord`)}},ct=t({reportAnalytics:()=>lt,reportEvent:()=>ut});function lt(...e){O(`reportAnalytics`,e)}function ut(e,t){O(`reportAnalytics`,{eventId:e,data:t})}var dt=t({closeBluetoothAdapter:()=>St,getBluetoothAdapterState:()=>xt,getBluetoothDevices:()=>bt,getConnectedBluetoothDevices:()=>yt,offBluetoothAdapterStateChange:()=>vt,offBluetoothDeviceFound:()=>_t,onBluetoothAdapterStateChange:()=>gt,onBluetoothDeviceFound:()=>ht,openBluetoothAdapter:()=>mt,startBluetoothDevicesDiscovery:()=>pt,stopBluetoothDevicesDiscovery:()=>ft});function ft(e){O(`stopBluetoothDevicesDiscovery`,e)}function pt(e){O(`startBluetoothDevicesDiscovery`,e)}function mt(e){O(`openBluetoothAdapter`,e)}function ht(e){O(`onBluetoothDeviceFound`,e)}function gt(e){O(`onBluetoothAdapterStateChange`,e)}function _t(){O(`offBluetoothDeviceFound`)}function vt(){O(`offBluetoothAdapterStateChange`)}function yt(e){O(`getConnectedBluetoothDevices`,e)}function bt(e){O(`getBluetoothDevices`,e)}function xt(e){O(`getBluetoothAdapterState`,e)}function St(e){O(`closeBluetoothAdapter`,e)}var Ct=t({closeBLEConnection:()=>It,createBLEConnection:()=>Ft,getBLEDeviceCharacteristics:()=>Pt,getBLEDeviceRSSI:()=>Nt,getBLEDeviceServices:()=>Mt,notifyBLECharacteristicValueChange:()=>jt,offBLECharacteristicValueChange:()=>At,offBLEConnectionStateChange:()=>kt,onBLECharacteristicValueChange:()=>Ot,onBLEConnectionStateChange:()=>Dt,readBLECharacteristicValue:()=>Et,setBLEMTU:()=>Tt,writeBLECharacteristicValue:()=>wt});function wt(e){O(`writeBLECharacteristicValue`,e)}function Tt(e){O(`setBLEMTU`,e)}function Et(e){O(`readBLECharacteristicValue`,e)}function Dt(e){O(`onBLEConnectionStateChange`,e)}function Ot(e){O(`onBLECharacteristicValueChange`,e)}function kt(e){O(`offBLEConnectionStateChange`,e)}function At(){O(`offBLECharacteristicValueChange`)}function jt(e){O(`notifyBLECharacteristicValueChange`,e)}function Mt(e){O(`getBLEDeviceServices`,e)}function Nt(e){O(`getBLEDeviceRSSI`,e)}function Pt(e){O(`getBLEDeviceCharacteristics`,e)}function Ft(e){O(`createBLEConnection`,e)}function It(e){O(`closeBLEConnection`,e)}var Lt=t({getClipboardData:()=>zt,setClipboardData:()=>Rt});function Rt(e){O(`setClipboardData`,e)}function zt(e){O(`getClipboardData`,e)}var Bt=t({addPhoneContact:()=>Ht,chooseContact:()=>Vt});function Vt(e){O(`chooseContact`,e)}function Ht(e){O(`addPhoneContact`,e)}var Ut=t({hideKeyboard:()=>Wt});function Wt(e){O(`hideKeyboard`,e)}var Gt=t({offMemoryWarning:()=>qt,onMemoryWarning:()=>Kt});function Kt(e){O(`onMemoryWarning`,e)}function qt(e){O(`offMemoryWarning`,e)}var Jt=t({getNetworkType:()=>Yt});function Yt(e){O(`getNetworkType`,e)}var Xt=t({makePhoneCall:()=>Zt});function Zt(e){O(`makePhoneCall`,e)}var Qt=t({scanCode:()=>$t});function $t(e){O(`scanCode`,e)}var en=t({vibrateLong:()=>nn,vibrateShort:()=>tn});function tn(e){O(`vibrateShort`,e)}function nn(e){O(`vibrateLong`,e)}var rn=t({extBridge:()=>an,extOffBridge:()=>sn,extOnBridge:()=>on,offLoginStatusChanged:()=>ln,onLoginStatusChanged:()=>cn});function an({event:e,module:t,data:r={},success:i,fail:a,complete:o},s){let c,l,u;n(s)?(c=s,l=s):(c=i,l=a,u=o),O(e,{module:t,data:r,keep:r.isSustain??!0,success:c,fail:l,complete:u})}function on({event:e,module:t,callBack:n,isSustain:r=!0}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOnBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOnBridge 参数 event 为空`);return}if(!n){console.error(`[ERROR]: extOnBridge 参数 callBack 为空`);return}let i=`${t}_${e}`;O(i,{evtId:i,keep:r,success:n})}function sn({event:e,module:t,callBack:n}){if(!t||t===`DMServiceBridgeModule`){console.error(`[ERROR]: extOffBridge \u53C2\u6570 module ${t?`\u503C${t}\u4E0D\u5408\u6CD5`:`为空`}`);return}if(!e){console.error(`[ERROR]: extOffBridge 参数 event 为空`);return}O(`${t}_${e}`,{success:n})}function cn(e){E.on(`notifyLoginStatusChanged`,t=>{e?.(t)})}function ln(){E.off(`notifyLoginStatusChanged`)}var un=t({USER_DATA_PATH:()=>dn,getFileSystemManager:()=>vn}),dn=`difile://`,fn=`not supported in simulator`,pn=class{constructor(e){this.size=e.size||0,this.mode=e.mode||438,this.lastAccessedTime=e.lastAccessedTime||0,this.lastModifiedTime=e.lastModifiedTime||0,this._isFile=e.isFile===void 0?!0:e.isFile,this._isDirectory=e.isDirectory===void 0?!1:e.isDirectory}isFile(){return this._isFile}isDirectory(){return this._isDirectory}};function k(e){throw Error(`FileSystemManager.${e} ${fn}`)}function A(e,t={}){let{fail:n,complete:r}=t;n?.({errMsg:`${e}:fail ${fn}`}),r?.()}function mn(e){return e&&new pn(e)}function hn(e){if(!e||typeof e!=`object`)return e;let t={};for(let[n,r]of Object.entries(e))t[n]=new pn(r);return t}var gn=class{access(e){O(`fsAccess`,e)}accessSync(){k(`accessSync`)}stat(e={}){let{success:t,recursive:n,...r}=e;O(`fsStat`,{...r,recursive:n,success:e=>{if(!t)return;let r=n?hn(e?.stats):mn(e?.stats);t({...e,stats:r})}})}statSync(){k(`statSync`)}readFile(e){O(`fsReadFile`,e)}readFileSync(){k(`readFileSync`)}writeFile(e){O(`fsWriteFile`,e)}writeFileSync(){k(`writeFileSync`)}appendFile(e){O(`fsAppendFile`,e)}appendFileSync(){k(`appendFileSync`)}copyFile(e){O(`fsCopyFile`,e)}copyFileSync(){k(`copyFileSync`)}rename(e){O(`fsRename`,e)}renameSync(){k(`renameSync`)}unlink(e){O(`fsUnlink`,e)}unlinkSync(){k(`unlinkSync`)}mkdir(e){O(`fsMkdir`,e)}mkdirSync(){k(`mkdirSync`)}rmdir(e){O(`fsRmdir`,e)}rmdirSync(){k(`rmdirSync`)}readdir(e){O(`fsReaddir`,e)}readdirSync(){k(`readdirSync`)}getFileInfo(e){O(`fsGetFileInfo`,e)}saveFile(e){O(`fsSaveFile`,e)}saveFileSync(){k(`saveFileSync`)}getSavedFileList(e){O(`fsGetSavedFileList`,e)}removeSavedFile(e){O(`fsRemoveSavedFile`,e)}truncate(e){O(`fsTruncate`,e)}truncateSync(){k(`truncateSync`)}unzip(e){O(`fsUnzip`,e)}open(e){A(`open`,e)}openSync(){k(`openSync`)}close(e){A(`close`,e)}closeSync(){k(`closeSync`)}read(e){A(`read`,e)}readSync(){k(`readSync`)}write(e){A(`write`,e)}writeSync(){k(`writeSync`)}fstat(e){A(`fstat`,e)}fstatSync(){k(`fstatSync`)}ftruncate(e){A(`ftruncate`,e)}ftruncateSync(){k(`ftruncateSync`)}readCompressedFile(e){A(`readCompressedFile`,e)}readCompressedFileSync(){k(`readCompressedFileSync`)}readZipEntry(e){A(`readZipEntry`,e)}},_n;function vn(){return _n||=new gn,_n}var yn=[`onLaunch`,`onShow`,`onHide`],bn=[`globalData`],xn=class{constructor(e,t){this.appModule=e,this.options=t,this.init()}init(){this.initGlobalData(),this.initLifecycle(),this.initCustomMethods(),this.invokeSomeLifecycle()}initGlobalData(){this.globalData=this.appModule.moduleInfo.globalData}initLifecycle(){yn.forEach(e=>{let t=this.appModule.moduleInfo[e];n(t)&&(this[e]=t.bind(this))})}initCustomMethods(){let e=this.appModule.moduleInfo;for(let t in e)yn.includes(t)||bn.includes(t)||(n(e[t])?this[t]=e[t].bind(this):this[t]=e[t])}invokeSomeLifecycle(){this.onLaunch?.(this.options),this.onShow?.(this.options)}appShow(){this.onShow?.(this.options)}appHide(){this.onHide?.()}},Sn=new Set([`2d`]),Cn=new Set([`webgl`,`experimental-webgl`,`webgl2`]),wn=new Set([`createLinearGradient`,`createPattern`,`createRadialGradient`]),Tn=new Set([`createBuffer`,`createFramebuffer`,`createProgram`,`createRenderbuffer`,`createShader`,`createTexture`]),En=new Set([`getAttribLocation`,`getUniformLocation`]),j={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,FALSE:0,TRUE:1,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPILE_STATUS:35713},Dn=1,On=1;function M(){let e=D.getPageInfo();return e?.bridgeId||e?.id||``}function N(e,t,n){E.send({type:`invokeAPI`,target:`render`,body:{bridgeId:e,name:t,params:n}})}function kn(e){Promise.resolve().then(e)}function An(e){return Object.prototype.toString.call(e)===`[object Object]`}function jn(e){return typeof ArrayBuffer>`u`||!ArrayBuffer.isView(e)?null:e instanceof DataView?{__canvasTypedArray:`DataView`,data:Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}:{__canvasTypedArray:e.constructor.name,data:Array.from(e)}}function P(e){if(e==null)return e;if(e.__canvasResourceId)return{__canvasResourceId:e.__canvasResourceId};if(e.__diminaCanvasNode)return{__canvasNodeId:e.nodeId};let t=jn(e);if(t)return t;if(typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer)return{__canvasArrayBuffer:!0,data:Array.from(new Uint8Array(e))};if(Array.isArray(e))return e.map(e=>P(e));if(An(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=P(r);return t}return e}function F(e){return Array.from(e).map(e=>P(e))}function I(e=`canvas_resource`){return`${e}_${g()}`}var Mn=class{constructor(e,t){return this.__canvasResourceId=t,this.__canvasProxyValue=Dn++,this.canvas=e,new Proxy(this,{get(e,n){if(n in e)return e[n];if(typeof n!=`symbol`)return(...r)=>{e.canvas.enqueueOperation({op:`resourceCall`,resourceId:t,method:n,args:F(r)})}}})}valueOf(){return this.__canvasProxyValue}toString(){return String(this.__canvasProxyValue)}},Nn=class{constructor(e,t){this.__canvasResourceId=t,this.canvas=e,this.imageId=t,this.onload=null,this.onerror=null,this.width=0,this.height=0,this._src=``,this.canvas.enqueueOperation({op:`createImage`,imageId:t})}get src(){return this._src}set src(e){this._src=e;let t=w.store((e={})=>{this.width=e.width||this.width,this.height=e.height||this.height,n(this.onload)&&this.onload(e)}),r=w.store((e={})=>{n(this.onerror)&&this.onerror(e)});this.canvas.enqueueOperation({op:`imageSetSrc`,imageId:this.imageId,src:e,onload:t,onerror:r})}},Pn=class{constructor(e,t){return this.canvas=e,this.contextId=t,this.state={fillStyle:`#000000`,strokeStyle:`#000000`,font:`10px sans-serif`,globalAlpha:1,lineWidth:1},new Proxy(this,{get(e,t){if(t in e)return e[t];if(t in e.state)return e.state[t];if(typeof t!=`symbol`)return(...n)=>e.call(t,n)},set(e,n,r){return e.state[n]=r,e.canvas.enqueueOperation({op:`contextSetProperty`,contextId:t,prop:n,value:P(r)}),!0}})}call(e,t){if(e===`measureText`)return{width:String(t[0]??``).length*10};let n=wn.has(e)?I():void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:F(t),resultId:n}),n)return new Mn(this.canvas,n)}},Fn=class{constructor(e,t,n){return this.canvas=e,this.contextId=t,this.contextType=n,new Proxy(this,{get(e,t){if(t in e)return e[t];if(Object.prototype.hasOwnProperty.call(j,t))return j[t];if(t===`drawingBufferWidth`)return e.canvas.width;if(t===`drawingBufferHeight`)return e.canvas.height;if(typeof t!=`symbol`)return(...n)=>e.call(t,n)}})}call(e,t){switch(e){case`getParameter`:return this.getParameter(t[0]);case`getShaderParameter`:case`getProgramParameter`:return!0;case`getShaderInfoLog`:case`getProgramInfoLog`:return``;case`getError`:return j.NO_ERROR;case`isContextLost`:return!1;case`checkFramebufferStatus`:return j.FRAMEBUFFER_COMPLETE;case`getContextAttributes`:return{};case`getSupportedExtensions`:return[];case`getExtension`:return null;default:break}let n=Tn.has(e)||En.has(e)?I(`webgl_resource`):void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:F(t),resultId:n}),n)return new Mn(this.canvas,n)}getParameter(e){let{width:t,height:n}=this.canvas;switch(e){case j.VERSION:return`WebGL 1.0`;case j.SHADING_LANGUAGE_VERSION:return`WebGL GLSL ES 1.0`;case j.VENDOR:return`Dimina`;case j.RENDERER:return`Dimina WebGL Proxy`;case j.VIEWPORT:return[0,0,t,n];case j.MAX_VIEWPORT_DIMS:return[t||4096,n||4096];case j.ALIASED_POINT_SIZE_RANGE:return[1,64];case j.ALIASED_LINE_WIDTH_RANGE:return[1,1];case j.COLOR_CLEAR_VALUE:return[0,0,0,0];case j.COLOR_WRITEMASK:case j.DEPTH_WRITEMASK:return!0;case j.COMPRESSED_TEXTURE_FORMATS:return[];case j.MAX_TEXTURE_SIZE:case j.MAX_CUBE_MAP_TEXTURE_SIZE:case j.MAX_RENDERBUFFER_SIZE:return 4096;case j.MAX_VERTEX_ATTRIBS:return 16;case j.MAX_TEXTURE_IMAGE_UNITS:case j.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case j.MAX_COMBINED_TEXTURE_IMAGE_UNITS:return 8;case j.MAX_VERTEX_UNIFORM_VECTORS:case j.MAX_FRAGMENT_UNIFORM_VECTORS:case j.MAX_VARYING_VECTORS:return 128;default:return 0}}},In=class{constructor({nodeId:e,bridgeId:t=M(),width:n=300,height:r=150,type:i=`2d`,offscreen:a=!1}){this.__diminaCanvasNode=!0,this.nodeId=e,this.bridgeId=t,this.type=i,this.offscreen=a,this.contexts=new Map,this.pendingOperations=[],this.flushScheduled=!1,this._width=n,this._height=r}get width(){return this._width}set width(e){this._width=e,this.enqueueOperation({op:`setCanvasProperty`,prop:`width`,value:e})}get height(){return this._height}set height(e){this._height=e,this.enqueueOperation({op:`setCanvasProperty`,prop:`height`,value:e})}getContext(e=`2d`,t){let n=String(e).toLowerCase();if(!Sn.has(n)&&!Cn.has(n))return null;if(this.contexts.has(n))return this.contexts.get(n);let r=I(`canvas_context`);this.enqueueOperation({op:`getContext`,contextId:r,contextType:n,attributes:P(t)});let i=Cn.has(n)?new Fn(this,r,n):new Pn(this,r);return this.contexts.set(n,i),i}createImage(){return new Nn(this,I(`canvas_image`))}requestAnimationFrame(e){let t=On++,r=w.store(t=>{n(e)&&e(t)});return N(this.bridgeId,`canvasNodeRequestAnimationFrame`,{nodeId:this.nodeId,requestId:t,callback:r}),t}cancelAnimationFrame(e){N(this.bridgeId,`canvasNodeCancelAnimationFrame`,{nodeId:this.nodeId,requestId:e})}enqueueOperation(e){this.pendingOperations.push(e),!this.flushScheduled&&(this.flushScheduled=!0,kn(()=>this.flushOperations()))}flushOperations(){if(this.flushScheduled=!1,this.pendingOperations.length===0)return;let e=this.pendingOperations;this.pendingOperations=[],N(this.bridgeId,`canvasNodeFlush`,{nodeId:this.nodeId,operations:e})}};function Ln(e,t=M()){return!e||e.__diminaNodeType!==`dimina-canvas-node`?e:new In({nodeId:e.nodeId,bridgeId:t,width:e.width,height:e.height,type:e.type})}function Rn(e,t=M()){return Array.isArray(e)?e.map(e=>Rn(e,t)):!e||typeof e!=`object`?e:e.node?{...e,node:Ln(e.node,t)}:e}function zn(e={}){let t=Number(e.width)||300,n=Number(e.height)||150,r=e.type||`2d`,i=I(`offscreen_canvas`),a=M();return N(a,`createOffscreenCanvas`,{nodeId:i,width:t,height:n,type:r}),new In({nodeId:i,bridgeId:a,width:t,height:n,type:r,offscreen:!0})}var Bn=t({createSelectorQuery:()=>L});function L(){return new Wn}function Vn(){return D.getPageInfo()}function Hn(){let e=Vn();return e?.__id__||e?.id}function Un(){let e=Vn();return e?.bridgeId||e?.id}var Wn=class{constructor(){this.__componentId=Hn(),this.__taskQueue=[],this.__cbQueue=[]}in(e){return this.__componentId=e.__id__,this}select(e){return new R(this,this.__componentId,e,!0)}selectAll(e){return new R(this,this.__componentId,e,!1)}selectViewport(){return new R(this,Hn(),``,!0)}__push(e,t,n,r,i){this.__taskQueue.push({moduleId:t,selector:e,single:n,fields:r}),this.__cbQueue.push(i)}exec(e){let t=this,r=Un();O(`selectorQuery`,{tasks:this.__taskQueue,success:i=>{let a=Rn(i,r)||[];a.forEach((e,r)=>{let i=t.__cbQueue[r];n(i)&&i.call(t,e)}),n(e)&&e.call(t,a)}},`render`)}},R=class{constructor(e,t,n,r){this.__selectorQuery=e,this.__moduleId=t,this.__selector=n,this.__single=r}fields(e,t){return this.__selectorQuery.__push(this.__selector,this.__moduleId,this.__single,e,t),this.__selectorQuery}boundingClientRect(e){return this.fields({id:!0,dataset:!0,rect:!0,size:!0},e)}context(e){return this.fields({context:!0},e)}node(e){return this.fields({node:!0},e)}scrollOffset(e){return this.fields({id:!0,dataset:!0,scrollOffset:!0},e)}},Gn=t({createIntersectionObserver:()=>Kn});function Kn(e,t={}){let{thresholds:n=[0],initialRatio:r=0,observeAll:i=!1}=t;return new qn(e,{thresholds:n,initialRatio:r,observeAll:i})}var qn=class{constructor(e,t){this._component=e,this._options=t,this._relativeInfo=[],this._observerId=null,this._disconnected=!1}relativeTo(e,t={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:e,margins:[`left`,`right`,`top`,`bottom`].map(e=>`${t[e]===void 0?0:t[e]}px`).join(` `)}),this}relativeToViewport(e={left:0,right:0,top:0,bottom:0}){if(this._observerId!==null)throw Error(`Relative nodes cannot be added after "observe" call in IntersectionObserver`);return this._relativeInfo.push({selector:null,margins:[`left`,`right`,`top`,`bottom`].map(t=>`${e[t]===void 0?0:e[t]}px`).join(` `)}),this}observe(e,t){let n=this,r=w.store(e=>{n._disconnected||(n._observerId=e.observerId),e.info&&t.call(n,e.info)},!0);O(`addIntersectionObserver`,{moduleId:this._component.__id__,targetSelector:e,relativeInfo:this._relativeInfo,options:this._options,success:r},`render`)}disconnect(){O(`removeIntersectionObserver`,{observerId:this._observerId},`render`),this._disconnected=!0}},z=new Map;function B(e){return z.has(e)||z.set(e,{depth:0,scheduled:!1,updates:[],byModuleId:new Map,callbackIds:[]}),z.get(e)}function V(e,t){let r=(Array.isArray(t)?t:[t]).filter(n);if(r.length!==0)return w.store(()=>{r.forEach(t=>t.call(e))})}function Jn(e){let t=B(e);t.depth++}function Yn(e){let t=B(e);t.depth>0&&t.depth--,t.depth===0&&Xn(e)}function H(e,t,n,r){let i=B(e),a=i.byModuleId.get(t);if(a)Object.assign(a.data,n);else{let e={moduleId:t,data:{...n}};i.byModuleId.set(t,e),i.updates.push(e)}r&&i.callbackIds.push(r),i.depth===0&&!i.scheduled&&(i.scheduled=!0,Promise.resolve().then(()=>{i.scheduled=!1,i.depth===0&&Xn(e)}))}function Xn(e){let t=z.get(e);if(!t||t.updates.length===0)return;let n=t.updates,r=t.callbackIds;t.updates=[],t.byModuleId=new Map,t.callbackIds=[],t.scheduled=!1,E.send({type:`ub`,target:`render`,body:{bridgeId:e,updates:n,callbackIds:r}})}function Zn(e){let t=e.__mpxProxy?.options?.computed;if(t)for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e.data,n)||(e.data[n]=null)}function U(e){return i(e)?e:Object.entries(e).reduce((e,[t,r])=>t.startsWith(`$`)?e:n(r)?(console.warn(`[service] 值不支持函数引用`,t),e):(Array.isArray(r)?e[t]=r.map(e=>typeof e==`object`&&e?e instanceof Date?e.getTime():U(e):e):r&&typeof r==`object`&&!Array.isArray(r)?r instanceof Date?e[t]=r.getTime():e[t]=U(r):e[t]=r,e),{})}function Qn(e){if(e){let t={};for(let r in e){let i=e[r];t[r]=t[r]||{};let a=i&&typeof i==`object`&&Object.prototype.hasOwnProperty.call(i,`type`)?W(i.type):W(i),o=null;if(o=Array.isArray(a)?[...a]:[a],i&&i.optionalTypes){let e=W(i.optionalTypes);Array.isArray(e)?o=[...e]:o.push(e)}t[r].type=o,t[r].type.length>0&&(i&&n(i.value)?t[r].default=i.value():i&&(t[r].default=i.value))}return t}}var $n=new Map([[String,`s`],[Number,`n`],[Boolean,`b`],[Object,`o`],[Array,`a`],[Function,`f`]]);function W(e){return Array.isArray(e)?e.map(e=>W(e)):e===null||e===``?null:$n.get(e)||(console.warn(`[service] ignore unknown props type ${e}`),null)}function er(e,t,n,r,i){let a=new Set;for(let o of e)for(let e in t){if(a.has(e))continue;let s=e.split(`,`).map(e=>e.trim());if(s.includes(o)){a.add(e);let c=t[e],l=s.map(e=>h(n,e));s.length===1?c.call(r,...l,i[o]):c.call(r,...l);continue}if(e===`**`){a.add(e),t[e].call(r,n);continue}let c=e.split(`.`),l=o.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u&&c.length>1){a.add(e);let s=n;for(let e of c)e!==`**`&&(s=s?.[e]);e===o?t[e].call(r,s,i[o]):t[e].call(r,s)}}}function tr(e,t,n,r,i){for(let a in t){let o=t[a],s=a.split(`,`).map(e=>e.trim());if(s.includes(e)){let t=s.map(e=>h(n,e));s.length===1&&s[0]===e?o.call(r,...t,i):o.call(r,...t);continue}if(a===`**`){o.call(r,n);continue}let c=a.split(`.`),l=e.split(`.`),u=!0;for(let e=0;e<c.length&&!(c[e]===`**`||l[e]===void 0);e++)if(c[e]!==l[e]){u=!1;break}if(u){let t=n;for(let e of c)e!==`**`&&(t=t[e]);a===e?o.call(r,t,i):o.call(r,t);continue}let d=a.match(/^(.+)\[(\d+)\]$/);if(d){let t=d[1],i=Number.parseInt(d[2],10);if(t===e.split(`[`)[0]&&n[t]&&n[t][i]!==void 0){o.call(r,n[t][i]);continue}}if(e.startsWith(a)){let e=a.split(`.`).reduce((e,t)=>e&&e[t],n);if(e!==void 0){o.call(r,e);continue}}}}function nr(e={},t=``){let n=t.trim();if(!n)return;let r=n.replace(/-/g,``).toLowerCase(),i=[n,oe(n),se(n),r];for(let t of i)if(t&&e[t]!==void 0)return e[t]}function G(e,t,n){let r=e.__info__||{};if(r.behaviorObservers)for(let i in r.behaviorObservers){let a=r.behaviorObservers[i];if(!(!Array.isArray(a)||a.length===0))for(let r of t)a.forEach(t=>{tr(r,{[i]:t},e.data,e,n[r])})}}function rr(e,t,n){ar(e,t,n)}function ir(e,t,i){let a=[];for(let o of t){let t=e.__info__.properties?.[o]?.observer,s=e.data[o],c=i[o];r(t)?a.push(()=>e[t]?.(s,c)):n(t)&&a.push(()=>t.call(e,s,c))}return a}function ar(e,t,n){ir(e,t,n).reverse().forEach(e=>e())}function or(e,t){if(!Array.isArray(t))return;let r=new WeakMap;function i(e,t){let n={...e};for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=n[e],a=t[e];r&&typeof r==`object`&&!Array.isArray(r)&&a&&typeof a==`object`&&!Array.isArray(a)?n[e]=i(r,a):n[e]=a}return n}function a(e,t){if(typeof t==`string`){o(e,t);return}if(!t||typeof t!=`object`||r.has(t))return;r.set(t,!0),Array.isArray(t.behaviors)&&t.behaviors.forEach(t=>a(e,t)),t.properties&&(e.properties={...t.properties,...e.properties}),t.data&&(e.data||={},e.data=i(t.data,e.data));let s=[`created`,`attached`,`ready`,`detached`];e.behaviorLifetimes=e.behaviorLifetimes||{};for(let r of s)n(t[r])&&(e.behaviorLifetimes[r]=e.behaviorLifetimes[r]||[],e.behaviorLifetimes[r].push(t[r]));if(t.observers){e.behaviorObservers=e.behaviorObservers||{};for(let n in t.observers)e.behaviorObservers[n]||(e.behaviorObservers[n]=[]),e.behaviorObservers[n].push(t.observers[n])}if(t.methods&&(e.methods={...t.methods,...e.methods}),t.relations&&(e.relations={...e.relations,...t.relations}),t.export&&(e.export=t.export),t.pageLifetimes){e.behaviorPageLifetimes=e.behaviorPageLifetimes||{};for(let r of[`show`,`hide`,`resize`,`routeDone`])n(t.pageLifetimes[r])&&(e.behaviorPageLifetimes[r]=e.behaviorPageLifetimes[r]||[],e.behaviorPageLifetimes[r].push(t.pageLifetimes[r]))}}function o(e,t){switch(t){case`wx://component-export`:break;case`wx://form-field`:break;case`wx://form-field-button`:break;default:console.warn(`[service] 未知的内置 behavior: ${t}`)}}t.forEach(t=>a(e,t))}function K(e,t,n){let r=e;for(;r&&r.__parentId__;){if(r.__parentId__===t)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}function q(e,t){if(!e||!t)return!1;if(e.startsWith(`#`)){let n=e.slice(1);return t.id===n}if(e.startsWith(`.`)){let n=e.slice(1);return t.__targetInfo__?.class&&t.__targetInfo__.class.split(` `).includes(n)}if(e.startsWith(`[`)&&e.endsWith(`]`)){let n=e.slice(1,-1).match(/^(\w+)(?:=["']?([^"']*)["']?)?$/);if(n){let[,e,r]=n,i=t.__targetInfo__?.dataset||{};return r===void 0?Object.prototype.hasOwnProperty.call(i,e):i[e]===r}return!1}return t.is?t.is.split(`/`).pop()===e||t.is===e:!1}function sr(e,t){if(!e||!Array.isArray(e.dependencies))return!1;for(let n of e.dependencies){if(n in t)return!0;for(let e of Object.keys(t))if(e.startsWith(n+`.`)||e.startsWith(n+`[`)||n.startsWith(e+`.`)||n.startsWith(e+`[`))return!0}return!1}function cr(e,t){if(!(!e||!e.expression)){if(e.isSimple)return h(t,e.expression);try{return Function(`data`,`with(data) { return ${e.expression} }`)(t)}catch(t){console.warn(`[service] 计算表达式失败:`,e.expression,t);return}}}function J(e,t,n){let r=Object.values(t||{}),i=[];for(let t of r){if(!K(t,e.__id__,r)||t.__parentId__!==e.__id__)continue;let a=t.__info__?.properties||{},o={};for(let r in a){let i=e.__childPropsBindings__?.[t.__id__]?.[r];i&&sr(i,n)&&(o[r]=cr(i,e.data))}Object.keys(o).length>0&&(t.tO?.(o),t.__pendingSyncedProps__=t.__pendingSyncedProps__||{},Object.assign(t.__pendingSyncedProps__,o),i.push({child:t,data:o}))}return i}var lr=[`created`,`attached`,`ready`,`moved`,`detached`,`error`],ur=[`show`,`hide`,`resize`,`routeDone`],dr=class{constructor(e,t){this.initd=!1,this.opts=t,t.targetInfo&&(this.id=t.targetInfo.id,this.dataset=t.targetInfo.dataset,this.__targetInfo__=t.targetInfo),this.is=t.path,this.route=t.path,this.query=t.query,this.renderer=`webview`,this.bridgeId=t.bridgeId,this.id||=t.bridgeId,this.behaviors=e.behaviors,this.data=le(e.noReferenceData),Object.defineProperty(this,"properties",{get(){return this.data},enumerable:!0,configurable:!1}),this.__isComponent__=e.isComponent,this.__type__=e.type,this.__id__=this.opts.moduleId,this.__info__=e.moduleInfo,this.__eventAttr__=t.eventAttr,this.__pageId__=t.pageId,this.__parentId__=t.parentId,this.__relations__=new Map,this.__relationPaths__=new Map,this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[],this.__pendingInitSetDataCallbacks__=[],this.__childPropsBindings__={},this.__pendingSyncedProps__={},this.__initialPropertyObserversInvoked__=!1}init(){if(this.__isComponent__)for(let e in this.__info__.properties)!Object.prototype.hasOwnProperty.call(this.opts.properties,e)||this.opts.properties[e]===void 0?this.data[e]=this.__info__.properties[e]?.value??null:this.data[e]=this.opts.properties[e];return this.#d(),this.#f(),this.#t(),this.#e(),this.#m().then(()=>{Zn(this),E.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],H(this.bridgeId,this.__id__,{},V(this,e))}#e(){this.hasBehavior(`wx://component-export`)&&this.__info__.export&&n(this.__info__.export)&&(this.export=this.__info__.export.bind(this))}#t(){let e=this.__info__.relations;if(!(!e||typeof e!=`object`))for(let[t]of Object.entries(e)){let e=this.#n(t);this.__relationPaths__.set(t,e),this.__relations__.has(t)||this.__relations__.set(t,[])}}#n(e){if(e.startsWith(`./`)){let t=this.is.lastIndexOf(`/`);return t===-1?e.substring(2):`${this.is.substring(0,t)}/${e.substring(2)}`}else if(e.startsWith(`../`)){let t=this.is.split(`/`),n=e.split(`/`),r=t.slice(0,-1);for(let e of n)e===`..`?r.pop():e!==`.`&&r.push(e);return r.join(`/`)}else return e}#r(){let e=this.__info__.relations;if(!e)return;let t=Object.values($.instances[this.bridgeId]||{});for(let[n,r]of Object.entries(e)){let{type:e,target:i}=r,a=this.__relationPaths__.get(n),o=t.filter(e=>i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`)).filter(t=>this.#o(t,e)||this.#a(t,e));for(let e of o)this.#c(n,e,r)}this.#i()}#i(){let e=Object.values($.instances[this.bridgeId]||{});for(let t of e)t!==this&&t._checkRelationsWithTarget&&t._checkRelationsWithTarget(this)}_checkRelationsWithTarget(e){let t=this.__info__.relations;if(t)for(let[n,r]of Object.entries(t)){let{type:t,target:i}=r,a=this.__relationPaths__.get(n),o=!1;o=i?e.hasBehavior&&e.hasBehavior(i):e.is===a||e.is.endsWith(`/${a}`);let s=this.#o(e,t),c=this.#a(e,t);o&&(s||c)&&this.#c(n,e,r)}}#a(e,t){if(t!==`descendant`&&t!==`ancestor`)return!1;let n=t===`descendant`?`ancestor`:`descendant`,r=e.__info__?.relations;return r?Object.entries(r).some(([t,r])=>{let i=e.__relationPaths__?.get(t);return r.type===n&&(this.is===i||this.is.endsWith(`/${i}`))}):!1}#o(e,t){let n=Object.values($.instances[this.bridgeId]||{});switch(t){case`parent`:return e.__id__===this.__parentId__;case`child`:return e.__parentId__===this.__id__;case`ancestor`:return this.#s(e.__id__,this.__id__,n);case`descendant`:return this.#s(this.__id__,e.__id__,n);default:return!1}}#s(e,t,n){let r=n.find(e=>e.__id__===t);for(;r&&r.__parentId__;){if(r.__parentId__===e)return!0;r=n.find(e=>e.__id__===r.__parentId__)}return!1}#c(e,t,r){let i=this.__relations__.get(e)||[];if(!i.includes(t)&&(i.push(t),this.__relations__.set(e,i),n(r.linked)))try{r.linked.call(this,t)}catch(e){console.error(`[service] relation linked error:`,e)}}#l(e,t,r){let i=this.__relations__.get(e)||[],a=i.indexOf(t);if(a!==-1&&(i.splice(a,1),this.__relations__.set(e,i),n(r.unlinked)))try{r.unlinked.call(this,t)}catch(e){console.error(`[service] relation unlinked error:`,e)}}#u(e,t,r){if(n(r.linkChanged))try{r.linkChanged.call(this,t)}catch(e){console.error(`[service] relation linkChanged error:`,e)}}setData(e,t){let r=U(e),i={};for(let e in r)i[e]=this.data[e],re(this.data,e,r[e]);if(this.__info__.observers&&er(Object.keys(r),this.__info__.observers,this.data,this,i),G(this,Object.keys(r),i),rr(this,Object.keys(r),i),!this.initd){n(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}if(this.__groupSetDataMode__){for(let e in r)this.__groupSetDataBuffer__[e]=r[e];n(t)&&this.__groupSetDataCallbacks__.push(t);return}let a=J(this,$.instances[this.bridgeId],r);H(this.bridgeId,this.__id__,r,V(this,t)),a.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}#d(){lr.forEach(e=>{let t=this.__info__.lifetimes?.[e]||this.__info__[e];n(t)&&(this[e]=t.bind(this))}),this.__isComponent__&&ur.forEach(e=>{let t=this.__info__.pageLifetimes?.[e];n(t)&&(e===`show`?e=`onShow`:e===`hide`&&(e=`onHide`),this[e]=t.bind(this))})}#f(){let e=this.__info__.methods;for(let t in e)n(e[t])&&(this[t]=e[t].bind(this))}#p(){if(!this.__isComponent__||!this.__info__.properties||this.__initialPropertyObserversInvoked__)return;let e=[];for(let t of Object.keys(this.__info__.properties)){let i=this.__info__.properties[t]?.observer,a=this.data[t];r(i)?e.push(()=>this[i]?.(a,void 0)):n(i)&&e.push(()=>i.call(this,a,void 0))}e.forEach(e=>e()),this.__initialPropertyObserversInvoked__=!0}async#m(){this.__isComponent__?(await this.componentCreated(),await this.componentAttached()):(await this.componentCreated(),await this.componentAttached(),await this.onLoad?.(this.opts.query||{})),this.initd=!0}tO(e){let t={};for(let[n,r]of Object.entries(e)){if(this.__pendingSyncedProps__&&Object.prototype.hasOwnProperty.call(this.__pendingSyncedProps__,n)&&a(this.__pendingSyncedProps__[n],r)){this.data[n]=r,delete this.__pendingSyncedProps__[n];continue}t[n]=r}if(Object.keys(t).length===0)return;let n=[],r={};for(let[e,i]of Object.entries(t)){let t=this.data[e];r[e]=t,this.data[e]=i,this.__info__.observers&&n.push(()=>tr(e,this.__info__.observers,this.data,this,t))}n.forEach(e=>e()),G(this,Object.keys(t),Object.fromEntries(Object.keys(t).map(e=>[e,void 0]))),ar(this,Object.keys(t),r)}getPageId(){return this.__id__}hasBehavior(e){let t=function(n){if(!Array.isArray(n))return!1;if(n.includes(e))return!0;for(let e of n)if(e&&e.behaviors&&t(e.behaviors))return!0;return!1};return t(this.behaviors)}createSelectorQuery(){return L().in(this)}selectComponent(e){let t=Object.values($.instances[this.bridgeId]),n=t.find(n=>K(n,this.__id__,t)&&q(e,n));return n?n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values($.instances[this.bridgeId]);return t.filter(n=>K(n,this.__id__,t)&&q(e,n))}selectOwnerComponent(){let e=Object.values($.instances[this.bridgeId]);for(let t of e)if(t.id===this.__parentId__)return t;return null}createIntersectionObserver(e){return Kn(this,e)}groupSetData(e){if(!n(e)){console.warn(`[service] groupSetData callback must be a function`);return}this.__groupSetDataMode__=!0,Jn(this.bridgeId),this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];try{e.call(this)}catch(e){console.error(`[service] groupSetData callback error:`,e)}finally{if(this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__&&Object.keys(this.__groupSetDataBuffer__).length>0){let e=this.__groupSetDataBuffer__,t=this.__groupSetDataCallbacks__;this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];let n=J(this,$.instances[this.bridgeId],e);H(this.bridgeId,this.__id__,e,V(this,t)),n.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}else this.__groupSetDataBuffer__={},this.__groupSetDataCallbacks__=[];Yn(this.bridgeId)}}createMediaQueryObserver(){console.warn(`[service] 暂不支持 createMediaQueryObserver`)}getRelationNodes(e){return e?[...this.__relations__.get(e)||[]]:(console.warn(`[service] getRelationNodes 需要传入关系路径参数`),[])}animate(){console.warn(`[service] 暂不支持 animate`)}clearAnimation(){console.warn(`[service] 暂不支持 clearAnimation`)}async triggerEvent(e,t,n={}){if(!e)return;let r=e.trim(),i=nr(this.__eventAttr__,r);i&&await $.triggerEvent({bridgeId:this.bridgeId,moduleId:this.__pageId__,methodName:i,event:{type:r,detail:t,currentTarget:{id:this.id,dataset:this.dataset},target:{id:this.id,dataset:this.dataset}}}),n.bubbles&&await $.instances[this.bridgeId][this.__parentId__]?.triggerEvent(e,t),n.composed,n.capturePhase}pageReady(){this.__isComponent__||this.ready?.()}pageUnload(){this.__isComponent__||this.onUnload?.()}pageScrollTop(e){if(!this.__isComponent__){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.resize?.(e)}componentRouteDone(){this.__info__.behaviorPageLifetimes?.routeDone?.forEach(e=>e.call(this)),this.routeDone?.()}async componentCreated(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.()}async componentAttached(){this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),this.#r()}componentReadied(){this.#p(),this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.()}componentMoved(){this.moved?.();let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=this.__relations__.get(t)||[];for(let r of e)this.#u(t,r,n)}}componentDetached(){let e=this.__info__.relations;if(e)for(let[t,n]of Object.entries(e)){let e=[...this.__relations__.get(t)||[]];for(let r of e)this.#l(t,r,n)}this.#h(),this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.initd=!1}#h(){let e=Object.values($.instances[this.bridgeId]||{});for(let t of e)if(!(t===this||!t.__relations__))for(let[e,r]of t.__relations__.entries()){let i=r.indexOf(this);if(i!==-1){r.splice(i,1),t.__relations__.set(e,r);let a=t.__info__.relations?.[e];if(a&&n(a.unlinked))try{a.unlinked.call(t,this)}catch(e){console.error(`[service] relation unlinked error:`,e)}}}}componentError(e){this.error?.(e)}},Y=class e{static type=`component`;constructor(t,n){this.moduleInfo=t,this.extraInfo=n,this.type=e.type,this.isComponent=this.extraInfo.component,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,or(this.moduleInfo,this.behaviors),this.noReferenceData=U(this.moduleInfo.data||{})}getProps(){let e=Qn(this.moduleInfo.properties);if(Array.isArray(this.moduleInfo.externalClasses)&&this.moduleInfo.externalClasses.length>0){e||={};for(let t of this.moduleInfo.externalClasses)e[t]={type:[`s`],cls:!0}}return e}},fr=class{constructor(e,t){this.initd=!1,this.opts=t,this.is=t.path,this.route=t.path,this.bridgeId=t.bridgeId,this.id=t.bridgeId,this.query=t.query,this.data=le(e.noReferenceData),this.__type__=e.type,this.__id__=t.moduleId,this.__info__=e.moduleInfo,this.__childPropsBindings__={},this.__pendingInitSetDataCallbacks__=[]}init(){return this.#e(),this.#t().then(()=>{Zn(this),E.send({type:this.__id__,target:`render`,body:{bridgeId:this.bridgeId,path:this.is,data:this.data}})})}flushInitSetDataCallbacks(){if(this.__pendingInitSetDataCallbacks__.length===0)return;let e=this.__pendingInitSetDataCallbacks__;this.__pendingInitSetDataCallbacks__=[],H(this.bridgeId,this.__id__,{},V(this,e))}setData(e,t){let r=U(e),i={},a=this.__info__||{};for(let e in r)i[e]=this.data[e],re(this.data,e,r[e]);if(a.observers&&er(Object.keys(r),a.observers,this.data,this,i),G(this,Object.keys(r),i),!this.initd){n(t)&&this.__pendingInitSetDataCallbacks__.push(t);return}let o=J(this,$.instances[this.bridgeId],r);H(this.bridgeId,this.__id__,r,V(this,t)),o.forEach(({child:e,data:t})=>{H(this.bridgeId,e.__id__,t)})}createSelectorQuery(){return L().in(this)}selectComponent(e){let t=Object.values($.instances[this.bridgeId]||{}),n=t.find(n=>K(n,this.__id__,t)&&q(e,n));return n?n.hasBehavior&&n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values($.instances[this.bridgeId]||{});return t.filter(n=>K(n,this.__id__,t)&&q(e,n)).map(e=>e.hasBehavior&&e.hasBehavior(`wx://component-export`)&&e.export?e.export():e)}#e(){for(let e in this.__info__){let t=this.__info__[e];n(t)?this[e]=t.bind(this):this[e]=t}}async#t(){this.__info__.behaviorLifetimes?.created?.forEach(e=>e.call(this)),await this.created?.(),this.__info__.behaviorLifetimes?.attached?.forEach(e=>e.call(this)),await this.attached?.(),await this.onLoad?.(this.opts.query||{}),this.initd=!0}pageShow(){this.__info__.behaviorPageLifetimes?.show?.forEach(e=>e.call(this)),this.onShow?.()}pageHide(){this.__info__.behaviorPageLifetimes?.hide?.forEach(e=>e.call(this)),this.onHide?.()}pageReady(){this.__info__.behaviorLifetimes?.ready?.forEach(e=>e.call(this)),this.ready?.(),this.onReady?.()}pageUnload(){this.__info__.behaviorLifetimes?.detached?.forEach(e=>e.call(this)),this.detached?.(),this.onUnload?.(),this.initd=!1}pageScrollTop(e){let{scrollTop:t}=e;this.onPageScroll?.({scrollTop:t})}pageResize(e){this.__info__.behaviorPageLifetimes?.resize?.forEach(t=>t.call(this,e)),this.onResize?.(e)}},X=class e{static type=`page`;constructor(t,r){if(this.moduleInfo=t,this.extraInfo=r,this.type=e.type,this.behaviors=this.moduleInfo.behaviors,this.usingComponents=this.extraInfo.usingComponents,or(this.moduleInfo,this.behaviors),this.moduleInfo.methods)for(let[e,t]of Object.entries(this.moduleInfo.methods))!(e in this.moduleInfo)&&n(t)&&(this.moduleInfo[e]=t);this.noReferenceData=U(this.moduleInfo.data||{})}},Z=class{static type=`app`;constructor(e){this.moduleInfo=e}},Q=new class{constructor(){this.staticModules={}}loadResource(e){let{appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a}=e;if(v&&(this.isScriptLoaded=this.isScriptLoaded||{},!this.isScriptLoaded[i])){let e=`${a}${t}/${i}/logic.js`;globalThis.importScripts(e),this.isScriptLoaded[i]=!0}D.setInitId(n),C(`app`),C(r),E.invoke({type:`serviceResourceLoaded`,target:`service`,body:{bridgeId:n}})}createAppModule(e){let t=new Z(e);this.staticModules[Z.type]=t}createModule(e,t,n){let{path:r,usingComponents:i}=t;if(!this.staticModules[r]){if(i)for(let e of Object.values(i))C(e);if(n===X.type){let n=new X(e,t);this.staticModules[r]=n}else if(n===Y.type){let n=new Y(e,t);this.staticModules[r]=n}else console.error(`[service] createModule ${n} error`)}}getPropsByPath(e){let t={};return this.getComponentProps(t,e),t}getComponentProps(e,t){if(t)for(let n of Object.values(t)){let t=this.staticModules[n];!t||e[n]||(e[n]=t.getProps(),this.getComponentProps(e,t.usingComponents))}}getAppModule(){return this.staticModules[Z.type]}getModuleByPath(e){return this.staticModules[e]}},$=new class{constructor(){this.app=null,this.instances={}}queuePendingEvent(e,t){return e.__pendingRuntimeEvents__=e.__pendingRuntimeEvents__||[],new Promise((n,r)=>{e.__pendingRuntimeEvents__.push({...t,resolve:n,reject:r})})}async flushPendingEvents(e){let t=e?.__pendingRuntimeEvents__||[];e.__pendingRuntimeEvents__=[];for(let e of t)try{let t=await this.dispatchEvent(e);e.resolve(t)}catch(t){e.reject(t)}}async dispatchEvent({instance:e,bridgeId:t,moduleId:r,methodName:i,event:a}){if(n(e[i]))return await e[i](a);console.warn(`[service] triggerEvent ${t} ${r}, is: ${e.is}, method: ${i} is not exist`)}createApp(e){if(this.app){console.log(`[service] app instance already existed`);return}let{scene:t,pagePath:n,query:r}=e,i=Q.getAppModule();if(!i){console.log(`[service] app instance is not exist`);return}console.log(`[service] create app instance`),this.app=new xn(i,{scene:t,path:n,query:r})}appShow(){this.app?.appShow()}appHide(){this.app?.appHide()}stackShow(e){D.pushStack(e)}stackHide(e){D.popStack(e)}createInstance(e){let{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l,stackId:u}=e,d=Q.getModuleByPath(r);if(!d){console.error(`[service] ${r} not exist`);return}if(console.log(`[service] create instance ${r}`),this.instances[t]=this.instances[t]||{},d.type===Y.type){let e=new dr(d,{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,targetInfo:l});return this.instances[t][n]=e,d.isComponent||D.push(e,u),e.init(),e}else if(d.type===X.type){let e=new fr(d,{bridgeId:t,moduleId:n,path:r,query:i});return this.instances[t][n]=e,D.push(e,u),e.init(),e}else console.error(`[service] ${d.type} instance is not exist.`)}moduleReady(e){let{bridgeId:t,moduleId:n,propBindings:r}=e,i=this.instances[t][n];if(i){if(r&&i.__parentId__){let e=this.instances[t]?.[i.__parentId__];e&&(e.__childPropsBindings__||={},e.__childPropsBindings__[n]=r)}if(i.__type__===Y.type){i.componentReadied(),i.__componentReadied__=!0,this.flushPendingEvents(i),i.flushInitSetDataCallbacks?.();let e=this.getPageInstance(t);e&&this.checkAndCallPageReady(t,e.__id__)}}}moduleUnmounted(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(r.__type__===Y.type&&r.componentDetached(),delete this.instances[t][n])}pageShow(e){let{bridgeId:t}=e,n=this.instances[t];if(!n)return;let r=[];Object.values(n).forEach(e=>{e&&(e.__type__===X.type?r.push(e):e.__type__===Y.type&&(e.__isComponent__?e.pageShow():r.push(e)))}),r.forEach(e=>{e.pageShow()})}pageReady(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&(this.pageShow(e),r.__pageReadyPending__=!0,r.flushInitSetDataCallbacks?.(),this.checkAndCallPageReady(t,n))}getPageInstance(e){let t=this.instances[e];return t?Object.values(t).find(e=>e&&(e.__type__===X.type||e.__type__===Y.type&&!e.__isComponent__)):null}checkAndCallPageReady(e,t){let n=this.instances[e][t];if(!n||!n.__pageReadyPending__)return;let r=this.instances[e];if(!r){n.__pageReadyPending__=!1,n.pageReady();return}Object.values(r).filter(e=>e&&e.__type__===Y.type&&e.__isComponent__&&e.initd&&!e.__componentReadied__).length===0&&(n.__pageReadyPending__=!1,n.pageReady())}pageHide(e){let{bridgeId:t}=e,n=this.instances[t],r=[];Object.values(n).forEach(e=>{e&&(e.__type__===X.type?r.push(e):e.__type__===Y.type&&(e.__isComponent__?e.pageHide():r.push(e)))}),r.forEach(e=>{e&&e.pageHide()})}pageUnload(e){let{bridgeId:t}=e,n=this.instances[t];n&&(Object.values(n).forEach(e=>{e&&(e.__type__===Y.type&&e.componentDetached(),e.pageUnload())}),D.pop(),delete this.instances[t])}pageScroll(e){let{bridgeId:t,moduleId:n,scrollTop:r}=e,i=this.instances[t][n];i&&i.pageScrollTop({scrollTop:r})}pageResize(e){let{bridgeId:t,size:n}=e,r=this.instances[t];r&&Object.values(r).forEach(e=>{e&&(e.__type__===X.type?e.pageResize(n):e.__type__===Y.type&&(e.__isComponent__,e.pageResize(n)))})}componentError(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t][n];r&&r.__type__===Y.type&&r.componentError()}componentRouteDone(e){let{bridgeId:t}=e,n=this.instances[t];n&&Object.values(n).forEach(e=>{e?.__type__===Y.type&&e.componentRouteDone()})}async triggerEvent(e){let{bridgeId:t,moduleId:n,methodName:r,event:i}=e;if(r===void 0)return;let a=this.instances[t];if(!a){console.warn(`[service] No instances found for bridgeId: ${t}`);return}let o=a[n];if(!o){console.warn(`[service] triggerEvent ${t} ${n} ${r}, instance is not exist`);return}return o.__type__===Y.type&&o.__isComponent__&&!o.__componentReadied__?this.queuePendingEvent(o,{instance:o,bridgeId:t,moduleId:n,methodName:r,event:i}):this.dispatchEvent({instance:o,bridgeId:t,moduleId:n,methodName:r,event:i})}},pr=t({getEnterOptionsSync:()=>hr,getLaunchOptionsSync:()=>mr});function mr(){return $.app?.options}function hr(){return $.app?.options}var gr=t({getLocation:()=>_r,offLocationChange:()=>Sr,onLocationChange:()=>xr,openLocation:()=>yr,startLocationUpdate:()=>vr,stopLocationUpdate:()=>br});function _r(e){O(`getLocation`,e)}function vr(e){O(`startLocationUpdate`,e)}function yr(e){O(`openLocation`,e)}function br(e){O(`stopLocationUpdate`,e)}function xr(e){e&&O(`onLocationChange`,{success:w.store(e,!0)})}function Sr(e){if(e){let t=w.store(e,!0);O(`offLocationChange`,{success:t}),w.remove(t)}else O(`offLocationChange`),w.remove()}var Cr=t({createMapContext:()=>wr});function wr(e,t){return new Tr({mapId:e,obj:t})}var Tr=class{constructor(e){this.opts=e}addMarkers(e){O(`addMarkers`,e)}removeMarkers(e){O(`removeMarkers`,e)}includePoints(e){O(`includePoints`,e)}setCenterOffset(e){O(`setCenterOffset`,e)}getCenterLocation(e){O(`getCenterLocation`,e)}getScale(e){O(`getScale`,e)}moveToLocation(e){O(`moveToLocation`,e)}translateMarker(e){O(`translateMarker`,e)}addArc(e){O(`addArc`,e)}removeArc(e){O(`removeArc`,e)}},Er=t({createInnerAudioContext:()=>kr}),Dr=1,Or=class{constructor(){this._audioId=Dr++,this._src=``,this._startTime=0,this._autoplay=!1,this._loop=!1,this._volume=1,this._playbackRate=1,this._currentTime=0,this._duration=0,this._buffered=0,this._paused=!0,this._listeners={},O(`audioCreate`,{audioId:this._audioId}),O(`audioListen`,{audioId:this._audioId,evtId:`audio_${this._audioId}`,keep:!0,success:e=>this._dispatch(e)})}_dispatch(e){if(!e||typeof e!=`object`)return;this._currentTime=e.currentTime||0,this._duration=e.duration||0,this._buffered=e.buffered||0,this._paused=!!e.paused;let t=this._listeners[e.event];if(t)for(let n of t.slice())n(e)}get src(){return this._src}set src(e){this._src=e,O(`audioSetProp`,{audioId:this._audioId,prop:`src`,value:e,startTime:this._startTime,loop:this._loop,volume:this._volume,playbackRate:this._playbackRate,autoplay:this._autoplay})}get startTime(){return this._startTime}set startTime(e){this._startTime=Number(e)||0,O(`audioSetProp`,{audioId:this._audioId,prop:`startTime`,value:this._startTime})}get autoplay(){return this._autoplay}set autoplay(e){this._autoplay=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`autoplay`,value:this._autoplay})}get loop(){return this._loop}set loop(e){this._loop=!!e,O(`audioSetProp`,{audioId:this._audioId,prop:`loop`,value:this._loop})}get volume(){return this._volume}set volume(e){this._volume=Math.max(0,Math.min(1,Number(e)||0)),O(`audioSetProp`,{audioId:this._audioId,prop:`volume`,value:this._volume})}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=Number(e)||1,O(`audioSetProp`,{audioId:this._audioId,prop:`playbackRate`,value:this._playbackRate})}get duration(){return this._duration}get currentTime(){return this._currentTime}get paused(){return this._paused}get buffered(){return this._buffered}play(){this._paused=!1,O(`audioPlay`,{audioId:this._audioId,src:this._src})}pause(){this._paused=!0,O(`audioPause`,{audioId:this._audioId})}stop(){this._paused=!0,O(`audioStop`,{audioId:this._audioId})}seek(e){O(`audioSeek`,{audioId:this._audioId,position:Number(e)||0})}destroy(){O(`audioDestroy`,{audioId:this._audioId}),this._listeners={}}_on(e,t){typeof t==`function`&&(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t))}_off(e,t){this._listeners[e]&&(t?this._listeners[e]=this._listeners[e].filter(e=>e!==t):this._listeners[e]=[])}onPlay(e){this._on(`play`,e)}onPause(e){this._on(`pause`,e)}onStop(e){this._on(`stop`,e)}onEnded(e){this._on(`ended`,e)}onError(e){this._on(`error`,e)}onTimeUpdate(e){this._on(`timeUpdate`,e)}onWaiting(e){this._on(`waiting`,e)}onSeeking(e){this._on(`seeking`,e)}onSeeked(e){this._on(`seeked`,e)}onCanplay(e){this._on(`canplay`,e)}offPlay(e){this._off(`play`,e)}offPause(e){this._off(`pause`,e)}offStop(e){this._off(`stop`,e)}offEnded(e){this._off(`ended`,e)}offError(e){this._off(`error`,e)}offTimeUpdate(e){this._off(`timeUpdate`,e)}offWaiting(e){this._off(`waiting`,e)}offSeeking(e){this._off(`seeking`,e)}offSeeked(e){this._off(`seeked`,e)}offCanplay(e){this._off(`canplay`,e)}};function kr(){return new Or}var Ar=t({chooseImage:()=>Pr,compressImage:()=>Nr,previewImage:()=>Mr,saveImageToPhotosAlbum:()=>jr});function jr(e){O(`saveImageToPhotosAlbum`,e)}function Mr(e){O(`previewImage`,e)}function Nr(e){O(`compressImage`,e)}function Pr(e){O(`chooseImage`,e)}var Fr=t({chooseMedia:()=>Rr,chooseVideo:()=>Lr,createVideoContext:()=>Ir});function Ir(e,t){return new zr({videoId:e,obj:t})}function Lr(e){O(`chooseVideo`,e)}function Rr(e){O(`chooseMedia`,e)}var zr=class{constructor(e){this.opts=e}play(){this.invoke(`play`)}pause(){this.invoke(`pause`)}stop(){this.invoke(`stop`)}seek(e){this.invoke(`seek`,{position:e})}playbackRate(e){this.invoke(`playbackRate`,{rate:e})}requestFullScreen(e={}){this.invoke(`requestFullScreen`,e)}exitFullScreen(){this.invoke(`exitFullScreen`)}requestBackgroundPlayback(e={}){this.invoke(`requestBackgroundPlayback`,e)}exitBackgroundPlayback(){this.invoke(`exitBackgroundPlayback`)}exitPictureInPicture(e={}){this.invoke(`exitPictureInPicture`,e)}showStatusBar(){this.invoke(`showStatusBar`)}hideStatusBar(){this.invoke(`hideStatusBar`)}invoke(e,t={}){O(`videoContext`,{type:`native/video`,id:this.opts.videoId,command:e,...t},`render`)}},Br=t({exitMiniProgram:()=>Wr,navigateBackMiniProgram:()=>Ur,navigateToMiniProgram:()=>Hr,restartMiniProgram:()=>Vr});function Vr(e){O(`restartMiniProgram`,e)}function Hr(e){O(`navigateToMiniProgram`,e)}function Ur(e){O(`navigateBackMiniProgram`,e)}function Wr(e){O(`exitMiniProgram`,e)}var Gr=t({downloadFile:()=>Kr});function Kr(e){O(`downloadFile`,e)}var qr=t({request:()=>Jr});function Jr(e){O(`request`,e)}var Yr=t({uploadFile:()=>Xr});function Xr(e){O(`uploadFile`,e)}var Zr=t({closeSocket:()=>ti,connectSocket:()=>$r,onSocketClose:()=>ai,onSocketError:()=>ii,onSocketMessage:()=>ri,onSocketOpen:()=>ni,sendSocketMessage:()=>ei}),Qr=class{constructor(e){this.socketId=e,this._readyState=0}send(e={}){let{data:t,success:r,fail:i,complete:a,...o}=e,s={socketId:this.socketId,data:t,...o};return n(r)&&(s.success=w.store(r)),n(i)&&(s.fail=w.store(i)),n(a)&&(s.complete=w.store(a)),O(`sendSocketMessage`,s)}close(e={}){let{code:t=1e3,reason:r=``,success:i,fail:a,complete:o,...s}=e,c={socketId:this.socketId,code:t,reason:r,...s};return n(i)&&(c.success=w.store(i)),n(a)&&(c.fail=w.store(a)),n(o)&&(c.complete=w.store(o)),O(`closeSocket`,c)}onOpen(e){if(n(e))return O(`onSocketOpen`,{socketId:this.socketId,callback:w.store(e,!0)})}offOpen(e){return O(`offSocketOpen`,{socketId:this.socketId,callback:e})}onMessage(e){if(n(e))return O(`onSocketMessage`,{socketId:this.socketId,callback:w.store(e,!0)})}offMessage(e){return O(`offSocketMessage`,{socketId:this.socketId,callback:e})}onError(e){if(n(e))return O(`onSocketError`,{socketId:this.socketId,callback:w.store(e,!0)})}offError(e){return O(`offSocketError`,{socketId:this.socketId,callback:e})}onClose(e){if(n(e))return O(`onSocketClose`,{socketId:this.socketId,callback:w.store(e,!0)})}offClose(e){return O(`offSocketClose`,{socketId:this.socketId,callback:e})}get readyState(){return this._readyState}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}};function $r(e={}){let{url:t,header:r={},protocols:i=[],tcpNoDelay:a=!1,perMessageDeflate:o=!1,timeout:s,forceCellularNetwork:c=!1,success:l,fail:u,complete:d,...ee}=e;if(!t){let e=Error(`url is required`);throw n(u)&&u(e),n(d)&&d(e),e}let f=`socket_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,p=new Qr(f),m={socketId:f,url:t,header:r,protocols:i,tcpNoDelay:a,perMessageDeflate:o,timeout:s,forceCellularNetwork:c,...ee};return n(l)&&(m.success=w.store(e=>{p._readyState=Qr.OPEN,l(e)})),n(u)&&(m.fail=w.store(e=>{p._readyState=Qr.CLOSED,u(e)})),n(d)&&(m.complete=w.store(d)),O(`connectSocket`,m),p}function ei(e){return O(`sendSocketMessage`,e)}function ti(e){return O(`closeSocket`,e)}function ni(e){return O(`onSocketOpen`,{callback:w.store(e,!0)})}function ri(e){return O(`onSocketMessage`,{callback:w.store(e,!0)})}function ii(e){return O(`onSocketError`,{callback:w.store(e,!0)})}function ai(e){return O(`onSocketClose`,{callback:w.store(e,!0)})}var oi=t({getAccountInfoSync:()=>si});function si(){return O(`getAccountInfoSync`)}var ci=t({authorize:()=>li});function li(e){O(`authorize`,e)}var ui=t({login:()=>di});function di(e){O(`login`,e)}var fi=t({login:()=>pi});function pi(e){O(`login`,e)}var mi=t({getPrivacySetting:()=>hi});function hi(e){O(`getPrivacySetting`,e)}var gi=t({getSetting:()=>vi,openSetting:()=>_i});function _i(e){O(`openSetting`,e)}function vi(e){O(`getSetting`,e)}var yi=t({getUserInfo:()=>bi});function bi(e){O(`getUserInfo`,e)}var xi=t({requestPayment:()=>Si});function Si(e){O(`requestPayment`,e)}var Ci=t({hideShareMenu:()=>Ei,showShareImageMenu:()=>Ti,showShareMenu:()=>wi});function wi(e){O(`shareShareMenu`,e)}function Ti(e){O(`showShareImageMenu`,e)}function Ei(e){O(`hideShareMenu`,e)}var Di=t({clearStorage:()=>Fi,clearStorageSync:()=>ji,getStorage:()=>Ni,getStorageInfo:()=>Li,getStorageInfoSync:()=>Ii,getStorageSync:()=>ki,removeStorage:()=>Pi,removeStorageSync:()=>Ai,setStorage:()=>Mi,setStorageSync:()=>Oi});function Oi(...e){O(`setStorageSync`,e)}function ki(e){return O(`getStorageSync`,e)}function Ai(e){return O(`removeStorageSync`,e)}function ji(){O(`clearStorageSync`)}function Mi(e){O(`setStorage`,e)}function Ni(e){O(`getStorage`,e)}function Pi(e){O(`removeStorage`,e)}function Fi(){O(`clearStorage`)}function Ii(){return O(`getStorageInfoSync`)}function Li(e){O(`getStorageInfo`,e)}var Ri=t({createAnimation:()=>zi});function zi(e={}){return new Bi(e)}var Bi=class{constructor({duration:e=400,timingFunction:t=`linear`,delay:n=0,transformOrigin:r=`50% 50% 0`}={}){this.actions=[],this.currentTransform={},this.currentStepAnimates=[],this.option={transition:{duration:e,timingFunction:t,delay:n},transformOrigin:r}}export(){let e=this.actions;return this.actions=[],{actions:e}}step(e={}){for(let e of this.currentStepAnimates)e.type===`style`?this.currentTransform[`${e.type}.${e.args[0]}`]=e:this.currentTransform[e.type]=e;return this.actions.push({animates:Object.keys(this.currentTransform).reduce((e,t)=>[].concat(...e,[this.currentTransform[t]]),[]),option:{transformOrigin:e.transformOrigin===void 0?this.option.transformOrigin:e.transformOrigin,transition:{duration:e.duration===void 0?this.option.transition.duration:e.duration,timingFunction:e.timingFunction===void 0?this.option.transition.timingFunction:e.timingFunction,delay:e.delay===void 0?this.option.transition.delay:e.delay}}}),this.currentStepAnimates=[],this}backgroundColor(e){return this.currentStepAnimates.push({type:`style`,args:[`background-color`,e]}),this}bottom(e){return this.currentStepAnimates.push({type:`style`,args:[`bottom`,b(e)]}),this}height(e){return this.currentStepAnimates.push({type:`style`,args:[`height`,b(e)]}),this}left(e){return this.currentStepAnimates.push({type:`style`,args:[`left`,b(e)]}),this}matrix(e=1,t=0,n=0,r=1,i=1,a=1){return this.currentStepAnimates.push({type:`matrix`,args:[e,t,n,r,i,a]}),this}matrix3d(e=1,t=0,n=0,r=0,i=0,a=1,o=0,s=0,c=0,l=0,u=1,d=0,ee=0,f=0,p=0,m=1){return this.currentStepAnimates.push({type:`matrix3d`,args:[e,t,n,r,i,a,o,s,c,l,u,d,ee,f,p,m]}),this}opacity(e){return this.currentStepAnimates.push({type:`style`,args:[`opacity`,e]}),this}right(e){return this.currentStepAnimates.push({type:`style`,args:[`right`,b(e)]}),this}rotate(e=0){return this.currentStepAnimates.push({type:`rotate`,args:[e]}),this}rotate3d(e=0,t=0,n=0,r=0){return this.currentStepAnimates.push({type:`rotate3d`,args:[e,t,n,r]}),this}rotateX(e){return this.currentStepAnimates.push({type:`rotateX`,args:[e]}),this}rotateY(e){return this.currentStepAnimates.push({type:`rotateY`,args:[e]}),this}rotateZ(e){return this.currentStepAnimates.push({type:`rotateZ`,args:[e]}),this}scale(e=1,t=1){return this.currentStepAnimates.push({type:`scale`,args:[e,t]}),this}scale3d(e=1,t=1,n=1){return this.currentStepAnimates.push({type:`scale3d`,args:[e,t,n]}),this}scaleX(e=1){return this.currentStepAnimates.push({type:`scaleX`,args:[e]}),this}scaleY(e=1){return this.currentStepAnimates.push({type:`scaleY`,args:[e]}),this}scaleZ(e=1){return this.currentStepAnimates.push({type:`scaleZ`,args:[e]}),this}skew(e=0,t=0){return this.currentStepAnimates.push({type:`skew`,args:[e,t]}),this}skewX(e=0){return this.currentStepAnimates.push({type:`skewX`,args:[e]}),this}skewY(e=0){return this.currentStepAnimates.push({type:`skewY`,args:[e]}),this}top(e){return this.currentStepAnimates.push({type:`style`,args:[`top`,b(e)]}),this}translate(e=0,t=0){return this.currentStepAnimates.push({type:`translate`,args:[e,t]}),this}translate3d(e=0,t=0,n=0){return this.currentStepAnimates.push({type:`translate3d`,args:[e,t,n]}),this}translateX(e=0){return this.currentStepAnimates.push({type:`translateX`,args:[e]}),this}translateY(e=0){return this.currentStepAnimates.push({type:`translateY`,args:[e]}),this}width(e){return this.currentStepAnimates.push({type:`style`,args:[`width`,b(e)]}),this}},Vi=t({setBackgroundColor:()=>Ui,setBackgroundTextStyle:()=>Hi});function Hi(e){O(`setBackgroundTextStyle`,e)}function Ui(e){O(`setBackgroundColor`,e)}var Wi=t({canvasToTempFilePath:()=>Ji,createCanvasContext:()=>Ki,createContext:()=>Gi,createOffscreenCanvas:()=>zn,drawCanvas:()=>qi});function Gi(){return new Xi}function Ki(e,t){return new Xi(e,Yi(t))}function qi(e={}){let t={...e,moduleId:e.moduleId||Yi(e.component)};delete t.component,O(`drawCanvas`,t,`render`)}function Ji(e={},t){let n={...e,moduleId:e.moduleId||Yi(t||e.component)};delete n.component,O(`canvasToTempFilePath`,n,`render`)}function Yi(e){return e?.__id__||D.getPageInfo()?.id}var Xi=class{constructor(e=``,t=null){this.canvasId=e,this.moduleId=t,this.actions=[]}pushAction(e,...t){return this.actions.push({type:e,args:t}),this}getActions(){return this.actions.slice()}draw(e=!1,t){this.canvasId&&(qi({canvasId:this.canvasId,moduleId:this.moduleId,actions:this.getActions(),reserve:e,success:t}),this.actions=[])}beginPath(){return this.pushAction(`beginPath`)}closePath(){return this.pushAction(`closePath`)}moveTo(e,t){return this.pushAction(`moveTo`,e,t)}lineTo(e,t){return this.pushAction(`lineTo`,e,t)}rect(e,t,n,r){return this.pushAction(`rect`,e,t,n,r)}arc(e,t,n,r,i,a=!1){return this.pushAction(`arc`,e,t,n,r,i,a)}quadraticCurveTo(e,t,n,r){return this.pushAction(`quadraticCurveTo`,e,t,n,r)}bezierCurveTo(e,t,n,r,i,a){return this.pushAction(`bezierCurveTo`,e,t,n,r,i,a)}fill(){return this.pushAction(`fill`)}stroke(){return this.pushAction(`stroke`)}clearRect(e,t,n,r){return this.pushAction(`clearRect`,e,t,n,r)}fillText(e,t,n,r){return this.pushAction(`fillText`,e,t,n,r)}drawImage(e,...t){return this.pushAction(`drawImage`,e,...t)}save(){return this.pushAction(`save`)}restore(){return this.pushAction(`restore`)}translate(e,t){return this.pushAction(`translate`,e,t)}rotate(e){return this.pushAction(`rotate`,e)}scale(e,t){return this.pushAction(`scale`,e,t)}setShadow(e,t,n,r){return this.pushAction(`setShadow`,e,t,n,r)}setFillStyle(e){return this.pushAction(`setFillStyle`,e)}setStrokeStyle(e){return this.pushAction(`setStrokeStyle`,e)}setGlobalAlpha(e){return this.pushAction(`setGlobalAlpha`,e)}setLineCap(e){return this.pushAction(`setLineCap`,e)}setLineJoin(e){return this.pushAction(`setLineJoin`,e)}setLineWidth(e){return this.pushAction(`setLineWidth`,e)}setMiterLimit(e){return this.pushAction(`setMiterLimit`,e)}setFontSize(e){return this.pushAction(`setFontSize`,e)}},Zi=t({nextTick:()=>ta}),Qi=[],$i=null;function ea(){let e=Qi;Qi=[],$i=null;for(let t=0;t<e.length;t++)e[t]()}function ta(e){n(e)&&(Qi.push(e),$i||=setTimeout(ea,0))}var na=t({disableAlertBeforeUnload:()=>ua,enableAlertBeforeUnload:()=>la,hideLoading:()=>ca,hideToast:()=>ia,showActionSheet:()=>sa,showLoading:()=>oa,showModal:()=>aa,showToast:()=>ra});function ra(e){O(`showToast`,e)}function ia(e){O(`hideToast`,e)}function aa(e){O(`showModal`,e)}function oa(e){O(`showLoading`,e)}function sa(e){O(`showActionSheet`,e)}function ca(e){O(`hideLoading`,e)}function la(e){O(`enableAlertBeforeUnload`,e)}function ua(e){O(`disableAlertBeforeUnload`,e)}var da=t({getMenuButtonBoundingClientRect:()=>pa,offMenuButtonBoundingClientRectWeightChange:()=>ha,onMenuButtonBoundingClientRectWeightChange:()=>ma}),fa=new Set;function pa(){return O(`getMenuButtonBoundingClientRect`)}function ma(e){n(e)&&fa.add(e)}function ha(e){n(e)?fa.delete(e):fa.clear()}var ga=t({hideNavigationBarLoading:()=>ba,setNavigationBarColor:()=>ya,setNavigationBarTitle:()=>va,showNavigationBarLoading:()=>_a});function _a(e){O(`showNavigationBarLoading`,e)}function va(e){O(`setNavigationBarTitle`,e)}function ya(e){O(`setNavigationBarColor`,e)}function ba(e){O(`hideNavigationBarLoading`,e)}var xa=t({startPullDownRefresh:()=>Ca,stopPullDownRefresh:()=>Sa});function Sa(e){O(`stopPullDownRefresh`,e)}function Ca(e){O(`startPullDownRefresh`,e)}var wa=t({pageScrollTo:()=>Ta});function Ta(e){O(`pageScrollTo`,e)}var Ea=t({hideTabBar:()=>Aa,hideTabBarRedDot:()=>Pa,removeTabBarBadge:()=>Ma,setTabBarBadge:()=>ja,setTabBarItem:()=>Oa,setTabBarStyle:()=>Da,showTabBar:()=>ka,showTabBarRedDot:()=>Na});function Da(e){O(`setTabBarStyle`,e)}function Oa(e){O(`setTabBarItem`,e)}function ka(e){O(`showTabBar`,e)}function Aa(e){O(`hideTabBar`,e)}function ja(e){O(`setTabBarBadge`,e)}function Ma(e){O(`removeTabBarBadge`,e)}function Na(e){O(`showTabBarRedDot`,e)}function Pa(e){O(`hideTabBarRedDot`,e)}var Fa=t({onWindowResize:()=>Ia});function Ia(e){e&&O(`onWindowResize`,{success:e})}var La=Object.assign({"./core/base/app-event/index.js":be,"./core/base/index.js":Ae,"./core/base/performance/index.js":Pe,"./core/base/subpackage/index.js":ze,"./core/base/system/index.js":He,"./core/base/update/index.js":Ze,"./core/camera/index.js":at,"./core/data-analysis/index.js":ct,"./core/device/bluetooth/index.js":dt,"./core/device/bluetooth-ble/index.js":Ct,"./core/device/clipboard/index.js":Lt,"./core/device/contact/index.js":Bt,"./core/device/keyboard/index.js":Ut,"./core/device/memory/index.js":Gt,"./core/device/network/index.js":Jt,"./core/device/phone/index.js":Xt,"./core/device/scan/index.js":Qt,"./core/device/vibrate/index.js":en,"./core/ext/index.js":rn,"./core/file/index.js":un,"./core/life-cycle/index.js":pr,"./core/location/index.js":gr,"./core/map/index.js":Cr,"./core/media/audio/index.js":Er,"./core/media/image/index.js":Ar,"./core/media/video/index.js":Fr,"./core/navigate/index.js":Br,"./core/network/download/index.js":Gr,"./core/network/request/index.js":qr,"./core/network/upload/index.js":Yr,"./core/network/websocket/index.js":Zr,"./core/open-api/account-info/index.js":oi,"./core/open-api/authorize/index.js":ci,"./core/open-api/index.js":ui,"./core/open-api/login/index.js":fi,"./core/open-api/privacy/index.js":mi,"./core/open-api/setting/index.js":gi,"./core/open-api/user-info/index.js":yi,"./core/payment/index.js":xi,"./core/route/index.js":me,"./core/share/index.js":Ci,"./core/storage/index.js":Di,"./core/ui/animation/index.js":Ri,"./core/ui/background/index.js":Vi,"./core/ui/canvas/index.js":Wi,"./core/ui/custom-component/index.js":Zi,"./core/ui/interaction/index.js":na,"./core/ui/menu/index.js":da,"./core/ui/navigation-bar/index.js":ga,"./core/ui/pull-down-refresh/index.js":xa,"./core/ui/scroll/index.js":wa,"./core/ui/tab-bar/index.js":Ea,"./core/ui/window/index.js":Fa,"./core/wxml/intersection-observer/index.js":Gn,"./core/wxml/selector-query/index.js":Bn}),Ra={};for(let e of Object.values(La))for(let[t,n]of Object.entries(e))Ra[t]=n;var za=new Proxy(Ra,{get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`||r!==void 0||t===`webpackJsonp`?r:(...e)=>O(t,...e)},set(e,t,n,r){return Reflect.set(e,t,n,r)}}),Ba=new class{constructor(){this.init()}init(){let e=globalThis.__diminaApiNamespaces||[];if(e.length===0&&globalThis.name)try{e=JSON.parse(globalThis.name).apiNamespaces||[]}catch{}for(let t of[`dd`,`wx`,...e])globalThis[t]=za;globalThis.modRequire=C,globalThis.modDefine=de,globalThis.global={},globalThis.App=e=>Q.createAppModule(e),globalThis.Page=e=>{Q.createModule(e,globalThis.__extraInfo,X.type)},globalThis.Component=e=>{Q.createModule(e,globalThis.__extraInfo,Y.type)},globalThis.Behavior=e=>e,globalThis.getApp=e=>{let t=$.app;return!t&&e?.allowDefault?{}:t},globalThis.getCurrentPages=()=>D.stack()}},Va={navigateBack:ye,navigateTo:ve,reLaunch:ge,redirectTo:_e,switchTab:he};return new class{constructor(){console.log(`[service] init`),this.env=Ba,this.message=E,this.init()}init(){this.message.on(`loadResource`,e=>{let{appId:t,bridgeId:n,pagePath:r,root:i=`.`,baseUrl:a=`/`,hostEnv:o}=e;o&&T.init(o),Q.loadResource({appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a})}),this.message.on(`t`,async e=>{let{bridgeId:t,moduleId:n,methodName:r,event:i,success:a}=e;if(r===void 0)return;let o=await $.triggerEvent({bridgeId:t,moduleId:n,methodName:r,event:i});o!==void 0&&this.message.send({type:`triggerCallback`,target:`render`,body:{bridgeId:t,moduleId:n,success:a,data:o}})}),this.message.on(`triggerCallback`,e=>{let{id:t,args:n}=e;w.invoke(t,n)}),this.onAppMsg(),this.onModuleMsg()}onAppMsg(){this.message.on(`resourceLoaded`,e=>{let{bridgeId:t,scene:n,pagePath:r,query:i,stackId:a}=e;$.createApp({scene:n,pagePath:r,query:i});let o=Q.getModuleByPath(r);if(!o){console.error(`[service] resourceLoaded: module not found, pagePath: ${r}`);return}let s=Q.getPropsByPath(o.usingComponents),c=`page_${g()}`;$.createInstance({bridgeId:t,moduleId:c,path:r,query:i,stackId:a}),E.send({type:`firstRender`,target:`render`,body:{bridgeId:t,pageId:c,pagePath:r,initialProps:s,query:i}})}),this.message.on(`appShow`,()=>{$.appShow()}),this.message.on(`appHide`,()=>{$.appHide()}),this.message.on(`stackShow`,({stackId:e})=>{$.stackShow(e)}),this.message.on(`stackHide`,({stackId:e})=>{$.stackHide(e)})}onModuleMsg(){this.message.on(`mC`,e=>{$.createInstance(e)}),this.message.on(`mR`,e=>{$.moduleReady(e)}),this.message.on(`mU`,e=>{$.moduleUnmounted(e)}),this.message.on(`pageUnload`,e=>{$.pageUnload(e)}),this.message.on(`pageShow`,e=>{$.pageShow(e)}),this.message.on(`pageReady`,e=>{$.pageReady(e)}),this.message.on(`pageHide`,e=>{$.pageHide(e)}),this.message.on(`pagePullDownRefresh`,()=>{}),this.message.on(`pageReachBottom`,()=>{}),this.message.on(`pageShareAppMessage`,()=>{}),this.message.on(`pageScroll`,e=>{$.pageScroll(e)}),this.message.on(`pageResize`,e=>{$.pageResize(e)}),this.message.on(`onTabItemTap`,()=>{}),this.message.on(`pageRouteDone`,e=>{let{bridgeId:t}=e;$.componentRouteDone({bridgeId:t})}),this.message.on(`componentError`,e=>{$.componentError(e)}),this.message.on(`h5SdkAction`,async(e={})=>{let t=e?.name?.replace(/h5/i,``),{url:n}=e?.params?.data?.params||{};if(e.params&&(e.params.data={...e.params?.data,...e.params?.data?.params||{}}),t===`postMessage`&&e.parentWebViewId){let{moduleId:t,attrs:n,params:r}=e,i={detail:{data:[r?.data?.params?.data]}},a=n.message,o=e.parentWebViewId,s=await $.triggerEvent({bridgeId:o,moduleId:t,methodName:a,event:i});s!==void 0&&this.message.send({type:`triggerCallback`,target:`service`,body:{bridgeId:o,moduleId:t,success:r?.success,data:s}})}Va[t]?.({url:n,...e.params})})}}})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"diminaGitHash": "
|
|
3
|
-
"inputFingerprint": "
|
|
2
|
+
"diminaGitHash": "644dd9ef38e1e5b18a2eb792eed5416f1b9c3057",
|
|
3
|
+
"inputFingerprint": "6fbdbb21fcdf8a431bbf27fceafca8369beb1093857211a2931272bcd981e5c3"
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="
|
|
1
|
+
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"><title>星河小程序</title><script type="module" crossorigin src="/assets/index.js"></script><link rel="stylesheet" crossorigin href="/assets/index.css"></head><body><div id="root"></div></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimina-kit/devkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2-dev.20260522085907",
|
|
4
4
|
"description": "Development toolkit for Dimina mini-apps with H5 container preview",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dimina",
|
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
"@types/node": "^22.15.3",
|
|
52
52
|
"eslint": "^10.2.1",
|
|
53
53
|
"typescript": "5.9.2",
|
|
54
|
+
"vitest": "^4.1.4",
|
|
54
55
|
"@dimina-kit/eslint-config": "0.1.0",
|
|
55
56
|
"@dimina-kit/typescript-config": "0.1.0"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
58
|
-
"@dimina/compiler": "1.0.
|
|
59
|
+
"@dimina/compiler": "1.0.16",
|
|
59
60
|
"axios": "^1.15.0",
|
|
60
61
|
"chokidar": "^5.0.0",
|
|
61
62
|
"cors": "^2.8.6",
|
|
@@ -68,6 +69,8 @@
|
|
|
68
69
|
"scripts": {
|
|
69
70
|
"build": "tsc",
|
|
70
71
|
"check-types": "tsc --noEmit",
|
|
71
|
-
"lint": "eslint . --max-warnings 0"
|
|
72
|
+
"lint": "eslint . --max-warnings 0",
|
|
73
|
+
"test": "vitest run",
|
|
74
|
+
"test:dev": "vitest"
|
|
72
75
|
}
|
|
73
76
|
}
|