@feedmepos/mf-payment 1.7.5 → 1.7.6

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 (44) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-JYZcfqUo.js → Actions.vue_vue_type_script_setup_true_lang-DQR1_RpF.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-CQxYDlES.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-CHkrHNPF.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-K87PW1uK.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-BIvrqTNw.js} +2 -2
  4. package/dist/{Chargeback-CKeP0C3C.js → Chargeback-CAj9Jgcy.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-4cyCT01g.js → DocumentViewer.vue_vue_type_script_setup_true_lang-jTkg_too.js} +1 -1
  6. package/dist/{OnboardForm-BP_9VO_L.js → OnboardForm-DRoUPx01.js} +5 -5
  7. package/dist/{OnboardForm-zqjcD6iD.js → OnboardForm-v-95d-S1.js} +5 -5
  8. package/dist/{OnboardSubmission-Du8NpfFx.js → OnboardSubmission-C09-Ac_u.js} +5 -5
  9. package/dist/{OnboardSubmission-BlRpjm51.js → OnboardSubmission-ciBwl8NO.js} +2 -2
  10. package/dist/{PayoutAccount-waepqJrT.js → PayoutAccount-5ckNIseh.js} +7 -7
  11. package/dist/{PayoutAccount-DB93s4Bz.js → PayoutAccount-BIXgrxF8.js} +5 -5
  12. package/dist/PayoutAccountSetting-Bhg_rRvI.js +1943 -0
  13. package/dist/{Restaurant-DMbTKWlj.js → Restaurant-CAkspzgz.js} +4 -4
  14. package/dist/{RestaurantSetting-CAZlf2Vs.js → RestaurantSetting-D-joRYbL.js} +3 -3
  15. package/dist/{Settlement-Cr6LJOel.js → Settlement-DCBsf6-S.js} +3 -3
  16. package/dist/{Settlement-BT-qtZX9.js → Settlement-tz1oE3Qt.js} +4 -4
  17. package/dist/{SettlementTransactions-BDjZmZjE.js → SettlementTransactions-B2IUyVs5.js} +4 -4
  18. package/dist/{SettlementTransactions-DoMTS35M.js → SettlementTransactions-YSNYN3HM.js} +4 -4
  19. package/dist/{Status.vue_vue_type_script_setup_true_lang-CZZiQMYe.js → Status.vue_vue_type_script_setup_true_lang-CpoEkJUQ.js} +1 -1
  20. package/dist/{Terminal-BcWccOla.js → Terminal-V45vMcvG.js} +5 -5
  21. package/dist/{TerminalSetting-DE0v-4-p.js → TerminalSetting-DtSt5q66.js} +4 -4
  22. package/dist/{Transaction-Cc4utrzZ.js → Transaction-8K6WJBsa.js} +10 -10
  23. package/dist/{Transaction-CVVGm-I8.js → Transaction-BJ6-2G9v.js} +10 -10
  24. package/dist/{TransactionOld-BgafsXwW.js → TransactionOld-DNVGQ2ck.js} +7 -7
  25. package/dist/{app-Cs1GHhDd.js → app-DiZz8sPe.js} +212 -197
  26. package/dist/app.js +1 -1
  27. package/dist/{assets-eHLQjw1e.js → assets-DiH3EaF3.js} +1 -1
  28. package/dist/{grafana-SUvDElAd.js → grafana-Bou0e3nV.js} +1 -1
  29. package/dist/{index-DXAJfLCs.js → index-CTKrpHLR.js} +2 -2
  30. package/dist/{index-B247KQYg.js → index-CZ_b9Pch.js} +1 -1
  31. package/dist/{index-gCNUDOJw.js → index-CfsmsUeJ.js} +1 -1
  32. package/dist/{index-ClGv4aTb.js → index-DO4-_8Af.js} +1 -1
  33. package/dist/{index-DvPHBuEr.js → index-Da6Yh4Gu.js} +1 -1
  34. package/dist/{index-BPGQQPaG.js → index-DeT3z3Jr.js} +1 -1
  35. package/dist/{index-lovX0Huh.js → index-DjOUxa1H.js} +1 -1
  36. package/dist/{index-MMGPrDuq.js → index-LkcyucJ_.js} +1 -1
  37. package/dist/{index-Xn55a2pJ.js → index-yLXt4lrZ.js} +1 -1
  38. package/dist/{index.vue_vue_type_script_setup_true_lang-1b18Xw6F.js → index.vue_vue_type_script_setup_true_lang-BQSr_US-.js} +1 -1
  39. package/dist/package.json +1 -1
  40. package/dist/{payout-account-Doi16CAx.js → payout-account-DDudWzkA.js} +3 -3
  41. package/dist/tsconfig.app.tsbuildinfo +1 -1
  42. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +9 -0
  43. package/package.json +1 -1
  44. package/dist/PayoutAccountSetting-47b8bmqq.js +0 -1847
@@ -0,0 +1,1943 @@
1
+ import { defineComponent as M, ref as U, resolveComponent as y, openBlock as g, createElementBlock as G, Fragment as K, createElementVNode as s, createVNode as o, withCtx as k, createTextVNode as _, toDisplayString as q, unref as i, createBlock as w, createCommentVNode as E, reactive as ye, watch as le, computed as L, isRef as ae, h as J, onMounted as me, resolveDynamicComponent as ue, normalizeProps as se, mergeProps as re } from "vue";
2
+ import { p as Y } from "./index-DO4-_8Af.js";
3
+ import { u as ne, e as O } from "./index-Da6Yh4Gu.js";
4
+ import { _ as be } from "./Layout.vue_vue_type_script_setup_true_lang-BKIvkgA_.js";
5
+ import { useRouter as ve } from "vue-router";
6
+ import { u as oe } from "./index-CfsmsUeJ.js";
7
+ import { _ as Q, P as ee } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-jTkg_too.js";
8
+ import { h as fe } from "./moment-h96o7c8I.js";
9
+ import { d as te } from "./index-yLXt4lrZ.js";
10
+ import { useSnackbar as W, useDialogChild as ge, useDialog as de, components as Fe } from "@feedmepos/ui-library";
11
+ import { u as Z } from "./error-K1CakhA9.js";
12
+ import { P as xe } from "./payout-account-DDudWzkA.js";
13
+ import { s as X, o as ke, z as N, a as h } from "./validator-CTlVogBQ.js";
14
+ import { _ as we } from "./TextInputDialog.vue_vue_type_script_setup_true_lang-C3AeZqwO.js";
15
+ import { useCoreStore as pe } from "@feedmepos/mf-common";
16
+ const Ve = { class: "flex gap-16 mb-6" }, Ae = { class: "flex gap-16 mb-6" }, Se = { class: "flex justify-between items-center mb-6" }, Ne = { class: "flex gap-4" }, Ce = { class: "flex gap-4 mt-4" }, Ue = /* @__PURE__ */ M({
17
+ __name: "Information",
18
+ props: {
19
+ payoutAccount: {
20
+ type: Object,
21
+ required: !0
22
+ },
23
+ onUpdate: {
24
+ type: Function,
25
+ required: !0
26
+ }
27
+ },
28
+ setup(a) {
29
+ const l = a, e = W(), v = U(!1), u = U(!1), t = U(), c = U(""), F = (d) => {
30
+ const n = new FileReader();
31
+ return new Promise((S) => {
32
+ n.onload = (A) => {
33
+ var C;
34
+ return S((C = A.target) == null ? void 0 : C.result);
35
+ }, n.readAsDataURL(d);
36
+ });
37
+ }, f = async (d) => {
38
+ t.value = d, c.value = d ? await F(d) : "";
39
+ }, m = () => {
40
+ u.value = !1, t.value = void 0, c.value = "";
41
+ }, b = () => {
42
+ t.value = void 0, c.value = "";
43
+ }, r = async (d) => {
44
+ var S;
45
+ const n = l.payoutAccount.businessId || l.payoutAccount.store.id;
46
+ return ((S = l.payoutAccount.store) == null ? void 0 : S.event) === "ORDERING" ? await te.adminUpload(
47
+ `restaurant/${l.payoutAccount.store.id}/exterior/photo`,
48
+ d,
49
+ n,
50
+ l.payoutAccount.store.id
51
+ ) : await te.adminUpload(
52
+ `business/${n}/exterior/photo`,
53
+ d,
54
+ n,
55
+ void 0
56
+ );
57
+ }, p = async () => {
58
+ if (t.value)
59
+ try {
60
+ v.value = !0;
61
+ const d = await r(t.value), n = {
62
+ ...l.payoutAccount,
63
+ store: {
64
+ ...l.payoutAccount.store,
65
+ exteriorPhoto: d
66
+ }
67
+ };
68
+ await l.onUpdate(n), u.value = !1, t.value = void 0, c.value = "", e.open({ type: "success", title: "Exterior photo updated successfully" });
69
+ } catch (d) {
70
+ e.open({ type: "error", title: "Failed to update exterior photo", message: Z(d) });
71
+ } finally {
72
+ v.value = !1;
73
+ }
74
+ };
75
+ return (d, n) => {
76
+ var T, V, x, $;
77
+ const S = y("FmCardHeader"), A = y("FmCardSection"), C = y("FmCard"), I = y("FmButton"), D = y("FmDropField");
78
+ return g(), G(K, null, [
79
+ s("div", Ve, [
80
+ o(C, {
81
+ horizontal: "",
82
+ class: "flex-1 p-6",
83
+ variant: "elevated"
84
+ }, {
85
+ default: k(() => [
86
+ o(A, { class: "flex flex-col gap-16 justify-between" }, {
87
+ default: k(() => [
88
+ o(S, {
89
+ class: "p-0",
90
+ title: "Account Info",
91
+ subtitle: ""
92
+ }),
93
+ o(A, { class: "p-0" }, {
94
+ default: k(() => {
95
+ var B, R, j, H, z;
96
+ return [
97
+ n[1] || (n[1] = s("b", null, "For", -1)),
98
+ _(": " + q((R = (B = a.payoutAccount) == null ? void 0 : B.store) == null ? void 0 : R.event) + " ", 1),
99
+ n[2] || (n[2] = s("br", null, null, -1)),
100
+ n[3] || (n[3] = s("b", null, "Reference", -1)),
101
+ _(": " + q((H = (j = a.payoutAccount) == null ? void 0 : j.store) == null ? void 0 : H.id), 1),
102
+ n[4] || (n[4] = s("br", null, null, -1)),
103
+ n[5] || (n[5] = s("b", null, "Business", -1)),
104
+ _(": " + q((z = a.payoutAccount) == null ? void 0 : z.businessId), 1),
105
+ n[6] || (n[6] = s("br", null, null, -1))
106
+ ];
107
+ }),
108
+ _: 1
109
+ })
110
+ ]),
111
+ _: 1
112
+ })
113
+ ]),
114
+ _: 1
115
+ }),
116
+ o(C, {
117
+ horizontal: "",
118
+ class: "flex-1 p-6",
119
+ variant: "elevated"
120
+ }, {
121
+ default: k(() => [
122
+ o(A, { class: "flex flex-col gap-16 justify-between" }, {
123
+ default: k(() => [
124
+ o(S, {
125
+ class: "p-0",
126
+ title: "Key Person",
127
+ subtitle: ""
128
+ }),
129
+ o(A, { class: "p-0" }, {
130
+ default: k(() => {
131
+ var B, R, j, H, z, P, ie, ce;
132
+ return [
133
+ n[7] || (n[7] = s("b", null, "Email", -1)),
134
+ _(": " + q((j = (R = (B = a.payoutAccount) == null ? void 0 : B.store) == null ? void 0 : R.keyPerson) == null ? void 0 : j.email) + " ", 1),
135
+ n[8] || (n[8] = s("br", null, null, -1)),
136
+ n[9] || (n[9] = s("b", null, "Name", -1)),
137
+ _(": " + q((P = (z = (H = a.payoutAccount) == null ? void 0 : H.store) == null ? void 0 : z.keyPerson) == null ? void 0 : P.name), 1),
138
+ n[10] || (n[10] = s("br", null, null, -1)),
139
+ n[11] || (n[11] = s("b", null, "Phone", -1)),
140
+ _(": " + q((ce = (ie = a.payoutAccount) == null ? void 0 : ie.store.keyPerson) == null ? void 0 : ce.phone), 1),
141
+ n[12] || (n[12] = s("br", null, null, -1))
142
+ ];
143
+ }),
144
+ _: 1
145
+ })
146
+ ]),
147
+ _: 1
148
+ })
149
+ ]),
150
+ _: 1
151
+ })
152
+ ]),
153
+ s("div", Ae, [
154
+ o(C, {
155
+ horizontal: "",
156
+ class: "flex-1 p-6",
157
+ variant: "elevated"
158
+ }, {
159
+ default: k(() => [
160
+ o(A, { class: "flex flex-col gap-16 justify-between" }, {
161
+ default: k(() => [
162
+ o(S, {
163
+ class: "p-0",
164
+ title: "Status Info",
165
+ subtitle: ""
166
+ }),
167
+ o(A, { class: "p-0" }, {
168
+ default: k(() => {
169
+ var B, R, j;
170
+ return [
171
+ n[13] || (n[13] = s("b", null, "Submission Date", -1)),
172
+ _(": " + q((B = a.payoutAccount) != null && B.submissionDate ? i(fe)(a.payoutAccount.submissionDate).format(
173
+ "YYYY-MM-DD HH:mm:ss"
174
+ ) : "—"), 1),
175
+ n[14] || (n[14] = s("br", null, null, -1)),
176
+ n[15] || (n[15] = s("b", null, "Status By", -1)),
177
+ _(": " + q(((R = a.payoutAccount) == null ? void 0 : R.statusBy) ?? "—"), 1),
178
+ n[16] || (n[16] = s("br", null, null, -1)),
179
+ n[17] || (n[17] = s("b", null, "Status Reason", -1)),
180
+ _(": " + q(((j = a.payoutAccount) == null ? void 0 : j.statusReason) ?? "—"), 1),
181
+ n[18] || (n[18] = s("br", null, null, -1))
182
+ ];
183
+ }),
184
+ _: 1
185
+ })
186
+ ]),
187
+ _: 1
188
+ })
189
+ ]),
190
+ _: 1
191
+ })
192
+ ]),
193
+ s("div", Se, [
194
+ n[19] || (n[19] = s("p", { class: "fm-typo-en-body-lg-600" }, "Exterior Photo", -1)),
195
+ s("div", Ne, [
196
+ u.value ? (g(), w(I, {
197
+ key: 0,
198
+ variant: "tertiary",
199
+ label: "Cancel",
200
+ onClick: m
201
+ })) : E("", !0),
202
+ u.value ? E("", !0) : (g(), w(I, {
203
+ key: 1,
204
+ variant: "primary",
205
+ label: "Edit Exterior Photo",
206
+ onClick: n[0] || (n[0] = (B) => u.value = !0)
207
+ }))
208
+ ])
209
+ ]),
210
+ u.value ? (g(), G(K, { key: 0 }, [
211
+ c.value ? (g(), G(K, { key: 0 }, [
212
+ o(Q, {
213
+ document: c.value,
214
+ "business-id": a.payoutAccount.businessId,
215
+ "restaurant-id": ((V = (T = a.payoutAccount) == null ? void 0 : T.store) == null ? void 0 : V.event) === "ORDERING" ? a.payoutAccount.store.id : void 0
216
+ }, null, 8, ["document", "business-id", "restaurant-id"]),
217
+ s("div", Ce, [
218
+ o(I, {
219
+ variant: "tertiary",
220
+ label: "Remove",
221
+ size: "md",
222
+ "prepend-icon": "delete",
223
+ onClick: b
224
+ }),
225
+ o(I, {
226
+ variant: "primary",
227
+ label: "Save",
228
+ size: "md",
229
+ loading: v.value,
230
+ onClick: p
231
+ }, null, 8, ["loading"])
232
+ ])
233
+ ], 64)) : (g(), w(D, {
234
+ key: 1,
235
+ class: "h-[300px] w-full",
236
+ accept: ".png,.jpg,.jpeg,.webp,.pdf",
237
+ onFileUpload: f
238
+ }))
239
+ ], 64)) : (g(), w(Q, {
240
+ key: 1,
241
+ document: a.payoutAccount.store.exteriorPhoto,
242
+ "business-id": a.payoutAccount.businessId,
243
+ "restaurant-id": (($ = (x = a.payoutAccount) == null ? void 0 : x.store) == null ? void 0 : $.event) === "ORDERING" ? a.payoutAccount.store.id : void 0
244
+ }, null, 8, ["document", "business-id", "restaurant-id"]))
245
+ ], 64);
246
+ };
247
+ }
248
+ }), Ie = { class: "flex flex-col gap-8" }, he = { class: "flex flex-col gap-8" }, De = { class: "flex justify-end mb-2" }, Re = /* @__PURE__ */ M({
249
+ __name: "SettlementEditDialog",
250
+ props: {
251
+ initialValue: {
252
+ type: Object,
253
+ required: !0
254
+ },
255
+ bankNameOptions: {
256
+ type: Array,
257
+ required: !0
258
+ },
259
+ businessId: {
260
+ type: String,
261
+ required: !0
262
+ },
263
+ restaurantId: {
264
+ type: String,
265
+ default: void 0
266
+ }
267
+ },
268
+ setup(a) {
269
+ const l = a, { emitAction: e, emitData: v } = ge(), u = ye({
270
+ companyName: l.initialValue.companyName,
271
+ regNo: l.initialValue.regNo,
272
+ bankName: l.initialValue.bankName,
273
+ bankHolderName: l.initialValue.bankHolderName,
274
+ bankAccountNumber: l.initialValue.bankAccountNumber,
275
+ ssm: l.initialValue.ssm,
276
+ bankStatement: l.initialValue.bankStatement
277
+ }), t = U(), c = U(), F = U(u.ssm ?? ""), f = U(u.bankStatement ?? ""), m = X().trim().min(1, "Company name is required"), b = X().trim().min(1, "Registration number is required"), r = X().trim().min(1, "Bank name is required"), p = X().trim().min(1, "Bank holder name is required"), d = X().trim().min(1, "Bank account number is required"), n = ke({
278
+ companyName: m,
279
+ regNo: b,
280
+ bankName: r,
281
+ bankHolderName: p,
282
+ bankAccountNumber: d
283
+ }), S = () => {
284
+ const V = n.safeParse(u);
285
+ V.success && (v({
286
+ ...V.data,
287
+ ssm: u.ssm,
288
+ bankStatement: u.bankStatement,
289
+ newSSM: t.value,
290
+ newBankStatement: c.value
291
+ }), e("primary"));
292
+ };
293
+ async function A(V) {
294
+ const x = new FileReader();
295
+ return new Promise(($) => {
296
+ x.onload = (B) => {
297
+ var R;
298
+ $((R = B.target) == null ? void 0 : R.result);
299
+ }, x.readAsDataURL(V);
300
+ });
301
+ }
302
+ const C = async (V) => {
303
+ t.value = V, F.value = V ? await A(V) : "";
304
+ }, I = async (V) => {
305
+ c.value = V, f.value = V ? await A(V) : "";
306
+ }, D = () => {
307
+ t.value = void 0, F.value = "";
308
+ }, T = () => {
309
+ c.value = void 0, f.value = "";
310
+ };
311
+ return (V, x) => {
312
+ const $ = y("FmTextField"), B = y("FmSelect"), R = y("FmButton"), j = y("FmFormGroup"), H = y("FmDropField"), z = y("FmForm");
313
+ return g(), w(z, {
314
+ class: "flex flex-col gap-16",
315
+ onValidationSuccess: S
316
+ }, {
317
+ default: k(() => [
318
+ x[9] || (x[9] = s("div", { class: "flex items-center my-2" }, [
319
+ s("hr", { class: "w-[80px] border-t border-gray-300" }),
320
+ s("span", { class: "text-left mx-6 text-gray-500" }, "Account"),
321
+ s("hr", { class: "flex-grow border-t border-gray-300" })
322
+ ], -1)),
323
+ o($, {
324
+ modelValue: u.regNo,
325
+ "onUpdate:modelValue": x[0] || (x[0] = (P) => u.regNo = P),
326
+ label: "Registration Number",
327
+ "label-mark": "required",
328
+ "helper-text": "Registration Number must match uploaded SSM registration number.",
329
+ rules: i(N)(i(b)),
330
+ autofocus: ""
331
+ }, null, 8, ["modelValue", "rules"]),
332
+ o($, {
333
+ modelValue: u.companyName,
334
+ "onUpdate:modelValue": x[1] || (x[1] = (P) => u.companyName = P),
335
+ label: "Company Name",
336
+ "label-mark": "required",
337
+ "helper-text": "Company Name must match uploaded SSM registration name.",
338
+ rules: i(N)(i(m))
339
+ }, null, 8, ["modelValue", "rules"]),
340
+ x[10] || (x[10] = s("div", { class: "flex items-center my-2" }, [
341
+ s("hr", { class: "w-[80px] border-t border-gray-300" }),
342
+ s("span", { class: "text-left mx-6 text-gray-500" }, "Bank"),
343
+ s("hr", { class: "flex-grow border-t border-gray-300" })
344
+ ], -1)),
345
+ o(B, {
346
+ modelValue: u.bankName,
347
+ "onUpdate:modelValue": x[2] || (x[2] = (P) => u.bankName = P),
348
+ label: "Bank",
349
+ "label-mark": "required",
350
+ items: l.bankNameOptions,
351
+ rules: i(N)(i(r))
352
+ }, null, 8, ["modelValue", "items", "rules"]),
353
+ o($, {
354
+ modelValue: u.bankHolderName,
355
+ "onUpdate:modelValue": x[3] || (x[3] = (P) => u.bankHolderName = P),
356
+ label: "Bank Holder",
357
+ "label-mark": "required",
358
+ rules: i(N)(i(p))
359
+ }, null, 8, ["modelValue", "rules"]),
360
+ o($, {
361
+ modelValue: u.bankAccountNumber,
362
+ "onUpdate:modelValue": x[4] || (x[4] = (P) => u.bankAccountNumber = P),
363
+ label: "Bank Account Number",
364
+ "label-mark": "required",
365
+ type: "number",
366
+ rules: i(N)(i(d))
367
+ }, null, 8, ["modelValue", "rules"]),
368
+ x[11] || (x[11] = s("div", { class: "flex items-center my-2" }, [
369
+ s("hr", { class: "w-[80px] border-t border-gray-300" }),
370
+ s("span", { class: "text-left mx-6 text-gray-500" }, "Document"),
371
+ s("hr", { class: "flex-grow border-t border-gray-300" })
372
+ ], -1)),
373
+ s("div", Ie, [
374
+ x[7] || (x[7] = s("p", { class: "fm-typo-en-body-md-500" }, "SSM (PDF)", -1)),
375
+ F.value ? (g(), w(j, {
376
+ key: 0,
377
+ modelValue: F.value,
378
+ "onUpdate:modelValue": x[5] || (x[5] = (P) => F.value = P),
379
+ label: "SSM"
380
+ }, {
381
+ default: k(() => [
382
+ o(Q, {
383
+ document: F.value,
384
+ "business-id": a.businessId,
385
+ "restaurant-id": a.restaurantId
386
+ }, {
387
+ default: k(({ src: P }) => [
388
+ o(ee, {
389
+ height: 300,
390
+ pdf: P,
391
+ "disable-text-layer": !0,
392
+ "disable-annotation-layer": !0
393
+ }, null, 8, ["pdf"])
394
+ ]),
395
+ _: 1
396
+ }, 8, ["document", "business-id", "restaurant-id"]),
397
+ o(R, {
398
+ type: "button",
399
+ variant: "tertiary",
400
+ label: "Remove",
401
+ size: "md",
402
+ "prepend-icon": "delete",
403
+ onClick: D
404
+ })
405
+ ]),
406
+ _: 1
407
+ }, 8, ["modelValue"])) : (g(), w(H, {
408
+ key: 1,
409
+ accept: ".pdf",
410
+ onFileUpload: C
411
+ }))
412
+ ]),
413
+ s("div", he, [
414
+ x[8] || (x[8] = s("p", { class: "fm-typo-en-body-md-500" }, "Bank Statement (PDF)", -1)),
415
+ f.value ? (g(), w(j, {
416
+ key: 0,
417
+ modelValue: f.value,
418
+ "onUpdate:modelValue": x[6] || (x[6] = (P) => f.value = P),
419
+ label: "Bank Statement"
420
+ }, {
421
+ default: k(() => [
422
+ o(Q, {
423
+ document: f.value,
424
+ "business-id": a.businessId,
425
+ "restaurant-id": a.restaurantId
426
+ }, {
427
+ default: k(({ src: P }) => [
428
+ o(ee, {
429
+ height: 300,
430
+ pdf: P,
431
+ "disable-text-layer": !0,
432
+ "disable-annotation-layer": !0
433
+ }, null, 8, ["pdf"])
434
+ ]),
435
+ _: 1
436
+ }, 8, ["document", "business-id", "restaurant-id"]),
437
+ o(R, {
438
+ type: "button",
439
+ variant: "tertiary",
440
+ label: "Remove",
441
+ size: "md",
442
+ "prepend-icon": "delete",
443
+ onClick: T
444
+ })
445
+ ]),
446
+ _: 1
447
+ }, 8, ["modelValue"])) : (g(), w(H, {
448
+ key: 1,
449
+ accept: ".pdf",
450
+ onFileUpload: I
451
+ }))
452
+ ]),
453
+ s("div", De, [
454
+ o(R, {
455
+ type: "submit",
456
+ variant: "primary",
457
+ label: "Save"
458
+ })
459
+ ])
460
+ ]),
461
+ _: 1
462
+ });
463
+ };
464
+ }
465
+ }), Te = { class: "flex justify-end mb-6" }, Pe = { class: "flex gap-16 mb-6" }, Me = { class: "flex gap-16" }, Be = { class: "flex-1" }, _e = { class: "flex-1" }, Ee = /* @__PURE__ */ M({
466
+ __name: "Settlement",
467
+ props: {
468
+ onUpdate: {
469
+ type: Function,
470
+ required: !0
471
+ },
472
+ payoutAccount: {
473
+ type: Object,
474
+ required: !0
475
+ }
476
+ },
477
+ setup(a) {
478
+ const l = a, e = U(!1), v = de(), u = W(), t = xe.bankNameOptions(), c = () => {
479
+ var b, r, p, d, n, S, A, C, I, D;
480
+ return {
481
+ companyName: ((b = l.payoutAccount.store) == null ? void 0 : b.companyName) ?? "",
482
+ regNo: ((r = l.payoutAccount.store) == null ? void 0 : r.regNo) ?? "",
483
+ bankName: ((d = (p = l.payoutAccount.store) == null ? void 0 : p.bank) == null ? void 0 : d.name) ?? "",
484
+ bankHolderName: ((S = (n = l.payoutAccount.store) == null ? void 0 : n.bank) == null ? void 0 : S.holderName) ?? "",
485
+ bankAccountNumber: ((C = (A = l.payoutAccount.store) == null ? void 0 : A.bank) == null ? void 0 : C.accountNumber) ?? "",
486
+ ssm: ((I = l.payoutAccount.store) == null ? void 0 : I.ssm) ?? "",
487
+ bankStatement: ((D = l.payoutAccount.store) == null ? void 0 : D.bankStatement) ?? ""
488
+ };
489
+ }, F = async (b, r) => {
490
+ var n;
491
+ const p = (/* @__PURE__ */ new Date()).toISOString();
492
+ if (((n = l.payoutAccount.store) == null ? void 0 : n.event) === "ORDERING")
493
+ return await te.adminUpload(
494
+ `restaurant/${l.payoutAccount.store.id}/documents/${b}/${p}.pdf`,
495
+ r,
496
+ l.payoutAccount.businessId,
497
+ l.payoutAccount.store.id
498
+ );
499
+ const d = l.payoutAccount.businessId || l.payoutAccount.store.id;
500
+ return await te.adminUpload(
501
+ `business/${d}/documents/${b}/${p}.pdf`,
502
+ r,
503
+ d,
504
+ void 0
505
+ );
506
+ }, f = async (b) => {
507
+ if (!l.payoutAccount.store) return;
508
+ let r = l.payoutAccount.store.ssm;
509
+ b.newSSM && (r = await F("ssm", b.newSSM));
510
+ let p = l.payoutAccount.store.bankStatement;
511
+ b.newBankStatement && (p = await F(
512
+ "bankStatement",
513
+ b.newBankStatement
514
+ ));
515
+ const d = {
516
+ ...l.payoutAccount,
517
+ store: {
518
+ ...l.payoutAccount.store,
519
+ companyName: b.companyName,
520
+ regNo: b.regNo,
521
+ bank: {
522
+ ...l.payoutAccount.store.bank ?? {},
523
+ name: b.bankName,
524
+ holderName: b.bankHolderName,
525
+ accountNumber: b.bankAccountNumber
526
+ },
527
+ ssm: r,
528
+ bankStatement: p
529
+ }
530
+ };
531
+ try {
532
+ e.value = !0, await l.onUpdate(d), u.open({
533
+ type: "success",
534
+ title: "Settlement info updated successfully"
535
+ }), v.close();
536
+ } catch (n) {
537
+ u.open({
538
+ type: "error",
539
+ title: "Failed to update settlement info",
540
+ message: Z(n)
541
+ });
542
+ } finally {
543
+ e.value = !1;
544
+ }
545
+ }, m = () => {
546
+ var b;
547
+ v.close(), v.open({
548
+ title: "Edit Settlement Info",
549
+ closeButton: !0,
550
+ overlay: !0,
551
+ contentComponent: Re,
552
+ contentComponentProps: {
553
+ initialValue: c(),
554
+ bankNameOptions: t,
555
+ businessId: l.payoutAccount.businessId,
556
+ restaurantId: ((b = l.payoutAccount.store) == null ? void 0 : b.event) === "ORDERING" ? l.payoutAccount.store.id : void 0
557
+ }
558
+ }).onPrimary((r) => {
559
+ f(r);
560
+ });
561
+ };
562
+ return (b, r) => {
563
+ var A, C, I, D;
564
+ const p = y("FmButton"), d = y("FmCardHeader"), n = y("FmCardSection"), S = y("FmCard");
565
+ return g(), G(K, null, [
566
+ s("div", Te, [
567
+ o(p, {
568
+ variant: "primary",
569
+ label: "Edit Settlement Info",
570
+ loading: e.value,
571
+ onclick: m
572
+ }, null, 8, ["loading"])
573
+ ]),
574
+ s("div", Pe, [
575
+ o(S, {
576
+ horizontal: "",
577
+ class: "flex-1 p-6",
578
+ variant: "elevated"
579
+ }, {
580
+ default: k(() => [
581
+ o(n, { class: "flex flex-col gap-16 justify-between" }, {
582
+ default: k(() => [
583
+ o(d, {
584
+ class: "p-0",
585
+ title: "Company Info",
586
+ subtitle: ""
587
+ }),
588
+ o(n, { class: "p-0" }, {
589
+ default: k(() => {
590
+ var T, V;
591
+ return [
592
+ r[0] || (r[0] = s("b", null, "Name", -1)),
593
+ _(": " + q((T = a.payoutAccount) == null ? void 0 : T.store.companyName), 1),
594
+ r[1] || (r[1] = s("br", null, null, -1)),
595
+ r[2] || (r[2] = s("b", null, "Registration Number", -1)),
596
+ _(": " + q((V = a.payoutAccount) == null ? void 0 : V.store.regNo), 1),
597
+ r[3] || (r[3] = s("br", null, null, -1))
598
+ ];
599
+ }),
600
+ _: 1
601
+ })
602
+ ]),
603
+ _: 1
604
+ })
605
+ ]),
606
+ _: 1
607
+ }),
608
+ o(S, {
609
+ horizontal: "",
610
+ class: "flex-1 p-6",
611
+ variant: "elevated"
612
+ }, {
613
+ default: k(() => [
614
+ o(n, { class: "flex flex-col gap-16 justify-between" }, {
615
+ default: k(() => [
616
+ o(d, {
617
+ class: "p-0",
618
+ title: "Bank Info",
619
+ subtitle: ""
620
+ }),
621
+ o(n, { class: "p-0" }, {
622
+ default: k(() => {
623
+ var T, V, x, $, B, R;
624
+ return [
625
+ r[4] || (r[4] = s("b", null, "Bank", -1)),
626
+ _(": " + q((V = (T = a.payoutAccount) == null ? void 0 : T.store.bank) == null ? void 0 : V.name), 1),
627
+ r[5] || (r[5] = s("br", null, null, -1)),
628
+ r[6] || (r[6] = s("b", null, "Name", -1)),
629
+ _(": " + q(($ = (x = a.payoutAccount) == null ? void 0 : x.store.bank) == null ? void 0 : $.holderName), 1),
630
+ r[7] || (r[7] = s("br", null, null, -1)),
631
+ r[8] || (r[8] = s("b", null, "Number", -1)),
632
+ _(": " + q((R = (B = a.payoutAccount) == null ? void 0 : B.store.bank) == null ? void 0 : R.accountNumber), 1)
633
+ ];
634
+ }),
635
+ _: 1
636
+ })
637
+ ]),
638
+ _: 1
639
+ })
640
+ ]),
641
+ _: 1
642
+ })
643
+ ]),
644
+ s("div", Me, [
645
+ s("div", Be, [
646
+ r[9] || (r[9] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "SSM", -1)),
647
+ o(Q, {
648
+ "business-id": a.payoutAccount.businessId,
649
+ "restaurant-id": ((C = (A = a.payoutAccount) == null ? void 0 : A.store) == null ? void 0 : C.event) === "ORDERING" ? a.payoutAccount.store.id : void 0,
650
+ document: a.payoutAccount.store.ssm
651
+ }, {
652
+ default: k(({ src: T }) => [
653
+ o(ee, {
654
+ pdf: T,
655
+ "disable-text-layer": !0,
656
+ "disable-annotation-layer": !0
657
+ }, null, 8, ["pdf"])
658
+ ]),
659
+ _: 1
660
+ }, 8, ["business-id", "restaurant-id", "document"])
661
+ ]),
662
+ s("div", _e, [
663
+ r[10] || (r[10] = s("p", { class: "fm-typo-en-body-lg-600 mb-6" }, "Bank Statement", -1)),
664
+ o(Q, {
665
+ "business-id": a.payoutAccount.businessId,
666
+ "restaurant-id": ((D = (I = a.payoutAccount) == null ? void 0 : I.store) == null ? void 0 : D.event) === "ORDERING" ? a.payoutAccount.store.id : void 0,
667
+ document: a.payoutAccount.store.bankStatement
668
+ }, {
669
+ default: k(({ src: T }) => [
670
+ o(ee, {
671
+ pdf: T,
672
+ "disable-text-layer": !0,
673
+ "disable-annotation-layer": !0
674
+ }, null, 8, ["pdf"])
675
+ ]),
676
+ _: 1
677
+ }, 8, ["business-id", "restaurant-id", "document"])
678
+ ])
679
+ ])
680
+ ], 64);
681
+ };
682
+ }
683
+ }), $e = /* @__PURE__ */ M({
684
+ __name: "RateInput",
685
+ props: {
686
+ data: {},
687
+ onChange: { type: Function }
688
+ },
689
+ setup(a) {
690
+ const l = a, e = U(l.data.toString());
691
+ return le(e, (v) => {
692
+ l.onChange(parseFloat(v));
693
+ }), (v, u) => {
694
+ const t = y("FmTextField");
695
+ return g(), w(t, {
696
+ inputmode: "decimal",
697
+ modelValue: e.value,
698
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => e.value = c)
699
+ }, {
700
+ append: k(() => [...u[1] || (u[1] = [
701
+ _("%", -1)
702
+ ])]),
703
+ _: 1
704
+ }, 8, ["modelValue"]);
705
+ };
706
+ }
707
+ }), qe = /* @__PURE__ */ M({
708
+ __name: "TPlusInput",
709
+ props: {
710
+ data: {},
711
+ onChange: { type: Function }
712
+ },
713
+ setup(a) {
714
+ const l = a, e = U(l.data.toString());
715
+ return le(e, (v) => {
716
+ l.onChange(parseInt(v));
717
+ }), (v, u) => {
718
+ const t = y("FmTextField");
719
+ return g(), w(t, {
720
+ inputmode: "numeric",
721
+ modelValue: e.value,
722
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => e.value = c)
723
+ }, null, 8, ["modelValue"]);
724
+ };
725
+ }
726
+ }), Oe = /* @__PURE__ */ M({
727
+ __name: "MinimumFeeInput",
728
+ props: {
729
+ data: {},
730
+ onChange: { type: Function }
731
+ },
732
+ setup(a) {
733
+ const l = a, e = U(l.data.toString());
734
+ return le(e, (v) => {
735
+ l.onChange(parseFloat(v));
736
+ }), (v, u) => {
737
+ const t = y("FmTextField");
738
+ return g(), w(t, {
739
+ inputmode: "numeric",
740
+ modelValue: e.value,
741
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => e.value = c)
742
+ }, {
743
+ prepend: k(() => [...u[1] || (u[1] = [
744
+ _("$", -1)
745
+ ])]),
746
+ _: 1
747
+ }, 8, ["modelValue"]);
748
+ };
749
+ }
750
+ }), Ge = { class: "flex gap-16 mt-6" }, je = { class: "flex-1" }, Ke = { class: "flex-1" }, Ye = { class: "my-6 w-full flex justify-end" }, He = { class: "w-[320px]" }, ze = /* @__PURE__ */ M({
751
+ __name: "PaymentStatus",
752
+ props: {
753
+ onUpdate: {
754
+ type: Function,
755
+ required: !0
756
+ },
757
+ payoutAccount: {
758
+ type: Object,
759
+ required: !0
760
+ }
761
+ },
762
+ setup(a) {
763
+ const l = a, e = U(!1), v = W(), u = de(), t = async (r) => {
764
+ try {
765
+ e.value = !0, await l.onUpdate(r), v.open({
766
+ type: "success",
767
+ title: "Payout account update succesfully"
768
+ });
769
+ } catch (p) {
770
+ v.open({
771
+ type: "error",
772
+ title: "Error occurs when updating payout account",
773
+ message: Z(p)
774
+ });
775
+ } finally {
776
+ e.value = !1;
777
+ }
778
+ }, c = async () => {
779
+ u.close(), u.open({
780
+ title: "Rejection Reason",
781
+ closeButton: !0,
782
+ overlay: !0,
783
+ contentComponent: we,
784
+ contentComponentProps: {
785
+ label: "Reason",
786
+ selectableReasons: [
787
+ {
788
+ label: "Incorrect Exterior Photo.",
789
+ value: "Incorrect Exterior Photo."
790
+ },
791
+ {
792
+ label: "The bank statement provided is unclear.",
793
+ value: "The bank statement provided is unclear."
794
+ },
795
+ {
796
+ label: "The exterior photo provided is unclear.",
797
+ value: "The exterior photo provided is unclear."
798
+ },
799
+ {
800
+ label: "Bank Account Name Mismatch with SSM Registration Name.",
801
+ value: "Bank Account Name Mismatch with SSM Registration Name."
802
+ },
803
+ {
804
+ label: 'Mismatch SSM with Signboard "Dimiliki Oleh"',
805
+ value: 'Mismatch SSM with Signboard "Dimiliki Oleh"'
806
+ },
807
+ {
808
+ label: "Mismatch Company Info with SSM Document",
809
+ value: "Mismatch Company Info with SSM Document"
810
+ },
811
+ {
812
+ label: "Other (fill in manually)",
813
+ value: "OTHER"
814
+ }
815
+ ],
816
+ otherLabel: "Other Reason",
817
+ otherPlaceholder: "Enter reason for rejection..."
818
+ }
819
+ }).onPrimary((r) => {
820
+ l.payoutAccount.enable = !1, l.payoutAccount.status = "REJECTED", l.payoutAccount.statusReason = r, t(l.payoutAccount), u.close();
821
+ });
822
+ }, { search: F } = oe({
823
+ search: ""
824
+ }), f = L(() => {
825
+ const { ssm: r, bank: p, bankStatement: d } = l.payoutAccount.store;
826
+ return r && p && p.name && p.accountNumber && p.holderName && d;
827
+ }), m = U(""), b = [
828
+ {
829
+ header: () => "Payment Method",
830
+ accessorKey: "issuer",
831
+ cell: (r) => `${r.row.original.issuer} (${r.row.original.variant})`
832
+ },
833
+ {
834
+ header: () => "Rate",
835
+ accessorKey: "rate",
836
+ cell: ({ row: r }) => {
837
+ let p = 0;
838
+ return r.original.rate && (p = r.original.rate.amount / Math.pow(10, r.original.rate.precision)), J($e, {
839
+ data: p,
840
+ onChange: (d) => {
841
+ const n = l.payoutAccount.methods.at(r.index);
842
+ n.rate || (n.rate = {
843
+ amount: 0,
844
+ precision: 4
845
+ }), n.rate.amount = d * Math.pow(10, n.rate.precision);
846
+ }
847
+ });
848
+ }
849
+ },
850
+ {
851
+ header: () => "Minimum Fee",
852
+ accessorKey: "minimumFee",
853
+ cell: ({ row: r }) => {
854
+ let p = 0;
855
+ return r.original.minimumFee && (p = r.original.minimumFee.amount / Math.pow(10, r.original.minimumFee.precision)), J(Oe, {
856
+ data: p,
857
+ onChange: (d) => {
858
+ const n = l.payoutAccount.methods.at(r.index);
859
+ n.minimumFee || (n.minimumFee = {
860
+ amount: 0,
861
+ precision: 2
862
+ }), n.minimumFee.amount = d * Math.pow(10, n.minimumFee.precision);
863
+ }
864
+ });
865
+ }
866
+ },
867
+ {
868
+ header: () => "T plus",
869
+ accessorKey: "tPlus",
870
+ cell: ({ row: r }) => J(qe, {
871
+ data: r.original.tPlus ?? 0,
872
+ onChange: (p) => {
873
+ const d = l.payoutAccount.methods.at(r.index);
874
+ d.tPlus = p;
875
+ }
876
+ })
877
+ }
878
+ ];
879
+ return (r, p) => {
880
+ const d = y("FmRadio"), n = y("FmRadioGroup"), S = y("FmSwitch"), A = y("FmSearch"), C = y("FmTable"), I = y("FmButton");
881
+ return g(), G(K, null, [
882
+ s("div", Ge, [
883
+ s("div", je, [
884
+ o(n, {
885
+ modelValue: a.payoutAccount.status,
886
+ "onUpdate:modelValue": p[0] || (p[0] = (D) => a.payoutAccount.status = D),
887
+ label: "Account Status"
888
+ }, {
889
+ default: k(() => [
890
+ o(d, {
891
+ value: "PENDING",
892
+ label: "Pending"
893
+ }),
894
+ o(d, {
895
+ value: "APPROVED",
896
+ label: "Approved"
897
+ }),
898
+ o(d, {
899
+ value: "REJECTED",
900
+ label: "Rejected",
901
+ onClick: c
902
+ })
903
+ ]),
904
+ _: 1
905
+ }, 8, ["modelValue"])
906
+ ]),
907
+ s("div", Ke, [
908
+ o(S, {
909
+ modelValue: a.payoutAccount.enable,
910
+ "onUpdate:modelValue": p[1] || (p[1] = (D) => a.payoutAccount.enable = D),
911
+ disabled: !f.value,
912
+ label: "Enabled",
913
+ sublabel: "Merchant can use online features such as e-payment, settlement"
914
+ }, null, 8, ["modelValue", "disabled"])
915
+ ])
916
+ ]),
917
+ a.payoutAccount.enable ? (g(), G(K, { key: 0 }, [
918
+ s("div", Ye, [
919
+ s("div", He, [
920
+ o(A, {
921
+ modelValue: i(F),
922
+ "onUpdate:modelValue": p[2] || (p[2] = (D) => ae(F) ? F.value = D : null),
923
+ placeholder: "Search Method ..."
924
+ }, null, 8, ["modelValue"])
925
+ ])
926
+ ]),
927
+ o(C, {
928
+ class: "mt-6",
929
+ modelValue: m.value,
930
+ "onUpdate:modelValue": p[3] || (p[3] = (D) => m.value = D),
931
+ "shrink-at": !1,
932
+ "search-value": i(F),
933
+ "row-data": a.payoutAccount.methods,
934
+ "column-defs": b
935
+ }, null, 8, ["modelValue", "search-value", "row-data"])
936
+ ], 64)) : E("", !0),
937
+ o(I, {
938
+ class: "w-full mt-6",
939
+ variant: "primary",
940
+ label: "Save",
941
+ loading: e.value,
942
+ onclick: () => t(a.payoutAccount)
943
+ }, null, 8, ["loading", "onclick"])
944
+ ], 64);
945
+ };
946
+ }
947
+ }), Le = { class: "flex" }, Ze = /* @__PURE__ */ M({
948
+ __name: "Actions",
949
+ emits: ["edit", "delete"],
950
+ setup(a, { emit: l }) {
951
+ const e = l;
952
+ return (v, u) => {
953
+ const t = y("FmButton");
954
+ return g(), G("div", Le, [
955
+ o(t, {
956
+ variant: "plain",
957
+ "prepend-icon": "delete",
958
+ onClick: u[0] || (u[0] = (c) => {
959
+ c.stopPropagation(), e("delete");
960
+ })
961
+ })
962
+ ]);
963
+ };
964
+ }
965
+ }), Je = { class: "flex justify-end px-6 pb-6" }, Qe = /* @__PURE__ */ M({
966
+ __name: "PaymentChannel",
967
+ props: {
968
+ payoutAccount: {
969
+ type: Object,
970
+ required: !0
971
+ }
972
+ },
973
+ setup(a) {
974
+ const l = W(), e = a, { isLoading: v, startAsyncCall: u } = ne(), t = U([]);
975
+ function c() {
976
+ u(async () => {
977
+ t.value = await Y.getChannels(e.payoutAccount._id);
978
+ });
979
+ }
980
+ me(c);
981
+ function F() {
982
+ u(async () => {
983
+ try {
984
+ await Y.updateChannels(e.payoutAccount._id, t.value), l.open({
985
+ type: "success",
986
+ title: "Payout account channels update succesfully"
987
+ });
988
+ } catch (b) {
989
+ l.open({
990
+ type: "error",
991
+ title: "Error occurs when updating payout account channels",
992
+ message: Z(b)
993
+ });
994
+ }
995
+ });
996
+ }
997
+ function f() {
998
+ u(async () => {
999
+ try {
1000
+ await Y.resetChannels(e.payoutAccount._id), t.value = await Y.getChannels(e.payoutAccount._id), l.open({
1001
+ type: "success",
1002
+ title: "Payout account channels reset succesfully"
1003
+ });
1004
+ } catch (b) {
1005
+ l.open({
1006
+ type: "error",
1007
+ title: "Error occurs when reset payout account channels",
1008
+ message: Z(b)
1009
+ });
1010
+ }
1011
+ });
1012
+ }
1013
+ const m = [
1014
+ {
1015
+ header: () => "Gateway",
1016
+ accessorKey: "gateway"
1017
+ },
1018
+ {
1019
+ header: () => "Payment Type",
1020
+ accessorKey: "type"
1021
+ },
1022
+ {
1023
+ header: () => "Display",
1024
+ accessorKey: "icon",
1025
+ cell: ({ row: b }) => J("img", { src: b.original.icon, width: 32, height: 32 })
1026
+ },
1027
+ {
1028
+ header: () => "Label",
1029
+ accessorKey: "label",
1030
+ cell: ({ row: b }) => J(Fe.FmTextField, {
1031
+ modelValue: b.original.label,
1032
+ "onUpdate:modelValue": (r) => b.original.label = r
1033
+ })
1034
+ },
1035
+ {
1036
+ id: "actions",
1037
+ header: () => "Actions",
1038
+ cell: ({ row: b }) => J(Ze, {
1039
+ onDelete: () => t.value.splice(b.index, 1)
1040
+ })
1041
+ }
1042
+ ];
1043
+ return (b, r) => {
1044
+ const p = y("FmButton"), d = y("FmTable");
1045
+ return g(), G(K, null, [
1046
+ s("div", Je, [
1047
+ o(p, {
1048
+ class: "mx-4",
1049
+ variant: "destructive",
1050
+ size: "md",
1051
+ icon: "history",
1052
+ label: "Reset",
1053
+ onClick: f
1054
+ }),
1055
+ o(p, {
1056
+ variant: "primary",
1057
+ size: "md",
1058
+ icon: "save",
1059
+ label: "Save",
1060
+ onClick: F
1061
+ })
1062
+ ]),
1063
+ o(d, {
1064
+ loading: i(v),
1065
+ "row-data": t.value,
1066
+ "column-defs": m,
1067
+ "shrink-at": !1
1068
+ }, null, 8, ["loading", "row-data"])
1069
+ ], 64);
1070
+ };
1071
+ }
1072
+ }), We = { class: "flex mt-6 space-x-6" }, Xe = /* @__PURE__ */ M({
1073
+ __name: "FiuuGateway",
1074
+ props: {
1075
+ gateway: {
1076
+ type: Object,
1077
+ required: !0
1078
+ },
1079
+ onUpdate: {
1080
+ type: Function,
1081
+ required: !0
1082
+ },
1083
+ onDelete: {
1084
+ type: Function,
1085
+ required: !0
1086
+ }
1087
+ },
1088
+ setup(a) {
1089
+ var v;
1090
+ const e = U(((v = a.gateway) == null ? void 0 : v.config) || {
1091
+ merchantId: "",
1092
+ verifyKey: "",
1093
+ secretKey: ""
1094
+ });
1095
+ return (u, t) => {
1096
+ const c = y("FmTextField"), F = y("FmButton"), f = y("FmForm");
1097
+ return g(), w(f, {
1098
+ ref: "form",
1099
+ class: "flex flex-col gap-16",
1100
+ onValidationSuccess: t[3] || (t[3] = () => a.onUpdate(e.value))
1101
+ }, {
1102
+ default: k(() => [
1103
+ o(c, {
1104
+ modelValue: e.value.merchantId,
1105
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => e.value.merchantId = m),
1106
+ label: "Merchant ID",
1107
+ rules: i(N)(i(h).string())
1108
+ }, null, 8, ["modelValue", "rules"]),
1109
+ o(c, {
1110
+ modelValue: e.value.verifyKey,
1111
+ "onUpdate:modelValue": t[1] || (t[1] = (m) => e.value.verifyKey = m),
1112
+ label: "Verify Key",
1113
+ rules: i(N)(i(h).string())
1114
+ }, null, 8, ["modelValue", "rules"]),
1115
+ o(c, {
1116
+ modelValue: e.value.secretKey,
1117
+ "onUpdate:modelValue": t[2] || (t[2] = (m) => e.value.secretKey = m),
1118
+ label: "Secret Key",
1119
+ rules: i(N)(i(h).string())
1120
+ }, null, 8, ["modelValue", "rules"]),
1121
+ s("div", We, [
1122
+ a.gateway ? (g(), w(F, {
1123
+ key: 0,
1124
+ class: "flex-1",
1125
+ variant: "secondary",
1126
+ label: "Delete",
1127
+ onclick: () => a.onDelete()
1128
+ }, null, 8, ["onclick"])) : E("", !0),
1129
+ o(F, {
1130
+ type: "submit",
1131
+ class: "flex-1",
1132
+ variant: "primary",
1133
+ label: "Save"
1134
+ })
1135
+ ])
1136
+ ]),
1137
+ _: 1
1138
+ }, 512);
1139
+ };
1140
+ }
1141
+ }), et = { class: "flex mt-6 space-x-6" }, tt = /* @__PURE__ */ M({
1142
+ __name: "MacauPassGateway",
1143
+ props: {
1144
+ gateway: {
1145
+ type: Object,
1146
+ required: !0
1147
+ },
1148
+ onUpdate: {
1149
+ type: Function,
1150
+ required: !0
1151
+ },
1152
+ onDelete: {
1153
+ type: Function,
1154
+ required: !0
1155
+ }
1156
+ },
1157
+ setup(a) {
1158
+ var v;
1159
+ const e = U(((v = a.gateway) == null ? void 0 : v.config) || {
1160
+ merchantId: "",
1161
+ merchantName: "",
1162
+ merchantCategoryCode: "",
1163
+ storeID: "",
1164
+ storeName: ""
1165
+ });
1166
+ return (u, t) => {
1167
+ const c = y("FmTextField"), F = y("FmButton"), f = y("FmForm");
1168
+ return g(), w(f, {
1169
+ ref: "form",
1170
+ class: "flex flex-col gap-16",
1171
+ onValidationSuccess: t[5] || (t[5] = () => a.onUpdate(e.value))
1172
+ }, {
1173
+ default: k(() => [
1174
+ o(c, {
1175
+ modelValue: e.value.merchantId,
1176
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => e.value.merchantId = m),
1177
+ label: "Merchant ID",
1178
+ rules: i(N)(i(h).string())
1179
+ }, null, 8, ["modelValue", "rules"]),
1180
+ o(c, {
1181
+ modelValue: e.value.merchantName,
1182
+ "onUpdate:modelValue": t[1] || (t[1] = (m) => e.value.merchantName = m),
1183
+ label: "Merchant Name",
1184
+ rules: i(N)(i(h).string())
1185
+ }, null, 8, ["modelValue", "rules"]),
1186
+ o(c, {
1187
+ modelValue: e.value.merchantCategoryCode,
1188
+ "onUpdate:modelValue": t[2] || (t[2] = (m) => e.value.merchantCategoryCode = m),
1189
+ label: "Merchant MCC",
1190
+ rules: i(N)(i(h).string())
1191
+ }, null, 8, ["modelValue", "rules"]),
1192
+ o(c, {
1193
+ modelValue: e.value.storeID,
1194
+ "onUpdate:modelValue": t[3] || (t[3] = (m) => e.value.storeID = m),
1195
+ label: "Store ID",
1196
+ rules: i(N)(i(h).string())
1197
+ }, null, 8, ["modelValue", "rules"]),
1198
+ o(c, {
1199
+ modelValue: e.value.storeName,
1200
+ "onUpdate:modelValue": t[4] || (t[4] = (m) => e.value.storeName = m),
1201
+ label: "Store Name",
1202
+ rules: i(N)(i(h).string())
1203
+ }, null, 8, ["modelValue", "rules"]),
1204
+ s("div", et, [
1205
+ a.gateway ? (g(), w(F, {
1206
+ key: 0,
1207
+ class: "flex-1",
1208
+ variant: "secondary",
1209
+ label: "Delete",
1210
+ onclick: () => a.onDelete()
1211
+ }, null, 8, ["onclick"])) : E("", !0),
1212
+ o(F, {
1213
+ type: "submit",
1214
+ class: "flex-1",
1215
+ variant: "primary",
1216
+ label: "Save"
1217
+ })
1218
+ ])
1219
+ ]),
1220
+ _: 1
1221
+ }, 512);
1222
+ };
1223
+ }
1224
+ }), at = { class: "flex mt-6 space-x-6" }, nt = /* @__PURE__ */ M({
1225
+ __name: "DigioGateway",
1226
+ props: {
1227
+ gateway: {
1228
+ type: Object,
1229
+ required: !0
1230
+ },
1231
+ onUpdate: {
1232
+ type: Function,
1233
+ required: !0
1234
+ },
1235
+ onDelete: {
1236
+ type: Function,
1237
+ required: !0
1238
+ }
1239
+ },
1240
+ setup(a) {
1241
+ var v;
1242
+ const e = U(((v = a.gateway) == null ? void 0 : v.config) || {
1243
+ merchantId: "",
1244
+ cardMerchantId: ""
1245
+ });
1246
+ return (u, t) => {
1247
+ const c = y("FmTextField"), F = y("FmButton"), f = y("FmForm");
1248
+ return g(), w(f, {
1249
+ ref: "form",
1250
+ class: "flex flex-col gap-16",
1251
+ onValidationSuccess: t[2] || (t[2] = () => a.onUpdate(e.value))
1252
+ }, {
1253
+ default: k(() => [
1254
+ o(c, {
1255
+ modelValue: e.value.merchantId,
1256
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => e.value.merchantId = m),
1257
+ label: "Merchant ID",
1258
+ rules: i(N)(i(h).string())
1259
+ }, null, 8, ["modelValue", "rules"]),
1260
+ o(c, {
1261
+ modelValue: e.value.cardMerchantId,
1262
+ "onUpdate:modelValue": t[1] || (t[1] = (m) => e.value.cardMerchantId = m),
1263
+ label: "Card Merchant ID",
1264
+ rules: i(N)(i(h).string())
1265
+ }, null, 8, ["modelValue", "rules"]),
1266
+ s("div", at, [
1267
+ a.gateway ? (g(), w(F, {
1268
+ key: 0,
1269
+ class: "flex-1",
1270
+ variant: "secondary",
1271
+ label: "Delete",
1272
+ onclick: () => a.onDelete()
1273
+ }, null, 8, ["onclick"])) : E("", !0),
1274
+ o(F, {
1275
+ type: "submit",
1276
+ class: "flex-1",
1277
+ variant: "primary",
1278
+ label: "Save"
1279
+ })
1280
+ ])
1281
+ ]),
1282
+ _: 1
1283
+ }, 512);
1284
+ };
1285
+ }
1286
+ }), ot = { class: "flex mt-6 space-x-6" }, lt = /* @__PURE__ */ M({
1287
+ __name: "AdyenGateway",
1288
+ props: {
1289
+ gateway: {
1290
+ type: Object,
1291
+ required: !0
1292
+ },
1293
+ onUpdate: {
1294
+ type: Function,
1295
+ required: !0
1296
+ },
1297
+ onDelete: {
1298
+ type: Function,
1299
+ required: !0
1300
+ }
1301
+ },
1302
+ setup(a) {
1303
+ var v;
1304
+ const e = U(((v = a.gateway) == null ? void 0 : v.config) || {
1305
+ merchantAccount: "",
1306
+ username: "",
1307
+ apiKey: "",
1308
+ clientKey: "",
1309
+ endpoint: "",
1310
+ hmacKey: ""
1311
+ });
1312
+ return (u, t) => {
1313
+ const c = y("FmTextField"), F = y("FmButton"), f = y("FmForm");
1314
+ return g(), w(f, {
1315
+ ref: "form",
1316
+ class: "flex flex-col gap-16",
1317
+ onValidationSuccess: t[6] || (t[6] = () => a.onUpdate(e.value))
1318
+ }, {
1319
+ default: k(() => [
1320
+ o(c, {
1321
+ modelValue: e.value.endpoint,
1322
+ "onUpdate:modelValue": t[0] || (t[0] = (m) => e.value.endpoint = m),
1323
+ label: "Endpoint",
1324
+ rules: i(N)(i(h).string())
1325
+ }, null, 8, ["modelValue", "rules"]),
1326
+ o(c, {
1327
+ modelValue: e.value.merchantAccount,
1328
+ "onUpdate:modelValue": t[1] || (t[1] = (m) => e.value.merchantAccount = m),
1329
+ label: "Merchant Account",
1330
+ rules: i(N)(i(h).string())
1331
+ }, null, 8, ["modelValue", "rules"]),
1332
+ o(c, {
1333
+ modelValue: e.value.username,
1334
+ "onUpdate:modelValue": t[2] || (t[2] = (m) => e.value.username = m),
1335
+ label: "Username",
1336
+ rules: i(N)(i(h).string())
1337
+ }, null, 8, ["modelValue", "rules"]),
1338
+ o(c, {
1339
+ modelValue: e.value.apiKey,
1340
+ "onUpdate:modelValue": t[3] || (t[3] = (m) => e.value.apiKey = m),
1341
+ label: "API Key",
1342
+ rules: i(N)(i(h).string())
1343
+ }, null, 8, ["modelValue", "rules"]),
1344
+ o(c, {
1345
+ modelValue: e.value.clientKey,
1346
+ "onUpdate:modelValue": t[4] || (t[4] = (m) => e.value.clientKey = m),
1347
+ label: "Client Key",
1348
+ rules: i(N)(i(h).string())
1349
+ }, null, 8, ["modelValue", "rules"]),
1350
+ o(c, {
1351
+ modelValue: e.value.hmacKey,
1352
+ "onUpdate:modelValue": t[5] || (t[5] = (m) => e.value.hmacKey = m),
1353
+ label: "HMac Key"
1354
+ }, null, 8, ["modelValue"]),
1355
+ s("div", ot, [
1356
+ a.gateway ? (g(), w(F, {
1357
+ key: 0,
1358
+ class: "flex-1",
1359
+ variant: "secondary",
1360
+ label: "Delete",
1361
+ onclick: () => a.onDelete()
1362
+ }, null, 8, ["onclick"])) : E("", !0),
1363
+ o(F, {
1364
+ type: "submit",
1365
+ class: "flex-1",
1366
+ variant: "primary",
1367
+ label: "Save"
1368
+ })
1369
+ ])
1370
+ ]),
1371
+ _: 1
1372
+ }, 512);
1373
+ };
1374
+ }
1375
+ }), ut = { class: "flex mt-6 space-x-6" }, st = /* @__PURE__ */ M({
1376
+ __name: "KsherGateway",
1377
+ props: {
1378
+ gateway: {
1379
+ type: Object,
1380
+ required: !0
1381
+ },
1382
+ onUpdate: {
1383
+ type: Function,
1384
+ required: !0
1385
+ },
1386
+ onDelete: {
1387
+ type: Function,
1388
+ required: !0
1389
+ }
1390
+ },
1391
+ setup(a) {
1392
+ var v;
1393
+ const e = U(((v = a.gateway) == null ? void 0 : v.config) || {
1394
+ appId: "",
1395
+ privateKey: ""
1396
+ });
1397
+ return (u, t) => {
1398
+ const c = y("FmTextField"), F = y("FmTextarea"), f = y("FmButton"), m = y("FmForm");
1399
+ return g(), w(m, {
1400
+ ref: "form",
1401
+ class: "flex flex-col gap-16",
1402
+ onValidationSuccess: t[2] || (t[2] = () => a.onUpdate(e.value))
1403
+ }, {
1404
+ default: k(() => [
1405
+ o(c, {
1406
+ modelValue: e.value.appId,
1407
+ "onUpdate:modelValue": t[0] || (t[0] = (b) => e.value.appId = b),
1408
+ label: "App ID",
1409
+ rules: i(N)(i(h).string())
1410
+ }, null, 8, ["modelValue", "rules"]),
1411
+ o(F, {
1412
+ modelValue: e.value.privateKey,
1413
+ "onUpdate:modelValue": t[1] || (t[1] = (b) => e.value.privateKey = b),
1414
+ label: "Private Key",
1415
+ placeholder: "Paste your private key including BEGIN and END markers",
1416
+ rules: i(N)(i(h).string())
1417
+ }, null, 8, ["modelValue", "rules"]),
1418
+ s("div", ut, [
1419
+ a.gateway ? (g(), w(f, {
1420
+ key: 0,
1421
+ class: "flex-1",
1422
+ variant: "secondary",
1423
+ label: "Delete",
1424
+ onclick: () => a.onDelete()
1425
+ }, null, 8, ["onclick"])) : E("", !0),
1426
+ o(f, {
1427
+ type: "submit",
1428
+ class: "flex-1",
1429
+ variant: "primary",
1430
+ label: "Save"
1431
+ })
1432
+ ])
1433
+ ]),
1434
+ _: 1
1435
+ }, 512);
1436
+ };
1437
+ }
1438
+ }), rt = /* @__PURE__ */ M({
1439
+ __name: "TyroGateway",
1440
+ props: {
1441
+ gateway: {
1442
+ type: Object,
1443
+ required: !0
1444
+ },
1445
+ onUpdate: {
1446
+ type: Function,
1447
+ required: !0
1448
+ },
1449
+ onDelete: {
1450
+ type: Function,
1451
+ required: !0
1452
+ }
1453
+ },
1454
+ setup(a) {
1455
+ var v;
1456
+ const e = U(
1457
+ ((v = a.gateway) == null ? void 0 : v.config) || {
1458
+ locationId: ""
1459
+ }
1460
+ );
1461
+ return (u, t) => {
1462
+ const c = y("FmTextField"), F = y("FmForm");
1463
+ return g(), w(F, {
1464
+ ref: "form",
1465
+ class: "flex flex-col gap-16",
1466
+ onValidationSuccess: t[1] || (t[1] = () => a.onUpdate(e.value))
1467
+ }, {
1468
+ default: k(() => [
1469
+ o(c, {
1470
+ modelValue: e.value.locationId,
1471
+ "onUpdate:modelValue": t[0] || (t[0] = (f) => e.value.locationId = f),
1472
+ label: "Location ID",
1473
+ readonly: !0,
1474
+ rules: i(N)(i(h).string())
1475
+ }, null, 8, ["modelValue", "rules"])
1476
+ ]),
1477
+ _: 1
1478
+ }, 512);
1479
+ };
1480
+ }
1481
+ }), it = {
1482
+ key: 0,
1483
+ className: "mt-1 my-6 text-gray-600"
1484
+ }, ct = {
1485
+ key: 1,
1486
+ class: "flex items-center justify-center min-h-[80vh]"
1487
+ }, mt = /* @__PURE__ */ M({
1488
+ __name: "PaymentGateway",
1489
+ props: {
1490
+ payoutAccount: {
1491
+ type: Object,
1492
+ required: !0
1493
+ }
1494
+ },
1495
+ setup(a) {
1496
+ const l = pe().currentCountry, e = l.value, v = W(), { isLoading: u, startAsyncCall: t } = ne(), { gatewayTab: c } = oe({
1497
+ gatewayTab: ""
1498
+ }), F = a, f = [
1499
+ {
1500
+ label: "Fiuu",
1501
+ value: "RAZER_MERCHANT_SERVICE",
1502
+ render: Xe,
1503
+ region: [O.F_COUNTRY.enum.MY, O.F_COUNTRY.enum.SG]
1504
+ },
1505
+ {
1506
+ label: "Macau Pass",
1507
+ value: "MACAU_PASS",
1508
+ render: tt,
1509
+ region: [O.F_COUNTRY.enum.MO]
1510
+ },
1511
+ {
1512
+ label: "Digio",
1513
+ value: "DIGIO",
1514
+ render: nt,
1515
+ region: [O.F_COUNTRY.enum.TH]
1516
+ },
1517
+ {
1518
+ label: "Ksher",
1519
+ value: "KSHER",
1520
+ render: st,
1521
+ region: [O.F_COUNTRY.enum.TH]
1522
+ },
1523
+ {
1524
+ label: "Adyen",
1525
+ value: "ADYEN",
1526
+ render: lt,
1527
+ region: [O.F_COUNTRY.enum.MY, O.F_COUNTRY.enum.SG]
1528
+ },
1529
+ {
1530
+ label: "Tyro",
1531
+ value: "TYRO",
1532
+ render: rt,
1533
+ region: [O.F_COUNTRY.enum.AU]
1534
+ }
1535
+ ], m = U(
1536
+ F.payoutAccount.gateways ?? []
1537
+ ), b = L(() => f.find((S) => S.value === c.value)), r = L(() => f.filter(
1538
+ (S) => S.region.includes(l.value ?? O.F_COUNTRY.enum.MY)
1539
+ ));
1540
+ async function p(S) {
1541
+ await t(async () => {
1542
+ try {
1543
+ await Y.updateGateway(F.payoutAccount._id, S), v.open({
1544
+ type: "success",
1545
+ title: "Payout account gateways update succesfully"
1546
+ }), d.value = S.length === 0;
1547
+ } catch (A) {
1548
+ v.open({
1549
+ type: "error",
1550
+ title: "Error occurs when updating payout account gateways",
1551
+ message: Z(A)
1552
+ });
1553
+ }
1554
+ });
1555
+ }
1556
+ const d = U((F.payoutAccount.gateways ?? []).length === 0), n = L(() => e !== "MY" || !d.value);
1557
+ return (S, A) => {
1558
+ var T;
1559
+ const C = y("FmCircularProgress"), I = y("FmSwitch"), D = y("FmTabs");
1560
+ return g(), G(K, null, [
1561
+ i(e) ? (g(), G("p", it, [...A[2] || (A[2] = [
1562
+ s("b", null, "Note: ", -1),
1563
+ _(" There's no setup required for Malaysia Payment Gateway, once Payout Account is ready you will able to configure the payment channels. ", -1)
1564
+ ])])) : E("", !0),
1565
+ i(u) ? (g(), G("div", ct, [
1566
+ o(C, { size: "xxl" })
1567
+ ])) : (g(), G(K, { key: 2 }, [
1568
+ i(e) === "MY" ? (g(), w(I, {
1569
+ key: 0,
1570
+ modelValue: d.value,
1571
+ "onUpdate:modelValue": A[0] || (A[0] = (V) => d.value = V),
1572
+ style: { "padding-bottom": "12px" },
1573
+ label: "Use FeedMe's Default Account?"
1574
+ }, null, 8, ["modelValue"])) : E("", !0),
1575
+ n.value ? (g(), w(D, {
1576
+ key: 1,
1577
+ "model-value": i(c),
1578
+ "onUpdate:modelValue": A[1] || (A[1] = (V) => ae(c) ? c.value = V : null),
1579
+ class: "mb-6",
1580
+ items: r.value
1581
+ }, null, 8, ["model-value", "items"])) : E("", !0),
1582
+ n.value && i(c) ? (g(), w(ue((T = b.value) == null ? void 0 : T.render), se(re({ key: 2 }, {
1583
+ gateway: m.value.find(
1584
+ (V) => {
1585
+ var x;
1586
+ return V.paymentGateway === ((x = b.value) == null ? void 0 : x.value);
1587
+ }
1588
+ ),
1589
+ onDelete: async () => {
1590
+ m.value = m.value.filter(
1591
+ (V) => {
1592
+ var x;
1593
+ return V.paymentGateway !== ((x = b.value) == null ? void 0 : x.value);
1594
+ }
1595
+ ), p(m.value);
1596
+ },
1597
+ onUpdate: (V) => {
1598
+ var $;
1599
+ let x = m.value.find(
1600
+ (B) => {
1601
+ var R;
1602
+ return B.paymentGateway === ((R = b.value) == null ? void 0 : R.value);
1603
+ }
1604
+ );
1605
+ x ? x.config = V : m.value.push({
1606
+ paymentGateway: ($ = b.value) == null ? void 0 : $.value,
1607
+ config: V
1608
+ }), p(m.value);
1609
+ }
1610
+ })), null, 16)) : E("", !0)
1611
+ ], 64))
1612
+ ], 64);
1613
+ };
1614
+ }
1615
+ }), dt = { class: "flex mt-6 space-x-6" }, pt = /* @__PURE__ */ M({
1616
+ __name: "GooglePayToken",
1617
+ props: {
1618
+ gateway: {
1619
+ type: Object,
1620
+ required: !0
1621
+ },
1622
+ onUpdate: {
1623
+ type: Function,
1624
+ required: !0
1625
+ },
1626
+ onDelete: {
1627
+ type: Function,
1628
+ required: !0
1629
+ }
1630
+ },
1631
+ setup(a) {
1632
+ const e = U(
1633
+ a.gateway || {
1634
+ type: "googlePay",
1635
+ gateway: "RAZER_MERCHANT_SERVICE",
1636
+ config: {
1637
+ gateway: "molpay",
1638
+ gatewayMerchantId: "molpay"
1639
+ }
1640
+ }
1641
+ );
1642
+ return (v, u) => {
1643
+ const t = y("FmTextField"), c = y("FmButton"), F = y("FmForm");
1644
+ return g(), w(F, {
1645
+ ref: "form",
1646
+ class: "flex flex-col gap-16",
1647
+ onValidationSuccess: u[3] || (u[3] = () => a.onUpdate(e.value))
1648
+ }, {
1649
+ default: k(() => [
1650
+ o(t, {
1651
+ modelValue: e.value.gateway,
1652
+ "onUpdate:modelValue": u[0] || (u[0] = (f) => e.value.gateway = f),
1653
+ label: "Gateway",
1654
+ disabled: !0,
1655
+ rules: i(N)(i(h).string())
1656
+ }, null, 8, ["modelValue", "rules"]),
1657
+ o(t, {
1658
+ modelValue: e.value.config.gateway,
1659
+ "onUpdate:modelValue": u[1] || (u[1] = (f) => e.value.config.gateway = f),
1660
+ label: "Gateway ID",
1661
+ disabled: !0,
1662
+ rules: i(N)(i(h).string())
1663
+ }, null, 8, ["modelValue", "rules"]),
1664
+ o(t, {
1665
+ modelValue: e.value.config.gatewayMerchantId,
1666
+ "onUpdate:modelValue": u[2] || (u[2] = (f) => e.value.config.gatewayMerchantId = f),
1667
+ label: "Gateway Merchant ID",
1668
+ disabled: !0,
1669
+ rules: i(N)(i(h).string())
1670
+ }, null, 8, ["modelValue", "rules"]),
1671
+ s("div", dt, [
1672
+ a.gateway ? (g(), w(c, {
1673
+ key: 0,
1674
+ class: "flex-1",
1675
+ variant: "secondary",
1676
+ label: "Delete",
1677
+ onclick: () => a.onDelete()
1678
+ }, null, 8, ["onclick"])) : E("", !0),
1679
+ o(c, {
1680
+ type: "submit",
1681
+ class: "flex-1",
1682
+ variant: "primary",
1683
+ label: "Save"
1684
+ })
1685
+ ])
1686
+ ]),
1687
+ _: 1
1688
+ }, 512);
1689
+ };
1690
+ }
1691
+ }), yt = { class: "flex mt-6 space-x-6" }, bt = /* @__PURE__ */ M({
1692
+ __name: "ApplePayToken",
1693
+ props: {
1694
+ gateway: {
1695
+ type: Object,
1696
+ required: !0
1697
+ },
1698
+ onUpdate: {
1699
+ type: Function,
1700
+ required: !0
1701
+ },
1702
+ onDelete: {
1703
+ type: Function,
1704
+ required: !0
1705
+ }
1706
+ },
1707
+ setup(a) {
1708
+ const e = U(
1709
+ a.gateway || {
1710
+ type: "applePay",
1711
+ gateway: "RAZER_MERCHANT_SERVICE",
1712
+ config: {
1713
+ merchantId: "FMfeedme"
1714
+ }
1715
+ }
1716
+ );
1717
+ return (v, u) => {
1718
+ const t = y("FmTextField"), c = y("FmButton"), F = y("FmForm");
1719
+ return g(), w(F, {
1720
+ ref: "form",
1721
+ class: "flex flex-col gap-16",
1722
+ onValidationSuccess: u[2] || (u[2] = () => a.onUpdate(e.value))
1723
+ }, {
1724
+ default: k(() => [
1725
+ o(t, {
1726
+ modelValue: e.value.gateway,
1727
+ "onUpdate:modelValue": u[0] || (u[0] = (f) => e.value.gateway = f),
1728
+ label: "Gateway",
1729
+ disabled: !0,
1730
+ rules: i(N)(i(h).string())
1731
+ }, null, 8, ["modelValue", "rules"]),
1732
+ o(t, {
1733
+ modelValue: e.value.config.merchantId,
1734
+ "onUpdate:modelValue": u[1] || (u[1] = (f) => e.value.config.merchantId = f),
1735
+ label: "Merchant ID",
1736
+ disabled: !0,
1737
+ rules: i(N)(i(h).string())
1738
+ }, null, 8, ["modelValue", "rules"]),
1739
+ s("div", yt, [
1740
+ a.gateway ? (g(), w(c, {
1741
+ key: 0,
1742
+ class: "flex-1",
1743
+ variant: "secondary",
1744
+ label: "Delete",
1745
+ onclick: () => a.onDelete()
1746
+ }, null, 8, ["onclick"])) : E("", !0),
1747
+ o(c, {
1748
+ type: "submit",
1749
+ class: "flex-1",
1750
+ variant: "primary",
1751
+ label: "Save"
1752
+ })
1753
+ ])
1754
+ ]),
1755
+ _: 1
1756
+ }, 512);
1757
+ };
1758
+ }
1759
+ }), vt = {
1760
+ key: 0,
1761
+ class: "flex items-center justify-center min-h-[80vh]"
1762
+ }, ft = /* @__PURE__ */ M({
1763
+ __name: "TokenGateway",
1764
+ props: {
1765
+ payoutAccount: {
1766
+ type: Object,
1767
+ required: !0
1768
+ }
1769
+ },
1770
+ setup(a) {
1771
+ const l = pe().currentCountry, e = W(), { isLoading: v, startAsyncCall: u } = ne(), { tokenTab: t } = oe({
1772
+ tokenTab: ""
1773
+ }), c = a, F = [
1774
+ {
1775
+ label: "Google Pay",
1776
+ value: "googlePay",
1777
+ icon: "android",
1778
+ render: pt,
1779
+ region: [O.F_COUNTRY.enum.MY, O.F_COUNTRY.enum.SG]
1780
+ },
1781
+ {
1782
+ label: "Apple Pay",
1783
+ value: "applePay",
1784
+ icon: "iOS",
1785
+ render: bt,
1786
+ region: [O.F_COUNTRY.enum.MY, O.F_COUNTRY.enum.SG]
1787
+ }
1788
+ ], f = U(c.payoutAccount.tokens ?? []), m = L(() => F.find((p) => p.value === t.value)), b = L(() => F.filter(
1789
+ (p) => p.region.includes(l.value ?? O.F_COUNTRY.enum.MY)
1790
+ ));
1791
+ async function r(p) {
1792
+ await u(async () => {
1793
+ try {
1794
+ await Y.updateTokens(c.payoutAccount._id, p), e.open({
1795
+ type: "success",
1796
+ title: "Payout account tokens gateway update succesfully"
1797
+ });
1798
+ } catch (d) {
1799
+ e.open({
1800
+ type: "error",
1801
+ title: "Error occurs when updating payout account tokens",
1802
+ message: Z(d)
1803
+ });
1804
+ }
1805
+ });
1806
+ }
1807
+ return (p, d) => {
1808
+ var A;
1809
+ const n = y("FmCircularProgress"), S = y("FmTabs");
1810
+ return g(), G(K, null, [
1811
+ d[1] || (d[1] = s("p", { className: "mt-1 my-6 text-gray-600" }, [
1812
+ s("b", null, "Note: "),
1813
+ _(" Token gateways appear above other online payment channels to comply with provider branding requirements. Configuration is standardized, so you generally only need to select the provider. "),
1814
+ s("br"),
1815
+ s("br"),
1816
+ s("b", null, ` Token payments are automatically enabled for "Pay-First" merchants. You do not need to adjust settings here unless you're modifying for a non-Pay-First merchant who wishes to manually enable this feature. `),
1817
+ s("br")
1818
+ ], -1)),
1819
+ i(v) ? (g(), G("div", vt, [
1820
+ o(n, { size: "xxl" })
1821
+ ])) : (g(), w(S, {
1822
+ key: 1,
1823
+ "model-value": i(t),
1824
+ "onUpdate:modelValue": d[0] || (d[0] = (C) => ae(t) ? t.value = C : null),
1825
+ class: "mb-6 mt-6",
1826
+ items: b.value
1827
+ }, null, 8, ["model-value", "items"])),
1828
+ i(t) ? (g(), w(ue((A = m.value) == null ? void 0 : A.render), se(re({ key: 2 }, {
1829
+ gateway: f.value.find((C) => {
1830
+ var I;
1831
+ return C.type === ((I = m.value) == null ? void 0 : I.value);
1832
+ }),
1833
+ onDelete: async () => {
1834
+ f.value = f.value.filter((C) => {
1835
+ var I;
1836
+ return C.type !== ((I = m.value) == null ? void 0 : I.value);
1837
+ }), r(f.value);
1838
+ },
1839
+ onUpdate: (C) => {
1840
+ let I = f.value.find((D) => {
1841
+ var T;
1842
+ return D.type === ((T = m.value) == null ? void 0 : T.value);
1843
+ });
1844
+ I ? I.config = C : f.value.push(C), r(f.value);
1845
+ }
1846
+ })), null, 16)) : E("", !0)
1847
+ ], 64);
1848
+ };
1849
+ }
1850
+ }), Tt = /* @__PURE__ */ M({
1851
+ __name: "PayoutAccountSetting",
1852
+ props: {
1853
+ accountId: {
1854
+ type: String,
1855
+ required: !0
1856
+ }
1857
+ },
1858
+ setup(a) {
1859
+ const l = a, { tab: e } = oe({
1860
+ tab: "information"
1861
+ }), { isLoading: v, startAsyncCall: u } = ne(!0), t = ve(), c = U();
1862
+ async function F(r) {
1863
+ await Y.updateById(
1864
+ l.accountId,
1865
+ r
1866
+ ), c.value = await Y.readById(l.accountId);
1867
+ }
1868
+ const f = [
1869
+ {
1870
+ label: "Information",
1871
+ value: "information",
1872
+ icon: "overview",
1873
+ render: Ue
1874
+ },
1875
+ {
1876
+ label: "Settlement",
1877
+ value: "settlement",
1878
+ icon: "payments",
1879
+ render: Ee
1880
+ },
1881
+ {
1882
+ label: "MDR Status",
1883
+ value: "payment",
1884
+ icon: "account_box",
1885
+ render: ze
1886
+ },
1887
+ {
1888
+ label: "Online Gateways",
1889
+ icon: "assured_workload",
1890
+ value: "gateways",
1891
+ render: mt
1892
+ },
1893
+ {
1894
+ label: "Token Gateways",
1895
+ value: "tokens",
1896
+ icon: "wallet",
1897
+ render: ft
1898
+ },
1899
+ {
1900
+ label: "Online Channels",
1901
+ icon: "shopping_cart",
1902
+ value: "channels",
1903
+ render: Qe
1904
+ }
1905
+ ];
1906
+ function m() {
1907
+ u(async () => {
1908
+ c.value = await Y.readById(l.accountId);
1909
+ });
1910
+ }
1911
+ me(m);
1912
+ const b = L(() => {
1913
+ const r = f.reduce((p, d) => p || (d.children ? d.children.find((n) => n.value === e.value) || null : d.value === e.value ? d : null), null);
1914
+ return r == null ? void 0 : r.render;
1915
+ });
1916
+ return (r, p) => {
1917
+ var n;
1918
+ const d = y("FmTabs");
1919
+ return g(), w(be, {
1920
+ title: `Payout Account (${(n = c.value) == null ? void 0 : n._id})`,
1921
+ loading: i(v),
1922
+ onBack: i(t).back
1923
+ }, {
1924
+ default: k(() => [
1925
+ o(d, {
1926
+ "model-value": i(e),
1927
+ "onUpdate:modelValue": p[0] || (p[0] = (S) => ae(e) ? e.value = S : null),
1928
+ class: "mb-6",
1929
+ items: f
1930
+ }, null, 8, ["model-value"]),
1931
+ i(e) ? (g(), w(ue(b.value), se(re({ key: 0 }, {
1932
+ payoutAccount: c.value,
1933
+ onUpdate: F
1934
+ })), null, 16)) : E("", !0)
1935
+ ]),
1936
+ _: 1
1937
+ }, 8, ["title", "loading", "onBack"]);
1938
+ };
1939
+ }
1940
+ });
1941
+ export {
1942
+ Tt as default
1943
+ };