superapp-miniapp-invoke-native 1.9.12 → 1.9.13
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/lib/main.d.ts +6 -0
- package/lib/main.js +53 -32
- package/lib/main.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/main.d.ts
CHANGED
|
@@ -148,6 +148,7 @@ declare class CommunicatePlugins implements CommunicatePluginsHookType {
|
|
|
148
148
|
switchStore(sendSwitchStoreParams: SendSwitchStoreParamsType): void;
|
|
149
149
|
closeMiniApp(): Promise<void>;
|
|
150
150
|
getStatus(): Promise<any>;
|
|
151
|
+
dispatchToShell(params: DispatchToShellParamsType): Promise<DispatchToShellParamsType | undefined>;
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
declare interface CommunicatePluginsHookType {
|
|
@@ -223,6 +224,11 @@ declare interface DisableFABType {
|
|
|
223
224
|
state: boolean;
|
|
224
225
|
}
|
|
225
226
|
|
|
227
|
+
declare interface DispatchToShellParamsType {
|
|
228
|
+
showStoreUnderUserIcon?: boolean;
|
|
229
|
+
[key: string]: any;
|
|
230
|
+
}
|
|
231
|
+
|
|
226
232
|
declare type FabBtnHandleType = (data: SetFabDataType | any) => void;
|
|
227
233
|
|
|
228
234
|
declare type HomeBtnHandleType = (cb: PluginCallback) => void;
|
package/lib/main.js
CHANGED
|
@@ -63,12 +63,12 @@ const Ar = (t) => {
|
|
|
63
63
|
if (P)
|
|
64
64
|
return console.warn(`Capacitor plugin "${_}" already registered. Cannot register plugins twice.`), P.proxy;
|
|
65
65
|
const v = M(), D = U(_);
|
|
66
|
-
let
|
|
66
|
+
let L;
|
|
67
67
|
const pe = (A) => {
|
|
68
|
-
let
|
|
68
|
+
let E;
|
|
69
69
|
const F = (...z) => {
|
|
70
70
|
const j = (() => o(void 0, null, function* () {
|
|
71
|
-
return !
|
|
71
|
+
return !L && v in h ? L = L = typeof h[v] == "function" ? yield h[v]() : h[v] : c !== null && !L && "web" in h && (L = L = typeof h.web == "function" ? yield h.web() : h.web), L;
|
|
72
72
|
}))().then((W) => {
|
|
73
73
|
const Be = ((O, $) => {
|
|
74
74
|
var Pe, ye;
|
|
@@ -87,25 +87,25 @@ const Ar = (t) => {
|
|
|
87
87
|
})(W, A);
|
|
88
88
|
if (Be) {
|
|
89
89
|
const O = Be(...z);
|
|
90
|
-
return
|
|
90
|
+
return E = O == null ? void 0 : O.remove, O;
|
|
91
91
|
}
|
|
92
92
|
throw new Ne(`"${_}.${A}()" is not implemented on ${v}`, x.Unimplemented);
|
|
93
93
|
});
|
|
94
94
|
return A === "addListener" && (j.remove = () => o(void 0, null, function* () {
|
|
95
|
-
return
|
|
95
|
+
return E();
|
|
96
96
|
})), j;
|
|
97
97
|
};
|
|
98
98
|
return F.toString = () => `${A.toString()}() { [capacitor code] }`, Object.defineProperty(F, "name", { value: A, writable: !1, configurable: !1 }), F;
|
|
99
|
-
}, be = pe("addListener"), Te = pe("removeListener"), yr = (A,
|
|
100
|
-
const F = be({ eventName: A },
|
|
99
|
+
}, be = pe("addListener"), Te = pe("removeListener"), yr = (A, E) => {
|
|
100
|
+
const F = be({ eventName: A }, E), z = () => o(void 0, null, function* () {
|
|
101
101
|
const W = yield F;
|
|
102
|
-
Te({ eventName: A, callbackId: W },
|
|
102
|
+
Te({ eventName: A, callbackId: W }, E);
|
|
103
103
|
}), j = new Promise((W) => F.then(() => W({ remove: z })));
|
|
104
104
|
return j.remove = () => o(void 0, null, function* () {
|
|
105
105
|
console.warn("Using addListener() without 'await' is deprecated."), yield z();
|
|
106
106
|
}), j;
|
|
107
|
-
}, ge = new Proxy({}, { get(A,
|
|
108
|
-
switch (
|
|
107
|
+
}, ge = new Proxy({}, { get(A, E) {
|
|
108
|
+
switch (E) {
|
|
109
109
|
case "$$typeof":
|
|
110
110
|
return;
|
|
111
111
|
case "toJSON":
|
|
@@ -115,7 +115,7 @@ const Ar = (t) => {
|
|
|
115
115
|
case "removeListener":
|
|
116
116
|
return Te;
|
|
117
117
|
default:
|
|
118
|
-
return pe(
|
|
118
|
+
return pe(E);
|
|
119
119
|
}
|
|
120
120
|
} });
|
|
121
121
|
return d[_] = ge, C.set(_, { name: _, proxy: ge, platforms: /* @__PURE__ */ new Set([...Object.keys(h), ...D ? [v] : []]) }), ge;
|
|
@@ -181,7 +181,7 @@ class g {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
const De = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), je = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
184
|
-
class
|
|
184
|
+
class Er extends g {
|
|
185
185
|
getCookies() {
|
|
186
186
|
return o(this, null, function* () {
|
|
187
187
|
const e = document.cookie, r = {};
|
|
@@ -233,8 +233,8 @@ class Lr extends g {
|
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
Re("CapacitorCookies", { web: () => new
|
|
237
|
-
const
|
|
236
|
+
Re("CapacitorCookies", { web: () => new Er() });
|
|
237
|
+
const Lr = (t, e = {}) => {
|
|
238
238
|
const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = ((a = {}) => {
|
|
239
239
|
const i = Object.keys(a);
|
|
240
240
|
return Object.keys(a).map((c) => c.toLocaleLowerCase()).reduce((c, s, d) => (c[s] = a[i[d]], c), {});
|
|
@@ -262,10 +262,10 @@ const kr = (t, e = {}) => {
|
|
|
262
262
|
(n.includes("application/json") || typeof t.data == "object") && (r.body = JSON.stringify(t.data));
|
|
263
263
|
return r;
|
|
264
264
|
};
|
|
265
|
-
class
|
|
265
|
+
class kr extends g {
|
|
266
266
|
request(e) {
|
|
267
267
|
return o(this, null, function* () {
|
|
268
|
-
const r =
|
|
268
|
+
const r = Lr(e, e.webFetchExtra), n = ((S, N = !0) => S ? Object.entries(S).reduce((U, C) => {
|
|
269
269
|
const [f, _] = C;
|
|
270
270
|
let h, P;
|
|
271
271
|
return Array.isArray(_) ? (P = "", _.forEach((v) => {
|
|
@@ -327,7 +327,7 @@ class Er extends g {
|
|
|
327
327
|
function Me() {
|
|
328
328
|
return l.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
|
|
329
329
|
}
|
|
330
|
-
Re("CapacitorHttp", { web: () => new
|
|
330
|
+
Re("CapacitorHttp", { web: () => new kr() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
|
|
331
331
|
Re("Portals", { web: () => Promise.resolve().then(function() {
|
|
332
332
|
return Rr;
|
|
333
333
|
}).then((t) => new t.PortalsWeb()) });
|
|
@@ -473,11 +473,11 @@ const Tr = (t) => {
|
|
|
473
473
|
} catch (n) {
|
|
474
474
|
throw console.error("fabBtnHandle error", n), n;
|
|
475
475
|
}
|
|
476
|
-
},
|
|
477
|
-
|
|
476
|
+
}, k = y();
|
|
477
|
+
k.addListenerBackRemoveHandle = () => null;
|
|
478
478
|
const We = (t = () => null) => o(void 0, null, function* () {
|
|
479
479
|
try {
|
|
480
|
-
|
|
480
|
+
k != null && k.addListenerBackRemoveHandle && typeof k.addListenerBackRemoveHandle == "function" && k.addListenerBackRemoveHandle(), k.addListenerBackRemoveHandle = yield ((e) => o(void 0, null, function* () {
|
|
481
481
|
try {
|
|
482
482
|
if (l.addListener) {
|
|
483
483
|
const r = yield l.addListener(I, "nativeSendBack", (n) => e && e(n));
|
|
@@ -842,6 +842,15 @@ class Hr {
|
|
|
842
842
|
}
|
|
843
843
|
});
|
|
844
844
|
}
|
|
845
|
+
dispatchToShell(e) {
|
|
846
|
+
return o(this, null, function* () {
|
|
847
|
+
try {
|
|
848
|
+
return yield m.dispatchToShell(e);
|
|
849
|
+
} catch (r) {
|
|
850
|
+
throw console.error("communicate dispatchToShell error", r), r;
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
}
|
|
845
854
|
}
|
|
846
855
|
let X = null;
|
|
847
856
|
var er;
|
|
@@ -1467,7 +1476,7 @@ class $r {
|
|
|
1467
1476
|
let le = null;
|
|
1468
1477
|
var cr;
|
|
1469
1478
|
window.__MICRO_APP_ENVIRONMENT__ && (le = (cr = window.rawWindow.__mini_app_status_hook__) != null ? cr : {});
|
|
1470
|
-
const
|
|
1479
|
+
const Ee = l.registerPlugin("DeviceInteractionPlugin", { web: new class extends g {
|
|
1471
1480
|
callVibrate() {
|
|
1472
1481
|
return o(this, null, function* () {
|
|
1473
1482
|
});
|
|
@@ -1493,7 +1502,7 @@ class qr {
|
|
|
1493
1502
|
callVibrate() {
|
|
1494
1503
|
return o(this, null, function* () {
|
|
1495
1504
|
try {
|
|
1496
|
-
return window.__MICRO_APP_ENVIRONMENT__ ? yield window.rawWindow.__mini_app_hook__.callVibrate() : yield
|
|
1505
|
+
return window.__MICRO_APP_ENVIRONMENT__ ? yield window.rawWindow.__mini_app_hook__.callVibrate() : yield Ee.callVibrate();
|
|
1497
1506
|
} catch (e) {
|
|
1498
1507
|
throw console.error("callVibrate error", e), e;
|
|
1499
1508
|
}
|
|
@@ -1502,7 +1511,7 @@ class qr {
|
|
|
1502
1511
|
callErrorBeep() {
|
|
1503
1512
|
return o(this, null, function* () {
|
|
1504
1513
|
try {
|
|
1505
|
-
return window.__MICRO_APP_ENVIRONMENT__ ? yield window.rawWindow.__mini_app_hook__.callErrorBeep() : yield
|
|
1514
|
+
return window.__MICRO_APP_ENVIRONMENT__ ? yield window.rawWindow.__mini_app_hook__.callErrorBeep() : yield Ee.callErrorBeep();
|
|
1506
1515
|
} catch (e) {
|
|
1507
1516
|
throw console.error("callErrorBeep error", e), e;
|
|
1508
1517
|
}
|
|
@@ -1511,7 +1520,7 @@ class qr {
|
|
|
1511
1520
|
getStatus() {
|
|
1512
1521
|
return o(this, null, function* () {
|
|
1513
1522
|
try {
|
|
1514
|
-
return yield
|
|
1523
|
+
return yield Ee.getStatus();
|
|
1515
1524
|
} catch (e) {
|
|
1516
1525
|
throw console.error("deviceInteractionPlugin getStatus error", e), e;
|
|
1517
1526
|
}
|
|
@@ -1522,7 +1531,7 @@ const Pr = "PollingPlugin";
|
|
|
1522
1531
|
let we = null;
|
|
1523
1532
|
var lr;
|
|
1524
1533
|
window.__MICRO_APP_ENVIRONMENT__ && (we = (lr = window.rawWindow.__mini_app_status_hook__) != null ? lr : {});
|
|
1525
|
-
const
|
|
1534
|
+
const Le = l.registerPlugin(Pr, { web: new class extends g {
|
|
1526
1535
|
create() {
|
|
1527
1536
|
return o(this, null, function* () {
|
|
1528
1537
|
});
|
|
@@ -1588,7 +1597,7 @@ class zr {
|
|
|
1588
1597
|
try {
|
|
1589
1598
|
(r = e == null ? void 0 : e.pollingParams) != null && r.pollingId && this.pollingList.push({ pollingId: (n = e == null ? void 0 : e.pollingParams) == null ? void 0 : n.pollingId, callBack: e == null ? void 0 : e.callBack }), this.pollingList = this.pollingList.filter((c, s, d) => s === d.findIndex((u) => u.pollingId === c.pollingId));
|
|
1590
1599
|
const i = ((a = e == null ? void 0 : e.pollingParams) == null ? void 0 : a.delay) / 1e3;
|
|
1591
|
-
return
|
|
1600
|
+
return Le.create(Fe(Ue({}, e == null ? void 0 : e.pollingParams), { delay: i })), ((c, s) => {
|
|
1592
1601
|
try {
|
|
1593
1602
|
const { mounted: d, pollingParams: u } = c;
|
|
1594
1603
|
d(() => Kr(s, u));
|
|
@@ -1611,7 +1620,7 @@ class zr {
|
|
|
1611
1620
|
} else
|
|
1612
1621
|
try {
|
|
1613
1622
|
const i = this.pollingList.map((c) => c.pollingId).indexOf(e.pollingId);
|
|
1614
|
-
return (a = this.pollingList) != null && a.length && (Number(i) || Number(i) >= 0) && this.pollingList.splice(Number(i), 1),
|
|
1623
|
+
return (a = this.pollingList) != null && a.length && (Number(i) || Number(i) >= 0) && this.pollingList.splice(Number(i), 1), Le.destroy(e);
|
|
1615
1624
|
} catch (i) {
|
|
1616
1625
|
throw console.error("pollingPlugin destroy error", i), i;
|
|
1617
1626
|
}
|
|
@@ -1619,7 +1628,7 @@ class zr {
|
|
|
1619
1628
|
getStatus() {
|
|
1620
1629
|
return o(this, null, function* () {
|
|
1621
1630
|
try {
|
|
1622
|
-
return yield
|
|
1631
|
+
return yield Le.getStatus();
|
|
1623
1632
|
} catch (e) {
|
|
1624
1633
|
throw console.error("getStatus error", e), e;
|
|
1625
1634
|
}
|
|
@@ -1677,7 +1686,7 @@ class Gr {
|
|
|
1677
1686
|
let _e = null;
|
|
1678
1687
|
var dr;
|
|
1679
1688
|
window.__MICRO_APP_ENVIRONMENT__ && (_e = (dr = window.rawWindow.__mini_app_status_hook__) != null ? dr : {});
|
|
1680
|
-
const
|
|
1689
|
+
const ke = l.registerPlugin("CameraForTakePhotoPlugin", { web: new class extends g {
|
|
1681
1690
|
pickCameraForTakePhoto() {
|
|
1682
1691
|
return o(this, null, function* () {
|
|
1683
1692
|
});
|
|
@@ -1703,7 +1712,7 @@ class Jr {
|
|
|
1703
1712
|
pickCameraForTakePhoto() {
|
|
1704
1713
|
return o(this, null, function* () {
|
|
1705
1714
|
try {
|
|
1706
|
-
return window.__MICRO_APP_ENVIRONMENT__ ? window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto() : yield
|
|
1715
|
+
return window.__MICRO_APP_ENVIRONMENT__ ? window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto() : yield ke.pickCameraForTakePhoto();
|
|
1707
1716
|
} catch (e) {
|
|
1708
1717
|
throw console.error("pickCameraForTakePhoto error", e), e;
|
|
1709
1718
|
}
|
|
@@ -1712,7 +1721,7 @@ class Jr {
|
|
|
1712
1721
|
setCameraForTakePhotoState(e) {
|
|
1713
1722
|
return o(this, null, function* () {
|
|
1714
1723
|
try {
|
|
1715
|
-
return window.__MICRO_APP_ENVIRONMENT__ ? window.rawWindow.__mini_app_hook__.setCameraForTakePhotoState(e) : yield
|
|
1724
|
+
return window.__MICRO_APP_ENVIRONMENT__ ? window.rawWindow.__mini_app_hook__.setCameraForTakePhotoState(e) : yield ke.setCameraForTakePhotoState(e);
|
|
1716
1725
|
} catch (r) {
|
|
1717
1726
|
throw console.error("setCameraForTakePhotoState error", r), r;
|
|
1718
1727
|
}
|
|
@@ -1721,7 +1730,7 @@ class Jr {
|
|
|
1721
1730
|
getStatus() {
|
|
1722
1731
|
return o(this, null, function* () {
|
|
1723
1732
|
try {
|
|
1724
|
-
return yield
|
|
1733
|
+
return yield ke.getStatus();
|
|
1725
1734
|
} catch (e) {
|
|
1726
1735
|
throw console.error("cameraForTakePhotoPlugin getStatus error", e), e;
|
|
1727
1736
|
}
|
|
@@ -1939,6 +1948,18 @@ const Zr = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: cl
|
|
|
1939
1948
|
throw console.error("communicate getStatus error", t), t;
|
|
1940
1949
|
}
|
|
1941
1950
|
}
|
|
1951
|
+
dispatchToShell(t) {
|
|
1952
|
+
try {
|
|
1953
|
+
return window.__MICRO_APP_ENVIRONMENT__ ? new Promise((e) => o(this, null, function* () {
|
|
1954
|
+
var r;
|
|
1955
|
+
e((yield (r = w == null ? void 0 : w.dispatchToShell) == null ? void 0 : r.call(w, t)) || {});
|
|
1956
|
+
})) : new Promise((e) => {
|
|
1957
|
+
e(t);
|
|
1958
|
+
});
|
|
1959
|
+
} catch (e) {
|
|
1960
|
+
throw console.error("communicate dispatchToShell error", e), e;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1942
1963
|
} }, Symbol.toStringTag, { value: "Module" }));
|
|
1943
1964
|
export {
|
|
1944
1965
|
Yr as NativeApi,
|
package/lib/main.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Qr=Object.defineProperty,Xr=Object.defineProperties;var Zr=Object.getOwnPropertyDescriptors;var Nr=Object.getOwnPropertySymbols;var Yr=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;var Ve=(P,m,p)=>m in P?Qr(P,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):P[m]=p,Mr=(P,m)=>{for(var p in m||(m={}))Yr.call(m,p)&&Ve(P,p,m[p]);if(Nr)for(var p of Nr(m))et.call(m,p)&&Ve(P,p,m[p]);return P},fr=(P,m)=>Xr(P,Zr(m));var S=(P,m,p)=>(Ve(P,typeof m!="symbol"?m+"":m,p),p);var o=(P,m,p)=>new Promise((b,F)=>{var Ne=f=>{try{l(p.next(f))}catch(g){F(g)}},Me=f=>{try{l(p.throw(f))}catch(g){F(g)}},l=f=>f.done?b(f.value):Promise.resolve(f.value).then(Ne,Me);l((p=p.apply(P,m)).next())});(function(P,m){typeof exports=="object"&&typeof module!="undefined"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):m((P=typeof globalThis!="undefined"?globalThis:P||self).main={})})(this,function(P){var tr,nr,or,ar,ir,sr,cr,lr,wr,dr,ur,_r,hr,mr,pr;"use strict";/*! Capacitor: https://capacitorjs.com/ - MIT License */const m=t=>t.CapacitorPlatforms=(e=>{const r=new Map;r.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:r};return n.addPlatform=(a,i)=>{n.platforms.set(a,i)},n.setPlatform=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))},n})(t),p=m(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var b;p.addPlatform,p.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(b||(b={}));class F extends Error{constructor(e,r,n){super(e),this.message=e,this.code=r,this.data=n}}const Ne=t=>{var e,r,n,a,i;const s=t.CapacitorCustomPlatform||null,c=t.Capacitor||{},u=c.Plugins=c.Plugins||{},_=t.CapacitorPlatforms,O=((e=_==null?void 0:_.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>s!==null?s.name:(d=>{var h,N;return d!=null&&d.androidBridge?"android":!((N=(h=d==null?void 0:d.webkit)===null||h===void 0?void 0:h.messageHandlers)===null||N===void 0)&&N.bridge?"ios":"web"})(t)),C=((r=_==null?void 0:_.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||(()=>O()!=="web"),v=((n=_==null?void 0:_.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(d=>{const h=I.get(d);return!!(h!=null&&h.platforms.has(O()))||!!$(d)}),$=((a=_==null?void 0:_.currentPlatform)===null||a===void 0?void 0:a.getPluginHeader)||(d=>{var h;return(h=c.PluginHeaders)===null||h===void 0?void 0:h.find(N=>N.name===d)}),I=new Map,A=((i=_==null?void 0:_.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((d,h={})=>{const N=I.get(d);if(N)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),N.proxy;const L=O(),z=$(d);let j;const be=R=>{let T;const q=(...Se)=>{const J=(()=>o(this,null,function*(){return!j&&L in h?j=j=typeof h[L]=="function"?yield h[L]():h[L]:s!==null&&!j&&"web"in h&&(j=j=typeof h.web=="function"?yield h.web():h.web),j}))().then(G=>{const yr=((k,Q)=>{var Be,He;if(!z){if(k)return(He=k[Q])===null||He===void 0?void 0:He.bind(k);throw new F(`"${d}" plugin is not implemented on ${L}`,b.Unimplemented)}{const Sr=z==null?void 0:z.methods.find(X=>Q===X.name);if(Sr)return Sr.rtype==="promise"?X=>c.nativePromise(d,Q.toString(),X):(X,Gr)=>c.nativeCallback(d,Q.toString(),X,Gr);if(k)return(Be=k[Q])===null||Be===void 0?void 0:Be.bind(k)}})(G,R);if(yr){const k=yr(...Se);return T=k==null?void 0:k.remove,k}throw new F(`"${d}.${R}()" is not implemented on ${L}`,b.Unimplemented)});return R==="addListener"&&(J.remove=()=>o(this,null,function*(){return T()})),J};return q.toString=()=>`${R.toString()}() { [capacitor code] }`,Object.defineProperty(q,"name",{value:R,writable:!1,configurable:!1}),q},gr=be("addListener"),Pr=be("removeListener"),Jr=(R,T)=>{const q=gr({eventName:R},T),Se=()=>o(this,null,function*(){const G=yield q;Pr({eventName:R,callbackId:G},T)}),J=new Promise(G=>q.then(()=>G({remove:Se})));return J.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Se()}),J},Te=new Proxy({},{get(R,T){switch(T){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return z?Jr:gr;case"removeListener":return Pr;default:return be(T)}}});return u[d]=Te,I.set(d,{name:d,proxy:Te,platforms:new Set([...Object.keys(h),...z?[L]:[]])}),Te});return c.convertFileSrc||(c.convertFileSrc=d=>d),c.getPlatform=O,c.handleError=d=>t.console.error(d),c.isNativePlatform=C,c.isPluginAvailable=v,c.pluginMethodNoop=(d,h,N)=>Promise.reject(`${N} does not have an implementation of "${h}".`),c.registerPlugin=A,c.Exception=F,c.DEBUG=!!c.DEBUG,c.isLoggingEnabled=!!c.isLoggingEnabled,c.platform=c.getPlatform(),c.isNative=c.isNativePlatform(),c},Me=t=>t.Capacitor=Ne(t),l=Me(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),f=l.registerPlugin;l.Plugins;class g{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const a=()=>o(this,null,function*(){return this.removeListener(e,r)}),i=Promise.resolve({remove:a});return Object.defineProperty(i,"remove",{value:()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield a()})}),i}removeAllListeners(){return o(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,r){const n=this.listeners[e];n&&n.forEach(a=>a(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:n=>{this.notifyListeners(r,n)}}}unimplemented(e="not implemented"){return new l.Exception(e,b.Unimplemented)}unavailable(e="not available"){return new l.Exception(e,b.Unavailable)}removeListener(e,r){return o(this,null,function*(){const n=this.listeners[e];if(!n)return;const a=n.indexOf(r);this.listeners[e].splice(a,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])})}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const We=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Ue=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Cr extends g{getCookies(){return o(this,null,function*(){const e=document.cookie,r={};return e.split(";").forEach(n=>{if(n.length<=0)return;let[a,i]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=Ue(a).trim(),i=Ue(i).trim(),r[a]=i}),r})}setCookie(e){return o(this,null,function*(){try{const r=We(e.key),n=We(e.value),a=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),s=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${n||""}${a}; path=${i}; ${s};`}catch(r){return Promise.reject(r)}})}deleteCookie(e){return o(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}})}clearCookies(){return o(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}})}clearAllCookies(){return o(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}f("CapacitorCookies",{web:()=>new Cr});const vr=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=((a={})=>{const i=Object.keys(a);return Object.keys(a).map(s=>s.toLocaleLowerCase()).reduce((s,c,u)=>(s[c]=a[i[u]],s),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[i,s]of Object.entries(t.data||{}))a.set(i,s);r.body=a.toString()}else if(n.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((s,c)=>{a.append(c,s)});else for(const s of Object.keys(t.data))a.append(s,t.data[s]);r.body=a;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class Or extends g{request(e){return o(this,null,function*(){const r=vr(e,e.webFetchExtra),n=((C,v=!0)=>C?Object.entries(C).reduce(($,I)=>{const[A,d]=I;let h,N;return Array.isArray(d)?(N="",d.forEach(L=>{h=v?encodeURIComponent(L):L,N+=`${A}=${h}&`}),N.slice(0,-1)):(h=v?encodeURIComponent(d):d,N=`${A}=${h}`),`${$}&${N}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=n?`${e.url}?${n}`:e.url,i=yield fetch(a,r),s=i.headers.get("content-type")||"";let c,u,{responseType:_="text"}=i.ok?e:{};switch(s.includes("application/json")&&(_="json"),_){case"arraybuffer":case"blob":u=yield i.blob(),c=yield(C=>o(this,null,function*(){return new Promise((v,$)=>{const I=new FileReader;I.onload=()=>{const A=I.result;v(A.indexOf(",")>=0?A.split(",")[1]:A)},I.onerror=A=>$(A),I.readAsDataURL(C)})}))(u);break;case"json":c=yield i.json();break;default:c=yield i.text()}const O={};return i.headers.forEach((C,v)=>{O[v]=C}),{data:c,headers:O,status:i.status,url:i.url}})}get(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function fe(){return l.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}f("CapacitorHttp",{web:()=>new Or}),f("Portals",{web:()=>Promise.resolve().then(function(){return Ir}).then(t=>new t.PortalsWeb)});const Ir=Object.freeze({__proto__:null,PortalsWeb:class extends g{publishNative(t){return o(this,null,function*(){})}}}),Z=t=>{var e,r,n;try{if(typeof window=="undefined")return;if(fe&&((e=fe())!=null&&e.value)){const a=(n=(r=fe())==null?void 0:r.value)!=null?n:null;if(!a)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(a)}}catch(a){throw console.error("getInitialContextHandle error",a),a}};class Ar{isNative(){try{return(()=>{try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.isNative();{let e=!1;return Z(r=>{e=!!(r!=null&&r.isNative)}),e}}catch(e){throw console.error("isNative error",e),e}})()}catch(e){throw console.error("isNative error",e),e}}redirectPage(e){try{if(window.__MICRO_APP_ENVIRONMENT__){const r=window.rawWindow.__mini_app_hook__.redirectPage(window.__MICRO_APP_NAME__);if(console.log("redirectParams",r),r)return e.callBack(r)}else(({callBack:r})=>{Z(n=>{var a;try{if(!(n!=null&&n.params))return void console.info("initial context native params is undefine");const i=(a=n==null?void 0:n.params)!=null?a:null;if(!i)return;if(!r)return void console.error("initial context call back is undefine");r(i)}catch(i){throw console.error("redirectPageHandle error",i),i}})})(e)}catch(r){throw console.error("redirectPage error",r),r}}getNativeInfo(e){var r;try{return this.isNative()?window.__MICRO_APP_ENVIRONMENT__?(r=window.rawWindow.__mini_app_hook__.getNativeInfo(e))!=null?r:{}:(()=>{try{let n=null;return Z(a=>{n=a!=null?a:null}),n}catch(n){throw console.error("getNativeInfoHandle error",n),n}})():(n=>{var a;return(a=n==null?void 0:n.mockData)!=null?a:null})(e)}catch(n){throw console.error("getNativeInfo error",n),n}}getStatus(){return new Promise(e=>{e({isNative:!0,redirectPage:!0,getNativeInfo:!0})})}}const M=()=>{try{let t={};return typeof window!="undefined"&&(t=window),t}catch(t){throw console.error("isWinHandle error",t),t}},E="CommunicatePlugin",y=l.registerPlugin(E,{web:()=>Promise.resolve().then(()=>zr).then(t=>new t.PluginsWeb)}),Y=M();Y.removeAddListenerFab=()=>null;const Lr=t=>{var e,r;try{Y.removeAddListenerFab&&Y.removeAddListenerFab();const n=[];if((e=y.showFABMenu)==null||e.call(y,{fabMenu:n}),!t||!((r=Object.keys(t))!=null&&r.length))return;Object.keys(t).forEach(a=>{var i,s,c,u,_,O,C,v;n.push({disable:(s=(i=t==null?void 0:t[a])==null?void 0:i.disable)!=null?s:!1,icon:(u=(c=t==null?void 0:t[a])==null?void 0:c.icon)!=null?u:"",id:(O=(_=t==null?void 0:t[a])==null?void 0:_.id)!=null?O:"",name:(v=(C=t==null?void 0:t[a])==null?void 0:C.title)!=null?v:""})}),queueMicrotask(()=>{var a;(a=y.showFABMenu)==null||a.call(y,{fabMenu:n})}),setTimeout(()=>{(a=>o(this,null,function*(){a&&(Y.removeAddListenerFab=yield(i=>o(this,null,function*(){try{if(l.addListener){const s=yield l.addListener(E,"nativeSendFab",c=>i&&i(c));return s!=null&&s.remove?s.remove:()=>null}}catch(s){throw console.error("addListenerFabHandle error",s),s}}))(a))}))(a=>{let i;a!=null&&a.disable||a!=null&&a.id&&(Object.keys(t).forEach(s=>{var c,u,_;(c=t==null?void 0:t[s])!=null&&c.id&&a.id===t[s].id&&(i=(_=(u=t[s])==null?void 0:u.fn)!=null?_:()=>null)}),typeof i=="function"&&i())})})}catch(n){throw console.error("fabBtnHandle error",n),n}},B=M();B.addListenerBackRemoveHandle=()=>null;const xe=(t=()=>null)=>o(this,null,function*(){try{B!=null&&B.addListenerBackRemoveHandle&&typeof B.addListenerBackRemoveHandle=="function"&&B.addListenerBackRemoveHandle(),B.addListenerBackRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(E,"nativeSendBack",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerBackHandle error",r),r}}))(t)}catch(e){throw console.error("initBackBtnFn error",e),e}}),ee=M();ee.addListenerHomeHandle=()=>null;const kr=t=>{try{ee.addListenerHomeHandle&&ee.addListenerHomeHandle(),setTimeout(()=>{(e=>o(this,null,function*(){e&&(ee.addListenerHomeHandle=yield(r=>o(this,null,function*(){try{if(l.addListener){const n=yield l.addListener(E,"nativeSendHome",a=>r&&r(a));return n!=null&&n.remove?n.remove:()=>null}}catch(n){throw console.error("addListenerHomeHandle error",n),n}}))(e))}))(t)})}catch(e){throw console.error("homeFn error",e),e}},H=M();H.addListenerTouchRemoveHandle=()=>null;const De=(t=()=>null)=>o(this,null,function*(){try{H!=null&&H.addListenerTouchRemoveHandle&&typeof H.addListenerTouchRemoveHandle=="function"&&H.addListenerTouchRemoveHandle(),H.addListenerTouchRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(E,"nativeTouchListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerTouchHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),V=M();V.addListenerSendDeepLinkRemoveHandle=()=>null;const je=(t=()=>null)=>o(this,null,function*(){try{V!=null&&V.addListenerSendDeepLinkRemoveHandle&&typeof V.addListenerSendDeepLinkRemoveHandle=="function"&&V.addListenerSendDeepLinkRemoveHandle(),V.addListenerSendDeepLinkRemoveHandle=yield(e=>o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return e&&window.rawWindow.__mini_app_hook__.getDeeplinkParams(e),{remove:()=>null};if(l.addListener){const r=yield l.addListener(E,"nativeSendDeeplinkCallbackListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSendDeepLinkHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),W=M();W.addListenerSwitchLanguageRemoveHandle=()=>null;const Fe=(t=()=>null)=>o(this,null,function*(){try{W!=null&&W.addListenerSwitchLanguageRemoveHandle&&typeof W.addListenerSwitchLanguageRemoveHandle=="function"&&W.addListenerSwitchLanguageRemoveHandle(),W.addListenerSwitchLanguageRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(E,"nativeSendSwitchLanguage",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchLanguage=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchLanguage=null}}}catch(r){throw console.error("addListenerSwitchLanguageHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchLanguageFn error",e),e}}),U=M();U.addListenerSetupMiniAppRemoveHandle=()=>null;const $e=(t=()=>null)=>o(this,null,function*(){try{U!=null&&U.addListenerSetupMiniAppRemoveHandle&&typeof U.addListenerSetupMiniAppRemoveHandle=="function"&&U.addListenerSetupMiniAppRemoveHandle(),U.addListenerSetupMiniAppRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(E,"nativeSetupMiniApp",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSetupMiniAppHandle error",r),r}}))(t)}catch(e){throw console.error("initSetupMiniAppFn error",e),e}}),x=M();x.addListenerSwitchStoreRemoveHandle=()=>null;const qe=(t=()=>null)=>o(this,null,function*(){try{x!=null&&x.addListenerSwitchStoreRemoveHandle&&typeof x.addListenerSwitchStoreRemoveHandle=="function"&&x.addListenerSwitchStoreRemoveHandle(),x.addListenerSwitchStoreRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(E,"nativeSendSwitchStore",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchStore=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchStore=null}}}catch(r){throw console.error("addListenerSwitchStoreHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchStoreFn error",e),e}});class Er{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return o(this,null,function*(){var r;try{return yield(r=y.homeIsClick)==null?void 0:r.call(y,e)}catch(n){throw console.error("homeBtnSwitch error",n),n}})}setBackBtn(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{xe(i)}),a(()=>{xe()})}catch(n){throw console.error("backBtnHandle error",n),n}})(e)}catch(r){throw console.error("setBackBtn error",r),r}}setHomeBtn(e){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setHomeBtn=e:kr(e)}catch(r){throw console.error("setHomeBtn error",r),r}}setFabBtn(e){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setFabBtn(e):Lr(e)}catch(r){throw console.error("setFabBtn error",r),r}}touchListener(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{De(i)}),a(()=>{De()})}catch(n){throw console.error("touchListenerHandle error",n),n}})(e)}catch(r){throw console.error("listenerTouch error",r),r}}disableFAB(e){return o(this,null,function*(){try{return yield y.disableFAB(e)}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(e){return o(this,null,function*(){try{return yield y.disableBack(e)}catch(r){throw console.error("disableBack error",r),r}})}openMiniApp(e){return o(this,null,function*(){try{return yield y.openMiniApp(e)}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(e){return o(this,null,function*(){try{return yield y.showTitle(e)}catch(r){throw console.error("showTitle error",r),r}})}showSubMask(e){return o(this,null,function*(){try{return yield y.showSubMask(e)}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(e){return o(this,null,function*(){try{return yield y.setMiniAppVersion(e)}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showNativeLoading(){return o(this,null,function*(){try{return yield y.showDialog()}catch(e){throw console.error("showNativeLoading error",e),e}})}cancelNativeLoading(){return o(this,null,function*(){try{return yield y.cancelDialog()}catch(e){throw console.error("cancelNativeLoading error",e),e}})}getMiniAppKong(e){return o(this,null,function*(){try{return yield y.getMiniAppKong(e)}catch(r){throw console.error("getMiniAppKong error",r),r}})}getDeeplinkParams(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{je(i)}),a(()=>{je()})}catch(n){throw console.error("sendDeepLinkListenerHandle error",n),n}})(e)}catch(r){throw console.error("getDeeplinkParams error",r),r}}switchLanguage(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Fe(i)}),a(()=>{Fe()})}catch(n){throw console.error("sendSwitchLanguageHandle error",n),n}})(e)}catch(r){throw console.error("switchLanguage error",r),r}}setupMiniApp(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{$e(i)}),a(()=>{$e()})}catch(n){throw console.error("setupMiniAppHandle error",n),n}})(e)}catch(r){throw console.error("setupMiniApp error",r),r}}switchStore(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{qe(i)}),a(()=>{qe()})}catch(n){throw console.error("sendSwitchStoreHandle error",n),n}})(e)}catch(r){throw console.error("switchStore error",r),r}}closeMiniApp(){return o(this,null,function*(){try{return yield y.closeMiniApp()}catch(e){throw console.error("closeMiniApp error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield y.getStatus()}catch(e){throw console.error("communicatePlugins getStatus error",e),e}})}}let re=null;window.__MICRO_APP_ENVIRONMENT__&&(re=(tr=window.rawWindow.__mini_app_status_hook__)!=null?tr:{});const Ce=l.registerPlugin("CameraScanPlugin",{web:new class extends g{pickCameraScan(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}setCameraScanState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=re==null?void 0:re.cameraScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScan getStatus error",t),t}}}});window.removeAddListenerCameraScan=()=>null;class Rr{pickCameraScan(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScan(e):yield Ce.pickCameraScan(e)}catch(r){throw console.error("pickCameraScan error",r),r}})}setCameraScanState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanState(e):yield Ce.setCameraScanState(e)}catch(r){throw console.error("setCameraScanState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ce.getStatus()}catch(e){throw console.error("cameraScanPlugin getStatus error",e),e}})}}let te=null;window.__MICRO_APP_ENVIRONMENT__&&(te=(nr=window.rawWindow.__mini_app_status_hook__)!=null?nr:{});const ve=l.registerPlugin("CameraScanMultiplePlugin",{web:new class extends g{pickCameraScanMultiple(){return o(this,null,function*(){})}setCameraScanMultipleState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=te==null?void 0:te.cameraScanMultiple)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultiple getStatus error",t),t}}}});class br{pickCameraScanMultiple(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultiple(e):yield ve.pickCameraScanMultiple(e)}catch(r){throw console.error("pickCameraScanMultiple error",r),r}})}setCameraScanMultipleState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleState(e):yield ve.setCameraScanMultipleState(e)}catch(r){throw console.error("setCameraScanMultipleState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ve.getStatus()}catch(e){throw console.error("cameraScanMultiplePlugin getStatus error",e),e}})}}let ne=null;window.__MICRO_APP_ENVIRONMENT__&&(ne=(or=window.rawWindow.__mini_app_status_hook__)!=null?or:{});const Oe=l.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends g{pickCameraScanMultipleNoCount(){return o(this,null,function*(){})}setCameraScanMultipleNoCountState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ne==null?void 0:ne.cameraScanMultipleNoCount)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultipleNoCount getStatus error",t),t}}}});class Tr{pickCameraScanMultipleNoCount(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultipleNoCount(e):yield Oe.pickCameraScanMultipleNoCount(e)}catch(r){throw console.error("pickCameraScanMultipleNoCount error",r),r}})}setCameraScanMultipleNoCountState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleNoCountState(e):yield Oe.setCameraScanMultipleNoCountState(e)}catch(r){throw console.error("setCameraScanMultipleNoCountState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Oe.getStatus()}catch(e){throw console.error("cameraScanMultipleNoCountPlugin getStatus error",e),e}})}}let oe=null;window.__MICRO_APP_ENVIRONMENT__&&(oe=(ar=window.rawWindow.__mini_app_status_hook__)!=null?ar:{});const Ie=l.registerPlugin("CameraScanSingleOrDualPlugin",{web:new class extends g{pickCameraScanSingleOrDual(){return o(this,null,function*(){})}setCameraScanSingleOrDualState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=oe==null?void 0:oe.cameraScanSingleOrDual)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanSingleOrDual getStatus error",t),t}}}});class Br{pickCameraScanSingleOrDual(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanSingleOrDual(e):yield Ie.pickCameraScanSingleOrDual(e)}catch(r){throw console.error("pickCameraScanSingleOrDual error",r),r}})}setCameraScanSingleOrDualState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCameraScanSingleOrDualState(e):yield Ie.setCameraScanSingleOrDualState(e)}catch(r){throw console.error("setCameraScanSingleOrDualState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ie.getStatus()}catch(e){throw console.error("cameraScanSingleOrDualPlugin getStatus error",e),e}})}}const Ke="LaserScanPlugin";let ae=null;window.__MICRO_APP_ENVIRONMENT__&&(ae=(ir=window.rawWindow.__mini_app_status_hook__)!=null?ir:{});const ie=l.registerPlugin(Ke,{web:new class extends g{pickLaserScan(){return o(this,null,function*(){})}unPickLaserScan(){return o(this,null,function*(){})}setLaserState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ae==null?void 0:ae.laserScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("laserScan getStatus error",t),t}}}}),se=M();se.removeAddListenerLaserScan=()=>null;const ze=(t=()=>null)=>{try{se.removeAddListenerLaserScan&&se.removeAddListenerLaserScan();const e=r=>o(this,null,function*(){r&&(se.removeAddListenerLaserScan=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(Ke,"nativeSendLaser",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("addListenerLaserHandle error",a),a}}))(r))});setTimeout(()=>{e(t)})}catch(e){throw console.error("laserScanFn error",e),e}};class Hr{constructor(){this.pickLaserScan()}pickLaserScan(){return o(this,null,function*(){try{return yield ie.pickLaserScan({isContinue:!1})}catch(e){throw console.error("pickLaserScan error",e),e}})}unPickLaserScan(){return o(this,null,function*(){try{return yield ie.unPickLaserScan()}catch(e){throw console.error("unPickLaserScan error",e),e}})}setLaserState(e){try{ie.setLaserState(e)}catch(r){throw console.error("setLaserState error",r),r}}setLaserScan(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{ze(i)}),a(()=>{ze()})}catch(n){throw console.error("laserScanApiParams error",n),n}})(e)}getStatus(){return o(this,null,function*(){try{return yield ie.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}const Je="CountAssistPlugin";let ce=null;window.__MICRO_APP_ENVIRONMENT__&&(ce=(sr=window.rawWindow.__mini_app_status_hook__)!=null?sr:{});const le=l.registerPlugin(Je,{web:new class extends g{setCountAssistState(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("setCountAssistState error",e),e}})}toggleCountAssist(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("hideCountAssist error",e),e}})}getCountAssistToggleState(){return o(this,null,function*(){try{return new Promise(t=>{t(void 0)})}catch(t){throw console.error("getCountAssistToggleState error",t),t}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ce==null?void 0:ce.countAssist)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("countAssist getStatus error",t),t}}}}),D=M();D.addListenerCountAssistRemoveHandle=()=>null;const Ge=(t=()=>null)=>o(this,null,function*(){try{D!=null&&D.addListenerCountAssistRemoveHandle&&typeof D.addListenerCountAssistRemoveHandle=="function"&&D.addListenerCountAssistRemoveHandle(),D.addListenerCountAssistRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(Je,"nativeSendCountAssist",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerCountAssistHandle error",r),r}}))(t)}catch(e){throw console.error("initCountAssistFn error",e),e}});class Vr{setCountAssistState(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCountAssistState(e):yield le.setCountAssistState(e)})}getCountAssistState(e){return(r=>{try{let n=r!=null?r:!1;return Z(a=>{n=!!(a!=null&&a.countAssistState)}),n}catch(n){throw console.error("getCountAssistStateHandle error",n),n}})(e)}setCountAssistBtn(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ge(i)}),a(()=>{Ge()})}catch(n){throw console.error("setCountAssistBtnHandle error",n),n}})(e)}toggleCountAssist(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.toggleCountAssist(e):yield le.toggleCountAssist(e)})}getCountAssistToggleState(){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.getCountAssistToggleState():yield le.getCountAssistToggleState()})}getStatus(){return o(this,null,function*(){try{return yield le.getStatus()}catch(e){throw console.error("countAssistPlugin getStatus error",e),e}})}}let we=null;window.__MICRO_APP_ENVIRONMENT__&&(we=(cr=window.rawWindow.__mini_app_status_hook__)!=null?cr:{});const Ae=l.registerPlugin("ClickStreamPlugin",{web:new class extends g{init(){return o(this,null,function*(){return new Promise(t=>{t(null)})})}trace(t){return o(this,null,function*(){var e,r;try{return window.__MICRO_APP_ENVIRONMENT__&&((r=(e=window.rawWindow.__mini_app_hook__).clickStream)==null||r.call(e,t.data)),new Promise(n=>{n(t)})}catch(n){throw console.error("clickStreamTraceParams error",n),n}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=we==null?void 0:we.clickStream)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("clickStream getStatus error",t),t}}}});class Wr{constructor(){this.init()}init(){return o(this,null,function*(){try{return yield Ae.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return o(this,null,function*(){try{return yield Ae.trace(e)}catch(r){throw console.error("clickStreamPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ae.getStatus()}catch(e){throw console.error("clickStreamPlugin getStatus error",e),e}})}}const Qe="MiniAppLifecyclePlugin";let de=null;window.__MICRO_APP_ENVIRONMENT__&&(de=(lr=window.rawWindow.__mini_app_status_hook__)!=null?lr:{});var K=(t=>(t.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",t.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",t))(K||{});const Le=l.registerPlugin(Qe,{web:new class extends g{setNativeUsagePermission(){return o(this,null,function*(){})}authorizeWebCallback(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=de==null?void 0:de.lifecycle)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("lifecycle getStatus error",t),t}}}}),ue=M();ue.removeAddListenerLifecycleMiniAppBeforeUnmount=()=>null;const Xe=(t=()=>null)=>{try{ue.removeAddListenerLifecycleMiniAppBeforeUnmount&&ue.removeAddListenerLifecycleMiniAppBeforeUnmount();const e=r=>o(this,null,function*(){r&&(ue.removeAddListenerLifecycleMiniAppBeforeUnmount=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(Qe,"miniAppBeforeUnmount",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("miniAppBeforeUnmountHandle error",a),a}}))(r))});setTimeout(()=>o(this,null,function*(){yield e(t)}))}catch(e){throw console.error("laserScanFn error",e),e}};class Ur{constructor(){}setNativeUsagePermission(e){return o(this,null,function*(){try{return yield Le.setNativeUsagePermission(e)}catch(r){throw console.error("lifecyclePlugin.setNativeUsagePermission error",r),r}})}authorizeWebCallback(e){return o(this,null,function*(){try{return yield Le.authorizeWebCallback(e)}catch(r){throw console.error("lifecyclePlugin.authorizeWebCallback error",r),r}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:K.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((r,n)=>{try{const{mounted:a,beforeUnmount:i,callBack:s}=r;a(()=>{Xe(c=>o(this,null,function*(){var u;if(s&&s instanceof Function)try{(u=s(c))==null||u.then(()=>o(this,null,function*(){yield n.setNativeUsagePermission({action:K.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:K.MINI_APP_BEFORE_UNMOUNT_COMPLETION})}))}catch(_){console.error("miniAppBeforeUnmount error callBack is not a function or promise")}else console.error("miniAppBeforeUnmount error callBack is not a function or promise")}))}),i(()=>o(this,null,function*(){Xe(),n.setNativeUsagePermission({action:K.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1})}))}catch(a){throw console.error("miniAppBeforeUnmount error",a),a}})(e,this)}getStatus(){return o(this,null,function*(){try{return yield Le.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let _e=null;window.__MICRO_APP_ENVIRONMENT__&&(_e=(wr=window.rawWindow.__mini_app_status_hook__)!=null?wr:{});const ke=l.registerPlugin("DeviceInteractionPlugin",{web:new class extends g{callVibrate(){return o(this,null,function*(){})}callErrorBeep(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=_e==null?void 0:_e.deviceInteraction)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("deviceInteraction getStatus error",t),t}}}});class xr{callVibrate(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callVibrate():yield ke.callVibrate()}catch(e){throw console.error("callVibrate error",e),e}})}callErrorBeep(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callErrorBeep():yield ke.callErrorBeep()}catch(e){throw console.error("callErrorBeep error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield ke.getStatus()}catch(e){throw console.error("deviceInteractionPlugin getStatus error",e),e}})}}const Ze="PollingPlugin";let he=null;window.__MICRO_APP_ENVIRONMENT__&&(he=(dr=window.rawWindow.__mini_app_status_hook__)!=null?dr:{});const Ee=l.registerPlugin(Ze,{web:new class extends g{create(){return o(this,null,function*(){})}destroy(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=he==null?void 0:he.polling)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("polling getStatus error",t),t}}}}),me=M();me.removeAddListenerPolling=()=>null;const Dr=(t,e)=>{try{me.removeAddListenerPolling&&me.removeAddListenerPolling();const r=e.pollingId;(n=>o(this,null,function*(){return n&&(me.removeAddListenerPolling=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(Ze,"nativeSendPolling",s=>a&&a(s));return i!=null&&i.remove?i.remove:()=>null}}catch(i){throw console.error("addListenerPollingHandle error",i),i}}))(n))}))(n=>{(n==null?void 0:n.pollingId)===r&&(n!=null&&n.pollingId)&&t.pollingList.forEach(a=>{a!=null&&a.pollingId&&(n==null?void 0:n.pollingId)===(a==null?void 0:a.pollingId)&&typeof(a==null?void 0:a.callBack)=="function"&&a.callBack(n)})})}catch(r){throw console.error("pollingFn error",r),r}};class jr{constructor(){S(this,"pollingList");this.pollingList=[]}create(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{mounted:i,pollingParams:s,callBack:c}=e;return i(()=>{var u,_;(_=(u=window.rawWindow.__mini_app_hook__)==null?void 0:u.addPolling)==null||_.call(u,s,c)}),()=>{this.destroy({pollingId:s.pollingId})}}try{(r=e==null?void 0:e.pollingParams)!=null&&r.pollingId&&this.pollingList.push({pollingId:(n=e==null?void 0:e.pollingParams)==null?void 0:n.pollingId,callBack:e==null?void 0:e.callBack}),this.pollingList=this.pollingList.filter((s,c,u)=>c===u.findIndex(_=>_.pollingId===s.pollingId));const i=((a=e==null?void 0:e.pollingParams)==null?void 0:a.delay)/1e3;return Ee.create(fr(Mr({},e==null?void 0:e.pollingParams),{delay:i})),((s,c)=>{try{const{mounted:u,pollingParams:_}=s;u(()=>Dr(c,_))}catch(u){throw console.error("createPolling error",u),u}})(e,this),()=>{var s,c;return(s=e==null?void 0:e.pollingParams)!=null&&s.pollingId?this.destroy({pollingId:(c=e==null?void 0:e.pollingParams)==null?void 0:c.pollingId}):null}}catch(i){throw console.error("pollingPlugin create error",i),i}}destroy(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{pollingId:i}=e;(n=(r=window.rawWindow.__mini_app_hook__)==null?void 0:r.deletePolling)==null||n.call(r,i)}else try{const i=this.pollingList.map(s=>s.pollingId).indexOf(e.pollingId);return(a=this.pollingList)!=null&&a.length&&(Number(i)||Number(i)>=0)&&this.pollingList.splice(Number(i),1),Ee.destroy(e)}catch(i){throw console.error("pollingPlugin destroy error",i),i}}getStatus(){return o(this,null,function*(){try{return yield Ee.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let pe=null;window.__MICRO_APP_ENVIRONMENT__&&(pe=(ur=window.rawWindow.__mini_app_status_hook__)!=null?ur:{});const Ye=l.registerPlugin("PaymentPlugin",{web:new class extends g{process(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("process error",e),e}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=pe==null?void 0:pe.payment)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("payment getStatus error",t),t}}}});class Fr{process(e){return o(this,null,function*(){try{return yield Ye.process(e)}catch(r){throw console.error("paymentPlugins.process error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ye.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let ge=null;window.__MICRO_APP_ENVIRONMENT__&&(ge=(_r=window.rawWindow.__mini_app_status_hook__)!=null?_r:{});const Re=l.registerPlugin("CameraForTakePhotoPlugin",{web:new class extends g{pickCameraForTakePhoto(){return o(this,null,function*(){})}setCameraForTakePhotoState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ge==null?void 0:ge.cameraForTakePhoto)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraForTakePhoto getStatus error",t),t}}}});class $r{pickCameraForTakePhoto(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto():yield Re.pickCameraForTakePhoto()}catch(e){throw console.error("pickCameraForTakePhoto error",e),e}})}setCameraForTakePhotoState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraForTakePhotoState(e):yield Re.setCameraForTakePhotoState(e)}catch(r){throw console.error("setCameraForTakePhotoState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Re.getStatus()}catch(e){throw console.error("cameraForTakePhotoPlugin getStatus error",e),e}})}}let Pe=null;window.__MICRO_APP_ENVIRONMENT__&&(Pe=(hr=window.rawWindow.__mini_app_status_hook__)!=null?hr:{});const er=l.registerPlugin("HttpPlugin",{web:new class extends g{request(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Pe==null?void 0:Pe.http)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("http getStatus error",t),t}}}});class qr{request(e){return o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.requestHttp(e);{let r={};return e.url&&(r.url=e.url),e.method&&(r.method=e.method),e.headers&&(r.headers=e.headers),e.params&&(r.urlParams=e.params),e.data&&(typeof e.data=="string"?r.bodyData=e.data:r.bodyParams=e.data),e.upload&&(r.upload=e.upload),yield er.request(r)}}catch(r){throw console.error("HttpPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield er.getStatus()}catch(e){throw console.error("HttpPlugin getStatus error",e),e}})}}class rr{constructor(){S(this,"initialContextPlugins",new Ar);S(this,"communicatePlugins",new Er);S(this,"cameraScanPlugins",new Rr);S(this,"cameraScanMultiplePlugins",new br);S(this,"cameraScanMultipleNoCountPlugins",new Tr);S(this,"cameraScanSingleOrDualPlugins",new Br);S(this,"laserScanPlugins",new Hr);S(this,"countAssistPlugins",new Vr);S(this,"clickStreamPlugins",new Wr);S(this,"lifecyclePlugins",new Ur);S(this,"deviceInteractionPlugins",new xr);S(this,"pollingPlugins",new jr);S(this,"paymentPlugins",new Fr);S(this,"cameraForTakePhotoPlugin",new $r);S(this,"httpPlugin",new qr)}}const Kr=new rr;let w=null,ye=null;window.__MICRO_APP_ENVIRONMENT__&&(w=(mr=window.rawWindow.__mini_app_hook__)!=null?mr:{},ye=(pr=window.rawWindow.__mini_app_status_hook__)!=null?pr:{});const zr=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends g{homeIsClick(t){return o(this,null,function*(){var e;window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch homeIsClick",t),(e=w.disabledMenu)==null||e.call(w,t))})}openMiniApp(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.openMiniApp)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch showTitle",t),(e=w.showTitle)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showTitle error",r),r}})}showFABMenu(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.showFABMenu)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showFABMenu error",r),r}})}disableFAB(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.disableFAB)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.disableBack)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableBack error",r),r}})}showSubMask(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.showSubMask)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.setMiniAppVersion)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.showDialog)==null||t.call(w))})}cancelDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.cancelDialog)==null||t.call(w))})}getMiniAppKong(t){return o(this,null,function*(){var e,r;try{if(window.__MICRO_APP_ENVIRONMENT__){const n=(r=(e=w.getMiniAppKong)==null?void 0:e.call(w,t))!=null?r:{};return new Promise(a=>{a(n)})}return new Promise(n=>{n(t)})}catch(n){throw console.error("getMiniAppKong error",n),n}})}closeMiniApp(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.closeMiniApp)==null||t.call(w))})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ye==null?void 0:ye.communicate)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("communicate getStatus error",t),t}}}},Symbol.toStringTag,{value:"Module"}));P.NativeApi=rr,P.default=Kr,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
var Qr=Object.defineProperty,Xr=Object.defineProperties;var Zr=Object.getOwnPropertyDescriptors;var Nr=Object.getOwnPropertySymbols;var Yr=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable;var Ve=(y,m,p)=>m in y?Qr(y,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):y[m]=p,Mr=(y,m)=>{for(var p in m||(m={}))Yr.call(m,p)&&Ve(y,p,m[p]);if(Nr)for(var p of Nr(m))et.call(m,p)&&Ve(y,p,m[p]);return y},fr=(y,m)=>Xr(y,Zr(m));var S=(y,m,p)=>(Ve(y,typeof m!="symbol"?m+"":m,p),p);var o=(y,m,p)=>new Promise((b,F)=>{var Ne=f=>{try{l(p.next(f))}catch(g){F(g)}},Me=f=>{try{l(p.throw(f))}catch(g){F(g)}},l=f=>f.done?b(f.value):Promise.resolve(f.value).then(Ne,Me);l((p=p.apply(y,m)).next())});(function(y,m){typeof exports=="object"&&typeof module!="undefined"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):m((y=typeof globalThis!="undefined"?globalThis:y||self).main={})})(this,function(y){var tr,nr,or,ar,ir,sr,cr,lr,wr,dr,ur,_r,hr,mr,pr;"use strict";/*! Capacitor: https://capacitorjs.com/ - MIT License */const m=t=>t.CapacitorPlatforms=(e=>{const r=new Map;r.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:r};return n.addPlatform=(a,i)=>{n.platforms.set(a,i)},n.setPlatform=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))},n})(t),p=m(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var b;p.addPlatform,p.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(b||(b={}));class F extends Error{constructor(e,r,n){super(e),this.message=e,this.code=r,this.data=n}}const Ne=t=>{var e,r,n,a,i;const s=t.CapacitorCustomPlatform||null,c=t.Capacitor||{},u=c.Plugins=c.Plugins||{},_=t.CapacitorPlatforms,O=((e=_==null?void 0:_.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>s!==null?s.name:(d=>{var h,N;return d!=null&&d.androidBridge?"android":!((N=(h=d==null?void 0:d.webkit)===null||h===void 0?void 0:h.messageHandlers)===null||N===void 0)&&N.bridge?"ios":"web"})(t)),C=((r=_==null?void 0:_.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||(()=>O()!=="web"),v=((n=_==null?void 0:_.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(d=>{const h=I.get(d);return!!(h!=null&&h.platforms.has(O()))||!!$(d)}),$=((a=_==null?void 0:_.currentPlatform)===null||a===void 0?void 0:a.getPluginHeader)||(d=>{var h;return(h=c.PluginHeaders)===null||h===void 0?void 0:h.find(N=>N.name===d)}),I=new Map,A=((i=_==null?void 0:_.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((d,h={})=>{const N=I.get(d);if(N)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),N.proxy;const E=O(),z=$(d);let j;const be=R=>{let T;const q=(...Se)=>{const J=(()=>o(this,null,function*(){return!j&&E in h?j=j=typeof h[E]=="function"?yield h[E]():h[E]:s!==null&&!j&&"web"in h&&(j=j=typeof h.web=="function"?yield h.web():h.web),j}))().then(G=>{const yr=((L,Q)=>{var Be,He;if(!z){if(L)return(He=L[Q])===null||He===void 0?void 0:He.bind(L);throw new F(`"${d}" plugin is not implemented on ${E}`,b.Unimplemented)}{const Sr=z==null?void 0:z.methods.find(X=>Q===X.name);if(Sr)return Sr.rtype==="promise"?X=>c.nativePromise(d,Q.toString(),X):(X,Gr)=>c.nativeCallback(d,Q.toString(),X,Gr);if(L)return(Be=L[Q])===null||Be===void 0?void 0:Be.bind(L)}})(G,R);if(yr){const L=yr(...Se);return T=L==null?void 0:L.remove,L}throw new F(`"${d}.${R}()" is not implemented on ${E}`,b.Unimplemented)});return R==="addListener"&&(J.remove=()=>o(this,null,function*(){return T()})),J};return q.toString=()=>`${R.toString()}() { [capacitor code] }`,Object.defineProperty(q,"name",{value:R,writable:!1,configurable:!1}),q},gr=be("addListener"),Pr=be("removeListener"),Jr=(R,T)=>{const q=gr({eventName:R},T),Se=()=>o(this,null,function*(){const G=yield q;Pr({eventName:R,callbackId:G},T)}),J=new Promise(G=>q.then(()=>G({remove:Se})));return J.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Se()}),J},Te=new Proxy({},{get(R,T){switch(T){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return z?Jr:gr;case"removeListener":return Pr;default:return be(T)}}});return u[d]=Te,I.set(d,{name:d,proxy:Te,platforms:new Set([...Object.keys(h),...z?[E]:[]])}),Te});return c.convertFileSrc||(c.convertFileSrc=d=>d),c.getPlatform=O,c.handleError=d=>t.console.error(d),c.isNativePlatform=C,c.isPluginAvailable=v,c.pluginMethodNoop=(d,h,N)=>Promise.reject(`${N} does not have an implementation of "${h}".`),c.registerPlugin=A,c.Exception=F,c.DEBUG=!!c.DEBUG,c.isLoggingEnabled=!!c.isLoggingEnabled,c.platform=c.getPlatform(),c.isNative=c.isNativePlatform(),c},Me=t=>t.Capacitor=Ne(t),l=Me(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),f=l.registerPlugin;l.Plugins;class g{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const a=()=>o(this,null,function*(){return this.removeListener(e,r)}),i=Promise.resolve({remove:a});return Object.defineProperty(i,"remove",{value:()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield a()})}),i}removeAllListeners(){return o(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,r){const n=this.listeners[e];n&&n.forEach(a=>a(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:n=>{this.notifyListeners(r,n)}}}unimplemented(e="not implemented"){return new l.Exception(e,b.Unimplemented)}unavailable(e="not available"){return new l.Exception(e,b.Unavailable)}removeListener(e,r){return o(this,null,function*(){const n=this.listeners[e];if(!n)return;const a=n.indexOf(r);this.listeners[e].splice(a,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])})}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const We=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Ue=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Cr extends g{getCookies(){return o(this,null,function*(){const e=document.cookie,r={};return e.split(";").forEach(n=>{if(n.length<=0)return;let[a,i]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=Ue(a).trim(),i=Ue(i).trim(),r[a]=i}),r})}setCookie(e){return o(this,null,function*(){try{const r=We(e.key),n=We(e.value),a=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),s=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${n||""}${a}; path=${i}; ${s};`}catch(r){return Promise.reject(r)}})}deleteCookie(e){return o(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}})}clearCookies(){return o(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}})}clearAllCookies(){return o(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}f("CapacitorCookies",{web:()=>new Cr});const vr=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=((a={})=>{const i=Object.keys(a);return Object.keys(a).map(s=>s.toLocaleLowerCase()).reduce((s,c,u)=>(s[c]=a[i[u]],s),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[i,s]of Object.entries(t.data||{}))a.set(i,s);r.body=a.toString()}else if(n.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((s,c)=>{a.append(c,s)});else for(const s of Object.keys(t.data))a.append(s,t.data[s]);r.body=a;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class Or extends g{request(e){return o(this,null,function*(){const r=vr(e,e.webFetchExtra),n=((C,v=!0)=>C?Object.entries(C).reduce(($,I)=>{const[A,d]=I;let h,N;return Array.isArray(d)?(N="",d.forEach(E=>{h=v?encodeURIComponent(E):E,N+=`${A}=${h}&`}),N.slice(0,-1)):(h=v?encodeURIComponent(d):d,N=`${A}=${h}`),`${$}&${N}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=n?`${e.url}?${n}`:e.url,i=yield fetch(a,r),s=i.headers.get("content-type")||"";let c,u,{responseType:_="text"}=i.ok?e:{};switch(s.includes("application/json")&&(_="json"),_){case"arraybuffer":case"blob":u=yield i.blob(),c=yield(C=>o(this,null,function*(){return new Promise((v,$)=>{const I=new FileReader;I.onload=()=>{const A=I.result;v(A.indexOf(",")>=0?A.split(",")[1]:A)},I.onerror=A=>$(A),I.readAsDataURL(C)})}))(u);break;case"json":c=yield i.json();break;default:c=yield i.text()}const O={};return i.headers.forEach((C,v)=>{O[v]=C}),{data:c,headers:O,status:i.status,url:i.url}})}get(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function fe(){return l.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}f("CapacitorHttp",{web:()=>new Or}),f("Portals",{web:()=>Promise.resolve().then(function(){return Ir}).then(t=>new t.PortalsWeb)});const Ir=Object.freeze({__proto__:null,PortalsWeb:class extends g{publishNative(t){return o(this,null,function*(){})}}}),Z=t=>{var e,r,n;try{if(typeof window=="undefined")return;if(fe&&((e=fe())!=null&&e.value)){const a=(n=(r=fe())==null?void 0:r.value)!=null?n:null;if(!a)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(a)}}catch(a){throw console.error("getInitialContextHandle error",a),a}};class Ar{isNative(){try{return(()=>{try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.isNative();{let e=!1;return Z(r=>{e=!!(r!=null&&r.isNative)}),e}}catch(e){throw console.error("isNative error",e),e}})()}catch(e){throw console.error("isNative error",e),e}}redirectPage(e){try{if(window.__MICRO_APP_ENVIRONMENT__){const r=window.rawWindow.__mini_app_hook__.redirectPage(window.__MICRO_APP_NAME__);if(console.log("redirectParams",r),r)return e.callBack(r)}else(({callBack:r})=>{Z(n=>{var a;try{if(!(n!=null&&n.params))return void console.info("initial context native params is undefine");const i=(a=n==null?void 0:n.params)!=null?a:null;if(!i)return;if(!r)return void console.error("initial context call back is undefine");r(i)}catch(i){throw console.error("redirectPageHandle error",i),i}})})(e)}catch(r){throw console.error("redirectPage error",r),r}}getNativeInfo(e){var r;try{return this.isNative()?window.__MICRO_APP_ENVIRONMENT__?(r=window.rawWindow.__mini_app_hook__.getNativeInfo(e))!=null?r:{}:(()=>{try{let n=null;return Z(a=>{n=a!=null?a:null}),n}catch(n){throw console.error("getNativeInfoHandle error",n),n}})():(n=>{var a;return(a=n==null?void 0:n.mockData)!=null?a:null})(e)}catch(n){throw console.error("getNativeInfo error",n),n}}getStatus(){return new Promise(e=>{e({isNative:!0,redirectPage:!0,getNativeInfo:!0})})}}const M=()=>{try{let t={};return typeof window!="undefined"&&(t=window),t}catch(t){throw console.error("isWinHandle error",t),t}},k="CommunicatePlugin",P=l.registerPlugin(k,{web:()=>Promise.resolve().then(()=>zr).then(t=>new t.PluginsWeb)}),Y=M();Y.removeAddListenerFab=()=>null;const Er=t=>{var e,r;try{Y.removeAddListenerFab&&Y.removeAddListenerFab();const n=[];if((e=P.showFABMenu)==null||e.call(P,{fabMenu:n}),!t||!((r=Object.keys(t))!=null&&r.length))return;Object.keys(t).forEach(a=>{var i,s,c,u,_,O,C,v;n.push({disable:(s=(i=t==null?void 0:t[a])==null?void 0:i.disable)!=null?s:!1,icon:(u=(c=t==null?void 0:t[a])==null?void 0:c.icon)!=null?u:"",id:(O=(_=t==null?void 0:t[a])==null?void 0:_.id)!=null?O:"",name:(v=(C=t==null?void 0:t[a])==null?void 0:C.title)!=null?v:""})}),queueMicrotask(()=>{var a;(a=P.showFABMenu)==null||a.call(P,{fabMenu:n})}),setTimeout(()=>{(a=>o(this,null,function*(){a&&(Y.removeAddListenerFab=yield(i=>o(this,null,function*(){try{if(l.addListener){const s=yield l.addListener(k,"nativeSendFab",c=>i&&i(c));return s!=null&&s.remove?s.remove:()=>null}}catch(s){throw console.error("addListenerFabHandle error",s),s}}))(a))}))(a=>{let i;a!=null&&a.disable||a!=null&&a.id&&(Object.keys(t).forEach(s=>{var c,u,_;(c=t==null?void 0:t[s])!=null&&c.id&&a.id===t[s].id&&(i=(_=(u=t[s])==null?void 0:u.fn)!=null?_:()=>null)}),typeof i=="function"&&i())})})}catch(n){throw console.error("fabBtnHandle error",n),n}},B=M();B.addListenerBackRemoveHandle=()=>null;const xe=(t=()=>null)=>o(this,null,function*(){try{B!=null&&B.addListenerBackRemoveHandle&&typeof B.addListenerBackRemoveHandle=="function"&&B.addListenerBackRemoveHandle(),B.addListenerBackRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendBack",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerBackHandle error",r),r}}))(t)}catch(e){throw console.error("initBackBtnFn error",e),e}}),ee=M();ee.addListenerHomeHandle=()=>null;const Lr=t=>{try{ee.addListenerHomeHandle&&ee.addListenerHomeHandle(),setTimeout(()=>{(e=>o(this,null,function*(){e&&(ee.addListenerHomeHandle=yield(r=>o(this,null,function*(){try{if(l.addListener){const n=yield l.addListener(k,"nativeSendHome",a=>r&&r(a));return n!=null&&n.remove?n.remove:()=>null}}catch(n){throw console.error("addListenerHomeHandle error",n),n}}))(e))}))(t)})}catch(e){throw console.error("homeFn error",e),e}},H=M();H.addListenerTouchRemoveHandle=()=>null;const De=(t=()=>null)=>o(this,null,function*(){try{H!=null&&H.addListenerTouchRemoveHandle&&typeof H.addListenerTouchRemoveHandle=="function"&&H.addListenerTouchRemoveHandle(),H.addListenerTouchRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeTouchListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerTouchHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),V=M();V.addListenerSendDeepLinkRemoveHandle=()=>null;const je=(t=()=>null)=>o(this,null,function*(){try{V!=null&&V.addListenerSendDeepLinkRemoveHandle&&typeof V.addListenerSendDeepLinkRemoveHandle=="function"&&V.addListenerSendDeepLinkRemoveHandle(),V.addListenerSendDeepLinkRemoveHandle=yield(e=>o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return e&&window.rawWindow.__mini_app_hook__.getDeeplinkParams(e),{remove:()=>null};if(l.addListener){const r=yield l.addListener(k,"nativeSendDeeplinkCallbackListener",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSendDeepLinkHandle error",r),r}}))(t)}catch(e){throw console.error("initTouchFn error",e),e}}),W=M();W.addListenerSwitchLanguageRemoveHandle=()=>null;const Fe=(t=()=>null)=>o(this,null,function*(){try{W!=null&&W.addListenerSwitchLanguageRemoveHandle&&typeof W.addListenerSwitchLanguageRemoveHandle=="function"&&W.addListenerSwitchLanguageRemoveHandle(),W.addListenerSwitchLanguageRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendSwitchLanguage",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchLanguage=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchLanguage=null}}}catch(r){throw console.error("addListenerSwitchLanguageHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchLanguageFn error",e),e}}),U=M();U.addListenerSetupMiniAppRemoveHandle=()=>null;const $e=(t=()=>null)=>o(this,null,function*(){try{U!=null&&U.addListenerSetupMiniAppRemoveHandle&&typeof U.addListenerSetupMiniAppRemoveHandle=="function"&&U.addListenerSetupMiniAppRemoveHandle(),U.addListenerSetupMiniAppRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSetupMiniApp",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerSetupMiniAppHandle error",r),r}}))(t)}catch(e){throw console.error("initSetupMiniAppFn error",e),e}}),x=M();x.addListenerSwitchStoreRemoveHandle=()=>null;const qe=(t=()=>null)=>o(this,null,function*(){try{x!=null&&x.addListenerSwitchStoreRemoveHandle&&typeof x.addListenerSwitchStoreRemoveHandle=="function"&&x.addListenerSwitchStoreRemoveHandle(),x.addListenerSwitchStoreRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(k,"nativeSendSwitchStore",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.switchStore=e,{remove:()=>{window.rawWindow.__mini_app_hook__.switchStore=null}}}catch(r){throw console.error("addListenerSwitchStoreHandle error",r),r}}))(t)}catch(e){throw console.error("initSwitchStoreFn error",e),e}});class kr{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return o(this,null,function*(){var r;try{return yield(r=P.homeIsClick)==null?void 0:r.call(P,e)}catch(n){throw console.error("homeBtnSwitch error",n),n}})}setBackBtn(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{xe(i)}),a(()=>{xe()})}catch(n){throw console.error("backBtnHandle error",n),n}})(e)}catch(r){throw console.error("setBackBtn error",r),r}}setHomeBtn(e){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setHomeBtn=e:Lr(e)}catch(r){throw console.error("setHomeBtn error",r),r}}setFabBtn(e){try{window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setFabBtn(e):Er(e)}catch(r){throw console.error("setFabBtn error",r),r}}touchListener(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{De(i)}),a(()=>{De()})}catch(n){throw console.error("touchListenerHandle error",n),n}})(e)}catch(r){throw console.error("listenerTouch error",r),r}}disableFAB(e){return o(this,null,function*(){try{return yield P.disableFAB(e)}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(e){return o(this,null,function*(){try{return yield P.disableBack(e)}catch(r){throw console.error("disableBack error",r),r}})}openMiniApp(e){return o(this,null,function*(){try{return yield P.openMiniApp(e)}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(e){return o(this,null,function*(){try{return yield P.showTitle(e)}catch(r){throw console.error("showTitle error",r),r}})}showSubMask(e){return o(this,null,function*(){try{return yield P.showSubMask(e)}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(e){return o(this,null,function*(){try{return yield P.setMiniAppVersion(e)}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showNativeLoading(){return o(this,null,function*(){try{return yield P.showDialog()}catch(e){throw console.error("showNativeLoading error",e),e}})}cancelNativeLoading(){return o(this,null,function*(){try{return yield P.cancelDialog()}catch(e){throw console.error("cancelNativeLoading error",e),e}})}getMiniAppKong(e){return o(this,null,function*(){try{return yield P.getMiniAppKong(e)}catch(r){throw console.error("getMiniAppKong error",r),r}})}getDeeplinkParams(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{je(i)}),a(()=>{je()})}catch(n){throw console.error("sendDeepLinkListenerHandle error",n),n}})(e)}catch(r){throw console.error("getDeeplinkParams error",r),r}}switchLanguage(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Fe(i)}),a(()=>{Fe()})}catch(n){throw console.error("sendSwitchLanguageHandle error",n),n}})(e)}catch(r){throw console.error("switchLanguage error",r),r}}setupMiniApp(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{$e(i)}),a(()=>{$e()})}catch(n){throw console.error("setupMiniAppHandle error",n),n}})(e)}catch(r){throw console.error("setupMiniApp error",r),r}}switchStore(e){try{(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{qe(i)}),a(()=>{qe()})}catch(n){throw console.error("sendSwitchStoreHandle error",n),n}})(e)}catch(r){throw console.error("switchStore error",r),r}}closeMiniApp(){return o(this,null,function*(){try{return yield P.closeMiniApp()}catch(e){throw console.error("closeMiniApp error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield P.getStatus()}catch(e){throw console.error("communicatePlugins getStatus error",e),e}})}dispatchToShell(e){return o(this,null,function*(){try{return yield P.dispatchToShell(e)}catch(r){throw console.error("communicate dispatchToShell error",r),r}})}}let re=null;window.__MICRO_APP_ENVIRONMENT__&&(re=(tr=window.rawWindow.__mini_app_status_hook__)!=null?tr:{});const Ce=l.registerPlugin("CameraScanPlugin",{web:new class extends g{pickCameraScan(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}setCameraScanState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=re==null?void 0:re.cameraScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScan getStatus error",t),t}}}});window.removeAddListenerCameraScan=()=>null;class Rr{pickCameraScan(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScan(e):yield Ce.pickCameraScan(e)}catch(r){throw console.error("pickCameraScan error",r),r}})}setCameraScanState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanState(e):yield Ce.setCameraScanState(e)}catch(r){throw console.error("setCameraScanState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ce.getStatus()}catch(e){throw console.error("cameraScanPlugin getStatus error",e),e}})}}let te=null;window.__MICRO_APP_ENVIRONMENT__&&(te=(nr=window.rawWindow.__mini_app_status_hook__)!=null?nr:{});const ve=l.registerPlugin("CameraScanMultiplePlugin",{web:new class extends g{pickCameraScanMultiple(){return o(this,null,function*(){})}setCameraScanMultipleState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=te==null?void 0:te.cameraScanMultiple)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultiple getStatus error",t),t}}}});class br{pickCameraScanMultiple(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultiple(e):yield ve.pickCameraScanMultiple(e)}catch(r){throw console.error("pickCameraScanMultiple error",r),r}})}setCameraScanMultipleState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleState(e):yield ve.setCameraScanMultipleState(e)}catch(r){throw console.error("setCameraScanMultipleState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield ve.getStatus()}catch(e){throw console.error("cameraScanMultiplePlugin getStatus error",e),e}})}}let ne=null;window.__MICRO_APP_ENVIRONMENT__&&(ne=(or=window.rawWindow.__mini_app_status_hook__)!=null?or:{});const Oe=l.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends g{pickCameraScanMultipleNoCount(){return o(this,null,function*(){})}setCameraScanMultipleNoCountState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ne==null?void 0:ne.cameraScanMultipleNoCount)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanMultipleNoCount getStatus error",t),t}}}});class Tr{pickCameraScanMultipleNoCount(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanMultipleNoCount(e):yield Oe.pickCameraScanMultipleNoCount(e)}catch(r){throw console.error("pickCameraScanMultipleNoCount error",r),r}})}setCameraScanMultipleNoCountState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraScanMultipleNoCountState(e):yield Oe.setCameraScanMultipleNoCountState(e)}catch(r){throw console.error("setCameraScanMultipleNoCountState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Oe.getStatus()}catch(e){throw console.error("cameraScanMultipleNoCountPlugin getStatus error",e),e}})}}let oe=null;window.__MICRO_APP_ENVIRONMENT__&&(oe=(ar=window.rawWindow.__mini_app_status_hook__)!=null?ar:{});const Ie=l.registerPlugin("CameraScanSingleOrDualPlugin",{web:new class extends g{pickCameraScanSingleOrDual(){return o(this,null,function*(){})}setCameraScanSingleOrDualState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=oe==null?void 0:oe.cameraScanSingleOrDual)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraScanSingleOrDual getStatus error",t),t}}}});class Br{pickCameraScanSingleOrDual(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraScanSingleOrDual(e):yield Ie.pickCameraScanSingleOrDual(e)}catch(r){throw console.error("pickCameraScanSingleOrDual error",r),r}})}setCameraScanSingleOrDualState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCameraScanSingleOrDualState(e):yield Ie.setCameraScanSingleOrDualState(e)}catch(r){throw console.error("setCameraScanSingleOrDualState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ie.getStatus()}catch(e){throw console.error("cameraScanSingleOrDualPlugin getStatus error",e),e}})}}const Ke="LaserScanPlugin";let ae=null;window.__MICRO_APP_ENVIRONMENT__&&(ae=(ir=window.rawWindow.__mini_app_status_hook__)!=null?ir:{});const ie=l.registerPlugin(Ke,{web:new class extends g{pickLaserScan(){return o(this,null,function*(){})}unPickLaserScan(){return o(this,null,function*(){})}setLaserState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ae==null?void 0:ae.laserScan)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("laserScan getStatus error",t),t}}}}),se=M();se.removeAddListenerLaserScan=()=>null;const ze=(t=()=>null)=>{try{se.removeAddListenerLaserScan&&se.removeAddListenerLaserScan();const e=r=>o(this,null,function*(){r&&(se.removeAddListenerLaserScan=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(Ke,"nativeSendLaser",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("addListenerLaserHandle error",a),a}}))(r))});setTimeout(()=>{e(t)})}catch(e){throw console.error("laserScanFn error",e),e}};class Hr{constructor(){this.pickLaserScan()}pickLaserScan(){return o(this,null,function*(){try{return yield ie.pickLaserScan({isContinue:!1})}catch(e){throw console.error("pickLaserScan error",e),e}})}unPickLaserScan(){return o(this,null,function*(){try{return yield ie.unPickLaserScan()}catch(e){throw console.error("unPickLaserScan error",e),e}})}setLaserState(e){try{ie.setLaserState(e)}catch(r){throw console.error("setLaserState error",r),r}}setLaserScan(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{ze(i)}),a(()=>{ze()})}catch(n){throw console.error("laserScanApiParams error",n),n}})(e)}getStatus(){return o(this,null,function*(){try{return yield ie.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}const Je="CountAssistPlugin";let ce=null;window.__MICRO_APP_ENVIRONMENT__&&(ce=(sr=window.rawWindow.__mini_app_status_hook__)!=null?sr:{});const le=l.registerPlugin(Je,{web:new class extends g{setCountAssistState(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("setCountAssistState error",e),e}})}toggleCountAssist(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("hideCountAssist error",e),e}})}getCountAssistToggleState(){return o(this,null,function*(){try{return new Promise(t=>{t(void 0)})}catch(t){throw console.error("getCountAssistToggleState error",t),t}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ce==null?void 0:ce.countAssist)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("countAssist getStatus error",t),t}}}}),D=M();D.addListenerCountAssistRemoveHandle=()=>null;const Ge=(t=()=>null)=>o(this,null,function*(){try{D!=null&&D.addListenerCountAssistRemoveHandle&&typeof D.addListenerCountAssistRemoveHandle=="function"&&D.addListenerCountAssistRemoveHandle(),D.addListenerCountAssistRemoveHandle=yield(e=>o(this,null,function*(){try{if(l.addListener){const r=yield l.addListener(Je,"nativeSendCountAssist",n=>e&&e(n));return r!=null&&r.remove?r.remove:()=>null}}catch(r){throw console.error("addListenerCountAssistHandle error",r),r}}))(t)}catch(e){throw console.error("initCountAssistFn error",e),e}});class Vr{setCountAssistState(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.setCountAssistState(e):yield le.setCountAssistState(e)})}getCountAssistState(e){return(r=>{try{let n=r!=null?r:!1;return Z(a=>{n=!!(a!=null&&a.countAssistState)}),n}catch(n){throw console.error("getCountAssistStateHandle error",n),n}})(e)}setCountAssistBtn(e){(r=>{try{const{mounted:n,beforeUnmount:a,callBack:i}=r;n(()=>{Ge(i)}),a(()=>{Ge()})}catch(n){throw console.error("setCountAssistBtnHandle error",n),n}})(e)}toggleCountAssist(e){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.toggleCountAssist(e):yield le.toggleCountAssist(e)})}getCountAssistToggleState(){return o(this,null,function*(){return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.getCountAssistToggleState():yield le.getCountAssistToggleState()})}getStatus(){return o(this,null,function*(){try{return yield le.getStatus()}catch(e){throw console.error("countAssistPlugin getStatus error",e),e}})}}let we=null;window.__MICRO_APP_ENVIRONMENT__&&(we=(cr=window.rawWindow.__mini_app_status_hook__)!=null?cr:{});const Ae=l.registerPlugin("ClickStreamPlugin",{web:new class extends g{init(){return o(this,null,function*(){return new Promise(t=>{t(null)})})}trace(t){return o(this,null,function*(){var e,r;try{return window.__MICRO_APP_ENVIRONMENT__&&((r=(e=window.rawWindow.__mini_app_hook__).clickStream)==null||r.call(e,t.data)),new Promise(n=>{n(t)})}catch(n){throw console.error("clickStreamTraceParams error",n),n}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=we==null?void 0:we.clickStream)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("clickStream getStatus error",t),t}}}});class Wr{constructor(){this.init()}init(){return o(this,null,function*(){try{return yield Ae.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return o(this,null,function*(){try{return yield Ae.trace(e)}catch(r){throw console.error("clickStreamPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ae.getStatus()}catch(e){throw console.error("clickStreamPlugin getStatus error",e),e}})}}const Qe="MiniAppLifecyclePlugin";let de=null;window.__MICRO_APP_ENVIRONMENT__&&(de=(lr=window.rawWindow.__mini_app_status_hook__)!=null?lr:{});var K=(t=>(t.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",t.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",t))(K||{});const Ee=l.registerPlugin(Qe,{web:new class extends g{setNativeUsagePermission(){return o(this,null,function*(){})}authorizeWebCallback(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=de==null?void 0:de.lifecycle)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("lifecycle getStatus error",t),t}}}}),ue=M();ue.removeAddListenerLifecycleMiniAppBeforeUnmount=()=>null;const Xe=(t=()=>null)=>{try{ue.removeAddListenerLifecycleMiniAppBeforeUnmount&&ue.removeAddListenerLifecycleMiniAppBeforeUnmount();const e=r=>o(this,null,function*(){r&&(ue.removeAddListenerLifecycleMiniAppBeforeUnmount=yield(n=>o(this,null,function*(){try{if(l.addListener){const a=yield l.addListener(Qe,"miniAppBeforeUnmount",i=>n&&n(i));return a!=null&&a.remove?a.remove:()=>null}}catch(a){throw console.error("miniAppBeforeUnmountHandle error",a),a}}))(r))});setTimeout(()=>o(this,null,function*(){yield e(t)}))}catch(e){throw console.error("laserScanFn error",e),e}};class Ur{constructor(){}setNativeUsagePermission(e){return o(this,null,function*(){try{return yield Ee.setNativeUsagePermission(e)}catch(r){throw console.error("lifecyclePlugin.setNativeUsagePermission error",r),r}})}authorizeWebCallback(e){return o(this,null,function*(){try{return yield Ee.authorizeWebCallback(e)}catch(r){throw console.error("lifecyclePlugin.authorizeWebCallback error",r),r}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:K.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((r,n)=>{try{const{mounted:a,beforeUnmount:i,callBack:s}=r;a(()=>{Xe(c=>o(this,null,function*(){var u;if(s&&s instanceof Function)try{(u=s(c))==null||u.then(()=>o(this,null,function*(){yield n.setNativeUsagePermission({action:K.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:K.MINI_APP_BEFORE_UNMOUNT_COMPLETION})}))}catch(_){console.error("miniAppBeforeUnmount error callBack is not a function or promise")}else console.error("miniAppBeforeUnmount error callBack is not a function or promise")}))}),i(()=>o(this,null,function*(){Xe(),n.setNativeUsagePermission({action:K.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1})}))}catch(a){throw console.error("miniAppBeforeUnmount error",a),a}})(e,this)}getStatus(){return o(this,null,function*(){try{return yield Ee.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let _e=null;window.__MICRO_APP_ENVIRONMENT__&&(_e=(wr=window.rawWindow.__mini_app_status_hook__)!=null?wr:{});const Le=l.registerPlugin("DeviceInteractionPlugin",{web:new class extends g{callVibrate(){return o(this,null,function*(){})}callErrorBeep(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=_e==null?void 0:_e.deviceInteraction)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("deviceInteraction getStatus error",t),t}}}});class xr{callVibrate(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callVibrate():yield Le.callVibrate()}catch(e){throw console.error("callVibrate error",e),e}})}callErrorBeep(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?yield window.rawWindow.__mini_app_hook__.callErrorBeep():yield Le.callErrorBeep()}catch(e){throw console.error("callErrorBeep error",e),e}})}getStatus(){return o(this,null,function*(){try{return yield Le.getStatus()}catch(e){throw console.error("deviceInteractionPlugin getStatus error",e),e}})}}const Ze="PollingPlugin";let he=null;window.__MICRO_APP_ENVIRONMENT__&&(he=(dr=window.rawWindow.__mini_app_status_hook__)!=null?dr:{});const ke=l.registerPlugin(Ze,{web:new class extends g{create(){return o(this,null,function*(){})}destroy(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=he==null?void 0:he.polling)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("polling getStatus error",t),t}}}}),me=M();me.removeAddListenerPolling=()=>null;const Dr=(t,e)=>{try{me.removeAddListenerPolling&&me.removeAddListenerPolling();const r=e.pollingId;(n=>o(this,null,function*(){return n&&(me.removeAddListenerPolling=yield(a=>o(this,null,function*(){try{if(l.addListener){const i=yield l.addListener(Ze,"nativeSendPolling",s=>a&&a(s));return i!=null&&i.remove?i.remove:()=>null}}catch(i){throw console.error("addListenerPollingHandle error",i),i}}))(n))}))(n=>{(n==null?void 0:n.pollingId)===r&&(n!=null&&n.pollingId)&&t.pollingList.forEach(a=>{a!=null&&a.pollingId&&(n==null?void 0:n.pollingId)===(a==null?void 0:a.pollingId)&&typeof(a==null?void 0:a.callBack)=="function"&&a.callBack(n)})})}catch(r){throw console.error("pollingFn error",r),r}};class jr{constructor(){S(this,"pollingList");this.pollingList=[]}create(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{mounted:i,pollingParams:s,callBack:c}=e;return i(()=>{var u,_;(_=(u=window.rawWindow.__mini_app_hook__)==null?void 0:u.addPolling)==null||_.call(u,s,c)}),()=>{this.destroy({pollingId:s.pollingId})}}try{(r=e==null?void 0:e.pollingParams)!=null&&r.pollingId&&this.pollingList.push({pollingId:(n=e==null?void 0:e.pollingParams)==null?void 0:n.pollingId,callBack:e==null?void 0:e.callBack}),this.pollingList=this.pollingList.filter((s,c,u)=>c===u.findIndex(_=>_.pollingId===s.pollingId));const i=((a=e==null?void 0:e.pollingParams)==null?void 0:a.delay)/1e3;return ke.create(fr(Mr({},e==null?void 0:e.pollingParams),{delay:i})),((s,c)=>{try{const{mounted:u,pollingParams:_}=s;u(()=>Dr(c,_))}catch(u){throw console.error("createPolling error",u),u}})(e,this),()=>{var s,c;return(s=e==null?void 0:e.pollingParams)!=null&&s.pollingId?this.destroy({pollingId:(c=e==null?void 0:e.pollingParams)==null?void 0:c.pollingId}):null}}catch(i){throw console.error("pollingPlugin create error",i),i}}destroy(e){var r,n,a;if(window.__MICRO_APP_ENVIRONMENT__){const{pollingId:i}=e;(n=(r=window.rawWindow.__mini_app_hook__)==null?void 0:r.deletePolling)==null||n.call(r,i)}else try{const i=this.pollingList.map(s=>s.pollingId).indexOf(e.pollingId);return(a=this.pollingList)!=null&&a.length&&(Number(i)||Number(i)>=0)&&this.pollingList.splice(Number(i),1),ke.destroy(e)}catch(i){throw console.error("pollingPlugin destroy error",i),i}}getStatus(){return o(this,null,function*(){try{return yield ke.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let pe=null;window.__MICRO_APP_ENVIRONMENT__&&(pe=(ur=window.rawWindow.__mini_app_status_hook__)!=null?ur:{});const Ye=l.registerPlugin("PaymentPlugin",{web:new class extends g{process(t){return o(this,null,function*(){try{return new Promise(e=>{e(t)})}catch(e){throw console.error("process error",e),e}})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=pe==null?void 0:pe.payment)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("payment getStatus error",t),t}}}});class Fr{process(e){return o(this,null,function*(){try{return yield Ye.process(e)}catch(r){throw console.error("paymentPlugins.process error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Ye.getStatus()}catch(e){throw console.error("getStatus error",e),e}})}}let ge=null;window.__MICRO_APP_ENVIRONMENT__&&(ge=(_r=window.rawWindow.__mini_app_status_hook__)!=null?_r:{});const Re=l.registerPlugin("CameraForTakePhotoPlugin",{web:new class extends g{pickCameraForTakePhoto(){return o(this,null,function*(){})}setCameraForTakePhotoState(){return o(this,null,function*(){})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ge==null?void 0:ge.cameraForTakePhoto)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("cameraForTakePhoto getStatus error",t),t}}}});class $r{pickCameraForTakePhoto(){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.pickCameraForTakePhoto():yield Re.pickCameraForTakePhoto()}catch(e){throw console.error("pickCameraForTakePhoto error",e),e}})}setCameraForTakePhotoState(e){return o(this,null,function*(){try{return window.__MICRO_APP_ENVIRONMENT__?window.rawWindow.__mini_app_hook__.setCameraForTakePhotoState(e):yield Re.setCameraForTakePhotoState(e)}catch(r){throw console.error("setCameraForTakePhotoState error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield Re.getStatus()}catch(e){throw console.error("cameraForTakePhotoPlugin getStatus error",e),e}})}}let Pe=null;window.__MICRO_APP_ENVIRONMENT__&&(Pe=(hr=window.rawWindow.__mini_app_status_hook__)!=null?hr:{});const er=l.registerPlugin("HttpPlugin",{web:new class extends g{request(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=Pe==null?void 0:Pe.http)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("http getStatus error",t),t}}}});class qr{request(e){return o(this,null,function*(){try{if(window.__MICRO_APP_ENVIRONMENT__)return window.rawWindow.__mini_app_hook__.requestHttp(e);{let r={};return e.url&&(r.url=e.url),e.method&&(r.method=e.method),e.headers&&(r.headers=e.headers),e.params&&(r.urlParams=e.params),e.data&&(typeof e.data=="string"?r.bodyData=e.data:r.bodyParams=e.data),e.upload&&(r.upload=e.upload),yield er.request(r)}}catch(r){throw console.error("HttpPlugin, trace error",r),r}})}getStatus(){return o(this,null,function*(){try{return yield er.getStatus()}catch(e){throw console.error("HttpPlugin getStatus error",e),e}})}}class rr{constructor(){S(this,"initialContextPlugins",new Ar);S(this,"communicatePlugins",new kr);S(this,"cameraScanPlugins",new Rr);S(this,"cameraScanMultiplePlugins",new br);S(this,"cameraScanMultipleNoCountPlugins",new Tr);S(this,"cameraScanSingleOrDualPlugins",new Br);S(this,"laserScanPlugins",new Hr);S(this,"countAssistPlugins",new Vr);S(this,"clickStreamPlugins",new Wr);S(this,"lifecyclePlugins",new Ur);S(this,"deviceInteractionPlugins",new xr);S(this,"pollingPlugins",new jr);S(this,"paymentPlugins",new Fr);S(this,"cameraForTakePhotoPlugin",new $r);S(this,"httpPlugin",new qr)}}const Kr=new rr;let w=null,ye=null;window.__MICRO_APP_ENVIRONMENT__&&(w=(mr=window.rawWindow.__mini_app_hook__)!=null?mr:{},ye=(pr=window.rawWindow.__mini_app_status_hook__)!=null?pr:{});const zr=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends g{homeIsClick(t){return o(this,null,function*(){var e;window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch homeIsClick",t),(e=w.disabledMenu)==null||e.call(w,t))})}openMiniApp(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.openMiniApp)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("openMiniApp error",r),r}})}showTitle(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&(console.log("window.microApp.forceDispatch showTitle",t),(e=w.showTitle)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showTitle error",r),r}})}showFABMenu(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.showFABMenu)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showFABMenu error",r),r}})}disableFAB(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.disableFAB)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableFAB error",r),r}})}disableBack(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.disableBack)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("disableBack error",r),r}})}showSubMask(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.showSubMask)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("showSubMask error",r),r}})}setMiniAppVersion(t){return o(this,null,function*(){var e;try{return window.__MICRO_APP_ENVIRONMENT__&&((e=w.setMiniAppVersion)==null||e.call(w,t)),new Promise(r=>{r(t)})}catch(r){throw console.error("setMiniAppVersion error",r),r}})}showDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.showDialog)==null||t.call(w))})}cancelDialog(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.cancelDialog)==null||t.call(w))})}getMiniAppKong(t){return o(this,null,function*(){var e,r;try{if(window.__MICRO_APP_ENVIRONMENT__){const n=(r=(e=w.getMiniAppKong)==null?void 0:e.call(w,t))!=null?r:{};return new Promise(a=>{a(n)})}return new Promise(n=>{n(t)})}catch(n){throw console.error("getMiniAppKong error",n),n}})}closeMiniApp(){return o(this,null,function*(){var t;window.__MICRO_APP_ENVIRONMENT__&&((t=w.closeMiniApp)==null||t.call(w))})}getStatus(){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(t=>o(this,null,function*(){var e,r;t((yield(r=(e=ye==null?void 0:ye.communicate)==null?void 0:e.getStatus)==null?void 0:r.call(e))||{})})):new Promise(t=>{t(null)})}catch(t){throw console.error("communicate getStatus error",t),t}}dispatchToShell(t){try{return window.__MICRO_APP_ENVIRONMENT__?new Promise(e=>o(this,null,function*(){var r;e((yield(r=w==null?void 0:w.dispatchToShell)==null?void 0:r.call(w,t))||{})})):new Promise(e=>{e(t)})}catch(e){throw console.error("communicate dispatchToShell error",e),e}}}},Symbol.toStringTag,{value:"Module"}));y.NativeApi=rr,y.default=Kr,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED