superapp-miniapp-invoke-native 1.0.71 → 1.0.73

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 CHANGED
@@ -1,4 +1,3 @@
1
- import CameraScanPlugins from './api/camera-scan';
2
1
  import type { PluginCallback } from '@capacitor/core';
3
2
 
4
3
  declare type BackBtnHandleType = (backBtnApiParams: BackBtnParamsType) => void;
@@ -35,6 +34,14 @@ declare interface CameraScanMultiplePluginsHandleType {
35
34
  pickCameraScanMultiple(cameraMultipleParams: cameraMultipleParamsType): Promise<void>;
36
35
  }
37
36
 
37
+ declare class CameraScanPlugins implements CameraScanPluginsHandleType {
38
+ pickCameraScan(pickCameraScan?: pickCameraScanParamsType): Promise<pickCameraScanParamsType>;
39
+ }
40
+
41
+ declare interface CameraScanPluginsHandleType {
42
+ pickCameraScan(pickCameraScan: pickCameraScanParamsType): Promise<pickCameraScanParamsType>;
43
+ }
44
+
38
45
  declare class CommunicatePlugins implements CommunicatePluginsHookType {
39
46
  constructor();
40
47
  homeBtnSwitch(isClick: homeIsClickType): Promise<void | undefined>;
@@ -145,6 +152,10 @@ declare interface NativeInfoConfigType {
145
152
 
146
153
  declare type PackOrdersScanBoxType = "pack_orders_scan_box" | "collect_orders_scan_box";
147
154
 
155
+ declare interface pickCameraScanParamsType {
156
+ title: string;
157
+ }
158
+
148
159
  declare interface SetFabDataParamsType {
149
160
  fn: (value?: any) => void;
150
161
  id: string;
package/lib/main.js CHANGED
@@ -17,9 +17,9 @@ var s = (n, e, t) => new Promise((r, a) => {
17
17
  }, i = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(o, d);
18
18
  i((t = t.apply(n, e)).next());
19
19
  });
20
- var D = ((n) => (n.DEV = "dev", n.SIT = "sit", n.UAT = "uat", n.PROD = "prod", n.TEST = "test", n))(D || {}), B = ((n) => (n.EU = "eu", n.ASIA = "asia", n))(B || {});
20
+ var D = ((n) => (n.DEV = "dev", n.SIT = "sit", n.UAT = "uat", n.PROD = "prod", n.TEST = "test", n))(D || {}), K = ((n) => (n.EU = "eu", n.ASIA = "asia", n))(K || {});
21
21
  /*! Capacitor: https://capacitorjs.com/ - MIT License */
22
- const ve = (n) => n.CapacitorPlatforms = ((e) => {
22
+ const ge = (n) => n.CapacitorPlatforms = ((e) => {
23
23
  const t = /* @__PURE__ */ new Map();
24
24
  t.set("web", { name: "web" });
25
25
  const r = e.CapacitorPlatforms || { currentPlatform: { name: "web" }, platforms: t };
@@ -28,24 +28,24 @@ const ve = (n) => n.CapacitorPlatforms = ((e) => {
28
28
  }, r.setPlatform = (a) => {
29
29
  r.platforms.has(a) && (r.currentPlatform = r.platforms.get(a));
30
30
  }, r;
31
- })(n), se = ve(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {});
31
+ })(n), se = ge(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {});
32
32
  var M;
33
33
  se.addPlatform, se.setPlatform, function(n) {
34
34
  n.Unimplemented = "UNIMPLEMENTED", n.Unavailable = "UNAVAILABLE";
35
35
  }(M || (M = {}));
36
- class X extends Error {
36
+ class J extends Error {
37
37
  constructor(e, t, r) {
38
38
  super(e), this.message = e, this.code = t, this.data = r;
39
39
  }
40
40
  }
41
- const ge = (n) => {
41
+ const ve = (n) => {
42
42
  var e, t, r, a, o;
43
- const d = n.CapacitorCustomPlatform || null, i = n.Capacitor || {}, u = i.Plugins = i.Plugins || {}, l = n.CapacitorPlatforms, v = ((e = l == null ? void 0 : l.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => d !== null ? d.name : ((c) => {
43
+ const d = n.CapacitorCustomPlatform || null, i = n.Capacitor || {}, u = i.Plugins = i.Plugins || {}, l = n.CapacitorPlatforms, g = ((e = l == null ? void 0 : l.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => d !== null ? d.name : ((c) => {
44
44
  var p, f;
45
45
  return c != null && c.androidBridge ? "android" : !((f = (p = c == null ? void 0 : c.webkit) === null || p === void 0 ? void 0 : p.messageHandlers) === null || f === void 0) && f.bridge ? "ios" : "web";
46
- })(n)), g = ((t = l == null ? void 0 : l.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => v() !== "web"), k = ((r = l == null ? void 0 : l.currentPlatform) === null || r === void 0 ? void 0 : r.isPluginAvailable) || ((c) => {
46
+ })(n)), v = ((t = l == null ? void 0 : l.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => g() !== "web"), k = ((r = l == null ? void 0 : l.currentPlatform) === null || r === void 0 ? void 0 : r.isPluginAvailable) || ((c) => {
47
47
  const p = h.get(c);
48
- return !!(p != null && p.platforms.has(v())) || !!E(c);
48
+ return !!(p != null && p.platforms.has(g())) || !!E(c);
49
49
  }), E = ((a = l == null ? void 0 : l.currentPlatform) === null || a === void 0 ? void 0 : a.getPluginHeader) || ((c) => {
50
50
  var p;
51
51
  return (p = i.PluginHeaders) === null || p === void 0 ? void 0 : p.find((f) => f.name === c);
@@ -53,34 +53,34 @@ const ge = (n) => {
53
53
  const f = h.get(c);
54
54
  if (f)
55
55
  return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`), f.proxy;
56
- const _ = v(), T = E(c);
56
+ const _ = g(), T = E(c);
57
57
  let A;
58
58
  const q = (P) => {
59
59
  let L;
60
60
  const N = (...H) => {
61
61
  const j = (() => s(void 0, null, function* () {
62
62
  return !A && _ in p ? A = A = typeof p[_] == "function" ? yield p[_]() : p[_] : d !== null && !A && "web" in p && (A = A = typeof p.web == "function" ? yield p.web() : p.web), A;
63
- }))().then((U) => {
64
- const ae = ((b, x) => {
65
- var G, J;
63
+ }))().then((x) => {
64
+ const ae = ((b, U) => {
65
+ var G, X;
66
66
  if (!T) {
67
67
  if (b)
68
- return (J = b[x]) === null || J === void 0 ? void 0 : J.bind(b);
69
- throw new X(`"${c}" plugin is not implemented on ${_}`, M.Unimplemented);
68
+ return (X = b[U]) === null || X === void 0 ? void 0 : X.bind(b);
69
+ throw new J(`"${c}" plugin is not implemented on ${_}`, M.Unimplemented);
70
70
  }
71
71
  {
72
- const re = T == null ? void 0 : T.methods.find((I) => x === I.name);
72
+ const re = T == null ? void 0 : T.methods.find((I) => U === I.name);
73
73
  if (re)
74
- return re.rtype === "promise" ? (I) => i.nativePromise(c, x.toString(), I) : (I, me) => i.nativeCallback(c, x.toString(), I, me);
74
+ return re.rtype === "promise" ? (I) => i.nativePromise(c, U.toString(), I) : (I, me) => i.nativeCallback(c, U.toString(), I, me);
75
75
  if (b)
76
- return (G = b[x]) === null || G === void 0 ? void 0 : G.bind(b);
76
+ return (G = b[U]) === null || G === void 0 ? void 0 : G.bind(b);
77
77
  }
78
- })(U, P);
78
+ })(x, P);
79
79
  if (ae) {
80
80
  const b = ae(...H);
81
81
  return L = b == null ? void 0 : b.remove, b;
82
82
  }
83
- throw new X(`"${c}.${P}()" is not implemented on ${_}`, M.Unimplemented);
83
+ throw new J(`"${c}.${P}()" is not implemented on ${_}`, M.Unimplemented);
84
84
  });
85
85
  return P === "addListener" && (j.remove = () => s(void 0, null, function* () {
86
86
  return L();
@@ -89,9 +89,9 @@ const ge = (n) => {
89
89
  return N.toString = () => `${P.toString()}() { [capacitor code] }`, Object.defineProperty(N, "name", { value: P, writable: !1, configurable: !1 }), N;
90
90
  }, ne = q("addListener"), te = q("removeListener"), ue = (P, L) => {
91
91
  const N = ne({ eventName: P }, L), H = () => s(void 0, null, function* () {
92
- const U = yield N;
93
- te({ eventName: P, callbackId: U }, L);
94
- }), j = new Promise((U) => N.then(() => U({ remove: H })));
92
+ const x = yield N;
93
+ te({ eventName: P, callbackId: x }, L);
94
+ }), j = new Promise((x) => N.then(() => x({ remove: H })));
95
95
  return j.remove = () => s(void 0, null, function* () {
96
96
  console.warn("Using addListener() without 'await' is deprecated."), yield H();
97
97
  }), j;
@@ -111,8 +111,8 @@ const ge = (n) => {
111
111
  } });
112
112
  return u[c] = z, h.set(c, { name: c, proxy: z, platforms: /* @__PURE__ */ new Set([...Object.keys(p), ...T ? [_] : []]) }), z;
113
113
  });
114
- return i.convertFileSrc || (i.convertFileSrc = (c) => c), i.getPlatform = v, i.handleError = (c) => n.console.error(c), i.isNativePlatform = g, i.isPluginAvailable = k, i.pluginMethodNoop = (c, p, f) => Promise.reject(`${f} does not have an implementation of "${p}".`), i.registerPlugin = y, i.Exception = X, i.DEBUG = !!i.DEBUG, i.isLoggingEnabled = !!i.isLoggingEnabled, i.platform = i.getPlatform(), i.isNative = i.isNativePlatform(), i;
115
- }, he = (n) => n.Capacitor = ge(n), m = he(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), Q = m.registerPlugin;
114
+ return i.convertFileSrc || (i.convertFileSrc = (c) => c), i.getPlatform = g, i.handleError = (c) => n.console.error(c), i.isNativePlatform = v, i.isPluginAvailable = k, i.pluginMethodNoop = (c, p, f) => Promise.reject(`${f} does not have an implementation of "${p}".`), i.registerPlugin = y, i.Exception = J, i.DEBUG = !!i.DEBUG, i.isLoggingEnabled = !!i.isLoggingEnabled, i.platform = i.getPlatform(), i.isNative = i.isNativePlatform(), i;
115
+ }, he = (n) => n.Capacitor = ve(n), m = he(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), Q = m.registerPlugin;
116
116
  m.Plugins;
117
117
  class C {
118
118
  constructor(e) {
@@ -256,7 +256,7 @@ const _e = (n, e = {}) => {
256
256
  class be extends C {
257
257
  request(e) {
258
258
  return s(this, null, function* () {
259
- const t = _e(e, e.webFetchExtra), r = ((g, k = !0) => g ? Object.entries(g).reduce((E, h) => {
259
+ const t = _e(e, e.webFetchExtra), r = ((v, k = !0) => v ? Object.entries(v).reduce((E, h) => {
260
260
  const [y, c] = h;
261
261
  let p, f;
262
262
  return Array.isArray(c) ? (f = "", c.forEach((_) => {
@@ -267,13 +267,13 @@ class be extends C {
267
267
  switch (d.includes("application/json") && (l = "json"), l) {
268
268
  case "arraybuffer":
269
269
  case "blob":
270
- u = yield o.blob(), i = yield ((g) => s(this, null, function* () {
270
+ u = yield o.blob(), i = yield ((v) => s(this, null, function* () {
271
271
  return new Promise((k, E) => {
272
272
  const h = new FileReader();
273
273
  h.onload = () => {
274
274
  const y = h.result;
275
275
  k(y.indexOf(",") >= 0 ? y.split(",")[1] : y);
276
- }, h.onerror = (y) => E(y), h.readAsDataURL(g);
276
+ }, h.onerror = (y) => E(y), h.readAsDataURL(v);
277
277
  });
278
278
  }))(u);
279
279
  break;
@@ -283,10 +283,10 @@ class be extends C {
283
283
  default:
284
284
  i = yield o.text();
285
285
  }
286
- const v = {};
287
- return o.headers.forEach((g, k) => {
288
- v[k] = g;
289
- }), { data: i, headers: v, status: o.status, url: o.url };
286
+ const g = {};
287
+ return o.headers.forEach((v, k) => {
288
+ g[k] = v;
289
+ }), { data: i, headers: g, status: o.status, url: o.url };
290
290
  });
291
291
  }
292
292
  get(e) {
@@ -340,12 +340,12 @@ const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
340
340
  }, ke = (n) => new Promise((e) => s(void 0, null, function* () {
341
341
  let t = null;
342
342
  t = n != null && n.mockData ? n.mockData : ((r, { asiaUatData: a, euSitData: o, euUatData: d }) => {
343
- var v, g;
344
- const i = (v = r.mockServerInfo) == null ? void 0 : v.env, u = (g = r.mockServerInfo) == null ? void 0 : g.area;
343
+ var g, v;
344
+ const i = (g = r.mockServerInfo) == null ? void 0 : g.env, u = (v = r.mockServerInfo) == null ? void 0 : v.area;
345
345
  let l = null;
346
- return i && u && (B.ASIA === u ? D.UAT === i && (l = a) : B.EU === u && (D.SIT === i ? l = o : D.UAT === i && (l = d))), l;
347
- })(n, { asiaUatData: yield Promise.resolve().then(() => xe), euSitData: yield Promise.resolve().then(() => Ie), euUatData: yield Promise.resolve().then(() => De) }), e(t ? t != null && t.default ? t == null ? void 0 : t.default : t : null);
348
- })), K = class K {
346
+ return i && u && (K.ASIA === u ? D.UAT === i && (l = a) : K.EU === u && (D.SIT === i ? l = o : D.UAT === i && (l = d))), l;
347
+ })(n, { asiaUatData: yield Promise.resolve().then(() => Ue), euSitData: yield Promise.resolve().then(() => Ie), euUatData: yield Promise.resolve().then(() => De) }), e(t ? t != null && t.default ? t == null ? void 0 : t.default : t : null);
348
+ })), B = class B {
349
349
  isNative() {
350
350
  return s(this, null, function* () {
351
351
  return yield (() => {
@@ -371,7 +371,7 @@ const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
371
371
  }
372
372
  getNativeInfo(e) {
373
373
  return s(this, null, function* () {
374
- const t = e != null && e.mockServerInfo || e != null && e.mockData ? e : K.defaultNativeAppInfoConfig;
374
+ const t = e != null && e.mockServerInfo || e != null && e.mockData ? e : B.defaultNativeAppInfoConfig;
375
375
  return (yield this.isNative()) ? yield (() => {
376
376
  let r = null;
377
377
  return Z((a) => {
@@ -381,8 +381,8 @@ const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
381
381
  });
382
382
  }
383
383
  };
384
- S(K, "defaultNativeAppInfoConfig", { mockServerInfo: { area: B.ASIA, env: D.UAT } });
385
- let ee = K;
384
+ S(B, "defaultNativeAppInfoConfig", { mockServerInfo: { area: K.ASIA, env: D.UAT } });
385
+ let ee = B;
386
386
  const V = () => {
387
387
  let n = {};
388
388
  return typeof window != "undefined" && (n = window), n;
@@ -393,8 +393,8 @@ const Le = (n) => {
393
393
  R.removeAddListenerFab && R.removeAddListenerFab();
394
394
  const e = [];
395
395
  (t = w.showFABMenu) == null || t.call(w, { fabMenu: e }), n && ((r = Object.keys(n)) != null && r.length) && (Object.keys(n).forEach((a) => {
396
- var o, d, i, u, l, v;
397
- e.push({ icon: (d = (o = n == null ? void 0 : n[a]) == null ? void 0 : o.icon) != null ? d : "", id: (u = (i = n == null ? void 0 : n[a]) == null ? void 0 : i.id) != null ? u : "", name: (v = (l = n == null ? void 0 : n[a]) == null ? void 0 : l.title) != null ? v : "" });
396
+ var o, d, i, u, l, g;
397
+ e.push({ icon: (d = (o = n == null ? void 0 : n[a]) == null ? void 0 : o.icon) != null ? d : "", id: (u = (i = n == null ? void 0 : n[a]) == null ? void 0 : i.id) != null ? u : "", name: (g = (l = n == null ? void 0 : n[a]) == null ? void 0 : l.title) != null ? g : "" });
398
398
  }), queueMicrotask(() => {
399
399
  var a;
400
400
  (a = w.showFABMenu) == null || a.call(w, { fabMenu: e });
@@ -505,9 +505,9 @@ const Ae = m.registerPlugin("CameraScanPlugin", { web: new class extends C {
505
505
  }() });
506
506
  window.removeAddListenerCameraScan = () => null;
507
507
  class Oe {
508
- pickCameraScan() {
508
+ pickCameraScan(e) {
509
509
  return s(this, null, function* () {
510
- return yield Ae.pickCameraScan();
510
+ return yield Ae.pickCameraScan(e);
511
511
  });
512
512
  }
513
513
  }
@@ -587,7 +587,7 @@ class je {
587
587
  })(e);
588
588
  }
589
589
  }
590
- class Ue {
590
+ class xe {
591
591
  constructor() {
592
592
  S(this, "initialContextPlugins", new ee());
593
593
  S(this, "communicatePlugins", new Ce());
@@ -597,7 +597,7 @@ class Ue {
597
597
  S(this, "laserScanPlugins", new je());
598
598
  }
599
599
  }
600
- const $e = new Ue(), xe = 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" }, data_kong: { token: { access_token: "OLXyjfmHGolOdt7NMLvzh4VEAFRRHZAf", expires_in: 86400, token_type: "bearer" } } } }, Symbol.toStringTag, { value: "Module" })), Ie = 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" }, data_kong: { "X-ASW-APIKey": "6j2AHemxmsGMmIs9rtdys0DK04Hag6s1" } } }, Symbol.toStringTag, { value: "Module" })), De = 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" }, data_kong: { "X-ASW-APIKey": "axiBpmRYqN99pWG9r3horNTNgWxpvlfG" } } }, Symbol.toStringTag, { value: "Module" })), He = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends C {
600
+ const $e = new xe(), Ue = 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" }, data_kong: { token: { access_token: "OLXyjfmHGolOdt7NMLvzh4VEAFRRHZAf", expires_in: 86400, token_type: "bearer" } } } }, Symbol.toStringTag, { value: "Module" })), Ie = 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" }, data_kong: { "X-ASW-APIKey": "6j2AHemxmsGMmIs9rtdys0DK04Hag6s1", "EVC-X-ASW-APIKey": "6j2AHemxmsGMmIs9rtdys0DK04Hag6s1" } } }, Symbol.toStringTag, { value: "Module" })), De = 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" }, data_kong: { "X-ASW-APIKey": "axiBpmRYqN99pWG9r3horNTNgWxpvlfG", "EVC-X-ASW-APIKey": "6j2AHemxmsGMmIs9rtdys0DK04Hag6s1" } } }, Symbol.toStringTag, { value: "Module" })), He = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends C {
601
601
  homeIsClick() {
602
602
  return s(this, null, function* () {
603
603
  });
@@ -647,6 +647,6 @@ const $e = new Ue(), xe = Object.freeze(Object.defineProperty({ __proto__: null,
647
647
  }
648
648
  } }, Symbol.toStringTag, { value: "Module" }));
649
649
  export {
650
- Ue as NativeApi,
650
+ xe as NativeApi,
651
651
  $e as default
652
652
  };
package/lib/main.umd.cjs CHANGED
@@ -1 +1 @@
1
- (function(h,m){typeof exports=="object"&&typeof module!="undefined"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):m((h=typeof globalThis!="undefined"?globalThis:h||self).main={})})(this,function(h){"use strict";var Re=Object.defineProperty;var $e=(h,m,g)=>m in h?Re(h,m,{enumerable:!0,configurable:!0,writable:!0,value:g}):h[m]=g;var M=(h,m,g)=>($e(h,typeof m!="symbol"?m+"":m,g),g);var s=(h,m,g)=>new Promise((Y,I)=>{var A=L=>{try{H(g.next(L))}catch(u){I(u)}},D=L=>{try{H(g.throw(L))}catch(u){I(u)}},H=L=>L.done?Y(L.value):Promise.resolve(L.value).then(A,D);H((g=g.apply(h,m)).next())});var m=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(m||{}),g=(t=>(t.EU="eu",t.ASIA="asia",t))(g||{});/*! Capacitor: https://capacitorjs.com/ - MIT License */const Y=t=>t.CapacitorPlatforms=(e=>{const n=new Map;n.set("web",{name:"web"});const r=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:n};return r.addPlatform=(a,o)=>{r.platforms.set(a,o)},r.setPlatform=a=>{r.platforms.has(a)&&(r.currentPlatform=r.platforms.get(a))},r})(t),I=Y(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var A;I.addPlatform,I.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(A||(A={}));class D extends Error{constructor(e,n,r){super(e),this.message=e,this.code=n,this.data=r}}const H=t=>{var e,n,r,a,o;const d=t.CapacitorCustomPlatform||null,i=t.Capacitor||{},f=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:(c=>{var l,w;return c!=null&&c.androidBridge?"android":!((w=(l=c==null?void 0:c.webkit)===null||l===void 0?void 0:l.messageHandlers)===null||w===void 0)&&w.bridge?"ios":"web"})(t)),_=((n=p==null?void 0:p.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||(()=>y()!=="web"),E=((r=p==null?void 0:p.currentPlatform)===null||r===void 0?void 0:r.isPluginAvailable)||(c=>{const l=b.get(c);return!!(l!=null&&l.platforms.has(y()))||!!x(c)}),x=((a=p==null?void 0:p.currentPlatform)===null||a===void 0?void 0:a.getPluginHeader)||(c=>{var l;return(l=i.PluginHeaders)===null||l===void 0?void 0:l.find(w=>w.name===c)}),b=new Map,P=((o=p==null?void 0:p.currentPlatform)===null||o===void 0?void 0:o.registerPlugin)||((c,l={})=>{const w=b.get(c);if(w)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),w.proxy;const k=y(),R=x(c);let j;const ne=C=>{let N;const U=(...X)=>{const $=(()=>s(this,null,function*(){return!j&&k in l?j=j=typeof l[k]=="function"?yield l[k]():l[k]:d!==null&&!j&&"web"in l&&(j=j=typeof l.web=="function"?yield l.web():l.web),j}))().then(F=>{const we=((S,B)=>{var re,se;if(!R){if(S)return(se=S[B])===null||se===void 0?void 0:se.bind(S);throw new D(`"${c}" plugin is not implemented on ${k}`,A.Unimplemented)}{const ge=R==null?void 0:R.methods.find(K=>B===K.name);if(ge)return ge.rtype==="promise"?K=>i.nativePromise(c,B.toString(),K):(K,He)=>i.nativeCallback(c,B.toString(),K,He);if(S)return(re=S[B])===null||re===void 0?void 0:re.bind(S)}})(F,C);if(we){const S=we(...X);return N=S==null?void 0:S.remove,S}throw new D(`"${c}.${C}()" is not implemented on ${k}`,A.Unimplemented)});return C==="addListener"&&($.remove=()=>s(this,null,function*(){return N()})),$};return U.toString=()=>`${C.toString()}() { [capacitor code] }`,Object.defineProperty(U,"name",{value:C,writable:!1,configurable:!1}),U},me=ne("addListener"),fe=ne("removeListener"),De=(C,N)=>{const U=me({eventName:C},N),X=()=>s(this,null,function*(){const F=yield U;fe({eventName:C,callbackId:F},N)}),$=new Promise(F=>U.then(()=>F({remove:X})));return $.remove=()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield X()}),$},ae=new Proxy({},{get(C,N){switch(N){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return R?De:me;case"removeListener":return fe;default:return ne(N)}}});return f[c]=ae,b.set(c,{name:c,proxy:ae,platforms:new Set([...Object.keys(l),...R?[k]:[]])}),ae});return i.convertFileSrc||(i.convertFileSrc=c=>c),i.getPlatform=y,i.handleError=c=>t.console.error(c),i.isNativePlatform=_,i.isPluginAvailable=E,i.pluginMethodNoop=(c,l,w)=>Promise.reject(`${w} does not have an implementation of "${l}".`),i.registerPlugin=P,i.Exception=D,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},L=t=>t.Capacitor=H(t),u=L(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),Z=u.registerPlugin;u.Plugins;class O{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 r=this.windowListeners[e];r&&!r.registered&&this.addWindowListener(r);const a=()=>s(this,null,function*(){return this.removeListener(e,n)}),o=Promise.resolve({remove:a});return Object.defineProperty(o,"remove",{value:()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield a()})}),o}removeAllListeners(){return s(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,n){const r=this.listeners[e];r&&r.forEach(a=>a(n))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(e="not implemented"){return new u.Exception(e,A.Unimplemented)}unavailable(e="not available"){return new u.Exception(e,A.Unavailable)}removeListener(e,n){return s(this,null,function*(){const r=this.listeners[e];if(!r)return;const a=r.indexOf(n);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 oe=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ie=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ve extends O{getCookies(){return s(this,null,function*(){const e=document.cookie,n={};return e.split(";").forEach(r=>{if(r.length<=0)return;let[a,o]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=ie(a).trim(),o=ie(o).trim(),n[a]=o}),n})}setCookie(e){return s(this,null,function*(){try{const n=oe(e.key),r=oe(e.value),a=`; expires=${(e.expires||"").replace("expires=","")}`,o=(e.path||"/").replace("path=",""),d=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${r||""}${a}; path=${o}; ${d};`}catch(n){return Promise.reject(n)}})}deleteCookie(e){return s(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}})}clearCookies(){return s(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 s(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}Z("CapacitorCookies",{web:()=>new ve});const he=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),r=((a={})=>{const o=Object.keys(a);return Object.keys(a).map(d=>d.toLocaleLowerCase()).reduce((d,i,f)=>(d[i]=a[o[f]],d),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(r.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[o,d]of Object.entries(t.data||{}))a.set(o,d);n.body=a.toString()}else if(r.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((d,i)=>{a.append(i,d)});else for(const d of Object.keys(t.data))a.append(d,t.data[d]);n.body=a;const o=new Headers(n.headers);o.delete("content-type"),n.headers=o}else(r.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class ye extends O{request(e){return s(this,null,function*(){const n=he(e,e.webFetchExtra),r=((_,E=!0)=>_?Object.entries(_).reduce((x,b)=>{const[P,c]=b;let l,w;return Array.isArray(c)?(w="",c.forEach(k=>{l=E?encodeURIComponent(k):k,w+=`${P}=${l}&`}),w.slice(0,-1)):(l=E?encodeURIComponent(c):c,w=`${P}=${l}`),`${x}&${w}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=r?`${e.url}?${r}`:e.url,o=yield fetch(a,n),d=o.headers.get("content-type")||"";let i,f,{responseType:p="text"}=o.ok?e:{};switch(d.includes("application/json")&&(p="json"),p){case"arraybuffer":case"blob":f=yield o.blob(),i=yield(_=>s(this,null,function*(){return new Promise((E,x)=>{const b=new FileReader;b.onload=()=>{const P=b.result;E(P.indexOf(",")>=0?P.split(",")[1]:P)},b.onerror=P=>x(P),b.readAsDataURL(_)})}))(f);break;case"json":i=yield o.json();break;default:i=yield o.text()}const y={};return o.headers.forEach((_,E)=>{y[E]=_}),{data:i,headers:y,status:o.status,url:o.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 Q(){return u.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}Z("CapacitorHttp",{web:()=>new ye}),Z("Portals",{web:()=>Promise.resolve().then(function(){return _e}).then(t=>new t.PortalsWeb)});const _e=Object.freeze({__proto__:null,PortalsWeb:class extends O{publishNative(t){return s(this,null,function*(){})}}}),ee=t=>{var e,n,r;if(typeof window!="undefined"&&Q&&((e=Q())!=null&&e.value)){const a=(r=(n=Q())==null?void 0:n.value)!=null?r:null;if(!a)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(a)}},be=t=>new Promise(e=>s(this,null,function*(){let n=null;n=t!=null&&t.mockData?t.mockData:((r,{asiaUatData:a,euSitData:o,euUatData:d})=>{var y,_;const i=(y=r.mockServerInfo)==null?void 0:y.env,f=(_=r.mockServerInfo)==null?void 0:_.area;let p=null;return i&&f&&(g.ASIA===f?m.UAT===i&&(p=a):g.EU===f&&(m.SIT===i?p=o:m.UAT===i&&(p=d))),p})(t,{asiaUatData:yield Promise.resolve().then(()=>je),euSitData:yield Promise.resolve().then(()=>xe),euUatData:yield Promise.resolve().then(()=>Ue)}),e(n?n!=null&&n.default?n==null?void 0:n.default:n:null)})),J=class J{isNative(){return s(this,null,function*(){return yield(()=>{let e=!1;return ee(n=>{e=!!(n!=null&&n.isNative)}),e})()})}redirectPage(e){return s(this,null,function*(){yield(({callBack:n})=>{ee(r=>{var o;if(!(r!=null&&r.params))return void console.info("initial context native params is undefine");const a=(o=r==null?void 0:r.params)!=null?o:null;a&&(n?n(a):console.error("initial context call back is undefine"))})})(e)})}getNativeInfo(e){return s(this,null,function*(){const n=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:J.defaultNativeAppInfoConfig;return(yield this.isNative())?yield(()=>{let r=null;return ee(a=>{r=a!=null?a:null}),r})():yield be(n)})}};M(J,"defaultNativeAppInfoConfig",{mockServerInfo:{area:g.ASIA,env:m.UAT}});let te=J;const V=()=>{let t={};return typeof window!="undefined"&&(t=window),t},W="CommunicatePlugin",v=u.registerPlugin(W,{web:()=>Promise.resolve().then(()=>Ie).then(t=>new t.PluginsWeb)}),q=V();q.removeAddListenerFab=()=>null;const Pe=t=>{var n,r;q.removeAddListenerFab&&q.removeAddListenerFab();const e=[];(n=v.showFABMenu)==null||n.call(v,{fabMenu:e}),t&&((r=Object.keys(t))!=null&&r.length)&&(Object.keys(t).forEach(a=>{var o,d,i,f,p,y;e.push({icon:(d=(o=t==null?void 0:t[a])==null?void 0:o.icon)!=null?d:"",id:(f=(i=t==null?void 0:t[a])==null?void 0:i.id)!=null?f:"",name:(y=(p=t==null?void 0:t[a])==null?void 0:p.title)!=null?y:""})}),queueMicrotask(()=>{var a;(a=v.showFABMenu)==null||a.call(v,{fabMenu:e})}),setTimeout(()=>{(a=>s(this,null,function*(){a&&(q.removeAddListenerFab=yield(o=>s(this,null,function*(){if(u.addListener){const d=yield u.addListener(W,"nativeSendFab",i=>o&&o(i));return d!=null&&d.remove?d.remove:()=>null}}))(a))}))(a=>{let o;a!=null&&a.id&&(Object.keys(t).forEach(d=>{var i,f,p;(i=t==null?void 0:t[d])!=null&&i.id&&a.id===t[d].id&&(o=(p=(f=t[d])==null?void 0:f.fn)!=null?p:()=>null)}),typeof o=="function"&&o())})}))},T=V();T.addListenerBackRemoveHandle=()=>null;const de=(t=()=>null)=>s(this,null,function*(){T!=null&&T.addListenerBackRemoveHandle&&typeof T.addListenerBackRemoveHandle=="function"&&T.addListenerBackRemoveHandle(),T.addListenerBackRemoveHandle=yield(e=>s(this,null,function*(){if(u.addListener){const n=yield u.addListener(W,"nativeSendBack",r=>e&&e(r));return n!=null&&n.remove?n.remove:()=>null}}))(t)}),z=V();z.addListenerHomeHandle=()=>null;const ke=t=>{z.addListenerHomeHandle&&z.addListenerHomeHandle(),setTimeout(()=>{(e=>s(this,null,function*(){e&&(z.addListenerHomeHandle=yield(n=>s(this,null,function*(){if(u.addListener){const r=yield u.addListener(W,"nativeSendHome",a=>n&&n(a));return r!=null&&r.remove?r.remove:()=>null}}))(e))}))(t)})};class Se{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return s(this,null,function*(){var n;return yield(n=v.homeIsClick)==null?void 0:n.call(v,e)})}setBackBtn(e){(n=>{const{mounted:r,beforeUnmount:a,callBack:o}=n;r(()=>{de(o)}),a(()=>{de()})})(e)}setHomeBtn(e){ke(e)}setFabBtn(e){Pe(e)}openMiniApp(e){return s(this,null,function*(){return yield v.openMiniApp(e)})}showTitle(e){return s(this,null,function*(){return yield v.showTitle(e)})}showSubMask(e){return s(this,null,function*(){return yield v.showSubMask(e)})}setMiniAppVersion(e){return s(this,null,function*(){return yield v.setMiniAppVersion(e)})}showNativeLoading(){return s(this,null,function*(){return yield v.showDialog()})}cancelNativeLoading(){return s(this,null,function*(){return yield v.cancelDialog()})}}const Le=u.registerPlugin("CameraScanPlugin",{web:new class extends O{pickCameraScan(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}}});window.removeAddListenerCameraScan=()=>null;class Ce{pickCameraScan(){return s(this,null,function*(){return yield Le.pickCameraScan()})}}const Ae=u.registerPlugin("CameraScanMultiplePlugin",{web:new class extends O{pickCameraScanMultiple(){return s(this,null,function*(){})}}});class Oe{pickCameraScanMultiple(e){return s(this,null,function*(){return yield Ae.pickCameraScanMultiple(e)})}}const Ee=u.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends O{pickCameraScanMultipleNoCount(){return s(this,null,function*(){})}}});class Ne{pickCameraScanMultipleNoCount(e){return s(this,null,function*(){return yield Ee.pickCameraScanMultipleNoCount(e)})}}const ce="LaserScanPlugin",le=u.registerPlugin(ce,{web:new class extends O{pickLaserScan(){return s(this,null,function*(){})}unPickLaserScan(){return s(this,null,function*(){})}}}),G=V();G.removeAddListenerLaserScan=()=>null;const pe=(t=()=>null)=>{G.removeAddListenerLaserScan&&G.removeAddListenerLaserScan();const e=n=>s(this,null,function*(){n&&(G.removeAddListenerLaserScan=yield(r=>s(this,null,function*(){if(u.addListener){const a=yield u.addListener(ce,"nativeSendLaser",o=>r&&r(o));return a!=null&&a.remove?a.remove:()=>null}}))(n))});setTimeout(()=>{e(t)})};class Me{constructor(){this.pickLaserScan()}pickLaserScan(){return s(this,null,function*(){le.pickLaserScan({isContinue:!1})})}unPickLaserScan(){return s(this,null,function*(){le.unPickLaserScan()})}setLaserScan(e){(n=>{const{mounted:r,beforeUnmount:a,callBack:o}=n;r(()=>{pe(o)}),a(()=>{pe()})})(e)}}class ue{constructor(){M(this,"initialContextPlugins",new te);M(this,"communicatePlugins",new Se);M(this,"cameraScanPlugins",new Ce);M(this,"cameraScanMultiplePlugins",new Oe);M(this,"cameraScanMultipleNoCountPlugins",new Ne);M(this,"laserScanPlugins",new Me)}}const Te=new ue,je=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"},data_kong:{token:{access_token:"OLXyjfmHGolOdt7NMLvzh4VEAFRRHZAf",expires_in:86400,token_type:"bearer"}}}},Symbol.toStringTag,{value:"Module"})),xe=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"},data_kong:{"X-ASW-APIKey":"6j2AHemxmsGMmIs9rtdys0DK04Hag6s1"}}},Symbol.toStringTag,{value:"Module"})),Ue=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"},data_kong:{"X-ASW-APIKey":"axiBpmRYqN99pWG9r3horNTNgWxpvlfG"}}},Symbol.toStringTag,{value:"Module"})),Ie=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends O{homeIsClick(){return s(this,null,function*(){})}openMiniApp(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showTitle(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showFABMenu(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showSubMask(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}setMiniAppVersion(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showDialog(){return s(this,null,function*(){})}cancelDialog(){return s(this,null,function*(){})}}},Symbol.toStringTag,{value:"Module"}));h.NativeApi=ue,h.default=Te,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(h,m){typeof exports=="object"&&typeof module!="undefined"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):m((h=typeof globalThis!="undefined"?globalThis:h||self).main={})})(this,function(h){"use strict";var Re=Object.defineProperty;var $e=(h,m,g)=>m in h?Re(h,m,{enumerable:!0,configurable:!0,writable:!0,value:g}):h[m]=g;var M=(h,m,g)=>($e(h,typeof m!="symbol"?m+"":m,g),g);var s=(h,m,g)=>new Promise((Y,I)=>{var A=C=>{try{H(g.next(C))}catch(u){I(u)}},D=C=>{try{H(g.throw(C))}catch(u){I(u)}},H=C=>C.done?Y(C.value):Promise.resolve(C.value).then(A,D);H((g=g.apply(h,m)).next())});var m=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(m||{}),g=(t=>(t.EU="eu",t.ASIA="asia",t))(g||{});/*! Capacitor: https://capacitorjs.com/ - MIT License */const Y=t=>t.CapacitorPlatforms=(e=>{const n=new Map;n.set("web",{name:"web"});const r=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:n};return r.addPlatform=(a,o)=>{r.platforms.set(a,o)},r.setPlatform=a=>{r.platforms.has(a)&&(r.currentPlatform=r.platforms.get(a))},r})(t),I=Y(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var A;I.addPlatform,I.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(A||(A={}));class D extends Error{constructor(e,n,r){super(e),this.message=e,this.code=n,this.data=r}}const H=t=>{var e,n,r,a,o;const d=t.CapacitorCustomPlatform||null,i=t.Capacitor||{},f=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:(c=>{var l,w;return c!=null&&c.androidBridge?"android":!((w=(l=c==null?void 0:c.webkit)===null||l===void 0?void 0:l.messageHandlers)===null||w===void 0)&&w.bridge?"ios":"web"})(t)),_=((n=p==null?void 0:p.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||(()=>y()!=="web"),E=((r=p==null?void 0:p.currentPlatform)===null||r===void 0?void 0:r.isPluginAvailable)||(c=>{const l=b.get(c);return!!(l!=null&&l.platforms.has(y()))||!!x(c)}),x=((a=p==null?void 0:p.currentPlatform)===null||a===void 0?void 0:a.getPluginHeader)||(c=>{var l;return(l=i.PluginHeaders)===null||l===void 0?void 0:l.find(w=>w.name===c)}),b=new Map,P=((o=p==null?void 0:p.currentPlatform)===null||o===void 0?void 0:o.registerPlugin)||((c,l={})=>{const w=b.get(c);if(w)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),w.proxy;const k=y(),R=x(c);let j;const ne=L=>{let N;const U=(...J)=>{const $=(()=>s(this,null,function*(){return!j&&k in l?j=j=typeof l[k]=="function"?yield l[k]():l[k]:d!==null&&!j&&"web"in l&&(j=j=typeof l.web=="function"?yield l.web():l.web),j}))().then(F=>{const we=((S,K)=>{var re,se;if(!R){if(S)return(se=S[K])===null||se===void 0?void 0:se.bind(S);throw new D(`"${c}" plugin is not implemented on ${k}`,A.Unimplemented)}{const ge=R==null?void 0:R.methods.find(B=>K===B.name);if(ge)return ge.rtype==="promise"?B=>i.nativePromise(c,K.toString(),B):(B,He)=>i.nativeCallback(c,K.toString(),B,He);if(S)return(re=S[K])===null||re===void 0?void 0:re.bind(S)}})(F,L);if(we){const S=we(...J);return N=S==null?void 0:S.remove,S}throw new D(`"${c}.${L}()" is not implemented on ${k}`,A.Unimplemented)});return L==="addListener"&&($.remove=()=>s(this,null,function*(){return N()})),$};return U.toString=()=>`${L.toString()}() { [capacitor code] }`,Object.defineProperty(U,"name",{value:L,writable:!1,configurable:!1}),U},me=ne("addListener"),fe=ne("removeListener"),De=(L,N)=>{const U=me({eventName:L},N),J=()=>s(this,null,function*(){const F=yield U;fe({eventName:L,callbackId:F},N)}),$=new Promise(F=>U.then(()=>F({remove:J})));return $.remove=()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield J()}),$},ae=new Proxy({},{get(L,N){switch(N){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return R?De:me;case"removeListener":return fe;default:return ne(N)}}});return f[c]=ae,b.set(c,{name:c,proxy:ae,platforms:new Set([...Object.keys(l),...R?[k]:[]])}),ae});return i.convertFileSrc||(i.convertFileSrc=c=>c),i.getPlatform=y,i.handleError=c=>t.console.error(c),i.isNativePlatform=_,i.isPluginAvailable=E,i.pluginMethodNoop=(c,l,w)=>Promise.reject(`${w} does not have an implementation of "${l}".`),i.registerPlugin=P,i.Exception=D,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},C=t=>t.Capacitor=H(t),u=C(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),Z=u.registerPlugin;u.Plugins;class O{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 r=this.windowListeners[e];r&&!r.registered&&this.addWindowListener(r);const a=()=>s(this,null,function*(){return this.removeListener(e,n)}),o=Promise.resolve({remove:a});return Object.defineProperty(o,"remove",{value:()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield a()})}),o}removeAllListeners(){return s(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,n){const r=this.listeners[e];r&&r.forEach(a=>a(n))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(e="not implemented"){return new u.Exception(e,A.Unimplemented)}unavailable(e="not available"){return new u.Exception(e,A.Unavailable)}removeListener(e,n){return s(this,null,function*(){const r=this.listeners[e];if(!r)return;const a=r.indexOf(n);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 oe=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ie=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ve extends O{getCookies(){return s(this,null,function*(){const e=document.cookie,n={};return e.split(";").forEach(r=>{if(r.length<=0)return;let[a,o]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=ie(a).trim(),o=ie(o).trim(),n[a]=o}),n})}setCookie(e){return s(this,null,function*(){try{const n=oe(e.key),r=oe(e.value),a=`; expires=${(e.expires||"").replace("expires=","")}`,o=(e.path||"/").replace("path=",""),d=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${r||""}${a}; path=${o}; ${d};`}catch(n){return Promise.reject(n)}})}deleteCookie(e){return s(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}})}clearCookies(){return s(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 s(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}Z("CapacitorCookies",{web:()=>new ve});const he=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),r=((a={})=>{const o=Object.keys(a);return Object.keys(a).map(d=>d.toLocaleLowerCase()).reduce((d,i,f)=>(d[i]=a[o[f]],d),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(r.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[o,d]of Object.entries(t.data||{}))a.set(o,d);n.body=a.toString()}else if(r.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((d,i)=>{a.append(i,d)});else for(const d of Object.keys(t.data))a.append(d,t.data[d]);n.body=a;const o=new Headers(n.headers);o.delete("content-type"),n.headers=o}else(r.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class ye extends O{request(e){return s(this,null,function*(){const n=he(e,e.webFetchExtra),r=((_,E=!0)=>_?Object.entries(_).reduce((x,b)=>{const[P,c]=b;let l,w;return Array.isArray(c)?(w="",c.forEach(k=>{l=E?encodeURIComponent(k):k,w+=`${P}=${l}&`}),w.slice(0,-1)):(l=E?encodeURIComponent(c):c,w=`${P}=${l}`),`${x}&${w}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=r?`${e.url}?${r}`:e.url,o=yield fetch(a,n),d=o.headers.get("content-type")||"";let i,f,{responseType:p="text"}=o.ok?e:{};switch(d.includes("application/json")&&(p="json"),p){case"arraybuffer":case"blob":f=yield o.blob(),i=yield(_=>s(this,null,function*(){return new Promise((E,x)=>{const b=new FileReader;b.onload=()=>{const P=b.result;E(P.indexOf(",")>=0?P.split(",")[1]:P)},b.onerror=P=>x(P),b.readAsDataURL(_)})}))(f);break;case"json":i=yield o.json();break;default:i=yield o.text()}const y={};return o.headers.forEach((_,E)=>{y[E]=_}),{data:i,headers:y,status:o.status,url:o.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 Q(){return u.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}Z("CapacitorHttp",{web:()=>new ye}),Z("Portals",{web:()=>Promise.resolve().then(function(){return _e}).then(t=>new t.PortalsWeb)});const _e=Object.freeze({__proto__:null,PortalsWeb:class extends O{publishNative(t){return s(this,null,function*(){})}}}),ee=t=>{var e,n,r;if(typeof window!="undefined"&&Q&&((e=Q())!=null&&e.value)){const a=(r=(n=Q())==null?void 0:n.value)!=null?r:null;if(!a)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(a)}},be=t=>new Promise(e=>s(this,null,function*(){let n=null;n=t!=null&&t.mockData?t.mockData:((r,{asiaUatData:a,euSitData:o,euUatData:d})=>{var y,_;const i=(y=r.mockServerInfo)==null?void 0:y.env,f=(_=r.mockServerInfo)==null?void 0:_.area;let p=null;return i&&f&&(g.ASIA===f?m.UAT===i&&(p=a):g.EU===f&&(m.SIT===i?p=o:m.UAT===i&&(p=d))),p})(t,{asiaUatData:yield Promise.resolve().then(()=>je),euSitData:yield Promise.resolve().then(()=>xe),euUatData:yield Promise.resolve().then(()=>Ue)}),e(n?n!=null&&n.default?n==null?void 0:n.default:n:null)})),X=class X{isNative(){return s(this,null,function*(){return yield(()=>{let e=!1;return ee(n=>{e=!!(n!=null&&n.isNative)}),e})()})}redirectPage(e){return s(this,null,function*(){yield(({callBack:n})=>{ee(r=>{var o;if(!(r!=null&&r.params))return void console.info("initial context native params is undefine");const a=(o=r==null?void 0:r.params)!=null?o:null;a&&(n?n(a):console.error("initial context call back is undefine"))})})(e)})}getNativeInfo(e){return s(this,null,function*(){const n=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:X.defaultNativeAppInfoConfig;return(yield this.isNative())?yield(()=>{let r=null;return ee(a=>{r=a!=null?a:null}),r})():yield be(n)})}};M(X,"defaultNativeAppInfoConfig",{mockServerInfo:{area:g.ASIA,env:m.UAT}});let te=X;const V=()=>{let t={};return typeof window!="undefined"&&(t=window),t},W="CommunicatePlugin",v=u.registerPlugin(W,{web:()=>Promise.resolve().then(()=>Ie).then(t=>new t.PluginsWeb)}),q=V();q.removeAddListenerFab=()=>null;const Pe=t=>{var n,r;q.removeAddListenerFab&&q.removeAddListenerFab();const e=[];(n=v.showFABMenu)==null||n.call(v,{fabMenu:e}),t&&((r=Object.keys(t))!=null&&r.length)&&(Object.keys(t).forEach(a=>{var o,d,i,f,p,y;e.push({icon:(d=(o=t==null?void 0:t[a])==null?void 0:o.icon)!=null?d:"",id:(f=(i=t==null?void 0:t[a])==null?void 0:i.id)!=null?f:"",name:(y=(p=t==null?void 0:t[a])==null?void 0:p.title)!=null?y:""})}),queueMicrotask(()=>{var a;(a=v.showFABMenu)==null||a.call(v,{fabMenu:e})}),setTimeout(()=>{(a=>s(this,null,function*(){a&&(q.removeAddListenerFab=yield(o=>s(this,null,function*(){if(u.addListener){const d=yield u.addListener(W,"nativeSendFab",i=>o&&o(i));return d!=null&&d.remove?d.remove:()=>null}}))(a))}))(a=>{let o;a!=null&&a.id&&(Object.keys(t).forEach(d=>{var i,f,p;(i=t==null?void 0:t[d])!=null&&i.id&&a.id===t[d].id&&(o=(p=(f=t[d])==null?void 0:f.fn)!=null?p:()=>null)}),typeof o=="function"&&o())})}))},T=V();T.addListenerBackRemoveHandle=()=>null;const de=(t=()=>null)=>s(this,null,function*(){T!=null&&T.addListenerBackRemoveHandle&&typeof T.addListenerBackRemoveHandle=="function"&&T.addListenerBackRemoveHandle(),T.addListenerBackRemoveHandle=yield(e=>s(this,null,function*(){if(u.addListener){const n=yield u.addListener(W,"nativeSendBack",r=>e&&e(r));return n!=null&&n.remove?n.remove:()=>null}}))(t)}),z=V();z.addListenerHomeHandle=()=>null;const ke=t=>{z.addListenerHomeHandle&&z.addListenerHomeHandle(),setTimeout(()=>{(e=>s(this,null,function*(){e&&(z.addListenerHomeHandle=yield(n=>s(this,null,function*(){if(u.addListener){const r=yield u.addListener(W,"nativeSendHome",a=>n&&n(a));return r!=null&&r.remove?r.remove:()=>null}}))(e))}))(t)})};class Se{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return s(this,null,function*(){var n;return yield(n=v.homeIsClick)==null?void 0:n.call(v,e)})}setBackBtn(e){(n=>{const{mounted:r,beforeUnmount:a,callBack:o}=n;r(()=>{de(o)}),a(()=>{de()})})(e)}setHomeBtn(e){ke(e)}setFabBtn(e){Pe(e)}openMiniApp(e){return s(this,null,function*(){return yield v.openMiniApp(e)})}showTitle(e){return s(this,null,function*(){return yield v.showTitle(e)})}showSubMask(e){return s(this,null,function*(){return yield v.showSubMask(e)})}setMiniAppVersion(e){return s(this,null,function*(){return yield v.setMiniAppVersion(e)})}showNativeLoading(){return s(this,null,function*(){return yield v.showDialog()})}cancelNativeLoading(){return s(this,null,function*(){return yield v.cancelDialog()})}}const Ce=u.registerPlugin("CameraScanPlugin",{web:new class extends O{pickCameraScan(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}}});window.removeAddListenerCameraScan=()=>null;class Le{pickCameraScan(e){return s(this,null,function*(){return yield Ce.pickCameraScan(e)})}}const Ae=u.registerPlugin("CameraScanMultiplePlugin",{web:new class extends O{pickCameraScanMultiple(){return s(this,null,function*(){})}}});class Oe{pickCameraScanMultiple(e){return s(this,null,function*(){return yield Ae.pickCameraScanMultiple(e)})}}const Ee=u.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends O{pickCameraScanMultipleNoCount(){return s(this,null,function*(){})}}});class Ne{pickCameraScanMultipleNoCount(e){return s(this,null,function*(){return yield Ee.pickCameraScanMultipleNoCount(e)})}}const ce="LaserScanPlugin",le=u.registerPlugin(ce,{web:new class extends O{pickLaserScan(){return s(this,null,function*(){})}unPickLaserScan(){return s(this,null,function*(){})}}}),G=V();G.removeAddListenerLaserScan=()=>null;const pe=(t=()=>null)=>{G.removeAddListenerLaserScan&&G.removeAddListenerLaserScan();const e=n=>s(this,null,function*(){n&&(G.removeAddListenerLaserScan=yield(r=>s(this,null,function*(){if(u.addListener){const a=yield u.addListener(ce,"nativeSendLaser",o=>r&&r(o));return a!=null&&a.remove?a.remove:()=>null}}))(n))});setTimeout(()=>{e(t)})};class Me{constructor(){this.pickLaserScan()}pickLaserScan(){return s(this,null,function*(){le.pickLaserScan({isContinue:!1})})}unPickLaserScan(){return s(this,null,function*(){le.unPickLaserScan()})}setLaserScan(e){(n=>{const{mounted:r,beforeUnmount:a,callBack:o}=n;r(()=>{pe(o)}),a(()=>{pe()})})(e)}}class ue{constructor(){M(this,"initialContextPlugins",new te);M(this,"communicatePlugins",new Se);M(this,"cameraScanPlugins",new Le);M(this,"cameraScanMultiplePlugins",new Oe);M(this,"cameraScanMultipleNoCountPlugins",new Ne);M(this,"laserScanPlugins",new Me)}}const Te=new ue,je=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"},data_kong:{token:{access_token:"OLXyjfmHGolOdt7NMLvzh4VEAFRRHZAf",expires_in:86400,token_type:"bearer"}}}},Symbol.toStringTag,{value:"Module"})),xe=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"},data_kong:{"X-ASW-APIKey":"6j2AHemxmsGMmIs9rtdys0DK04Hag6s1","EVC-X-ASW-APIKey":"6j2AHemxmsGMmIs9rtdys0DK04Hag6s1"}}},Symbol.toStringTag,{value:"Module"})),Ue=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"},data_kong:{"X-ASW-APIKey":"axiBpmRYqN99pWG9r3horNTNgWxpvlfG","EVC-X-ASW-APIKey":"6j2AHemxmsGMmIs9rtdys0DK04Hag6s1"}}},Symbol.toStringTag,{value:"Module"})),Ie=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends O{homeIsClick(){return s(this,null,function*(){})}openMiniApp(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showTitle(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showFABMenu(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showSubMask(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}setMiniAppVersion(t){return s(this,null,function*(){return new Promise(e=>{e(t)})})}showDialog(){return s(this,null,function*(){})}cancelDialog(){return s(this,null,function*(){})}}},Symbol.toStringTag,{value:"Module"}));h.NativeApi=ue,h.default=Te,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "superapp-miniapp-invoke-native",
3
3
  "type": "module",
4
- "version": "1.0.71",
4
+ "version": "1.0.73",
5
5
  "description": "Superapp中,小程序调用Native 接口的封装,如OSP项目中,需要调用Native的相机扫描,镭射扫描,获取RBAC的数据等",
6
6
  "scripts": {
7
7
  "dev": "vite",