@feedmepos/mf-order-setting 0.0.88 → 0.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{DisplaySystemView-BiKFL6UY.js → DisplaySystemView-BA-5JObJ.js} +1 -1
  2. package/dist/{KioskDevicesView-DQPue13D.js → KioskDevicesView-CgdnW9N9.js} +1 -1
  3. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-BAe1eQvx.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-C9X9ziUm.js} +3 -3
  4. package/dist/KioskSettingView-CVck01e7.js +860 -0
  5. package/dist/{KioskView-BfTNsmN1.js → KioskView-DKY2QEh5.js} +54 -48
  6. package/dist/{OrderSettingsView-CowX8_oN.js → OrderSettingsView-CEPIZmHA.js} +774 -768
  7. package/dist/{app-DgZSoUgk.js → app-C9nnuR9O.js} +206 -190
  8. package/dist/app.js +1 -1
  9. package/dist/frontend/mf-order/src/app.d.ts +16 -0
  10. package/dist/frontend/mf-order/src/main.d.ts +16 -0
  11. package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +2 -0
  12. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +6 -0
  13. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  14. package/dist/{index-CGJIcLNE.js → index-BaC_Douy.js} +2 -2
  15. package/dist/{index-CWm0u6lo.js → index-DGAU5Dhc.js} +1 -1
  16. package/dist/{index-DzmXxFJu.js → index-Gk7389CW.js} +1 -1
  17. package/dist/{order.dto-DQWf-RVV.js → order.dto-CfCfBJYu.js} +43 -6
  18. package/dist/package/entity/food-court/food-court.dto.d.ts +51 -121
  19. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +10 -0
  20. package/dist/package/entity/kiosk/kiosk.do.d.ts +16 -16
  21. package/dist/package/entity/kiosk/kiosk.dto.d.ts +19 -19
  22. package/dist/package/entity/order/order-item/order-item.dto.d.ts +20 -0
  23. package/dist/package/entity/order/order.do.d.ts +19 -3
  24. package/dist/package/entity/order/order.dto.d.ts +107 -91
  25. package/dist/package/entity/order/order.enum.d.ts +1 -1
  26. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +3 -0
  27. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +6 -0
  28. package/dist/package/entity/order-setting/order-setting.do.d.ts +5 -0
  29. package/dist/package/entity/order-setting/order-setting.dto.d.ts +13 -0
  30. package/dist/package/entity/queue/queue.dto.d.ts +23 -36
  31. package/dist/package/entity/restaurant/restaurant.dto.d.ts +10 -15
  32. package/dist/package/entity/websocket/websocket.dto.d.ts +12 -0
  33. package/package.json +1 -1
  34. package/src/locales/en-US.json +4 -0
  35. package/src/locales/ja-JP.json +4 -0
  36. package/src/locales/th-TH.json +4 -0
  37. package/src/locales/zh-CN.json +4 -0
  38. package/src/modules/order-setting/kiosk/interface.ts +10 -0
  39. package/src/stores/order-setting/mapper.spec.ts +21 -0
  40. package/src/stores/order-setting/mapper.ts +8 -2
  41. package/src/views/kiosk/settings/KioskSettingView.vue +37 -0
  42. package/src/views/order-settings/delivery/delivery.spec.ts +23 -3
  43. package/src/views/order-settings/delivery/delivery.ts +4 -0
  44. package/dist/KioskSettingView-M3pBFSwt.js +0 -839
@@ -1,839 +0,0 @@
1
- import { defineComponent as ye, computed as x, ref as Y, onMounted as Ae, resolveComponent as V, openBlock as w, createBlock as oe, withCtx as R, createVNode as i, unref as a, createElementVNode as d, withDirectives as F, vShow as N, toDisplayString as b, watch as Re, createElementBlock as E, createCommentVNode as z, Fragment as te, renderList as ne, normalizeClass as Ee } from "vue";
2
- import { e as ue, b as ve, s as fe, d as Ue, r as me, f as pe, h as Fe } from "./app-DgZSoUgk.js";
3
- import { c as v, K as Ne, d as Oe } from "./order.dto-DQWf-RVV.js";
4
- import { _ as Le, u as Me, a as De } from "./index-CGJIcLNE.js";
5
- import { useI18n as be, FeedMeAuth as ge, useCoreStore as $e } from "@feedmepos/mf-common";
6
- import { useSnackbar as We } from "@feedmepos/ui-library";
7
- const Ye = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary ml-7" }, Ke = { class: "ml-7" }, je = { class: "ml-7" }, qe = { class: "flex flex-row gap-9" }, Be = /* @__PURE__ */ ye({
8
- __name: "KioskPaymentTypeSection",
9
- props: {
10
- paymentTypes: {
11
- type: Array,
12
- required: !0
13
- },
14
- offlinePaymentTypes: {
15
- type: Array,
16
- required: !0
17
- },
18
- allowEPayment: {
19
- type: [Boolean, String],
20
- required: !0
21
- },
22
- allowCredit: {
23
- type: [Boolean, String],
24
- default: !1
25
- },
26
- ePaymentTypes: {
27
- type: Object,
28
- required: !0
29
- }
30
- },
31
- emits: ["update:paymentTypes", "update:offlinePaymentTypes", "update:ePaymentTypes"],
32
- setup(n, { emit: r }) {
33
- const { t: e } = be(), u = n, I = r, h = x(() => (u.paymentTypes || []).includes(ue.F_ORDER_PAYMENT_TYPE.enum.ePayment)), _ = Y(), g = Y([]), l = Y(!1), U = Y(!1), T = Y(!1), K = () => {
34
- Object.keys(u.ePaymentTypes).length !== 0 && (u.ePaymentTypes.terminal && (U.value = !0), u.ePaymentTypes.card.terminal ? (_.value = v.enum.TERMINAL, l.value = !0) : u.ePaymentTypes.card.nfc && (_.value = v.enum.NFC, l.value = !0), u.ePaymentTypes.eWallet.qrPay && (g.value.push(v.enum.QRPAY), T.value = !0), u.ePaymentTypes.eWallet.scanPay && (g.value.push(v.enum.SCANPAY), T.value = !0));
35
- };
36
- K();
37
- const Z = (f) => {
38
- const m = {
39
- terminal: !1,
40
- card: {
41
- terminal: !1,
42
- nfc: !1
43
- },
44
- eWallet: {
45
- qrPay: !1,
46
- scanPay: !1
47
- }
48
- };
49
- h.value && (f == v.enum.TERMINAL && (m.card.terminal = !0), f == v.enum.NFC && (m.card.nfc = !0), g.value.length > 0 && (g.value.includes(v.enum.QRPAY) && (m.eWallet.qrPay = !0), g.value.includes(v.enum.SCANPAY) && (m.eWallet.scanPay = !0))), U.value && (m.terminal = !0), I("update:ePaymentTypes", m);
50
- }, A = () => {
51
- const f = {
52
- terminal: !1,
53
- card: {
54
- terminal: !1,
55
- nfc: !1
56
- },
57
- eWallet: {
58
- qrPay: !1,
59
- scanPay: !1,
60
- terminalScanPay: !1,
61
- terminalQrPay: !1
62
- }
63
- };
64
- h.value && (_.value && (_.value === v.enum.TERMINAL && (f.card.terminal = !0), _.value === v.enum.NFC && (f.card.nfc = !0)), U.value && (f.terminal = !0), g.value.includes(v.enum.QRPAY) && (f.eWallet.qrPay = !0), g.value.includes(v.enum.SCANPAY) && (f.eWallet.scanPay = !0), g.value.includes(v.enum.TERMINAL_SCAN_PAY) && (f.eWallet.terminalScanPay = !0), g.value.includes(v.enum.TERMINAL_QR_PAY) && (f.eWallet.terminalQrPay = !0)), I("update:ePaymentTypes", f);
65
- }, D = (f) => {
66
- _.value = "", f && (_.value = v.enum.TERMINAL), A();
67
- }, Q = (f) => {
68
- g.value = [], f && (g.value = [
69
- v.enum.QRPAY,
70
- v.enum.SCANPAY
71
- ]), A();
72
- }, ee = (f) => {
73
- I("update:paymentTypes", f), f.includes(ue.F_ORDER_PAYMENT_TYPE.enum.ePayment) || (l.value = !1, T.value = !1, D(!1), Q(!1));
74
- };
75
- return Ae(() => {
76
- K();
77
- }), (f, m) => {
78
- const O = V("FmSwitch"), j = V("FmRadio"), ae = V("FmRadioGroup"), q = V("FmCardSection"), B = V("FmCard"), $ = V("FmCheckbox");
79
- return w(), oe(Le, {
80
- "payment-types": n.paymentTypes,
81
- "offline-payment-types": n.offlinePaymentTypes,
82
- "allow-e-payment": u.allowEPayment,
83
- "allow-credit": u.allowCredit,
84
- "onUpdate:paymentTypes": ee,
85
- "onUpdate:offlinePaymentTypes": m[8] || (m[8] = (c) => I("update:offlinePaymentTypes", c || []))
86
- }, {
87
- "e-payment-note": R(() => [
88
- d("div", Ye, b(a(e)("order.legacyEPaymentNote")), 1)
89
- ]),
90
- "e-payment-content": R(() => [
91
- i(B, { variant: "outlined" }, {
92
- default: R(() => [
93
- i(q, null, {
94
- default: R(() => [
95
- i(O, {
96
- label: a(e)("order.bankCard"),
97
- sublabel: a(e)("order.cardPaymentDescription"),
98
- "label-placement": "right",
99
- modelValue: l.value,
100
- "onUpdate:modelValue": [
101
- m[0] || (m[0] = (c) => l.value = c),
102
- D
103
- ]
104
- }, null, 8, ["label", "sublabel", "modelValue"]),
105
- m[9] || (m[9] = d("br", null, null, -1)),
106
- F(d("div", Ke, [
107
- i(ae, {
108
- modelValue: _.value,
109
- "onUpdate:modelValue": [
110
- m[1] || (m[1] = (c) => _.value = c),
111
- Z
112
- ],
113
- inline: ""
114
- }, {
115
- default: R(() => [
116
- i(j, {
117
- label: a(e)("order.terminal"),
118
- value: a(v).enum.TERMINAL
119
- }, null, 8, ["label", "value"]),
120
- i(j, {
121
- label: a(e)("order.nfc"),
122
- value: a(v).enum.NFC
123
- }, null, 8, ["label", "value"])
124
- ]),
125
- _: 1
126
- }, 8, ["modelValue"])
127
- ], 512), [
128
- [N, l.value]
129
- ])
130
- ]),
131
- _: 1
132
- })
133
- ]),
134
- _: 1
135
- }),
136
- i(B, {
137
- variant: "outlined",
138
- class: "mt-2"
139
- }, {
140
- default: R(() => [
141
- i(q, null, {
142
- default: R(() => [
143
- i(O, {
144
- label: a(e)("order.terminal"),
145
- sublabel: a(e)("order.terminalPaymentDescription"),
146
- "label-placement": "right",
147
- modelValue: U.value,
148
- "onUpdate:modelValue": [
149
- m[2] || (m[2] = (c) => U.value = c),
150
- A
151
- ]
152
- }, null, 8, ["label", "sublabel", "modelValue"])
153
- ]),
154
- _: 1
155
- })
156
- ]),
157
- _: 1
158
- }),
159
- i(B, {
160
- variant: "outlined",
161
- class: "mt-2"
162
- }, {
163
- default: R(() => [
164
- i(q, null, {
165
- default: R(() => [
166
- i(O, {
167
- label: a(e)("order.eWallet"),
168
- sublabel: a(e)("order.eWalletDescription"),
169
- "label-placement": "right",
170
- modelValue: T.value,
171
- "onUpdate:modelValue": [
172
- m[3] || (m[3] = (c) => T.value = c),
173
- Q
174
- ]
175
- }, null, 8, ["label", "sublabel", "modelValue"]),
176
- m[10] || (m[10] = d("br", null, null, -1)),
177
- F(d("div", je, [
178
- d("div", qe, [
179
- i($, {
180
- modelValue: g.value,
181
- "onUpdate:modelValue": [
182
- m[4] || (m[4] = (c) => g.value = c),
183
- A
184
- ],
185
- label: a(e)("order.qrPay"),
186
- value: a(v).enum.QRPAY
187
- }, null, 8, ["modelValue", "label", "value"]),
188
- i($, {
189
- modelValue: g.value,
190
- "onUpdate:modelValue": [
191
- m[5] || (m[5] = (c) => g.value = c),
192
- A
193
- ],
194
- label: a(e)("order.scanPay"),
195
- value: a(v).enum.SCANPAY
196
- }, null, 8, ["modelValue", "label", "value"]),
197
- i($, {
198
- modelValue: g.value,
199
- "onUpdate:modelValue": [
200
- m[6] || (m[6] = (c) => g.value = c),
201
- A
202
- ],
203
- label: a(e)("order.terminalScanPay"),
204
- value: a(v).enum.TERMINAL_SCAN_PAY
205
- }, null, 8, ["modelValue", "label", "value"]),
206
- i($, {
207
- modelValue: g.value,
208
- "onUpdate:modelValue": [
209
- m[7] || (m[7] = (c) => g.value = c),
210
- A
211
- ],
212
- label: a(e)("order.terminalQrPay"),
213
- value: a(v).enum.TERMINAL_QR_PAY
214
- }, null, 8, ["modelValue", "label", "value"])
215
- ])
216
- ], 512), [
217
- [N, T.value]
218
- ])
219
- ]),
220
- _: 1
221
- })
222
- ]),
223
- _: 1
224
- })
225
- ]),
226
- _: 1
227
- }, 8, ["payment-types", "offline-payment-types", "allow-e-payment", "allow-credit"]);
228
- };
229
- }
230
- }), ze = {
231
- "en-US": "English",
232
- "zh-CN": "中文",
233
- "th-TH": "ไทย",
234
- "vi-VN": "Tiếng Việt",
235
- "id-ID": "Bahasa Indonesia",
236
- "ko-KR": "한국어",
237
- "ja-JP": "日本語",
238
- "ar-SA": "العربية"
239
- }, Qe = Ne.map((n) => ({
240
- code: n,
241
- label: ze[n]
242
- }));
243
- var He = { firebase: {} }, Ge = {};
244
- let G = null;
245
- function Xe(n) {
246
- var u;
247
- const r = (u = n.name.split(".").pop()) == null ? void 0 : u.toLowerCase();
248
- return r && /^[a-z0-9]+$/.test(r) ? r : {
249
- "image/jpeg": "jpg",
250
- "image/png": "png",
251
- "image/webp": "webp",
252
- "image/gif": "gif"
253
- }[n.type] ?? "bin";
254
- }
255
- function Je() {
256
- var e;
257
- return (((e = Ge.firebase) == null ? void 0 : e.storageBucket) ?? He.firebase.storageBucket ?? "image.feedme.cc").replace(/^https?:\/\//, "").replace(/\/+$/, "");
258
- }
259
- function Ze(n) {
260
- const r = n.replace(/^\/+/, "");
261
- return `https://${Je()}/${r}`;
262
- }
263
- async function ea() {
264
- const n = ve();
265
- if (!n.currentUser && (await n.authStateReady(), !n.currentUser && (G || (G = (async () => {
266
- const r = await ge.getCustomToken();
267
- await fe(n, r);
268
- })().finally(() => {
269
- G = null;
270
- })), await G, !n.currentUser)))
271
- throw new Error("User not authenticated for image upload");
272
- }
273
- async function aa() {
274
- const n = ve();
275
- n.currentUser && await Fe(n);
276
- const r = await ge.getCustomToken();
277
- await fe(n, r);
278
- }
279
- async function la(n, r) {
280
- const e = Ue(), u = me(e, n);
281
- try {
282
- await pe(u, r, {
283
- contentType: r.type || void 0
284
- });
285
- return;
286
- } catch (h) {
287
- if ((h == null ? void 0 : h.code) !== "storage/unauthorized")
288
- throw h;
289
- }
290
- await aa();
291
- const I = me(e, n);
292
- await pe(I, r, {
293
- contentType: r.type || void 0
294
- });
295
- }
296
- async function ta(n, r) {
297
- await ea();
298
- const e = n.replace(/^\/+/, "").replace(/\/+$/, ""), u = Xe(r), I = `${Date.now()}_${Math.random().toString(36).slice(2, 10)}.${u}`, h = `${e}/${I}`;
299
- return await la(h, r), Ze(h);
300
- }
301
- const X = 8, ce = 6, Ie = 2, _e = 60, na = {
302
- landscape: "coverImageLandscape",
303
- portrait: "coverImagePortrait"
304
- };
305
- function he(n) {
306
- if (!Array.isArray(n)) return [];
307
- const r = /* @__PURE__ */ new Set(), e = [];
308
- for (const u of n) {
309
- const I = typeof u == "string" ? u.trim() : "";
310
- !I || r.has(I) || (r.add(I), e.push(I));
311
- }
312
- return e;
313
- }
314
- function J(n, r) {
315
- var e;
316
- return he((e = n.coverCarousel) == null ? void 0 : e[r]);
317
- }
318
- function oa(n, r) {
319
- const e = n[na[r]], u = typeof e == "string" ? e.trim() : "";
320
- return u.length > 0 ? u : null;
321
- }
322
- function ra(n, r) {
323
- const e = J(n, r);
324
- if (e.length > 0) return e;
325
- const u = oa(n, r);
326
- return u ? [u] : [];
327
- }
328
- function sa(n) {
329
- var e;
330
- const r = (e = n.coverCarousel) == null ? void 0 : e.intervalMs;
331
- return typeof r != "number" || !Number.isFinite(r) || r <= 0 ? null : Math.round(r / 1e3);
332
- }
333
- function Se(n, r, e) {
334
- return n.length === 0 && r.length === 0 ? null : {
335
- landscape: n.length > 0 ? n : void 0,
336
- portrait: r.length > 0 ? r : void 0,
337
- intervalMs: typeof e == "number" && e > 0 ? e : void 0
338
- };
339
- }
340
- function da(n, r, e) {
341
- var _;
342
- const u = he(e).slice(0, X), I = r === "landscape" ? "portrait" : "landscape", h = {
343
- [r]: u.length > 1 ? u : [],
344
- [I]: J(n, I)
345
- };
346
- return {
347
- coverImageLandscape: r === "landscape" ? u[0] ?? null : n.coverImageLandscape,
348
- coverImagePortrait: r === "portrait" ? u[0] ?? null : n.coverImagePortrait,
349
- coverCarousel: Se(
350
- h.landscape,
351
- h.portrait,
352
- (_ = n.coverCarousel) == null ? void 0 : _.intervalMs
353
- )
354
- };
355
- }
356
- function ia(n, r) {
357
- const e = r == null || !Number.isFinite(r) ? null : Math.min(_e, Math.max(Ie, Math.round(r)));
358
- return {
359
- coverImageLandscape: n.coverImageLandscape,
360
- coverImagePortrait: n.coverImagePortrait,
361
- coverCarousel: Se(
362
- J(n, "landscape"),
363
- J(n, "portrait"),
364
- e == null ? null : e * 1e3
365
- )
366
- };
367
- }
368
- function ua(n, r, e) {
369
- if (r === e) return [...n];
370
- if (r < 0 || e < 0 || r >= n.length || e >= n.length) return [...n];
371
- const u = [...n], [I] = u.splice(r, 1);
372
- return u.splice(e, 0, I), u;
373
- }
374
- const ma = {
375
- key: 0,
376
- class: "flex flex-col gap-32"
377
- }, pa = {
378
- key: 0,
379
- class: "flex flex-col gap-2"
380
- }, ca = { class: "fm-typo-en-title-sm-600" }, ya = { class: "flex flex-col gap-1 w-full md:w-1/2" }, va = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, fa = { class: "flex flex-col gap-2" }, ba = { class: "fm-typo-en-title-sm-600" }, ga = { class: "flex flex-col gap-5" }, Ia = { class: "flex flex-col gap-16" }, _a = { class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12" }, ha = { class: "fm-typo-en-title-sm-600" }, Sa = { class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12" }, Pa = { class: "fm-typo-en-title-sm-600" }, Ca = { class: "flex flex-row gap-2" }, xa = { class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12" }, wa = { class: "fm-typo-en-title-sm-600" }, Va = { class: "flex flex-col gap-2" }, ka = { class: "fm-typo-en-title-sm-600" }, Ta = { class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12" }, Aa = { class: "fm-typo-en-title-sm-600" }, Ra = { class: "flex flex-col gap-2" }, Ea = { class: "fm-typo-en-title-sm-600" }, Ua = { class: "flex flex-col gap-2" }, Fa = { class: "fm-typo-en-title-sm-600" }, Na = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Oa = { class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4 my-5 w-11/12" }, La = { class: "grid grid-cols-1 md:grid-cols-2 gap-3" }, Ma = {
381
- key: 0,
382
- class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300"
383
- }, Da = { class: "flex flex-col gap-2" }, $a = { class: "fm-typo-en-title-sm-600" }, Wa = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ya = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ka = { class: "fm-typo-en-body-md-600" }, ja = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qa = { class: "flex flex-wrap items-start gap-4" }, Ba = { class: "relative" }, za = ["src", "alt"], Qa = { class: "absolute top-2 left-2 px-2 rounded-full bg-fm-color-typo-primary text-fm-color-neutral-white fm-typo-en-body-sm-400" }, Ha = { class: "flex items-center gap-1" }, Ga = {
384
- key: 0,
385
- class: "w-11/12"
386
- }, Xa = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ja = { class: "flex flex-col gap-2" }, Za = { class: "fm-typo-en-title-sm-600" }, el = { class: "flex flex-col gap-2" }, al = { key: 1 }, ll = 10 * 1e3 * 1e3, il = /* @__PURE__ */ ye({
387
- __name: "KioskSettingView",
388
- props: {
389
- restaurantId: {},
390
- form: {}
391
- },
392
- emits: ["updateKioskOrderSetting"],
393
- setup(n, { emit: r }) {
394
- const { t: e } = be(), u = $e(), I = x(() => {
395
- var o;
396
- return ((o = u.sessionUser.value) == null ? void 0 : o.role.isAdmin) ?? !1;
397
- }), h = n, _ = We(), g = r, l = Y(h.form), U = Qe, T = x(() => l.value.languages != null), K = x(() => l.value.languages ?? []);
398
- function Z(o) {
399
- l.value.languages = o ? ["en-US"] : null;
400
- }
401
- function A(o, s) {
402
- const p = l.value.languages ?? [];
403
- l.value.languages = s ? U.filter((y) => y.code === o || p.includes(y.code)).map((y) => y.code) : p.filter((y) => y !== o);
404
- }
405
- const D = (o) => o < 0 ? e("order.nonNegativeRule") : !0, Q = (o) => o <= (l.value.dineIn.displayStand.standSlotRange.min ?? 0) ? e("order.greaterThanMinRule") : !0, ee = x(() => [D]), f = x(() => [D]), m = x(() => [D, Q]), O = x(() => {
406
- var y, S, L, M, H, t, k, C;
407
- const o = l.value, s = (y = o.otaChannel) == null ? void 0 : y.trim();
408
- if (o.dineIn.enabled && o.dineIn.displayStand.enabled) {
409
- const { padDigit: P, standSlotRange: W } = o.dineIn.displayStand;
410
- if (!(P != null && P >= 0 && W.min != null && W.max != null && W.min <= W.max)) return null;
411
- }
412
- if (o.languages != null && o.languages.length === 0) return null;
413
- const p = o.paymentSetting;
414
- if ((S = p == null ? void 0 : p.paymentTypes) != null && S.includes(Oe.enum.ePayment)) {
415
- const P = p.ePaymentTypes;
416
- if (!P) return null;
417
- const W = ((L = P.card) == null ? void 0 : L.terminal) || ((M = P.card) == null ? void 0 : M.nfc), ie = ((H = P.eWallet) == null ? void 0 : H.qrPay) || ((t = P.eWallet) == null ? void 0 : t.scanPay) || ((k = P.eWallet) == null ? void 0 : k.terminalScanPay) || ((C = P.eWallet) == null ? void 0 : C.terminalQrPay), Te = P.terminal;
418
- if (!W && !ie && !Te) return null;
419
- }
420
- return {
421
- ...o,
422
- otaChannel: s || void 0,
423
- dineIn: {
424
- ...o.dineIn,
425
- displayStand: {
426
- ...o.dineIn.displayStand,
427
- enabled: o.dineIn.enabled && o.dineIn.displayStand.enabled,
428
- padDigit: o.dineIn.displayStand.padDigit ?? 0,
429
- standSlotRange: {
430
- min: o.dineIn.displayStand.standSlotRange.min ?? 0,
431
- max: o.dineIn.displayStand.standSlotRange.max ?? 10
432
- },
433
- prefix: o.dineIn.displayStand.prefix ?? ""
434
- }
435
- }
436
- };
437
- }), { startAsyncCall: j } = Me();
438
- function ae(o) {
439
- l.value.paymentSetting.paymentTypes = o;
440
- }
441
- function q(o) {
442
- l.value.paymentSetting.ePaymentTypes = o;
443
- }
444
- const B = De(), $ = [
445
- {
446
- value: "landscape",
447
- labelKey: "order.coverImageLandscape",
448
- hintKey: "order.coverImageLandscapeHint",
449
- previewClass: "w-[280px] aspect-video",
450
- dropClass: "w-[280px] aspect-video"
451
- },
452
- {
453
- value: "portrait",
454
- labelKey: "order.coverImagePortrait",
455
- hintKey: "order.coverImagePortraitHint",
456
- previewClass: "w-[160px] aspect-[9/16]",
457
- dropClass: "w-[160px] aspect-[9/16]"
458
- }
459
- ];
460
- function c(o) {
461
- return ra(l.value, o);
462
- }
463
- const Pe = x(
464
- () => c("landscape").length > 1 || c("portrait").length > 1
465
- );
466
- function le(o, s) {
467
- Object.assign(
468
- l.value,
469
- da(l.value, o, s)
470
- );
471
- }
472
- function re(o, s, p) {
473
- le(o, ua(c(o), s, p));
474
- }
475
- function Ce(o, s) {
476
- const p = c(o).filter((y, S) => S !== s);
477
- le(o, p);
478
- }
479
- const se = x({
480
- get: () => sa(l.value),
481
- set: (o) => {
482
- Object.assign(
483
- l.value,
484
- ia(l.value, o)
485
- );
486
- }
487
- });
488
- async function xe(o, s) {
489
- if (!(c(o).length >= X))
490
- try {
491
- const p = await j(async () => {
492
- const y = `/restaurant/${h.restaurantId}/kiosk/cover-${o}`;
493
- return await ta(y, s);
494
- });
495
- le(o, [...c(o), p]), _.open({
496
- title: e("order.imageUploadSuccess"),
497
- type: "success"
498
- });
499
- } catch (p) {
500
- console.error(p), _.open({
501
- title: e("order.imageUploadFailed"),
502
- type: "error"
503
- });
504
- }
505
- }
506
- function we(o, s) {
507
- var S, L;
508
- const p = e(o === "landscape" ? "order.coverImageLandscape" : "order.coverImagePortrait"), y = (L = (S = s[0]) == null ? void 0 : S.reason) == null ? void 0 : L[0];
509
- _.open({
510
- title: y ? `${e("order.imageUploadRejected")}: ${p} (${y})` : `${e("order.imageUploadRejected")}: ${p}`,
511
- type: "error"
512
- });
513
- }
514
- const Ve = x(() => B.getRestaurantEPayment()), de = x({
515
- get: () => (l.value.dineIn.displayStand.enabled && l.value.dineIn.displayStand.enablePaxDialog || l.value.dineIn.pickUp.enablePaxDialog) ?? !1,
516
- set: (o) => {
517
- l.value.dineIn.displayStand.enablePaxDialog = o, l.value.dineIn.pickUp.enablePaxDialog = o;
518
- }
519
- });
520
- Re(
521
- () => [
522
- l.value.dineIn.enabled,
523
- l.value.dineIn.pickUp.enabled,
524
- l.value.dineIn.displayStand.enabled
525
- ],
526
- ([o, s, p], y) => {
527
- const S = (y == null ? void 0 : y[0]) ?? !1;
528
- o && !s && !p && (l.value.dineIn.pickUp.enabled = !0, S || _.open({
529
- title: e("order.dineInModeAutoCorrected"),
530
- type: "info"
531
- }));
532
- },
533
- { immediate: !0 }
534
- );
535
- async function ke() {
536
- if (O.value) {
537
- const o = O.value;
538
- j(async () => {
539
- await g("updateKioskOrderSetting", o);
540
- });
541
- } else
542
- _.open({
543
- title: e("order.failedToUpdateSetting"),
544
- type: "error"
545
- });
546
- }
547
- return (o, s) => {
548
- const p = V("FmTextField"), y = V("FmSwitch"), S = V("FmStepperField"), L = V("FmCheckbox"), M = V("FmButton"), H = V("FmDropField");
549
- return l.value ? (w(), E("div", ma, [
550
- I.value ? (w(), E("div", pa, [
551
- d("span", ca, b(a(e)("order.otaChannel")), 1),
552
- d("div", ya, [
553
- i(p, {
554
- modelValue: l.value.otaChannel,
555
- "onUpdate:modelValue": s[0] || (s[0] = (t) => l.value.otaChannel = t),
556
- label: a(e)("order.otaChannel"),
557
- placeholder: a(e)("order.otaChannelHint")
558
- }, null, 8, ["modelValue", "label", "placeholder"]),
559
- d("span", va, b(a(e)("order.otaChannelHint")), 1)
560
- ])
561
- ])) : z("", !0),
562
- d("div", fa, [
563
- d("span", ba, b(a(e)("order.dineIn")), 1),
564
- d("div", ga, [
565
- i(y, {
566
- modelValue: l.value.dineIn.enabled,
567
- "onUpdate:modelValue": s[1] || (s[1] = (t) => l.value.dineIn.enabled = t),
568
- label: a(e)("order.dineIn"),
569
- "label-placement": "right"
570
- }, null, 8, ["modelValue", "label"]),
571
- F(d("div", Ia, [
572
- d("div", null, [
573
- i(y, {
574
- modelValue: l.value.dineIn.pickUp.enabled,
575
- "onUpdate:modelValue": s[2] || (s[2] = (t) => l.value.dineIn.pickUp.enabled = t),
576
- label: a(e)("order.pickAtCounter"),
577
- "label-placement": "right"
578
- }, null, 8, ["modelValue", "label"]),
579
- F(d("div", _a, [
580
- d("span", ha, b(a(e)("order.submitOrderInstruction")), 1),
581
- i(p, {
582
- modelValue: l.value.dineIn.pickUp.submitOrderInstruction.payAtCounter,
583
- "onUpdate:modelValue": s[3] || (s[3] = (t) => l.value.dineIn.pickUp.submitOrderInstruction.payAtCounter = t),
584
- label: a(e)("order.payAtCounter"),
585
- placeholder: "Collect your transaction slip below and present it to the cashier"
586
- }, null, 8, ["modelValue", "label"]),
587
- i(p, {
588
- modelValue: l.value.dineIn.pickUp.submitOrderInstruction.paid,
589
- "onUpdate:modelValue": s[4] || (s[4] = (t) => l.value.dineIn.pickUp.submitOrderInstruction.paid = t),
590
- label: a(e)("order.paid"),
591
- placeholder: "Please wait as we prepare your food. We'll call your number when it's ready."
592
- }, null, 8, ["modelValue", "label"])
593
- ], 512), [
594
- [N, l.value.dineIn.pickUp.enabled]
595
- ])
596
- ]),
597
- d("div", null, [
598
- i(y, {
599
- modelValue: l.value.dineIn.displayStand.enabled,
600
- "onUpdate:modelValue": s[5] || (s[5] = (t) => l.value.dineIn.displayStand.enabled = t),
601
- label: a(e)("order.displayStand"),
602
- "label-placement": "right"
603
- }, null, 8, ["modelValue", "label"]),
604
- F(d("div", Sa, [
605
- d("span", Pa, b(a(e)("order.tableServiceSetting")), 1),
606
- i(p, {
607
- modelValue: l.value.dineIn.displayStand.prefix,
608
- "onUpdate:modelValue": s[6] || (s[6] = (t) => l.value.dineIn.displayStand.prefix = t),
609
- label: a(e)("order.prefix"),
610
- placeholder: a(e)("order.prefix")
611
- }, null, 8, ["modelValue", "label", "placeholder"]),
612
- d("div", Ca, [
613
- i(S, {
614
- modelValue: l.value.dineIn.displayStand.standSlotRange.min,
615
- "onUpdate:modelValue": s[7] || (s[7] = (t) => l.value.dineIn.displayStand.standSlotRange.min = t),
616
- class: "w-1/2",
617
- label: a(e)("order.start"),
618
- labelMark: "required",
619
- rules: f.value,
620
- placeholder: a(e)("order.enterANumber")
621
- }, null, 8, ["modelValue", "label", "rules", "placeholder"]),
622
- i(S, {
623
- modelValue: l.value.dineIn.displayStand.standSlotRange.max,
624
- "onUpdate:modelValue": s[8] || (s[8] = (t) => l.value.dineIn.displayStand.standSlotRange.max = t),
625
- class: "w-1/2",
626
- label: a(e)("order.end"),
627
- labelMark: "required",
628
- rules: m.value,
629
- placeholder: a(e)("order.enterANumber")
630
- }, null, 8, ["modelValue", "label", "rules", "placeholder"])
631
- ]),
632
- i(S, {
633
- modelValue: l.value.dineIn.displayStand.padDigit,
634
- "onUpdate:modelValue": s[9] || (s[9] = (t) => l.value.dineIn.displayStand.padDigit = t),
635
- label: a(e)("order.padDigit"),
636
- labelMark: "required",
637
- rules: ee.value,
638
- placeholder: a(e)("order.padDigit")
639
- }, null, 8, ["modelValue", "label", "rules", "placeholder"])
640
- ], 512), [
641
- [N, l.value.dineIn.displayStand.enabled]
642
- ]),
643
- F(d("div", xa, [
644
- d("span", wa, b(a(e)("order.submitOrderInstruction")), 1),
645
- i(p, {
646
- modelValue: l.value.dineIn.displayStand.submitOrderInstruction.payAtCounter,
647
- "onUpdate:modelValue": s[10] || (s[10] = (t) => l.value.dineIn.displayStand.submitOrderInstruction.payAtCounter = t),
648
- label: a(e)("order.payAtCounter"),
649
- placeholder: "Collect your transaction slip below and present it to the cashier"
650
- }, null, 8, ["modelValue", "label"]),
651
- i(p, {
652
- modelValue: l.value.dineIn.displayStand.submitOrderInstruction.paid,
653
- "onUpdate:modelValue": s[11] || (s[11] = (t) => l.value.dineIn.displayStand.submitOrderInstruction.paid = t),
654
- label: a(e)("order.paid"),
655
- placeholder: "Please collect your receipt and we'll bring your food to your table once it's ready."
656
- }, null, 8, ["modelValue", "label"])
657
- ], 512), [
658
- [N, l.value.dineIn.displayStand.enabled]
659
- ])
660
- ])
661
- ], 512), [
662
- [N, l.value.dineIn.enabled]
663
- ])
664
- ])
665
- ]),
666
- d("div", Va, [
667
- d("span", ka, b(a(e)("order.takeawayTitle")), 1),
668
- i(y, {
669
- modelValue: l.value.takeaway.enabled,
670
- "onUpdate:modelValue": s[12] || (s[12] = (t) => l.value.takeaway.enabled = t),
671
- label: a(e)("order.takeaway"),
672
- "label-placement": "right",
673
- class: "mb-5"
674
- }, null, 8, ["modelValue", "label"]),
675
- F(d("div", Ta, [
676
- d("span", Aa, b(a(e)("order.submitOrderInstruction")), 1),
677
- i(p, {
678
- modelValue: l.value.takeaway.submitOrderInstruction.payAtCounter,
679
- "onUpdate:modelValue": s[13] || (s[13] = (t) => l.value.takeaway.submitOrderInstruction.payAtCounter = t),
680
- label: a(e)("order.payAtCounter"),
681
- placeholder: "Collect your transaction slip below and present it to the cashier"
682
- }, null, 8, ["modelValue", "label"]),
683
- i(p, {
684
- modelValue: l.value.takeaway.submitOrderInstruction.paid,
685
- "onUpdate:modelValue": s[14] || (s[14] = (t) => l.value.takeaway.submitOrderInstruction.paid = t),
686
- label: a(e)("order.paid"),
687
- placeholder: "Please wait as we prepare your food. We'll call your number when it's ready."
688
- }, null, 8, ["modelValue", "label"])
689
- ], 512), [
690
- [N, l.value.takeaway.enabled]
691
- ])
692
- ]),
693
- d("div", Ra, [
694
- d("span", Ea, b(a(e)("order.menuItem")), 1),
695
- i(y, {
696
- modelValue: l.value.menuItem.showAllOnly,
697
- "onUpdate:modelValue": s[15] || (s[15] = (t) => l.value.menuItem.showAllOnly = t),
698
- label: a(e)("order.showNotAvailableMenuItem"),
699
- "label-placement": "right",
700
- class: "mb-5"
701
- }, null, 8, ["modelValue", "label"])
702
- ]),
703
- d("div", Ua, [
704
- d("span", Fa, b(a(e)("order.kioskLanguage")), 1),
705
- d("span", Na, b(a(e)("order.kioskLanguageHint")), 1),
706
- d("div", Oa, [
707
- i(y, {
708
- "model-value": T.value,
709
- label: a(e)("order.kioskLanguageRestrict"),
710
- sublabel: a(e)("order.kioskLanguageRestrictSublabel"),
711
- "label-placement": "right",
712
- "onUpdate:modelValue": Z
713
- }, null, 8, ["model-value", "label", "sublabel"]),
714
- F(d("div", La, [
715
- (w(!0), E(te, null, ne(a(U), (t) => (w(), oe(L, {
716
- key: t.code,
717
- "model-value": K.value.includes(t.code),
718
- value: t.code,
719
- label: t.label,
720
- "onUpdate:modelValue": (k) => A(t.code, k)
721
- }, null, 8, ["model-value", "value", "label", "onUpdate:modelValue"]))), 128))
722
- ], 512), [
723
- [N, T.value]
724
- ]),
725
- T.value && K.value.length === 0 ? (w(), E("span", Ma, b(a(e)("order.kioskLanguageAtLeastOne")), 1)) : z("", !0)
726
- ])
727
- ]),
728
- d("div", Da, [
729
- d("span", $a, b(a(e)("order.coverImage")), 1),
730
- d("span", Wa, b(a(e)("order.coverImageFallbackHint")), 1),
731
- d("span", Ya, b(a(e)("order.coverCarouselHint", { max: a(X) })), 1),
732
- (w(), E(te, null, ne($, (t) => d("div", {
733
- key: t.value,
734
- class: "border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4 my-5 w-11/12"
735
- }, [
736
- d("span", Ka, b(a(e)(t.labelKey)), 1),
737
- d("span", ja, b(a(e)(t.hintKey)), 1),
738
- d("div", qa, [
739
- (w(!0), E(te, null, ne(c(t.value), (k, C) => (w(), E("div", {
740
- key: `${t.value}-${C}-${k}`,
741
- class: "flex flex-col gap-2"
742
- }, [
743
- d("div", Ba, [
744
- d("img", {
745
- src: k,
746
- alt: `${a(e)(t.labelKey)} ${C + 1}`,
747
- class: Ee([
748
- t.previewClass,
749
- "object-cover rounded-md border border-fm-color-neutral-gray-200"
750
- ])
751
- }, null, 10, za),
752
- d("span", Qa, b(C + 1), 1)
753
- ]),
754
- d("div", Ha, [
755
- i(M, {
756
- variant: "tertiary",
757
- size: "md",
758
- "prepend-icon": "arrow_back",
759
- disabled: C === 0,
760
- "aria-label": a(e)("order.coverCarouselMoveEarlier"),
761
- onClick: (P) => re(t.value, C, C - 1)
762
- }, null, 8, ["disabled", "aria-label", "onClick"]),
763
- i(M, {
764
- variant: "tertiary",
765
- size: "md",
766
- "prepend-icon": "arrow_forward",
767
- disabled: C === c(t.value).length - 1,
768
- "aria-label": a(e)("order.coverCarouselMoveLater"),
769
- onClick: (P) => re(t.value, C, C + 1)
770
- }, null, 8, ["disabled", "aria-label", "onClick"]),
771
- i(M, {
772
- variant: "tertiary",
773
- size: "md",
774
- "prepend-icon": "delete",
775
- "aria-label": a(e)("common.delete"),
776
- onClick: (P) => Ce(t.value, C)
777
- }, null, 8, ["aria-label", "onClick"])
778
- ])
779
- ]))), 128)),
780
- c(t.value).length < a(X) ? (w(), oe(H, {
781
- key: 0,
782
- accept: "image/*",
783
- "max-file-size": ll,
784
- "content-class": t.dropClass,
785
- onFileUpload: (k) => xe(t.value, k),
786
- onFileRejected: (k) => we(t.value, k)
787
- }, null, 8, ["content-class", "onFileUpload", "onFileRejected"])) : z("", !0)
788
- ])
789
- ])), 64)),
790
- Pe.value ? (w(), E("div", Ga, [
791
- i(S, {
792
- modelValue: se.value,
793
- "onUpdate:modelValue": s[16] || (s[16] = (t) => se.value = t),
794
- class: "max-w-[240px]",
795
- label: a(e)("order.coverCarouselInterval"),
796
- min: a(Ie),
797
- max: a(_e),
798
- placeholder: String(a(ce))
799
- }, null, 8, ["modelValue", "label", "min", "max", "placeholder"]),
800
- d("span", Xa, b(a(e)("order.coverCarouselIntervalHint", { seconds: a(ce) })), 1)
801
- ])) : z("", !0)
802
- ]),
803
- d("div", Ja, [
804
- d("span", Za, b(a(e)("order.displayPaxDialogTitle")), 1),
805
- i(y, {
806
- modelValue: de.value,
807
- "onUpdate:modelValue": s[17] || (s[17] = (t) => de.value = t),
808
- label: a(e)("order.displayPaxDialogDescription"),
809
- "label-placement": "right",
810
- class: "mb-5"
811
- }, null, 8, ["modelValue", "label"])
812
- ]),
813
- z("", !0),
814
- d("div", el, [
815
- i(Be, {
816
- "payment-types": l.value.paymentSetting.paymentTypes ?? [],
817
- "allow-credit": !0,
818
- "allow-e-payment": Ve.value,
819
- "offline-payment-types": l.value.paymentSetting.offlinePaymentTypes ?? [],
820
- ePaymentTypes: l.value.paymentSetting.ePaymentTypes ?? {},
821
- "onUpdate:paymentTypes": ae,
822
- "onUpdate:offlinePaymentTypes": s[19] || (s[19] = (t) => l.value.paymentSetting.offlinePaymentTypes = t),
823
- "onUpdate:ePaymentTypes": q
824
- }, null, 8, ["payment-types", "allow-e-payment", "offline-payment-types", "ePaymentTypes"])
825
- ]),
826
- i(M, {
827
- class: "w-1/4 mb-10",
828
- variant: "primary",
829
- label: a(e)("order.updateSetting"),
830
- disabled: !O.value,
831
- onClick: ke
832
- }, null, 8, ["label", "disabled"])
833
- ])) : (w(), E("div", al, b(a(e)("order.pleaseSelectRestaurant")), 1));
834
- };
835
- }
836
- });
837
- export {
838
- il as default
839
- };