@feedmepos/mf-payment 1.2.14 → 1.2.16

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.
Files changed (60) hide show
  1. package/dist/{PayoutAccount-B9sThTU6.js → PayoutAccount-CvMczmij.js} +6 -6
  2. package/dist/{PayoutAccount-C1-oQCFC.js → PayoutAccount-bF6506mg.js} +5 -5
  3. package/dist/{PayoutAccountSetting-D3ffGE0d.js → PayoutAccountSetting-Di_Rohl7.js} +391 -330
  4. package/dist/{Restaurant-3FLRoz2Z.js → Restaurant-BgfJ4kMh.js} +4 -4
  5. package/dist/RestaurantSetting-DLB_GBbu.js +754 -0
  6. package/dist/{Settlement-Bdj2WaoM.js → Settlement-DqwyJFk-.js} +3 -3
  7. package/dist/{Settlement-CC2B-e4f.js → Settlement-Mf5XJrXc.js} +3 -3
  8. package/dist/{SettlementTransactions-DGCj9bAe.js → SettlementTransactions-6vkA8-4o.js} +3 -3
  9. package/dist/{SettlementTransactions-CwLzHWsb.js → SettlementTransactions-DvzbSvA9.js} +3 -3
  10. package/dist/{Terminal-7c3OQF9g.js → Terminal-DC6alAxg.js} +5 -5
  11. package/dist/{TerminalSetting-B7xu6e4X.js → TerminalSetting-BE9fFg4j.js} +3 -3
  12. package/dist/{Transaction-D1LWBBsZ.js → Transaction-BPVSJWdM.js} +7 -7
  13. package/dist/{Transaction--t5VJdXQ.js → Transaction-BXynWN9l.js} +5 -5
  14. package/dist/{TransactionOld-DHVZ5iSD.js → TransactionOld-aJqwnMYJ.js} +4 -4
  15. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-CRkXGtHQ.js → TransactionTable.vue_vue_type_script_setup_true_lang-CX5eNJPx.js} +3 -3
  16. package/dist/{app-D24UkS2o.js → app-l69fYMyZ.js} +375 -375
  17. package/dist/app.js +1 -1
  18. package/dist/{assets-B5NXw6Y4.js → assets-CRA5IzdW.js} +2 -2
  19. package/dist/{grafana-DaIIupgz.js → grafana-AnUnO24M.js} +1 -1
  20. package/dist/{index-B2DvBis-.js → index-34hQY02y.js} +2 -2
  21. package/dist/{index-BBYs-Llt.js → index-8V-GavUD.js} +1 -1
  22. package/dist/{index-Bboy-oty.js → index-BrtYLN-t.js} +1 -1
  23. package/dist/{index-BFdB2HXN.js → index-Cer_6J8b.js} +1 -1
  24. package/dist/{index-DvYpRRA_.js → index-DayhN_i6.js} +1 -1
  25. package/dist/{index-DNHpMza-.js → index-DmI9Gt5s.js} +9532 -9385
  26. package/dist/{index-Lio-k9My.js → index-k7EwR1PN.js} +1 -1
  27. package/dist/{index.vue_vue_type_script_setup_true_lang-B8G7gIcx.js → index.vue_vue_type_script_setup_true_lang-BZvBvJ7L.js} +1 -1
  28. package/dist/package.json +2 -2
  29. package/dist/{payout-account-MSqoi8mH.js → payout-account-HJH4ybUc.js} +3 -3
  30. package/dist/stores/payoutAccount.d.ts +22 -12
  31. package/dist/tsconfig.app.tsbuildinfo +1 -1
  32. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +22 -12
  33. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +26 -16
  34. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +26 -16
  35. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +22 -12
  36. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +22 -12
  37. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +26 -16
  38. package/dist/views/admin/payout-account/tabs/gateway/DigioGateway.vue.d.ts +39 -0
  39. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  40. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  41. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  42. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +45 -0
  43. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  44. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +8 -8
  45. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +6 -6
  46. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +8 -10
  47. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +6 -6
  48. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +48 -0
  49. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +14 -14
  50. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +14 -14
  51. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +14 -14
  52. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +14 -14
  53. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +14 -14
  54. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +16 -14
  55. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +14 -14
  56. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +44 -24
  57. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +56 -56
  58. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +28 -28
  59. package/package.json +2 -2
  60. package/dist/RestaurantSetting-DnqiIepz.js +0 -625
@@ -0,0 +1,754 @@
1
+ import { defineComponent as _, ref as b, resolveComponent as s, openBlock as V, createBlock as w, withCtx as U, createVNode as o, unref as l, createElementVNode as D, createCommentVNode as S, computed as R, onMounted as $, createElementBlock as N, Fragment as L, isRef as B, resolveDynamicComponent as P, normalizeProps as K, mergeProps as Y } from "vue";
2
+ import { g as q, b as M, u as A, e as I } from "./index-DmI9Gt5s.js";
3
+ import { _ as z } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
4
+ import { useRouter as H } from "vue-router";
5
+ import { u as E } from "./index-Cer_6J8b.js";
6
+ import { z as f, a as g } from "./validator-D5jtpt9A.js";
7
+ import { useCoreStore as j } from "@feedmepos/mf-common";
8
+ import { u as Q } from "./error-K1CakhA9.js";
9
+ import { useSnackbar as Z } from "@feedmepos/ui-library";
10
+ import { r as J } from "./index-k7EwR1PN.js";
11
+ const G = {
12
+ async get(a) {
13
+ return q(
14
+ await M().get(
15
+ `restaurants/${a}/payment-gateway`
16
+ )
17
+ );
18
+ },
19
+ async upsert(a, c) {
20
+ return q(
21
+ await M().post(
22
+ `restaurants/${a}/payment-gateway`,
23
+ { data: c }
24
+ )
25
+ );
26
+ },
27
+ async delete(a, c) {
28
+ return q(
29
+ await M().delete(
30
+ `restaurants/${a}/payment-gateway/${c}`
31
+ )
32
+ );
33
+ },
34
+ async grabSync(a) {
35
+ return q(
36
+ await M().post(
37
+ `restaurants/${a}/payment-gateway/grab/sync`
38
+ )
39
+ );
40
+ }
41
+ }, W = { class: "flex mt-6 space-x-6" }, X = /* @__PURE__ */ _({
42
+ __name: "FiuuGateway",
43
+ props: {
44
+ onUpdate: {
45
+ type: Function,
46
+ required: !0
47
+ },
48
+ onDelete: {
49
+ type: Function,
50
+ required: !0
51
+ },
52
+ gateway: {
53
+ type: Object,
54
+ required: !0
55
+ }
56
+ },
57
+ setup(a) {
58
+ var v, m;
59
+ const c = a, u = b(((v = c.gateway) == null ? void 0 : v.active) ?? !1), t = b(((m = c.gateway) == null ? void 0 : m.config) || {
60
+ merchantId: "",
61
+ uniqueId: "",
62
+ verifyKey: "",
63
+ secretKey: "",
64
+ applicationCode: "",
65
+ offlineSecret: ""
66
+ });
67
+ return (d, e) => {
68
+ const i = s("FmTextField"), F = s("FmSwitch"), p = s("FmButton"), y = s("FmForm");
69
+ return V(), w(y, {
70
+ ref: "form",
71
+ class: "flex flex-col gap-16",
72
+ onValidationSuccess: e[7] || (e[7] = () => a.onUpdate(u.value, t.value))
73
+ }, {
74
+ default: U(() => [
75
+ o(i, {
76
+ modelValue: t.value.merchantId,
77
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => t.value.merchantId = n),
78
+ label: "Merchant ID",
79
+ rules: l(f)(l(g).string())
80
+ }, null, 8, ["modelValue", "rules"]),
81
+ o(i, {
82
+ modelValue: t.value.uniqueId,
83
+ "onUpdate:modelValue": e[1] || (e[1] = (n) => t.value.uniqueId = n),
84
+ label: "Unique ID",
85
+ rules: l(f)(l(g).string())
86
+ }, null, 8, ["modelValue", "rules"]),
87
+ o(i, {
88
+ modelValue: t.value.verifyKey,
89
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => t.value.verifyKey = n),
90
+ label: "Verify Key",
91
+ rules: l(f)(l(g).string())
92
+ }, null, 8, ["modelValue", "rules"]),
93
+ o(i, {
94
+ modelValue: t.value.secretKey,
95
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => t.value.secretKey = n),
96
+ label: "Secret Key",
97
+ rules: l(f)(l(g).string())
98
+ }, null, 8, ["modelValue", "rules"]),
99
+ o(i, {
100
+ modelValue: t.value.applicationCode,
101
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => t.value.applicationCode = n),
102
+ label: "Application Code ( Offline )",
103
+ rules: l(f)(l(g).string())
104
+ }, null, 8, ["modelValue", "rules"]),
105
+ o(i, {
106
+ modelValue: t.value.offlineSecret,
107
+ "onUpdate:modelValue": e[5] || (e[5] = (n) => t.value.offlineSecret = n),
108
+ label: "Offline Secret ( Offline )",
109
+ rules: l(f)(l(g).string())
110
+ }, null, 8, ["modelValue", "rules"]),
111
+ o(F, {
112
+ modelValue: u.value,
113
+ "onUpdate:modelValue": e[6] || (e[6] = (n) => u.value = n),
114
+ label: "Is Active"
115
+ }, null, 8, ["modelValue"]),
116
+ D("div", W, [
117
+ a.gateway ? (V(), w(p, {
118
+ key: 0,
119
+ class: "flex-1",
120
+ variant: "secondary",
121
+ label: "Delete",
122
+ onclick: () => a.onDelete(a.gateway)
123
+ }, null, 8, ["onclick"])) : S("", !0),
124
+ o(p, {
125
+ type: "submit",
126
+ class: "flex-1",
127
+ variant: "primary",
128
+ label: "Save"
129
+ })
130
+ ])
131
+ ]),
132
+ _: 1
133
+ }, 512);
134
+ };
135
+ }
136
+ }), h = { class: "flex mt-6 space-x-6" }, ee = /* @__PURE__ */ _({
137
+ __name: "RevenueMonsterGateway",
138
+ props: {
139
+ onUpdate: {
140
+ type: Function,
141
+ required: !0
142
+ },
143
+ onDelete: {
144
+ type: Function,
145
+ required: !0
146
+ },
147
+ gateway: {
148
+ type: Object,
149
+ required: !0
150
+ }
151
+ },
152
+ setup(a) {
153
+ var v, m;
154
+ const c = a, u = b(((v = c.gateway) == null ? void 0 : v.active) ?? !1), t = b(((m = c.gateway) == null ? void 0 : m.config) || {
155
+ storeId: "",
156
+ clientId: "",
157
+ clientSecret: "",
158
+ clientPrivateKey: ""
159
+ });
160
+ return (d, e) => {
161
+ const i = s("FmTextField"), F = s("FmTextarea"), p = s("FmSwitch"), y = s("FmButton"), n = s("FmForm");
162
+ return V(), w(n, {
163
+ ref: "form",
164
+ class: "flex flex-col gap-16",
165
+ onValidationSuccess: e[5] || (e[5] = () => a.onUpdate(u.value, t.value))
166
+ }, {
167
+ default: U(() => [
168
+ o(i, {
169
+ modelValue: t.value.storeId,
170
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => t.value.storeId = r),
171
+ label: "Store ID",
172
+ rules: l(f)(l(g).string())
173
+ }, null, 8, ["modelValue", "rules"]),
174
+ o(i, {
175
+ modelValue: t.value.clientId,
176
+ "onUpdate:modelValue": e[1] || (e[1] = (r) => t.value.clientId = r),
177
+ label: "Client ID",
178
+ rules: l(f)(l(g).string())
179
+ }, null, 8, ["modelValue", "rules"]),
180
+ o(i, {
181
+ modelValue: t.value.clientSecret,
182
+ "onUpdate:modelValue": e[2] || (e[2] = (r) => t.value.clientSecret = r),
183
+ label: "Client Secret",
184
+ rules: l(f)(l(g).string())
185
+ }, null, 8, ["modelValue", "rules"]),
186
+ o(F, {
187
+ modelValue: t.value.clientPrivateKey,
188
+ "onUpdate:modelValue": e[3] || (e[3] = (r) => t.value.clientPrivateKey = r),
189
+ label: "Client Private Key"
190
+ }, null, 8, ["modelValue"]),
191
+ o(p, {
192
+ modelValue: u.value,
193
+ "onUpdate:modelValue": e[4] || (e[4] = (r) => u.value = r),
194
+ label: "Is Active"
195
+ }, null, 8, ["modelValue"]),
196
+ D("div", h, [
197
+ a.gateway ? (V(), w(y, {
198
+ key: 0,
199
+ class: "flex-1",
200
+ variant: "secondary",
201
+ label: "Delete",
202
+ onclick: () => a.onDelete(a.gateway)
203
+ }, null, 8, ["onclick"])) : S("", !0),
204
+ o(y, {
205
+ type: "submit",
206
+ class: "flex-1",
207
+ variant: "primary",
208
+ label: "Save"
209
+ })
210
+ ])
211
+ ]),
212
+ _: 1
213
+ }, 512);
214
+ };
215
+ }
216
+ }), te = { class: "flex mt-6 space-x-6" }, ae = /* @__PURE__ */ _({
217
+ __name: "GhlGateway",
218
+ props: {
219
+ onUpdate: {
220
+ type: Function,
221
+ required: !0
222
+ },
223
+ onDelete: {
224
+ type: Function,
225
+ required: !0
226
+ },
227
+ gateway: {
228
+ type: Object,
229
+ required: !0
230
+ }
231
+ },
232
+ setup(a) {
233
+ var v, m;
234
+ const c = a, u = b(((v = c.gateway) == null ? void 0 : v.active) ?? !1), t = b(((m = c.gateway) == null ? void 0 : m.config) || {
235
+ merchantId: "",
236
+ terminalId: "",
237
+ privateKey: ""
238
+ });
239
+ return (d, e) => {
240
+ const i = s("FmTextField"), F = s("FmTextarea"), p = s("FmSwitch"), y = s("FmButton"), n = s("FmForm");
241
+ return V(), w(n, {
242
+ ref: "form",
243
+ class: "flex flex-col gap-16",
244
+ onValidationSuccess: e[4] || (e[4] = () => a.onUpdate(u.value, t.value))
245
+ }, {
246
+ default: U(() => [
247
+ o(i, {
248
+ modelValue: t.value.merchantId,
249
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => t.value.merchantId = r),
250
+ label: "Merchant ID",
251
+ rules: l(f)(l(g).string())
252
+ }, null, 8, ["modelValue", "rules"]),
253
+ o(i, {
254
+ modelValue: t.value.terminalId,
255
+ "onUpdate:modelValue": e[1] || (e[1] = (r) => t.value.terminalId = r),
256
+ label: "Terminal ID",
257
+ rules: l(f)(l(g).string())
258
+ }, null, 8, ["modelValue", "rules"]),
259
+ o(F, {
260
+ id: "ghl_pkey",
261
+ modelValue: t.value.privateKey,
262
+ "onUpdate:modelValue": e[2] || (e[2] = (r) => t.value.privateKey = r),
263
+ label: "Private Key",
264
+ rules: l(f)(l(g).string())
265
+ }, null, 8, ["modelValue", "rules"]),
266
+ o(p, {
267
+ modelValue: u.value,
268
+ "onUpdate:modelValue": e[3] || (e[3] = (r) => u.value = r),
269
+ label: "Is Active"
270
+ }, null, 8, ["modelValue"]),
271
+ D("div", te, [
272
+ a.gateway ? (V(), w(y, {
273
+ key: 0,
274
+ class: "flex-1",
275
+ variant: "secondary",
276
+ label: "Delete",
277
+ onclick: () => a.onDelete(a.gateway)
278
+ }, null, 8, ["onclick"])) : S("", !0),
279
+ o(y, {
280
+ type: "submit",
281
+ class: "flex-1",
282
+ variant: "primary",
283
+ label: "Save"
284
+ })
285
+ ])
286
+ ]),
287
+ _: 1
288
+ }, 512);
289
+ };
290
+ }
291
+ }), le = { class: "flex mt-6 space-x-6" }, ne = /* @__PURE__ */ _({
292
+ __name: "MacauPassGateway",
293
+ props: {
294
+ onUpdate: {
295
+ type: Function,
296
+ required: !0
297
+ },
298
+ onDelete: {
299
+ type: Function,
300
+ required: !0
301
+ },
302
+ gateway: {
303
+ type: Object,
304
+ required: !0
305
+ }
306
+ },
307
+ setup(a) {
308
+ var v, m;
309
+ const c = a, u = b(((v = c.gateway) == null ? void 0 : v.active) ?? !1), t = b(((m = c.gateway) == null ? void 0 : m.config) || {
310
+ merchantId: "",
311
+ merchantName: "",
312
+ merchantCategoryCode: "",
313
+ storeID: "",
314
+ storeName: ""
315
+ });
316
+ return (d, e) => {
317
+ const i = s("FmTextField"), F = s("FmSwitch"), p = s("FmButton"), y = s("FmForm");
318
+ return V(), w(y, {
319
+ ref: "form",
320
+ class: "flex flex-col gap-16",
321
+ onValidationSuccess: e[6] || (e[6] = () => a.onUpdate(u.value, t.value))
322
+ }, {
323
+ default: U(() => [
324
+ o(i, {
325
+ modelValue: t.value.merchantId,
326
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => t.value.merchantId = n),
327
+ label: "Merchant ID",
328
+ rules: l(f)(l(g).string())
329
+ }, null, 8, ["modelValue", "rules"]),
330
+ o(i, {
331
+ modelValue: t.value.merchantName,
332
+ "onUpdate:modelValue": e[1] || (e[1] = (n) => t.value.merchantName = n),
333
+ label: "Merchant Name",
334
+ rules: l(f)(l(g).string())
335
+ }, null, 8, ["modelValue", "rules"]),
336
+ o(i, {
337
+ modelValue: t.value.merchantCategoryCode,
338
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => t.value.merchantCategoryCode = n),
339
+ label: "Merchant MCC",
340
+ rules: l(f)(l(g).string())
341
+ }, null, 8, ["modelValue", "rules"]),
342
+ o(i, {
343
+ modelValue: t.value.storeID,
344
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => t.value.storeID = n),
345
+ label: "Store ID",
346
+ rules: l(f)(l(g).string())
347
+ }, null, 8, ["modelValue", "rules"]),
348
+ o(i, {
349
+ modelValue: t.value.storeName,
350
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => t.value.storeName = n),
351
+ label: "Store Name",
352
+ rules: l(f)(l(g).string())
353
+ }, null, 8, ["modelValue", "rules"]),
354
+ o(F, {
355
+ modelValue: u.value,
356
+ "onUpdate:modelValue": e[5] || (e[5] = (n) => u.value = n),
357
+ label: "Is Active"
358
+ }, null, 8, ["modelValue"]),
359
+ D("div", le, [
360
+ a.gateway ? (V(), w(p, {
361
+ key: 0,
362
+ class: "flex-1",
363
+ variant: "secondary",
364
+ label: "Delete",
365
+ onclick: () => a.onDelete(a.gateway)
366
+ }, null, 8, ["onclick"])) : S("", !0),
367
+ o(p, {
368
+ type: "submit",
369
+ class: "flex-1",
370
+ variant: "primary",
371
+ label: "Save"
372
+ })
373
+ ])
374
+ ]),
375
+ _: 1
376
+ }, 512);
377
+ };
378
+ }
379
+ }), oe = { class: "flex items-end" }, ue = { class: "flex mt-6 space-x-6" }, re = /* @__PURE__ */ _({
380
+ __name: "GrabGateway",
381
+ props: {
382
+ onUpdate: {
383
+ type: Function,
384
+ required: !0
385
+ },
386
+ onDelete: {
387
+ type: Function,
388
+ required: !0
389
+ },
390
+ gateway: {
391
+ type: Object,
392
+ required: !0
393
+ }
394
+ },
395
+ setup(a) {
396
+ var F, p;
397
+ const c = Z(), { isLoading: u, startAsyncCall: t } = A(), v = j(), m = a, d = b(((F = m.gateway) == null ? void 0 : F.active) ?? !1), e = b(((p = m.gateway) == null ? void 0 : p.config) || {
398
+ merchantId: ""
399
+ });
400
+ async function i() {
401
+ t(async () => {
402
+ var y;
403
+ try {
404
+ const { merchantID: n } = await G.grabSync(((y = v.currentRestaurant.value) == null ? void 0 : y._id) ?? "");
405
+ e.value.merchantId = n, d.value = !0, c.open({
406
+ type: "success",
407
+ title: "Grab Setting sync succesfully, you will still need to save the changes."
408
+ });
409
+ } catch (n) {
410
+ c.open({
411
+ type: "error",
412
+ title: "Error occurs when sync ordering settings",
413
+ message: Q(n)
414
+ });
415
+ }
416
+ });
417
+ }
418
+ return (y, n) => {
419
+ const r = s("FmTextField"), x = s("FmButton"), C = s("FmTooltip"), T = s("FmSwitch"), k = s("FmForm");
420
+ return V(), w(k, {
421
+ ref: "form",
422
+ class: "flex flex-col gap-16",
423
+ onValidationSuccess: n[2] || (n[2] = () => a.onUpdate(d.value, e.value))
424
+ }, {
425
+ default: U(() => [
426
+ D("div", oe, [
427
+ o(r, {
428
+ modelValue: e.value.merchantId,
429
+ "onUpdate:modelValue": n[0] || (n[0] = (O) => e.value.merchantId = O),
430
+ label: "Merchant ID",
431
+ rules: l(f)(l(g).string())
432
+ }, null, 8, ["modelValue", "rules"]),
433
+ o(C, {
434
+ variant: "plain",
435
+ placement: "right",
436
+ content: "Sync from Ordering Settings"
437
+ }, {
438
+ default: U(() => [
439
+ o(x, {
440
+ class: "ml-2",
441
+ type: "button",
442
+ variant: "primary",
443
+ icon: "sync",
444
+ loading: l(u),
445
+ onclick: () => i()
446
+ }, null, 8, ["loading", "onclick"])
447
+ ]),
448
+ _: 1
449
+ })
450
+ ]),
451
+ o(T, {
452
+ modelValue: d.value,
453
+ "onUpdate:modelValue": n[1] || (n[1] = (O) => d.value = O),
454
+ label: "Is Active"
455
+ }, null, 8, ["modelValue"]),
456
+ D("div", ue, [
457
+ a.gateway ? (V(), w(x, {
458
+ key: 0,
459
+ class: "flex-1",
460
+ variant: "secondary",
461
+ label: "Delete",
462
+ onclick: () => a.onDelete(a.gateway)
463
+ }, null, 8, ["onclick"])) : S("", !0),
464
+ o(x, {
465
+ type: "submit",
466
+ class: "flex-1",
467
+ variant: "primary",
468
+ label: "Save"
469
+ })
470
+ ])
471
+ ]),
472
+ _: 1
473
+ }, 512);
474
+ };
475
+ }
476
+ }), se = { class: "flex mt-6 space-x-6" }, ie = /* @__PURE__ */ _({
477
+ __name: "SoftSpaceGateway",
478
+ props: {
479
+ onUpdate: {
480
+ type: Function,
481
+ required: !0
482
+ },
483
+ onDelete: {
484
+ type: Function,
485
+ required: !0
486
+ },
487
+ gateway: {
488
+ type: Object,
489
+ required: !0
490
+ }
491
+ },
492
+ setup(a) {
493
+ var v, m;
494
+ const c = a, u = b(((v = c.gateway) == null ? void 0 : v.active) ?? !1), t = b(((m = c.gateway) == null ? void 0 : m.config) || {
495
+ mid: "",
496
+ tid: ""
497
+ });
498
+ return (d, e) => {
499
+ const i = s("FmTextField"), F = s("FmButton"), p = s("FmForm");
500
+ return V(), w(p, {
501
+ ref: "form",
502
+ class: "flex flex-col gap-16",
503
+ onValidationSuccess: e[2] || (e[2] = () => a.onUpdate(u.value, t.value))
504
+ }, {
505
+ default: U(() => [
506
+ o(i, {
507
+ modelValue: t.value.mid,
508
+ "onUpdate:modelValue": e[0] || (e[0] = (y) => t.value.mid = y),
509
+ label: "MID",
510
+ rules: l(f)(l(g).string())
511
+ }, null, 8, ["modelValue", "rules"]),
512
+ o(i, {
513
+ modelValue: t.value.tid,
514
+ "onUpdate:modelValue": e[1] || (e[1] = (y) => t.value.tid = y),
515
+ label: "TID",
516
+ rules: l(f)(l(g).string())
517
+ }, null, 8, ["modelValue", "rules"]),
518
+ D("div", se, [
519
+ a.gateway ? (V(), w(F, {
520
+ key: 0,
521
+ class: "flex-1",
522
+ variant: "secondary",
523
+ label: "Delete",
524
+ onclick: () => a.onDelete(a.gateway)
525
+ }, null, 8, ["onclick"])) : S("", !0),
526
+ o(F, {
527
+ type: "submit",
528
+ class: "flex-1",
529
+ variant: "primary",
530
+ label: "Save"
531
+ })
532
+ ])
533
+ ]),
534
+ _: 1
535
+ }, 512);
536
+ };
537
+ }
538
+ }), me = { class: "flex mt-6 space-x-6" }, ce = /* @__PURE__ */ _({
539
+ __name: "DigioGateway",
540
+ props: {
541
+ gateway: {
542
+ type: Object,
543
+ required: !0
544
+ },
545
+ onUpdate: {
546
+ type: Function,
547
+ required: !0
548
+ },
549
+ onDelete: {
550
+ type: Function,
551
+ required: !0
552
+ }
553
+ },
554
+ setup(a) {
555
+ var t;
556
+ const u = b(((t = a.gateway) == null ? void 0 : t.config) || {
557
+ merchantId: ""
558
+ });
559
+ return (v, m) => {
560
+ const d = s("FmTextField"), e = s("FmButton"), i = s("FmForm");
561
+ return V(), w(i, {
562
+ ref: "form",
563
+ class: "flex flex-col gap-16",
564
+ onValidationSuccess: m[1] || (m[1] = () => a.onUpdate(u.value))
565
+ }, {
566
+ default: U(() => [
567
+ o(d, {
568
+ modelValue: u.value.merchantId,
569
+ "onUpdate:modelValue": m[0] || (m[0] = (F) => u.value.merchantId = F),
570
+ label: "Merchant ID",
571
+ rules: l(f)(l(g).string())
572
+ }, null, 8, ["modelValue", "rules"]),
573
+ D("div", me, [
574
+ a.gateway ? (V(), w(e, {
575
+ key: 0,
576
+ class: "flex-1",
577
+ variant: "secondary",
578
+ label: "Delete",
579
+ onclick: () => a.onDelete()
580
+ }, null, 8, ["onclick"])) : S("", !0),
581
+ o(e, {
582
+ type: "submit",
583
+ class: "flex-1",
584
+ variant: "primary",
585
+ label: "Save"
586
+ })
587
+ ])
588
+ ]),
589
+ _: 1
590
+ }, 512);
591
+ };
592
+ }
593
+ }), de = {
594
+ key: 0,
595
+ class: "flex items-center justify-center min-h-[80vh]"
596
+ }, ye = /* @__PURE__ */ _({
597
+ __name: "PaymentGateway",
598
+ props: {
599
+ restaurant: {
600
+ type: Object,
601
+ required: !0
602
+ }
603
+ },
604
+ setup(a) {
605
+ const c = [
606
+ {
607
+ label: "Fiuu",
608
+ value: "RAZER_MERCHANT_SERVICE",
609
+ form: X,
610
+ region: [I.F_COUNTRY.enum.MY, I.F_COUNTRY.enum.SG]
611
+ },
612
+ {
613
+ label: "Revenue Monster",
614
+ value: "REVENUE_MONSTER",
615
+ form: ee,
616
+ region: [I.F_COUNTRY.enum.MY]
617
+ },
618
+ {
619
+ label: "GHL",
620
+ value: "E_GHL",
621
+ form: ae,
622
+ region: [I.F_COUNTRY.enum.MY]
623
+ },
624
+ {
625
+ label: "Grab",
626
+ value: "GRAB",
627
+ form: re,
628
+ region: [I.F_COUNTRY.enum.MY]
629
+ },
630
+ {
631
+ label: "Macau Pass",
632
+ value: "MACAU_PASS",
633
+ form: ne,
634
+ region: [I.F_COUNTRY.enum.MO]
635
+ },
636
+ {
637
+ label: "SoftSpace",
638
+ value: "SOFTSPACE",
639
+ form: ie,
640
+ region: [I.F_COUNTRY.enum.MY]
641
+ },
642
+ {
643
+ label: "Digio",
644
+ value: "DIGIO",
645
+ form: ce,
646
+ region: [I.F_COUNTRY.enum.TH]
647
+ }
648
+ ], u = a, t = j(), { isLoading: v, startAsyncCall: m } = A(), { activeGateway: d } = E({
649
+ activeGateway: ""
650
+ }), e = b([]);
651
+ async function i(r, x) {
652
+ await m(async () => {
653
+ const C = {
654
+ _id: "",
655
+ _rev: "",
656
+ paymentGateway: d.value,
657
+ config: x,
658
+ active: r
659
+ }, T = e.value.find((k) => k.paymentGateway === d.value);
660
+ T && (C._id = T._id, C._rev = T._rev), await G.upsert(u.restaurant._id, C), e.value = await G.get(u.restaurant._id);
661
+ });
662
+ }
663
+ async function F(r) {
664
+ m(async () => {
665
+ await G.delete(u.restaurant._id, r._id), e.value = await G.get(u.restaurant._id);
666
+ });
667
+ }
668
+ const p = R(() => c.filter((r) => r.region.includes(t.currentCountry.value ?? I.F_COUNTRY.enum.MY)));
669
+ function y() {
670
+ m(async () => {
671
+ e.value = await G.get(u.restaurant._id), p.value.length > 0 && (d.value = p.value[0].value);
672
+ });
673
+ }
674
+ $(y);
675
+ const n = R(() => {
676
+ var r;
677
+ return (r = c.find((x) => x.value === d.value)) == null ? void 0 : r.form;
678
+ });
679
+ return (r, x) => {
680
+ const C = s("FmCircularProgress"), T = s("FmTabs");
681
+ return V(), N(L, null, [
682
+ l(v) ? (V(), N("div", de, [
683
+ o(C, { size: "xxl" })
684
+ ])) : S("", !0),
685
+ o(T, {
686
+ class: "mb-6",
687
+ "model-value": l(d),
688
+ "onUpdate:modelValue": x[0] || (x[0] = (k) => B(d) ? d.value = k : null),
689
+ items: p.value
690
+ }, null, 8, ["model-value", "items"]),
691
+ l(d) ? (V(), w(P(n.value), K(Y({ key: 1 }, {
692
+ gateway: e.value.find((k) => k.paymentGateway === l(d)),
693
+ onDelete: F,
694
+ onUpdate: i
695
+ })), null, 16)) : S("", !0)
696
+ ], 64);
697
+ };
698
+ }
699
+ }), Ie = /* @__PURE__ */ _({
700
+ __name: "RestaurantSetting",
701
+ props: {
702
+ restaurantId: {
703
+ type: String,
704
+ required: !0
705
+ }
706
+ },
707
+ setup(a) {
708
+ const c = a, { tab: u } = E({
709
+ tab: "payment-gateway"
710
+ }), { isLoading: t, startAsyncCall: v } = A(!0), m = H(), d = b(), e = [
711
+ {
712
+ label: "Payment Gateway",
713
+ value: "payment-gateway",
714
+ icon: "assured_workload",
715
+ render: ye
716
+ }
717
+ ];
718
+ function i() {
719
+ v(async () => {
720
+ d.value = await J.readRestaurantById(c.restaurantId);
721
+ });
722
+ }
723
+ $(i);
724
+ const F = R(() => {
725
+ var p;
726
+ return (p = e.find((y) => y.value === u.value)) == null ? void 0 : p.render;
727
+ });
728
+ return (p, y) => {
729
+ var r;
730
+ const n = s("FmTabs");
731
+ return V(), w(z, {
732
+ title: `Restaurant (${(r = d.value) == null ? void 0 : r._id})`,
733
+ loading: l(t),
734
+ onBack: l(m).back
735
+ }, {
736
+ default: U(() => [
737
+ o(n, {
738
+ "model-value": l(u),
739
+ "onUpdate:modelValue": y[0] || (y[0] = (x) => B(u) ? u.value = x : null),
740
+ class: "mb-6",
741
+ items: e
742
+ }, null, 8, ["model-value"]),
743
+ l(u) && d.value ? (V(), w(P(F.value), K(Y({ key: 0 }, {
744
+ restaurant: d.value
745
+ })), null, 16)) : S("", !0)
746
+ ]),
747
+ _: 1
748
+ }, 8, ["title", "loading", "onBack"]);
749
+ };
750
+ }
751
+ });
752
+ export {
753
+ Ie as default
754
+ };