@neuxnet/neux-cli 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 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]))}function o(e){return e===`__proto__`}function s(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function c(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function l(e){if(Array.isArray(e))return e.map(c);if(typeof e==`symbol`)return[e];e=u(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 u(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(u).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function d(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||o(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function f(e,t){if(e!=null)switch(typeof t){case`string`:{if(o(t))return;let n=e[t];return n===void 0?s(t)?f(e,l(t)):void 0:n}case`number`:case`symbol`:{typeof t==`number`&&(t=c(t));let n=e[t];return n===void 0?void 0:n}default:{if(Array.isArray(t))return d(e,t);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),o(t))return;let n=e[t];return n===void 0?void 0:n}}}function p(){return Math.random().toString(36).slice(2,7)}function m(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function h(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}var g=typeof window<`u`&&typeof navigator<`u`;g&&/Android/i.test(navigator.userAgent),g&&/iPad|iPhone|iPod/.test(navigator.userAgent),g&&/OpenHarmony|harmony/.test(navigator.userAgent),g&&/Android|iPad|iPhone|iPod|OpenHarmony|harmony|Mobile/.test(navigator.userAgent);var _=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function ee(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 te(e,t){let n=e.split(`/`).slice(0,-1).join(`/`),r=t.split(`?`),i=r[0],a=r[1],o=ee(n,i);return a&&(o+=`?${a}`),o}function v(e){return typeof e==`number`&&Number.isFinite(e)&&!Number.isNaN(e)?`${e}px`:e}function y(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 ne={},re=1,ie=2;function ae(e,t){ne[e]||(ne[e]={factory:t,status:re,exports:void 0})}function oe(e,t){ne[e]={factory:t,status:re,exports:void 0}}function b(e,t,r){if(typeof e!=`string`)throw TypeError(`require args must be a string`);let i=ne[e];if(!i)throw Error(`module ${e} not found`);if(i.status===re){i.status=ie;let t={exports:{}},a;try{i.factory&&(a=i.factory.call(null,b,t,t.exports))}catch(t){i.status=re;let a=`
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]))}function o(e){return e===`__proto__`}function s(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e.includes(`.`)||e.includes(`[`)||e.includes(`]`)}}function c(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function l(e){if(Array.isArray(e))return e.map(c);if(typeof e==`symbol`)return[e];e=u(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 u(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(u).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function d(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||o(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function f(e,t){if(e!=null)switch(typeof t){case`string`:{if(o(t))return;let n=e[t];return n===void 0?s(t)?f(e,l(t)):void 0:n}case`number`:case`symbol`:{typeof t==`number`&&(t=c(t));let n=e[t];return n===void 0?void 0:n}default:{if(Array.isArray(t))return d(e,t);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),o(t))return;let n=e[t];return n===void 0?void 0:n}}}function p(){return Math.random().toString(36).slice(2,7)}function m(e){return e.toLowerCase().replace(/-(.)/g,(e,t)=>t.toUpperCase())}function h(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}var g=typeof window<`u`&&typeof navigator<`u`;g&&/Android/i.test(navigator.userAgent),g&&/iPad|iPhone|iPod/.test(navigator.userAgent),g&&/OpenHarmony|harmony/.test(navigator.userAgent),g&&/Android|iPad|iPhone|iPod|OpenHarmony|harmony|Mobile/.test(navigator.userAgent);var ee=typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;function te(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 ne(e,t){let n=e.split(`/`).slice(0,-1).join(`/`),r=t.split(`?`),i=r[0],a=r[1],o=te(n,i);return a&&(o+=`?${a}`),o}function _(e){return typeof e==`number`&&Number.isFinite(e)&&!Number.isNaN(e)?`${e}px`:e}function v(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 re={},ie=1,ae=2;function oe(e,t){re[e]||(re[e]={factory:t,status:ie,exports:void 0})}function se(e,t){re[e]={factory:t,status:ie,exports:void 0}}function y(e,t,r){if(typeof e!=`string`)throw TypeError(`require args must be a string`);let i=re[e];if(!i)throw Error(`module ${e} not found`);if(i.status===ie){i.status=ae;let t={exports:{}},a;try{i.factory&&(a=i.factory.call(null,y,t,t.exports))}catch(t){i.status=ie;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: ${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}b.async=async e=>new Promise((t,n)=>{try{t(b(e))}catch(t){n(Error(`${t.message}: Failed to initialize asynchronous loading for module '${e}'`))}});var x=new class{constructor(){this.callbacks={}}store(e,t,n=p()){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])}has(e){return!!(e&&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]})}},se=`__dimina_data_function_reference__`,ce=1;function le(e){return{[se]:e,version:ce}}function ue(e){return typeof e==`object`&&!!e&&e.version===ce&&typeof e[se]==`string`&&Object.keys(e).length===2}function de(e){return ue(e)?e[se]:void 0}function fe(e,{mapFunction:t,mapReference:n}={},r=new WeakMap){if(typeof e==`function`)return t?t(e):e;if(typeof e!=`object`||!e)return e;if(ue(e))return n?n(e):e;if(e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e))return e;if(!Array.isArray(e)){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e}if(r.has(e))return r.get(e);let i=Array.isArray(e)?[]:{};r.set(e,i);for(let a of Object.keys(e))i[a]=fe(e[a],{mapFunction:t,mapReference:n},r);return i}var pe=new Set([String,Number,Boolean,Object,Array,null]);function me(e){return pe.has(e)}function he(e){return e===String?``:e===Number?0:e===Boolean?!1:e===Array?[]:null}function ge(e){return Array.isArray(e)?e.filter(me):[]}function _e(e){let t,n=[],r;return me(e)?t=e:e&&typeof e==`object`&&(t=e.type,n=ge(e.optionalTypes),r=e.value),me(t)||(t=n[0]??null),r===void 0&&(r=he(t)),{type:t,optionalTypes:n,value:y(r)}}function ve(e){return Array.isArray(e)}function ye(e){return ve(e)&&e?.constructor?.name===Array.name}function be(e,t){return e===String?typeof t==`string`:e===Number?Number.isFinite(t):e===Boolean?typeof t==`boolean`:e===Object?t!==null&&t?.constructor===Object:e===Array?ye(t):t!==void 0}function xe(e,t){typeof e==`function`&&e(t)}function Se(e,t,{absent:n=!1,warn:r}={}){if(n)return y(e.value);for(let n of e.optionalTypes||[])if(be(n,t))return t;let i=e.type;if(i===String)return t==null?(xe(r,`property received type-uncompatible value: expected <String> but get null value. Used empty string instead.`),``):(typeof t==`object`&&xe(r,`property received type-uncompatible value: expected <String> but got object-typed value. Forcely converted.`),String(t));if(i===Number){try{if(Number.isFinite(Number(t)))return Number(t)}catch{}return xe(r,`property received type-uncompatible value: expected <Number> but ${typeof t==`number`?`got NaN or Infinity`:`got non-number value`}. Used 0 instead.`),0}return i===Boolean?!!t:i===Array?ve(t)?t:(xe(r,`property received type-uncompatible value: expected <Array> but got non-array value. Used empty array instead.`),[]):i===Object?typeof t==`object`?t:(xe(r,`property received type-uncompatible value: expected <Object> but got non-object value. Used null instead.`),null):t===void 0?null:t}var Ce=t({__themeChangeTestHooks:()=>ke,notifyThemeChange:()=>De,offThemeChange:()=>Ee,onThemeChange:()=>Te}),we=new Set;function Te(e){n(e)&&we.add(e)}function Ee(e){n(e)?we.delete(e):we.clear()}function De(e){let t=Oe(e);if(t)for(let e of Array.from(we))try{e({theme:t})}catch(e){console.error(`[service] onThemeChange callback error:`,e)}}function Oe(e){return e===`dark`||e===`light`?e:``}var ke={themeChangeCallbacks:we,normalizeTheme:Oe},S=new class{constructor(){this.listeners=new Set,this.reset()}reset(){this.active=!1,this.snapshot=Ae()}init(e={}){this.active=!0,this.snapshot={...Ae(),...e}}update(e={}){this.snapshot={...this.snapshot,...je(this.snapshot,e)},this.listeners.forEach(t=>t(e,this.snapshot))}onUpdate(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get(e){return this.active?this.snapshot[e]??null:null}getSystemInfo(){return this.get(`systemInfo`)}getHostCustom(){return this.get(`hostCustom`)??{}}getMenuRect(){return this.get(`menuRect`)}getDomainPolicy(){return this.get(`domainPolicy`)}getAnalyticsBaseContext(){return this.get(`analyticsBaseContext`)}getAnalyticsRemoteConfig(){return this.get(`analyticsRemoteConfig`)}getStorageSnapshot(){return this.get(`storageSnapshot`)??{}}};function Ae(){return{systemInfo:null,hostCustom:{},menuRect:null,domainPolicy:null,analyticsBaseContext:null,analyticsRemoteConfig:null,storageSnapshot:{}}}function je(e,t){let n={...t};for(let r of[`systemInfo`,`hostCustom`,`menuRect`,`domainPolicy`,`analyticsBaseContext`,`analyticsRemoteConfig`,`vConsoleEnabled`])t[r]&&typeof t[r]==`object`&&!Array.isArray(t[r])&&e[r]&&typeof e[r]==`object`&&!Array.isArray(e[r])&&(n[r]={...e[r],...t[r]});return Object.prototype.hasOwnProperty.call(t,`storageSnapshot`)&&(n.storageSnapshot=t.storageSnapshot??{}),n}function Me(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 C=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()}remove(e){for(let t=this.#e.length-1;t>=0;t--){let n=this.#e[t].pages,r=n.findIndex(t=>t.id===e);if(r!==-1){n.splice(r,1);return}}}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}{let e=this.#e[this.#e.length-1];return e?e.pages:this.pushStack(Date.now()).pages}}},Ne=new WeakMap,Pe=new Map;function Fe(e){let t=Ne.get(e);if(t)return Pe.set(t,e),t;let n;do n=`data-function-${p()}`;while(Pe.has(n));return Ne.set(e,n),Pe.set(n,e),n}function Ie(e){return Pe.get(e)}function Le(e){return fe(e,{mapFunction(e){return le(Fe(e))}})}function Re(e){return fe(e,{mapReference(e){return Ie(de(e))||e}})}var w=new class e{constructor(){this.event=Me(),this.isForwardingConsole=!1,this.currentBridgeId=``,this.init(),this.installConsoleForwarder()}init(){_?globalThis.onmessage=e=>{this.handleMsg(e.data)}:DiminaServiceBridge.onMessage=this.handleMsg.bind(this)}handleMsg(e){let t=Re(e);this.currentBridgeId=t?.body?.bridgeId||this.currentBridgeId;let{type:n,body:r}=t;this.event.emit(n,r)}installConsoleForwarder(){let e=globalThis.console;if(e.__diminaConsoleForwarderInstalled)return;Object.defineProperty(e,"__diminaConsoleForwarderInstalled",{value:!0,configurable:!0});let t=(e,t)=>{if(!this.isForwardingConsole)try{this.isForwardingConsole=!0,this.send({type:`print`,target:`render`,body:{bridgeId:this.currentBridgeId||C.getPageInfo().id,type:e,detail:t}})}catch{}finally{this.isForwardingConsole=!1}},n=e=>{if(e instanceof Error)return{__diminaConsoleType:`error`,name:e.name,message:e.message,stack:e.stack};if(e===void 0)return{__diminaConsoleType:`undefined`};if(typeof e==`function`)return{__diminaConsoleType:`function`,value:String(e)};try{return JSON.stringify(e),e}catch{return{__diminaConsoleType:`unserializable`,value:String(e)}}},r=e=>{let t=e[0];return typeof t==`string`&&(t.startsWith(`[service]`)||t.startsWith(`[system]`)||t===`system`)};[`log`,`info`,`warn`,`error`,`debug`,`trace`].forEach(i=>{let a=typeof e[i]==`function`?e[i].bind(e):null;a&&(e[i]=(...e)=>{a(...e),!r(e)&&t(i,{kind:`console`,method:i,args:e.map(n)})})});let i=typeof e.clear==`function`?e.clear.bind(e):null;i&&(e.clear=(...e)=>{i(...e),t(`clear`,{kind:`console-clear`})})}on(e,t){this.event.on(e,t)}off(e){this.event.off(e)}getBridgeId(){return this.currentBridgeId||C.getPageInfo().bridgeId||C.getPageInfo().id}send(t){return _?e.prototype.send=function(e){let t=Le(e);t.method=`publish`,globalThis.postMessage(t)}:e.prototype.send=function(e){let t=Le(e);return DiminaServiceBridge.publish(t.body.bridgeId||``,t)},this.send(t)}invoke(t){return _?e.prototype.invoke=function(e){e.method=`invoke`,globalThis.postMessage(e)}:e.prototype.invoke=function(e){return DiminaServiceBridge.invoke(e)},this.invoke(t)}};function ze(e,t){if(!e)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Be(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Ve(e,t){return e&&{...e,hostCustom:Be(t)}}var He={getWindowInfo:()=>ze(S.getSystemInfo(),[`pixelRatio`,`screenWidth`,`screenHeight`,`windowWidth`,`windowHeight`,`statusBarHeight`,`safeArea`,`screenTop`]),getSystemInfoSync:()=>Ve(S.getSystemInfo(),S.getHostCustom()),getAppBaseInfo:()=>{let e=S.getSystemInfo();return e&&{...ze(e,[`SDKVersion`,`enableDebug`,`host`,`language`,`version`,`theme`,`fontSizeScaleFactor`,`fontSizeSetting`]),hostCustom:Be(S.getHostCustom())}},getDeviceInfo:()=>ze(S.getSystemInfo(),[`abi`,`benchmarkLevel`,`brand`,`model`,`platform`,`system`]),getMenuButtonBoundingClientRect:()=>S.getMenuRect()},Ue=new Set([`connectSocket`,`downloadFile`,`loadSubpackage`,`preDownloadSubpackage`,`request`,`uploadFile`]),We=new Set(`FileSystemManager.getSavedFileList,clearStorage,chooseImage,chooseMessageFile,chooseMedia,chooseVideo,closeBluetoothAdapter,getClipboardData,getEmail,getBluetoothAdapterState,getBluetoothDevices,getLocation,getNetworkType,getPrivacySetting,getStorageInfo,getSystemInfo,getSystemInfoAsync,getUserInfo,hideKeyboard,hideLoading,hideShareMenu,hideTabBar,hideToast,login,navigateBack,openAppAuthorizeSetting,openBluetoothAdapter,openSetting,openSystemBluetoothSetting,requirePrivacyAuthorize,showNavigationBarLoading,showShareMenu,showTabBar,startPullDownRefresh,startRecord,stopPullDownRefresh,stopBluetoothDevicesDiscovery,stopLocationUpdate,stopRecord,vibrateLong,vibrateShort`.split(`,`));function Ge(e){return Object.prototype.hasOwnProperty.call(e,`success`)||Object.prototype.hasOwnProperty.call(e,`fail`)||Object.prototype.hasOwnProperty.call(e,`complete`)}function Ke(e,t){return Ue.has(e)||typeof e==`string`&&e.endsWith(`Sync`)?!1:t!==void 0||We.has(e)}function qe(e,t,n){let r={type:`invokeAPI`,target:n,body:{name:e,bridgeId:C.getPageInfo().id,params:t}};return n===`container`?w.invoke(r):w.send(r)}function Je(e,t,n){return new Promise((r,i)=>{let a,o,s=()=>{x.remove(a),x.remove(o)};a=x.store(e=>{s(),r(e)}),o=x.store(e=>{s(),i(e)}),t.success=a,t.fail=o;try{qe(e,t,n)}catch(e){s(),i(e)}})}function T(e,t,r=`container`){let i=He[e];if(r===`container`&&i){let e=i();if(e)return e}let a;if(t===void 0){if(Ke(e,t))return Je(e,{},r);a=t}else if(typeof t==`string`||Array.isArray(t))a=t;else if(n(t))a={success:x.store(t,!0)};else if(Ge(t)){let{success:e,fail:r,complete:i,keep:o,evtId:s,...c}=t;a=c,s!==void 0&&(a.evtId=s),n(e)?a.success=x.store(e,o,s):a.success=e,n(r)&&(a.fail=x.store(r,o,s)),n(i)&&(a.complete=x.store(i,o,s))}else{let{keep:n,...i}=t;if(delete i.evtId,!n&&Ke(e,t))return a={...i},Je(e,a,r);a=i}return qe(e,a,r)}var Ye=t({navigateBack:()=>et,navigateTo:()=>$e,reLaunch:()=>Ze,redirectTo:()=>Qe,switchTab:()=>Xe});function Xe(e){return e.url=te(C.getPageInfo().route,e.url),T(`switchTab`,e)}function Ze(e){return e.url=te(C.getPageInfo().route,e.url),T(`reLaunch`,e)}function Qe(e){let t=te(C.getPageInfo().route,e.url);if(C.getPageInfo().route!==t)return e.url=t,T(`redirectTo`,e)}function $e(e){return e.url=te(C.getPageInfo().route,e.url),T(`navigateTo`,e)}function et(e){return T(`navigateBack`,e)}var tt=new WeakSet;function nt(e,t,r){if(e&&(typeof e==`object`||typeof e==`function`)&&!tt.has(e)){tt.add(e);try{n(e.componentError)&&e.componentError(t)}catch(e){console.error(`[service] error lifetime error:`,e)}finally{tt.delete(e)}}console.error(`[service] ${r} error:`,t)}function E(e,t,r=[],i=`callback`,a=!0){if(n(t))try{return t.apply(e,r)}catch(t){a?nt(e,t,i):console.error(`[service] ${i} error:`,t);return}}function D(e,t,n=[],r=`callback`,i=!0){for(let a of t||[])E(e,a,n,r,i)}var rt=[`onLaunch`,`onShow`,`onHide`],it=[`globalData`],at=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(){rt.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)rt.includes(t)||it.includes(t)||(this[t]=n(e[t])?e[t].bind(this):e[t])}invokeSomeLifecycle(){E(this,this.onLaunch,[this.options],`onLaunch`),E(this,this.onShow,[this.options],`onShow`)}appShow(){E(this,this.onShow,[this.options],`onShow`)}appHide(){E(this,this.onHide,[],`onHide`)}},ot=new Set([`2d`]),st=new Set([`webgl`,`experimental-webgl`,`webgl2`]),ct=new Set([`createLinearGradient`,`createPattern`,`createRadialGradient`]),lt=new Map([[`createBuffer`,`buffer`],[`createFramebuffer`,`framebuffer`],[`createProgram`,`program`],[`createQuery`,`query`],[`createRenderbuffer`,`renderbuffer`],[`createSampler`,`sampler`],[`createShader`,`shader`],[`createTexture`,`texture`],[`createTransformFeedback`,`transformFeedback`],[`createVertexArray`,`vertexArray`],[`fenceSync`,`sync`]]),ut=new Map([[`getAttribLocation`,`attribLocation`],[`getUniformLocation`,`uniformLocation`]]),dt=new Map([[`deleteBuffer`,`buffer`],[`deleteFramebuffer`,`framebuffer`],[`deleteProgram`,`program`],[`deleteQuery`,`query`],[`deleteRenderbuffer`,`renderbuffer`],[`deleteSampler`,`sampler`],[`deleteShader`,`shader`],[`deleteSync`,`sync`],[`deleteTexture`,`texture`],[`deleteTransformFeedback`,`transformFeedback`],[`deleteVertexArray`,`vertexArray`]]),ft=new Map([[`isBuffer`,`buffer`],[`isFramebuffer`,`framebuffer`],[`isProgram`,`program`],[`isQuery`,`query`],[`isRenderbuffer`,`renderbuffer`],[`isSampler`,`sampler`],[`isShader`,`shader`],[`isSync`,`sync`],[`isTexture`,`texture`],[`isTransformFeedback`,`transformFeedback`],[`isVertexArray`,`vertexArray`]]),pt={alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:`default`,failIfMajorPerformanceCaveat:!1,desynchronized:!1},mt=new Map,O={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};function ht(e){let t=String(e).toLowerCase();return t===`experimental-webgl`?`webgl`:t}function gt(e,t){!e||!t||mt.set(e,t)}function _t(e){return mt.get(e)||null}function vt(e,t){return e&&e[ht(t)]||null}function k(e){if(e==null)return e;if(Array.isArray(e))return e.map(e=>k(e));if(typeof e!=`object`)return e;if(e.__canvasTypedArray){if(e.__canvasTypedArray===`DataView`)return new DataView(new Uint8Array(e.data||[]).buffer);let t=globalThis[e.__canvasTypedArray];return typeof t==`function`?new t(e.data||[]):e.data||[]}let t={};for(let[n,r]of Object.entries(e))t[n]=k(r);return t}w.on(`canvasCapabilities`,({bridgeId:e,capabilities:t})=>{gt(e,t)}),w.on(`resourceLoaded`,({bridgeId:e,canvasCapabilities:t})=>{gt(e,t)});var yt=1,bt=1;function xt(){let e=C.getPageInfo();return e?.bridgeId||e?.id||``}function St(e,t){if(e===void 0)return t;let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function Ct(e,t,n){w.send({type:`invokeAPI`,target:`render`,body:{bridgeId:e,name:t,params:n}})}function wt(e){Promise.resolve().then(e)}function Tt(e){return Object.prototype.toString.call(e)===`[object Object]`}function Et(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 Dt(e){if(e==null)return e;if(e.__canvasResourceId)return{__canvasResourceId:e.__canvasResourceId};if(e.__diminaCanvasNode)return{__canvasNodeId:e.nodeId};let t=Et(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=>Dt(e));if(Tt(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=Dt(r);return t}return e}function A(e){return Array.from(e).map(e=>Dt(e))}function j(e=`canvas_resource`){return`${e}_${p()}`}var M=class{constructor(e,t,n=`resource`,r={}){return this.__canvasResourceId=t,this.__canvasProxyValue=yt++,this.canvas=e,this.resourceType=n,this.metadata=r,this.deleted=!1,new Proxy(this,{get(e,n){if(n in e){let t=e[n];return typeof t==`function`?t.bind(e):t}if(typeof n!=`symbol`)return(...r)=>{e.canvas.enqueueOperation({op:`resourceCall`,resourceId:t,method:n,args:A(r)})}}})}valueOf(){return this.__canvasProxyValue}toString(){return String(this.__canvasProxyValue)}markDeleted(){this.deleted=!0}updateMetadata(e={}){Object.assign(this.metadata,e)}},Ot=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=x.store((e={})=>{this.width=e.width||this.width,this.height=e.height||this.height,n(this.onload)&&this.onload(e)}),r=x.store((e={})=>{n(this.onerror)&&this.onerror(e)});this.canvas.enqueueOperation({op:`imageSetSrc`,imageId:this.imageId,src:e,onload:t,onerror:r})}},kt=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:Dt(r)}),!0}})}async getImageData(e,t,n,r){return await this.canvas.getImageData({contextId:this.contextId,x:e,y:t,width:n,height:r})}toDataURL(e,t){return this.canvas.toDataURL(e,t)}call(e,t){if(e===`measureText`)return{width:String(t[0]??``).length*10};if(e===`createImageData`){let e=t[0],n=t[1];return{width:e,height:n,data:new Uint8ClampedArray(e*n*4)}}let n=ct.has(e)?j():void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:A(t),resultId:n}),n)return new M(this.canvas,n)}},At=class{constructor(e,t,n,r={}){return this.context=e,this.name=t,this.__canvasResourceId=n,this.constants=r.constants||{},new Proxy(this,{get(e,t){if(t in e){let n=e[t];return typeof n==`function`?n.bind(e):n}if(Object.prototype.hasOwnProperty.call(e.constants,t))return e.constants[t];if(typeof t!=`symbol`)return(...n)=>e.call(t,n)}})}call(e,t){let n,r;if(e.startsWith(`create`))r=j(`webgl_extension_resource`),n=new M(this.context.canvas,r,`${this.name}:${e}`),this.context.resources.set(r,n);else if(e.startsWith(`delete`)&&t[0]?.markDeleted)t[0].markDeleted();else if(e.startsWith(`is`)&&t[0]instanceof M)return!t[0].deleted;return this.context.canvas.enqueueOperation({op:`extensionCall`,contextId:this.context.contextId,extensionId:this.__canvasResourceId,method:e,args:A(t),resultId:r}),n}},jt=class{constructor(e,t,n,r,i){return this.canvas=e,this.contextId=t,this.contextType=n,this.requestedAttributes={...pt,...Tt(r)?r:{}},this.capabilities=null,this.resources=new Map,this.extensions=new Map,this.properties=new Map,this.state=new Map,this.enabledCapabilities=new Set,this.errors=[],this.queryResults=new Map,this.contextLost=!1,this.creationFailed=!1,this.hasActualCapabilities=!1,this.initializeState(),this.updateCapabilities(i),new Proxy(this,{get(e,t){if(t in e){let n=e[t];return typeof n==`function`?n.bind(e):n}if(e.properties.has(t))return e.properties.get(t);if(Object.prototype.hasOwnProperty.call(e.capabilities?.constants||{},t))return e.capabilities.constants[t];if(Object.prototype.hasOwnProperty.call(O,t))return O[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)},set(e,n,r){return e.properties.set(n,r),e.canvas.enqueueOperation({op:`contextSetProperty`,contextId:t,prop:n,value:Dt(r)}),!0}})}initializeState(){let{width:e,height:t}=this.canvas;this.state.set(O.VIEWPORT,[0,0,e,t]),this.state.set(O.SCISSOR_BOX,[0,0,e,t]),this.state.set(O.COLOR_CLEAR_VALUE,new Float32Array([0,0,0,0])),this.state.set(O.COLOR_WRITEMASK,[!0,!0,!0,!0]),this.state.set(O.DEPTH_CLEAR_VALUE,1),this.state.set(O.DEPTH_WRITEMASK,!0),this.state.set(O.DEPTH_FUNC,O.LESS),this.state.set(O.STENCIL_CLEAR_VALUE,0),this.state.set(O.LINE_WIDTH,1),this.state.set(O.CULL_FACE_MODE,O.BACK),this.state.set(O.FRONT_FACE,O.CCW),this.state.set(O.ACTIVE_TEXTURE,O.TEXTURE0),this.state.set(O.PACK_ALIGNMENT,4),this.state.set(O.UNPACK_ALIGNMENT,4),this.state.set(O.CURRENT_PROGRAM,null),this.state.set(O.ARRAY_BUFFER_BINDING,null),this.state.set(O.ELEMENT_ARRAY_BUFFER_BINDING,null),this.state.set(O.TEXTURE_BINDING_2D,null),this.state.set(O.FRAMEBUFFER_BINDING,null),this.state.set(O.RENDERBUFFER_BINDING,null)}updateCapabilities(e,t=!1){if(!e)return;let n=k(e),r={...this.capabilities?.extensions||{}};for(let[e,t]of Object.entries(n.extensions||{}))r[e]={...r[e]||{},...t,constants:{...r[e]?.constants||{},...t.constants||{}}};this.capabilities={...this.capabilities||{},...n,constants:{...this.capabilities?.constants||{},...n.constants||{}},parameters:{...this.capabilities?.parameters||{},...n.parameters||{}},extensions:r,shaderPrecisionFormats:{...this.capabilities?.shaderPrecisionFormats||{},...n.shaderPrecisionFormats||{}}},this.hasActualCapabilities||=t,typeof this.capabilities.contextLost==`boolean`&&(this.contextLost=this.capabilities.contextLost)}applyFeedback(e={}){e.success===!1?(this.creationFailed=!0,this.contextLost=!0,this.canvas.handleContextCreationFailure(this.contextId,this.contextType,e.statusMessage)):e.capabilities&&this.updateCapabilities(e.capabilities,!0),typeof e.contextLost==`boolean`&&(this.contextLost=e.contextLost);for(let t of e.errors||[])this.queueError(t);for(let t of e.resources||[])this.resources.get(t.resourceId)?.updateMetadata(k(t.metadata));for(let t of e.queries||[])this.queryResults.set(t.key,this.deserializeFeedbackValue(t.value))}deserializeFeedbackValue(e){if(e?.__canvasResourceId)return this.resources.get(e.__canvasResourceId)||null;if(Array.isArray(e))return e.map(e=>this.deserializeFeedbackValue(e));if(e&&typeof e==`object`&&!e.__canvasTypedArray){let t={};for(let[n,r]of Object.entries(e))t[n]=this.deserializeFeedbackValue(r);return t}return k(e)}queueError(e){e&&e!==O.NO_ERROR&&!this.errors.includes(e)&&this.errors.push(e)}queryKey(e,t){return`${e}:${JSON.stringify(A(t))}`}requestQuery(e,t,n=null){let r=this.queryKey(e,t);return this.canvas.enqueueOperation({op:`contextQuery`,contextId:this.contextId,method:e,args:A(t),key:r}),this.queryResults.has(r)?this.queryResults.get(r):n}createResource(e,t,n){let r=j(`webgl_${n}`),i={};n===`shader`?(i.shaderType=t[0],i.source=``,i.compileStatus=!1,i.infoLog=``):n===`program`&&(i.attachedShaders=[],i.linkStatus=!1,i.validateStatus=!1,i.infoLog=``);let a=new M(this.canvas,r,n,i);return this.resources.set(r,a),this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:A(t),resultId:r}),a}call(e,t){switch(e){case`getParameter`:return this.getParameter(t[0]);case`getShaderParameter`:return this.getShaderParameter(t[0],t[1]);case`getProgramParameter`:return this.getProgramParameter(t[0],t[1]);case`getShaderInfoLog`:return t[0]?.metadata?.infoLog||``;case`getProgramInfoLog`:return t[0]?.metadata?.infoLog||``;case`getShaderSource`:return t[0]?.metadata?.source||null;case`getAttachedShaders`:return t[0]?.metadata?.attachedShaders?.slice()||[];case`getError`:return this.errors.shift()||(this.canvas.enqueueOperation({op:`contextFeedback`,contextId:this.contextId}),O.NO_ERROR);case`isContextLost`:return this.canvas.enqueueOperation({op:`contextFeedback`,contextId:this.contextId}),this.contextLost;case`isEnabled`:return this.enabledCapabilities.has(t[0]);case`checkFramebufferStatus`:return this.requestQuery(e,t,O.FRAMEBUFFER_COMPLETE);case`getContextAttributes`:return{...this.hasActualCapabilities&&this.capabilities?.contextAttributes?this.capabilities.contextAttributes:this.requestedAttributes};case`getSupportedExtensions`:return(this.capabilities?.supportedExtensions||[]).slice();case`getExtension`:return this.getExtension(t[0]);case`getShaderPrecisionFormat`:return this.getShaderPrecisionFormat(t[0],t[1]);case`getActiveAttrib`:case`getActiveUniform`:case`getBufferParameter`:case`getFramebufferAttachmentParameter`:case`getRenderbufferParameter`:case`getTexParameter`:case`getUniform`:case`getVertexAttrib`:case`getVertexAttribOffset`:return this.requestQuery(e,t)}let n=lt.get(e)||ut.get(e);if(n)return this.createResource(e,t,n);if(ft.has(e)){let n=t[0];return n instanceof M&&n.resourceType===ft.get(e)&&!n.deleted}dt.has(e)&&t[0]?.markDeleted&&t[0].markDeleted(),this.updateState(e,t);let r={op:`contextCall`,contextId:this.contextId,method:e,args:A(t)};e===`compileShader`?(t[0]?.updateMetadata({compileStatus:!0}),r.feedback=`shader`):e===`linkProgram`||e===`validateProgram`?(t[0]?.updateMetadata(e===`linkProgram`?{linkStatus:!0}:{validateStatus:!0}),r.feedback=`program`):e===`readPixels`&&ArrayBuffer.isView(t[6])?(r.typedArrayUpdateId=this.canvas.registerTypedArrayUpdate(t[6]),r.typedArrayArgIndex=6):e===`getBufferSubData`&&ArrayBuffer.isView(t[2])&&(r.typedArrayUpdateId=this.canvas.registerTypedArrayUpdate(t[2]),r.typedArrayArgIndex=2),this.canvas.enqueueOperation(r)}updateState(e,t){switch(e){case`viewport`:this.state.set(O.VIEWPORT,t.slice(0,4));break;case`scissor`:this.state.set(O.SCISSOR_BOX,t.slice(0,4));break;case`clearColor`:this.state.set(O.COLOR_CLEAR_VALUE,new Float32Array(t.slice(0,4)));break;case`colorMask`:this.state.set(O.COLOR_WRITEMASK,t.slice(0,4).map(Boolean));break;case`clearDepth`:this.state.set(O.DEPTH_CLEAR_VALUE,t[0]);break;case`depthMask`:this.state.set(O.DEPTH_WRITEMASK,!!t[0]);break;case`depthFunc`:this.state.set(O.DEPTH_FUNC,t[0]);break;case`clearStencil`:this.state.set(O.STENCIL_CLEAR_VALUE,t[0]);break;case`lineWidth`:this.state.set(O.LINE_WIDTH,t[0]);break;case`cullFace`:this.state.set(O.CULL_FACE_MODE,t[0]);break;case`frontFace`:this.state.set(O.FRONT_FACE,t[0]);break;case`activeTexture`:this.state.set(O.ACTIVE_TEXTURE,t[0]);break;case`pixelStorei`:this.state.set(t[0],t[1]);break;case`enable`:this.enabledCapabilities.add(t[0]);break;case`disable`:this.enabledCapabilities.delete(t[0]);break;case`useProgram`:this.state.set(O.CURRENT_PROGRAM,t[0]||null);break;case`bindBuffer`:t[0]===O.ARRAY_BUFFER?this.state.set(O.ARRAY_BUFFER_BINDING,t[1]||null):t[0]===O.ELEMENT_ARRAY_BUFFER&&this.state.set(O.ELEMENT_ARRAY_BUFFER_BINDING,t[1]||null);break;case`bindTexture`:t[0]===O.TEXTURE_2D&&this.state.set(O.TEXTURE_BINDING_2D,t[1]||null);break;case`bindFramebuffer`:this.state.set(O.FRAMEBUFFER_BINDING,t[1]||null);break;case`bindRenderbuffer`:this.state.set(O.RENDERBUFFER_BINDING,t[1]||null);break;case`shaderSource`:t[0]?.updateMetadata({source:String(t[1]??``)});break;case`attachShader`:{let e=t[0]?.metadata?.attachedShaders;e&&t[1]&&!e.includes(t[1])&&e.push(t[1]);break}case`detachShader`:{let e=t[0]?.metadata?.attachedShaders,n=e?.indexOf(t[1])??-1;n>=0&&e.splice(n,1);break}}}getParameter(e){if(this.state.has(e)){let t=this.state.get(e);return ArrayBuffer.isView(t)||Array.isArray(t)?t.slice():t}let t=this.capabilities?.parameters||{};return Object.prototype.hasOwnProperty.call(t,e)?k(t[e]):this.requestQuery(`getParameter`,[e])}getShaderParameter(e,t){if(!(e instanceof M)||e.resourceType!==`shader`)return null;switch(t){case O.DELETE_STATUS:return e.deleted;case O.SHADER_TYPE:return e.metadata.shaderType;case O.COMPILE_STATUS:return!!e.metadata.compileStatus;default:return this.requestQuery(`getShaderParameter`,[e,t])}}getProgramParameter(e,t){if(!(e instanceof M)||e.resourceType!==`program`)return null;switch(t){case O.DELETE_STATUS:return e.deleted;case O.LINK_STATUS:return!!e.metadata.linkStatus;case O.VALIDATE_STATUS:return!!e.metadata.validateStatus;case O.ATTACHED_SHADERS:return e.metadata.attachedShaders.length;default:return this.requestQuery(`getProgramParameter`,[e,t])}}getShaderPrecisionFormat(e,t){let n=`${e}:${t}`,r=this.capabilities?.shaderPrecisionFormats?.[n];return r?{...r}:this.requestQuery(`getShaderPrecisionFormat`,[e,t])}getExtension(e){let t=String(e||``),n=(this.capabilities?.supportedExtensions||[]).find(e=>e.toLowerCase()===t.toLowerCase());if(!n)return null;if(this.extensions.has(n))return this.extensions.get(n);let r=j(`webgl_extension`),i=this.capabilities?.extensions?.[n]||{},a=new At(this,n,r,i);return this.extensions.set(n,a),this.canvas.enqueueOperation({op:`getExtension`,contextId:this.contextId,extensionId:r,name:n}),a}},Mt=class{constructor({nodeId:e,bridgeId:t=xt(),width:n=300,height:r=150,type:i=`2d`,offscreen:a=!1,webglCapabilities:o}){this.__diminaCanvasNode=!0,this.nodeId=e,this.bridgeId=t,this.type=i,this.offscreen=a,this.webglCapabilities=o||_t(t),this.contexts=new Map,this.contextsById=new Map,this.activeContextType=null,this.eventListeners=new Map,this.pendingTypedArrayUpdates=new Map,this.pendingOperations=[],this.flushScheduled=!1,this._width=St(n,300),this._height=St(r,150)}get width(){return this._width}set width(e){this._width=St(e,300),this.enqueueOperation({op:`setCanvasProperty`,prop:`width`,value:this._width})}get height(){return this._height}set height(e){this._height=St(e,150),this.enqueueOperation({op:`setCanvasProperty`,prop:`height`,value:this._height})}getContext(e=`2d`,t){let n=String(e).toLowerCase(),r=ht(n),i=st.has(n);if(!ot.has(r)&&!i||this.activeContextType&&this.activeContextType!==r)return null;if(this.contexts.has(r))return this.contexts.get(r);let a=i?vt(this.webglCapabilities,r):null;if(i&&a?.supported===!1)return null;let o=j(`canvas_context`);this.enqueueOperation({op:`getContext`,contextId:o,contextType:n,attributes:Dt(t)});let s=i?new jt(this,o,r,t,a):new kt(this,o);return this.activeContextType=r,this.contexts.set(r,s),this.contextsById.set(o,s),s}addEventListener(e,t){n(t)&&(this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t))}removeEventListener(e,t){this.eventListeners.get(e)?.delete(t)}dispatchEvent(e){if(!e?.type)return!0;let t=!1,r={...e,target:this,currentTarget:this,preventDefault(){t=!0,this.defaultPrevented=!0}};for(let t of this.eventListeners.get(e.type)||[])t.call(this,r);let i=this[`on${e.type}`];return n(i)&&i.call(this,r),!t}notifyContextCreationError(e=`WebGL context creation failed`){this.dispatchEvent({type:`webglcontextcreationerror`,statusMessage:e})}handleContextCreationFailure(e,t,n){let r=this.contextsById.get(e);this.contexts.get(t)===r&&(this.contexts.delete(t),this.activeContextType=null),this.contextsById.delete(e),this.notifyContextCreationError(n)}registerTypedArrayUpdate(e){let t=j(`canvas_typed_array_update`);return this.pendingTypedArrayUpdates.set(t,e),t}applyFlushFeedback(e={}){for(let[t,n]of Object.entries(e.contexts||{}))this.contextsById.get(t)?.applyFeedback?.(n);for(let t of e.typedArrays||[]){let e=this.pendingTypedArrayUpdates.get(t.id);if(e&&ArrayBuffer.isView(e)){let n=k(t.value);ArrayBuffer.isView(n)?e.set(n.subarray(0,e.length)):Array.isArray(n)&&e.set(n.slice(0,e.length))}this.pendingTypedArrayUpdates.delete(t.id)}}createImage(){return new Ot(this,j(`canvas_image`))}requestAnimationFrame(e){let t=bt++,r=x.store(t=>{n(e)&&e(t)});return Ct(this.bridgeId,`canvasNodeRequestAnimationFrame`,{nodeId:this.nodeId,requestId:t,callback:r}),t}cancelAnimationFrame(e){Ct(this.bridgeId,`canvasNodeCancelAnimationFrame`,{nodeId:this.nodeId,requestId:e})}getImageData({contextId:e,x:t,y:n,width:r,height:i}){return new Promise((a,o)=>{let s=x.store(e=>{a(e)});this.enqueueOperation({op:`getImageData`,contextId:e,x:t,y:n,width:r,height:i,callback:s})})}toDataURL(e=`image/png`,t){return new Promise(n=>{let r=x.store(e=>{n(e)});this.enqueueOperation({op:`toDataURL`,mimeType:e,quality:t,callback:r})})}enqueueOperation(e){this.pendingOperations.push(e),!this.flushScheduled&&(this.flushScheduled=!0,wt(()=>this.flushOperations()))}flushOperations(){if(this.flushScheduled=!1,this.pendingOperations.length===0)return;let e=this.pendingOperations;this.pendingOperations=[];let t=e.some(e=>e.op===`getContext`||e.op===`contextQuery`||e.op===`contextFeedback`||e.feedback||e.typedArrayUpdateId)?x.store(e=>this.applyFlushFeedback(e)):void 0;Ct(this.bridgeId,`canvasNodeFlush`,{nodeId:this.nodeId,operations:e,feedback:t})}};function Nt(e,t=xt()){return!e||e.__diminaNodeType!==`dimina-canvas-node`?e:(gt(t,e.webglCapabilities),new Mt({nodeId:e.nodeId,bridgeId:t,width:e.width,height:e.height,type:e.type,webglCapabilities:e.webglCapabilities}))}function Pt(e,t=xt()){return Array.isArray(e)?e.map(e=>Pt(e,t)):!e||typeof e!=`object`?e:e.node?{...e,node:Nt(e.node,t)}:e}function Ft(e={}){let t=St(e.width,300),n=St(e.height,150),r=e.type||`2d`,i=j(`offscreen_canvas`),a=xt();return Ct(a,`createOffscreenCanvas`,{nodeId:i,width:t,height:n,type:r}),new Mt({nodeId:i,bridgeId:a,width:t,height:n,type:r,offscreen:!0,webglCapabilities:_t(a)})}var It=t({createSelectorQuery:()=>Lt});function Lt(){return new Vt}function Rt(){return C.getPageInfo()}function zt(){let e=Rt();return e?.__id__||e?.id}function Bt(){let e=Rt();return e?.bridgeId||e?.id}var Vt=class{constructor(){this.__componentId=zt(),this.__taskQueue=[],this.__cbQueue=[]}in(e){return this.__componentId=e.__id__,this}select(e){return new Ht(this,this.__componentId,e,!0)}selectAll(e){return new Ht(this,this.__componentId,e,!1)}selectViewport(){return new Ht(this,zt(),``,!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=Bt();T(`selectorQuery`,{tasks:this.__taskQueue,success:i=>{let a=Pt(i,r)||[];a.forEach((e,r)=>{let i=t.__cbQueue[r];n(i)&&i.call(t,e)}),n(e)&&e.call(t,a)}},`render`)}},Ht=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)}},Ut=t({createIntersectionObserver:()=>Wt});function Wt(e,t={}){let{thresholds:n=[0],initialRatio:r=0,observeAll:i=!1}=t;return new Gt(e,{thresholds:n,initialRatio:r,observeAll:i})}var Gt=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=x.store(e=>{n._disconnected||(n._observerId=e.observerId),e.info&&t.call(n,e.info)},!0);T(`addIntersectionObserver`,{moduleId:this._component.__id__,targetSelector:e,relativeInfo:this._relativeInfo,options:this._options,success:r},`render`)}disconnect(){T(`removeIntersectionObserver`,{observerId:this._observerId},`render`),this._disconnected=!0}},Kt=t({createMediaQueryObserver:()=>Jt});function qt(e={}){let t={};for(let n of[`minWidth`,`maxWidth`,`width`,`minHeight`,`maxHeight`,`height`]){let r=Number(e[n]);Number.isFinite(r)&&r>=0&&(t[n]=r)}return typeof e.orientation==`string`&&/^[-_a-z0-9]+$/i.test(e.orientation)&&(t.orientation=e.orientation),t}function Jt(e,t={}){return new Yt(e,t)}var Yt=class{constructor(e,t){this._component=e,this._options=t,this._observerId=null,this._callbackId=null,this._disconnected=!1}observe(e,t){if(!n(t))throw TypeError(`MediaQueryObserver.observe listener must be a function`);if(this._observerId!==null)throw Error(`MediaQueryObserver.observe can only be called once`);this._disconnected=!1,this._callbackId=x.store((e={})=>{if(e.observerId&&(this._observerId=e.observerId,this._disconnected)){T(`removeMediaQueryObserver`,{observerId:e.observerId},`render`),x.remove(this._callbackId),this._callbackId=null;return}!this._disconnected&&typeof e.matches==`boolean`&&t.call(this,{matches:e.matches})},!0),T(`addMediaQueryObserver`,{moduleId:this._component.__id__,condition:qt(e),options:this._options,success:this._callbackId},`render`)}disconnect(){this._disconnected=!0,T(`removeMediaQueryObserver`,{observerId:this._observerId},`render`),this._callbackId&&this._observerId&&(x.remove(this._callbackId),this._callbackId=null)}};function Xt(e){if(typeof e!=`string`||e.length===0)return null;let t=[],n=``,r=0,i=()=>{n.length>0&&(t.push(n),n=``)};for(;r<e.length;){let a=e[r];if(a===`\\`){let t=e[r+1];if(t===`.`||t===`[`||t===`]`||t===`\\`){n+=t,r+=2;continue}n+=a,r++;continue}if(a===`.`){i(),r++;continue}if(a===`[`){if(t.length===0&&n.length===0)return null;i();let a=e.indexOf(`]`,r+1);if(a===-1)return null;let o=e.slice(r+1,a);if(!/^\d+$/.test(o))return null;t.push(Number(o)),r=a+1;continue}if(a===`]`)return null;n+=a,r++}return i(),t.length>0?t:null}function Zt(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e],i=t[e+1],a=Object.prototype.hasOwnProperty.call(r,n);typeof i==`number`?(!a||!Array.isArray(r[n]))&&(r[n]=[]):(!a||r[n]===null||typeof r[n]!=`object`||Array.isArray(r[n]))&&(r[n]={}),r=r[n]}r[t[t.length-1]]=n}function Qt(e,t){return e.length<=t.length&&e.every((e,n)=>e===t[n])}function $t(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){if(e===`**`){n.push({path:[],wildcard:!0});continue}let t=e.endsWith(`.**`),r=Xt(t?e.slice(0,-3):e);r&&n.push({path:r,wildcard:t})}return n}function en(e,t){return e.wildcard&&e.path.length===0?!0:e.wildcard&&Qt(e.path,t)||Qt(t,e.path)}function tn(e){let t=[];if(Array.isArray(e.behaviorObserverList)&&e.behaviorObserverList.length>0)for(let{key:n,observer:r}of e.behaviorObserverList)t.push({expression:n,observer:r});else for(let[n,r]of Object.entries(e.behaviorObservers||{}))for(let e of r||[])t.push({expression:n,observer:e});for(let[n,r]of Object.entries(e.observers||{}))t.push({expression:n,observer:r});return t.map(e=>({...e,paths:$t(e.expression)}))}function nn(e,t,r=e.data,i=e.__info__||{}){for(let a of tn(i)){if(!n(a.observer)||!a.paths.some(e=>t.some(t=>en(e,t))))continue;let i=a.paths.map(({path:e})=>e.length===0?r:f(r,e));E(e,a.observer,i,`data observer`)}}function rn(e,t){let n={};for(let r of t)n[r.key]=f(e.data,r.path);return n}function an(e,t){let n=e.__info__?.properties||{};return t.flatMap(e=>{let t=e.path[0];return typeof t!=`string`||!Object.prototype.hasOwnProperty.call(n,t)?[]:[{propertyName:t,oldValue:e.path.length===1?e.oldValue:void 0,path:e.path,value:e.value}]})}function on(e,t,r){if(!t||typeof t!=`object`||Array.isArray(t))return console.warn(`[service] setData data must be an object`),null;let i=!e.__dataUpdateTransaction__,a=e.__dataUpdateTransaction__||{changes:[],pendingPaths:[],callbacks:[]};e.__dataUpdateTransaction__=a,n(r)&&a.callbacks.push(r);for(let r of Object.keys(t)){let i=Xt(r);if(!i){console.warn(`[service] invalid setData path: ${r}`);continue}let o=y(t[r]);i.length===1&&e.__propertySchemas__?.[i[0]]&&n(e.normalizePropertyValues)&&(o=e.normalizePropertyValues({[i[0]]:o})[i[0]]);let s=i.length===1?e.data[i[0]]:void 0;Zt(e.data,i,o),a.changes.push({key:r,path:i,oldValue:s,value:o}),a.pendingPaths.push(i)}if(!i)return null;try{for(;a.pendingPaths.length>0;){let t=a.pendingPaths;a.pendingPaths=[],nn(e,t)}}finally{delete e.__dataUpdateTransaction__}return{callbacks:a.callbacks,changedData:rn(e,a.changes),changes:a.changes.map(e=>({path:e.path,value:e.value})),propertyChanges:an(e,a.changes)}}function sn(e,t){let i=e.__info__?.properties||{};for(let a of t){let t=i[a.propertyName],o=t?.observer,s=a.path,c=Object.prototype.hasOwnProperty.call(a,`value`)?a.value:s.length===1?e.data[a.propertyName]:f(e.data,s);s.length===1&&c===a.oldValue&&!t?.observeAssignments||(r(o)?E(e,e[o],[c,a.oldValue,s],`property observer`):n(o)&&E(e,o,[c,a.oldValue,s],`property observer`))}}var cn=new Map;function ln(e){return cn.has(e)||cn.set(e,{depth:0,scheduled:!1,updates:[],byModuleId:new Map,callbackIds:[]}),cn.get(e)}function un(e,t){let r=(Array.isArray(t)?t:[t]).filter(n);if(r.length!==0)return x.store(()=>{r.forEach(t=>E(e,t,[],`setData callback`))})}function dn(e){let t=ln(e);t.depth++}function fn(e){let t=ln(e);t.depth>0&&t.depth--,t.depth===0&&mn(e)}function pn(e,t=[]){let n=t.length>0?t:Object.entries(e).flatMap(([e,t])=>{let n=Xt(e);return n?[{path:n,value:t}]:[]}),r=JSON.parse(JSON.stringify(Le({data:e,changes:n})));return{data:r.data||{},changes:(r.changes||[]).filter(e=>Object.prototype.hasOwnProperty.call(e,`value`))}}function N(e,t,n,r,i=[]){let a=ln(e),o=a.byModuleId.get(t),s=i.filter(e=>e&&typeof e==`object`),c=i.filter(e=>typeof e==`string`),l=pn(n,s);if(o){if(Array.isArray(c)&&c.length>0){let e=new Set([...o.deleteKeys||[],...c]);for(let t of e)delete o.data[t];o.deleteKeys=[...e]}Object.assign(o.data,l.data),o.changes=o.changes||[],o.changes.push(...l.changes),Array.isArray(o.deleteKeys)&&o.deleteKeys.length>0&&(o.deleteKeys=o.deleteKeys.filter(e=>!Object.prototype.hasOwnProperty.call(l.data,e)),o.deleteKeys.length===0&&delete o.deleteKeys)}else{let e={moduleId:t,data:l.data,changes:l.changes};Array.isArray(c)&&c.length>0&&(e.deleteKeys=[...new Set(c)]),a.byModuleId.set(t,e),a.updates.push(e)}r&&a.callbackIds.push(r),a.depth===0&&!a.scheduled&&(a.scheduled=!0,Promise.resolve().then(()=>{a.scheduled=!1,a.depth===0&&mn(e)}))}function mn(e){let t=cn.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,w.send({type:`ub`,target:`render`,body:{bridgeId:e,updates:n,callbackIds:r}})}function hn(e){return i(e)||n(e)?e:e instanceof Date?e.getTime():Array.isArray(e)?e.map(e=>hn(e)):typeof e==`object`?Object.entries(e).reduce((e,[t,n])=>(t.startsWith(`$`)||(e[t]=hn(n)),e),{}):e}function gn(e){if(e){let t={};for(let n in e){let r=_e(e[n]);t[n]={type:[r.type,...r.optionalTypes].map(vn),default:r.value}}return t}}var _n=new Map([[String,`s`],[Number,`n`],[Boolean,`b`],[Object,`o`],[Array,`a`]]);function vn(e){return Array.isArray(e)?e.map(e=>vn(e)):e===null||e===``?null:_n.get(e)||(console.warn(`[service] ignore unknown props type ${e}`),null)}function yn(e,t,n,r){let i=e.map(Xt).filter(Boolean);nn(r||{},i,n,{observers:t})}function bn(e={},t=``){let n=t.trim();if(!n)return;let r=n.replace(/-/g,``).toLowerCase(),i=[n,m(n),h(n),r];for(let t of i)if(t&&e[t]!==void 0){let n=e[t];if(typeof n==`string`)return{bind:n};if(n&&typeof n==`object`)return n}}function xn(e,t){let n=e.__info__||{};n.behaviorObservers&&nn(e,t.map(Xt).filter(Boolean),e.data,{behaviorObserverList:n.behaviorObserverList,behaviorObservers:n.behaviorObservers})}function Sn(e,t){if(!Array.isArray(t))return;let r=new WeakMap,i=new WeakSet,a=e.properties,o=e.data,s=e.methods,c=e.relations,l=Object.prototype.hasOwnProperty.call(e,`export`),u=e.export,d,f,p,m,h;function g(e,t){let n=Array.isArray(e)?[...e]:{...e};for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=n[e],i=t[e];n[e]=typeof r==`object`&&typeof i==`object`&&i&&!Array.isArray(i)?g(r,i):i}return n}function _(e,t){if(typeof t==`string`){ee(e,t);return}if(!t||typeof t!=`object`||i.has(t))return;i.add(t);let a=r.has(t);if(Array.isArray(t.behaviors)&&t.behaviors.forEach(t=>_(e,t)),t.properties&&(d={...d,...t.properties}),t.data&&(f=g(f||{},t.data)),!a){r.set(t,!0);let i=[`created`,`attached`,`ready`,`moved`,`detached`,`error`];e.behaviorLifetimes=e.behaviorLifetimes||{};for(let r of i){let i=t.lifetimes?.[r]||t[r];n(i)&&(e.behaviorLifetimes[r]=e.behaviorLifetimes[r]||[],e.behaviorLifetimes[r].push(i))}if(t.observers){e.behaviorObservers=e.behaviorObservers||{},e.behaviorObserverList=e.behaviorObserverList||[];for(let n in t.observers)e.behaviorObservers[n]||(e.behaviorObservers[n]=[]),e.behaviorObservers[n].push(t.observers[n]),e.behaviorObserverList.push({key:n,observer:t.observers[n]})}}if(t.methods&&(p={...p,...t.methods}),t.relations&&(m={...m,...t.relations}),t.export&&(h=t.export),!a&&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]))}i.delete(t)}function ee(e,t){switch(t){case`wx://component-export`:break;case`wx://form-field`:d={...d,name:{type:String},value:{type:null}};break;case`wx://form-field-group`:case`wx://form-field-button`:case`wx://label-target`:case`wx://style-filter`:case`wx://request-filter`:break;default:console.warn(`[service] 未知的内置 behavior: ${t}`)}}t.forEach(t=>_(e,t)),(d||a)&&(e.properties={...d,...a}),(f||o)&&(e.data=g(f||{},o||{})),(p||s)&&(e.methods={...p,...s}),(m||c)&&(e.relations={...m,...c}),l?e.export=u:h&&(e.export=h)}function Cn(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 wn(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 Tn(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 En(e,t){if(!(!e||!e.expression)){if(e.isSimple)return f(t,e.expression);try{return Function(`data`,`with(data) { return ${e.expression} }`)(t)}catch(t){console.warn(`[service] 计算表达式失败:`,e.expression,t);return}}}function Dn(e,t,n){let r=Object.values(t||{}),i=[];for(let t of r){if(!Cn(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&&Tn(i,n)&&(o[r]=y(En(i,e.data)))}if(Object.keys(o).length>0){let e=t.normalizePropertyValues?.(o,{applyFilter:!1})||o,n=t.tO?.(e)||t.normalizePropertyValues?.(e)||e;t.__pendingSyncedProps__=t.__pendingSyncedProps__||{},Object.assign(t.__pendingSyncedProps__,e),i.push({child:t,data:n})}}return i}var On=[`created`,`attached`,`ready`,`moved`,`detached`,`error`],kn=[`show`,`hide`,`resize`,`routeDone`],An=class e{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=y(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.__eventPath__=null,this.__pageId__=t.pageId,this.__parentId__=t.parentId,this.__hotUpdateMemberKeys__=new Set,this.__isCustomTabBar__=t.isCustomTabBar===!0,this.__relations__=new Map,this.__relationPaths__=new Map,this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[],this.__pendingInitSetDataCallbacks__=[],this.__childPropsBindings__={},this.__pendingSyncedProps__={},this.__initialPropertyObserversInvoked__=!1,this.__initialPropertyNames__=new Set(t.propertyNames||Object.keys(t.properties||{})),this.__initialPropertyChanges__=[],this.__initialPropertyValues__={},this.__propertySchemas__=Object.fromEntries(Object.entries(this.__info__.properties||{}).map(([e,t])=>[e,_e(t)]))}init({deferInitialData:e=!1}={}){if(this.#d(),this.__isComponent__){let e=this.opts.properties||{};for(let[t,n]of Object.entries(this.__propertySchemas__)){let r=Se(n,void 0,{absent:!0});if(this.data[t]=r,this.__initialPropertyNames__.has(t)){let n=this.normalizePropertyValue(t,e[t],{applyFilter:!1});this.__initialPropertyValues__[t]=n,this.__initialPropertyChanges__.push({propertyName:t,oldValue:void 0,path:[t],value:n})}}}this.#u(),this.#t(),this.#e(),this.#m(),e||this.sendInitialData()}sendInitialData(){this.__initialDataSent__||(this.__initialDataSent__=!0,w.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__=[],N(this.bridgeId,this.__id__,{},un(this,e))}#e(){this.hasBehavior(`wx://component-export`)&&this.__info__.export&&n(this.__info__.export)&&(this.export=this.__info__.export.bind(this),this.__hotUpdateMemberKeys__.add(`export`))}#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)}`}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(`/`)}return e}#r(){let e=this.__info__.relations;if(!e)return;let t=Object.values(B.instances[this.bridgeId]||{}).filter(e=>e===this||!e.__isComponent__||e.__componentAttached__||e.__componentAttaching__);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.#a(t,e));for(let e of o)this.#s(n,e,r)}this.#i()}#i(){let e=Object.values(B.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}`),o&&this.#a(e,t)&&this.#s(n,e,r)}}#a(e,t){let n=Object.values(B.instances[this.bridgeId]||{});switch(t){case`parent`:return e.__id__===this.__parentId__;case`child`:return e.__parentId__===this.__id__;case`ancestor`:return this.#o(e.__id__,this.__id__,n);case`descendant`:return this.#o(this.__id__,e.__id__,n);default:return!1}}#o(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}#s(e,t,n){let r=this.__relations__.get(e)||[];r.includes(t)||(r.push(t),this.__relations__.set(e,r),E(this,n.linked,[t],`relation linked callback`))}#c(e,t,n){let r=this.__relations__.get(e)||[],i=r.indexOf(t);i!==-1&&(r.splice(i,1),this.__relations__.set(e,r),E(this,n.unlinked,[t],`relation unlinked callback`))}#l(e,t,n){E(this,n.linkChanged,[t],`relation linkChanged callback`)}setData(e,t){let n=on(this,e,t);if(!n)return;if(!this.initd){this.__pendingInitSetDataCallbacks__.push(...n.callbacks),sn(this,n.propertyChanges);return}if(this.__groupSetDataMode__){for(let e of Object.keys(n.changedData))this.__groupSetDataBuffer__[e]=n.changedData[e];this.__groupSetDataChanges__.push(...n.changes),this.__groupSetDataCallbacks__.push(...n.callbacks),sn(this,n.propertyChanges);return}let r=Dn(this,B.instances[this.bridgeId],n.changedData);N(this.bridgeId,this.__id__,n.changedData,un(this,n.callbacks),n.changes),r.forEach(({child:e,data:t})=>{N(this.bridgeId,e.__id__,t)}),sn(this,n.propertyChanges)}#u(){On.forEach(e=>{let t=this.__info__.lifetimes?.[e]||this.__info__[e];n(t)&&(this[e]=t.bind(this),this.__hotUpdateMemberKeys__.add(e))}),this.__isComponent__&&kn.forEach(e=>{let t=this.__info__.pageLifetimes?.[e];n(t)&&(e===`show`?e=`onShow`:e===`hide`&&(e=`onHide`),this[e]=t.bind(this),this.__hotUpdateMemberKeys__.add(e))})}#d(){let e=this.__info__.methods;for(let t in e)n(e[t])&&(this[t]=e[t].bind(this),this.__hotUpdateMemberKeys__.add(t))}hotUpdate(e){for(let e of this.__hotUpdateMemberKeys__)delete this[e];this.__hotUpdateMemberKeys__.clear(),this.behaviors=e.behaviors,this.__isComponent__=e.isComponent,this.__type__=e.type,this.__info__=e.moduleInfo,this.#u(),this.#d(),this.#t(),this.#e()}#f(){if(!this.__isComponent__||!this.__info__.properties||this.__initialPropertyObserversInvoked__)return;let e=this.__initialPropertyChanges__.map(e=>e.path);e.length>0&&(nn(this,e),sn(this,this.__initialPropertyChanges__)),this.__initialPropertyObserversInvoked__=!0}#p(){for(let[e,t]of Object.entries(this.__initialPropertyValues__)){let n=this.data[e],r=this.normalizePropertyValue(e,t,{oldValue:n});this.data[e]=r;let i=this.__initialPropertyChanges__.find(t=>t.propertyName===e);i&&(i.oldValue=n,i.value=r)}}#m(){this.__isComponent__?(this.componentCreated(),this.#p(),this.#f()):(this.componentCreated(),this.componentAttached(),E(this,this.onLoad,[this.opts.query||{}],`onLoad`)),this.initd=!0}tO(e){let t=typeof this.normalizePropertyValues==`function`?this.normalizePropertyValues(e,{applyFilter:!1}):e,n={},r={};for(let[e,i]of Object.entries(t)){if(this.__pendingSyncedProps__&&Object.prototype.hasOwnProperty.call(this.__pendingSyncedProps__,e)&&a(this.__pendingSyncedProps__[e],i)){this.hasPropertyFilter?.(e)||(this.data[e]=i),r[e]=this.data[e],delete this.__pendingSyncedProps__[e];continue}let t=typeof this.normalizePropertyValue==`function`?this.normalizePropertyValue(e,i):i;n[e]=t,r[e]=t}if(Object.keys(n).length===0)return r;let i=[],o=[];for(let[e,t]of Object.entries(n)){let n=this.data[e];this.data[e]=t,o.push([e]),i.push({propertyName:e,oldValue:n,path:[e],value:t})}return nn(this,o),sn(this,i),r}hasPropertyFilter(e){let t=this.__info__.properties?.[e];return!!t&&typeof t==`object`&&t.filter!=null}normalizePropertyValue(e,t,{absent:r=!1,applyFilter:i=!0,oldValue:a=this.data[e],path:o=[e]}={}){let s=this.__propertySchemas__[e];if(!s)return t;let c=Se(s,t,{absent:r});if(r||!i||!this.hasPropertyFilter(e))return c;let l=this.__info__.properties[e],u=n(l.filter)?l.filter:this.__info__.methods?.[l.filter];if(!n(u))return c;let d=E(this,u,[c,a,o],`property filter`);return d===void 0?c:d}normalizePropertyValues(e,{applyFilter:t=!0}={}){let n={};for(let[r,i]of Object.entries(e||{}))n[r]=this.normalizePropertyValue(r,i,{applyFilter:t});return n}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 Lt().in(this)}selectComponent(e){let t=Object.values(B.instances[this.bridgeId]),n=t.find(n=>Cn(n,this.__id__,t)&&wn(e,n));return n?n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(B.instances[this.bridgeId]);return t.filter(n=>Cn(n,this.__id__,t)&&wn(e,n))}selectOwnerComponent(){let e=Object.values(B.instances[this.bridgeId]);for(let t of e)if(t.id===this.__parentId__)return t;return null}createIntersectionObserver(e){return Wt(this,e)}groupSetData(e){if(!n(e)){console.warn(`[service] groupSetData callback must be a function`);return}this.__groupSetDataMode__=!0,dn(this.bridgeId),this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];try{E(this,e,[],`groupSetData callback`)}finally{if(this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__&&Object.keys(this.__groupSetDataBuffer__).length>0){let e=this.__groupSetDataBuffer__,t=this.__groupSetDataCallbacks__,n=this.__groupSetDataChanges__;this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];let r=Dn(this,B.instances[this.bridgeId],e);N(this.bridgeId,this.__id__,e,un(this,t),n),r.forEach(({child:e,data:t})=>{N(this.bridgeId,e.__id__,t)})}else this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];fn(this.bridgeId)}}createMediaQueryObserver(e){return Jt(this,e)}getRelationNodes(e){let t=this.__relations__.get(e);return t?[...t]:null}animate(e,t,r,i,a){n(i)&&(a=i,i=void 0),T(`componentAnimate`,{moduleId:this.__id__,selector:e,keyframes:t,duration:r,timeline:i,success:a},`render`)}clearAnimation(e,t,r){n(t)&&(r=t,t={}),T(`componentClearAnimation`,{moduleId:this.__id__,selector:e,options:t||{},success:r},`render`)}async triggerEvent(t,n,r={}){if(!t)return;let i=t.trim();if(!i)return;let a={bubbles:r.bubbles===!0,composed:r.composed===!0,capturePhase:r.capturePhase===!0},o={id:this.id,dataset:this.dataset||{}},s=!1,c=!1,l={type:i,timeStamp:Date.now(),detail:n,bubbles:a.bubbles,composed:a.composed,currentTarget:null,target:o,preventDefault(){c=!0},stopPropagation(){s=!0}};Object.defineProperty(l,"defaultPrevented",{enumerable:!0,get:()=>c});let u=e.prototype.getCustomEventPath.call(this,a.composed),d=async(e,t)=>{let n=bn(e.eventAttr,i);if(!n)return;let r=t?n.captureCatch??n.captureBind:n.catch??n.bind;if(!r)return;l.currentTarget=e.currentTarget;let a=await B.triggerEvent({bridgeId:this.bridgeId,moduleId:e.moduleId,methodName:r,event:l});(t?n.captureCatch:n.catch)&&l.stopPropagation(),a===!1&&(l.preventDefault(),l.stopPropagation())};if(a.capturePhase)for(let e=u.length-1;e>=0&&!s;e--)await d(u[e],!0);if(s)return;let f=a.bubbles?u:u.slice(0,1);for(let e of f)if(await d(e,!1),s)break}getCustomEventPath(e){let t=[{moduleId:this.__pageId__,eventAttr:this.__eventAttr__||{},currentTarget:{id:this.id,dataset:this.dataset||{}}}];if(Array.isArray(this.__eventPath__)){let n=this.__eventPath__.filter(e=>e?.moduleId).map(e=>{let t=e.isComponentHost&&e.nodeModuleId?B.instances[this.bridgeId]?.[e.nodeModuleId]:null;return{moduleId:e.moduleId,nodeModuleId:e.nodeModuleId,isComponentHost:e.isComponentHost===!0,eventAttr:e.eventAttr||{},currentTarget:{id:t?.id??e.targetInfo?.id,dataset:t?.dataset||e.targetInfo?.dataset||{}}}}),r=B.instances[this.bridgeId]||{},i=new Set([this.__id__]),a=0,o=r[this.__parentId__];for(;o?.__isComponent__&&!i.has(o.__id__);){i.add(o.__id__);let e=n.findIndex(e=>e.isComponentHost&&e.nodeModuleId===o.__id__);if(e>=0)a=Math.max(a,e+1);else if(Object.keys(o.__eventAttr__||{}).length>0){let e=-1;for(let t=0;t<n.length;t++)n[t].moduleId===o.__id__&&(e=t);let t=Math.max(a,e+1);n.splice(t,0,{moduleId:o.__pageId__,nodeModuleId:o.__id__,isComponentHost:!0,eventAttr:o.__eventAttr__,currentTarget:{id:o.id,dataset:o.dataset||{}}}),a=t+1}o=r[o.__parentId__]}for(let r of n)(e||r.moduleId===this.__pageId__)&&t.push(r);return t}let n=B.instances[this.bridgeId]||{},r=new Set([this.__id__]),i=n[this.__parentId__];for(;i?.__isComponent__&&!r.has(i.__id__);)r.add(i.__id__),(e||i.__pageId__===this.__pageId__)&&t.push({moduleId:i.__pageId__,eventAttr:i.__eventAttr__||{},currentTarget:{id:i.id,dataset:i.dataset||{}}}),i=n[i.__parentId__];return t}pageReady(){this.__isComponent__||E(this,this.ready,[],`ready lifetime`)}pageUnload(){this.__isComponent__||E(this,this.onUnload,[],`onUnload`)}pageScrollTop(e){if(!this.__isComponent__){let{scrollTop:t}=e;E(this,this.onPageScroll,[{scrollTop:t}],`onPageScroll`)}}pagePullDownRefresh(){this.__isComponent__||E(this,this.onPullDownRefresh,[],`onPullDownRefresh`)}pageReachBottom(){this.__isComponent__||E(this,this.onReachBottom,[],`onReachBottom`)}pageShareAppMessage(e={}){if(!this.__isComponent__)return E(this,this.onShareAppMessage,[e],`onShareAppMessage`)}pageTabItemTap(e={}){this.__isComponent__||E(this,this.onTabItemTap,[e],`onTabItemTap`)}pageShow(){D(this,this.__info__.behaviorPageLifetimes?.show,[],`page show lifetime`),E(this,this.onShow,[],`page show lifetime`)}pageHide(){D(this,this.__info__.behaviorPageLifetimes?.hide,[],`page hide lifetime`),E(this,this.onHide,[],`page hide lifetime`)}pageResize(e){D(this,this.__info__.behaviorPageLifetimes?.resize,[e],`page resize lifetime`),E(this,this.resize,[e],`page resize lifetime`)}componentRouteDone(){D(this,this.__info__.behaviorPageLifetimes?.routeDone,[],`page routeDone lifetime`),E(this,this.routeDone,[],`page routeDone lifetime`)}componentCreated(){D(this,this.__info__.behaviorLifetimes?.created,[],`created lifetime`),E(this,this.created,[],`created lifetime`)}componentAttached(){D(this,this.__info__.behaviorLifetimes?.attached,[],`attached lifetime`),E(this,this.attached,[],`attached lifetime`),this.#r()}componentReadied(){D(this,this.__info__.behaviorLifetimes?.ready,[],`ready lifetime`),E(this,this.ready,[],`ready lifetime`)}componentMoved(){D(this,this.__info__.behaviorLifetimes?.moved,[],`moved lifetime`),E(this,this.moved,[],`moved lifetime`);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)}}componentDetached(){this.__componentAttached__=!1,D(this,this.__info__.behaviorLifetimes?.detached,[],`detached lifetime`),E(this,this.detached,[],`detached lifetime`);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.#c(t,r,n)}this.#h(),this.initd=!1}#h(){let e=Object.values(B.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];E(t,i?.unlinked,[this],`relation unlinked callback`)}}}componentError(e){D(this,this.__info__.behaviorLifetimes?.error,[e],`error lifetime`,!1),E(this,this.error,[e],`error lifetime`,!1)}},P=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,Sn(this.moduleInfo,this.behaviors),this.noReferenceData=hn(this.moduleInfo.data||{})}getProps(){let e=gn(this.moduleInfo.properties),t=Array.isArray(this.behaviors)?this.behaviors.filter(e=>typeof e==`string`&&e.startsWith(`wx://`)):[];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 t.length&&(e||={},e.__diminaMeta={builtinBehaviors:t}),e}},jn=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=y(e.noReferenceData),this.__defaultData__=y(e.noReferenceData),this.__type__=e.type,this.__id__=t.moduleId,this.__info__=e.moduleInfo,this.__hotUpdateMemberKeys__=new Set,this.__childPropsBindings__={},this.__pendingInitSetDataCallbacks__=[]}init({deferInitialData:e=!1}={}){this.#e(),this.#r(),e||this.sendInitialData()}sendInitialData(){this.__initialDataSent__||(this.__initialDataSent__=!0,w.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__=[],N(this.bridgeId,this.__id__,{},un(this,e))}setData(e,t){let n=on(this,e,t);if(!n)return;if(!this.initd){this.__pendingInitSetDataCallbacks__.push(...n.callbacks);return}let r=Dn(this,B.instances[this.bridgeId],n.changedData);N(this.bridgeId,this.__id__,n.changedData,un(this,n.callbacks),n.changes),r.forEach(({child:e,data:t})=>{N(this.bridgeId,e.__id__,t)})}createSelectorQuery(){return Lt().in(this)}getTabBar(){let e=Object.values(B.instances[this.bridgeId]||{});return e.find(t=>t?.__isComponent__&&t.__isCustomTabBar__&&Cn(t,this.__id__,e))||null}selectComponent(e){let t=Object.values(B.instances[this.bridgeId]||{}),n=t.find(n=>Cn(n,this.__id__,t)&&wn(e,n));return n?n.hasBehavior&&n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(B.instances[this.bridgeId]||{});return t.filter(n=>Cn(n,this.__id__,t)&&wn(e,n)).map(e=>e.hasBehavior&&e.hasBehavior(`wx://component-export`)&&e.export?e.export():e)}#e(){this.#n(!1)}hotUpdate(e){let t=this.__defaultData__||{},n=e.noReferenceData||{};this.__type__=e.type,this.__info__=e.moduleInfo,this.#n(!0);let r=Nn(this.data,t,n),{dataPatch:i,deletedKeys:a}=Fn(this.data,r);this.__defaultData__=y(n),(Object.keys(i).length>0||a.length>0)&&this.#t(i,a)}#t(e,t){let n=Array.from(new Set([...Object.keys(e),...t]));if(n.length===0)return;let r={},i=this.__info__||{};for(let e of t)r[e]=this.data[e],delete this.data[e];for(let t of Object.keys(e))t in r||(r[t]=this.data[t]),this.data[t]=e[t];if(i.observers&&yn(n,i.observers,this.data,this,r),xn(this,n,r),!this.initd)return;let a={...e};for(let e of t)a[e]=void 0;let o=Dn(this,B.instances[this.bridgeId],a);N(this.bridgeId,this.__id__,e,void 0,t),o.forEach(({child:e,data:t})=>{N(this.bridgeId,e.__id__,t)})}#n(e){for(let e of this.__hotUpdateMemberKeys__)e in this.__info__||delete this[e];this.__hotUpdateMemberKeys__.clear();for(let t in this.__info__){if(e&&t===`data`)continue;let r=this.__info__[t];n(r)?(this[t]=r.bind(this),this.__hotUpdateMemberKeys__.add(t)):(this[t]=r,t!==`data`&&this.__hotUpdateMemberKeys__.add(t))}}#r(){D(this,this.__info__.behaviorLifetimes?.created,[],`created lifetime`),E(this,this.created,[],`created lifetime`),D(this,this.__info__.behaviorLifetimes?.attached,[],`attached lifetime`),E(this,this.attached,[],`attached lifetime`),E(this,this.onLoad,[this.opts.query||{}],`onLoad`),this.initd=!0}pageShow(){D(this,this.__info__.behaviorPageLifetimes?.show,[],`page show lifetime`),E(this,this.onShow,[],`onShow`)}pageHide(){D(this,this.__info__.behaviorPageLifetimes?.hide,[],`page hide lifetime`),E(this,this.onHide,[],`onHide`)}pageReady(){D(this,this.__info__.behaviorLifetimes?.ready,[],`ready lifetime`),E(this,this.ready,[],`ready lifetime`),E(this,this.onReady,[],`onReady`)}pageUnload(){D(this,this.__info__.behaviorLifetimes?.detached,[],`detached lifetime`),E(this,this.detached,[],`detached lifetime`),E(this,this.onUnload,[],`onUnload`),this.initd=!1}pageScrollTop(e){let{scrollTop:t}=e;E(this,this.onPageScroll,[{scrollTop:t}],`onPageScroll`)}pagePullDownRefresh(){E(this,this.onPullDownRefresh,[],`onPullDownRefresh`)}pageReachBottom(){E(this,this.onReachBottom,[],`onReachBottom`)}pageShareAppMessage(e={}){return E(this,this.onShareAppMessage,[e],`onShareAppMessage`)}pageTabItemTap(e={}){E(this,this.onTabItemTap,[e],`onTabItemTap`)}pageResize(e){D(this,this.__info__.behaviorPageLifetimes?.resize,[e],`page resize lifetime`),E(this,this.onResize,[e],`onResize`)}};function Mn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var F=Symbol(`hot-update-removed`);function Nn(e,t,n){let r=Pn(e,t,n);return r===F?{}:r}function Pn(e,t,n){if(Rn(e,t))return Ln(n);if(!Mn(e)||!Mn(t)||!Mn(n))return Ln(e);let r={},i=new Set([...Object.keys(e),...Object.keys(t),...Object.keys(n)]);for(let a of i){let i=Pn(In(e,a),In(t,a),In(n,a));i!==F&&(r[a]=i)}return r}function Fn(e,t){let n={},r=[],i=new Set([...Object.keys(e||{}),...Object.keys(t||{})]);for(let o of i){let i=Object.prototype.hasOwnProperty.call(e||{},o);if(!Object.prototype.hasOwnProperty.call(t||{},o)){i&&r.push(o);continue}(!i||!a(e[o],t[o]))&&(n[o]=y(t[o]))}return{dataPatch:n,deletedKeys:r}}function In(e,t){return!Mn(e)||!Object.prototype.hasOwnProperty.call(e,t)?F:e[t]}function Ln(e){return e===F?F:y(e)}function Rn(e,t){return e===F||t===F?e===t:a(e,t)}var I=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,Sn(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=hn(this.moduleInfo.data||{})}},zn={flushBulkSize:20,flushInterval:15e3,enableAutoTrack:!0,enablePageView:!0,enablePageLeave:!0,enableClick:!0,debug:!1,disableSDK:!1,enableLog:!1,requireConsentBeforeTrack:!1,instantEvents:[],pageBlacklist:[],networkPolicy:`all`},Bn={QUEUED:`queued`,FLUSHING:`flushing`,FAILED:`failed`};function Vn(e={}){if(!e.serverUrl)throw Error(`analytics.init requires serverUrl`);if(!e.miniappId)throw Error(`analytics.init requires miniappId`);if(!e.miniappVersion)throw Error(`analytics.init requires miniappVersion`);let t={...zn,...e};return t.instantEvents=Array.isArray(t.instantEvents)?[...t.instantEvents]:[],t.pageBlacklist=Array.isArray(t.pageBlacklist)?[...t.pageBlacklist]:[],t}function Hn(e){let t=new Map,n=new Set;function r(r){if(n.has(r.__id__))return;let i=Date.now(),a=t.get(r.__id__);e.track(`$MPPageLeave`,{page_path:r.route,duration:Math.max(0,i-(a??i))},{isAutoTrack:!0}),t.delete(r.__id__),n.add(r.__id__)}return{onAppLaunch(t={}){e.track(`$MPLaunch`,{scene:t.scene||``},{isAutoTrack:!0})},onAppShow(){e.track(`$MPShow`,{},{isAutoTrack:!0})},onAppHide(){e.track(`$MPHide`,{},{isAutoTrack:!0})},onPageShow(r){t.set(r.__id__,Date.now()),n.delete(r.__id__),e.track(`$MPViewScreen`,{page_path:r.route},{isAutoTrack:!0})},onPageHide(e){r(e)}}}function L(e){return Array.isArray(e)?e.map(e=>L(e)):e&&typeof e==`object`?Object.keys(e).reduce((t,n)=>(t[n]=L(e[n]),t),{}):e}function Un(){let e=``,t=``,n={},r=null,i={};return{identify(t){e=t},login(e){t=e},logout(){t=``},registerSuperProperties(e={}){n={...n,...L(e)}},registerDynamicSuperProperties(e){r=e},setPageProperties(e={}){i={...i,...L(e)}},getSnapshot(){let a=typeof r==`function`&&r()||{};return{anonymousId:e,loginId:t,distinctId:t||e,superProperties:L(n),dynamicProps:L(a),pageProperties:L(i)}}}}function Wn(e){return Array.isArray(e)?e.map(e=>Wn(e)):e&&typeof e==`object`?Object.keys(e).reduce((t,n)=>(t[n]=Wn(e[n]),t),{}):e}function Gn(e,t){let{context:n,hostContext:r={},pageContext:i={},miniappId:a,miniappVersion:o}=t,s=n.getSnapshot(),c=Wn({...s.superProperties,...s.dynamicProps,...s.pageProperties,page_path:i.pagePath||``,referrer:i.referrer||``,host_app_version:r.hostAppVersion||``,platform:r.platform||``,miniapp_id:a,miniapp_version:o,...e.properties||{}});return{event:e.event,type:e.type||`track`,time:e.time||new Date().toISOString(),distinct_id:s.distinctId,anonymous_id:s.anonymousId,login_id:s.loginId||``,is_autotrack:!!e.isAutoTrack,properties:c}}function Kn({storageKey:e,maxCacheSize:t}){let n=[];function r(e){return JSON.parse(JSON.stringify(e))}function i(e){let n=e.map(e=>r(e));return n.length<=t?n:n.slice(n.length-t)}function a(e){return i(e).map(e=>({...e,status:e.status===Bn.FLUSHING?Bn.QUEUED:e.status}))}function o(){wx.setStorageSync(e,JSON.stringify(n))}return{enqueue(e){n=i(n.concat(e)),o()},restore(){let t=wx.getStorageSync(e);return n=t?a(JSON.parse(t)):[],o(),i(n)},getAll(){return i(n)},replace(e){n=i(e),o()},clear(){n=[],wx.removeStorageSync(e)}}}function qn({request:e,storage:t,config:n}){return{async flush(){let r=t.getAll();if(!r.length)return;let i=r.map(e=>({...e,status:Bn.FLUSHING})),a=new Set(i.map(e=>e.id));t.replace(i);try{await new Promise((t,r)=>{e({url:n.serverUrl,method:`POST`,data:{events:i},success:e=>{if(e.statusCode>=200&&e.statusCode<300){t(e);return}r(Error(`analytics upload failed with status ${e.statusCode}`))},fail:r})}),t.replace(t.getAll().filter(e=>!a.has(e.id)))}catch(e){throw t.replace(t.getAll().map(e=>a.has(e.id)?{...e,status:Bn.QUEUED}:e)),e}}}}var R=new class{constructor(){this.config=null,this.context=Un(),this.storage=null,this.uploader=null,this.autotrack=null}init(e){return this.config=Vn(e),this.storage=Kn({storageKey:`analytics_queue_${this.config.miniappId}`,maxCacheSize:this.config.maxCacheSize||1e3}),this.storage.restore(),this.uploader=qn({request:e=>wx.request(e),storage:this.storage,config:this.config}),this.autotrack=Hn(this),this.config}identify(e){this.context.identify(e)}login(e){this.context.login(e)}logout(){this.context.logout()}registerSuperProperties(e){this.context.registerSuperProperties(e)}registerDynamicSuperProperties(e){this.context.registerDynamicSuperProperties(e)}setPageProperties(e){this.context.setPageProperties(e)}getHostContext(){return S.getAnalyticsBaseContext?.()||{}}getPageContext(){let e=C.getPageInfo?.()||{};return{pagePath:e.route||e.is||``,referrer:e.__analyticsReferrer__||``}}track(e,t={},n={}){if(!this.config||this.config.disableSDK)return null;let r=Gn({event:e,properties:t,isAutoTrack:!!n.isAutoTrack,type:n.type||`track`},{context:this.context,hostContext:this.getHostContext(),pageContext:this.getPageContext(),miniappId:this.config.miniappId,miniappVersion:this.config.miniappVersion});return this.storage.enqueue({id:`${Date.now()}_${Math.random().toString(16).slice(2)}`,status:Bn.QUEUED,...r}),this.config.instantEvents.includes(e)&&this.flush().catch(()=>{}),r}flush(){return this.uploader?.flush()||Promise.resolve()}},Jn=t({__appEventTestHooks:()=>fr,notifyAppError:()=>dr,notifyAppHide:()=>ur,notifyAppShow:()=>lr,offAppHide:()=>ar,offAppShow:()=>ir,offError:()=>tr,onAppHide:()=>rr,onAppRoute:()=>cr,onAppShow:()=>nr,onError:()=>er,onPageNotFound:()=>sr,onUnhandledRejection:()=>or}),Yn=new Set,Xn=new Set,Zn=new Set;function Qn(e,t,n){for(let r of Array.from(e))try{t===void 0?r():r(t)}catch(e){console.error(`[service] ${n} callback error:`,e)}}function $n(e){if(typeof e==`string`)return e;if(e?.message)return e.stack||e.message;if(e?.errMsg)return e.errMsg;try{return JSON.stringify(e)}catch{return String(e)}}function er(e){n(e)&&Zn.add(e)}function tr(e){n(e)?Zn.delete(e):Zn.clear()}function nr(e){n(e)&&Yn.add(e)}function rr(e){n(e)&&Xn.add(e)}function ir(e){n(e)?Yn.delete(e):Yn.clear()}function ar(e){n(e)?Xn.delete(e):Xn.clear()}function or(){}function sr(){}function cr(){}function lr(e){Qn(Yn,e,`onAppShow`)}function ur(){Qn(Xn,void 0,`onAppHide`)}function dr(e){Qn(Zn,$n(e),`onError`)}var fr={appShowCallbacks:Yn,appHideCallbacks:Xn,errorCallbacks:Zn,notifyAppShow:lr,notifyAppHide:ur,notifyAppError:dr},pr=class{static type=`app`;constructor(e){this.moduleInfo=e}},mr=0,hr=65536;function gr(e,t){try{w.send({type:e,target:`render`,body:{bridgeId:w.getBridgeId?.()||C.getPageInfo()?.id,...t}})}catch{}}function _r(e,t,n){vr()&&gr(`print`,{type:`log`,detail:{group:`network`,action:e,id:t,value:n}})}function vr(){return S.get(`vConsoleEnabled`)===!0}function yr(e){if(e==null)return 0;try{return new Blob([typeof e==`string`?e:JSON.stringify(e)]).size}catch{return String(e).length}}function br(e){if(e==null||yr(e)<=hr)return e;if(typeof e==`string`)return`${e.slice(0,hr)}...[truncated]`;try{return`${JSON.stringify(e).slice(0,hr)}...[truncated]`}catch{return`${String(e).slice(0,hr)}...[truncated]`}}function xr(e){return!e||typeof e!=`object`?null:e}function Sr(e={},t){return Object.prototype.hasOwnProperty.call(e,`data`)?e.data:t===`downloadFile`?e.filePath||e.tempFilePath||``:e.errMsg||``}function Cr(e={}){return!e||typeof e!=`object`?!1:Object.prototype.hasOwnProperty.call(e,`data`)||Object.prototype.hasOwnProperty.call(e,`statusCode`)||Object.prototype.hasOwnProperty.call(e,`header`)||Object.prototype.hasOwnProperty.call(e,`cookies`)}function wr(e={}){return Cr(e)?!0:typeof e?.errMsg==`string`&&e.errMsg.includes(`:fail`)}function Tr(e,t={}){let n=t.responseType||t.dataType;if(typeof n==`string`&&n)return n.toLowerCase();if(typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView?.(e)))return`arraybuffer`;if(typeof e==`string`){let t=e.trim();return t.startsWith(`{`)&&t.endsWith(`}`)||t.startsWith(`[`)&&t.endsWith(`]`)?`json`:`text`}return e&&typeof e==`object`?`json`:`text`}function Er(e,t){if(e==null)return e;if(t===`json`){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function Dr(e,t={}){let n=`dimina_${Date.now()}_${++mr}`,r=Date.now(),i=(t.method||(e===`uploadFile`?`POST`:`GET`)).toUpperCase(),a=br(e===`uploadFile`?t.formData:t.data);_r(`add`,n,{id:n,method:i,url:t.url||``,status:0,readyState:1,requestType:`custom`,requestHeader:xr(t.header),responseType:t.responseType||t.dataType||``,startTime:r,postData:a??null});let o=!1,s=(i={},a=!1)=>{if(o)return;o=!0;let s=Sr(i,e),c=Tr(s,t),l=Er(s,c),u=yr(s),d=br(l),f=Date.now();_r(`update`,n,{id:n,status:a?0:i.statusCode||200,statusText:i.errMsg||(a?`fail`:`ok`),readyState:4,header:xr(i.header),responseType:c,response:d,responseSize:u,endTime:f,costTime:f-r})};return{wrapOptions(e={}){return{...e,success(t){s(t,!1),e.success?.(t)},fail(t){s(t,!0),e.fail?.(t)},complete(t){wr(t)&&s(t,t?.errMsg?.includes(`:fail`)),e.complete?.(t)}}}}}function Or(e){return e}function kr(e){if(typeof e==`string`)return e;if(e===void 0)return`undefined`;try{return JSON.stringify(e)}catch{return String(e)}}function Ar(e,t){e&&gr(`debugStorage`,{action:`set`,key:Or(e),value:kr(t)})}function jr(e){e&&gr(`debugStorage`,{action:`remove`,key:Or(e)})}function Mr(){gr(`debugStorage`,{action:`clear`,prefix:Or(``)})}var z=new class{constructor(){this.staticModules={}}loadResource(e){let{appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a,resourceLoadId:o}=e;if(_&&(this.isScriptLoaded=this.isScriptLoaded||{},!this.isScriptLoaded[i])){let e=`${a}${t}/${i}/logic.js`;globalThis.importScripts(e),this.isScriptLoaded[i]=!0}C.setInitId(n),b(`app`),b(r),w.invoke({type:`serviceResourceLoaded`,target:`service`,body:{bridgeId:n,resourceLoadId:o}})}hotUpdateResource(e){let{appId:t,pagePath:n,root:r=`main`,baseUrl:i=`/`}=e;if(typeof globalThis.importScripts!=`function`)return!1;let a=`${i}${t}/${r}/logic.js?t=${Date.now()}`,o=globalThis.modDefine,s=globalThis.__diminaHotUpdating;try{return globalThis.__diminaHotUpdating=!0,globalThis.modDefine=oe,globalThis.importScripts(a),n&&b(n),!0}finally{globalThis.modDefine=o,globalThis.__diminaHotUpdating=s}}createAppModule(e){let t=new pr(e);this.staticModules[pr.type]=t}createModule(e,t,n){let{path:r}=t;this.staticModules[r]||this.#e(e,t,n)}hotUpdateModule(e,t,n){this.#e(e,t,n)}#e(e,t,n){let{path:r,usingComponents:i}=t;if(i)for(let e of Object.values(i))b(e);if(n===I.type){let n=new I(e,t);this.staticModules[r]=n}else if(n===P.type){let n=new P(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[pr.type]}getModuleByPath(e){return this.staticModules[e]}},B=new class{constructor(){this.app=void 0,this.defaultApp={},this.appLaunchOptions={},this.instances={},this.pageStates=new Map}setAppLaunchOptions(e){this.app||(this.appLaunchOptions=e)}getApp(e={}){return e.allowDefault?this.app||this.defaultApp:this.app}getPageState(e){return this.pageStates.has(e)||this.pageStates.set(e,{hidden:!1,pendingReady:!1,pendingShow:!1,ready:!1,shown:!1}),this.pageStates.get(e)}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=this.appLaunchOptions){if(this.app){console.log(`[service] app instance already existed`);return}let{scene:t,pagePath:n,query:r}=e||{},i=z.getAppModule();if(!i){console.log(`[service] app instance is not exist`);return}console.log(`[service] create app instance`),Object.assign(i.moduleInfo,this.defaultApp),this.defaultApp={},this.app=new at(i,{scene:t,path:n,query:r}),R.autotrack?.onAppLaunch({scene:t,path:n,query:r})}appShow(){this.app?.appShow(),lr(this.app?.options),R.autotrack?.onAppShow()}appHide(){this.app?.appHide(),ur(),R.autotrack?.onAppHide()}stackShow(e){C.pushStack(e)}stackHide(e){C.popStack(e)}createInstance(e){let{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,propertyNames:l,targetInfo:u,stackId:d,isCustomTabBar:f=!1,deferInitialData:p=!1}=e,m=z.getModuleByPath(r);if(!m){console.error(`[service] ${r} not exist`);return}if(this.instances[t]=this.instances[t]||{},m.type===P.type){let e=new An(m,{bridgeId:t,moduleId:n,path:r,isCustomTabBar:f,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,propertyNames:l,targetInfo:u});this.instances[t][n]=e,m.isComponent||C.push(e,d),e.init({deferInitialData:p});let h=this.getPageState(t);return!m.isComponent&&h.pendingShow&&!h.hidden&&this.pageShow({bridgeId:t,moduleId:n}),e}if(m.type===I.type){let e=new jn(m,{bridgeId:t,moduleId:n,path:r,query:i});this.instances[t][n]=e,C.push(e,d),e.init({deferInitialData:p});let a=this.getPageState(t);return a.pendingShow&&!a.hidden&&this.pageShow({bridgeId:t,moduleId:n}),e}console.error(`[service] ${m.type} instance is not exist.`)}moduleAttached(e){let{bridgeId:t,moduleId:n,parentId:r}=e,i=this.instances[t]?.[n];if(!i||i.__type__!==P.type||!i.__isComponent__||i.__componentAttached__||i.__componentAttaching__)return;r&&this.instances[t]?.[r]&&(i.__parentId__=r);let a=this.instances[t]?.[i.__parentId__];if(a?.__isComponent__&&!a.__componentAttached__){i.__componentAttachPending__=!0;return}i.__componentAttachPending__=!1,i.__componentAttaching__=!0;try{i.__componentAttached__=!0,i.componentAttached(),i.__componentAttaching__=!1,this.getPageState(t).shown&&!i.__pageShown__&&(i.__pageShown__=!0,i.pageShow());let e=Object.values(this.instances[t]||{}).filter(e=>e?.__parentId__===n&&e.__componentAttachPending__);for(let n of e)this.moduleAttached({bridgeId:t,moduleId:n.__id__});if(i.__pendingReadyOpts__){let e=i.__pendingReadyOpts__;delete i.__pendingReadyOpts__,this.moduleReady(e)}}finally{i.__componentAttaching__=!1}}moduleReady(e){let{bridgeId:t,moduleId:n,propBindings:r,eventPath:i}=e,a=this.instances[t]?.[n];if(a){if(Array.isArray(i)&&(a.__eventPath__=i),r&&a.__parentId__){let e=this.instances[t]?.[a.__parentId__];e&&(e.__childPropsBindings__||={},e.__childPropsBindings__[n]=r)}if(a.__type__===P.type){if(a.__isComponent__&&!a.__componentAttached__){a.__pendingReadyOpts__=e;return}if(a.__componentReadied__)return;if(Object.values(this.instances[t]||{}).some(e=>e?.__isComponent__&&e.__componentAttached__&&!e.__componentReadied__&&this.isDescendantInstance(e,a,t))){a.__pendingReadyOpts__=e;return}a.__componentReadied__=!0,a.componentReadied(),this.flushPendingEvents(a),a.flushInitSetDataCallbacks?.();let n=this.getPageInstance(t);n&&this.checkAndCallPageReady(t,n.__id__);let r=this.instances[t]?.[a.__parentId__];for(;r?.__isComponent__;){if(r.__pendingReadyOpts__){let e=r.__pendingReadyOpts__;delete r.__pendingReadyOpts__,this.moduleReady(e)}r=this.instances[t]?.[r.__parentId__]}}}}isDescendantInstance(e,t,n){let r=e;for(;r?.__parentId__;){if(r.__parentId__===t.__id__)return!0;r=this.instances[n]?.[r.__parentId__]}return!1}moduleUnmounted(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t]?.[n];r&&(r.__type__===P.type&&(!r.__isComponent__||r.__componentAttached__)&&!r.__componentDetached__&&(r.componentDetached(),r.__componentDetached__=!0),delete this.instances[t][n])}pageShow(e){let{bridgeId:t}=e,n=this.getPageState(t);if(n.hidden=!1,n.pendingShow=!0,!this.instances[t])return;let r=this.getPageInstance(t);if(!r?.initd)return;if(n.shown){n.pendingShow=!1;return}n.shown=!0,n.pendingShow=!1;let i=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===I.type?i.push(e):e.__type__===P.type&&(e.__isComponent__?e.__componentAttached__&&!e.__pageShown__&&(e.__pageShown__=!0,e.pageShow()):i.push(e)))}),i.forEach(e=>{e.pageShow(),R.autotrack?.onPageShow(e)}),n.pendingReady&&this.pageReady({...e,moduleId:r.__id__})}pageReady(e){let{bridgeId:t,moduleId:n}=e,r=this.getPageState(t);r.pendingReady=!0;let i=this.instances[t]?.[n];i&&(r.hidden||!r.shown||r.ready||(i.__pageReadyPending__=!0,i.flushInitSetDataCallbacks?.(),this.checkAndCallPageReady(t,n)))}getPageInstance(e){let t=this.instances[e];return t?Object.values(t).find(e=>e&&(e.__type__===I.type||e.__type__===P.type&&!e.__isComponent__)):null}checkAndCallPageReady(e,t){let n=this.getPageState(e),r=this.instances[e]?.[t];if(!r||!r.__pageReadyPending__||!n.shown||n.ready)return;let i=this.instances[e];if(!i){r.__pageReadyPending__=!1,n.pendingReady=!1,n.ready=!0,r.pageReady();return}Object.values(i).filter(e=>e&&e.__type__===P.type&&e.__isComponent__&&e.initd&&!e.__componentReadied__).length===0&&(r.__pageReadyPending__=!1,n.pendingReady=!1,n.ready=!0,r.pageReady())}pageHide(e){let{bridgeId:t}=e,n=this.getPageState(t);if(n.hidden=!0,n.pendingShow=!1,!n.shown)return;n.shown=!1;let r=this.instances[t];if(!r||!r)return;let i=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===I.type?i.push(e):e.__type__===P.type&&(e.__isComponent__?e.__componentAttached__&&e.__pageShown__&&(e.__pageShown__=!1,e.pageHide()):i.push(e)))}),i.forEach(e=>{e&&(e.pageHide(),R.autotrack?.onPageHide(e))})}pageUnload(e){let{bridgeId:t}=e;if(!this.instances[t])return;let n=[],r=this.getInstancesInTreeOrder(t);this.getInstancesInTreeOrder(t,{postOrder:!0}).filter(e=>e?.__type__===P.type&&e.__isComponent__).forEach(e=>{e.__componentAttached__&&!e.__componentDetached__&&(e.componentDetached(),e.__componentDetached__=!0)}),r.forEach(e=>{e&&(e.__type__===P.type&&!e.__isComponent__&&!e.__componentDetached__?(n.push(e),e.componentDetached(),e.__componentDetached__=!0):e.__type__===I.type&&n.push(e),e.pageUnload())}),n.forEach(e=>{R.autotrack?.onPageHide(e)}),C.remove(t),delete this.instances[t],this.pageStates.delete(t)}getInstancesInTreeOrder(e,{postOrder:t=!1}={}){let n=Object.values(this.instances[e]||{}).filter(Boolean),r=new Map(n.map(e=>[e.__id__,e])),i=new Map,a=[];for(let e of n)if(e.__parentId__&&r.has(e.__parentId__)){let t=i.get(e.__parentId__)||[];t.push(e),i.set(e.__parentId__,t)}else a.push(e);let o=[],s=new Set,c=e=>{if(!(!e||s.has(e))){s.add(e),t||o.push(e);for(let t of i.get(e.__id__)||[])c(t);t&&o.push(e)}};return a.forEach(c),n.forEach(c),o}pageScroll(e){let{bridgeId:t,moduleId:n,scrollTop:r}=e,i=this.instances[t]?.[n];i&&i.pageScrollTop({scrollTop:r})}pagePullDownRefresh(e={}){this.getPageInstance(e.bridgeId)?.pagePullDownRefresh?.()}pageReachBottom(e={}){this.getPageInstance(e.bridgeId)?.pageReachBottom?.()}pageResize(e){let{bridgeId:t,size:n}=e;if(!this.instances[t])return;let r=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===I.type?r.push(e):e.__type__===P.type&&(e.__isComponent__?e.__componentAttached__&&e.pageResize(n):r.push(e)))}),r.forEach(e=>e.pageResize(n))}async pageShareAppMessage(e={}){let t=this.getPageInstance(e.bridgeId);if(!t||!n(t.onShareAppMessage))return{};let r=await t.onShareAppMessage(e.event||{});return Nr(r)?r:{}}pageTabItemTap({bridgeId:e,...t}){this.getPageInstance(e)?.pageTabItemTap(t)}componentError(e={}){let{bridgeId:t,moduleId:n}=e,r=this.instances[t]?.[n],i=e?.error||e?.message||e?.errMsg||e;if(!r){dr(i);return}r.__type__===P.type&&r.componentError(i),dr(i)}componentRouteDone(e){let{bridgeId:t}=e;this.instances[t]&&this.getInstancesInTreeOrder(t).forEach(e=>{e?.__type__===P.type&&(!e.__isComponent__||e.__componentAttached__)&&e.componentRouteDone()})}hotUpdateLogic(e={}){let{bridgeId:t}=e,r=this.instances[t];if(!r)return 0;let i=0;return Object.values(r).forEach(e=>{if(!e)return;let t=z.getModuleByPath(e.is);!t||!n(e.hotUpdate)||(e.hotUpdate(t),i++)}),i}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__===P.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})}};function Nr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Pr=t({getEnterOptionsSync:()=>Ir,getLaunchOptionsSync:()=>Fr});function Fr(){return B.app?.options}function Ir(){return B.app?.options}var Lr=t({getAppBaseInfo:()=>Kr,getDeviceInfo:()=>qr,getSystemInfo:()=>Ur,getSystemInfoAsync:()=>Gr,getSystemInfoSync:()=>Wr,getSystemSetting:()=>Vr,getWindowInfo:()=>Br,offThemeChange:()=>Yr,onThemeChange:()=>Jr,openAppAuthorizeSetting:()=>Hr,openSystemBluetoothSetting:()=>zr}),Rr=new Set;S.onUpdate(e=>{let t=e.systemInfo?.theme;t&&Rr.forEach(e=>e({theme:t}))});function zr(e){return T(`openSystemBluetoothSetting`,e)}function Br(e){return T(`getWindowInfo`,e)}function Vr(){return T(`getSystemSetting`)}function Hr(e){return T(`openAppAuthorizeSetting`,e)}function Ur(e){return new Promise(t=>{t(T(`getSystemInfo`,e))})}function Wr(){return T(`getSystemInfoSync`)}function Gr(e){return T(`getSystemInfoAsync`,e)}function Kr(){return T(`getAppBaseInfo`)}function qr(){return T(`getDeviceInfo`)}function Jr(e){n(e)&&Rr.add(e)}function Yr(e){n(e)?Rr.delete(e):Rr.clear()}var Xr=t({extBridge:()=>V,extOffBridge:()=>Qr,extOnBridge:()=>Zr,offLoginStatusChanged:()=>ei,onLoginStatusChanged:()=>$r});function V({event:e,module:t,data:r={},success:i,fail:a,complete:o},s){let c=t||`DefaultModule`,l,u,d;return n(s)?(l=s,u=s):(l=i,u=a,d=o),T(e,{module:c,data:r,keep:r.isSustain??!0,success:l,fail:u,complete:d})}function Zr({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}`;T(i,{evtId:i,keep:r,success:n})}function Qr({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}let r=`${t}_${e}`;T(r,{evtId:r,success:n})}function $r(e){w.on(`notifyLoginStatusChanged`,t=>{e?.(t)})}function ei(){w.off(`notifyLoginStatusChanged`)}var ti=t({captureScreen:()=>ni});function ni(e){let t={event:`captureScreen`,data:ri(e)};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),V(t)}function ri(e={}){let{success:t,fail:n,complete:r,...i}=e&&typeof e==`object`?e:{};return i}var ii=t({hideShareMenu:()=>di,share:()=>oi,shareMiniAppMessage:()=>ci,shareToApp:()=>si,showShareImageMenu:()=>ui,showShareMenu:()=>li});function ai(e={}){let t=e&&typeof e==`object`?e:{},n={};for(let e of[`provider`,`type`,`summary`,`href`,`imageUrl`])Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);if(t.file&&typeof t.file==`object`&&!Array.isArray(t.file)){let e={};for(let n of[`path`,`name`,`mimeType`])Object.prototype.hasOwnProperty.call(t.file,n)&&(e[n]=t.file[n]);Object.keys(e).length>0&&(n.file=e)}return n}function oi(e){return V({event:`share`,data:ai(e)})}function si(e){let t={event:`shareToApp`,data:ai(e)};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),V(t)}async function ci(e={}){let t=e&&typeof e==`object`?e:{},n=t.imageUrl;fi(n)||(n=await pi());let r={title:t.title||``,path:t.path||hi(),type:mi(t),extraData:t.extraData||{},version:Wr()?.appVersion};n&&(r.imageUrl=n);let i={event:`shareMiniAppToIM`,data:r};return t.success&&(i.success=t.success),t.fail&&(i.fail=t.fail),t.complete&&(i.complete=t.complete),V(i)}function li(e){return T(`showShareMenu`,e)}function ui(e){return T(`showShareImageMenu`,e)}function di(e){return T(`hideShareMenu`,e)}function fi(e){return typeof e==`string`&&e.includes(`http`)}function pi(){return new Promise(e=>{try{ni({success(t={}){e(t.imageUrl||t.tempFilePath||t.path||``)},fail(){e(``)}})}catch{e(``)}})}function mi(e){return Object.prototype.hasOwnProperty.call(e,`type`)?e.type:Fr()?.referrerInfo?.extraData?.envVersion||0}function hi(){let e=typeof getCurrentPages==`function`?getCurrentPages():[],t=e[e.length-1];if(!t)return``;let n=t.$page?.fullPath||t.fullPath||t.route||t.is||``,r=t.query||{},i=Object.keys(r).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`).join(`&`);return i&&!n.includes(`?`)?`${n}?${i}`:n}var gi=t({clearStorage:()=>ki,clearStorageSync:()=>Ti,getStorage:()=>Di,getStorageInfo:()=>ji,getStorageInfoSync:()=>Ai,getStorageSync:()=>Ci,removeStorage:()=>Oi,removeStorageSync:()=>wi,replaceSyncStorageSnapshot:()=>xi,setStorage:()=>Ei,setStorageSync:()=>Si}),_i=null;function H(){return _i||={...S.getStorageSnapshot()},_i}function vi(e){return e.length===1&&Array.isArray(e[0])?e[0]:e}function yi(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function bi(e){return typeof e==`object`?JSON.stringify(e):String(e)}function xi(e={}){_i={...e}}function Si(...e){let[t,n]=vi(e),r=H();r[t]=bi(n);let i=T(`setStorageSync`,[t,n]);return Ar(t,n),i}function Ci(e){let[t]=vi([e]),n=H();return Object.prototype.hasOwnProperty.call(n,t)?yi(n[t]):``}function wi(e){let[t]=vi([e]),n=H();delete n[t];let r=T(`removeStorageSync`,t);return jr(t),r}function Ti(){H(),_i={};let e=T(`clearStorageSync`);return Mr(),e}function Ei(e){return T(`setStorage`,{...e,success(t){let n=H();n[e?.key]=bi(e?.data),Ar(e?.key,e?.data),e?.success?.(t)},fail:e?.fail,complete:e?.complete})}function Di(e){return T(`getStorage`,e)}function Oi(e){return T(`removeStorage`,{...e,success(t){let n=H();delete n[e?.key],jr(e?.key),e?.success?.(t)},fail:e?.fail,complete:e?.complete})}function ki(e={}){return T(`clearStorage`,{...e,success(t){H(),_i={},Mr(),e?.success?.(t)},fail:e?.fail,complete:e?.complete})}function Ai(){let e=H();return{keys:Object.keys(e),currentSize:Object.values(e).reduce((e,t)=>e+String(t??``).length,0),limitSize:10485760}}function ji(e){return T(`getStorageInfo`,e)}var Mi=t({flushAnalytics:()=>Vi,identifyAnalytics:()=>Li,initAnalytics:()=>Ni,loginAnalytics:()=>Fi,logoutAnalytics:()=>Ii,registerAnalyticsDynamicSuperProperties:()=>zi,registerAnalyticsSuperProperties:()=>Ri,setAnalyticsPageProperties:()=>Bi,trackAnalytics:()=>Pi});function Ni(e){return R.init(e)}function Pi(e,t={}){return R.track(e,t)}function Fi(e){return R.login(e)}function Ii(){return R.logout()}function Li(e){return R.identify(e)}function Ri(e){return R.registerSuperProperties(e)}function zi(e){return R.registerDynamicSuperProperties(e)}function Bi(e){return R.setPageProperties(e)}function Vi(){return R.flush()}var Hi=t({chooseMessageFile:()=>ha,fileSystemManagerAPINames:()=>fa,getFileSystemManager:()=>ma}),Ui=`__diminaArrayBufferBase64`,Wi=`__diminaFileDataBase64`,Gi=`__diminaFileDataType`,U=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ki=(()=>{let e={};for(let t=0;t<64;t++)e[U[t]]=t;return e})();function qi(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function Ji(e){return e&&e.buffer&&qi(e.buffer)}function Yi(e){return qi(e)?e:Ji(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function Xi(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=U[t[r]>>2],n+=U[(t[r]&3)<<4|t[r+1]>>4],n+=U[(t[r+1]&15)<<2|t[r+2]>>6],n+=U[t[r+2]&63];return r<t.length&&(n+=U[t[r]>>2],r+1<t.length?(n+=U[(t[r]&3)<<4|t[r+1]>>4],n+=U[(t[r+1]&15)<<2],n+=`=`):(n+=U[(t[r]&3)<<4],n+=`==`)),n}function Zi(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=Ki[t[e]],o=Ki[t[e+1]],s=t[e+2]===`=`?0:Ki[t[e+2]],c=t[e+3]===`=`?0:Ki[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function Qi(e){let t=Yi(e);return t?{[Gi]:`base64`,[Wi]:Xi(t)}:e}function $i(e,t=[`data`,`arrayBuffer`]){if(!e||typeof e!=`object`)return e;let n={...e};for(let e of t)e in n&&(n[e]=Qi(n[e]));return n}function ea(e){return e&&typeof e==`object`&&e[Ui]!==void 0?Zi(e[Ui]):e}function ta(e){return e&&typeof e==`object`&&e.data!==void 0?{...e,data:ea(e.data)}:e}function na(e){if(!e||typeof e!=`object`||!e.entries||typeof e.entries!=`object`)return e;let t={};for(let[n,r]of Object.entries(e.entries))t[n]=r&&typeof r==`object`&&r.data!==void 0?{...r,data:ea(r.data)}:r;return{...e,entries:t}}function ra(e,t,n=0){if(!e||typeof e!=`object`||!t||e[Ui]===void 0)return e;let r=new Uint8Array(Zi(e[Ui]));new Uint8Array(t).set(r,n);let{[Ui]:i,...a}=e;return{...a,arrayBuffer:t}}function ia(e){let t={...e},n=Yi(e?.arrayBuffer);return n&&(t.arrayBufferLength=n.byteLength,delete t.arrayBuffer),t}var aa=class{constructor(e={}){this.mode=e.mode,this.size=e.size,this.lastAccessedTime=e.lastAccessedTime,this.lastModifiedTime=e.lastModifiedTime,this._isDirectory=!!e.isDirectory,this._isFile=!!e.isFile}isDirectory(){return this._isDirectory}isFile(){return this._isFile}};function oa(e){return e&&typeof e==`object`&&typeof e.size==`number`&&Object.prototype.hasOwnProperty.call(e,`isDirectory`)&&Object.prototype.hasOwnProperty.call(e,`isFile`)}function sa(e){if(!e||typeof e!=`object`||typeof e.isDirectory==`function`&&typeof e.isFile==`function`)return e;if(oa(e))return new aa(e);if(Array.isArray(e))return e.map(e=>sa(e));let t={};for(let[n,r]of Object.entries(e))t[n]=sa(r);return t}function ca(e){if(e&&typeof e==`object`){if(e.stats!==void 0)return{...e,stats:sa(e.stats)};if(e.statsMap!==void 0)return{...e,statsMap:sa(e.statsMap)}}return sa(e)}function la(e,t){if(!e||typeof e!=`object`)return e;let n={...e};return typeof e.success==`function`&&(n.success=n=>e.success(t(n))),typeof e.complete==`function`&&(n.complete=n=>e.complete(t(n))),n}function W(e,t,{transform:n=e=>e,prepare:r=e=>e}={}){let i=T(e,r(la(t,n)));return i&&typeof i.then==`function`?i.then(n):i}function ua(e,t){let n=t?.arrayBuffer,r=t?.offset||0;return W(e,t,{prepare:ia,transform:e=>ra(e,n,r)})}var da=class{access(e){return W(`FileSystemManager.access`,e)}accessSync(e){return T(`FileSystemManager.accessSync`,e)}appendFile(e){return W(`FileSystemManager.appendFile`,e,{prepare:$i})}appendFileSync(e,t,n){return T(`FileSystemManager.appendFileSync`,$i({filePath:e,data:t,encoding:n}))}close(e){return W(`FileSystemManager.close`,e)}closeSync(e){return T(`FileSystemManager.closeSync`,e)}copyFile(e){return W(`FileSystemManager.copyFile`,e)}copyFileSync(e,t){return T(`FileSystemManager.copyFileSync`,{srcPath:e,destPath:t})}fstat(e){return W(`FileSystemManager.fstat`,e,{transform:ca})}fstatSync(e){return ca(T(`FileSystemManager.fstatSync`,e))}ftruncate(e){return W(`FileSystemManager.ftruncate`,e)}ftruncateSync(e){return T(`FileSystemManager.ftruncateSync`,e)}getFileInfo(e){return W(`FileSystemManager.getFileInfo`,e)}getSavedFileList(e){return W(`FileSystemManager.getSavedFileList`,e||{})}getSavedFileInfo(e){return T(`FileSystemManager.getSavedFileInfo`,e)}mkdir(e){return W(`FileSystemManager.mkdir`,e)}mkdirSync(e,t){return T(`FileSystemManager.mkdirSync`,{dirPath:e,recursive:t})}open(e){return W(`FileSystemManager.open`,e)}openSync(e){return T(`FileSystemManager.openSync`,e)}read(e){return ua(`FileSystemManager.read`,e)}readSync(e){return ra(T(`FileSystemManager.readSync`,ia(e)),e?.arrayBuffer,e?.offset||0)}readCompressedFile(e){return W(`FileSystemManager.readCompressedFile`,e,{transform:ta})}readCompressedFileSync(e){return ea(T(`FileSystemManager.readCompressedFileSync`,e))}readdir(e){return W(`FileSystemManager.readdir`,e)}readdirSync(e){return T(`FileSystemManager.readdirSync`,e)}readFile(e){return W(`FileSystemManager.readFile`,e,{transform:ta})}readFileSync(e,t,n,r){return ea(T(`FileSystemManager.readFileSync`,{filePath:e,encoding:t,position:n,length:r}))}readZipEntry(e){return W(`FileSystemManager.readZipEntry`,e,{transform:na})}removeSavedFile(e){return W(`FileSystemManager.removeSavedFile`,e)}rename(e){return W(`FileSystemManager.rename`,e)}renameSync(e,t){return T(`FileSystemManager.renameSync`,{oldPath:e,newPath:t})}rmdir(e){return W(`FileSystemManager.rmdir`,e)}rmdirSync(e,t){return T(`FileSystemManager.rmdirSync`,{dirPath:e,recursive:t})}saveFile(e){return W(`FileSystemManager.saveFile`,e)}saveFileSync(e,t){return T(`FileSystemManager.saveFileSync`,{tempFilePath:e,filePath:t})}stat(e){return W(`FileSystemManager.stat`,e,{transform:ca})}statSync(e,t){return ca(T(`FileSystemManager.statSync`,{path:e,recursive:t}))}truncate(e){return W(`FileSystemManager.truncate`,e)}truncateSync(e,t){return T(`FileSystemManager.truncateSync`,{filePath:e,length:t})}unlink(e){return W(`FileSystemManager.unlink`,e)}unlinkSync(e){return T(`FileSystemManager.unlinkSync`,e)}unzip(e){return W(`FileSystemManager.unzip`,e)}write(e){return W(`FileSystemManager.write`,e,{prepare:e=>$i(e,[`arrayBuffer`,`data`])})}writeSync(e){return T(`FileSystemManager.writeSync`,$i(e,[`arrayBuffer`,`data`]))}writeFile(e){return W(`FileSystemManager.writeFile`,e,{prepare:$i})}writeFileSync(e,t,n){return T(`FileSystemManager.writeFileSync`,$i({filePath:e,data:t,encoding:n}))}},fa=Object.getOwnPropertyNames(da.prototype).filter(e=>e!==`constructor`),pa=null;function ma(){return pa||=new da,pa}function ha(e){return T(`chooseMessageFile`,e)}var ga=[`applyUpdate`,`onCheckForUpdate`,`onUpdateFailed`,`onUpdateReady`],_a=new Set;function va(e){for(let t of e||[])typeof t==`string`&&t.length>0&&_a.add(t)}function ya(e){return typeof e==`string`&&_a.has(e)}var ba=t({canIUse:()=>Ta,env:()=>xa,setEnableDebug:()=>Ca}),xa={USER_DATA_PATH:`difile://usr`},Sa=new Set([`nextTick`,`getUpdateManager`,`getPerformance`,`getFileSystemManager`,`setEnableDebug`,`authorize`,`captureScreen`,`getAuthList`,`getAuthCode`,`getHostFontSize`,`getHostLanguage`,`getPhoneNumber`,`getEmail`,`getUserProfile`,`addPhoneCalendar`,`shareMiniAppMessage`,`shareToApp`,`button.open-type.share`,`onError`,`offError`,`onAppShow`,`onAppHide`,`offAppShow`,`offAppHide`,`onThemeChange`,`offThemeChange`,`UpdateManager`,...ga.map(e=>`UpdateManager.${e}`),`getPerformance`,`getFileSystemManager`,`FileSystemManager`,...fa.map(e=>`FileSystemManager.${e}`)]);function Ca(e){T(`setEnableDebug`,e)}var wa={createUDPSocket:`UDPSocket.bind`,UDPSocket:`UDPSocket.bind`,createTCPSocket:`TCPSocket.connect`,TCPSocket:`TCPSocket.connect`};function Ta(e){if(Sa.has(e)||ya(e))return!0;try{return T(`canIUse`,Object.hasOwn(wa,e)?wa[e]:e)===!0}catch(t){return console.warn(`[canIUse] check ${e} error:`,t),!1}}var Ea=t({getPerformance:()=>Da});function Da(){return Oa.getInstance()}var Oa=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one Performance instance.`);this.entryList=new ka,e.#e=this}static getInstance(){return e.#e||=new e,e.#e}createObserver(e){return new Aa(this,e)}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}},ka=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}},Aa=class{constructor(e,t){this.performance=e,this.entryTypes=[],this.callback=t,this.observerId=null,this.callbackId=null,this.connected=!1}observe(e={}){this.disconnect(),this.connected=!0,this.entryTypes=Array.isArray(e.entryTypes)?e.entryTypes:[],this.callbackId=x.store((e={})=>{if(e.observerId&&(this.observerId=e.observerId,!this.connected)){T(`removePerformanceObserver`,{observerId:e.observerId},`render`),x.remove(this.callbackId),this.callbackId=null;return}let t=e?.data?.entryList?JSON.parse(e.data.entryList):[];this.connected&&t.length>0&&(this.performance.entryList.push(t),this.notify(t))},!0),T(`addPerformanceObserver`,{entryTypes:this.entryTypes,success:this.callbackId},`render`)}notify(e){if(this.connected){let t=new ka;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})),typeof this.callback==`function`&&this.callback(t)}}disconnect(){this.connected=!1,this.observerId&&T(`removePerformanceObserver`,{observerId:this.observerId},`render`),this.callbackId&&this.observerId&&x.remove(this.callbackId),this.observerId=null,this.callbackId=null}},ja=t({getScreenBrightness:()=>Ia,offUserCaptureScreen:()=>Ba,onUserCaptureScreen:()=>za,setKeepScreenOn:()=>Fa,setScreenBrightness:()=>La,setVisualEffectOnCapture:()=>Ra}),Ma=new Map;function Na(e,t,r){if(!n(r)||t.has(r))return;let i=x.store(r,!0);t.set(r,i),T(e,{callback:i})}function Pa(e,t,r){if(n(r)){let n=t.get(r);if(!n)return;t.delete(r),x.remove(n),T(e,{callback:n});return}t.forEach(e=>x.remove(e)),t.clear(),T(e)}function Fa(e){return T(`setKeepScreenOn`,e)}function Ia(e){return T(`getScreenBrightness`,e)}function La(e){return T(`setScreenBrightness`,e)}function Ra(e){return T(`setVisualEffectOnCapture`,e)}function za(e){Na(`onUserCaptureScreen`,Ma,e)}function Ba(e){Pa(`offUserCaptureScreen`,Ma,e)}var Va=t({loadSubpackage:()=>Ua,preDownloadSubpackage:()=>Ha});function Ha(e){return T(`preDownloadSubpackage`,e)}function Ua(e){return T(`loadSubpackage`,e)}var Wa=t({getUpdateManager:()=>Xa}),Ga=`onUpdateStatusChange`,Ka=`updatefail`,qa=`updateready`,Ja=`noupdate`,Ya=`updating`;function Xa(){return Za.getInstance()}var Za=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=[],w.on(Ga,e=>this.handleUpdateStatusChange(e)),e.#e=this}handleUpdateStatusChange(e={}){let{event:t}=e;if(t===Ka){this.updateFailed=!0,this.emit(this.updateFailedListeners);return}if(t===qa){let e=this.checkForUpdateResult?.hasUpdate!==!0,t=!this.updateReady;this.updateReady=!0,this.checkForUpdateResult={hasUpdate:!0},e&&this.emit(this.checkForUpdateListeners,this.checkForUpdateResult),t&&this.emit(this.updateReadyListeners);return}if(t===Ya){this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}if(t===Ja){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,T(`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())}};Za.getInstance();var Qa=t({createCameraContext:()=>$a});function $a(e){return new eo({cameraId:e})}var eo=class{constructor(e={}){this.opts=e,this.bridgeId=C.getPageInfo().id}takePhoto(e){return this.invoke(`takePhoto`,e)}startRecord(e={}){return this.invoke(`startRecord`,e)}stopRecord(e={}){return this.invoke(`stopRecord`,e)}invoke(e,t={}){return T(`cameraContext`,{type:`native/camera`,id:this.opts.cameraId,command:e,...t},`render`)}},to=t({reportAnalytics:()=>no,reportEvent:()=>ro});function no(...e){return T(`reportAnalytics`,e)}function ro(e,t){return T(`reportAnalytics`,{eventId:e,data:t})}var io=`__diminaArrayBufferBase64`,G=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ao=(()=>{let e={};for(let t=0;t<64;t++)e[G[t]]=t;return e})();function oo(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function so(e){return oo(e)?e:e&&e.buffer&&oo(e.buffer)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function co(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=G[t[r]>>2],n+=G[(t[r]&3)<<4|t[r+1]>>4],n+=G[(t[r+1]&15)<<2|t[r+2]>>6],n+=G[t[r+2]&63];return r<t.length&&(n+=G[t[r]>>2],r+1<t.length?(n+=G[(t[r]&3)<<4|t[r+1]>>4],n+=`${G[(t[r+1]&15)<<2]}=`):n+=`${G[(t[r]&3)<<4]}==`),n}function lo(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=ao[t[e]],o=ao[t[e+1]],s=t[e+2]===`=`?0:ao[t[e+2]],c=t[e+3]===`=`?0:ao[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function uo(e){let t=so(e);return t?{[io]:co(t)}:e}function fo(e){return e&&typeof e==`object`&&e.__diminaArrayBufferBase64!==void 0?lo(e[io]):e}function po(e){if(!e||typeof e!=`object`)return e;let t={};for(let[n,r]of Object.entries(e.serviceData||{}))t[n]=fo(r);return{...e,advertisData:fo(e.advertisData),serviceData:t}}function mo(e){return!e||!Array.isArray(e.devices)?e:{...e,devices:e.devices.map(po)}}function ho(e){return!e||typeof e!=`object`?e:{...e,value:fo(e.value)}}function go(e,t){if(!e||typeof e!=`object`)return e;let n={...e};return typeof e.success==`function`&&(n.success=n=>e.success(t(n))),typeof e.complete==`function`&&(n.complete=n=>e.complete(t(n))),n}function _o(e,t,{prepare:n=e=>e,transform:r=e=>e}={}){let i=T(e,n(go(t,r)));return i&&typeof i.then==`function`?i.then(r):i}function K(e,t,n=e=>e){let r=new Map;return{on(t){if(typeof t!=`function`||r.has(t))return;let i=x.store(e=>t(n(e)),!0);return r.set(t,i),T(e,{callbackId:i,success:i,keep:!0})},off(e){if(typeof e==`function`){let n=r.get(e);return n?(r.delete(e),x.remove(n),T(t,{callbackId:n,keep:!0})):void 0}for(let e of r.values())x.remove(e);return r.clear(),T(t)}}}var vo=t({closeBluetoothAdapter:()=>jo,getBluetoothAdapterState:()=>Ao,getBluetoothDevices:()=>ko,getConnectedBluetoothDevices:()=>Oo,isBluetoothDevicePaired:()=>Mo,makeBluetoothPair:()=>No,offBluetoothAdapterStateChange:()=>Do,offBluetoothDeviceFound:()=>Eo,onBluetoothAdapterStateChange:()=>To,onBluetoothDeviceFound:()=>wo,openBluetoothAdapter:()=>Co,startBluetoothDevicesDiscovery:()=>So,stopBluetoothDevicesDiscovery:()=>xo}),yo=K(`onBluetoothDeviceFound`,`offBluetoothDeviceFound`,mo),bo=K(`onBluetoothAdapterStateChange`,`offBluetoothAdapterStateChange`);function xo(e){return T(`stopBluetoothDevicesDiscovery`,e)}function So(e){return T(`startBluetoothDevicesDiscovery`,e)}function Co(e){return T(`openBluetoothAdapter`,e)}function wo(e){return yo.on(e)}function To(e){return bo.on(e)}function Eo(e){return yo.off(e)}function Do(e){return bo.off(e)}function Oo(e){return _o(`getConnectedBluetoothDevices`,e,{transform:mo})}function ko(e){return _o(`getBluetoothDevices`,e,{transform:mo})}function Ao(e){return T(`getBluetoothAdapterState`,e)}function jo(e){return T(`closeBluetoothAdapter`,e)}function Mo(e){return T(`isBluetoothDevicePaired`,e)}function No(e){return T(`makeBluetoothPair`,e)}var Po=t({closeBLEConnection:()=>Xo,createBLEConnection:()=>Yo,getBLEDeviceCharacteristics:()=>Jo,getBLEDeviceRSSI:()=>qo,getBLEDeviceServices:()=>Ko,getBLEMTU:()=>Zo,notifyBLECharacteristicValueChange:()=>Go,offBLECharacteristicValueChange:()=>Wo,offBLEConnectionStateChange:()=>Uo,offBLEMTUChange:()=>$o,onBLECharacteristicValueChange:()=>Ho,onBLEConnectionStateChange:()=>Vo,onBLEMTUChange:()=>Qo,readBLECharacteristicValue:()=>Bo,setBLEMTU:()=>zo,writeBLECharacteristicValue:()=>Ro}),Fo=K(`onBLEConnectionStateChange`,`offBLEConnectionStateChange`),Io=K(`onBLECharacteristicValueChange`,`offBLECharacteristicValueChange`,ho),Lo=K(`onBLEMTUChange`,`offBLEMTUChange`);function Ro(e){return _o(`writeBLECharacteristicValue`,e,{prepare(e){return e&&typeof e==`object`?{...e,value:uo(e.value)}:e}})}function zo(e){return T(`setBLEMTU`,e)}function Bo(e){return T(`readBLECharacteristicValue`,e)}function Vo(e){return Fo.on(e)}function Ho(e){return Io.on(e)}function Uo(e){return Fo.off(e)}function Wo(e){return Io.off(e)}function Go(e){return T(`notifyBLECharacteristicValueChange`,e)}function Ko(e){return T(`getBLEDeviceServices`,e)}function qo(e){return T(`getBLEDeviceRSSI`,e)}function Jo(e){return T(`getBLEDeviceCharacteristics`,e)}function Yo(e){return T(`createBLEConnection`,e)}function Xo(e){return T(`closeBLEConnection`,e)}function Zo(e){return T(`getBLEMTU`,e)}function Qo(e){return Lo.on(e)}function $o(e){return Lo.off(e)}var es=t({addPhoneCalendar:()=>ts});function ts(e){return T(`addPhoneCalendar`,e)}var ns=t({getClipboardData:()=>is,setClipboardData:()=>rs});function rs(e){return T(`setClipboardData`,e)}function is(e){return T(`getClipboardData`,e)}var as=t({addPhoneContact:()=>ss,chooseContact:()=>os});function os(e){return T(`chooseContact`,e)}function ss(e){return T(`addPhoneContact`,e)}var cs=t({hideKeyboard:()=>ls});function ls(e){return T(`hideKeyboard`,e)}var us=t({offMemoryWarning:()=>fs,onMemoryWarning:()=>ds});function ds(e){return T(`onMemoryWarning`,e)}function fs(e){return T(`offMemoryWarning`,e)}var ps=t({getNetworkType:()=>ms});function ms(e){return T(`getNetworkType`,e)}var hs=t({makePhoneCall:()=>gs});function gs(e){return T(`makePhoneCall`,e)}var _s=t({scanCode:()=>vs});function vs(e){return T(`scanCode`,e)}var ys=t({offUserCaptureScreen:()=>Ss,onUserCaptureScreen:()=>xs}),bs=K(`onUserCaptureScreen`,`offUserCaptureScreen`),q;function xs(e){if(typeof e==`function`)return q&&q!==e&&bs.off(q),q=e,bs.on(e)}function Ss(e){if(typeof e!=`function`||e===q)return q=void 0,bs.off(e)}var Cs=t({vibrateLong:()=>Ts,vibrateShort:()=>ws});function ws(e){return T(`vibrateShort`,e)}function Ts(e){return T(`vibrateLong`,e)}var Es=t({__hostEventTestHooks:()=>Ks,offHostEvent:()=>Gs,offHostTest:()=>Us,onHostEvent:()=>Ws,onHostTest:()=>Hs}),Ds=`nativeEvent`,Os=`onHostTest`,ks=`hostCallResult`,As=/^onHost[A-Z][A-Za-z0-9_]{0,63}$/,js=new Map,Ms=new Map;function J(e){return e||C.getPageInfo()?.id||``}function Ns(e,t){return`${e}::${J(t)}`}function Ps(e){return typeof e==`string`&&As.test(e)}function Fs(e){return e===void 0?{}:e}function Is(e,t){return!e||typeof e[t]!=`function`?null:{handler:e[t].bind(e),legacy:t===Os}}function Ls(e){return!e||typeof e.onHostEvent!=`function`?null:{handler:e.onHostEvent.bind(e),legacy:!1}}function Rs(e,t){return Is(e,t)||Ls(e)}function zs(e={},t){return Rs(Object.values(e).find(e=>typeof e?.[t]==`function`||typeof e?.onHostEvent==`function`),t)}function Bs(e,t){let n=C.getPageInfo?.()||{},r=[J(t),J(n.id)].filter(Boolean);for(let t of r){let n=B.getPageInstance?.(t),r=Rs(n,e);if(r)return r;let i=zs(B.instances?.[t],e);if(i)return i}let i=n.route;if(!i||!B.instances)return null;for(let t of Object.values(B.instances)){let n=Rs(Object.values(t||{}).find(t=>t&&t.route===i&&(typeof t[e]==`function`||typeof t.onHostEvent==`function`)),e);if(n)return n}return null}function Vs({bridgeId:e,requestId:t,success:n,data:r,errMsg:i}){w.send({type:ks,target:`service`,body:{bridgeId:e,requestId:t,success:n,data:r,errMsg:i}})}w.on(Ds,async(e={})=>{let t=e.event;if(!Ps(t))return;let n=J(e.bridgeId),r=e.requestId||``,i=e.payload??e.data??{},a=Ns(t,n);Ms.set(a,i);let o=Bs(t,n),s=js.get(a),c=o||(s?{handler:s,legacy:t===Os}:null);if(!c){Vs({bridgeId:n,requestId:r,success:!1,errMsg:`${t}:fail handler not registered`});return}try{Vs({bridgeId:n,requestId:r,success:!0,data:Fs(c.legacy?await c.handler(i):await c.handler(i,{event:t,bridgeId:n,requestId:r}))})}catch(e){Vs({bridgeId:n,requestId:r,success:!1,errMsg:e?.message||String(e)||`${t}:fail`})}});function Hs(e){Ws(Os,e,{legacy:!0})}function Us(){Gs(Os)}function Ws(e,t,n={}){if(!Ps(e)){console.error(`[onHostEvent]: event must match /^onHost[A-Z][A-Za-z0-9_]{0,63}$/`);return}if(typeof t!=`function`){console.error(`[onHostEvent]: handler must be a function`);return}let r=Ns(e);js.set(r,t),Ms.has(r)&&Promise.resolve().then(()=>{n.legacy?t(Ms.get(r)):t(Ms.get(r),{event:e,bridgeId:J(),requestId:``})})}function Gs(e){Ps(e)&&js.delete(Ns(e))}var Ks={HOST_EVENT_TYPE:Ds,HOST_TEST_EVENT:Os,HOST_TEST_RESULT_EVENT:ks,hostEventHandlers:js,hostEventLastPayloads:Ms,scopeKey:J,hostEventKey:Ns,isControlledHostEvent:Ps},qs=t({getLocation:()=>Js,offLocationChange:()=>$s,onLocationChange:()=>Qs,openLocation:()=>Xs,startLocationUpdate:()=>Ys,stopLocationUpdate:()=>Zs});function Js(e){return T(`getLocation`,e)}function Ys(e){return T(`startLocationUpdate`,e)}function Xs(e){return T(`openLocation`,e)}function Zs(e){return T(`stopLocationUpdate`,e)}function Qs(e){e&&T(`onLocationChange`,{success:x.store(e,!0)})}function $s(e){if(e){let t=x.store(e,!0);T(`offLocationChange`,{success:t}),x.remove(t)}else T(`offLocationChange`),x.remove()}var ec=t({createMapContext:()=>tc});function tc(e,t){return new nc({mapId:e,obj:t})}var nc=class{constructor(e){this.opts=e}invoke(e,t={}){return T(`mapContext`,{...t,id:this.opts.mapId,mapId:this.opts.mapId,command:e},`render`)}addMarkers(e){return this.invoke(`addMarkers`,e)}removeMarkers(e){return this.invoke(`removeMarkers`,e)}includePoints(e){return this.invoke(`includePoints`,e)}setCenterOffset(e){return this.invoke(`setCenterOffset`,e)}getCenterLocation(e){return this.invoke(`getCenterLocation`,e)}getScale(e){return this.invoke(`getScale`,e)}moveToLocation(e){return this.invoke(`moveToLocation`,e)}translateMarker(e){return this.invoke(`translateMarker`,e)}addArc(e){return this.invoke(`addArc`,e)}removeArc(e){return this.invoke(`removeArc`,e)}},rc=t({createAudioContext:()=>ic,getBackgroundAudioPlayerState:()=>lc,pauseBackgroundAudio:()=>oc,playBackgroundAudio:()=>ac,seekBackgroundAudio:()=>cc,stopBackgroundAudio:()=>sc});function ic(e,t){return new uc({audioId:e,obj:t})}function ac(e={}){return T(`playBackgroundAudio`,e)}function oc(e={}){return T(`pauseBackgroundAudio`,e)}function sc(e={}){return T(`stopBackgroundAudio`,e)}function cc(e={}){return T(`seekBackgroundAudio`,e)}function lc(e={}){return T(`getBackgroundAudioPlayerState`,e)}var uc=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})}invoke(e,t={}){T(`audioContext`,{type:`native/audio`,id:this.opts.audioId,command:e,...t},`render`)}},dc=t({chooseImage:()=>hc,compressImage:()=>mc,previewImage:()=>pc,saveImageToPhotosAlbum:()=>fc});function fc(e){return T(`saveImageToPhotosAlbum`,e)}function pc(e){return T(`previewImage`,e)}function mc(e){return T(`compressImage`,e)}function hc(e){return T(`chooseImage`,e)}var gc=t({chooseMedia:()=>yc,chooseVideo:()=>vc,createVideoContext:()=>_c,saveVideoToPhotosAlbum:()=>bc});function _c(e,t){return new xc({videoId:e,obj:t})}function vc(e){return T(`chooseVideo`,e)}function yc(e){return T(`chooseMedia`,e)}function bc(e){return T(`saveVideoToPhotosAlbum`,e)}var xc=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})}sendDanmu(e={}){this.invoke(`sendDanmu`,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={}){T(`videoContext`,{type:`native/video`,id:this.opts.videoId,command:e,...t},`render`)}},Sc=t({exitMiniProgram:()=>Ec,navigateBackMiniProgram:()=>Tc,navigateToMiniProgram:()=>wc,restartMiniProgram:()=>Cc});function Cc(e){return T(`restartMiniProgram`,e)}function wc(e){return T(`navigateToMiniProgram`,e)}function Tc(e){return T(`navigateBackMiniProgram`,e)}function Ec(e){return T(`exitMiniProgram`,e)}function Dc(e){let t=`${e}_${Date.now()}_${Math.random().toString(36).slice(2,10)}`,r=new Map,i=new Map;function a(e,r,i){if(!n(i))return;let a=x.store(i,!0);r.set(i,a),T(e,{taskId:t,callback:a})}function o(e,r,i){if(n(i)){let n=r.get(i);if(!n)return;r.delete(i),x.remove(n),T(e,{taskId:t,callback:n});return}r.forEach(e=>x.remove(e)),r.clear(),T(e,{taskId:t})}return{taskId:t,abort(){T(`${e}Abort`,{taskId:t})},onProgressUpdate(t){a(`${e}OnProgressUpdate`,r,t)},offProgressUpdate(t){o(`${e}OffProgressUpdate`,r,t)},onHeadersReceived(t){a(`${e}OnHeadersReceived`,i,t)},offHeadersReceived(t){o(`${e}OffHeadersReceived`,i,t)}}}var Oc=t({downloadFile:()=>kc});function kc(e){let t=Dc(`downloadFile`);return T(`downloadFile`,{...Dr(`downloadFile`,e).wrapOptions(e),taskId:t.taskId}),t}var Ac=`__diminaArrayBufferBase64`,Y=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,jc=Object.fromEntries([...Y].map((e,t)=>[e,t]));function Mc(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function Nc(e){return Mc(e)?e:e&&Mc(e.buffer)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function Pc(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=Y[t[r]>>2],n+=Y[(t[r]&3)<<4|t[r+1]>>4],n+=Y[(t[r+1]&15)<<2|t[r+2]>>6],n+=Y[t[r+2]&63];return r<t.length&&(n+=Y[t[r]>>2],r+1<t.length?(n+=Y[(t[r]&3)<<4|t[r+1]>>4],n+=`${Y[(t[r+1]&15)<<2]}=`):n+=`${Y[(t[r]&3)<<4]}==`),n}function Fc(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=jc[t[e]],o=jc[t[e+1]],s=t[e+2]===`=`?0:jc[t[e+2]],c=t[e+3]===`=`?0:jc[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function Ic(e){let t=Nc(e);return t?{[Ac]:Pc(t)}:e}function Lc(e){if(!e||typeof e!=`object`)return e;let t=e.message;return!t||typeof t!=`object`||t.__diminaArrayBufferBase64===void 0?e:{...e,message:Fc(t[Ac])}}function Rc(e){return`${e}_${Date.now()}_${Math.random().toString(36).slice(2,11)}`}function X(e,t,n={}){return T(e,{socketId:t,...n,keep:!0})}function Z(e,t,n={},r=e=>e){let i=new Set,a,o;function s(){if(!a)return;let e=a;a=void 0,x.remove(e),T(t,{...n,callbackId:e,keep:!0})}return{on(t){if(!(typeof t!=`function`||i.has(t))&&(i.add(t),!a))return a=x.store(e=>{let t=r(e);for(let e of[...i])e(t);o?.()},!0),T(e,{...n,callbackId:a,success:a,keep:!0})},off(e){if(typeof e==`function`?i.delete(e):i.clear(),i.size===0)return s()},dispose({notifyNative:e=!1}={}){if(i.clear(),e)return s();a&&x.remove(a),a=void 0},hasListeners(){return i.size>0},setAfterEmit(e){o=e}}}var zc=t({offLocalServiceDiscoveryStop:()=>qc,offLocalServiceFound:()=>Yc,offLocalServiceLost:()=>Zc,offLocalServiceResolveFail:()=>$c,onLocalServiceDiscoveryStop:()=>Kc,onLocalServiceFound:()=>Jc,onLocalServiceLost:()=>Xc,onLocalServiceResolveFail:()=>Qc,startLocalServiceDiscovery:()=>Wc,stopLocalServiceDiscovery:()=>Gc}),Bc=Z(`onLocalServiceDiscoveryStop`,`offLocalServiceDiscoveryStop`),Vc=Z(`onLocalServiceFound`,`offLocalServiceFound`),Hc=Z(`onLocalServiceLost`,`offLocalServiceLost`),Uc=Z(`onLocalServiceResolveFail`,`offLocalServiceResolveFail`);function Wc(e={}){return T(`startLocalServiceDiscovery`,e)}function Gc(e={}){return T(`stopLocalServiceDiscovery`,e)}function Kc(e){return Bc.on(e)}function qc(e){return Bc.off(e)}function Jc(e){return Vc.on(e)}function Yc(e){return Vc.off(e)}function Xc(e){return Hc.on(e)}function Zc(e){return Hc.off(e)}function Qc(e){return Uc.on(e)}function $c(e){return Uc.off(e)}var el=t({request:()=>tl});function tl(e){return T(`request`,Dr(`request`,e).wrapOptions(e))}var nl=t({createTCPSocket:()=>il}),rl=class{constructor(e){this.socketId=e,this.events={bindWifi:Z(`TCPSocket.onBindWifi`,`TCPSocket.offBindWifi`,{socketId:e}),close:Z(`TCPSocket.onClose`,`TCPSocket.offClose`,{socketId:e}),connect:Z(`TCPSocket.onConnect`,`TCPSocket.offConnect`,{socketId:e}),error:Z(`TCPSocket.onError`,`TCPSocket.offError`,{socketId:e}),message:Z(`TCPSocket.onMessage`,`TCPSocket.offMessage`,{socketId:e},Lc)},this.events.close.setAfterEmit(()=>{for(let e of Object.values(this.events))e.dispose()})}bindWifi(e={}){return X(`TCPSocket.bindWifi`,this.socketId,e)}close(){let e=X(`TCPSocket.close`,this.socketId);for(let[e,t]of Object.entries(this.events))(e!==`close`||!t.hasListeners())&&t.dispose();return e}connect(e={}){return X(`TCPSocket.connect`,this.socketId,e)}write(e){return X(`TCPSocket.write`,this.socketId,{data:Ic(e)})}onBindWifi(e){return this.events.bindWifi.on(e)}offBindWifi(e){return this.events.bindWifi.off(e)}onClose(e){return this.events.close.on(e)}offClose(e){return this.events.close.off(e)}onConnect(e){return this.events.connect.on(e)}offConnect(e){return this.events.connect.off(e)}onError(e){return this.events.error.on(e)}offError(e){return this.events.error.off(e)}onMessage(e){return this.events.message.on(e)}offMessage(e){return this.events.message.off(e)}};function il(){return new rl(Rc(`tcp`))}var al=t({createUDPSocket:()=>sl}),ol=class{constructor(e){this.socketId=e,this.events={close:Z(`UDPSocket.onClose`,`UDPSocket.offClose`,{socketId:e}),error:Z(`UDPSocket.onError`,`UDPSocket.offError`,{socketId:e}),listening:Z(`UDPSocket.onListening`,`UDPSocket.offListening`,{socketId:e}),message:Z(`UDPSocket.onMessage`,`UDPSocket.offMessage`,{socketId:e},Lc)},this.events.close.setAfterEmit(()=>{for(let e of Object.values(this.events))e.dispose()})}bind(e=0){return X(`UDPSocket.bind`,this.socketId,{port:e})}close(){let e=X(`UDPSocket.close`,this.socketId);for(let[e,t]of Object.entries(this.events))(e!==`close`||!t.hasListeners())&&t.dispose();return e}connect(e={}){return X(`UDPSocket.connect`,this.socketId,e)}send(e={}){return this.sendWithName(`UDPSocket.send`,e)}write(e={}){return this.sendWithName(`UDPSocket.write`,e)}setTTL(e){return X(`UDPSocket.setTTL`,this.socketId,{ttl:e})}onClose(e){return this.events.close.on(e)}offClose(e){return this.events.close.off(e)}onError(e){return this.events.error.on(e)}offError(e){return this.events.error.off(e)}onListening(e){return this.events.listening.on(e)}offListening(e){return this.events.listening.off(e)}onMessage(e){return this.events.message.on(e)}offMessage(e){return this.events.message.off(e)}sendWithName(e,t){return X(e,this.socketId,{...t,message:Ic(t.message)})}};function sl(){return new ol(Rc(`udp`))}var cl=t({uploadFile:()=>ll});function ll(e){let t=Dc(`uploadFile`);return T(`uploadFile`,{...Dr(`uploadFile`,e).wrapOptions(e),taskId:t.taskId}),t}var ul=t({closeSocket:()=>ml,connectSocket:()=>fl,offSocketClose:()=>Sl,offSocketError:()=>bl,offSocketMessage:()=>vl,offSocketOpen:()=>gl,onSocketClose:()=>xl,onSocketError:()=>yl,onSocketMessage:()=>_l,onSocketOpen:()=>hl,sendSocketMessage:()=>pl});function Q(e,t,r={}){let i=new Map;return{on(t){if(!n(t)||i.has(t))return;let a=x.store(e=>t(e),!0);i.set(t,a);try{return T(e,{...r,callback:a,keep:!0})}catch(e){throw i.delete(t),x.remove(a),e}},off(e){if(n(e)){let n=i.get(e);return n?(i.delete(e),x.remove(n),T(t,{...r,callback:n,keep:!0})):void 0}for(let e of i.values())x.remove(e);return i.clear(),T(t,{...r,keep:!0})}}}var dl=class{constructor(e){this.socketId=e,this._readyState=0,this._events={open:Q(`onSocketOpen`,`offSocketOpen`,{socketId:e}),message:Q(`onSocketMessage`,`offSocketMessage`,{socketId:e}),error:Q(`onSocketError`,`offSocketError`,{socketId:e}),close:Q(`onSocketClose`,`offSocketClose`,{socketId:e})}}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=x.store(r)),n(i)&&(s.fail=x.store(i)),n(a)&&(s.complete=x.store(a)),T(`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=x.store(i)),n(a)&&(c.fail=x.store(a)),n(o)&&(c.complete=x.store(o)),T(`closeSocket`,c)}onOpen(e){return this._events.open.on(e)}offOpen(e){return this._events.open.off(e)}onMessage(e){return this._events.message.on(e)}offMessage(e){return this._events.message.off(e)}onError(e){return this._events.error.on(e)}offError(e){return this._events.error.off(e)}onClose(e){return this._events.close.on(e)}offClose(e){return this._events.close.off(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}},$={open:Q(`onSocketOpen`,`offSocketOpen`),message:Q(`onSocketMessage`,`offSocketMessage`),error:Q(`onSocketError`,`offSocketError`),close:Q(`onSocketClose`,`offSocketClose`)};function fl(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,...f}=e;if(!t){let e=Error(`url is required`);throw n(u)&&u(e),n(d)&&d(e),e}let p=`socket_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,m=new dl(p),h={socketId:p,url:t,header:r,protocols:i,tcpNoDelay:a,perMessageDeflate:o,timeout:s,forceCellularNetwork:c,...f};return n(l)&&(h.success=x.store(e=>{m._readyState=dl.OPEN,l(e)})),n(u)&&(h.fail=x.store(e=>{m._readyState=dl.CLOSED,u(e)})),n(d)&&(h.complete=x.store(d)),T(`connectSocket`,h),m}function pl(e){return T(`sendSocketMessage`,e)}function ml(e){return T(`closeSocket`,e)}function hl(e){return $.open.on(e)}function gl(e){return $.open.off(e)}function _l(e){return $.message.on(e)}function vl(e){return $.message.off(e)}function yl(e){return $.error.on(e)}function bl(e){return $.error.off(e)}function xl(e){return $.close.on(e)}function Sl(e){return $.close.off(e)}var Cl=t({getAccountInfoSync:()=>wl});function wl(){return T(`getAccountInfoSync`)}var Tl=t({getAuthList:()=>El});function El(e){let t={event:`obtainServerAuthScope`,data:{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),V(t)}var Dl=t({getAuthCode:()=>Ol});function Ol(e){return T(`getAuthCode`,e||{})}var kl=t({authorize:()=>Al});function Al(e){return T(`authorize`,e)}var jl=t({getEmail:()=>Ml});function Ml(e){return T(`getEmail`,e)}var Nl=t({generateQRCode:()=>Pl});function Pl(e){return T(`generateQRCode`,e)}var Fl=t({getHostAppConfig:()=>Il});function Il(e){let t={event:`getHostAppConfig`,data:e||{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),V(t)}var Ll=t({getHostFontSize:()=>Rl});function Rl(e){let t={event:`zoomFontSize`,data:{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),V(t)}var zl=t({getHostLanguage:()=>Bl});function Bl(e){let t={event:`obtainLanguageTag`,data:{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),V(t)}var Vl=t({getUserProfile:()=>Hl});function Hl(e){let t={event:`getUserProfile`,data:e||{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),V(t)}var Ul=t({getPhoneNumber:()=>Wl});function Wl(e){return T(`getPhoneNumber`,e)}var Gl=t({authorize:()=>Al,captureScreen:()=>ni,generateQRCode:()=>Pl,getAuthCode:()=>Ol,getAuthList:()=>El,getEmail:()=>Ml,getHostAppConfig:()=>Il,getHostFontSize:()=>Rl,getHostLanguage:()=>Bl,getPhoneNumber:()=>Wl,getUserProfile:()=>Hl,login:()=>Kl});function Kl(e){return T(`login`,e)}var ql=t({login:()=>Jl});function Jl(e){return T(`login`,e)}var Yl=t({getPrivacySetting:()=>Xl,requirePrivacyAuthorize:()=>Zl});function Xl(e){return T(`getPrivacySetting`,e)}function Zl(e){return T(`requirePrivacyAuthorize`,e)}var Ql=t({getSetting:()=>eu,openSetting:()=>$l});function $l(e){return T(`openSetting`,e)}function eu(e){return T(`getSetting`,e)}var tu=t({getUserInfo:()=>nu});function nu(e){return T(`getUserInfo`,e)}var ru=t({requestPayment:()=>iu});function iu(e){return T(`requestPayment`,e)}var au=t({createAnimation:()=>ou});function ou(e={}){return new su(e)}var su=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`,v(e)]}),this}height(e){return this.currentStepAnimates.push({type:`style`,args:[`height`,v(e)]}),this}left(e){return this.currentStepAnimates.push({type:`style`,args:[`left`,v(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,h=1){return this.currentStepAnimates.push({type:`matrix3d`,args:[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}),this}opacity(e){return this.currentStepAnimates.push({type:`style`,args:[`opacity`,e]}),this}right(e){return this.currentStepAnimates.push({type:`style`,args:[`right`,v(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`,v(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`,v(e)]}),this}},cu=t({setBackgroundColor:()=>uu,setBackgroundTextStyle:()=>lu});function lu(e){return T(`setBackgroundTextStyle`,e)}function uu(e){return T(`setBackgroundColor`,e)}var du=t({canvasToTempFilePath:()=>hu,createCanvasContext:()=>pu,createContext:()=>fu,createOffscreenCanvas:()=>Ft,drawCanvas:()=>mu});function fu(){return new _u}function pu(e,t){return new _u(e,gu(t))}function mu(e={}){let t={...e,moduleId:e.moduleId||gu(e.component)};delete t.component,T(`drawCanvas`,t,`render`)}function hu(e={},t){let n={...e,moduleId:e.moduleId||gu(t||e.component)};return delete n.component,T(`canvasToTempFilePath`,n,`render`)}function gu(e){return e?.__id__||C.getPageInfo()?.id}var _u=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&&(mu({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)}},vu=t({nextTick:()=>Su}),yu=[],bu=null;function xu(){let e=yu;yu=[],bu=null;for(let t=0;t<e.length;t++)e[t]()}function Su(e){n(e)&&(yu.push(e),bu||=setTimeout(xu,0))}var Cu=t({disableAlertBeforeUnload:()=>ju,enableAlertBeforeUnload:()=>Au,hideLoading:()=>ku,hideToast:()=>Tu,showActionSheet:()=>Ou,showLoading:()=>Du,showModal:()=>Eu,showToast:()=>wu});function wu(e){return T(`showToast`,e)}function Tu(e){return T(`hideToast`,e)}function Eu(e){return T(`showModal`,e)}function Du(e){return T(`showLoading`,e)}function Ou(e){return T(`showActionSheet`,e)}function ku(e){return T(`hideLoading`,e)}function Au(e){return T(`enableAlertBeforeUnload`,e)}function ju(e){return T(`disableAlertBeforeUnload`,e)}var Mu=t({getMenuButtonBoundingClientRect:()=>Pu,offMenuButtonBoundingClientRectWeightChange:()=>Iu,onMenuButtonBoundingClientRectWeightChange:()=>Fu}),Nu=new Set;S.onUpdate(e=>{e.menuRect&&Nu.forEach(t=>t(e.menuRect))});function Pu(){return T(`getMenuButtonBoundingClientRect`)}function Fu(e){n(e)&&Nu.add(e)}function Iu(e){n(e)?Nu.delete(e):Nu.clear()}var Lu=t({hideHomeButton:()=>Hu,hideNavigationBarLoading:()=>Vu,setNavigationBarColor:()=>Bu,setNavigationBarTitle:()=>zu,showNavigationBarLoading:()=>Ru});function Ru(e){return T(`showNavigationBarLoading`,e)}function zu(e){return T(`setNavigationBarTitle`,e)}function Bu(e){return T(`setNavigationBarColor`,e)}function Vu(e){return T(`hideNavigationBarLoading`,e)}function Hu(e){return T(`hideHomeButton`,e)}var Uu=t({startPullDownRefresh:()=>Gu,stopPullDownRefresh:()=>Wu});function Wu(e){return T(`stopPullDownRefresh`,e)}function Gu(e){return T(`startPullDownRefresh`,e)}var Ku=t({pageScrollTo:()=>qu});function qu(e){return T(`pageScrollTo`,e)}var Ju=t({hideTabBar:()=>Qu,hideTabBarRedDot:()=>nd,removeTabBarBadge:()=>ed,setTabBarBadge:()=>$u,setTabBarItem:()=>Xu,setTabBarStyle:()=>Yu,showTabBar:()=>Zu,showTabBarRedDot:()=>td});function Yu(e){return T(`setTabBarStyle`,e)}function Xu(e){return T(`setTabBarItem`,e)}function Zu(e){return T(`showTabBar`,e)}function Qu(e){return T(`hideTabBar`,e)}function $u(e){return T(`setTabBarBadge`,e)}function ed(e){return T(`removeTabBarBadge`,e)}function td(e){return T(`showTabBarRedDot`,e)}function nd(e){return T(`hideTabBarRedDot`,e)}var rd=t({onWindowResize:()=>id});function id(e){e&&T(`onWindowResize`,{success:e})}var ad=Object.assign({"./core/analytics/index.js":Mi,"./core/base/app-event/index.js":Jn,"./core/base/index.js":ba,"./core/base/performance/index.js":Ea,"./core/base/screen/index.js":ja,"./core/base/subpackage/index.js":Va,"./core/base/system/index.js":Lr,"./core/base/theme/index.js":Ce,"./core/base/update/index.js":Wa,"./core/camera/index.js":Qa,"./core/data-analysis/index.js":to,"./core/device/bluetooth/index.js":vo,"./core/device/bluetooth-ble/index.js":Po,"./core/device/calendar/index.js":es,"./core/device/clipboard/index.js":ns,"./core/device/contact/index.js":as,"./core/device/keyboard/index.js":cs,"./core/device/memory/index.js":us,"./core/device/network/index.js":ps,"./core/device/phone/index.js":hs,"./core/device/scan/index.js":_s,"./core/device/screen/index.js":ys,"./core/device/vibrate/index.js":Cs,"./core/ext/index.js":Xr,"./core/file/index.js":Hi,"./core/host-event/index.js":Es,"./core/life-cycle/index.js":Pr,"./core/location/index.js":qs,"./core/map/index.js":ec,"./core/media/audio/index.js":rc,"./core/media/image/index.js":dc,"./core/media/video/index.js":gc,"./core/navigate/index.js":Sc,"./core/network/download/index.js":Oc,"./core/network/mdns/index.js":zc,"./core/network/request/index.js":el,"./core/network/tcp/index.js":nl,"./core/network/udp/index.js":al,"./core/network/upload/index.js":cl,"./core/network/websocket/index.js":ul,"./core/open-api/account-info/index.js":Cl,"./core/open-api/auth-list/index.js":Tl,"./core/open-api/auth-scope/index.js":Dl,"./core/open-api/authorize/index.js":kl,"./core/open-api/capture-screen/index.js":ti,"./core/open-api/email/index.js":jl,"./core/open-api/generate-qrcode/index.js":Nl,"./core/open-api/get-host-app-config/index.js":Fl,"./core/open-api/get-host-font-size/index.js":Ll,"./core/open-api/get-host-language/index.js":zl,"./core/open-api/get-user-profile/index.js":Vl,"./core/open-api/index.js":Gl,"./core/open-api/login/index.js":ql,"./core/open-api/phone-number/index.js":Ul,"./core/open-api/privacy/index.js":Yl,"./core/open-api/setting/index.js":Ql,"./core/open-api/user-info/index.js":tu,"./core/payment/index.js":ru,"./core/route/index.js":Ye,"./core/share/index.js":ii,"./core/storage/index.js":gi,"./core/ui/animation/index.js":au,"./core/ui/background/index.js":cu,"./core/ui/canvas/index.js":du,"./core/ui/custom-component/index.js":vu,"./core/ui/interaction/index.js":Cu,"./core/ui/menu/index.js":Mu,"./core/ui/navigation-bar/index.js":Lu,"./core/ui/pull-down-refresh/index.js":Uu,"./core/ui/scroll/index.js":Ku,"./core/ui/tab-bar/index.js":Ju,"./core/ui/window/index.js":rd,"./core/wxml/intersection-observer/index.js":Ut,"./core/wxml/media-query-observer/index.js":Kt,"./core/wxml/selector-query/index.js":It}),od={};for(let e of Object.values(ad))for(let[t,n]of Object.entries(e))od[t]=n;function sd(e){va(e);for(let t of e||[])typeof t!=`string`||Object.prototype.hasOwnProperty.call(od,t)||t in Object.prototype||Object.defineProperty(od,t,{value:(...e)=>T(t,...e),writable:!0,enumerable:!0,configurable:!0})}var cd=new Proxy(od,{get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`||r!==void 0||t===`webpackJsonp`?r:(...e)=>T(t,...e)},set(e,t,n,r){return Reflect.set(e,t,n,r)}}),ld=new class{constructor(){this.init()}init(){let e=globalThis.__diminaApiNamespaces||[],t=globalThis.__diminaRegisteredApis||[];if(globalThis.name)try{let n=JSON.parse(globalThis.name);e.length===0&&(e=n.apiNamespaces||[]),t.length===0&&(t=n.registeredApis||[])}catch{}sd(t);for(let t of[`dd`,`wx`,...e])globalThis[t]=cd;globalThis.modRequire=b,globalThis.modDefine=ae,globalThis.modHotUpdate=oe,globalThis.global={},globalThis.App=(e={})=>{z.createAppModule(e),B.createApp()},globalThis.Page=e=>{(globalThis.__diminaHotUpdating?z.hotUpdateModule.bind(z):z.createModule.bind(z))(e,globalThis.__extraInfo,I.type)},globalThis.Component=e=>{(globalThis.__diminaHotUpdating?z.hotUpdateModule.bind(z):z.createModule.bind(z))(e,globalThis.__extraInfo,P.type)},globalThis.Behavior=e=>e,globalThis.getApp=e=>B.getApp(e),globalThis.getCurrentPages=()=>C.stack()}},ud={navigateBack:et,navigateTo:$e,reLaunch:Ze,redirectTo:Qe,switchTab:Xe};return new class{constructor(){this.env=ld,this.message=w,this.init()}init(){this.message.on(`loadResource`,e=>{let{appId:t,bridgeId:n,pagePath:r,root:i=`.`,baseUrl:a=`/`,hostEnv:o,query:s,resourceLoadId:c,scene:l}=e;o&&(S.init(o),xi(S.getStorageSnapshot())),B.setAppLaunchOptions({scene:l,pagePath:r,query:s}),z.loadResource({appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a,resourceLoadId:c})}),this.message.on(`hostEnvChanged`,e=>{if(e.hostEnv){let t=S.getSystemInfo()?.theme;S.update(e.hostEnv),Object.prototype.hasOwnProperty.call(e.hostEnv,`storageSnapshot`)&&xi(S.getStorageSnapshot());let n=S.getSystemInfo()?.theme;t&&n&&t!==n&&De(n)}}),this.message.on(`hotUpdateLogic`,e=>{z.hotUpdateResource(e),B.hotUpdateLogic(e)}),this.message.on(`hostEnvUpdate`,e=>{S.update(e)}),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 B.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;x.invoke(t,n)}),this.message.on(`componentInvokeAPI`,e=>{let{apiName:t,bridgeId:n,callbacks:r={},params:i={}}=e,a,o,s=(e,t)=>{e&&this.message.send({type:`triggerCallback`,target:`render`,body:{bridgeId:n,data:t,success:e}})};r.success&&(a=x.store(e=>s(r.success,e))),r.fail&&(o=x.store(e=>s(r.fail,e)));let c=x.store(e=>{s(r.complete,e),x.remove(a),x.remove(o)});this.message.invoke({type:`invokeAPI`,target:`container`,body:{name:t,bridgeId:n,params:{...i,complete:c,fail:o,success:a}}})}),this.message.on(`resourceLoadFailed`,({bridgeId:e,pagePath:t,errors:n=[]})=>{console.error(`[service] resourceLoadFailed: bridgeId: ${e}, pagePath: ${t}, errors: ${n.join(`; `)}`)}),this.onAppMsg(),this.onModuleMsg()}onAppMsg(){this.message.on(`resourceLoaded`,e=>{let{bridgeId:t,pagePath:n,query:r,stackId:i,resourceLoadId:a}=e,o=z.getModuleByPath(n);if(!o){console.error(`[service] resourceLoaded: module not found, pagePath: ${n}`);return}let s=z.getPropsByPath(o.usingComponents),c=`page_${p()}`;B.createInstance({bridgeId:t,moduleId:c,path:n,query:r,stackId:i,deferInitialData:!0}),w.send({type:`firstRender`,target:`render`,body:{bridgeId:t,pageId:c,pagePath:n,initialProps:s,query:r,resourceLoadId:a}})}),this.message.on(`pageInitialDataReady`,({bridgeId:e,moduleId:t})=>{let n=B.instances[e]?.[t];if(!n){console.warn(`[service] pageInitialDataReady: page not found, bridgeId: ${e}, moduleId: ${t}`);return}n.sendInitialData()}),this.message.on(`appShow`,()=>{B.appShow()}),this.message.on(`appHide`,()=>{B.appHide()}),this.message.on(`stackShow`,({stackId:e})=>{B.stackShow(e)}),this.message.on(`stackHide`,({stackId:e})=>{B.stackHide(e)})}onModuleMsg(){this.message.on(`mC`,e=>{B.createInstance(e)}),this.message.on(`mA`,e=>{B.moduleAttached(e)}),this.message.on(`mR`,e=>{B.moduleReady(e)}),this.message.on(`mU`,e=>{B.moduleUnmounted(e)}),this.message.on(`pageUnload`,e=>{B.pageUnload(e)}),this.message.on(`pageShow`,e=>{B.pageShow(e)}),this.message.on(`pageReady`,e=>{B.pageReady(e)}),this.message.on(`pageHide`,e=>{B.pageHide(e)}),this.message.on(`pagePullDownRefresh`,e=>{B.pagePullDownRefresh(e)}),this.message.on(`pageReachBottom`,e=>{B.pageReachBottom(e)}),this.message.on(`pageShareAppMessage`,async e=>{let t=await B.pageShareAppMessage(e);await ci(t),e?.success&&this.message.send({type:`triggerCallback`,target:`container`,body:{bridgeId:e.bridgeId,id:e.success,args:[t],data:t}})}),this.message.on(`pageScroll`,e=>{B.pageScroll(e)}),this.message.on(`pageResize`,e=>{B.pageResize(e)}),this.message.on(`onTabItemTap`,e=>{B.pageTabItemTap(e)}),this.message.on(`pageRouteDone`,e=>{let{bridgeId:t}=e;B.componentRouteDone({bridgeId:t})}),this.message.on(`componentError`,e=>{B.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 B.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}})}ud[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}y.async=async e=>new Promise((t,n)=>{try{t(y(e))}catch(t){n(Error(`${t.message}: Failed to initialize asynchronous loading for module '${e}'`))}});var b=new class{constructor(){this.callbacks={}}store(e,t,n=p()){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])}has(e){return!!(e&&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]})}},ce=`__dimina_data_function_reference__`,le=1;function ue(e){return{[ce]:e,version:le}}function de(e){return typeof e==`object`&&!!e&&e.version===le&&typeof e[ce]==`string`&&Object.keys(e).length===2}function fe(e){return de(e)?e[ce]:void 0}function pe(e,{mapFunction:t,mapReference:n}={},r=new WeakMap){if(typeof e==`function`)return t?t(e):e;if(typeof e!=`object`||!e)return e;if(de(e))return n?n(e):e;if(e instanceof Date||e instanceof RegExp||e instanceof ArrayBuffer||ArrayBuffer.isView(e))return e;if(!Array.isArray(e)){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e}if(r.has(e))return r.get(e);let i=Array.isArray(e)?[]:{};r.set(e,i);for(let a of Object.keys(e))i[a]=pe(e[a],{mapFunction:t,mapReference:n},r);return i}var me=new Set([String,Number,Boolean,Object,Array,null]);function he(e){return me.has(e)}function ge(e){return e===String?``:e===Number?0:e===Boolean?!1:e===Array?[]:null}function _e(e){return Array.isArray(e)?e.filter(he):[]}function ve(e){let t,n=[],r;return he(e)?t=e:e&&typeof e==`object`&&(t=e.type,n=_e(e.optionalTypes),r=e.value),he(t)||(t=n[0]??null),r===void 0&&(r=ge(t)),{type:t,optionalTypes:n,value:v(r)}}function ye(e){return Array.isArray(e)}function be(e){return ye(e)&&e?.constructor?.name===Array.name}function xe(e,t){return e===String?typeof t==`string`:e===Number?Number.isFinite(t):e===Boolean?typeof t==`boolean`:e===Object?t!==null&&t?.constructor===Object:e===Array?be(t):t!==void 0}function Se(e,t){typeof e==`function`&&e(t)}function Ce(e,t,{absent:n=!1,warn:r}={}){if(n)return v(e.value);for(let n of e.optionalTypes||[])if(xe(n,t))return t;let i=e.type;if(i===String)return t==null?(Se(r,`property received type-uncompatible value: expected <String> but get null value. Used empty string instead.`),``):(typeof t==`object`&&Se(r,`property received type-uncompatible value: expected <String> but got object-typed value. Forcely converted.`),String(t));if(i===Number){try{if(Number.isFinite(Number(t)))return Number(t)}catch{}return Se(r,`property received type-uncompatible value: expected <Number> but ${typeof t==`number`?`got NaN or Infinity`:`got non-number value`}. Used 0 instead.`),0}return i===Boolean?!!t:i===Array?ye(t)?t:(Se(r,`property received type-uncompatible value: expected <Array> but got non-array value. Used empty array instead.`),[]):i===Object?typeof t==`object`?t:(Se(r,`property received type-uncompatible value: expected <Object> but got non-object value. Used null instead.`),null):t===void 0?null:t}var we=t({__themeChangeTestHooks:()=>Ae,notifyThemeChange:()=>Oe,offThemeChange:()=>De,onThemeChange:()=>Ee}),Te=new Set;function Ee(e){n(e)&&Te.add(e)}function De(e){n(e)?Te.delete(e):Te.clear()}function Oe(e){let t=ke(e);if(t)for(let e of Array.from(Te))try{e({theme:t})}catch(e){console.error(`[service] onThemeChange callback error:`,e)}}function ke(e){return e===`dark`||e===`light`?e:``}var Ae={themeChangeCallbacks:Te,normalizeTheme:ke},x=new class{constructor(){this.listeners=new Set,this.reset()}reset(){this.active=!1,this.snapshot=je()}init(e={}){this.active=!0,this.snapshot={...je(),...e}}update(e={}){this.snapshot={...this.snapshot,...Me(this.snapshot,e)},this.listeners.forEach(t=>t(e,this.snapshot))}onUpdate(e){return this.listeners.add(e),()=>this.listeners.delete(e)}get(e){return this.active?this.snapshot[e]??null:null}getSystemInfo(){return this.get(`systemInfo`)}getHostCustom(){return this.get(`hostCustom`)??{}}getMenuRect(){return this.get(`menuRect`)}getDomainPolicy(){return this.get(`domainPolicy`)}getAnalyticsBaseContext(){return this.get(`analyticsBaseContext`)}getAnalyticsRemoteConfig(){return this.get(`analyticsRemoteConfig`)}getStorageSnapshot(){return this.get(`storageSnapshot`)??{}}};function je(){return{systemInfo:null,hostCustom:{},menuRect:null,domainPolicy:null,analyticsBaseContext:null,analyticsRemoteConfig:null,storageSnapshot:{}}}function Me(e,t){let n={...t};for(let r of[`systemInfo`,`hostCustom`,`menuRect`,`domainPolicy`,`analyticsBaseContext`,`analyticsRemoteConfig`,`vConsoleEnabled`])t[r]&&typeof t[r]==`object`&&!Array.isArray(t[r])&&e[r]&&typeof e[r]==`object`&&!Array.isArray(e[r])&&(n[r]={...e[r],...t[r]});return Object.prototype.hasOwnProperty.call(t,`storageSnapshot`)&&(n.storageSnapshot=t.storageSnapshot??{}),n}function Ne(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 S=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()}remove(e){for(let t=this.#e.length-1;t>=0;t--){let n=this.#e[t].pages,r=n.findIndex(t=>t.id===e);if(r!==-1){n.splice(r,1);return}}}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}{let e=this.#e[this.#e.length-1];return e?e.pages:this.pushStack(Date.now()).pages}}},Pe=new WeakMap,Fe=new Map;function Ie(e){let t=Pe.get(e);if(t)return Fe.set(t,e),t;let n;do n=`data-function-${p()}`;while(Fe.has(n));return Pe.set(e,n),Fe.set(n,e),n}function Le(e){return Fe.get(e)}function Re(e){return pe(e,{mapFunction(e){return ue(Ie(e))}})}function ze(e){return pe(e,{mapReference(e){return Le(fe(e))||e}})}var C=new class e{constructor(){this.event=Ne(),this.isForwardingConsole=!1,this.currentBridgeId=``,this.init(),this.installConsoleForwarder()}init(){ee?globalThis.onmessage=e=>{this.handleMsg(e.data)}:DiminaServiceBridge.onMessage=this.handleMsg.bind(this)}handleMsg(e){let t=ze(e);this.currentBridgeId=t?.body?.bridgeId||this.currentBridgeId;let{type:n,body:r}=t;this.event.emit(n,r)}installConsoleForwarder(){let e=globalThis.console;if(e.__diminaConsoleForwarderInstalled)return;Object.defineProperty(e,"__diminaConsoleForwarderInstalled",{value:!0,configurable:!0});let t=(e,t)=>{if(!this.isForwardingConsole)try{this.isForwardingConsole=!0,this.send({type:`print`,target:`render`,body:{bridgeId:this.currentBridgeId||S.getPageInfo().id,type:e,detail:t}})}catch{}finally{this.isForwardingConsole=!1}},n=e=>{if(e instanceof Error)return{__diminaConsoleType:`error`,name:e.name,message:e.message,stack:e.stack};if(e===void 0)return{__diminaConsoleType:`undefined`};if(typeof e==`function`)return{__diminaConsoleType:`function`,value:String(e)};try{return JSON.stringify(e),e}catch{return{__diminaConsoleType:`unserializable`,value:String(e)}}},r=e=>{let t=e[0];return typeof t==`string`&&(t.startsWith(`[service]`)||t.startsWith(`[system]`)||t===`system`)};[`log`,`info`,`warn`,`error`,`debug`,`trace`].forEach(i=>{let a=typeof e[i]==`function`?e[i].bind(e):null;a&&(e[i]=(...e)=>{a(...e),!r(e)&&t(i,{kind:`console`,method:i,args:e.map(n)})})});let i=typeof e.clear==`function`?e.clear.bind(e):null;i&&(e.clear=(...e)=>{i(...e),t(`clear`,{kind:`console-clear`})})}on(e,t){this.event.on(e,t)}off(e){this.event.off(e)}getBridgeId(){return this.currentBridgeId||S.getPageInfo().bridgeId||S.getPageInfo().id}send(t){return ee?e.prototype.send=function(e){let t=Re(e);t.method=`publish`,globalThis.postMessage(t)}:e.prototype.send=function(e){let t=Re(e);return DiminaServiceBridge.publish(t.body.bridgeId||``,t)},this.send(t)}invoke(t){return ee?e.prototype.invoke=function(e){e.method=`invoke`,globalThis.postMessage(e)}:e.prototype.invoke=function(e){return DiminaServiceBridge.invoke(e)},this.invoke(t)}};function Be(e,t){if(!e)return e;let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ve(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function He(e,t){return e&&{...e,hostCustom:Ve(t)}}var Ue={getWindowInfo:()=>Be(x.getSystemInfo(),[`pixelRatio`,`screenWidth`,`screenHeight`,`windowWidth`,`windowHeight`,`statusBarHeight`,`safeArea`,`screenTop`]),getSystemInfoSync:()=>He(x.getSystemInfo(),x.getHostCustom()),getAppBaseInfo:()=>{let e=x.getSystemInfo();return e&&{...Be(e,[`SDKVersion`,`enableDebug`,`host`,`language`,`version`,`theme`,`fontSizeScaleFactor`,`fontSizeSetting`]),hostCustom:Ve(x.getHostCustom())}},getDeviceInfo:()=>Be(x.getSystemInfo(),[`abi`,`benchmarkLevel`,`brand`,`model`,`platform`,`system`]),getMenuButtonBoundingClientRect:()=>x.getMenuRect()},We=new Set([`connectSocket`,`downloadFile`,`loadSubpackage`,`preDownloadSubpackage`,`request`,`uploadFile`]),Ge=new Set(`FileSystemManager.getSavedFileList,clearStorage,chooseImage,chooseMessageFile,chooseMedia,chooseVideo,closeBluetoothAdapter,getClipboardData,getEmail,getBluetoothAdapterState,getBluetoothDevices,getLocation,getNetworkType,getPrivacySetting,getStorageInfo,getSystemInfo,getSystemInfoAsync,getUserInfo,hideKeyboard,hideLoading,hideShareMenu,hideTabBar,hideToast,login,navigateBack,openAppAuthorizeSetting,openBluetoothAdapter,openSetting,openSystemBluetoothSetting,requirePrivacyAuthorize,showNavigationBarLoading,showShareMenu,showTabBar,startPullDownRefresh,startRecord,stopPullDownRefresh,stopBluetoothDevicesDiscovery,stopLocationUpdate,stopRecord,vibrateLong,vibrateShort`.split(`,`));function Ke(e){return Object.prototype.hasOwnProperty.call(e,`success`)||Object.prototype.hasOwnProperty.call(e,`fail`)||Object.prototype.hasOwnProperty.call(e,`complete`)}function qe(e,t){return We.has(e)||typeof e==`string`&&e.endsWith(`Sync`)?!1:t!==void 0||Ge.has(e)}function Je(e,t,n){let r={type:`invokeAPI`,target:n,body:{name:e,bridgeId:S.getPageInfo().id,params:t}};return n===`container`?C.invoke(r):C.send(r)}function Ye(e,t,n){return new Promise((r,i)=>{let a,o,s=()=>{b.remove(a),b.remove(o)};a=b.store(e=>{s(),r(e)}),o=b.store(e=>{s(),i(e)}),t.success=a,t.fail=o;try{Je(e,t,n)}catch(e){s(),i(e)}})}function w(e,t,r=`container`){let i=Ue[e];if(r===`container`&&i){let e=i();if(e)return e}let a;if(t===void 0){if(qe(e,t))return Ye(e,{},r);a=t}else if(typeof t==`string`||Array.isArray(t))a=t;else if(n(t))a={success:b.store(t,!0)};else if(Ke(t)){let{success:e,fail:r,complete:i,keep:o,evtId:s,...c}=t;a=c,s!==void 0&&(a.evtId=s),n(e)?a.success=b.store(e,o,s):a.success=e,n(r)&&(a.fail=b.store(r,o,s)),n(i)&&(a.complete=b.store(i,o,s))}else{let{keep:n,...i}=t;if(delete i.evtId,!n&&qe(e,t))return a={...i},Ye(e,a,r);a=i}return Je(e,a,r)}var Xe=t({navigateBack:()=>tt,navigateTo:()=>et,reLaunch:()=>Qe,redirectTo:()=>$e,switchTab:()=>Ze});function Ze(e){return e.url=ne(S.getPageInfo().route,e.url),w(`switchTab`,e)}function Qe(e){return e.url=ne(S.getPageInfo().route,e.url),w(`reLaunch`,e)}function $e(e){let t=ne(S.getPageInfo().route,e.url);if(S.getPageInfo().route!==t)return e.url=t,w(`redirectTo`,e)}function et(e){return e.url=ne(S.getPageInfo().route,e.url),w(`navigateTo`,e)}function tt(e){return w(`navigateBack`,e)}var nt=new WeakSet;function rt(e,t,r){if(e&&(typeof e==`object`||typeof e==`function`)&&!nt.has(e)){nt.add(e);try{n(e.componentError)&&e.componentError(t)}catch(e){console.error(`[service] error lifetime error:`,e)}finally{nt.delete(e)}}console.error(`[service] ${r} error:`,t)}function T(e,t,r=[],i=`callback`,a=!0){if(n(t))try{return t.apply(e,r)}catch(t){a?rt(e,t,i):console.error(`[service] ${i} error:`,t);return}}function E(e,t,n=[],r=`callback`,i=!0){for(let a of t||[])T(e,a,n,r,i)}var it=[`onLaunch`,`onShow`,`onHide`],at=[`globalData`],ot=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(){it.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)it.includes(t)||at.includes(t)||(this[t]=n(e[t])?e[t].bind(this):e[t])}invokeSomeLifecycle(){T(this,this.onLaunch,[this.options],`onLaunch`),T(this,this.onShow,[this.options],`onShow`)}appShow(){T(this,this.onShow,[this.options],`onShow`)}appHide(){T(this,this.onHide,[],`onHide`)}},st=new Set([`2d`]),ct=new Set([`webgl`,`experimental-webgl`,`webgl2`]),lt=new Set([`createLinearGradient`,`createPattern`,`createRadialGradient`]),ut=new Map([[`createBuffer`,`buffer`],[`createFramebuffer`,`framebuffer`],[`createProgram`,`program`],[`createQuery`,`query`],[`createRenderbuffer`,`renderbuffer`],[`createSampler`,`sampler`],[`createShader`,`shader`],[`createTexture`,`texture`],[`createTransformFeedback`,`transformFeedback`],[`createVertexArray`,`vertexArray`],[`fenceSync`,`sync`]]),dt=new Map([[`getAttribLocation`,`attribLocation`],[`getUniformLocation`,`uniformLocation`]]),ft=new Map([[`deleteBuffer`,`buffer`],[`deleteFramebuffer`,`framebuffer`],[`deleteProgram`,`program`],[`deleteQuery`,`query`],[`deleteRenderbuffer`,`renderbuffer`],[`deleteSampler`,`sampler`],[`deleteShader`,`shader`],[`deleteSync`,`sync`],[`deleteTexture`,`texture`],[`deleteTransformFeedback`,`transformFeedback`],[`deleteVertexArray`,`vertexArray`]]),pt=new Map([[`isBuffer`,`buffer`],[`isFramebuffer`,`framebuffer`],[`isProgram`,`program`],[`isQuery`,`query`],[`isRenderbuffer`,`renderbuffer`],[`isSampler`,`sampler`],[`isShader`,`shader`],[`isSync`,`sync`],[`isTexture`,`texture`],[`isTransformFeedback`,`transformFeedback`],[`isVertexArray`,`vertexArray`]]),mt={alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:`default`,failIfMajorPerformanceCaveat:!1,desynchronized:!1},ht=new Map,D={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};function gt(e){let t=String(e).toLowerCase();return t===`experimental-webgl`?`webgl`:t}function _t(e,t){!e||!t||ht.set(e,t)}function vt(e){return ht.get(e)||null}function yt(e,t){return e&&e[gt(t)]||null}function O(e){if(e==null)return e;if(Array.isArray(e))return e.map(e=>O(e));if(typeof e!=`object`)return e;if(e.__canvasTypedArray){if(e.__canvasTypedArray===`DataView`)return new DataView(new Uint8Array(e.data||[]).buffer);let t=globalThis[e.__canvasTypedArray];return typeof t==`function`?new t(e.data||[]):e.data||[]}let t={};for(let[n,r]of Object.entries(e))t[n]=O(r);return t}C.on(`canvasCapabilities`,({bridgeId:e,capabilities:t})=>{_t(e,t)}),C.on(`resourceLoaded`,({bridgeId:e,canvasCapabilities:t})=>{_t(e,t)});var bt=1,xt=1;function St(){let e=S.getPageInfo();return e?.bridgeId||e?.id||``}function k(e,t){if(e===void 0)return t;let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function Ct(e,t,n){C.send({type:`invokeAPI`,target:`render`,body:{bridgeId:e,name:t,params:n}})}function wt(e){Promise.resolve().then(e)}function Tt(e){return Object.prototype.toString.call(e)===`[object Object]`}function Et(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 A(e){if(e==null)return e;if(e.__canvasResourceId)return{__canvasResourceId:e.__canvasResourceId};if(e.__diminaCanvasNode)return{__canvasNodeId:e.nodeId};let t=Et(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=>A(e));if(Tt(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=A(r);return t}return e}function j(e){return Array.from(e).map(e=>A(e))}function M(e=`canvas_resource`){return`${e}_${p()}`}var N=class{constructor(e,t,n=`resource`,r={}){return this.__canvasResourceId=t,this.__canvasProxyValue=bt++,this.canvas=e,this.resourceType=n,this.metadata=r,this.deleted=!1,new Proxy(this,{get(e,n){if(n in e){let t=e[n];return typeof t==`function`?t.bind(e):t}if(typeof n!=`symbol`)return(...r)=>{e.canvas.enqueueOperation({op:`resourceCall`,resourceId:t,method:n,args:j(r)})}}})}valueOf(){return this.__canvasProxyValue}toString(){return String(this.__canvasProxyValue)}markDeleted(){this.deleted=!0}updateMetadata(e={}){Object.assign(this.metadata,e)}},Dt=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=b.store((e={})=>{this.width=e.width||this.width,this.height=e.height||this.height,n(this.onload)&&this.onload(e)}),r=b.store((e={})=>{n(this.onerror)&&this.onerror(e)});this.canvas.enqueueOperation({op:`imageSetSrc`,imageId:this.imageId,src:e,onload:t,onerror:r})}},Ot=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:A(r)}),!0}})}async getImageData(e,t,n,r){return await this.canvas.getImageData({contextId:this.contextId,x:e,y:t,width:n,height:r})}toDataURL(e,t){return this.canvas.toDataURL(e,t)}call(e,t){if(e===`measureText`)return{width:String(t[0]??``).length*10};if(e===`createImageData`){let e=t[0],n=t[1];return{width:e,height:n,data:new Uint8ClampedArray(e*n*4)}}let n=lt.has(e)?M():void 0;if(this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:j(t),resultId:n}),n)return new N(this.canvas,n)}},kt=class{constructor(e,t,n,r={}){return this.context=e,this.name=t,this.__canvasResourceId=n,this.constants=r.constants||{},new Proxy(this,{get(e,t){if(t in e){let n=e[t];return typeof n==`function`?n.bind(e):n}if(Object.prototype.hasOwnProperty.call(e.constants,t))return e.constants[t];if(typeof t!=`symbol`)return(...n)=>e.call(t,n)}})}call(e,t){let n,r;if(e.startsWith(`create`))r=M(`webgl_extension_resource`),n=new N(this.context.canvas,r,`${this.name}:${e}`),this.context.resources.set(r,n);else if(e.startsWith(`delete`)&&t[0]?.markDeleted)t[0].markDeleted();else if(e.startsWith(`is`)&&t[0]instanceof N)return!t[0].deleted;return this.context.canvas.enqueueOperation({op:`extensionCall`,contextId:this.context.contextId,extensionId:this.__canvasResourceId,method:e,args:j(t),resultId:r}),n}},At=class{constructor(e,t,n,r,i){return this.canvas=e,this.contextId=t,this.contextType=n,this.requestedAttributes={...mt,...Tt(r)?r:{}},this.capabilities=null,this.resources=new Map,this.extensions=new Map,this.properties=new Map,this.state=new Map,this.enabledCapabilities=new Set,this.errors=[],this.queryResults=new Map,this.contextLost=!1,this.creationFailed=!1,this.hasActualCapabilities=!1,this.initializeState(),this.updateCapabilities(i),new Proxy(this,{get(e,t){if(t in e){let n=e[t];return typeof n==`function`?n.bind(e):n}if(e.properties.has(t))return e.properties.get(t);if(Object.prototype.hasOwnProperty.call(e.capabilities?.constants||{},t))return e.capabilities.constants[t];if(Object.prototype.hasOwnProperty.call(D,t))return D[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)},set(e,n,r){return e.properties.set(n,r),e.canvas.enqueueOperation({op:`contextSetProperty`,contextId:t,prop:n,value:A(r)}),!0}})}initializeState(){let{width:e,height:t}=this.canvas;this.state.set(D.VIEWPORT,[0,0,e,t]),this.state.set(D.SCISSOR_BOX,[0,0,e,t]),this.state.set(D.COLOR_CLEAR_VALUE,new Float32Array([0,0,0,0])),this.state.set(D.COLOR_WRITEMASK,[!0,!0,!0,!0]),this.state.set(D.DEPTH_CLEAR_VALUE,1),this.state.set(D.DEPTH_WRITEMASK,!0),this.state.set(D.DEPTH_FUNC,D.LESS),this.state.set(D.STENCIL_CLEAR_VALUE,0),this.state.set(D.LINE_WIDTH,1),this.state.set(D.CULL_FACE_MODE,D.BACK),this.state.set(D.FRONT_FACE,D.CCW),this.state.set(D.ACTIVE_TEXTURE,D.TEXTURE0),this.state.set(D.PACK_ALIGNMENT,4),this.state.set(D.UNPACK_ALIGNMENT,4),this.state.set(D.CURRENT_PROGRAM,null),this.state.set(D.ARRAY_BUFFER_BINDING,null),this.state.set(D.ELEMENT_ARRAY_BUFFER_BINDING,null),this.state.set(D.TEXTURE_BINDING_2D,null),this.state.set(D.FRAMEBUFFER_BINDING,null),this.state.set(D.RENDERBUFFER_BINDING,null)}updateCapabilities(e,t=!1){if(!e)return;let n=O(e),r={...this.capabilities?.extensions||{}};for(let[e,t]of Object.entries(n.extensions||{}))r[e]={...r[e]||{},...t,constants:{...r[e]?.constants||{},...t.constants||{}}};this.capabilities={...this.capabilities||{},...n,constants:{...this.capabilities?.constants||{},...n.constants||{}},parameters:{...this.capabilities?.parameters||{},...n.parameters||{}},extensions:r,shaderPrecisionFormats:{...this.capabilities?.shaderPrecisionFormats||{},...n.shaderPrecisionFormats||{}}},this.hasActualCapabilities||=t,typeof this.capabilities.contextLost==`boolean`&&(this.contextLost=this.capabilities.contextLost)}applyFeedback(e={}){e.success===!1?(this.creationFailed=!0,this.contextLost=!0,this.canvas.handleContextCreationFailure(this.contextId,this.contextType,e.statusMessage)):e.capabilities&&this.updateCapabilities(e.capabilities,!0),typeof e.contextLost==`boolean`&&(this.contextLost=e.contextLost);for(let t of e.errors||[])this.queueError(t);for(let t of e.resources||[])this.resources.get(t.resourceId)?.updateMetadata(O(t.metadata));for(let t of e.queries||[])this.queryResults.set(t.key,this.deserializeFeedbackValue(t.value))}deserializeFeedbackValue(e){if(e?.__canvasResourceId)return this.resources.get(e.__canvasResourceId)||null;if(Array.isArray(e))return e.map(e=>this.deserializeFeedbackValue(e));if(e&&typeof e==`object`&&!e.__canvasTypedArray){let t={};for(let[n,r]of Object.entries(e))t[n]=this.deserializeFeedbackValue(r);return t}return O(e)}queueError(e){e&&e!==D.NO_ERROR&&!this.errors.includes(e)&&this.errors.push(e)}queryKey(e,t){return`${e}:${JSON.stringify(j(t))}`}requestQuery(e,t,n=null){let r=this.queryKey(e,t);return this.canvas.enqueueOperation({op:`contextQuery`,contextId:this.contextId,method:e,args:j(t),key:r}),this.queryResults.has(r)?this.queryResults.get(r):n}createResource(e,t,n){let r=M(`webgl_${n}`),i={};n===`shader`?(i.shaderType=t[0],i.source=``,i.compileStatus=!1,i.infoLog=``):n===`program`&&(i.attachedShaders=[],i.linkStatus=!1,i.validateStatus=!1,i.infoLog=``);let a=new N(this.canvas,r,n,i);return this.resources.set(r,a),this.canvas.enqueueOperation({op:`contextCall`,contextId:this.contextId,method:e,args:j(t),resultId:r}),a}call(e,t){switch(e){case`getParameter`:return this.getParameter(t[0]);case`getShaderParameter`:return this.getShaderParameter(t[0],t[1]);case`getProgramParameter`:return this.getProgramParameter(t[0],t[1]);case`getShaderInfoLog`:return t[0]?.metadata?.infoLog||``;case`getProgramInfoLog`:return t[0]?.metadata?.infoLog||``;case`getShaderSource`:return t[0]?.metadata?.source||null;case`getAttachedShaders`:return t[0]?.metadata?.attachedShaders?.slice()||[];case`getError`:return this.errors.shift()||(this.canvas.enqueueOperation({op:`contextFeedback`,contextId:this.contextId}),D.NO_ERROR);case`isContextLost`:return this.canvas.enqueueOperation({op:`contextFeedback`,contextId:this.contextId}),this.contextLost;case`isEnabled`:return this.enabledCapabilities.has(t[0]);case`checkFramebufferStatus`:return this.requestQuery(e,t,D.FRAMEBUFFER_COMPLETE);case`getContextAttributes`:return{...this.hasActualCapabilities&&this.capabilities?.contextAttributes?this.capabilities.contextAttributes:this.requestedAttributes};case`getSupportedExtensions`:return(this.capabilities?.supportedExtensions||[]).slice();case`getExtension`:return this.getExtension(t[0]);case`getShaderPrecisionFormat`:return this.getShaderPrecisionFormat(t[0],t[1]);case`getActiveAttrib`:case`getActiveUniform`:case`getBufferParameter`:case`getFramebufferAttachmentParameter`:case`getRenderbufferParameter`:case`getTexParameter`:case`getUniform`:case`getVertexAttrib`:case`getVertexAttribOffset`:return this.requestQuery(e,t)}let n=ut.get(e)||dt.get(e);if(n)return this.createResource(e,t,n);if(pt.has(e)){let n=t[0];return n instanceof N&&n.resourceType===pt.get(e)&&!n.deleted}ft.has(e)&&t[0]?.markDeleted&&t[0].markDeleted(),this.updateState(e,t);let r={op:`contextCall`,contextId:this.contextId,method:e,args:j(t)};e===`compileShader`?(t[0]?.updateMetadata({compileStatus:!0}),r.feedback=`shader`):e===`linkProgram`||e===`validateProgram`?(t[0]?.updateMetadata(e===`linkProgram`?{linkStatus:!0}:{validateStatus:!0}),r.feedback=`program`):e===`readPixels`&&ArrayBuffer.isView(t[6])?(r.typedArrayUpdateId=this.canvas.registerTypedArrayUpdate(t[6]),r.typedArrayArgIndex=6):e===`getBufferSubData`&&ArrayBuffer.isView(t[2])&&(r.typedArrayUpdateId=this.canvas.registerTypedArrayUpdate(t[2]),r.typedArrayArgIndex=2),this.canvas.enqueueOperation(r)}updateState(e,t){switch(e){case`viewport`:this.state.set(D.VIEWPORT,t.slice(0,4));break;case`scissor`:this.state.set(D.SCISSOR_BOX,t.slice(0,4));break;case`clearColor`:this.state.set(D.COLOR_CLEAR_VALUE,new Float32Array(t.slice(0,4)));break;case`colorMask`:this.state.set(D.COLOR_WRITEMASK,t.slice(0,4).map(Boolean));break;case`clearDepth`:this.state.set(D.DEPTH_CLEAR_VALUE,t[0]);break;case`depthMask`:this.state.set(D.DEPTH_WRITEMASK,!!t[0]);break;case`depthFunc`:this.state.set(D.DEPTH_FUNC,t[0]);break;case`clearStencil`:this.state.set(D.STENCIL_CLEAR_VALUE,t[0]);break;case`lineWidth`:this.state.set(D.LINE_WIDTH,t[0]);break;case`cullFace`:this.state.set(D.CULL_FACE_MODE,t[0]);break;case`frontFace`:this.state.set(D.FRONT_FACE,t[0]);break;case`activeTexture`:this.state.set(D.ACTIVE_TEXTURE,t[0]);break;case`pixelStorei`:this.state.set(t[0],t[1]);break;case`enable`:this.enabledCapabilities.add(t[0]);break;case`disable`:this.enabledCapabilities.delete(t[0]);break;case`useProgram`:this.state.set(D.CURRENT_PROGRAM,t[0]||null);break;case`bindBuffer`:t[0]===D.ARRAY_BUFFER?this.state.set(D.ARRAY_BUFFER_BINDING,t[1]||null):t[0]===D.ELEMENT_ARRAY_BUFFER&&this.state.set(D.ELEMENT_ARRAY_BUFFER_BINDING,t[1]||null);break;case`bindTexture`:t[0]===D.TEXTURE_2D&&this.state.set(D.TEXTURE_BINDING_2D,t[1]||null);break;case`bindFramebuffer`:this.state.set(D.FRAMEBUFFER_BINDING,t[1]||null);break;case`bindRenderbuffer`:this.state.set(D.RENDERBUFFER_BINDING,t[1]||null);break;case`shaderSource`:t[0]?.updateMetadata({source:String(t[1]??``)});break;case`attachShader`:{let e=t[0]?.metadata?.attachedShaders;e&&t[1]&&!e.includes(t[1])&&e.push(t[1]);break}case`detachShader`:{let e=t[0]?.metadata?.attachedShaders,n=e?.indexOf(t[1])??-1;n>=0&&e.splice(n,1);break}}}getParameter(e){if(this.state.has(e)){let t=this.state.get(e);return ArrayBuffer.isView(t)||Array.isArray(t)?t.slice():t}let t=this.capabilities?.parameters||{};return Object.prototype.hasOwnProperty.call(t,e)?O(t[e]):this.requestQuery(`getParameter`,[e])}getShaderParameter(e,t){if(!(e instanceof N)||e.resourceType!==`shader`)return null;switch(t){case D.DELETE_STATUS:return e.deleted;case D.SHADER_TYPE:return e.metadata.shaderType;case D.COMPILE_STATUS:return!!e.metadata.compileStatus;default:return this.requestQuery(`getShaderParameter`,[e,t])}}getProgramParameter(e,t){if(!(e instanceof N)||e.resourceType!==`program`)return null;switch(t){case D.DELETE_STATUS:return e.deleted;case D.LINK_STATUS:return!!e.metadata.linkStatus;case D.VALIDATE_STATUS:return!!e.metadata.validateStatus;case D.ATTACHED_SHADERS:return e.metadata.attachedShaders.length;default:return this.requestQuery(`getProgramParameter`,[e,t])}}getShaderPrecisionFormat(e,t){let n=`${e}:${t}`,r=this.capabilities?.shaderPrecisionFormats?.[n];return r?{...r}:this.requestQuery(`getShaderPrecisionFormat`,[e,t])}getExtension(e){let t=String(e||``),n=(this.capabilities?.supportedExtensions||[]).find(e=>e.toLowerCase()===t.toLowerCase());if(!n)return null;if(this.extensions.has(n))return this.extensions.get(n);let r=M(`webgl_extension`),i=this.capabilities?.extensions?.[n]||{},a=new kt(this,n,r,i);return this.extensions.set(n,a),this.canvas.enqueueOperation({op:`getExtension`,contextId:this.contextId,extensionId:r,name:n}),a}},jt=class{constructor({nodeId:e,bridgeId:t=St(),width:n=300,height:r=150,type:i=`2d`,offscreen:a=!1,webglCapabilities:o}){this.__diminaCanvasNode=!0,this.nodeId=e,this.bridgeId=t,this.type=i,this.offscreen=a,this.webglCapabilities=o||vt(t),this.contexts=new Map,this.contextsById=new Map,this.activeContextType=null,this.eventListeners=new Map,this.pendingTypedArrayUpdates=new Map,this.pendingOperations=[],this.flushScheduled=!1,this._width=k(n,300),this._height=k(r,150)}get width(){return this._width}set width(e){this._width=k(e,300),this.enqueueOperation({op:`setCanvasProperty`,prop:`width`,value:this._width})}get height(){return this._height}set height(e){this._height=k(e,150),this.enqueueOperation({op:`setCanvasProperty`,prop:`height`,value:this._height})}getContext(e=`2d`,t){let n=String(e).toLowerCase(),r=gt(n),i=ct.has(n);if(!st.has(r)&&!i||this.activeContextType&&this.activeContextType!==r)return null;if(this.contexts.has(r))return this.contexts.get(r);let a=i?yt(this.webglCapabilities,r):null;if(i&&a?.supported===!1)return null;let o=M(`canvas_context`);this.enqueueOperation({op:`getContext`,contextId:o,contextType:n,attributes:A(t)});let s=i?new At(this,o,r,t,a):new Ot(this,o);return this.activeContextType=r,this.contexts.set(r,s),this.contextsById.set(o,s),s}addEventListener(e,t){n(t)&&(this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t))}removeEventListener(e,t){this.eventListeners.get(e)?.delete(t)}dispatchEvent(e){if(!e?.type)return!0;let t=!1,r={...e,target:this,currentTarget:this,preventDefault(){t=!0,this.defaultPrevented=!0}};for(let t of this.eventListeners.get(e.type)||[])t.call(this,r);let i=this[`on${e.type}`];return n(i)&&i.call(this,r),!t}notifyContextCreationError(e=`WebGL context creation failed`){this.dispatchEvent({type:`webglcontextcreationerror`,statusMessage:e})}handleContextCreationFailure(e,t,n){let r=this.contextsById.get(e);this.contexts.get(t)===r&&(this.contexts.delete(t),this.activeContextType=null),this.contextsById.delete(e),this.notifyContextCreationError(n)}registerTypedArrayUpdate(e){let t=M(`canvas_typed_array_update`);return this.pendingTypedArrayUpdates.set(t,e),t}applyFlushFeedback(e={}){for(let[t,n]of Object.entries(e.contexts||{}))this.contextsById.get(t)?.applyFeedback?.(n);for(let t of e.typedArrays||[]){let e=this.pendingTypedArrayUpdates.get(t.id);if(e&&ArrayBuffer.isView(e)){let n=O(t.value);ArrayBuffer.isView(n)?e.set(n.subarray(0,e.length)):Array.isArray(n)&&e.set(n.slice(0,e.length))}this.pendingTypedArrayUpdates.delete(t.id)}}createImage(){return new Dt(this,M(`canvas_image`))}requestAnimationFrame(e){let t=xt++,r=b.store(t=>{n(e)&&e(t)});return Ct(this.bridgeId,`canvasNodeRequestAnimationFrame`,{nodeId:this.nodeId,requestId:t,callback:r}),t}cancelAnimationFrame(e){Ct(this.bridgeId,`canvasNodeCancelAnimationFrame`,{nodeId:this.nodeId,requestId:e})}getImageData({contextId:e,x:t,y:n,width:r,height:i}){return new Promise((a,o)=>{let s=b.store(e=>{a(e)});this.enqueueOperation({op:`getImageData`,contextId:e,x:t,y:n,width:r,height:i,callback:s})})}toDataURL(e=`image/png`,t){return new Promise(n=>{let r=b.store(e=>{n(e)});this.enqueueOperation({op:`toDataURL`,mimeType:e,quality:t,callback:r})})}enqueueOperation(e){this.pendingOperations.push(e),!this.flushScheduled&&(this.flushScheduled=!0,wt(()=>this.flushOperations()))}flushOperations(){if(this.flushScheduled=!1,this.pendingOperations.length===0)return;let e=this.pendingOperations;this.pendingOperations=[];let t=e.some(e=>e.op===`getContext`||e.op===`contextQuery`||e.op===`contextFeedback`||e.feedback||e.typedArrayUpdateId)?b.store(e=>this.applyFlushFeedback(e)):void 0;Ct(this.bridgeId,`canvasNodeFlush`,{nodeId:this.nodeId,operations:e,feedback:t})}};function Mt(e,t=St()){return!e||e.__diminaNodeType!==`dimina-canvas-node`?e:(_t(t,e.webglCapabilities),new jt({nodeId:e.nodeId,bridgeId:t,width:e.width,height:e.height,type:e.type,webglCapabilities:e.webglCapabilities}))}function Nt(e,t=St()){return Array.isArray(e)?e.map(e=>Nt(e,t)):!e||typeof e!=`object`?e:e.node?{...e,node:Mt(e.node,t)}:e}function Pt(e={}){let t=k(e.width,300),n=k(e.height,150),r=e.type||`2d`,i=M(`offscreen_canvas`),a=St();return Ct(a,`createOffscreenCanvas`,{nodeId:i,width:t,height:n,type:r}),new jt({nodeId:i,bridgeId:a,width:t,height:n,type:r,offscreen:!0,webglCapabilities:vt(a)})}var Ft=t({createSelectorQuery:()=>It});function It(){return new Bt}function Lt(){return S.getPageInfo()}function Rt(){let e=Lt();return e?.__id__||e?.id}function zt(){let e=Lt();return e?.bridgeId||e?.id}var Bt=class{constructor(){this.__componentId=Rt(),this.__taskQueue=[],this.__cbQueue=[]}in(e){return this.__componentId=e.__id__,this}select(e){return new Vt(this,this.__componentId,e,!0)}selectAll(e){return new Vt(this,this.__componentId,e,!1)}selectViewport(){return new Vt(this,Rt(),``,!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=zt();w(`selectorQuery`,{tasks:this.__taskQueue,success:i=>{let a=Nt(i,r)||[];a.forEach((e,r)=>{let i=t.__cbQueue[r];n(i)&&i.call(t,e)}),n(e)&&e.call(t,a)}},`render`)}},Vt=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)}},Ht=t({createIntersectionObserver:()=>Ut});function Ut(e,t={}){let{thresholds:n=[0],initialRatio:r=0,observeAll:i=!1}=t;return new Wt(e,{thresholds:n,initialRatio:r,observeAll:i})}var Wt=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=b.store(e=>{n._disconnected||(n._observerId=e.observerId),e.info&&t.call(n,e.info)},!0);w(`addIntersectionObserver`,{moduleId:this._component.__id__,targetSelector:e,relativeInfo:this._relativeInfo,options:this._options,success:r},`render`)}disconnect(){w(`removeIntersectionObserver`,{observerId:this._observerId},`render`),this._disconnected=!0}},Gt=t({createMediaQueryObserver:()=>qt});function Kt(e={}){let t={};for(let n of[`minWidth`,`maxWidth`,`width`,`minHeight`,`maxHeight`,`height`]){let r=Number(e[n]);Number.isFinite(r)&&r>=0&&(t[n]=r)}return typeof e.orientation==`string`&&/^[-_a-z0-9]+$/i.test(e.orientation)&&(t.orientation=e.orientation),t}function qt(e,t={}){return new Jt(e,t)}var Jt=class{constructor(e,t){this._component=e,this._options=t,this._observerId=null,this._callbackId=null,this._disconnected=!1}observe(e,t){if(!n(t))throw TypeError(`MediaQueryObserver.observe listener must be a function`);if(this._observerId!==null)throw Error(`MediaQueryObserver.observe can only be called once`);this._disconnected=!1,this._callbackId=b.store((e={})=>{if(e.observerId&&(this._observerId=e.observerId,this._disconnected)){w(`removeMediaQueryObserver`,{observerId:e.observerId},`render`),b.remove(this._callbackId),this._callbackId=null;return}!this._disconnected&&typeof e.matches==`boolean`&&t.call(this,{matches:e.matches})},!0),w(`addMediaQueryObserver`,{moduleId:this._component.__id__,condition:Kt(e),options:this._options,success:this._callbackId},`render`)}disconnect(){this._disconnected=!0,w(`removeMediaQueryObserver`,{observerId:this._observerId},`render`),this._callbackId&&this._observerId&&(b.remove(this._callbackId),this._callbackId=null)}};function Yt(e){if(typeof e!=`string`||e.length===0)return null;let t=[],n=``,r=0,i=()=>{n.length>0&&(t.push(n),n=``)};for(;r<e.length;){let a=e[r];if(a===`\\`){let t=e[r+1];if(t===`.`||t===`[`||t===`]`||t===`\\`){n+=t,r+=2;continue}n+=a,r++;continue}if(a===`.`){i(),r++;continue}if(a===`[`){if(t.length===0&&n.length===0)return null;i();let a=e.indexOf(`]`,r+1);if(a===-1)return null;let o=e.slice(r+1,a);if(!/^\d+$/.test(o))return null;t.push(Number(o)),r=a+1;continue}if(a===`]`)return null;n+=a,r++}return i(),t.length>0?t:null}function Xt(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e],i=t[e+1],a=Object.prototype.hasOwnProperty.call(r,n);typeof i==`number`?(!a||!Array.isArray(r[n]))&&(r[n]=[]):(!a||r[n]===null||typeof r[n]!=`object`||Array.isArray(r[n]))&&(r[n]={}),r=r[n]}r[t[t.length-1]]=n}function Zt(e,t){return e.length<=t.length&&e.every((e,n)=>e===t[n])}function Qt(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){if(e===`**`){n.push({path:[],wildcard:!0});continue}let t=e.endsWith(`.**`),r=Yt(t?e.slice(0,-3):e);r&&n.push({path:r,wildcard:t})}return n}function $t(e,t){return e.wildcard&&e.path.length===0?!0:e.wildcard&&Zt(e.path,t)||Zt(t,e.path)}function en(e){let t=[];if(Array.isArray(e.behaviorObserverList)&&e.behaviorObserverList.length>0)for(let{key:n,observer:r}of e.behaviorObserverList)t.push({expression:n,observer:r});else for(let[n,r]of Object.entries(e.behaviorObservers||{}))for(let e of r||[])t.push({expression:n,observer:e});for(let[n,r]of Object.entries(e.observers||{}))t.push({expression:n,observer:r});return t.map(e=>({...e,paths:Qt(e.expression)}))}function tn(e,t,r=e.data,i=e.__info__||{}){for(let a of en(i)){if(!n(a.observer)||!a.paths.some(e=>t.some(t=>$t(e,t))))continue;let i=a.paths.map(({path:e})=>e.length===0?r:f(r,e));T(e,a.observer,i,`data observer`)}}function nn(e,t){let n={};for(let r of t)n[r.key]=f(e.data,r.path);return n}function rn(e,t){let n=e.__info__?.properties||{};return t.flatMap(e=>{let t=e.path[0];return typeof t!=`string`||!Object.prototype.hasOwnProperty.call(n,t)?[]:[{propertyName:t,oldValue:e.path.length===1?e.oldValue:void 0,path:e.path,value:e.value}]})}function an(e,t,r){if(!t||typeof t!=`object`||Array.isArray(t))return console.warn(`[service] setData data must be an object`),null;let i=!e.__dataUpdateTransaction__,a=e.__dataUpdateTransaction__||{changes:[],pendingPaths:[],callbacks:[]};e.__dataUpdateTransaction__=a,n(r)&&a.callbacks.push(r);for(let r of Object.keys(t)){let i=Yt(r);if(!i){console.warn(`[service] invalid setData path: ${r}`);continue}let o=v(t[r]);i.length===1&&e.__propertySchemas__?.[i[0]]&&n(e.normalizePropertyValues)&&(o=e.normalizePropertyValues({[i[0]]:o})[i[0]]);let s=i.length===1?e.data[i[0]]:void 0;Xt(e.data,i,o),a.changes.push({key:r,path:i,oldValue:s,value:o}),a.pendingPaths.push(i)}if(!i)return null;try{for(;a.pendingPaths.length>0;){let t=a.pendingPaths;a.pendingPaths=[],tn(e,t)}}finally{delete e.__dataUpdateTransaction__}return{callbacks:a.callbacks,changedData:nn(e,a.changes),changes:a.changes.map(e=>({path:e.path,value:e.value})),propertyChanges:rn(e,a.changes)}}function on(e,t){let i=e.__info__?.properties||{};for(let a of t){let t=i[a.propertyName],o=t?.observer,s=a.path,c=Object.prototype.hasOwnProperty.call(a,`value`)?a.value:s.length===1?e.data[a.propertyName]:f(e.data,s);s.length===1&&c===a.oldValue&&!t?.observeAssignments||(r(o)?T(e,e[o],[c,a.oldValue,s],`property observer`):n(o)&&T(e,o,[c,a.oldValue,s],`property observer`))}}var sn=new Map;function cn(e){return sn.has(e)||sn.set(e,{depth:0,scheduled:!1,updates:[],byModuleId:new Map,callbackIds:[]}),sn.get(e)}function ln(e,t){let r=(Array.isArray(t)?t:[t]).filter(n);if(r.length!==0)return b.store(()=>{r.forEach(t=>T(e,t,[],`setData callback`))})}function un(e){let t=cn(e);t.depth++}function dn(e){let t=cn(e);t.depth>0&&t.depth--,t.depth===0&&pn(e)}function fn(e,t=[]){let n=t.length>0?t:Object.entries(e).flatMap(([e,t])=>{let n=Yt(e);return n?[{path:n,value:t}]:[]}),r=JSON.parse(JSON.stringify(Re({data:e,changes:n})));return{data:r.data||{},changes:(r.changes||[]).filter(e=>Object.prototype.hasOwnProperty.call(e,`value`))}}function P(e,t,n,r,i=[]){let a=cn(e),o=a.byModuleId.get(t),s=i.filter(e=>e&&typeof e==`object`),c=i.filter(e=>typeof e==`string`),l=fn(n,s);if(o){if(Array.isArray(c)&&c.length>0){let e=new Set([...o.deleteKeys||[],...c]);for(let t of e)delete o.data[t];o.deleteKeys=[...e]}Object.assign(o.data,l.data),o.changes=o.changes||[],o.changes.push(...l.changes),Array.isArray(o.deleteKeys)&&o.deleteKeys.length>0&&(o.deleteKeys=o.deleteKeys.filter(e=>!Object.prototype.hasOwnProperty.call(l.data,e)),o.deleteKeys.length===0&&delete o.deleteKeys)}else{let e={moduleId:t,data:l.data,changes:l.changes};Array.isArray(c)&&c.length>0&&(e.deleteKeys=[...new Set(c)]),a.byModuleId.set(t,e),a.updates.push(e)}r&&a.callbackIds.push(r),a.depth===0&&!a.scheduled&&(a.scheduled=!0,Promise.resolve().then(()=>{a.scheduled=!1,a.depth===0&&pn(e)}))}function pn(e){let t=sn.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,C.send({type:`ub`,target:`render`,body:{bridgeId:e,updates:n,callbackIds:r}})}function mn(e){return i(e)||n(e)?e:e instanceof Date?e.getTime():Array.isArray(e)?e.map(e=>mn(e)):typeof e==`object`?Object.entries(e).reduce((e,[t,n])=>(t.startsWith(`$`)||(e[t]=mn(n)),e),{}):e}function hn(e){if(e){let t={};for(let n in e){let r=ve(e[n]);t[n]={type:[r.type,...r.optionalTypes].map(_n),default:r.value}}return t}}var gn=new Map([[String,`s`],[Number,`n`],[Boolean,`b`],[Object,`o`],[Array,`a`]]);function _n(e){return Array.isArray(e)?e.map(e=>_n(e)):e===null||e===``?null:gn.get(e)||(console.warn(`[service] ignore unknown props type ${e}`),null)}function vn(e,t,n,r){let i=e.map(Yt).filter(Boolean);tn(r||{},i,n,{observers:t})}function yn(e={},t=``){let n=t.trim();if(!n)return;let r=n.replace(/-/g,``).toLowerCase(),i=[n,m(n),h(n),r];for(let t of i)if(t&&e[t]!==void 0){let n=e[t];if(typeof n==`string`)return{bind:n};if(n&&typeof n==`object`)return n}}function bn(e,t){let n=e.__info__||{};n.behaviorObservers&&tn(e,t.map(Yt).filter(Boolean),e.data,{behaviorObserverList:n.behaviorObserverList,behaviorObservers:n.behaviorObservers})}function xn(e,t){if(!Array.isArray(t))return;let r=new WeakMap,i=new WeakSet,a=e.properties,o=e.data,s=e.methods,c=e.relations,l=Object.prototype.hasOwnProperty.call(e,`export`),u=e.export,d,f,p,m,h;function g(e,t){let n=Array.isArray(e)?[...e]:{...e};for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=n[e],i=t[e];n[e]=typeof r==`object`&&typeof i==`object`&&i&&!Array.isArray(i)?g(r,i):i}return n}function ee(e,t){if(typeof t==`string`){te(e,t);return}if(!t||typeof t!=`object`||i.has(t))return;i.add(t);let a=r.has(t);if(Array.isArray(t.behaviors)&&t.behaviors.forEach(t=>ee(e,t)),t.properties&&(d={...d,...t.properties}),t.data&&(f=g(f||{},t.data)),!a){r.set(t,!0);let i=[`created`,`attached`,`ready`,`moved`,`detached`,`error`];e.behaviorLifetimes=e.behaviorLifetimes||{};for(let r of i){let i=t.lifetimes?.[r]||t[r];n(i)&&(e.behaviorLifetimes[r]=e.behaviorLifetimes[r]||[],e.behaviorLifetimes[r].push(i))}if(t.observers){e.behaviorObservers=e.behaviorObservers||{},e.behaviorObserverList=e.behaviorObserverList||[];for(let n in t.observers)e.behaviorObservers[n]||(e.behaviorObservers[n]=[]),e.behaviorObservers[n].push(t.observers[n]),e.behaviorObserverList.push({key:n,observer:t.observers[n]})}}if(t.methods&&(p={...p,...t.methods}),t.relations&&(m={...m,...t.relations}),t.export&&(h=t.export),!a&&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]))}i.delete(t)}function te(e,t){switch(t){case`wx://component-export`:break;case`wx://form-field`:d={...d,name:{type:String},value:{type:null}};break;case`wx://form-field-group`:case`wx://form-field-button`:case`wx://label-target`:case`wx://style-filter`:case`wx://request-filter`:break;default:console.warn(`[service] 未知的内置 behavior: ${t}`)}}t.forEach(t=>ee(e,t)),(d||a)&&(e.properties={...d,...a}),(f||o)&&(e.data=g(f||{},o||{})),(p||s)&&(e.methods={...p,...s}),(m||c)&&(e.relations={...m,...c}),l?e.export=u:h&&(e.export=h)}function F(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 Sn(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 Cn(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 wn(e,t){if(!(!e||!e.expression)){if(e.isSimple)return f(t,e.expression);try{return Function(`data`,`with(data) { return ${e.expression} }`)(t)}catch(t){console.warn(`[service] 计算表达式失败:`,e.expression,t);return}}}function Tn(e,t,n){let r=Object.values(t||{}),i=[];for(let t of r){if(!F(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&&Cn(i,n)&&(o[r]=v(wn(i,e.data)))}if(Object.keys(o).length>0){let e=t.normalizePropertyValues?.(o,{applyFilter:!1})||o,n=t.tO?.(e)||t.normalizePropertyValues?.(e)||e;t.__pendingSyncedProps__=t.__pendingSyncedProps__||{},Object.assign(t.__pendingSyncedProps__,e),i.push({child:t,data:n})}}return i}var En=[`created`,`attached`,`ready`,`moved`,`detached`,`error`],Dn=[`show`,`hide`,`resize`,`routeDone`],On=class e{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=v(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.__eventPath__=null,this.__pageId__=t.pageId,this.__parentId__=t.parentId,this.__hotUpdateMemberKeys__=new Set,this.__isCustomTabBar__=t.isCustomTabBar===!0,this.__relations__=new Map,this.__relationPaths__=new Map,this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[],this.__pendingInitSetDataCallbacks__=[],this.__childPropsBindings__={},this.__pendingSyncedProps__={},this.__initialPropertyObserversInvoked__=!1,this.__initialPropertyNames__=new Set(t.propertyNames||Object.keys(t.properties||{})),this.__initialPropertyChanges__=[],this.__initialPropertyValues__={},this.__propertySchemas__=Object.fromEntries(Object.entries(this.__info__.properties||{}).map(([e,t])=>[e,ve(t)]))}init({deferInitialData:e=!1}={}){if(this.#d(),this.__isComponent__){let e=this.opts.properties||{};for(let[t,n]of Object.entries(this.__propertySchemas__)){let r=Ce(n,void 0,{absent:!0});if(this.data[t]=r,this.__initialPropertyNames__.has(t)){let n=this.normalizePropertyValue(t,e[t],{applyFilter:!1});this.__initialPropertyValues__[t]=n,this.__initialPropertyChanges__.push({propertyName:t,oldValue:void 0,path:[t],value:n})}}}this.#u(),this.#t(),this.#e(),this.#m(),e||this.sendInitialData()}sendInitialData(){this.__initialDataSent__||(this.__initialDataSent__=!0,C.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__=[],P(this.bridgeId,this.__id__,{},ln(this,e))}#e(){this.hasBehavior(`wx://component-export`)&&this.__info__.export&&n(this.__info__.export)&&(this.export=this.__info__.export.bind(this),this.__hotUpdateMemberKeys__.add(`export`))}#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)}`}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(`/`)}return e}#r(){let e=this.__info__.relations;if(!e)return;let t=Object.values(H.instances[this.bridgeId]||{}).filter(e=>e===this||!e.__isComponent__||e.__componentAttached__||e.__componentAttaching__);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.#a(t,e));for(let e of o)this.#s(n,e,r)}this.#i()}#i(){let e=Object.values(H.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}`),o&&this.#a(e,t)&&this.#s(n,e,r)}}#a(e,t){let n=Object.values(H.instances[this.bridgeId]||{});switch(t){case`parent`:return e.__id__===this.__parentId__;case`child`:return e.__parentId__===this.__id__;case`ancestor`:return this.#o(e.__id__,this.__id__,n);case`descendant`:return this.#o(this.__id__,e.__id__,n);default:return!1}}#o(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}#s(e,t,n){let r=this.__relations__.get(e)||[];r.includes(t)||(r.push(t),this.__relations__.set(e,r),T(this,n.linked,[t],`relation linked callback`))}#c(e,t,n){let r=this.__relations__.get(e)||[],i=r.indexOf(t);i!==-1&&(r.splice(i,1),this.__relations__.set(e,r),T(this,n.unlinked,[t],`relation unlinked callback`))}#l(e,t,n){T(this,n.linkChanged,[t],`relation linkChanged callback`)}setData(e,t){let n=an(this,e,t);if(!n)return;if(!this.initd){this.__pendingInitSetDataCallbacks__.push(...n.callbacks),on(this,n.propertyChanges);return}if(this.__groupSetDataMode__){for(let e of Object.keys(n.changedData))this.__groupSetDataBuffer__[e]=n.changedData[e];this.__groupSetDataChanges__.push(...n.changes),this.__groupSetDataCallbacks__.push(...n.callbacks),on(this,n.propertyChanges);return}let r=Tn(this,H.instances[this.bridgeId],n.changedData);P(this.bridgeId,this.__id__,n.changedData,ln(this,n.callbacks),n.changes),r.forEach(({child:e,data:t})=>{P(this.bridgeId,e.__id__,t)}),on(this,n.propertyChanges)}#u(){En.forEach(e=>{let t=this.__info__.lifetimes?.[e]||this.__info__[e];n(t)&&(this[e]=t.bind(this),this.__hotUpdateMemberKeys__.add(e))}),this.__isComponent__&&Dn.forEach(e=>{let t=this.__info__.pageLifetimes?.[e];n(t)&&(e===`show`?e=`onShow`:e===`hide`&&(e=`onHide`),this[e]=t.bind(this),this.__hotUpdateMemberKeys__.add(e))})}#d(){let e=this.__info__.methods;for(let t in e)n(e[t])&&(this[t]=e[t].bind(this),this.__hotUpdateMemberKeys__.add(t))}hotUpdate(e){for(let e of this.__hotUpdateMemberKeys__)delete this[e];this.__hotUpdateMemberKeys__.clear(),this.behaviors=e.behaviors,this.__isComponent__=e.isComponent,this.__type__=e.type,this.__info__=e.moduleInfo,this.#u(),this.#d(),this.#t(),this.#e()}#f(){if(!this.__isComponent__||!this.__info__.properties||this.__initialPropertyObserversInvoked__)return;let e=this.__initialPropertyChanges__.map(e=>e.path);e.length>0&&(tn(this,e),on(this,this.__initialPropertyChanges__)),this.__initialPropertyObserversInvoked__=!0}#p(){for(let[e,t]of Object.entries(this.__initialPropertyValues__)){let n=this.data[e],r=this.normalizePropertyValue(e,t,{oldValue:n});this.data[e]=r;let i=this.__initialPropertyChanges__.find(t=>t.propertyName===e);i&&(i.oldValue=n,i.value=r)}}#m(){this.__isComponent__?(this.componentCreated(),this.#p(),this.#f()):(this.componentCreated(),this.componentAttached(),T(this,this.onLoad,[this.opts.query||{}],`onLoad`)),this.initd=!0}tO(e){let t=typeof this.normalizePropertyValues==`function`?this.normalizePropertyValues(e,{applyFilter:!1}):e,n={},r={};for(let[e,i]of Object.entries(t)){if(this.__pendingSyncedProps__&&Object.prototype.hasOwnProperty.call(this.__pendingSyncedProps__,e)&&a(this.__pendingSyncedProps__[e],i)){this.hasPropertyFilter?.(e)||(this.data[e]=i),r[e]=this.data[e],delete this.__pendingSyncedProps__[e];continue}let t=typeof this.normalizePropertyValue==`function`?this.normalizePropertyValue(e,i):i;n[e]=t,r[e]=t}if(Object.keys(n).length===0)return r;let i=[],o=[];for(let[e,t]of Object.entries(n)){let n=this.data[e];this.data[e]=t,o.push([e]),i.push({propertyName:e,oldValue:n,path:[e],value:t})}return tn(this,o),on(this,i),r}hasPropertyFilter(e){let t=this.__info__.properties?.[e];return!!t&&typeof t==`object`&&t.filter!=null}normalizePropertyValue(e,t,{absent:r=!1,applyFilter:i=!0,oldValue:a=this.data[e],path:o=[e]}={}){let s=this.__propertySchemas__[e];if(!s)return t;let c=Ce(s,t,{absent:r});if(r||!i||!this.hasPropertyFilter(e))return c;let l=this.__info__.properties[e],u=n(l.filter)?l.filter:this.__info__.methods?.[l.filter];if(!n(u))return c;let d=T(this,u,[c,a,o],`property filter`);return d===void 0?c:d}normalizePropertyValues(e,{applyFilter:t=!0}={}){let n={};for(let[r,i]of Object.entries(e||{}))n[r]=this.normalizePropertyValue(r,i,{applyFilter:t});return n}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 It().in(this)}selectComponent(e){let t=Object.values(H.instances[this.bridgeId]),n=t.find(n=>F(n,this.__id__,t)&&Sn(e,n));return n?n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(H.instances[this.bridgeId]);return t.filter(n=>F(n,this.__id__,t)&&Sn(e,n))}selectOwnerComponent(){let e=Object.values(H.instances[this.bridgeId]);for(let t of e)if(t.id===this.__parentId__)return t;return null}createIntersectionObserver(e){return Ut(this,e)}groupSetData(e){if(!n(e)){console.warn(`[service] groupSetData callback must be a function`);return}this.__groupSetDataMode__=!0,un(this.bridgeId),this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];try{T(this,e,[],`groupSetData callback`)}finally{if(this.__groupSetDataMode__=!1,this.__groupSetDataBuffer__&&Object.keys(this.__groupSetDataBuffer__).length>0){let e=this.__groupSetDataBuffer__,t=this.__groupSetDataCallbacks__,n=this.__groupSetDataChanges__;this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];let r=Tn(this,H.instances[this.bridgeId],e);P(this.bridgeId,this.__id__,e,ln(this,t),n),r.forEach(({child:e,data:t})=>{P(this.bridgeId,e.__id__,t)})}else this.__groupSetDataBuffer__={},this.__groupSetDataChanges__=[],this.__groupSetDataCallbacks__=[];dn(this.bridgeId)}}createMediaQueryObserver(e){return qt(this,e)}getRelationNodes(e){let t=this.__relations__.get(e);return t?[...t]:null}animate(e,t,r,i,a){n(i)&&(a=i,i=void 0),w(`componentAnimate`,{moduleId:this.__id__,selector:e,keyframes:t,duration:r,timeline:i,success:a},`render`)}clearAnimation(e,t,r){n(t)&&(r=t,t={}),w(`componentClearAnimation`,{moduleId:this.__id__,selector:e,options:t||{},success:r},`render`)}async triggerEvent(t,n,r={}){if(!t)return;let i=t.trim();if(!i)return;let a={bubbles:r.bubbles===!0,composed:r.composed===!0,capturePhase:r.capturePhase===!0},o={id:this.id,dataset:this.dataset||{}},s=!1,c=!1,l={type:i,timeStamp:Date.now(),detail:n,bubbles:a.bubbles,composed:a.composed,currentTarget:null,target:o,preventDefault(){c=!0},stopPropagation(){s=!0}};Object.defineProperty(l,"defaultPrevented",{enumerable:!0,get:()=>c});let u=e.prototype.getCustomEventPath.call(this,a.composed),d=async(e,t)=>{let n=yn(e.eventAttr,i);if(!n)return;let r=t?n.captureCatch??n.captureBind:n.catch??n.bind;if(!r)return;l.currentTarget=e.currentTarget;let a=await H.triggerEvent({bridgeId:this.bridgeId,moduleId:e.moduleId,methodName:r,event:l});(t?n.captureCatch:n.catch)&&l.stopPropagation(),a===!1&&(l.preventDefault(),l.stopPropagation())};if(a.capturePhase)for(let e=u.length-1;e>=0&&!s;e--)await d(u[e],!0);if(s)return;let f=a.bubbles?u:u.slice(0,1);for(let e of f)if(await d(e,!1),s)break}getCustomEventPath(e){let t=[{moduleId:this.__pageId__,eventAttr:this.__eventAttr__||{},currentTarget:{id:this.id,dataset:this.dataset||{}}}];if(Array.isArray(this.__eventPath__)){let n=this.__eventPath__.filter(e=>e?.moduleId).map(e=>{let t=e.isComponentHost&&e.nodeModuleId?H.instances[this.bridgeId]?.[e.nodeModuleId]:null;return{moduleId:e.moduleId,nodeModuleId:e.nodeModuleId,isComponentHost:e.isComponentHost===!0,eventAttr:e.eventAttr||{},currentTarget:{id:t?.id??e.targetInfo?.id,dataset:t?.dataset||e.targetInfo?.dataset||{}}}}),r=H.instances[this.bridgeId]||{},i=new Set([this.__id__]),a=0,o=r[this.__parentId__];for(;o?.__isComponent__&&!i.has(o.__id__);){i.add(o.__id__);let e=n.findIndex(e=>e.isComponentHost&&e.nodeModuleId===o.__id__);if(e>=0)a=Math.max(a,e+1);else if(Object.keys(o.__eventAttr__||{}).length>0){let e=-1;for(let t=0;t<n.length;t++)n[t].moduleId===o.__id__&&(e=t);let t=Math.max(a,e+1);n.splice(t,0,{moduleId:o.__pageId__,nodeModuleId:o.__id__,isComponentHost:!0,eventAttr:o.__eventAttr__,currentTarget:{id:o.id,dataset:o.dataset||{}}}),a=t+1}o=r[o.__parentId__]}for(let r of n)(e||r.moduleId===this.__pageId__)&&t.push(r);return t}let n=H.instances[this.bridgeId]||{},r=new Set([this.__id__]),i=n[this.__parentId__];for(;i?.__isComponent__&&!r.has(i.__id__);)r.add(i.__id__),(e||i.__pageId__===this.__pageId__)&&t.push({moduleId:i.__pageId__,eventAttr:i.__eventAttr__||{},currentTarget:{id:i.id,dataset:i.dataset||{}}}),i=n[i.__parentId__];return t}pageReady(){this.__isComponent__||T(this,this.ready,[],`ready lifetime`)}pageUnload(){this.__isComponent__||T(this,this.onUnload,[],`onUnload`)}pageScrollTop(e){if(!this.__isComponent__){let{scrollTop:t}=e;T(this,this.onPageScroll,[{scrollTop:t}],`onPageScroll`)}}pagePullDownRefresh(){this.__isComponent__||T(this,this.onPullDownRefresh,[],`onPullDownRefresh`)}pageReachBottom(){this.__isComponent__||T(this,this.onReachBottom,[],`onReachBottom`)}pageShareAppMessage(e={}){if(!this.__isComponent__)return T(this,this.onShareAppMessage,[e],`onShareAppMessage`)}pageTabItemTap(e={}){this.__isComponent__||T(this,this.onTabItemTap,[e],`onTabItemTap`)}pageShow(){E(this,this.__info__.behaviorPageLifetimes?.show,[],`page show lifetime`),T(this,this.onShow,[],`page show lifetime`)}pageHide(){E(this,this.__info__.behaviorPageLifetimes?.hide,[],`page hide lifetime`),T(this,this.onHide,[],`page hide lifetime`)}pageResize(e){E(this,this.__info__.behaviorPageLifetimes?.resize,[e],`page resize lifetime`),T(this,this.resize,[e],`page resize lifetime`)}componentRouteDone(){E(this,this.__info__.behaviorPageLifetimes?.routeDone,[],`page routeDone lifetime`),T(this,this.routeDone,[],`page routeDone lifetime`)}componentCreated(){E(this,this.__info__.behaviorLifetimes?.created,[],`created lifetime`),T(this,this.created,[],`created lifetime`)}componentAttached(){E(this,this.__info__.behaviorLifetimes?.attached,[],`attached lifetime`),T(this,this.attached,[],`attached lifetime`),this.#r()}componentReadied(){E(this,this.__info__.behaviorLifetimes?.ready,[],`ready lifetime`),T(this,this.ready,[],`ready lifetime`)}componentMoved(){E(this,this.__info__.behaviorLifetimes?.moved,[],`moved lifetime`),T(this,this.moved,[],`moved lifetime`);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)}}componentDetached(){this.__componentAttached__=!1,E(this,this.__info__.behaviorLifetimes?.detached,[],`detached lifetime`),T(this,this.detached,[],`detached lifetime`);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.#c(t,r,n)}this.#h(),this.initd=!1}#h(){let e=Object.values(H.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];T(t,i?.unlinked,[this],`relation unlinked callback`)}}}componentError(e){E(this,this.__info__.behaviorLifetimes?.error,[e],`error lifetime`,!1),T(this,this.error,[e],`error lifetime`,!1)}},I=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,xn(this.moduleInfo,this.behaviors),this.noReferenceData=mn(this.moduleInfo.data||{})}getProps(){let e=hn(this.moduleInfo.properties),t=Array.isArray(this.behaviors)?this.behaviors.filter(e=>typeof e==`string`&&e.startsWith(`wx://`)):[];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 t.length&&(e||={},e.__diminaMeta={builtinBehaviors:t}),e}},kn=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=v(e.noReferenceData),this.__defaultData__=v(e.noReferenceData),this.__type__=e.type,this.__id__=t.moduleId,this.__info__=e.moduleInfo,this.__hotUpdateMemberKeys__=new Set,this.__childPropsBindings__={},this.__pendingInitSetDataCallbacks__=[]}init({deferInitialData:e=!1}={}){this.#e(),this.#r(),e||this.sendInitialData()}sendInitialData(){this.__initialDataSent__||(this.__initialDataSent__=!0,C.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__=[],P(this.bridgeId,this.__id__,{},ln(this,e))}setData(e,t){let n=an(this,e,t);if(!n)return;if(!this.initd){this.__pendingInitSetDataCallbacks__.push(...n.callbacks);return}let r=Tn(this,H.instances[this.bridgeId],n.changedData);P(this.bridgeId,this.__id__,n.changedData,ln(this,n.callbacks),n.changes),r.forEach(({child:e,data:t})=>{P(this.bridgeId,e.__id__,t)})}createSelectorQuery(){return It().in(this)}getTabBar(){let e=Object.values(H.instances[this.bridgeId]||{});return e.find(t=>t?.__isComponent__&&t.__isCustomTabBar__&&F(t,this.__id__,e))||null}selectComponent(e){let t=Object.values(H.instances[this.bridgeId]||{}),n=t.find(n=>F(n,this.__id__,t)&&Sn(e,n));return n?n.hasBehavior&&n.hasBehavior(`wx://component-export`)&&n.export?n.export():n:null}selectAllComponents(e){let t=Object.values(H.instances[this.bridgeId]||{});return t.filter(n=>F(n,this.__id__,t)&&Sn(e,n)).map(e=>e.hasBehavior&&e.hasBehavior(`wx://component-export`)&&e.export?e.export():e)}#e(){this.#n(!1)}hotUpdate(e){let t=this.__defaultData__||{},n=e.noReferenceData||{};this.__type__=e.type,this.__info__=e.moduleInfo,this.#n(!0);let r=jn(this.data,t,n),{dataPatch:i,deletedKeys:a}=Nn(this.data,r);this.__defaultData__=v(n),(Object.keys(i).length>0||a.length>0)&&this.#t(i,a)}#t(e,t){let n=Array.from(new Set([...Object.keys(e),...t]));if(n.length===0)return;let r={},i=this.__info__||{};for(let e of t)r[e]=this.data[e],delete this.data[e];for(let t of Object.keys(e))t in r||(r[t]=this.data[t]),this.data[t]=e[t];if(i.observers&&vn(n,i.observers,this.data,this,r),bn(this,n,r),!this.initd)return;let a={...e};for(let e of t)a[e]=void 0;let o=Tn(this,H.instances[this.bridgeId],a);P(this.bridgeId,this.__id__,e,void 0,t),o.forEach(({child:e,data:t})=>{P(this.bridgeId,e.__id__,t)})}#n(e){for(let e of this.__hotUpdateMemberKeys__)e in this.__info__||delete this[e];this.__hotUpdateMemberKeys__.clear();for(let t in this.__info__){if(e&&t===`data`)continue;let r=this.__info__[t];n(r)?(this[t]=r.bind(this),this.__hotUpdateMemberKeys__.add(t)):(this[t]=r,t!==`data`&&this.__hotUpdateMemberKeys__.add(t))}}#r(){E(this,this.__info__.behaviorLifetimes?.created,[],`created lifetime`),T(this,this.created,[],`created lifetime`),E(this,this.__info__.behaviorLifetimes?.attached,[],`attached lifetime`),T(this,this.attached,[],`attached lifetime`),T(this,this.onLoad,[this.opts.query||{}],`onLoad`),this.initd=!0}pageShow(){E(this,this.__info__.behaviorPageLifetimes?.show,[],`page show lifetime`),T(this,this.onShow,[],`onShow`)}pageHide(){E(this,this.__info__.behaviorPageLifetimes?.hide,[],`page hide lifetime`),T(this,this.onHide,[],`onHide`)}pageReady(){E(this,this.__info__.behaviorLifetimes?.ready,[],`ready lifetime`),T(this,this.ready,[],`ready lifetime`),T(this,this.onReady,[],`onReady`)}pageUnload(){E(this,this.__info__.behaviorLifetimes?.detached,[],`detached lifetime`),T(this,this.detached,[],`detached lifetime`),T(this,this.onUnload,[],`onUnload`),this.initd=!1}pageScrollTop(e){let{scrollTop:t}=e;T(this,this.onPageScroll,[{scrollTop:t}],`onPageScroll`)}pagePullDownRefresh(){T(this,this.onPullDownRefresh,[],`onPullDownRefresh`)}pageReachBottom(){T(this,this.onReachBottom,[],`onReachBottom`)}pageShareAppMessage(e={}){return T(this,this.onShareAppMessage,[e],`onShareAppMessage`)}pageTabItemTap(e={}){T(this,this.onTabItemTap,[e],`onTabItemTap`)}pageResize(e){E(this,this.__info__.behaviorPageLifetimes?.resize,[e],`page resize lifetime`),T(this,this.onResize,[e],`onResize`)}};function An(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var L=Symbol(`hot-update-removed`);function jn(e,t,n){let r=Mn(e,t,n);return r===L?{}:r}function Mn(e,t,n){if(In(e,t))return Fn(n);if(!An(e)||!An(t)||!An(n))return Fn(e);let r={},i=new Set([...Object.keys(e),...Object.keys(t),...Object.keys(n)]);for(let a of i){let i=Mn(Pn(e,a),Pn(t,a),Pn(n,a));i!==L&&(r[a]=i)}return r}function Nn(e,t){let n={},r=[],i=new Set([...Object.keys(e||{}),...Object.keys(t||{})]);for(let o of i){let i=Object.prototype.hasOwnProperty.call(e||{},o);if(!Object.prototype.hasOwnProperty.call(t||{},o)){i&&r.push(o);continue}(!i||!a(e[o],t[o]))&&(n[o]=v(t[o]))}return{dataPatch:n,deletedKeys:r}}function Pn(e,t){return!An(e)||!Object.prototype.hasOwnProperty.call(e,t)?L:e[t]}function Fn(e){return e===L?L:v(e)}function In(e,t){return e===L||t===L?e===t:a(e,t)}var R=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,xn(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=mn(this.moduleInfo.data||{})}},Ln={flushBulkSize:20,flushInterval:15e3,enableAutoTrack:!0,enablePageView:!0,enablePageLeave:!0,enableClick:!0,debug:!1,disableSDK:!1,enableLog:!1,requireConsentBeforeTrack:!1,instantEvents:[],pageBlacklist:[],networkPolicy:`all`},Rn={QUEUED:`queued`,FLUSHING:`flushing`,FAILED:`failed`};function zn(e={}){if(!e.serverUrl)throw Error(`analytics.init requires serverUrl`);if(!e.miniappId)throw Error(`analytics.init requires miniappId`);if(!e.miniappVersion)throw Error(`analytics.init requires miniappVersion`);let t={...Ln,...e};return t.instantEvents=Array.isArray(t.instantEvents)?[...t.instantEvents]:[],t.pageBlacklist=Array.isArray(t.pageBlacklist)?[...t.pageBlacklist]:[],t}function Bn(e){let t=new Map,n=new Set;function r(r){if(n.has(r.__id__))return;let i=Date.now(),a=t.get(r.__id__);e.track(`$MPPageLeave`,{page_path:r.route,duration:Math.max(0,i-(a??i))},{isAutoTrack:!0}),t.delete(r.__id__),n.add(r.__id__)}return{onAppLaunch(t={}){e.track(`$MPLaunch`,{scene:t.scene||``},{isAutoTrack:!0})},onAppShow(){e.track(`$MPShow`,{},{isAutoTrack:!0})},onAppHide(){e.track(`$MPHide`,{},{isAutoTrack:!0})},onPageShow(r){t.set(r.__id__,Date.now()),n.delete(r.__id__),e.track(`$MPViewScreen`,{page_path:r.route},{isAutoTrack:!0})},onPageHide(e){r(e)}}}function z(e){return Array.isArray(e)?e.map(e=>z(e)):e&&typeof e==`object`?Object.keys(e).reduce((t,n)=>(t[n]=z(e[n]),t),{}):e}function Vn(){let e=``,t=``,n={},r=null,i={};return{identify(t){e=t},login(e){t=e},logout(){t=``},registerSuperProperties(e={}){n={...n,...z(e)}},registerDynamicSuperProperties(e){r=e},setPageProperties(e={}){i={...i,...z(e)}},getSnapshot(){let a=typeof r==`function`&&r()||{};return{anonymousId:e,loginId:t,distinctId:t||e,superProperties:z(n),dynamicProps:z(a),pageProperties:z(i)}}}}function Hn(e){return Array.isArray(e)?e.map(e=>Hn(e)):e&&typeof e==`object`?Object.keys(e).reduce((t,n)=>(t[n]=Hn(e[n]),t),{}):e}function Un(e,t){let{context:n,hostContext:r={},pageContext:i={},miniappId:a,miniappVersion:o}=t,s=n.getSnapshot(),c=Hn({...s.superProperties,...s.dynamicProps,...s.pageProperties,page_path:i.pagePath||``,referrer:i.referrer||``,host_app_version:r.hostAppVersion||``,platform:r.platform||``,miniapp_id:a,miniapp_version:o,...e.properties||{}});return{event:e.event,type:e.type||`track`,time:e.time||new Date().toISOString(),distinct_id:s.distinctId,anonymous_id:s.anonymousId,login_id:s.loginId||``,is_autotrack:!!e.isAutoTrack,properties:c}}function Wn({storageKey:e,maxCacheSize:t}){let n=[];function r(e){return JSON.parse(JSON.stringify(e))}function i(e){let n=e.map(e=>r(e));return n.length<=t?n:n.slice(n.length-t)}function a(e){return i(e).map(e=>({...e,status:e.status===Rn.FLUSHING?Rn.QUEUED:e.status}))}function o(){wx.setStorageSync(e,JSON.stringify(n))}return{enqueue(e){n=i(n.concat(e)),o()},restore(){let t=wx.getStorageSync(e);return n=t?a(JSON.parse(t)):[],o(),i(n)},getAll(){return i(n)},replace(e){n=i(e),o()},clear(){n=[],wx.removeStorageSync(e)}}}function Gn({request:e,storage:t,config:n}){return{async flush(){let r=t.getAll();if(!r.length)return;let i=r.map(e=>({...e,status:Rn.FLUSHING})),a=new Set(i.map(e=>e.id));t.replace(i);try{await new Promise((t,r)=>{e({url:n.serverUrl,method:`POST`,data:{events:i},success:e=>{if(e.statusCode>=200&&e.statusCode<300){t(e);return}r(Error(`analytics upload failed with status ${e.statusCode}`))},fail:r})}),t.replace(t.getAll().filter(e=>!a.has(e.id)))}catch(e){throw t.replace(t.getAll().map(e=>a.has(e.id)?{...e,status:Rn.QUEUED}:e)),e}}}}var B=new class{constructor(){this.config=null,this.context=Vn(),this.storage=null,this.uploader=null,this.autotrack=null}init(e){return this.config=zn(e),this.storage=Wn({storageKey:`analytics_queue_${this.config.miniappId}`,maxCacheSize:this.config.maxCacheSize||1e3}),this.storage.restore(),this.uploader=Gn({request:e=>wx.request(e),storage:this.storage,config:this.config}),this.autotrack=Bn(this),this.config}identify(e){this.context.identify(e)}login(e){this.context.login(e)}logout(){this.context.logout()}registerSuperProperties(e){this.context.registerSuperProperties(e)}registerDynamicSuperProperties(e){this.context.registerDynamicSuperProperties(e)}setPageProperties(e){this.context.setPageProperties(e)}getHostContext(){return x.getAnalyticsBaseContext?.()||{}}getPageContext(){let e=S.getPageInfo?.()||{};return{pagePath:e.route||e.is||``,referrer:e.__analyticsReferrer__||``}}track(e,t={},n={}){if(!this.config||this.config.disableSDK)return null;let r=Un({event:e,properties:t,isAutoTrack:!!n.isAutoTrack,type:n.type||`track`},{context:this.context,hostContext:this.getHostContext(),pageContext:this.getPageContext(),miniappId:this.config.miniappId,miniappVersion:this.config.miniappVersion});return this.storage.enqueue({id:`${Date.now()}_${Math.random().toString(16).slice(2)}`,status:Rn.QUEUED,...r}),this.config.instantEvents.includes(e)&&this.flush().catch(()=>{}),r}flush(){return this.uploader?.flush()||Promise.resolve()}},Kn=t({__appEventTestHooks:()=>ur,notifyAppError:()=>lr,notifyAppHide:()=>cr,notifyAppShow:()=>sr,offAppHide:()=>rr,offAppShow:()=>nr,offError:()=>$n,onAppHide:()=>tr,onAppRoute:()=>or,onAppShow:()=>er,onError:()=>Qn,onPageNotFound:()=>ar,onUnhandledRejection:()=>ir}),qn=new Set,Jn=new Set,Yn=new Set;function Xn(e,t,n){for(let r of Array.from(e))try{t===void 0?r():r(t)}catch(e){console.error(`[service] ${n} callback error:`,e)}}function Zn(e){if(typeof e==`string`)return e;if(e?.message)return e.stack||e.message;if(e?.errMsg)return e.errMsg;try{return JSON.stringify(e)}catch{return String(e)}}function Qn(e){n(e)&&Yn.add(e)}function $n(e){n(e)?Yn.delete(e):Yn.clear()}function er(e){n(e)&&qn.add(e)}function tr(e){n(e)&&Jn.add(e)}function nr(e){n(e)?qn.delete(e):qn.clear()}function rr(e){n(e)?Jn.delete(e):Jn.clear()}function ir(){}function ar(){}function or(){}function sr(e){Xn(qn,e,`onAppShow`)}function cr(){Xn(Jn,void 0,`onAppHide`)}function lr(e){Xn(Yn,Zn(e),`onError`)}var ur={appShowCallbacks:qn,appHideCallbacks:Jn,errorCallbacks:Yn,notifyAppShow:sr,notifyAppHide:cr,notifyAppError:lr},dr=class{static type=`app`;constructor(e){this.moduleInfo=e}},fr=0,pr=65536;function mr(e,t){try{C.send({type:e,target:`render`,body:{bridgeId:C.getBridgeId?.()||S.getPageInfo()?.id,...t}})}catch{}}function hr(e,t,n){gr()&&mr(`print`,{type:`log`,detail:{group:`network`,action:e,id:t,value:n}})}function gr(){return x.get(`vConsoleEnabled`)===!0}function _r(e){if(e==null)return 0;try{return new Blob([typeof e==`string`?e:JSON.stringify(e)]).size}catch{return String(e).length}}function vr(e){if(e==null||_r(e)<=pr)return e;if(typeof e==`string`)return`${e.slice(0,pr)}...[truncated]`;try{return`${JSON.stringify(e).slice(0,pr)}...[truncated]`}catch{return`${String(e).slice(0,pr)}...[truncated]`}}function yr(e){return!e||typeof e!=`object`?null:e}function br(e={},t){return Object.prototype.hasOwnProperty.call(e,`data`)?e.data:t===`downloadFile`?e.filePath||e.tempFilePath||``:e.errMsg||``}function xr(e={}){return!e||typeof e!=`object`?!1:Object.prototype.hasOwnProperty.call(e,`data`)||Object.prototype.hasOwnProperty.call(e,`statusCode`)||Object.prototype.hasOwnProperty.call(e,`header`)||Object.prototype.hasOwnProperty.call(e,`cookies`)}function Sr(e={}){return xr(e)?!0:typeof e?.errMsg==`string`&&e.errMsg.includes(`:fail`)}function Cr(e,t={}){let n=t.responseType||t.dataType;if(typeof n==`string`&&n)return n.toLowerCase();if(typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView?.(e)))return`arraybuffer`;if(typeof e==`string`){let t=e.trim();return t.startsWith(`{`)&&t.endsWith(`}`)||t.startsWith(`[`)&&t.endsWith(`]`)?`json`:`text`}return e&&typeof e==`object`?`json`:`text`}function wr(e,t){if(e==null)return e;if(t===`json`){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function Tr(e,t={}){let n=`dimina_${Date.now()}_${++fr}`,r=Date.now(),i=(t.method||(e===`uploadFile`?`POST`:`GET`)).toUpperCase(),a=vr(e===`uploadFile`?t.formData:t.data);hr(`add`,n,{id:n,method:i,url:t.url||``,status:0,readyState:1,requestType:`custom`,requestHeader:yr(t.header),responseType:t.responseType||t.dataType||``,startTime:r,postData:a??null});let o=!1,s=(i={},a=!1)=>{if(o)return;o=!0;let s=br(i,e),c=Cr(s,t),l=wr(s,c),u=_r(s),d=vr(l),f=Date.now();hr(`update`,n,{id:n,status:a?0:i.statusCode||200,statusText:i.errMsg||(a?`fail`:`ok`),readyState:4,header:yr(i.header),responseType:c,response:d,responseSize:u,endTime:f,costTime:f-r})};return{wrapOptions(e={}){return{...e,success(t){s(t,!1),e.success?.(t)},fail(t){s(t,!0),e.fail?.(t)},complete(t){Sr(t)&&s(t,t?.errMsg?.includes(`:fail`)),e.complete?.(t)}}}}}function Er(e){return e}function Dr(e){if(typeof e==`string`)return e;if(e===void 0)return`undefined`;try{return JSON.stringify(e)}catch{return String(e)}}function Or(e,t){e&&mr(`debugStorage`,{action:`set`,key:Er(e),value:Dr(t)})}function kr(e){e&&mr(`debugStorage`,{action:`remove`,key:Er(e)})}function Ar(){mr(`debugStorage`,{action:`clear`,prefix:Er(``)})}var V=new class{constructor(){this.staticModules={}}loadResource(e){let{appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a,resourceLoadId:o}=e;if(ee&&(this.isScriptLoaded=this.isScriptLoaded||{},!this.isScriptLoaded[i])){let e=`${a}${t}/${i}/logic.js`;globalThis.importScripts(e),this.isScriptLoaded[i]=!0}S.setInitId(n),y(`app`),y(r),C.invoke({type:`serviceResourceLoaded`,target:`service`,body:{bridgeId:n,resourceLoadId:o}})}hotUpdateResource(e){let{appId:t,pagePath:n,root:r=`main`,baseUrl:i=`/`}=e;if(typeof globalThis.importScripts!=`function`)return!1;let a=`${i}${t}/${r}/logic.js?t=${Date.now()}`,o=globalThis.modDefine,s=globalThis.__diminaHotUpdating;try{return globalThis.__diminaHotUpdating=!0,globalThis.modDefine=se,globalThis.importScripts(a),n&&y(n),!0}finally{globalThis.modDefine=o,globalThis.__diminaHotUpdating=s}}createAppModule(e){let t=new dr(e);this.staticModules[dr.type]=t}createModule(e,t,n){let{path:r}=t;this.staticModules[r]||this.#e(e,t,n)}hotUpdateModule(e,t,n){this.#e(e,t,n)}#e(e,t,n){let{path:r,usingComponents:i}=t;if(i)for(let e of Object.values(i))y(e);if(n===R.type){let n=new R(e,t);this.staticModules[r]=n}else if(n===I.type){let n=new I(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[dr.type]}getModuleByPath(e){return this.staticModules[e]}},H=new class{constructor(){this.app=void 0,this.defaultApp={},this.appLaunchOptions={},this.instances={},this.pageStates=new Map}setAppLaunchOptions(e){this.app||(this.appLaunchOptions=e)}getApp(e={}){return e.allowDefault?this.app||this.defaultApp:this.app}getPageState(e){return this.pageStates.has(e)||this.pageStates.set(e,{hidden:!1,pendingReady:!1,pendingShow:!1,ready:!1,shown:!1}),this.pageStates.get(e)}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=this.appLaunchOptions){if(this.app){console.log(`[service] app instance already existed`);return}let{scene:t,pagePath:n,query:r}=e||{},i=V.getAppModule();if(!i){console.log(`[service] app instance is not exist`);return}console.log(`[service] create app instance`),Object.assign(i.moduleInfo,this.defaultApp),this.defaultApp={},this.app=new ot(i,{scene:t,path:n,query:r}),B.autotrack?.onAppLaunch({scene:t,path:n,query:r})}appShow(){this.app?.appShow(),sr(this.app?.options),B.autotrack?.onAppShow()}appHide(){this.app?.appHide(),cr(),B.autotrack?.onAppHide()}stackShow(e){S.pushStack(e)}stackHide(e){S.popStack(e)}createInstance(e){let{bridgeId:t,moduleId:n,path:r,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,propertyNames:l,targetInfo:u,stackId:d,isCustomTabBar:f=!1,deferInitialData:p=!1}=e,m=V.getModuleByPath(r);if(!m){console.error(`[service] ${r} not exist`);return}if(this.instances[t]=this.instances[t]||{},m.type===I.type){let e=new On(m,{bridgeId:t,moduleId:n,path:r,isCustomTabBar:f,query:i,eventAttr:a,pageId:o,parentId:s,properties:c,propertyNames:l,targetInfo:u});this.instances[t][n]=e,m.isComponent||S.push(e,d),e.init({deferInitialData:p});let h=this.getPageState(t);return!m.isComponent&&h.pendingShow&&!h.hidden&&this.pageShow({bridgeId:t,moduleId:n}),e}if(m.type===R.type){let e=new kn(m,{bridgeId:t,moduleId:n,path:r,query:i});this.instances[t][n]=e,S.push(e,d),e.init({deferInitialData:p});let a=this.getPageState(t);return a.pendingShow&&!a.hidden&&this.pageShow({bridgeId:t,moduleId:n}),e}console.error(`[service] ${m.type} instance is not exist.`)}moduleAttached(e){let{bridgeId:t,moduleId:n,parentId:r}=e,i=this.instances[t]?.[n];if(!i||i.__type__!==I.type||!i.__isComponent__||i.__componentAttached__||i.__componentAttaching__)return;r&&this.instances[t]?.[r]&&(i.__parentId__=r);let a=this.instances[t]?.[i.__parentId__];if(a?.__isComponent__&&!a.__componentAttached__){i.__componentAttachPending__=!0;return}i.__componentAttachPending__=!1,i.__componentAttaching__=!0;try{i.__componentAttached__=!0,i.componentAttached(),i.__componentAttaching__=!1,this.getPageState(t).shown&&!i.__pageShown__&&(i.__pageShown__=!0,i.pageShow());let e=Object.values(this.instances[t]||{}).filter(e=>e?.__parentId__===n&&e.__componentAttachPending__);for(let n of e)this.moduleAttached({bridgeId:t,moduleId:n.__id__});if(i.__pendingReadyOpts__){let e=i.__pendingReadyOpts__;delete i.__pendingReadyOpts__,this.moduleReady(e)}}finally{i.__componentAttaching__=!1}}moduleReady(e){let{bridgeId:t,moduleId:n,propBindings:r,eventPath:i}=e,a=this.instances[t]?.[n];if(a){if(Array.isArray(i)&&(a.__eventPath__=i),r&&a.__parentId__){let e=this.instances[t]?.[a.__parentId__];e&&(e.__childPropsBindings__||={},e.__childPropsBindings__[n]=r)}if(a.__type__===I.type){if(a.__isComponent__&&!a.__componentAttached__){a.__pendingReadyOpts__=e;return}if(a.__componentReadied__)return;if(Object.values(this.instances[t]||{}).some(e=>e?.__isComponent__&&e.__componentAttached__&&!e.__componentReadied__&&this.isDescendantInstance(e,a,t))){a.__pendingReadyOpts__=e;return}a.__componentReadied__=!0,a.componentReadied(),this.flushPendingEvents(a),a.flushInitSetDataCallbacks?.();let n=this.getPageInstance(t);n&&this.checkAndCallPageReady(t,n.__id__);let r=this.instances[t]?.[a.__parentId__];for(;r?.__isComponent__;){if(r.__pendingReadyOpts__){let e=r.__pendingReadyOpts__;delete r.__pendingReadyOpts__,this.moduleReady(e)}r=this.instances[t]?.[r.__parentId__]}}}}isDescendantInstance(e,t,n){let r=e;for(;r?.__parentId__;){if(r.__parentId__===t.__id__)return!0;r=this.instances[n]?.[r.__parentId__]}return!1}moduleUnmounted(e){let{bridgeId:t,moduleId:n}=e,r=this.instances[t]?.[n];r&&(r.__type__===I.type&&(!r.__isComponent__||r.__componentAttached__)&&!r.__componentDetached__&&(r.componentDetached(),r.__componentDetached__=!0),delete this.instances[t][n])}pageShow(e){let{bridgeId:t}=e,n=this.getPageState(t);if(n.hidden=!1,n.pendingShow=!0,!this.instances[t])return;let r=this.getPageInstance(t);if(!r?.initd)return;if(n.shown){n.pendingShow=!1;return}n.shown=!0,n.pendingShow=!1;let i=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===R.type?i.push(e):e.__type__===I.type&&(e.__isComponent__?e.__componentAttached__&&!e.__pageShown__&&(e.__pageShown__=!0,e.pageShow()):i.push(e)))}),i.forEach(e=>{e.pageShow(),B.autotrack?.onPageShow(e)}),n.pendingReady&&this.pageReady({...e,moduleId:r.__id__})}pageReady(e){let{bridgeId:t,moduleId:n}=e,r=this.getPageState(t);r.pendingReady=!0;let i=this.instances[t]?.[n];i&&(r.hidden||!r.shown||r.ready||(i.__pageReadyPending__=!0,i.flushInitSetDataCallbacks?.(),this.checkAndCallPageReady(t,n)))}getPageInstance(e){let t=this.instances[e];return t?Object.values(t).find(e=>e&&(e.__type__===R.type||e.__type__===I.type&&!e.__isComponent__)):null}checkAndCallPageReady(e,t){let n=this.getPageState(e),r=this.instances[e]?.[t];if(!r||!r.__pageReadyPending__||!n.shown||n.ready)return;let i=this.instances[e];if(!i){r.__pageReadyPending__=!1,n.pendingReady=!1,n.ready=!0,r.pageReady();return}Object.values(i).filter(e=>e&&e.__type__===I.type&&e.__isComponent__&&e.initd&&!e.__componentReadied__).length===0&&(r.__pageReadyPending__=!1,n.pendingReady=!1,n.ready=!0,r.pageReady())}pageHide(e){let{bridgeId:t}=e,n=this.getPageState(t);if(n.hidden=!0,n.pendingShow=!1,!n.shown)return;n.shown=!1;let r=this.instances[t];if(!r||!r)return;let i=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===R.type?i.push(e):e.__type__===I.type&&(e.__isComponent__?e.__componentAttached__&&e.__pageShown__&&(e.__pageShown__=!1,e.pageHide()):i.push(e)))}),i.forEach(e=>{e&&(e.pageHide(),B.autotrack?.onPageHide(e))})}pageUnload(e){let{bridgeId:t}=e;if(!this.instances[t])return;let n=[],r=this.getInstancesInTreeOrder(t);this.getInstancesInTreeOrder(t,{postOrder:!0}).filter(e=>e?.__type__===I.type&&e.__isComponent__).forEach(e=>{e.__componentAttached__&&!e.__componentDetached__&&(e.componentDetached(),e.__componentDetached__=!0)}),r.forEach(e=>{e&&(e.__type__===I.type&&!e.__isComponent__&&!e.__componentDetached__?(n.push(e),e.componentDetached(),e.__componentDetached__=!0):e.__type__===R.type&&n.push(e),e.pageUnload())}),n.forEach(e=>{B.autotrack?.onPageHide(e)}),S.remove(t),delete this.instances[t],this.pageStates.delete(t)}getInstancesInTreeOrder(e,{postOrder:t=!1}={}){let n=Object.values(this.instances[e]||{}).filter(Boolean),r=new Map(n.map(e=>[e.__id__,e])),i=new Map,a=[];for(let e of n)if(e.__parentId__&&r.has(e.__parentId__)){let t=i.get(e.__parentId__)||[];t.push(e),i.set(e.__parentId__,t)}else a.push(e);let o=[],s=new Set,c=e=>{if(!(!e||s.has(e))){s.add(e),t||o.push(e);for(let t of i.get(e.__id__)||[])c(t);t&&o.push(e)}};return a.forEach(c),n.forEach(c),o}pageScroll(e){let{bridgeId:t,moduleId:n,scrollTop:r}=e,i=this.instances[t]?.[n];i&&i.pageScrollTop({scrollTop:r})}pagePullDownRefresh(e={}){this.getPageInstance(e.bridgeId)?.pagePullDownRefresh?.()}pageReachBottom(e={}){this.getPageInstance(e.bridgeId)?.pageReachBottom?.()}pageResize(e){let{bridgeId:t,size:n}=e;if(!this.instances[t])return;let r=[];this.getInstancesInTreeOrder(t).forEach(e=>{e&&(e.__type__===R.type?r.push(e):e.__type__===I.type&&(e.__isComponent__?e.__componentAttached__&&e.pageResize(n):r.push(e)))}),r.forEach(e=>e.pageResize(n))}async pageShareAppMessage(e={}){let t=this.getPageInstance(e.bridgeId);if(!t||!n(t.onShareAppMessage))return{};let r=await t.onShareAppMessage(e.event||{});return jr(r)?r:{}}pageTabItemTap({bridgeId:e,...t}){this.getPageInstance(e)?.pageTabItemTap(t)}componentError(e={}){let{bridgeId:t,moduleId:n}=e,r=this.instances[t]?.[n],i=e?.error||e?.message||e?.errMsg||e;if(!r){lr(i);return}r.__type__===I.type&&r.componentError(i),lr(i)}componentRouteDone(e){let{bridgeId:t}=e;this.instances[t]&&this.getInstancesInTreeOrder(t).forEach(e=>{e?.__type__===I.type&&(!e.__isComponent__||e.__componentAttached__)&&e.componentRouteDone()})}hotUpdateLogic(e={}){let{bridgeId:t}=e,r=this.instances[t];if(!r)return 0;let i=0;return Object.values(r).forEach(e=>{if(!e)return;let t=V.getModuleByPath(e.is);!t||!n(e.hotUpdate)||(e.hotUpdate(t),i++)}),i}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__===I.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})}};function jr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Mr=t({getEnterOptionsSync:()=>Pr,getLaunchOptionsSync:()=>Nr});function Nr(){return H.app?.options}function Pr(){return H.app?.options}var Fr=t({getAppBaseInfo:()=>Wr,getDeviceInfo:()=>Gr,getSystemInfo:()=>Vr,getSystemInfoAsync:()=>Ur,getSystemInfoSync:()=>Hr,getSystemSetting:()=>zr,getWindowInfo:()=>Rr,offThemeChange:()=>qr,onThemeChange:()=>Kr,openAppAuthorizeSetting:()=>Br,openSystemBluetoothSetting:()=>Lr}),Ir=new Set;x.onUpdate(e=>{let t=e.systemInfo?.theme;t&&Ir.forEach(e=>e({theme:t}))});function Lr(e){return w(`openSystemBluetoothSetting`,e)}function Rr(e){return w(`getWindowInfo`,e)}function zr(){return w(`getSystemSetting`)}function Br(e){return w(`openAppAuthorizeSetting`,e)}function Vr(e){return new Promise(t=>{t(w(`getSystemInfo`,e))})}function Hr(){return w(`getSystemInfoSync`)}function Ur(e){return w(`getSystemInfoAsync`,e)}function Wr(){return w(`getAppBaseInfo`)}function Gr(){return w(`getDeviceInfo`)}function Kr(e){n(e)&&Ir.add(e)}function qr(e){n(e)?Ir.delete(e):Ir.clear()}var Jr=t({extBridge:()=>U,extOffBridge:()=>Xr,extOnBridge:()=>Yr,offLoginStatusChanged:()=>Qr,onLoginStatusChanged:()=>Zr});function U({event:e,module:t,data:r={},success:i,fail:a,complete:o},s){let c=t||`DefaultModule`,l,u,d;return n(s)?(l=s,u=s):(l=i,u=a,d=o),w(e,{module:c,data:r,keep:r.isSustain??!0,success:l,fail:u,complete:d})}function Yr({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}`;w(i,{evtId:i,keep:r,success:n})}function Xr({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}let r=`${t}_${e}`;w(r,{evtId:r,success:n})}function Zr(e){C.on(`notifyLoginStatusChanged`,t=>{e?.(t)})}function Qr(){C.off(`notifyLoginStatusChanged`)}var $r=new Set;function ei(e){for(let t of e||[])typeof t==`string`&&t.length>0&&$r.add(t)}function ti(e){return typeof e==`string`&&$r.has(e)}var ni=t({captureScreen:()=>ri});function ri(e){if(ti(`captureScreen`))return w(`captureScreen`,e);let t={event:`captureScreen`,data:ii(e)};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),U(t)}function ii(e={}){let{success:t,fail:n,complete:r,...i}=e&&typeof e==`object`?e:{};return i}var ai=t({hideShareMenu:()=>fi,share:()=>si,shareMiniAppMessage:()=>li,shareToApp:()=>ci,showShareImageMenu:()=>di,showShareMenu:()=>ui});function oi(e={}){let t=e&&typeof e==`object`?e:{},n={};for(let e of[`provider`,`type`,`summary`,`href`,`imageUrl`])Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);if(t.file&&typeof t.file==`object`&&!Array.isArray(t.file)){let e={};for(let n of[`path`,`name`,`mimeType`])Object.prototype.hasOwnProperty.call(t.file,n)&&(e[n]=t.file[n]);Object.keys(e).length>0&&(n.file=e)}return n}function si(e){return U({event:`share`,data:oi(e)})}function ci(e){let t={event:`shareToApp`,data:oi(e)};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),U(t)}async function li(e={}){let t=e&&typeof e==`object`?e:{},n=t.imageUrl;pi(n)||(n=await mi());let r={title:t.title||``,path:t.path||gi(),type:hi(t),extraData:t.extraData||{},version:Hr()?.appVersion};n&&(r.imageUrl=n);let i={event:`shareMiniAppToIM`,data:r};return t.success&&(i.success=t.success),t.fail&&(i.fail=t.fail),t.complete&&(i.complete=t.complete),U(i)}function ui(e){return w(`showShareMenu`,e)}function di(e){return w(`showShareImageMenu`,e)}function fi(e){return w(`hideShareMenu`,e)}function pi(e){return typeof e==`string`&&e.includes(`http`)}function mi(){return new Promise(e=>{try{ri({success(t={}){e(t.imageUrl||t.tempFilePath||t.path||``)},fail(){e(``)}})}catch{e(``)}})}function hi(e){return Object.prototype.hasOwnProperty.call(e,`type`)?e.type:Nr()?.referrerInfo?.extraData?.envVersion||0}function gi(){let e=typeof getCurrentPages==`function`?getCurrentPages():[],t=e[e.length-1];if(!t)return``;let n=t.$page?.fullPath||t.fullPath||t.route||t.is||``,r=t.query||{},i=Object.keys(r).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`).join(`&`);return i&&!n.includes(`?`)?`${n}?${i}`:n}var _i=t({clearStorage:()=>Ai,clearStorageSync:()=>Ei,getStorage:()=>Oi,getStorageInfo:()=>Mi,getStorageInfoSync:()=>ji,getStorageSync:()=>wi,removeStorage:()=>ki,removeStorageSync:()=>Ti,replaceSyncStorageSnapshot:()=>Si,setStorage:()=>Di,setStorageSync:()=>Ci}),vi=null;function W(){return vi||={...x.getStorageSnapshot()},vi}function yi(e){return e.length===1&&Array.isArray(e[0])?e[0]:e}function bi(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function xi(e){return typeof e==`object`?JSON.stringify(e):String(e)}function Si(e={}){vi={...e}}function Ci(...e){let[t,n]=yi(e),r=W();r[t]=xi(n);let i=w(`setStorageSync`,[t,n]);return Or(t,n),i}function wi(e){let[t]=yi([e]),n=W();return Object.prototype.hasOwnProperty.call(n,t)?bi(n[t]):``}function Ti(e){let[t]=yi([e]),n=W();delete n[t];let r=w(`removeStorageSync`,t);return kr(t),r}function Ei(){W(),vi={};let e=w(`clearStorageSync`);return Ar(),e}function Di(e){return w(`setStorage`,{...e,success(t){let n=W();n[e?.key]=xi(e?.data),Or(e?.key,e?.data),e?.success?.(t)},fail:e?.fail,complete:e?.complete})}function Oi(e){return w(`getStorage`,e)}function ki(e){return w(`removeStorage`,{...e,success(t){let n=W();delete n[e?.key],kr(e?.key),e?.success?.(t)},fail:e?.fail,complete:e?.complete})}function Ai(e={}){return w(`clearStorage`,{...e,success(t){W(),vi={},Ar(),e?.success?.(t)},fail:e?.fail,complete:e?.complete})}function ji(){let e=W();return{keys:Object.keys(e),currentSize:Object.values(e).reduce((e,t)=>e+String(t??``).length,0),limitSize:10485760}}function Mi(e){return w(`getStorageInfo`,e)}var Ni=t({flushAnalytics:()=>Hi,identifyAnalytics:()=>Ri,initAnalytics:()=>Pi,loginAnalytics:()=>Ii,logoutAnalytics:()=>Li,registerAnalyticsDynamicSuperProperties:()=>Bi,registerAnalyticsSuperProperties:()=>zi,setAnalyticsPageProperties:()=>Vi,trackAnalytics:()=>Fi});function Pi(e){return B.init(e)}function Fi(e,t={}){return B.track(e,t)}function Ii(e){return B.login(e)}function Li(){return B.logout()}function Ri(e){return B.identify(e)}function zi(e){return B.registerSuperProperties(e)}function Bi(e){return B.registerDynamicSuperProperties(e)}function Vi(e){return B.setPageProperties(e)}function Hi(){return B.flush()}var Ui=t({chooseMessageFile:()=>ha,fileSystemManagerAPINames:()=>fa,getFileSystemManager:()=>ma}),Wi=`__diminaArrayBufferBase64`,Gi=`__diminaFileDataBase64`,Ki=`__diminaFileDataType`,G=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,qi=(()=>{let e={};for(let t=0;t<64;t++)e[G[t]]=t;return e})();function Ji(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function Yi(e){return e&&e.buffer&&Ji(e.buffer)}function Xi(e){return Ji(e)?e:Yi(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function Zi(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=G[t[r]>>2],n+=G[(t[r]&3)<<4|t[r+1]>>4],n+=G[(t[r+1]&15)<<2|t[r+2]>>6],n+=G[t[r+2]&63];return r<t.length&&(n+=G[t[r]>>2],r+1<t.length?(n+=G[(t[r]&3)<<4|t[r+1]>>4],n+=G[(t[r+1]&15)<<2],n+=`=`):(n+=G[(t[r]&3)<<4],n+=`==`)),n}function Qi(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=qi[t[e]],o=qi[t[e+1]],s=t[e+2]===`=`?0:qi[t[e+2]],c=t[e+3]===`=`?0:qi[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function $i(e){let t=Xi(e);return t?{[Ki]:`base64`,[Gi]:Zi(t)}:e}function K(e,t=[`data`,`arrayBuffer`]){if(!e||typeof e!=`object`)return e;let n={...e};for(let e of t)e in n&&(n[e]=$i(n[e]));return n}function ea(e){return e&&typeof e==`object`&&e[Wi]!==void 0?Qi(e[Wi]):e}function ta(e){return e&&typeof e==`object`&&e.data!==void 0?{...e,data:ea(e.data)}:e}function na(e){if(!e||typeof e!=`object`||!e.entries||typeof e.entries!=`object`)return e;let t={};for(let[n,r]of Object.entries(e.entries))t[n]=r&&typeof r==`object`&&r.data!==void 0?{...r,data:ea(r.data)}:r;return{...e,entries:t}}function ra(e,t,n=0){if(!e||typeof e!=`object`||!t||e[Wi]===void 0)return e;let r=new Uint8Array(Qi(e[Wi]));new Uint8Array(t).set(r,n);let{[Wi]:i,...a}=e;return{...a,arrayBuffer:t}}function ia(e){let t={...e},n=Xi(e?.arrayBuffer);return n&&(t.arrayBufferLength=n.byteLength,delete t.arrayBuffer),t}var aa=class{constructor(e={}){this.mode=e.mode,this.size=e.size,this.lastAccessedTime=e.lastAccessedTime,this.lastModifiedTime=e.lastModifiedTime,this._isDirectory=!!e.isDirectory,this._isFile=!!e.isFile}isDirectory(){return this._isDirectory}isFile(){return this._isFile}};function oa(e){return e&&typeof e==`object`&&typeof e.size==`number`&&Object.prototype.hasOwnProperty.call(e,`isDirectory`)&&Object.prototype.hasOwnProperty.call(e,`isFile`)}function sa(e){if(!e||typeof e!=`object`||typeof e.isDirectory==`function`&&typeof e.isFile==`function`)return e;if(oa(e))return new aa(e);if(Array.isArray(e))return e.map(e=>sa(e));let t={};for(let[n,r]of Object.entries(e))t[n]=sa(r);return t}function ca(e){if(e&&typeof e==`object`){if(e.stats!==void 0)return{...e,stats:sa(e.stats)};if(e.statsMap!==void 0)return{...e,statsMap:sa(e.statsMap)}}return sa(e)}function la(e,t){if(!e||typeof e!=`object`)return e;let n={...e};return typeof e.success==`function`&&(n.success=n=>e.success(t(n))),typeof e.complete==`function`&&(n.complete=n=>e.complete(t(n))),n}function q(e,t,{transform:n=e=>e,prepare:r=e=>e}={}){let i=w(e,r(la(t,n)));return i&&typeof i.then==`function`?i.then(n):i}function ua(e,t){let n=t?.arrayBuffer,r=t?.offset||0;return q(e,t,{prepare:ia,transform:e=>ra(e,n,r)})}var da=class{access(e){return q(`FileSystemManager.access`,e)}accessSync(e){return w(`FileSystemManager.accessSync`,e)}appendFile(e){return q(`FileSystemManager.appendFile`,e,{prepare:K})}appendFileSync(e,t,n){return w(`FileSystemManager.appendFileSync`,K({filePath:e,data:t,encoding:n}))}close(e){return q(`FileSystemManager.close`,e)}closeSync(e){return w(`FileSystemManager.closeSync`,e)}copyFile(e){return q(`FileSystemManager.copyFile`,e)}copyFileSync(e,t){return w(`FileSystemManager.copyFileSync`,{srcPath:e,destPath:t})}fstat(e){return q(`FileSystemManager.fstat`,e,{transform:ca})}fstatSync(e){return ca(w(`FileSystemManager.fstatSync`,e))}ftruncate(e){return q(`FileSystemManager.ftruncate`,e)}ftruncateSync(e){return w(`FileSystemManager.ftruncateSync`,e)}getFileInfo(e){return q(`FileSystemManager.getFileInfo`,e)}getSavedFileList(e){return q(`FileSystemManager.getSavedFileList`,e||{})}getSavedFileInfo(e){return w(`FileSystemManager.getSavedFileInfo`,e)}mkdir(e){return q(`FileSystemManager.mkdir`,e)}mkdirSync(e,t){return w(`FileSystemManager.mkdirSync`,{dirPath:e,recursive:t})}open(e){return q(`FileSystemManager.open`,e)}openSync(e){return w(`FileSystemManager.openSync`,e)}read(e){return ua(`FileSystemManager.read`,e)}readSync(e){return ra(w(`FileSystemManager.readSync`,ia(e)),e?.arrayBuffer,e?.offset||0)}readCompressedFile(e){return q(`FileSystemManager.readCompressedFile`,e,{transform:ta})}readCompressedFileSync(e){return ea(w(`FileSystemManager.readCompressedFileSync`,e))}readdir(e){return q(`FileSystemManager.readdir`,e)}readdirSync(e){return w(`FileSystemManager.readdirSync`,e)}readFile(e){return q(`FileSystemManager.readFile`,e,{transform:ta})}readFileSync(e,t,n,r){return ea(w(`FileSystemManager.readFileSync`,{filePath:e,encoding:t,position:n,length:r}))}readZipEntry(e){return q(`FileSystemManager.readZipEntry`,e,{transform:na})}removeSavedFile(e){return q(`FileSystemManager.removeSavedFile`,e)}rename(e){return q(`FileSystemManager.rename`,e)}renameSync(e,t){return w(`FileSystemManager.renameSync`,{oldPath:e,newPath:t})}rmdir(e){return q(`FileSystemManager.rmdir`,e)}rmdirSync(e,t){return w(`FileSystemManager.rmdirSync`,{dirPath:e,recursive:t})}saveFile(e){return q(`FileSystemManager.saveFile`,e)}saveFileSync(e,t){return w(`FileSystemManager.saveFileSync`,{tempFilePath:e,filePath:t})}stat(e){return q(`FileSystemManager.stat`,e,{transform:ca})}statSync(e,t){return ca(w(`FileSystemManager.statSync`,{path:e,recursive:t}))}truncate(e){return q(`FileSystemManager.truncate`,e)}truncateSync(e,t){return w(`FileSystemManager.truncateSync`,{filePath:e,length:t})}unlink(e){return q(`FileSystemManager.unlink`,e)}unlinkSync(e){return w(`FileSystemManager.unlinkSync`,e)}unzip(e){return q(`FileSystemManager.unzip`,e)}write(e){return q(`FileSystemManager.write`,e,{prepare:e=>K(e,[`arrayBuffer`,`data`])})}writeSync(e){return w(`FileSystemManager.writeSync`,K(e,[`arrayBuffer`,`data`]))}writeFile(e){return q(`FileSystemManager.writeFile`,e,{prepare:K})}writeFileSync(e,t,n){return w(`FileSystemManager.writeFileSync`,K({filePath:e,data:t,encoding:n}))}},fa=Object.getOwnPropertyNames(da.prototype).filter(e=>e!==`constructor`),pa=null;function ma(){return pa||=new da,pa}function ha(e){return w(`chooseMessageFile`,e)}var ga=[`applyUpdate`,`onCheckForUpdate`,`onUpdateFailed`,`onUpdateReady`],_a=t({canIUse:()=>Sa,env:()=>va,setEnableDebug:()=>ba}),va={USER_DATA_PATH:`difile://usr`},ya=new Set([`nextTick`,`getUpdateManager`,`getPerformance`,`getFileSystemManager`,`setEnableDebug`,`authorize`,`getAuthList`,`getAuthCode`,`getHostFontSize`,`getHostLanguage`,`getPhoneNumber`,`getEmail`,`getUserProfile`,`addPhoneCalendar`,`shareMiniAppMessage`,`shareToApp`,`button.open-type.share`,`onError`,`offError`,`onAppShow`,`onAppHide`,`offAppShow`,`offAppHide`,`onThemeChange`,`offThemeChange`,`UpdateManager`,...ga.map(e=>`UpdateManager.${e}`),`getPerformance`,`getFileSystemManager`,`FileSystemManager`,...fa.map(e=>`FileSystemManager.${e}`)]);function ba(e){w(`setEnableDebug`,e)}var xa={createUDPSocket:`UDPSocket.bind`,UDPSocket:`UDPSocket.bind`,createTCPSocket:`TCPSocket.connect`,TCPSocket:`TCPSocket.connect`};function Sa(e){if(ya.has(e)||ti(e))return!0;try{return w(`canIUse`,Object.hasOwn(xa,e)?xa[e]:e)===!0}catch(t){return console.warn(`[canIUse] check ${e} error:`,t),!1}}var Ca=t({getPerformance:()=>wa});function wa(){return Ta.getInstance()}var Ta=class e{static#e=null;constructor(){if(e.#e)throw Error(`Cannot instantiate more than one Performance instance.`);this.entryList=new Ea,e.#e=this}static getInstance(){return e.#e||=new e,e.#e}createObserver(e){return new Da(this,e)}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}},Ea=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}},Da=class{constructor(e,t){this.performance=e,this.entryTypes=[],this.callback=t,this.observerId=null,this.callbackId=null,this.connected=!1}observe(e={}){this.disconnect(),this.connected=!0,this.entryTypes=Array.isArray(e.entryTypes)?e.entryTypes:[],this.callbackId=b.store((e={})=>{if(e.observerId&&(this.observerId=e.observerId,!this.connected)){w(`removePerformanceObserver`,{observerId:e.observerId},`render`),b.remove(this.callbackId),this.callbackId=null;return}let t=e?.data?.entryList?JSON.parse(e.data.entryList):[];this.connected&&t.length>0&&(this.performance.entryList.push(t),this.notify(t))},!0),w(`addPerformanceObserver`,{entryTypes:this.entryTypes,success:this.callbackId},`render`)}notify(e){if(this.connected){let t=new Ea;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})),typeof this.callback==`function`&&this.callback(t)}}disconnect(){this.connected=!1,this.observerId&&w(`removePerformanceObserver`,{observerId:this.observerId},`render`),this.callbackId&&this.observerId&&b.remove(this.callbackId),this.observerId=null,this.callbackId=null}},Oa=t({getScreenBrightness:()=>Na,offUserCaptureScreen:()=>La,onUserCaptureScreen:()=>Ia,setKeepScreenOn:()=>Ma,setScreenBrightness:()=>Pa,setVisualEffectOnCapture:()=>Fa}),ka=new Map;function Aa(e,t,r){if(!n(r)||t.has(r))return;let i=b.store(r,!0);t.set(r,i),w(e,{callback:i})}function ja(e,t,r){if(n(r)){let n=t.get(r);if(!n)return;t.delete(r),b.remove(n),w(e,{callback:n});return}t.forEach(e=>b.remove(e)),t.clear(),w(e)}function Ma(e){return w(`setKeepScreenOn`,e)}function Na(e){return w(`getScreenBrightness`,e)}function Pa(e){return w(`setScreenBrightness`,e)}function Fa(e){return w(`setVisualEffectOnCapture`,e)}function Ia(e){Aa(`onUserCaptureScreen`,ka,e)}function La(e){ja(`offUserCaptureScreen`,ka,e)}var Ra=t({loadSubpackage:()=>Ba,preDownloadSubpackage:()=>za});function za(e){return w(`preDownloadSubpackage`,e)}function Ba(e){return w(`loadSubpackage`,e)}var Va=t({getUpdateManager:()=>qa}),Ha=`onUpdateStatusChange`,Ua=`updatefail`,Wa=`updateready`,Ga=`noupdate`,Ka=`updating`;function qa(){return Ja.getInstance()}var Ja=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=[],C.on(Ha,e=>this.handleUpdateStatusChange(e)),e.#e=this}handleUpdateStatusChange(e={}){let{event:t}=e;if(t===Ua){this.updateFailed=!0,this.emit(this.updateFailedListeners);return}if(t===Wa){let e=this.checkForUpdateResult?.hasUpdate!==!0,t=!this.updateReady;this.updateReady=!0,this.checkForUpdateResult={hasUpdate:!0},e&&this.emit(this.checkForUpdateListeners,this.checkForUpdateResult),t&&this.emit(this.updateReadyListeners);return}if(t===Ka){this.checkForUpdateResult={hasUpdate:!0},this.emit(this.checkForUpdateListeners,this.checkForUpdateResult);return}if(t===Ga){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,w(`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())}};Ja.getInstance();var Ya=t({createCameraContext:()=>Xa});function Xa(e){return new Za({cameraId:e})}var Za=class{constructor(e={}){this.opts=e,this.bridgeId=S.getPageInfo().id}takePhoto(e){return this.invoke(`takePhoto`,e)}startRecord(e={}){return this.invoke(`startRecord`,e)}stopRecord(e={}){return this.invoke(`stopRecord`,e)}invoke(e,t={}){return w(`cameraContext`,{type:`native/camera`,id:this.opts.cameraId,command:e,...t},`render`)}},Qa=t({reportAnalytics:()=>$a,reportEvent:()=>eo});function $a(...e){return w(`reportAnalytics`,e)}function eo(e,t){return w(`reportAnalytics`,{eventId:e,data:t})}var to=`__diminaArrayBufferBase64`,J=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,no=(()=>{let e={};for(let t=0;t<64;t++)e[J[t]]=t;return e})();function ro(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function io(e){return ro(e)?e:e&&e.buffer&&ro(e.buffer)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function ao(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=J[t[r]>>2],n+=J[(t[r]&3)<<4|t[r+1]>>4],n+=J[(t[r+1]&15)<<2|t[r+2]>>6],n+=J[t[r+2]&63];return r<t.length&&(n+=J[t[r]>>2],r+1<t.length?(n+=J[(t[r]&3)<<4|t[r+1]>>4],n+=`${J[(t[r+1]&15)<<2]}=`):n+=`${J[(t[r]&3)<<4]}==`),n}function oo(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=no[t[e]],o=no[t[e+1]],s=t[e+2]===`=`?0:no[t[e+2]],c=t[e+3]===`=`?0:no[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function so(e){let t=io(e);return t?{[to]:ao(t)}:e}function co(e){return e&&typeof e==`object`&&e.__diminaArrayBufferBase64!==void 0?oo(e[to]):e}function lo(e){if(!e||typeof e!=`object`)return e;let t={};for(let[n,r]of Object.entries(e.serviceData||{}))t[n]=co(r);return{...e,advertisData:co(e.advertisData),serviceData:t}}function uo(e){return!e||!Array.isArray(e.devices)?e:{...e,devices:e.devices.map(lo)}}function fo(e){return!e||typeof e!=`object`?e:{...e,value:co(e.value)}}function po(e,t){if(!e||typeof e!=`object`)return e;let n={...e};return typeof e.success==`function`&&(n.success=n=>e.success(t(n))),typeof e.complete==`function`&&(n.complete=n=>e.complete(t(n))),n}function mo(e,t,{prepare:n=e=>e,transform:r=e=>e}={}){let i=w(e,n(po(t,r)));return i&&typeof i.then==`function`?i.then(r):i}function ho(e,t,n=e=>e){let r=new Map;return{on(t){if(typeof t!=`function`||r.has(t))return;let i=b.store(e=>t(n(e)),!0);return r.set(t,i),w(e,{callbackId:i,success:i,keep:!0})},off(e){if(typeof e==`function`){let n=r.get(e);return n?(r.delete(e),b.remove(n),w(t,{callbackId:n,keep:!0})):void 0}for(let e of r.values())b.remove(e);return r.clear(),w(t)}}}var go=t({closeBluetoothAdapter:()=>ko,getBluetoothAdapterState:()=>Oo,getBluetoothDevices:()=>Do,getConnectedBluetoothDevices:()=>Eo,isBluetoothDevicePaired:()=>Ao,makeBluetoothPair:()=>jo,offBluetoothAdapterStateChange:()=>To,offBluetoothDeviceFound:()=>wo,onBluetoothAdapterStateChange:()=>Co,onBluetoothDeviceFound:()=>So,openBluetoothAdapter:()=>xo,startBluetoothDevicesDiscovery:()=>bo,stopBluetoothDevicesDiscovery:()=>yo}),_o=ho(`onBluetoothDeviceFound`,`offBluetoothDeviceFound`,uo),vo=ho(`onBluetoothAdapterStateChange`,`offBluetoothAdapterStateChange`);function yo(e){return w(`stopBluetoothDevicesDiscovery`,e)}function bo(e){return w(`startBluetoothDevicesDiscovery`,e)}function xo(e){return w(`openBluetoothAdapter`,e)}function So(e){return _o.on(e)}function Co(e){return vo.on(e)}function wo(e){return _o.off(e)}function To(e){return vo.off(e)}function Eo(e){return mo(`getConnectedBluetoothDevices`,e,{transform:uo})}function Do(e){return mo(`getBluetoothDevices`,e,{transform:uo})}function Oo(e){return w(`getBluetoothAdapterState`,e)}function ko(e){return w(`closeBluetoothAdapter`,e)}function Ao(e){return w(`isBluetoothDevicePaired`,e)}function jo(e){return w(`makeBluetoothPair`,e)}var Mo=t({closeBLEConnection:()=>Jo,createBLEConnection:()=>qo,getBLEDeviceCharacteristics:()=>Ko,getBLEDeviceRSSI:()=>Go,getBLEDeviceServices:()=>Wo,getBLEMTU:()=>Yo,notifyBLECharacteristicValueChange:()=>Uo,offBLECharacteristicValueChange:()=>Ho,offBLEConnectionStateChange:()=>Vo,offBLEMTUChange:()=>Zo,onBLECharacteristicValueChange:()=>Bo,onBLEConnectionStateChange:()=>zo,onBLEMTUChange:()=>Xo,readBLECharacteristicValue:()=>Ro,setBLEMTU:()=>Lo,writeBLECharacteristicValue:()=>Io}),No=ho(`onBLEConnectionStateChange`,`offBLEConnectionStateChange`),Po=ho(`onBLECharacteristicValueChange`,`offBLECharacteristicValueChange`,fo),Fo=ho(`onBLEMTUChange`,`offBLEMTUChange`);function Io(e){return mo(`writeBLECharacteristicValue`,e,{prepare(e){return e&&typeof e==`object`?{...e,value:so(e.value)}:e}})}function Lo(e){return w(`setBLEMTU`,e)}function Ro(e){return w(`readBLECharacteristicValue`,e)}function zo(e){return No.on(e)}function Bo(e){return Po.on(e)}function Vo(e){return No.off(e)}function Ho(e){return Po.off(e)}function Uo(e){return w(`notifyBLECharacteristicValueChange`,e)}function Wo(e){return w(`getBLEDeviceServices`,e)}function Go(e){return w(`getBLEDeviceRSSI`,e)}function Ko(e){return w(`getBLEDeviceCharacteristics`,e)}function qo(e){return w(`createBLEConnection`,e)}function Jo(e){return w(`closeBLEConnection`,e)}function Yo(e){return w(`getBLEMTU`,e)}function Xo(e){return Fo.on(e)}function Zo(e){return Fo.off(e)}var Qo=t({addPhoneCalendar:()=>$o});function $o(e){return w(`addPhoneCalendar`,e)}var es=t({getClipboardData:()=>ns,setClipboardData:()=>ts});function ts(e){return w(`setClipboardData`,e)}function ns(e){return w(`getClipboardData`,e)}var rs=t({addPhoneContact:()=>as,chooseContact:()=>is});function is(e){return w(`chooseContact`,e)}function as(e){return w(`addPhoneContact`,e)}var os=t({hideKeyboard:()=>ss});function ss(e){return w(`hideKeyboard`,e)}var cs=t({offMemoryWarning:()=>us,onMemoryWarning:()=>ls});function ls(e){return w(`onMemoryWarning`,e)}function us(e){return w(`offMemoryWarning`,e)}var ds=t({getNetworkType:()=>fs});function fs(e){return w(`getNetworkType`,e)}var ps=t({makePhoneCall:()=>ms});function ms(e){return w(`makePhoneCall`,e)}var hs=t({scanCode:()=>gs});function gs(e){return w(`scanCode`,e)}var _s=t({offUserCaptureScreen:()=>xs,onUserCaptureScreen:()=>bs}),vs=ho(`onUserCaptureScreen`,`offUserCaptureScreen`),ys;function bs(e){if(typeof e==`function`)return ys&&ys!==e&&vs.off(ys),ys=e,vs.on(e)}function xs(e){if(typeof e!=`function`||e===ys)return ys=void 0,vs.off(e)}var Ss=t({vibrateLong:()=>ws,vibrateShort:()=>Cs});function Cs(e){return w(`vibrateShort`,e)}function ws(e){return w(`vibrateLong`,e)}var Ts=t({__hostEventTestHooks:()=>Ks,offHostEvent:()=>Gs,offHostTest:()=>Us,onHostEvent:()=>Ws,onHostTest:()=>Hs}),Es=`nativeEvent`,Ds=`onHostTest`,Os=`hostCallResult`,ks=/^onHost[A-Z][A-Za-z0-9_]{0,63}$/,As=new Map,js=new Map;function Ms(e){return e||S.getPageInfo()?.id||``}function Ns(e,t){return`${e}::${Ms(t)}`}function Ps(e){return typeof e==`string`&&ks.test(e)}function Fs(e){return e===void 0?{}:e}function Is(e,t){return!e||typeof e[t]!=`function`?null:{handler:e[t].bind(e),legacy:t===Ds}}function Ls(e){return!e||typeof e.onHostEvent!=`function`?null:{handler:e.onHostEvent.bind(e),legacy:!1}}function Rs(e,t){return Is(e,t)||Ls(e)}function zs(e={},t){return Rs(Object.values(e).find(e=>typeof e?.[t]==`function`||typeof e?.onHostEvent==`function`),t)}function Bs(e,t){let n=S.getPageInfo?.()||{},r=[Ms(t),Ms(n.id)].filter(Boolean);for(let t of r){let n=H.getPageInstance?.(t),r=Rs(n,e);if(r)return r;let i=zs(H.instances?.[t],e);if(i)return i}let i=n.route;if(!i||!H.instances)return null;for(let t of Object.values(H.instances)){let n=Rs(Object.values(t||{}).find(t=>t&&t.route===i&&(typeof t[e]==`function`||typeof t.onHostEvent==`function`)),e);if(n)return n}return null}function Vs({bridgeId:e,requestId:t,success:n,data:r,errMsg:i}){C.send({type:Os,target:`service`,body:{bridgeId:e,requestId:t,success:n,data:r,errMsg:i}})}C.on(Es,async(e={})=>{let t=e.event;if(!Ps(t))return;let n=Ms(e.bridgeId),r=e.requestId||``,i=e.payload??e.data??{},a=Ns(t,n);js.set(a,i);let o=Bs(t,n),s=As.get(a),c=o||(s?{handler:s,legacy:t===Ds}:null);if(!c){Vs({bridgeId:n,requestId:r,success:!1,errMsg:`${t}:fail handler not registered`});return}try{Vs({bridgeId:n,requestId:r,success:!0,data:Fs(c.legacy?await c.handler(i):await c.handler(i,{event:t,bridgeId:n,requestId:r}))})}catch(e){Vs({bridgeId:n,requestId:r,success:!1,errMsg:e?.message||String(e)||`${t}:fail`})}});function Hs(e){Ws(Ds,e,{legacy:!0})}function Us(){Gs(Ds)}function Ws(e,t,n={}){if(!Ps(e)){console.error(`[onHostEvent]: event must match /^onHost[A-Z][A-Za-z0-9_]{0,63}$/`);return}if(typeof t!=`function`){console.error(`[onHostEvent]: handler must be a function`);return}let r=Ns(e);As.set(r,t),js.has(r)&&Promise.resolve().then(()=>{n.legacy?t(js.get(r)):t(js.get(r),{event:e,bridgeId:Ms(),requestId:``})})}function Gs(e){Ps(e)&&As.delete(Ns(e))}var Ks={HOST_EVENT_TYPE:Es,HOST_TEST_EVENT:Ds,HOST_TEST_RESULT_EVENT:Os,hostEventHandlers:As,hostEventLastPayloads:js,scopeKey:Ms,hostEventKey:Ns,isControlledHostEvent:Ps},qs=t({getLocation:()=>Js,offLocationChange:()=>$s,onLocationChange:()=>Qs,openLocation:()=>Xs,startLocationUpdate:()=>Ys,stopLocationUpdate:()=>Zs});function Js(e){return w(`getLocation`,e)}function Ys(e){return w(`startLocationUpdate`,e)}function Xs(e){return w(`openLocation`,e)}function Zs(e){return w(`stopLocationUpdate`,e)}function Qs(e){e&&w(`onLocationChange`,{success:b.store(e,!0)})}function $s(e){if(e){let t=b.store(e,!0);w(`offLocationChange`,{success:t}),b.remove(t)}else w(`offLocationChange`),b.remove()}var ec=t({createMapContext:()=>tc});function tc(e,t){return new nc({mapId:e,obj:t})}var nc=class{constructor(e){this.opts=e}invoke(e,t={}){return w(`mapContext`,{...t,id:this.opts.mapId,mapId:this.opts.mapId,command:e},`render`)}addMarkers(e){return this.invoke(`addMarkers`,e)}removeMarkers(e){return this.invoke(`removeMarkers`,e)}includePoints(e){return this.invoke(`includePoints`,e)}setCenterOffset(e){return this.invoke(`setCenterOffset`,e)}getCenterLocation(e){return this.invoke(`getCenterLocation`,e)}getScale(e){return this.invoke(`getScale`,e)}moveToLocation(e){return this.invoke(`moveToLocation`,e)}translateMarker(e){return this.invoke(`translateMarker`,e)}addArc(e){return this.invoke(`addArc`,e)}removeArc(e){return this.invoke(`removeArc`,e)}},rc=t({createAudioContext:()=>ic,getBackgroundAudioPlayerState:()=>lc,pauseBackgroundAudio:()=>oc,playBackgroundAudio:()=>ac,seekBackgroundAudio:()=>cc,stopBackgroundAudio:()=>sc});function ic(e,t){return new uc({audioId:e,obj:t})}function ac(e={}){return w(`playBackgroundAudio`,e)}function oc(e={}){return w(`pauseBackgroundAudio`,e)}function sc(e={}){return w(`stopBackgroundAudio`,e)}function cc(e={}){return w(`seekBackgroundAudio`,e)}function lc(e={}){return w(`getBackgroundAudioPlayerState`,e)}var uc=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})}invoke(e,t={}){w(`audioContext`,{type:`native/audio`,id:this.opts.audioId,command:e,...t},`render`)}},dc=t({chooseImage:()=>hc,compressImage:()=>mc,previewImage:()=>pc,saveImageToPhotosAlbum:()=>fc});function fc(e){return w(`saveImageToPhotosAlbum`,e)}function pc(e){return w(`previewImage`,e)}function mc(e){return w(`compressImage`,e)}function hc(e){return w(`chooseImage`,e)}var gc=t({chooseMedia:()=>yc,chooseVideo:()=>vc,createVideoContext:()=>_c,saveVideoToPhotosAlbum:()=>bc});function _c(e,t){return new xc({videoId:e,obj:t})}function vc(e){return w(`chooseVideo`,e)}function yc(e){return w(`chooseMedia`,e)}function bc(e){return w(`saveVideoToPhotosAlbum`,e)}var xc=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})}sendDanmu(e={}){this.invoke(`sendDanmu`,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={}){w(`videoContext`,{type:`native/video`,id:this.opts.videoId,command:e,...t},`render`)}},Sc=t({exitMiniProgram:()=>Ec,navigateBackMiniProgram:()=>Tc,navigateToMiniProgram:()=>wc,restartMiniProgram:()=>Cc});function Cc(e){return w(`restartMiniProgram`,e)}function wc(e){return w(`navigateToMiniProgram`,e)}function Tc(e){return w(`navigateBackMiniProgram`,e)}function Ec(e){return w(`exitMiniProgram`,e)}function Dc(e){let t=`${e}_${Date.now()}_${Math.random().toString(36).slice(2,10)}`,r=new Map,i=new Map;function a(e,r,i){if(!n(i))return;let a=b.store(i,!0);r.set(i,a),w(e,{taskId:t,callback:a})}function o(e,r,i){if(n(i)){let n=r.get(i);if(!n)return;r.delete(i),b.remove(n),w(e,{taskId:t,callback:n});return}r.forEach(e=>b.remove(e)),r.clear(),w(e,{taskId:t})}return{taskId:t,abort(){w(`${e}Abort`,{taskId:t})},onProgressUpdate(t){a(`${e}OnProgressUpdate`,r,t)},offProgressUpdate(t){o(`${e}OffProgressUpdate`,r,t)},onHeadersReceived(t){a(`${e}OnHeadersReceived`,i,t)},offHeadersReceived(t){o(`${e}OffHeadersReceived`,i,t)}}}var Oc=t({downloadFile:()=>kc});function kc(e){let t=Dc(`downloadFile`);return w(`downloadFile`,{...Tr(`downloadFile`,e).wrapOptions(e),taskId:t.taskId}),t}var Ac=`__diminaArrayBufferBase64`,Y=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,jc=Object.fromEntries([...Y].map((e,t)=>[e,t]));function Mc(e){return Object.prototype.toString.call(e)===`[object ArrayBuffer]`}function Nc(e){return Mc(e)?e:e&&Mc(e.buffer)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):null}function Pc(e){let t=new Uint8Array(e),n=``,r=0;for(;r+2<t.length;r+=3)n+=Y[t[r]>>2],n+=Y[(t[r]&3)<<4|t[r+1]>>4],n+=Y[(t[r+1]&15)<<2|t[r+2]>>6],n+=Y[t[r+2]&63];return r<t.length&&(n+=Y[t[r]>>2],r+1<t.length?(n+=Y[(t[r]&3)<<4|t[r+1]>>4],n+=`${Y[(t[r+1]&15)<<2]}=`):n+=`${Y[(t[r]&3)<<4]}==`),n}function Fc(e){let t=String(e||``).replace(/[\r\n\s]/g,``);if(!t)return new ArrayBuffer(0);let n=t.endsWith(`==`)?2:+!!t.endsWith(`=`),r=t.length*3/4-n,i=new Uint8Array(r),a=0;for(let e=0;e<t.length;e+=4){let n=jc[t[e]],o=jc[t[e+1]],s=t[e+2]===`=`?0:jc[t[e+2]],c=t[e+3]===`=`?0:jc[t[e+3]];a<r&&(i[a++]=n<<2|o>>4),a<r&&(i[a++]=(o&15)<<4|s>>2),a<r&&(i[a++]=(s&3)<<6|c)}return i.buffer}function Ic(e){let t=Nc(e);return t?{[Ac]:Pc(t)}:e}function Lc(e){if(!e||typeof e!=`object`)return e;let t=e.message;return!t||typeof t!=`object`||t.__diminaArrayBufferBase64===void 0?e:{...e,message:Fc(t[Ac])}}function Rc(e){return`${e}_${Date.now()}_${Math.random().toString(36).slice(2,11)}`}function X(e,t,n={}){return w(e,{socketId:t,...n,keep:!0})}function Z(e,t,n={},r=e=>e){let i=new Set,a,o;function s(){if(!a)return;let e=a;a=void 0,b.remove(e),w(t,{...n,callbackId:e,keep:!0})}return{on(t){if(!(typeof t!=`function`||i.has(t))&&(i.add(t),!a))return a=b.store(e=>{let t=r(e);for(let e of[...i])e(t);o?.()},!0),w(e,{...n,callbackId:a,success:a,keep:!0})},off(e){if(typeof e==`function`?i.delete(e):i.clear(),i.size===0)return s()},dispose({notifyNative:e=!1}={}){if(i.clear(),e)return s();a&&b.remove(a),a=void 0},hasListeners(){return i.size>0},setAfterEmit(e){o=e}}}var zc=t({offLocalServiceDiscoveryStop:()=>qc,offLocalServiceFound:()=>Yc,offLocalServiceLost:()=>Zc,offLocalServiceResolveFail:()=>$c,onLocalServiceDiscoveryStop:()=>Kc,onLocalServiceFound:()=>Jc,onLocalServiceLost:()=>Xc,onLocalServiceResolveFail:()=>Qc,startLocalServiceDiscovery:()=>Wc,stopLocalServiceDiscovery:()=>Gc}),Bc=Z(`onLocalServiceDiscoveryStop`,`offLocalServiceDiscoveryStop`),Vc=Z(`onLocalServiceFound`,`offLocalServiceFound`),Hc=Z(`onLocalServiceLost`,`offLocalServiceLost`),Uc=Z(`onLocalServiceResolveFail`,`offLocalServiceResolveFail`);function Wc(e={}){return w(`startLocalServiceDiscovery`,e)}function Gc(e={}){return w(`stopLocalServiceDiscovery`,e)}function Kc(e){return Bc.on(e)}function qc(e){return Bc.off(e)}function Jc(e){return Vc.on(e)}function Yc(e){return Vc.off(e)}function Xc(e){return Hc.on(e)}function Zc(e){return Hc.off(e)}function Qc(e){return Uc.on(e)}function $c(e){return Uc.off(e)}var el=t({request:()=>tl});function tl(e){return w(`request`,Tr(`request`,e).wrapOptions(e))}var nl=t({createTCPSocket:()=>il}),rl=class{constructor(e){this.socketId=e,this.events={bindWifi:Z(`TCPSocket.onBindWifi`,`TCPSocket.offBindWifi`,{socketId:e}),close:Z(`TCPSocket.onClose`,`TCPSocket.offClose`,{socketId:e}),connect:Z(`TCPSocket.onConnect`,`TCPSocket.offConnect`,{socketId:e}),error:Z(`TCPSocket.onError`,`TCPSocket.offError`,{socketId:e}),message:Z(`TCPSocket.onMessage`,`TCPSocket.offMessage`,{socketId:e},Lc)},this.events.close.setAfterEmit(()=>{for(let e of Object.values(this.events))e.dispose()})}bindWifi(e={}){return X(`TCPSocket.bindWifi`,this.socketId,e)}close(){let e=X(`TCPSocket.close`,this.socketId);for(let[e,t]of Object.entries(this.events))(e!==`close`||!t.hasListeners())&&t.dispose();return e}connect(e={}){return X(`TCPSocket.connect`,this.socketId,e)}write(e){return X(`TCPSocket.write`,this.socketId,{data:Ic(e)})}onBindWifi(e){return this.events.bindWifi.on(e)}offBindWifi(e){return this.events.bindWifi.off(e)}onClose(e){return this.events.close.on(e)}offClose(e){return this.events.close.off(e)}onConnect(e){return this.events.connect.on(e)}offConnect(e){return this.events.connect.off(e)}onError(e){return this.events.error.on(e)}offError(e){return this.events.error.off(e)}onMessage(e){return this.events.message.on(e)}offMessage(e){return this.events.message.off(e)}};function il(){return new rl(Rc(`tcp`))}var al=t({createUDPSocket:()=>sl}),ol=class{constructor(e){this.socketId=e,this.events={close:Z(`UDPSocket.onClose`,`UDPSocket.offClose`,{socketId:e}),error:Z(`UDPSocket.onError`,`UDPSocket.offError`,{socketId:e}),listening:Z(`UDPSocket.onListening`,`UDPSocket.offListening`,{socketId:e}),message:Z(`UDPSocket.onMessage`,`UDPSocket.offMessage`,{socketId:e},Lc)},this.events.close.setAfterEmit(()=>{for(let e of Object.values(this.events))e.dispose()})}bind(e=0){return X(`UDPSocket.bind`,this.socketId,{port:e})}close(){let e=X(`UDPSocket.close`,this.socketId);for(let[e,t]of Object.entries(this.events))(e!==`close`||!t.hasListeners())&&t.dispose();return e}connect(e={}){return X(`UDPSocket.connect`,this.socketId,e)}send(e={}){return this.sendWithName(`UDPSocket.send`,e)}write(e={}){return this.sendWithName(`UDPSocket.write`,e)}setTTL(e){return X(`UDPSocket.setTTL`,this.socketId,{ttl:e})}onClose(e){return this.events.close.on(e)}offClose(e){return this.events.close.off(e)}onError(e){return this.events.error.on(e)}offError(e){return this.events.error.off(e)}onListening(e){return this.events.listening.on(e)}offListening(e){return this.events.listening.off(e)}onMessage(e){return this.events.message.on(e)}offMessage(e){return this.events.message.off(e)}sendWithName(e,t){return X(e,this.socketId,{...t,message:Ic(t.message)})}};function sl(){return new ol(Rc(`udp`))}var cl=t({uploadFile:()=>ll});function ll(e){let t=Dc(`uploadFile`);return w(`uploadFile`,{...Tr(`uploadFile`,e).wrapOptions(e),taskId:t.taskId}),t}var ul=t({closeSocket:()=>ml,connectSocket:()=>fl,offSocketClose:()=>Sl,offSocketError:()=>bl,offSocketMessage:()=>vl,offSocketOpen:()=>gl,onSocketClose:()=>xl,onSocketError:()=>yl,onSocketMessage:()=>_l,onSocketOpen:()=>hl,sendSocketMessage:()=>pl});function Q(e,t,r={}){let i=new Map;return{on(t){if(!n(t)||i.has(t))return;let a=b.store(e=>t(e),!0);i.set(t,a);try{return w(e,{...r,callback:a,keep:!0})}catch(e){throw i.delete(t),b.remove(a),e}},off(e){if(n(e)){let n=i.get(e);return n?(i.delete(e),b.remove(n),w(t,{...r,callback:n,keep:!0})):void 0}for(let e of i.values())b.remove(e);return i.clear(),w(t,{...r,keep:!0})}}}var dl=class{constructor(e){this.socketId=e,this._readyState=0,this._events={open:Q(`onSocketOpen`,`offSocketOpen`,{socketId:e}),message:Q(`onSocketMessage`,`offSocketMessage`,{socketId:e}),error:Q(`onSocketError`,`offSocketError`,{socketId:e}),close:Q(`onSocketClose`,`offSocketClose`,{socketId:e})}}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=b.store(r)),n(i)&&(s.fail=b.store(i)),n(a)&&(s.complete=b.store(a)),w(`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=b.store(i)),n(a)&&(c.fail=b.store(a)),n(o)&&(c.complete=b.store(o)),w(`closeSocket`,c)}onOpen(e){return this._events.open.on(e)}offOpen(e){return this._events.open.off(e)}onMessage(e){return this._events.message.on(e)}offMessage(e){return this._events.message.off(e)}onError(e){return this._events.error.on(e)}offError(e){return this._events.error.off(e)}onClose(e){return this._events.close.on(e)}offClose(e){return this._events.close.off(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}},$={open:Q(`onSocketOpen`,`offSocketOpen`),message:Q(`onSocketMessage`,`offSocketMessage`),error:Q(`onSocketError`,`offSocketError`),close:Q(`onSocketClose`,`offSocketClose`)};function fl(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,...f}=e;if(!t){let e=Error(`url is required`);throw n(u)&&u(e),n(d)&&d(e),e}let p=`socket_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,m=new dl(p),h={socketId:p,url:t,header:r,protocols:i,tcpNoDelay:a,perMessageDeflate:o,timeout:s,forceCellularNetwork:c,...f};return n(l)&&(h.success=b.store(e=>{m._readyState=dl.OPEN,l(e)})),n(u)&&(h.fail=b.store(e=>{m._readyState=dl.CLOSED,u(e)})),n(d)&&(h.complete=b.store(d)),w(`connectSocket`,h),m}function pl(e){return w(`sendSocketMessage`,e)}function ml(e){return w(`closeSocket`,e)}function hl(e){return $.open.on(e)}function gl(e){return $.open.off(e)}function _l(e){return $.message.on(e)}function vl(e){return $.message.off(e)}function yl(e){return $.error.on(e)}function bl(e){return $.error.off(e)}function xl(e){return $.close.on(e)}function Sl(e){return $.close.off(e)}var Cl=t({getAccountInfoSync:()=>wl});function wl(){return w(`getAccountInfoSync`)}var Tl=t({getAuthList:()=>El});function El(e){let t={event:`obtainServerAuthScope`,data:{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),U(t)}var Dl=t({getAuthCode:()=>Ol});function Ol(e){return w(`getAuthCode`,e||{})}var kl=t({authorize:()=>Al});function Al(e){return w(`authorize`,e)}var jl=t({getEmail:()=>Ml});function Ml(e){return w(`getEmail`,e)}var Nl=t({generateQRCode:()=>Pl});function Pl(e){return w(`generateQRCode`,e)}var Fl=t({getHostAppConfig:()=>Il});function Il(e){let t={event:`getHostAppConfig`,data:e||{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),U(t)}var Ll=t({getHostFontSize:()=>Rl});function Rl(e){let t={event:`zoomFontSize`,data:{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),U(t)}var zl=t({getHostLanguage:()=>Bl});function Bl(e){let t={event:`obtainLanguageTag`,data:{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),U(t)}var Vl=t({getUserProfile:()=>Hl});function Hl(e){let t={event:`getUserProfile`,data:e||{}};return e?.success&&(t.success=e.success),e?.fail&&(t.fail=e.fail),e?.complete&&(t.complete=e.complete),U(t)}var Ul=t({getPhoneNumber:()=>Wl});function Wl(e){return w(`getPhoneNumber`,e)}var Gl=t({authorize:()=>Al,captureScreen:()=>ri,generateQRCode:()=>Pl,getAuthCode:()=>Ol,getAuthList:()=>El,getEmail:()=>Ml,getHostAppConfig:()=>Il,getHostFontSize:()=>Rl,getHostLanguage:()=>Bl,getPhoneNumber:()=>Wl,getUserProfile:()=>Hl,login:()=>Kl});function Kl(e){return w(`login`,e)}var ql=t({login:()=>Jl});function Jl(e){return w(`login`,e)}var Yl=t({getPrivacySetting:()=>Xl,requirePrivacyAuthorize:()=>Zl});function Xl(e){return w(`getPrivacySetting`,e)}function Zl(e){return w(`requirePrivacyAuthorize`,e)}var Ql=t({getSetting:()=>eu,openSetting:()=>$l});function $l(e){return w(`openSetting`,e)}function eu(e){return w(`getSetting`,e)}var tu=t({getUserInfo:()=>nu});function nu(e){return w(`getUserInfo`,e)}var ru=t({requestPayment:()=>iu});function iu(e){return w(`requestPayment`,e)}var au=t({createAnimation:()=>ou});function ou(e={}){return new su(e)}var su=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`,_(e)]}),this}height(e){return this.currentStepAnimates.push({type:`style`,args:[`height`,_(e)]}),this}left(e){return this.currentStepAnimates.push({type:`style`,args:[`left`,_(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,h=1){return this.currentStepAnimates.push({type:`matrix3d`,args:[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}),this}opacity(e){return this.currentStepAnimates.push({type:`style`,args:[`opacity`,e]}),this}right(e){return this.currentStepAnimates.push({type:`style`,args:[`right`,_(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`,_(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`,_(e)]}),this}},cu=t({setBackgroundColor:()=>uu,setBackgroundTextStyle:()=>lu});function lu(e){return w(`setBackgroundTextStyle`,e)}function uu(e){return w(`setBackgroundColor`,e)}var du=t({canvasToTempFilePath:()=>hu,createCanvasContext:()=>pu,createContext:()=>fu,createOffscreenCanvas:()=>Pt,drawCanvas:()=>mu});function fu(){return new _u}function pu(e,t){return new _u(e,gu(t))}function mu(e={}){let t={...e,moduleId:e.moduleId||gu(e.component)};delete t.component,w(`drawCanvas`,t,`render`)}function hu(e={},t){let n={...e,moduleId:e.moduleId||gu(t||e.component)};return delete n.component,w(`canvasToTempFilePath`,n,`render`)}function gu(e){return e?.__id__||S.getPageInfo()?.id}var _u=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&&(mu({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)}},vu=t({nextTick:()=>Su}),yu=[],bu=null;function xu(){let e=yu;yu=[],bu=null;for(let t=0;t<e.length;t++)e[t]()}function Su(e){n(e)&&(yu.push(e),bu||=setTimeout(xu,0))}var Cu=t({disableAlertBeforeUnload:()=>ju,enableAlertBeforeUnload:()=>Au,hideLoading:()=>ku,hideToast:()=>Tu,showActionSheet:()=>Ou,showLoading:()=>Du,showModal:()=>Eu,showToast:()=>wu});function wu(e){return w(`showToast`,e)}function Tu(e){return w(`hideToast`,e)}function Eu(e){return w(`showModal`,e)}function Du(e){return w(`showLoading`,e)}function Ou(e){return w(`showActionSheet`,e)}function ku(e){return w(`hideLoading`,e)}function Au(e){return w(`enableAlertBeforeUnload`,e)}function ju(e){return w(`disableAlertBeforeUnload`,e)}var Mu=t({getMenuButtonBoundingClientRect:()=>Pu,offMenuButtonBoundingClientRectWeightChange:()=>Iu,onMenuButtonBoundingClientRectWeightChange:()=>Fu}),Nu=new Set;x.onUpdate(e=>{e.menuRect&&Nu.forEach(t=>t(e.menuRect))});function Pu(){return w(`getMenuButtonBoundingClientRect`)}function Fu(e){n(e)&&Nu.add(e)}function Iu(e){n(e)?Nu.delete(e):Nu.clear()}var Lu=t({hideHomeButton:()=>Hu,hideNavigationBarLoading:()=>Vu,setNavigationBarColor:()=>Bu,setNavigationBarTitle:()=>zu,showNavigationBarLoading:()=>Ru});function Ru(e){return w(`showNavigationBarLoading`,e)}function zu(e){return w(`setNavigationBarTitle`,e)}function Bu(e){return w(`setNavigationBarColor`,e)}function Vu(e){return w(`hideNavigationBarLoading`,e)}function Hu(e){return w(`hideHomeButton`,e)}var Uu=t({startPullDownRefresh:()=>Gu,stopPullDownRefresh:()=>Wu});function Wu(e){return w(`stopPullDownRefresh`,e)}function Gu(e){return w(`startPullDownRefresh`,e)}var Ku=t({pageScrollTo:()=>qu});function qu(e){return w(`pageScrollTo`,e)}var Ju=t({hideTabBar:()=>Qu,hideTabBarRedDot:()=>nd,removeTabBarBadge:()=>ed,setTabBarBadge:()=>$u,setTabBarItem:()=>Xu,setTabBarStyle:()=>Yu,showTabBar:()=>Zu,showTabBarRedDot:()=>td});function Yu(e){return w(`setTabBarStyle`,e)}function Xu(e){return w(`setTabBarItem`,e)}function Zu(e){return w(`showTabBar`,e)}function Qu(e){return w(`hideTabBar`,e)}function $u(e){return w(`setTabBarBadge`,e)}function ed(e){return w(`removeTabBarBadge`,e)}function td(e){return w(`showTabBarRedDot`,e)}function nd(e){return w(`hideTabBarRedDot`,e)}var rd=t({onWindowResize:()=>id});function id(e){e&&w(`onWindowResize`,{success:e})}var ad=Object.assign({"./core/analytics/index.js":Ni,"./core/base/app-event/index.js":Kn,"./core/base/index.js":_a,"./core/base/performance/index.js":Ca,"./core/base/screen/index.js":Oa,"./core/base/subpackage/index.js":Ra,"./core/base/system/index.js":Fr,"./core/base/theme/index.js":we,"./core/base/update/index.js":Va,"./core/camera/index.js":Ya,"./core/data-analysis/index.js":Qa,"./core/device/bluetooth/index.js":go,"./core/device/bluetooth-ble/index.js":Mo,"./core/device/calendar/index.js":Qo,"./core/device/clipboard/index.js":es,"./core/device/contact/index.js":rs,"./core/device/keyboard/index.js":os,"./core/device/memory/index.js":cs,"./core/device/network/index.js":ds,"./core/device/phone/index.js":ps,"./core/device/scan/index.js":hs,"./core/device/screen/index.js":_s,"./core/device/vibrate/index.js":Ss,"./core/ext/index.js":Jr,"./core/file/index.js":Ui,"./core/host-event/index.js":Ts,"./core/life-cycle/index.js":Mr,"./core/location/index.js":qs,"./core/map/index.js":ec,"./core/media/audio/index.js":rc,"./core/media/image/index.js":dc,"./core/media/video/index.js":gc,"./core/navigate/index.js":Sc,"./core/network/download/index.js":Oc,"./core/network/mdns/index.js":zc,"./core/network/request/index.js":el,"./core/network/tcp/index.js":nl,"./core/network/udp/index.js":al,"./core/network/upload/index.js":cl,"./core/network/websocket/index.js":ul,"./core/open-api/account-info/index.js":Cl,"./core/open-api/auth-list/index.js":Tl,"./core/open-api/auth-scope/index.js":Dl,"./core/open-api/authorize/index.js":kl,"./core/open-api/capture-screen/index.js":ni,"./core/open-api/email/index.js":jl,"./core/open-api/generate-qrcode/index.js":Nl,"./core/open-api/get-host-app-config/index.js":Fl,"./core/open-api/get-host-font-size/index.js":Ll,"./core/open-api/get-host-language/index.js":zl,"./core/open-api/get-user-profile/index.js":Vl,"./core/open-api/index.js":Gl,"./core/open-api/login/index.js":ql,"./core/open-api/phone-number/index.js":Ul,"./core/open-api/privacy/index.js":Yl,"./core/open-api/setting/index.js":Ql,"./core/open-api/user-info/index.js":tu,"./core/payment/index.js":ru,"./core/route/index.js":Xe,"./core/share/index.js":ai,"./core/storage/index.js":_i,"./core/ui/animation/index.js":au,"./core/ui/background/index.js":cu,"./core/ui/canvas/index.js":du,"./core/ui/custom-component/index.js":vu,"./core/ui/interaction/index.js":Cu,"./core/ui/menu/index.js":Mu,"./core/ui/navigation-bar/index.js":Lu,"./core/ui/pull-down-refresh/index.js":Uu,"./core/ui/scroll/index.js":Ku,"./core/ui/tab-bar/index.js":Ju,"./core/ui/window/index.js":rd,"./core/wxml/intersection-observer/index.js":Ht,"./core/wxml/media-query-observer/index.js":Gt,"./core/wxml/selector-query/index.js":Ft}),od={};for(let e of Object.values(ad))for(let[t,n]of Object.entries(e))od[t]=n;function sd(e){ei(e);for(let t of e||[])typeof t!=`string`||Object.prototype.hasOwnProperty.call(od,t)||t in Object.prototype||Object.defineProperty(od,t,{value:(...e)=>w(t,...e),writable:!0,enumerable:!0,configurable:!0})}var cd=new Proxy(od,{get(e,t,n){let r=Reflect.get(e,t,n);return typeof r==`function`||r!==void 0||t===`webpackJsonp`?r:(...e)=>w(t,...e)},set(e,t,n,r){return Reflect.set(e,t,n,r)}}),ld=new class{constructor(){this.init()}init(){let e=globalThis.__diminaApiNamespaces||[],t=globalThis.__diminaRegisteredApis||[];if(globalThis.name)try{let n=JSON.parse(globalThis.name);e.length===0&&(e=n.apiNamespaces||[]),t.length===0&&(t=n.registeredApis||[])}catch{}sd(t);for(let t of[`dd`,`wx`,...e])globalThis[t]=cd;globalThis.modRequire=y,globalThis.modDefine=oe,globalThis.modHotUpdate=se,globalThis.global={},globalThis.App=(e={})=>{V.createAppModule(e),H.createApp()},globalThis.Page=e=>{(globalThis.__diminaHotUpdating?V.hotUpdateModule.bind(V):V.createModule.bind(V))(e,globalThis.__extraInfo,R.type)},globalThis.Component=e=>{(globalThis.__diminaHotUpdating?V.hotUpdateModule.bind(V):V.createModule.bind(V))(e,globalThis.__extraInfo,I.type)},globalThis.Behavior=e=>e,globalThis.getApp=e=>H.getApp(e),globalThis.getCurrentPages=()=>S.stack()}},ud={navigateBack:tt,navigateTo:et,reLaunch:Qe,redirectTo:$e,switchTab:Ze};return new class{constructor(){this.env=ld,this.message=C,this.init()}init(){this.message.on(`loadResource`,e=>{let{appId:t,bridgeId:n,pagePath:r,root:i=`.`,baseUrl:a=`/`,hostEnv:o,query:s,resourceLoadId:c,scene:l}=e;o&&(x.init(o),Si(x.getStorageSnapshot())),H.setAppLaunchOptions({scene:l,pagePath:r,query:s}),V.loadResource({appId:t,bridgeId:n,pagePath:r,root:i,baseUrl:a,resourceLoadId:c})}),this.message.on(`hostEnvChanged`,e=>{if(e.hostEnv){let t=x.getSystemInfo()?.theme;x.update(e.hostEnv),Object.prototype.hasOwnProperty.call(e.hostEnv,`storageSnapshot`)&&Si(x.getStorageSnapshot());let n=x.getSystemInfo()?.theme;t&&n&&t!==n&&Oe(n)}}),this.message.on(`hotUpdateLogic`,e=>{V.hotUpdateResource(e),H.hotUpdateLogic(e)}),this.message.on(`hostEnvUpdate`,e=>{x.update(e)}),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 H.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;b.invoke(t,n)}),this.message.on(`componentInvokeAPI`,e=>{let{apiName:t,bridgeId:n,callbacks:r={},params:i={}}=e,a,o,s=(e,t)=>{e&&this.message.send({type:`triggerCallback`,target:`render`,body:{bridgeId:n,data:t,success:e}})};r.success&&(a=b.store(e=>s(r.success,e))),r.fail&&(o=b.store(e=>s(r.fail,e)));let c=b.store(e=>{s(r.complete,e),b.remove(a),b.remove(o)});this.message.invoke({type:`invokeAPI`,target:`container`,body:{name:t,bridgeId:n,params:{...i,complete:c,fail:o,success:a}}})}),this.message.on(`resourceLoadFailed`,({bridgeId:e,pagePath:t,errors:n=[]})=>{console.error(`[service] resourceLoadFailed: bridgeId: ${e}, pagePath: ${t}, errors: ${n.join(`; `)}`)}),this.onAppMsg(),this.onModuleMsg()}onAppMsg(){this.message.on(`resourceLoaded`,e=>{let{bridgeId:t,pagePath:n,query:r,stackId:i,resourceLoadId:a}=e,o=V.getModuleByPath(n);if(!o){console.error(`[service] resourceLoaded: module not found, pagePath: ${n}`);return}let s=V.getPropsByPath(o.usingComponents),c=`page_${p()}`;H.createInstance({bridgeId:t,moduleId:c,path:n,query:r,stackId:i,deferInitialData:!0}),C.send({type:`firstRender`,target:`render`,body:{bridgeId:t,pageId:c,pagePath:n,initialProps:s,query:r,resourceLoadId:a}})}),this.message.on(`pageInitialDataReady`,({bridgeId:e,moduleId:t})=>{let n=H.instances[e]?.[t];if(!n){console.warn(`[service] pageInitialDataReady: page not found, bridgeId: ${e}, moduleId: ${t}`);return}n.sendInitialData()}),this.message.on(`appShow`,()=>{H.appShow()}),this.message.on(`appHide`,()=>{H.appHide()}),this.message.on(`stackShow`,({stackId:e})=>{H.stackShow(e)}),this.message.on(`stackHide`,({stackId:e})=>{H.stackHide(e)})}onModuleMsg(){this.message.on(`mC`,e=>{H.createInstance(e)}),this.message.on(`mA`,e=>{H.moduleAttached(e)}),this.message.on(`mR`,e=>{H.moduleReady(e)}),this.message.on(`mU`,e=>{H.moduleUnmounted(e)}),this.message.on(`pageUnload`,e=>{H.pageUnload(e)}),this.message.on(`pageShow`,e=>{H.pageShow(e)}),this.message.on(`pageReady`,e=>{H.pageReady(e)}),this.message.on(`pageHide`,e=>{H.pageHide(e)}),this.message.on(`pagePullDownRefresh`,e=>{H.pagePullDownRefresh(e)}),this.message.on(`pageReachBottom`,e=>{H.pageReachBottom(e)}),this.message.on(`pageShareAppMessage`,async e=>{let t=await H.pageShareAppMessage(e);await li(t),e?.success&&this.message.send({type:`triggerCallback`,target:`container`,body:{bridgeId:e.bridgeId,id:e.success,args:[t],data:t}})}),this.message.on(`pageScroll`,e=>{H.pageScroll(e)}),this.message.on(`pageResize`,e=>{H.pageResize(e)}),this.message.on(`onTabItemTap`,e=>{H.pageTabItemTap(e)}),this.message.on(`pageRouteDone`,e=>{let{bridgeId:t}=e;H.componentRouteDone({bridgeId:t})}),this.message.on(`componentError`,e=>{H.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 H.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}})}ud[t]?.({url:n,...e.params})})}}})();