@macle-community/simulator-web 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +125 -2
- package/bin/macle-web-simulator.js +108 -0
- package/package.json +37 -4
- package/runtime/framework/service/service.js +1 -0
- package/runtime/framework/view/view.js +1 -0
- package/runtime/remoteDebug/adapter.js +1 -0
- package/runtime/remoteDebug/service.html +16 -0
- package/runtime/remoteDebug/sub-packages.js +1 -0
- package/runtime/simulator/config/config.json +40 -0
- package/runtime/simulator/css/common.css +945 -0
- package/runtime/simulator/index.html +95 -0
- package/runtime/simulator/mockApi.json +1 -0
- package/runtime/simulator/native/native.js +1 -0
- package/runtime/simulator/public/default-user-avatar@128w.jpg +0 -0
- package/runtime/simulator/service/app.js +1 -0
- package/runtime/simulator/service/service.html +14 -0
- package/runtime/simulator/service/sync-api.js +1 -0
- package/runtime/simulator/version.json +1 -0
- package/runtime/simulator/view/webview.js +1 -0
- package/src/compiler.js +117 -0
- package/src/mock-backend.js +225 -0
- package/src/project-parser.js +87 -0
- package/src/server.js +334 -0
- package/src/watcher.js +76 -0
- package/web/index.html +234 -0
- package/web/qrcode.js +1145 -0
- package/web/simulator.css +526 -0
- package/web/simulator.js +510 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! date: Wed Sep 30 2026, package version: 26.6.0-LG0001 */(()=>{var e={278:e=>{const t="mafile://",n={tmp:{env:"".concat(t,"tmp_")},store:{env:"".concat(t,"store_")},usr:{env:"".concat(t,"usr")}};e.exports={VALIDATE_ERROR_CAUSE:"macle-validate",envConfigs:n}},277:(e,t,n)=>{const a=n(118),o=n(695).getCurrentPage;e.exports={genSkeleton:function(){const e=function(){const e="".concat(o(),".html"),t=parent.window.__maConfig__,n=t.skeleton&&t.skeleton.config?t.skeleton.config:{},a=t.page[e].window.skeleton&&t.page[e].window.skeleton.config?t.page[e].window.skeleton.config:{};return Object.assign(n,a)}(),t=o(),n=document.getElementById(t),r=n.contentDocument.body,i=n.contentWindow,s=new a(r,i,e);s.genSkeleton();const c={skeleton:"<template>\n <div class='sk-container'>\n ".concat(s.skeletonHtml.join("\n "),'\n </div>\n</template>\n<style id="skeletonStyle">\n ').concat(s.skeletonStyle.join("\n "),"\n</style>\n"),path:t};return JSON.stringify(c)}}},118:(e,t,n)=>{function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function r(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=n(695),s={loading:"spin",image:{color:"#EFEFEF",shape:"rect"},text:{color:"#EFEFEF"},button:{color:"#EFEFEF"},color:"#EFEFEF",backgroundColor:"#FFF"};e.exports=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.options=o(o({},s),n),this.rootNode=e,this.skeletonHtml=[],this.skeletonStyle=[],this.iframe=t,this.nodeHandler={media:this.mediaHandler,button:this.buttonHandler,progress:this.progressHandler,slider:this.sliderHandler,"picker-view":this.pickerViewHandler,"scroll-view":this.scrollViewHandler}}mediaHandler(e){const t=i.getNodeName(e);let n=0,a=this.options.color;"ma-image"!==t&&"img"!==t||(n="circle"===this.options.image.shape?"100%":0,a=this.options.image.color),this.genGeneralSkeletonNode(e,a,n)}buttonHandler(e){const t=this.options.button.color,n=i.computeSizeAndLocation(e,this.iframe),a=n.height,o=n.top,r=n.radius,s=i.percentage(e.getBoundingClientRect().left,this.iframe.innerWidth),c=i.percentage(e.getBoundingClientRect().width,this.iframe.innerWidth);this.genSkeletonNode({width:c,height:a,top:o,left:s,color:t,radius:r})}progressHandler(e){const t=e.childNodes[0],n=e.childNodes[1].childNodes[0];this.genGeneralSkeletonNode(t),i.isTextNode(n)&&this.textNodeHandler(n)}sliderHandler(e){const t=e.childNodes[0],n=t.childNodes[0].childNodes[0];this.genGeneralSkeletonNode(n);const a=t.childNodes[1].childNodes[0];i.isTextNode(a)&&this.textNodeHandler(a)}pickerViewHandler(e){const t=e.getBoundingClientRect(),n=t.x,a=t.y,o=t.width,r=t.height,s=e=>{for(let t=0;t<e.childNodes.length;t++){const c=e.childNodes[t];if(i.isTextNode(c)){const e=i.getNodeRect(c);if(!(n<=e.x&&e.x<=n+o&&a<=e.y&&e.y<=a+r))continue;this.textNodeHandler(c)}else s(c)}};s(e)}textNodeHandler(e){if(!i.validTextValue(e))return;const t=i.rectPercentage(i.getNodeRect(e),this.iframe),n=t.width,a=t.height,o=t.top,r=t.left,s=this.options.text.color;let c=getComputedStyle(e.parentElement),l=c.lineHeight,d=c.fontSize;if(!/\d/.test(l)){const e=parseFloat(d)||14;l="".concat(1.4*e,"px")}let u=(100*i.getTextHeightRatio(d,l)).toFixed(4);const p="100% ".concat(i.transformPx(this.iframe,l));i.getNodeRect(e).height<2*parseFloat(d)&&(u=100);const f="sk_".concat(Math.floor(n),"_").concat(Math.floor(a),"_").concat(Math.floor(o),"_").concat(Math.floor(r)),m=".".concat(f," {\n background-image: linear-gradient(transparent ").concat(0,"%, ").concat(s," 0%, ").concat(s," ").concat(u,"%, transparent 0%) !important;\n background-size: ").concat(p,";\n background-repeat: 'repeat-y' !important;\n position: fixed !important;\n }");this.skeletonStyle.push(m),this.skeletonHtml.push(i.genDiv({className:f,width:n,height:a,top:o,left:r,zIndex:999}))}inScrollViewRange(e,t){return e.top>=t.top&&e.bottom<=t.bottom&&e.left>=t.left&&e.right<=t.right}scrollViewChild(e,t){for(let n=0;n<e.childNodes.length;n++){const a=e.childNodes[n];if(!i.isInvisible(a)){if(i.isTextNode(a)){const e=i.getNodeRect(a);this.inScrollViewRange(e,t)&&this.textNodeHandler(a);continue}const e=a.getBoundingClientRect(),n=i.getNodeType(a);this.nodeHandler[n]?this.inScrollViewRange(e,t)&&this.nodeHandler[n].call(this,a):this.scrollViewChild(a,t)}}}scrollViewHandler(e){const t=e.getBoundingClientRect();this.scrollViewChild(e,t)}genGeneralSkeletonNode(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const a=i.computeSizeAndLocation(e,this.iframe),o=a.width,r=a.height,s=a.top,c=a.left;let l=a.radius;l=n||l,this.genSkeletonNode({width:o,height:r,top:s,left:c,color:t,radius:l})}genSkeletonNode(e){let t=e.width,n=e.height,a=e.top,o=e.left,r=e.color,s=e.radius;const c=r||this.options.color,l="sk_".concat(Math.floor(t),"_").concat(Math.floor(n),"_").concat(Math.floor(a),"_").concat(Math.floor(o));this.skeletonHtml.push(i.genDiv({className:l,width:t,height:n,top:a,left:o,zIndex:999})),this.skeletonStyle.push(i.genStyle(l,c,s))}traverse(e){if(e.childNodes&&0!==e.childNodes.length)for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(i.isTextNode(n))this.textNodeHandler(n);else if(i.isInViewPort(n,this.iframe)){const e=i.getNodeName(n);if("ma-cover-image"===e||"ma-cover-view"===e){this.genGeneralSkeletonNode(n);continue}if(!i.isInvisible(n)){const e=i.getNodeType(n);this.nodeHandler[e]?this.nodeHandler[e].call(this,n):this.traverse(n)}}}}genBackground(){this.skeletonHtml.push(i.genDiv({className:"sk_canvas",width:100,height:100,top:0,left:0,zIndex:990})),this.skeletonStyle.push(i.genStyle("sk_canvas",this.options.backgroundColor,0))}genLoading(){let e={};switch(this.options.loading){case"shine":e=i.addShine();break;case"chiaroscuro":e=i.addChiaroscuro();break;default:e=i.addSpin()}e.skeletonHtml&&this.skeletonHtml.push(e.skeletonHtml),e.skeletonStyle&&this.skeletonStyle.push(e.skeletonStyle)}genSkeleton(){this.traverse(this.rootNode),this.genLoading(),this.genBackground()}}},695:e=>{function t(e){return e.nodeName.toLowerCase().trim()}function n(e){return e.nodeType===Node.ELEMENT_NODE?getComputedStyle(e):{}}function a(e,t){return e[t]?e[t]:""}function o(e){const n=t(e);return!("ma-view"!==n||e.childNodes&&0!==e.childNodes.length)||(!(e.childNodes&&0!==e.childNodes.length||!r(e))||(!!u(e)||["ma-image","ma-video","ma-audio","ma-swiper","img","ma-input","input","video","ma-camera","ma-icon","ma-map"].indexOf(n)>=0))}function r(e){if(e.nodeType===Node.ELEMENT_NODE){const t="none"!==getComputedStyle(e,"::before").content,n="none"!==getComputedStyle(e,"::after").content;return t||n}return!1}function i(e){if(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}}return{}}function s(e){if(e){const t=n(e);return{pt:parseInt(a(t,"paddingTop")),pl:parseInt(a(t,"paddingLeft")),pb:parseInt(a(t,"paddingBottom")),pr:parseInt(a(t,"paddingRight"))}}return{}}function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;return parseFloat(e/t*100).toFixed(n)}function l(e,t){let n=e.width,a=e.height,o=e.top,r=e.left;return n=c(n,t.innerWidth),a=c(a,t.innerHeight),o=c(o,t.innerHeight),r=c(r,t.innerWidth),{width:n,height:a,top:o,left:r}}function d(e){return{vh:e.innerHeight,vw:e.innerWidth}}function u(e){return["footer","header","hr","img","pre","nav","td","th"].indexOf((e.tagName||"").toLowerCase())>=0}e.exports={getCurrentPage:function(){return window.navigatorPages[window.navigatorPages.length-1].path},getNodeName:t,isInvisible:function(e){const t=n(e);return"none"===a(t,"display")||"hidden"===a(t,"visibility")||"0"===a(t,"opacity")||e.hidden},isInViewPort:function(e,t){const n=e.getBoundingClientRect();return n.top<t.innerHeight&&n.left<t.innerWidth},isMedia:o,isPseudo:r,isTextNode:function(e){return e.nodeType===Node.TEXT_NODE},validTextValue:function(e){return e.textContent.trim().length>0},getNodeType:function(e){const n=t(e);return o(e)?"media":n.startsWith("ma-")?n.substring(3,n.length):""},getPadding:s,getRect:i,getStyle:a,genDiv:function(e){let t=e.className,n=e.width,a=e.height,o=e.top,r=e.left,i=e.zIndex,s=void 0===i?999:i,c='<div class="'.concat(t,'" ');return c+='style="height: '.concat(a,"%; width: ").concat(n,"%; top: ").concat(o,"%; left: ").concat(r,"%; z-index: ").concat(s,';"></div>'),c},genStyle:function(e,t,n){return".".concat(e," {\n background-color: ").concat(t,";\n border-radius: ").concat(n,";\n position: fixed;\n }")},percentage:c,addChiaroscuro:function(){return{skeletonStyle:"\n @keyframes animation-chiaroscuro {\n 0% {\n opacity: 0.2;\n }\n\n 50% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0.2;\n }\n }\n .".concat("sk-container"," {\n animation: animation-chiaroscuro 2s infinite;\n }\n ")}},addShine:function(){const e="sk-loading-shine";return{skeletonHtml:'<div class="'.concat(e,'" style="z-index: 999"></div>'),skeletonStyle:"\n body {\n overflow: hidden;\n }\n @keyframes animation-shine {\n 0% {background-color:rgba(255, 255, 255, 0.2);}\n 25% {background-color:rgba(255, 255, 255, 0.4);}\n 50% {background-color:rgba(255, 255, 255, 0.8);}\n 75% {background-color:rgba(255, 255, 255, 0.4);}\n 100% {background-color:rgba(255, 255, 255, 0.2);}\n }\n .".concat(e," {\n animation: animation-shine 2s linear infinite;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 100%;\n }\n ")}},addSpin:function(){const e="sk-loading-spinner";return{skeletonHtml:' <div class="'.concat(e,'" style="z-index: 999">\n <div class="circular"></div>\n </div>'),skeletonStyle:"\n @keyframes animation-spin {\n 0% {\n transform: rotate(0);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n .".concat(e," {\n width: 100%;\n text-align: center;\n position: absolute;\n top: 50%;\n margin-top: -0.5rem;\n }\n .").concat(e," .circular {\n width: 1rem;\n height: 1rem;\n border-radius: 100%;\n display: inline-block;\n border: 2px solid #6d98f0;\n border-top-color: transparent;\n animation: animation-spin 1s linear infinite;\n }\n ")}},rectPercentage:l,computeSizeAndLocation:function(e,t){let o={width:0,height:0,top:0,left:0,radius:0};const r=i(e),c=r.top,d=r.left,u=r.width,p=r.height;if(u>0&&p>0&&c>=0&&d>=0){const r=s(e),i=r.pt,f=r.pl,m=r.pb;o=l({width:u-f-r.pr,height:p-i-m,top:c+i,left:d+f},t);const g=n(e);o.radius=a(g,"border-radius")}return o},isTargetNode:u,getViewPort:d,transformPx:function(e,t){const n="string"==typeof t?parseFloat(t):t,a=d(e).vh;return"".concat(c(n,a),"vh")},getTextWidth:function(e){const t=document.createRange();try{return t.selectNode(e.childNodes[0]),t.getBoundingClientRect().width}catch(e){return 0}},getNodeRect:function(e){const t=document.createRange();try{return t.selectNode(e),t.getBoundingClientRect()}catch(e){return{}}},getLineCount:function(e,t,n,a){return(e-parseFloat(t)-parseFloat(n))/parseFloat(a)},getTextHeightRatio:function(e,t){let n=parseFloat(e)/parseFloat(t);return Number.isNaN(n)&&(n=1/1.4),parseFloat(n).toFixed(4)},transformPositionX:function(e){const t=e.textAlign,n=e.display,a=e.justifyContent;let o;return o="center"===t||"flex"===n&&"center"===a?"50%":"right"===t||"flex"===n&&("end"===a||"flex-end"===a||"right"===a)?"100%":"0%",o},transformPositionY:function(e){const t=e.display,n=e.alignItems;if("flex"===t){if("center"===n||"stretch"===n)return"center";if("flex-end"===n)return"bottom"}return"top"}}}},t={};function n(a){var o=t[a];if(void 0!==o)return o.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};function t(e,t){return function(){return e.apply(t,arguments)}}n.r(e),n.d(e,{hasBrowserEnv:()=>Be,hasStandardBrowserEnv:()=>je,hasStandardBrowserWebWorkerEnv:()=>Fe,navigator:()=>xe,origin:()=>Ue});const{toString:a}=Object.prototype,{getPrototypeOf:o}=Object,{iterator:r,toStringTag:i}=Symbol,s=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),c=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),l=(e,t,n)=>e===Object.prototype||!n&&null===t,d=(e,t)=>{let n=e;const a=[];for(;null!=n;){if(-1!==a.indexOf(n))return!1;a.push(n);const r=o(n);if(l(n,r,n===e))return!1;if(s(n,t))return!0;n=r}return!1},u=(p=Object.create(null),e=>{const t=a.call(e);return p[t]||(p[t]=t.slice(8,-1).toLowerCase())});var p;const f=e=>(e=e.toLowerCase(),t=>u(t)===e),m=e=>t=>typeof t===e,{isArray:g}=Array,h=m("undefined");function b(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&w(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=f("ArrayBuffer");const v=m("string"),w=m("function"),E=m("number"),_=e=>null!==e&&"object"==typeof e,O=e=>{if(!_(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==o(t)||d(e,i)||d(e,r))},I=f("Date"),S=f("File"),P=f("Blob"),T=f("FileList"),A=f("Set");const N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},k=void 0!==N.FormData?N.FormData:void 0,C=f("URLSearchParams"),[R,M,D,L]=["ReadableStream","Request","Response","Headers"].map(f);function B(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let a,o;if("object"!=typeof e&&(e=[e]),g(e))for(a=0,o=e.length;a<o;a++)t.call(null,e[a],a,e);else{if(b(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),r=o.length;let i;for(a=0;a<r;a++)i=o[a],t.call(null,e[i],i,e)}}function x(e,t){if(b(e))return null;t=t.toLowerCase();const n=Object.keys(e);let a,o=n.length;for(;o-- >0;)if(a=n[o],t===a.toLowerCase())return a;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,F=e=>!h(e)&&e!==j;const U=(H="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>H&&e instanceof H);var H;const V=f("HTMLFormElement"),{propertyIsEnumerable:G}=Object.prototype,W=f("RegExp"),J=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),a={};B(n,((n,o)=>{let r;!1!==(r=t(n,o,e))&&(a[o]=r||n)})),Object.defineProperties(e,a)};const K=f("AsyncFunction"),z=(Y="function"==typeof setImmediate,q=w(j.postMessage),Y?setImmediate:q?((e,t)=>(j.addEventListener("message",(({source:n,data:a})=>{n===j&&a===e&&t.length&&t.shift()()}),!1),n=>{t.push(n),j.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Y,q;const X="undefined"!=typeof queueMicrotask?queueMicrotask.bind(j):"undefined"!=typeof process&&process.nextTick||z,$=e=>null!=e&&w(e[r]),Z={isArray:g,isArrayBuffer:y,isBuffer:b,isFormData:e=>{if(!e)return!1;if(k&&e instanceof k)return!0;const t=o(e);if(!t||t===Object.prototype)return!1;if(!w(e.append))return!1;const n=u(e);return"formdata"===n||"object"===n&&w(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:v,isNumber:E,isBoolean:e=>!0===e||!1===e,isObject:_,isPlainObject:O,isEmptyObject:e=>{if(!_(e)||b(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:R,isRequest:M,isResponse:D,isHeaders:L,isUndefined:h,isDate:I,isFile:S,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:P,isRegExp:W,isFunction:w,isStream:e=>_(e)&&w(e.pipe),isURLSearchParams:C,isTypedArray:U,isFileList:T,forEach:B,merge:function e(...t){const{caseless:n,skipUndefined:a}=F(this)&&this||{},o={},r=(t,r)=>{if("__proto__"===r||"constructor"===r||"prototype"===r)return;const i=n&&"string"==typeof r&&x(o,r)||r,c=s(o,i)?o[i]:void 0;O(c)&&O(t)?o[i]=e(c,t):O(t)?o[i]=e({},t):g(t)?o[i]=t.slice():a&&h(t)||(o[i]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||b(n))continue;if(B(n,r),"object"!=typeof n||g(n))continue;const a=Object.getOwnPropertySymbols(n);for(let e=0;e<a.length;e++){const t=a[e];G.call(n,t)&&r(n[t],t)}}return o},extend:(e,n,a,{allOwnKeys:o}={})=>(B(n,((n,o)=>{a&&w(n)?Object.defineProperty(e,o,{__proto__:null,value:t(n,a),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,a)=>{e.prototype=Object.create(t.prototype,a),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,a)=>{let r,i,s;const c={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)s=r[i],a&&!a(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:f,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const a=e.indexOf(t,n);return-1!==a&&a===n},toArray:e=>{if(!e)return null;if(g(e))return e;let t=e.length;if(!E(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[r]).call(e);let a;for(;(a=n.next())&&!a.done;){const n=a.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const a=[];for(;null!==(n=e.exec(t));)a.push(n);return a},isHTMLForm:V,hasOwnProperty:s,hasOwnProp:s,hasOwnInPrototypeChain:d,getSafeProp:(e,t)=>null!=e&&d(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=o(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every((t=>{if(c(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable}))})(e))return e;const n=Object.create(null),a=Object.create(null),r=[];let i=e;for(;null!=i&&-1===r.indexOf(i);){r.push(i);const d=i===e?t:o(i);if(l(i,d,i===e))break;const u=Object.getOwnPropertyNames(i);Object.getOwnPropertySymbols&&u.push(...Object.getOwnPropertySymbols(i));for(const t of u)c(t)||s(a,t)||(n[t]=e[t],a[t]=!0);i=d}return n},reduceDescriptors:J,freezeMethods:e=>{J(e,((t,n)=>{if(w(e)&&["arguments","caller","callee"].includes(n))return!1;const a=e[n];w(a)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},a=e=>{e.forEach((e=>{n[e]=!0}))};return g(e)?a(e):a(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:x,global:j,isContextDefined:F,isSpecCompliantForm:function(e){return!!(e&&w(e.append)&&"FormData"===e[i]&&e[r])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(_(e)){if(t.has(e))return;if(b(e))return e;if(!("toJSON"in e)){let a;if(t.add(e),A(e)){a=[];for(const t of e){const e=n(t);!h(e)&&a.push(e)}}else a=g(e)?[]:{},B(e,((e,t)=>{const o=n(e);!h(o)&&(a[t]=o)}));return t.delete(e),a}}return e};return n(e)},isAsyncFn:K,isThenable:e=>e&&(_(e)||w(e))&&w(e.then)&&w(e.catch),setImmediate:z,asap:X,isIterable:$,isSafeIterable:e=>null!=e&&d(e,r)&&$(e)},Q=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ee=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),te=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ne(e,t){return Z.isArray(e)?e.map((e=>ne(e,t))):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function ae(e){const t=Object.create(null);return Z.forEach(e.toJSON(),((e,n)=>{t[n]=(e=>ne(e,te))(e)})),t}const oe=Symbol("internals");function re(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:Z.isArray(e)?e.map(ie):(e=>ne(e,ee))(String(e))}const se=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function ce(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function le(e,t,n,a,o){return Z.isFunction(a)?a.call(this,t,n):(o&&(t=n),Z.isString(t)?Z.isString(a)?-1!==t.indexOf(a):Z.isRegExp(a)?a.test(t):void 0:void 0)}class de{constructor(e){e&&this.set(e)}set(e,t,n){const a=this;function o(e,t,n){const o=re(t);if(!o)return;const r=Z.findKey(a,o);(!r||void 0===a[r]||!0===n||void 0===n&&!1!==a[r])&&(a[r||t]=ie(e))}const r=(e,t)=>Z.forEach(e,((e,n)=>o(e,n,t)));if(Z.isPlainObject(e)||e instanceof this.constructor)r(e,t);else if(Z.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))r((e=>{const t={};let n,a,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),a=e.substring(o+1).trim();const r=Z.hasOwnProp(t,n);!n||r&&Z.hasOwnProp(Q,n)||("set-cookie"===n?r?t[n].push(a):t[n]=[a]:t[n]=r?t[n]+", "+a:a)})),t})(e),t);else if(Z.isObject(e)&&Z.isSafeIterable(e)){let n,a,o=Object.create(null);for(const t of e){if(!Z.isArray(t))throw new TypeError("Object iterator must return a key-value pair");a=t[0],Z.hasOwnProp(o,a)?(n=o[a],o[a]=Z.isArray(n)?[...n,t[1]]:[n,t[1]]):o[a]=t[1]}r(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=re(e)){const n=Z.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let a;for(;a=n.exec(e);)t[a[1]]=a[2];return t}(e);if(Z.isFunction(t))return t.call(this,e,n);if(Z.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=re(e)){const n=Z.findKey(this,e);return!(!n||void 0===this[n]||t&&!le(0,this[n],n,t))}return!1}delete(e,t){const n=this;let a=!1;function o(e){if(e=re(e)){const o=Z.findKey(n,e);!o||t&&!le(0,n[o],o,t)||(delete n[o],a=!0)}}return Z.isArray(e)?e.forEach(o):o(e),a}clear(e){const t=Object.keys(this);let n=t.length,a=!1;for(;n--;){const o=t[n];e&&!le(0,this[o],o,e,!0)||(delete this[o],a=!0)}return a}normalize(e){const t=this,n={};return Z.forEach(this,((a,o)=>{const r=Z.findKey(n,o);if(r)return t[r]=ie(a),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ie(a),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Z.forEach(this,((n,a)=>{null!=n&&!1!==n&&(t[a]=e&&Z.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){const e=this.get("set-cookie");return Z.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let a=0,o=!1,r=!1;function i(e){const o=ce(n.slice(a,e)),r=o.indexOf("=");if(r<1)return;const i=ce(o.slice(0,r));if(!se.test(i))return;const s=i.toLowerCase();if("__proto__"===s||"constructor"===s||"prototype"===s)return;const c=ce(o.slice(r+1));t[s]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let a=1;a<t;a++){const o=e.charCodeAt(a);if(34===o)return e;if(92===o&&(a+=1,a>=t))return e;n+=e[a]}return n}(c)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);o?r?r=!1:92===t?r=!0:34===t&&(o=!1):34===t?o=!0:44!==t&&59!==t||(i(e),a=e+1)}return i(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function a(e){const a=re(e);t[a]||(!function(e,t){const n=Z.toCamelCase(" "+t);["get","set","has"].forEach((a=>{Object.defineProperty(e,a+n,{__proto__:null,value:function(e,n,o){return this[a].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[a]=!0)}return Z.isArray(e)?e.forEach(a):a(e),this}}de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(de.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),Z.freezeMethods(de);const ue=de,pe="[REDACTED ****]";function fe(e,t){const n=new Set(t.map((e=>String(e).toLowerCase()))),a=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(Z.isBuffer(e))return e;if(-1!==a.indexOf(e))return;let t;if(e instanceof ue&&(e=e.toJSON()),a.push(e),Z.isArray(e))t=[],e.forEach(((e,n)=>{const a=o(e);Z.isUndefined(a)||(t[n]=a)}));else{if(!Z.isPlainObject(e)&&function(e){if(Z.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return a.pop(),e;t=Object.create(null);for(const[a,r]of Object.entries(e)){const e=n.has(a.toLowerCase())?pe:o(r);Z.isUndefined(e)||(t[a]=e)}}return a.pop(),t};return o(e)}function me(e){try{return String(e)}catch(e){return""}}class ge extends Error{static from(e,t,n,a,o,r){let i=e.message;!i&&Z.isArray(e.errors)&&e.errors.length&&(i=function(e){return e.errors.map((e=>{try{return e&&e.message?me(e.message):me(e)}catch(e){return""}})).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const s=new ge(i,t||e.code,n,a,o);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),r&&Object.assign(s,r),s}constructor(e,t,n,a,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),a&&(this.request=a),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&Z.hasOwnProp(e,"redact")?e.redact:void 0,n=Z.isArray(t)&&t.length>0?fe(e,t):Z.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}}ge.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",ge.ERR_BAD_OPTION="ERR_BAD_OPTION",ge.ECONNABORTED="ECONNABORTED",ge.ETIMEDOUT="ETIMEDOUT",ge.ECONNREFUSED="ECONNREFUSED",ge.ERR_NETWORK="ERR_NETWORK",ge.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",ge.ERR_DEPRECATED="ERR_DEPRECATED",ge.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",ge.ERR_BAD_REQUEST="ERR_BAD_REQUEST",ge.ERR_CANCELED="ERR_CANCELED",ge.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",ge.ERR_INVALID_URL="ERR_INVALID_URL",ge.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const he=ge,be=null;function ye(e){return Z.isPlainObject(e)||Z.isArray(e)}function ve(e){return Z.endsWith(e,"[]")?e.slice(0,-2):e}function we(e,t,n){return e?e.concat(t).map((function(e,t){return e=ve(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const Ee=Z.toFlatObject(Z,{},null,(function(e){return/^is[A-Z]/.test(e)}));const _e=function(e,t,n){if(!Z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const a=(e,t)=>{const a=Z.getSafeProp(n,e);return Z.isUndefined(a)?t:a},o=a("metaTokens",!0),r=a("visitor")||m,i=a("dots",!1),s=a("indexes",!1),c=a("Blob")||"undefined"!=typeof Blob&&Blob,l=a("maxDepth",100),d=c&&Z.isSpecCompliantForm(t),u=[];if(!Z.isFunction(r))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(Z.isDate(e))return e.toISOString();if(Z.isBoolean(e))return e.toString();if(!d&&Z.isBlob(e))throw new he("Blob is not supported. Use a Buffer instead.");if(Z.isArrayBuffer(e)||Z.isTypedArray(e)){if(d&&"function"==typeof c)return new c([e]);throw new he("Blob is not supported. Use a Buffer instead.",he.ERR_NOT_SUPPORT)}return e}function f(e){if(e>l)throw new he("Object is too deeply nested ("+e+" levels). Max depth: "+l,he.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,n,a){let r=e;if(Z.isReactNative(t)&&Z.isReactNativeBlob(e))return t.append(we(a,n,i),p(e)),!1;if(e&&!a&&"object"==typeof e)if(Z.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(l===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,(function(e,a){if(!Z.isObject(a))return a;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(a),f(t+n.length-1),a}))}(e,1);else if(Z.isArray(e)&&function(e){return Z.isArray(e)&&!e.some(ye)}(e)||(Z.isFileList(e)||Z.endsWith(n,"[]"))&&(r=Z.toArray(e)))return n=ve(n),r.forEach((function(e,a){!Z.isUndefined(e)&&null!==e&&t.append(!0===s?we([n],a,i):null===s?n:n+"[]",p(e))})),!1;return!!ye(e)||(t.append(we(a,n,i),p(e)),!1)}const g=Object.assign(Ee,{defaultVisitor:m,convertValue:p,isVisitable:ye});if(!Z.isObject(e))throw new TypeError("data must be an object");return function e(n,a,o=0){if(!Z.isUndefined(n)){if(f(o),-1!==u.indexOf(n))throw new Error("Circular reference detected in "+a.join("."));u.push(n),Z.forEach(n,(function(n,i){!0===(!(Z.isUndefined(n)||null===n)&&r.call(t,n,Z.isString(i)?i.trim():i,a,g))&&e(n,a?a.concat(i):[i],o+1)})),u.pop()}}(e),t};function Oe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function Ie(e,t){this._pairs=[],e&&_e(e,this,t)}const Se=Ie.prototype;Se.append=function(e,t){this._pairs.push([e,t])},Se.toString=function(e){const t=e?t=>e.call(this,t,Oe):Oe;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Pe=Ie;function Te(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ae(e,t,n){if(!t)return e;e=e||"";const a=Z.isFunction(n)?{serialize:n}:n,o=Z.getSafeProp(a,"encode")||Te,r=Z.getSafeProp(a,"serialize");let i;if(i=r?r(t,a):Z.isURLSearchParams(t)?t.toString():new Pe(t,a).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const Ne=Symbol("internals");function ke(e){return e?e.length:0}function Ce(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function Re(e,t){const n=e.handlers,a=ke(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):a!==t.handlersLength&&(a?t.handlerEntries.forEach((function(e,a){n[e.index]!==e.handler&&t.handlerEntries.delete(a)})):t.handlerEntries.clear()),t.handlersLength=a}const Me=class{constructor(){this.handlers=[],this[Ne]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const a={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},o=this[Ne];null==this.handlers&&(this.handlers=[]),Re(this,o);const r=o.nextId++;return this.handlers.push(a),o.handlerEntries.set(r,{handler:a,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,r}eject(e){const t=this[Ne];Re(this,t);const n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(Ce(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Re(this,this[Ne]))}forEach(e){const t=this[Ne];Re(this,t),t.iterationDepth++;try{Z.forEach(this.handlers,(function(t){null!==t&&e(t)}))}finally{--t.iterationDepth||(Re(this,t),Ce(this.handlers),t.handlersLength=ke(this.handlers))}}},De={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Le={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Pe,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Be="undefined"!=typeof window&&"undefined"!=typeof document,xe="object"==typeof navigator&&navigator||void 0,je=Be&&(!xe||["ReactNative","NativeScript","NS"].indexOf(xe.product)<0),Fe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ue=Be&&window.location.href||"http://localhost",He={...e,...Le};function Ve(e){if(e>100)throw new he("FormData field is too deeply nested ("+e+" levels). Max depth: 100",he.ERR_FORM_DATA_DEPTH_EXCEEDED)}const Ge=function(e){function t(e,n,a,o){Ve(o);let r=e[o++];if("__proto__"===r)return!0;const i=Number.isFinite(+r),s=o>=e.length;if(r=!r&&Z.isArray(a)?a.length:r,s)return Z.hasOwnProp(a,r)?a[r]=Z.isArray(a[r])?a[r].concat(n):[a[r],n]:a[r]=n,!i;Z.hasOwnProp(a,r)&&Z.isObject(a[r])||(a[r]=[]);return t(e,n,a[r],o)&&Z.isArray(a[r])&&(a[r]=function(e){const t={},n=Object.keys(e);let a;const o=n.length;let r;for(a=0;a<o;a++)r=n[a],t[r]=e[r];return t}(a[r])),!i}if(Z.isFormData(e)&&Z.isFunction(e.entries)){const n={};return Z.forEachEntry(e,((e,a)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let a;for(;null!==(a=n.exec(e));)Ve(t.length),t.push("[]"===a[0]?"":a[1]||a[0]);return t}(e),a,n,0)})),n}return null},We=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Je=(e,t)=>null!=e&&Z.hasOwnProp(e,t)?e[t]:void 0;const Ke={transitional:De,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",a=n.indexOf("application/json")>-1,o=Z.isObject(e);o&&Z.isHTMLForm(e)&&(e=new FormData(e));if(Z.isFormData(e))return a?JSON.stringify(Ge(e)):e;if(Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)||Z.isReadableStream(e))return e;if(Z.isArrayBufferView(e))return e.buffer;if(Z.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(o){const t=Je(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return _e(e,new He.classes.URLSearchParams,{visitor:function(e,t,n,a){return He.isNode&&Z.isBuffer(e)?(this.append(t,e.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((r=Z.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Je(this,"env"),a=n&&n.FormData;return _e(r?{"files[]":e}:e,a&&new a,t)}}return o||a?(t.setContentType("application/json",!1),function(e,t,n){if(Z.isString(e))try{return(t||JSON.parse)(e),Z.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Je(this,"transitional")||Ke.transitional,n=t&&t.forcedJSONParsing,a=Je(this,"responseType"),o="json"===a;if(Z.isResponse(e)||Z.isReadableStream(e))return e;if(e&&Z.isString(e)&&(n&&!a||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Je(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw he.from(e,he.ERR_BAD_RESPONSE,this,null,Je(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:He.classes.FormData,Blob:He.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(We,(e=>{Ke.headers[e]={}}));const ze=Ke;function Ye(e,t){const n=this||ze,a=t||n,o=ue.from(a.headers);let r=a.data;return Z.forEach(e,(function(e){r=e.call(n,r,o.normalize(),t?t.status:void 0)})),o.normalize(),r}function qe(e){return!(!e||!e.__CANCEL__)}const Xe=class extends he{constructor(e,t,n){super(null==e?"canceled":e,he.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function $e(e,t,n){const a=n.config.validateStatus;n.status&&a&&!a(n.status)?t(new he("Request failed with status code "+n.status,n.status>=400&&n.status<500?he.ERR_BAD_REQUEST:he.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const Ze=/[\t\n\r]/g;function Qe(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Ze,"")}function et(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const tt=function(e,t){e=e||10;const n=new Array(e),a=new Array(e);let o,r=0,i=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),l=a[i];o||(o=c),n[r]=s,a[r]=c;let d=i,u=0;for(;d!==r;)u+=n[d++],d%=e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),c-o<t)return;const p=l&&c-l;return p?Math.round(1e3*u/p):void 0}};const nt=function(e,t){let n,a,o=0,r=1e3/t;const i=(t,r=Date.now())=>{o=r,n=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=r?i(e,t):(n=e,a||(a=setTimeout((()=>{a=null,i(n)}),r-s)))},()=>n&&i(n),(...e)=>i(e)]},at=(e,t,n=3)=>{let a=0;const o=tt(50,250);return nt((n=>{if(!n||!Z.isNumber(n.loaded))return;const r=n.loaded,i=n.lengthComputable?n.total:void 0,s=Math.max(0,null!=i?Math.min(r,i):r),c=Math.max(0,s-a),l=o(c);a=Math.max(a,s);e({loaded:s,total:i,progress:i?s/i:void 0,bytes:c,rate:l||void 0,estimated:l&&i?(i-s)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),n)},ot=(e,t)=>{const n=null!=e;return[a=>t[0]({lengthComputable:n,total:e,loaded:a}),t[1]]},rt=(e,t=Z.asap)=>(...n)=>t((()=>e(...n))),it=He.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,He.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(He.origin),He.navigator&&/(msie|trident)/i.test(He.navigator.userAgent)):()=>!0,st=He.hasStandardBrowserEnv?{write(e,t,n,a,o,r,i){if("undefined"==typeof document)return;const s=[`${e}=${encodeURIComponent(t)}`];Z.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),Z.isString(a)&&s.push(`path=${a}`),Z.isString(o)&&s.push(`domain=${o}`),!0===r&&s.push("secure"),Z.isString(i)&&s.push(`SameSite=${i}`),document.cookie=s.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const a=t[n].replace(/^\s+/,""),o=a.indexOf("=");if(-1!==o&&a.slice(0,o)===e)try{return decodeURIComponent(a.slice(o+1))}catch(e){return a.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};const ct=/^https?:(?!\/\/)/i;function lt(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${pe}@`),n=t.indexOf("#"),a=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${pe}`);return-1===n?a:`${a}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,((e,t,n="")=>`${t}${n}${pe}`)):o}`;var o}function dt(e,t){if("string"==typeof e){const n=Qe(e);if(ct.test(n))throw new he(`Invalid URL ${JSON.stringify(lt(n))}: missing "//" after protocol`,he.ERR_INVALID_URL,t)}}function ut(e,t,n,a){dt(t,a);let o=!("string"==typeof(r=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r));var r;return e&&(o||!1===n)?(dt(e,a),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const pt=e=>e instanceof ue?{...e}:e;function ft(e,t){e=e||{},t=t||{};const n=Object.create(null);function a(e,t,n,a){return Z.isPlainObject(e)&&Z.isPlainObject(t)?Z.merge.call({caseless:a},e,t):Z.isPlainObject(t)?Z.merge({},t):Z.isArray(t)?t.slice():t}function o(e,t,n,o){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:a(void 0,e,0,o):a(e,t,0,o)}function r(e,t){if(!Z.isUndefined(t))return a(void 0,t)}function i(e,t){return Z.isUndefined(t)?Z.isUndefined(e)?void 0:a(void 0,e):a(void 0,t)}function s(n,o,r){return Z.hasOwnProp(t,r)?a(n,o):Z.hasOwnProp(e,r)?a(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:r,method:r,data:r,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutErrorMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:s,headers:(e,t,n)=>o(pt(e),pt(t),0,!0)};var l;return Z.forEach((l={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(l).concat(Object.getOwnPropertySymbols(l).filter((e=>Object.getOwnPropertyDescriptor(l,e).enumerable))):Object.keys(l)),(function(a){if("__proto__"===a||"constructor"===a||"prototype"===a)return;const r=Z.hasOwnProp(c,a)?c[a]:o,i=r(Z.hasOwnProp(e,a)?e[a]:void 0,Z.hasOwnProp(t,a)?t[a]:void 0,a);Z.isUndefined(i)&&r!==s||(n[a]=i)})),Z.hasOwnProp(t,"validateStatus")&&Z.isUndefined(t.validateStatus)&&!1===function(n){const a=Z.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Z.isUndefined(a)){if(!Z.isPlainObject(a))return;if(Z.hasOwnProp(a,n))return a[n]}const o=Z.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Z.isPlainObject(o)&&Z.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Z.hasOwnProp(e,"validateStatus")?n.validateStatus=a(void 0,e.validateStatus):delete n.validateStatus),n}const mt=["content-type","content-length"];const gt=function(e){const t=ft({},e),n=e=>Z.hasOwnProp(t,e)?t[e]:void 0,a=n("data");let o=n("withXSRFToken");const r=n("xsrfHeaderName"),i=n("xsrfCookieName");let s=n("headers");const c=n("auth"),l=n("baseURL"),d=n("allowAbsoluteUrls"),u=n("url");if(t.headers=s=ue.from(s),t.url=Ae(ut(l,u,d,t),n("params"),n("paramsSerializer")),c){const t=Z.getSafeProp(c,"username")||"",n=Z.getSafeProp(c,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(n?encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))):"")))}catch(t){throw he.from(t,he.ERR_BAD_OPTION_VALUE,e)}}if(Z.isFormData(a)){const e=Z.getSafeProp(a,"getHeaders");He.hasStandardBrowserEnv||He.hasStandardBrowserWebWorkerEnv||Z.isReactNative(a)?s.setContentType(void 0):Z.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((([t,n])=>{mt.includes(t.toLowerCase())&&e.set(t,n)})):e.set(t)}(s,e.call(a),n("formDataHeaderPolicy"))}if(He.hasStandardBrowserEnv){Z.isFunction(o)&&(o=o(t));if(!0===o||null==o&&it(t.url)){const e=r&&i&&st.read(i);e&&s.set(r,e)}}return t},ht="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const a=gt(e);let o=a.data;const r=ue.from(a.headers).normalize();let i,s,c,l,d,u,{responseType:p,onUploadProgress:f,onDownloadProgress:m}=a;function g(){l&&l(),d&&d(),a.cancelToken&&a.cancelToken.unsubscribe(i),a.signal&&a.signal.removeEventListener("abort",i)}let h=new XMLHttpRequest;function b(o){if(!h)return;if(!(0!==h.status||"file"===(et(Qe(a.url))||et(He.origin))||h.responseURL&&h.responseURL.startsWith("file:")))return n(new he("Request aborted",he.ECONNABORTED,e,h)),g(),void(h=null);try{o?u&&u(o):d&&d()}catch(e){setTimeout((()=>{throw e}))}if(!h)return;const r=ue.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());$e((function(e){t(e),g()}),(function(e){n(e),g()}),{data:p&&"text"!==p&&"json"!==p?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}h.open(a.method.toUpperCase(),a.url,!0),h.timeout=a.timeout,"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&h.responseURL.startsWith("file:"))&&setTimeout(b)},h.onabort=function(){h&&(n(new he("Request aborted",he.ECONNABORTED,e,h)),g(),h=null)},h.onerror=function(t){const a=t&&t.message?t.message:"Network Error",o=new he(a,he.ERR_NETWORK,e,h);o.event=t||null,n(o),g(),h=null},h.ontimeout=function(){let t=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const o=a.transitional||De;a.timeoutErrorMessage&&(t=a.timeoutErrorMessage),n(new he(t,o.clarifyTimeoutError?he.ETIMEDOUT:he.ECONNABORTED,e,h)),g(),h=null},void 0===o&&r.setContentType(null),"setRequestHeader"in h&&Z.forEach(ae(r),(function(e,t){h.setRequestHeader(t,e)})),Z.isUndefined(a.withCredentials)||(h.withCredentials=!!a.withCredentials),p&&"json"!==p&&(h.responseType=a.responseType),m&&([c,d,u]=at(m,!0),h.addEventListener("progress",c)),f&&h.upload&&([s,l]=at(f),h.upload.addEventListener("progress",s),h.upload.addEventListener("loadend",l)),(a.cancelToken||a.signal)&&(i=t=>{h&&(n(!t||t.type?new Xe(null,e,h):t),h.abort(),g(),h=null)},a.cancelToken&&a.cancelToken.subscribe(i),a.signal&&(a.signal.aborted?i():a.signal.addEventListener("abort",i)));const y=et(a.url);if(y&&!He.protocols.includes(y))return n(new he("Unsupported protocol "+y+":",he.ERR_BAD_REQUEST,e)),void g();h.send(o||null)}))},bt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let a=!1;const o=function(e){if(!a){a=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof he?t:new Xe(t instanceof Error?t.message:t))}};let r=t&&setTimeout((()=>{r=null,o(new he(`timeout of ${t}ms exceeded`,he.ETIMEDOUT))}),t);const i=()=>{e&&(r&&clearTimeout(r),r=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>{a||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))}));const{signal:s}=n;return s.unsubscribe=()=>Z.asap(i),s},yt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let a,o=0;for(;o<n;)a=o+t,yield e.slice(o,a),o=a},vt=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},wt=(e,t,n,a)=>{const o=async function*(e,t){for await(const n of vt(e))yield*yt(n,t)}(e,t);let r,i=0,s=e=>{r||(r=!0,a&&a(e))};return new ReadableStream({async pull(e){try{const{done:t,value:a}=await o.next();if(t)return s(),void e.close();let r=a.byteLength;if(n){let e=i+=r;n(e)}e.enqueue(new Uint8Array(a))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},Et=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,_t=(e,t,n)=>t+2<n&&Et(e.charCodeAt(t+1))&&Et(e.charCodeAt(t+2)),Ot=e=>e<=57?e-48:(223&e)-55,It=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,St=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Pt=e=>{const t=e.length;let n=0,a=0,o=!1;for(let i=0;i<t;i++){let s=e.charCodeAt(i);37===s&&_t(e,i,t)&&(s=16*Ot(e.charCodeAt(i+1))+Ot(e.charCodeAt(i+2)),i+=2),9!==(r=s)&&10!==r&&12!==r&&13!==r&&32!==r&&(61!==s?!It(s)||a>0?o=!0:n++:a++)}var r;return o||a>2||a>0&&(n+a)%4!=0||n%4==1?St(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Tt=(e,t)=>{if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const a=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(a))return t(o);let r=0;for(let e=0,t=o.length;e<t;e++){const n=o.charCodeAt(e);if(37===n&&_t(o,e,t))r+=1,e+=2;else if(n<128)r+=1;else if(n<2048)r+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=o.charCodeAt(e+1);t>=56320&&t<=57343?(r+=4,e++):r+=3}else r+=3}return r};const At="1.20.0",Nt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:kt}=Z,Ct=e=>{if(!Z.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Rt=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Mt=e=>{const t=void 0!==Z.global&&null!==Z.global?Z.global:globalThis,{ReadableStream:n,TextEncoder:a}=t;e=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:r,Response:i}=e,s=o?kt(o):"function"==typeof fetch,c=kt(r),l=kt(i);if(!s)return!1;const d=s&&kt(n),u=s&&("function"==typeof a?(p=new a,e=>p.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var p;const f=c&&d&&Rt((()=>{let e=!1;const t=new r(He.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),a=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!a})),m=l&&d&&Rt((()=>Z.isReadableStream(new i("").body))),g={stream:m&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!g[e]&&(g[e]=(t,n)=>{let a=t&&t[e];if(a)return a.call(t);throw new he(`Response type '${e}' is not supported`,he.ERR_NOT_SUPPORT,n)})}));const h=async e=>{if(null==e)return 0;if(Z.isBlob(e))return e.size;if(Z.isSpecCompliantForm(e)){const t=new r(He.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Z.isArrayBufferView(e)||Z.isArrayBuffer(e)?e.byteLength:(Z.isURLSearchParams(e)&&(e+=""),Z.isString(e)?(await u(e)).byteLength:void 0)};return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:u,timeout:p,onDownloadProgress:b,onUploadProgress:y,responseType:v,headers:w,withCredentials:E="same-origin",fetchOptions:_,maxContentLength:O,maxBodyLength:I,maxRedirects:S}=gt(e);const P=Z.isNumber(O)&&O>-1,T=Z.isNumber(I)&&I>-1;let A=o||fetch;v=v?(v+"").toLowerCase():"text";let N=bt([l,u&&u.toAbortSignal()],p),k=null;const C=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let R,M=null;const D=()=>new he("Request body larger than maxBodyLength limit",he.ERR_BAD_REQUEST,e,k);try{let o;const l=(B="auth",Z.hasOwnProp(e,B)?e[B]:void 0);if(l){const e=Z.getSafeProp(l,"username")||"";o={username:e,password:Z.getSafeProp(l,"password")||""}}if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){const e=new URL(t,He.origin);if(!o&&(e.username||e.password)){const t=Ct(e.username);o={username:t,password:Ct(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(o&&(w.delete("authorization"),w.set("Authorization","Basic "+btoa((L=(o.username||"")+":"+(o.password||""),encodeURIComponent(L).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),P&&"string"==typeof t&&t.startsWith("data:")){const n=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return Tt(-1===t?e:e.slice(0,t),Pt)}(t);if(n>O)throw new he("maxContentLength size of "+O+" exceeded",he.ERR_BAD_RESPONSE,e,k)}if(T&&"get"!==n&&"head"!==n){const e=await h(s);if("number"==typeof e&&isFinite(e)&&(R=e,e>I))throw D()}const u=T&&(Z.isReadableStream(s)||Z.isStream(s)),p=(e,t,n)=>wt(e,65536,(e=>{if(T&&e>I)throw M=D();t&&t(e)}),n);if(f&&"get"!==n&&"head"!==n&&(y||u)){if(R=null==R?await(async(e,t)=>{const n=Z.toFiniteNumber(e.getContentLength());return null==n?h(t):n})(w,s):R,0!==R||u){let e,n=new r(t,{method:"POST",body:s,duplex:"half"});if(Z.isFormData(s)&&(e=n.headers.get("content-type"))&&w.setContentType(e),n.body){const[e,t]=y&&ot(R,at(rt(y)))||[];s=p(n.body,e,t)}}}else if(u&&!c&&d&&"get"!==n&&"head"!==n)s=p(s);else if(u&&c&&!f&&"get"!==n&&"head"!==n)throw new he("Stream request bodies are not supported by the current fetch implementation",he.ERR_NOT_SUPPORT,e,k);Z.isString(E)||(E=E?"include":"omit");const x=c&&"credentials"in r.prototype;if(Z.isFormData(s)){const e=w.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&w.delete("content-type")}w.set("User-Agent","axios/1.20.0",!1);const j=null==_?_:Object.assign(Object.create(null),_);j&&(delete j.body,delete j.headers,delete j.method,delete j.signal,delete j.duplex,delete j.credentials);const F=Object.assign(Object.create(null),j,{signal:N,method:n.toUpperCase(),headers:ae(w.normalize()),body:s,duplex:"half",credentials:x?E:void 0});c&&(Z.forEach(Nt,((e,t)=>{void 0===F[t]&&(F[t]=e)})),void 0===F.signal&&(F.signal=null),void 0===F.body&&(F.body=null)),0===S&&(F.redirect="manual",j&&(j.redirect="manual")),k=c&&new r(t,F);let U=await(c?A(k,j):A(t,F));const H=ue.from(U.headers);if(P){const t=Z.toFiniteNumber(H.getContentLength());if(null!=t&&t>O)throw new he("maxContentLength size of "+O+" exceeded",he.ERR_BAD_RESPONSE,e,k)}const V=m&&("stream"===v||"response"===v);if(m&&U.body&&(b||P||V&&C)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=U[e]}));const n=Z.toFiniteNumber(H.getContentLength()),[a,o]=b&&ot(n,at(rt(b),!0))||[];let r=0;const s=t=>{if(P&&(r=t,r>O))throw new he("maxContentLength size of "+O+" exceeded",he.ERR_BAD_RESPONSE,e,k);a&&a(t)};U=new i(wt(U.body,65536,s,(()=>{o&&o(),C&&C()})),t)}v=v||"text";let G=await g[Z.findKey(g,v)||"text"](U,e);if(P&&!m&&!V){let t;if(null!=G&&("number"==typeof G.byteLength?t=G.byteLength:"number"==typeof G.size?t=G.size:"string"==typeof G&&(t="function"==typeof a?(new a).encode(G).byteLength:G.length)),"number"==typeof t&&t>O)throw new he("maxContentLength size of "+O+" exceeded",he.ERR_BAD_RESPONSE,e,k)}return!V&&C&&C(),await new Promise(((t,n)=>{$e(t,n,{data:G,headers:ue.from(U.headers),status:U.status,statusText:U.statusText,config:e,request:k})}))}catch(t){if(C&&C(),N&&N.aborted&&N.reason instanceof he){const n=N.reason;throw n.config=e,k&&(n.request=k),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(M)throw k&&!M.request&&(M.request=k),M;if(t instanceof he)throw k&&!t.request&&(t.request=k),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new he("Network Error",he.ERR_NETWORK,e,k,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw he.from(t,t&&t.code,e,k,t&&t.response)}var L,B}},Dt=new Map,Lt=e=>{let t=e&&e.env||{};const{fetch:n,Request:a,Response:o}=t,r=[a,o,n];let i,s,c=r.length,l=Dt;for(;c--;)i=r[c],s=l.get(i),void 0===s&&l.set(i,s=c?new Map:Mt(t)),l=s;return s},Bt=(Lt(),{http:be,xhr:ht,fetch:{get:Lt}});Z.forEach(Bt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const xt=e=>`- ${e}`,jt=e=>Z.isFunction(e)||null===e||!1===e;const Ft={getAdapter:function(e,t){e=Z.isArray(e)?e:[e];const{length:n}=e;let a,o;const r={};for(let i=0;i<n;i++){let n;if(a=e[i],o=a,!jt(a)&&(o=Bt[(n=String(a)).toLowerCase()],void 0===o))throw new he(`Unknown adapter '${n}'`);if(o&&(Z.isFunction(o)||(o=o.get(t))))break;r[n||"#"+i]=o}if(!o){const e=Object.entries(r).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=n?e.length>1?"since :\n"+e.map(xt).join("\n"):" "+xt(e[0]):"as no adapter specified";throw new he("There is no suitable adapter to dispatch the request "+t,he.ERR_NOT_SUPPORT)}return o},adapters:Bt};function Ut(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xe(null,e)}function Ht(e){const t=Z.toSafeFlatObject(e);Ut(t),t.headers=ue.from(Z.getSafeProp(t,"headers")),t.data=Ye.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return Ft.getAdapter(t.adapter||ze.adapter,t)(t).then((function(e){Ut(t),t.response=e;try{e.data=Ye.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=ue.from(e.headers),e}),(function(e){if(!qe(e)&&(Ut(t),e&&e.response)){t.response=e.response;try{e.response.data=Ye.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=ue.from(e.response.headers)}return Promise.reject(e)}))}const Vt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Vt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Gt={};Vt.transitional=function(e,t,n){function a(e,t){return"[Axios v1.20.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,r)=>{if(!1===e)throw new he(a(o," has been removed"+(t?" in "+t:"")),he.ERR_DEPRECATED);return t&&!Gt[o]&&(Gt[o]=!0,console.warn(a(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,r)}},Vt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const Wt={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new he("options must be an object",he.ERR_BAD_OPTION_VALUE);const a=Object.keys(e);let o=a.length;for(;o-- >0;){const r=a[o],i=Object.prototype.hasOwnProperty.call(t,r)?t[r]:void 0;if(i){const t=e[r],n=void 0===t||i(t,r,e);if(!0!==n)throw new he("option "+r+" must be "+n,he.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new he("Unknown option "+r,he.ERR_BAD_OPTION)}},validators:Vt},Jt=Wt.validators;class Kt{constructor(e){this.defaults=e||{},this.interceptors={request:new Me,response:new Me}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let a="";if("string"==typeof n){const e=n.indexOf("\n");a=-1===e?"":n.slice(e+1)}if(e.stack){if(a){const t=a.indexOf("\n"),n=-1===t?-1:a.indexOf("\n",t+1),o=-1===n?"":a.slice(n+1);String(e.stack).endsWith(o)||(e.stack+="\n"+a)}}else e.stack=a}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ft(this.defaults,t);const{transitional:n,paramsSerializer:a,headers:o}=t;void 0!==n&&Wt.assertOptions(n,{silentJSONParsing:Jt.transitional(Jt.boolean),forcedJSONParsing:Jt.transitional(Jt.boolean),clarifyTimeoutError:Jt.transitional(Jt.boolean),legacyInterceptorReqResOrdering:Jt.transitional(Jt.boolean),advertiseZstdAcceptEncoding:Jt.transitional(Jt.boolean),validateStatusUndefinedResolves:Jt.transitional(Jt.boolean)},!1),null!=a&&(Z.isFunction(a)?t.paramsSerializer={serialize:a}:Wt.assertOptions(a,{encode:Jt.function,serialize:Jt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Wt.assertOptions(t,{baseUrl:Jt.spelling("baseURL"),withXsrfToken:Jt.spelling("withXSRFToken")},!0),t.method=(Z.getSafeProp(t,"method")||Z.getSafeProp(this.defaults,"method")||"get").toLowerCase();let r=o&&Z.merge(o.common,o[t.method]);o&&Z.forEach(We.concat("common"),(e=>{delete o[e]})),t.headers=ue.concat(r,o);const i=[];let s=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;s=s&&e.synchronous;const n=t.transitional||De;n&&n.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let d,u=0;if(!s){const e=[Ht.bind(this),void 0];for(e.unshift(...i),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=i.length;let p=t;for(;u<d;){const e=i[u++],t=i[u++];try{p=e?e(p):p}catch(e){if(!t){l=Promise.reject(e);break}try{const n=t.call(this,e);Z.isThenable(n)&&(l=Promise.resolve(n).then((()=>Ht.call(this,p))))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=Ht.call(this,p)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return Ae(ut((e=ft(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}Z.forEach(["delete","get","head","options"],(function(e){Kt.prototype[e]=function(t,n){return this.request(ft(n||{},{method:e,url:t,data:n&&Z.hasOwnProp(n,"data")?n.data:void 0}))}})),Z.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,a,o){return this.request(ft(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:a}))}}Kt.prototype[e]=t(),"query"!==e&&(Kt.prototype[e+"Form"]=t(!0))}));const zt=Kt;class Yt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const a=new Promise((e=>{n.subscribe(e),t=e})).then(e);return a.cancel=function(){n.unsubscribe(t)},a},e((function(e,a,o){n.reason||(n.reason=new Xe(e,a,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Yt((function(t){e=t})),cancel:e}}}const qt=Yt;const Xt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Xt).forEach((([e,t])=>{void 0===Xt[t]&&(Xt[t]=e)}));const $t=Xt;const Zt=function e(n){const a=new zt(n),o=t(zt.prototype.request,a);return Z.extend(o,zt.prototype,a,{allOwnKeys:!0}),Z.extend(o,a,null,{allOwnKeys:!0}),o.create=function(t){return e(ft(n,t))},o}(ze);Zt.Axios=zt,Zt.CanceledError=Xe,Zt.CancelToken=qt,Zt.isCancel=qe,Zt.VERSION=At,Zt.toFormData=_e,Zt.AxiosError=he,Zt.Cancel=Zt.CanceledError,Zt.all=function(e){return Promise.all(e)},Zt.spread=function(e){return function(t){return e.apply(null,t)}},Zt.isAxiosError=function(e){return Z.isObject(e)&&!0===e.isAxiosError},Zt.mergeConfig=ft,Zt.AxiosHeaders=ue,Zt.formToJSON=e=>Ge(Z.isHTMLForm(e)?new FormData(e):e),Zt.getAdapter=Ft.getAdapter,Zt.HttpStatusCode=$t,Zt.default=Zt;const Qt=Zt,en={PAGE_EVENT:"PAGE_EVENT",SPECIAL_PAGE_EVENT:"SPECIAL_PAGE_EVENT",DOM_READY:"DOM_READY",VIDEO_PLAYER_INSERT:"VIDEO_PLAYER_INSERT",VIDEO_PLAYER_REMOVE:"VIDEO_PLAYER_REMOVE",AUDIO_PLAYER_INSERT:"AUDIO_PLAYER_INSERT",CAMERA_NOTIFY:"CAMERA_NOTIFY",INSERT_HTML_WEBVIEW:"insertHTMLWebView",UPDATE_HTML_WEBVIEW:"updateHTMLWebView",INSERT_VIDEO_PLAYER:"insertVideoPlayer",UPDATE_VIDEO_PLAYER:"updateVideoPlayer",REMOVE_VIDEO_PLAYER:"removeVideoPlayer",INSERT_CAMERA:"insertCamera",UPDATE_CAMERA:"updateCamera",REMOVE_CAMERA:"removeCamera",INSERT_COVER_VIEW:"insertCoverView",REMOVE_COVER_VIEW:"removeCoverView",UPDATE_COVER_VIEW:"updateCoverView",INSERT_COVER_IMAGE:"insertCoverImage",REMOVE_COVER_IMAGE:"removeCoverImage",UPDATE_COVER_IMAGE:"updateCoverImage",DOM_CONTENT_LOADED:"domContentLoaded",SHOW_INPUT:"showInput",LINE_CHANGE:"lineChange",PAGE_DATA_CHANGE:"PAGE_DATA_CHANGE",VIEW_LOGIC_SYNC:"VIEW_LOGIC_SYNC",VIEW_LOGIC_SYNC_BATCH:"VIEW_LOGIC_SYNC_BATCH",AUDIO_ACTION_CHANGED:"AUDIO_ACTION_CHANGED",VIDEO_ID_BINGING:"VIDEO_ID_BINGING",LOCALE_CHANGE:"LOCALE_CHANGE",ON_ERROR:"onError",NAVIGATE_TO:"navigateTo",NAVIGATE_BACK:"navigateBack",NAVIGATE_TO_MINI_PROGRAM:"navigateToMiniProgram",REDIRECT_TO:"redirectTo",RELAUNCH:"reLaunch",SWITCHTAB:"switchTab",EXIT_MINI_PROGRAM:"exitMiniProgram",SHOW_MODAL:"showModal",SHOW_TOAST:"showToast",SHOW_LOADING:"showLoading",HIDE_LOADING:"hideLoading",REQUEST:"request",NETWORK_ABORT:"networkAbort",DOWNLOAD_FILE:"downloadFile",ON_DOWNLOAD_PROGRESS_UPDATE:"ON_DOWNLOAD_PROGRESS_UPDATE",UPLOAD_FILE:"uploadFile",SCAN_CODE:"scanCode",VIBRATE_SHORT:"vibrateShort",VIBRATE_LONG:"vibrateLong",CHOOSE_CONTACT:"chooseContact",GET_NETWORK_TYPE:"getNetworkType",CHOOSE_VIDEO:"chooseVideo",CHOOSE_IMAGE:"chooseImage",PREVIEW_IMAGE:"previewImage",COMPRESS_IMAGE:"compressImage",GET_IMAGE_INFO:"getImageInfo",SAVE_IMAGE_TOPHOTOS_ALBUM:"saveImageToPhotosAlbum",LOAD_FONT_FACE:"loadFontFace",PLAY_VOICE:"playVoice",STOP_VOICE:"stopVoice",GETSYSTEMINFO:"getSystemInfo",GETSYSTEMINFOSYNC:"getSystemInfoSync",GET_LAUNCH_OPTIONS_SYNC:"getLaunchOptionsSync",GET_LOCATION:"getLocation",START_PULL_DOWN_REFRESH:"startPullDownRefresh",STOP_PULL_DOWN_REFRESH:"stopPullDownRefresh",APPLYUPDATE:"applyUpdate",CANIUSE:"canIUse",CAMERA_TAKEPHOTO:"cameraTakePhoto",CAMERA_STARTRECORD:"cameraStartRecord",CAMERA_STOPRECORD:"cameraStopRecord",CAMERA_SETZOOM:"cameraSetZoom",SET_STORAGE:"setStorage",GET_STORAGE:"getStorage",GET_STORAGE_INFO:"getStorageInfo",REMOVE_STORAGE:"removeStorage",CLEAR_STORAGE:"clearStorage",SET_NAVIGATION_BAR_TITLE:"setNavigationBarTitle",SET_NAVIGATION_BAR_COLOR:"setNavigationBarColor",SET_BACKGROUND_TEXT_STYLE:"setBackgroundTextStyle",SET_BACKGROUND_COLOR:"setBackgroundColor",SHOW_ACTION_SHEET:"showActionSheet",SHOW_TAB_BAR:"showTabBar",HIDE_TAB_BAR:"hideTabBar",SHOW_TAB_BAR_RED_DOT:"showTabBarRedDot",HIDE_TAB_BAR_RED_DOT:"hideTabBarRedDot",SET_TAB_BAR_STYLE:"setTabBarStyle",SET_TAB_BAR_ITEM:"setTabBarItem",SET_TAB_BAR_BADGE:"setTabBarBadge",REMOVE_TAB_BAR_BADGE:"removeTabBarBadge",SAVE_FILE:"saveFile",REMOVE_SAVED_FILE:"removeSavedFile",OPEN_DOCUMENT:"openDocument",GET_SAVED_FILE_LIST:"getSavedFileList",GET_SAVED_FILE_INFO:"getSavedFileInfo",GET_FILE_INFO:"getFileInfo",WRITE_FILE:"writeFile",READ_FILE:"readFile",READ_DIR:"readdir",COPY_FILE:"copyFile",MOVE_FILE:"moveFile",UNLINK:"unlink",EXISTS:"exists",MKDIR:"mkdir",GET_BATTERY_INFO:"getBatteryInfo",SET_SCREEN_BRIGHTNESS:"setScreenBrightness",SET_KEEP_SCREEN_ON:"setKeepScreenOn",GET_SCREEN_BRIGHTNESS:"getScreenBrightness",MAKE_PHONE_CALL:"makePhoneCall",START_GYROSCOPE:"startGyroscope",STOP_GYROSCOPE:"stopGyroscope",GET_MENU_BUTTON_BOUNDING_CLIENT_RECT:"getMenuButtonBoundingClientRect",SET_CLIPBOARD_DATA:"setClipboardData",GET_CLIPBOARD_DATA:"getClipboardData",GET_PERMISSION_SETTING:"getSetting",OPEN_PERMISSION_SETTING:"openSetting",PERMISSION_AUTHORIZE:"authorize",DELETE_PERMISSION_AUTHORIZE:"deauthorize",CANCLE_PERMISSION_AUTHORIZE:"cancelAuthorize",SERVICE_READY:"serviceReady",MACLE_PERFORMANCE_LOG:"maclePerformanceLog",MACLE_SYSTEM_LOG:"MACLE_SYSTEM_LOG",MACLE_CUSTOM_LOG:"macleCustomLog",MACLE_ERROR_LOG:"macleErrorLog",SPECIAL_PAGE_DATA_CHANGE:"specialPageDataChange",VIDEO_ACTION_CHANGED:"videoActionChanged",NETWORK_STATUS_CHANGE:"networkStatusChange",MEMORY_WARNING:"memoryWarning",ON_APP_ROUTE:"ON_APP_ROUTE",ON_APP_SHOW:"ON_APP_SHOW",ON_APP_HIDE:"ON_APP_HIDE",ON_PULL_DOWN_REFRESH:"ON_PULL_DOWN_REFRESH",ON_CHECK_FOR_UPDATE:"ON_CHECK_FOR_UPDATE",ON_UPDATE_READY:"ON_UPDATE_READY",ON_UPDATE_FAILED:"ON_UPDATE_FAILED",ON_NETWORK_STATUS_CHANGE:"ON_NETWORK_STATUS_CHANGE",ON_GYROSCOPE_CHANGE:"ON_GYROSCOPE_CHANGE",ON_MEMORY_WARNING:"ON_MEMORY_WARNING",ON_SOCKET_OPEN:"ON_SOCKET_OPEN",ON_SOCKET_CLOSE:"ON_SOCKET_CLOSE",ON_SOCKET_ERROR:"ON_SOCKET_ERROR",ON_SOCKET_MESSAGE:"ON_SOCKET_MESSAGE",ON_RECORD_START:"ON_RECORD_START",ON_RECORD_STOP:"ON_RECORD_STOP",ON_RECORD_PAUSE:"ON_RECORD_PAUSE",ON_RECORD_RESUME:"ON_RECORD_RESUME",ON_RECORD_ERROR:"ON_RECORD_ERROR",ON_BT_DEVICE_FOUND:"ON_BT_DEVICE_FOUND",WEBVIEW_ON_JS_SDK_MESSAGE:"WEBVIEW_ON_JS_SDK_MESSAGE",WEBVIEW_POST_MESSAGE:"webviewPostMessage",JS_SDK_POST_MESSAGE:"h5PostMessage",JS_SDK_ON_WEBVIEW_MESSAGE:"JS_SDK_ON_WEBVIEW_MESSAGE",ON_INPUT_CHANGE:"ON_INPUT_CHANGE",ON_INPUT_HIDE:"ON_INPUT_HIDE",ON_VIDEO_STOP:"ON_VIDEO_STOP",ON_VIDEO_ACTION_CHANGED:"ON_VIDEO_ACTION_CHANGED",ON_CAMERA_CHANGED:"ON_CAMERA_CHANGED",ON_CAMERA_INIT:"ON_CAMERA_INIT",ON_CAMERA_RECORD_FINISH:"ON_CAMERA_RECORD_FINISH",ON_MAP_TAP:"ON_MAP_TAP",ON_MAP_MARKER_TAP:"ON_MAP_MARKER_TAP",REPORT_SUBMIT_FORM:"REPORT_SUBMIT_FORM",NAVIGATE_TO_FINISHED:"NAVIGATE_TO_FINISHED",NEW_IFRAME_LOADED:"NEW_IFRAME_LOADED",SYNC_EVENT_NAME:{MA_EVENT:11,REQUEST_SAVE:12,COMPONENT_DEF:21,SAVE_STATE:22,RESTORE_STATE:23,LAYOUT_READY:31,SET_DATA_CALLBACK:32,FLOW_SET_DATA:33,FLUSH_BLOCKED:43,FLOW_GROUP:41,FLOW_GROUP_END:42,FLOW_DEPTH:2,FLOW_INITIAL_CREATION:3,FLOW_UPDATE:6,FLOW_DATA_OBSERVER:8,FLOW_APPLY_PROPERTY:4,FLOW_MINIPULATE_CHILD:7,FLOW_CREATE_NODE:5,FLOW_REPEAT:9,REQUEST_TAB:51,COMPONENT_DEF_TAB:52,FLOW_CREATE_TAB:53,DESTROY_TAB:54,REQUEST_BROADCAST_VIEW_ID:61,RESPONSE_BROADCAST_VIEW_ID:62,BANNING_MAP:90,CALL_METHOD_FROM_MAS:50},PATCH_TYPE:{NONE:0,TEXT:1,VNODE:2,PROPS:3,REORDER:4,INSERT:5,REMOVE:6}};window.Enums=en;const tn=en;var nn=n(278);async function an(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500;try{const o=await Qt({method:"GET",url:e,params:{data:{inputParams:JSON.stringify(t)}}}),r=parseInt(o.data.statusCode);100===r?(n(o),await new Promise((e=>setTimeout(e,a))),await an(e,t,n)):200===r&&n(o)}catch(e){}}function on(e){e.length&&(e[0].remove(),on(e))}const rn={request:function(e){const t=e.data,n=JSON.parse(t.inputParams).timeout||6e4;Qt.post("/requestData",{data:t},{timeout:n}).then((e=>{const n=e.data;if(t.callbackId){const e=Pn(t.type),a="legacy"===t.type?n:{data:JSON.stringify(n)};e(t.callbackId,a,t.range)}})).catch((e=>{const n=e.response?e.response.data:{resMsg:e.message};if(t.callbackId){Tn(t.type)(t.callbackId,{errMsg:"request: fail",responseBody:n},t.range)}}))},downloadFile:function(e){var t;const n=e.data,a=JSON.parse(n.inputParams);a.taskId=null!==(t=a.taskId)&&void 0!==t?t:Number(new Date);const o=a.timeout||6e4;n.inputParams=JSON.stringify(a);try{Qt.post("/download",{data:n},{timeout:o}).then((t=>{const a=t.data;Pn(e.data.type)(n.callbackId,a,1)})).catch((t=>{var a;const o=(null===(a=t.response)||void 0===a?void 0:a.data.errMsg)||"downloadFile: fail, ".concat(t.message);Tn(e.data.type)(n.callbackId,{errMsg:o},1)}));const t=a.taskId;an("/download/progress",{taskId:t},(e=>{const n=e.data.result,a=n.total,o=n.loaded,r=n.progress;!function(e,t,n,a){if(void 0===a)return;const o={taskId:e,totalBytesExpectedToWrite:t,totalBytesWritten:n,progress:a};gn("service/service",{event:Enums.ON_DOWNLOAD_PROGRESS_UPDATE,isNative:!0,paramsString:JSON.stringify(o)})}(t,a,o,r)}))}catch(e){In(n.callbackId,{errMsg:"downloadFile:fail"})}},networkAbort:function(e){const t=e.data;try{Qt.post("/network/abort",{data:t})}catch(e){}},searchApp:function(e,t){Qt.post("/searchApp",{data:e,url:t}).then((e=>{const t=e.data,n=ln("appList");on(n.children),t.app_infos.forEach((e=>{const t=document.createElement("div");t.innerHTML=e.app_name,t.info=e,t.setAttribute("class","item"),t.addEventListener("click",(e=>{!function(e){Qt.post("/downloadApp",{data:e}).then((e=>{window.location.reload()}))}(e.currentTarget.info)})),n.appendChild(t)}))}))},uploadFile:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.timeout||6e4;n.filePath=Dn(n.filePath);for(const e of null!==(o=n.files)&&void 0!==o?o:[]){var o;e.path=Dn(e.path)}Qt.post("/uploadFile",{data:n},{timeout:a}).then((n=>{const a=Pn(e.data.type),o=n.data,r=o.errMsg,i=o.failFiles,s=o.successFiles;a(t.callbackId,{errMsg:r,data:{failFiles:i,successFiles:s},statuscode:n.status},1)})).catch((n=>{var a;const o=Tn(e.data.type),r=(null===(a=n.response)||void 0===a?void 0:a.data.errMsg)||"uploadFile: fail, ".concat(n.message);o(t.callbackId,{errMsg:r},1)}))}};var sn;function cn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ln(e){return document.getElementById(e)}function dn(e){return ln(e)&&ln(e).contentWindow}function un(e,t,n){fn("h5Entry",{callbackId:e,invokeStatusCode:200,outputParams:t},n)}function pn(e,t,n){fn("h5Entry",{callbackId:e,invokeStatusCode:-1,outputParams:t},n)}function fn(e,t,n){const a=dn(e);if(a){try{a.JSBridge.onSuccess(t.callbackId,{code:t.invokeStatusCode,data:t.outputParams},n)}catch(e){}try{a.viewLayer.onInvokeFinished(t.callbackId,200===t.invokeStatusCode?0:t.invokeStatusCode,t.outputParams)}catch(e){}}}function mn(e,t,n,a){"legacy"===e?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=dn("h5Entry");if(a)try{a.logicLayer.onNativeNotify(e,t,n)}catch(e){}}(t,n,a):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};gn("service/service",{event:e,isNative:!0,paramsString:JSON.stringify(n)})}(t,n,a)}function gn(e,t){if("string"!=typeof e)"object"==typeof e&&e.forEach((e=>{const n=dn(e);n&&n.postMessage(t,window.location.href)}));else{const n=dn(e);n&&n.postMessage(t,window.location.href)}}function hn(e){return"service/service"===e}function bn(e){let t;return __maConfig__.tabBar&&__maConfig__.tabBar.list.forEach((n=>{n.pagePath.replace(/\.htm[^\.]*$/,"")===e&&(t=!0)})),t}function yn(e){let t;return __maConfig__.pages&&__maConfig__.pages.forEach((n=>{n===e&&(t=!0)})),t}function vn(e){var t,n;return"custom"===((null===(t=__maConfig__.page["".concat(e,".html")])||void 0===t||null===(t=t.window)||void 0===t?void 0:t.navigationStyle)||(null===(n=__maConfig__.global)||void 0===n||null===(n=n.window)||void 0===n?void 0:n.navigationStyle))}function wn(e){e&&(e.style.display="none")}function En(e){e&&(e.style.display="block")}function _n(e,t){const n=document.createElement("iframe"),a=e||"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=window.crypto.getRandomValues(new Uint8Array(1))/256*16|0;return("x"===e?t:3&t|8).toString(16)}));return n.setAttribute("id",a),n.setAttribute("path",e),hn(e)&&wn(n),hn(e)?n.setAttribute("src","".concat(e,".html")):t?n.setAttribute("src","../app/".concat(t)):n.setAttribute("src","../app/".concat(e,".html")),n}function On(e,t){const n=ln("body"),a=_n(e,t);return n.appendChild(a),a}function In(e,t){gn("service/service",{callbackId:e,invokeStatusCode:1,outputParams:t})}function Sn(e,t){gn("service/service",{callbackId:e,invokeStatusCode:0,outputParams:t})}function Pn(e){return"legacy"===e?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return un(e,t,n)}:Sn}function Tn(e){return"legacy"===e?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return pn(e,t,n)}:In}function An(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const a={event:e,isNative:n,paramsString:JSON.stringify(t)};gn("service/service",a)}function Nn(e,t,n,a){let o=t.url,r=t.method,i=t.headers,s=t.data,c=t.mockType;const l=JSON.parse(i||"{}"),d=JSON.parse(s||"{}"),u={data:{}};u.data.inputParams={url:o,timeout:5e3,header:l,data:d,method:r},u.data.callbackId=e,u.data.mockType=c,"legacy"===a&&(u.data.type="legacy",u.data.range=n),rn.request(u)}function kn(e,t,n){const a=e.callbackId;gn(t.webviewIdList,{callbackId:a,invokeStatusCode:0,outputParams:{errMsg:n}})}function Cn(e,t,n){const a=e.callbackId;gn(t.webviewIdList,{callbackId:a,invokeStatusCode:1,outputParams:{errMsg:n}})}function Rn(){const e=window.navigatorPages;return e&&e.length>0?e[e.length-1]:{}}function Mn(){const e=document.getElementById("h5Entry").contentWindow.location,t=decodeURI(e.pathname).split("/").filter((e=>e));t.pop();const n=t.indexOf("app");return{path:t.slice(n+1).join("/")}}function Dn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n="../app",a=t?Rn().path:Mn().path;if(e.startsWith("/"))return n+e;if(e.startsWith("./")){const t=a.lastIndexOf("/");return"".concat(n,"/").concat(a.substr(0,t),"/").concat(e.substr(2))}{const t=a.length>0?a.split("/"):[],o=e.split("/"),r=[];let i=0,s=0;for(;i<o.length&&".."===o[i];i++);if(i>=t.length-1){for(;i<o.length;)r.push(o[i]),i++;return"".concat(n,"/").concat(r.join("/"))}for(;s<t.length-1-i;)r.push(t[s++]);for(;i<o.length;)r.push(o[i++]);return"".concat(n,"/").concat(r.join("/"))}}function Ln(){const e=vn(Rn().path),t=window.__simulatorConfig__.api.getSystemInfo.statusBarHeight,n=window.__simulatorConfig__.statusBar;let a;return a=e?0:44+(n?t:0),a}class Bn{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";this.errMsg="".concat(e,": ").concat(t).concat(n?", ":"").concat(n)}}class xn extends Bn{constructor(e,t,n){super(e,t,arguments.length>3&&void 0!==arguments[3]?arguments[3]:""),this.errno=n}}class jn{static Errno(e,t,n){return Number("".concat(e).concat(t).concat(n))}}class Fn{constructor(e){this.status=e}toString(){return this.status}}cn(Fn,"OK",new(sn=Fn)("ok")),cn(Fn,"FAIL",new sn("fail"));const Un=console,Hn={info:Un.info,log:Un.log,warn:Un.warn,error:Un.error,group:Un.group,groupEnd:Un.groupEnd};function Vn(){var e;return!(null===(e=__maConfig__.global)||void 0===e||!e.window)&&(Wn(),Gn(),Kn(__maConfig__.global),!0)}function Gn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"white";ln("title").innerText=e,t&&(ln("head-tabbar").style["background-color"]=t,ln("head-tabbar").style.overflow="hidden",ln("status").style["background-color"]=t,n&&(ln("head-tabbar").style.color=n,ln("head-tabbar-i").style["background-color"]=n,ln("status").style.color=n,ln("signal").style["background-color"]=n,ln("battery-a").style["border-color"]=n,ln("battery-b").style["background-color"]=n,ln("battery-c").style["background-color"]=n))}function Wn(e){const t=ln("body"),n=vn(e),a=ln("head-tabbar");n?(a.style.display="none",ln("status").style["background-color"]="transparent"):a.style.display="flex";const o=window.__simulatorConfig__.statusBar,r=n?"custom-header":"";bn(e)?t.setAttribute("class","tabbar-frame ".concat(r)):t.setAttribute("class","notabbar-frame ".concat(r)),r||o?t.classList.remove("nostatus"):t.classList.add("nostatus");const i=ln("menuButton");o||i.classList.add("nostatus")}function Jn(e){Kn(__maConfig__.page["".concat(e,".html")])}function Kn(e){var t;if("custom"!==(null==e||null===(t=e.window)||void 0===t?void 0:t.navigationStyle)){var n;const t=Object.assign({},null===(n=__maConfig__.global)||void 0===n?void 0:n.window,null==e?void 0:e.window);Gn(t.navigationBarTitleText,t.navigationBarBackgroundColor,t.navigationBarTextStyle)}}function zn(e){const t=document.getElementsByClassName("tabbar-root")[0],n=ln("goback");bn(e)?(n.style.visibility="hidden",En(t)):(window.navigatorPages.length>1?n.style.visibility="visible":n.style.visibility="hidden",wn(t));(__maConfig__.tabBar?__maConfig__.tabBar.list:[]).forEach((t=>{const n=t.pagePath.replace(/\.htm[^\.]*$/,""),a=ln("tabbar-".concat(n)),o=a.getElementsByTagName("img")[0],r=a.getElementsByTagName("p")[0];n===e?(o.setAttribute("src","data:image/png;base64,".concat(t.selectedIconData)),r.style.color=__maConfig__.tabBar.selectedColor):(o.setAttribute("src","data:image/png;base64,".concat(t.iconData)),r.style.color="")})),Wn(e)}const Yn={getSystemInfo:function(e){const t=e.data,n=Rn().path||__maConfig__.entryPagePath.split(".html")[0];if(t.callbackId){const e=window.__simulatorConfig__.api.getSystemInfo.statusBarHeight,a=vn(n),o=bn(n),r=window.__simulatorConfig__.statusBar;let i;i=o?57:a?0:44+(r?e:0);const s=document.getElementById("macle-main");Sn(t.callbackId,{brand:window.__simulatorConfig__.api.getSystemInfo.brand,system:window.__simulatorConfig__.api.getSystemInfo.system,model:window.__simulatorConfig__.api.getSystemInfo.model,pixelRatio:window.__simulatorConfig__.api.getSystemInfo.pixelRatio,screenWidth:s.clientWidth,screenHeight:s.clientHeight,windowWidth:s.clientWidth,windowHeight:s.clientHeight-i,statusBarHeight:e,language:window.__simulatorConfig__.api.getSystemInfo.language})}},onAppShow:function(){ln("macle-app-hide").setAttribute("style","display: none"),gn("service/service",{event:tn.ON_APP_SHOW,webviewId:"",isNative:!0,paramsString:JSON.stringify({test:111})})},onAppHide:function(){ln("macle-app-hide").setAttribute("style","display: block"),gn("service/service",{event:tn.ON_APP_HIDE,webviewId:"",isNative:!0,paramsString:JSON.stringify({test:111})})},applyUpdate:function(e){const t=e.data;t.callbackId&&Sn(t.callbackId,{errMsg:"Apply new version and restart"}),localStorage.setItem("macle.upgraded",!0);const n=document.createElement("div");document.body.appendChild(n),n.innerHTML='<div class="macle-toast" id="toast">\n <i class="macle-toast-icon macle-icon-loading"></i>\n <p class="macle-toast-content">restarting</p>\n </div>',setTimeout((()=>{n.remove(),window.location.reload()}),3e3)},onCheckForUpdate:function(){if(!localStorage.getItem("macle.upgraded")){const e={hasUpdate:!0};gn("service/service",{event:tn.ON_CHECK_FOR_UPDATE,webviewId:"",isNative:!0,paramsString:JSON.stringify(e)})}},onUpdate:function(){if(!localStorage.getItem("macle.upgraded")){const e={};gn("service/service",{event:tn.ON_UPDATE_READY,webviewId:"",isNative:!0,paramsString:JSON.stringify(e)})}},close:function(e){("legacy"===e.data.type?document.getElementById("h5Entry"):document.getElementById("service/service")).remove();const t="close:ok";e.data.callbackId&&("legacy"===e.data.type?un(e.data.callbackId,{errMsg:t},1):Sn(e.data.callbackId,{errMsg:t}))},setCustomEvent:function(e){gn("service/service",{event:"custom_".concat(e),webviewId:"",isNative:!0,paramsString:JSON.stringify({test:111})})},webviewPostMessage:function(e){gn("service/service",{event:tn.JS_SDK_ON_WEBVIEW_MESSAGE,webviewId:"",isNative:!0,paramsString:JSON.stringify(e)})},h5PostMessage:function(e){gn("service/service",{event:tn.WEBVIEW_ON_JS_SDK_MESSAGE,webviewId:"",isNative:!0,paramsString:JSON.stringify(e.inputParams)})}};class qn{constructor(){this.onEventMap=new Map,this.onceEventMap=new Map,this.callbacksMap=new WeakMap}static getInstance(){return this.instance||(this.instance=new qn),this.instance}on(e,t){const n=function(){try{for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];t.apply(void 0,n)}catch(e){}};this.callbacksMap.has(t)?this.callbacksMap.get(t).set(e,n):this.callbacksMap.set(t,new Map([[e,n]])),this.onEventMap.has(e)?this.onEventMap.get(e).add(n):this.onEventMap.set(e,new Set([n]))}once(e,t){const n=function(){try{for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];t.apply(void 0,n)}catch(e){}};this.callbacksMap.has(t)?this.callbacksMap.get(t).set(e,n):this.callbacksMap.set(t,new Map([[e,n]])),this.onceEventMap.has(e)?this.onceEventMap.get(e).add(n):this.onceEventMap.set(e,new Set([n]))}off(e,t){const n=this.onEventMap.get(e);if(n)if(t){const a=this.callbacksMap.get(t),o=null==a?void 0:a.get(e);n.delete(o),null==a||a.delete(e)}else n.clear();const a=this.onceEventMap.get(e);if(a)if(t){const n=this.callbacksMap.get(t),o=null==n?void 0:n.get(e);a.delete(o),null==n||n.delete(e)}else a.clear()}emit(e,t){const n=this.onEventMap.get(e);if(n)for(const e of n)e.call(this,t);const a=this.onceEventMap.get(e);if(a)for(const e of a)e.call(this,t),a.delete(e)}}const Xn=qn,$n={LOCATION:"scope.location",CAMERA:"scope.camera",PHOTOS_ALBUMS:"scope.photosAlbums",CONTACTS:"scope.contacts",RECORD:"scope.record",JUMP_MINI_APP:"scope.jumpMiniApp",GOTO_BROWSER:"scope.gotoBrowser",BLUETOOTH:"scope.bluetooth",PAYMENT:"scope.payment",VIDEO:"scope.video",STORAGE:"scope.storage",AUTH_BASE:"scope.AUTH_BASE",AUTH_USER:"scope.AUTH_USER",SEND_MESSAGE:"scope.SEND_MESSAGE",USER_NICKNAME:"scope.USER_NAME",USER_LOGIN_ID:"scope.USER_LOGIN_ID",PLAINTEXT_USER_LOGIN_ID:"scope.PLAINTEXT_USER_LOGIN_ID",HASH_LOGIN_ID:"scope.HASH_LOGIN_ID",USER_AVATAR:"scope.USER_AVATAR",USER_GENDER:"scope.USER_GENDER",USER_BIRTHDAY:"scope.USER_BIRTHDAY",USER_NATIONALITY:"scope.USER_NATIONALITY",USER_CONTACTINFO:"scope.USER_CONTACTINFO",USER_ADDRESS:"scope.USER_ADDRESS",PLAINTEXT_MOBILE_PHONE:"scope.PLAINTEXT_MOBILE_PHONE"},Zn=new Map([[$n.LOCATION,"Your Location will be obtained."],[$n.CAMERA,"Your Camera will be accessed."],[$n.PHOTOS_ALBUMS,"Your Photos will be read/written."],[$n.CONTACTS,"Your Contacts will be accessed."],[$n.RECORD,"Your Microphone will be accessed."],[$n.JUMP_MINI_APP,"Open other mini-programs."],[$n.GOTO_BROWSER,"Open another application."],[$n.BLUETOOTH,"Your Bluetooth will be accessed."],[$n.PAYMENT,"Apply for payment authorization."],[$n.VIDEO,"Video recording will be conducted."],[$n.STORAGE,"Your files will be read/written."],[$n.AUTH_BASE,"Authorized to silently obtain user ID only."],[$n.AUTH_USER,"Authorized to obtain user ID and other user information."],[$n.SEND_MESSAGE,"Authorized to send notifications to the user via SMS, PUSH, or INBOX."],[$n.USER_NICKNAME,"Authorized to obtain the user nickname."],[$n.USER_LOGIN_ID,"Authorized to obtain the user's login ID."],[$n.PLAINTEXT_USER_LOGIN_ID,"Authorized to obtain the user's plaintext login ID."],[$n.HASH_LOGIN_ID,"Authorized to obtain the hash user login ID."],[$n.USER_AVATAR,"Authorized to obtain the user avatar."],[$n.USER_GENDER,"Authorized to obtain the user's gender."],[$n.USER_BIRTHDAY,"Authorized to obtain the user's birthday."],[$n.USER_NATIONALITY,"Authorized to obtain the user's nationality."],[$n.USER_CONTACTINFO,"Authorized to obtain the user's contact information."],[$n.USER_ADDRESS,"Authorized to obtain the user's address."],[$n.PLAINTEXT_MOBILE_PHONE,"Authorized to obtain the user's plaintext phone number."]]),Qn="00",ea="07",ta="00",na="01",aa="000",oa="001",ra="001",ia="002",sa=Xn.getInstance(),ca={errorCallback:(e,t)=>{gn("service/service",{callbackId:e,invokeStatusCode:1,outputParams:{errMsg:t}})},successCallback:(e,t)=>{gn("service/service",{callbackId:e,invokeStatusCode:0,outputParams:{errMsg:t}})},changeHeadAndSendRoute:(e,t,n)=>{window.ipcRenderer&&window.ipcRenderer.sendToHost("cur-page-res",e),ln("head-tabbar").style["background-color"]="rgb(0, 0, 0)",ln("head-tabbar").style.color="rgb(0, 0, 0)",ln("head-tabbar-i").style["background-color"]="rgb(0, 0, 0)",ln("status").style["background-color"]="rgb(0, 0, 0)",ln("status").style.color="rgb(0, 0, 0)",ln("signal").style["background-color"]="rgb(0, 0, 0)",ln("battery-a").style["border-color"]="rgb(0, 0, 0)",ln("battery-b").style["background-color"]="rgb(0, 0, 0)",ln("battery-c").style["background-color"]="rgb(0, 0, 0)",zn(e),Jn(e),function(){const e=__maConfig__.entryPagePath.split(".html")[0];if(bn(e));else{let t=!1;window.navigatorPages.forEach((n=>{n.path===e&&(t=!0)}))}}();const a={openType:n,query:{},path:e,pageStack:navigatorPages},o={event:tn.ON_APP_ROUTE,webviewId:t,isNative:!0,paramsString:JSON.stringify(a)};sa.emit(tn.ON_APP_ROUTE,a),gn("service/service",o)},getDataAndUrl(e){const t=e.data;return{data:t,url:JSON.parse(t.inputParams).url}}};function la(e,t,n){const a=On(e,t);a.addEventListener("load",(function e(){const t=new Event(tn.NEW_IFRAME_LOADED);a.dispatchEvent(t),a.removeEventListener("load",e)}));const o=a.getAttribute("id");if(window.navigatorPages.push({path:e,webviewId:o}),ca.changeHeadAndSendRoute(e,o,"navigateTo"),n.callbackId){const e="navigateTo:ok";ca.successCallback(n.callbackId,e)}}const da={switchTab:function(e){const t=ca.getDataAndUrl(e),n=t.data,a=t.url.split(".html")[0];if(yn(a)){if(bn(a))!function(e,t){window.ipcRenderer&&window.ipcRenderer.sendToHost("cur-page-res",e);const n=document.getElementsByTagName("iframe");let a;const o=[];for(let t=0;t<n.length;t++){const r=n[t],i=r.getAttribute("path");"service/service"===i||bn(i)?e===i?(a=r,wn(r)):wn(r):o.push(r)}for(let e=0;e<o.length;e++)o[e].remove();a?En(a):a=On(e);const r=a.getAttribute("id");if(window.navigatorPages=[{path:e,webviewId:r}],ca.changeHeadAndSendRoute(e,r,"switchTab"),t.callbackId){const e="switchTab:ok";ca.successCallback(t.callbackId,e)}}(a,n);else if(n.callbackId){const e="swicthTab:fail can not switch to no-tabbar page";ca.errorCallback(n.callbackId,e)}}else if(n.callbackId){const e="switchTab:fail page ".concat(a," is not found");ca.errorCallback(n.callbackId,e)}},navigateTo:function(e){const t=ca.getDataAndUrl(e),n=t.data,a=t.url,o=a.split(".html")[0];if(window.navigatorPages.length>10){if(n.callbackId){const e="navigateTo:fail webview count limit exceed";ca.errorCallback(n.callbackId,e)}}else if(bn(o)){if(n.callbackId){const e="navigateTo:fail can not navigateTo a tabbar page";ca.errorCallback(n.callbackId,e)}}else if(yn(o))!function(e,t,n){window.ipcRenderer&&window.ipcRenderer.sendToHost("cur-page-res",e);const a=document.getElementsByTagName("iframe");let o=!1;for(let t=0;t<a.length;t++){const n=a[t].getAttribute("path");n&&n===e?(En(a[t]),o=!0):wn(a[t])}o||(__maConfig__.isApp&&__maConfig__.subPackages&&__maConfig__.subPackages.length?Qt.post("/checkPath",{data:{path:e,curl:__maConfig__.curl,instanceId:__maConfig__.instance_id,subPackages:__maConfig__.subPackages}}).then((n=>{let a=n.resData;if(!0!==a.result){const e=ln("service/service").contentWindow.document,t="../../app/".concat(a.result.root,"app-service.js"),n=e.createElement("script");n.type="text/javascript",n.language="javascript",n.src=t,e.getElementsByTagName("body")[0].appendChild(n)}la(e,t,a)})):la(e,t,n))}(o,a,n);else if(n.callbackId){const e="navigateTo:fail page ".concat(o," is not found");ca.errorCallback(n.callbackId,e)}},navigateBack:function(e){const t=e.data,n=window.navigatorPages.length;window.navigatorPages[n-1];let a,o=JSON.parse(t.inputParams).delta;if(o=o||1,1===n)throw a=window.navigatorPages[0],new Error("navigateBack fail, cannot navigate back at first page");if(n-o-1>=0){a=window.navigatorPages[n-o-1];let e=1;for(;e<=o;){ln(window.navigatorPages[n-e].webviewId).remove(),e++}window.navigatorPages=window.navigatorPages.slice(0,n-o)}else a=window.navigatorPages[0],window.navigatorPages=window.navigatorPages.splice(n-1,n-2);const r=a.webviewId,i=ln(r);if(i&&En(i),ca.changeHeadAndSendRoute(a.path,r,"navigateBack"),t.callbackId){const e="navigateBack:ok";ca.successCallback(t.callbackId,e)}},redirectTo:function(e){const t=ca.getDataAndUrl(e),n=t.data,a=t.url,o=a.split(".html")[0];if(yn(o))if(bn(o)){if(n.callbackId){const e="redirectTo:fail can not redirectTo a tabbar page";ca.errorCallback(n.callbackId,e)}}else!function(e,t,n){window.ipcRenderer&&window.ipcRenderer.sendToHost("cur-page-res",e),ln(window.navigatorPages[window.navigatorPages.length-1].webviewId).remove();const a=On(e,t).getAttribute("id");if(window.navigatorPages.splice(window.navigatorPages.length-1,1),window.navigatorPages.push({path:e,webviewId:a}),ca.changeHeadAndSendRoute(e,a,"redirectTo"),n.callbackId){const e="redirectTo:ok";ca.successCallback(n.callbackId,e)}}(o,a,n);else if(n.callbackId){const e="redirectTo:fail page ".concat(o," is not found");ca.errorCallback(n.callbackId,e)}},reLaunch:function(e){const t=ca.getDataAndUrl(e),n=t.data,a=t.url,o=a.split(".html")[0];if(yn(o)){for(let e=0;e<window.navigatorPages.length;e++){ln(window.navigatorPages[e].webviewId).remove()}const e=On(o,a).getAttribute("id");if(window.navigatorPages=[],window.navigatorPages.push({path:o,webviewId:e}),ca.changeHeadAndSendRoute(o,e,"reLaunch"),n.callbackId){const e="reLaunch:ok";ca.successCallback(n.callbackId,e)}}else if(n.callbackId){const e="reLaunch:fail page ".concat(o," is not found");ca.errorCallback(n.callbackId,e)}},navigateToMiniProgram:function(e){let t=e.data,n=t.callbackId,a=t.type,o=t.inputParams;if(""===JSON.parse(o).appId){const e=new xn(tn.NAVIGATE_TO_MINI_PROGRAM,Fn.FAIL,jn.Errno(Qn,ta,ia),"the appId in param is empty.");return void Tn(a)(n,e)}Pn(a)(n,new Bn(tn.NAVIGATE_TO_MINI_PROGRAM,Fn.OK))},exitMiniProgram:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn(tn.EXIT_MINI_PROGRAM,Fn.OK))}},ua=[];function pa(){const e=ln("macle-dialog".concat(ua.length));ua.pop(),e&&e.remove(),ua.length||wn(ln("macle-dialog-container"))}function fa(e){const t=ln("macle-dialog-container");if(ua.push({confirm:e.confirmCallback,cancel:e.cancelCallback}),!0===e.editable){const n=function(e){let t="",n="";"showModal"===e.name&&(t="hidden"),"scanCode"===e.name&&(n="hidden");const a=document.createElement("div");return a.innerHTML='<div class="macle-dialog" id="macle-dialog'.concat(ua.length,'">\n <div class="macle-dialog__hd">\n <strong class="macle-dialog__title" >').concat(e.title,'</strong>\n </div>\n <div class="macle-dialog__bd" ').concat(n,'>\n <textarea class="macle-dialog__showModal" id="showModalName" >').concat(e.content,'</textarea>\n </div>\n <div class="macle-dialog__bd" ').concat(t,'>\n <p class="macle-dialog__div" align="left">返回值:<input class="macle-dialog__input" type="text" id="fname"></p>\n <p class="macle-dialog__div macle-dialog__margin" align="left">类型:\n <input type="radio" name="scanCodeType" value="barCode" checked><label>barCode</label>\n <input type="radio" name="scanCodeType" value="qrCode"><label>qrCode</label>\n </p>\n \n </div>\n <div class="macle-dialog__ft" >\n <a id="cancelDia" class="macle-dialog__btn macle-dialog__btn_default" \n style="color:').concat(e.cancelColor||"#000000",";\n display:").concat(!1===e.showCancel?"none":"block",'" \n >\n ').concat(e.cancelText?e.cancelText:"Cancel",'\n </a>\n <a id="confirmDia" class="macle-dialog__btn macle-dialog__btn_confirm" \n style="color:').concat(e.confirmColor||"#576B95",';" \n >\n ').concat(e.confirmText?e.confirmText:"Confirm","\n </a>\n </div>\n </div>"),a}(e);t.appendChild(n.childNodes[0]),En(t);window.document.getElementById("confirmDia").addEventListener("click",(()=>{confirmDia(e)}));window.document.getElementById("cancelDia").addEventListener("click",(()=>{cancelDia(e)}))}else{const n=document.createElement("div");n.innerHTML='<div class="macle-dialog" id="macle-dialog'.concat(ua.length,'">\n <div class="macle-dialog__hd">\n <strong class="macle-dialog__title">').concat(e.title,'</strong>\n </div>\n <div class="macle-dialog__bd">').concat(e.content,'</div>\n <div class="macle-dialog__ft">\n <a class="macle-dialog__btn macle-dialog__btn_default" \n style="color:').concat(e.cancelColor||"#000000",";\n display:").concat(!1===e.showCancel?"none":"block",'" \n onclick="cancelDialog()">\n ').concat(e.cancelText?e.cancelText:"Cancel",'\n </a>\n <a class="macle-dialog__btn macle-dialog__btn_confirm" \n style="color:').concat(e.confirmColor||"#576B95",';" \n onclick="confirmDialog()">\n ').concat(e.confirmText?e.confirmText:"Confirm","\n </a>\n </div>\n </div>"),t.appendChild(n.childNodes[0]),En(t)}}function ma(e){let t=e.scope,n=e.success,a=void 0===n?()=>{}:n,o=e.fail,r=void 0===o?()=>{}:o;return localStorage.getItem(t)?"true"!==localStorage.getItem(t)?r():a():fa({title:"User Authorization",content:'\n <div style="text-align: left">\n <span style="color: #1c1c1c; font-size: 14px; font-weight: bold;">The miniprogram request following information</span>\n <p style="font-size: 12px;">'.concat(Zn.get(t),"</p>\n </div>\n "),confirmText:"Allow",cancelText:"Reject",confirmCallback:()=>{a(),localStorage.setItem(t,!0)},cancelCallback:()=>{r(),localStorage.setItem(t,!1)}})}window.confirmDialog=function(){const e=ua[ua.length-1];if(e.confirm&&"function"==typeof e.confirm)try{e.confirm()}catch(e){throw new Error("dialog confirm callback error:".concat(e))}pa()},window.cancelDialog=function(){const e=ua[ua.length-1];if(e.cancel&&"function"==typeof e.cancel)try{e.cancel()}catch(e){throw new Error("dialog cancel callback error:".concat(e))}pa()},window.showModalConfirmDia=function(e){const t={errMsg:"showModal:ok",cancel:!1,confirm:!0,content:window.document.getElementById("showModalName").value};try{Sn(e.callbackId,t)}catch(e){throw new Error("dialog confirm callback error:".concat(e))}},window.scanCodeConfirmDia=function(e){const t=window.document.getElementById("fname").value,n=window.document.getElementsByName("scanCodeType");let a="";for(let e=0;e<n.length;e++)n[e].checked&&(a=n[e].value);const o={errMsg:"scanCode:ok",result:t,scanType:a};try{if(""===t){const t="scanCode:fail";"legacy"===e.type?pn(e.callbackId,t,1):In(e.callbackId,t)}else"legacy"===e.type?un(e.callbackId,o,1):Sn(e.callbackId,o)}catch(e){throw new Error("dialog confirm callback error:".concat(e))}},window.confirmDia=function(e){const t=ua[ua.length-1];if(t.confirm&&"function"==typeof t.confirm){if("showModal"===e.name)return showModalConfirmDia(e),void pa();"scanCode"===e.name&&(scanCodeConfirmDia(e),pa())}},window.cancelDia=function(e){const t=ua[ua.length-1];if(t.confirm&&"function"==typeof t.confirm){const n={errMsg:"scanCode:fail"};try{if("showModal"===e.name)return t.cancel(),void pa();"scanCode"===e.name&&("legacy"===e.type?pn(e.callbackId,n,1):In(e.callbackId,n),pa())}catch(e){throw new Error("dialog cancel callback error:".concat(e))}}};class ga extends Error{constructor(e){super(e,{cause:nn.VALIDATE_ERROR_CAUSE})}}class ha{constructor(e,t,n){this.target=e,this.callback=t,this.delay=n}start(){this.startTime=new Date;const e=Math.max(this.delay,0),t=this.callback.bind(this.target);this.timer=setTimeout(t,e)}pause(){this.delay-=new Date-this.startTime,this.startTime=new Date,this.clear()}resume(){this.start()}clear(){clearTimeout(this.timer)}}class ba{constructor(e){const t=e.interval,n=e.handler,a=void 0===n?()=>{}:n,o=e.maxLoopTimes;this.handler=a,this.interval=t,this.maxLoopTimes=o}loop(){const e=this.interval,t=this.handler,n=this.maxLoopTimes;let a=0;return new Promise(((o,r)=>{this.intervalId=setInterval((()=>{a++<n?t(o,r):(this.stop(),o())}),e)}))}stop(){clearInterval(this.intervalId),this.intervalId=null}}class ya{static format(e,t){let n=t;const a={"y+":e.getFullYear(),"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours()%12==0?12:e.getHours()%12,"H+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),S:e.getMilliseconds()};for(const e in a){const t=new RegExp("(".concat(e,")")).exec(n);t&&(n=/(y+)/.test(e)?n.replace(t[1],"".concat(a[e]).substring(4-t[1].length)):n.replace(t[1],1===t[1].length?"".concat(a[e]):"".concat(a[e]).padStart(t[1].length,"0")))}return n}}function va(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function wa(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ea={getLocation:function(e){const t=e.data,n=t.type,a=t.callbackId;a&&ma({scope:$n.LOCATION,success:()=>{const e=window.__simulatorConfig__.api.getLocation,t=Pn(n);Object.assign(e,{locationEndTime:ya.format(new Date,"yyyy-MM-dd HH:mm:ss"),locationOrigin:"location",errMsg:"getLocation: ok"}),t(a,e)},fail:()=>{const e=Tn(n),t="false"===localStorage.getItem($n.LOCATION),o=new xn("getLocation",Fn.FAIL,jn.Errno(ea,na,t?oa:aa),"auth deny.");e(a,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?va(Object(n),!0).forEach((function(t){wa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):va(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},o))}})}};function _a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Oa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_a(Object(n),!0).forEach((function(t){Ia(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ia(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Sa={getPullDownRefresh(){const e=Rn(),t="".concat(e.path,".html"),n=__maConfig__.page[t].window.enablePullDownRefresh;return __maConfig__.global.window.enablePullDownRefresh||n},getBase64Image(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;t.getContext("2d").drawImage(e,0,0,e.width,e.height);const n=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return t.toDataURL("image/".concat(n))},isTabBarPage(){const e="".concat(Rn().path,".html"),t=window.__maConfig__.tabBar.list,n=[];for(let e=0;e<t.length;e++)n.push(t[e].pagePath);return-1!==n.indexOf(e)},titleLength(e){let t=0;for(let n=0;n<e.length;n++){const a=e.charCodeAt(n);a>=1&&a<=126||a>=65376&&a<=65439?t++:t+=2}return t},subLength(e){let t=0,n=0;for(let a=0;a<e.length;a++){const o=e.charCodeAt(a);if(o>=1&&o<=126||o>=65376&&o<=65439){if(n++,n>=14)break}else if(n+=2,t++,n>=14)break}return t}};const Pa={showToast:function(e){const t=document.getElementById("macleToast");t&&t.remove();const n=e.data,a=JSON.parse(n.inputParams);let o=a.icon,r=a.title||a.message||"";const i=Sa.titleLength(r),s=a.duration||1500;"none"===o?o="":i>28&&(r=i===r.length?r.substring(0,28):r.substring(0,28-Sa.subLength(r)>14?28-Sa.subLength(r):14),r="".concat(r,"..."),o="error"===o?"macle-icon-warn":"loading"===o?"macle-icon-loading":"macle-icon-success");const c=a.image?"":"hidden",l=a.image||"none"===a.icon?"hidden":"";a.image&&(a.image=Dn(a.image));const d=document.createElement("div");d.innerHTML='\n <div id="macleToast">\n <div id="toastMask" class="macle-transparent-mask" style="display:'.concat(a.mask?"block":"none",'">\n </div>\n <div id="macleToastContent" class="macle-toast">\n <img src="').concat(a.image?a.image:"",'" alt="" class="macle-toast-icon" ').concat(c,'>\n <i class="macle-toast-icon ').concat(o,' " id="macleToastIcon" ').concat(l,'></i>\n <p class="macle-toast-content">').concat(r,"</p>\n </div>\n</div>\n "),document.body.appendChild(d),"legacy"===n.type?un(n.callbackId,{errMsg:"showToast:ok"},1):Sn(n.callbackId,{errMsg:"showToast:ok"}),setTimeout((()=>{d.remove()}),s)},hideToast:function(e){const t=e.data,n=document.getElementById("macleToast");n&&n.remove(),t.callbackId&&Sn(t.callbackId,{errMsg:"hideToast:ok"})},showModal:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.editable||!1;t.callbackId&&fa({title:n.title,content:n.content,cancelText:n.cancelText,confirmText:n.confirmText,cancelColor:n.cancelColor,confirmColor:n.confirmColor,showCancel:n.showCancel,editable:a,name:t.command,callbackId:t.callbackId,cancelCallback:()=>{Sn(t.callbackId,{errMsg:"showModal:ok",confirm:!1,cancel:!0})},confirmCallback:()=>{Sn(t.callbackId,{errMsg:"showModal:ok",confirm:!0,cancel:!1})}})},showLoading:function(e){const t=document.getElementById("macleToast");t&&t.remove();const n=e.data.inputParams?JSON.parse(e.data.inputParams):{};let a=n.title||"loading";const o=Sa.titleLength(a);o>28&&(a=o===a.length?a.substring(0,28):a.substring(0,14)),o>28&&(a="".concat(a,"..."));const r=document.createElement("div");r.innerHTML='\n <div id="macleToast">\n <div id="toastMask" class="macle-transparent-mask" style="display:'.concat(n.mask?"block":"none",'">\n </div>\n <div id="macleToastContent" class="macle-toast">\n <i class="macle-toast-icon macle-icon-loading "></i>\n <p class="macle-toast-content">').concat(a,"</p>\n </div>\n</div>\n "),document.body.appendChild(r),e.data.callbackId&&("legacy"===e.data.type?un(e.data.callbackId,{errMsg:"showLoading:ok"},1):Sn(e.data.callbackId,{errMsg:"showLoading:ok"}))},hideLoading:function(e){const t=e.data,n=document.getElementById("macleToast");n&&n.remove(),t.callbackId&&("legacy"===t.type?un(t.callbackId,{errMsg:"hideLoading:ok"},1):Sn(t.callbackId,{errMsg:"hideLoading:ok"}))},showActionSheet:function(e){const t=JSON.parse(e.data.inputParams);if(0===document.getElementsByClassName("ma-actionsheet").length){const n=document.createElement("div");t.alertText&&(n.innerHTML='<div class="ma-actionsheet__title" style="color: rgb(0, 0, 0);">'.concat(t.alertText,"</div>"));const a=document.createElement("div");for(let e=0;e<t.itemList.length;e++){const n=document.createElement("div");n.innerHTML='\n <div class="ma-actionsheet__cell" id=index'.concat(e,' style="color: ').concat(t.itemColor,';">').concat(t.itemList[e],"</div>\n "),a.appendChild(n)}const o=document.getElementById("macle-dialog-container");o.style.display="block";const r=document.createElement("div");r.innerHTML='\n <div class="ma-actionsheet ui-animate-swipeInUp">\n '.concat(n.innerHTML,'\n <div class="ma-actionsheet__menu" id="ma-actionsheet__menu"> \n ').concat(a.innerHTML,'\n </div>\n <div class="ma-actionsheet__action">\n <div class="ma-actionsheet__cell" id="ma-actionsheet__cell" style="color: rgb(0, 0, 0);">取消</div>\n </div>\n </div>\n '),o.appendChild(r),document.getElementsByClassName("macle-mask")[0].onclick=function(){_close()},document.getElementById("ma-actionsheet__menu").addEventListener("click",(t=>{const n=t.target.attributes.id.value.slice(5);_close(),e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"showActionSheet:ok",tapIndex:n})})),document.getElementById("ma-actionsheet__cell").addEventListener("click",(t=>{_close(),e.data.callbackId&&In(e.data.callbackId,{errMsg:"showActionSheet:fail"})}))}},startPullDownRefresh:function(e){const t=e.data;Sa.getPullDownRefresh(e)&&(document.getElementById("body").style.transform="translateY(50px)",document.getElementById("body").style.transition="all ease 0.5s"),t.callbackId&&Sn(t.callbackId,{errMsg:"startPullDownRefresh:ok"}),gn("service/service",{event:tn.ON_PULL_DOWN_REFRESH,webviewId:Rn().webviewId,isNative:!0})},stopPullDownRefresh:function(e){const t=e.data;Sa.getPullDownRefresh(e)&&document.getElementById("body").style.removeProperty("transform"),t.callbackId&&Sn(t.callbackId,{errMsg:"stopPullDownRefresh:ok"})},setNavigationBarTitle:function(e){const t=JSON.parse(e.data.inputParams).title;if(document.getElementById("title").innerHTML=t,e.data.callbackId){const t="setNavigationBarTitle:ok";"legacy"===e.data.type?un(e.data.callbackId,{errMsg:t},1):Sn(e.data.callbackId,{errMsg:t})}},getStatusBarHeight:function(e){const t=window.__simulatorConfig__.api.getSystemInfo.statusBarHeight,n=Oa(Oa({},new Bn("getStatusBarHeight",Fn.OK)),{},{xm_string_callback_key:"".concat(t)}),a=e.data,o=a.type,r=a.callbackId;if(r){Pn(o)(r,n)}},gotoBrowser:function(e){const t=e.data,n=t.type,a=t.callbackId;if(a){Pn(n)(a,new Bn("gotoBrowser",Fn.OK))}},setNavigationBarColor:function(e){const t=JSON.parse(e.data.inputParams),n=t.frontColor,a=t.backgroundColor;document.getElementById("head-tabbar").classList.add("navigation-bar"),document.getElementById("status").classList.add("navigation-bar");const o=document.getElementsByClassName("navigation-bar");for(let e=0;e<o.length;e++)o[e].style.color=n,o[e].style.backgroundColor=a;if(t.animation)for(let e=0;e<o.length;e++)o[e].style.transition="all 0.3s linear 0s",o[e].style.transitionDuration=t.animation.duration,o[e].style.transitionTimingFunction=t.animation.timingFunc;e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"setNavigationBarColor:ok"})},setBackgroundColor:function(e){const t=JSON.parse(e.data.inputParams).backgroundColor;document.getElementById("background").style.backgroundColor=t,e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"setBackgroundColor:ok"})},setBackgroundTextStyle:function(e){const t=JSON.parse(e.data.inputParams).textStyle,n=document.getElementsByClassName("dot");if("dark"===t)for(let e=0;e<n.length;e++)n[e].style.backgroundColor="gray";else for(let e=0;e<n.length;e++)n[e].style.backgroundColor="white";e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"setBackgroundTextStyle:ok"})},getMenuButtonBoundingClientRect:function(e){const t=e.data;if(t.callbackId){const e=document.getElementById("menuButton").getBoundingClientRect();Sn(t.callbackId,{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left})}},capsuleStyle:function(e){const t=e.data,n=t.type,a=t.callbackId,o=1===JSON.parse(e.data.inputParams).style?"white":"black",r=document.getElementById("capsule-status"),i=document.getElementById("capsule-round");r.style.backgroundColor=o,i.style.backgroundColor=o,Pn(n)(a,new Bn("capsuleStyle",Fn.OK))},setCapsuleShow:function(e){const t=e.data,n=t.type,a=t.callbackId,o=JSON.parse(e.data.inputParams),r=!Object.hasOwn(o,"isShow")||o.isShow;document.getElementById("menuButton").style.visibility=r?"visible":"hidden",Pn(n)(a,new Bn("setCapsuleShow",Fn.OK))},setSwipeBack:function(e){const t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("setSwipeBack",Fn.OK))}};function Ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Aa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(n),!0).forEach((function(t){Na(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ta(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Na(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ka="convert data to image fail",Ca=(e,t)=>{gn("service/service",{callbackId:e,invokeStatusCode:1,outputParams:{errMsg:t}})},Ra=(e,t,n)=>{gn("service/service",{callbackId:e,invokeStatusCode:0,outputParams:{msg:t,data:n}})};const Ma={setStorage:function(e){var t;const n=JSON.parse(e.data.inputParams),a=n.key,o="xm"===(null===(t=e.data)||void 0===t?void 0:t.mode)?null==n?void 0:n.value:null==n?void 0:n.data;if(0!==a.length){if(o.length>1024){if(e.data.callbackId){const t="setStorage: fail, the storage exceeds the limit";"legacy"===e.data.type?pn(e.data.callbackId,t,1):Ca(e.data.callbackId,t)}}else if(localStorage.setItem(a,JSON.stringify(o)),e.data.callbackId){const t="setStorage:ok";"legacy"===e.data.type?un(e.data.callbackId,t,1):Ra(e.data.callbackId,t)}}else if(e.data.callbackId){const t="setStorage: fail, parameter error: parameter.key must be String";"legacy"===e.data.type?pn(e.data.callbackId,t,1):Ca(e.data.callbackId,t)}},getStorage:function(e){const t=JSON.parse(e.data.inputParams).key;if(0!==t.length){let n=null;try{n=JSON.parse(localStorage.getItem(t))}catch(t){Hn.error(t);const n="getStorage: fail, failed to parse the value as JSON";e.data.callbackId&&("legacy"===e.data.type?pn(e.data.callbackId,n,1):Ca(e.data.callbackId,n))}const a=null!==n?n:null;if(null!==a){if(e.data.callbackId){const t="getStorage:ok";"legacy"===e.data.type?un(e.data.callbackId,a,1):Ra(e.data.callbackId,t,a)}}else if(e.data.callbackId){const t="getStorage: fail, can not found the key";"legacy"===e.data.type?pn(e.data.callbackId,t,1):Ca(e.data.callbackId,t)}}else if(e.data.callbackId){const t="getStorage: fail, parameter error: parameter.key must be String";"legacy"===e.data.type?pn(e.data.callbackId,t,1):Ca(e.data.callbackId,t)}},getStorageInfo:function(e){const t=[];for(let e=0;e<localStorage.length;e++)t.push(localStorage.key(e));let n=0;for(const e in localStorage)Object.prototype.hasOwnProperty.call(localStorage,e)&&(n+=localStorage.getItem(e).length);const a=(n/1024).toFixed(3);if(e.data.callbackId){const n=0;gn("service/service",{callbackId:e.data.callbackId,invokeStatusCode:n,outputParams:{keys:t,currentSize:a,limitSize:"10240",errMsg:"getStorageInfo:ok"}})}},removeStorage:function(e){const t=JSON.parse(e.data.inputParams).key;if(t){if(localStorage.removeItem(t),e.data.callbackId){const t="removeStorage:ok";"legacy"===e.data.type?un(e.data.callbackId,t,1):Ra(e.data.callbackId,t)}}else if(e.data.callbackId){const t="removeStorage: fail, parameter error: parameter.key must be String";"legacy"===e.data.type?pn(e.data.callbackId,t,1):Ca(e.data.callbackId,t)}},clearStorage:function(e){if(localStorage.clear(),e.data.callbackId){const t=0,n="localStorage clear successfully";if("legacy"===e.data.type)un(e.data.callbackId,n,1);else{gn("service/service",{callbackId:e.data.callbackId,invokeStatusCode:t,outputParams:{errMsg:n}})}}},submitReport:function(e){if(e.data.callbackId){const t=new Bn("submitReport",Fn.OK);Pn(e.data.type)(e.data.callbackId,t,1)}},reportPerformance:function(){},reportLog:function(){},reportEvent:function(){},saveFileToPhone:function(e){const t=JSON.parse(e.data.inputParams),n=e.data,a=n.type,o=n.callbackId,r={content:t.content,name:t.fileName,autoRename:!0};return"legacy"===a&&(Qt.post("/saveBase64File",{data:r}).then((e=>{Pn(a)(o,Aa(Aa({},new Bn("saveFileToPhone",Fn.OK)),{},{filePath:e.data.filePath,result:"true"}))})).catch((e=>{Tn(a)(o,Aa(Aa({},new Bn("saveFileToPhone",Fn.FAIL,"create file fail")),{},{result:"false"}))})),!0)},saveImage:function(e){const t=JSON.parse(e.data.inputParams),n=e.data,a=n.type,o=n.callbackId,r="".concat(crypto.getRandomValues(new Uint32Array(1))[0],".jpg"),i=[t.content,r];return"legacy"===a&&(Qt.post("/saveImg",{data:i}).then((()=>{Pn(a)(o,Aa(Aa({},new Bn("saveImage",Fn.OK)),{},{result:"true"}))})).catch((e=>{Tn(a)(o,Aa(Aa({},new Bn("saveImage",Fn.FAIL,ka)),{},{result:"false"}))})),!0)},saveBase64Image:function(e){const t=JSON.parse(e.data.inputParams),n=e.data,a=n.type,o=n.callbackId,r="".concat(crypto.getRandomValues(new Uint32Array(1))[0],".jpg"),i=[t.base64,r];return"legacy"===a&&(Qt.post("/saveImg",{data:i}).then((e=>{Pn(a)(o,new Bn("saveBase64Image",Fn.OK))})).catch((e=>{Tn(a)(o,new Bn("saveBase64Image",Fn.FAIL,ka))})),!0)}};let Da="",La="",Ba="";const xa=function(){ja.getTargetIframe().scrollTo(0,0)},ja={setSelection:(e,t,n,a)=>{t>-1&&n>-1&&n>t?e.setSelectionRange(t,n):a>=0?e.setSelectionRange(a,a):e.setSelectionRange(e.value.length,e.value.length)},generateInput:e=>{let t=document.getElementById("macle-input-simulator");if(t||(t=document.createElement("div"),t.setAttribute("id","macle-input-simulator"),document.body.appendChild(t)),e.inputId===Ba&&t.firstChild&&(t.firstChild.onblur=e=>!1),e.componentType)t.innerHTML="<textarea id='".concat(e.inputId,"' \n class='macle-textarea' \n maxlength=\"").concat(e.maxlength,'"\n placeholder="').concat(e.placeholder,'"> ');else{const n=e.password?"password":e.type,a=ja.getType(n);t.innerHTML="<input id='".concat(e.inputId,"' \n class='macle-input' \n type=\"").concat(a,'" \n maxlength="').concat(e.maxlength,'"\n placeholder="').concat(e.placeholder,'"> ')}const n=t.firstChild;n.style.top="".concat(ja.handleTopPosition(e.position.top,e.position.height,e.left),"px"),n.style.left="".concat(e.position.left,"px"),n.style.width="".concat(e.position.width,"px"),n.style.height="".concat(e.position.height,"px"),n.style.fontSize=e.inputStyle.fontSize,n.style.fontWeight=e.inputStyle.fontWeight,n.style.color=e.inputStyle.color,n.style.textAlign=e.inputStyle.textAlign;const a=[...document.styleSheets].filter((e=>{var t;return null===(t=e.href)||void 0===t?void 0:t.includes("common.css")}))[0],o=a.rules;let r=e.placeholderStyle.fontWeight;return r=Number(r)>0?Number(r):r,a.insertRule("".concat(e.componentType?".macle-textarea":".macle-input","::-webkit-input-placeholder{ \n color: ").concat(e.placeholderStyle.color,"; \n font-size:").concat(e.placeholderStyle.fontSize,";\n font-weight:").concat(r,";\n line-height:").concat(e.position.height," + 'px';\n }"),o.length-1),ja.hiddenScroll(),n},registerInput:(e,t)=>{e.oninput=n=>{const a=Rn().webviewId,o={value:e.value,inputId:t};gn(a,{event:tn.ON_INPUT_CHANGE,webviewId:a,isNative:!0,paramsString:JSON.stringify(o)})}},registerBlur:(e,t)=>{e.onblur=n=>{e.style.visibility="hidden",Da=t,La=n.target.value,ja.hideInput(Da,La,!1),Da===Ba&&ja.showScroll()}},registerConfirm:(e,t)=>{e.onkeydown=n=>{"Enter"===n.code&&(ja.hideInput(t,n.target.value,!0),e.blur())}},hideInput:(e,t,n)=>{const a={inputId:e,isConfirm:n,value:t,isSimulator:!0},o=Rn().webviewId;gn(o,{event:tn.ON_INPUT_HIDE,webviewId:o,isNative:!0,paramsString:JSON.stringify(a)})},getType:e=>({text:"text",digit:"digit",number:"number",idcard:"text",safePassword:"password",password:"password"}[e]),handleTopPosition:(e,t,n)=>{let a=e;const o=Rn(),r=document.getElementById(o.webviewId),i=window.__simulatorConfig__.api.getSystemInfo.statusBarHeight,s=vn(o.path),c=bn(o.path),l=window.__simulatorConfig__.statusBar,d=Ln();let u;u=c?54:s?0:44+(l?i:0);const p=document.getElementById("macle-main").clientHeight-u,f=r.contentWindow.document.body.scrollTop;return a+t>p?(r.contentWindow.document.body.scrollTo({left:n,top:a+t-p+f}),a=p-t+d):a+=d,a},hiddenScroll:()=>{const e=ja.getTargetIframe(),t=ja.getMacleContentBody();e.document.body.style.overflowY="hidden",document.body.style.overflowY="hidden",t&&(t.style.overflowY="hidden"),e.addEventListener("scroll",xa)},showScroll:()=>{const e=ja.getTargetIframe(),t=ja.getMacleContentBody();e.document.body.style.overflowY="",document.body.style.overflowY="",t&&(t.style.overflowY=""),e.removeEventListener("scroll",xa)},getTargetIframe:()=>dn(Rn().webviewId),getMacleContentBody:()=>{var e;return null===(e=ja.getTargetIframe().document.body.getElementsByTagName("body"))||void 0===e?void 0:e[0]}};const Fa={lineChange:function(e){const t=JSON.parse(e.data.inputParams),n=document.getElementById(t.inputId);n&&(n.style.top="".concat(ja.handleTopPosition(t.position.top,t.position.height,t.left),"px"),n.style.left="".concat(t.position.left,"px"),n.style.width="".concat(t.position.width,"px"),n.style.height="".concat(t.position.height,"px"))},showInput:function(e){const t=JSON.parse(e.data.inputParams);if(Rn().webviewId!==t.webviewId)return;ja.hiddenScroll();const n=ja.generateInput(t);Da=t.inputId,La=t.inputValue,Ba=t.inputId,ja.registerInput(n,t.inputId),ja.registerBlur(n,t.inputId),t.componentType||ja.registerConfirm(n,t.inputId),n.focus(),n.value=t.value,t.focus&&ja.setSelection(n,t.selectionStart,t.selectionEnd,t.cursor)},specialPageDataChange:function(e){const t=JSON.parse(e.data.inputParams),n=document.getElementById(t.inputId),a=t.value,o=t.cursor;void 0!==a&&(n.value=a),void 0!==o&&-1!==o&&n.setSelectionRange(o,o),t.hasReturn=!0;const r=t.webviewId;gn(r,{event:tn.ON_INPUT_CHANGE,webviewId:r,isNative:!0,paramsString:JSON.stringify(t)})}};function Ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ha(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ua(Object(n),!0).forEach((function(t){Va(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ua(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Va(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ga={resultCode:"EXAMPLE_RESULT_CODE",tradeNO:"EXAMPLE_TRADE_NO",extendInfo:"EXAMPLE_EXTEND_INFO"};const Wa={insertHTMLWebView:function(e){const t=e.data,n=JSON.parse(t.inputParams);if(!n.src&&t.callbackId){Cn(t,n,"insertHTMLWebView:fail")}else{const e=Rn(),a=document.getElementById(e.webviewId),o=n.src;if(a.setAttribute("src",o),t.callbackId){kn(t,n,"insertHTMLWebView:ok")}}},updateHTMLWebView:function(e){const t=e.data,n=JSON.parse(t.inputParams);if(!n.src&&t.callbackId){const e="updateHTMLWebView:fail";Cn(t,t.inputParams,e)}else{const e=Rn(),a=document.getElementById(e.webviewId),o=n.src;if(a.setAttribute("src",o),t.callbackId){kn(t,n,"updateHTMLWebView:ok")}}},tradePay:function(e){let t=e.data,n=t.type,a=t.callbackId;const o=Ha(Ha({},new Bn("tradePay",Fn.OK)),Ga);Pn(n)(a,o)}};function Ja(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Ka(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ja(Object(n),!0).forEach((function(t){za(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ja(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function za(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ya=Xn.getInstance(),qa={getBase64Image(e,t){const n=e.width*t,a=e.height*t,o=document.createElement("canvas");o.width=n,o.height=a;const r=o.getContext("2d");r.clearRect(0,0,n,a),r.drawImage(e,0,0,n,a);const i=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return o.toDataURL("image".concat(i))},urlsList(e){var t;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return 0===(null===(t=e[0])||void 0===t?void 0:t.trim().indexOf("http"))?e:e.map((e=>Dn(e,n)))},divElementInner(e,t,n){const a=100*e.length;let o=0,r=1;if(t.current)for(let a=0;a<e.length;a++)t.urls[a]===t.current&&(o=-a*n,r=a+1);let i='<div id="maclePreview">\n <div id="previewNumber" class="macle-preview-number">'.concat(r,"/").concat(e.length,'</div>\n <div class="macle-preview-list" \n id="previewList" \n style="display: block; \n width: ').concat(a,"%; \n transition: all 0.3s linear 0s; transform: translate(").concat(o,'px, 0px); " >\n ');for(let t=0;t<e.length;t++){const a=n*t;i+=' \n <span class="macle-preview-img" \n style="background-image: url(\''.concat(e[t],"' ); left:").concat(a,"px; width: ").concat(n,'px; height:100%; "\n >\n </span>\n ')}return i+="</div></div>",i},addEventListenerTouch(e,t,n){let a,o,r,i;e.addEventListener("touchstart",(e=>{a=e.touches[0].pageX,i=parseInt(e.touches[0].target.getAttribute("style").split(";")[1].split(":")[1].split("px")[0])}),!1),e.addEventListener("touchmove",(e=>{r=e.touches[0].pageX;const o=r-a,s=-i+o;o>0?document.getElementById("previewList").style.transform=0===i?"translateX(0px)":"translateX(".concat(s,"px)"):i===n*(t.length-1)?document.getElementById("previewList").style.transform="translateX(-".concat(i,"px)"):document.getElementById("previewList").style.transform="translateX(".concat(s,"px)")})),e.addEventListener("touchend",(e=>{o=e.changedTouches[0].pageX;const r=o-a,s=-(i+n),c=-(i-n);r>100||r<-100?r>100?(i>0&&(document.getElementById("previewList").style.transform="translateX(".concat(c,"px)"),document.getElementById("previewNumber").innerHTML="".concat(i/n,"/").concat(t.length)),0===i&&(document.getElementById("previewList").style.transform="translateX(0px)",document.getElementById("previewNumber").innerHTML="1/".concat(t.length))):i===n*(t.length-1)?(document.getElementById("previewList").style.transform="translateX(-".concat(i,"px)"),document.getElementById("previewNumber").innerHTML="".concat(t.length,"/").concat(t.length)):(document.getElementById("previewList").style.transform="translateX(".concat(s,"px)"),document.getElementById("previewNumber").innerHTML="".concat(i/n+2,"/").concat(t.length)):(document.getElementById("previewList").style.transform="translateX(-".concat(i,"px)"),document.getElementById("previewNumber").innerHTML="".concat(i/n+1,"/").concat(t.length))}))},uploadFile(e,t){const n=document.createElement("div");n.innerHTML='<input id="inputFile" type="file" accept="'.concat(e.accept,'" ').concat(e.multiple?"multiple":""," >"),document.body.appendChild(n);const a=document.getElementById("inputFile");a.click(),a.onchange=t,n.remove()},saveTmpFiles(e){const t=new FormData;e.forEach((e=>t.append("files",e)));return Qt.post("/tmp",t,{headers:{"Content-Type":"multipart/form-data"}})},getMediaDuration:e=>new Promise(((t,n)=>{const a=URL.createObjectURL(e),o=new Audio(a);let r;o.addEventListener("loadedmetadata",(e=>{r=o.duration,t({duration:o.duration})})),o.addEventListener("error",(e=>{n(new Error("get media duration failed",{cause:"ParsingFailed"}))}))}))};class Xa{static getInstance(){return this.instance||(this.instance=new Xa),this.instance}async play(e){var t,n,a;let o=e.url,r=e.filePath,i=e.duration,s=void 0===i?60:i;const c=function(e){const t=nn.envConfigs;for(const n of Object.keys(t)){const a=t[n].env;if(!a||!e.startsWith(a))continue;const o="".concat(n,"/").concat(e.replace(a,"")).replace("//","/");return"".concat(window.origin,"/").concat(o)}return""}(r);if(!c)throw new Error;null===(t=this.audio)||void 0===t||t.pause(),null===(n=this.timer)||void 0===n||n.clear();const l=new Audio(c);this.audio=l;this.timer=o?null:new ha(l,this.onAppHide,1e3*s),await this.audio.play(),null===(a=this.timer)||void 0===a||a.start(),Ya.once(tn.ON_APP_HIDE,this.onAppHide),Ya.once(tn.ON_APP_ROUTE,this.onAppHide)}stop(){var e;this.audio.pause(),null===(e=this.timer)||void 0===e||e.clear(),this.audio=void 0,Ya.off(tn.ON_APP_HIDE,this.onAppHide),Ya.off(tn.ON_APP_ROUTE,this.onAppHide)}onAppHide(){Xa.getInstance().stop()}onSuccess(e,t,n){Pn(e)(t,new Bn(n,Fn.OK))}onError(e,t,n,a){Tn(e)(t,new Bn(n,Fn.FAIL))}}const $a={chooseImage:function(e){let t=e.data,n=t.callbackId,a=t.type,o=t.inputParams;const r=tn.CHOOSE_IMAGE,i=Pn(a),s=JSON.parse(o),c=Number.isInteger(s.count)?s.count:9;qa.uploadFile({accept:"image/*",multiple:c>1},(e=>{const t=e.target.files,a=t.length>=c?c:t.length,o=[...t].slice(0,a);qa.saveTmpFiles(o).then((e=>{const t=e.data,a=t.fileName,o=t.sizeList,s=a.map((e=>"/tmp/".concat(e))),c=a.map((e=>"".concat(nn.envConfigs.tmp.env).concat(e))),l=s.map(((e,t)=>({path:e,size:o[t]})));i(n,Ka(Ka({},new Bn(r,Fn.OK)),{},{tempFilePaths:s,tempFileVirtualPaths:c,tempFiles:l}))}))}))},chooseVideo:async function(e){let t=e.data,n=t.callbackId,a=t.type;const o=tn.CHOOSE_VIDEO,r=Tn(a),i=Pn(a);try{await function(e){let t=e.scope;return new Promise(((e,n)=>{ma({scope:t,success:()=>e(),fail:e=>n(e)})}))}({scope:$n.PHOTOS_ALBUMS})}catch(e){return void r(n,new Bn(o,Fn.FAIL,"album permission auth failed."))}qa.uploadFile({accept:"video/*"},(async e=>{try{const t=e.target.files[0]||{};if(!t.type.startsWith("video/"))throw new Error("upload video failed",{cause:"WrongFileType"});let a=(await qa.getMediaDuration(t)).duration;a=a.toFixed(2);const r=(await qa.saveTmpFiles([t])).data.fileName;i(n,Ka(Ka({},new Bn(o,Fn.OK)),{},{tempFilePath:"/tmp/".concat(r[0]),tempFileVirtualPath:"".concat(nn.envConfigs.tmp.env).concat(r[0]),duration:a}))}catch(e){const t={ParsingFailed:"fail to get video info",WrongFileType:"no video selected"}[e.cause]||"";r(n,new Bn(o,Fn.FAIL,t))}}))},compressImage:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.src.split("/")[n.src.split("/").length-1],o=n.quality?n.quality/100:.8,r=(window.crypto||window.webkitCrypto||window.mozCrypto||window.oCrypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0],i=new Image;i.onload=function(){const e={base64:qa.getBase64Image(i,o),name:a,numArray:r};Qt.post("/tmpImg",{data:e}).then((e=>{const n=e.data,a="/tmp/".concat(n.fileName);Sn(t.callbackId,{errMsg:"compressImage:ok",tempFilePath:a})})).catch((e=>{In(t.callbackId,{errMsg:"compressImage:fail "})}))},i.src=Dn(n.src)},getImageInfo:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.src.split("/"),o="../".concat(a[a.length-1]),r=new Image;r.id="imgMessage",r.onload=function(){const e=r.width,a=r.height;let i=n.src.split(".")[n.src.split(".").length-1];"jpg"===i&&(i="jpeg");Sn(t.callbackId,{errMsg:"getImageInfo:ok",width:e,height:a,type:i,path:o,orientation:"up"})},-1!==n.src.indexOf("http")?r.src=n.src:r.src=Dn(n.src)},insertVideoPlayer:function(e){const t=e.data,n=JSON.parse(t.inputParams);if(t.inputParams&&n.src||!t.callbackId){if(t.callbackId){const e=0,a=t.callbackId;gn(n.webviewIdList,{callbackId:a,invokeStatusCode:e,outputParams:{type:"simulate",errMsg:"insertVideoPlayer: ok"}})}}else{Cn(t,n,"insertVideoPlayer: fail, The url cannot be empty !")}},loadFontFace:async function(e){const t=e.data;try{var n,a,o;const e=JSON.parse(t.inputParams),r=e.family,i=e.source,s=e.desc,c=void 0===s?{}:s,l=e.global,d=void 0!==l&&l,u={inputParams:JSON.stringify({url:i})},p=await Qt.post("/download",{data:u}),f=p.data.tempFilePath.split("/").pop(),m=new FontFace(r,"url(".concat(window.origin,"/tmp/").concat(f,")"),{style:null!==(n=c.style)&&void 0!==n?n:"normal",weight:null!==(a=c.weight)&&void 0!==a?a:"normal",variant:null!==(o=c.variant)&&void 0!==o?o:"normal"}),g=(await m.load()).status,h=Array.from(document.getElementsByTagName("iframe"));let b=[];if(d)window.addEventListener(tn.NEW_IFRAME_LOADED,(e=>{e.target.contentDocument.fonts.add(m)}),!0),b=[document,...h.map((e=>e.contentDocument))];else{b=h.filter((e=>"none"!==e.style.display)).map((e=>e.contentDocument))}for(const e of b)e.fonts.add(m);Sn(t.callbackId,Ka(Ka({},new Bn("loadFontFace",Fn.OK)),{},{status:g}))}catch(e){In(t.callbackId,Ka(Ka({},new Bn("loadFontFace",Fn.FAIL)),{},{status:"error"}))}},playVoice:async function(e){let t=e.data,n=t.type,a=t.inputParams,o=t.callbackId;const r=JSON.parse(a),i=Xa.getInstance();try{r.filePath&&delete r.url,r.url&&(r.filePath=await async function(e){return new Promise((async(t,n)=>{try{const n={inputParams:JSON.stringify({url:e.url})},a=await Qt.post("/download",{data:n});t(a.data.tempFilePath.replace("/tmp/",nn.envConfigs.tmp.env))}catch(e){n(e)}}))}(r)),await i.play(r),i.onSuccess(n,o,tn.PLAY_VOICE)}catch(e){i.onError(n,o,tn.PLAY_VOICE)}},previewImage:function(e){let t=e.data,n=t.callbackId,a=t.type,o=t.inputParams;const r="legacy"!==a,i=JSON.parse(o),s=qa.urlsList(i.urls,r),c=document.body.clientWidth,l=qa.divElementInner(s,i,c),d=document.createElement("div");d.innerHTML=l,document.body.appendChild(d),Pn(a)(n,{errMsg:"previewImage:ok"});const u=document.getElementsByClassName("macle-preview-img");for(let e=0;e<u.length;e++)qa.addEventListenerTouch(u[e],s,c);document.getElementById("maclePreview").onclick=function(){d.remove()}},saveImageToPhotosAlbum:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.filePath.split("/")[n.filePath.split("/").length-1],o=Dn(n.filePath),r=new Image;r.onload=function(){const e=qa.getBase64Image(r,1),n=[];n[0]=e,n[1]=a,Qt.post("/saveImg",{data:n}).then((e=>{Sn(t.callbackId,e.data)})).catch((e=>{In(t.callbackId,{errMsg:"saveImageToPhotosAlbum:fail "})}))},r.src=o},stopVoice:function(e){let t=e.data,n=t.type,a=t.callbackId;const o=Xa.getInstance();try{o.stop(),o.onSuccess(n,a,tn.STOP_VOICE)}catch(e){o.onError(n,a,tn.STOP_VOICE)}},videoActionChanged:function(e){const t=JSON.parse(e.data.inputParams).webviewId;gn(t,{event:"VIDEO_ACTION_CHANGED",webviewId:t,isNative:!0,paramsString:e.data.inputParams})}},Za={};let Qa="",eo="",to=0,no={},ao={},oo="",ro="",io={},so=!1;function co(e){return Za[e]}function lo(e,t,n){const a=[];e.ondataavailable=e=>{a.push(e.data)},e.onstop=function(){so=!1;const e=new Blob(a,{type:"video/mp4"});ro=URL.createObjectURL(e);const o=document.createElement("video");o.src=ro,o.onloadedmetadata=function(){const e=ln("".concat(Qa,"-videoCamera")),a=ln("".concat(Qa,"-canvasCamera")),o=a.getContext("2d"),r=co(Qa);o.drawImage(e,0,0,r.position.width,r.position.height),oo=a.toDataURL("image/png"),io={event:Enums.ON_CAMERA_RECORD_FINISH,webviewId:Qa,isNative:!0,paramsString:JSON.stringify({webviewId:Qa,errMsg:"stopRecord: ok",tempThumbPath:oo,tempVideoPath:ro})},"timeoutCallback"===t?gn("service/service",io):Sn(n,{errMsg:"stopRecord: ok",tempThumbPath:oo,tempVideoPath:ro})}}}const uo={insertCamera:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.webViewId;if(function(e,t){const n=document.createElement("video"),a=document.createElement("canvas"),o="position: absolute;left: ".concat(t.left,"PX;top: ").concat(t.top+Ln(),"px;z-index: 9");n.setAttribute("style",o),n.setAttribute("id","".concat(e,"-videoCamera")),n.setAttribute("width","".concat(t.width,"px")),n.setAttribute("height","".concat(t.height,"px")),n.setAttribute("class","camera-simulate"),a.setAttribute("style",o),a.setAttribute("id","".concat(e,"-canvasCamera")),a.setAttribute("width","".concat(t.width,"px")),a.setAttribute("height","".concat(t.height,"px")),document.getElementsByTagName("body")[0].appendChild(a),document.getElementsByTagName("body")[0].appendChild(n)}(a,n.position),Qa=a,eo=n.cameraId,Za[a]=n,function(e){void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(e){const t=navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return t?new Promise(((n,a)=>{t.call(navigator,e,n,a)})):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),navigator.mediaDevices.getUserMedia({video:!0,audio:!1}).then((t=>{if(Rn().webviewId===e){no=t;const e=ln("".concat(Qa,"-videoCamera"));"srcObject"in e?(e.srcObject=t,window.mediaStreamTrack="function"==typeof t.stop?t:t.getTracks()[0]):e.src=window.URL.createObjectURL(t),e.onloadedmetadata=function(t){e.play()};const n=t.getTracks()[0].getCapabilities();to=n.zoom?n.max:400;const a={event:Enums.ON_CAMERA_CHANGED,webviewId:Qa,isNative:!0,paramsString:JSON.stringify({cameraId:eo,eventName:"initdone",detail:{errMsg:"{'maxZoom: ".concat(to,"'}")}})};gn(Qa,a)}})).catch((e=>{const t={event:Enums.ON_CAMERA_CHANGED,webviewId:Qa,isNative:!0,paramsString:JSON.stringify({cameraId:eo,eventName:"error",detail:{errMsg:"camera permission denied"}})};gn(Qa,t)}))}(a),t.callbackId){kn(t,n,"insertCamera:ok")}},updateCamera:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.webViewId,o=n.position,r=ln("".concat(a,"-videoCamera")),i=ln("".concat(a,"-canvasCamera")),s="position: absolute;left: ".concat(o.left,"px;top: ").concat(o.top+67,"px;z-index: 9");if(r.setAttribute("style",s),r.setAttribute("width","".concat(o.width,"px")),r.setAttribute("height","".concat(o.height,"px")),r.setAttribute("class","camera-simulate"),i.setAttribute("style",s),i.setAttribute("width","".concat(o.width,"px")),i.setAttribute("height","".concat(o.height,"px")),t.callbackId){kn(t,n,"updateCamera:ok")}},removeCamera:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=n.webViewId;if(ln("".concat(a,"-videoCamera"))&&ln("".concat(a,"-videoCamera")).remove(),ln("".concat(a,"-canvasCamera"))&&ln("".concat(a,"-canvasCamera")).remove(),window.mediaStreamTrack&&window.mediaStreamTrack.stop(),t.callbackId){kn(t,n,"removeCamera: ok")}},cameraTakePhoto:function(e){const t=e.data,n=JSON.parse(t.inputParams).camera.webviewId,a=ln("".concat(n,"-videoCamera")),o=ln("".concat(n,"-canvasCamera")),r=o.getContext("2d"),i=co(n);r.drawImage(a,0,0,i.position.width,i.position.height);const s=o.toDataURL();t.callbackId&&Sn(t.callbackId,{tempImagePath:s})},getCameraById:co,cameraSetZoom:function(e){const t=e.data,n=JSON.parse(t.inputParams);if(n.zoom){const e=n.zoom&&n.zoom<to?n.zoom:to,a=no.getVideoTracks(),o={advanced:[{zoom:e}]};a[0].applyConstraints(o).then((a=>{if(t.callbackId){const a="cameraSetZoom: ok";n.zoom=e,kn(t,n,a)}})).catch((e=>{In(t.callbackId,{errMsg:e.message})}))}else In(t.callbackId,{errMsg:"zoom value can not be empty"})},cameraStartRecord:function(e){if(so)return void In(e.data.callbackId,{errMsg:"startRecord: fail, camera is recording, can not start recording now."});const t=e.data,n=JSON.parse(t.inputParams).timeout||30;navigator.mediaDevices.getUserMedia({video:!0,audio:!0}).then((e=>{no=e;ao=new MediaRecorder(no);try{if(ao.start(),so=!0,lo(ao,"timeoutCallback",t.callbackId),t.callbackId){const e="cameraStartRecord: ok";Sn(t.callbackId,{errMsg:e})}setTimeout((()=>{ao.stop()}),n<180?1e3*n:18e4)}catch(e){In(t.callbackId,{errMsg:"video recording has been interrupted"})}})).catch((()=>{In(t.callbackId,{errMsg:"startRecord:fail, unauthorized, user does not allow microphone authority"})}))},cameraStopRecord:function(e){const t=e.data;try{lo(ao,"success",t.callbackId),ao.stop()}catch(e){In(t.callbackId,{errMsg:e.message})}}},po={UNHANDLED:e=>({errMsg:e.message}),PROCESSED:e=>e.response.data,COMMON:e=>{var t;return null!==(t=e.response.data)&&void 0!==t?t:{errMsg:e.message}}};function fo(e,t){const n=t.data,a=void 0===n?{}:n,o=t.params,r=t.resMapFn,i=void 0===r?e=>e.data:r,s=t.errMapFn,c=void 0===s?po.PROCESSED:s,l=a.callbackId;Qt.post(e,{data:a,params:o}).then((e=>{const t=i(e);l&&Sn(l,t)})).catch((e=>{const t=c(e);l&&In(l,t)}))}function mo(e,t){const n=t.data,a=void 0===n?{}:n,o=t.params,r=t.resMapFn,i=void 0===r?e=>e.data:r,s=t.errMapFn,c=void 0===s?po.PROCESSED:s,l=a.callbackId;Qt.get(e,{params:o}).then((e=>{const t=i(e);l&&Sn(l,t)})).catch((e=>{const t=c(e);l&&In(l,t)}))}const go={saveFile:function(e){fo("/saveFile",{data:e.data,errMapFn:po.UNHANDLED})},getFileInfo:function(e){const t=e.data;mo("/fileInfo",{data:t,params:{data:t},errMapFn:po.PROCESSED})},openDocument:function(e){const t=JSON.parse(e.data.inputParams);!function(e,t){const n=t.data,a=void 0===n?{}:n,o=t.params,r=t.resMapFn,i=void 0===r?e=>e.data:r,s=t.errMapFn,c=void 0===s?po.PROCESSED:s,l=a.callbackId,d=a.type;Qt.post(e,{data:a,params:o}).then((e=>{const t=i(e);l&&("legacy"===d?un(l,t,1):Sn(l,t))})).catch((e=>{const t=c(e);l&&("legacy"===d?pn(l,t,1):In(l,t))}))}("/openDocument",{data:e.data,params:t,errMapFn:po.PROCESSED})},removeSavedFile:function(e){fo("/removeSaved",{data:e.data,errMapFn:po.UNHANDLED})},getSavedFileList:function(e){mo("/savedFileList",{data:e.data,errMapFn:po.UNHANDLED})},getSavedFileInfo:function(e){const t=e.data;mo("/savedFileInfo",{data:t,params:{data:t},errMapFn:po.UNHANDLED})},writeFile:function(e){fo("/writeFile",{data:e.data})},readFile:function(e){fo("/readFile",{data:e.data})},readdir:function(e){fo("/readdir",{data:e.data})},copyFile:function(e){fo("/copyFile",{data:e.data})},moveFile:function(e){fo("/moveFile",{data:e.data})},unlink:function(e){fo("/unlink",{data:e.data})},exists:function(e){fo("/exists",{data:e.data})},mkdir:function(e){fo("/mkdir",{data:e.data})}};function ho(e){const t=document.createElement("div");e.text&&(t.innerHTML=e.text);let n="\n position: absolute;\n width: ".concat(e.width,"px;\n height: ").concat(e.height,"px;\n left: ").concat(e.left,"px;\n top: ").concat(e.top+Ln(),"px;\n z-index: 9\n ");return n="".concat(n).concat(e.style),t.setAttribute("style",n),t.setAttribute("class","cover-view-div"),t.setAttribute("id",e.id),!!document.getElementsByTagName("body")[0]&&(document.getElementsByTagName("body")[0].appendChild(t),e.children&&e.children.forEach((e=>{ho(e)})),!0)}function bo(e){e&&e.forEach((e=>{bo(e.children),ln(e.id)&&ln(e.id).remove()}))}function yo(e){e&&e.forEach((e=>{const t=ln(e.id);let n="\n position: absolute;\n width: ".concat(e.width,"px;\n height: ").concat(e.height,"px;\n left: ").concat(e.left,"px;\n top: ").concat(e.top+Ln(),"px;\n z-index: 9\n ");n="".concat(n).concat(e.style),t.setAttribute("style",n),t.setAttribute("class","cover-view-div"),yo(e.children)}))}const vo={insertCoverView:function(e){const t=e.data,n=JSON.parse(t.inputParams);if(Rn().webviewId!==n.webviewId)return;if(ho(n,t.callbackId)&&t.callbackId){kn(t,n,"insertCoverView:ok")}else if(t.callbackId){Cn(t,n,"insertCoverView:fail")}},removeCoverView:function(e){const t=e.data,n=JSON.parse(t.inputParams);bo(n.children),ln(n.id)&&ln(n.id).remove()},updateCoverView:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=ln(n.id);let o="\n position: absolute;\n width: ".concat(n.width,"px;\n height: ").concat(n.height,"px;\n left: ").concat(n.left,"px;\n top: ").concat(n.top+Ln(),"px;\n z-index: 9\n ");if(o="".concat(o).concat(n.style),a.setAttribute("style",o),a.setAttribute("class","cover-view-div"),yo(n.children),t.callbackId){kn(t,n,"updateCoverView:ok")}}};const wo={insertCoverImage:function(e){const t=e.data,n=JSON.parse(t.inputParams);if(Rn().webviewId!==n.webviewId)return;const a=function(e){const t=document.createElement("img");let n="\n position: absolute;\n width: ".concat(e.width,"px;\n height: ").concat(e.height,"px;\n left: ").concat(e.left,"px;\n top: ").concat(e.top+67,"px;z-index: 9\n ");n="".concat(n).concat(e.style),t.setAttribute("style",n),t.setAttribute("id",e.id);const a=e.src.startsWith("http")?e.src:Dn(e.src);return t.setAttribute("src",a),!!document.getElementsByTagName("body")[0]&&(document.getElementsByTagName("body")[0].appendChild(t),!0)}(n);if(a&&t.callbackId){kn(t,n,"insertCoverImage:ok")}else if(!a&&t.callbackId){Cn(t,n,"insertCoverImage:fail")}},removeCoverImage:function(e){const t=e.data,n=JSON.parse(t.inputParams);ln(n.id)&&ln(n.id).remove()},updateCoverImage:function(e){const t=e.data,n=JSON.parse(t.inputParams),a=ln(n.id);let o="\n position: absolute;\n width: ".concat(n.width,"px;\n height: ").concat(n.height,"px;\n left: ").concat(n.left,"px;\n top: ").concat(n.top+67,"px;z-index: 9\n ");o="".concat(o).concat(n.style),a.setAttribute("style",o);const r=n.src.startsWith("http")?n.src:Dn(n.src);if(a.setAttribute("src",r),t.callbackId){kn(t,n,"updateCoverImage:ok")}}};function Eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function _o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Eo(Object(n),!0).forEach((function(t){Oo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Eo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Io=.5;const So={authCode:"AUTH_CODE",userInfo:{nickName:"NICK_NAME",avatarUrl:"".concat(location.origin,"/default-user-avatar@128w.jpg"),country:"COUNTRY"},accessToken:"ACCESS_TOKEN"};const Po={devices:[{deviceId:"DEVICE_ID_EXAMPLE",localName:"LOCAL_NAME_EXAMPLE",name:"NAME_EXAMPLE",RSSI:-50,connectable:!0,advertisServiceUUIDs:["ADVERTIS_SERVICE_UUID_EXAMPLE"]}],services:[{uuid:"SERVICE_ID_EXAMPLE",isPrimary:!0}],characteristics:[{uuid:"CHARACTERISTIC_ID_EXAMPLE",properties:{read:!0,write:!0,writeNoResponse:!0,writeDefault:!0,signedWrite:!1,extendedProperties:!1}}]};const To={scanCode:function(e){const t=e.data,n="scanCode:ok",a="scanCode:fail";t.callbackId&&fa({title:"设置扫码返回的数据",content:"",cancelText:"取消",confirmText:"确定",editable:!0,name:"scanCode",callbackId:t.callbackId,type:t.type,cancelCallback:()=>{"legacy"===t.type?pn(t.callbackId,{errMsg:n},1):In(t.callbackId,{errMsg:n})},confirmCallback:()=>{"legacy"===t.type?un(t.callbackId,{errMsg:a},1):Sn(t.callbackId,{errMsg:a})}})},vibrateShort:function(e){const t=e.data;document.getElementById("macle-main").style.transition="all 0.05s linear 0s";const n=[-1,-1,1,1],a=[0,5,5,0];let o=0;const r=setInterval((()=>{document.getElementById("macle-main").style.transform="translate(".concat(n[o],"%, ").concat(a[o],"px)"),o+=1,3===o&&(clearInterval(r),document.getElementById("macle-main").style.removeProperty("transform"),Sn(t.callbackId,{errMsg:"vibrateShort:ok"}))}),51)},vibrateLong:function(e){const t=e.data;document.getElementById("macle-main").style.transition="all 0.05s linear 0s";const n=[-1,1,-1,1,-1,1,-1,1],a=[5,5,5,5,5,5,5,0];let o=0;const r=setInterval((()=>{document.getElementById("macle-main").style.transform="translate(".concat(n[o],"%, ").concat(a[o],"px)"),o+=1,8===o&&(clearInterval(r),document.getElementById("macle-main").style.removeProperty("transform"),Sn(t.callbackId,{errMsg:"vibrateLong:ok"}))}),51)},chooseContact:function(e){In(e.data.callbackId,{errMsg:"chooseContact:fail 模拟器暂时不支持此 API 调试,请使用真机进行开发"})},getNetworkType:function(e){const t=e.data,n=localStorage.getItem("networkType");if(null===n){const e="getNetworkType:fail ";return void("legacy"===t.type?pn(t.callbackId,{errMsg:e},1):In(t.callbackId,{errMsg:e}))}const a="getNetworkType:ok";"legacy"===t.type?un(t.callbackId,{errMsg:a,networkType:n,isConnectVPN:true},1):Sn(t.callbackId,{errMsg:a,networkType:n,isConnectVPN:true})},startGyroscope:function(e){In(e.data.callbackId,{errMsg:"startGyroscope:fail 模拟器暂时不支持此 API 调试,请使用真机进行开发"})},stopGyroscope:function(e){In(e.data.callbackId,{errMsg:"stopGyroscope:fail 模拟器暂时不支持此 API 调试,请使用真机进行开发"})},makePhoneCall:function(e){const t=e.data,n=JSON.parse(t.inputParams);fa({title:"",content:"拨打".concat(n.phoneNumber,"?【仅为模拟】"),cancelText:"取消",confirmText:"确认",cancelColor:"#000000",name:t.command,callbackId:t.callbackId,confirmCallback:()=>{Sn(t.callbackId,{errMsg:"makePhoneCall:ok"})}})},getBatteryInfo:function(e){const t=e.data;window.navigator.getBattery().then((e=>{const n=100*e.level,a=e.charging;Sn(t.callbackId,{errMsg:"getBatteryInfo:ok",level:n,isCharging:a})}))},setScreenBrightness:function(e){const t=e.data,n=JSON.parse(t.inputParams);Io=n.value,Sn(t.callbackId,{errMsg:"setScreenBrightness:ok"})},getScreenBrightness:function(e){Sn(e.data.callbackId,{errMsg:"getScreenBrightness:ok",value:Io})},setKeepScreenOn:function(e){const t=e.data;JSON.parse(t.inputParams).keepScreenOn,Sn(t.callbackId,{errMsg:"setKeepScreenOn:ok"})},getsmallappinfo:function(e){let t=e.data,n=t.type,a=t.callbackId,o=new Bn("getsmallappinfo",Fn.OK);const r=window.__projectConfig__,i=r.projectname,s=void 0===i?"":i,c=r.appid,l=void 0===c?"":c,d=r.appicon,u=void 0===d?"":d;o=_o(_o({},o),{},{appId:l,name:s,appIcon:u}),Pn(n)(a,o,1)},getAuthCode:function(e){let t=e.data,n=t.type,a=t.callbackId;const o=_o(_o({},new Bn("getAuthCode",Fn.OK)),{},{authCode:So.authCode});Pn(n)(a,o)},getOpenUserInfo:function(e){let t=e.data,n=t.type,a=t.callbackId;const o=_o(_o({},new Bn("getOpenUserInfo",Fn.OK)),So.userInfo);Pn(n)(a,o)},openBluetoothAdapter:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("openBluetoothAdapter",Fn.OK))},closeBluetoothAdapter:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("closeBluetoothAdapter",Fn.OK))},startBluetoothDevicesDiscovery:function(e){let t=e.data,n=t.type,a=t.callbackId,o=t.webviewId;Pn(n)(a,new Bn("startBluetoothDevicesDiscovery",Fn.OK)),mn(n,tn.ON_BT_DEVICE_FOUND,o,{devices:Po.devices})},stopBluetoothDevicesDiscovery:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("stopBluetoothDevicesDiscovery",Fn.OK))},createBLEConnection:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("createBLEConnection",Fn.OK))},closeBLEConnection:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("closeBLEConnection",Fn.OK))},getBLEDeviceServices:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,Object.assign(new Bn("getBLEDeviceServices",Fn.OK),{services:Po.services}))},getBLEDeviceCharacteristics:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,Object.assign(new Bn("getBLEDeviceCharacteristics",Fn.OK),{characteristics:Po.characteristics}))},readBLECharacteristicValue:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("readBLECharacteristicValue",Fn.OK))},writeBLECharacteristicValue:function(e){let t=e.data,n=t.type,a=t.callbackId;Pn(n)(a,new Bn("writeBLECharacteristicValue",Fn.OK))}};window.wsClientMap={};function Ao(){return window.wsClientMap.global_client}const No={connectSocket:function(e){if(Ao())return;const t=e.data;try{const e=JSON.parse(null==t?void 0:t.inputParams)||{},n=new WebSocket(e.url,e.protocols);n.onopen=e=>function(e,t){gn("service/service",{event:tn.ON_SOCKET_OPEN,isNative:true,paramsString:JSON.stringify({header:e.header})}),null!=t&&t.callbackId&&gn("service/service",{callbackId:t.callbackId,invokeStatusCode:0,outputParams:{data:JSON.stringify({errMsg:"connectSocket success"})}})}(e,t),n.onclose=e=>function(e){gn("service/service",{event:tn.ON_SOCKET_CLOSE,isNative:!0,paramsString:JSON.stringify({code:e.code,reason:e.reason})})}(e),n.onmessage=e=>function(e){gn("service/service",{event:tn.ON_SOCKET_MESSAGE,isNative:!0,paramsString:JSON.stringify({data:e.data})})}(e),n.onerror=e=>function(e,t){gn("service/service",{event:tn.ON_SOCKET_ERROR,isNative:!0,paramsString:JSON.stringify({errMsg:"connect webSocket error"})});const n=1;null!=t&&t.callbackId&&gn("service/service",{callbackId:t.callbackId,invokeStatusCode:n,outputParams:{errMsg:"connect webSocket error"}})}(0,t),window.wsClientMap.global_client=n}catch(e){const n=1;null!=t&&t.callbackId&&gn("service/service",{callbackId:t.callbackId,invokeStatusCode:n,outputParams:{errMsg:e.message}})}},closeSocket:function(e){const t=Ao();if(!t)return;const n=e.data;try{const e=JSON.parse(null==n?void 0:n.inputParams)||{},a=e.code,o=e.reason;t.close(a,o),null!=n&&n.callbackId&&gn("service/service",{callbackId:n.callbackId,invokeStatusCode:0,outputParams:{data:JSON.stringify({errMsg:"closeSocket success"})}}),window.wsClientMap.global_client=void 0}catch(e){const t=1;null!=n&&n.callbackId&&gn("service/service",{callbackId:n.callbackId,invokeStatusCode:t,outputParams:{errMsg:e.message}})}},sendSocketMessage:function(e){const t=Ao(),n=e.data;if(t&&1===t.readyState)try{var a;const e=JSON.parse(null==n?void 0:n.inputParams)||{};if(null!=n&&n.callbackId&&0===(null==e||null===(a=e.data)||void 0===a?void 0:a.length))return void gn("service/service",{callbackId:n.callbackId,invokeStatusCode:1,outputParams:{errMsg:"Message data cannot be empty"}});t.send(e.data),null!=n&&n.callbackId&&gn("service/service",{callbackId:n.callbackId,invokeStatusCode:0,outputParams:{data:JSON.stringify({errMsg:"sendmessage success"})}})}catch(e){const t=1;null!=n&&n.callbackId&&gn("service/service",{callbackId:n.callbackId,invokeStatusCode:t,outputParams:{errMsg:e.message}})}else null!=n&&n.callbackId&&gn("service/service",{callbackId:n.callbackId,invokeStatusCode:1,outputParams:{errMsg:"Failed to send message, socket not connected"}})}};function ko(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Co=Xn.getInstance(),Ro={async getDuration(e){const t=new FileReader;return t.readAsArrayBuffer(e),new Promise((e=>{t.onloadend=t=>{let n=t.target.result;(new AudioContext).decodeAudioData(n,(t=>{const n=1e3*t.duration;e(n)}))}}))},uploadTempFile(e,t){const n=new FormData;n.append("customName",t),n.append("files",e);return Qt.post("/tmp",n,{headers:{"Content-Type":"multipart/form-data"}})}};class Mo{constructor(){ko(this,"MIME_TYPES",{AAC:"audio/aac",WEBM:"audio/webm"}),ko(this,"RECORD_STATES",{INACTIVE:"inactive",RECORDING:"recording",PAUSED:"paused"}),ko(this,"OPS",{START:"start",PAUSE:"pause",RESUME:"resume",STOP:"stop",HIDE:"hide"}),ko(this,"CONFIGS",{API_NAME:"operateRecorder",STATES:{[this.OPS.START]:[this.RECORD_STATES.INACTIVE],[this.OPS.PAUSE]:[this.RECORD_STATES.RECORDING],[this.OPS.RESUME]:[this.RECORD_STATES.PAUSED],[this.OPS.STOP]:[this.RECORD_STATES.RECORDING,this.RECORD_STATES.PAUSED]}}),ko(this,"ERR_MESSAGES",{[this.OPS.START]:"recorder is not idle, can't start",[this.OPS.PAUSE]:"recorder is not recording, can't pause",[this.OPS.RESUME]:"recorder is not paused, can't resume",[this.OPS.STOP]:"recorder is currently idle, can't stop",[this.OPS.HIDE]:"recorder page is unavailable",MAP:new Map([["Permission denied",new ga("You do not have the microphone permission. Enable the microphone permission and try again")]])}),ko(this,"instance",void 0),ko(this,"timer",void 0),ko(this,"timestamp",void 0),ko(this,"options",{}),ko(this,"audioData",[]),ko(this,"mediaRecorder",{})}static getInstance(){return this.instance||(this.instance=new Mo),this.instance}async start(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.MIME_TYPES,n=t.AAC,a=t.WEBM,o=this.ERR_MESSAGES;try{this.validateStart();const t=e.duration,o=void 0===t?6e4:t,r=e.numberOfChannels,i=void 0===r?2:r,s=e.sampleRate,c=void 0===s?8e3:s,l=e.encodeBitRate,d=void 0===l?48e3:l,u=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:c,channelCount:i}}),p={mimeType:MediaRecorder.isTypeSupported(n)?n:a,audioBitsPerSecond:d},f=new MediaRecorder(u,p);this.timestamp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const t=["month","day","hour","minute","second"].reduce(((e,t)=>(e[t]="2-digit",e)),{});t.year="numeric";const n=e.toLocaleString(navigator.languages,t);return n.replace(/[^0-9]/g,"")}(),this.options=p,this.bindListeners(f),this.timer=new ha(f,f.stop,o),this.mediaRecorder=f,this.mediaRecorder.start()}catch(e){var r;const t=e.message,n=null!==(r=o.MAP.get(t))&&void 0!==r?r:e;this.onRecorderError({error:n})}}validateStart(){let e=this.mediaRecorder,t=this.ERR_MESSAGES,n=this.CONFIGS,a=this.OPS;if(null!=e&&e.state&&!n.STATES[a.START].includes(null==e?void 0:e.state))throw new ga(t[a.START])}bindListeners(e){e.onstart=this.onRecorderStart,e.onpause=this.onRecorderPause,e.onresume=this.onRecorderResume,e.onstop=this.onRecorderStop,e.onerror=this.onRecorderError,e.ondataavailable=e=>{let t=e.data;this.audioData.push(t)}}operate(e){try{const t=this.mediaRecorder,n=this.ERR_MESSAGES;if(!this.CONFIGS.STATES[e].includes(null==t?void 0:t.state))throw new ga(n[e]);t[e]()}catch(e){this.onRecorderError({error:e})}}pause(){this.operate(this.OPS.PAUSE)}resume(){this.operate(this.OPS.RESUME)}stop(){this.operate(this.OPS.STOP)}onRecorderPause(){Mo.getInstance().timer.pause(),An(tn.ON_RECORD_PAUSE)}onRecorderResume(){Mo.getInstance().timer.resume(),An(tn.ON_RECORD_RESUME)}onAppHide(){const e=Mo.getInstance();let t=e.ERR_MESSAGES,n=e.OPS;const a=new ga(t[n.HIDE]);e.stop(),e.onRecorderError({error:a})}onRecorderStart(){const e=Mo.getInstance();e.timer.start(),Co.once(tn.ON_APP_HIDE,e.onAppHide),Co.once(tn.ON_APP_ROUTE,e.onAppHide),An(tn.ON_RECORD_START)}async onRecorderStop(){const e=Mo.getInstance();try{Co.off(tn.ON_APP_HIDE,e.onAppHide),Co.off(tn.ON_APP_ROUTE,e.onAppHide),e.timer.clear();const t=e.timestamp,n=e.options.mimeType,a=new Blob(e.audioData,{type:n});e.audioData=[];const o=new File([a],"".concat(t,".aac"),{type:n}),r=await Ro.uploadTempFile(o,t),i="".concat(nn.envConfigs.tmp.env).concat(r.data.fileName[0]),s=await Ro.getDuration(o),c=o.size;An(tn.ON_RECORD_STOP,{tempFilePath:i,duration:s,fileSize:c})}catch(t){e.onRecorderError({error:t})}}onRecorderError(e){let t=e.error;const n=t.message,a=Mo.getInstance().CONFIGS.API_NAME,o=new Bn(a,Fn.FAIL,t instanceof ga?n:"");An(tn.ON_RECORD_ERROR,o)}}const Do={startRecord:async function(e){let t=e.data;const n=JSON.parse(t.inputParams);Mo.getInstance().start(n)},pauseRecord:function(){Mo.getInstance().pause()},resumeRecord:function(){Mo.getInstance().resume()},stopRecord:function(){Mo.getInstance().stop()}};function Lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Bo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lo(Object(n),!0).forEach((function(t){xo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class jo{constructor(e){xo(this,"locationIndicatorProps",{color:"#3065f7",size:16}),this.mapId=e.mapId,this.webviewIdList=e.webviewIdList,this.webviewId=e.webviewIdList[0],this.options=e,this.locationIndicator=[],this.markers=[],this.polyline=[],this.circles=[],this.showLocation=!1,this.init()}init(){this.initMap(),this.updateMap(this.options),this.bindMapClickEv()}initMap(){var e;const t=google.maps,n=t.Map,a=t.LatLng,o=this.options,r=o.latitude,i=o.longitude,s=o.scale,c=void 0===s?16:s,l=ln(this.webviewId),d=l.contentDocument,u=null===(e=d.getElementsByTagName("ma-map"))||void 0===e?void 0:e[0],p=d.createElement("div");p.style.cssText="width: 100%; height: 100%",u.shadowRoot.appendChild(p);const f={center:new a(r,i),zoom:Math.max(Math.min(c,20),3)};this.map=new n(p,f),this.targetWebview=l,this.pagePath=l.contentWindow.__route__}updateMap(e){const t=e.longitude,n=e.latitude,a=e.scale,o=e.markers,r=e.polyline,i=e.circles,s=e.includePoints,c=e.showLocation;a&&this.setScale(Math.max(Math.min(a,20),3)),(t||n)&&this.moveCenter({lng:t,lat:n}),!1===c&&this._removeMapItems(this.locationIndicator),!0===c&&ma({scope:$n.LOCATION,success:e=>{let t=e.latitude,n=e.longitude;const a=this.locationIndicatorProps,o=a.color,r=a.size;this.moveCenter({lng:n,lat:t}),this._removeMapItems(this.locationIndicator),this.addCircle(this.locationIndicator,{latitude:t,longitude:n,color:o,fillColor:o,radius:r})}}),void 0!==c&&(this.showLocation=c),o&&this.addMarkers(this.markers,o,!0),r&&(this._removeMapItems(this.polyline),this.addPolylines(r)),i&&(this._removeMapItems(this.circles),this.addCircles(i)),s&&this.includeThePoints(s)}setScale(e){this.map.moveCamera({zoom:e})}moveCenter(e){const t=this.map.getCenter(),n=e.lat,a=void 0===n?t.lat():n,o=e.lng,r=void 0===o?t.lng():o;this.map.moveCamera({center:{lat:a,lng:r}})}addMarkers(e,t,n){const a=google.maps,o=a.Marker,r=a.LatLng,i=a.Size,s=this.map;!0===n&&this._removeMapItems(e);const c=t.filter((e=>{let t=e.iconPath;return void 0===t||this._transformIconPath(t)})).map((e=>{let t=e.id,n=e.longitude,a=e.latitude,c=e.title,l=e.iconPath,d=e.height,u=void 0===d?0:d,p=e.width,f=void 0===p?0:p;const m=new o({map:s,id:t,position:new r(a,n),title:c,icon:{url:this._transformIconPath(l),scaledSize:f*u?new i(f,u):void 0}});return this.bindMarkerClickEv(m),m}));e.push(...c)}removeMarkers(e){const t=this.markers.filter((t=>e.includes(t.id)));this._setMapOnAll(t,null),this.markers=this.markers.filter((t=>!e.includes(t.id)))}addPolylines(e){for(let t of e)this.addPolylineItem(t)}addPolylineItem(e){const t=google.maps.LatLng,n=e.colorList,a=e.points,o=e.width;if(null!=n&&n.length){const e=new Array(a.length-1).fill(0).map(((e,t)=>{var a;return null!==(a=n[t])&&void 0!==a?a:n.at(-1)}));for(let n=0;n<e.length;n++){const r=new t(a[n].latitude,a[n].longitude),i=new t(a[n+1].latitude,a[n+1].longitude);this.addPolyline({path:[r,i],color:e[n],width:o})}}else this.addPolyline(Bo(Bo({},e),{},{path:e.points.map((e=>({lat:e.latitude,lng:e.longitude})))}))}addPolyline(e){let t=e.path,n=e.color,a=e.width;const o=new(0,google.maps.Polyline)({path:t,strokeColor:n,strokeWeight:a,map:this.map});this.polyline.push(o)}addCircles(e){for(let t of e)this.addCircle(this.circles,t)}addCircle(e,t){let n=t.latitude,a=t.longitude,o=t.radius,r=t.fillColor,i=t.color,s=void 0===i?"#000000":i;const c=new(0,google.maps.Circle)({map:this.map,center:{lat:n,lng:a},radius:o,fillOpacity:r?1:0,strokeOpacity:1,fillColor:r,strokeColor:s});e.push(c)}bindMapClickEv(){const e=google.maps.event,t=this.webviewId,n={event:tn.ON_MAP_TAP,webviewId:t,isNative:!0},a=this.mapId;e.addListener(this.map,"click",(e=>{var o;let r=e.latLng;const i={mapId:a,latitude:r.lat(),longitude:r.lng()};n.paramsString=JSON.stringify(i),gn(t,n),null===(o=this.activeInfoWindow)||void 0===o||o.close()}))}bindMarkerClickEv(e){const t=google.maps,n=t.event,a=t.InfoWindow,o=this.webviewId,r={event:tn.ON_MAP_MARKER_TAP,webviewId:o,isNative:!0},i=this.mapId;return n.addListener(e,"click",(()=>{var t,n;const s={mapId:i,markerId:null!==(t=e.id)&&void 0!==t?t:""};if(r.paramsString=JSON.stringify(s),gn(o,r),null===(n=this.activeInfoWindow)||void 0===n||n.close(),e.title){const t=new a({content:e.title});t.open(e.get("map"),e),this.activeInfoWindow=t}})),!0}includeThePoints(e){if(null==e||!e.length)return;const t=e.map((e=>e.longitude)),n=e.map((e=>e.latitude)),a=Math.max(...t),o=Math.min(...t),r=Math.max(...n),i=Math.min(...n);this.map.fitBounds({east:a,west:o,north:r,south:i},0)}_setMapOnAll(e,t){for(let n=0;n<e.length;n++)e[n].setMap(t)}_removeMapItems(e){this._setMapOnAll(e,null),e.length=0}_transformIconPath(e){if(!e||/^(http|https):\/\/.*/i.test(e))return;const t=e.split("/").filter((e=>e&&"."!==e)),n=this.pagePath.split("/");n.pop();for(let e of t)".."===e?n.pop():n.push(e);return"/".concat(n.join("/"))}}const Fo=new Map([]),Uo={async insertMap(e){let t=e.data;try{const e=window.__simulatorConfig__.thirdPartyAuth.googleMapApiKey,n=JSON.parse(t.inputParams),a=new ba({interval:1e3,maxLoopTimes:60,handler:t=>(!e||window.__mapSimulate__.isScriptInjected)&&t(a.stop())});if(await a.loop(),!e||window.__mapSimulate__.isApiKeyInvalid)return Cn(t,n,new Bn("insertMap",Fn.FAIL,"google map's API key is invalid.").errMsg);const o=new jo(n);return Fo.set(n.mapId,o),kn(t,n,new Bn("insertMap",Fn.OK).errMsg)}catch(e){return Cn(t,params,new Bn("insertMap",Fn.FAIL).errMsg)}},updateMap(e){let t=e.data.inputParams;try{const e=JSON.parse(t),n=Fo.get(e.mapId),a=["position","mapId","webviewIdList"];Object.keys(e).filter((e=>!a.includes(e))).length&&n.updateMap(e)}catch(e){}},removeMap(e){let t=e.data,n=t.callbackId,a=t.inputParams;const o=JSON.parse(a);Fo.has(o.mapId)?(Fo.delete(o.mapId),Sn(n,new Bn("removeMap",Fn.OK))):In(n,new Bn("removeMap",Fn.FAIL))},addMarkers(e){let t=e.data,n=t.callbackId,a=t.inputParams;try{const e=JSON.parse(a),t=Fo.get(e.mapId);t.addMarkers(t.markers,e.markers,e.clear),Sn(n,new Bn("addMarkers",Fn.OK))}catch(e){In(n,new Bn("addMarkers",Fn.FAIL))}},removeMarkers(e){let t=e.data,n=t.callbackId,a=t.inputParams;try{const e=JSON.parse(a);Fo.get(e.mapId).removeMarkers(e.markerIds),Sn(n,new Bn("removeMarkers",Fn.OK))}catch(e){In(n,new Bn("removeMarkers",Fn.FAIL))}},moveToLocation(e){let t=e.data,n=t.callbackId,a=t.inputParams;const o=JSON.parse(a),r=Fo.get(o.mapId);return void 0!==o.latitude||void 0!==o.longitude?(r.moveCenter({lat:o.latitude,lng:o.longitude}),Sn(n,new Bn("moveToLocation",Fn.OK))):r.showLocation?ma({scope:$n.LOCATION,success:e=>{let t=e.latitude,a=e.longitude;r.moveCenter({lat:t,lng:a}),Sn(n,new Bn("moveToLocation",Fn.OK))},fail:()=>{In(n,new Bn("moveToLocation",Fn.FAIL,"location authorization denied"))}}):In(n,new Bn("moveToLocation",Fn.FAIL,"showLocation need to be true"))}};const Ho={deauthorize:function(e){let t=e.data,n=t.type,a=t.callbackId;for(const e of Object.values($n))localStorage.removeItem(e);const o=new Bn("deauthorize",Fn.OK);Pn(n)(a,o)},cancelAuthorize:function(e){let t=e.data,n=t.callbackId,a=t.type,o=t.inputParams;const r=JSON.parse(o);for(const e of r.scopes)localStorage.removeItem(e);const i=new Bn("cancelAuthorize",Fn.OK);Pn(a)(n,i)}};function Vo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,o,r,i,s=[],c=!0,l=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=r.call(n)).done)&&(s.push(a.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Go(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Go(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Go(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function Wo(e,t,n){const a=e.querySelector(".maui-badge");a&&a.remove();const o=document.createElement("span");o.className="maui-badge ".concat(t),o.style.position="absolute",o.style.top="0px",o.style.left="16px",void 0!==n&&(o.textContent=n);const r=Vo(e.getElementsByClassName("tabbar-icon"),1)[0],i=Vo(e.getElementsByClassName("tabbar-label"),1)[0],s=document.createElement("span");s.style.position="relative",s.style.display="inline-block";const c=r.cloneNode(!0);s.appendChild(c),s.appendChild(o),e.insertBefore(s,i),r.remove()}window._close=function(){document.getElementsByClassName("ma-actionsheet")[0].remove(),document.getElementById("macle-dialog-container").style.display="none"};const Jo={showTabBar:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"showTabBar:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=Vo(document.getElementsByClassName("tabbar-root"),1)[0];n.style.display="block",t.animation?(n.classList.remove("tabbar-bottom-hide"),n.classList.add("tabbar-bottom-show")):n.classList.remove("tabbar-bottom-hide"),e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"showTabBar:ok"})},hideTabBar:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"hideTabBar:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=Vo(document.getElementsByClassName("tabbar-root"),1)[0];t.animation?(n.classList.remove("tabbar-bottom-show"),n.classList.add("tabbar-bottom-hide")):n.style.display="none",e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"hideTabBar:ok"})},setTabBarStyle:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"setTabBarStyle:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=document.getElementsByClassName("tabbar")[0],a=document.getElementsByClassName("tabbar-item-on")[0],o=document.getElementsByClassName("tabbar-label");if(t.color){__maConfig__.tabBar.color=t.color;for(let e=0;e<o.length;e++)o[e].style.color=t.color}t.selectedColor&&(a.getElementsByClassName("tabbar-label")[0].style.color=t.selectedColor,__maConfig__.tabBar.selectedColor=t.selectedColor),t.backgroundColor&&(n.style.backgroundColor=t.backgroundColor,__maConfig__.tabBar.backgroundColor=t.backgroundColor),t.borderStyle&&(n.style.borderTopColor=t.borderStyle,__maConfig__.tabBar.borderStyle=t.borderStyle),e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"setTabBarStyle:ok"})},setTabBarItem:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"setTabBarItem:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=document.getElementsByClassName("tabbar-item");if(t.index>n.length-1){const t=new Bn("setTabBarItem",Fn.FAIL,"parameter error: parameter index is out of range");return void In(e.data.callbackId,t)}const a=n[t.index];if(t.text&&(a.getElementsByClassName("tabbar-label")[0].innerHTML=t.text,__maConfig__.tabBar.list[t.index].text=t.text),t.iconPath){const e=Dn(t.iconPath),n=new Image;n.src=e,n.onload=function(){const e=Sa.getBase64Image(n);a.getElementsByClassName("tabbar-icon")[0].src=e,__maConfig__.tabBar.list[t.index].iconData=e.split(",")[1]}}if(t.selectedIconPath){const e=Dn(t.selectedIconPath),n=new Image;n.src=e,n.onload=function(){const e=Sa.getBase64Image(n);a.classList.contains("tabbar-item-on")&&(a.getElementsByClassName("tabbar-icon")[0].src=e),__maConfig__.tabBar.list[t.index].selectedIconData=e.split(",")[1]}}e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"setTabBarItem:ok"})},showTabBarRedDot:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"showTabBarRedDot:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=document.getElementsByClassName("tabbar-item");if(!Number.isInteger(t.index)||t.index<0||t.index>n.length-1){const t=new Bn("showTabBarRedDot",Fn.FAIL,"parameter error: parameter index is out of range");return void In(e.data.callbackId,t)}Wo(n[t.index],"maui-badge_dot",void 0),e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"showTabBarRedDot:ok"})},hideTabBarRedDot:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"hideTabBarRedDot:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=document.getElementsByClassName("tabbar-item");if(t.index>n.length-1){const t=new Bn("hideTabBarRedDot",Fn.FAIL,"parameter error: parameter index is out of range");return void In(e.data.callbackId,t)}const a=n[t.index].getElementsByClassName("maui-badge")[0];a&&a.parentNode.removeChild(a),e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"hideTabBarRedDot:ok"})},setTabBarBadge:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"setTabBarBadge:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=document.getElementsByClassName("tabbar-item");if(t.index<0||t.index>n.length-1){const t=new xn("setTabBarBadge",Fn.FAIL,jn.Errno(Qn,ta,ia),"parameter error: parameter.index value not legal, please check it.");return void In(e.data.callbackId,t)}if(!Number.isInteger(t.index)){const t=new xn("setTabBarBadge",Fn.FAIL,jn.Errno(Qn,ta,ra),"parameter error: parameter.index type not legal, please check it.");return void In(e.data.callbackId,t)}if(""===t.text){const t=new xn("setTabBarBadge",Fn.FAIL,jn.Errno(Qn,ta,ia),"parameter error: parameter.text value not legal, please check it.");return void In(e.data.callbackId,t)}const a=n[t.index],o=t.text;Wo(a,"maui-badge_text",Sa.titleLength(o)>4?"...":o),e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"setTabBarBadge:ok"})},removeTabBarBadge:function(e){if(!Sa.isTabBarPage())return void In(e.data.callbackId,{errMsg:"removeTabBarBadge:fail not TabBar page"});const t=JSON.parse(e.data.inputParams),n=document.getElementsByClassName("tabbar-item");if(t.index<0||t.index>n.length-1){const t=new xn("setTabBarBadge",Fn.FAIL,jn.Errno(Qn,ta,ia),"parameter error: parameter.index value not legal, please check it.");return void In(e.data.callbackId,t)}if(!Number.isInteger(t.index)){const t=new xn("setTabBarBadge",Fn.FAIL,jn.Errno(Qn,ta,ra),"parameter error: parameter.index type not legal, please check it.");return void In(e.data.callbackId,t)}const a=n[t.index].getElementsByClassName("maui-badge")[0];a&&a.parentNode.removeChild(a),e.data.callbackId&&Sn(e.data.callbackId,{errMsg:"removeTabBarBadge:ok"})}};function Ko(e){const t=e.title||e.message||"",n=e.duration||1500,a=document.createElement("div");a.innerHTML='\n <div id="macleToast">\n <div id="toastMask" class="macle-transparent-mask" style="display:'.concat(e.mask?"block":"none",'"></div>\n <div id="macleToastContent" class="toast">\n <p class="toast-content">').concat(t,"</p>\n </div>\n </div>\n "),document.body.appendChild(a),setTimeout((()=>{a.remove()}),n)}function zo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Yo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zo(Object(n),!0).forEach((function(t){qo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xo={setClipboardData:function(e){const t=e.data,n=JSON.parse(t.inputParams);if(!navigator.clipboard||!navigator.clipboard.writeText){const e=new Bn(tn.SET_CLIPBOARD_DATA,Fn.FAIL,"The current browser does not support this API.");return void In(t.callbackId,e)}navigator.clipboard.writeText(n.data).then((()=>{Ko({title:"Content copied",duration:1500});const e=new Bn(tn.SET_CLIPBOARD_DATA,Fn.OK);t.callbackId&&("legacy"===t.type?un(t.callbackId,Yo({},e),1):Sn(t.callbackId,e))})).catch((()=>{const e=new Bn(tn.SET_CLIPBOARD_DATA,Fn.FAIL);t.callbackId&&("legacy"===t.type?pn(t.callbackId,Yo({},e),1):In(t.callbackId,e))}))},getClipboardData:function(e){const t=e.data;if(!navigator.clipboard||!navigator.clipboard.readText){const e=new Bn(tn.GET_CLIPBOARD_DATA,Fn.FAIL,"The current browser does not support this API.");return void In(t.callbackId,e)}navigator.clipboard.readText().then((e=>{Ko({title:"The miniprogram has read the content of your clipboard.",duration:1500});const n=new Bn(tn.GET_CLIPBOARD_DATA,Fn.OK);t.callbackId&&("legacy"===t.type?un(t.callbackId,Yo(Yo({},n),{},{data:e})):Sn(t.callbackId,Yo(Yo({},n),{},{data:e})))})).catch((()=>{const e=new Bn(tn.GET_CLIPBOARD_DATA,Fn.FAIL);t.callbackId&&("legacy"===t.type?pn(t.callbackId,Yo({},e),1):In(t.callbackId,e))}))}};function $o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function Zo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$o(Object(n),!0).forEach((function(t){Qo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qo(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const er={getSetting:function(e){const t=e.data,n=Object.values($n),a={};for(const e of Object.keys(localStorage))if(n.includes(e)){const t=localStorage.getItem(e);a[e]=t}const o=new Bn(tn.GET_PERMISSION_SETTING,Fn.OK);t.callbackId&&("legacy"===t.type?un(t.callbackId,Zo({authSetting:a},o),1):Sn(t.callbackId,Zo({authSetting:a},o)))},authorize:function(e){let t=e.data,n=t.callbackId,a=t.type,o=t.inputParams;const r=JSON.parse(o);n&&ma({scope:r.scope,success:()=>{Pn(a)(n,{errMsg:"permission authorize allow"})},fail:()=>{Tn(a)(n,{errMsg:"permission authorize deny"})}})}};function tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(n),!0).forEach((function(t){ar(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ar(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function or(){let e=function(e){const t=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)"),"i"),n=window.location.search.substr(1).match(t);return null!==n?unescape(n[2]):null}("entryPagePath");null===e&&(e=__maConfig__.entryPagePath.split(".html")[0]);const t=On(e);window.ipcRenderer&&window.ipcRenderer.sendToHost("cur-page-res",e);const n=t.getAttribute("id");window.navigatorPages=[{path:e,webviewId:n}],Wn(e),Gn(__maConfig__.global.window.navigationBarTitleText,__maConfig__.global.window.navigationBarBackgroundColor,__maConfig__.global.window.navigationBarTextStyle),Jn(e),__maConfig__.tabBar&&__maConfig__.tabBar.list.length&&function(e,t){let n='<div class="tabbar-root"><div class="tabbar jshook-ws-tabbar">';e.list.forEach((a=>{const o=a.iconData,r=a.selectedIconData;let i=o,s="",c="tabbar-item jshook-ws-tabbar-item";const l=a.pagePath.replace(/\.htm[^\.]*$/,"");l===t&&(s='style="color: '.concat(e.selectedColor,'"'),i=r,c="tabbar-item jshook-ws-tabbar-item tabbar-item-on"),i="data:image/png;base64,".concat(i),n+='\n <div class="'.concat(c,'" \n onclick="clickTabbar(\'').concat(l,"')\" \n id='tabbar-").concat(l,'\'>\n <img class="tabbar-icon" src="').concat(i,'" icon="" select-icon="" alt="" />\n <p class="tabbar-label" ').concat(s,">").concat(a.text,'\n <i class="tabbar-label-indicator"></i>\n </p>\n </div>\n ')})),n+="</div></div>";const a=document.createElement("div");a.innerHTML=n,document.body.appendChild(a.childNodes[0])}(__maConfig__.tabBar,e),zn(e)}const rr=nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr(nr({serviceReady:function(){document.getElementsByTagName("iframe")[0].contentWindow.__maConfig__=window.__maConfig__,or(),Yn.onCheckForUpdate(),Yn.onUpdate()},domContentLoaded:function(e){const t=e.source,n=t.frameElement.getAttribute("id"),a=t.frameElement.getAttribute("path");let o={};t.location.search&&(o=function(e){const t={},n=("?"===e[0]?e.substr(1):e).split("&");for(let e=0;e<n.length;e++){const a=n[e].split("=");t[decodeURIComponent(a[0])]=decodeURIComponent(a[1]||"")}return t}(t.location.search));const r={openType:"appLaunch",query:o,path:a,pageStack:navigatorPages};gn("service/service",{event:tn.ON_APP_ROUTE,webviewId:n,isNative:!0,paramsString:JSON.stringify(r)}),function(){let e=!1;const t=Rn(),n="".concat(t.path,".html"),a=__maConfig__.page[n].window.enablePullDownRefresh;e=__maConfig__.global.window.enablePullDownRefresh||a;const o=t.webviewId;if(e){let e,n,a,r;document.getElementById(o).contentWindow.addEventListener("touchstart",(t=>{e=t.touches[0].pageX,n=t.touches[0].pageY})),document.getElementById(o).contentWindow.addEventListener("touchmove",(e=>{r=e.touches[0].pageY;const t=r-n;let a=Math.max(t,100);a<=10&&(a=0),document.getElementById("body").style.transform="translateY(".concat(a,"px)"),document.getElementById("body").style.transition="all ease 0.5s"})),document.getElementById(o).contentWindow.addEventListener("touchend",(e=>{if(a=e.changedTouches[0].pageY,a-n>50){document.getElementById("body").style.transform="translateY(50px)",document.getElementById("body").style.transition="all ease 0.5s";const e=t.webviewId;gn("service/service",{event:tn.ON_PULL_DOWN_REFRESH,webviewId:e,isNative:!0}),setTimeout((()=>{document.getElementById("body").style.removeProperty("transform")}),2e3)}else document.getElementById("body").style.removeProperty("transform")}))}}()},maclePerformanceLog:function(e){const t=JSON.parse(e.data.inputParams);console.log("".concat(t.type," : ").concat(t.eventName," ").concat(t.path," timestamp ").concat(t.timestamp))},macleCustomLog:function(e){const t=JSON.parse(e.data.inputParams);console.log("".concat(t.level," : ").concat(t.log))},macleErrorLog:function(e){const t=JSON.parse(e.data.inputParams);console.log("".concat(t.key," : ").concat(t.errorStack," timestamp ").concat(t.timestamp))},memoryWarning:function(e){const t={level:e.data.inputParams.level};gn("service/service",{event:tn.ON_MEMORY_WARNING,isNative:!0,paramsString:JSON.stringify(t)})},networkStatusChange:function(e){const t=e.data.inputParams.type;let n=!0;"none"===t&&(n=!1);const a={isConnected:n,networkType:t};gn("service/service",{event:tn.ON_NETWORK_STATUS_CHANGE,isNative:!0,paramsString:JSON.stringify(a)})}},Yn),rn),da),Ea),Pa),Ma),Fa),Wa),$a),uo),go),vo),To),wo),No),Do),Uo),Ho),Jo),Xo),er);function ir(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function sr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const cr=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(n),!0).forEach((function(t){sr(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},{startPay:function(e){const t=e.data;if(t.callbackId){const e=0;gn("service/service",{callbackId:t.callbackId,invokeStatusCode:e,outputParams:{data:{status:0}}})}},getKbzBackendServerUrl:function(e){const t=e.data;if(t.callbackId){const e=0;gn("service/service",{callbackId:t.callbackId,invokeStatusCode:e,outputParams:{url:window.__simulatorConfig__.api.getKbzBackendServerUrl}})}},getKBZPayToken:function(e){const t=e.data;if(t.callbackId){const e=0;gn("service/service",{callbackId:t.callbackId,invokeStatusCode:e,outputParams:{token:"xxxx"}})}}});let lr="";const dr=Xn.getInstance();window.clickTabbar=function(e){ln("tabbar-".concat(e)).classList.add("tabbar-item-on");const t=Rn().path;ln("tabbar-".concat(t)).classList.remove("tabbar-item-on");const n={inputParams:JSON.stringify({url:"".concat(e,".html")})};rr.switchTab({data:n})},window.goToPage=function(e){const t={inputParams:JSON.stringify({url:e})};bn(e.split(".html")[0])?rr.switchTab({data:t}):rr.navigateTo({data:t})},window.goBackHome=function(){window.goToPage(window.__maConfig__.entryPagePath)},window.goBackPage=function(){const e={inputParams:JSON.stringify({delta:1})};rr.navigateBack({data:e})},window.onAppShow=function(){rr.onAppShow()},window.searchApp=function(){const e=ln("searchApp").value,t=lr||"";rr.searchApp(e,t)},window.clickHis=function(){ln("his").setAttribute("class","tag choose");ln("cloud").setAttribute("class","tag"),lr=""},window.clickCloud=function(){ln("his").setAttribute("class","tag");ln("cloud").setAttribute("class","tag choose"),lr=""},window.downloadApp=function(){const e=ln("searchApp").value;rr.searchApp(e)},window.onAppHide=function(){dr.emit(tn.ON_APP_HIDE),rr.onAppHide()},window.onScreenLock=function(){rr.setCustomEvent("lockScreen")};var ur=n(277);function pr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,o,r,i,s=[],c=!0,l=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(a=r.call(n)).done)&&(s.push(a.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}class mr{constructor(e,t){this.webviewWindow=e,this.webviewDocument=t}initService(){this.initStyles(),this.initCommonVars(),this.initViewLayerNative(),this.initGlobal(),this.initSimulatorKit(),this.initCommonFunc(),this.initMessageListener()}initStyles(){const e=this.webviewDocument;function t(t){const n=e.createElement("style");n.type="text/css",e.getElementsByTagName("head")[0].appendChild(n),n.appendChild(e.createTextNode(t))}t("html { overflow: overlay; }"),t("::-webkit-scrollbar { width: 2px; height: 0px; display: none; }"),t("::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 5px rgb(0 0 0 / 20%); \n background: #eeeeee; }"),t("::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgb(0 0 0 / 0%); border-radius: 10px; }"),t(":hover ::-webkit-scrollbar { display: block; }")}initCommonVars(){const e=this.webviewWindow,t={},n={};for(const t in e.screen.orientation)n[t]=e.screen.orientation[t];for(const a in e.screen)t[a]="orientation"===a?n:e.screen[a];e.screen=t,e.screen.width=e.innerWidth,e.screen.height=e.innerHeight,e.screen.orientation.type="portrait",e.devicePixelRatio=1===e.devicePixelRatio?2:e.devicePixelRatio}initViewLayerNative(){const e=this.webviewWindow,t={notifyLogicLayer:function(t,n,a){const o={event:t,webviewId:n,paramsString:a,targetName:"service/service"};e.parent.postMessage(o,e.parent.location.href)},invoke:function(t,n,a){const o={command:t,inputParams:n,callbackId:a,targetName:"service/service"};e.parent.postMessage(o,e.parent.location.href)},notifyNative:function(t,n){const a={command:t,inputParams:n,targetName:"service/service"};e.parent.postMessage(a,e.parent.location.href)}};e.viewLayerNative=t}initGlobal(){const e=this.webviewWindow,t={webkit:{messageHandlers:{notifyLogicLayer:{postMessage:function(t){t.targetName="service/service",t.webviewId=JSON.parse(t.paramsString).webviewId,e.parent.postMessage(t,e.parent.location.href)}},invoke:{postMessage:function(t){t.targetName="service/service",t.webviewId=JSON.parse(t.inputParams).webviewId,e.parent.postMessage(t,e.parent.location.href)}},notifyNative:{postMessage:function(t){t.targetName="service/service",t.webviewId=JSON.parse(t.inputParams).webviewId,e.parent.postMessage(t,e.parent.location.href)}}}}};e.global=t}initSimulatorKit(){const e=this.webviewWindow,t={messageHandlers:{notifyLogicLayer:{postMessage:function(t){t.targetName="service/service",t.webviewId=JSON.parse(t.paramsString).webviewId,e.parent.postMessage(t,e.parent.location.href)}},invoke:{postMessage:function(t){t.targetName="service/service",t.webviewId=JSON.parse(t.inputParams).webviewId,e.parent.postMessage(t,e.parent.location.href)}},notifyNative:{postMessage:function(t){t.targetName="service/service",t.webviewId=JSON.parse(t.inputParams).webviewId,e.parent.postMessage(t,e.parent.location.href)}}}};e.simulatorWebkit=t}initCommonFunc(){const e=this.webviewWindow;e.parent&&(e.__maConfig__=e.parent.__maConfig__);const t=e.__maConfig__;e.getWebViewId=function(e){let n;if(e.webviewId)n=e.webviewId;else if(e.path)t.pages.forEach(((t,a)=>{t===e.path&&(n=a)}));else if(e.webviewIdList){var a=pr(JSON.parse(e.webviewIdList),1);n=a[0]}else n=0;return n}}initMessageListener(){const e=this.webviewWindow;e.addEventListener("message",(function(t){const n=t.data;n.event?(n.isNative,e.viewLayer.onNotify(n.event,n.webviewIdList,JSON.parse(n.paramsString))):e.viewLayer.onInvokeFinished(n.callbackId,n.invokeStatusCode,n.outputParams)}))}}let gr;function hr(){let e;if(window.__maConfig__.type&&"legacy"===window.__maConfig__.type){!function(){const e=ln("menuButton"),t=ln("body");e.classList.add("nostatus"),t.setAttribute("class","notabbar-frame"),ln("head-tabbar").style.color="white"}(),e=On("h5Entry",window.__maConfig__.entryPagePath);new mr(e.contentWindow,e.contentWindow.document).initService(),e.contentWindow.onload=()=>{const t=e.contentWindow.document.head,n=document.createElement("script"),a=document.createElement("script");a.setAttribute("src","../simulator/service/sync-api.js"),t.appendChild(n),t.appendChild(a),Vn()}}else e=On("service/service");const t=__maAppCode__.subPackages,n=e.contentWindow,a=[];if(t){for(let e=0;e<t.length;e++){const o=t[e].root,r="../../app/".concat(o,"app-service.js"),i=n.document.createElement("script");i.type="text/javascript",i.language="javascript",i.src=r,a.push(i)}n.onload=function(){n.window.ma.env.USER_DATA_PATH=nn.envConfigs.usr.env,a.forEach((e=>{n.document.getElementsByTagName("body")[0].appendChild(e)}))}}}function br(){yr({url:"../simulator/config/config.json",callback:e=>{200===e.status&&(window.__simulatorConfig__=JSON.parse(e.responseText),Qt.defaults.baseURL=window.__simulatorConfig__.axios.baseUrl,function(){const e=window.__simulatorConfig__.statusBar,t=ln("status");e?t.removeAttribute("style","display: block"):t.setAttribute("style","display: none")}(),function(){var e;window.__mapSimulate__={},window.gm_loaded=()=>window.__mapSimulate__.isScriptInjected=!0,window.gm_authFailure=()=>window.__mapSimulate__.isApiKeyInvalid=!0;let t=((null===(e=window.__simulatorConfig__)||void 0===e?void 0:e.thirdPartyAuth)||{}).googleMapApiKey,n=void 0===t?"":t;const a=document.createElement("script");a.src="https://maps.googleapis.com/maps/api/js?key=".concat(n,"&loading=async&callback=gm_loaded"),a.async=!0,document.head.appendChild(a)}())}})}function yr(e){let t=e.url,n=e.callback;const a=new XMLHttpRequest;a.open("get",t),a.withCredentials=!0,a.send(null),a.onload=function(){n(a)}}function vr(){Qt.get("./mockApi.json").then((e=>{200===e.status&&(gr=e.data,gr&&gr.length>0&&function(e){for(const t of e)if(t.enable){const e=Number(t.delayTime)||0;rr[t.apiName]=function(n){setTimeout((()=>{"Remote"===t.mockType?n.data.callbackId&&Nn(n.data.callbackId,t,1,n.data.type):"Success"===t.returnType?n.data.callbackId&&("legacy"===n.data.type?un(n.data.callbackId,JSON.parse(t.returnValue),1):Sn(n.data.callbackId,JSON.parse(t.returnValue))):n.data.callbackId&&("legacy"===n.data.type?pn(n.data.callbackId,JSON.parse(t.returnValue),1):In(n.data.callbackId,JSON.parse(t.returnValue)))}),e)}}}(gr),window.api=new Proxy(rr,{get(e,t){const n=e[t];return e=>{try{n||Hn.warn("The simulator does not support ".concat(t," Api"));const a=JSON.parse(e);a.data.inputParams=JSON.stringify(a.data.inputParams),n&&n(a)}catch(e){throw new Error(e)}}}}))})).catch(Hn.error)}window.genSkeleton=ur.genSkeleton,window.addEventListener("message",(function(e){const t=e.data,n=t.event?t.event:t.command,a=tn[n],o=t.targetName;if(t.event&&t.event!==tn.ON_APP_ROUTE)gn(o,t);else if(t.command)if(rr[n]||rr[a]){const t=rr[n]||rr[a];"function"==typeof t&&t(e)}else{let a=1,o={};Qt.post("/customApiSimulate",{customApiName:t.command,params:JSON.parse(t.inputParams)}).then((e=>{a=200===e.status?0:1,o=e.data?e.data:{},t.callbackId&&gn("service/service",{callbackId:t.callbackId,invokeStatusCode:a,outputParams:o})})).catch((a=>{if(cr[n]){const t=cr[n];"function"==typeof t&&t(e)}else gn("service/service",{callbackId:t.callbackId,invokeStatusCode:1,outputParams:{data:{errMsg:a.response.data}}})}))}})),window.onload=function(){vr(),br(),yr({url:"../app/app-config.json",callback:e=>{200===e.status&&(window.__maConfig__=window.__maAppCode__=JSON.parse(e.responseText),hr())}}),yr({url:"../app/project.config.json",callback:e=>{window.__projectConfig__=200===e.status?JSON.parse(e.responseText):{}}})}})()})();
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const logicLayerNative={};function receiveMessage(e){const a=e.data;a.event?a.isNative?logicLayer.onNativeNotify(a.event,a.webviewId,a.paramsString?JSON.parse(a.paramsString):a.paramsString):logicLayer.onNotify(a.event,a.webviewId,a.paramsString?JSON.parse(a.paramsString):a.paramsString):logicLayer.onInvokeFinished(a.callbackId,a.invokeStatusCode,a.outputParams)}window.global={webkit:{messageHandlers:{notifyViewLayer:{postMessage:function(e){const a=JSON.parse(e.paramsString).webviewIdList;e.targetName=a,window.parent.postMessage(e,window.parent.location.href)}},invoke:{postMessage:function(e){window.parent.postMessage(e,window.parent.location.href)}},notifyNative:{postMessage:function(e){window.parent.postMessage(e,window.parent.location.href)}}}}},logicLayerNative.notifyViewLayer=function(e,a,t){const n=JSON.parse(a),i={event:e,webviewIdList:n,paramsString:t};i.targetName=n,window.parent.postMessage(i,window.parent.location.href)},logicLayerNative.invoke=function(e,a,t){const n={command:e,inputParams:a,callbackId:t};window.parent.postMessage(n,window.parent.location.href)},logicLayerNative.notifyNative=function(e,a){const t={command:e,inputParams:a};window.parent.postMessage(t,window.parent.location.href)},window.logicLayerNative=logicLayerNative,window.addEventListener("message",receiveMessage),window.loadJs=(e,a)=>{const t=[],n=[...e]||[];for(let e=0,a=n.length;e<a;e++)t.push(new Promise(((a,t)=>{const i=document.createElement("script");i.setAttribute("src",`../../app/${n[e]}`),i.addEventListener("load",(()=>{a()})),i.addEventListener("error",(()=>{a()})),document.head.appendChild(i)})));Promise.all(t).then((()=>{a&&a()}))};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
|
+
</head>
|
|
6
|
+
|
|
7
|
+
<body>
|
|
8
|
+
<script src="app.js" type="text/javascript"></script>
|
|
9
|
+
<script src="sync-api.js" type="text/javascript"></script>
|
|
10
|
+
<script src="../../framework/service/service.js" type="text/javascript"></script>
|
|
11
|
+
<script src="../../app/app-service.js" type="text/javascript"></script>
|
|
12
|
+
</body>
|
|
13
|
+
|
|
14
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function getConfig(){const e=new XMLHttpRequest;e.open("get","../config/config.json",!1),e.send(null),200===e.status&&(window.__simulatorConfig__=JSON.parse(e.responseText))}function getUseSize(){let e=0;for(item in window.localStorage)if(null!==window.localStorage.getItem(item)){const t="aa";e+=window.localStorage.getItem(item).replace(/[^\u0000-\u00ff]/g,t).length}return e}const SyncApi={getSystemInfoSync:()=>JSON.stringify({brand:"devtool",system:"devtool 22.6.0",model:"iphone 6/7/8",pixelRatio:"2",screenHeight:667,screenWidth:375,statusBarHeight:20,windowHeight:667,windowWidth:375,language:"en-US"}),getSystemSetting:()=>JSON.stringify({bluetoothEnabled:!0,locationEnabled:!0,wifiEnabled:!0,deviceOrientation:"portrait"}),getLaunchOptionsSync:()=>JSON.stringify({serviceConfig:[]}),getStorageSync:e=>{const{key:t}=e;return t&&0!==t.length?"false"===localStorage.getItem(t)?JSON.stringify({data:!1}):JSON.stringify({data:JSON.parse(localStorage.getItem(t))||""}):""},setStorageSync:e=>{const t=1024,n=(getUseSize()/t).toFixed(2),{key:o,data:i}=e;if(!o||0===o.length)return;const a=JSON.stringify(i),r=(a?.replace(/[^\u0000-\u00ff]/g,"aa").length/t).toFixed(2);if(r>t||r+n>5120){throw new Error("setStorage: fail, the storage exceeds the limit")}localStorage.setItem(o,a)}},prompt=e=>{const t=e&&JSON.parse(e),n=t&&SyncApi[t.command];return n?n(t):"{}"};window.prompt=prompt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"26.6.0-LG0001","updateTime":"Wed Sep 30 2026"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function addNewStyle(e){const i=document.createElement("style");i.type="text/css",document.getElementsByTagName("head")[0].appendChild(i),i.appendChild(document.createTextNode(e))}addNewStyle("html { overflow: overlay; }"),addNewStyle("::-webkit-scrollbar { width: 2px; height: 0px; display: none; }"),addNewStyle("::-webkit-scrollbar-thumb { border-radius: 10px; -webkit-box-shadow: inset 0 0 5px rgb(0 0 0 / 20%); \n background: #eeeeee; }"),addNewStyle("::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 5px rgb(0 0 0 / 0%); border-radius: 10px; }"),addNewStyle(":hover ::-webkit-scrollbar { display: block; }");const myScreen={},orientation={};for(const e in screen.orientation)orientation[e]=screen.orientation[e];for(const e in screen)myScreen[e]="orientation"===e?orientation:screen[e];screen=myScreen,screen.width=window.innerWidth,screen.height=window.innerHeight,screen.orientation.type="portrait",window.devicePixelRatio=1===window.devicePixelRatio?2:window.devicePixelRatio;const viewLayerNative={},global={webkit:{messageHandlers:{notifyLogicLayer:{postMessage:function(e){e.targetName="service/service",e.webviewId=JSON.parse(e.paramsString).webviewId,window.parent.postMessage(e,window.parent.location.href)}},invoke:{postMessage:function(e){e.targetName="service/service",e.webviewId=JSON.parse(e.inputParams).webviewId,window.parent.postMessage(e,window.parent.location.href)}},notifyNative:{postMessage:function(e){e.targetName="service/service",e.webviewId=JSON.parse(e.inputParams).webviewId,window.parent.postMessage(e,window.parent.location.href)}}}}},simulatorWebkit={messageHandlers:{notifyLogicLayer:{postMessage:function(e){e.targetName="service/service",e.webviewId=JSON.parse(e.paramsString).webviewId,window.parent.postMessage(e,window.parent.location.href)}},invoke:{postMessage:function(e){e.targetName="service/service",e.webviewId=JSON.parse(e.inputParams).webviewId,window.parent.postMessage(e,window.parent.location.href)}},notifyNative:{postMessage:function(e){e.targetName="service/service",e.webviewId=JSON.parse(e.inputParams).webviewId,window.parent.postMessage(e,window.parent.location.href)}}}};window.parent&&(window.__maConfig__=window.parent.__maConfig__);const __maConfig__=window.__maConfig__;function getWebViewId(e){let i;return e.webviewId?i=e.webviewId:e.path?__maConfig__.pages.forEach(((t,a)=>{t===e.path&&(i=a)})):e.webviewIdList?[i]=JSON.parse(e.webviewIdList):i=0,i}function receiveMessage(e){const i=e.data;i.event?(i.isNative,viewLayer.onNotify(i.event,i.webviewIdList,JSON.parse(i.paramsString))):viewLayer.onInvokeFinished(i.callbackId,i.invokeStatusCode,i.outputParams)}viewLayerNative.notifyLogicLayer=function(e,i,t){const a={event:e,webviewId:i,paramsString:t,targetName:"service/service"};window.parent.postMessage(a,window.parent.location.href)},viewLayerNative.invoke=function(e,i,t){const a={command:e,inputParams:i,callbackId:t,targetName:"service/service"};window.parent.postMessage(a,window.parent.location.href)},viewLayerNative.notifyNative=function(e,i){const t={command:e,inputParams:i,targetName:"service/service"};window.parent.postMessage(t,window.parent.location.href)},window.viewLayerNative=viewLayerNative,window.global=global,window.simulatorWebkit=simulatorWebkit,window.addEventListener("message",receiveMessage);
|