@feedmepos/mf-payment 1.3.2 → 1.3.4

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 (70) hide show
  1. package/dist/{OnboardForm-BR1OjadM.js → OnboardForm-0gm_drkY.js} +4 -4
  2. package/dist/{OnboardForm-4zEyVLUv.js → OnboardForm-DiFkSYCY.js} +4 -4
  3. package/dist/{OnboardSubmission-CQlnohqQ.js → OnboardSubmission-D2RCkW7k.js} +5 -5
  4. package/dist/{OnboardSubmission-CsSrEezv.js → OnboardSubmission-DuoQ5dv7.js} +2 -2
  5. package/dist/{PayoutAccount-BLyqZUnt.js → PayoutAccount-D8Pfhz4C.js} +5 -5
  6. package/dist/{PayoutAccount-CbA1YDwd.js → PayoutAccount-Lym1Za-n.js} +5 -5
  7. package/dist/{PayoutAccountSetting-DfGw639O.js → PayoutAccountSetting-DcuumyW4.js} +3 -3
  8. package/dist/{Restaurant-BdDDrAsq.js → Restaurant-C8lLkTRk.js} +4 -4
  9. package/dist/RestaurantSetting-IW965gti.js +764 -0
  10. package/dist/{Settlement-Cfhafc8m.js → Settlement-BQPbR8m-.js} +3 -3
  11. package/dist/{Settlement-8RYgvfzf.js → Settlement-D18xsXRd.js} +3 -3
  12. package/dist/{SettlementTransactions-Bb54OlAj.js → SettlementTransactions-BQmJ_nZS.js} +3 -3
  13. package/dist/{SettlementTransactions-DrA8PAyd.js → SettlementTransactions-DhKWeuuo.js} +3 -3
  14. package/dist/{Status.vue_vue_type_script_setup_true_lang-BumKpo4s.js → Status.vue_vue_type_script_setup_true_lang-Cp3akQew.js} +1 -1
  15. package/dist/{Terminal-DoTJw-hl.js → Terminal-tg7f8Wue.js} +5 -5
  16. package/dist/TerminalSetting-B5VdUivg.js +1080 -0
  17. package/dist/{Transaction-C5DXkIjl.js → Transaction-CQF5lDAd.js} +5 -5
  18. package/dist/{Transaction-qKhaX4qv.js → Transaction-DFxizbZ7.js} +6 -6
  19. package/dist/{TransactionOld-DAoWcstb.js → TransactionOld-uFMnygUK.js} +4 -4
  20. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-C5cEFUs2.js → TransactionTable.vue_vue_type_script_setup_true_lang-CFr-DduC.js} +3 -3
  21. package/dist/api/payment-gateway/index.d.ts +1 -3
  22. package/dist/{app-D0KpHznD.js → app-DlajGnF4.js} +151 -151
  23. package/dist/app.js +1 -1
  24. package/dist/{assets-C_H0OeWB.js → assets-R7Pf2tcC.js} +1 -1
  25. package/dist/{grafana-BK_sYlee.js → grafana-DLVFFmRO.js} +1 -1
  26. package/dist/{index-jsEyizHG.js → index-BRcPRBkm.js} +1 -1
  27. package/dist/{index-D4_YGL4B.js → index-BUXnw6w4.js} +1 -1
  28. package/dist/{index-BjqwgRyA.js → index-C4T0m6DM.js} +1 -1
  29. package/dist/{index-CvXTRd5n.js → index-CTPvAooK.js} +2 -2
  30. package/dist/index-C_4l0JZj.js +58590 -0
  31. package/dist/{index-GsQWAnBk.js → index-Cpsfcvcu.js} +1 -1
  32. package/dist/{index-Dogc22BO.js → index-D7GUIvIW.js} +1 -1
  33. package/dist/{index.vue_vue_type_script_setup_true_lang-CIxp2j06.js → index.vue_vue_type_script_setup_true_lang-BIGL3hMd.js} +1 -1
  34. package/dist/package.json +2 -2
  35. package/dist/{payout-account-DU-Eid_y.js → payout-account-BN3SUWK6.js} +3 -3
  36. package/dist/{plugins-Dk-0C0b6.js → plugins-BJJ6gEom.js} +1 -1
  37. package/dist/stores/payoutAccount.d.ts +16 -16
  38. package/dist/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +24 -24
  40. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +16 -16
  41. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +20 -20
  42. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +20 -20
  43. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +16 -16
  44. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +16 -16
  45. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +20 -20
  46. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  47. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +92 -8
  48. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +174 -0
  49. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +92 -8
  50. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +174 -0
  51. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +92 -8
  52. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +92 -8
  53. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +174 -0
  54. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +174 -0
  55. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +174 -0
  56. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +174 -0
  57. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +174 -0
  58. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +174 -0
  59. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +174 -0
  60. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +92 -8
  61. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +32 -32
  62. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +4 -4
  63. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +2 -2
  64. package/package.json +2 -2
  65. package/dist/RestaurantSetting-C-16ifI3.js +0 -834
  66. package/dist/TerminalSetting-DpePQHKW.js +0 -572
  67. package/dist/index-eNSd1RuW.js +0 -57995
  68. package/dist/views/admin/restaurant/tabs/LocalIntegration.vue.d.ts +0 -803
  69. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +0 -90
  70. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +0 -92
@@ -0,0 +1,764 @@
1
+ import { defineComponent as _, ref as b, resolveComponent as r, openBlock as F, createBlock as w, withCtx as U, createVNode as o, unref as n, createElementVNode as D, createCommentVNode as S, computed as O, 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 A, u as R, e as I } from "./index-C_4l0JZj.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-C4T0m6DM.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-BUXnw6w4.js";
11
+ const G = {
12
+ async get(l) {
13
+ return q(
14
+ await A().get(
15
+ `restaurants/${l}/payment-gateway`
16
+ )
17
+ );
18
+ },
19
+ async upsert(l, m) {
20
+ return q(
21
+ await A().post(
22
+ `restaurants/${l}/payment-gateway`,
23
+ { data: m }
24
+ )
25
+ );
26
+ },
27
+ async delete(l, m) {
28
+ return q(
29
+ await A().delete(
30
+ `restaurants/${l}/payment-gateway/${m}`
31
+ )
32
+ );
33
+ },
34
+ async grabSync(l) {
35
+ return q(
36
+ await A().post(
37
+ `restaurants/${l}/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(l) {
58
+ var p, c;
59
+ const m = l, u = b(((p = m.gateway) == null ? void 0 : p.active) ?? !1), t = b(((c = m.gateway) == null ? void 0 : c.config) || {
60
+ merchantId: "",
61
+ uniqueId: "",
62
+ verifyKey: "",
63
+ secretKey: "",
64
+ applicationCode: "",
65
+ offlineSecret: ""
66
+ });
67
+ return (y, e) => {
68
+ const i = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
69
+ return F(), w(v, {
70
+ ref: "form",
71
+ class: "flex flex-col gap-16",
72
+ onValidationSuccess: e[7] || (e[7] = () => l.onUpdate(u.value, t.value))
73
+ }, {
74
+ default: U(() => [
75
+ o(i, {
76
+ modelValue: t.value.merchantId,
77
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => t.value.merchantId = a),
78
+ label: "Merchant ID",
79
+ rules: n(f)(n(g).string())
80
+ }, null, 8, ["modelValue", "rules"]),
81
+ o(i, {
82
+ modelValue: t.value.uniqueId,
83
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => t.value.uniqueId = a),
84
+ label: "Unique ID",
85
+ rules: n(f)(n(g).string())
86
+ }, null, 8, ["modelValue", "rules"]),
87
+ o(i, {
88
+ modelValue: t.value.verifyKey,
89
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => t.value.verifyKey = a),
90
+ label: "Verify Key",
91
+ rules: n(f)(n(g).string())
92
+ }, null, 8, ["modelValue", "rules"]),
93
+ o(i, {
94
+ modelValue: t.value.secretKey,
95
+ "onUpdate:modelValue": e[3] || (e[3] = (a) => t.value.secretKey = a),
96
+ label: "Secret Key",
97
+ rules: n(f)(n(g).string())
98
+ }, null, 8, ["modelValue", "rules"]),
99
+ o(i, {
100
+ modelValue: t.value.applicationCode,
101
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => t.value.applicationCode = a),
102
+ label: "Application Code ( Offline )",
103
+ rules: n(f)(n(g).string())
104
+ }, null, 8, ["modelValue", "rules"]),
105
+ o(i, {
106
+ modelValue: t.value.offlineSecret,
107
+ "onUpdate:modelValue": e[5] || (e[5] = (a) => t.value.offlineSecret = a),
108
+ label: "Offline Secret ( Offline )",
109
+ rules: n(f)(n(g).string())
110
+ }, null, 8, ["modelValue", "rules"]),
111
+ o(V, {
112
+ modelValue: u.value,
113
+ "onUpdate:modelValue": e[6] || (e[6] = (a) => u.value = a),
114
+ label: "Is Active"
115
+ }, null, 8, ["modelValue"]),
116
+ D("div", W, [
117
+ l.gateway ? (F(), w(d, {
118
+ key: 0,
119
+ class: "flex-1",
120
+ variant: "secondary",
121
+ label: "Delete",
122
+ onclick: () => l.onDelete(l.gateway)
123
+ }, null, 8, ["onclick"])) : S("", !0),
124
+ o(d, {
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(l) {
153
+ var p, c;
154
+ const m = l, u = b(((p = m.gateway) == null ? void 0 : p.active) ?? !1), t = b(((c = m.gateway) == null ? void 0 : c.config) || {
155
+ storeId: "",
156
+ clientId: "",
157
+ clientSecret: "",
158
+ clientPrivateKey: ""
159
+ });
160
+ return (y, e) => {
161
+ const i = r("FmTextField"), V = r("FmTextarea"), d = r("FmSwitch"), v = r("FmButton"), a = r("FmForm");
162
+ return F(), w(a, {
163
+ ref: "form",
164
+ class: "flex flex-col gap-16",
165
+ onValidationSuccess: e[5] || (e[5] = () => l.onUpdate(u.value, t.value))
166
+ }, {
167
+ default: U(() => [
168
+ o(i, {
169
+ modelValue: t.value.storeId,
170
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => t.value.storeId = s),
171
+ label: "Store ID",
172
+ rules: n(f)(n(g).string())
173
+ }, null, 8, ["modelValue", "rules"]),
174
+ o(i, {
175
+ modelValue: t.value.clientId,
176
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => t.value.clientId = s),
177
+ label: "Client ID",
178
+ rules: n(f)(n(g).string())
179
+ }, null, 8, ["modelValue", "rules"]),
180
+ o(i, {
181
+ modelValue: t.value.clientSecret,
182
+ "onUpdate:modelValue": e[2] || (e[2] = (s) => t.value.clientSecret = s),
183
+ label: "Client Secret",
184
+ rules: n(f)(n(g).string())
185
+ }, null, 8, ["modelValue", "rules"]),
186
+ o(V, {
187
+ modelValue: t.value.clientPrivateKey,
188
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => t.value.clientPrivateKey = s),
189
+ label: "Client Private Key"
190
+ }, null, 8, ["modelValue"]),
191
+ o(d, {
192
+ modelValue: u.value,
193
+ "onUpdate:modelValue": e[4] || (e[4] = (s) => u.value = s),
194
+ label: "Is Active"
195
+ }, null, 8, ["modelValue"]),
196
+ D("div", h, [
197
+ l.gateway ? (F(), w(v, {
198
+ key: 0,
199
+ class: "flex-1",
200
+ variant: "secondary",
201
+ label: "Delete",
202
+ onclick: () => l.onDelete(l.gateway)
203
+ }, null, 8, ["onclick"])) : S("", !0),
204
+ o(v, {
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(l) {
233
+ var p, c;
234
+ const m = l, u = b(((p = m.gateway) == null ? void 0 : p.active) ?? !1), t = b(((c = m.gateway) == null ? void 0 : c.config) || {
235
+ merchantId: "",
236
+ terminalId: "",
237
+ privateKey: ""
238
+ });
239
+ return (y, e) => {
240
+ const i = r("FmTextField"), V = r("FmTextarea"), d = r("FmSwitch"), v = r("FmButton"), a = r("FmForm");
241
+ return F(), w(a, {
242
+ ref: "form",
243
+ class: "flex flex-col gap-16",
244
+ onValidationSuccess: e[4] || (e[4] = () => l.onUpdate(u.value, t.value))
245
+ }, {
246
+ default: U(() => [
247
+ o(i, {
248
+ modelValue: t.value.merchantId,
249
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => t.value.merchantId = s),
250
+ label: "Merchant ID",
251
+ rules: n(f)(n(g).string())
252
+ }, null, 8, ["modelValue", "rules"]),
253
+ o(i, {
254
+ modelValue: t.value.terminalId,
255
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => t.value.terminalId = s),
256
+ label: "Terminal ID",
257
+ rules: n(f)(n(g).string())
258
+ }, null, 8, ["modelValue", "rules"]),
259
+ o(V, {
260
+ id: "ghl_pkey",
261
+ modelValue: t.value.privateKey,
262
+ "onUpdate:modelValue": e[2] || (e[2] = (s) => t.value.privateKey = s),
263
+ label: "Private Key",
264
+ rules: n(f)(n(g).string())
265
+ }, null, 8, ["modelValue", "rules"]),
266
+ o(d, {
267
+ modelValue: u.value,
268
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => u.value = s),
269
+ label: "Is Active"
270
+ }, null, 8, ["modelValue"]),
271
+ D("div", te, [
272
+ l.gateway ? (F(), w(v, {
273
+ key: 0,
274
+ class: "flex-1",
275
+ variant: "secondary",
276
+ label: "Delete",
277
+ onclick: () => l.onDelete(l.gateway)
278
+ }, null, 8, ["onclick"])) : S("", !0),
279
+ o(v, {
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(l) {
308
+ var p, c;
309
+ const m = l, u = b(((p = m.gateway) == null ? void 0 : p.active) ?? !1), t = b(((c = m.gateway) == null ? void 0 : c.config) || {
310
+ merchantId: "",
311
+ merchantName: "",
312
+ merchantCategoryCode: "",
313
+ storeID: "",
314
+ storeName: ""
315
+ });
316
+ return (y, e) => {
317
+ const i = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
318
+ return F(), w(v, {
319
+ ref: "form",
320
+ class: "flex flex-col gap-16",
321
+ onValidationSuccess: e[6] || (e[6] = () => l.onUpdate(u.value, t.value))
322
+ }, {
323
+ default: U(() => [
324
+ o(i, {
325
+ modelValue: t.value.merchantId,
326
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => t.value.merchantId = a),
327
+ label: "Merchant ID",
328
+ rules: n(f)(n(g).string())
329
+ }, null, 8, ["modelValue", "rules"]),
330
+ o(i, {
331
+ modelValue: t.value.merchantName,
332
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => t.value.merchantName = a),
333
+ label: "Merchant Name",
334
+ rules: n(f)(n(g).string())
335
+ }, null, 8, ["modelValue", "rules"]),
336
+ o(i, {
337
+ modelValue: t.value.merchantCategoryCode,
338
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => t.value.merchantCategoryCode = a),
339
+ label: "Merchant MCC",
340
+ rules: n(f)(n(g).string())
341
+ }, null, 8, ["modelValue", "rules"]),
342
+ o(i, {
343
+ modelValue: t.value.storeID,
344
+ "onUpdate:modelValue": e[3] || (e[3] = (a) => t.value.storeID = a),
345
+ label: "Store ID",
346
+ rules: n(f)(n(g).string())
347
+ }, null, 8, ["modelValue", "rules"]),
348
+ o(i, {
349
+ modelValue: t.value.storeName,
350
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => t.value.storeName = a),
351
+ label: "Store Name",
352
+ rules: n(f)(n(g).string())
353
+ }, null, 8, ["modelValue", "rules"]),
354
+ o(V, {
355
+ modelValue: u.value,
356
+ "onUpdate:modelValue": e[5] || (e[5] = (a) => u.value = a),
357
+ label: "Is Active"
358
+ }, null, 8, ["modelValue"]),
359
+ D("div", le, [
360
+ l.gateway ? (F(), w(d, {
361
+ key: 0,
362
+ class: "flex-1",
363
+ variant: "secondary",
364
+ label: "Delete",
365
+ onclick: () => l.onDelete(l.gateway)
366
+ }, null, 8, ["onclick"])) : S("", !0),
367
+ o(d, {
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(l) {
396
+ var V, d;
397
+ const m = Z(), { isLoading: u, startAsyncCall: t } = R(), p = j(), c = l, y = b(((V = c.gateway) == null ? void 0 : V.active) ?? !1), e = b(((d = c.gateway) == null ? void 0 : d.config) || {
398
+ merchantId: ""
399
+ });
400
+ async function i() {
401
+ t(async () => {
402
+ var v;
403
+ try {
404
+ const { merchantID: a } = await G.grabSync(((v = p.currentRestaurant.value) == null ? void 0 : v._id) ?? "");
405
+ e.value.merchantId = a, y.value = !0, m.open({
406
+ type: "success",
407
+ title: "Grab Setting sync succesfully, you will still need to save the changes."
408
+ });
409
+ } catch (a) {
410
+ m.open({
411
+ type: "error",
412
+ title: "Error occurs when sync ordering settings",
413
+ message: Q(a)
414
+ });
415
+ }
416
+ });
417
+ }
418
+ return (v, a) => {
419
+ const s = r("FmTextField"), x = r("FmButton"), C = r("FmTooltip"), T = r("FmSwitch"), k = r("FmForm");
420
+ return F(), w(k, {
421
+ ref: "form",
422
+ class: "flex flex-col gap-16",
423
+ onValidationSuccess: a[2] || (a[2] = () => l.onUpdate(y.value, e.value))
424
+ }, {
425
+ default: U(() => [
426
+ D("div", oe, [
427
+ o(s, {
428
+ modelValue: e.value.merchantId,
429
+ "onUpdate:modelValue": a[0] || (a[0] = (M) => e.value.merchantId = M),
430
+ label: "Merchant ID",
431
+ rules: n(f)(n(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: n(u),
445
+ onclick: () => i()
446
+ }, null, 8, ["loading", "onclick"])
447
+ ]),
448
+ _: 1
449
+ })
450
+ ]),
451
+ o(T, {
452
+ modelValue: y.value,
453
+ "onUpdate:modelValue": a[1] || (a[1] = (M) => y.value = M),
454
+ label: "Is Active"
455
+ }, null, 8, ["modelValue"]),
456
+ D("div", ue, [
457
+ l.gateway ? (F(), w(x, {
458
+ key: 0,
459
+ class: "flex-1",
460
+ variant: "secondary",
461
+ label: "Delete",
462
+ onclick: () => l.onDelete(l.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(l) {
493
+ var p, c;
494
+ const m = l, u = b(((p = m.gateway) == null ? void 0 : p.active) ?? !1), t = b(((c = m.gateway) == null ? void 0 : c.config) || {
495
+ mid: "",
496
+ tid: ""
497
+ });
498
+ return (y, e) => {
499
+ const i = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
500
+ return F(), w(v, {
501
+ ref: "form",
502
+ class: "flex flex-col gap-16",
503
+ onValidationSuccess: e[3] || (e[3] = () => l.onUpdate(u.value, t.value))
504
+ }, {
505
+ default: U(() => [
506
+ o(i, {
507
+ modelValue: t.value.mid,
508
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => t.value.mid = a),
509
+ label: "MID",
510
+ rules: n(f)(n(g).string())
511
+ }, null, 8, ["modelValue", "rules"]),
512
+ o(i, {
513
+ modelValue: t.value.tid,
514
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => t.value.tid = a),
515
+ label: "TID",
516
+ rules: n(f)(n(g).string())
517
+ }, null, 8, ["modelValue", "rules"]),
518
+ o(V, {
519
+ modelValue: u.value,
520
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => u.value = a),
521
+ label: "Is Active"
522
+ }, null, 8, ["modelValue"]),
523
+ D("div", se, [
524
+ l.gateway ? (F(), w(d, {
525
+ key: 0,
526
+ class: "flex-1",
527
+ variant: "secondary",
528
+ label: "Delete",
529
+ onclick: () => l.onDelete(l.gateway)
530
+ }, null, 8, ["onclick"])) : S("", !0),
531
+ o(d, {
532
+ type: "submit",
533
+ class: "flex-1",
534
+ variant: "primary",
535
+ label: "Save"
536
+ })
537
+ ])
538
+ ]),
539
+ _: 1
540
+ }, 512);
541
+ };
542
+ }
543
+ }), me = { class: "flex mt-6 space-x-6" }, ce = /* @__PURE__ */ _({
544
+ __name: "DigioGateway",
545
+ props: {
546
+ gateway: {
547
+ type: Object,
548
+ required: !0
549
+ },
550
+ onUpdate: {
551
+ type: Function,
552
+ required: !0
553
+ },
554
+ onDelete: {
555
+ type: Function,
556
+ required: !0
557
+ }
558
+ },
559
+ setup(l) {
560
+ var p, c;
561
+ const m = l, u = b(((p = m.gateway) == null ? void 0 : p.active) ?? !1), t = b(((c = m.gateway) == null ? void 0 : c.config) || {
562
+ merchantId: ""
563
+ });
564
+ return (y, e) => {
565
+ const i = r("FmTextField"), V = r("FmSwitch"), d = r("FmButton"), v = r("FmForm");
566
+ return F(), w(v, {
567
+ ref: "form",
568
+ class: "flex flex-col gap-16",
569
+ onValidationSuccess: e[2] || (e[2] = () => l.onUpdate(u.value, t.value))
570
+ }, {
571
+ default: U(() => [
572
+ o(i, {
573
+ modelValue: t.value.merchantId,
574
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => t.value.merchantId = a),
575
+ label: "Merchant ID",
576
+ rules: n(f)(n(g).string())
577
+ }, null, 8, ["modelValue", "rules"]),
578
+ o(V, {
579
+ modelValue: u.value,
580
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => u.value = a),
581
+ label: "Is Active"
582
+ }, null, 8, ["modelValue"]),
583
+ D("div", me, [
584
+ l.gateway ? (F(), w(d, {
585
+ key: 0,
586
+ class: "flex-1",
587
+ variant: "secondary",
588
+ label: "Delete",
589
+ onclick: () => l.onDelete(l.gateway)
590
+ }, null, 8, ["onclick"])) : S("", !0),
591
+ o(d, {
592
+ type: "submit",
593
+ class: "flex-1",
594
+ variant: "primary",
595
+ label: "Save"
596
+ })
597
+ ])
598
+ ]),
599
+ _: 1
600
+ }, 512);
601
+ };
602
+ }
603
+ }), de = {
604
+ key: 0,
605
+ class: "flex items-center justify-center min-h-[80vh]"
606
+ }, ye = /* @__PURE__ */ _({
607
+ __name: "PaymentGateway",
608
+ props: {
609
+ restaurant: {
610
+ type: Object,
611
+ required: !0
612
+ }
613
+ },
614
+ setup(l) {
615
+ const m = [
616
+ {
617
+ label: "Fiuu",
618
+ value: "RAZER_MERCHANT_SERVICE",
619
+ form: X,
620
+ region: [I.F_COUNTRY.enum.MY, I.F_COUNTRY.enum.SG]
621
+ },
622
+ {
623
+ label: "Revenue Monster",
624
+ value: "REVENUE_MONSTER",
625
+ form: ee,
626
+ region: [I.F_COUNTRY.enum.MY]
627
+ },
628
+ {
629
+ label: "GHL",
630
+ value: "E_GHL",
631
+ form: ae,
632
+ region: [I.F_COUNTRY.enum.MY]
633
+ },
634
+ {
635
+ label: "Grab",
636
+ value: "GRAB",
637
+ form: re,
638
+ region: [I.F_COUNTRY.enum.MY]
639
+ },
640
+ {
641
+ label: "Macau Pass",
642
+ value: "MACAU_PASS",
643
+ form: ne,
644
+ region: [I.F_COUNTRY.enum.MO]
645
+ },
646
+ {
647
+ label: "SoftSpace",
648
+ value: "SOFTSPACE",
649
+ form: ie,
650
+ region: [I.F_COUNTRY.enum.MY]
651
+ },
652
+ {
653
+ label: "Digio",
654
+ value: "DIGIO",
655
+ form: ce,
656
+ region: [I.F_COUNTRY.enum.TH]
657
+ }
658
+ ], u = l, t = j(), { isLoading: p, startAsyncCall: c } = R(), { activeGateway: y } = E({
659
+ activeGateway: ""
660
+ }), e = b([]);
661
+ async function i(s, x) {
662
+ await c(async () => {
663
+ const C = {
664
+ _id: "",
665
+ _rev: "",
666
+ paymentGateway: y.value,
667
+ config: x,
668
+ active: s
669
+ }, T = e.value.find((k) => k.paymentGateway === y.value);
670
+ T && (C._id = T._id, C._rev = T._rev), await G.upsert(u.restaurant._id, C), e.value = await G.get(u.restaurant._id);
671
+ });
672
+ }
673
+ async function V(s) {
674
+ c(async () => {
675
+ await G.delete(u.restaurant._id, s._id), e.value = await G.get(u.restaurant._id);
676
+ });
677
+ }
678
+ const d = O(() => m.filter((s) => s.region.includes(t.currentCountry.value ?? I.F_COUNTRY.enum.MY)));
679
+ function v() {
680
+ c(async () => {
681
+ e.value = await G.get(u.restaurant._id), d.value.length > 0 && (y.value = d.value[0].value);
682
+ });
683
+ }
684
+ $(v);
685
+ const a = O(() => {
686
+ var s;
687
+ return (s = m.find((x) => x.value === y.value)) == null ? void 0 : s.form;
688
+ });
689
+ return (s, x) => {
690
+ const C = r("FmCircularProgress"), T = r("FmTabs");
691
+ return F(), N(L, null, [
692
+ n(p) ? (F(), N("div", de, [
693
+ o(C, { size: "xxl" })
694
+ ])) : S("", !0),
695
+ o(T, {
696
+ class: "mb-6",
697
+ "model-value": n(y),
698
+ "onUpdate:modelValue": x[0] || (x[0] = (k) => B(y) ? y.value = k : null),
699
+ items: d.value
700
+ }, null, 8, ["model-value", "items"]),
701
+ n(y) ? (F(), w(P(a.value), K(Y({ key: 1 }, {
702
+ gateway: e.value.find((k) => k.paymentGateway === n(y)),
703
+ onDelete: V,
704
+ onUpdate: i
705
+ })), null, 16)) : S("", !0)
706
+ ], 64);
707
+ };
708
+ }
709
+ }), Ie = /* @__PURE__ */ _({
710
+ __name: "RestaurantSetting",
711
+ props: {
712
+ restaurantId: {
713
+ type: String,
714
+ required: !0
715
+ }
716
+ },
717
+ setup(l) {
718
+ const m = l, { tab: u } = E({
719
+ tab: "payment-gateway"
720
+ }), { isLoading: t, startAsyncCall: p } = R(!0), c = H(), y = b(), e = [
721
+ {
722
+ label: "Payment Gateway",
723
+ value: "payment-gateway",
724
+ icon: "assured_workload",
725
+ render: ye
726
+ }
727
+ ];
728
+ function i() {
729
+ p(async () => {
730
+ y.value = await J.readRestaurantById(m.restaurantId);
731
+ });
732
+ }
733
+ $(i);
734
+ const V = O(() => {
735
+ var d;
736
+ return (d = e.find((v) => v.value === u.value)) == null ? void 0 : d.render;
737
+ });
738
+ return (d, v) => {
739
+ var s;
740
+ const a = r("FmTabs");
741
+ return F(), w(z, {
742
+ title: `Restaurant (${(s = y.value) == null ? void 0 : s._id})`,
743
+ loading: n(t),
744
+ onBack: n(c).back
745
+ }, {
746
+ default: U(() => [
747
+ o(a, {
748
+ "model-value": n(u),
749
+ "onUpdate:modelValue": v[0] || (v[0] = (x) => B(u) ? u.value = x : null),
750
+ class: "mb-6",
751
+ items: e
752
+ }, null, 8, ["model-value"]),
753
+ n(u) && y.value ? (F(), w(P(V.value), K(Y({ key: 0 }, {
754
+ restaurant: y.value
755
+ })), null, 16)) : S("", !0)
756
+ ]),
757
+ _: 1
758
+ }, 8, ["title", "loading", "onBack"]);
759
+ };
760
+ }
761
+ });
762
+ export {
763
+ Ie as default
764
+ };