@feedmepos/mf-payment 1.10.3 → 1.10.5-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 (95) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-DXXEAGNv.js → Actions.vue_vue_type_script_setup_true_lang-BIxmXhVi.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-DtDcZPiM.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-BOuAR3Jk.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-DzfC4Ydq.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-CVWH4h9m.js} +2 -2
  4. package/dist/{Chargeback-CeT1Lhsx.js → Chargeback-D-SaWEZ3.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-Anj6Ov3T.js → DocumentViewer.vue_vue_type_script_setup_true_lang-BddsB-O7.js} +9 -4
  6. package/dist/{ExternalTerminal-CVwXtIQi.js → ExternalTerminal-DSFdyxgo.js} +6 -6
  7. package/dist/OnboardForm-BW_d_NI5.js +22533 -0
  8. package/dist/OnboardForm-rjhOG28l.js +1519 -0
  9. package/dist/{OnboardSubmission-DbCS8yrY.js → OnboardSubmission-CvSo8EfH.js} +6 -6
  10. package/dist/{OnboardSubmission-CMjrVivi.js → OnboardSubmission-b73A_sV3.js} +3 -3
  11. package/dist/{PayoutAccount-DAyjFYUb.js → PayoutAccount-DaFv-aML.js} +5 -5
  12. package/dist/{PayoutAccount-BQmYnRti.js → PayoutAccount-q8erqoPY.js} +7 -7
  13. package/dist/{PayoutAccountSetting-B2GvHok3.js → PayoutAccountSetting-DxxdGfgG.js} +715 -722
  14. package/dist/{Restaurant-BQYJBsl7.js → Restaurant-CV8QkUbQ.js} +4 -4
  15. package/dist/{RestaurantSetting-BAGLuDkq.js → RestaurantSetting-CTlqvfdy.js} +3 -3
  16. package/dist/{Settlement-DRAn74x0.js → Settlement-Cl9Gg13I.js} +3 -3
  17. package/dist/{Settlement-ChindqhG.js → Settlement-iRQ6XDJ4.js} +4 -4
  18. package/dist/{SettlementTransactions-BQr5WvYC.js → SettlementTransactions-CHUT3xnm.js} +5 -5
  19. package/dist/{SettlementTransactions-CIGKFRsD.js → SettlementTransactions-blKyTkGq.js} +5 -5
  20. package/dist/{Status.vue_vue_type_script_setup_true_lang-D0RTxbYt.js → Status.vue_vue_type_script_setup_true_lang-D_nmEdyu.js} +1 -1
  21. package/dist/{Terminal-ITG71-h5.js → Terminal-BXvAm6w3.js} +6 -6
  22. package/dist/{TerminalSetting-DALz7UOI.js → TerminalSetting-C4o5IOpK.js} +6 -6
  23. package/dist/{Transaction-CMlbLJ40.js → Transaction-BIeW9fTK.js} +10 -10
  24. package/dist/{Transaction-CNczRMks.js → Transaction-DntiUDtA.js} +11 -11
  25. package/dist/{TransactionOld-Vc0BxLst.js → TransactionOld-BLrS-7GS.js} +7 -7
  26. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-D0IHQIDw.js → TransactionStatus.vue_vue_type_script_setup_true_lang-CjQ2GMrD.js} +1 -1
  27. package/dist/{app-DIXzt9ON.js → app-DyJjl-JW.js} +362 -353
  28. package/dist/app.js +1 -1
  29. package/dist/{assets-D6PvbkZQ.js → assets-Dli_wsgY.js} +1 -1
  30. package/dist/components/PDFViewer.vue.d.ts +11 -1
  31. package/dist/{grafana-CIUpjt-p.js → grafana-B_QqlaQQ.js} +1 -1
  32. package/dist/{index-VP68zTCg.js → index-8GWhPszq.js} +1 -1
  33. package/dist/{index-Dd0_PteU.js → index-B8bREy8p.js} +1 -1
  34. package/dist/{index-Gru3oQsi.js → index-BAEwRvM-.js} +1 -1
  35. package/dist/{index-Dhl-wJsD.js → index-C1n_Ih97.js} +1 -1
  36. package/dist/{index-DSzEV9Z2.js → index-CUDgQRLT.js} +1 -1
  37. package/dist/{index-BJz6amD9.js → index-CbTXFbRi.js} +1 -2
  38. package/dist/{index-cVqHUVQr.js → index-CqWAZhwv.js} +2 -2
  39. package/dist/{index-DSTvbZSY.js → index-Cvrxt3gd.js} +1 -1
  40. package/dist/{index-BtizhJgd.js → index-DjlqF6I0.js} +1 -1
  41. package/dist/{index-6ArggUS4.js → index-eEK4FJWw.js} +1 -1
  42. package/dist/{index.vue_vue_type_script_setup_true_lang-i75zV-qk.js → index.vue_vue_type_script_setup_true_lang-BBqaMh-p.js} +1 -1
  43. package/dist/model/payout-account.d.ts +2 -2
  44. package/dist/{onboard-submission-CaLG3ujz.js → onboard-submission-DW1TUY3U.js} +1 -1
  45. package/dist/package.json +2 -2
  46. package/dist/{payout-account-BuF5FTeH.js → payout-account-BEdIU70O.js} +3 -3
  47. package/dist/stores/payoutAccount.d.ts +16 -16
  48. package/dist/style.css +1 -1
  49. package/dist/tsconfig.app.tsbuildinfo +1 -1
  50. package/dist/views/admin/onboard-submission/cell/UploadButton.vue.d.ts +1 -1
  51. package/dist/views/admin/onboard-submission/forms/NTTSubmission.vue.d.ts +12 -12
  52. package/dist/views/admin/onboard-submission/forms/SoftspaceSubmission.vue.d.ts +12 -12
  53. package/dist/views/admin/onboard-submission/forms/TyroSubmission.vue.d.ts +12 -12
  54. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +16 -16
  55. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +38 -38
  56. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +38 -38
  57. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +16 -16
  58. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +16 -16
  59. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +38 -38
  60. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  61. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  62. package/dist/views/admin/settlement/SettlementTable.vue.d.ts +32 -32
  63. package/dist/views/admin/terminal/TerminalSideSheet.vue.d.ts +18 -18
  64. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +18 -18
  65. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +18 -18
  66. package/dist/views/admin/terminal/tabs/PaymentCheckout.vue.d.ts +18 -18
  67. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +18 -18
  68. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +18 -18
  69. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +18 -18
  70. package/dist/views/admin/terminal/tabs/ecr/BeamGateway.vue.d.ts +18 -18
  71. package/dist/views/admin/terminal/tabs/ecr/BriGateway.vue.d.ts +18 -18
  72. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +18 -18
  73. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +18 -18
  74. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +18 -18
  75. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +18 -18
  76. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +18 -18
  77. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +18 -18
  78. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +18 -18
  79. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +18 -18
  80. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +18 -18
  81. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +18 -18
  82. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +18 -18
  83. package/dist/views/admin/terminal/tabs/ecr/PbbGateway.vue.d.ts +18 -18
  84. package/dist/views/admin/terminal/tabs/ecr/RevenueGateway.vue.d.ts +18 -18
  85. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +18 -18
  86. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +18 -18
  87. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +18 -18
  88. package/dist/views/onboard-submission/cell/UploadButton.vue.d.ts +1 -1
  89. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +32 -32
  90. package/dist/views/settlement/FiuuSettlementTable.vue.d.ts +80 -80
  91. package/dist/views/settlement/FiuuSettlementTransactions.vue.d.ts +40 -40
  92. package/dist/views/settlement/SettlementTable.vue.d.ts +32 -32
  93. package/package.json +2 -2
  94. package/dist/OnboardForm-CwNYDJWa.js +0 -1463
  95. package/dist/OnboardForm-DIDPFAwq.js +0 -22368
@@ -0,0 +1,1519 @@
1
+ import { defineComponent as X, ref as j, computed as z, resolveComponent as N, openBlock as d, createElementBlock as w, createElementVNode as a, toDisplayString as F, createBlock as U, withCtx as f, createCommentVNode as $, createVNode as n, unref as e, Fragment as K, renderList as G, createTextVNode as J, onMounted as Ve, resolveDynamicComponent as ve } from "vue";
2
+ import { o as M } from "./index-CqWAZhwv.js";
3
+ import { u as ee, p as de } from "./index-CbTXFbRi.js";
4
+ import { useRouter as fe } from "vue-router";
5
+ import { z as i, a as u } from "./validator-CTlVogBQ.js";
6
+ import { P as ke } from "./payout-account-BEdIU70O.js";
7
+ import { a as Ce } from "./onboard-submission-DW1TUY3U.js";
8
+ import { _ as me } from "./DocumentViewer.vue_vue_type_script_setup_true_lang-BddsB-O7.js";
9
+ import { s as Ne } from "./vue-signature-pad.esm-IXPjf4fL.js";
10
+ import { _ as pe } from "./Status.vue_vue_type_script_setup_true_lang-D_nmEdyu.js";
11
+ import { useSnackbar as oe } from "@feedmepos/ui-library";
12
+ import { u as Q } from "./error-K1CakhA9.js";
13
+ const Se = ["src"], re = ".png, .jpg, .jpeg", ie = ".pdf", P = /* @__PURE__ */ X({
14
+ __name: "UploadButton",
15
+ props: {
16
+ modelValue: {},
17
+ label: {},
18
+ type: {},
19
+ restaurantId: {}
20
+ },
21
+ emits: ["update:modelValue"],
22
+ setup(m, { emit: O }) {
23
+ const c = m, k = j(c.modelValue), y = O, I = (r) => {
24
+ const R = new FileReader();
25
+ R.onload = (V) => {
26
+ var D;
27
+ k.value = (D = V.target) == null ? void 0 : D.result, y("update:modelValue", r);
28
+ }, R.readAsDataURL(r);
29
+ }, g = (r) => {
30
+ window.open(r, "_blank", "noopener,noreferrer");
31
+ }, T = z(() => c.type === "image" ? re : c.type === "pdf" ? ie : `${re}, ${ie}`), o = (r) => c.type === "pdf" ? !0 : c.type === "image" ? !1 : r === "application/pdf";
32
+ return (r, R) => {
33
+ const V = N("FmButton"), D = N("FmDropField");
34
+ return d(), w("div", null, [
35
+ a("p", null, F(m.label), 1),
36
+ k.value ? (d(), U(me, {
37
+ key: 0,
38
+ document: k.value,
39
+ "restaurant-id": m.restaurantId
40
+ }, {
41
+ default: f(({ src: x, type: q }) => [
42
+ o(q) ? (d(), U(V, {
43
+ key: 1,
44
+ class: "mt-4 w-full",
45
+ "prepend-icon": "manage_accounts",
46
+ label: "View Document",
47
+ variant: "primary",
48
+ onVnodeMounted: () => g(x),
49
+ onClick: () => g(x)
50
+ }, null, 8, ["onVnodeMounted", "onClick"])) : (d(), w("img", {
51
+ key: 0,
52
+ src: x
53
+ }, null, 8, Se))
54
+ ]),
55
+ _: 1
56
+ }, 8, ["document", "restaurant-id"])) : (d(), U(D, {
57
+ key: 1,
58
+ accept: T.value,
59
+ onFileUpload: I
60
+ }, null, 8, ["accept"]))
61
+ ]);
62
+ };
63
+ }
64
+ }), Pe = ["src"], qe = {
65
+ key: 0,
66
+ class: "text-center text-red-700 py-4"
67
+ }, we = { class: "flex justify-evenly py-3" }, Ie = /* @__PURE__ */ X({
68
+ __name: "SignatureBoard",
69
+ props: {
70
+ modelValue: {},
71
+ label: {},
72
+ restaurantId: {}
73
+ },
74
+ emits: ["update:modelValue"],
75
+ setup(m, { emit: O }) {
76
+ const c = m, k = O, y = j(c.modelValue), I = j(!1), g = j(), T = j(!1);
77
+ function o(R, V) {
78
+ var E;
79
+ const D = R.split(","), x = ((E = D[0].match(/:(.*?);/)) == null ? void 0 : E[1]) || "", q = atob(D[1]);
80
+ let B = q.length;
81
+ const p = new Uint8Array(B);
82
+ for (; B--; )
83
+ p[B] = q.charCodeAt(B);
84
+ return new File([p], V, { type: x });
85
+ }
86
+ const r = function() {
87
+ const { isEmpty: R, data: V } = g.value.saveSignature();
88
+ if (R)
89
+ return I.value = !0;
90
+ y.value = V, T.value = !1, k("update:modelValue", o(V, "signature.png"));
91
+ };
92
+ return (R, V) => {
93
+ const D = N("FmButton"), x = N("FmDialog");
94
+ return d(), w("div", null, [
95
+ a("p", null, F(m.label), 1),
96
+ y.value ? (d(), U(me, {
97
+ key: 0,
98
+ document: y.value,
99
+ "restaurant-id": m.restaurantId
100
+ }, {
101
+ default: f(({ src: q }) => [
102
+ a("img", {
103
+ src: q,
104
+ alt: "Signature Preview",
105
+ class: "w-full h-auto"
106
+ }, null, 8, Pe)
107
+ ]),
108
+ _: 1
109
+ }, 8, ["document", "restaurant-id"])) : $("", !0),
110
+ y.value ? $("", !0) : (d(), U(x, {
111
+ key: 1,
112
+ modelValue: T.value,
113
+ "onUpdate:modelValue": V[1] || (V[1] = (q) => T.value = q)
114
+ }, {
115
+ "dialog-button": f(() => [
116
+ n(D, {
117
+ "prepend-icon": "signature",
118
+ class: "w-full",
119
+ label: "Signature"
120
+ })
121
+ ]),
122
+ "dialog-header": f(() => [...V[2] || (V[2] = [
123
+ a("div", null, "Signature Board", -1)
124
+ ])]),
125
+ default: f(() => [
126
+ n(e(Ne), {
127
+ ref_key: "signaturePad",
128
+ ref: g,
129
+ height: "300px",
130
+ customStyle: { border: "2px solid #ccc", borderRadius: "3px" },
131
+ options: { penColor: "#000000" }
132
+ }, null, 512),
133
+ I.value ? (d(), w("p", qe, " Please sign your signature before saving. ")) : $("", !0),
134
+ a("div", we, [
135
+ n(D, {
136
+ variant: "destructive",
137
+ label: "Clear",
138
+ "prepend-icon": "delete",
139
+ onClick: V[0] || (V[0] = (q) => g.value.clearSignature())
140
+ }),
141
+ n(D, {
142
+ label: "Save",
143
+ "prepend-icon": "save",
144
+ onClick: r
145
+ })
146
+ ])
147
+ ]),
148
+ _: 1
149
+ }, 8, ["modelValue"]))
150
+ ]);
151
+ };
152
+ }
153
+ }), xe = { class: "space-y-2" }, Fe = { class: "text-gray-900" }, Ue = { class: "text-gray-900" }, De = { class: "text-gray-900" }, Re = { class: "text-gray-900" }, Ae = { class: "text-gray-900" }, Te = { class: "text-gray-900" }, Be = { class: "grid grid-cols-4 gap-6" }, Ee = ["src"], $e = {
154
+ key: 1,
155
+ class: "mt-2 truncate text-gray-700"
156
+ }, je = { key: 0 }, Oe = {
157
+ key: 0,
158
+ class: "w-full flex justify-end mt-6"
159
+ }, Le = { class: "mt-6 grid grid-cols-4 gap-24" }, ze = { class: "grid grid-cols-4 gap-6" }, Me = { class: "w-full flex justify-end mt-6" }, He = { class: "mt-6 grid grid-cols-4 gap-24" }, We = { class: "col-span-2" }, Je = { class: "col-span-2" }, Ke = { class: "col-span-2" }, Qe = { class: "col-span-2" }, Ye = { class: "col-span-2" }, he = { class: "col-span-2" }, Ge = { class: "col-span-2" }, Xe = { class: "col-span-2" }, Ze = { class: "col-start-1 col-span-2" }, _e = { class: "col-span-2" }, el = { class: "col-span-2" }, ll = { class: "col-span-2" }, tl = { class: "mt-6 grid grid-cols-4 gap-6" }, al = { class: "mt-6 grid grid-cols-4 gap-6" }, sl = { class: "mt-6 grid grid-cols-4 gap-6" }, ol = { class: "mt-6 grid grid-cols-4 gap-6" }, nl = { class: "mt-6 grid grid-cols-4 gap-6" }, rl = { class: "mt-6 grid grid-cols-4 gap-6" }, il = {
160
+ key: 2,
161
+ class: "text-sm text-gray-500"
162
+ }, ul = { class: "mt-6 grid grid-cols-2 gap-24" }, ue = 30, dl = /* @__PURE__ */ X({
163
+ __name: "SoftspaceSubmission",
164
+ props: {
165
+ submission: {
166
+ type: Object,
167
+ required: !0
168
+ }
169
+ },
170
+ emits: ["update:submission"],
171
+ setup(m, { emit: O }) {
172
+ var _;
173
+ const c = m, k = O, y = oe(), I = j(!1), { isLoading: g, startAsyncCall: T } = ee(), { fields: o, documents: r, restaurantId: R, profile: V, status: D, statusReason: x } = c.submission, q = j(""), B = j(
174
+ parseInt(((_ = c.submission.fields) == null ? void 0 : _.numberOfDevices) ?? 1)
175
+ ), p = j(
176
+ c.submission.rates ? Object.fromEntries(
177
+ Object.entries(c.submission.rates).map(([b, l]) => [b, `${l}`])
178
+ ) : {
179
+ duitNow: "0.8",
180
+ mydebitCard: "0.5",
181
+ localDebit: "0.5",
182
+ localCredit: "1.1",
183
+ foreignCard: "3.0",
184
+ jcbStandard: "2.2",
185
+ jcbPlatinum: "2.2"
186
+ }
187
+ ), E = z(
188
+ () => Object.values(p.value).every((b) => parseFloat(b) > 0)
189
+ ), Y = z(
190
+ () => Object.keys(c.submission.documents).filter((b) => /^authorizedPersonID\d+$/.test(b)).sort(
191
+ (b, l) => Number(b.replace("authorizedPersonID", "")) - Number(l.replace("authorizedPersonID", ""))
192
+ )
193
+ ), { isLoading: le, startAsyncCall: te } = ee(), L = j([]), Z = (b) => Number(b.replace("additionalDocument", "")), v = z(
194
+ () => Object.keys(c.submission.documents).filter((b) => /^additionalDocument\d+$/.test(b)).sort((b, l) => Z(b) - Z(l))
195
+ ), s = z(
196
+ () => v.value.length + L.value.length
197
+ ), S = (b) => {
198
+ if (!(s.value >= ue)) {
199
+ if (b.type.startsWith("image/")) {
200
+ const l = new FileReader();
201
+ l.onload = (A) => {
202
+ var H;
203
+ return L.value.push({
204
+ file: b,
205
+ preview: String(((H = A.target) == null ? void 0 : H.result) ?? "")
206
+ });
207
+ }, l.readAsDataURL(b);
208
+ return;
209
+ }
210
+ L.value.push({ file: b, preview: "" });
211
+ }
212
+ }, h = () => te(async () => {
213
+ try {
214
+ let b = v.value.reduce(
215
+ (A, H) => Math.max(A, Z(H)),
216
+ 0
217
+ );
218
+ const l = {};
219
+ for (const { file: A } of L.value) {
220
+ const H = `additionalDocument${++b}`;
221
+ l[H] = await M.uploadDocument(
222
+ R,
223
+ H,
224
+ A
225
+ );
226
+ }
227
+ k(
228
+ "update:submission",
229
+ await M.addAdditionalDocuments(
230
+ c.submission._id,
231
+ l
232
+ )
233
+ ), L.value = [], y.open({ type: "success", title: "Documents saved" });
234
+ } catch (b) {
235
+ y.open({
236
+ type: "error",
237
+ title: "Error occurs when sending additional documents",
238
+ message: Q(b)
239
+ });
240
+ }
241
+ }), ae = () => T(async () => {
242
+ try {
243
+ const b = await M.reviewById(
244
+ c.submission._id,
245
+ {
246
+ rates: {
247
+ duitNow: parseFloat(p.value.duitNow),
248
+ mydebitCard: parseFloat(p.value.mydebitCard),
249
+ localDebit: parseFloat(p.value.localDebit),
250
+ localCredit: parseFloat(p.value.localCredit),
251
+ foreignCard: parseFloat(p.value.foreignCard),
252
+ jcbStandard: parseFloat(p.value.jcbStandard),
253
+ jcbPlatinum: parseFloat(p.value.jcbPlatinum)
254
+ },
255
+ status: "approved"
256
+ }
257
+ );
258
+ k("update:submission", b), I.value = !1, y.open({
259
+ type: "success",
260
+ title: "Submission updated successfully"
261
+ });
262
+ } catch (b) {
263
+ y.open({
264
+ type: "error",
265
+ title: "Error occurs when updating submission",
266
+ message: Q(b)
267
+ });
268
+ }
269
+ }), se = () => T(async () => {
270
+ try {
271
+ const b = await M.reviewById(
272
+ c.submission._id,
273
+ {
274
+ status: "rejected",
275
+ statusReason: q.value
276
+ }
277
+ );
278
+ k("update:submission", b), I.value = !1, y.open({
279
+ type: "success",
280
+ title: "Submission updated successfully"
281
+ });
282
+ } catch (b) {
283
+ y.open({
284
+ type: "error",
285
+ title: "Error occurs when updating submission",
286
+ message: Q(b)
287
+ });
288
+ }
289
+ });
290
+ return (b, l) => {
291
+ const A = N("FmButton"), H = N("FmDropField"), C = N("FmTextField"), be = N("FmTextarea"), ce = N("FmDialog"), ge = N("FmPhoneNumber"), ne = N("FmSelect"), ye = N("FmForm");
292
+ return d(), w(K, null, [
293
+ a("div", xe, [
294
+ a("div", null, [
295
+ l[38] || (l[38] = a("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
296
+ a("span", Fe, F(e(R)), 1)
297
+ ]),
298
+ a("div", null, [
299
+ l[39] || (l[39] = a("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
300
+ a("span", Ue, F(e(V).name) + " ( " + F(e(V).legalName) + " )", 1)
301
+ ]),
302
+ a("div", null, [
303
+ l[40] || (l[40] = a("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
304
+ a("span", De, F(e(V).email), 1)
305
+ ]),
306
+ a("div", null, [
307
+ l[41] || (l[41] = a("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
308
+ a("span", Re, F(e(V).phoneNo), 1)
309
+ ]),
310
+ a("div", null, [
311
+ l[42] || (l[42] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
312
+ a("span", Ae, [
313
+ n(pe, { data: e(D) }, null, 8, ["data"])
314
+ ])
315
+ ]),
316
+ a("div", null, [
317
+ l[43] || (l[43] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
318
+ a("span", Te, F(e(x)), 1)
319
+ ])
320
+ ]),
321
+ l[61] || (l[61] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " (SharePoint) Additional Requested Documents ", -1)),
322
+ a("div", Be, [
323
+ (d(!0), w(K, null, G(v.value, (t) => (d(), U(P, {
324
+ key: t,
325
+ label: t.replace("additionalDocument", "Document "),
326
+ type: /\.pdf$/i.test(c.submission.documents[t]) ? "pdf" : "image",
327
+ modelValue: c.submission.documents[t],
328
+ "onUpdate:modelValue": (W) => c.submission.documents[t] = W,
329
+ "restaurant-id": e(R)
330
+ }, null, 8, ["label", "type", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128)),
331
+ (d(!0), w(K, null, G(L.value, (t, W) => (d(), w("div", {
332
+ key: `new-${W}`
333
+ }, [
334
+ a("p", null, "Document " + F(v.value.length + W + 1), 1),
335
+ t.file.type.startsWith("image/") ? (d(), w("img", {
336
+ key: 0,
337
+ src: t.preview,
338
+ class: "mt-2 rounded border"
339
+ }, null, 8, Ee)) : (d(), w("p", $e, F(t.file.name), 1)),
340
+ n(A, {
341
+ class: "mt-4",
342
+ "prepend-icon": "delete",
343
+ label: "Remove",
344
+ variant: "destructive",
345
+ onClick: (jl) => L.value.splice(W, 1)
346
+ }, null, 8, ["onClick"])
347
+ ]))), 128)),
348
+ s.value < ue ? (d(), w("div", je, [
349
+ a("p", null, "Document " + F(s.value + 1), 1),
350
+ n(H, {
351
+ accept: ".png, .jpg, .jpeg, .pdf",
352
+ onFileUpload: S
353
+ })
354
+ ])) : $("", !0)
355
+ ]),
356
+ L.value.length ? (d(), w("div", Oe, [
357
+ n(A, {
358
+ type: "button",
359
+ variant: "primary",
360
+ "prepend-icon": "cloud_upload",
361
+ label: "Save documents",
362
+ loading: e(le),
363
+ onClick: h
364
+ }, null, 8, ["loading"])
365
+ ])) : $("", !0),
366
+ l[62] || (l[62] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
367
+ a("div", Le, [
368
+ n(C, {
369
+ modelValue: p.value.duitNow,
370
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => p.value.duitNow = t),
371
+ label: "DuitNow QR",
372
+ "label-mark": "required",
373
+ type: "number",
374
+ inputmode: "numeric",
375
+ decimal: 2,
376
+ rules: e(i)(
377
+ e(u).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
378
+ )
379
+ }, {
380
+ append: f(() => [...l[44] || (l[44] = [
381
+ J("%", -1)
382
+ ])]),
383
+ _: 1
384
+ }, 8, ["modelValue", "rules"]),
385
+ n(C, {
386
+ modelValue: p.value.mydebitCard,
387
+ "onUpdate:modelValue": l[1] || (l[1] = (t) => p.value.mydebitCard = t),
388
+ label: "myDebit Card",
389
+ "label-mark": "required",
390
+ type: "number",
391
+ inputmode: "numeric",
392
+ decimal: 2,
393
+ rules: e(i)(
394
+ e(u).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
395
+ )
396
+ }, {
397
+ append: f(() => [...l[45] || (l[45] = [
398
+ J("%", -1)
399
+ ])]),
400
+ _: 1
401
+ }, 8, ["modelValue", "rules"]),
402
+ n(C, {
403
+ modelValue: p.value.localDebit,
404
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => p.value.localDebit = t),
405
+ label: "Local Debit Card",
406
+ "label-mark": "required",
407
+ type: "number",
408
+ inputmode: "numeric",
409
+ decimal: 2,
410
+ rules: e(i)(
411
+ e(u).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
412
+ )
413
+ }, {
414
+ append: f(() => [...l[46] || (l[46] = [
415
+ J("%", -1)
416
+ ])]),
417
+ _: 1
418
+ }, 8, ["modelValue", "rules"]),
419
+ n(C, {
420
+ modelValue: p.value.localCredit,
421
+ "onUpdate:modelValue": l[3] || (l[3] = (t) => p.value.localCredit = t),
422
+ label: "Local Credit Card",
423
+ "label-mark": "required",
424
+ type: "number",
425
+ inputmode: "numeric",
426
+ decimal: 2,
427
+ rules: e(i)(
428
+ e(u).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
429
+ )
430
+ }, {
431
+ append: f(() => [...l[47] || (l[47] = [
432
+ J("%", -1)
433
+ ])]),
434
+ _: 1
435
+ }, 8, ["modelValue", "rules"]),
436
+ n(C, {
437
+ modelValue: p.value.foreignCard,
438
+ "onUpdate:modelValue": l[4] || (l[4] = (t) => p.value.foreignCard = t),
439
+ label: "Foreign Card",
440
+ "label-mark": "required",
441
+ type: "number",
442
+ inputmode: "numeric",
443
+ decimal: 2,
444
+ rules: e(i)(
445
+ e(u).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
446
+ )
447
+ }, {
448
+ append: f(() => [...l[48] || (l[48] = [
449
+ J("%", -1)
450
+ ])]),
451
+ _: 1
452
+ }, 8, ["modelValue", "rules"]),
453
+ n(C, {
454
+ modelValue: p.value.jcbStandard,
455
+ "onUpdate:modelValue": l[5] || (l[5] = (t) => p.value.jcbStandard = t),
456
+ label: "JCB Standard",
457
+ "label-mark": "required",
458
+ type: "number",
459
+ inputmode: "numeric",
460
+ decimal: 2,
461
+ rules: e(i)(
462
+ e(u).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
463
+ )
464
+ }, {
465
+ append: f(() => [...l[49] || (l[49] = [
466
+ J("%", -1)
467
+ ])]),
468
+ _: 1
469
+ }, 8, ["modelValue", "rules"]),
470
+ n(C, {
471
+ modelValue: p.value.jcbPlatinum,
472
+ "onUpdate:modelValue": l[6] || (l[6] = (t) => p.value.jcbPlatinum = t),
473
+ label: "JCB Platinum",
474
+ "label-mark": "required",
475
+ type: "number",
476
+ inputmode: "numeric",
477
+ decimal: 2,
478
+ rules: e(i)(
479
+ e(u).string().min(1, "Rate is required").transform((t) => parseFloat(t)).refine((t) => !isNaN(t), { message: "Rate must be a number" })
480
+ )
481
+ }, {
482
+ append: f(() => [...l[50] || (l[50] = [
483
+ J("%", -1)
484
+ ])]),
485
+ _: 1
486
+ }, 8, ["modelValue", "rules"])
487
+ ]),
488
+ l[63] || (l[63] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-6" }, "Extra Settings", -1)),
489
+ a("div", ze, [
490
+ n(C, {
491
+ modelValue: B.value,
492
+ "onUpdate:modelValue": l[7] || (l[7] = (t) => B.value = t),
493
+ label: "Number of Devices",
494
+ "label-mark": "required",
495
+ type: "number",
496
+ inputmode: "numeric"
497
+ }, null, 8, ["modelValue"])
498
+ ]),
499
+ a("div", Me, [
500
+ n(ce, {
501
+ modelValue: I.value,
502
+ "onUpdate:modelValue": l[9] || (l[9] = (t) => I.value = t)
503
+ }, {
504
+ "dialog-button": f(() => [
505
+ n(A, {
506
+ class: "mr-6",
507
+ type: "button",
508
+ variant: "destructive",
509
+ "prepend-icon": "block",
510
+ loading: e(g),
511
+ label: "Reject Submission"
512
+ }, null, 8, ["loading"])
513
+ ]),
514
+ "dialog-header": f(() => [...l[51] || (l[51] = [
515
+ a("div", null, "Rejecting Submission", -1)
516
+ ])]),
517
+ default: f(() => [
518
+ n(be, {
519
+ modelValue: q.value,
520
+ "onUpdate:modelValue": l[8] || (l[8] = (t) => q.value = t),
521
+ label: "Reason for Rejection",
522
+ "label-mark": "optional",
523
+ "helper-text": "Please provide a reason for rejection."
524
+ }, null, 8, ["modelValue"]),
525
+ n(A, {
526
+ class: "mb-2 mt-6 w-full",
527
+ label: "Submit",
528
+ "prepend-icon": "save",
529
+ onClick: se,
530
+ loading: e(g)
531
+ }, null, 8, ["loading"])
532
+ ]),
533
+ _: 1
534
+ }, 8, ["modelValue"]),
535
+ n(A, {
536
+ type: "button",
537
+ variant: "primary",
538
+ "prepend-icon": "approval",
539
+ disabled: !E.value,
540
+ label: "Approve Submission with Rates",
541
+ onClick: ae,
542
+ loading: e(g)
543
+ }, null, 8, ["disabled", "loading"])
544
+ ]),
545
+ n(ye, { disabled: !0 }, {
546
+ default: f(() => [
547
+ l[52] || (l[52] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
548
+ a("div", He, [
549
+ a("div", We, [
550
+ n(C, {
551
+ modelValue: e(o).picName,
552
+ "onUpdate:modelValue": l[10] || (l[10] = (t) => e(o).picName = t),
553
+ label: "Owner/Director Name",
554
+ placeholder: "Enter your name",
555
+ "label-mark": "required",
556
+ rules: e(i)(e(u).string().min(1, "Owner/Director Name is required"))
557
+ }, null, 8, ["modelValue", "rules"])
558
+ ]),
559
+ a("div", Je, [
560
+ n(C, {
561
+ modelValue: e(o).picRole,
562
+ "onUpdate:modelValue": l[11] || (l[11] = (t) => e(o).picRole = t),
563
+ label: "Owner/Director Role",
564
+ placeholder: "Enter your role",
565
+ "label-mark": "required",
566
+ rules: e(i)(e(u).string().min(1, "Owner/Director Role is required"))
567
+ }, null, 8, ["modelValue", "rules"])
568
+ ]),
569
+ a("div", Ke, [
570
+ n(C, {
571
+ modelValue: e(o).picEmail,
572
+ "onUpdate:modelValue": l[12] || (l[12] = (t) => e(o).picEmail = t),
573
+ label: "Owner/Director Email",
574
+ type: "email",
575
+ placeholder: "Enter your email address",
576
+ "label-mark": "required",
577
+ rules: e(i)(e(u).string().min(1, "Owner/Director Email is required"))
578
+ }, null, 8, ["modelValue", "rules"])
579
+ ]),
580
+ a("div", Qe, [
581
+ n(ge, {
582
+ "model-value": e(o).picContact,
583
+ "onUpdate:modelValue": l[13] || (l[13] = (t) => e(o).picContact = t),
584
+ "default-country": "MY",
585
+ label: "Owner/Director Contact",
586
+ "label-mark": "required",
587
+ rules: e(i)(e(u).string().min(1, "Owner/Director Contact is required"))
588
+ }, null, 8, ["model-value", "rules"])
589
+ ]),
590
+ a("div", Ye, [
591
+ n(C, {
592
+ modelValue: e(o).nric,
593
+ "onUpdate:modelValue": l[14] || (l[14] = (t) => e(o).nric = t),
594
+ label: "Owner/Director NRIC No",
595
+ placeholder: "Enter your NRIC number",
596
+ "label-mark": "required",
597
+ rules: e(i)(e(u).string().min(1, "NRIC No is required"))
598
+ }, null, 8, ["modelValue", "rules"])
599
+ ]),
600
+ a("div", he, [
601
+ n(C, {
602
+ modelValue: e(o).tradingName,
603
+ "onUpdate:modelValue": l[15] || (l[15] = (t) => e(o).tradingName = t),
604
+ label: "Trading Name",
605
+ placeholder: "Enter trading name",
606
+ "label-mark": "required",
607
+ rules: e(i)(e(u).string().min(1, "Trading Name is required"))
608
+ }, null, 8, ["modelValue", "rules"])
609
+ ]),
610
+ a("div", Ge, [
611
+ n(C, {
612
+ modelValue: e(o).outletName,
613
+ "onUpdate:modelValue": l[16] || (l[16] = (t) => e(o).outletName = t),
614
+ label: "Registered Name",
615
+ placeholder: "Enter registered name",
616
+ "label-mark": "required",
617
+ rules: e(i)(e(u).string().min(1, "Registered Name is required"))
618
+ }, null, 8, ["modelValue", "rules"])
619
+ ]),
620
+ a("div", Xe, [
621
+ n(C, {
622
+ modelValue: e(o).outletAddress,
623
+ "onUpdate:modelValue": l[17] || (l[17] = (t) => e(o).outletAddress = t),
624
+ label: "Outlet Address",
625
+ placeholder: "Enter outlet address",
626
+ "label-mark": "required",
627
+ rules: e(i)(e(u).string().min(1, "Address is required"))
628
+ }, null, 8, ["modelValue", "rules"])
629
+ ]),
630
+ n(C, {
631
+ modelValue: e(o).outletPostCode,
632
+ "onUpdate:modelValue": l[18] || (l[18] = (t) => e(o).outletPostCode = t),
633
+ label: "Postal Code",
634
+ placeholder: "Enter postal code",
635
+ "label-mark": "required",
636
+ rules: e(i)(e(u).string().min(1, "Postal Code is required"))
637
+ }, null, 8, ["modelValue", "rules"]),
638
+ n(C, {
639
+ modelValue: e(o).outletState,
640
+ "onUpdate:modelValue": l[19] || (l[19] = (t) => e(o).outletState = t),
641
+ label: "State",
642
+ placeholder: "Enter state",
643
+ "label-mark": "required",
644
+ rules: e(i)(e(u).string().min(1, "State is required"))
645
+ }, null, 8, ["modelValue", "rules"]),
646
+ n(C, {
647
+ modelValue: e(o).outletCity,
648
+ "onUpdate:modelValue": l[20] || (l[20] = (t) => e(o).outletCity = t),
649
+ label: "City",
650
+ placeholder: "Enter city",
651
+ "label-mark": "required",
652
+ rules: e(i)(e(u).string().min(1, "City is required"))
653
+ }, null, 8, ["modelValue", "rules"]),
654
+ a("div", Ze, [
655
+ n(ne, {
656
+ modelValue: e(o).businessType,
657
+ "onUpdate:modelValue": l[21] || (l[21] = (t) => e(o).businessType = t),
658
+ label: "Type",
659
+ placeholder: "Select business type",
660
+ "label-mark": "required",
661
+ rules: e(i)(e(u).string().min(1, "Business Type is required")),
662
+ items: [
663
+ { label: "Sole Proprietorship", value: "sole_proprietorship" },
664
+ { label: "Partnership", value: "partnership" },
665
+ {
666
+ label: "Private Limited Company (Sdn Bhd)",
667
+ value: "private_limited"
668
+ },
669
+ {
670
+ label: "Public Limited Company (Berhad)",
671
+ value: "public_limited"
672
+ }
673
+ ]
674
+ }, null, 8, ["modelValue", "rules"])
675
+ ]),
676
+ a("div", _e, [
677
+ n(C, {
678
+ modelValue: e(o).businessRegNo,
679
+ "onUpdate:modelValue": l[22] || (l[22] = (t) => e(o).businessRegNo = t),
680
+ label: "Registration No",
681
+ placeholder: "Enter registration number",
682
+ "label-mark": "required",
683
+ rules: e(i)(e(u).string().min(1, "Reg No is required"))
684
+ }, null, 8, ["modelValue", "rules"])
685
+ ]),
686
+ a("div", el, [
687
+ n(C, {
688
+ modelValue: e(o).tinNo,
689
+ "onUpdate:modelValue": l[23] || (l[23] = (t) => e(o).tinNo = t),
690
+ label: "Tax Identification No (TIN)",
691
+ placeholder: "Enter your TIN number",
692
+ "label-mark": "required",
693
+ rules: e(i)(e(u).string().min(1, "TIN is required"))
694
+ }, null, 8, ["modelValue", "rules"])
695
+ ]),
696
+ a("div", ll, [
697
+ n(C, {
698
+ modelValue: e(o).sstNo,
699
+ "onUpdate:modelValue": l[24] || (l[24] = (t) => e(o).sstNo = t),
700
+ label: "SST Registration No (SST)",
701
+ placeholder: "Enter your SST number",
702
+ "label-mark": "optional"
703
+ }, null, 8, ["modelValue"])
704
+ ])
705
+ ]),
706
+ l[53] || (l[53] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
707
+ a("div", tl, [
708
+ n(ne, {
709
+ modelValue: e(o).bankName,
710
+ "onUpdate:modelValue": l[25] || (l[25] = (t) => e(o).bankName = t),
711
+ label: "Bank",
712
+ placeholder: "Select bank type",
713
+ "label-mark": "required",
714
+ rules: e(i)(e(u).string().min(1, "Bank Type is required")),
715
+ items: e(ke).bankNameOptions()
716
+ }, null, 8, ["modelValue", "rules", "items"]),
717
+ n(C, {
718
+ modelValue: e(o).bankHolderName,
719
+ "onUpdate:modelValue": l[26] || (l[26] = (t) => e(o).bankHolderName = t),
720
+ label: "Beneficiary Name",
721
+ placeholder: "Enter Beneficiary Name",
722
+ "label-mark": "required",
723
+ rules: e(i)(e(u).string().min(1, "Beneficiary Name is required"))
724
+ }, null, 8, ["modelValue", "rules"]),
725
+ n(C, {
726
+ modelValue: e(o).bankAccountNo,
727
+ "onUpdate:modelValue": l[27] || (l[27] = (t) => e(o).bankAccountNo = t),
728
+ label: "Account Number",
729
+ placeholder: "Enter Account Number",
730
+ "label-mark": "required",
731
+ rules: e(i)(e(u).string().min(1, "Account Number is required"))
732
+ }, null, 8, ["modelValue", "rules"])
733
+ ]),
734
+ l[54] || (l[54] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
735
+ l[55] || (l[55] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 1. All Directors/Owner ICs ", -1)),
736
+ a("div", al, [
737
+ n(P, {
738
+ label: "Authorized Person ID",
739
+ modelValue: e(r).authorizedPersonID,
740
+ "onUpdate:modelValue": l[28] || (l[28] = (t) => e(r).authorizedPersonID = t),
741
+ type: "image",
742
+ "restaurant-id": m.submission.restaurantId
743
+ }, null, 8, ["modelValue", "restaurant-id"]),
744
+ (d(!0), w(K, null, G(Y.value, (t) => (d(), U(P, {
745
+ key: t,
746
+ label: `Authorized Person ID ${t.replace("authorizedPersonID", "")}`,
747
+ modelValue: e(r)[t],
748
+ "onUpdate:modelValue": (W) => e(r)[t] = W,
749
+ type: "image",
750
+ "restaurant-id": m.submission.restaurantId
751
+ }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128))
752
+ ]),
753
+ l[56] || (l[56] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-6" }, " Section 2. Business Information ", -1)),
754
+ a("div", sl, [
755
+ e(o).businessType === "private_limited" || e(o).businessType === "public_limited" ? (d(), U(P, {
756
+ key: 0,
757
+ label: "Superform",
758
+ type: "pdf",
759
+ modelValue: e(r).certificate,
760
+ "onUpdate:modelValue": l[29] || (l[29] = (t) => e(r).certificate = t),
761
+ "restaurant-id": m.submission.restaurantId
762
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
763
+ e(o).businessType === "sole_proprietorship" || e(o).businessType === "partnership" ? (d(), U(P, {
764
+ key: 1,
765
+ label: "Business Registration Document",
766
+ type: "pdf",
767
+ modelValue: e(r).certificate,
768
+ "onUpdate:modelValue": l[30] || (l[30] = (t) => e(r).certificate = t),
769
+ "restaurant-id": m.submission.restaurantId
770
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
771
+ e(r).interiorPhoto ? (d(), U(P, {
772
+ key: 2,
773
+ label: "Interior Photo",
774
+ modelValue: e(r).interiorPhoto,
775
+ "onUpdate:modelValue": l[31] || (l[31] = (t) => e(r).interiorPhoto = t),
776
+ type: "image",
777
+ "restaurant-id": m.submission.restaurantId
778
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
779
+ n(P, {
780
+ label: "Outlet Photo",
781
+ modelValue: e(r).outletPhoto,
782
+ "onUpdate:modelValue": l[32] || (l[32] = (t) => e(r).outletPhoto = t),
783
+ type: "image-or-pdf",
784
+ "restaurant-id": m.submission.restaurantId
785
+ }, null, 8, ["modelValue", "restaurant-id"])
786
+ ]),
787
+ l[57] || (l[57] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 3. Payout Information ", -1)),
788
+ a("div", ol, [
789
+ n(P, {
790
+ label: "Latest Bank Statement",
791
+ modelValue: e(r).bankStatement,
792
+ "onUpdate:modelValue": l[33] || (l[33] = (t) => e(r).bankStatement = t),
793
+ type: "pdf",
794
+ "restaurant-id": m.submission.restaurantId
795
+ }, null, 8, ["modelValue", "restaurant-id"])
796
+ ]),
797
+ l[58] || (l[58] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 4. Site Photos ", -1)),
798
+ a("div", nl, [
799
+ (d(!0), w(K, null, G([1, 2, 3, 4, 5].filter(
800
+ (t) => !!e(r)[`onsitePhoto${t}`]
801
+ ), (t) => (d(), U(P, {
802
+ key: t,
803
+ label: e(Ce)[t - 1],
804
+ modelValue: e(r)[`onsitePhoto${t}`],
805
+ "onUpdate:modelValue": (W) => e(r)[`onsitePhoto${t}`] = W,
806
+ type: "image",
807
+ "restaurant-id": m.submission.restaurantId
808
+ }, null, 8, ["label", "modelValue", "onUpdate:modelValue", "restaurant-id"]))), 128))
809
+ ]),
810
+ l[59] || (l[59] = a("h4", { class: "font-semibold border-b pb-1 mt-6 mb-4" }, " Section 5. Additional Documents ", -1)),
811
+ a("div", rl, [
812
+ e(r).liquorLicense ? (d(), U(P, {
813
+ key: 0,
814
+ label: "Liquor License",
815
+ modelValue: e(r).liquorLicense,
816
+ "onUpdate:modelValue": l[34] || (l[34] = (t) => e(r).liquorLicense = t),
817
+ type: "image-or-pdf",
818
+ "restaurant-id": m.submission.restaurantId
819
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
820
+ e(r).appendixC ? (d(), U(P, {
821
+ key: 1,
822
+ label: "Appendix C",
823
+ modelValue: e(r).appendixC,
824
+ "onUpdate:modelValue": l[35] || (l[35] = (t) => e(r).appendixC = t),
825
+ type: "pdf",
826
+ "restaurant-id": m.submission.restaurantId
827
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
828
+ !e(r).liquorLicense && !e(r).appendixC ? (d(), w("p", il, " No additional documents submitted. ")) : $("", !0)
829
+ ]),
830
+ l[60] || (l[60] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
831
+ a("div", ul, [
832
+ n(Ie, {
833
+ modelValue: e(r).signature,
834
+ "onUpdate:modelValue": l[36] || (l[36] = (t) => e(r).signature = t),
835
+ "restaurant-id": m.submission.restaurantId,
836
+ label: "Signature"
837
+ }, null, 8, ["modelValue", "restaurant-id"]),
838
+ n(P, {
839
+ label: "Company Stamp",
840
+ type: "image",
841
+ modelValue: e(r).companyStamp,
842
+ "onUpdate:modelValue": l[37] || (l[37] = (t) => e(r).companyStamp = t),
843
+ "restaurant-id": m.submission.restaurantId
844
+ }, null, 8, ["modelValue", "restaurant-id"])
845
+ ])
846
+ ]),
847
+ _: 1
848
+ })
849
+ ], 64);
850
+ };
851
+ }
852
+ }), ml = { class: "space-y-2" }, pl = { class: "text-gray-900" }, bl = { class: "text-gray-900" }, cl = { class: "text-gray-900" }, gl = { class: "text-gray-900" }, yl = { class: "text-gray-900" }, Vl = { class: "text-gray-900" }, vl = { class: "mt-6 grid grid-cols-4 gap-24" }, fl = { class: "w-full flex justify-end mt-6" }, kl = { class: "mt-6 grid grid-cols-4 gap-24" }, Cl = { class: "col-span-2" }, Nl = { class: "col-span-2" }, Sl = { class: "col-span-2" }, Pl = { class: "col-span-2" }, ql = { class: "mt-6 grid grid-cols-4 gap-24" }, wl = { class: "mt-6 grid grid-cols-4 gap-24" }, Il = { class: "mt-6 grid grid-cols-4 gap-24" }, xl = { class: "col-span-2" }, Fl = { class: "col-span-2" }, Ul = { class: "col-span-2" }, Dl = { class: "col-span-2" }, Rl = { class: "col-span-2" }, Al = { class: "col-span-2" }, Tl = /* @__PURE__ */ X({
853
+ __name: "NTTSubmission",
854
+ props: {
855
+ submission: {
856
+ type: Object,
857
+ required: !0
858
+ }
859
+ },
860
+ emits: ["update:submission"],
861
+ setup(m, { emit: O }) {
862
+ const c = m, k = O, y = oe(), I = j(!1), { isLoading: g, startAsyncCall: T } = ee(), { fields: o, documents: r, restaurantId: R, profile: V, status: D, statusReason: x } = c.submission, q = j(""), B = [
863
+ { key: "localCardDebit", label: "Local Card (Debit)", defaultValue: "2.3" },
864
+ {
865
+ key: "localCardStandard",
866
+ label: "Local Card (Standard)",
867
+ defaultValue: "2.3"
868
+ },
869
+ {
870
+ key: "localCardPremium",
871
+ label: "Local Card (Premium)",
872
+ defaultValue: "2.3"
873
+ },
874
+ {
875
+ key: "localCardSuperPremium",
876
+ label: "Local Card (Super Premium)",
877
+ defaultValue: "2.3"
878
+ },
879
+ {
880
+ key: "internationalCard",
881
+ label: "International Card",
882
+ defaultValue: "3.1"
883
+ },
884
+ { key: "upiCard", label: "UPI Card", defaultValue: "3" },
885
+ { key: "jcbCard", label: "JCB Card", defaultValue: "3" },
886
+ { key: "dciCard", label: "DCI Card", defaultValue: "3" },
887
+ { key: "amexCard", label: "Amex Card", defaultValue: "3" },
888
+ { key: "alipay", label: "Alipay", defaultValue: "2.3" },
889
+ { key: "alipayPlus", label: "Alipay+", defaultValue: "2.3" },
890
+ { key: "trueMoney", label: "TrueMoney", defaultValue: "2.3" },
891
+ { key: "shopeePay", label: "ShopeePay", defaultValue: "2.3" },
892
+ { key: "linePay", label: "LinePay", defaultValue: "2.1" },
893
+ { key: "thaiQr", label: "ThaiQR", defaultValue: "0.5" }
894
+ ], p = Object.fromEntries(
895
+ B.map((v) => [v.key, v.defaultValue])
896
+ ), E = j(
897
+ c.submission.rates ? Object.fromEntries(
898
+ Object.entries(c.submission.rates).map(([v, s]) => [v, `${s}`])
899
+ ) : { ...p }
900
+ ), Y = z(
901
+ () => Object.values(E.value).every((v) => parseFloat(v) > 0)
902
+ ), le = z(() => o.businessType === "juristic" ? "Juristic" : o.businessType === "individual" ? "Individual" : o.businessType || "-"), te = () => T(async () => {
903
+ try {
904
+ const v = await M.reviewById(
905
+ c.submission._id,
906
+ {
907
+ status: de.FdoOnboardStatus.enum.ready
908
+ }
909
+ );
910
+ k("update:submission", v), y.open({
911
+ type: "success",
912
+ title: "Submission marked as ready"
913
+ });
914
+ } catch (v) {
915
+ y.open({
916
+ type: "error",
917
+ title: "Error occurs when marking submission as ready",
918
+ message: Q(v)
919
+ });
920
+ }
921
+ }), L = () => T(async () => {
922
+ try {
923
+ const v = await M.reviewById(
924
+ c.submission._id,
925
+ {
926
+ rates: Object.fromEntries(
927
+ B.map((s) => [
928
+ s.key,
929
+ parseFloat(E.value[s.key])
930
+ ])
931
+ ),
932
+ status: "approved"
933
+ }
934
+ );
935
+ k("update:submission", v), y.open({
936
+ type: "success",
937
+ title: "Submission updated successfully"
938
+ });
939
+ } catch (v) {
940
+ y.open({
941
+ type: "error",
942
+ title: "Error occurs when updating submission",
943
+ message: Q(v)
944
+ });
945
+ }
946
+ }), Z = () => T(async () => {
947
+ try {
948
+ const v = await M.reviewById(
949
+ c.submission._id,
950
+ {
951
+ status: "rejected",
952
+ statusReason: q.value
953
+ }
954
+ );
955
+ k("update:submission", v), I.value = !1, y.open({
956
+ type: "success",
957
+ title: "Submission updated successfully"
958
+ });
959
+ } catch (v) {
960
+ y.open({
961
+ type: "error",
962
+ title: "Error occurs when updating submission",
963
+ message: Q(v)
964
+ });
965
+ }
966
+ });
967
+ return (v, s) => {
968
+ const S = N("FmTextField"), h = N("FmButton"), ae = N("FmTextarea"), se = N("FmDialog"), _ = N("FmPhoneNumber"), b = N("FmForm");
969
+ return d(), w(K, null, [
970
+ a("div", ml, [
971
+ a("div", null, [
972
+ s[31] || (s[31] = a("span", { class: "w-40 font-medium text-gray-600" }, "Restaurant: ", -1)),
973
+ a("span", pl, F(e(R)), 1)
974
+ ]),
975
+ a("div", null, [
976
+ s[32] || (s[32] = a("span", { class: "w-40 font-medium text-gray-600" }, "Profile: ", -1)),
977
+ a("span", bl, F(e(V).name) + " ( " + F(e(V).legalName) + " )", 1)
978
+ ]),
979
+ a("div", null, [
980
+ s[33] || (s[33] = a("span", { class: "w-40 font-medium text-gray-600" }, "Email: ", -1)),
981
+ a("span", cl, F(e(V).email), 1)
982
+ ]),
983
+ a("div", null, [
984
+ s[34] || (s[34] = a("span", { class: "w-40 font-medium text-gray-600" }, "Phone: ", -1)),
985
+ a("span", gl, F(e(V).phoneNo), 1)
986
+ ]),
987
+ a("div", null, [
988
+ s[35] || (s[35] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status: ", -1)),
989
+ a("span", yl, [
990
+ n(pe, { data: e(D) }, null, 8, ["data"])
991
+ ])
992
+ ]),
993
+ a("div", null, [
994
+ s[36] || (s[36] = a("span", { class: "w-40 font-medium text-gray-600" }, "Status Reason: ", -1)),
995
+ a("span", Vl, F(e(x)), 1)
996
+ ])
997
+ ]),
998
+ s[43] || (s[43] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Rate Settings", -1)),
999
+ a("div", vl, [
1000
+ (d(), w(K, null, G(B, (l) => n(S, {
1001
+ key: l.key,
1002
+ modelValue: E.value[l.key],
1003
+ "onUpdate:modelValue": (A) => E.value[l.key] = A,
1004
+ label: l.label,
1005
+ "label-mark": "required",
1006
+ type: "number",
1007
+ inputmode: "numeric",
1008
+ decimal: 2,
1009
+ rules: e(i)(
1010
+ e(u).string().min(1, "Rate is required").transform((A) => parseFloat(A)).refine((A) => !isNaN(A), { message: "Rate must be a number" })
1011
+ )
1012
+ }, {
1013
+ append: f(() => [...s[37] || (s[37] = [
1014
+ J("%", -1)
1015
+ ])]),
1016
+ _: 1
1017
+ }, 8, ["modelValue", "onUpdate:modelValue", "label", "rules"])), 64))
1018
+ ]),
1019
+ a("div", fl, [
1020
+ n(se, {
1021
+ modelValue: I.value,
1022
+ "onUpdate:modelValue": s[1] || (s[1] = (l) => I.value = l)
1023
+ }, {
1024
+ "dialog-button": f(() => [
1025
+ n(h, {
1026
+ class: "mr-6",
1027
+ type: "button",
1028
+ variant: "destructive",
1029
+ "prepend-icon": "block",
1030
+ loading: e(g),
1031
+ label: "Reject Submission"
1032
+ }, null, 8, ["loading"])
1033
+ ]),
1034
+ "dialog-header": f(() => [...s[38] || (s[38] = [
1035
+ a("div", null, "Rejecting Submission", -1)
1036
+ ])]),
1037
+ default: f(() => [
1038
+ n(ae, {
1039
+ modelValue: q.value,
1040
+ "onUpdate:modelValue": s[0] || (s[0] = (l) => q.value = l),
1041
+ label: "Reason for Rejection",
1042
+ "label-mark": "optional",
1043
+ "helper-text": "Please provide a reason for rejection."
1044
+ }, null, 8, ["modelValue"]),
1045
+ n(h, {
1046
+ class: "mb-2 mt-6 w-full",
1047
+ label: "Submit",
1048
+ "prepend-icon": "save",
1049
+ onClick: Z,
1050
+ loading: e(g)
1051
+ }, null, 8, ["loading"])
1052
+ ]),
1053
+ _: 1
1054
+ }, 8, ["modelValue"]),
1055
+ n(h, {
1056
+ type: "button",
1057
+ variant: "primary",
1058
+ "prepend-icon": "approval",
1059
+ label: "Approve Submission with Rates",
1060
+ disabled: !Y.value,
1061
+ onClick: L,
1062
+ loading: e(g)
1063
+ }, null, 8, ["disabled", "loading"]),
1064
+ e(D) === "approved" ? (d(), U(h, {
1065
+ key: 0,
1066
+ type: "button",
1067
+ variant: "secondary",
1068
+ "prepend-icon": "check_circle",
1069
+ label: "Mark as Ready",
1070
+ class: "ml-6",
1071
+ onClick: te,
1072
+ loading: e(g)
1073
+ }, null, 8, ["loading"])) : $("", !0)
1074
+ ]),
1075
+ n(b, { disabled: !0 }, {
1076
+ default: f(() => [
1077
+ s[39] || (s[39] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Outlet Information ", -1)),
1078
+ a("div", kl, [
1079
+ a("div", Cl, [
1080
+ n(S, {
1081
+ modelValue: e(o).companyName,
1082
+ "onUpdate:modelValue": s[2] || (s[2] = (l) => e(o).companyName = l),
1083
+ label: "Company Name",
1084
+ "label-mark": "required",
1085
+ rules: e(i)(e(u).string().min(1, "Company Name is required"))
1086
+ }, null, 8, ["modelValue", "rules"])
1087
+ ]),
1088
+ a("div", Nl, [
1089
+ n(S, {
1090
+ modelValue: e(o).outletName,
1091
+ "onUpdate:modelValue": s[3] || (s[3] = (l) => e(o).outletName = l),
1092
+ label: "Outlet Name (Thai)",
1093
+ "label-mark": "required",
1094
+ rules: e(i)(e(u).string().min(1, "Outlet Name is required"))
1095
+ }, null, 8, ["modelValue", "rules"])
1096
+ ]),
1097
+ a("div", Sl, [
1098
+ n(S, {
1099
+ modelValue: e(o).outletNameEnglish,
1100
+ "onUpdate:modelValue": s[4] || (s[4] = (l) => e(o).outletNameEnglish = l),
1101
+ label: "Outlet Name (English)",
1102
+ "label-mark": "required",
1103
+ rules: e(i)(e(u).string().min(1, "Outlet Name English is required"))
1104
+ }, null, 8, ["modelValue", "rules"])
1105
+ ]),
1106
+ a("div", Pl, [
1107
+ n(S, {
1108
+ modelValue: e(o).outletAddress,
1109
+ "onUpdate:modelValue": s[5] || (s[5] = (l) => e(o).outletAddress = l),
1110
+ label: "Outlet Address",
1111
+ "label-mark": "required",
1112
+ rules: e(i)(e(u).string().min(1, "Outlet Address is required"))
1113
+ }, null, 8, ["modelValue", "rules"])
1114
+ ]),
1115
+ n(S, {
1116
+ modelValue: e(o).outletPostCode,
1117
+ "onUpdate:modelValue": s[6] || (s[6] = (l) => e(o).outletPostCode = l),
1118
+ label: "Post Code",
1119
+ "label-mark": "required",
1120
+ rules: e(i)(e(u).string().min(1, "Post Code is required"))
1121
+ }, null, 8, ["modelValue", "rules"]),
1122
+ n(S, {
1123
+ modelValue: e(o).outletState,
1124
+ "onUpdate:modelValue": s[7] || (s[7] = (l) => e(o).outletState = l),
1125
+ label: "State",
1126
+ "label-mark": "required",
1127
+ rules: e(i)(e(u).string().min(1, "State is required"))
1128
+ }, null, 8, ["modelValue", "rules"]),
1129
+ n(S, {
1130
+ modelValue: e(o).outletCity,
1131
+ "onUpdate:modelValue": s[8] || (s[8] = (l) => e(o).outletCity = l),
1132
+ label: "City",
1133
+ "label-mark": "required",
1134
+ rules: e(i)(e(u).string().min(1, "City is required"))
1135
+ }, null, 8, ["modelValue", "rules"]),
1136
+ n(S, {
1137
+ "model-value": le.value,
1138
+ label: "Business Type",
1139
+ "label-mark": "required"
1140
+ }, null, 8, ["model-value"]),
1141
+ n(S, {
1142
+ modelValue: e(o).numberOfDevices,
1143
+ "onUpdate:modelValue": s[9] || (s[9] = (l) => e(o).numberOfDevices = l),
1144
+ label: "Number of Devices",
1145
+ "label-mark": "required"
1146
+ }, null, 8, ["modelValue"])
1147
+ ]),
1148
+ s[40] || (s[40] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Payout Information ", -1)),
1149
+ a("div", ql, [
1150
+ n(S, {
1151
+ modelValue: e(o).bankName,
1152
+ "onUpdate:modelValue": s[10] || (s[10] = (l) => e(o).bankName = l),
1153
+ label: "Bank Name",
1154
+ "label-mark": "required",
1155
+ rules: e(i)(e(u).string().min(1, "Bank Name is required"))
1156
+ }, null, 8, ["modelValue", "rules"]),
1157
+ n(S, {
1158
+ modelValue: e(o).bankHolderName,
1159
+ "onUpdate:modelValue": s[11] || (s[11] = (l) => e(o).bankHolderName = l),
1160
+ label: "Bank Holder Name",
1161
+ "label-mark": "required",
1162
+ rules: e(i)(e(u).string().min(1, "Bank Holder Name is required"))
1163
+ }, null, 8, ["modelValue", "rules"]),
1164
+ n(S, {
1165
+ modelValue: e(o).bankAccountNo,
1166
+ "onUpdate:modelValue": s[12] || (s[12] = (l) => e(o).bankAccountNo = l),
1167
+ label: "Bank Account No",
1168
+ "label-mark": "required",
1169
+ rules: e(i)(e(u).string().min(1, "Bank Account No is required"))
1170
+ }, null, 8, ["modelValue", "rules"]),
1171
+ n(S, {
1172
+ modelValue: e(o).bankBranch,
1173
+ "onUpdate:modelValue": s[13] || (s[13] = (l) => e(o).bankBranch = l),
1174
+ label: "Bank Branch",
1175
+ "label-mark": "required",
1176
+ rules: e(i)(e(u).string().min(1, "Bank Branch is required"))
1177
+ }, null, 8, ["modelValue", "rules"]),
1178
+ n(S, {
1179
+ modelValue: e(o).bankBranchCode,
1180
+ "onUpdate:modelValue": s[14] || (s[14] = (l) => e(o).bankBranchCode = l),
1181
+ label: "Bank Branch Code",
1182
+ "label-mark": "required",
1183
+ rules: e(i)(e(u).string().min(1, "Bank Branch Code is required"))
1184
+ }, null, 8, ["modelValue", "rules"])
1185
+ ]),
1186
+ s[41] || (s[41] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, "Documents", -1)),
1187
+ a("div", wl, [
1188
+ n(P, {
1189
+ label: "Authorized Person ID",
1190
+ modelValue: e(r).authorizedPersonID,
1191
+ "onUpdate:modelValue": s[15] || (s[15] = (l) => e(r).authorizedPersonID = l),
1192
+ type: "image",
1193
+ "restaurant-id": m.submission.restaurantId
1194
+ }, null, 8, ["modelValue", "restaurant-id"]),
1195
+ n(P, {
1196
+ label: "Outlet Photo",
1197
+ modelValue: e(r).outletPhoto,
1198
+ "onUpdate:modelValue": s[16] || (s[16] = (l) => e(r).outletPhoto = l),
1199
+ type: "image",
1200
+ "restaurant-id": m.submission.restaurantId
1201
+ }, null, 8, ["modelValue", "restaurant-id"]),
1202
+ n(P, {
1203
+ label: "Interior Photo",
1204
+ modelValue: e(r).interiorPhoto,
1205
+ "onUpdate:modelValue": s[17] || (s[17] = (l) => e(r).interiorPhoto = l),
1206
+ type: "image",
1207
+ "restaurant-id": m.submission.restaurantId
1208
+ }, null, 8, ["modelValue", "restaurant-id"]),
1209
+ n(P, {
1210
+ label: "Bank Statement",
1211
+ modelValue: e(r).bankStatement,
1212
+ "onUpdate:modelValue": s[18] || (s[18] = (l) => e(r).bankStatement = l),
1213
+ type: "pdf",
1214
+ "restaurant-id": m.submission.restaurantId
1215
+ }, null, 8, ["modelValue", "restaurant-id"]),
1216
+ e(o).businessType === "juristic" ? (d(), U(P, {
1217
+ key: 0,
1218
+ label: "Company Certificate",
1219
+ type: "pdf",
1220
+ modelValue: e(r).companyCertificate,
1221
+ "onUpdate:modelValue": s[19] || (s[19] = (l) => e(r).companyCertificate = l),
1222
+ "restaurant-id": m.submission.restaurantId
1223
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1224
+ e(o).businessType === "juristic" ? (d(), U(P, {
1225
+ key: 1,
1226
+ label: "VAT Certificate",
1227
+ type: "pdf",
1228
+ modelValue: e(r).vatCertificate,
1229
+ "onUpdate:modelValue": s[20] || (s[20] = (l) => e(r).vatCertificate = l),
1230
+ "restaurant-id": m.submission.restaurantId
1231
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0),
1232
+ e(o).businessType === "individual" ? (d(), U(P, {
1233
+ key: 2,
1234
+ label: "Commercial Certificate",
1235
+ type: "pdf",
1236
+ modelValue: e(r).commercialCertificate,
1237
+ "onUpdate:modelValue": s[21] || (s[21] = (l) => e(r).commercialCertificate = l),
1238
+ "restaurant-id": m.submission.restaurantId
1239
+ }, null, 8, ["modelValue", "restaurant-id"])) : $("", !0)
1240
+ ]),
1241
+ s[42] || (s[42] = a("h3", { class: "font-semibold text-lg border-b pb-1 mt-6 mb-4" }, " Declaration Information ", -1)),
1242
+ a("div", Il, [
1243
+ a("div", xl, [
1244
+ n(S, {
1245
+ modelValue: e(o).picName,
1246
+ "onUpdate:modelValue": s[22] || (s[22] = (l) => e(o).picName = l),
1247
+ label: "PIC Name",
1248
+ "label-mark": "required",
1249
+ rules: e(i)(e(u).string().min(1, "PIC Name is required"))
1250
+ }, null, 8, ["modelValue", "rules"])
1251
+ ]),
1252
+ a("div", Fl, [
1253
+ n(S, {
1254
+ modelValue: e(o).picRole,
1255
+ "onUpdate:modelValue": s[23] || (s[23] = (l) => e(o).picRole = l),
1256
+ label: "PIC Role",
1257
+ "label-mark": "required",
1258
+ rules: e(i)(e(u).string().min(1, "PIC Role is required"))
1259
+ }, null, 8, ["modelValue", "rules"])
1260
+ ]),
1261
+ a("div", Ul, [
1262
+ n(S, {
1263
+ modelValue: e(o).picEmail,
1264
+ "onUpdate:modelValue": s[24] || (s[24] = (l) => e(o).picEmail = l),
1265
+ label: "PIC Email",
1266
+ "label-mark": "required",
1267
+ rules: e(i)(e(u).string().min(1, "PIC Email is required"))
1268
+ }, null, 8, ["modelValue", "rules"])
1269
+ ]),
1270
+ a("div", Dl, [
1271
+ n(_, {
1272
+ "model-value": e(o).picContact,
1273
+ "onUpdate:modelValue": s[25] || (s[25] = (l) => e(o).picContact = l),
1274
+ "default-country": "TH",
1275
+ label: "PIC Contact",
1276
+ "label-mark": "required",
1277
+ rules: e(i)(e(u).string().min(1, "PIC Contact is required"))
1278
+ }, null, 8, ["model-value", "rules"])
1279
+ ]),
1280
+ a("div", Rl, [
1281
+ n(S, {
1282
+ modelValue: e(o).witnessName,
1283
+ "onUpdate:modelValue": s[26] || (s[26] = (l) => e(o).witnessName = l),
1284
+ label: "Witness Name",
1285
+ "label-mark": "required",
1286
+ rules: e(i)(e(u).string().min(1, "Witness Name is required"))
1287
+ }, null, 8, ["modelValue", "rules"])
1288
+ ]),
1289
+ a("div", Al, [
1290
+ n(S, {
1291
+ modelValue: e(o).witnessRole,
1292
+ "onUpdate:modelValue": s[27] || (s[27] = (l) => e(o).witnessRole = l),
1293
+ label: "Witness Role",
1294
+ "label-mark": "required",
1295
+ rules: e(i)(e(u).string().min(1, "Witness Role is required"))
1296
+ }, null, 8, ["modelValue", "rules"])
1297
+ ]),
1298
+ n(P, {
1299
+ label: "Signature",
1300
+ type: "image",
1301
+ modelValue: e(r).signature,
1302
+ "onUpdate:modelValue": s[28] || (s[28] = (l) => e(r).signature = l),
1303
+ "restaurant-id": m.submission.restaurantId
1304
+ }, null, 8, ["modelValue", "restaurant-id"]),
1305
+ n(P, {
1306
+ label: "Witness Signature",
1307
+ type: "image",
1308
+ modelValue: e(r).witnessSignature,
1309
+ "onUpdate:modelValue": s[29] || (s[29] = (l) => e(r).witnessSignature = l),
1310
+ "restaurant-id": m.submission.restaurantId
1311
+ }, null, 8, ["modelValue", "restaurant-id"]),
1312
+ n(P, {
1313
+ label: "Company Stamp",
1314
+ type: "image",
1315
+ modelValue: e(r).companyStamp,
1316
+ "onUpdate:modelValue": s[30] || (s[30] = (l) => e(r).companyStamp = l),
1317
+ "restaurant-id": m.submission.restaurantId
1318
+ }, null, 8, ["modelValue", "restaurant-id"])
1319
+ ])
1320
+ ]),
1321
+ _: 1
1322
+ })
1323
+ ], 64);
1324
+ };
1325
+ }
1326
+ }), Bl = /* @__PURE__ */ X({
1327
+ __name: "TyroSubmission",
1328
+ props: {
1329
+ submission: {
1330
+ type: Object,
1331
+ required: !0
1332
+ }
1333
+ },
1334
+ emits: ["update:submission"],
1335
+ setup(m) {
1336
+ const O = m, c = z(() => {
1337
+ const k = O.submission.fields || {}, y = (I) => k[I] || "N/A";
1338
+ return [
1339
+ {
1340
+ label: "Tyro POS Reference ID",
1341
+ value: y("tyroPosReference")
1342
+ },
1343
+ {
1344
+ label: "Tyro Merchant ID",
1345
+ value: y("tyroMerchantId")
1346
+ },
1347
+ {
1348
+ label: "Tyro Merchant Name",
1349
+ value: y("tyroMerchantDisplayName")
1350
+ },
1351
+ {
1352
+ label: "Authorised",
1353
+ value: y("tyroIsAuthorised")
1354
+ }
1355
+ ];
1356
+ });
1357
+ return (k, y) => {
1358
+ const I = N("FmCardHeader"), g = N("FmCardSection"), T = N("FmCard");
1359
+ return d(), U(T, {
1360
+ class: "max-w-3xl mt-8 p-6",
1361
+ variant: "elevated"
1362
+ }, {
1363
+ default: f(() => [
1364
+ n(g, { class: "flex flex-col gap-16 justify-between" }, {
1365
+ default: f(() => [
1366
+ n(I, {
1367
+ class: "p-0",
1368
+ title: "Tyro Authorisation",
1369
+ subtitle: ""
1370
+ }),
1371
+ n(g, { class: "p-0" }, {
1372
+ default: f(() => [
1373
+ (d(!0), w(K, null, G(c.value, (o) => (d(), w("p", {
1374
+ key: o.label,
1375
+ class: "text-sm text-gray-900 break-all mb-4 last:mb-0"
1376
+ }, [
1377
+ a("b", null, F(o.label), 1),
1378
+ J(": " + F(o.value), 1)
1379
+ ]))), 128))
1380
+ ]),
1381
+ _: 1
1382
+ })
1383
+ ]),
1384
+ _: 1
1385
+ })
1386
+ ]),
1387
+ _: 1
1388
+ });
1389
+ };
1390
+ }
1391
+ }), El = {
1392
+ key: 0,
1393
+ class: "flex items-center justify-center min-h-[80vh]"
1394
+ }, $l = { class: "px-32 pb-32" }, Xl = /* @__PURE__ */ X({
1395
+ __name: "OnboardForm",
1396
+ props: {
1397
+ submissionId: {
1398
+ type: String,
1399
+ required: !0
1400
+ }
1401
+ },
1402
+ setup(m) {
1403
+ const { startAsyncCall: O, isLoading: c } = ee(), k = oe(), y = m, I = fe(), g = j(null), T = z(
1404
+ () => {
1405
+ var x;
1406
+ return ((x = g.value) == null ? void 0 : x.type) === de.FdoOnboardType.enum.tyro;
1407
+ }
1408
+ ), o = () => {
1409
+ if (window.history.length > 1) {
1410
+ I.back();
1411
+ return;
1412
+ }
1413
+ I.push({ name: "mf-payment-admin.onboard-submission" });
1414
+ };
1415
+ Ve(() => {
1416
+ O(async () => {
1417
+ g.value = await M.readById(y.submissionId);
1418
+ });
1419
+ });
1420
+ const r = z(() => {
1421
+ if (!g.value) return null;
1422
+ switch (g.value.type) {
1423
+ case "softspace":
1424
+ return dl;
1425
+ case "ntt":
1426
+ return Tl;
1427
+ case "tyro":
1428
+ return Bl;
1429
+ default:
1430
+ return null;
1431
+ }
1432
+ }), R = j(0);
1433
+ function V(x) {
1434
+ g.value = x, R.value = Date.now();
1435
+ }
1436
+ const D = async (x) => {
1437
+ var q, B;
1438
+ if (g.value)
1439
+ switch (x) {
1440
+ case "preview":
1441
+ let p;
1442
+ try {
1443
+ p = k.open({
1444
+ message: "Generating preview document...",
1445
+ type: "info"
1446
+ }), await M.previewDocument(
1447
+ (q = g.value) == null ? void 0 : q._id
1448
+ );
1449
+ } catch (E) {
1450
+ k.open({
1451
+ type: "error",
1452
+ title: "Error occurs when generating submission document",
1453
+ message: Q(E)
1454
+ });
1455
+ } finally {
1456
+ p && k.close(p);
1457
+ }
1458
+ break;
1459
+ case "send":
1460
+ try {
1461
+ k.open({
1462
+ message: "Sending onboarding document...",
1463
+ type: "info"
1464
+ }), await M.sendDocument(
1465
+ (B = g.value) == null ? void 0 : B._id
1466
+ ), k.open({
1467
+ type: "success",
1468
+ title: "Submission documents send successfully"
1469
+ });
1470
+ } catch (E) {
1471
+ k.open({
1472
+ type: "error",
1473
+ title: "Error occurs when sending document",
1474
+ message: Q(E)
1475
+ });
1476
+ }
1477
+ break;
1478
+ }
1479
+ };
1480
+ return (x, q) => {
1481
+ var E, Y;
1482
+ const B = N("FmCircularProgress"), p = N("FmPageHead");
1483
+ return e(c) ? (d(), w("div", El, [
1484
+ n(B, { size: "xxl" })
1485
+ ])) : (d(), w(K, { key: 1 }, [
1486
+ n(p, {
1487
+ title: `Submission - ${(E = g.value) == null ? void 0 : E.type}`,
1488
+ description: `ID - ${(Y = g.value) == null ? void 0 : Y._id}`,
1489
+ "back-button": !0,
1490
+ "onClick:back": o,
1491
+ "onClick:action": D,
1492
+ actions: T.value ? [] : [
1493
+ {
1494
+ label: "Preview Document",
1495
+ value: "preview",
1496
+ prependIcon: "preview"
1497
+ },
1498
+ {
1499
+ label: "Send for Review",
1500
+ value: "send",
1501
+ isPrimary: !0,
1502
+ prependIcon: "send"
1503
+ }
1504
+ ]
1505
+ }, null, 8, ["title", "description", "actions"]),
1506
+ a("div", $l, [
1507
+ (d(), U(ve(r.value), {
1508
+ key: R.value,
1509
+ submission: g.value,
1510
+ "onUpdate:submission": V
1511
+ }, null, 40, ["submission"]))
1512
+ ])
1513
+ ], 64));
1514
+ };
1515
+ }
1516
+ });
1517
+ export {
1518
+ Xl as default
1519
+ };