@feedmepos/mf-payment 1.10.7 → 1.10.8-dev

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 (91) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-Cb4w7Its.js → Actions.vue_vue_type_script_setup_true_lang-DRF8W4tg.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-B_-olj-A.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-4ApEVDHf.js} +3 -3
  3. package/dist/AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-C4xRm0d0.js +135 -0
  4. package/dist/{Chargeback-B5MXERko.js → Chargeback-pnoHxJba.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-DNrsl1TX.js → DocumentViewer.vue_vue_type_script_setup_true_lang-B4nIdf5-.js} +1 -1
  6. package/dist/{ExternalTerminal-bjMJ7qr-.js → ExternalTerminal-CqrRcbsp.js} +6 -6
  7. package/dist/{OnboardForm-BwFlXqV5.js → OnboardForm-BDv2pxL9.js} +6 -6
  8. package/dist/{OnboardForm-CE0weADC.js → OnboardForm-CYO3vK_8.js} +6 -6
  9. package/dist/{OnboardSubmission-C60-dPdV.js → OnboardSubmission-BUJZydpX.js} +6 -6
  10. package/dist/{OnboardSubmission-2s5PtLcm.js → OnboardSubmission-Cx_sPOVH.js} +3 -3
  11. package/dist/PaymentCheckout-DQM_kppH.js +1939 -0
  12. package/dist/{PayoutAccount-PGN4vUiE.js → PayoutAccount-DKWtIoTX.js} +7 -7
  13. package/dist/{PayoutAccount-DnE00Tpx.js → PayoutAccount-dwMtm1PL.js} +5 -5
  14. package/dist/{PayoutAccountSetting-UxgmC_It.js → PayoutAccountSetting-CWZD3Kwa.js} +6 -6
  15. package/dist/{Restaurant-DWs8l6IN.js → Restaurant-CV5n8389.js} +4 -4
  16. package/dist/{RestaurantSetting-CghN3Qij.js → RestaurantSetting-DsP4kGjM.js} +3 -3
  17. package/dist/{Settlement-DSAWgf1q.js → Settlement-58-ie3T1.js} +3 -3
  18. package/dist/{Settlement-BZG0nEhU.js → Settlement-Bt18kRNt.js} +4 -4
  19. package/dist/{SettlementTransactions-dSH6mKX9.js → SettlementTransactions-C7GhMTLQ.js} +5 -5
  20. package/dist/{SettlementTransactions-5l9xe_rQ.js → SettlementTransactions-Db1f9lYu.js} +5 -5
  21. package/dist/{Status.vue_vue_type_script_setup_true_lang-CSz0sfMv.js → Status.vue_vue_type_script_setup_true_lang-B9j6CfzS.js} +1 -1
  22. package/dist/{Terminal-CU70aAqI.js → Terminal-BuMIcbhv.js} +6 -6
  23. package/dist/TerminalSetting-2kwSwfKt.js +2779 -0
  24. package/dist/TerminalTemplate-aBZAYAKp.js +322 -0
  25. package/dist/TerminalTemplateSetting-BZlX7Xll.js +262 -0
  26. package/dist/{Transaction-9yHZiRAp.js → Transaction-Cy03QV60.js} +10 -10
  27. package/dist/{Transaction-CHL7HVtl.js → Transaction-lRZITPtN.js} +20 -19
  28. package/dist/{TransactionOld-Dk_5TVXm.js → TransactionOld-CmLbZyaP.js} +7 -7
  29. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-D4A7Hfk7.js → TransactionStatus.vue_vue_type_script_setup_true_lang-DSzil-ib.js} +1 -1
  30. package/dist/api/terminal/index.d.ts +1 -0
  31. package/dist/api/terminal-template/index.d.ts +15 -0
  32. package/dist/{app-WOQvK6eu.js → app-DKD_4d44.js} +389 -353
  33. package/dist/app.js +1 -1
  34. package/dist/assets-VX0DqpvG.js +96 -0
  35. package/dist/{grafana-BqnbcwyU.js → grafana-B_uCjmFj.js} +1 -1
  36. package/dist/{index-BRCt0Wjb.js → index-BpAx8sXI.js} +3073 -3030
  37. package/dist/{index-DiYIJH8n.js → index-C3AnskZH.js} +2 -2
  38. package/dist/index-CGmA3Z9Z.js +71 -0
  39. package/dist/{index-Jo4g2Fvl.js → index-Cf9xnlvp.js} +1 -1
  40. package/dist/{index-Cwbpxr-3.js → index-CnTRiFh5.js} +1 -1
  41. package/dist/{index-BSUOKl_R.js → index-DFNUFV3R.js} +1 -1
  42. package/dist/index-DFZ1vkMO.js +43 -0
  43. package/dist/{index-XucAJsGV.js → index-DO72hNKP.js} +1 -1
  44. package/dist/{index-BPTPINow.js → index-DZJaOOKJ.js} +1 -1
  45. package/dist/{index--Svzj_Uq.js → index-DbJwyim8.js} +1 -1
  46. package/dist/{index-Cc7BGx40.js → index-FScngz5X.js} +1 -1
  47. package/dist/{index.vue_vue_type_script_setup_true_lang-CQwRJloj.js → index.vue_vue_type_script_setup_true_lang-CH17wzq0.js} +1 -1
  48. package/dist/{onboard-submission-B7IRbUGm.js → onboard-submission-Cjp6Mugk.js} +1 -1
  49. package/dist/package.json +2 -2
  50. package/dist/{payout-account-v0EWhJ79.js → payout-account-CzCmFwEa.js} +3 -3
  51. package/dist/style.css +1 -1
  52. package/dist/tsconfig.app.tsbuildinfo +1 -1
  53. package/dist/useQuery-Cn_nXHMC.js +375 -0
  54. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +4 -4
  55. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +4 -4
  56. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +4 -4
  57. package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  58. package/dist/views/admin/payout-account/tabs/gateway/BeamGateway.vue.d.ts +2 -2
  59. package/dist/views/admin/payout-account/tabs/gateway/DigioGateway.vue.d.ts +2 -2
  60. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  61. package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +4 -4
  62. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  63. package/dist/views/admin/payout-account/tabs/gateway/TyroGateway.vue.d.ts +2 -2
  64. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  65. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  66. package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +4 -4
  67. package/dist/views/admin/restaurant/tabs/gateway/BeamGateway.vue.d.ts +4 -4
  68. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +4 -4
  69. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +8 -8
  70. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +8 -8
  71. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +4 -4
  72. package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +6 -6
  73. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +6 -6
  74. package/dist/views/admin/restaurant/tabs/gateway/MaybankGateway.vue.d.ts +6 -6
  75. package/dist/views/admin/restaurant/tabs/gateway/MonetapayGateway.vue.d.ts +6 -6
  76. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +8 -8
  77. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +6 -6
  78. package/dist/views/admin/terminal/TerminalApplyTemplateDialog.vue.d.ts +6 -0
  79. package/dist/views/admin/terminal/TerminalSaveTemplateDialog.vue.d.ts +2 -0
  80. package/dist/views/admin/terminal-template/TerminalTemplate.vue.d.ts +2 -0
  81. package/dist/views/admin/terminal-template/TerminalTemplateSetting.vue.d.ts +12 -0
  82. package/dist/views/admin/terminal-template/TerminalTemplateSideSheet.vue.d.ts +174 -0
  83. package/dist/views/admin/terminal-template/cell/Actions.vue.d.ts +12 -0
  84. package/dist/views/admin/terminal-template/cell/Default.vue.d.ts +5 -0
  85. package/dist/views/admin/terminal-template/tabs/EcrGateways.vue.d.ts +104 -0
  86. package/dist/views/admin/terminal-template/tabs/Information.vue.d.ts +95 -0
  87. package/package.json +2 -2
  88. package/dist/AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-KddyORH2.js +0 -505
  89. package/dist/TerminalSetting-Bc6HJqCW.js +0 -4521
  90. package/dist/assets-B_Ilda1K.js +0 -96
  91. package/dist/index-BR7n0dkV.js +0 -63
@@ -0,0 +1,322 @@
1
+ import { defineComponent as D, resolveComponent as d, openBlock as g, createElementBlock as U, createVNode as m, createElementVNode as x, useModel as Y, ref as p, watch as N, createBlock as F, withCtx as E, unref as r, createCommentVNode as K, mergeModels as $, isRef as j, h as I } from "vue";
2
+ import { h as z } from "./moment-h96o7c8I.js";
3
+ import { useRouter as P } from "vue-router";
4
+ import { u as q } from "./index-Cf9xnlvp.js";
5
+ import { _ as H } from "./index.vue_vue_type_script_setup_true_lang-CH17wzq0.js";
6
+ import { _ as O } from "./AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js";
7
+ import { useDialog as L, useSnackbar as Q } from "@feedmepos/ui-library";
8
+ import { t as S } from "./index-DFZ1vkMO.js";
9
+ import { z as A, a as C } from "./validator-CTlVogBQ.js";
10
+ import { _ as G } from "./AdminBusinessSelector.vue_vue_type_script_setup_true_lang-4ApEVDHf.js";
11
+ import { p as J } from "./index-BpAx8sXI.js";
12
+ import { u as M } from "./error-K1CakhA9.js";
13
+ import { w as W } from "./Modal-DB8M9o1T.js";
14
+ const X = { class: "flex items-center justify-center" }, Z = /* @__PURE__ */ D({
15
+ __name: "Actions",
16
+ props: {
17
+ data: {}
18
+ },
19
+ emits: ["edit", "delete"],
20
+ setup(b, { emit: u }) {
21
+ const l = u;
22
+ return (T, n) => {
23
+ const h = d("FmButton");
24
+ return g(), U("div", X, [
25
+ m(h, {
26
+ variant: "plain",
27
+ "prepend-icon": "edit",
28
+ onClick: n[0] || (n[0] = (s) => {
29
+ s.stopPropagation(), l("edit");
30
+ })
31
+ }),
32
+ m(h, {
33
+ variant: "plain",
34
+ "prepend-icon": "delete",
35
+ onClick: n[1] || (n[1] = (s) => {
36
+ s.stopPropagation(), l("delete");
37
+ })
38
+ })
39
+ ]);
40
+ };
41
+ }
42
+ }), ee = {
43
+ key: 0,
44
+ class: "flex items-center gap-2"
45
+ }, te = {
46
+ key: 1,
47
+ class: "text-fm-color-neutral-gray-500"
48
+ }, le = /* @__PURE__ */ D({
49
+ __name: "Default",
50
+ props: {
51
+ data: { type: Boolean }
52
+ },
53
+ setup(b) {
54
+ return (u, l) => b.data ? (g(), U("div", ee, [...l[0] || (l[0] = [
55
+ x("div", { class: "w-[8px] h-[8px] rounded-full shrink-0 bg-green-400" }, null, -1),
56
+ x("div", null, "Default", -1)
57
+ ])])) : (g(), U("div", te, "—"));
58
+ }
59
+ }), ae = /* @__PURE__ */ D({
60
+ __name: "TerminalTemplateSideSheet",
61
+ props: /* @__PURE__ */ $({
62
+ template: {
63
+ type: Object
64
+ }
65
+ }, {
66
+ modelValue: { type: Boolean, default: !1 },
67
+ modelModifiers: {}
68
+ }),
69
+ emits: /* @__PURE__ */ $(["submit"], ["update:modelValue"]),
70
+ setup(b, { emit: u }) {
71
+ const l = b, T = u, n = Y(b, "modelValue"), h = p(), s = p(""), c = p(""), f = p(""), y = p(), V = p(!1), w = J.FdoTerminalTemplateDeviceType.options.map((_) => ({
72
+ label: _,
73
+ value: _
74
+ }));
75
+ N(n, (_) => {
76
+ var e, t, a, v, o;
77
+ _ && (s.value = ((e = l.template) == null ? void 0 : e.name) ?? "", c.value = ((t = l.template) == null ? void 0 : t.description) ?? "", f.value = ((a = l.template) == null ? void 0 : a.businessId) ?? "", y.value = (v = l.template) == null ? void 0 : v.deviceType, V.value = ((o = l.template) == null ? void 0 : o.isDefault) ?? !1);
78
+ });
79
+ function k() {
80
+ T("submit", {
81
+ name: s.value,
82
+ description: c.value,
83
+ businessId: f.value,
84
+ deviceType: y.value,
85
+ isDefault: V.value
86
+ }), n.value = !1;
87
+ }
88
+ return (_, e) => {
89
+ const t = d("FmSelect"), a = d("FmTextField"), v = d("FmSwitch"), o = d("FmButton"), B = d("FmForm"), R = d("FmSideSheet");
90
+ return g(), F(R, {
91
+ modelValue: n.value,
92
+ "onUpdate:modelValue": e[5] || (e[5] = (i) => n.value = i),
93
+ header: l.template ? "Update Setting Template" : "Create Setting Template",
94
+ "close-button": ""
95
+ }, {
96
+ default: E(() => [
97
+ m(B, {
98
+ ref: h.value,
99
+ class: "flex flex-col gap-16 px-4 py-6",
100
+ onValidationSuccess: k
101
+ }, {
102
+ default: E(() => [
103
+ l.template ? K("", !0) : (g(), F(G, {
104
+ key: 0,
105
+ modelValue: f.value,
106
+ "onUpdate:modelValue": e[0] || (e[0] = (i) => f.value = i),
107
+ label: "Business",
108
+ "search-placeholder": "Search businesses",
109
+ rules: r(A)(r(C).string().min(1, "Business is required"))
110
+ }, null, 8, ["modelValue", "rules"])),
111
+ l.template ? K("", !0) : (g(), F(t, {
112
+ key: 1,
113
+ modelValue: y.value,
114
+ "onUpdate:modelValue": e[1] || (e[1] = (i) => y.value = i),
115
+ label: "Device Type",
116
+ items: r(w),
117
+ rules: r(A)(r(C).string().min(1, "Device type is required"))
118
+ }, null, 8, ["modelValue", "items", "rules"])),
119
+ m(a, {
120
+ modelValue: s.value,
121
+ "onUpdate:modelValue": e[2] || (e[2] = (i) => s.value = i),
122
+ label: "Template Name",
123
+ rules: r(A)(r(C).string().min(1))
124
+ }, null, 8, ["modelValue", "rules"]),
125
+ m(a, {
126
+ modelValue: c.value,
127
+ "onUpdate:modelValue": e[3] || (e[3] = (i) => c.value = i),
128
+ label: "Description",
129
+ "label-mark": "optional"
130
+ }, null, 8, ["modelValue"]),
131
+ m(v, {
132
+ modelValue: V.value,
133
+ "onUpdate:modelValue": e[4] || (e[4] = (i) => V.value = i),
134
+ label: "Default",
135
+ "label-info": "Applied automatically when a new device of this type binds for this business."
136
+ }, null, 8, ["modelValue"]),
137
+ m(o, {
138
+ type: "submit",
139
+ label: l.template ? "Update" : "Create"
140
+ }, null, 8, ["label"])
141
+ ]),
142
+ _: 1
143
+ }, 512)
144
+ ]),
145
+ _: 1
146
+ }, 8, ["modelValue", "header"]);
147
+ };
148
+ }
149
+ }), se = { class: "flex justify-between mb-6 items-center" }, oe = { class: "flex space-x-4" }, ne = { class: "flex space-x-4" }, Te = /* @__PURE__ */ D({
150
+ __name: "TerminalTemplate",
151
+ setup(b) {
152
+ const u = p(), { searchKey: l } = q({
153
+ searchKey: ""
154
+ });
155
+ let T;
156
+ N(l, async () => {
157
+ T && clearTimeout(T), T = setTimeout(() => {
158
+ var e;
159
+ return (e = u.value) == null ? void 0 : e.reset();
160
+ }, 700);
161
+ });
162
+ const n = P(), h = L(), s = Q(), c = p(!1), f = p();
163
+ function y(e) {
164
+ f.value = e, c.value = !0;
165
+ }
166
+ async function V(e) {
167
+ var a;
168
+ const t = f.value;
169
+ try {
170
+ t ? await S.updateById(t._id, {
171
+ name: e.name,
172
+ description: e.description,
173
+ isDefault: e.isDefault
174
+ }) : await S.create(e), (a = u.value) == null || a.reset(), s.open({
175
+ type: "success",
176
+ message: t ? "Setting template updated successfully." : "Setting template created successfully."
177
+ });
178
+ } catch (v) {
179
+ s.open({
180
+ type: "error",
181
+ title: t ? "Error occurs when update setting template" : "Error occurs when create setting template",
182
+ message: M(v)
183
+ });
184
+ }
185
+ }
186
+ async function w(e) {
187
+ W(
188
+ h,
189
+ "Delete Setting Template",
190
+ "Are you sure to delete this setting template? Terminals already configured from it are not affected.",
191
+ async () => {
192
+ var t;
193
+ try {
194
+ await S.delete(e), (t = u.value) == null || t.reset(), s.open({
195
+ type: "success",
196
+ message: "Setting template deleted successfully."
197
+ });
198
+ } catch (a) {
199
+ s.open({
200
+ type: "error",
201
+ title: "Error occurs when delete setting template",
202
+ message: M(a)
203
+ });
204
+ }
205
+ }
206
+ );
207
+ }
208
+ const k = function(e) {
209
+ var t;
210
+ return {
211
+ id: e._id,
212
+ name: e.name,
213
+ business: ((t = e.business) == null ? void 0 : t.name) ?? e.businessId,
214
+ deviceType: e.deviceType,
215
+ isDefault: e.isDefault,
216
+ updatedAt: z(e.updatedAt).format("YYYY-MM-DD HH:mm:ss")
217
+ };
218
+ }, _ = [
219
+ {
220
+ accessorKey: "name",
221
+ header: () => "Name",
222
+ meta: {
223
+ textAlign: "left"
224
+ }
225
+ },
226
+ {
227
+ accessorKey: "business",
228
+ header: () => "Business",
229
+ meta: {
230
+ textAlign: "left"
231
+ }
232
+ },
233
+ {
234
+ accessorKey: "deviceType",
235
+ header: () => "Device Type",
236
+ meta: {
237
+ textAlign: "left"
238
+ }
239
+ },
240
+ {
241
+ accessorKey: "isDefault",
242
+ header: () => "Default",
243
+ meta: {
244
+ textAlign: "left"
245
+ },
246
+ cell: ({ cell: e }) => I(le, { data: e.getValue() })
247
+ },
248
+ {
249
+ accessorKey: "updatedAt",
250
+ header: () => "Last Updated",
251
+ meta: {
252
+ textAlign: "left"
253
+ }
254
+ },
255
+ {
256
+ accessorKey: "id",
257
+ header: () => "Actions",
258
+ meta: {
259
+ textAlign: "center"
260
+ },
261
+ cell: ({ row: e }) => {
262
+ var a;
263
+ const t = (a = u.value) == null ? void 0 : a.pageData().at(e.index);
264
+ return I(Z, {
265
+ data: t,
266
+ onEdit: () => y(t),
267
+ onDelete: () => w(t._id)
268
+ });
269
+ }
270
+ }
271
+ ];
272
+ return (e, t) => {
273
+ const a = d("FmSearch"), v = d("FmButton");
274
+ return g(), F(O, {
275
+ title: "Templates",
276
+ loading: !1
277
+ }, {
278
+ default: E(() => [
279
+ x("div", se, [
280
+ x("div", oe, [
281
+ m(a, {
282
+ "model-value": r(l),
283
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => j(l) ? l.value = o : null),
284
+ class: "mr-8",
285
+ label: "Search",
286
+ placeholder: "Search ..."
287
+ }, null, 8, ["model-value"])
288
+ ]),
289
+ x("div", ne, [
290
+ m(v, {
291
+ label: "Create",
292
+ icon: "add",
293
+ onClick: t[1] || (t[1] = () => y())
294
+ })
295
+ ])
296
+ ]),
297
+ m(H, {
298
+ ref_key: "controller",
299
+ ref: u,
300
+ "column-defs": _,
301
+ "rows-defs": k,
302
+ paginate: (o, B) => r(S).read({ searchKey: r(l), limit: o, cursor: B }),
303
+ onRowClick: t[2] || (t[2] = (o) => r(n).push({
304
+ name: "mf-payment-admin.terminal-template-setting",
305
+ params: { templateId: o._id }
306
+ }))
307
+ }, null, 8, ["paginate"]),
308
+ m(ae, {
309
+ modelValue: c.value,
310
+ "onUpdate:modelValue": t[3] || (t[3] = (o) => c.value = o),
311
+ template: f.value,
312
+ onSubmit: V
313
+ }, null, 8, ["modelValue", "template"])
314
+ ]),
315
+ _: 1
316
+ });
317
+ };
318
+ }
319
+ });
320
+ export {
321
+ Te as default
322
+ };
@@ -0,0 +1,262 @@
1
+ import { defineComponent as G, openBlock as b, createElementBlock as F, Fragment as H, createElementVNode as l, createTextVNode as f, toDisplayString as v, computed as T, ref as L, watch as j, onMounted as $, resolveComponent as O, renderList as q, unref as y, createVNode as B, createBlock as D, withCtx as K, isRef as z, resolveDynamicComponent as Q, normalizeProps as W, mergeProps as J, createCommentVNode as X } from "vue";
2
+ import { useRouter as Z } from "vue-router";
3
+ import { t as x } from "./index-DFZ1vkMO.js";
4
+ import { e as n, u as ee } from "./index-BpAx8sXI.js";
5
+ import { _ as te } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
6
+ import { u as ne } from "./index-Cf9xnlvp.js";
7
+ import { useSnackbar as ae } from "@feedmepos/ui-library";
8
+ import { useCoreStore as le, useI18n as re } from "@feedmepos/mf-common";
9
+ import { u as oe } from "./error-K1CakhA9.js";
10
+ import { g as se } from "./assets-VX0DqpvG.js";
11
+ import { P as ie } from "./PaymentCheckout-DQM_kppH.js";
12
+ const ue = /* @__PURE__ */ G({
13
+ __name: "Information",
14
+ props: {
15
+ template: {
16
+ type: Object,
17
+ required: !0
18
+ }
19
+ },
20
+ setup(s) {
21
+ return (u, e) => {
22
+ var w;
23
+ return b(), F(H, null, [
24
+ e[0] || (e[0] = l("b", null, "Name", -1)),
25
+ f(": " + v(s.template.name), 1),
26
+ e[1] || (e[1] = l("br", null, null, -1)),
27
+ e[2] || (e[2] = l("b", null, "Description", -1)),
28
+ f(": " + v(s.template.description || "-"), 1),
29
+ e[3] || (e[3] = l("br", null, null, -1)),
30
+ e[4] || (e[4] = l("b", null, "Business", -1)),
31
+ f(": " + v(((w = s.template.business) == null ? void 0 : w.name) ?? s.template.businessId), 1),
32
+ e[5] || (e[5] = l("br", null, null, -1)),
33
+ e[6] || (e[6] = l("b", null, "Device Type", -1)),
34
+ f(": " + v(s.template.deviceType), 1),
35
+ e[7] || (e[7] = l("br", null, null, -1)),
36
+ e[8] || (e[8] = l("b", null, "Default", -1)),
37
+ f(": " + v(s.template.isDefault ? "Yes" : "No"), 1),
38
+ e[9] || (e[9] = l("br", null, null, -1))
39
+ ], 64);
40
+ };
41
+ }
42
+ }), me = { class: "flex flex-col gap-16 max-w-[560px]" }, ce = { class: "flex items-center gap-12" }, de = ["src"], pe = { class: "font-medium" }, ge = { class: "mt-16" }, ye = /* @__PURE__ */ G({
43
+ __name: "EcrGateways",
44
+ props: {
45
+ template: {
46
+ type: Object,
47
+ required: !0
48
+ },
49
+ onUpdate: {
50
+ type: Function,
51
+ required: !0
52
+ }
53
+ },
54
+ setup(s) {
55
+ const u = s, e = [
56
+ { gateway: "FeedMe", field: "ecrs", label: "FeedMe Terminal", region: [n.F_COUNTRY.enum.MY, n.F_COUNTRY.enum.SG, n.F_COUNTRY.enum.TH, n.F_COUNTRY.enum.PK, n.F_COUNTRY.enum.ID] },
57
+ { gateway: "Ghl", field: "ecrs", label: "GHL Terminal", region: [n.F_COUNTRY.enum.MY] },
58
+ { gateway: "Beam", field: "ecrs", label: "Beam Terminal", region: [n.F_COUNTRY.enum.TH] },
59
+ { gateway: "Bri", field: "ecrs", label: "BRI Terminal", region: [n.F_COUNTRY.enum.ID] },
60
+ { gateway: "Maybank", field: "ecrIntegrations", label: "ITB Maybank", region: [n.F_COUNTRY.enum.MY] },
61
+ { gateway: "Maybank2", field: "ecrIntegrations", label: "PMA Maybank", region: [n.F_COUNTRY.enum.MY] },
62
+ { gateway: "Maybank3", field: "ecrIntegrations", label: "Paysys Maybank", region: [n.F_COUNTRY.enum.MY] },
63
+ { gateway: "Hlbb", field: "ecrIntegrations", label: "Paysys HLBB", region: [n.F_COUNTRY.enum.MY] },
64
+ { gateway: "Ghl2", field: "ecrIntegrations", label: "GHL2", region: [n.F_COUNTRY.enum.MY] },
65
+ { gateway: "Revenue", field: "ecrIntegrations", label: "Revenue PBB", region: [n.F_COUNTRY.enum.MY] },
66
+ { gateway: "Pbb", field: "ecrIntegrations", label: "PBB", region: [n.F_COUNTRY.enum.MY] },
67
+ { gateway: "Nets", field: "ecrIntegrations", label: "Nets", region: [n.F_COUNTRY.enum.SG] },
68
+ { gateway: "GlobalPayments", field: "ecrIntegrations", label: "GPAP", region: [n.F_COUNTRY.enum.SG] },
69
+ { gateway: "Kbank", field: "ecrIntegrations", label: "KBank", region: [n.F_COUNTRY.enum.TH] },
70
+ { gateway: "Ghl3", field: "ecrIntegrations", label: "GHL", region: [n.F_COUNTRY.enum.TH] },
71
+ { gateway: "Oma", field: "ecrIntegrations", label: "OMA", region: [n.F_COUNTRY.enum.PK] }
72
+ ], w = le().currentCountry, Y = T(
73
+ () => e.filter(
74
+ (r) => r.region.includes(w.value ?? n.F_COUNTRY.enum.MY)
75
+ )
76
+ ), C = (r) => u.template.settings[r] ?? [], I = T(
77
+ () => [...C("ecrs"), ...C("ecrIntegrations")].map((r) => r.gateway)
78
+ ), m = L([]), t = () => m.value = [...I.value];
79
+ j(() => u.template, t), $(t);
80
+ const M = (r) => m.value.includes(r);
81
+ function U(r, i) {
82
+ m.value = i ? [...m.value, r] : m.value.filter((p) => p !== r);
83
+ }
84
+ const P = T(
85
+ () => [...m.value].sort().join() !== [...I.value].sort().join()
86
+ );
87
+ function N(r) {
88
+ return e.filter(
89
+ (i) => i.field === r && m.value.includes(i.gateway)
90
+ ).map(
91
+ (i) => C(r).find((p) => p.gateway === i.gateway) ?? {
92
+ gateway: i.gateway
93
+ }
94
+ );
95
+ }
96
+ async function R() {
97
+ await u.onUpdate({
98
+ ecrs: N("ecrs"),
99
+ ecrIntegrations: N("ecrIntegrations")
100
+ });
101
+ }
102
+ return (r, i) => {
103
+ const p = O("FmSwitch"), o = O("FmButton");
104
+ return b(), F("div", me, [
105
+ (b(!0), F(H, null, q(Y.value, (a) => (b(), F("div", {
106
+ key: a.gateway,
107
+ class: "flex items-center justify-between border rounded-lg px-16 py-12"
108
+ }, [
109
+ l("div", ce, [
110
+ l("img", {
111
+ class: "rounded-md border-transparent w-[32px] h-[32px]",
112
+ src: y(se)(a.gateway.toUpperCase())
113
+ }, null, 8, de),
114
+ l("span", pe, v(a.label), 1)
115
+ ]),
116
+ B(p, {
117
+ "model-value": M(a.gateway),
118
+ "onUpdate:modelValue": (c) => U(a.gateway, c)
119
+ }, null, 8, ["model-value", "onUpdate:modelValue"])
120
+ ]))), 128)),
121
+ l("div", ge, [
122
+ B(o, {
123
+ variant: "primary",
124
+ label: "Save",
125
+ icon: "save",
126
+ disabled: !P.value,
127
+ onclick: R
128
+ }, null, 8, ["disabled"])
129
+ ])
130
+ ]);
131
+ };
132
+ }
133
+ }), fe = { class: "mb-6 flex items-center gap-8 rounded-md bg-fm-color-neutral-gray-100 px-16 py-12" }, ve = { class: "fm-typo-en-body-md-400" }, be = {
134
+ key: 0,
135
+ class: "text-fm-color-neutral-gray-500"
136
+ }, Oe = /* @__PURE__ */ G({
137
+ __name: "TerminalTemplateSetting",
138
+ props: {
139
+ templateId: {
140
+ type: String,
141
+ required: !0
142
+ }
143
+ },
144
+ setup(s) {
145
+ const u = s, { tab: e } = ne({
146
+ tab: "information"
147
+ }), { isLoading: w, startAsyncCall: Y } = ee(!0), C = Z(), I = ae(), { t: m } = re(), t = L(), M = T(
148
+ () => {
149
+ var o, a, c, g, d, _, k;
150
+ return {
151
+ _id: u.templateId,
152
+ referenceId: "",
153
+ name: (o = t.value) == null ? void 0 : o.name,
154
+ status: "Active",
155
+ securityCode: "",
156
+ deviceType: (a = t.value) == null ? void 0 : a.deviceType,
157
+ ecrs: ((c = t.value) == null ? void 0 : c.settings.ecrs) ?? [],
158
+ gateways: [],
159
+ qrIntegrations: [],
160
+ ecrIntegrations: ((g = t.value) == null ? void 0 : g.settings.ecrIntegrations) ?? [],
161
+ paymentCheckouts: ((d = t.value) == null ? void 0 : d.settings.paymentCheckouts) ?? [],
162
+ createdAt: (_ = t.value) == null ? void 0 : _.createdAt,
163
+ updatedAt: (k = t.value) == null ? void 0 : k.updatedAt
164
+ };
165
+ }
166
+ );
167
+ async function U(o) {
168
+ Y(async () => {
169
+ try {
170
+ await x.updateById(u.templateId, { settings: o }), t.value = await x.readById(u.templateId), I.open({
171
+ type: "success",
172
+ message: "Setting template updated successfully"
173
+ });
174
+ } catch (a) {
175
+ I.open({
176
+ type: "error",
177
+ title: "Error occurs when update setting template",
178
+ message: oe(a)
179
+ });
180
+ }
181
+ });
182
+ }
183
+ async function P(o) {
184
+ var a;
185
+ await U({
186
+ ...o,
187
+ paymentCheckouts: ((a = t.value) == null ? void 0 : a.settings.paymentCheckouts) ?? []
188
+ });
189
+ }
190
+ async function N(o, a) {
191
+ var c, g, d;
192
+ await U({
193
+ ecrs: ((c = t.value) == null ? void 0 : c.settings.ecrs) ?? [],
194
+ ecrIntegrations: ((g = t.value) == null ? void 0 : g.settings.ecrIntegrations) ?? [],
195
+ paymentCheckouts: a ?? ((d = t.value) == null ? void 0 : d.settings.paymentCheckouts) ?? []
196
+ });
197
+ }
198
+ const R = [
199
+ {
200
+ label: "Information",
201
+ value: "information",
202
+ icon: "overview",
203
+ render: ue
204
+ },
205
+ {
206
+ label: "ECR Gateway",
207
+ value: "ecr",
208
+ icon: "point_of_sale",
209
+ render: ye
210
+ },
211
+ {
212
+ label: "Payment Checkout",
213
+ value: "payment-checkout",
214
+ icon: "tune",
215
+ render: ie
216
+ }
217
+ ], r = T(() => R.find((o) => o.value === e.value)), i = T(() => e.value === "information" ? { template: t.value } : e.value === "ecr" ? { template: t.value, onUpdate: P } : { terminal: M.value, onUpdate: N });
218
+ async function p() {
219
+ Y(async () => {
220
+ t.value = await x.readById(u.templateId);
221
+ });
222
+ }
223
+ return $(p), (o, a) => {
224
+ var d, _, k, S;
225
+ const c = O("FmIcon"), g = O("FmTabs");
226
+ return b(), D(te, {
227
+ title: ((d = t.value) == null ? void 0 : d.name) ?? "",
228
+ description: `${(_ = t.value) == null ? void 0 : _.deviceType} · ${((S = (k = t.value) == null ? void 0 : k.business) == null ? void 0 : S.name) ?? ""}`,
229
+ loading: y(w),
230
+ onBack: y(C).back
231
+ }, {
232
+ default: K(() => {
233
+ var h, A, E;
234
+ return [
235
+ l("div", fe, [
236
+ B(c, {
237
+ name: "info",
238
+ class: "shrink-0"
239
+ }),
240
+ l("span", ve, v(y(m)("payment.terminal_template.scope_info")), 1)
241
+ ]),
242
+ B(g, {
243
+ "model-value": y(e),
244
+ "onUpdate:modelValue": a[0] || (a[0] = (V) => z(e) ? e.value = V : null),
245
+ class: "mb-6",
246
+ items: R
247
+ }, null, 8, ["model-value"]),
248
+ y(e) === "payment-checkout" && !((A = (h = t.value) == null ? void 0 : h.settings.paymentCheckouts) != null && A.length) ? (b(), F("div", be, [...a[1] || (a[1] = [
249
+ f(" Enable an ECR gateway, or use ", -1),
250
+ l("b", null, "Save as Template", -1),
251
+ f(" on a POS or Kiosk to capture its checkout list. ", -1)
252
+ ])])) : y(e) && t.value ? (b(), D(Q((E = r.value) == null ? void 0 : E.render), W(J({ key: 1 }, i.value)), null, 16)) : X("", !0)
253
+ ];
254
+ }),
255
+ _: 1
256
+ }, 8, ["title", "description", "loading", "onBack"]);
257
+ };
258
+ }
259
+ });
260
+ export {
261
+ Oe as default
262
+ };
@@ -1,24 +1,24 @@
1
1
  import { defineComponent as w, ref as x, watch as k, onMounted as Q, resolveComponent as h, unref as n, openBlock as R, createBlock as O, createElementBlock as Y, createVNode as d, withCtx as M, createElementVNode as N, Fragment as H, renderList as W, createTextVNode as X, toDisplayString as Z, onBeforeUnmount as ee, isRef as F, h as I } from "vue";
2
- import { t as P } from "./index-XucAJsGV.js";
2
+ import { t as P } from "./index-DO72hNKP.js";
3
3
  import { h as G } from "./moment-h96o7c8I.js";
4
4
  import { useI18n as j, useCoreStore as J } from "@feedmepos/mf-common";
5
5
  import { _ as te } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
6
- import { t as ae, a as ne, _ as re } from "./TransactionStatus.vue_vue_type_script_setup_true_lang-D4A7Hfk7.js";
7
- import { u as se } from "./index-Jo4g2Fvl.js";
6
+ import { t as ae, a as ne, _ as re } from "./TransactionStatus.vue_vue_type_script_setup_true_lang-DSzil-ib.js";
7
+ import { u as se } from "./index-Cf9xnlvp.js";
8
8
  import { _ as oe } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
9
9
  import { _ as le } from "./SelectAll.vue_vue_type_script_setup_true_lang-BNZTqdoF.js";
10
10
  import { _ as ie } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-CDjdQf-E.js";
11
- import { p as ce } from "./index--Svzj_Uq.js";
12
- import { t as ue } from "./index-BR7n0dkV.js";
13
- import { u as me, p as D } from "./index-BRCt0Wjb.js";
11
+ import { p as ce } from "./index-DbJwyim8.js";
12
+ import { t as ue } from "./index-CGmA3Z9Z.js";
13
+ import { u as me, p as D } from "./index-BpAx8sXI.js";
14
14
  import { useSnackbar as de, useDialog as pe } from "@feedmepos/ui-library";
15
- import { _ as ye, a as fe, b as _e } from "./Actions.vue_vue_type_script_setup_true_lang-Cb4w7Its.js";
16
- import { g as ge } from "./grafana-BqnbcwyU.js";
15
+ import { _ as ye, a as fe, b as _e } from "./Actions.vue_vue_type_script_setup_true_lang-DRF8W4tg.js";
16
+ import { g as ge } from "./grafana-B_uCjmFj.js";
17
17
  import { w as z } from "./Modal-DB8M9o1T.js";
18
18
  import { u as L } from "./error-K1CakhA9.js";
19
- import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-CQwRJloj.js";
19
+ import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-CH17wzq0.js";
20
20
  import { u as Te, a as ve } from "./index-n58-Qewm.js";
21
- import { h as q } from "./app-WOQvK6eu.js";
21
+ import { h as q } from "./app-DKD_4d44.js";
22
22
  const he = {
23
23
  key: 1,
24
24
  class: "inline-flex"