superapp-miniapp-invoke-native 1.0.52 → 1.0.54
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 +7 -7
- package/lib/main.js +115 -114
- package/lib/main.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/main.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { PluginCallback } from '@capacitor/core';
|
|
2
|
-
import
|
|
2
|
+
import { Router } from 'vue-router';
|
|
3
3
|
|
|
4
4
|
declare interface BackBtnApiParamsType {
|
|
5
|
-
backBtnCb
|
|
6
|
-
router?: Router;
|
|
5
|
+
backBtnCb: (value: string) => void;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
declare interface CommunicatePluginsHandleType {
|
|
@@ -15,7 +14,7 @@ declare interface CommunicatePluginsHandleType {
|
|
|
15
14
|
declare interface CommunicatePluginsHookType {
|
|
16
15
|
backBtnApiHook: (backBtnApiParams: BackBtnApiParamsType) => void;
|
|
17
16
|
homeBtnHandle: (cb: PluginCallback) => void;
|
|
18
|
-
|
|
17
|
+
fabBtnHandle: (data: any) => void;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
declare const _default: NativeApi;
|
|
@@ -42,16 +41,17 @@ declare interface MinAppType {
|
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
declare class NativeApi extends InitialContextPlugins implements CommunicatePluginsHookType, CommunicatePluginsHandleType {
|
|
44
|
+
constructor();
|
|
45
45
|
private communicatePlugins;
|
|
46
46
|
openMinAppHandle(minApp: MinAppType): Promise<MinAppType>;
|
|
47
47
|
showTitleHandle(title: TitleType): Promise<TitleType>;
|
|
48
48
|
showSubMaskHandle(subMask: subMaskType): Promise<subMaskType>;
|
|
49
|
-
backBtnApiHook(backBtnApiParams
|
|
50
|
-
initBackBtnHandle: () => void;
|
|
49
|
+
backBtnApiHook(backBtnApiParams?: BackBtnApiParamsType): {
|
|
50
|
+
initBackBtnHandle: (router: Router) => void;
|
|
51
51
|
registerBackBtnHandle: (registerBackBtnParams: registerBackBtnParamsType) => void;
|
|
52
52
|
};
|
|
53
53
|
homeBtnHandle(cb: PluginCallback): void;
|
|
54
|
-
|
|
54
|
+
fabBtnHandle(data: SetFabDataType): void;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
declare interface NativeAppInfoConfigType {
|
package/lib/main.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
var pe = Object.defineProperty;
|
|
2
2
|
var ue = (n, e, t) => e in n ? pe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var
|
|
4
|
-
var i = (n, e, t) => new Promise((
|
|
3
|
+
var B = (n, e, t) => (ue(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
var i = (n, e, t) => new Promise((a, r) => {
|
|
5
5
|
var o = (u) => {
|
|
6
6
|
try {
|
|
7
7
|
s(t.next(u));
|
|
8
8
|
} catch (p) {
|
|
9
|
-
|
|
9
|
+
r(p);
|
|
10
10
|
}
|
|
11
11
|
}, d = (u) => {
|
|
12
12
|
try {
|
|
13
13
|
s(t.throw(u));
|
|
14
14
|
} catch (p) {
|
|
15
|
-
|
|
15
|
+
r(p);
|
|
16
16
|
}
|
|
17
|
-
}, s = (u) => u.done ?
|
|
17
|
+
}, s = (u) => u.done ? a(u.value) : Promise.resolve(u.value).then(o, d);
|
|
18
18
|
s((t = t.apply(n, e)).next());
|
|
19
19
|
});
|
|
20
20
|
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
|
21
21
|
const me = (n) => n.CapacitorPlatforms = ((e) => {
|
|
22
22
|
const t = /* @__PURE__ */ new Map();
|
|
23
23
|
t.set("web", { name: "web" });
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
24
|
+
const a = e.CapacitorPlatforms || { currentPlatform: { name: "web" }, platforms: t };
|
|
25
|
+
return a.addPlatform = (r, o) => {
|
|
26
|
+
a.platforms.set(r, o);
|
|
27
|
+
}, a.setPlatform = (r) => {
|
|
28
|
+
a.platforms.has(r) && (a.currentPlatform = a.platforms.get(r));
|
|
29
|
+
}, a;
|
|
30
30
|
})(n), se = me(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {});
|
|
31
31
|
var S;
|
|
32
32
|
se.addPlatform, se.setPlatform, function(n) {
|
|
33
33
|
n.Unimplemented = "UNIMPLEMENTED", n.Unavailable = "UNAVAILABLE";
|
|
34
34
|
}(S || (S = {}));
|
|
35
35
|
class G extends Error {
|
|
36
|
-
constructor(e, t,
|
|
37
|
-
super(e), this.message = e, this.code = t, this.data =
|
|
36
|
+
constructor(e, t, a) {
|
|
37
|
+
super(e), this.message = e, this.code = t, this.data = a;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
const fe = (n) => {
|
|
41
|
-
var e, t,
|
|
41
|
+
var e, t, a, r, o;
|
|
42
42
|
const d = n.CapacitorCustomPlatform || null, s = n.Capacitor || {}, u = s.Plugins = s.Plugins || {}, p = n.CapacitorPlatforms, v = ((e = p == null ? void 0 : p.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => d !== null ? d.name : ((l) => {
|
|
43
43
|
var c, m;
|
|
44
44
|
return l != null && l.androidBridge ? "android" : !((m = (c = l == null ? void 0 : l.webkit) === null || c === void 0 ? void 0 : c.messageHandlers) === null || m === void 0) && m.bridge ? "ios" : "web";
|
|
45
|
-
})(n)), h = ((t = p == null ? void 0 : p.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => v() !== "web"), A = ((
|
|
45
|
+
})(n)), h = ((t = p == null ? void 0 : p.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => v() !== "web"), A = ((a = p == null ? void 0 : p.currentPlatform) === null || a === void 0 ? void 0 : a.isPluginAvailable) || ((l) => {
|
|
46
46
|
const c = g.get(l);
|
|
47
47
|
return !!(c != null && c.platforms.has(v())) || !!L(l);
|
|
48
|
-
}), L = ((
|
|
48
|
+
}), L = ((r = p == null ? void 0 : p.currentPlatform) === null || r === void 0 ? void 0 : r.getPluginHeader) || ((l) => {
|
|
49
49
|
var c;
|
|
50
50
|
return (c = s.PluginHeaders) === null || c === void 0 ? void 0 : c.find((m) => m.name === l);
|
|
51
51
|
}), g = /* @__PURE__ */ new Map(), b = ((o = p == null ? void 0 : p.currentPlatform) === null || o === void 0 ? void 0 : o.registerPlugin) || ((l, c = {}) => {
|
|
@@ -53,12 +53,12 @@ const fe = (n) => {
|
|
|
53
53
|
if (m)
|
|
54
54
|
return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`), m.proxy;
|
|
55
55
|
const _ = v(), N = L(l);
|
|
56
|
-
let
|
|
56
|
+
let O;
|
|
57
57
|
const V = (P) => {
|
|
58
|
-
let
|
|
58
|
+
let C;
|
|
59
59
|
const E = (...x) => {
|
|
60
60
|
const T = (() => i(void 0, null, function* () {
|
|
61
|
-
return !
|
|
61
|
+
return !O && _ in c ? O = O = typeof c[_] == "function" ? yield c[_]() : c[_] : d !== null && !O && "web" in c && (O = O = typeof c.web == "function" ? yield c.web() : c.web), O;
|
|
62
62
|
}))().then((M) => {
|
|
63
63
|
const ae = ((y, j) => {
|
|
64
64
|
var q, z;
|
|
@@ -77,25 +77,25 @@ const fe = (n) => {
|
|
|
77
77
|
})(M, P);
|
|
78
78
|
if (ae) {
|
|
79
79
|
const y = ae(...x);
|
|
80
|
-
return
|
|
80
|
+
return C = y == null ? void 0 : y.remove, y;
|
|
81
81
|
}
|
|
82
82
|
throw new G(`"${l}.${P}()" is not implemented on ${_}`, S.Unimplemented);
|
|
83
83
|
});
|
|
84
84
|
return P === "addListener" && (T.remove = () => i(void 0, null, function* () {
|
|
85
|
-
return
|
|
85
|
+
return C();
|
|
86
86
|
})), T;
|
|
87
87
|
};
|
|
88
88
|
return E.toString = () => `${P.toString()}() { [capacitor code] }`, Object.defineProperty(E, "name", { value: P, writable: !1, configurable: !1 }), E;
|
|
89
|
-
}, ne = V("addListener"), te = V("removeListener"), le = (P,
|
|
90
|
-
const E = ne({ eventName: P },
|
|
89
|
+
}, ne = V("addListener"), te = V("removeListener"), le = (P, C) => {
|
|
90
|
+
const E = ne({ eventName: P }, C), x = () => i(void 0, null, function* () {
|
|
91
91
|
const M = yield E;
|
|
92
|
-
te({ eventName: P, callbackId: M },
|
|
92
|
+
te({ eventName: P, callbackId: M }, C);
|
|
93
93
|
}), T = new Promise((M) => E.then(() => M({ remove: x })));
|
|
94
94
|
return T.remove = () => i(void 0, null, function* () {
|
|
95
95
|
console.warn("Using addListener() without 'await' is deprecated."), yield x();
|
|
96
96
|
}), T;
|
|
97
|
-
}, W = new Proxy({}, { get(P,
|
|
98
|
-
switch (
|
|
97
|
+
}, W = new Proxy({}, { get(P, C) {
|
|
98
|
+
switch (C) {
|
|
99
99
|
case "$$typeof":
|
|
100
100
|
return;
|
|
101
101
|
case "toJSON":
|
|
@@ -105,7 +105,7 @@ const fe = (n) => {
|
|
|
105
105
|
case "removeListener":
|
|
106
106
|
return te;
|
|
107
107
|
default:
|
|
108
|
-
return V(
|
|
108
|
+
return V(C);
|
|
109
109
|
}
|
|
110
110
|
} });
|
|
111
111
|
return u[l] = W, g.set(l, { name: l, proxy: W, platforms: /* @__PURE__ */ new Set([...Object.keys(c), ...N ? [_] : []]) }), W;
|
|
@@ -119,13 +119,13 @@ class R {
|
|
|
119
119
|
}
|
|
120
120
|
addListener(e, t) {
|
|
121
121
|
this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const
|
|
122
|
+
const a = this.windowListeners[e];
|
|
123
|
+
a && !a.registered && this.addWindowListener(a);
|
|
124
|
+
const r = () => i(this, null, function* () {
|
|
125
125
|
return this.removeListener(e, t);
|
|
126
|
-
}), o = Promise.resolve({ remove:
|
|
126
|
+
}), o = Promise.resolve({ remove: r });
|
|
127
127
|
return Object.defineProperty(o, "remove", { value: () => i(this, null, function* () {
|
|
128
|
-
console.warn("Using addListener() without 'await' is deprecated."), yield
|
|
128
|
+
console.warn("Using addListener() without 'await' is deprecated."), yield r();
|
|
129
129
|
}) }), o;
|
|
130
130
|
}
|
|
131
131
|
removeAllListeners() {
|
|
@@ -137,15 +137,15 @@ class R {
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
notifyListeners(e, t) {
|
|
140
|
-
const
|
|
141
|
-
|
|
140
|
+
const a = this.listeners[e];
|
|
141
|
+
a && a.forEach((r) => r(t));
|
|
142
142
|
}
|
|
143
143
|
hasListeners(e) {
|
|
144
144
|
return !!this.listeners[e].length;
|
|
145
145
|
}
|
|
146
146
|
registerWindowListener(e, t) {
|
|
147
|
-
this.windowListeners[t] = { registered: !1, windowEventName: e, pluginEventName: t, handler: (
|
|
148
|
-
this.notifyListeners(t,
|
|
147
|
+
this.windowListeners[t] = { registered: !1, windowEventName: e, pluginEventName: t, handler: (a) => {
|
|
148
|
+
this.notifyListeners(t, a);
|
|
149
149
|
} };
|
|
150
150
|
}
|
|
151
151
|
unimplemented(e = "not implemented") {
|
|
@@ -156,11 +156,11 @@ class R {
|
|
|
156
156
|
}
|
|
157
157
|
removeListener(e, t) {
|
|
158
158
|
return i(this, null, function* () {
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
159
|
+
const a = this.listeners[e];
|
|
160
|
+
if (!a)
|
|
161
161
|
return;
|
|
162
|
-
const
|
|
163
|
-
this.listeners[e].splice(
|
|
162
|
+
const r = a.indexOf(t);
|
|
163
|
+
this.listeners[e].splice(r, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
addWindowListener(e) {
|
|
@@ -175,19 +175,19 @@ class he extends R {
|
|
|
175
175
|
getCookies() {
|
|
176
176
|
return i(this, null, function* () {
|
|
177
177
|
const e = document.cookie, t = {};
|
|
178
|
-
return e.split(";").forEach((
|
|
179
|
-
if (
|
|
178
|
+
return e.split(";").forEach((a) => {
|
|
179
|
+
if (a.length <= 0)
|
|
180
180
|
return;
|
|
181
|
-
let [
|
|
182
|
-
|
|
181
|
+
let [r, o] = a.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
|
|
182
|
+
r = ie(r).trim(), o = ie(o).trim(), t[r] = o;
|
|
183
183
|
}), t;
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
setCookie(e) {
|
|
187
187
|
return i(this, null, function* () {
|
|
188
188
|
try {
|
|
189
|
-
const t = oe(e.key),
|
|
190
|
-
document.cookie = `${t}=${
|
|
189
|
+
const t = oe(e.key), a = oe(e.value), r = `; expires=${(e.expires || "").replace("expires=", "")}`, o = (e.path || "/").replace("path=", ""), d = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
|
|
190
|
+
document.cookie = `${t}=${a || ""}${r}; path=${o}; ${d};`;
|
|
191
191
|
} catch (t) {
|
|
192
192
|
return Promise.reject(t);
|
|
193
193
|
}
|
|
@@ -225,43 +225,43 @@ class he extends R {
|
|
|
225
225
|
}
|
|
226
226
|
Y("CapacitorCookies", { web: () => new he() });
|
|
227
227
|
const ve = (n, e = {}) => {
|
|
228
|
-
const t = Object.assign({ method: n.method || "GET", headers: n.headers }, e),
|
|
229
|
-
const o = Object.keys(
|
|
230
|
-
return Object.keys(
|
|
228
|
+
const t = Object.assign({ method: n.method || "GET", headers: n.headers }, e), a = ((r = {}) => {
|
|
229
|
+
const o = Object.keys(r);
|
|
230
|
+
return Object.keys(r).map((d) => d.toLocaleLowerCase()).reduce((d, s, u) => (d[s] = r[o[u]], d), {});
|
|
231
231
|
})(n.headers)["content-type"] || "";
|
|
232
232
|
if (typeof n.data == "string")
|
|
233
233
|
t.body = n.data;
|
|
234
|
-
else if (
|
|
235
|
-
const
|
|
234
|
+
else if (a.includes("application/x-www-form-urlencoded")) {
|
|
235
|
+
const r = new URLSearchParams();
|
|
236
236
|
for (const [o, d] of Object.entries(n.data || {}))
|
|
237
|
-
|
|
238
|
-
t.body =
|
|
239
|
-
} else if (
|
|
240
|
-
const
|
|
237
|
+
r.set(o, d);
|
|
238
|
+
t.body = r.toString();
|
|
239
|
+
} else if (a.includes("multipart/form-data")) {
|
|
240
|
+
const r = new FormData();
|
|
241
241
|
if (n.data instanceof FormData)
|
|
242
242
|
n.data.forEach((d, s) => {
|
|
243
|
-
|
|
243
|
+
r.append(s, d);
|
|
244
244
|
});
|
|
245
245
|
else
|
|
246
246
|
for (const d of Object.keys(n.data))
|
|
247
|
-
|
|
248
|
-
t.body =
|
|
247
|
+
r.append(d, n.data[d]);
|
|
248
|
+
t.body = r;
|
|
249
249
|
const o = new Headers(t.headers);
|
|
250
250
|
o.delete("content-type"), t.headers = o;
|
|
251
251
|
} else
|
|
252
|
-
(
|
|
252
|
+
(a.includes("application/json") || typeof n.data == "object") && (t.body = JSON.stringify(n.data));
|
|
253
253
|
return t;
|
|
254
254
|
};
|
|
255
255
|
class ge extends R {
|
|
256
256
|
request(e) {
|
|
257
257
|
return i(this, null, function* () {
|
|
258
|
-
const t = ve(e, e.webFetchExtra),
|
|
258
|
+
const t = ve(e, e.webFetchExtra), a = ((h, A = !0) => h ? Object.entries(h).reduce((L, g) => {
|
|
259
259
|
const [b, l] = g;
|
|
260
260
|
let c, m;
|
|
261
261
|
return Array.isArray(l) ? (m = "", l.forEach((_) => {
|
|
262
262
|
c = A ? encodeURIComponent(_) : _, m += `${b}=${c}&`;
|
|
263
263
|
}), m.slice(0, -1)) : (c = A ? encodeURIComponent(l) : l, m = `${b}=${c}`), `${L}&${m}`;
|
|
264
|
-
}, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams),
|
|
264
|
+
}, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams), r = a ? `${e.url}?${a}` : e.url, o = yield fetch(r, t), d = o.headers.get("content-type") || "";
|
|
265
265
|
let s, u, { responseType: p = "text" } = o.ok ? e : {};
|
|
266
266
|
switch (d.includes("application/json") && (p = "json"), p) {
|
|
267
267
|
case "arraybuffer":
|
|
@@ -327,28 +327,28 @@ const be = Object.freeze({ __proto__: null, PortalsWeb: class extends R {
|
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
} });
|
|
330
|
-
var I = ((n) => (n.DEV = "dev", n.SIT = "sit", n.UAT = "uat", n.PROD = "prod", n.TEST = "test", n))(I || {}),
|
|
330
|
+
var I = ((n) => (n.DEV = "dev", n.SIT = "sit", n.UAT = "uat", n.PROD = "prod", n.TEST = "test", n))(I || {}), F = ((n) => (n.EU = "eu", n.ASIA = "asia", n))(F || {});
|
|
331
331
|
const Q = (n) => {
|
|
332
|
-
var e, t,
|
|
332
|
+
var e, t, a;
|
|
333
333
|
if (typeof window != "undefined" && J && ((e = J()) != null && e.value)) {
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
334
|
+
const r = (a = (t = J()) == null ? void 0 : t.value) != null ? a : null;
|
|
335
|
+
if (!r)
|
|
336
336
|
return void console.error("native initialContext is undefine");
|
|
337
337
|
if (!n)
|
|
338
338
|
return void console.error("initialContext call back is undefine");
|
|
339
|
-
n(
|
|
339
|
+
n(r);
|
|
340
340
|
}
|
|
341
341
|
}, _e = (n) => new Promise((e) => i(void 0, null, function* () {
|
|
342
342
|
let t = null;
|
|
343
|
-
t = n != null && n.mockData ? n.mockData : ((
|
|
343
|
+
t = n != null && n.mockData ? n.mockData : ((a, { asiaUatData: r, euSitData: o, euUatData: d }) => {
|
|
344
344
|
var v, h;
|
|
345
|
-
const s = (v =
|
|
345
|
+
const s = (v = a.mockServerInfo) == null ? void 0 : v.env, u = (h = a.mockServerInfo) == null ? void 0 : h.area;
|
|
346
346
|
let p = null;
|
|
347
|
-
return s && u && (
|
|
348
|
-
})(n, { asiaUatData: yield Promise.resolve().then(() =>
|
|
347
|
+
return s && u && (F.ASIA === u ? I.UAT === s && (p = r) : F.EU === u && (I.SIT === s ? p = o : I.UAT === s && (p = d))), p;
|
|
348
|
+
})(n, { asiaUatData: yield Promise.resolve().then(() => Ce), euSitData: yield Promise.resolve().then(() => Oe), euUatData: yield Promise.resolve().then(() => Le) }), e(t ? t != null && t.default ? t == null ? void 0 : t.default : t : null);
|
|
349
349
|
})), U = class U {
|
|
350
350
|
constructor() {
|
|
351
|
-
|
|
351
|
+
B(this, "nativeAppInfoConfig");
|
|
352
352
|
this.nativeAppInfoConfig = U.defaultNativeAppInfoConfig;
|
|
353
353
|
}
|
|
354
354
|
isNativeHandle() {
|
|
@@ -364,15 +364,15 @@ const Q = (n) => {
|
|
|
364
364
|
specifiedPageHandle(e) {
|
|
365
365
|
return i(this, null, function* () {
|
|
366
366
|
yield (({ cb: t }) => {
|
|
367
|
-
Q((
|
|
367
|
+
Q((a) => {
|
|
368
368
|
var s;
|
|
369
|
-
if (!(
|
|
369
|
+
if (!(a != null && a.params))
|
|
370
370
|
return void console.error("native params is undefine");
|
|
371
|
-
const
|
|
372
|
-
if (!
|
|
371
|
+
const r = (s = JSON.parse(a.params)) != null ? s : null;
|
|
372
|
+
if (!r)
|
|
373
373
|
return;
|
|
374
|
-
const { params: o, routeName: d } =
|
|
375
|
-
o && d && (t ? t(
|
|
374
|
+
const { params: o, routeName: d } = r;
|
|
375
|
+
o && d && (t ? t(r) : console.error("call back is undefine"));
|
|
376
376
|
});
|
|
377
377
|
})(e);
|
|
378
378
|
});
|
|
@@ -381,14 +381,14 @@ const Q = (n) => {
|
|
|
381
381
|
return i(this, null, function* () {
|
|
382
382
|
return this.nativeAppInfoConfig = e != null && e.mockServerInfo || e != null && e.mockData ? e : U.defaultNativeAppInfoConfig, (yield this.isNativeHandle()) ? yield (() => {
|
|
383
383
|
let t = null;
|
|
384
|
-
return Q((
|
|
385
|
-
t =
|
|
384
|
+
return Q((a) => {
|
|
385
|
+
t = a != null ? a : null;
|
|
386
386
|
}), t;
|
|
387
387
|
})() : yield _e(this.nativeAppInfoConfig);
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
390
|
};
|
|
391
|
-
|
|
391
|
+
B(U, "defaultNativeAppInfoConfig", { mockServerInfo: { area: F.ASIA, env: I.UAT } });
|
|
392
392
|
let Z = U;
|
|
393
393
|
const ee = () => {
|
|
394
394
|
let n = null;
|
|
@@ -400,8 +400,8 @@ const ye = (n) => {
|
|
|
400
400
|
((e) => i(void 0, null, function* () {
|
|
401
401
|
k != null && k.addListenerBackHandle && e && (k.addListenerBackHandle = yield ((t) => i(void 0, null, function* () {
|
|
402
402
|
if (w.addListener) {
|
|
403
|
-
const
|
|
404
|
-
return
|
|
403
|
+
const a = yield w.addListener(K, "nativeSendBack", (r) => t && t(r));
|
|
404
|
+
return a != null && a.remove ? a.remove : () => null;
|
|
405
405
|
}
|
|
406
406
|
}))(e));
|
|
407
407
|
}))(n);
|
|
@@ -412,15 +412,15 @@ const X = (n) => {
|
|
|
412
412
|
de = (e) => {
|
|
413
413
|
n && n(e);
|
|
414
414
|
};
|
|
415
|
-
},
|
|
416
|
-
|
|
415
|
+
}, D = ee();
|
|
416
|
+
D.addListenerHomeHandle = () => null;
|
|
417
417
|
const Pe = (n) => {
|
|
418
|
-
|
|
418
|
+
D.addListenerHomeHandle && D.addListenerHomeHandle(), setTimeout(() => {
|
|
419
419
|
((e) => i(void 0, null, function* () {
|
|
420
|
-
e && (
|
|
420
|
+
e && (D.addListenerHomeHandle = yield ((t) => i(void 0, null, function* () {
|
|
421
421
|
if (w.addListener) {
|
|
422
|
-
const
|
|
423
|
-
return
|
|
422
|
+
const a = yield w.addListener(K, "nativeSendHome", (r) => t && t(r));
|
|
423
|
+
return a != null && a.remove ? a.remove : () => null;
|
|
424
424
|
}
|
|
425
425
|
}))(e));
|
|
426
426
|
}))(n);
|
|
@@ -428,26 +428,26 @@ const Pe = (n) => {
|
|
|
428
428
|
}, $ = ee();
|
|
429
429
|
$.removeAddListenerFab = () => null;
|
|
430
430
|
const ke = (n) => {
|
|
431
|
-
var t,
|
|
431
|
+
var t, a;
|
|
432
432
|
$.removeAddListenerFab && $.removeAddListenerFab();
|
|
433
433
|
const e = [];
|
|
434
|
-
(t = f.showFABMenu) == null || t.call(f, { fabMenu: e }), n && ((
|
|
435
|
-
e.push({ icon: n[
|
|
434
|
+
(t = f.showFABMenu) == null || t.call(f, { fabMenu: e }), n && ((a = Object.keys(n)) != null && a.length) && (Object.keys(n).forEach((r) => {
|
|
435
|
+
e.push({ icon: n[r].icon, id: n[r].id, name: n[r].title });
|
|
436
436
|
}), queueMicrotask(() => {
|
|
437
|
-
var
|
|
438
|
-
(
|
|
437
|
+
var r;
|
|
438
|
+
(r = f.showFABMenu) == null || r.call(f, { fabMenu: e });
|
|
439
439
|
}), setTimeout(() => {
|
|
440
|
-
((
|
|
441
|
-
|
|
440
|
+
((r) => i(void 0, null, function* () {
|
|
441
|
+
r && ($.removeAddListenerFab = yield ((o) => i(void 0, null, function* () {
|
|
442
442
|
if (w.addListener) {
|
|
443
443
|
const d = yield w.addListener(K, "nativeSendFab", (s) => o && o(s));
|
|
444
444
|
return d != null && d.remove ? d.remove : () => null;
|
|
445
445
|
}
|
|
446
|
-
}))(
|
|
447
|
-
}))((
|
|
446
|
+
}))(r));
|
|
447
|
+
}))((r) => {
|
|
448
448
|
let o;
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
r && r.id && Object.keys(n).forEach((d) => {
|
|
450
|
+
r.id === n[d].id && (o = n[d].fn);
|
|
451
451
|
}), o && o();
|
|
452
452
|
});
|
|
453
453
|
}));
|
|
@@ -479,34 +479,35 @@ class Ae {
|
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
481
|
backBtnApiHook(e) {
|
|
482
|
-
return
|
|
483
|
-
|
|
482
|
+
return t = e, { initBackBtnHandle: (a) => {
|
|
483
|
+
a && a.afterEach((r) => {
|
|
484
484
|
ye(() => {
|
|
485
|
-
|
|
485
|
+
r != null && r.name && de(r.name);
|
|
486
486
|
});
|
|
487
487
|
});
|
|
488
488
|
}, registerBackBtnHandle: (a) => {
|
|
489
|
-
const { onMounted:
|
|
490
|
-
|
|
491
|
-
X((
|
|
492
|
-
t && t(
|
|
489
|
+
const { onMounted: r, onUnmounted: o } = a;
|
|
490
|
+
r(() => {
|
|
491
|
+
X((d) => {
|
|
492
|
+
t != null && t.backBtnCb && t.backBtnCb(d);
|
|
493
493
|
});
|
|
494
|
-
}),
|
|
494
|
+
}), o(() => {
|
|
495
495
|
X && X(() => "");
|
|
496
496
|
});
|
|
497
|
-
} }
|
|
497
|
+
} };
|
|
498
|
+
var t;
|
|
498
499
|
}
|
|
499
500
|
homeBtnHandle(e) {
|
|
500
501
|
Pe(e);
|
|
501
502
|
}
|
|
502
|
-
|
|
503
|
+
fabBtnHandle(e) {
|
|
503
504
|
ke(e);
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
507
|
const Ne = new class extends Z {
|
|
507
508
|
constructor() {
|
|
508
|
-
super(
|
|
509
|
-
|
|
509
|
+
super();
|
|
510
|
+
B(this, "communicatePlugins", new Ae());
|
|
510
511
|
}
|
|
511
512
|
openMinAppHandle(e) {
|
|
512
513
|
return i(this, null, function* () {
|
|
@@ -529,10 +530,10 @@ const Ne = new class extends Z {
|
|
|
529
530
|
homeBtnHandle(e) {
|
|
530
531
|
this.communicatePlugins.homeBtnHandle(e);
|
|
531
532
|
}
|
|
532
|
-
|
|
533
|
-
this.communicatePlugins.
|
|
533
|
+
fabBtnHandle(e) {
|
|
534
|
+
this.communicatePlugins.fabBtnHandle(e);
|
|
534
535
|
}
|
|
535
|
-
}(),
|
|
536
|
+
}(), Ce = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "WTCHK", tenants: [{ store_detail_list: [{ name: "APELDOORN HOOFDSTRAAT 136", code: "3462" }], name: "WTCHK", stores: ["3462"], timezone: "Europe/Amsterdam", code: "WTCHK" }] }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "asia", serverEnv: "uat" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { name: "APELDOORN HOOFDSTRAAT 3462", code: "3462" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Oe = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Le = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Ee = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends R {
|
|
536
537
|
homeIsClick() {
|
|
537
538
|
return i(this, null, function* () {
|
|
538
539
|
});
|
package/lib/main.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(w,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m():typeof define=="function"&&define.amd?define(m):(w=typeof globalThis!="undefined"?globalThis:w||self).main=m()})(this,function(){"use strict";var Ee=Object.defineProperty;var Se=(w,m,u)=>m in w?Ee(w,m,{enumerable:!0,configurable:!0,writable:!0,value:u}):w[m]=u;var J=(w,m,u)=>(Se(w,typeof m!="symbol"?m+"":m,u),u);var s=(w,m,u)=>new Promise((I,K)=>{var Q=v=>{try{T(u.next(v))}catch(j){K(j)}},h=v=>{try{T(u.throw(v))}catch(j){K(j)}},T=v=>v.done?I(v.value):Promise.resolve(v.value).then(Q,h);T((u=u.apply(w,m)).next())});/*! Capacitor: https://capacitorjs.com/ - MIT License */const w=n=>n.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const a=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return a.addPlatform=(r,i)=>{a.platforms.set(r,i)},a.setPlatform=r=>{a.platforms.has(r)&&(a.currentPlatform=a.platforms.get(r))},a})(n),m=w(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var u;m.addPlatform,m.setPlatform,function(n){n.Unimplemented="UNIMPLEMENTED",n.Unavailable="UNAVAILABLE"}(u||(u={}));class I extends Error{constructor(e,t,a){super(e),this.message=e,this.code=t,this.data=a}}const K=n=>{var e,t,a,r,i;const d=n.CapacitorCustomPlatform||null,o=n.Capacitor||{},_=o.Plugins=o.Plugins||{},p=n.CapacitorPlatforms,y=((e=p==null?void 0:p.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>d!==null?d.name:(l=>{var c,f;return l!=null&&l.androidBridge?"android":!((f=(c=l==null?void 0:l.webkit)===null||c===void 0?void 0:c.messageHandlers)===null||f===void 0)&&f.bridge?"ios":"web"})(n)),b=((t=p==null?void 0:p.currentPlatform)===null||t===void 0?void 0:t.isNativePlatform)||(()=>y()!=="web"),E=((a=p==null?void 0:p.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||(l=>{const c=P.get(l);return!!(c!=null&&c.platforms.has(y()))||!!M(l)}),M=((r=p==null?void 0:p.currentPlatform)===null||r===void 0?void 0:r.getPluginHeader)||(l=>{var c;return(c=o.PluginHeaders)===null||c===void 0?void 0:c.find(f=>f.name===l)}),P=new Map,k=((i=p==null?void 0:p.currentPlatform)===null||i===void 0?void 0:i.registerPlugin)||((l,c={})=>{const f=P.get(l);if(f)return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`),f.proxy;const A=y(),D=M(l);let N;const te=L=>{let S;const H=(...G)=>{const F=(()=>s(this,null,function*(){return!N&&A in c?N=N=typeof c[A]=="function"?yield c[A]():c[A]:d!==null&&!N&&"web"in c&&(N=N=typeof c.web=="function"?yield c.web():c.web),N}))().then($=>{const ce=((O,B)=>{var re,oe;if(!D){if(O)return(oe=O[B])===null||oe===void 0?void 0:oe.bind(O);throw new I(`"${l}" plugin is not implemented on ${A}`,u.Unimplemented)}{const pe=D==null?void 0:D.methods.find(R=>B===R.name);if(pe)return pe.rtype==="promise"?R=>o.nativePromise(l,B.toString(),R):(R,Le)=>o.nativeCallback(l,B.toString(),R,Le);if(O)return(re=O[B])===null||re===void 0?void 0:re.bind(O)}})($,L);if(ce){const O=ce(...G);return S=O==null?void 0:O.remove,O}throw new I(`"${l}.${L}()" is not implemented on ${A}`,u.Unimplemented)});return L==="addListener"&&(F.remove=()=>s(this,null,function*(){return S()})),F};return H.toString=()=>`${L.toString()}() { [capacitor code] }`,Object.defineProperty(H,"name",{value:L,writable:!1,configurable:!1}),H},de=te("addListener"),le=te("removeListener"),Ce=(L,S)=>{const H=de({eventName:L},S),G=()=>s(this,null,function*(){const $=yield H;le({eventName:L,callbackId:$},S)}),F=new Promise($=>H.then(()=>$({remove:G})));return F.remove=()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield G()}),F},ae=new Proxy({},{get(L,S){switch(S){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return D?Ce:de;case"removeListener":return le;default:return te(S)}}});return _[l]=ae,P.set(l,{name:l,proxy:ae,platforms:new Set([...Object.keys(c),...D?[A]:[]])}),ae});return o.convertFileSrc||(o.convertFileSrc=l=>l),o.getPlatform=y,o.handleError=l=>n.console.error(l),o.isNativePlatform=b,o.isPluginAvailable=E,o.pluginMethodNoop=(l,c,f)=>Promise.reject(`${f} does not have an implementation of "${c}".`),o.registerPlugin=k,o.Exception=I,o.DEBUG=!!o.DEBUG,o.isLoggingEnabled=!!o.isLoggingEnabled,o.platform=o.getPlatform(),o.isNative=o.isNativePlatform(),o},Q=n=>n.Capacitor=K(n),h=Q(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),T=h.registerPlugin;h.Plugins;class v{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,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const a=this.windowListeners[e];a&&!a.registered&&this.addWindowListener(a);const r=()=>s(this,null,function*(){return this.removeListener(e,t)}),i=Promise.resolve({remove:r});return Object.defineProperty(i,"remove",{value:()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield r()})}),i}removeAllListeners(){return s(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,t){const a=this.listeners[e];a&&a.forEach(r=>r(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:a=>{this.notifyListeners(t,a)}}}unimplemented(e="not implemented"){return new h.Exception(e,u.Unimplemented)}unavailable(e="not available"){return new h.Exception(e,u.Unavailable)}removeListener(e,t){return s(this,null,function*(){const a=this.listeners[e];if(!a)return;const r=a.indexOf(t);this.listeners[e].splice(r,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 j=n=>encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),se=n=>n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ue extends v{getCookies(){return s(this,null,function*(){const e=document.cookie,t={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[r,i]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=se(r).trim(),i=se(i).trim(),t[r]=i}),t})}setCookie(e){return s(this,null,function*(){try{const t=j(e.key),a=j(e.value),r=`; expires=${(e.expires||"").replace("expires=","")}`,i=(e.path||"/").replace("path=",""),d=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${a||""}${r}; path=${i}; ${d};`}catch(t){return Promise.reject(t)}})}deleteCookie(e){return s(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}})}clearCookies(){return s(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}})}clearAllCookies(){return s(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}T("CapacitorCookies",{web:()=>new ue});const me=(n,e={})=>{const t=Object.assign({method:n.method||"GET",headers:n.headers},e),a=((r={})=>{const i=Object.keys(r);return Object.keys(r).map(d=>d.toLocaleLowerCase()).reduce((d,o,_)=>(d[o]=r[i[_]],d),{})})(n.headers)["content-type"]||"";if(typeof n.data=="string")t.body=n.data;else if(a.includes("application/x-www-form-urlencoded")){const r=new URLSearchParams;for(const[i,d]of Object.entries(n.data||{}))r.set(i,d);t.body=r.toString()}else if(a.includes("multipart/form-data")){const r=new FormData;if(n.data instanceof FormData)n.data.forEach((d,o)=>{r.append(o,d)});else for(const d of Object.keys(n.data))r.append(d,n.data[d]);t.body=r;const i=new Headers(t.headers);i.delete("content-type"),t.headers=i}else(a.includes("application/json")||typeof n.data=="object")&&(t.body=JSON.stringify(n.data));return t};class fe extends v{request(e){return s(this,null,function*(){const t=me(e,e.webFetchExtra),a=((b,E=!0)=>b?Object.entries(b).reduce((M,P)=>{const[k,l]=P;let c,f;return Array.isArray(l)?(f="",l.forEach(A=>{c=E?encodeURIComponent(A):A,f+=`${k}=${c}&`}),f.slice(0,-1)):(c=E?encodeURIComponent(l):l,f=`${k}=${c}`),`${M}&${f}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),r=a?`${e.url}?${a}`:e.url,i=yield fetch(r,t),d=i.headers.get("content-type")||"";let o,_,{responseType:p="text"}=i.ok?e:{};switch(d.includes("application/json")&&(p="json"),p){case"arraybuffer":case"blob":_=yield i.blob(),o=yield(b=>s(this,null,function*(){return new Promise((E,M)=>{const P=new FileReader;P.onload=()=>{const k=P.result;E(k.indexOf(",")>=0?k.split(",")[1]:k)},P.onerror=k=>M(k),P.readAsDataURL(b)})}))(_);break;case"json":o=yield i.json();break;default:o=yield i.text()}const y={};return i.headers.forEach((b,E)=>{y[E]=b}),{data:o,headers:y,status:i.status,url:i.url}})}get(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return s(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function X(){return h.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}T("CapacitorHttp",{web:()=>new fe}),T("Portals",{web:()=>Promise.resolve().then(function(){return he}).then(n=>new n.PortalsWeb)});const he=Object.freeze({__proto__:null,PortalsWeb:class extends v{publishNative(n){return s(this,null,function*(){})}}});var U=(n=>(n.DEV="dev",n.SIT="sit",n.UAT="uat",n.PROD="prod",n.TEST="test",n))(U||{}),V=(n=>(n.EU="eu",n.ASIA="asia",n))(V||{});const Y=n=>{var e,t,a;if(typeof window!="undefined"&&X&&((e=X())!=null&&e.value)){const r=(a=(t=X())==null?void 0:t.value)!=null?a:null;if(!r)return void console.error("native initialContext is undefine");if(!n)return void console.error("initialContext call back is undefine");n(r)}},we=n=>new Promise(e=>s(this,null,function*(){let t=null;t=n!=null&&n.mockData?n.mockData:((a,{asiaUatData:r,euSitData:i,euUatData:d})=>{var y,b;const o=(y=a.mockServerInfo)==null?void 0:y.env,_=(b=a.mockServerInfo)==null?void 0:b.area;let p=null;return o&&_&&(V.ASIA===_?U.UAT===o&&(p=r):V.EU===_&&(U.SIT===o?p=i:U.UAT===o&&(p=d))),p})(n,{asiaUatData:yield Promise.resolve().then(()=>Pe),euSitData:yield Promise.resolve().then(()=>ke),euUatData:yield Promise.resolve().then(()=>Ae)}),e(t?t!=null&&t.default?t==null?void 0:t.default:t:null)})),x=class x{constructor(){J(this,"nativeAppInfoConfig");this.nativeAppInfoConfig=x.defaultNativeAppInfoConfig}isNativeHandle(){return s(this,null,function*(){return yield(()=>{let e=!1;return Y(t=>{e=!!(t!=null&&t.isNative)}),e})()})}specifiedPageHandle(e){return s(this,null,function*(){yield(({cb:t})=>{Y(a=>{var o;if(!(a!=null&&a.params))return void console.error("native params is undefine");const r=(o=JSON.parse(a.params))!=null?o:null;if(!r)return;const{params:i,routeName:d}=r;i&&d&&(t?t(r):console.error("call back is undefine"))})})(e)})}nativeAppInfoHandle(e){return s(this,null,function*(){return this.nativeAppInfoConfig=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:x.defaultNativeAppInfoConfig,(yield this.isNativeHandle())?yield(()=>{let t=null;return Y(a=>{t=a!=null?a:null}),t})():yield we(this.nativeAppInfoConfig)})}};J(x,"defaultNativeAppInfoConfig",{mockServerInfo:{area:V.ASIA,env:U.UAT}});let Z=x;const ee=()=>{let n=null;return n=typeof window=="undefined"?{}:window,n},W="CommunicatePlugin",g=h.registerPlugin(W,{web:()=>Promise.resolve().then(()=>Oe).then(n=>new n.PluginsWeb)}),C=ee();C.addListenerBackHandle=()=>null;const ve=n=>{C!=null&&C.addListenerBackHandle&&C.addListenerBackHandle(),setTimeout(()=>{(e=>s(this,null,function*(){C!=null&&C.addListenerBackHandle&&e&&(C.addListenerBackHandle=yield(t=>s(this,null,function*(){if(h.addListener){const a=yield h.addListener(W,"nativeSendBack",r=>t&&t(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(n)})};let ie;const ne=n=>{ie=e=>{n&&n(e)}},q=ee();q.addListenerHomeHandle=()=>null;const ge=n=>{q.addListenerHomeHandle&&q.addListenerHomeHandle(),setTimeout(()=>{(e=>s(this,null,function*(){e&&(q.addListenerHomeHandle=yield(t=>s(this,null,function*(){if(h.addListener){const a=yield h.addListener(W,"nativeSendHome",r=>t&&t(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(n)})},z=ee();z.removeAddListenerFab=()=>null;const be=n=>{var t,a;z.removeAddListenerFab&&z.removeAddListenerFab();const e=[];(t=g.showFABMenu)==null||t.call(g,{fabMenu:e}),n&&((a=Object.keys(n))!=null&&a.length)&&(Object.keys(n).forEach(r=>{e.push({icon:n[r].icon,id:n[r].id,name:n[r].title})}),queueMicrotask(()=>{var r;(r=g.showFABMenu)==null||r.call(g,{fabMenu:e})}),setTimeout(()=>{(r=>s(this,null,function*(){r&&(z.removeAddListenerFab=yield(i=>s(this,null,function*(){if(h.addListener){const d=yield h.addListener(W,"nativeSendFab",o=>i&&i(o));return d!=null&&d.remove?d.remove:()=>null}}))(r))}))(r=>{let i;r&&r.id&&Object.keys(n).forEach(d=>{r.id===n[d].id&&(i=n[d].fn)}),i&&i()})}))};class _e{constructor(){var e;(e=this.homeIsClick)==null||e.call(this,{isClick:!0})}homeIsClick(e){return s(this,null,function*(){var t;return yield(t=g.homeIsClick)==null?void 0:t.call(g,e)})}openMinApp(e){return s(this,null,function*(){return yield g.openMinApp(e)})}showTitle(e){return s(this,null,function*(){return yield g.showTitle(e)})}showSubMask(e){return s(this,null,function*(){return yield g.showSubMask(e)})}backBtnApiHook(e){return(({backBtnCb:t,router:a})=>({initBackBtnHandle:()=>{a&&a.afterEach(r=>{ve(()=>{r!=null&&r.name&&ie(r.name)})})},registerBackBtnHandle:r=>{const{onMounted:i,onUnmounted:d}=r;i(()=>{ne(o=>{t&&t(o)})}),d(()=>{ne&&ne(()=>"")})}}))(e)}homeBtnHandle(e){ge(e)}setFabHandle(e){be(e)}}const ye=new class extends Z{constructor(){super(...arguments);J(this,"communicatePlugins",new _e)}openMinAppHandle(e){return s(this,null,function*(){return yield this.communicatePlugins.openMinApp(e)})}showTitleHandle(e){return s(this,null,function*(){return yield this.communicatePlugins.showTitle(e)})}showSubMaskHandle(e){return s(this,null,function*(){return yield this.communicatePlugins.showSubMask(e)})}backBtnApiHook(e){return this.communicatePlugins.backBtnApiHook(e)}homeBtnHandle(e){this.communicatePlugins.homeBtnHandle(e)}setFabHandle(e){this.communicatePlugins.setFabHandle(e)}},Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"WTCHK",tenants:[{store_detail_list:[{name:"APELDOORN HOOFDSTRAAT 136",code:"3462"}],name:"WTCHK",stores:["3462"],timezone:"Europe/Amsterdam",code:"WTCHK"}]},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"asia",serverEnv:"uat"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{name:"APELDOORN HOOFDSTRAAT 3462",code:"3462"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),ke=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ae=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Oe=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends v{homeIsClick(){return s(this,null,function*(){})}openMinApp(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}showTitle(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}showFABMenu(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}showSubMask(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}}},Symbol.toStringTag,{value:"Module"}));return ye});
|
|
1
|
+
(function(w,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m():typeof define=="function"&&define.amd?define(m):(w=typeof globalThis!="undefined"?globalThis:w||self).main=m()})(this,function(){"use strict";var Ee=Object.defineProperty;var Se=(w,m,u)=>m in w?Ee(w,m,{enumerable:!0,configurable:!0,writable:!0,value:u}):w[m]=u;var J=(w,m,u)=>(Se(w,typeof m!="symbol"?m+"":m,u),u);var o=(w,m,u)=>new Promise((I,K)=>{var Q=v=>{try{T(u.next(v))}catch(j){K(j)}},h=v=>{try{T(u.throw(v))}catch(j){K(j)}},T=v=>v.done?I(v.value):Promise.resolve(v.value).then(Q,h);T((u=u.apply(w,m)).next())});/*! Capacitor: https://capacitorjs.com/ - MIT License */const w=t=>t.CapacitorPlatforms=(e=>{const n=new Map;n.set("web",{name:"web"});const a=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:n};return a.addPlatform=(r,s)=>{a.platforms.set(r,s)},a.setPlatform=r=>{a.platforms.has(r)&&(a.currentPlatform=a.platforms.get(r))},a})(t),m=w(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var u;m.addPlatform,m.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(u||(u={}));class I extends Error{constructor(e,n,a){super(e),this.message=e,this.code=n,this.data=a}}const K=t=>{var e,n,a,r,s;const d=t.CapacitorCustomPlatform||null,i=t.Capacitor||{},_=i.Plugins=i.Plugins||{},p=t.CapacitorPlatforms,y=((e=p==null?void 0:p.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>d!==null?d.name:(l=>{var c,f;return l!=null&&l.androidBridge?"android":!((f=(c=l==null?void 0:l.webkit)===null||c===void 0?void 0:c.messageHandlers)===null||f===void 0)&&f.bridge?"ios":"web"})(t)),b=((n=p==null?void 0:p.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||(()=>y()!=="web"),E=((a=p==null?void 0:p.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||(l=>{const c=P.get(l);return!!(c!=null&&c.platforms.has(y()))||!!M(l)}),M=((r=p==null?void 0:p.currentPlatform)===null||r===void 0?void 0:r.getPluginHeader)||(l=>{var c;return(c=i.PluginHeaders)===null||c===void 0?void 0:c.find(f=>f.name===l)}),P=new Map,k=((s=p==null?void 0:p.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||((l,c={})=>{const f=P.get(l);if(f)return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`),f.proxy;const A=y(),B=M(l);let N;const ne=L=>{let S;const H=(...G)=>{const D=(()=>o(this,null,function*(){return!N&&A in c?N=N=typeof c[A]=="function"?yield c[A]():c[A]:d!==null&&!N&&"web"in c&&(N=N=typeof c.web=="function"?yield c.web():c.web),N}))().then($=>{const ce=((C,F)=>{var re,oe;if(!B){if(C)return(oe=C[F])===null||oe===void 0?void 0:oe.bind(C);throw new I(`"${l}" plugin is not implemented on ${A}`,u.Unimplemented)}{const pe=B==null?void 0:B.methods.find(R=>F===R.name);if(pe)return pe.rtype==="promise"?R=>i.nativePromise(l,F.toString(),R):(R,Le)=>i.nativeCallback(l,F.toString(),R,Le);if(C)return(re=C[F])===null||re===void 0?void 0:re.bind(C)}})($,L);if(ce){const C=ce(...G);return S=C==null?void 0:C.remove,C}throw new I(`"${l}.${L}()" is not implemented on ${A}`,u.Unimplemented)});return L==="addListener"&&(D.remove=()=>o(this,null,function*(){return S()})),D};return H.toString=()=>`${L.toString()}() { [capacitor code] }`,Object.defineProperty(H,"name",{value:L,writable:!1,configurable:!1}),H},de=ne("addListener"),le=ne("removeListener"),Oe=(L,S)=>{const H=de({eventName:L},S),G=()=>o(this,null,function*(){const $=yield H;le({eventName:L,callbackId:$},S)}),D=new Promise($=>H.then(()=>$({remove:G})));return D.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield G()}),D},ae=new Proxy({},{get(L,S){switch(S){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return B?Oe:de;case"removeListener":return le;default:return ne(S)}}});return _[l]=ae,P.set(l,{name:l,proxy:ae,platforms:new Set([...Object.keys(c),...B?[A]:[]])}),ae});return i.convertFileSrc||(i.convertFileSrc=l=>l),i.getPlatform=y,i.handleError=l=>t.console.error(l),i.isNativePlatform=b,i.isPluginAvailable=E,i.pluginMethodNoop=(l,c,f)=>Promise.reject(`${f} does not have an implementation of "${c}".`),i.registerPlugin=k,i.Exception=I,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},Q=t=>t.Capacitor=K(t),h=Q(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),T=h.registerPlugin;h.Plugins;class v{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,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(n);const a=this.windowListeners[e];a&&!a.registered&&this.addWindowListener(a);const r=()=>o(this,null,function*(){return this.removeListener(e,n)}),s=Promise.resolve({remove:r});return Object.defineProperty(s,"remove",{value:()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield r()})}),s}removeAllListeners(){return o(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,n){const a=this.listeners[e];a&&a.forEach(r=>r(n))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:a=>{this.notifyListeners(n,a)}}}unimplemented(e="not implemented"){return new h.Exception(e,u.Unimplemented)}unavailable(e="not available"){return new h.Exception(e,u.Unavailable)}removeListener(e,n){return o(this,null,function*(){const a=this.listeners[e];if(!a)return;const r=a.indexOf(n);this.listeners[e].splice(r,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 j=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),se=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ue extends v{getCookies(){return o(this,null,function*(){const e=document.cookie,n={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[r,s]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=se(r).trim(),s=se(s).trim(),n[r]=s}),n})}setCookie(e){return o(this,null,function*(){try{const n=j(e.key),a=j(e.value),r=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),d=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${a||""}${r}; path=${s}; ${d};`}catch(n){return Promise.reject(n)}})}deleteCookie(e){return o(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}})}clearCookies(){return o(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const n of e)document.cookie=n.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)}})}}T("CapacitorCookies",{web:()=>new ue});const me=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),a=((r={})=>{const s=Object.keys(r);return Object.keys(r).map(d=>d.toLocaleLowerCase()).reduce((d,i,_)=>(d[i]=r[s[_]],d),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(a.includes("application/x-www-form-urlencoded")){const r=new URLSearchParams;for(const[s,d]of Object.entries(t.data||{}))r.set(s,d);n.body=r.toString()}else if(a.includes("multipart/form-data")){const r=new FormData;if(t.data instanceof FormData)t.data.forEach((d,i)=>{r.append(i,d)});else for(const d of Object.keys(t.data))r.append(d,t.data[d]);n.body=r;const s=new Headers(n.headers);s.delete("content-type"),n.headers=s}else(a.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class fe extends v{request(e){return o(this,null,function*(){const n=me(e,e.webFetchExtra),a=((b,E=!0)=>b?Object.entries(b).reduce((M,P)=>{const[k,l]=P;let c,f;return Array.isArray(l)?(f="",l.forEach(A=>{c=E?encodeURIComponent(A):A,f+=`${k}=${c}&`}),f.slice(0,-1)):(c=E?encodeURIComponent(l):l,f=`${k}=${c}`),`${M}&${f}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),r=a?`${e.url}?${a}`:e.url,s=yield fetch(r,n),d=s.headers.get("content-type")||"";let i,_,{responseType:p="text"}=s.ok?e:{};switch(d.includes("application/json")&&(p="json"),p){case"arraybuffer":case"blob":_=yield s.blob(),i=yield(b=>o(this,null,function*(){return new Promise((E,M)=>{const P=new FileReader;P.onload=()=>{const k=P.result;E(k.indexOf(",")>=0?k.split(",")[1]:k)},P.onerror=k=>M(k),P.readAsDataURL(b)})}))(_);break;case"json":i=yield s.json();break;default:i=yield s.text()}const y={};return s.headers.forEach((b,E)=>{y[E]=b}),{data:i,headers:y,status:s.status,url:s.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 X(){return h.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}T("CapacitorHttp",{web:()=>new fe}),T("Portals",{web:()=>Promise.resolve().then(function(){return he}).then(t=>new t.PortalsWeb)});const he=Object.freeze({__proto__:null,PortalsWeb:class extends v{publishNative(t){return o(this,null,function*(){})}}});var U=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(U||{}),V=(t=>(t.EU="eu",t.ASIA="asia",t))(V||{});const Y=t=>{var e,n,a;if(typeof window!="undefined"&&X&&((e=X())!=null&&e.value)){const r=(a=(n=X())==null?void 0:n.value)!=null?a:null;if(!r)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(r)}},we=t=>new Promise(e=>o(this,null,function*(){let n=null;n=t!=null&&t.mockData?t.mockData:((a,{asiaUatData:r,euSitData:s,euUatData:d})=>{var y,b;const i=(y=a.mockServerInfo)==null?void 0:y.env,_=(b=a.mockServerInfo)==null?void 0:b.area;let p=null;return i&&_&&(V.ASIA===_?U.UAT===i&&(p=r):V.EU===_&&(U.SIT===i?p=s:U.UAT===i&&(p=d))),p})(t,{asiaUatData:yield Promise.resolve().then(()=>Pe),euSitData:yield Promise.resolve().then(()=>ke),euUatData:yield Promise.resolve().then(()=>Ae)}),e(n?n!=null&&n.default?n==null?void 0:n.default:n:null)})),x=class x{constructor(){J(this,"nativeAppInfoConfig");this.nativeAppInfoConfig=x.defaultNativeAppInfoConfig}isNativeHandle(){return o(this,null,function*(){return yield(()=>{let e=!1;return Y(n=>{e=!!(n!=null&&n.isNative)}),e})()})}specifiedPageHandle(e){return o(this,null,function*(){yield(({cb:n})=>{Y(a=>{var i;if(!(a!=null&&a.params))return void console.error("native params is undefine");const r=(i=JSON.parse(a.params))!=null?i:null;if(!r)return;const{params:s,routeName:d}=r;s&&d&&(n?n(r):console.error("call back is undefine"))})})(e)})}nativeAppInfoHandle(e){return o(this,null,function*(){return this.nativeAppInfoConfig=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:x.defaultNativeAppInfoConfig,(yield this.isNativeHandle())?yield(()=>{let n=null;return Y(a=>{n=a!=null?a:null}),n})():yield we(this.nativeAppInfoConfig)})}};J(x,"defaultNativeAppInfoConfig",{mockServerInfo:{area:V.ASIA,env:U.UAT}});let Z=x;const ee=()=>{let t=null;return t=typeof window=="undefined"?{}:window,t},W="CommunicatePlugin",g=h.registerPlugin(W,{web:()=>Promise.resolve().then(()=>Ce).then(t=>new t.PluginsWeb)}),O=ee();O.addListenerBackHandle=()=>null;const ve=t=>{O!=null&&O.addListenerBackHandle&&O.addListenerBackHandle(),setTimeout(()=>{(e=>o(this,null,function*(){O!=null&&O.addListenerBackHandle&&e&&(O.addListenerBackHandle=yield(n=>o(this,null,function*(){if(h.addListener){const a=yield h.addListener(W,"nativeSendBack",r=>n&&n(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(t)})};let ie;const te=t=>{ie=e=>{t&&t(e)}},q=ee();q.addListenerHomeHandle=()=>null;const ge=t=>{q.addListenerHomeHandle&&q.addListenerHomeHandle(),setTimeout(()=>{(e=>o(this,null,function*(){e&&(q.addListenerHomeHandle=yield(n=>o(this,null,function*(){if(h.addListener){const a=yield h.addListener(W,"nativeSendHome",r=>n&&n(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(t)})},z=ee();z.removeAddListenerFab=()=>null;const be=t=>{var n,a;z.removeAddListenerFab&&z.removeAddListenerFab();const e=[];(n=g.showFABMenu)==null||n.call(g,{fabMenu:e}),t&&((a=Object.keys(t))!=null&&a.length)&&(Object.keys(t).forEach(r=>{e.push({icon:t[r].icon,id:t[r].id,name:t[r].title})}),queueMicrotask(()=>{var r;(r=g.showFABMenu)==null||r.call(g,{fabMenu:e})}),setTimeout(()=>{(r=>o(this,null,function*(){r&&(z.removeAddListenerFab=yield(s=>o(this,null,function*(){if(h.addListener){const d=yield h.addListener(W,"nativeSendFab",i=>s&&s(i));return d!=null&&d.remove?d.remove:()=>null}}))(r))}))(r=>{let s;r&&r.id&&Object.keys(t).forEach(d=>{r.id===t[d].id&&(s=t[d].fn)}),s&&s()})}))};class _e{constructor(){var e;(e=this.homeIsClick)==null||e.call(this,{isClick:!0})}homeIsClick(e){return o(this,null,function*(){var n;return yield(n=g.homeIsClick)==null?void 0:n.call(g,e)})}openMinApp(e){return o(this,null,function*(){return yield g.openMinApp(e)})}showTitle(e){return o(this,null,function*(){return yield g.showTitle(e)})}showSubMask(e){return o(this,null,function*(){return yield g.showSubMask(e)})}backBtnApiHook(e){return n=e,{initBackBtnHandle:a=>{a&&a.afterEach(r=>{ve(()=>{r!=null&&r.name&&ie(r.name)})})},registerBackBtnHandle:a=>{const{onMounted:r,onUnmounted:s}=a;r(()=>{te(d=>{n!=null&&n.backBtnCb&&n.backBtnCb(d)})}),s(()=>{te&&te(()=>"")})}};var n}homeBtnHandle(e){ge(e)}fabBtnHandle(e){be(e)}}const ye=new class extends Z{constructor(){super();J(this,"communicatePlugins",new _e)}openMinAppHandle(e){return o(this,null,function*(){return yield this.communicatePlugins.openMinApp(e)})}showTitleHandle(e){return o(this,null,function*(){return yield this.communicatePlugins.showTitle(e)})}showSubMaskHandle(e){return o(this,null,function*(){return yield this.communicatePlugins.showSubMask(e)})}backBtnApiHook(e){return this.communicatePlugins.backBtnApiHook(e)}homeBtnHandle(e){this.communicatePlugins.homeBtnHandle(e)}fabBtnHandle(e){this.communicatePlugins.fabBtnHandle(e)}},Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"WTCHK",tenants:[{store_detail_list:[{name:"APELDOORN HOOFDSTRAAT 136",code:"3462"}],name:"WTCHK",stores:["3462"],timezone:"Europe/Amsterdam",code:"WTCHK"}]},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"asia",serverEnv:"uat"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{name:"APELDOORN HOOFDSTRAAT 3462",code:"3462"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),ke=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ae=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ce=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends v{homeIsClick(){return o(this,null,function*(){})}openMinApp(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}showTitle(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}showFABMenu(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}showSubMask(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}}},Symbol.toStringTag,{value:"Module"}));return ye});
|