superapp-miniapp-invoke-native 1.3.0 → 1.3.2

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.js CHANGED
@@ -1,18 +1,18 @@
1
1
  var ge = Object.defineProperty;
2
2
  var ve = (r, e, t) => e in r ? ge(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var P = (r, e, t) => (ve(r, typeof e != "symbol" ? e + "" : e, t), t);
3
+ var v = (r, e, t) => (ve(r, typeof e != "symbol" ? e + "" : e, t), t);
4
4
  var a = (r, e, t) => new Promise((n, o) => {
5
5
  var s = (w) => {
6
6
  try {
7
7
  i(t.next(w));
8
- } catch (u) {
9
- o(u);
8
+ } catch (m) {
9
+ o(m);
10
10
  }
11
11
  }, c = (w) => {
12
12
  try {
13
13
  i(t.throw(w));
14
- } catch (u) {
15
- o(u);
14
+ } catch (m) {
15
+ o(m);
16
16
  }
17
17
  }, i = (w) => w.done ? n(w.value) : Promise.resolve(w.value).then(s, c);
18
18
  i((t = t.apply(r, e)).next());
@@ -39,20 +39,20 @@ class X extends Error {
39
39
  }
40
40
  const be = (r) => {
41
41
  var e, t, n, o, s;
42
- const c = r.CapacitorCustomPlatform || null, i = r.Capacitor || {}, w = i.Plugins = i.Plugins || {}, u = r.CapacitorPlatforms, f = ((e = u == null ? void 0 : u.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => c !== null ? c.name : ((l) => {
42
+ const c = r.CapacitorCustomPlatform || null, i = r.Capacitor || {}, w = i.Plugins = i.Plugins || {}, m = r.CapacitorPlatforms, P = ((e = m == null ? void 0 : m.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => c !== null ? c.name : ((l) => {
43
43
  var d, h;
44
44
  return l != null && l.androidBridge ? "android" : !((h = (d = l == null ? void 0 : l.webkit) === null || d === void 0 ? void 0 : d.messageHandlers) === null || h === void 0) && h.bridge ? "ios" : "web";
45
- })(r)), g = ((t = u == null ? void 0 : u.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => f() !== "web"), v = ((n = u == null ? void 0 : u.currentPlatform) === null || n === void 0 ? void 0 : n.isPluginAvailable) || ((l) => {
45
+ })(r)), f = ((t = m == null ? void 0 : m.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => P() !== "web"), g = ((n = m == null ? void 0 : m.currentPlatform) === null || n === void 0 ? void 0 : n.isPluginAvailable) || ((l) => {
46
46
  const d = b.get(l);
47
- return !!(d != null && d.platforms.has(f())) || !!B(l);
48
- }), B = ((o = u == null ? void 0 : u.currentPlatform) === null || o === void 0 ? void 0 : o.getPluginHeader) || ((l) => {
47
+ return !!(d != null && d.platforms.has(P())) || !!B(l);
48
+ }), B = ((o = m == null ? void 0 : m.currentPlatform) === null || o === void 0 ? void 0 : o.getPluginHeader) || ((l) => {
49
49
  var d;
50
50
  return (d = i.PluginHeaders) === null || d === void 0 ? void 0 : d.find((h) => h.name === l);
51
- }), b = /* @__PURE__ */ new Map(), L = ((s = u == null ? void 0 : u.currentPlatform) === null || s === void 0 ? void 0 : s.registerPlugin) || ((l, d = {}) => {
51
+ }), b = /* @__PURE__ */ new Map(), L = ((s = m == null ? void 0 : m.currentPlatform) === null || s === void 0 ? void 0 : s.registerPlugin) || ((l, d = {}) => {
52
52
  const h = b.get(l);
53
53
  if (h)
54
54
  return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`), h.proxy;
55
- const S = f(), _ = B(l);
55
+ const S = P(), _ = B(l);
56
56
  let M;
57
57
  const V = (k) => {
58
58
  let A;
@@ -110,9 +110,9 @@ const be = (r) => {
110
110
  } });
111
111
  return w[l] = G, b.set(l, { name: l, proxy: G, platforms: /* @__PURE__ */ new Set([...Object.keys(d), ..._ ? [S] : []]) }), G;
112
112
  });
113
- return i.convertFileSrc || (i.convertFileSrc = (l) => l), i.getPlatform = f, i.handleError = (l) => r.console.error(l), i.isNativePlatform = g, i.isPluginAvailable = v, i.pluginMethodNoop = (l, d, h) => Promise.reject(`${h} does not have an implementation of "${d}".`), i.registerPlugin = L, i.Exception = X, i.DEBUG = !!i.DEBUG, i.isLoggingEnabled = !!i.isLoggingEnabled, i.platform = i.getPlatform(), i.isNative = i.isNativePlatform(), i;
114
- }, Le = (r) => r.Capacitor = be(r), m = Le(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), ee = m.registerPlugin;
115
- m.Plugins;
113
+ return i.convertFileSrc || (i.convertFileSrc = (l) => l), i.getPlatform = P, i.handleError = (l) => r.console.error(l), i.isNativePlatform = f, i.isPluginAvailable = g, i.pluginMethodNoop = (l, d, h) => Promise.reject(`${h} does not have an implementation of "${d}".`), i.registerPlugin = L, i.Exception = X, i.DEBUG = !!i.DEBUG, i.isLoggingEnabled = !!i.isLoggingEnabled, i.platform = i.getPlatform(), i.isNative = i.isNativePlatform(), i;
114
+ }, Le = (r) => r.Capacitor = be(r), u = Le(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), ee = u.registerPlugin;
115
+ u.Plugins;
116
116
  class y {
117
117
  constructor(e) {
118
118
  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);
@@ -149,10 +149,10 @@ class y {
149
149
  } };
150
150
  }
151
151
  unimplemented(e = "not implemented") {
152
- return new m.Exception(e, E.Unimplemented);
152
+ return new u.Exception(e, E.Unimplemented);
153
153
  }
154
154
  unavailable(e = "not available") {
155
- return new m.Exception(e, E.Unavailable);
155
+ return new u.Exception(e, E.Unavailable);
156
156
  }
157
157
  removeListener(e, t) {
158
158
  return a(this, null, function* () {
@@ -255,24 +255,24 @@ const Ce = (r, e = {}) => {
255
255
  class ke extends y {
256
256
  request(e) {
257
257
  return a(this, null, function* () {
258
- const t = Ce(e, e.webFetchExtra), n = ((g, v = !0) => g ? Object.entries(g).reduce((B, b) => {
258
+ const t = Ce(e, e.webFetchExtra), n = ((f, g = !0) => f ? Object.entries(f).reduce((B, b) => {
259
259
  const [L, l] = b;
260
260
  let d, h;
261
261
  return Array.isArray(l) ? (h = "", l.forEach((S) => {
262
- d = v ? encodeURIComponent(S) : S, h += `${L}=${d}&`;
263
- }), h.slice(0, -1)) : (d = v ? encodeURIComponent(l) : l, h = `${L}=${d}`), `${B}&${h}`;
262
+ d = g ? encodeURIComponent(S) : S, h += `${L}=${d}&`;
263
+ }), h.slice(0, -1)) : (d = g ? encodeURIComponent(l) : l, h = `${L}=${d}`), `${B}&${h}`;
264
264
  }, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams), o = n ? `${e.url}?${n}` : e.url, s = yield fetch(o, t), c = s.headers.get("content-type") || "";
265
- let i, w, { responseType: u = "text" } = s.ok ? e : {};
266
- switch (c.includes("application/json") && (u = "json"), u) {
265
+ let i, w, { responseType: m = "text" } = s.ok ? e : {};
266
+ switch (c.includes("application/json") && (m = "json"), m) {
267
267
  case "arraybuffer":
268
268
  case "blob":
269
- w = yield s.blob(), i = yield ((g) => a(this, null, function* () {
270
- return new Promise((v, B) => {
269
+ w = yield s.blob(), i = yield ((f) => a(this, null, function* () {
270
+ return new Promise((g, B) => {
271
271
  const b = new FileReader();
272
272
  b.onload = () => {
273
273
  const L = b.result;
274
- v(L.indexOf(",") >= 0 ? L.split(",")[1] : L);
275
- }, b.onerror = (L) => B(L), b.readAsDataURL(g);
274
+ g(L.indexOf(",") >= 0 ? L.split(",")[1] : L);
275
+ }, b.onerror = (L) => B(L), b.readAsDataURL(f);
276
276
  });
277
277
  }))(w);
278
278
  break;
@@ -282,10 +282,10 @@ class ke extends y {
282
282
  default:
283
283
  i = yield s.text();
284
284
  }
285
- const f = {};
286
- return s.headers.forEach((g, v) => {
287
- f[v] = g;
288
- }), { data: i, headers: f, status: s.status, url: s.url };
285
+ const P = {};
286
+ return s.headers.forEach((f, g) => {
287
+ P[g] = f;
288
+ }), { data: i, headers: P, status: s.status, url: s.url };
289
289
  });
290
290
  }
291
291
  get(e) {
@@ -315,7 +315,7 @@ class ke extends y {
315
315
  }
316
316
  }
317
317
  function Y() {
318
- return m.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
318
+ return u.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
319
319
  }
320
320
  ee("CapacitorHttp", { web: () => new ke() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
321
321
  ee("Portals", { web: () => Promise.resolve().then(function() {
@@ -410,7 +410,7 @@ const H = () => {
410
410
  } catch (r) {
411
411
  throw console.error("isWinHandle error", r), r;
412
412
  }
413
- }, R = "CommunicatePlugin", p = m.registerPlugin(R, { web: () => Promise.resolve().then(() => ze).then((r) => new r.PluginsWeb()) }), Ne = m.registerPlugin("CountAssistPlugin", { web: new class extends y {
413
+ }, R = "CommunicatePlugin", p = u.registerPlugin(R, { web: () => Promise.resolve().then(() => ze).then((r) => new r.PluginsWeb()) }), Ne = u.registerPlugin("CountAssistPlugin", { web: new class extends y {
414
414
  setCountAssistState(r) {
415
415
  return a(this, null, function* () {
416
416
  try {
@@ -432,8 +432,8 @@ const Oe = (r) => {
432
432
  if ((e = p.showFABMenu) == null || e.call(p, { fabMenu: n }), !r || !((t = Object.keys(r)) != null && t.length))
433
433
  return;
434
434
  Object.keys(r).forEach((o) => {
435
- var s, c, i, w, u, f, g, v;
436
- n.push({ disable: (c = (s = r == null ? void 0 : r[o]) == null ? void 0 : s.disable) != null ? c : !1, icon: (w = (i = r == null ? void 0 : r[o]) == null ? void 0 : i.icon) != null ? w : "", id: (f = (u = r == null ? void 0 : r[o]) == null ? void 0 : u.id) != null ? f : "", name: (v = (g = r == null ? void 0 : r[o]) == null ? void 0 : g.title) != null ? v : "" });
435
+ var s, c, i, w, m, P, f, g;
436
+ n.push({ disable: (c = (s = r == null ? void 0 : r[o]) == null ? void 0 : s.disable) != null ? c : !1, icon: (w = (i = r == null ? void 0 : r[o]) == null ? void 0 : i.icon) != null ? w : "", id: (P = (m = r == null ? void 0 : r[o]) == null ? void 0 : m.id) != null ? P : "", name: (g = (f = r == null ? void 0 : r[o]) == null ? void 0 : f.title) != null ? g : "" });
437
437
  }), queueMicrotask(() => {
438
438
  var o;
439
439
  (o = p.showFABMenu) == null || o.call(p, { fabMenu: n });
@@ -441,8 +441,8 @@ const Oe = (r) => {
441
441
  ((o) => a(void 0, null, function* () {
442
442
  o && (q.removeAddListenerFab = yield ((s) => a(void 0, null, function* () {
443
443
  try {
444
- if (m.addListener) {
445
- const c = yield m.addListener(R, "nativeSendFab", (i) => s && s(i));
444
+ if (u.addListener) {
445
+ const c = yield u.addListener(R, "nativeSendFab", (i) => s && s(i));
446
446
  return c != null && c.remove ? c.remove : () => null;
447
447
  }
448
448
  } catch (c) {
@@ -452,8 +452,8 @@ const Oe = (r) => {
452
452
  }))((o) => {
453
453
  let s;
454
454
  o != null && o.disable || o != null && o.id && (Object.keys(r).forEach((c) => {
455
- var i, w, u;
456
- (i = r == null ? void 0 : r[c]) != null && i.id && o.id === r[c].id && (s = (u = (w = r[c]) == null ? void 0 : w.fn) != null ? u : () => null);
455
+ var i, w, m;
456
+ (i = r == null ? void 0 : r[c]) != null && i.id && o.id === r[c].id && (s = (m = (w = r[c]) == null ? void 0 : w.fn) != null ? m : () => null);
457
457
  }), typeof s == "function" && s());
458
458
  });
459
459
  });
@@ -466,8 +466,8 @@ const ce = (r = () => null) => a(void 0, null, function* () {
466
466
  try {
467
467
  N != null && N.addListenerBackRemoveHandle && typeof N.addListenerBackRemoveHandle == "function" && N.addListenerBackRemoveHandle(), N.addListenerBackRemoveHandle = yield ((e) => a(void 0, null, function* () {
468
468
  try {
469
- if (m.addListener) {
470
- const t = yield m.addListener(R, "nativeSendBack", (n) => e && e(n));
469
+ if (u.addListener) {
470
+ const t = yield u.addListener(R, "nativeSendBack", (n) => e && e(n));
471
471
  return t != null && t.remove ? t.remove : () => null;
472
472
  }
473
473
  } catch (t) {
@@ -485,8 +485,8 @@ const Be = (r) => {
485
485
  ((e) => a(void 0, null, function* () {
486
486
  e && (z.addListenerHomeHandle = yield ((t) => a(void 0, null, function* () {
487
487
  try {
488
- if (m.addListener) {
489
- const n = yield m.addListener(R, "nativeSendHome", (o) => t && t(o));
488
+ if (u.addListener) {
489
+ const n = yield u.addListener(R, "nativeSendHome", (o) => t && t(o));
490
490
  return n != null && n.remove ? n.remove : () => null;
491
491
  }
492
492
  } catch (n) {
@@ -609,7 +609,7 @@ class Ue {
609
609
  });
610
610
  }
611
611
  }
612
- const Ee = m.registerPlugin("CameraScanPlugin", { web: new class extends y {
612
+ const Ee = u.registerPlugin("CameraScanPlugin", { web: new class extends y {
613
613
  pickCameraScan(r) {
614
614
  return a(this, null, function* () {
615
615
  return new Promise((e) => {
@@ -630,7 +630,7 @@ class He {
630
630
  });
631
631
  }
632
632
  }
633
- const _e = m.registerPlugin("CameraScanMultiplePlugin", { web: new class extends y {
633
+ const _e = u.registerPlugin("CameraScanMultiplePlugin", { web: new class extends y {
634
634
  pickCameraScanMultiple() {
635
635
  return a(this, null, function* () {
636
636
  });
@@ -647,7 +647,7 @@ class xe {
647
647
  });
648
648
  }
649
649
  }
650
- const Ie = m.registerPlugin("CameraScanMultipleNoCountPlugin", { web: new class extends y {
650
+ const Ie = u.registerPlugin("CameraScanMultipleNoCountPlugin", { web: new class extends y {
651
651
  pickCameraScanMultipleNoCount() {
652
652
  return a(this, null, function* () {
653
653
  });
@@ -664,7 +664,7 @@ class je {
664
664
  });
665
665
  }
666
666
  }
667
- const Te = m.registerPlugin("CameraScanSingleOrDualPlugin", { web: new class extends y {
667
+ const Te = u.registerPlugin("CameraScanSingleOrDualPlugin", { web: new class extends y {
668
668
  pickCameraScanSingleOrDual() {
669
669
  return a(this, null, function* () {
670
670
  });
@@ -681,7 +681,7 @@ class Fe {
681
681
  });
682
682
  }
683
683
  }
684
- const he = "LaserScanPlugin", Z = m.registerPlugin(he, { web: new class extends y {
684
+ const he = "LaserScanPlugin", Z = u.registerPlugin(he, { web: new class extends y {
685
685
  pickLaserScan() {
686
686
  return a(this, null, function* () {
687
687
  });
@@ -702,8 +702,8 @@ const le = (r = () => null) => {
702
702
  const e = (t) => a(void 0, null, function* () {
703
703
  t && (K.removeAddListenerLaserScan = yield ((n) => a(void 0, null, function* () {
704
704
  try {
705
- if (m.addListener) {
706
- const o = yield m.addListener(he, "nativeSendLaser", (s) => n && n(s));
705
+ if (u.addListener) {
706
+ const o = yield u.addListener(he, "nativeSendLaser", (s) => n && n(s));
707
707
  return o != null && o.remove ? o.remove : () => null;
708
708
  }
709
709
  } catch (o) {
@@ -768,8 +768,8 @@ const de = (r = () => null) => a(void 0, null, function* () {
768
768
  try {
769
769
  O != null && O.addListenerCountAssistRemoveHandle && typeof O.addListenerCountAssistRemoveHandle == "function" && O.addListenerCountAssistRemoveHandle(), O.addListenerCountAssistRemoveHandle = yield ((e) => a(void 0, null, function* () {
770
770
  try {
771
- if (m.addListener) {
772
- const t = yield m.addListener(R, "nativeSendCountAssist", (n) => e && e(n));
771
+ if (u.addListener) {
772
+ const t = yield u.addListener(R, "nativeSendCountAssist", (n) => e && e(n));
773
773
  return t != null && t.remove ? t.remove : () => null;
774
774
  }
775
775
  } catch (t) {
@@ -813,7 +813,7 @@ class Re {
813
813
  })(e);
814
814
  }
815
815
  }
816
- const ue = m.registerPlugin("ClickStreamPlugin", { web: new class extends y {
816
+ const ue = u.registerPlugin("ClickStreamPlugin", { web: new class extends y {
817
817
  init() {
818
818
  return a(this, null, function* () {
819
819
  return new Promise((r) => {
@@ -859,7 +859,7 @@ class De {
859
859
  }
860
860
  const pe = "MiniAppLifecyclePlugin";
861
861
  var F = ((r) => (r.MINI_APP_BEFORE_UNMOUNT_PERMISSION = "mini_app_before_unmount_permission", r.MINI_APP_BEFORE_UNMOUNT_COMPLETION = "mini_app_before_unmount_completion", r))(F || {});
862
- const me = m.registerPlugin(pe, { web: new class extends y {
862
+ const me = u.registerPlugin(pe, { web: new class extends y {
863
863
  setNativeUsagePermission() {
864
864
  return a(this, null, function* () {
865
865
  });
@@ -876,8 +876,8 @@ const we = (r) => {
876
876
  const e = (t) => a(void 0, null, function* () {
877
877
  t && ($.removeAddListenerLifecycleMiniAppBeforeUnmount = yield ((n) => a(void 0, null, function* () {
878
878
  try {
879
- if (m.addListener) {
880
- const o = yield m.addListener(pe, "miniAppBeforeUnmount", (s) => n && n(s));
879
+ if (u.addListener) {
880
+ const o = yield u.addListener(pe, "miniAppBeforeUnmount", (s) => n && n(s));
881
881
  return o != null && o.remove ? o.remove : () => null;
882
882
  }
883
883
  } catch (o) {
@@ -919,23 +919,22 @@ class We {
919
919
  const { mounted: o, beforeUnmount: s, callBack: c } = t;
920
920
  o(() => {
921
921
  we((i) => a(this, null, function* () {
922
- var w, u;
922
+ var w;
923
923
  if (c && c instanceof Function)
924
924
  try {
925
- (u = (w = c(i)) == null ? void 0 : w.finally) == null || u.call(w, () => a(this, null, function* () {
925
+ (w = c(i)) == null || w.then(() => a(this, null, function* () {
926
926
  yield n.setNativeUsagePermission({ action: F.MINI_APP_BEFORE_UNMOUNT_PERMISSION, value: !1 }), yield n.authorizeWebCallback({ action: F.MINI_APP_BEFORE_UNMOUNT_COMPLETION });
927
927
  }));
928
- } catch (f) {
928
+ } catch (m) {
929
929
  console.error("miniAppBeforeUnmount error callBack is not a function or promise");
930
930
  }
931
931
  else
932
932
  console.error("miniAppBeforeUnmount error callBack is not a function or promise");
933
933
  }));
934
- }), s(() => {
935
- we(() => a(this, null, function* () {
936
- yield n.setNativeUsagePermission({ action: F.MINI_APP_BEFORE_UNMOUNT_PERMISSION, value: !1 });
937
- }));
938
- });
934
+ }), s(() => a(this, null, function* () {
935
+ yield n.setNativeUsagePermission({ action: F.MINI_APP_BEFORE_UNMOUNT_PERMISSION, value: !1 }), we(() => {
936
+ });
937
+ }));
939
938
  } catch (o) {
940
939
  throw console.error("miniAppBeforeUnmount error", o), o;
941
940
  }
@@ -944,16 +943,16 @@ class We {
944
943
  }
945
944
  class qe {
946
945
  constructor() {
947
- P(this, "initialContextPlugins", new Me());
948
- P(this, "communicatePlugins", new Ue());
949
- P(this, "cameraScanPlugins", new He());
950
- P(this, "cameraScanMultiplePlugins", new xe());
951
- P(this, "cameraScanMultipleNoCountPlugins", new je());
952
- P(this, "cameraScanSingleOrDualPlugins", new Fe());
953
- P(this, "laserScanPlugins", new $e());
954
- P(this, "countAssistPlugins", new Re());
955
- P(this, "clickStreamPlugins", new De());
956
- P(this, "lifecyclePlugins", new We());
946
+ v(this, "initialContextPlugins", new Me());
947
+ v(this, "communicatePlugins", new Ue());
948
+ v(this, "cameraScanPlugins", new He());
949
+ v(this, "cameraScanMultiplePlugins", new xe());
950
+ v(this, "cameraScanMultipleNoCountPlugins", new je());
951
+ v(this, "cameraScanSingleOrDualPlugins", new Fe());
952
+ v(this, "laserScanPlugins", new $e());
953
+ v(this, "countAssistPlugins", new Re());
954
+ v(this, "clickStreamPlugins", new De());
955
+ v(this, "lifecyclePlugins", new We());
957
956
  }
958
957
  }
959
958
  const Ve = new qe(), ze = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends y {
package/lib/main.umd.cjs CHANGED
@@ -1 +1 @@
1
- (function(g,f){typeof exports=="object"&&typeof module!="undefined"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):f((g=typeof globalThis!="undefined"?globalThis:g||self).main={})})(this,function(g){"use strict";var Ke=Object.defineProperty;var Ve=(g,f,v)=>f in g?Ke(g,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):g[f]=v;var C=(g,f,v)=>(Ve(g,typeof f!="symbol"?f+"":f,v),v);var a=(g,f,v)=>new Promise((B,H)=>{var Y=P=>{try{l(v.next(P))}catch(h){H(h)}},Z=P=>{try{l(v.throw(P))}catch(h){H(h)}},l=P=>P.done?B(P.value):Promise.resolve(P.value).then(Y,Z);l((v=v.apply(g,f)).next())});/*! Capacitor: https://capacitorjs.com/ - MIT License */const f=r=>r.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return n.addPlatform=(o,s)=>{n.platforms.set(o,s)},n.setPlatform=o=>{n.platforms.has(o)&&(n.currentPlatform=n.platforms.get(o))},n})(r),v=f(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var B;v.addPlatform,v.setPlatform,function(r){r.Unimplemented="UNIMPLEMENTED",r.Unavailable="UNAVAILABLE"}(B||(B={}));class H extends Error{constructor(e,t,n){super(e),this.message=e,this.code=t,this.data=n}}const Y=r=>{var e,t,n,o,s;const c=r.CapacitorCustomPlatform||null,i=r.Capacitor||{},w=i.Plugins=i.Plugins||{},m=r.CapacitorPlatforms,b=((e=m==null?void 0:m.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>c!==null?c.name:(d=>{var u,y;return d!=null&&d.androidBridge?"android":!((y=(u=d==null?void 0:d.webkit)===null||u===void 0?void 0:u.messageHandlers)===null||y===void 0)&&y.bridge?"ios":"web"})(r)),L=((t=m==null?void 0:m.currentPlatform)===null||t===void 0?void 0:t.isNativePlatform)||(()=>b()!=="web"),S=((n=m==null?void 0:m.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(d=>{const u=k.get(d);return!!(u!=null&&u.platforms.has(b()))||!!j(d)}),j=((o=m==null?void 0:m.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||(d=>{var u;return(u=i.PluginHeaders)===null||u===void 0?void 0:u.find(y=>y.name===d)}),k=new Map,A=((s=m==null?void 0:m.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||((d,u={})=>{const y=k.get(d);if(y)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),y.proxy;const M=b(),D=j(d);let x;const re=O=>{let U;const T=(...X)=>{const W=(()=>a(this,null,function*(){return!x&&M in u?x=x=typeof u[M]=="function"?yield u[M]():u[M]:c!==null&&!x&&"web"in u&&(x=x=typeof u.web=="function"?yield u.web():u.web),x}))().then(q=>{const ve=((N,z)=>{var oe,ae;if(!D){if(N)return(ae=N[z])===null||ae===void 0?void 0:ae.bind(N);throw new H(`"${d}" plugin is not implemented on ${M}`,B.Unimplemented)}{const Pe=D==null?void 0:D.methods.find(K=>z===K.name);if(Pe)return Pe.rtype==="promise"?K=>i.nativePromise(d,z.toString(),K):(K,ze)=>i.nativeCallback(d,z.toString(),K,ze);if(N)return(oe=N[z])===null||oe===void 0?void 0:oe.bind(N)}})(q,O);if(ve){const N=ve(...X);return U=N==null?void 0:N.remove,N}throw new H(`"${d}.${O}()" is not implemented on ${M}`,B.Unimplemented)});return O==="addListener"&&(W.remove=()=>a(this,null,function*(){return U()})),W};return T.toString=()=>`${O.toString()}() { [capacitor code] }`,Object.defineProperty(T,"name",{value:O,writable:!1,configurable:!1}),T},fe=re("addListener"),ge=re("removeListener"),qe=(O,U)=>{const T=fe({eventName:O},U),X=()=>a(this,null,function*(){const q=yield T;ge({eventName:O,callbackId:q},U)}),W=new Promise(q=>T.then(()=>q({remove:X})));return W.remove=()=>a(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield X()}),W},ne=new Proxy({},{get(O,U){switch(U){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return D?qe:fe;case"removeListener":return ge;default:return re(U)}}});return w[d]=ne,k.set(d,{name:d,proxy:ne,platforms:new Set([...Object.keys(u),...D?[M]:[]])}),ne});return i.convertFileSrc||(i.convertFileSrc=d=>d),i.getPlatform=b,i.handleError=d=>r.console.error(d),i.isNativePlatform=L,i.isPluginAvailable=S,i.pluginMethodNoop=(d,u,y)=>Promise.reject(`${y} does not have an implementation of "${u}".`),i.registerPlugin=A,i.Exception=H,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},Z=r=>r.Capacitor=Y(r),l=Z(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),P=l.registerPlugin;l.Plugins;class h{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 n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const o=()=>a(this,null,function*(){return this.removeListener(e,t)}),s=Promise.resolve({remove:o});return Object.defineProperty(s,"remove",{value:()=>a(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield o()})}),s}removeAllListeners(){return a(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,t){const n=this.listeners[e];n&&n.forEach(o=>o(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:n=>{this.notifyListeners(t,n)}}}unimplemented(e="not implemented"){return new l.Exception(e,B.Unimplemented)}unavailable(e="not available"){return new l.Exception(e,B.Unavailable)}removeListener(e,t){return a(this,null,function*(){const n=this.listeners[e];if(!n)return;const o=n.indexOf(t);this.listeners[e].splice(o,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 se=r=>encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ie=r=>r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class be extends h{getCookies(){return a(this,null,function*(){const e=document.cookie,t={};return e.split(";").forEach(n=>{if(n.length<=0)return;let[o,s]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=ie(o).trim(),s=ie(s).trim(),t[o]=s}),t})}setCookie(e){return a(this,null,function*(){try{const t=se(e.key),n=se(e.value),o=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),c=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${n||""}${o}; path=${s}; ${c};`}catch(t){return Promise.reject(t)}})}deleteCookie(e){return a(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}})}clearCookies(){return a(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 a(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}P("CapacitorCookies",{web:()=>new be});const Le=(r,e={})=>{const t=Object.assign({method:r.method||"GET",headers:r.headers},e),n=((o={})=>{const s=Object.keys(o);return Object.keys(o).map(c=>c.toLocaleLowerCase()).reduce((c,i,w)=>(c[i]=o[s[w]],c),{})})(r.headers)["content-type"]||"";if(typeof r.data=="string")t.body=r.data;else if(n.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[s,c]of Object.entries(r.data||{}))o.set(s,c);t.body=o.toString()}else if(n.includes("multipart/form-data")){const o=new FormData;if(r.data instanceof FormData)r.data.forEach((c,i)=>{o.append(i,c)});else for(const c of Object.keys(r.data))o.append(c,r.data[c]);t.body=o;const s=new Headers(t.headers);s.delete("content-type"),t.headers=s}else(n.includes("application/json")||typeof r.data=="object")&&(t.body=JSON.stringify(r.data));return t};class Se extends h{request(e){return a(this,null,function*(){const t=Le(e,e.webFetchExtra),n=((L,S=!0)=>L?Object.entries(L).reduce((j,k)=>{const[A,d]=k;let u,y;return Array.isArray(d)?(y="",d.forEach(M=>{u=S?encodeURIComponent(M):M,y+=`${A}=${u}&`}),y.slice(0,-1)):(u=S?encodeURIComponent(d):d,y=`${A}=${u}`),`${j}&${y}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),o=n?`${e.url}?${n}`:e.url,s=yield fetch(o,t),c=s.headers.get("content-type")||"";let i,w,{responseType:m="text"}=s.ok?e:{};switch(c.includes("application/json")&&(m="json"),m){case"arraybuffer":case"blob":w=yield s.blob(),i=yield(L=>a(this,null,function*(){return new Promise((S,j)=>{const k=new FileReader;k.onload=()=>{const A=k.result;S(A.indexOf(",")>=0?A.split(",")[1]:A)},k.onerror=A=>j(A),k.readAsDataURL(L)})}))(w);break;case"json":i=yield s.json();break;default:i=yield s.text()}const b={};return s.headers.forEach((L,S)=>{b[S]=L}),{data:i,headers:b,status:s.status,url:s.url}})}get(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function ee(){return l.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}P("CapacitorHttp",{web:()=>new Se}),P("Portals",{web:()=>Promise.resolve().then(function(){return Ce}).then(r=>new r.PortalsWeb)});const Ce=Object.freeze({__proto__:null,PortalsWeb:class extends h{publishNative(r){return a(this,null,function*(){})}}}),V=r=>{var e,t,n;try{if(typeof window=="undefined")return;if(ee&&((e=ee())!=null&&e.value)){const o=(n=(t=ee())==null?void 0:t.value)!=null?n:null;if(!o)return void console.error("native initialContext is undefine");if(!r)return void console.error("initialContext call back is undefine");r(o)}}catch(o){throw console.error("getInitialContextHandle error",o),o}};class ke{isNative(){try{return(()=>{try{let e=!1;return V(t=>{e=!!(t!=null&&t.isNative)}),e}catch(e){throw console.error("isNative error",e),e}})()}catch(e){throw console.error("isNative error",e),e}}redirectPage(e){try{(({callBack:t})=>{V(n=>{var o;try{if(!(n!=null&&n.params))return void console.info("initial context native params is undefine");const s=(o=n==null?void 0:n.params)!=null?o:null;if(!s)return;if(!t)return void console.error("initial context call back is undefine");t(s)}catch(s){throw console.error("redirectPageHandle error",s),s}})})(e)}catch(t){throw console.error("redirectPage error",t),t}}getNativeInfo(e){try{return this.isNative()?(()=>{try{let t=null;return V(n=>{t=n!=null?n:null}),t}catch(t){throw console.error("getNativeInfoHandle error",t),t}})():(t=>{var n;return(n=t==null?void 0:t.mockData)!=null?n:null})(e)}catch(t){throw console.error("getNativeInfo error",t),t}}}const I=()=>{try{let r={};return typeof window!="undefined"&&(r=window),r}catch(r){throw console.error("isWinHandle error",r),r}},F="CommunicatePlugin",p=l.registerPlugin(F,{web:()=>Promise.resolve().then(()=>We).then(r=>new r.PluginsWeb)}),Ae=l.registerPlugin("CountAssistPlugin",{web:new class extends h{setCountAssistState(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("setCountAssistState error",e),e}})}}}),G=I();G.removeAddListenerFab=()=>null;const Me=r=>{var e,t;try{G.removeAddListenerFab&&G.removeAddListenerFab();const n=[];if((e=p.showFABMenu)==null||e.call(p,{fabMenu:n}),!r||!((t=Object.keys(r))!=null&&t.length))return;Object.keys(r).forEach(o=>{var s,c,i,w,m,b,L,S;n.push({disable:(c=(s=r==null?void 0:r[o])==null?void 0:s.disable)!=null?c:!1,icon:(w=(i=r==null?void 0:r[o])==null?void 0:i.icon)!=null?w:"",id:(b=(m=r==null?void 0:r[o])==null?void 0:m.id)!=null?b:"",name:(S=(L=r==null?void 0:r[o])==null?void 0:L.title)!=null?S:""})}),queueMicrotask(()=>{var o;(o=p.showFABMenu)==null||o.call(p,{fabMenu:n})}),setTimeout(()=>{(o=>a(this,null,function*(){o&&(G.removeAddListenerFab=yield(s=>a(this,null,function*(){try{if(l.addListener){const c=yield l.addListener(F,"nativeSendFab",i=>s&&s(i));return c!=null&&c.remove?c.remove:()=>null}}catch(c){throw console.error("addListenerFabHandle error",c),c}}))(o))}))(o=>{let s;o!=null&&o.disable||o!=null&&o.id&&(Object.keys(r).forEach(c=>{var i,w,m;(i=r==null?void 0:r[c])!=null&&i.id&&o.id===r[c].id&&(s=(m=(w=r[c])==null?void 0:w.fn)!=null?m:()=>null)}),typeof s=="function"&&s())})})}catch(n){throw console.error("fabBtnHandle error",n),n}},E=I();E.addListenerBackRemoveHandle=()=>null;const ce=(r=()=>null)=>a(this,null,function*(){try{E!=null&&E.addListenerBackRemoveHandle&&typeof E.addListenerBackRemoveHandle=="function"&&E.addListenerBackRemoveHandle(),E.addListenerBackRemoveHandle=yield(e=>a(this,null,function*(){try{if(l.addListener){const t=yield l.addListener(F,"nativeSendBack",n=>e&&e(n));return t!=null&&t.remove?t.remove:()=>null}}catch(t){throw console.error("addListenerBackHandle error",t),t}}))(r)}catch(e){throw console.error("initBackBtnFn error",e),e}}),J=I();J.addListenerHomeHandle=()=>null;const Ne=r=>{try{J.addListenerHomeHandle&&J.addListenerHomeHandle(),setTimeout(()=>{(e=>a(this,null,function*(){e&&(J.addListenerHomeHandle=yield(t=>a(this,null,function*(){try{if(l.addListener){const n=yield l.addListener(F,"nativeSendHome",o=>t&&t(o));return n!=null&&n.remove?n.remove:()=>null}}catch(n){throw console.error("addListenerHomeHandle error",n),n}}))(e))}))(r)})}catch(e){throw console.error("homeFn error",e),e}};class Oe{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return a(this,null,function*(){var t;try{return yield(t=p.homeIsClick)==null?void 0:t.call(p,e)}catch(n){throw console.error("homeBtnSwitch error",n),n}})}setBackBtn(e){try{(t=>{try{const{mounted:n,beforeUnmount:o,callBack:s}=t;n(()=>{ce(s)}),o(()=>{ce()})}catch(n){throw console.error("backBtnHandle error",n),n}})(e)}catch(t){throw console.error("setBackBtn error",t),t}}setHomeBtn(e){try{Ne(e)}catch(t){throw console.error("setHomeBtn error",t),t}}setFabBtn(e){try{Me(e)}catch(t){throw console.error("setFabBtn error",t),t}}openMiniApp(e){return a(this,null,function*(){try{return yield p.openMiniApp(e)}catch(t){throw console.error("openMiniApp error",t),t}})}showTitle(e){return a(this,null,function*(){try{return yield p.showTitle(e)}catch(t){throw console.error("showTitle error",t),t}})}showSubMask(e){return a(this,null,function*(){try{return yield p.showSubMask(e)}catch(t){throw console.error("showSubMask error",t),t}})}setMiniAppVersion(e){return a(this,null,function*(){try{return yield p.setMiniAppVersion(e)}catch(t){throw console.error("setMiniAppVersion error",t),t}})}showNativeLoading(){return a(this,null,function*(){try{return yield p.showDialog()}catch(e){throw console.error("showNativeLoading error",e),e}})}cancelNativeLoading(){return a(this,null,function*(){try{return yield p.cancelDialog()}catch(e){throw console.error("cancelNativeLoading error",e),e}})}getMiniAppKong(e){return a(this,null,function*(){try{return yield p.getMiniAppKong(e)}catch(t){throw console.error("getMiniAppKong error",t),t}})}}const Be=l.registerPlugin("CameraScanPlugin",{web:new class extends h{pickCameraScan(r){return a(this,null,function*(){return new Promise(e=>{e(r)})})}}});window.removeAddListenerCameraScan=()=>null;class Ue{pickCameraScan(e){return a(this,null,function*(){try{return yield Be.pickCameraScan(e)}catch(t){throw console.error("pickCameraScan error",t),t}})}}const Ee=l.registerPlugin("CameraScanMultiplePlugin",{web:new class extends h{pickCameraScanMultiple(){return a(this,null,function*(){})}}});class _e{pickCameraScanMultiple(e){return a(this,null,function*(){try{return yield Ee.pickCameraScanMultiple(e)}catch(t){throw console.error("pickCameraScanMultiple error",t),t}})}}const xe=l.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends h{pickCameraScanMultipleNoCount(){return a(this,null,function*(){})}}});class He{pickCameraScanMultipleNoCount(e){return a(this,null,function*(){try{return yield xe.pickCameraScanMultipleNoCount(e)}catch(t){throw console.error("pickCameraScanMultipleNoCount error",t),t}})}}const Ie=l.registerPlugin("CameraScanSingleOrDualPlugin",{web:new class extends h{pickCameraScanSingleOrDual(){return a(this,null,function*(){})}}});class je{pickCameraScanSingleOrDual(e){return a(this,null,function*(){try{return yield Ie.pickCameraScanSingleOrDual(e)}catch(t){throw console.error("pickCameraScanSingleOrDual error",t),t}})}}const le="LaserScanPlugin",te=l.registerPlugin(le,{web:new class extends h{pickLaserScan(){return a(this,null,function*(){})}unPickLaserScan(){return a(this,null,function*(){})}setLaserState(){return a(this,null,function*(){})}}}),Q=I();Q.removeAddListenerLaserScan=()=>null;const de=(r=()=>null)=>{try{Q.removeAddListenerLaserScan&&Q.removeAddListenerLaserScan();const e=t=>a(this,null,function*(){t&&(Q.removeAddListenerLaserScan=yield(n=>a(this,null,function*(){try{if(l.addListener){const o=yield l.addListener(le,"nativeSendLaser",s=>n&&n(s));return o!=null&&o.remove?o.remove:()=>null}}catch(o){throw console.error("addListenerLaserHandle error",o),o}}))(t))});setTimeout(()=>{e(r)})}catch(e){throw console.error("laserScanFn error",e),e}};class Te{constructor(){this.pickLaserScan()}pickLaserScan(){return a(this,null,function*(){try{return yield te.pickLaserScan({isContinue:!1})}catch(e){throw console.error("pickLaserScan error",e),e}})}unPickLaserScan(){return a(this,null,function*(){try{return yield te.unPickLaserScan()}catch(e){throw console.error("unPickLaserScan error",e),e}})}setLaserState(e){try{te.setLaserState(e)}catch(t){throw console.error("setLaserState error",t),t}}setLaserScan(e){(t=>{try{const{mounted:n,beforeUnmount:o,callBack:s}=t;n(()=>{de(s)}),o(()=>{de()})}catch(n){throw console.error("laserScanApiParams error",n),n}})(e)}}const _=I();_.addListenerCountAssistRemoveHandle=()=>null;const ue=(r=()=>null)=>a(this,null,function*(){try{_!=null&&_.addListenerCountAssistRemoveHandle&&typeof _.addListenerCountAssistRemoveHandle=="function"&&_.addListenerCountAssistRemoveHandle(),_.addListenerCountAssistRemoveHandle=yield(e=>a(this,null,function*(){try{if(l.addListener){const t=yield l.addListener(F,"nativeSendCountAssist",n=>e&&e(n));return t!=null&&t.remove?t.remove:()=>null}}catch(t){throw console.error("addListenerCountAssistHandle error",t),t}}))(r)}catch(e){throw console.error("initCountAssistFn error",e),e}});class Fe{setCountAssistState(e){return a(this,null,function*(){return yield Ae.setCountAssistState(e)})}getCountAssistState(e){return(t=>{try{let n=t!=null?t:!1;return V(o=>{n=!!(o!=null&&o.countAssistState)}),n}catch(n){throw console.error("getCountAssistStateHandle error",n),n}})(e)}setCountAssistBtn(e){(t=>{try{const{mounted:n,beforeUnmount:o,callBack:s}=t;n(()=>{ue(s)}),o(()=>{ue()})}catch(n){throw console.error("setCountAssistBtnHandle error",n),n}})(e)}}const me=l.registerPlugin("ClickStreamPlugin",{web:new class extends h{init(){return a(this,null,function*(){return new Promise(r=>{r(null)})})}trace(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("clickStreamTraceParams error",e),e}})}}});class $e{constructor(){this.init()}init(){return a(this,null,function*(){try{return yield me.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return a(this,null,function*(){console.info("clickStreamTraceParams===",e);try{return yield me.trace(e)}catch(t){throw console.error("clickStreamPlugin, trace error",t),t}})}}const we="MiniAppLifecyclePlugin";var $=(r=>(r.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",r.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",r))($||{});const he=l.registerPlugin(we,{web:new class extends h{setNativeUsagePermission(){return a(this,null,function*(){})}authorizeWebCallback(){return a(this,null,function*(){})}}}),R=I();R.removeAddListenerLifecycleMiniAppBeforeUnmount=()=>null;const pe=r=>{try{R.removeAddListenerLifecycleMiniAppBeforeUnmount&&typeof R.removeAddListenerLifecycleMiniAppBeforeUnmount!="function"&&R.removeAddListenerLifecycleMiniAppBeforeUnmount();const e=t=>a(this,null,function*(){t&&(R.removeAddListenerLifecycleMiniAppBeforeUnmount=yield(n=>a(this,null,function*(){try{if(l.addListener){const o=yield l.addListener(we,"miniAppBeforeUnmount",s=>n&&n(s));return o!=null&&o.remove?o.remove:()=>null}}catch(o){throw console.error("miniAppBeforeUnmountHandle error",o),o}}))(t))});setTimeout(()=>a(this,null,function*(){yield e(r)}))}catch(e){throw console.error("laserScanFn error",e),e}};class Re{constructor(){}setNativeUsagePermission(e){return a(this,null,function*(){try{return yield he.setNativeUsagePermission(e)}catch(t){throw console.error("lifecyclePlugin.setNativeUsagePermission error",t),t}})}authorizeWebCallback(e){return a(this,null,function*(){try{return yield he.authorizeWebCallback(e)}catch(t){throw console.error("lifecyclePlugin.authorizeWebCallback error",t),t}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:$.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((t,n)=>{try{const{mounted:o,beforeUnmount:s,callBack:c}=t;o(()=>{pe(i=>a(this,null,function*(){var w,m;if(c&&c instanceof Function)try{(m=(w=c(i))==null?void 0:w.finally)==null||m.call(w,()=>a(this,null,function*(){yield n.setNativeUsagePermission({action:$.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:$.MINI_APP_BEFORE_UNMOUNT_COMPLETION})}))}catch(b){console.error("miniAppBeforeUnmount error callBack is not a function or promise")}else console.error("miniAppBeforeUnmount error callBack is not a function or promise")}))}),s(()=>{pe(()=>a(this,null,function*(){yield n.setNativeUsagePermission({action:$.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1})}))})}catch(o){throw console.error("miniAppBeforeUnmount error",o),o}})(e,this)}}class ye{constructor(){C(this,"initialContextPlugins",new ke);C(this,"communicatePlugins",new Oe);C(this,"cameraScanPlugins",new Ue);C(this,"cameraScanMultiplePlugins",new _e);C(this,"cameraScanMultipleNoCountPlugins",new He);C(this,"cameraScanSingleOrDualPlugins",new je);C(this,"laserScanPlugins",new Te);C(this,"countAssistPlugins",new Fe);C(this,"clickStreamPlugins",new $e);C(this,"lifecyclePlugins",new Re)}}const De=new ye,We=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends h{homeIsClick(){return a(this,null,function*(){})}openMiniApp(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("openMiniApp error",e),e}})}showTitle(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("showTitle error",e),e}})}showFABMenu(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("showFABMenu error",e),e}})}showSubMask(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("showSubMask error",e),e}})}setMiniAppVersion(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("setMiniAppVersion error",e),e}})}showDialog(){return a(this,null,function*(){})}cancelDialog(){return a(this,null,function*(){})}getMiniAppKong(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("getMiniAppKong error",e),e}})}}},Symbol.toStringTag,{value:"Module"}));g.NativeApi=ye,g.default=De,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(g,y){typeof exports=="object"&&typeof module!="undefined"?y(exports):typeof define=="function"&&define.amd?define(["exports"],y):y((g=typeof globalThis!="undefined"?globalThis:g||self).main={})})(this,function(g){"use strict";var Ke=Object.defineProperty;var Ve=(g,y,v)=>y in g?Ke(g,y,{enumerable:!0,configurable:!0,writable:!0,value:v}):g[y]=v;var S=(g,y,v)=>(Ve(g,typeof y!="symbol"?y+"":y,v),v);var a=(g,y,v)=>new Promise((B,H)=>{var Y=P=>{try{l(v.next(P))}catch(w){H(w)}},Z=P=>{try{l(v.throw(P))}catch(w){H(w)}},l=P=>P.done?B(P.value):Promise.resolve(P.value).then(Y,Z);l((v=v.apply(g,y)).next())});/*! Capacitor: https://capacitorjs.com/ - MIT License */const y=r=>r.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return n.addPlatform=(o,s)=>{n.platforms.set(o,s)},n.setPlatform=o=>{n.platforms.has(o)&&(n.currentPlatform=n.platforms.get(o))},n})(r),v=y(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var B;v.addPlatform,v.setPlatform,function(r){r.Unimplemented="UNIMPLEMENTED",r.Unavailable="UNAVAILABLE"}(B||(B={}));class H extends Error{constructor(e,t,n){super(e),this.message=e,this.code=t,this.data=n}}const Y=r=>{var e,t,n,o,s;const c=r.CapacitorCustomPlatform||null,i=r.Capacitor||{},f=i.Plugins=i.Plugins||{},m=r.CapacitorPlatforms,C=((e=m==null?void 0:m.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>c!==null?c.name:(d=>{var u,p;return d!=null&&d.androidBridge?"android":!((p=(u=d==null?void 0:d.webkit)===null||u===void 0?void 0:u.messageHandlers)===null||p===void 0)&&p.bridge?"ios":"web"})(r)),b=((t=m==null?void 0:m.currentPlatform)===null||t===void 0?void 0:t.isNativePlatform)||(()=>C()!=="web"),L=((n=m==null?void 0:m.currentPlatform)===null||n===void 0?void 0:n.isPluginAvailable)||(d=>{const u=k.get(d);return!!(u!=null&&u.platforms.has(C()))||!!j(d)}),j=((o=m==null?void 0:m.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||(d=>{var u;return(u=i.PluginHeaders)===null||u===void 0?void 0:u.find(p=>p.name===d)}),k=new Map,A=((s=m==null?void 0:m.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||((d,u={})=>{const p=k.get(d);if(p)return console.warn(`Capacitor plugin "${d}" already registered. Cannot register plugins twice.`),p.proxy;const M=C(),D=j(d);let x;const re=O=>{let U;const T=(...X)=>{const W=(()=>a(this,null,function*(){return!x&&M in u?x=x=typeof u[M]=="function"?yield u[M]():u[M]:c!==null&&!x&&"web"in u&&(x=x=typeof u.web=="function"?yield u.web():u.web),x}))().then(q=>{const ve=((N,z)=>{var oe,ae;if(!D){if(N)return(ae=N[z])===null||ae===void 0?void 0:ae.bind(N);throw new H(`"${d}" plugin is not implemented on ${M}`,B.Unimplemented)}{const Pe=D==null?void 0:D.methods.find(K=>z===K.name);if(Pe)return Pe.rtype==="promise"?K=>i.nativePromise(d,z.toString(),K):(K,ze)=>i.nativeCallback(d,z.toString(),K,ze);if(N)return(oe=N[z])===null||oe===void 0?void 0:oe.bind(N)}})(q,O);if(ve){const N=ve(...X);return U=N==null?void 0:N.remove,N}throw new H(`"${d}.${O}()" is not implemented on ${M}`,B.Unimplemented)});return O==="addListener"&&(W.remove=()=>a(this,null,function*(){return U()})),W};return T.toString=()=>`${O.toString()}() { [capacitor code] }`,Object.defineProperty(T,"name",{value:O,writable:!1,configurable:!1}),T},fe=re("addListener"),ge=re("removeListener"),qe=(O,U)=>{const T=fe({eventName:O},U),X=()=>a(this,null,function*(){const q=yield T;ge({eventName:O,callbackId:q},U)}),W=new Promise(q=>T.then(()=>q({remove:X})));return W.remove=()=>a(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield X()}),W},ne=new Proxy({},{get(O,U){switch(U){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return D?qe:fe;case"removeListener":return ge;default:return re(U)}}});return f[d]=ne,k.set(d,{name:d,proxy:ne,platforms:new Set([...Object.keys(u),...D?[M]:[]])}),ne});return i.convertFileSrc||(i.convertFileSrc=d=>d),i.getPlatform=C,i.handleError=d=>r.console.error(d),i.isNativePlatform=b,i.isPluginAvailable=L,i.pluginMethodNoop=(d,u,p)=>Promise.reject(`${p} does not have an implementation of "${u}".`),i.registerPlugin=A,i.Exception=H,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},Z=r=>r.Capacitor=Y(r),l=Z(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),P=l.registerPlugin;l.Plugins;class w{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 n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const o=()=>a(this,null,function*(){return this.removeListener(e,t)}),s=Promise.resolve({remove:o});return Object.defineProperty(s,"remove",{value:()=>a(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield o()})}),s}removeAllListeners(){return a(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,t){const n=this.listeners[e];n&&n.forEach(o=>o(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:n=>{this.notifyListeners(t,n)}}}unimplemented(e="not implemented"){return new l.Exception(e,B.Unimplemented)}unavailable(e="not available"){return new l.Exception(e,B.Unavailable)}removeListener(e,t){return a(this,null,function*(){const n=this.listeners[e];if(!n)return;const o=n.indexOf(t);this.listeners[e].splice(o,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 se=r=>encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ie=r=>r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class be extends w{getCookies(){return a(this,null,function*(){const e=document.cookie,t={};return e.split(";").forEach(n=>{if(n.length<=0)return;let[o,s]=n.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=ie(o).trim(),s=ie(s).trim(),t[o]=s}),t})}setCookie(e){return a(this,null,function*(){try{const t=se(e.key),n=se(e.value),o=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),c=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${n||""}${o}; path=${s}; ${c};`}catch(t){return Promise.reject(t)}})}deleteCookie(e){return a(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}})}clearCookies(){return a(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 a(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}P("CapacitorCookies",{web:()=>new be});const Le=(r,e={})=>{const t=Object.assign({method:r.method||"GET",headers:r.headers},e),n=((o={})=>{const s=Object.keys(o);return Object.keys(o).map(c=>c.toLocaleLowerCase()).reduce((c,i,f)=>(c[i]=o[s[f]],c),{})})(r.headers)["content-type"]||"";if(typeof r.data=="string")t.body=r.data;else if(n.includes("application/x-www-form-urlencoded")){const o=new URLSearchParams;for(const[s,c]of Object.entries(r.data||{}))o.set(s,c);t.body=o.toString()}else if(n.includes("multipart/form-data")){const o=new FormData;if(r.data instanceof FormData)r.data.forEach((c,i)=>{o.append(i,c)});else for(const c of Object.keys(r.data))o.append(c,r.data[c]);t.body=o;const s=new Headers(t.headers);s.delete("content-type"),t.headers=s}else(n.includes("application/json")||typeof r.data=="object")&&(t.body=JSON.stringify(r.data));return t};class Se extends w{request(e){return a(this,null,function*(){const t=Le(e,e.webFetchExtra),n=((b,L=!0)=>b?Object.entries(b).reduce((j,k)=>{const[A,d]=k;let u,p;return Array.isArray(d)?(p="",d.forEach(M=>{u=L?encodeURIComponent(M):M,p+=`${A}=${u}&`}),p.slice(0,-1)):(u=L?encodeURIComponent(d):d,p=`${A}=${u}`),`${j}&${p}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),o=n?`${e.url}?${n}`:e.url,s=yield fetch(o,t),c=s.headers.get("content-type")||"";let i,f,{responseType:m="text"}=s.ok?e:{};switch(c.includes("application/json")&&(m="json"),m){case"arraybuffer":case"blob":f=yield s.blob(),i=yield(b=>a(this,null,function*(){return new Promise((L,j)=>{const k=new FileReader;k.onload=()=>{const A=k.result;L(A.indexOf(",")>=0?A.split(",")[1]:A)},k.onerror=A=>j(A),k.readAsDataURL(b)})}))(f);break;case"json":i=yield s.json();break;default:i=yield s.text()}const C={};return s.headers.forEach((b,L)=>{C[L]=b}),{data:i,headers:C,status:s.status,url:s.url}})}get(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return a(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function ee(){return l.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}P("CapacitorHttp",{web:()=>new Se}),P("Portals",{web:()=>Promise.resolve().then(function(){return Ce}).then(r=>new r.PortalsWeb)});const Ce=Object.freeze({__proto__:null,PortalsWeb:class extends w{publishNative(r){return a(this,null,function*(){})}}}),V=r=>{var e,t,n;try{if(typeof window=="undefined")return;if(ee&&((e=ee())!=null&&e.value)){const o=(n=(t=ee())==null?void 0:t.value)!=null?n:null;if(!o)return void console.error("native initialContext is undefine");if(!r)return void console.error("initialContext call back is undefine");r(o)}}catch(o){throw console.error("getInitialContextHandle error",o),o}};class ke{isNative(){try{return(()=>{try{let e=!1;return V(t=>{e=!!(t!=null&&t.isNative)}),e}catch(e){throw console.error("isNative error",e),e}})()}catch(e){throw console.error("isNative error",e),e}}redirectPage(e){try{(({callBack:t})=>{V(n=>{var o;try{if(!(n!=null&&n.params))return void console.info("initial context native params is undefine");const s=(o=n==null?void 0:n.params)!=null?o:null;if(!s)return;if(!t)return void console.error("initial context call back is undefine");t(s)}catch(s){throw console.error("redirectPageHandle error",s),s}})})(e)}catch(t){throw console.error("redirectPage error",t),t}}getNativeInfo(e){try{return this.isNative()?(()=>{try{let t=null;return V(n=>{t=n!=null?n:null}),t}catch(t){throw console.error("getNativeInfoHandle error",t),t}})():(t=>{var n;return(n=t==null?void 0:t.mockData)!=null?n:null})(e)}catch(t){throw console.error("getNativeInfo error",t),t}}}const I=()=>{try{let r={};return typeof window!="undefined"&&(r=window),r}catch(r){throw console.error("isWinHandle error",r),r}},F="CommunicatePlugin",h=l.registerPlugin(F,{web:()=>Promise.resolve().then(()=>We).then(r=>new r.PluginsWeb)}),Ae=l.registerPlugin("CountAssistPlugin",{web:new class extends w{setCountAssistState(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("setCountAssistState error",e),e}})}}}),G=I();G.removeAddListenerFab=()=>null;const Me=r=>{var e,t;try{G.removeAddListenerFab&&G.removeAddListenerFab();const n=[];if((e=h.showFABMenu)==null||e.call(h,{fabMenu:n}),!r||!((t=Object.keys(r))!=null&&t.length))return;Object.keys(r).forEach(o=>{var s,c,i,f,m,C,b,L;n.push({disable:(c=(s=r==null?void 0:r[o])==null?void 0:s.disable)!=null?c:!1,icon:(f=(i=r==null?void 0:r[o])==null?void 0:i.icon)!=null?f:"",id:(C=(m=r==null?void 0:r[o])==null?void 0:m.id)!=null?C:"",name:(L=(b=r==null?void 0:r[o])==null?void 0:b.title)!=null?L:""})}),queueMicrotask(()=>{var o;(o=h.showFABMenu)==null||o.call(h,{fabMenu:n})}),setTimeout(()=>{(o=>a(this,null,function*(){o&&(G.removeAddListenerFab=yield(s=>a(this,null,function*(){try{if(l.addListener){const c=yield l.addListener(F,"nativeSendFab",i=>s&&s(i));return c!=null&&c.remove?c.remove:()=>null}}catch(c){throw console.error("addListenerFabHandle error",c),c}}))(o))}))(o=>{let s;o!=null&&o.disable||o!=null&&o.id&&(Object.keys(r).forEach(c=>{var i,f,m;(i=r==null?void 0:r[c])!=null&&i.id&&o.id===r[c].id&&(s=(m=(f=r[c])==null?void 0:f.fn)!=null?m:()=>null)}),typeof s=="function"&&s())})})}catch(n){throw console.error("fabBtnHandle error",n),n}},E=I();E.addListenerBackRemoveHandle=()=>null;const ce=(r=()=>null)=>a(this,null,function*(){try{E!=null&&E.addListenerBackRemoveHandle&&typeof E.addListenerBackRemoveHandle=="function"&&E.addListenerBackRemoveHandle(),E.addListenerBackRemoveHandle=yield(e=>a(this,null,function*(){try{if(l.addListener){const t=yield l.addListener(F,"nativeSendBack",n=>e&&e(n));return t!=null&&t.remove?t.remove:()=>null}}catch(t){throw console.error("addListenerBackHandle error",t),t}}))(r)}catch(e){throw console.error("initBackBtnFn error",e),e}}),J=I();J.addListenerHomeHandle=()=>null;const Ne=r=>{try{J.addListenerHomeHandle&&J.addListenerHomeHandle(),setTimeout(()=>{(e=>a(this,null,function*(){e&&(J.addListenerHomeHandle=yield(t=>a(this,null,function*(){try{if(l.addListener){const n=yield l.addListener(F,"nativeSendHome",o=>t&&t(o));return n!=null&&n.remove?n.remove:()=>null}}catch(n){throw console.error("addListenerHomeHandle error",n),n}}))(e))}))(r)})}catch(e){throw console.error("homeFn error",e),e}};class Oe{constructor(){this.homeBtnSwitch({isClick:!0})}homeBtnSwitch(e){return a(this,null,function*(){var t;try{return yield(t=h.homeIsClick)==null?void 0:t.call(h,e)}catch(n){throw console.error("homeBtnSwitch error",n),n}})}setBackBtn(e){try{(t=>{try{const{mounted:n,beforeUnmount:o,callBack:s}=t;n(()=>{ce(s)}),o(()=>{ce()})}catch(n){throw console.error("backBtnHandle error",n),n}})(e)}catch(t){throw console.error("setBackBtn error",t),t}}setHomeBtn(e){try{Ne(e)}catch(t){throw console.error("setHomeBtn error",t),t}}setFabBtn(e){try{Me(e)}catch(t){throw console.error("setFabBtn error",t),t}}openMiniApp(e){return a(this,null,function*(){try{return yield h.openMiniApp(e)}catch(t){throw console.error("openMiniApp error",t),t}})}showTitle(e){return a(this,null,function*(){try{return yield h.showTitle(e)}catch(t){throw console.error("showTitle error",t),t}})}showSubMask(e){return a(this,null,function*(){try{return yield h.showSubMask(e)}catch(t){throw console.error("showSubMask error",t),t}})}setMiniAppVersion(e){return a(this,null,function*(){try{return yield h.setMiniAppVersion(e)}catch(t){throw console.error("setMiniAppVersion error",t),t}})}showNativeLoading(){return a(this,null,function*(){try{return yield h.showDialog()}catch(e){throw console.error("showNativeLoading error",e),e}})}cancelNativeLoading(){return a(this,null,function*(){try{return yield h.cancelDialog()}catch(e){throw console.error("cancelNativeLoading error",e),e}})}getMiniAppKong(e){return a(this,null,function*(){try{return yield h.getMiniAppKong(e)}catch(t){throw console.error("getMiniAppKong error",t),t}})}}const Be=l.registerPlugin("CameraScanPlugin",{web:new class extends w{pickCameraScan(r){return a(this,null,function*(){return new Promise(e=>{e(r)})})}}});window.removeAddListenerCameraScan=()=>null;class Ue{pickCameraScan(e){return a(this,null,function*(){try{return yield Be.pickCameraScan(e)}catch(t){throw console.error("pickCameraScan error",t),t}})}}const Ee=l.registerPlugin("CameraScanMultiplePlugin",{web:new class extends w{pickCameraScanMultiple(){return a(this,null,function*(){})}}});class _e{pickCameraScanMultiple(e){return a(this,null,function*(){try{return yield Ee.pickCameraScanMultiple(e)}catch(t){throw console.error("pickCameraScanMultiple error",t),t}})}}const xe=l.registerPlugin("CameraScanMultipleNoCountPlugin",{web:new class extends w{pickCameraScanMultipleNoCount(){return a(this,null,function*(){})}}});class He{pickCameraScanMultipleNoCount(e){return a(this,null,function*(){try{return yield xe.pickCameraScanMultipleNoCount(e)}catch(t){throw console.error("pickCameraScanMultipleNoCount error",t),t}})}}const Ie=l.registerPlugin("CameraScanSingleOrDualPlugin",{web:new class extends w{pickCameraScanSingleOrDual(){return a(this,null,function*(){})}}});class je{pickCameraScanSingleOrDual(e){return a(this,null,function*(){try{return yield Ie.pickCameraScanSingleOrDual(e)}catch(t){throw console.error("pickCameraScanSingleOrDual error",t),t}})}}const le="LaserScanPlugin",te=l.registerPlugin(le,{web:new class extends w{pickLaserScan(){return a(this,null,function*(){})}unPickLaserScan(){return a(this,null,function*(){})}setLaserState(){return a(this,null,function*(){})}}}),Q=I();Q.removeAddListenerLaserScan=()=>null;const de=(r=()=>null)=>{try{Q.removeAddListenerLaserScan&&Q.removeAddListenerLaserScan();const e=t=>a(this,null,function*(){t&&(Q.removeAddListenerLaserScan=yield(n=>a(this,null,function*(){try{if(l.addListener){const o=yield l.addListener(le,"nativeSendLaser",s=>n&&n(s));return o!=null&&o.remove?o.remove:()=>null}}catch(o){throw console.error("addListenerLaserHandle error",o),o}}))(t))});setTimeout(()=>{e(r)})}catch(e){throw console.error("laserScanFn error",e),e}};class Te{constructor(){this.pickLaserScan()}pickLaserScan(){return a(this,null,function*(){try{return yield te.pickLaserScan({isContinue:!1})}catch(e){throw console.error("pickLaserScan error",e),e}})}unPickLaserScan(){return a(this,null,function*(){try{return yield te.unPickLaserScan()}catch(e){throw console.error("unPickLaserScan error",e),e}})}setLaserState(e){try{te.setLaserState(e)}catch(t){throw console.error("setLaserState error",t),t}}setLaserScan(e){(t=>{try{const{mounted:n,beforeUnmount:o,callBack:s}=t;n(()=>{de(s)}),o(()=>{de()})}catch(n){throw console.error("laserScanApiParams error",n),n}})(e)}}const _=I();_.addListenerCountAssistRemoveHandle=()=>null;const ue=(r=()=>null)=>a(this,null,function*(){try{_!=null&&_.addListenerCountAssistRemoveHandle&&typeof _.addListenerCountAssistRemoveHandle=="function"&&_.addListenerCountAssistRemoveHandle(),_.addListenerCountAssistRemoveHandle=yield(e=>a(this,null,function*(){try{if(l.addListener){const t=yield l.addListener(F,"nativeSendCountAssist",n=>e&&e(n));return t!=null&&t.remove?t.remove:()=>null}}catch(t){throw console.error("addListenerCountAssistHandle error",t),t}}))(r)}catch(e){throw console.error("initCountAssistFn error",e),e}});class Fe{setCountAssistState(e){return a(this,null,function*(){return yield Ae.setCountAssistState(e)})}getCountAssistState(e){return(t=>{try{let n=t!=null?t:!1;return V(o=>{n=!!(o!=null&&o.countAssistState)}),n}catch(n){throw console.error("getCountAssistStateHandle error",n),n}})(e)}setCountAssistBtn(e){(t=>{try{const{mounted:n,beforeUnmount:o,callBack:s}=t;n(()=>{ue(s)}),o(()=>{ue()})}catch(n){throw console.error("setCountAssistBtnHandle error",n),n}})(e)}}const me=l.registerPlugin("ClickStreamPlugin",{web:new class extends w{init(){return a(this,null,function*(){return new Promise(r=>{r(null)})})}trace(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("clickStreamTraceParams error",e),e}})}}});class $e{constructor(){this.init()}init(){return a(this,null,function*(){try{return yield me.init()}catch(e){throw console.error("clickStreamPlugin, init error",e),e}})}trace(e){return a(this,null,function*(){console.info("clickStreamTraceParams===",e);try{return yield me.trace(e)}catch(t){throw console.error("clickStreamPlugin, trace error",t),t}})}}const we="MiniAppLifecyclePlugin";var $=(r=>(r.MINI_APP_BEFORE_UNMOUNT_PERMISSION="mini_app_before_unmount_permission",r.MINI_APP_BEFORE_UNMOUNT_COMPLETION="mini_app_before_unmount_completion",r))($||{});const he=l.registerPlugin(we,{web:new class extends w{setNativeUsagePermission(){return a(this,null,function*(){})}authorizeWebCallback(){return a(this,null,function*(){})}}}),R=I();R.removeAddListenerLifecycleMiniAppBeforeUnmount=()=>null;const pe=r=>{try{R.removeAddListenerLifecycleMiniAppBeforeUnmount&&typeof R.removeAddListenerLifecycleMiniAppBeforeUnmount!="function"&&R.removeAddListenerLifecycleMiniAppBeforeUnmount();const e=t=>a(this,null,function*(){t&&(R.removeAddListenerLifecycleMiniAppBeforeUnmount=yield(n=>a(this,null,function*(){try{if(l.addListener){const o=yield l.addListener(we,"miniAppBeforeUnmount",s=>n&&n(s));return o!=null&&o.remove?o.remove:()=>null}}catch(o){throw console.error("miniAppBeforeUnmountHandle error",o),o}}))(t))});setTimeout(()=>a(this,null,function*(){yield e(r)}))}catch(e){throw console.error("laserScanFn error",e),e}};class Re{constructor(){}setNativeUsagePermission(e){return a(this,null,function*(){try{return yield he.setNativeUsagePermission(e)}catch(t){throw console.error("lifecyclePlugin.setNativeUsagePermission error",t),t}})}authorizeWebCallback(e){return a(this,null,function*(){try{return yield he.authorizeWebCallback(e)}catch(t){throw console.error("lifecyclePlugin.authorizeWebCallback error",t),t}})}miniAppBeforeUnmount(e){this.setNativeUsagePermission({action:$.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!0}),((t,n)=>{try{const{mounted:o,beforeUnmount:s,callBack:c}=t;o(()=>{pe(i=>a(this,null,function*(){var f;if(c&&c instanceof Function)try{(f=c(i))==null||f.then(()=>a(this,null,function*(){yield n.setNativeUsagePermission({action:$.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),yield n.authorizeWebCallback({action:$.MINI_APP_BEFORE_UNMOUNT_COMPLETION})}))}catch(m){console.error("miniAppBeforeUnmount error callBack is not a function or promise")}else console.error("miniAppBeforeUnmount error callBack is not a function or promise")}))}),s(()=>a(this,null,function*(){yield n.setNativeUsagePermission({action:$.MINI_APP_BEFORE_UNMOUNT_PERMISSION,value:!1}),pe(()=>{})}))}catch(o){throw console.error("miniAppBeforeUnmount error",o),o}})(e,this)}}class ye{constructor(){S(this,"initialContextPlugins",new ke);S(this,"communicatePlugins",new Oe);S(this,"cameraScanPlugins",new Ue);S(this,"cameraScanMultiplePlugins",new _e);S(this,"cameraScanMultipleNoCountPlugins",new He);S(this,"cameraScanSingleOrDualPlugins",new je);S(this,"laserScanPlugins",new Te);S(this,"countAssistPlugins",new Fe);S(this,"clickStreamPlugins",new $e);S(this,"lifecyclePlugins",new Re)}}const De=new ye,We=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends w{homeIsClick(){return a(this,null,function*(){})}openMiniApp(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("openMiniApp error",e),e}})}showTitle(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("showTitle error",e),e}})}showFABMenu(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("showFABMenu error",e),e}})}showSubMask(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("showSubMask error",e),e}})}setMiniAppVersion(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("setMiniAppVersion error",e),e}})}showDialog(){return a(this,null,function*(){})}cancelDialog(){return a(this,null,function*(){})}getMiniAppKong(r){return a(this,null,function*(){try{return new Promise(e=>{e(r)})}catch(e){throw console.error("getMiniAppKong error",e),e}})}}},Symbol.toStringTag,{value:"Module"}));g.NativeApi=ye,g.default=De,Object.defineProperties(g,{__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.3.0",
4
+ "version": "1.3.2",
5
5
  "description": "In Superapp, the encapsulation of calling Native interfaces by mini-programs.",
6
6
  "scripts": {
7
7
  "dev": "vite",