@feedmepos/mf-payment 1.2.5 → 1.2.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 (60) hide show
  1. package/dist/{PayoutAccount-D9LY7i1J.js → PayoutAccount-CFFgQ_65.js} +6 -6
  2. package/dist/{PayoutAccount-DEoI6K0j.js → PayoutAccount-CSm0Ldg9.js} +5 -5
  3. package/dist/{PayoutAccountSetting-5lrvWFIz.js → PayoutAccountSetting-rO11Afiw.js} +3 -3
  4. package/dist/{Restaurant-AxoM-AsE.js → Restaurant-CoNFB1rk.js} +4 -4
  5. package/dist/RestaurantSetting-BQvg8S_p.js +628 -0
  6. package/dist/{Settlement-D4CsP3fg.js → Settlement-DEKvU0zP.js} +3 -3
  7. package/dist/{Settlement-DDwe_w3m.js → Settlement-DpmBq0V9.js} +3 -3
  8. package/dist/{SettlementTransactions-Cmv7dqVI.js → SettlementTransactions-3alZwucT.js} +3 -3
  9. package/dist/{SettlementTransactions-Dp3nN442.js → SettlementTransactions-DugNdpd2.js} +3 -3
  10. package/dist/{Terminal-B8UQH6ga.js → Terminal-Dv7zS_te.js} +5 -5
  11. package/dist/{TerminalSetting-yRok1Iuc.js → TerminalSetting-ChM9jB-O.js} +3 -3
  12. package/dist/{Transaction-KkfCz4Cu.js → Transaction-CT8Be7FS.js} +7 -7
  13. package/dist/{Transaction-BZ7H6oB_.js → Transaction-DCKhuoVw.js} +5 -5
  14. package/dist/{TransactionOld-BLpQHFH1.js → TransactionOld-jkTy7Aeb.js} +4 -4
  15. package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-C4Bb203Q.js → TransactionTable.vue_vue_type_script_setup_true_lang-B_By7BvK.js} +3 -3
  16. package/dist/api/payment-gateway/index.d.ts +3 -0
  17. package/dist/{app-I2TNuZCs.js → app-CiHNgoQY.js} +181 -181
  18. package/dist/app.js +1 -1
  19. package/dist/{assets-D5Qc4r7j.js → assets-BqjaEXmB.js} +2 -2
  20. package/dist/{grafana-BAbIv4CF.js → grafana-Bwx9Kj61.js} +1 -1
  21. package/dist/{index-D209n4gS.js → index-1q4ZbRix.js} +4203 -4162
  22. package/dist/{index-CnGVTtwu.js → index-BIDuwnm_.js} +1 -1
  23. package/dist/{index-Cc0abuxv.js → index-C3fxBVdz.js} +1 -1
  24. package/dist/{index-DGcRvKvr.js → index-CCIVpogO.js} +1 -1
  25. package/dist/{index-CguRXKmG.js → index-CN50SqVG.js} +1 -1
  26. package/dist/{index-bOlAWIVP.js → index-CZrwq9oF.js} +1 -1
  27. package/dist/{index-1NP0WkxZ.js → index-CyMElhGL.js} +2 -2
  28. package/dist/{index.vue_vue_type_script_setup_true_lang-HYqCCZsZ.js → index.vue_vue_type_script_setup_true_lang-DT8A92zR.js} +1 -1
  29. package/dist/package.json +2 -2
  30. package/dist/{payout-account-DNGKjfY1.js → payout-account-cg0CKkbk.js} +3 -3
  31. package/dist/stores/payoutAccount.d.ts +18 -18
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +18 -18
  34. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +44 -44
  35. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +44 -44
  36. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +18 -18
  37. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +18 -18
  38. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +44 -44
  39. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +4 -4
  40. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  41. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  42. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +10 -10
  43. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +10 -10
  44. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +46 -0
  45. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +10 -10
  46. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +8 -8
  47. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +4 -4
  48. package/dist/views/admin/terminal/TerminalDialog.vue.d.ts +18 -18
  49. package/dist/views/admin/terminal/tabs/GhlGateway.vue.d.ts +18 -18
  50. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +18 -18
  51. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +18 -18
  52. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +18 -18
  53. package/dist/views/admin/terminal/tabs/TerminalGateway.vue.d.ts +18 -18
  54. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +18 -18
  55. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +36 -36
  56. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +36 -36
  57. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +18 -18
  58. package/dist/views/settlement/SettlementTable.vue.d.ts +4 -4
  59. package/package.json +2 -2
  60. package/dist/RestaurantSetting-B6LQF664.js +0 -501
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as y, resolveComponent as u, openBlock as h, createBlock as k, normalizeClass as N, withCtx as c, createElementVNode as P, toDisplayString as I, createVNode as i, computed as x, ref as S, watch as F, unref as r, isRef as f, h as v } from "vue";
2
- import { u as O } from "./index-Cc0abuxv.js";
3
- import { _ as K } from "./index-CguRXKmG.js";
2
+ import { u as O } from "./index-C3fxBVdz.js";
3
+ import { _ as K } from "./index-CN50SqVG.js";
4
4
  import { _ as A } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
5
- import { P as V } from "./payout-account-DNGKjfY1.js";
6
- import { p as D } from "./index-1NP0WkxZ.js";
5
+ import { P as V } from "./payout-account-cg0CKkbk.js";
6
+ import { p as D } from "./index-CyMElhGL.js";
7
7
  import "@feedmepos/ui-library";
8
- import "./index-D209n4gS.js";
9
- import { _ as T } from "./index.vue_vue_type_script_setup_true_lang-HYqCCZsZ.js";
8
+ import "./index-1q4ZbRix.js";
9
+ import { _ as T } from "./index.vue_vue_type_script_setup_true_lang-DT8A92zR.js";
10
10
  import { useRouter as U } from "vue-router";
11
11
  import { _ as $ } from "./SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js";
12
12
  const G = /* @__PURE__ */ y({
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as P, ref as W, reactive as sA, computed as I, watch as AA, resolveComponent as V, openBlock as c, createElementBlock as x, Fragment as tA, unref as a, createVNode as m, createBlock as i, createCommentVNode as j, withCtx as q, createElementVNode as n, toDisplayString as z, normalizeClass as k, h as N, onMounted as oA } from "vue";
2
- import { p as K } from "./index-1NP0WkxZ.js";
3
- import { u as gA, e as lA } from "./index-D209n4gS.js";
2
+ import { p as K } from "./index-CyMElhGL.js";
3
+ import { u as gA, e as lA } from "./index-1q4ZbRix.js";
4
4
  import { defineStore as rA } from "pinia";
5
5
  import { useI18n as R, useCoreStore as eA } from "@feedmepos/mf-common";
6
- import { c as cA, a as _, P as J } from "./payout-account-DNGKjfY1.js";
6
+ import { c as cA, a as _, P as J } from "./payout-account-cg0CKkbk.js";
7
7
  import { useDialogChild as nA, useDialog as BA } from "@feedmepos/ui-library";
8
8
  import { z as F, a as H } from "./validator-D5jtpt9A.js";
9
- import { _ as U } from "./index-CguRXKmG.js";
9
+ import { _ as U } from "./index-CN50SqVG.js";
10
10
  import { P as $ } from "./PDFViewer-xrBtzrlR.js";
11
- import "./app-I2TNuZCs.js";
11
+ import "./app-CiHNgoQY.js";
12
12
  import { _ as uA } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
13
13
  function wA() {
14
14
  return {
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as V, resolveComponent as p, openBlock as g, createElementBlock as _, Fragment as $, createElementVNode as i, createVNode as r, withCtx as k, createTextVNode as C, toDisplayString as U, createCommentVNode as P, createBlock as x, ref as T, watch as W, computed as D, unref as c, isRef as q, h as G, onMounted as J, resolveDynamicComponent as Y, normalizeProps as L, mergeProps as H } from "vue";
2
- import { p as N } from "./index-1NP0WkxZ.js";
3
- import { u as j, e as R } from "./index-D209n4gS.js";
2
+ import { p as N } from "./index-CyMElhGL.js";
3
+ import { u as j, e as R } from "./index-1q4ZbRix.js";
4
4
  import { _ as ee } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
5
5
  import { useRouter as te } from "vue-router";
6
- import { u as K } from "./index-Cc0abuxv.js";
6
+ import { u as K } from "./index-C3fxBVdz.js";
7
7
  import { P as Q } from "./PDFViewer-xrBtzrlR.js";
8
8
  import { useSnackbar as z, components as ae } from "@feedmepos/ui-library";
9
9
  import { u as B } from "./error-K1CakhA9.js";
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as F, ref as y, resolveComponent as g, openBlock as x, createBlock as A, withCtx as $, createVNode as f, createElementVNode as d, normalizeStyle as T, createElementBlock as R, Fragment as z, renderList as q, computed as C, watch as I, onMounted as N, unref as h, toDisplayString as B, normalizeClass as W, isRef as E, h as P } from "vue";
2
- import { u as O } from "./index-Cc0abuxv.js";
2
+ import { u as O } from "./index-C3fxBVdz.js";
3
3
  import { _ as j } from "./AdminLayout.vue_vue_type_script_setup_true_lang-BTmMOzwx.js";
4
4
  import "@feedmepos/ui-library";
5
- import { u as G } from "./index-D209n4gS.js";
5
+ import { u as G } from "./index-1q4ZbRix.js";
6
6
  import { _ as Q } from "./AutoCopyCell.vue_vue_type_script_setup_true_lang-CdmfrBoW.js";
7
- import { r as H } from "./index-DGcRvKvr.js";
7
+ import { r as H } from "./index-CCIVpogO.js";
8
8
  import { useRouter as J } from "vue-router";
9
- import { g as X } from "./grafana-BAbIv4CF.js";
9
+ import { g as X } from "./grafana-Bwx9Kj61.js";
10
10
  const Y = ["id"], L = /* @__PURE__ */ F({
11
11
  __name: "FmTableSelection",
12
12
  props: {
@@ -0,0 +1,628 @@
1
+ import { defineComponent as T, ref as b, resolveComponent as s, openBlock as V, createBlock as x, withCtx as D, createVNode as o, unref as l, createElementVNode as R, createCommentVNode as U, computed as q, onMounted as $, createElementBlock as O, Fragment as Y, resolveDynamicComponent as B, normalizeProps as K, mergeProps as P, isRef as L } from "vue";
2
+ import { g as A, b as M, u as N, e as k } from "./index-1q4ZbRix.js";
3
+ import { _ as j } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
4
+ import { useRouter as z } from "vue-router";
5
+ import { u as H } from "./index-C3fxBVdz.js";
6
+ import { z as p, a as f } from "./validator-D5jtpt9A.js";
7
+ import { useCoreStore as E } from "@feedmepos/mf-common";
8
+ import { u as Q } from "./error-K1CakhA9.js";
9
+ import { useSnackbar as Z } from "@feedmepos/ui-library";
10
+ import { r as h } from "./index-CCIVpogO.js";
11
+ const G = {
12
+ async get(n) {
13
+ return A(
14
+ await M().get(
15
+ `restaurants/${n}/payment-gateway`
16
+ )
17
+ );
18
+ },
19
+ async upsert(n, d) {
20
+ return A(
21
+ await M().post(
22
+ `restaurants/${n}/payment-gateway`,
23
+ { data: d }
24
+ )
25
+ );
26
+ },
27
+ async delete(n, d) {
28
+ return A(
29
+ await M().delete(
30
+ `restaurants/${n}/payment-gateway/${d}`
31
+ )
32
+ );
33
+ },
34
+ async grabSync(n) {
35
+ return A(
36
+ await M().post(
37
+ `restaurants/${n}/payment-gateway/grab/sync`
38
+ )
39
+ );
40
+ }
41
+ }, J = { class: "flex mt-6 space-x-6" }, W = /* @__PURE__ */ T({
42
+ __name: "FiuuGateway",
43
+ props: {
44
+ onUpdate: {
45
+ type: Function,
46
+ required: !0
47
+ },
48
+ onDelete: {
49
+ type: Function,
50
+ required: !0
51
+ },
52
+ gateway: {
53
+ type: Object,
54
+ required: !0
55
+ }
56
+ },
57
+ setup(n) {
58
+ var g, c;
59
+ const d = n, r = b(((g = d.gateway) == null ? void 0 : g.active) ?? !1), t = b(((c = d.gateway) == null ? void 0 : c.config) || {
60
+ merchantId: "",
61
+ uniqueId: "",
62
+ verifyKey: "",
63
+ secretKey: "",
64
+ applicationCode: "",
65
+ offlineSecret: ""
66
+ });
67
+ return (m, e) => {
68
+ const i = s("FmTextField"), w = s("FmSwitch"), v = s("FmButton"), y = s("FmForm");
69
+ return V(), x(y, {
70
+ ref: "form",
71
+ class: "flex flex-col gap-16",
72
+ onValidationSuccess: e[7] || (e[7] = () => n.onUpdate(r.value, t.value))
73
+ }, {
74
+ default: D(() => [
75
+ o(i, {
76
+ modelValue: t.value.merchantId,
77
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => t.value.merchantId = a),
78
+ label: "Merchant ID",
79
+ rules: l(p)(l(f).string())
80
+ }, null, 8, ["modelValue", "rules"]),
81
+ o(i, {
82
+ modelValue: t.value.uniqueId,
83
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => t.value.uniqueId = a),
84
+ label: "Unique ID",
85
+ rules: l(p)(l(f).string())
86
+ }, null, 8, ["modelValue", "rules"]),
87
+ o(i, {
88
+ modelValue: t.value.verifyKey,
89
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => t.value.verifyKey = a),
90
+ label: "Verify Key",
91
+ rules: l(p)(l(f).string())
92
+ }, null, 8, ["modelValue", "rules"]),
93
+ o(i, {
94
+ modelValue: t.value.secretKey,
95
+ "onUpdate:modelValue": e[3] || (e[3] = (a) => t.value.secretKey = a),
96
+ label: "Secret Key",
97
+ rules: l(p)(l(f).string())
98
+ }, null, 8, ["modelValue", "rules"]),
99
+ o(i, {
100
+ modelValue: t.value.applicationCode,
101
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => t.value.applicationCode = a),
102
+ label: "Application Code ( Offline )",
103
+ rules: l(p)(l(f).string())
104
+ }, null, 8, ["modelValue", "rules"]),
105
+ o(i, {
106
+ modelValue: t.value.offlineSecret,
107
+ "onUpdate:modelValue": e[5] || (e[5] = (a) => t.value.offlineSecret = a),
108
+ label: "Offline Secret ( Offline )",
109
+ rules: l(p)(l(f).string())
110
+ }, null, 8, ["modelValue", "rules"]),
111
+ o(w, {
112
+ modelValue: r.value,
113
+ "onUpdate:modelValue": e[6] || (e[6] = (a) => r.value = a),
114
+ label: "Is Active"
115
+ }, null, 8, ["modelValue"]),
116
+ R("div", J, [
117
+ n.gateway ? (V(), x(v, {
118
+ key: 0,
119
+ class: "flex-1",
120
+ variant: "secondary",
121
+ label: "Delete",
122
+ onclick: () => n.onDelete(n.gateway)
123
+ }, null, 8, ["onclick"])) : U("", !0),
124
+ o(v, {
125
+ type: "submit",
126
+ class: "flex-1",
127
+ variant: "primary",
128
+ label: "Save"
129
+ })
130
+ ])
131
+ ]),
132
+ _: 1
133
+ }, 512);
134
+ };
135
+ }
136
+ }), X = { class: "flex mt-6 space-x-6" }, ee = /* @__PURE__ */ T({
137
+ __name: "RevenueMonsterGateway",
138
+ props: {
139
+ onUpdate: {
140
+ type: Function,
141
+ required: !0
142
+ },
143
+ onDelete: {
144
+ type: Function,
145
+ required: !0
146
+ },
147
+ gateway: {
148
+ type: Object,
149
+ required: !0
150
+ }
151
+ },
152
+ setup(n) {
153
+ var g, c;
154
+ const d = n, r = b(((g = d.gateway) == null ? void 0 : g.active) ?? !1), t = b(((c = d.gateway) == null ? void 0 : c.config) || {
155
+ storeId: "",
156
+ clientId: "",
157
+ clientSecret: "",
158
+ clientPrivateKey: ""
159
+ });
160
+ return (m, e) => {
161
+ const i = s("FmTextField"), w = s("FmTextarea"), v = s("FmSwitch"), y = s("FmButton"), a = s("FmForm");
162
+ return V(), x(a, {
163
+ ref: "form",
164
+ class: "flex flex-col gap-16",
165
+ onValidationSuccess: e[5] || (e[5] = () => n.onUpdate(r.value, t.value))
166
+ }, {
167
+ default: D(() => [
168
+ o(i, {
169
+ modelValue: t.value.storeId,
170
+ "onUpdate:modelValue": e[0] || (e[0] = (u) => t.value.storeId = u),
171
+ label: "Store ID",
172
+ rules: l(p)(l(f).string())
173
+ }, null, 8, ["modelValue", "rules"]),
174
+ o(i, {
175
+ modelValue: t.value.clientId,
176
+ "onUpdate:modelValue": e[1] || (e[1] = (u) => t.value.clientId = u),
177
+ label: "Client ID",
178
+ rules: l(p)(l(f).string())
179
+ }, null, 8, ["modelValue", "rules"]),
180
+ o(i, {
181
+ modelValue: t.value.clientSecret,
182
+ "onUpdate:modelValue": e[2] || (e[2] = (u) => t.value.clientSecret = u),
183
+ label: "Client Secret",
184
+ rules: l(p)(l(f).string())
185
+ }, null, 8, ["modelValue", "rules"]),
186
+ o(w, {
187
+ modelValue: t.value.clientPrivateKey,
188
+ "onUpdate:modelValue": e[3] || (e[3] = (u) => t.value.clientPrivateKey = u),
189
+ label: "Client Private Key"
190
+ }, null, 8, ["modelValue"]),
191
+ o(v, {
192
+ modelValue: r.value,
193
+ "onUpdate:modelValue": e[4] || (e[4] = (u) => r.value = u),
194
+ label: "Is Active"
195
+ }, null, 8, ["modelValue"]),
196
+ R("div", X, [
197
+ n.gateway ? (V(), x(y, {
198
+ key: 0,
199
+ class: "flex-1",
200
+ variant: "secondary",
201
+ label: "Delete",
202
+ onclick: () => n.onDelete(n.gateway)
203
+ }, null, 8, ["onclick"])) : U("", !0),
204
+ o(y, {
205
+ type: "submit",
206
+ class: "flex-1",
207
+ variant: "primary",
208
+ label: "Save"
209
+ })
210
+ ])
211
+ ]),
212
+ _: 1
213
+ }, 512);
214
+ };
215
+ }
216
+ }), te = { class: "flex mt-6 space-x-6" }, ae = /* @__PURE__ */ T({
217
+ __name: "GhlGateway",
218
+ props: {
219
+ onUpdate: {
220
+ type: Function,
221
+ required: !0
222
+ },
223
+ onDelete: {
224
+ type: Function,
225
+ required: !0
226
+ },
227
+ gateway: {
228
+ type: Object,
229
+ required: !0
230
+ }
231
+ },
232
+ setup(n) {
233
+ var g, c;
234
+ const d = n, r = b(((g = d.gateway) == null ? void 0 : g.active) ?? !1), t = b(((c = d.gateway) == null ? void 0 : c.config) || {
235
+ merchantId: "",
236
+ terminalId: "",
237
+ privateKey: ""
238
+ });
239
+ return (m, e) => {
240
+ const i = s("FmTextField"), w = s("FmTextarea"), v = s("FmSwitch"), y = s("FmButton"), a = s("FmForm");
241
+ return V(), x(a, {
242
+ ref: "form",
243
+ class: "flex flex-col gap-16",
244
+ onValidationSuccess: e[4] || (e[4] = () => n.onUpdate(r.value, t.value))
245
+ }, {
246
+ default: D(() => [
247
+ o(i, {
248
+ modelValue: t.value.merchantId,
249
+ "onUpdate:modelValue": e[0] || (e[0] = (u) => t.value.merchantId = u),
250
+ label: "Merchant ID",
251
+ rules: l(p)(l(f).string())
252
+ }, null, 8, ["modelValue", "rules"]),
253
+ o(i, {
254
+ modelValue: t.value.terminalId,
255
+ "onUpdate:modelValue": e[1] || (e[1] = (u) => t.value.terminalId = u),
256
+ label: "Terminal ID",
257
+ rules: l(p)(l(f).string())
258
+ }, null, 8, ["modelValue", "rules"]),
259
+ o(w, {
260
+ id: "ghl_pkey",
261
+ modelValue: t.value.privateKey,
262
+ "onUpdate:modelValue": e[2] || (e[2] = (u) => t.value.privateKey = u),
263
+ label: "Private Key",
264
+ rules: l(p)(l(f).string())
265
+ }, null, 8, ["modelValue", "rules"]),
266
+ o(v, {
267
+ modelValue: r.value,
268
+ "onUpdate:modelValue": e[3] || (e[3] = (u) => r.value = u),
269
+ label: "Is Active"
270
+ }, null, 8, ["modelValue"]),
271
+ R("div", te, [
272
+ n.gateway ? (V(), x(y, {
273
+ key: 0,
274
+ class: "flex-1",
275
+ variant: "secondary",
276
+ label: "Delete",
277
+ onclick: () => n.onDelete(n.gateway)
278
+ }, null, 8, ["onclick"])) : U("", !0),
279
+ o(y, {
280
+ type: "submit",
281
+ class: "flex-1",
282
+ variant: "primary",
283
+ label: "Save"
284
+ })
285
+ ])
286
+ ]),
287
+ _: 1
288
+ }, 512);
289
+ };
290
+ }
291
+ }), le = { class: "flex mt-6 space-x-6" }, ne = /* @__PURE__ */ T({
292
+ __name: "MacauPassGateway",
293
+ props: {
294
+ onUpdate: {
295
+ type: Function,
296
+ required: !0
297
+ },
298
+ onDelete: {
299
+ type: Function,
300
+ required: !0
301
+ },
302
+ gateway: {
303
+ type: Object,
304
+ required: !0
305
+ }
306
+ },
307
+ setup(n) {
308
+ var g, c;
309
+ const d = n, r = b(((g = d.gateway) == null ? void 0 : g.active) ?? !1), t = b(((c = d.gateway) == null ? void 0 : c.config) || {
310
+ merchantId: "",
311
+ merchantName: "",
312
+ merchantCategoryCode: "",
313
+ storeID: "",
314
+ storeName: ""
315
+ });
316
+ return (m, e) => {
317
+ const i = s("FmTextField"), w = s("FmSwitch"), v = s("FmButton"), y = s("FmForm");
318
+ return V(), x(y, {
319
+ ref: "form",
320
+ class: "flex flex-col gap-16",
321
+ onValidationSuccess: e[6] || (e[6] = () => n.onUpdate(r.value, t.value))
322
+ }, {
323
+ default: D(() => [
324
+ o(i, {
325
+ modelValue: t.value.merchantId,
326
+ "onUpdate:modelValue": e[0] || (e[0] = (a) => t.value.merchantId = a),
327
+ label: "Merchant ID",
328
+ rules: l(p)(l(f).string())
329
+ }, null, 8, ["modelValue", "rules"]),
330
+ o(i, {
331
+ modelValue: t.value.merchantName,
332
+ "onUpdate:modelValue": e[1] || (e[1] = (a) => t.value.merchantName = a),
333
+ label: "Merchant Name",
334
+ rules: l(p)(l(f).string())
335
+ }, null, 8, ["modelValue", "rules"]),
336
+ o(i, {
337
+ modelValue: t.value.merchantCategoryCode,
338
+ "onUpdate:modelValue": e[2] || (e[2] = (a) => t.value.merchantCategoryCode = a),
339
+ label: "Merchant MCC",
340
+ rules: l(p)(l(f).string())
341
+ }, null, 8, ["modelValue", "rules"]),
342
+ o(i, {
343
+ modelValue: t.value.storeID,
344
+ "onUpdate:modelValue": e[3] || (e[3] = (a) => t.value.storeID = a),
345
+ label: "Store ID",
346
+ rules: l(p)(l(f).string())
347
+ }, null, 8, ["modelValue", "rules"]),
348
+ o(i, {
349
+ modelValue: t.value.storeName,
350
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => t.value.storeName = a),
351
+ label: "Store Name",
352
+ rules: l(p)(l(f).string())
353
+ }, null, 8, ["modelValue", "rules"]),
354
+ o(w, {
355
+ modelValue: r.value,
356
+ "onUpdate:modelValue": e[5] || (e[5] = (a) => r.value = a),
357
+ label: "Is Active"
358
+ }, null, 8, ["modelValue"]),
359
+ R("div", le, [
360
+ n.gateway ? (V(), x(v, {
361
+ key: 0,
362
+ class: "flex-1",
363
+ variant: "secondary",
364
+ label: "Delete",
365
+ onclick: () => n.onDelete(n.gateway)
366
+ }, null, 8, ["onclick"])) : U("", !0),
367
+ o(v, {
368
+ type: "submit",
369
+ class: "flex-1",
370
+ variant: "primary",
371
+ label: "Save"
372
+ })
373
+ ])
374
+ ]),
375
+ _: 1
376
+ }, 512);
377
+ };
378
+ }
379
+ }), oe = {
380
+ class: "flex items-end",
381
+ '"': ""
382
+ }, ue = { class: "flex mt-6 space-x-6" }, re = /* @__PURE__ */ T({
383
+ __name: "GrabGateway",
384
+ props: {
385
+ onUpdate: {
386
+ type: Function,
387
+ required: !0
388
+ },
389
+ onDelete: {
390
+ type: Function,
391
+ required: !0
392
+ },
393
+ gateway: {
394
+ type: Object,
395
+ required: !0
396
+ }
397
+ },
398
+ setup(n) {
399
+ var w, v;
400
+ const d = Z(), { isLoading: r, startAsyncCall: t } = N(), g = E(), c = n, m = b(((w = c.gateway) == null ? void 0 : w.active) ?? !1), e = b(((v = c.gateway) == null ? void 0 : v.config) || {
401
+ merchantId: ""
402
+ });
403
+ async function i() {
404
+ t(async () => {
405
+ var y;
406
+ try {
407
+ const { merchantID: a } = await G.grabSync(((y = g.currentRestaurant.value) == null ? void 0 : y._id) ?? "");
408
+ e.value.merchantId = a, m.value = !0, d.open({
409
+ type: "success",
410
+ title: "Grab Setting sync succesfully, you will still need to save the changes."
411
+ });
412
+ } catch (a) {
413
+ d.open({
414
+ type: "error",
415
+ title: "Error occurs when sync ordering settings",
416
+ message: Q(a)
417
+ });
418
+ }
419
+ });
420
+ }
421
+ return (y, a) => {
422
+ const u = s("FmTextField"), F = s("FmButton"), S = s("FmTooltip"), _ = s("FmSwitch"), I = s("FmForm");
423
+ return V(), x(I, {
424
+ ref: "form",
425
+ class: "flex flex-col gap-16",
426
+ onValidationSuccess: a[2] || (a[2] = () => n.onUpdate(m.value, e.value))
427
+ }, {
428
+ default: D(() => [
429
+ R("div", oe, [
430
+ o(u, {
431
+ modelValue: e.value.merchantId,
432
+ "onUpdate:modelValue": a[0] || (a[0] = (C) => e.value.merchantId = C),
433
+ label: "Merchant ID",
434
+ rules: l(p)(l(f).string())
435
+ }, null, 8, ["modelValue", "rules"]),
436
+ o(S, {
437
+ variant: "plain",
438
+ placement: "right",
439
+ content: "Sync from Ordering Settings"
440
+ }, {
441
+ default: D(() => [
442
+ o(F, {
443
+ class: "ml-2",
444
+ type: "button",
445
+ variant: "primary",
446
+ icon: "sync",
447
+ loading: l(r),
448
+ onclick: () => i()
449
+ }, null, 8, ["loading", "onclick"])
450
+ ]),
451
+ _: 1
452
+ })
453
+ ]),
454
+ o(_, {
455
+ modelValue: m.value,
456
+ "onUpdate:modelValue": a[1] || (a[1] = (C) => m.value = C),
457
+ label: "Is Active"
458
+ }, null, 8, ["modelValue"]),
459
+ R("div", ue, [
460
+ n.gateway ? (V(), x(F, {
461
+ key: 0,
462
+ class: "flex-1",
463
+ variant: "secondary",
464
+ label: "Delete",
465
+ onclick: () => n.onDelete(n.gateway)
466
+ }, null, 8, ["onclick"])) : U("", !0),
467
+ o(F, {
468
+ type: "submit",
469
+ class: "flex-1",
470
+ variant: "primary",
471
+ label: "Save"
472
+ })
473
+ ])
474
+ ]),
475
+ _: 1
476
+ }, 512);
477
+ };
478
+ }
479
+ }), se = {
480
+ key: 0,
481
+ class: "flex items-center justify-center min-h-[80vh]"
482
+ }, ie = /* @__PURE__ */ T({
483
+ __name: "PaymentGateway",
484
+ props: {
485
+ restaurant: {
486
+ type: Object,
487
+ required: !0
488
+ }
489
+ },
490
+ setup(n) {
491
+ const d = [
492
+ {
493
+ label: "Fiuu",
494
+ value: "RAZER_MERCHANT_SERVICE",
495
+ form: W,
496
+ region: [k.F_COUNTRY.enum.MY, k.F_COUNTRY.enum.SG]
497
+ },
498
+ {
499
+ label: "Revenue Monster",
500
+ value: "REVENUE_MONSTER",
501
+ form: ee,
502
+ region: [k.F_COUNTRY.enum.MY]
503
+ },
504
+ {
505
+ label: "GHL",
506
+ value: "E_GHL",
507
+ form: ae,
508
+ region: [k.F_COUNTRY.enum.MY]
509
+ },
510
+ {
511
+ label: "Grab",
512
+ value: "GRAB",
513
+ form: re,
514
+ region: [k.F_COUNTRY.enum.MY]
515
+ },
516
+ {
517
+ label: "Macau Pass",
518
+ value: "MACAU_PASS",
519
+ form: ne,
520
+ region: [k.F_COUNTRY.enum.MO]
521
+ }
522
+ ], r = n, t = E(), { isLoading: g, startAsyncCall: c } = N(), m = b(), e = b([]);
523
+ async function i(u, F) {
524
+ await c(async () => {
525
+ var I;
526
+ const S = {
527
+ _id: "",
528
+ _rev: "",
529
+ paymentGateway: m.value,
530
+ config: F,
531
+ active: u
532
+ }, _ = e.value.find((C) => C.paymentGateway === m.value);
533
+ _ && (S._id = _._id, S._rev = _._rev), await G.upsert(r.restaurant._id, S), e.value = await G.get(r.restaurant._id), m.value = (I = e.value.find((C) => C.active)) == null ? void 0 : I.paymentGateway;
534
+ });
535
+ }
536
+ async function w(u) {
537
+ c(async () => {
538
+ var F;
539
+ await G.delete(r.restaurant._id, u._id), e.value = await G.get(r.restaurant._id), m.value = (F = e.value.find((S) => S.active)) == null ? void 0 : F.paymentGateway;
540
+ });
541
+ }
542
+ const v = q(() => d.filter((u) => u.region.includes(t.currentCountry.value ?? k.F_COUNTRY.enum.MY)));
543
+ function y() {
544
+ c(async () => {
545
+ e.value = await G.get(r.restaurant._id), v.value.length > 0 && (m.value = v.value[0].value);
546
+ });
547
+ }
548
+ $(y);
549
+ const a = q(() => {
550
+ var u;
551
+ return (u = d.find((F) => F.value === m.value)) == null ? void 0 : u.form;
552
+ });
553
+ return (u, F) => {
554
+ const S = s("FmCircularProgress"), _ = s("FmTabs");
555
+ return V(), O(Y, null, [
556
+ l(g) ? (V(), O("div", se, [
557
+ o(S, { size: "xxl" })
558
+ ])) : U("", !0),
559
+ o(_, {
560
+ class: "mb-6",
561
+ "model-value": m.value,
562
+ "onUpdate:modelValue": F[0] || (F[0] = (I) => m.value = I),
563
+ items: v.value
564
+ }, null, 8, ["model-value", "items"]),
565
+ m.value ? (V(), x(B(a.value), K(P({ key: 1 }, {
566
+ gateway: e.value.find((I) => I.paymentGateway === m.value),
567
+ onDelete: w,
568
+ onUpdate: i
569
+ })), null, 16)) : U("", !0)
570
+ ], 64);
571
+ };
572
+ }
573
+ }), we = /* @__PURE__ */ T({
574
+ __name: "RestaurantSetting",
575
+ props: {
576
+ restaurantId: {
577
+ type: String,
578
+ required: !0
579
+ }
580
+ },
581
+ setup(n) {
582
+ const d = n, { tab: r } = H({
583
+ tab: "payment-gateway"
584
+ }), { isLoading: t, startAsyncCall: g } = N(!0), c = z(), m = b(), e = [
585
+ {
586
+ label: "Payment Gateway",
587
+ value: "payment-gateway",
588
+ icon: "assured_workload",
589
+ render: ie
590
+ }
591
+ ];
592
+ function i() {
593
+ g(async () => {
594
+ m.value = await h.readRestaurantById(d.restaurantId);
595
+ });
596
+ }
597
+ $(i);
598
+ const w = q(() => {
599
+ var v;
600
+ return (v = e.find((y) => y.value === r.value)) == null ? void 0 : v.render;
601
+ });
602
+ return (v, y) => {
603
+ var u;
604
+ const a = s("FmTabs");
605
+ return V(), x(j, {
606
+ title: `Restaurant (${(u = m.value) == null ? void 0 : u._id})`,
607
+ loading: l(t),
608
+ onBack: l(c).back
609
+ }, {
610
+ default: D(() => [
611
+ o(a, {
612
+ "model-value": l(r),
613
+ "onUpdate:modelValue": y[0] || (y[0] = (F) => L(r) ? r.value = F : null),
614
+ class: "mb-6",
615
+ items: e
616
+ }, null, 8, ["model-value"]),
617
+ l(r) && m.value ? (V(), x(B(w.value), K(P({ key: 0 }, {
618
+ restaurant: m.value
619
+ })), null, 16)) : U("", !0)
620
+ ]),
621
+ _: 1
622
+ }, 8, ["title", "loading", "onBack"]);
623
+ };
624
+ }
625
+ });
626
+ export {
627
+ we as default
628
+ };