@feedmepos/mf-order-setting 0.0.33 → 0.0.34

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 (30) hide show
  1. package/dist/{KioskDevicesView-CxZI99me.js → KioskDevicesView-BHzBoF_O.js} +1 -1
  2. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-EGj4fxeN.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-C5JpMDP_.js} +2 -2
  3. package/dist/KioskSettingView-i8tgH3dF.js +841 -0
  4. package/dist/{KioskView-IUQTvUF8.js → KioskView-DW7vX6rJ.js} +41 -34
  5. package/dist/{OrderSettingsView-VLE9yxNt.js → OrderSettingsView-D3SQHET3.js} +4 -4
  6. package/dist/{app-cd45Ryph.js → app-C15xKXga.js} +16 -10
  7. package/dist/app.js +1 -1
  8. package/dist/{dayjs.min-CRAlrjJy.js → dayjs.min-KE7XM_kc.js} +1 -1
  9. package/dist/frontend/mf-order/src/app.d.ts +6 -0
  10. package/dist/frontend/mf-order/src/main.d.ts +6 -0
  11. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +12 -0
  12. package/dist/frontend/mf-order/src/stores/order-setting/mapper.d.ts +3 -3
  13. package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPaymentTypeSection.vue.d.ts +8 -0
  14. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  15. package/dist/{index-DLWAy-3K.js → index-DGfFxIZo.js} +2 -2
  16. package/dist/{menu.dto-DGDI6XwH.js → menu.dto-CLARGRsi.js} +6 -2
  17. package/dist/package/entity/order/order.enum.d.ts +1 -1
  18. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +42 -0
  19. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +32 -0
  20. package/dist/package/entity/order-setting/order-setting.do.d.ts +22 -0
  21. package/dist/package/entity/order-setting/order-setting.dto.d.ts +44 -0
  22. package/dist/package/entity/restaurant/restaurant.dto.d.ts +22 -0
  23. package/dist/package/entity/websocket/websocket.dto.d.ts +48 -0
  24. package/package.json +1 -1
  25. package/src/locales/en-US.json +2 -0
  26. package/src/locales/th-TH.json +2 -0
  27. package/src/locales/zh-CN.json +2 -0
  28. package/src/stores/order-setting/mapper.ts +230 -168
  29. package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +31 -1
  30. package/dist/KioskSettingView-CTDY8__s.js +0 -821
@@ -0,0 +1,841 @@
1
+ import { defineComponent as U, resolveComponent as T, createElementBlock as I, openBlock as y, createElementVNode as m, toDisplayString as V, unref as l, Fragment as B, renderList as j, createVNode as o, computed as D, withDirectives as Y, vShow as q, createBlock as M, createCommentVNode as L, ref as O, onMounted as te, withCtx as R, createTextVNode as le } from "vue";
2
+ import { useI18n as F } from "@feedmepos/mf-common";
3
+ import { F as $, c as v } from "./menu.dto-CLARGRsi.js";
4
+ import { _ as ie, u as de } from "./index-BXsnV_eO.js";
5
+ import { useSnackbar as oe } from "@feedmepos/ui-library";
6
+ function ue(P, h) {
7
+ let e = P.toString(), n = h - e.length;
8
+ return n > 0 && (e = Array(n + 1).join("0") + e), e;
9
+ }
10
+ const se = {
11
+ applyPadDigits: ue
12
+ }, re = { class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12" }, pe = { class: "fm-typo-en-title-sm-600" }, G = /* @__PURE__ */ U({
13
+ __name: "KioskInstructionSection",
14
+ props: {
15
+ fields: {}
16
+ },
17
+ emits: ["update:field"],
18
+ setup(P, { emit: h }) {
19
+ const { t: e } = F(), n = P, p = h;
20
+ function g(i, b) {
21
+ p("update:field", i, b);
22
+ }
23
+ return (i, b) => {
24
+ const d = T("FmTextField");
25
+ return y(), I("div", re, [
26
+ m("span", pe, V(l(e)("order.submitOrderInstruction")), 1),
27
+ (y(!0), I(B, null, j(n.fields, (s) => (y(), I("div", {
28
+ class: "flex flex-col gap-10",
29
+ key: s.title
30
+ }, [
31
+ o(d, {
32
+ "model-value": s.value,
33
+ label: s.title,
34
+ placeholder: s.defaultValue,
35
+ "onUpdate:modelValue": (_) => g(s.id, _)
36
+ }, null, 8, ["model-value", "label", "placeholder", "onUpdate:modelValue"])
37
+ ]))), 128))
38
+ ]);
39
+ };
40
+ }
41
+ }), me = { class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12" }, ce = { class: "fm-typo-en-title-sm-600" }, ye = { class: "flex flex-col gap-10" }, fe = { class: "flex flex-row gap-2" }, ve = /* @__PURE__ */ U({
42
+ __name: "KioskDisplayStandSection",
43
+ props: {
44
+ displayStand: {}
45
+ },
46
+ emits: ["updateDisplayStand"],
47
+ setup(P, { emit: h }) {
48
+ const { t: e } = F(), n = P, p = h, g = D(() => {
49
+ const u = n.displayStand.submitOrderInstruction;
50
+ return [
51
+ {
52
+ id: "payAtCounter",
53
+ value: u.payAtCounter ?? void 0,
54
+ title: e("order.payAtCounter"),
55
+ defaultValue: "Collect your transaction slip below and present it to the cashier"
56
+ },
57
+ {
58
+ id: "paid",
59
+ value: u.paid ?? void 0,
60
+ title: e("order.paid"),
61
+ defaultValue: "Please collect your receipt and we'll bring your food to your table once it's ready."
62
+ }
63
+ ];
64
+ });
65
+ function i(u, a) {
66
+ p("updateDisplayStand", {
67
+ ...n.displayStand,
68
+ submitOrderInstruction: {
69
+ ...n.displayStand.submitOrderInstruction,
70
+ [u]: a
71
+ }
72
+ });
73
+ }
74
+ const b = (u) => u < 0 ? e("order.nonNegativeRule") : !0, d = (u) => u <= (n.displayStand.standSlotRange.min ?? 0) ? e("order.greaterThanMinRule") : !0, s = D(() => [b]), _ = D(() => [b]), f = D(() => [b, d]);
75
+ D(() => {
76
+ const a = se.applyPadDigits(5, n.displayStand.padDigit ?? 0);
77
+ return `Preview: ${n.displayStand.prefix}${a}`;
78
+ });
79
+ function w(u) {
80
+ p("updateDisplayStand", {
81
+ ...n.displayStand,
82
+ enabled: u
83
+ });
84
+ }
85
+ function k(u) {
86
+ u && p("updateDisplayStand", {
87
+ ...n.displayStand,
88
+ standSlotRange: {
89
+ ...n.displayStand.standSlotRange,
90
+ min: u
91
+ }
92
+ });
93
+ }
94
+ function A(u) {
95
+ u && p("updateDisplayStand", {
96
+ ...n.displayStand,
97
+ standSlotRange: {
98
+ ...n.displayStand.standSlotRange,
99
+ max: u
100
+ }
101
+ });
102
+ }
103
+ function W(u) {
104
+ p("updateDisplayStand", {
105
+ ...n.displayStand,
106
+ prefix: u
107
+ });
108
+ }
109
+ function K(u) {
110
+ u && p("updateDisplayStand", {
111
+ ...n.displayStand,
112
+ padDigit: u
113
+ });
114
+ }
115
+ return (u, a) => {
116
+ const c = T("FmSwitch"), E = T("FmTextField"), C = T("FmStepperField");
117
+ return y(), I("div", null, [
118
+ o(c, {
119
+ "model-value": u.displayStand.enabled,
120
+ label: l(e)("order.displayStand"),
121
+ "label-placement": "right",
122
+ "onUpdate:modelValue": w
123
+ }, null, 8, ["model-value", "label"]),
124
+ Y(m("div", me, [
125
+ m("span", ce, V(l(e)("order.tableServiceSetting")), 1),
126
+ m("div", ye, [
127
+ o(E, {
128
+ "model-value": u.displayStand.prefix,
129
+ label: l(e)("order.prefix"),
130
+ placeholder: l(e)("order.prefix"),
131
+ "onUpdate:modelValue": W
132
+ }, null, 8, ["model-value", "label", "placeholder"])
133
+ ]),
134
+ m("div", fe, [
135
+ o(C, {
136
+ class: "w-1/2",
137
+ "model-value": u.displayStand.standSlotRange.min,
138
+ label: l(e)("order.start"),
139
+ labelMark: "required",
140
+ rules: _.value,
141
+ placeholder: l(e)("order.enterANumber"),
142
+ "onUpdate:modelValue": k
143
+ }, null, 8, ["model-value", "label", "rules", "placeholder"]),
144
+ o(C, {
145
+ class: "w-1/2",
146
+ "model-value": u.displayStand.standSlotRange.max,
147
+ label: l(e)("order.end"),
148
+ labelMark: "required",
149
+ rules: f.value,
150
+ placeholder: l(e)("order.enterANumber"),
151
+ "onUpdate:modelValue": A
152
+ }, null, 8, ["model-value", "label", "rules", "placeholder"])
153
+ ]),
154
+ m("div", null, [
155
+ o(C, {
156
+ "model-value": u.displayStand.padDigit,
157
+ label: l(e)("order.padDigit"),
158
+ labelMark: "required",
159
+ rules: s.value,
160
+ placeholder: l(e)("order.padDigit"),
161
+ "onUpdate:modelValue": K
162
+ }, null, 8, ["model-value", "label", "rules", "placeholder"])
163
+ ])
164
+ ], 512), [
165
+ [q, u.displayStand.enabled]
166
+ ]),
167
+ Y(o(G, {
168
+ fields: g.value,
169
+ "onUpdate:field": i
170
+ }, null, 8, ["fields"]), [
171
+ [q, u.displayStand.enabled]
172
+ ])
173
+ ]);
174
+ };
175
+ }
176
+ }), be = /* @__PURE__ */ U({
177
+ __name: "KioskPickAtCounterSection",
178
+ props: {
179
+ form: {}
180
+ },
181
+ emits: ["update-pick-up"],
182
+ setup(P, { emit: h }) {
183
+ const { t: e } = F(), n = P, p = h, g = D(() => [
184
+ {
185
+ id: "payAtCounter",
186
+ value: n.form.submitOrderInstruction.payAtCounter ?? void 0,
187
+ title: e("order.payAtCounter"),
188
+ defaultValue: "Collect your transaction slip below and present it to the cashier"
189
+ },
190
+ {
191
+ id: "paid",
192
+ value: n.form.submitOrderInstruction.paid ?? void 0,
193
+ title: e("order.paid"),
194
+ defaultValue: "Please wait as we prepare your food. We'll call your number when it's ready."
195
+ }
196
+ ]);
197
+ function i(d) {
198
+ p("update-pick-up", {
199
+ ...n.form,
200
+ enabled: d
201
+ });
202
+ }
203
+ function b(d, s) {
204
+ p("update-pick-up", {
205
+ ...n.form,
206
+ submitOrderInstruction: {
207
+ ...n.form.submitOrderInstruction,
208
+ [d]: s
209
+ }
210
+ });
211
+ }
212
+ return (d, s) => {
213
+ const _ = T("FmSwitch");
214
+ return y(), I("div", null, [
215
+ o(_, {
216
+ "model-value": d.form.enabled,
217
+ label: l(e)("order.pickAtCounter"),
218
+ "label-placement": "right",
219
+ "onUpdate:modelValue": i
220
+ }, null, 8, ["model-value", "label"]),
221
+ Y(o(G, {
222
+ fields: g.value,
223
+ "onUpdate:field": b
224
+ }, null, 8, ["fields"]), [
225
+ [q, d.form.enabled]
226
+ ])
227
+ ]);
228
+ };
229
+ }
230
+ }), Se = { class: "flex flex-col gap-5" }, Pe = { class: "flex flex-col gap-16" }, ge = { class: "flex flex-col gap-16" }, _e = /* @__PURE__ */ U({
231
+ __name: "KioskDineInSection",
232
+ props: {
233
+ v: {}
234
+ },
235
+ emits: ["updateDineIn"],
236
+ setup(P, { emit: h }) {
237
+ const { t: e } = F();
238
+ function n(d) {
239
+ b("updateDineIn", {
240
+ ...i.v,
241
+ pickUp: d
242
+ });
243
+ }
244
+ function p(d) {
245
+ b("updateDineIn", {
246
+ ...i.v,
247
+ displayStand: d
248
+ });
249
+ }
250
+ function g(d) {
251
+ b("updateDineIn", {
252
+ ...i.v,
253
+ enabled: d
254
+ });
255
+ }
256
+ const i = P, b = h;
257
+ return (d, s) => {
258
+ const _ = T("FmSwitch");
259
+ return y(), I("div", Se, [
260
+ m("div", Pe, [
261
+ o(_, {
262
+ "model-value": d.v.enabled,
263
+ label: l(e)("order.dineIn"),
264
+ "label-placement": "right",
265
+ "onUpdate:modelValue": g
266
+ }, null, 8, ["model-value", "label"]),
267
+ Y(m("div", ge, [
268
+ d.v.pickUp ? (y(), M(be, {
269
+ key: 0,
270
+ form: d.v.pickUp,
271
+ onUpdatePickUp: n
272
+ }, null, 8, ["form"])) : L("", !0),
273
+ d.v.displayStand ? (y(), M(ve, {
274
+ key: 1,
275
+ "display-stand": d.v.displayStand,
276
+ onUpdateDisplayStand: p
277
+ }, null, 8, ["display-stand"])) : L("", !0)
278
+ ], 512), [
279
+ [q, d.v.enabled]
280
+ ])
281
+ ])
282
+ ]);
283
+ };
284
+ }
285
+ }), he = /* @__PURE__ */ U({
286
+ __name: "KioskTakeawaySection",
287
+ props: {
288
+ v: {}
289
+ },
290
+ emits: ["updateTakeaway"],
291
+ setup(P, { emit: h }) {
292
+ const { t: e } = F(), n = P, p = h, g = D(() => [
293
+ {
294
+ id: "payAtCounter",
295
+ value: n.v.submitOrderInstruction.payAtCounter ?? void 0,
296
+ title: e("order.payAtCounter"),
297
+ defaultValue: "Collect your transaction slip below and present it to the cashier"
298
+ },
299
+ {
300
+ id: "paid",
301
+ value: n.v.submitOrderInstruction.paid ?? void 0,
302
+ title: e("order.paid"),
303
+ defaultValue: "Please wait as we prepare your food. We'll call your number when it's ready."
304
+ }
305
+ ]);
306
+ function i(d) {
307
+ p("updateTakeaway", { ...n.v, enabled: d });
308
+ }
309
+ function b(d, s) {
310
+ p("updateTakeaway", {
311
+ ...n.v,
312
+ submitOrderInstruction: {
313
+ ...n.v.submitOrderInstruction,
314
+ [d]: s
315
+ }
316
+ });
317
+ }
318
+ return (d, s) => {
319
+ const _ = T("FmSwitch");
320
+ return y(), I("div", null, [
321
+ o(_, {
322
+ "model-value": d.v.enabled,
323
+ label: l(e)("order.takeaway"),
324
+ "label-placement": "right",
325
+ "onUpdate:modelValue": i,
326
+ class: "mb-5"
327
+ }, null, 8, ["model-value", "label"]),
328
+ Y(o(G, {
329
+ fields: g.value,
330
+ "onUpdate:field": b
331
+ }, null, 8, ["fields"]), [
332
+ [q, d.v.enabled]
333
+ ])
334
+ ]);
335
+ };
336
+ }
337
+ }), Ie = { class: "flex flex-row items-center" }, Te = { key: 0 }, ke = {
338
+ key: 1,
339
+ class: "ml-7"
340
+ }, xe = { key: 0 }, Ae = { class: "font-bold" }, we = {
341
+ key: 2,
342
+ class: "ml-7"
343
+ }, Ve = { class: "ml-7" }, De = { class: "ml-7" }, Ce = { class: "flex flex-row gap-9" }, Re = /* @__PURE__ */ U({
344
+ __name: "KioskPaymentTypeSection",
345
+ props: {
346
+ paymentTypes: {
347
+ type: Array,
348
+ required: !0
349
+ },
350
+ offlinePaymentTypes: {
351
+ type: Array,
352
+ required: !0
353
+ },
354
+ allowEPayment: {
355
+ type: [Boolean, String],
356
+ required: !0
357
+ },
358
+ ePaymentTypes: {
359
+ type: Object,
360
+ required: !0
361
+ }
362
+ },
363
+ emits: ["update:paymentTypes", "update:offlinePaymentTypes", "update:ePaymentTypes"],
364
+ setup(P, { emit: h }) {
365
+ const { t: e } = F(), n = P, p = h;
366
+ async function g(r) {
367
+ p(
368
+ "update:offlinePaymentTypes",
369
+ n.offlinePaymentTypes.filter((t, x) => x !== r)
370
+ );
371
+ }
372
+ const i = D(() => (n.paymentTypes || []).includes($.enum.ePayment)), b = D(() => {
373
+ const r = n.paymentTypes || [], t = n.offlinePaymentTypes || [];
374
+ return r.includes($.enum.cash) || t.length > 0;
375
+ }), d = O(!1), s = O([]), _ = O(), f = O([]), w = O(!1), k = O(!1), A = [
376
+ { label: e("order.offlinePayment"), value: "offline" },
377
+ { label: e("order.ePayment"), value: "e-payment" }
378
+ ], W = () => {
379
+ const r = [];
380
+ b.value && r.push("offline"), i.value && r.push("e-payment"), s.value = r, d.value = r.length === A.length, Object.keys(n.ePaymentTypes).length !== 0 && (n.ePaymentTypes.card.terminal ? (_.value = v.enum.TERMINAL, w.value = !0) : n.ePaymentTypes.card.nfc && (_.value = v.enum.NFC, w.value = !0), n.ePaymentTypes.eWallet.qrPay && (f.value.push(v.enum.QRPAY), k.value = !0), n.ePaymentTypes.eWallet.scanPay && (f.value.push(v.enum.SCANPAY), k.value = !0), n.ePaymentTypes.eWallet.terminalScanPay && (f.value.push(v.enum.TERMINAL_SCAN_PAY), k.value = !0), n.ePaymentTypes.eWallet.terminalQrPay && (f.value.push(v.enum.TERMINAL_QR_PAY), k.value = !0));
381
+ };
382
+ W();
383
+ const K = (r) => {
384
+ s.value = r ? A.map((N) => N.value) : [], d.value = r;
385
+ const t = [], x = r ? n.offlinePaymentTypes || [] : [];
386
+ s.value.includes("e-payment") && (t.push($.enum.ePayment), w.value = !0, k.value = !0), s.value.includes("offline") && t.push($.enum.cash), p("update:paymentTypes", t), p("update:offlinePaymentTypes", x), E(w.value), C(k.value);
387
+ }, u = (r) => {
388
+ const t = s.value;
389
+ s.value = r, d.value = r.length === A.length;
390
+ const x = [], N = r.includes("offline") ? n.offlinePaymentTypes || [] : [];
391
+ r.includes("e-payment") && x.push($.enum.ePayment), r.includes("offline") && x.push($.enum.cash), t.includes("e-payment") || (w.value = !0, k.value = !0, E(w.value), C(k.value)), p("update:paymentTypes", x), p("update:offlinePaymentTypes", N);
392
+ }, a = (r) => {
393
+ const t = {
394
+ card: {
395
+ terminal: !1,
396
+ nfc: !1
397
+ },
398
+ eWallet: {
399
+ qrPay: !1,
400
+ scanPay: !1,
401
+ terminalScanPay: !1,
402
+ terminalQrPay: !1
403
+ }
404
+ };
405
+ s.value.includes("e-payment") && (r == v.enum.TERMINAL && (t.card.terminal = !0), r == v.enum.NFC && (t.card.nfc = !0), f.value.length > 0 && (f.value.includes(v.enum.QRPAY) && (t.eWallet.qrPay = !0), f.value.includes(v.enum.SCANPAY) && (t.eWallet.scanPay = !0), f.value.includes(v.enum.TERMINAL_SCAN_PAY) && (t.eWallet.terminalScanPay = !0), f.value.includes(v.enum.TERMINAL_QR_PAY) && (t.eWallet.terminalQrPay = !0))), p("update:ePaymentTypes", t);
406
+ }, c = () => {
407
+ const r = {
408
+ card: {
409
+ terminal: !1,
410
+ nfc: !1
411
+ },
412
+ eWallet: {
413
+ qrPay: !1,
414
+ scanPay: !1
415
+ }
416
+ };
417
+ s.value.includes("e-payment") && (_.value && (_.value === v.enum.TERMINAL && (r.card.terminal = !0), _.value === v.enum.NFC && (r.card.nfc = !0)), f.value.includes(v.enum.QRPAY) && (r.eWallet.qrPay = !0), f.value.includes(v.enum.SCANPAY) && (r.eWallet.scanPay = !0)), p("update:ePaymentTypes", r);
418
+ }, E = (r) => {
419
+ _.value = "", r && (_.value = v.enum.TERMINAL), c();
420
+ }, C = (r) => {
421
+ f.value = [], r && (f.value = [
422
+ v.enum.QRPAY,
423
+ v.enum.SCANPAY
424
+ ]), c();
425
+ };
426
+ return te(() => {
427
+ W();
428
+ }), (r, t) => {
429
+ var J, X;
430
+ const x = T("FmCheckbox"), N = T("FmCardSection"), Q = T("FmCard"), ee = T("FmButton"), z = T("FmSwitch"), H = T("FmRadio"), ae = T("FmRadioGroup");
431
+ return y(), I(B, null, [
432
+ o(x, {
433
+ value: "",
434
+ "model-value": d.value,
435
+ label: l(e)("order.all"),
436
+ indeterminate: s.value.length > 0 && s.value.length < A.length,
437
+ "onUpdate:modelValue": K
438
+ }, null, 8, ["model-value", "label", "indeterminate"]),
439
+ m("div", Ie, [
440
+ o(x, {
441
+ modelValue: s.value,
442
+ "onUpdate:modelValue": [
443
+ t[0] || (t[0] = (S) => s.value = S),
444
+ u
445
+ ],
446
+ label: A[0].label,
447
+ value: A[0].value
448
+ }, null, 8, ["modelValue", "label", "value"])
449
+ ]),
450
+ s.value.includes(A[0].value) && ((J = P.offlinePaymentTypes) == null ? void 0 : J.length) === 0 ? (y(), I("div", Te, [
451
+ o(ie, {
452
+ "onUpdate:offlinePaymentTypes": t[1] || (t[1] = (S) => p("update:offlinePaymentTypes", S))
453
+ })
454
+ ])) : L("", !0),
455
+ s.value.includes("offline") ? (y(), I("div", ke, [
456
+ ((X = P.offlinePaymentTypes) == null ? void 0 : X.length) === 0 ? (y(), I("div", xe, [
457
+ o(Q, { variant: "outlined" }, {
458
+ default: R(() => [
459
+ o(N, null, {
460
+ default: R(() => [
461
+ le(V(l(e)("order.payAtCounter")), 1)
462
+ ]),
463
+ _: 1
464
+ })
465
+ ]),
466
+ _: 1
467
+ })
468
+ ])) : L("", !0),
469
+ (y(!0), I(B, null, j(P.offlinePaymentTypes, (S, ne) => (y(), I("p", { key: ne }, [
470
+ o(Q, { variant: "outlined" }, {
471
+ default: R(() => [
472
+ o(N, { class: "flex items-center justify-between" }, {
473
+ default: R(() => [
474
+ m("div", null, [
475
+ m("span", Ae, V(S.name), 1),
476
+ t[10] || (t[10] = m("br", null, null, -1)),
477
+ m("span", null, V(S.instruction), 1)
478
+ ]),
479
+ (y(!0), I(B, null, j(P.offlinePaymentTypes, (Ge, Z) => (y(), I("div", { key: Z }, [
480
+ o(ee, {
481
+ "append-icon": "delete",
482
+ variant: "tertiary",
483
+ onClick: (ze) => g(Z)
484
+ }, null, 8, ["onClick"])
485
+ ]))), 128))
486
+ ]),
487
+ _: 2
488
+ }, 1024)
489
+ ]),
490
+ _: 2
491
+ }, 1024)
492
+ ]))), 128))
493
+ ])) : L("", !0),
494
+ o(x, {
495
+ modelValue: s.value,
496
+ "onUpdate:modelValue": [
497
+ t[2] || (t[2] = (S) => s.value = S),
498
+ u
499
+ ],
500
+ label: A[1].label,
501
+ value: A[1].value
502
+ }, null, 8, ["modelValue", "label", "value"]),
503
+ s.value.includes(A[1].value) ? (y(), I("div", we, [
504
+ o(Q, { variant: "outlined" }, {
505
+ default: R(() => [
506
+ o(N, null, {
507
+ default: R(() => [
508
+ o(z, {
509
+ label: l(e)("order.bankCard"),
510
+ sublabel: l(e)("order.cardPaymentDescription"),
511
+ "label-placement": "right",
512
+ modelValue: w.value,
513
+ "onUpdate:modelValue": [
514
+ t[3] || (t[3] = (S) => w.value = S),
515
+ E
516
+ ]
517
+ }, null, 8, ["label", "sublabel", "modelValue"]),
518
+ t[11] || (t[11] = m("br", null, null, -1)),
519
+ Y(m("div", Ve, [
520
+ o(ae, {
521
+ modelValue: _.value,
522
+ "onUpdate:modelValue": [
523
+ t[4] || (t[4] = (S) => _.value = S),
524
+ a
525
+ ],
526
+ inline: ""
527
+ }, {
528
+ default: R(() => [
529
+ o(H, {
530
+ label: l(e)("order.terminal"),
531
+ value: l(v).enum.TERMINAL
532
+ }, null, 8, ["label", "value"]),
533
+ o(H, {
534
+ label: l(e)("order.nfc"),
535
+ value: l(v).enum.NFC
536
+ }, null, 8, ["label", "value"])
537
+ ]),
538
+ _: 1
539
+ }, 8, ["modelValue"])
540
+ ], 512), [
541
+ [q, w.value]
542
+ ])
543
+ ]),
544
+ _: 1
545
+ })
546
+ ]),
547
+ _: 1
548
+ }),
549
+ o(Q, {
550
+ variant: "outlined",
551
+ class: "mt-2"
552
+ }, {
553
+ default: R(() => [
554
+ o(N, null, {
555
+ default: R(() => [
556
+ o(z, {
557
+ label: l(e)("order.eWallet"),
558
+ sublabel: l(e)("order.eWalletDescription"),
559
+ "label-placement": "right",
560
+ modelValue: k.value,
561
+ "onUpdate:modelValue": [
562
+ t[5] || (t[5] = (S) => k.value = S),
563
+ C
564
+ ]
565
+ }, null, 8, ["label", "sublabel", "modelValue"]),
566
+ t[12] || (t[12] = m("br", null, null, -1)),
567
+ Y(m("div", De, [
568
+ m("div", Ce, [
569
+ o(x, {
570
+ modelValue: f.value,
571
+ "onUpdate:modelValue": [
572
+ t[6] || (t[6] = (S) => f.value = S),
573
+ c
574
+ ],
575
+ label: l(e)("order.qrPay"),
576
+ value: l(v).enum.QRPAY
577
+ }, null, 8, ["modelValue", "label", "value"]),
578
+ o(x, {
579
+ modelValue: f.value,
580
+ "onUpdate:modelValue": [
581
+ t[7] || (t[7] = (S) => f.value = S),
582
+ c
583
+ ],
584
+ label: l(e)("order.scanPay"),
585
+ value: l(v).enum.SCANPAY
586
+ }, null, 8, ["modelValue", "label", "value"]),
587
+ o(x, {
588
+ modelValue: f.value,
589
+ "onUpdate:modelValue": [
590
+ t[8] || (t[8] = (S) => f.value = S),
591
+ c
592
+ ],
593
+ label: l(e)("order.terminalScanPay"),
594
+ value: l(v).enum.TERMINAL_SCAN_PAY
595
+ }, null, 8, ["modelValue", "label", "value"]),
596
+ o(x, {
597
+ modelValue: f.value,
598
+ "onUpdate:modelValue": [
599
+ t[9] || (t[9] = (S) => f.value = S),
600
+ c
601
+ ],
602
+ label: l(e)("order.terminalQrPay"),
603
+ value: l(v).enum.TERMINAL_QR_PAY
604
+ }, null, 8, ["modelValue", "label", "value"])
605
+ ])
606
+ ], 512), [
607
+ [q, k.value]
608
+ ])
609
+ ]),
610
+ _: 1
611
+ })
612
+ ]),
613
+ _: 1
614
+ })
615
+ ])) : L("", !0)
616
+ ], 64);
617
+ };
618
+ }
619
+ }), Ue = /* @__PURE__ */ U({
620
+ __name: "KioskMenuItemSection",
621
+ props: {
622
+ v: { type: Boolean }
623
+ },
624
+ emits: ["update:modelValue"],
625
+ setup(P, { emit: h }) {
626
+ const { t: e } = F(), n = h, p = (g) => {
627
+ n("update:modelValue", g);
628
+ };
629
+ return (g, i) => {
630
+ const b = T("FmSwitch");
631
+ return y(), M(b, {
632
+ "model-value": g.v,
633
+ label: `${l(e)("order.hideNotAvailableMenuItem")}`,
634
+ "label-placement": "right",
635
+ "onUpdate:modelValue": p,
636
+ class: "mb-5"
637
+ }, null, 8, ["model-value", "label"]);
638
+ };
639
+ }
640
+ }), Fe = /* @__PURE__ */ U({
641
+ __name: "KioskEnablePaxDialogSection",
642
+ props: {
643
+ v: { type: Boolean }
644
+ },
645
+ emits: ["updateEnablePaxDialog"],
646
+ setup(P, { emit: h }) {
647
+ const { t: e } = F(), n = h;
648
+ function p(g) {
649
+ n("updateEnablePaxDialog", g);
650
+ }
651
+ return (g, i) => {
652
+ const b = T("FmSwitch");
653
+ return y(), I("div", null, [
654
+ o(b, {
655
+ "model-value": g.v,
656
+ label: l(e)("order.displayPaxDialogDescription"),
657
+ "label-placement": "right",
658
+ "onUpdate:modelValue": p,
659
+ class: "mb-5"
660
+ }, null, 8, ["model-value", "label"])
661
+ ]);
662
+ };
663
+ }
664
+ }), Ne = {
665
+ key: 0,
666
+ class: "flex flex-col gap-32"
667
+ }, Ee = { class: "flex flex-col gap-2" }, Oe = { class: "fm-typo-en-title-sm-600" }, $e = { class: "flex flex-col gap-2" }, Me = { class: "fm-typo-en-title-sm-600" }, Ye = { class: "flex flex-col gap-2" }, qe = { class: "fm-typo-en-title-sm-600" }, We = { class: "flex flex-col gap-2" }, Le = { class: "fm-typo-en-title-sm-600" }, Ke = { class: "flex flex-col gap-2" }, Qe = { class: "fm-typo-en-title-sm-600" }, Be = { class: "fm-typo-en-title-sm-400 font-bold" }, je = { key: 1 }, aa = /* @__PURE__ */ U({
668
+ __name: "KioskSettingView",
669
+ props: {
670
+ restaurantId: {},
671
+ form: {}
672
+ },
673
+ emits: ["updateKioskOrderSetting"],
674
+ setup(P, { emit: h }) {
675
+ const { t: e } = F(), n = P, p = oe(), g = h, i = O(n.form), b = D(() => {
676
+ const a = i.value;
677
+ if (!a.dineIn.enabled)
678
+ return {
679
+ ...a,
680
+ dineIn: {
681
+ enabled: a.dineIn.enabled,
682
+ sequenceNumber: a.dineIn.sequenceNumber,
683
+ pickUp: a.dineIn.pickUp,
684
+ displayStand: {
685
+ enabled: !1,
686
+ padDigit: a.dineIn.displayStand.padDigit ?? 0,
687
+ standSlotRange: {
688
+ min: a.dineIn.displayStand.standSlotRange.min ?? 0,
689
+ max: a.dineIn.displayStand.standSlotRange.max ?? 10
690
+ },
691
+ prefix: a.dineIn.displayStand.prefix ?? "",
692
+ enablePaxDialog: a.dineIn.displayStand.enablePaxDialog,
693
+ submitOrderInstruction: {
694
+ payAtCounter: a.dineIn.displayStand.submitOrderInstruction.payAtCounter ?? null,
695
+ paid: a.dineIn.displayStand.submitOrderInstruction.paid ?? null
696
+ }
697
+ }
698
+ }
699
+ };
700
+ if (a.dineIn.enabled && a.dineIn.displayStand.enabled) {
701
+ const c = a.dineIn.displayStand;
702
+ return c.padDigit != null && c.padDigit >= 0 && c.standSlotRange.min && c.standSlotRange.max && c.standSlotRange.min <= c.standSlotRange.max ? {
703
+ ...a,
704
+ dineIn: {
705
+ enabled: a.dineIn.enabled,
706
+ sequenceNumber: a.dineIn.sequenceNumber,
707
+ pickUp: a.dineIn.pickUp,
708
+ displayStand: {
709
+ enabled: c.enabled,
710
+ padDigit: c.padDigit,
711
+ standSlotRange: {
712
+ min: c.standSlotRange.min,
713
+ max: c.standSlotRange.max
714
+ },
715
+ prefix: c.prefix ?? "",
716
+ enablePaxDialog: c.enablePaxDialog,
717
+ submitOrderInstruction: {
718
+ payAtCounter: c.submitOrderInstruction.payAtCounter ?? null,
719
+ paid: c.submitOrderInstruction.paid ?? null
720
+ }
721
+ }
722
+ }
723
+ } : null;
724
+ }
725
+ return {
726
+ ...a,
727
+ dineIn: {
728
+ enabled: a.dineIn.enabled,
729
+ sequenceNumber: a.dineIn.sequenceNumber,
730
+ pickUp: a.dineIn.pickUp,
731
+ displayStand: {
732
+ enabled: !1,
733
+ padDigit: a.dineIn.displayStand.padDigit ?? 0,
734
+ standSlotRange: {
735
+ min: a.dineIn.displayStand.standSlotRange.min ?? 0,
736
+ max: a.dineIn.displayStand.standSlotRange.max ?? 10
737
+ },
738
+ prefix: a.dineIn.displayStand.prefix ?? "",
739
+ enablePaxDialog: a.dineIn.displayStand.enablePaxDialog,
740
+ submitOrderInstruction: {
741
+ payAtCounter: a.dineIn.displayStand.submitOrderInstruction.payAtCounter ?? null,
742
+ paid: a.dineIn.displayStand.submitOrderInstruction.paid ?? null
743
+ }
744
+ }
745
+ }
746
+ };
747
+ }), { startAsyncCall: d } = de();
748
+ async function s(a) {
749
+ i.value.dineIn = a;
750
+ }
751
+ async function _(a) {
752
+ i.value.takeaway = a;
753
+ }
754
+ async function f(a) {
755
+ i.value.menuItem.showAllOnly = a;
756
+ }
757
+ async function w(a) {
758
+ i.value.paymentSetting.paymentTypes = a;
759
+ }
760
+ async function k(a) {
761
+ i.value.paymentSetting.ePaymentTypes = a;
762
+ }
763
+ const A = D(() => (i.value.paymentSetting.paymentTypes || []).includes($.enum.ePayment));
764
+ async function W(a) {
765
+ i.value.dineIn.displayStand.enablePaxDialog = a, i.value.dineIn.pickUp.enablePaxDialog = a;
766
+ }
767
+ const K = D(() => (i.value.dineIn.displayStand.enabled && i.value.dineIn.displayStand.enablePaxDialog || i.value.dineIn.pickUp.enablePaxDialog) ?? !1);
768
+ async function u() {
769
+ if (b.value) {
770
+ const a = b.value;
771
+ d(async () => {
772
+ await g("updateKioskOrderSetting", a);
773
+ });
774
+ } else
775
+ p.open({
776
+ title: e("order.failedToUpdateSetting"),
777
+ type: "error"
778
+ });
779
+ }
780
+ return (a, c) => {
781
+ const E = T("FmButton");
782
+ return i.value ? (y(), I("div", Ne, [
783
+ m("div", Ee, [
784
+ m("span", Oe, V(l(e)("order.dineIn")), 1),
785
+ (y(), M(_e, {
786
+ key: "dine-in-" + a.restaurantId,
787
+ v: i.value.dineIn,
788
+ onUpdateDineIn: s
789
+ }, null, 8, ["v"]))
790
+ ]),
791
+ m("div", $e, [
792
+ m("span", Me, V(l(e)("order.takeawayTitle")), 1),
793
+ (y(), M(he, {
794
+ key: "takeaway-" + a.restaurantId,
795
+ v: i.value.takeaway,
796
+ onUpdateTakeaway: _
797
+ }, null, 8, ["v"]))
798
+ ]),
799
+ m("div", Ye, [
800
+ m("span", qe, V(l(e)("order.menuItem")), 1),
801
+ (y(), M(Ue, {
802
+ key: "menu-item-" + a.restaurantId,
803
+ v: i.value.menuItem.showAllOnly,
804
+ "onUpdate:modelValue": f
805
+ }, null, 8, ["v"]))
806
+ ]),
807
+ m("div", We, [
808
+ m("span", Le, V(l(e)("order.displayPaxDialogTitle")), 1),
809
+ (y(), M(Fe, {
810
+ key: "enable-pax-dialog-" + a.restaurantId,
811
+ v: K.value,
812
+ onUpdateEnablePaxDialog: W
813
+ }, null, 8, ["v"]))
814
+ ]),
815
+ m("div", Ke, [
816
+ m("span", Qe, V(l(e)("order.acceptedPayment")), 1),
817
+ m("span", Be, V(l(e)("order.configuration")), 1),
818
+ o(Re, {
819
+ "payment-types": i.value.paymentSetting.paymentTypes ?? [],
820
+ "allow-e-payment": A.value,
821
+ "offline-payment-types": i.value.paymentSetting.offlinePaymentTypes ?? [],
822
+ ePaymentTypes: i.value.paymentSetting.ePaymentTypes ?? {},
823
+ "onUpdate:paymentTypes": w,
824
+ "onUpdate:offlinePaymentTypes": c[0] || (c[0] = (C) => i.value.paymentSetting.offlinePaymentTypes = C),
825
+ "onUpdate:ePaymentTypes": k
826
+ }, null, 8, ["payment-types", "allow-e-payment", "offline-payment-types", "ePaymentTypes"])
827
+ ]),
828
+ o(E, {
829
+ class: "w-1/4 mb-10",
830
+ variant: "primary",
831
+ label: l(e)("order.updateSetting"),
832
+ disabled: !b.value,
833
+ onClick: u
834
+ }, null, 8, ["label", "disabled"])
835
+ ])) : (y(), I("div", je, V(l(e)("order.pleaseSelectRestaurant")), 1));
836
+ };
837
+ }
838
+ });
839
+ export {
840
+ aa as default
841
+ };