@feedmepos/mf-order-setting 0.0.52 → 0.0.54

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 (74) hide show
  1. package/.env.dev +1 -1
  2. package/.env.prod +1 -1
  3. package/dist/{KioskDevicesView-D_YT-CL0.js → KioskDevicesView-CMKNjgWx.js} +1 -1
  4. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-Bxv6oiFw.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-B1sNvlUC.js} +2 -2
  5. package/dist/KioskSettingView-BE_pMA-i.js +720 -0
  6. package/dist/KioskView-U-Wg8oMC.js +480 -0
  7. package/dist/OrderSettingsView-BWzaITT6.js +51916 -0
  8. package/dist/app-CFfgPAd8.js +10445 -0
  9. package/dist/app.js +3 -3
  10. package/dist/dayjs.min-CuRr-wlf.js +283 -0
  11. package/dist/frontend/mf-order/src/app.d.ts +60 -8
  12. package/dist/frontend/mf-order/src/main.d.ts +60 -8
  13. package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +4 -2
  14. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +15 -6
  15. package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +3 -3
  16. package/dist/frontend/mf-order/src/utils/firebase-app.d.ts +4 -0
  17. package/dist/frontend/mf-order/src/utils/firebase-storage.d.ts +2 -0
  18. package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +2 -2
  19. package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +2 -2
  20. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  21. package/dist/{index-Bjwv8B4h.js → index-Bj0bCGTm.js} +25 -26
  22. package/dist/menu.dto-DAh1J2ES.js +128627 -0
  23. package/dist/package/entity/booking/booking.do.d.ts +30 -30
  24. package/dist/package/entity/delivery/delivery.dto.d.ts +6 -6
  25. package/dist/package/entity/food-court/order.do.d.ts +24 -4
  26. package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +12553 -162
  27. package/dist/package/entity/incoming-order/incoming-order.do.d.ts +43 -22268
  28. package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +14805 -66
  29. package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +1 -1
  30. package/dist/package/entity/index.d.ts +3 -0
  31. package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1 -19864
  32. package/dist/package/entity/order/order-item/order-item.dto.d.ts +1 -3721
  33. package/dist/package/entity/order/order.dto.d.ts +342 -7293
  34. package/dist/package/entity/order/payment/payment.dto.d.ts +3 -344
  35. package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +6 -6
  36. package/dist/package/entity/order-platform/grabfood/grabfood-edit-order.do.d.ts +144 -0
  37. package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +282 -47
  38. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +6 -6
  39. package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +69 -14
  40. package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +2 -0
  41. package/dist/package/entity/order-platform/order-platform.dto.d.ts +7306 -3
  42. package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +6 -6
  43. package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +12 -0
  44. package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +12 -0
  45. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +6 -3
  46. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +6 -3
  47. package/dist/package/entity/order-setting/order-setting.do.d.ts +13 -8
  48. package/dist/package/entity/order-setting/order-setting.dto.d.ts +30 -10
  49. package/dist/package/entity/queue/queue.do.d.ts +1 -11
  50. package/dist/package/entity/restaurant/restaurant.dto.d.ts +14 -9
  51. package/dist/package/entity/websocket/websocket.dto.d.ts +24 -12
  52. package/package.json +4 -2
  53. package/src/App.vue +3 -0
  54. package/src/locales/en-US.json +15 -2
  55. package/src/locales/ja-JP.json +31 -18
  56. package/src/locales/th-TH.json +15 -2
  57. package/src/locales/zh-CN.json +15 -2
  58. package/src/main.ts +10 -20
  59. package/src/modules/order-setting/kiosk/interface.ts +4 -2
  60. package/src/stores/order-setting/mapper.ts +63 -60
  61. package/src/utils/firebase-app.ts +34 -0
  62. package/src/utils/firebase-storage.ts +112 -0
  63. package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +1 -19
  64. package/src/views/kiosk/settings/KioskSettingView.vue +136 -43
  65. package/src/views/order-settings/OrderSettingsView.vue +1 -1
  66. package/src/views/order-settings/dine-in/DineInSetting.vue +23 -1
  67. package/src/views/order-settings/drive-thru/DriveThruSetting.vue +19 -18
  68. package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +5 -1
  69. package/dist/KioskSettingView-DS5vEQ07.js +0 -573
  70. package/dist/KioskView-B8NHcyGz.js +0 -477
  71. package/dist/OrderSettingsView-BhEN-2ZZ.js +0 -51602
  72. package/dist/app-BWFBpJUR.js +0 -2986
  73. package/dist/dayjs.min-CD9R3x-Y.js +0 -2092
  74. package/dist/menu.dto-Wzm4Tz0i.js +0 -101874
@@ -1,477 +0,0 @@
1
- import { defineComponent as U, computed as h, createElementBlock as f, openBlock as i, normalizeClass as k, createCommentVNode as b, createElementVNode as l, toDisplayString as u, unref as c, Fragment as ee, renderList as te, ref as I, defineAsyncComponent as ae, onMounted as ne, watch as oe, resolveComponent as g, createVNode as C, withCtx as se, withDirectives as le, vShow as re, createBlock as B } from "vue";
2
- import { u as ce, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-Bxv6oiFw.js";
3
- import { useI18n as $, useCoreStore as ue } from "@feedmepos/mf-common";
4
- import { F as V, a as ie, b as pe } from "./menu.dto-Wzm4Tz0i.js";
5
- import { useDialog as ye, useSnackbar as me, useBreakpoints as fe } from "@feedmepos/ui-library";
6
- import { defineStore as ve } from "pinia";
7
- import { O as E, c as M } from "./index-Bjwv8B4h.js";
8
- const _e = {
9
- key: 0,
10
- class: "fm-typo-en-title-sm-600"
11
- }, be = {
12
- key: 1,
13
- class: "my-[0.25rem]"
14
- }, he = { class: "flex flex-col gap-4" }, xe = { class: "flex flex-col gap-2" }, Pe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, we = {
15
- key: 0,
16
- class: "flex flex-col gap-1"
17
- }, Ce = { class: "px-1.5 py-0.5 fm-corner-radius-sm bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary fm-typo-en-body-xs-600 uppercase" }, Te = {
18
- key: 0,
19
- class: "fm-typo-en-body-sm-600"
20
- }, ge = ["title"], Ie = {
21
- key: 1,
22
- class: "fm-typo-en-body-lg-600"
23
- }, Ae = {
24
- key: 0,
25
- class: "flex flex-col gap-1"
26
- }, Ke = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Oe = { class: "fm-typo-en-body-lg-600" }, Ue = {
27
- key: 1,
28
- class: "flex flex-col gap-1"
29
- }, $e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Fe = { class: "fm-typo-en-body-lg-600" }, Se = {
30
- key: 2,
31
- class: "flex flex-col gap-1"
32
- }, qe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Re = { class: "fm-typo-en-body-lg-600" }, De = {
33
- key: 3,
34
- class: "flex flex-col gap-1"
35
- }, Be = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ve = { class: "fm-typo-en-body-lg-600" }, Ee = { key: 0 }, N = /* @__PURE__ */ U({
36
- __name: "KioskSummary",
37
- props: {
38
- restaurantId: {},
39
- devices: {},
40
- kioskOrderSetting: {},
41
- dialogType: { type: Boolean }
42
- },
43
- setup(t) {
44
- const { t: e } = $(), s = t, r = h(() => {
45
- var a;
46
- return (a = s.kioskOrderSetting) != null && a.dineIn.enabled ? e("order.activated") : e("order.deactivated");
47
- }), n = h(() => {
48
- var a;
49
- return (a = s.kioskOrderSetting) != null && a.takeaway.enabled ? e("order.activated") : e("order.deactivated");
50
- }), o = h(() => {
51
- var a, y;
52
- return (a = s.kioskOrderSetting) != null && a.dineIn.displayStand ? e("order.tableService") : (y = s.kioskOrderSetting) != null && y.dineIn && !s.kioskOrderSetting.dineIn.displayStand ? e("order.pickAtCounter") : e("order.unknown");
53
- }), p = h(() => {
54
- var a;
55
- return ((a = s.kioskOrderSetting) == null ? void 0 : a.paymentSetting.paymentTypes.includes(V.enum.cash)) ?? !1;
56
- }), d = h(() => {
57
- var y, v;
58
- const a = [];
59
- if ((y = s.kioskOrderSetting) == null || y.paymentSetting.paymentTypes.forEach((_) => {
60
- _ === V.enum.ePayment && a.push(e("order.ePayment"));
61
- }), a.length > 0 && Object.keys(s.kioskOrderSetting.paymentSetting.ePaymentTypes).length !== 0) {
62
- const _ = (v = s.kioskOrderSetting) == null ? void 0 : v.paymentSetting.ePaymentTypes;
63
- (_.card.terminal || _.card.nfc) && a.push(e("order.bankCard")), (_.eWallet.scanPay || _.eWallet.qrPay) && a.push(e("order.eWallet"));
64
- }
65
- return a.join(", ");
66
- });
67
- return (a, y) => (i(), f("div", {
68
- class: k(a.dialogType ? "" : ["p-[1.5rem] border fm-corner-radius-lg flex flex-col gap-5 fixed ml-40 w-[320px]"])
69
- }, [
70
- a.dialogType ? b("", !0) : (i(), f("span", _e, u(c(e)("order.kioskSummary")), 1)),
71
- a.dialogType ? b("", !0) : (i(), f("hr", be)),
72
- l("div", he, [
73
- l("div", xe, [
74
- l("span", Pe, u(c(e)("order.kioskDisplay")), 1),
75
- a.devices.length > 0 ? (i(), f("div", we, [
76
- (i(!0), f(ee, null, te(a.devices, (v) => (i(), f("div", {
77
- key: v.machineId,
78
- class: "fm-typo-en-body-sm-400 flex items-center gap-2"
79
- }, [
80
- l("span", Ce, u(v.deviceAppType === "TABLET_APP" ? "T" : "K"), 1),
81
- v.slotInfo ? (i(), f("span", Te, u(v.slotInfo), 1)) : b("", !0),
82
- l("span", {
83
- class: "text-fm-color-typo-secondary truncate flex-1",
84
- title: v.name
85
- }, u(v.name), 9, ge)
86
- ]))), 128))
87
- ])) : (i(), f("div", Ie, "-"))
88
- ]),
89
- r.value === c(e)("order.activated") ? (i(), f("div", Ae, [
90
- l("span", Ke, u(c(e)("order.dineIn")), 1),
91
- l("div", Oe, u(r.value), 1)
92
- ])) : b("", !0),
93
- r.value === c(e)("order.activated") && o.value !== c(e)("order.unknown") ? (i(), f("div", Ue, [
94
- l("span", $e, u(c(e)("order.dineInType")), 1),
95
- l("div", Fe, u(o.value), 1)
96
- ])) : b("", !0),
97
- n.value === c(e)("order.activated") ? (i(), f("div", Se, [
98
- l("span", qe, u(c(e)("order.takeaway")), 1),
99
- l("div", Re, u(n.value), 1)
100
- ])) : b("", !0),
101
- d.value || p.value ? (i(), f("div", De, [
102
- l("span", Be, u(c(e)("order.acceptedPayment")), 1),
103
- l("div", Ve, [
104
- p.value ? (i(), f("div", Ee, u(c(e)("order.offlinePayment")), 1)) : b("", !0),
105
- l("div", null, u(d.value), 1)
106
- ])
107
- ])) : b("", !0)
108
- ])
109
- ], 2));
110
- }
111
- }), Me = { class: "flex flex-col gap-5 pb-6" }, Ne = { class: "fm-typo-en-body-md-400 block" }, We = { class: "fm-typo-en-title-md-600" }, Le = /* @__PURE__ */ U({
112
- __name: "KioskOtpDialog",
113
- props: {
114
- otp: {}
115
- },
116
- setup(t) {
117
- const { t: e } = $();
118
- return (s, r) => (i(), f("div", Me, [
119
- l("span", Ne, u(c(e)("order.bindDeviceMessage")), 1),
120
- l("div", We, u(s.otp), 1)
121
- ]));
122
- }
123
- }), L = {
124
- enabled: !1,
125
- prefix: null,
126
- padDigit: 0,
127
- standSlotRange: {
128
- min: 1,
129
- max: 10
130
- },
131
- enablePaxDialog: !1,
132
- submitOrderInstruction: {
133
- payAtCounter: null,
134
- paid: null
135
- }
136
- }, je = {
137
- enabled: !1,
138
- submitOrderInstruction: {
139
- payAtCounter: null,
140
- paid: null
141
- }
142
- }, j = {
143
- enabled: !1,
144
- submitOrderInstruction: {
145
- payAtCounter: null,
146
- paid: null
147
- },
148
- enablePaxDialog: !1
149
- }, He = {
150
- dineIn: {
151
- enabled: !1,
152
- pickUp: j,
153
- sequenceNumber: ie.parse({}),
154
- displayStand: L
155
- },
156
- takeaway: je,
157
- paymentSetting: {
158
- paymentTypes: [],
159
- offlinePaymentTypes: [],
160
- ePaymentTypes: {
161
- terminal: !1,
162
- card: {
163
- terminal: !1,
164
- nfc: !1
165
- },
166
- eWallet: {
167
- terminalQrPay: !1,
168
- terminalScanPay: !1,
169
- qrPay: !1,
170
- scanPay: !1
171
- }
172
- }
173
- },
174
- menuItem: {
175
- showAllOnly: !1
176
- },
177
- otaChannel: ""
178
- }, O = {
179
- payAtCounter: null,
180
- paid: null
181
- }, Ye = (t) => {
182
- var e;
183
- return {
184
- kiosk: ze(t.kioskSettings, (e = t.sequenceSettings) == null ? void 0 : e.kioskDineIn)
185
- };
186
- }, ze = (t, e) => {
187
- var s, r, n, o, p, d, a, y, v, _, P;
188
- return {
189
- dineIn: Qe(
190
- e ?? {
191
- current: 0,
192
- prefix: "#K"
193
- },
194
- (t == null ? void 0 : t.dineIn) ?? void 0
195
- ),
196
- takeaway: {
197
- enabled: (t == null ? void 0 : t.canTakeaway) ?? !1,
198
- submitOrderInstruction: (s = t == null ? void 0 : t.takeaway) != null && s.submitOrderInstruction ? {
199
- payAtCounter: ((o = (n = (r = t == null ? void 0 : t.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : n.payAtCounter) == null ? void 0 : o.en) ?? null,
200
- paid: ((a = (d = (p = t == null ? void 0 : t.takeaway) == null ? void 0 : p.submitOrderInstruction) == null ? void 0 : d.paid) == null ? void 0 : a.en) ?? null
201
- } : O
202
- },
203
- paymentSetting: {
204
- paymentTypes: ((y = t == null ? void 0 : t.paymentSetting) == null ? void 0 : y.paymentTypes) ?? [],
205
- offlinePaymentTypes: ((v = t == null ? void 0 : t.paymentSetting) == null ? void 0 : v.offlinePaymentTypes) ?? [],
206
- ePaymentTypes: ((_ = t == null ? void 0 : t.paymentSetting) == null ? void 0 : _.ePaymentTypes) ?? pe.parse({
207
- card: {
208
- terminal: !1,
209
- nfc: !1
210
- },
211
- eWallet: {
212
- qrPay: !1,
213
- scanPay: !1
214
- }
215
- })
216
- },
217
- menuItem: {
218
- showAllOnly: ((P = t == null ? void 0 : t.menuItem) == null ? void 0 : P.showAllOnly) ?? !1
219
- },
220
- otaChannel: (t == null ? void 0 : t.otaChannel) ?? ""
221
- };
222
- }, Qe = (t, e) => {
223
- var s, r, n, o, p, d, a, y;
224
- return {
225
- enabled: !!e,
226
- sequenceNumber: t,
227
- pickUp: e != null && e.pickUp ? {
228
- ...e.pickUp,
229
- submitOrderInstruction: e.pickUp.submitOrderInstruction ? {
230
- payAtCounter: ((r = (s = e.pickUp.submitOrderInstruction) == null ? void 0 : s.payAtCounter) == null ? void 0 : r.en) ?? null,
231
- paid: ((o = (n = e.pickUp.submitOrderInstruction) == null ? void 0 : n.paid) == null ? void 0 : o.en) ?? null
232
- } : O,
233
- enablePaxDialog: e.pickUp.enablePaxDialog ? e.pickUp.enablePaxDialog : !1
234
- } : j,
235
- displayStand: e != null && e.displayStand ? {
236
- enabled: e.displayStand.enabled,
237
- standSlotRange: e.displayStand.standSlotRange,
238
- prefix: e.displayStand.prefix,
239
- padDigit: e.displayStand.padDigit,
240
- enablePaxDialog: e.displayStand.enablePaxDialog ?? !1,
241
- submitOrderInstruction: e.displayStand.submitOrderInstruction ? {
242
- payAtCounter: ((d = (p = e.displayStand.submitOrderInstruction) == null ? void 0 : p.payAtCounter) == null ? void 0 : d.en) ?? null,
243
- paid: ((y = (a = e.displayStand.submitOrderInstruction) == null ? void 0 : a.paid) == null ? void 0 : y.en) ?? null
244
- } : O
245
- } : L
246
- };
247
- }, Ge = (t) => {
248
- const e = (n) => {
249
- var o, p, d, a;
250
- return {
251
- requiredSlot: !!n.displayStand,
252
- displayStand: {
253
- ...n.displayStand,
254
- submitOrderInstruction: {
255
- payAtCounter: (o = n.displayStand.submitOrderInstruction) != null && o.payAtCounter ? {
256
- en: n.displayStand.submitOrderInstruction.payAtCounter
257
- } : null,
258
- paid: (p = n.displayStand.submitOrderInstruction) != null && p.paid ? {
259
- en: n.displayStand.submitOrderInstruction.paid
260
- } : null
261
- }
262
- },
263
- pickUp: {
264
- ...n.pickUp,
265
- submitOrderInstruction: {
266
- payAtCounter: (d = n.pickUp.submitOrderInstruction) != null && d.payAtCounter ? {
267
- en: n.pickUp.submitOrderInstruction.payAtCounter
268
- } : null,
269
- paid: (a = n.pickUp.submitOrderInstruction) != null && a.paid ? {
270
- en: n.pickUp.submitOrderInstruction.paid
271
- } : null
272
- }
273
- }
274
- };
275
- }, s = (n) => ({
276
- canTakeaway: t.takeaway.enabled,
277
- dineIn: n,
278
- menuItem: t.menuItem,
279
- paymentSetting: r(t.paymentSetting),
280
- otaChannel: t.otaChannel || void 0,
281
- takeaway: t.takeaway.submitOrderInstruction ? {
282
- submitOrderInstruction: {
283
- payAtCounter: t.takeaway.submitOrderInstruction.payAtCounter ? {
284
- en: t.takeaway.submitOrderInstruction.payAtCounter
285
- } : null,
286
- paid: t.takeaway.submitOrderInstruction.paid ? {
287
- en: t.takeaway.submitOrderInstruction.paid
288
- } : null
289
- }
290
- } : void 0
291
- }), r = (n) => ({
292
- paymentTypes: n.paymentTypes,
293
- offlinePaymentTypes: n.offlinePaymentTypes,
294
- ePaymentTypes: n.ePaymentTypes
295
- });
296
- return t.dineIn.enabled ? {
297
- kioskSettings: s(e(t.dineIn)),
298
- kioskDineIn: t.dineIn.sequenceNumber
299
- } : {
300
- kioskSettings: s()
301
- };
302
- }, W = {
303
- convertOrderSettingDto: Ye,
304
- toOrderKioskSettingsDto: Ge
305
- }, Je = ve("orderSetting", () => {
306
- const t = I({});
307
- async function e() {
308
- const o = await E.getOrderSetting();
309
- r(o);
310
- }
311
- async function s() {
312
- if (t.value.orderSetting && t.value.kiosk) {
313
- const { _id: o, ...p } = t.value.orderSetting, d = W.toOrderKioskSettingsDto(t.value.kiosk), a = {
314
- ...p,
315
- kioskSettings: d.kioskSettings
316
- }, y = await E.updateOrderSetting(a);
317
- r(y);
318
- }
319
- }
320
- function r(o) {
321
- t.value.orderSetting = o, t.value.kiosk = W.convertOrderSettingDto(o).kiosk;
322
- }
323
- function n(o) {
324
- t.value.kiosk = o;
325
- }
326
- return {
327
- state: t.value,
328
- getSetting: e,
329
- updateKioskSetting: s,
330
- setKioskOrderSetting: n
331
- };
332
- }), Xe = { class: "py-[1.5rem]" }, Ze = { class: "flex px-[1.5rem]" }, ke = { class: "flex-[2_2_0%]" }, et = { class: "pt-[1.5rem]" }, tt = { class: "flex flex-col gap-10" }, at = { class: "flex flex-col gap-2" }, nt = { class: "fm-typo-en-title-sm-600" }, ot = { class: "fm-typo-en-title-sm-400" }, st = {
333
- key: 0,
334
- class: "flex-[1_1_0%]"
335
- }, yt = /* @__PURE__ */ U({
336
- __name: "KioskView",
337
- setup(t) {
338
- var R, D;
339
- const { t: e } = $(), s = ae(
340
- () => import("./KioskSettingView-DS5vEQ07.js")
341
- ), r = I("device"), n = ce(), o = Je(), p = ye(), { currentRestaurant: d, restaurants: a, changeRestaurant: y } = ue(), v = me(), _ = fe(), P = h(() => _.breakpoints.value.xs), T = I(((R = d.value) == null ? void 0 : R._id) ?? void 0), H = h(() => a.value.map((m) => ({
342
- label: m.profile.name,
343
- value: m._id
344
- }))), w = I(((D = d.value) == null ? void 0 : D._id) ?? "");
345
- function Y() {
346
- var m;
347
- p.open({
348
- title: M(e("order.kioskSummary")),
349
- contentComponent: N,
350
- contentComponentProps: {
351
- restaurantId: (m = d.value) == null ? void 0 : m._id,
352
- devices: n.state.devices,
353
- kioskOrderSetting: o.state.kiosk,
354
- dialogType: !0
355
- }
356
- });
357
- }
358
- async function F(m) {
359
- const x = a.value.find((A) => A._id == m);
360
- await y(x), await S(), T.value = m, w.value = m;
361
- }
362
- async function S() {
363
- await o.getSetting(), await n.getDevices();
364
- }
365
- const z = h(() => [
366
- {
367
- label: e("order.deviceBinding"),
368
- value: "device"
369
- },
370
- {
371
- label: e("order.settings"),
372
- value: "setting"
373
- }
374
- ]), q = h(() => n.state.devices);
375
- async function Q() {
376
- await n.requestOtp(), p.open({
377
- title: M(e("order.bindDevice")),
378
- contentComponent: Le,
379
- contentComponentProps: {
380
- otp: n.state.otp
381
- }
382
- }).onClose(async () => {
383
- await n.getDevices();
384
- });
385
- }
386
- async function G(m) {
387
- try {
388
- o.setKioskOrderSetting(m), await o.updateKioskSetting(), v.open({
389
- title: e("order.kioskSettingSuccess"),
390
- type: "success"
391
- });
392
- } catch {
393
- v.open({
394
- title: e("order.kioskSettingFailed"),
395
- type: "error"
396
- });
397
- }
398
- }
399
- return ne(async () => {
400
- var m;
401
- (m = d.value) != null && m._id && (w.value = d.value._id, await S());
402
- }), oe(
403
- () => a.value.length,
404
- async (m) => {
405
- T.value === void 0 && a.value.length > 0 && await F(a.value[0]._id);
406
- },
407
- { immediate: !0 }
408
- ), (m, x) => {
409
- const A = g("FmButton"), J = g("FmPageHead"), X = g("FmTabs"), Z = g("FmSelect");
410
- return i(), f("div", Xe, [
411
- C(J, {
412
- title: c(e)("order.kiosk")
413
- }, {
414
- append: se(() => [
415
- le(C(A, {
416
- icon: "info",
417
- variant: "tertiary",
418
- onClick: Y
419
- }, null, 512), [
420
- [re, P.value]
421
- ])
422
- ]),
423
- _: 1
424
- }, 8, ["title"]),
425
- l("div", Ze, [
426
- l("div", ke, [
427
- C(X, {
428
- "model-value": r.value,
429
- "onUpdate:modelValue": x[0] || (x[0] = (K) => r.value = K),
430
- items: z.value
431
- }, null, 8, ["model-value", "items"]),
432
- l("div", et, [
433
- l("div", tt, [
434
- l("div", at, [
435
- l("span", nt, u(c(e)("order.activateLocation")), 1),
436
- l("span", ot, u(c(e)("order.selectRestaurant")) + ": ", 1),
437
- C(Z, {
438
- class: "w-1/2",
439
- modelValue: T.value,
440
- "onUpdate:modelValue": [
441
- x[1] || (x[1] = (K) => T.value = K),
442
- F
443
- ],
444
- items: H.value,
445
- placeholder: c(e)("order.selectItem")
446
- }, null, 8, ["modelValue", "items", "placeholder"])
447
- ]),
448
- r.value == "device" ? (i(), B(de, {
449
- key: 0,
450
- devices: q.value,
451
- onRequestOtp: Q
452
- }, null, 8, ["devices"])) : b("", !0),
453
- r.value == "setting" ? (i(), B(c(s), {
454
- key: `KioskSettingView-${w.value}`,
455
- "restaurant-id": w.value,
456
- onUpdateKioskOrderSetting: G,
457
- form: c(o).state.kiosk ?? c(He)
458
- }, null, 8, ["restaurant-id", "form"])) : b("", !0)
459
- ])
460
- ])
461
- ]),
462
- P.value ? b("", !0) : (i(), f("div", st, [
463
- C(N, {
464
- "restaurant-id": w.value,
465
- devices: q.value,
466
- "kiosk-order-setting": c(o).state.kiosk,
467
- dialogType: !1
468
- }, null, 8, ["restaurant-id", "devices", "kiosk-order-setting"])
469
- ]))
470
- ])
471
- ]);
472
- };
473
- }
474
- });
475
- export {
476
- yt as default
477
- };