superapp-miniapp-invoke-native 1.0.58 → 1.0.60

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
@@ -51,6 +51,7 @@ declare class CommunicatePlugins implements CommunicatePluginsHookType {
51
51
  openMinApp(minApp: MinAppType): Promise<MinAppType>;
52
52
  showTitle(title: TitleType): Promise<TitleType>;
53
53
  showSubMask(subMask: subMaskType): Promise<subMaskType>;
54
+ setMinAppVersion(minAppVersion: MinAppVersionType): Promise<MinAppVersionType>;
54
55
  showNativeLoading(): Promise<void>;
55
56
  cancelNativeLoading(): Promise<void>;
56
57
  }
@@ -62,6 +63,7 @@ declare interface CommunicatePluginsHookType {
62
63
  openMinApp(minApp: MinAppType): Promise<MinAppType>;
63
64
  showTitle(title: TitleType): Promise<TitleType>;
64
65
  showSubMask(subMask: subMaskType): Promise<subMaskType>;
66
+ setMinAppVersion(minAppVersion: MinAppVersionType): Promise<MinAppVersionType>;
65
67
  showNativeLoading: () => Promise<void>;
66
68
  cancelNativeLoading: () => Promise<void>;
67
69
  }
@@ -114,6 +116,10 @@ declare interface MinAppType {
114
116
  params?: string;
115
117
  }
116
118
 
119
+ declare interface MinAppVersionType {
120
+ minAppVersion: string;
121
+ }
122
+
117
123
  export declare class NativeApi {
118
124
  initialContextPlugins: InitialContextPlugins;
119
125
  communicatePlugins: CommunicatePlugins;
package/lib/main.js CHANGED
@@ -33,7 +33,7 @@ var M;
33
33
  se.addPlatform, se.setPlatform, function(n) {
34
34
  n.Unimplemented = "UNIMPLEMENTED", n.Unavailable = "UNAVAILABLE";
35
35
  }(M || (M = {}));
36
- class Q extends Error {
36
+ class X extends Error {
37
37
  constructor(e, t, r) {
38
38
  super(e), this.message = e, this.code = t, this.data = r;
39
39
  }
@@ -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 b = v(), T = E(c);
57
- let O;
56
+ const _ = v(), T = E(c);
57
+ let A;
58
58
  const q = (P) => {
59
59
  let L;
60
- const N = (...$) => {
60
+ const N = (...H) => {
61
61
  const j = (() => s(void 0, null, function* () {
62
- return !O && b in p ? O = O = typeof p[b] == "function" ? yield p[b]() : p[b] : d !== null && !O && "web" in p && (O = O = typeof p.web == "function" ? yield p.web() : p.web), O;
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
63
  }))().then((U) => {
64
- const ae = ((_, x) => {
64
+ const ae = ((b, x) => {
65
65
  var G, J;
66
66
  if (!T) {
67
- if (_)
68
- return (J = _[x]) === null || J === void 0 ? void 0 : J.bind(_);
69
- throw new Q(`"${c}" plugin is not implemented on ${b}`, M.Unimplemented);
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);
70
70
  }
71
71
  {
72
72
  const re = T == null ? void 0 : T.methods.find((I) => x === I.name);
73
73
  if (re)
74
74
  return re.rtype === "promise" ? (I) => i.nativePromise(c, x.toString(), I) : (I, me) => i.nativeCallback(c, x.toString(), I, me);
75
- if (_)
76
- return (G = _[x]) === null || G === void 0 ? void 0 : G.bind(_);
75
+ if (b)
76
+ return (G = b[x]) === null || G === void 0 ? void 0 : G.bind(b);
77
77
  }
78
78
  })(U, P);
79
79
  if (ae) {
80
- const _ = ae(...$);
81
- return L = _ == null ? void 0 : _.remove, _;
80
+ const b = ae(...H);
81
+ return L = b == null ? void 0 : b.remove, b;
82
82
  }
83
- throw new Q(`"${c}.${P}()" is not implemented on ${b}`, M.Unimplemented);
83
+ throw new X(`"${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();
@@ -88,12 +88,12 @@ const ge = (n) => {
88
88
  };
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
- const N = ne({ eventName: P }, L), $ = () => s(void 0, null, function* () {
91
+ const N = ne({ eventName: P }, L), H = () => s(void 0, null, function* () {
92
92
  const U = yield N;
93
93
  te({ eventName: P, callbackId: U }, L);
94
- }), j = new Promise((U) => N.then(() => U({ remove: $ })));
94
+ }), j = new Promise((U) => N.then(() => U({ remove: H })));
95
95
  return j.remove = () => s(void 0, null, function* () {
96
- console.warn("Using addListener() without 'await' is deprecated."), yield $();
96
+ console.warn("Using addListener() without 'await' is deprecated."), yield H();
97
97
  }), j;
98
98
  }, z = new Proxy({}, { get(P, L) {
99
99
  switch (L) {
@@ -109,10 +109,10 @@ const ge = (n) => {
109
109
  return q(L);
110
110
  }
111
111
  } });
112
- return u[c] = z, h.set(c, { name: c, proxy: z, platforms: /* @__PURE__ */ new Set([...Object.keys(p), ...T ? [b] : []]) }), z;
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 = Q, 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 : {}), Z = m.registerPlugin;
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;
116
116
  m.Plugins;
117
117
  class C {
118
118
  constructor(e) {
@@ -224,8 +224,8 @@ class ye extends C {
224
224
  });
225
225
  }
226
226
  }
227
- Z("CapacitorCookies", { web: () => new ye() });
228
- const be = (n, e = {}) => {
227
+ Q("CapacitorCookies", { web: () => new ye() });
228
+ const _e = (n, e = {}) => {
229
229
  const t = Object.assign({ method: n.method || "GET", headers: n.headers }, e), r = ((a = {}) => {
230
230
  const o = Object.keys(a);
231
231
  return Object.keys(a).map((d) => d.toLocaleLowerCase()).reduce((d, i, u) => (d[i] = a[o[u]], d), {});
@@ -253,14 +253,14 @@ const be = (n, e = {}) => {
253
253
  (r.includes("application/json") || typeof n.data == "object") && (t.body = JSON.stringify(n.data));
254
254
  return t;
255
255
  };
256
- class _e extends C {
256
+ class be extends C {
257
257
  request(e) {
258
258
  return s(this, null, function* () {
259
- const t = be(e, e.webFetchExtra), r = ((g, k = !0) => g ? Object.entries(g).reduce((E, h) => {
259
+ const t = _e(e, e.webFetchExtra), r = ((g, k = !0) => g ? Object.entries(g).reduce((E, h) => {
260
260
  const [y, c] = h;
261
261
  let p, f;
262
- return Array.isArray(c) ? (f = "", c.forEach((b) => {
263
- p = k ? encodeURIComponent(b) : b, f += `${y}=${p}&`;
262
+ return Array.isArray(c) ? (f = "", c.forEach((_) => {
263
+ p = k ? encodeURIComponent(_) : _, f += `${y}=${p}&`;
264
264
  }), f.slice(0, -1)) : (p = k ? encodeURIComponent(c) : c, f = `${y}=${p}`), `${E}&${f}`;
265
265
  }, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams), a = r ? `${e.url}?${r}` : e.url, o = yield fetch(a, t), d = o.headers.get("content-type") || "";
266
266
  let i, u, { responseType: l = "text" } = o.ok ? e : {};
@@ -315,11 +315,11 @@ class _e extends C {
315
315
  });
316
316
  }
317
317
  }
318
- function X() {
318
+ function Y() {
319
319
  return m.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
320
320
  }
321
- Z("CapacitorHttp", { web: () => new _e() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
322
- Z("Portals", { web: () => Promise.resolve().then(function() {
321
+ Q("CapacitorHttp", { web: () => new be() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
322
+ Q("Portals", { web: () => Promise.resolve().then(function() {
323
323
  return Pe;
324
324
  }).then((n) => new n.PortalsWeb()) });
325
325
  const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
@@ -327,10 +327,10 @@ const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
327
327
  return s(this, null, function* () {
328
328
  });
329
329
  }
330
- } }), Y = (n) => {
330
+ } }), Z = (n) => {
331
331
  var e, t, r;
332
- if (typeof window != "undefined" && X && ((e = X()) != null && e.value)) {
333
- const a = (r = (t = X()) == null ? void 0 : t.value) != null ? r : null;
332
+ if (typeof window != "undefined" && Y && ((e = Y()) != null && e.value)) {
333
+ const a = (r = (t = Y()) == null ? void 0 : t.value) != null ? r : null;
334
334
  if (!a)
335
335
  return void console.error("native initialContext is undefine");
336
336
  if (!n)
@@ -350,7 +350,7 @@ const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
350
350
  return s(this, null, function* () {
351
351
  return yield (() => {
352
352
  let e = !1;
353
- return Y((t) => {
353
+ return Z((t) => {
354
354
  e = !!(t != null && t.isNative);
355
355
  }), e;
356
356
  })();
@@ -359,7 +359,7 @@ const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
359
359
  redirectPage(e) {
360
360
  return s(this, null, function* () {
361
361
  yield (({ callBack: t }) => {
362
- Y((r) => {
362
+ Z((r) => {
363
363
  var i;
364
364
  if (!(r != null && r.params))
365
365
  return void console.error("native params is undefine");
@@ -377,7 +377,7 @@ const Pe = Object.freeze({ __proto__: null, PortalsWeb: class extends C {
377
377
  const t = e != null && e.mockServerInfo || e != null && e.mockData ? e : K.defaultNativeAppInfoConfig;
378
378
  return (yield this.isNative()) ? yield (() => {
379
379
  let r = null;
380
- return Y((a) => {
380
+ return Z((a) => {
381
381
  r = a != null ? a : null;
382
382
  }), r;
383
383
  })() : yield ke(t);
@@ -389,11 +389,11 @@ let ee = K;
389
389
  const V = () => {
390
390
  let n = {};
391
391
  return typeof window != "undefined" && (n = window), n;
392
- }, W = "CommunicatePlugin", w = m.registerPlugin(W, { web: () => Promise.resolve().then(() => $e).then((n) => new n.PluginsWeb()) }), F = V();
393
- F.removeAddListenerFab = () => null;
392
+ }, W = "CommunicatePlugin", w = m.registerPlugin(W, { web: () => Promise.resolve().then(() => He).then((n) => new n.PluginsWeb()) }), R = V();
393
+ R.removeAddListenerFab = () => null;
394
394
  const Le = (n) => {
395
395
  var t, r;
396
- F.removeAddListenerFab && F.removeAddListenerFab();
396
+ R.removeAddListenerFab && R.removeAddListenerFab();
397
397
  const e = [];
398
398
  (t = w.showFABMenu) == null || t.call(w, { fabMenu: e }), n && ((r = Object.keys(n)) != null && r.length) && (Object.keys(n).forEach((a) => {
399
399
  var o, d, i, u, l, v;
@@ -403,7 +403,7 @@ const Le = (n) => {
403
403
  (a = w.showFABMenu) == null || a.call(w, { fabMenu: e });
404
404
  }), setTimeout(() => {
405
405
  ((a) => s(void 0, null, function* () {
406
- a && (F.removeAddListenerFab = yield ((o) => s(void 0, null, function* () {
406
+ a && (R.removeAddListenerFab = yield ((o) => s(void 0, null, function* () {
407
407
  if (m.addListener) {
408
408
  const d = yield m.addListener(W, "nativeSendFab", (i) => o && o(i));
409
409
  return d != null && d.remove ? d.remove : () => null;
@@ -417,21 +417,21 @@ const Le = (n) => {
417
417
  }), typeof o == "function" && o());
418
418
  });
419
419
  }));
420
- }, A = V();
421
- A.addListenerBackRemoveHandle = () => null;
420
+ }, O = V();
421
+ O.addListenerBackRemoveHandle = () => null;
422
422
  const de = (n = () => null) => s(void 0, null, function* () {
423
- A != null && A.addListenerBackRemoveHandle && typeof A.addListenerBackRemoveHandle == "function" && A.addListenerBackRemoveHandle(), A.addListenerBackRemoveHandle = yield ((e) => s(void 0, null, function* () {
423
+ O != null && O.addListenerBackRemoveHandle && typeof O.addListenerBackRemoveHandle == "function" && O.addListenerBackRemoveHandle(), O.addListenerBackRemoveHandle = yield ((e) => s(void 0, null, function* () {
424
424
  if (m.addListener) {
425
425
  const t = yield m.addListener(W, "nativeSendBack", (r) => e && e(r));
426
426
  return t != null && t.remove ? t.remove : () => null;
427
427
  }
428
428
  }))(n);
429
- }), R = V();
430
- R.addListenerHomeHandle = () => null;
429
+ }), $ = V();
430
+ $.addListenerHomeHandle = () => null;
431
431
  const Se = (n) => {
432
- R.addListenerHomeHandle && R.addListenerHomeHandle(), setTimeout(() => {
432
+ $.addListenerHomeHandle && $.addListenerHomeHandle(), setTimeout(() => {
433
433
  ((e) => s(void 0, null, function* () {
434
- e && (R.addListenerHomeHandle = yield ((t) => s(void 0, null, function* () {
434
+ e && ($.addListenerHomeHandle = yield ((t) => s(void 0, null, function* () {
435
435
  if (m.addListener) {
436
436
  const r = yield m.addListener(W, "nativeSendHome", (a) => t && t(a));
437
437
  return r != null && r.remove ? r.remove : () => null;
@@ -481,6 +481,11 @@ class Ce {
481
481
  return yield w.showSubMask(e);
482
482
  });
483
483
  }
484
+ setMinAppVersion(e) {
485
+ return s(this, null, function* () {
486
+ return yield w.setMinAppVersion(e);
487
+ });
488
+ }
484
489
  showNativeLoading() {
485
490
  return s(this, null, function* () {
486
491
  return yield w.showDialog();
@@ -492,17 +497,17 @@ class Ce {
492
497
  });
493
498
  }
494
499
  }
495
- const Oe = m.registerPlugin("CameraScanPlugin", { web: new class extends C {
500
+ const Ae = m.registerPlugin("CameraScanPlugin", { web: new class extends C {
496
501
  pickCameraScan() {
497
502
  return s(this, null, function* () {
498
503
  });
499
504
  }
500
505
  }() });
501
506
  window.removeAddListenerCameraScan = () => null;
502
- class Ae {
507
+ class Oe {
503
508
  pickCameraScan() {
504
509
  return s(this, null, function* () {
505
- return yield Oe.pickCameraScan();
510
+ return yield Ae.pickCameraScan();
506
511
  });
507
512
  }
508
513
  }
@@ -541,12 +546,12 @@ const pe = "LaserScanPlugin", ce = m.registerPlugin(pe, { web: new class extends
541
546
  return s(this, null, function* () {
542
547
  });
543
548
  }
544
- }() }), H = V();
545
- H.removeAddListenerLaserScan = () => null;
549
+ }() }), F = V();
550
+ F.removeAddListenerLaserScan = () => null;
546
551
  const le = (n = () => null) => {
547
- H.removeAddListenerLaserScan && H.removeAddListenerLaserScan();
552
+ F.removeAddListenerLaserScan && F.removeAddListenerLaserScan();
548
553
  const e = (t) => s(void 0, null, function* () {
549
- t && (H.removeAddListenerLaserScan = yield ((r) => s(void 0, null, function* () {
554
+ t && (F.removeAddListenerLaserScan = yield ((r) => s(void 0, null, function* () {
550
555
  if (m.addListener) {
551
556
  const a = yield m.addListener(pe, "nativeSendLaser", (o) => r && r(o));
552
557
  return a != null && a.remove ? a.remove : () => null;
@@ -586,13 +591,13 @@ class Ue {
586
591
  constructor() {
587
592
  S(this, "initialContextPlugins", new ee());
588
593
  S(this, "communicatePlugins", new Ce());
589
- S(this, "cameraScanPlugins", new Ae());
594
+ S(this, "cameraScanPlugins", new Oe());
590
595
  S(this, "cameraScanMultiplePlugins", new Ne());
591
596
  S(this, "cameraScanMultipleNoCountPlugins", new Te());
592
597
  S(this, "laserScanPlugins", new je());
593
598
  }
594
599
  }
595
- const Re = 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" } } }, 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" } } }, 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" } } }, Symbol.toStringTag, { value: "Module" })), $e = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends C {
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", kong: [{ token: { access_token: "OLXyjfmHGolOdt7NMLvzh4VEAFRRHZAf", expires_in: 86400, token_type: "bearer" } }] }, 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" })), 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", kong: [{ "X-ASW-APIKey": "6j2AHemxmsGMmIs9rtdys0DK04Hag6s1" }] }, 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" })), 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", kong: [{ "X-ASW-APIKey": "axiBpmRYqN99pWG9r3horNTNgWxpvlfG" }] }, 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" })), He = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends C {
596
601
  homeIsClick() {
597
602
  return s(this, null, function* () {
598
603
  });
@@ -625,6 +630,13 @@ const Re = new Ue(), xe = Object.freeze(Object.defineProperty({ __proto__: null,
625
630
  });
626
631
  });
627
632
  }
633
+ setMinAppVersion(n) {
634
+ return s(this, null, function* () {
635
+ return new Promise((e) => {
636
+ e(n);
637
+ });
638
+ });
639
+ }
628
640
  showDialog() {
629
641
  return s(this, null, function* () {
630
642
  });
@@ -636,5 +648,5 @@ const Re = new Ue(), xe = Object.freeze(Object.defineProperty({ __proto__: null,
636
648
  } }, Symbol.toStringTag, { value: "Module" }));
637
649
  export {
638
650
  Ue as NativeApi,
639
- Re as default
651
+ $e as default
640
652
  };
package/lib/main.umd.cjs CHANGED
@@ -1 +1 @@
1
- (function(v,m){typeof exports=="object"&&typeof module!="undefined"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):m((v=typeof globalThis!="undefined"?globalThis:v||self).main={})})(this,function(v){"use strict";var Fe=Object.defineProperty;var Re=(v,m,g)=>m in v?Fe(v,m,{enumerable:!0,configurable:!0,writable:!0,value:g}):v[m]=g;var T=(v,m,g)=>(Re(v,typeof m!="symbol"?m+"":m,g),g);var s=(v,m,g)=>new Promise((X,I)=>{var O=C=>{try{$(g.next(C))}catch(u){I(u)}},D=C=>{try{$(g.throw(C))}catch(u){I(u)}},$=C=>C.done?X(C.value):Promise.resolve(C.value).then(O,D);$((g=g.apply(v,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 X=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=X(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var O;I.addPlatform,I.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(O||(O={}));class D extends Error{constructor(e,n,r){super(e),this.message=e,this.code=n,this.data=r}}const $=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()))||!!U(c)}),U=((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(),F=U(c);let j;const ne=L=>{let N;const x=(...Q)=>{const R=(()=>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(H=>{const we=((S,B)=>{var re,se;if(!F){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}`,O.Unimplemented)}{const ge=F==null?void 0:F.methods.find(K=>B===K.name);if(ge)return ge.rtype==="promise"?K=>i.nativePromise(c,B.toString(),K):(K,$e)=>i.nativeCallback(c,B.toString(),K,$e);if(S)return(re=S[B])===null||re===void 0?void 0:re.bind(S)}})(H,L);if(we){const S=we(...Q);return N=S==null?void 0:S.remove,S}throw new D(`"${c}.${L}()" is not implemented on ${k}`,O.Unimplemented)});return L==="addListener"&&(R.remove=()=>s(this,null,function*(){return N()})),R};return x.toString=()=>`${L.toString()}() { [capacitor code] }`,Object.defineProperty(x,"name",{value:L,writable:!1,configurable:!1}),x},me=ne("addListener"),fe=ne("removeListener"),De=(L,N)=>{const x=me({eventName:L},N),Q=()=>s(this,null,function*(){const H=yield x;fe({eventName:L,callbackId:H},N)}),R=new Promise(H=>x.then(()=>H({remove:Q})));return R.remove=()=>s(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield Q()}),R},ae=new Proxy({},{get(L,N){switch(N){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return F?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),...F?[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=$(t),u=C(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),Y=u.registerPlugin;u.Plugins;class A{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,O.Unimplemented)}unavailable(e="not available"){return new u.Exception(e,O.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 A{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)}})}}Y("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 A{request(e){return s(this,null,function*(){const n=he(e,e.webFetchExtra),r=((_,E=!0)=>_?Object.entries(_).reduce((U,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}`),`${U}&${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,U)=>{const b=new FileReader;b.onload=()=>{const P=b.result;E(P.indexOf(",")>=0?P.split(",")[1]:P)},b.onerror=P=>U(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 Z(){return u.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}Y("CapacitorHttp",{web:()=>new ye}),Y("Portals",{web:()=>Promise.resolve().then(function(){return _e}).then(t=>new t.PortalsWeb)});const _e=Object.freeze({__proto__:null,PortalsWeb:class extends A{publishNative(t){return s(this,null,function*(){})}}}),ee=t=>{var e,n,r;if(typeof window!="undefined"&&Z&&((e=Z())!=null&&e.value)){const a=(r=(n=Z())==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(()=>Ue),euUatData:yield Promise.resolve().then(()=>xe)}),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 i;if(!(r!=null&&r.params))return void console.error("native params is undefine");const a=(i=JSON.parse(r.params))!=null?i:null;if(!a)return;const{params:o,routeName:d}=a;o&&d&&(n?n(a):console.error("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)})}};T(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",h=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=h.showFABMenu)==null||n.call(h,{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=h.showFABMenu)==null||a.call(h,{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())})}))},M=V();M.addListenerBackRemoveHandle=()=>null;const de=(t=()=>null)=>s(this,null,function*(){M!=null&&M.addListenerBackRemoveHandle&&typeof M.addListenerBackRemoveHandle=="function"&&M.addListenerBackRemoveHandle(),M.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=h.homeIsClick)==null?void 0:n.call(h,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)}openMinApp(e){return s(this,null,function*(){return yield h.openMinApp(e)})}showTitle(e){return s(this,null,function*(){return yield h.showTitle(e)})}showSubMask(e){return s(this,null,function*(){return yield h.showSubMask(e)})}showNativeLoading(){return s(this,null,function*(){return yield h.showDialog()})}cancelNativeLoading(){return s(this,null,function*(){return yield h.cancelDialog()})}}const Ce=u.registerPlugin("CameraScanPlugin",{web:new class extends A{pickCameraScan(){return s(this,null,function*(){})}}});window.removeAddListenerCameraScan=()=>null;class Le{pickCameraScan(){return s(this,null,function*(){return yield Ce.pickCameraScan()})}}const Oe=u.registerPlugin("CameraScanMultiplePlugin",{web:new class extends A{pickCameraScanMultiple(){return s(this,null,function*(){})}}});class Ae{pickCameraScanMultiple(e){return s(this,null,function*(){return yield Oe.pickCameraScanMultiple(e)})}}const Ee=u.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends A{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 A{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 Te{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(){T(this,"initialContextPlugins",new te);T(this,"communicatePlugins",new Se);T(this,"cameraScanPlugins",new Le);T(this,"cameraScanMultiplePlugins",new Ae);T(this,"cameraScanMultipleNoCountPlugins",new Ne);T(this,"laserScanPlugins",new Te)}}const Me=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"}}},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"}}},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"}}},Symbol.toStringTag,{value:"Module"})),Ie=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends A{homeIsClick(){return s(this,null,function*(){})}openMinApp(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)})})}showDialog(){return s(this,null,function*(){})}cancelDialog(){return s(this,null,function*(){})}}},Symbol.toStringTag,{value:"Module"}));v.NativeApi=ue,v.default=Me,Object.defineProperties(v,{__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=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=(n=>(n.DEV="dev",n.SIT="sit",n.UAT="uat",n.PROD="prod",n.TEST="test",n))(m||{}),g=(n=>(n.EU="eu",n.ASIA="asia",n))(g||{});/*! Capacitor: https://capacitorjs.com/ - MIT License */const Y=n=>n.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const r=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return r.addPlatform=(a,o)=>{r.platforms.set(a,o)},r.setPlatform=a=>{r.platforms.has(a)&&(r.currentPlatform=r.platforms.get(a))},r})(n),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(n){n.Unimplemented="UNIMPLEMENTED",n.Unavailable="UNAVAILABLE"}(A||(A={}));class D extends Error{constructor(e,t,r){super(e),this.message=e,this.code=t,this.data=r}}const H=n=>{var e,t,r,a,o;const d=n.CapacitorCustomPlatform||null,i=n.Capacitor||{},f=i.Plugins=i.Plugins||{},p=n.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"})(n)),_=((t=p==null?void 0:p.currentPlatform)===null||t===void 0?void 0:t.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()))||!!U(c)}),U=((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=U(c);let j;const te=C=>{let N;const x=(...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 x.toString=()=>`${C.toString()}() { [capacitor code] }`,Object.defineProperty(x,"name",{value:C,writable:!1,configurable:!1}),x},me=te("addListener"),fe=te("removeListener"),De=(C,N)=>{const x=me({eventName:C},N),X=()=>s(this,null,function*(){const F=yield x;fe({eventName:C,callbackId:F},N)}),$=new Promise(F=>x.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 te(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=>n.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=n=>n.Capacitor=H(n),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,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const r=this.windowListeners[e];r&&!r.registered&&this.addWindowListener(r);const a=()=>s(this,null,function*(){return this.removeListener(e,t)}),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,t){const r=this.listeners[e];r&&r.forEach(a=>a(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:r=>{this.notifyListeners(t,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,t){return s(this,null,function*(){const r=this.listeners[e];if(!r)return;const a=r.indexOf(t);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=n=>encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ie=n=>n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ve extends O{getCookies(){return s(this,null,function*(){const e=document.cookie,t={};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(),t[a]=o}),t})}setCookie(e){return s(this,null,function*(){try{const t=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=`${t}=${r||""}${a}; path=${o}; ${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)}})}}Z("CapacitorCookies",{web:()=>new ve});const he=(n,e={})=>{const t=Object.assign({method:n.method||"GET",headers:n.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),{})})(n.headers)["content-type"]||"";if(typeof n.data=="string")t.body=n.data;else if(r.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[o,d]of Object.entries(n.data||{}))a.set(o,d);t.body=a.toString()}else if(r.includes("multipart/form-data")){const a=new FormData;if(n.data instanceof FormData)n.data.forEach((d,i)=>{a.append(i,d)});else for(const d of Object.keys(n.data))a.append(d,n.data[d]);t.body=a;const o=new Headers(t.headers);o.delete("content-type"),t.headers=o}else(r.includes("application/json")||typeof n.data=="object")&&(t.body=JSON.stringify(n.data));return t};class ye extends O{request(e){return s(this,null,function*(){const t=he(e,e.webFetchExtra),r=((_,E=!0)=>_?Object.entries(_).reduce((U,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}`),`${U}&${w}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=r?`${e.url}?${r}`:e.url,o=yield fetch(a,t),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,U)=>{const b=new FileReader;b.onload=()=>{const P=b.result;E(P.indexOf(",")>=0?P.split(",")[1]:P)},b.onerror=P=>U(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(n=>new n.PortalsWeb)});const _e=Object.freeze({__proto__:null,PortalsWeb:class extends O{publishNative(n){return s(this,null,function*(){})}}}),ee=n=>{var e,t,r;if(typeof window!="undefined"&&Q&&((e=Q())!=null&&e.value)){const a=(r=(t=Q())==null?void 0:t.value)!=null?r:null;if(!a)return void console.error("native initialContext is undefine");if(!n)return void console.error("initialContext call back is undefine");n(a)}},be=n=>new Promise(e=>s(this,null,function*(){let t=null;t=n!=null&&n.mockData?n.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})(n,{asiaUatData:yield Promise.resolve().then(()=>je),euSitData:yield Promise.resolve().then(()=>Ue),euUatData:yield Promise.resolve().then(()=>xe)}),e(t?t!=null&&t.default?t==null?void 0:t.default:t:null)})),J=class J{isNative(){return s(this,null,function*(){return yield(()=>{let e=!1;return ee(t=>{e=!!(t!=null&&t.isNative)}),e})()})}redirectPage(e){return s(this,null,function*(){yield(({callBack:t})=>{ee(r=>{var i;if(!(r!=null&&r.params))return void console.error("native params is undefine");const a=(i=JSON.parse(r.params))!=null?i:null;if(!a)return;const{params:o,routeName:d}=a;o&&d&&(t?t(a):console.error("call back is undefine"))})})(e)})}getNativeInfo(e){return s(this,null,function*(){const t=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(t)})}};M(J,"defaultNativeAppInfoConfig",{mockServerInfo:{area:g.ASIA,env:m.UAT}});let ne=J;const V=()=>{let n={};return typeof window!="undefined"&&(n=window),n},W="CommunicatePlugin",v=u.registerPlugin(W,{web:()=>Promise.resolve().then(()=>Ie).then(n=>new n.PluginsWeb)}),q=V();q.removeAddListenerFab=()=>null;const Pe=n=>{var t,r;q.removeAddListenerFab&&q.removeAddListenerFab();const e=[];(t=v.showFABMenu)==null||t.call(v,{fabMenu:e}),n&&((r=Object.keys(n))!=null&&r.length)&&(Object.keys(n).forEach(a=>{var o,d,i,f,p,y;e.push({icon:(d=(o=n==null?void 0:n[a])==null?void 0:o.icon)!=null?d:"",id:(f=(i=n==null?void 0:n[a])==null?void 0:i.id)!=null?f:"",name:(y=(p=n==null?void 0:n[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(n).forEach(d=>{var i,f,p;(i=n==null?void 0:n[d])!=null&&i.id&&a.id===n[d].id&&(o=(p=(f=n[d])==null?void 0:f.fn)!=null?p:()=>null)}),typeof o=="function"&&o())})}))},T=V();T.addListenerBackRemoveHandle=()=>null;const de=(n=()=>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 t=yield u.addListener(W,"nativeSendBack",r=>e&&e(r));return t!=null&&t.remove?t.remove:()=>null}}))(n)}),z=V();z.addListenerHomeHandle=()=>null;const ke=n=>{z.addListenerHomeHandle&&z.addListenerHomeHandle(),setTimeout(()=>{(e=>s(this,null,function*(){e&&(z.addListenerHomeHandle=yield(t=>s(this,null,function*(){if(u.addListener){const r=yield u.addListener(W,"nativeSendHome",a=>t&&t(a));return r!=null&&r.remove?r.remove:()=>null}}))(e))}))(n)})};class Se{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return s(this,null,function*(){var t;return yield(t=v.homeIsClick)==null?void 0:t.call(v,e)})}setBackBtn(e){(t=>{const{mounted:r,beforeUnmount:a,callBack:o}=t;r(()=>{de(o)}),a(()=>{de()})})(e)}setHomeBtn(e){ke(e)}setFabBtn(e){Pe(e)}openMinApp(e){return s(this,null,function*(){return yield v.openMinApp(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)})}setMinAppVersion(e){return s(this,null,function*(){return yield v.setMinAppVersion(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(){return s(this,null,function*(){})}}});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=(n=()=>null)=>{G.removeAddListenerLaserScan&&G.removeAddListenerLaserScan();const e=t=>s(this,null,function*(){t&&(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}}))(t))});setTimeout(()=>{e(n)})};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){(t=>{const{mounted:r,beforeUnmount:a,callBack:o}=t;r(()=>{pe(o)}),a(()=>{pe()})})(e)}}class ue{constructor(){M(this,"initialContextPlugins",new ne);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",kong:[{token:{access_token:"OLXyjfmHGolOdt7NMLvzh4VEAFRRHZAf",expires_in:86400,token_type:"bearer"}}]},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"})),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",kong:[{"X-ASW-APIKey":"6j2AHemxmsGMmIs9rtdys0DK04Hag6s1"}]},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"})),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",kong:[{"X-ASW-APIKey":"axiBpmRYqN99pWG9r3horNTNgWxpvlfG"}]},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"})),Ie=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends O{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)})})}setMinAppVersion(n){return s(this,null,function*(){return new Promise(e=>{e(n)})})}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.58",
4
+ "version": "1.0.60",
5
5
  "description": "Superapp中,小程序调用Native 接口的封装,如OSP项目中,需要调用Native的相机扫描,镭射扫描,获取RBAC的数据等",
6
6
  "scripts": {
7
7
  "dev": "vite",