@feedmepos/mf-payment 0.0.0-beta.36 → 0.0.0-beta.37

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,12 @@
1
- import { defineComponent as b, openBlock as g, createElementBlock as _, Fragment as C, createElementVNode as F, createTextVNode as q, toDisplayString as B, ref as v, onMounted as T, computed as D, resolveComponent as f, unref as w, createVNode as y, createBlock as I, withCtx as U, createCommentVNode as S, isRef as $, resolveDynamicComponent as P, normalizeProps as K, mergeProps as L } from "vue";
2
- import { u as M } from "./index-Cnxt2xmc.js";
1
+ import { defineComponent as b, openBlock as F, createElementBlock as D, Fragment as _, createElementVNode as p, createTextVNode as V, toDisplayString as T, ref as y, onMounted as S, computed as M, resolveComponent as f, unref as w, createVNode as g, createBlock as I, withCtx as G, createCommentVNode as q, isRef as $, resolveDynamicComponent as P, normalizeProps as K, mergeProps as L } from "vue";
2
+ import { u as C } from "./index-Cnxt2xmc.js";
3
3
  import { useRouter as N } from "vue-router";
4
- import { t as V } from "./index-CBFVJirn.js";
4
+ import { t as U } from "./index-CBFVJirn.js";
5
5
  import { _ as O } from "./Layout.vue_vue_type_script_setup_true_lang-C38PTqO5.js";
6
6
  import { u as j } from "./index-BgnU5ezY.js";
7
7
  import { useSnackbar as E } from "@feedmepos/ui-library";
8
- import { u as h } from "./error-K1CakhA9.js";
9
- const A = /* @__PURE__ */ b({
8
+ import { u as A } from "./error-K1CakhA9.js";
9
+ const R = /* @__PURE__ */ b({
10
10
  __name: "Information",
11
11
  props: {
12
12
  terminal: {
@@ -14,23 +14,26 @@ const A = /* @__PURE__ */ b({
14
14
  required: !0
15
15
  }
16
16
  },
17
- setup(a) {
18
- return (l, n) => (g(), _(C, null, [
19
- n[0] || (n[0] = F("b", null, "Name", -1)),
20
- q(": " + B(a.terminal.name), 1),
21
- n[1] || (n[1] = F("br", null, null, -1)),
22
- n[2] || (n[2] = F("b", null, "Status", -1)),
23
- q(": " + B(a.terminal.status), 1),
24
- n[3] || (n[3] = F("br", null, null, -1)),
25
- n[4] || (n[4] = F("b", null, "Device ID", -1)),
26
- q(": " + B(a.terminal.deviceId ?? "-"), 1),
27
- n[5] || (n[5] = F("br", null, null, -1))
17
+ setup(t) {
18
+ return (l, a) => (F(), D(_, null, [
19
+ a[0] || (a[0] = p("b", null, "Name", -1)),
20
+ V(": " + T(t.terminal.name), 1),
21
+ a[1] || (a[1] = p("br", null, null, -1)),
22
+ a[2] || (a[2] = p("b", null, "Status", -1)),
23
+ V(": " + T(t.terminal.status), 1),
24
+ a[3] || (a[3] = p("br", null, null, -1)),
25
+ a[4] || (a[4] = p("b", null, "Device ID", -1)),
26
+ V(": " + T(t.terminal.deviceId ?? "-"), 1),
27
+ a[5] || (a[5] = p("br", null, null, -1)),
28
+ a[6] || (a[6] = p("b", null, "Device Type", -1)),
29
+ V(": " + T(t.terminal.deviceType ?? "-"), 1),
30
+ a[7] || (a[7] = p("br", null, null, -1))
28
31
  ], 64));
29
32
  }
30
- }), R = {
33
+ }), z = {
31
34
  key: 0,
32
35
  class: "flex items-center justify-center min-h-[80vh]"
33
- }, z = { class: "flex mt-6 space-x-6" }, H = /* @__PURE__ */ b({
36
+ }, H = { class: "flex mt-6 space-x-6" }, Q = /* @__PURE__ */ b({
34
37
  __name: "TerminalGateway",
35
38
  props: {
36
39
  terminal: {
@@ -42,13 +45,13 @@ const A = /* @__PURE__ */ b({
42
45
  required: !0
43
46
  }
44
47
  },
45
- setup(a) {
46
- const { isLoading: l, startAsyncCall: n } = M(), o = a, i = v(), c = v(), m = v(-1), e = v({
48
+ setup(t) {
49
+ const { isLoading: l, startAsyncCall: a } = C(), o = t, i = y(), c = y(), m = y(-1), e = y({
47
50
  terminalId: ""
48
51
  });
49
- T(() => {
50
- if (n(async () => {
51
- i.value = await V.getTerminals(o.terminal.referenceId);
52
+ S(() => {
53
+ if (a(async () => {
54
+ i.value = await U.getTerminals(o.terminal.referenceId);
52
55
  }), !o.terminal.ecrs)
53
56
  return;
54
57
  const s = o.terminal.ecrs.findIndex((r) => r && r.gateway && r.gateway === "FeedMe");
@@ -60,7 +63,7 @@ const A = /* @__PURE__ */ b({
60
63
  terminalId: u.config.terminalId
61
64
  });
62
65
  });
63
- const t = D(() => (i.value ?? []).map((s) => ({
66
+ const n = M(() => (i.value ?? []).map((s) => ({
64
67
  label: s.name ?? s._id,
65
68
  value: s._id
66
69
  })));
@@ -69,33 +72,33 @@ const A = /* @__PURE__ */ b({
69
72
  (u = o.terminal.ecrs) == null || u.splice(s, 1), o.onUpdate(o.terminal);
70
73
  }
71
74
  return (s, u) => {
72
- const r = f("FmCircularProgress"), p = f("FmSelect"), x = f("FmButton"), k = f("FmForm");
73
- return w(l) ? (g(), _("div", R, [
74
- y(r, { size: "xxl" })
75
- ])) : (g(), I(k, {
75
+ const r = f("FmCircularProgress"), v = f("FmSelect"), x = f("FmButton"), k = f("FmForm");
76
+ return w(l) ? (F(), D("div", z, [
77
+ g(r, { size: "xxl" })
78
+ ])) : (F(), I(k, {
76
79
  key: 1,
77
80
  ref: c.value,
78
81
  class: "flex flex-col gap-16 w-[500px]",
79
82
  onValidationSuccess: u[1] || (u[1] = () => {
80
- m.value > -1 ? a.terminal.ecrs[m.value] = { gateway: "FeedMe", config: e.value } : (a.terminal.ecrs || (a.terminal.ecrs = []), a.terminal.ecrs.push({ gateway: "FeedMe", config: e.value })), o.onUpdate(a.terminal);
83
+ m.value > -1 ? t.terminal.ecrs[m.value] = { gateway: "FeedMe", config: e.value } : (t.terminal.ecrs || (t.terminal.ecrs = []), t.terminal.ecrs.push({ gateway: "FeedMe", config: e.value })), o.onUpdate(t.terminal);
81
84
  })
82
85
  }, {
83
- default: U(() => [
84
- y(p, {
86
+ default: G(() => [
87
+ g(v, {
85
88
  modelValue: e.value.terminalId,
86
- "onUpdate:modelValue": u[0] || (u[0] = (G) => e.value.terminalId = G),
89
+ "onUpdate:modelValue": u[0] || (u[0] = (B) => e.value.terminalId = B),
87
90
  label: "Terminal ID",
88
- items: t.value
91
+ items: n.value
89
92
  }, null, 8, ["modelValue", "items"]),
90
- F("div", z, [
91
- m.value > -1 ? (g(), I(x, {
93
+ p("div", H, [
94
+ m.value > -1 ? (F(), I(x, {
92
95
  key: 0,
93
96
  class: "flex-1",
94
97
  variant: "secondary",
95
98
  label: "Delete",
96
99
  onclick: () => d(m.value)
97
- }, null, 8, ["onclick"])) : S("", !0),
98
- y(x, {
100
+ }, null, 8, ["onclick"])) : q("", !0),
101
+ g(x, {
99
102
  type: "submit",
100
103
  class: "flex-1",
101
104
  variant: "primary",
@@ -107,7 +110,7 @@ const A = /* @__PURE__ */ b({
107
110
  }, 512));
108
111
  };
109
112
  }
110
- }), Q = { class: "flex mt-6 space-x-6" }, J = /* @__PURE__ */ b({
113
+ }), h = { class: "flex mt-6 space-x-6" }, J = /* @__PURE__ */ b({
111
114
  __name: "FiuuGateway",
112
115
  props: {
113
116
  terminal: {
@@ -119,8 +122,8 @@ const A = /* @__PURE__ */ b({
119
122
  required: !0
120
123
  }
121
124
  },
122
- setup(a) {
123
- const l = a, n = [
125
+ setup(t) {
126
+ const l = t, a = [
124
127
  {
125
128
  label: "Fiuu Malaysia",
126
129
  value: "cc.feedme.payment.rms"
@@ -133,57 +136,57 @@ const A = /* @__PURE__ */ b({
133
136
  label: "Fiuu Singapore",
134
137
  value: "cc.feedme.payment.fiuu_sg"
135
138
  }
136
- ], o = v(), i = v(-1), c = v({
139
+ ], o = y(), i = y(-1), c = y({
137
140
  packageId: "",
138
141
  uniqueId: ""
139
142
  });
140
- T(() => {
143
+ S(() => {
141
144
  if (!l.terminal.gateways)
142
145
  return;
143
146
  const e = l.terminal.gateways.findIndex((d) => d && d.gateway && d.gateway === "Fiuu");
144
147
  if (e === -1)
145
148
  return;
146
149
  i.value = e;
147
- const t = l.terminal.gateways.at(e);
148
- t.gateway === "Fiuu" && t.config && (c.value = {
149
- packageId: t.config.packageId,
150
- uniqueId: t.config.uniqueId
150
+ const n = l.terminal.gateways.at(e);
151
+ n.gateway === "Fiuu" && n.config && (c.value = {
152
+ packageId: n.config.packageId,
153
+ uniqueId: n.config.uniqueId
151
154
  });
152
155
  });
153
156
  async function m(e) {
154
- var t;
155
- (t = l.terminal.gateways) == null || t.splice(e, 1), l.onUpdate(l.terminal);
157
+ var n;
158
+ (n = l.terminal.gateways) == null || n.splice(e, 1), l.onUpdate(l.terminal);
156
159
  }
157
- return (e, t) => {
160
+ return (e, n) => {
158
161
  const d = f("FmSelect"), s = f("FmTextField"), u = f("FmButton"), r = f("FmForm");
159
- return g(), I(r, {
162
+ return F(), I(r, {
160
163
  ref: o.value,
161
164
  class: "flex flex-col gap-16 w-[500px]",
162
- onValidationSuccess: t[2] || (t[2] = () => {
163
- i.value > -1 ? a.terminal.gateways[i.value] = { gateway: "Fiuu", config: c.value } : (a.terminal.gateways || (a.terminal.gateways = []), a.terminal.gateways.push({ gateway: "Fiuu", config: c.value })), l.onUpdate(a.terminal);
165
+ onValidationSuccess: n[2] || (n[2] = () => {
166
+ i.value > -1 ? t.terminal.gateways[i.value] = { gateway: "Fiuu", config: c.value } : (t.terminal.gateways || (t.terminal.gateways = []), t.terminal.gateways.push({ gateway: "Fiuu", config: c.value })), l.onUpdate(t.terminal);
164
167
  })
165
168
  }, {
166
- default: U(() => [
167
- y(d, {
169
+ default: G(() => [
170
+ g(d, {
168
171
  modelValue: c.value.packageId,
169
- "onUpdate:modelValue": t[0] || (t[0] = (p) => c.value.packageId = p),
172
+ "onUpdate:modelValue": n[0] || (n[0] = (v) => c.value.packageId = v),
170
173
  label: "Package ID",
171
- items: n
174
+ items: a
172
175
  }, null, 8, ["modelValue"]),
173
- y(s, {
176
+ g(s, {
174
177
  modelValue: c.value.uniqueId,
175
- "onUpdate:modelValue": t[1] || (t[1] = (p) => c.value.uniqueId = p),
178
+ "onUpdate:modelValue": n[1] || (n[1] = (v) => c.value.uniqueId = v),
176
179
  label: "Unique ID"
177
180
  }, null, 8, ["modelValue"]),
178
- F("div", Q, [
179
- i.value > -1 ? (g(), I(u, {
181
+ p("div", h, [
182
+ i.value > -1 ? (F(), I(u, {
180
183
  key: 0,
181
184
  class: "flex-1",
182
185
  variant: "secondary",
183
186
  label: "Delete",
184
187
  onclick: () => m(i.value)
185
- }, null, 8, ["onclick"])) : S("", !0),
186
- y(u, {
188
+ }, null, 8, ["onclick"])) : q("", !0),
189
+ g(u, {
187
190
  type: "submit",
188
191
  class: "flex-1",
189
192
  variant: "primary",
@@ -207,16 +210,16 @@ const A = /* @__PURE__ */ b({
207
210
  required: !0
208
211
  }
209
212
  },
210
- setup(a) {
211
- const l = a, n = v(), o = v(-1), i = v({
213
+ setup(t) {
214
+ const l = t, a = y(), o = y(-1), i = y({
212
215
  merchantId: "",
213
216
  terminalId: "",
214
217
  privateKey: ""
215
218
  });
216
- T(() => {
219
+ S(() => {
217
220
  if (!l.terminal.ecrs)
218
221
  return;
219
- const m = l.terminal.ecrs.findIndex((t) => t && t.gateway && t.gateway === "Ghl");
222
+ const m = l.terminal.ecrs.findIndex((n) => n && n.gateway && n.gateway === "Ghl");
220
223
  if (m === -1)
221
224
  return;
222
225
  o.value = m;
@@ -232,39 +235,39 @@ const A = /* @__PURE__ */ b({
232
235
  (e = l.terminal.ecrs) == null || e.splice(m, 1), l.onUpdate(l.terminal);
233
236
  }
234
237
  return (m, e) => {
235
- const t = f("FmTextField"), d = f("FmTextarea"), s = f("FmButton"), u = f("FmForm");
236
- return g(), I(u, {
237
- ref: n.value,
238
+ const n = f("FmTextField"), d = f("FmTextarea"), s = f("FmButton"), u = f("FmForm");
239
+ return F(), I(u, {
240
+ ref: a.value,
238
241
  class: "flex flex-col gap-16 w-[500px]",
239
242
  onValidationSuccess: e[3] || (e[3] = () => {
240
- o.value > -1 ? a.terminal.ecrs[o.value] = { gateway: "Ghl", config: i.value } : (a.terminal.ecrs || (a.terminal.ecrs = []), a.terminal.ecrs.push({ gateway: "Ghl", config: i.value })), l.onUpdate(a.terminal);
243
+ o.value > -1 ? t.terminal.ecrs[o.value] = { gateway: "Ghl", config: i.value } : (t.terminal.ecrs || (t.terminal.ecrs = []), t.terminal.ecrs.push({ gateway: "Ghl", config: i.value })), l.onUpdate(t.terminal);
241
244
  })
242
245
  }, {
243
- default: U(() => [
244
- y(t, {
246
+ default: G(() => [
247
+ g(n, {
245
248
  modelValue: i.value.merchantId,
246
249
  "onUpdate:modelValue": e[0] || (e[0] = (r) => i.value.merchantId = r),
247
250
  label: "Merchant ID"
248
251
  }, null, 8, ["modelValue"]),
249
- y(t, {
252
+ g(n, {
250
253
  modelValue: i.value.terminalId,
251
254
  "onUpdate:modelValue": e[1] || (e[1] = (r) => i.value.terminalId = r),
252
255
  label: "Terminal ID"
253
256
  }, null, 8, ["modelValue"]),
254
- y(d, {
257
+ g(d, {
255
258
  modelValue: i.value.privateKey,
256
259
  "onUpdate:modelValue": e[2] || (e[2] = (r) => i.value.privateKey = r),
257
260
  label: "Private Key"
258
261
  }, null, 8, ["modelValue"]),
259
- F("div", W, [
260
- o.value > -1 ? (g(), I(s, {
262
+ p("div", W, [
263
+ o.value > -1 ? (F(), I(s, {
261
264
  key: 0,
262
265
  class: "flex-1",
263
266
  variant: "secondary",
264
267
  label: "Delete",
265
268
  onclick: () => c(o.value)
266
- }, null, 8, ["onclick"])) : S("", !0),
267
- y(s, {
269
+ }, null, 8, ["onclick"])) : q("", !0),
270
+ g(s, {
268
271
  type: "submit",
269
272
  class: "flex-1",
270
273
  variant: "primary",
@@ -284,13 +287,13 @@ const A = /* @__PURE__ */ b({
284
287
  required: !0
285
288
  }
286
289
  },
287
- setup(a) {
288
- const l = a, { tab: n } = j({
290
+ setup(t) {
291
+ const l = t, { tab: a } = j({
289
292
  tab: "information"
290
- }), { isLoading: o, startAsyncCall: i } = M(!0), c = N(), m = E(), e = v();
291
- async function t(r) {
293
+ }), { isLoading: o, startAsyncCall: i } = C(!0), c = N(), m = E(), e = y();
294
+ async function n(r) {
292
295
  try {
293
- await V.updateById(
296
+ await U.updateById(
294
297
  l.terminalId,
295
298
  {
296
299
  name: r.name,
@@ -298,15 +301,15 @@ const A = /* @__PURE__ */ b({
298
301
  ecrs: r.ecrs ?? [],
299
302
  gateways: r.gateways ?? []
300
303
  }
301
- ), e.value = await V.readById(l.terminalId), m.open({
304
+ ), e.value = await U.readById(l.terminalId), m.open({
302
305
  type: "success",
303
306
  message: "Terminal updated successfully"
304
307
  });
305
- } catch (p) {
308
+ } catch (v) {
306
309
  m.open({
307
310
  type: "error",
308
311
  title: "Error occurs when update terminal",
309
- message: h(p)
312
+ message: A(v)
310
313
  });
311
314
  }
312
315
  }
@@ -315,7 +318,7 @@ const A = /* @__PURE__ */ b({
315
318
  label: "Information",
316
319
  value: "information",
317
320
  icon: "overview",
318
- render: A
321
+ render: R
319
322
  },
320
323
  {
321
324
  label: "Fiuu",
@@ -323,18 +326,18 @@ const A = /* @__PURE__ */ b({
323
326
  icon: "payment",
324
327
  render: J
325
328
  }
326
- ], s = D(() => {
329
+ ], s = M(() => {
327
330
  var r;
328
- return (r = d.find((p) => p.value === n.value)) == null ? void 0 : r.render;
331
+ return (r = d.find((v) => v.value === a.value)) == null ? void 0 : r.render;
329
332
  });
330
333
  async function u() {
331
334
  i(async () => {
332
- e.value = await V.readById(l.terminalId), e.value.deviceType !== "TERMINAL" && d.push(
335
+ e.value = await U.readById(l.terminalId), e.value.deviceType !== "TERMINAL" && d.push(
333
336
  {
334
337
  label: "FeedMe Terminal",
335
338
  value: "terminal",
336
339
  icon: "shopping_cart_checkout",
337
- render: H
340
+ render: Q
338
341
  },
339
342
  {
340
343
  label: "GHL Terminal (V2)",
@@ -345,25 +348,25 @@ const A = /* @__PURE__ */ b({
345
348
  );
346
349
  });
347
350
  }
348
- return T(u), (r, p) => {
351
+ return S(u), (r, v) => {
349
352
  var k;
350
353
  const x = f("FmTabs");
351
- return g(), I(O, {
354
+ return F(), I(O, {
352
355
  title: `Terminal (${(k = e.value) == null ? void 0 : k._id})`,
353
356
  loading: w(o),
354
357
  onBack: w(c).back
355
358
  }, {
356
- default: U(() => [
357
- y(x, {
358
- "model-value": w(n),
359
- "onUpdate:modelValue": p[0] || (p[0] = (G) => $(n) ? n.value = G : null),
359
+ default: G(() => [
360
+ g(x, {
361
+ "model-value": w(a),
362
+ "onUpdate:modelValue": v[0] || (v[0] = (B) => $(a) ? a.value = B : null),
360
363
  class: "mb-6",
361
364
  items: d
362
365
  }, null, 8, ["model-value"]),
363
- w(n) ? (g(), I(P(s.value), K(L({ key: 0 }, {
366
+ w(a) ? (F(), I(P(s.value), K(L({ key: 0 }, {
364
367
  terminal: e.value,
365
- onUpdate: t
366
- })), null, 16)) : S("", !0)
368
+ onUpdate: n
369
+ })), null, 16)) : q("", !0)
367
370
  ]),
368
371
  _: 1
369
372
  }, 8, ["title", "loading", "onBack"]);
@@ -1,4 +1,4 @@
1
- import { UpdateTerminalByIdDto, type PaginatedResult } from "@feedmepos/payment-entity";
1
+ import { FdoTerminalDeviceType, UpdateTerminalByIdDto, type PaginatedResult } from "@feedmepos/payment-entity";
2
2
  import { FdoTerminal } from "@feedmepos/payment-entity";
3
3
  export declare const temrinalApi: {
4
4
  create(payload: {
@@ -7,6 +7,7 @@ export declare const temrinalApi: {
7
7
  }): Promise<PaginatedResult<FdoTerminal>>;
8
8
  read(payload: {
9
9
  searchKey: string;
10
+ deviceType: FdoTerminalDeviceType | undefined;
10
11
  limit: number;
11
12
  cursor: string;
12
13
  }): Promise<PaginatedResult<FdoTerminal>>;
package/dist/app.js CHANGED
@@ -1,15 +1,15 @@
1
- import { createRouter as D, createWebHistory as I, useRouter as S } from "vue-router";
2
- import { computed as b, watch as l, defineComponent as h, ref as T, resolveComponent as v, openBlock as _, createBlock as R, onMounted as g, onBeforeMount as w } from "vue";
3
- import { useCoreStore as d } from "@feedmepos/mf-common";
4
- import { defineStore as P } from "pinia";
5
- const f = [
1
+ import { createRouter as R, createWebHistory as D, useRouter as I } from "vue-router";
2
+ import { computed as f, watch as c, defineComponent as y, ref as P, resolveComponent as h, openBlock as b, createBlock as _, onMounted as S, onBeforeMount as w } from "vue";
3
+ import { useCoreStore as u } from "@feedmepos/mf-common";
4
+ import { defineStore as T } from "pinia";
5
+ const l = [
6
6
  {
7
7
  path: "/admin/payout-accounts",
8
8
  name: "mf-payment-admin.payout-account",
9
9
  meta: {
10
10
  sidebarDisplay: "Payout Accounts"
11
11
  },
12
- component: () => import("./PayoutAccount-DlS2OPwj.js")
12
+ component: () => import("./PayoutAccount-BcgYhX4b.js")
13
13
  },
14
14
  {
15
15
  path: "/admin/payout-accounts/:accountId",
@@ -23,13 +23,13 @@ const f = [
23
23
  meta: {
24
24
  sidebarDisplay: "Terminals"
25
25
  },
26
- component: () => import("./Terminal-BDDP5VT8.js")
26
+ component: () => import("./Terminal-CP380u7w.js")
27
27
  },
28
28
  {
29
29
  path: "/admin/terminal/:terminalId",
30
30
  name: "mf-payment-admin.terminal-setting",
31
31
  props: !0,
32
- component: () => import("./TerminalSetting-3CRuMj8l.js")
32
+ component: () => import("./TerminalSetting-DOdZk5cq.js")
33
33
  },
34
34
  {
35
35
  path: "/admin/terminal-transaction",
@@ -61,7 +61,7 @@ const f = [
61
61
  props: !0,
62
62
  component: () => import("./SettlementTransactions-yJhT6FR4.js")
63
63
  }
64
- ], y = [
64
+ ], d = [
65
65
  {
66
66
  path: "",
67
67
  redirect: { name: "mf-payment-payout-account" }
@@ -69,7 +69,7 @@ const f = [
69
69
  {
70
70
  path: "/payout-account",
71
71
  name: "mf-payment-payout-account",
72
- component: () => import("./PayoutAccount-IhMg0cdL.js"),
72
+ component: () => import("./PayoutAccount-B0viIh7c.js"),
73
73
  meta: {
74
74
  sidebarDisplay: "Payout Accounts"
75
75
  }
@@ -104,10 +104,10 @@ const f = [
104
104
  props: !0,
105
105
  component: () => import("./SettlementTransactions-Co4ziq3a.js")
106
106
  }
107
- ], A = P("iframe", () => {
107
+ ], g = T("iframe", () => {
108
108
  const o = {
109
109
  isIframe: !1
110
- }, a = b(() => o);
110
+ }, a = f(() => o);
111
111
  function n(r) {
112
112
  o.isIframe = r;
113
113
  }
@@ -115,40 +115,45 @@ const f = [
115
115
  state: a,
116
116
  init: n
117
117
  };
118
- }), C = D({
119
- history: I(),
120
- routes: [...y, ...f]
118
+ }), A = R({
119
+ history: D(),
120
+ routes: [...d, ...l]
121
121
  });
122
- C.beforeEach(async (o) => {
122
+ A.beforeEach(async (o) => {
123
123
  const {
124
124
  sessionUser: a,
125
125
  currentRestaurant: n,
126
- businesses: r,
127
- changeBusiness: c,
128
- currentBusiness: s,
129
- readRestaurants: u,
130
- changeRestaurant: e
131
- } = d();
132
- return o.name.startsWith("mf-payment-admin") ? a.value ? !0 : new Promise((t) => {
133
- const i = l(a, (m) => {
134
- var p;
135
- m && (i(), t((p = a.value) == null ? void 0 : p.isInternal));
126
+ currentBusiness: r,
127
+ readRestaurants: p,
128
+ changeRestaurant: i
129
+ } = u();
130
+ return o.name.startsWith("mf-payment-admin") ? a.value ? !0 : new Promise((m) => {
131
+ const e = c(a, (t) => {
132
+ var s;
133
+ t && (e(), m((s = a.value) == null ? void 0 : s.isInternal));
136
134
  });
137
- }) : !s.value || !n.value ? new Promise(async (t) => {
138
- const i = l(n, (p) => {
139
- p && (i(), t(!0));
140
- }), m = await u();
141
- await e(m == null ? void 0 : m.at(0));
142
- }) : !0;
135
+ }) : !r.value || !n.value ? Promise.all([
136
+ new Promise(async (m) => {
137
+ const e = c(r, (t) => {
138
+ t && (e(), m(!0));
139
+ });
140
+ }),
141
+ new Promise(async (m) => {
142
+ const e = c(n, (s) => {
143
+ s && (e(), m(!0));
144
+ }), t = await p();
145
+ await i(t == null ? void 0 : t.at(0));
146
+ })
147
+ ]).then((m) => !0) : !0;
143
148
  });
144
- const B = /* @__PURE__ */ h({
149
+ const C = /* @__PURE__ */ y({
145
150
  __name: "AppSidebar",
146
151
  setup(o) {
147
- const a = d(), n = S(), r = T(n.currentRoute.value.name);
148
- l(n.currentRoute, () => {
152
+ const a = u(), n = I(), r = P(n.currentRoute.value.name);
153
+ c(n.currentRoute, () => {
149
154
  r.value = n.currentRoute.value.name;
150
155
  });
151
- const c = y.map((e) => {
156
+ const p = d.map((e) => {
152
157
  var t;
153
158
  if ((t = e.meta) != null && t.sidebarDisplay)
154
159
  return {
@@ -159,7 +164,7 @@ const B = /* @__PURE__ */ h({
159
164
  return n.push({ name: e.name });
160
165
  }
161
166
  };
162
- }).filter((e) => !!e), s = f.map((e) => {
167
+ }).filter((e) => !!e), i = l.map((e) => {
163
168
  var t;
164
169
  if ((t = e.meta) != null && t.sidebarDisplay)
165
170
  return {
@@ -170,9 +175,9 @@ const B = /* @__PURE__ */ h({
170
175
  return n.push({ name: e.name });
171
176
  }
172
177
  };
173
- }).filter((e) => !!e), u = b(() => {
178
+ }).filter((e) => !!e), m = f(() => {
174
179
  var t;
175
- const e = [...c];
180
+ const e = [...p];
176
181
  return (t = a.sessionUser.value) != null && t.isInternal && (e.push({
177
182
  label: "",
178
183
  value: "divider",
@@ -182,36 +187,36 @@ const B = /* @__PURE__ */ h({
182
187
  icon: "admin_panel_settings",
183
188
  value: "divider",
184
189
  disabled: !0
185
- }), e.push(...s)), e;
190
+ }), e.push(...i)), e;
186
191
  });
187
192
  return (e, t) => {
188
- const i = v("FmCollapsibleTabs");
189
- return _(), R(i, {
193
+ const s = h("FmCollapsibleTabs");
194
+ return b(), _(s, {
190
195
  modelValue: r.value,
191
- "onUpdate:modelValue": t[0] || (t[0] = (m) => r.value = m),
192
- items: u.value,
196
+ "onUpdate:modelValue": t[0] || (t[0] = (v) => r.value = v),
197
+ items: m.value,
193
198
  class: "py-16 px-8"
194
199
  }, null, 8, ["modelValue", "items"]);
195
200
  };
196
201
  }
197
- }), F = /* @__PURE__ */ h({
202
+ }), O = /* @__PURE__ */ y({
198
203
  __name: "App",
199
204
  setup(o) {
200
- const { state: a } = A(), n = d();
201
- return g(() => {
205
+ const { state: a } = g(), n = u();
206
+ return S(() => {
202
207
  a.isIframe && parent.postMessage({ event: "ready" }, "*");
203
208
  }), w(() => {
204
- n.registerSidebarComponent(B);
205
- }), (r, c) => {
206
- const s = v("RouterView");
207
- return _(), R(s);
209
+ n.registerSidebarComponent(C);
210
+ }), (r, p) => {
211
+ const i = h("RouterView");
212
+ return b(), _(i);
208
213
  };
209
214
  }
210
- }), M = [
211
- ...f,
212
- ...y
215
+ }), F = [
216
+ ...l,
217
+ ...d
213
218
  ];
214
219
  export {
215
- F as FmApp,
216
- M as routers
220
+ O as FmApp,
221
+ F as routers
217
222
  };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-payment",
3
- "version": "0.0.0-beta.36",
3
+ "version": "0.0.0-beta.37",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"