@feedmepos/mf-order-setting 0.0.84 → 0.0.85
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.
- package/dist/DisplaySystemView-hmlT9gsb.js +6485 -0
- package/dist/{KioskDevicesView-DdwFuenU.js → KioskDevicesView-fW6M9Hao.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-CxtLm_oh.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-GrsnYo80.js} +3 -3
- package/dist/KioskSettingView-BdEPftHH.js +839 -0
- package/dist/{KioskView-fwBwUGCQ.js → KioskView-Bwk9S0tc.js} +82 -70
- package/dist/{OrderSettingsView-RhlyZmzs.js → OrderSettingsView-DVXfVdXj.js} +30858 -30699
- package/dist/{app-ClOkRxOZ.js → app-BnrruYco.js} +74 -12
- package/dist/app.js +1 -1
- package/dist/display-preview/assets/BandBoard-DIcfXsNV.js +1 -0
- package/dist/display-preview/assets/CarouselBlock-XAhTyEWB.js +1 -0
- package/dist/display-preview/assets/{CategoryBoard-DClMUGfS.js → CategoryBoard-DBKe18hv.js} +1 -1
- package/dist/display-preview/assets/ImageBlock-BCbnYSHq.js +1 -0
- package/dist/display-preview/assets/PickupMode-Df_TPCh8.js +1 -0
- package/dist/display-preview/assets/{StatusBoard-BVESD28J.js → StatusBoard-28z3bPOf.js} +1 -1
- package/dist/display-preview/assets/TextBlock-CvJKITtx.js +1 -0
- package/dist/display-preview/assets/VideoBlock-Dop43wDv.js +1 -0
- package/dist/display-preview/assets/index-C6DET5zJ.css +1 -0
- package/dist/display-preview/assets/index-cqMoOpSN.js +2 -0
- package/dist/display-preview/assets/pickupView-DRMVXqrc.js +1 -0
- package/dist/display-preview/index.html +2 -2
- package/dist/frontend/mf-order/src/app.d.ts +62 -0
- package/dist/frontend/mf-order/src/main.d.ts +62 -0
- package/dist/frontend/mf-order/src/modules/display-system/interface.d.ts +21 -0
- package/dist/frontend/mf-order/src/modules/order-setting/kiosk/coverCarousel.d.ts +69 -0
- package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +5 -1
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +90 -3
- package/dist/frontend/mf-order/src/views/display-system/DisplayFieldControl.vue.d.ts +3 -0
- package/dist/frontend/mf-order/src/views/display-system/DisplayInspector.vue.d.ts +3 -13
- package/dist/frontend/mf-order/src/views/order-settings/auto-send-kitchen.d.ts +58 -0
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +16 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +16 -1
- package/dist/frontend/mf-order/src/views/order-settings/useAutoSendGuard.d.ts +48 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-CKEbr9Es.js → index-D5wABuUx.js} +1 -1
- package/dist/{index-5k7kGCpJ.js → index-D7IWjZdy.js} +2 -2
- package/dist/{index-I2YGevce.js → index-LyvBqKnv.js} +1 -1
- package/dist/{order.dto-Dbn-hRrm.js → order.dto-D7HGiueX.js} +3579 -3428
- package/dist/package/entity/alert/investigation.dto.d.ts +25 -6
- package/dist/package/entity/alert/lark-callback.dto.d.ts +31 -12
- package/dist/package/entity/alert/suggestion.dto.d.ts +4 -4
- package/dist/package/entity/display/blocks.d.ts +42 -76
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +47 -36
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +1 -0
- package/dist/package/entity/index.d.ts +2 -0
- package/dist/package/entity/index.frontend.d.ts +2 -0
- package/dist/package/entity/order/effects/effect.dto.d.ts +266 -0
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +36 -36
- package/dist/package/entity/order/order.do.d.ts +7 -64
- package/dist/package/entity/order/order.dto.d.ts +13006 -795
- package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +13 -0
- package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +3 -0
- package/dist/package/entity/order-platform/menu.dto.d.ts +10 -10
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +11 -8
- package/dist/package/entity/order-setting/auto-accept.dto.d.ts +94 -0
- package/dist/package/entity/order-setting/auto-send.resolve.d.ts +110 -0
- package/dist/package/entity/order-setting/delivery/inhouse-delivery.do.d.ts +3 -0
- package/dist/package/entity/order-setting/delivery/inhouse-delivery.dto.d.ts +3 -0
- package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +3 -0
- package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +3 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +26 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +39 -0
- package/dist/package/entity/order-setting/order-setting.do.d.ts +57 -4
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +259 -9
- package/dist/package/entity/order-setting/pickup/pickup.do.d.ts +3 -0
- package/dist/package/entity/order-setting/pickup/pickup.dto.d.ts +3 -0
- package/dist/package/entity/order-setting/queue/queue.do.d.ts +2 -2
- package/dist/package/entity/order-setting/queue/queue.dto.d.ts +2 -2
- package/dist/package/entity/queue/queue.dto.d.ts +48 -48
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +46 -8
- package/dist/package/entity/websocket/websocket.dto.d.ts +88 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/locales/en-US.json +22 -2
- package/src/locales/ja-JP.json +12 -1
- package/src/locales/th-TH.json +12 -1
- package/src/locales/zh-CN.json +22 -2
- package/src/modules/display-system/interface.spec.ts +32 -18
- package/src/modules/display-system/interface.ts +32 -0
- package/src/modules/order-setting/kiosk/coverCarousel.spec.ts +172 -0
- package/src/modules/order-setting/kiosk/coverCarousel.ts +186 -0
- package/src/modules/order-setting/kiosk/interface.ts +138 -127
- package/src/stores/order-setting/mapper.spec.ts +26 -0
- package/src/stores/order-setting/mapper.ts +305 -293
- package/src/views/display-system/DisplayFieldControl.vue +46 -0
- package/src/views/display-system/DisplayInspector.vue +8 -3
- package/src/views/display-system/DisplaySystemView.vue +7 -3
- package/src/views/display-system/DisplayTemplateEditor.vue +28 -2
- package/src/views/kiosk/settings/KioskSettingView.vue +176 -60
- package/src/views/order-settings/auto-send-kitchen.spec.ts +137 -0
- package/src/views/order-settings/auto-send-kitchen.ts +92 -0
- package/src/views/order-settings/auto-send-resolve.spec.ts +123 -0
- package/src/views/order-settings/delivery/DeliverySetting.vue +10 -0
- package/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue +40 -5
- package/src/views/order-settings/dine-in/DineInSetting.vue +38 -5
- package/src/views/order-settings/pickup/PickUpSetting.vue +1 -0
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +38 -5
- package/src/views/order-settings/queue/QueueSetting.vue +6 -9
- package/src/views/order-settings/useAutoSendGuard.ts +142 -0
- package/tsconfig.app.json +10 -1
- package/dist/DisplaySystemView-4Bz8p26A.js +0 -5892
- package/dist/KioskSettingView-D57KtQ-t.js +0 -711
- package/dist/display-preview/assets/BandBoard-BrDTYDc9.js +0 -1
- package/dist/display-preview/assets/CarouselBlock-CrkGxoGk.js +0 -1
- package/dist/display-preview/assets/ImageBlock-DtgfHd5G.js +0 -1
- package/dist/display-preview/assets/PickupMode-DKmqGlG8.js +0 -1
- package/dist/display-preview/assets/TextBlock-gAfeCCmE.js +0 -1
- package/dist/display-preview/assets/index-BB0ReVXy.js +0 -2
- package/dist/display-preview/assets/index-BWVpFSIw.css +0 -1
- package/dist/display-preview/assets/pickupView-C-BGcOu8.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as G, openBlock as h, createElementBlock as Q, createElementVNode as y, toDisplayString as A, unref as m, ref as v, defineAsyncComponent as ue, computed as T, onMounted as ce, watch as re, resolveComponent as w, createVNode as U, withCtx as oe, createBlock as
|
|
2
|
-
import { u as se, a as pe, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as G, openBlock as h, createElementBlock as Q, createElementVNode as y, toDisplayString as A, unref as m, ref as v, defineAsyncComponent as ue, computed as T, onMounted as ce, watch as re, resolveComponent as w, createVNode as U, withCtx as oe, createBlock as K, createCommentVNode as E } from "vue";
|
|
2
|
+
import { u as se, a as pe, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-GrsnYo80.js";
|
|
3
3
|
import { useDialog as me, useSnackbar as ie } from "@feedmepos/ui-library";
|
|
4
4
|
import { useI18n as z, useCoreStore as ye } from "@feedmepos/mf-common";
|
|
5
|
-
import { F as fe, a as ve, S as N } from "./order.dto-
|
|
5
|
+
import { F as fe, a as ve, S as N } from "./order.dto-D7HGiueX.js";
|
|
6
6
|
import { defineStore as be } from "pinia";
|
|
7
|
-
import { O as H } from "./index-
|
|
8
|
-
import { u as _e } from "./app-
|
|
7
|
+
import { O as H } from "./index-LyvBqKnv.js";
|
|
8
|
+
import { u as _e } from "./app-BnrruYco.js";
|
|
9
9
|
const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body-md-400 block" }, Pe = { class: "fm-typo-en-title-md-600" }, we = /* @__PURE__ */ G({
|
|
10
10
|
__name: "KioskOtpDialog",
|
|
11
11
|
props: {
|
|
@@ -13,7 +13,7 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
13
13
|
},
|
|
14
14
|
setup(e) {
|
|
15
15
|
const { t: a } = z();
|
|
16
|
-
return (
|
|
16
|
+
return (n, c) => (h(), Q("div", he, [
|
|
17
17
|
y("span", Ce, A(m(a)("order.bindDeviceMessage")), 1),
|
|
18
18
|
y("div", Pe, A(e.otp), 1)
|
|
19
19
|
]));
|
|
@@ -75,10 +75,11 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
75
75
|
coverImageLandscape: null,
|
|
76
76
|
coverImagePortrait: null,
|
|
77
77
|
otaChannel: "",
|
|
78
|
+
autoSendKitchen: null,
|
|
78
79
|
autoCloseBill: null,
|
|
79
80
|
printReceiptAfterClose: null,
|
|
80
81
|
languages: null
|
|
81
|
-
},
|
|
82
|
+
}, F = {
|
|
82
83
|
payAtCounter: null,
|
|
83
84
|
paid: null
|
|
84
85
|
}, xe = (e) => {
|
|
@@ -87,7 +88,7 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
87
88
|
kiosk: Re(e.kioskSettings, (a = e.sequenceSettings) == null ? void 0 : a.kioskDineIn)
|
|
88
89
|
};
|
|
89
90
|
}, Re = (e, a) => {
|
|
90
|
-
var
|
|
91
|
+
var n, c, t, l, r, o, p, d, i, C, b, f;
|
|
91
92
|
return {
|
|
92
93
|
dineIn: Le(
|
|
93
94
|
a ?? {
|
|
@@ -98,10 +99,10 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
98
99
|
),
|
|
99
100
|
takeaway: {
|
|
100
101
|
enabled: (e == null ? void 0 : e.canTakeaway) ?? !1,
|
|
101
|
-
submitOrderInstruction: (
|
|
102
|
-
payAtCounter: ((
|
|
102
|
+
submitOrderInstruction: (n = e == null ? void 0 : e.takeaway) != null && n.submitOrderInstruction ? {
|
|
103
|
+
payAtCounter: ((l = (t = (c = e == null ? void 0 : e.takeaway) == null ? void 0 : c.submitOrderInstruction) == null ? void 0 : t.payAtCounter) == null ? void 0 : l.en) ?? null,
|
|
103
104
|
paid: ((p = (o = (r = e == null ? void 0 : e.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : p.en) ?? null
|
|
104
|
-
} :
|
|
105
|
+
} : F
|
|
105
106
|
},
|
|
106
107
|
paymentSetting: {
|
|
107
108
|
paymentTypes: ((d = e == null ? void 0 : e.paymentSetting) == null ? void 0 : d.paymentTypes) ?? [],
|
|
@@ -123,8 +124,16 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
123
124
|
otaChannel: (e == null ? void 0 : e.otaChannel) ?? "",
|
|
124
125
|
coverImageLandscape: (e == null ? void 0 : e.coverImageLandscape) ?? null,
|
|
125
126
|
coverImagePortrait: (e == null ? void 0 : e.coverImagePortrait) ?? null,
|
|
127
|
+
// The cover-image editor works on one list per orientation and writes both
|
|
128
|
+
// this and coverImage* through modules/order-setting/kiosk/coverCarousel.
|
|
129
|
+
// It still has to be read back explicitly: the write side rebuilds
|
|
130
|
+
// kioskSettings field by field and the backend $sets the whole
|
|
131
|
+
// subdocument, so anything not carried here is deleted on the next
|
|
132
|
+
// unrelated save.
|
|
133
|
+
coverCarousel: e == null ? void 0 : e.coverCarousel,
|
|
126
134
|
// Preserve "unset" as null — collapsing to a boolean here is what let an
|
|
127
135
|
// unrelated save overwrite the inherited dineInSettings value.
|
|
136
|
+
autoSendKitchen: (e == null ? void 0 : e.autoSendKitchen) ?? null,
|
|
128
137
|
autoCloseBill: (e == null ? void 0 : e.autoCloseBill) ?? null,
|
|
129
138
|
printReceiptAfterClose: (e == null ? void 0 : e.printReceiptAfterClose) ?? null,
|
|
130
139
|
// Stored [] means the same thing as unset ("all languages"), so collapse it
|
|
@@ -132,16 +141,16 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
132
141
|
languages: (f = e == null ? void 0 : e.languages) != null && f.length ? [...e.languages] : null
|
|
133
142
|
};
|
|
134
143
|
}, Le = (e, a) => {
|
|
135
|
-
var
|
|
144
|
+
var n, c, t, l, r, o, p, d;
|
|
136
145
|
return {
|
|
137
146
|
enabled: !!a,
|
|
138
147
|
sequenceNumber: e,
|
|
139
148
|
pickUp: a != null && a.pickUp ? {
|
|
140
149
|
...a.pickUp,
|
|
141
150
|
submitOrderInstruction: a.pickUp.submitOrderInstruction ? {
|
|
142
|
-
payAtCounter: ((c = (
|
|
143
|
-
paid: ((
|
|
144
|
-
} :
|
|
151
|
+
payAtCounter: ((c = (n = a.pickUp.submitOrderInstruction) == null ? void 0 : n.payAtCounter) == null ? void 0 : c.en) ?? null,
|
|
152
|
+
paid: ((l = (t = a.pickUp.submitOrderInstruction) == null ? void 0 : t.paid) == null ? void 0 : l.en) ?? null
|
|
153
|
+
} : F,
|
|
145
154
|
enablePaxDialog: a.pickUp.enablePaxDialog ? a.pickUp.enablePaxDialog : !1
|
|
146
155
|
} : Y,
|
|
147
156
|
displayStand: a != null && a.displayStand ? {
|
|
@@ -153,18 +162,18 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
153
162
|
submitOrderInstruction: a.displayStand.submitOrderInstruction ? {
|
|
154
163
|
payAtCounter: ((o = (r = a.displayStand.submitOrderInstruction) == null ? void 0 : r.payAtCounter) == null ? void 0 : o.en) ?? null,
|
|
155
164
|
paid: ((d = (p = a.displayStand.submitOrderInstruction) == null ? void 0 : p.paid) == null ? void 0 : d.en) ?? null
|
|
156
|
-
} :
|
|
165
|
+
} : F
|
|
157
166
|
} : J
|
|
158
167
|
};
|
|
159
168
|
}, Te = (e) => {
|
|
160
169
|
const a = (t) => {
|
|
161
|
-
var
|
|
170
|
+
var l, r, o, p;
|
|
162
171
|
return {
|
|
163
172
|
requiredSlot: !!t.displayStand,
|
|
164
173
|
displayStand: {
|
|
165
174
|
...t.displayStand,
|
|
166
175
|
submitOrderInstruction: {
|
|
167
|
-
payAtCounter: (
|
|
176
|
+
payAtCounter: (l = t.displayStand.submitOrderInstruction) != null && l.payAtCounter ? {
|
|
168
177
|
en: t.displayStand.submitOrderInstruction.payAtCounter
|
|
169
178
|
} : null,
|
|
170
179
|
paid: (r = t.displayStand.submitOrderInstruction) != null && r.paid ? {
|
|
@@ -184,22 +193,25 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
184
193
|
}
|
|
185
194
|
}
|
|
186
195
|
};
|
|
187
|
-
},
|
|
188
|
-
var
|
|
196
|
+
}, n = (t) => {
|
|
197
|
+
var l;
|
|
189
198
|
return {
|
|
190
199
|
canTakeaway: e.takeaway.enabled,
|
|
191
200
|
dineIn: t,
|
|
192
201
|
menuItem: e.menuItem,
|
|
193
202
|
coverImageLandscape: e.coverImageLandscape,
|
|
194
203
|
coverImagePortrait: e.coverImagePortrait,
|
|
204
|
+
// Written straight back; see the read side in toKiosk().
|
|
205
|
+
coverCarousel: e.coverCarousel,
|
|
195
206
|
otaChannel: e.otaChannel || void 0,
|
|
196
207
|
// Omit when unset so the backend's `?? config.autoCloseBill` inheritance
|
|
197
208
|
// still applies — sending `false` here would pin it off for good.
|
|
209
|
+
autoSendKitchen: e.autoSendKitchen ?? void 0,
|
|
198
210
|
autoCloseBill: e.autoCloseBill ?? void 0,
|
|
199
211
|
printReceiptAfterClose: e.printReceiptAfterClose ?? void 0,
|
|
200
212
|
// Omit rather than send [] when the merchant restricts nothing, so the
|
|
201
213
|
// saved document stays free of a field that means "all languages" anyway.
|
|
202
|
-
languages: (
|
|
214
|
+
languages: (l = e.languages) != null && l.length ? e.languages : void 0,
|
|
203
215
|
paymentSetting: c(e.paymentSetting),
|
|
204
216
|
takeaway: e.takeaway.submitOrderInstruction ? {
|
|
205
217
|
submitOrderInstruction: {
|
|
@@ -218,10 +230,10 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
218
230
|
ePaymentTypes: t.ePaymentTypes
|
|
219
231
|
});
|
|
220
232
|
return e.dineIn.enabled ? {
|
|
221
|
-
kioskSettings:
|
|
233
|
+
kioskSettings: n(a(e.dineIn)),
|
|
222
234
|
kioskDineIn: e.dineIn.sequenceNumber
|
|
223
235
|
} : {
|
|
224
|
-
kioskSettings:
|
|
236
|
+
kioskSettings: n()
|
|
225
237
|
};
|
|
226
238
|
}, W = {
|
|
227
239
|
convertOrderSettingDto: xe,
|
|
@@ -229,57 +241,57 @@ const he = { class: "flex flex-col gap-5 pb-6" }, Ce = { class: "fm-typo-en-body
|
|
|
229
241
|
}, Ue = be("orderSetting", () => {
|
|
230
242
|
const e = v({});
|
|
231
243
|
async function a() {
|
|
232
|
-
const
|
|
233
|
-
c(
|
|
244
|
+
const l = await H.getOrderSetting();
|
|
245
|
+
c(l);
|
|
234
246
|
}
|
|
235
|
-
async function
|
|
247
|
+
async function n() {
|
|
236
248
|
if (e.value.orderSetting && e.value.kiosk) {
|
|
237
|
-
const { _id:
|
|
249
|
+
const { _id: l, ...r } = e.value.orderSetting, o = W.toOrderKioskSettingsDto(e.value.kiosk), p = {
|
|
238
250
|
...r,
|
|
239
251
|
kioskSettings: o.kioskSettings
|
|
240
252
|
}, d = await H.updateOrderSetting(p);
|
|
241
253
|
c(d);
|
|
242
254
|
}
|
|
243
255
|
}
|
|
244
|
-
function c(
|
|
245
|
-
e.value.orderSetting =
|
|
256
|
+
function c(l) {
|
|
257
|
+
e.value.orderSetting = l, e.value.kiosk = W.convertOrderSettingDto(l).kiosk;
|
|
246
258
|
}
|
|
247
|
-
function t(
|
|
248
|
-
e.value.kiosk =
|
|
259
|
+
function t(l) {
|
|
260
|
+
e.value.kiosk = l;
|
|
249
261
|
}
|
|
250
262
|
return {
|
|
251
263
|
state: e.value,
|
|
252
264
|
getSetting: a,
|
|
253
|
-
updateKioskSetting:
|
|
265
|
+
updateKioskSetting: n,
|
|
254
266
|
setKioskOrderSetting: t
|
|
255
267
|
};
|
|
256
|
-
}),
|
|
268
|
+
}), Ke = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ee = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Fe = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), De = /[^\p{L}\d]+/giu, X = "$1\0$2", j = "";
|
|
257
269
|
function Z(e) {
|
|
258
270
|
let a = e.trim();
|
|
259
|
-
a = a.replace(
|
|
260
|
-
let
|
|
261
|
-
for (; a.charAt(
|
|
262
|
-
|
|
263
|
-
if (
|
|
271
|
+
a = a.replace(Ke, X).replace(Ee, X), a = a.replace(De, "\0");
|
|
272
|
+
let n = 0, c = a.length;
|
|
273
|
+
for (; a.charAt(n) === "\0"; )
|
|
274
|
+
n++;
|
|
275
|
+
if (n === c)
|
|
264
276
|
return [];
|
|
265
277
|
for (; a.charAt(c - 1) === "\0"; )
|
|
266
278
|
c--;
|
|
267
|
-
return a.slice(
|
|
279
|
+
return a.slice(n, c).split(/\0/g);
|
|
268
280
|
}
|
|
269
281
|
function qe(e) {
|
|
270
282
|
const a = Z(e);
|
|
271
|
-
for (let
|
|
272
|
-
const c = a[
|
|
283
|
+
for (let n = 0; n < a.length; n++) {
|
|
284
|
+
const c = a[n], t = Fe.exec(c);
|
|
273
285
|
if (t) {
|
|
274
|
-
const
|
|
275
|
-
a.splice(
|
|
286
|
+
const l = t.index + (t[1] ?? t[2]).length;
|
|
287
|
+
a.splice(n, 1, c.slice(0, l), c.slice(l));
|
|
276
288
|
}
|
|
277
289
|
}
|
|
278
290
|
return a;
|
|
279
291
|
}
|
|
280
292
|
function Be(e, a) {
|
|
281
|
-
const [
|
|
282
|
-
return
|
|
293
|
+
const [n, c, t] = Ne(e, a), l = Ve(a == null ? void 0 : a.locale), r = $e(a == null ? void 0 : a.locale);
|
|
294
|
+
return n + c.map(Me(l, r)).join(" ") + t;
|
|
283
295
|
}
|
|
284
296
|
function Ve(e) {
|
|
285
297
|
return (a) => a.toLocaleLowerCase(e);
|
|
@@ -288,26 +300,26 @@ function $e(e) {
|
|
|
288
300
|
return (a) => a.toLocaleUpperCase(e);
|
|
289
301
|
}
|
|
290
302
|
function Me(e, a) {
|
|
291
|
-
return (
|
|
303
|
+
return (n) => `${a(n[0])}${e(n.slice(1))}`;
|
|
292
304
|
}
|
|
293
305
|
function Ne(e, a = {}) {
|
|
294
|
-
const
|
|
295
|
-
let
|
|
296
|
-
for (;
|
|
297
|
-
const o = e.charAt(
|
|
306
|
+
const n = a.split ?? (a.separateNumbers ? qe : Z), c = a.prefixCharacters ?? j, t = a.suffixCharacters ?? j;
|
|
307
|
+
let l = 0, r = e.length;
|
|
308
|
+
for (; l < e.length; ) {
|
|
309
|
+
const o = e.charAt(l);
|
|
298
310
|
if (!c.includes(o))
|
|
299
311
|
break;
|
|
300
|
-
|
|
312
|
+
l++;
|
|
301
313
|
}
|
|
302
|
-
for (; r >
|
|
314
|
+
for (; r > l; ) {
|
|
303
315
|
const o = r - 1, p = e.charAt(o);
|
|
304
316
|
if (!t.includes(p))
|
|
305
317
|
break;
|
|
306
318
|
r = o;
|
|
307
319
|
}
|
|
308
320
|
return [
|
|
309
|
-
e.slice(0,
|
|
310
|
-
|
|
321
|
+
e.slice(0, l),
|
|
322
|
+
n(e.slice(l, r)),
|
|
311
323
|
e.slice(r)
|
|
312
324
|
];
|
|
313
325
|
}
|
|
@@ -315,9 +327,9 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
315
327
|
__name: "KioskView",
|
|
316
328
|
setup(e) {
|
|
317
329
|
var $, M;
|
|
318
|
-
const { t: a } = z(), { canManageOrderSetting:
|
|
319
|
-
() => import("./KioskSettingView-
|
|
320
|
-
), t = v("device"),
|
|
330
|
+
const { t: a } = z(), { canManageOrderSetting: n } = _e(), c = ue(
|
|
331
|
+
() => import("./KioskSettingView-BdEPftHH.js")
|
|
332
|
+
), t = v("device"), l = se(), r = Ue(), o = pe(), p = me(), { currentRestaurant: d, restaurants: i, changeRestaurant: C } = ye(), b = ie(), f = v((($ = d.value) == null ? void 0 : $._id) ?? void 0), I = v(null), x = v(""), D = v(null), q = T(() => {
|
|
321
333
|
const u = x.value.trim().toLowerCase();
|
|
322
334
|
return i.value.filter(
|
|
323
335
|
(s) => !u || s.profile.name.toLowerCase().includes(u) || s._id.toLowerCase().includes(u)
|
|
@@ -343,7 +355,7 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
343
355
|
await C(s), await V(), f.value = u, P.value = u;
|
|
344
356
|
}
|
|
345
357
|
async function V() {
|
|
346
|
-
if (
|
|
358
|
+
if (n.value)
|
|
347
359
|
try {
|
|
348
360
|
await r.getSetting();
|
|
349
361
|
} catch {
|
|
@@ -353,18 +365,18 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
353
365
|
async function R() {
|
|
354
366
|
I.value = null;
|
|
355
367
|
try {
|
|
356
|
-
await
|
|
368
|
+
await l.getDevices();
|
|
357
369
|
} catch (u) {
|
|
358
370
|
I.value = u instanceof N && u.status === 403 ? "forbidden" : "error";
|
|
359
371
|
}
|
|
360
372
|
}
|
|
361
373
|
const S = T(() => {
|
|
362
374
|
const u = [{ label: a("order.deviceBinding"), value: "device" }];
|
|
363
|
-
return
|
|
364
|
-
}), k = T(() =>
|
|
375
|
+
return n.value && u.push({ label: a("order.settings"), value: "setting" }), u;
|
|
376
|
+
}), k = T(() => l.state.devices);
|
|
365
377
|
async function ee() {
|
|
366
378
|
try {
|
|
367
|
-
await
|
|
379
|
+
await l.requestOtp();
|
|
368
380
|
} catch (u) {
|
|
369
381
|
b.open({
|
|
370
382
|
title: u instanceof N && u.status === 403 ? a("order.bindDevicePermissionDenied") : a("order.bindDeviceFailed"),
|
|
@@ -376,7 +388,7 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
376
388
|
title: Be(a("order.bindDevice")),
|
|
377
389
|
contentComponent: we,
|
|
378
390
|
contentComponentProps: {
|
|
379
|
-
otp:
|
|
391
|
+
otp: l.state.otp
|
|
380
392
|
}
|
|
381
393
|
}).onClose(async () => {
|
|
382
394
|
await R();
|
|
@@ -405,7 +417,7 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
405
417
|
},
|
|
406
418
|
{ immediate: !0 }
|
|
407
419
|
), (u, s) => {
|
|
408
|
-
const _ = w("FmPageHead"), te = w("FmTabs"),
|
|
420
|
+
const _ = w("FmPageHead"), te = w("FmTabs"), le = w("FmMenuItem"), ne = w("FmSelect");
|
|
409
421
|
return h(), Q("div", He, [
|
|
410
422
|
U(_, {
|
|
411
423
|
title: m(a)("order.kiosk")
|
|
@@ -425,7 +437,7 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
425
437
|
}, [
|
|
426
438
|
y("span", Ge, A(m(a)("order.activateLocation")), 1),
|
|
427
439
|
y("span", Qe, A(m(a)("order.selectRestaurant")) + ": ", 1),
|
|
428
|
-
U(
|
|
440
|
+
U(ne, {
|
|
429
441
|
class: "w-1/2",
|
|
430
442
|
modelValue: f.value,
|
|
431
443
|
"onUpdate:modelValue": [
|
|
@@ -440,7 +452,7 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
440
452
|
onDropdownChanged: O
|
|
441
453
|
}, {
|
|
442
454
|
"append-menu": oe(() => [
|
|
443
|
-
q.value.length ?
|
|
455
|
+
q.value.length ? E("", !0) : (h(), K(le, {
|
|
444
456
|
key: 0,
|
|
445
457
|
disabled: "",
|
|
446
458
|
label: m(a)("order.noRestaurantFound")
|
|
@@ -449,19 +461,19 @@ const He = { class: "py-[1.5rem]" }, We = { class: "px-[1.5rem]" }, Xe = { class
|
|
|
449
461
|
_: 1
|
|
450
462
|
}, 8, ["modelValue", "items", "placeholder"])
|
|
451
463
|
], 512),
|
|
452
|
-
t.value == "device" ? (h(),
|
|
464
|
+
t.value == "device" ? (h(), K(de, {
|
|
453
465
|
key: 0,
|
|
454
466
|
devices: k.value,
|
|
455
467
|
"load-error": I.value,
|
|
456
468
|
onRequestOtp: ee,
|
|
457
469
|
onRetry: R
|
|
458
|
-
}, null, 8, ["devices", "load-error"])) :
|
|
459
|
-
t.value == "setting" && m(
|
|
470
|
+
}, null, 8, ["devices", "load-error"])) : E("", !0),
|
|
471
|
+
t.value == "setting" && m(n) ? (h(), K(m(c), {
|
|
460
472
|
key: `KioskSettingView-${P.value}`,
|
|
461
473
|
"restaurant-id": P.value,
|
|
462
474
|
onUpdateKioskOrderSetting: ae,
|
|
463
475
|
form: m(r).state.kiosk ?? m(Ie)
|
|
464
|
-
}, null, 8, ["restaurant-id", "form"])) :
|
|
476
|
+
}, null, 8, ["restaurant-id", "form"])) : E("", !0)
|
|
465
477
|
])
|
|
466
478
|
])
|
|
467
479
|
])
|