@feedmepos/mf-order-setting 0.0.76 → 0.0.77

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 (81) hide show
  1. package/dist/{KioskDevicesView-H7stMDFu.js → KioskDevicesView-Dgs5_UoK.js} +1 -1
  2. package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DgpV4oKE.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-B4DXPgAV.js} +3 -3
  3. package/dist/KioskSettingView-BUcPNVTc.js +681 -0
  4. package/dist/{KioskView-Cxcc1UL1.js → KioskView-DelVMMj4.js} +137 -127
  5. package/dist/{OrderSettingsView-Ds2L_rbu.js → OrderSettingsView-DE2U7vqW.js} +9232 -8262
  6. package/dist/{app-BDlPjU4y.js → app-BIvt4NBq.js} +1476 -1302
  7. package/dist/app.js +1 -1
  8. package/dist/{dayjs.min-OJf1trOq.js → dayjs.min-B58_jBg3.js} +1 -1
  9. package/dist/frontend/mf-order/src/api/index.d.ts +3 -1
  10. package/dist/frontend/mf-order/src/api/remoteOrder/index.d.ts +65 -2
  11. package/dist/frontend/mf-order/src/app.d.ts +174 -0
  12. package/dist/frontend/mf-order/src/composables/useInternalUser.d.ts +3 -0
  13. package/dist/frontend/mf-order/src/main.d.ts +174 -0
  14. package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +4 -0
  15. package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +15 -3
  16. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/AdditionalStores.vue.d.ts +16 -0
  17. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +2 -2
  18. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/FoodpandaAdditionalStores.vue.d.ts +10 -0
  19. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +15 -4
  20. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegrationIdentityDetails.vue.d.ts +10 -0
  21. package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ShopeefoodAdditionalStores.vue.d.ts +10 -0
  22. package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
  23. package/dist/index-CLS-FSH-.js +762 -0
  24. package/dist/{index-gGOpbnY3.js → index-CahsmFL1.js} +1 -1
  25. package/dist/{lineman-settings.dto-Cny_fF4n.js → lineman-settings.dto-DBDThIb0.js} +8999 -8874
  26. package/dist/package/entity/delivery/delivery.enum.d.ts +1 -1
  27. package/dist/package/entity/incoming-order/incoming-order.do.d.ts +4 -4
  28. package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +11 -0
  29. package/dist/package/entity/order-platform/base-integration.dto.d.ts +179 -0
  30. package/dist/package/entity/order-platform/deliveroo/deliveroo-dto.d.ts +2 -2
  31. package/dist/package/entity/order-platform/deliveroo/deliveroo-setting.do.d.ts +2 -2
  32. package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +2 -2
  33. package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +4 -4
  34. package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +4 -4
  35. package/dist/package/entity/order-platform/foodpanda/foodpanda-menu.dto.d.ts +1 -1
  36. package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +105 -4
  37. package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +30 -11
  38. package/dist/package/entity/order-platform/gofood/gofood-settings.do.d.ts +2 -2
  39. package/dist/package/entity/order-platform/gofood/gofood-settings.dto.d.ts +2 -2
  40. package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +10 -10
  41. package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +134 -6
  42. package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +42 -20
  43. package/dist/package/entity/order-platform/lineman/lineman-settings.do.d.ts +2 -2
  44. package/dist/package/entity/order-platform/lineman/lineman-settings.dto.d.ts +2 -2
  45. package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +102 -4
  46. package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +66 -5
  47. package/dist/package/entity/order-platform/tng/tng-settings.do.d.ts +2 -2
  48. package/dist/package/entity/order-platform/tng/tng-settings.dto.d.ts +4 -4
  49. package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +2 -2
  50. package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +2 -2
  51. package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +6 -0
  52. package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +6 -0
  53. package/dist/package/entity/order-setting/order-setting.do.d.ts +14 -4
  54. package/dist/package/entity/order-setting/order-setting.dto.d.ts +28 -8
  55. package/dist/package/entity/restaurant/restaurant.dto.d.ts +10 -0
  56. package/dist/package/entity/websocket/websocket.dto.d.ts +24 -0
  57. package/dist/style.css +1 -1
  58. package/package.json +1 -1
  59. package/src/api/index.ts +8 -2
  60. package/src/api/remoteOrder/index.ts +200 -4
  61. package/src/composables/useInternalUser.ts +14 -0
  62. package/src/locales/en-US.json +43 -0
  63. package/src/locales/ja-JP.json +43 -0
  64. package/src/locales/th-TH.json +90 -45
  65. package/src/locales/zh-CN.json +43 -0
  66. package/src/modules/order-setting/kiosk/interface.ts +29 -19
  67. package/src/stores/order-setting/mapper.ts +65 -55
  68. package/src/views/kiosk/settings/KioskSettingView.vue +33 -0
  69. package/src/views/order-settings/delivery/DeliverySetting.vue +0 -1
  70. package/src/views/order-settings/delivery/delivery.data.ts +3 -0
  71. package/src/views/order-settings/delivery/integrated-delivery/AdditionalStores.vue +472 -0
  72. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaAdditionalStores.vue +314 -0
  73. package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +27 -8
  74. package/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue +31 -12
  75. package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +23 -11
  76. package/src/views/order-settings/delivery/integrated-delivery/IntegrationIdentityDetails.vue +144 -0
  77. package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodAdditionalStores.vue +335 -0
  78. package/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue +29 -8
  79. package/src/views/order-settings/queue/QueueSetting.vue +1 -1
  80. package/dist/KioskSettingView-fF6k9s_q.js +0 -658
  81. package/dist/index-Bid9lO2x.js +0 -665
@@ -1,11 +1,11 @@
1
- import { defineComponent as H, openBlock as P, createElementBlock as W, createElementVNode as i, toDisplayString as h, unref as d, ref as v, defineAsyncComponent as k, computed as A, onMounted as ee, watch as ae, resolveComponent as T, createVNode as U, createBlock as D, createCommentVNode as q } from "vue";
2
- import { u as te, _ as ne } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-DgpV4oKE.js";
3
- import { useDialog as le, useSnackbar as re } from "@feedmepos/ui-library";
4
- import { useI18n as X, useCoreStore as ce } from "@feedmepos/mf-common";
5
- import { F as ue, a as oe, S as V } from "./lineman-settings.dto-Cny_fF4n.js";
1
+ import { defineComponent as H, openBlock as C, createElementBlock as W, createElementVNode as i, toDisplayString as P, unref as d, ref as v, defineAsyncComponent as k, computed as x, onMounted as ee, watch as ae, resolveComponent as R, createVNode as T, createBlock as D, createCommentVNode as q } from "vue";
2
+ import { u as te, _ as le } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-B4DXPgAV.js";
3
+ import { useDialog as ne, useSnackbar as ce } from "@feedmepos/ui-library";
4
+ import { useI18n as X, useCoreStore as re } from "@feedmepos/mf-common";
5
+ import { F as ue, a as oe, S as B } from "./lineman-settings.dto-DBDThIb0.js";
6
6
  import { defineStore as se } from "pinia";
7
- import { O as $ } from "./index-gGOpbnY3.js";
8
- import { u as pe } from "./app-BDlPjU4y.js";
7
+ import { O as V } from "./index-CahsmFL1.js";
8
+ import { u as pe } from "./app-BIvt4NBq.js";
9
9
  const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body-md-400 block" }, me = { class: "fm-typo-en-title-md-600" }, ye = /* @__PURE__ */ H({
10
10
  __name: "KioskOtpDialog",
11
11
  props: {
@@ -13,9 +13,9 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
13
13
  },
14
14
  setup(e) {
15
15
  const { t: a } = X();
16
- return (l, r) => (P(), W("div", de, [
17
- i("span", ie, h(d(a)("order.bindDeviceMessage")), 1),
18
- i("div", me, h(e.otp), 1)
16
+ return (n, c) => (C(), W("div", de, [
17
+ i("span", ie, P(d(a)("order.bindDeviceMessage")), 1),
18
+ i("div", me, P(e.otp), 1)
19
19
  ]));
20
20
  }
21
21
  }), j = {
@@ -74,8 +74,10 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
74
74
  },
75
75
  coverImageLandscape: null,
76
76
  coverImagePortrait: null,
77
- otaChannel: ""
78
- }, L = {
77
+ otaChannel: "",
78
+ autoCloseBill: null,
79
+ printReceiptAfterClose: null
80
+ }, U = {
79
81
  payAtCounter: null,
80
82
  paid: null
81
83
  }, be = (e) => {
@@ -84,9 +86,9 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
84
86
  kiosk: _e(e.kioskSettings, (a = e.sequenceSettings) == null ? void 0 : a.kioskDineIn)
85
87
  };
86
88
  }, _e = (e, a) => {
87
- var l, r, t, n, c, o, s, p, b, f, m;
89
+ var n, c, t, l, r, o, s, p, b, f, m;
88
90
  return {
89
- dineIn: Pe(
91
+ dineIn: Ce(
90
92
  a ?? {
91
93
  current: 0,
92
94
  prefix: "#K"
@@ -95,10 +97,10 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
95
97
  ),
96
98
  takeaway: {
97
99
  enabled: (e == null ? void 0 : e.canTakeaway) ?? !1,
98
- submitOrderInstruction: (l = e == null ? void 0 : e.takeaway) != null && l.submitOrderInstruction ? {
99
- payAtCounter: ((n = (t = (r = e == null ? void 0 : e.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : t.payAtCounter) == null ? void 0 : n.en) ?? null,
100
- paid: ((s = (o = (c = e == null ? void 0 : e.takeaway) == null ? void 0 : c.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : s.en) ?? null
101
- } : L
100
+ submitOrderInstruction: (n = e == null ? void 0 : e.takeaway) != null && n.submitOrderInstruction ? {
101
+ 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,
102
+ paid: ((s = (o = (r = e == null ? void 0 : e.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : o.paid) == null ? void 0 : s.en) ?? null
103
+ } : U
102
104
  },
103
105
  paymentSetting: {
104
106
  paymentTypes: ((p = e == null ? void 0 : e.paymentSetting) == null ? void 0 : p.paymentTypes) ?? [],
@@ -119,19 +121,23 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
119
121
  },
120
122
  otaChannel: (e == null ? void 0 : e.otaChannel) ?? "",
121
123
  coverImageLandscape: (e == null ? void 0 : e.coverImageLandscape) ?? null,
122
- coverImagePortrait: (e == null ? void 0 : e.coverImagePortrait) ?? null
124
+ coverImagePortrait: (e == null ? void 0 : e.coverImagePortrait) ?? null,
125
+ // Preserve "unset" as null — collapsing to a boolean here is what let an
126
+ // unrelated save overwrite the inherited dineInSettings value.
127
+ autoCloseBill: (e == null ? void 0 : e.autoCloseBill) ?? null,
128
+ printReceiptAfterClose: (e == null ? void 0 : e.printReceiptAfterClose) ?? null
123
129
  };
124
- }, Pe = (e, a) => {
125
- var l, r, t, n, c, o, s, p;
130
+ }, Ce = (e, a) => {
131
+ var n, c, t, l, r, o, s, p;
126
132
  return {
127
133
  enabled: !!a,
128
134
  sequenceNumber: e,
129
135
  pickUp: a != null && a.pickUp ? {
130
136
  ...a.pickUp,
131
137
  submitOrderInstruction: a.pickUp.submitOrderInstruction ? {
132
- payAtCounter: ((r = (l = a.pickUp.submitOrderInstruction) == null ? void 0 : l.payAtCounter) == null ? void 0 : r.en) ?? null,
133
- paid: ((n = (t = a.pickUp.submitOrderInstruction) == null ? void 0 : t.paid) == null ? void 0 : n.en) ?? null
134
- } : L,
138
+ payAtCounter: ((c = (n = a.pickUp.submitOrderInstruction) == null ? void 0 : n.payAtCounter) == null ? void 0 : c.en) ?? null,
139
+ paid: ((l = (t = a.pickUp.submitOrderInstruction) == null ? void 0 : t.paid) == null ? void 0 : l.en) ?? null
140
+ } : U,
135
141
  enablePaxDialog: a.pickUp.enablePaxDialog ? a.pickUp.enablePaxDialog : !1
136
142
  } : G,
137
143
  displayStand: a != null && a.displayStand ? {
@@ -141,23 +147,23 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
141
147
  padDigit: a.displayStand.padDigit,
142
148
  enablePaxDialog: a.displayStand.enablePaxDialog ?? !1,
143
149
  submitOrderInstruction: a.displayStand.submitOrderInstruction ? {
144
- payAtCounter: ((o = (c = a.displayStand.submitOrderInstruction) == null ? void 0 : c.payAtCounter) == null ? void 0 : o.en) ?? null,
150
+ payAtCounter: ((o = (r = a.displayStand.submitOrderInstruction) == null ? void 0 : r.payAtCounter) == null ? void 0 : o.en) ?? null,
145
151
  paid: ((p = (s = a.displayStand.submitOrderInstruction) == null ? void 0 : s.paid) == null ? void 0 : p.en) ?? null
146
- } : L
152
+ } : U
147
153
  } : j
148
154
  };
149
- }, he = (e) => {
155
+ }, Pe = (e) => {
150
156
  const a = (t) => {
151
- var n, c, o, s;
157
+ var l, r, o, s;
152
158
  return {
153
159
  requiredSlot: !!t.displayStand,
154
160
  displayStand: {
155
161
  ...t.displayStand,
156
162
  submitOrderInstruction: {
157
- payAtCounter: (n = t.displayStand.submitOrderInstruction) != null && n.payAtCounter ? {
163
+ payAtCounter: (l = t.displayStand.submitOrderInstruction) != null && l.payAtCounter ? {
158
164
  en: t.displayStand.submitOrderInstruction.payAtCounter
159
165
  } : null,
160
- paid: (c = t.displayStand.submitOrderInstruction) != null && c.paid ? {
166
+ paid: (r = t.displayStand.submitOrderInstruction) != null && r.paid ? {
161
167
  en: t.displayStand.submitOrderInstruction.paid
162
168
  } : null
163
169
  }
@@ -174,14 +180,18 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
174
180
  }
175
181
  }
176
182
  };
177
- }, l = (t) => ({
183
+ }, n = (t) => ({
178
184
  canTakeaway: e.takeaway.enabled,
179
185
  dineIn: t,
180
186
  menuItem: e.menuItem,
181
187
  coverImageLandscape: e.coverImageLandscape,
182
188
  coverImagePortrait: e.coverImagePortrait,
183
189
  otaChannel: e.otaChannel || void 0,
184
- paymentSetting: r(e.paymentSetting),
190
+ // Omit when unset so the backend's `?? config.autoCloseBill` inheritance
191
+ // still applies — sending `false` here would pin it off for good.
192
+ autoCloseBill: e.autoCloseBill ?? void 0,
193
+ printReceiptAfterClose: e.printReceiptAfterClose ?? void 0,
194
+ paymentSetting: c(e.paymentSetting),
185
195
  takeaway: e.takeaway.submitOrderInstruction ? {
186
196
  submitOrderInstruction: {
187
197
  payAtCounter: e.takeaway.submitOrderInstruction.payAtCounter ? {
@@ -192,162 +202,162 @@ const de = { class: "flex flex-col gap-5 pb-6" }, ie = { class: "fm-typo-en-body
192
202
  } : null
193
203
  }
194
204
  } : void 0
195
- }), r = (t) => ({
205
+ }), c = (t) => ({
196
206
  paymentTypes: t.paymentTypes,
197
207
  offlinePaymentTypes: t.offlinePaymentTypes,
198
208
  ePaymentTypes: t.ePaymentTypes
199
209
  });
200
210
  return e.dineIn.enabled ? {
201
- kioskSettings: l(a(e.dineIn)),
211
+ kioskSettings: n(a(e.dineIn)),
202
212
  kioskDineIn: e.dineIn.sequenceNumber
203
213
  } : {
204
- kioskSettings: l()
214
+ kioskSettings: n()
205
215
  };
206
- }, N = {
216
+ }, $ = {
207
217
  convertOrderSettingDto: be,
208
- toOrderKioskSettingsDto: he
209
- }, we = se("orderSetting", () => {
218
+ toOrderKioskSettingsDto: Pe
219
+ }, he = se("orderSetting", () => {
210
220
  const e = v({});
211
221
  async function a() {
212
- const n = await $.getOrderSetting();
213
- r(n);
222
+ const l = await V.getOrderSetting();
223
+ c(l);
214
224
  }
215
- async function l() {
225
+ async function n() {
216
226
  if (e.value.orderSetting && e.value.kiosk) {
217
- const { _id: n, ...c } = e.value.orderSetting, o = N.toOrderKioskSettingsDto(e.value.kiosk), s = {
218
- ...c,
227
+ const { _id: l, ...r } = e.value.orderSetting, o = $.toOrderKioskSettingsDto(e.value.kiosk), s = {
228
+ ...r,
219
229
  kioskSettings: o.kioskSettings
220
- }, p = await $.updateOrderSetting(s);
221
- r(p);
230
+ }, p = await V.updateOrderSetting(s);
231
+ c(p);
222
232
  }
223
233
  }
224
- function r(n) {
225
- e.value.orderSetting = n, e.value.kiosk = N.convertOrderSettingDto(n).kiosk;
234
+ function c(l) {
235
+ e.value.orderSetting = l, e.value.kiosk = $.convertOrderSettingDto(l).kiosk;
226
236
  }
227
- function t(n) {
228
- e.value.kiosk = n;
237
+ function t(l) {
238
+ e.value.kiosk = l;
229
239
  }
230
240
  return {
231
241
  state: e.value,
232
242
  getSetting: a,
233
- updateKioskSetting: l,
243
+ updateKioskSetting: n,
234
244
  setKioskOrderSetting: t
235
245
  };
236
- }), Ce = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ie = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), xe = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), Ae = /[^\p{L}\d]+/giu, M = "$1\0$2", B = "";
246
+ }), we = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Ae = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Ie = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), xe = /[^\p{L}\d]+/giu, N = "$1\0$2", M = "";
237
247
  function Q(e) {
238
248
  let a = e.trim();
239
- a = a.replace(Ce, M).replace(Ie, M), a = a.replace(Ae, "\0");
240
- let l = 0, r = a.length;
241
- for (; a.charAt(l) === "\0"; )
242
- l++;
243
- if (l === r)
249
+ a = a.replace(we, N).replace(Ae, N), a = a.replace(xe, "\0");
250
+ let n = 0, c = a.length;
251
+ for (; a.charAt(n) === "\0"; )
252
+ n++;
253
+ if (n === c)
244
254
  return [];
245
- for (; a.charAt(r - 1) === "\0"; )
246
- r--;
247
- return a.slice(l, r).split(/\0/g);
255
+ for (; a.charAt(c - 1) === "\0"; )
256
+ c--;
257
+ return a.slice(n, c).split(/\0/g);
248
258
  }
249
- function Te(e) {
259
+ function Re(e) {
250
260
  const a = Q(e);
251
- for (let l = 0; l < a.length; l++) {
252
- const r = a[l], t = xe.exec(r);
261
+ for (let n = 0; n < a.length; n++) {
262
+ const c = a[n], t = Ie.exec(c);
253
263
  if (t) {
254
- const n = t.index + (t[1] ?? t[2]).length;
255
- a.splice(l, 1, r.slice(0, n), r.slice(n));
264
+ const l = t.index + (t[1] ?? t[2]).length;
265
+ a.splice(n, 1, c.slice(0, l), c.slice(l));
256
266
  }
257
267
  }
258
268
  return a;
259
269
  }
260
- function Ue(e, a) {
261
- const [l, r, t] = Fe(e, a), n = Le(a == null ? void 0 : a.locale), c = Re(a == null ? void 0 : a.locale);
262
- return l + r.map(Ee(n, c)).join(" ") + t;
270
+ function Te(e, a) {
271
+ const [n, c, t] = Fe(e, a), l = Ue(a == null ? void 0 : a.locale), r = Le(a == null ? void 0 : a.locale);
272
+ return n + c.map(Ee(l, r)).join(" ") + t;
263
273
  }
264
- function Le(e) {
274
+ function Ue(e) {
265
275
  return (a) => a.toLocaleLowerCase(e);
266
276
  }
267
- function Re(e) {
277
+ function Le(e) {
268
278
  return (a) => a.toLocaleUpperCase(e);
269
279
  }
270
280
  function Ee(e, a) {
271
- return (l) => `${a(l[0])}${e(l.slice(1))}`;
281
+ return (n) => `${a(n[0])}${e(n.slice(1))}`;
272
282
  }
273
283
  function Fe(e, a = {}) {
274
- const l = a.split ?? (a.separateNumbers ? Te : Q), r = a.prefixCharacters ?? B, t = a.suffixCharacters ?? B;
275
- let n = 0, c = e.length;
276
- for (; n < e.length; ) {
277
- const o = e.charAt(n);
278
- if (!r.includes(o))
284
+ const n = a.split ?? (a.separateNumbers ? Re : Q), c = a.prefixCharacters ?? M, t = a.suffixCharacters ?? M;
285
+ let l = 0, r = e.length;
286
+ for (; l < e.length; ) {
287
+ const o = e.charAt(l);
288
+ if (!c.includes(o))
279
289
  break;
280
- n++;
290
+ l++;
281
291
  }
282
- for (; c > n; ) {
283
- const o = c - 1, s = e.charAt(o);
292
+ for (; r > l; ) {
293
+ const o = r - 1, s = e.charAt(o);
284
294
  if (!t.includes(s))
285
295
  break;
286
- c = o;
296
+ r = o;
287
297
  }
288
298
  return [
289
- e.slice(0, n),
290
- l(e.slice(n, c)),
291
- e.slice(c)
299
+ e.slice(0, l),
300
+ n(e.slice(l, r)),
301
+ e.slice(r)
292
302
  ];
293
303
  }
294
- const Ke = { class: "py-[1.5rem]" }, De = { class: "px-[1.5rem]" }, qe = { class: "pt-[1.5rem]" }, Ve = { class: "flex flex-col gap-10" }, $e = { class: "flex flex-col gap-2" }, Ne = { class: "fm-typo-en-title-sm-600" }, Me = { class: "fm-typo-en-title-sm-400" }, Je = /* @__PURE__ */ H({
304
+ const Ke = { class: "py-[1.5rem]" }, De = { class: "px-[1.5rem]" }, qe = { class: "pt-[1.5rem]" }, Be = { class: "flex flex-col gap-10" }, Ve = { class: "flex flex-col gap-2" }, $e = { class: "fm-typo-en-title-sm-600" }, Ne = { class: "fm-typo-en-title-sm-400" }, Je = /* @__PURE__ */ H({
295
305
  __name: "KioskView",
296
306
  setup(e) {
297
307
  var F, K;
298
- const { t: a } = X(), { canManageOrderSetting: l } = pe(), r = k(
299
- () => import("./KioskSettingView-fF6k9s_q.js")
300
- ), t = v("device"), n = te(), c = we(), o = le(), { currentRestaurant: s, restaurants: p, changeRestaurant: b } = ce(), f = re(), m = v(((F = s.value) == null ? void 0 : F._id) ?? void 0), w = v(null), z = A(() => p.value.map((u) => ({
308
+ const { t: a } = X(), { canManageOrderSetting: n } = pe(), c = k(
309
+ () => import("./KioskSettingView-BUcPNVTc.js")
310
+ ), t = v("device"), l = te(), r = he(), o = ne(), { currentRestaurant: s, restaurants: p, changeRestaurant: b } = re(), f = ce(), m = v(((F = s.value) == null ? void 0 : F._id) ?? void 0), h = v(null), z = x(() => p.value.map((u) => ({
301
311
  label: u.profile.name,
302
312
  value: u._id
303
313
  }))), _ = v(((K = s.value) == null ? void 0 : K._id) ?? "");
304
- async function R(u) {
305
- const y = p.value.find((I) => I._id == u);
314
+ async function L(u) {
315
+ const y = p.value.find((A) => A._id == u);
306
316
  await b(y), await E(), m.value = u, _.value = u;
307
317
  }
308
318
  async function E() {
309
- if (l.value)
319
+ if (n.value)
310
320
  try {
311
- await c.getSetting();
321
+ await r.getSetting();
312
322
  } catch {
313
323
  }
314
- await C();
324
+ await w();
315
325
  }
316
- async function C() {
317
- w.value = null;
326
+ async function w() {
327
+ h.value = null;
318
328
  try {
319
- await n.getDevices();
329
+ await l.getDevices();
320
330
  } catch (u) {
321
- w.value = u instanceof V && u.status === 403 ? "forbidden" : "error";
331
+ h.value = u instanceof B && u.status === 403 ? "forbidden" : "error";
322
332
  }
323
333
  }
324
- const J = A(() => {
334
+ const J = x(() => {
325
335
  const u = [{ label: a("order.deviceBinding"), value: "device" }];
326
- return l.value && u.push({ label: a("order.settings"), value: "setting" }), u;
327
- }), O = A(() => n.state.devices);
328
- async function Y() {
336
+ return n.value && u.push({ label: a("order.settings"), value: "setting" }), u;
337
+ }), Y = x(() => l.state.devices);
338
+ async function Z() {
329
339
  try {
330
- await n.requestOtp();
340
+ await l.requestOtp();
331
341
  } catch (u) {
332
342
  f.open({
333
- title: u instanceof V && u.status === 403 ? a("order.bindDevicePermissionDenied") : a("order.bindDeviceFailed"),
343
+ title: u instanceof B && u.status === 403 ? a("order.bindDevicePermissionDenied") : a("order.bindDeviceFailed"),
334
344
  type: "error"
335
345
  });
336
346
  return;
337
347
  }
338
348
  o.open({
339
- title: Ue(a("order.bindDevice")),
349
+ title: Te(a("order.bindDevice")),
340
350
  contentComponent: ye,
341
351
  contentComponentProps: {
342
- otp: n.state.otp
352
+ otp: l.state.otp
343
353
  }
344
354
  }).onClose(async () => {
345
- await C();
355
+ await w();
346
356
  });
347
357
  }
348
- async function Z(u) {
358
+ async function O(u) {
349
359
  try {
350
- c.setKioskOrderSetting(u), await c.updateKioskSetting(), f.open({
360
+ r.setKioskOrderSetting(u), await r.updateKioskSetting(), f.open({
351
361
  title: a("order.kioskSettingSuccess"),
352
362
  type: "success"
353
363
  });
@@ -364,49 +374,49 @@ const Ke = { class: "py-[1.5rem]" }, De = { class: "px-[1.5rem]" }, qe = { class
364
374
  }), ae(
365
375
  () => p.value.length,
366
376
  async (u) => {
367
- m.value === void 0 && p.value.length > 0 && await R(p.value[0]._id);
377
+ m.value === void 0 && p.value.length > 0 && await L(p.value[0]._id);
368
378
  },
369
379
  { immediate: !0 }
370
380
  ), (u, y) => {
371
- const I = T("FmPageHead"), g = T("FmTabs"), S = T("FmSelect");
372
- return P(), W("div", Ke, [
373
- U(I, {
381
+ const A = R("FmPageHead"), g = R("FmTabs"), S = R("FmSelect");
382
+ return C(), W("div", Ke, [
383
+ T(A, {
374
384
  title: d(a)("order.kiosk")
375
385
  }, null, 8, ["title"]),
376
386
  i("div", De, [
377
- U(g, {
387
+ T(g, {
378
388
  "model-value": t.value,
379
- "onUpdate:modelValue": y[0] || (y[0] = (x) => t.value = x),
389
+ "onUpdate:modelValue": y[0] || (y[0] = (I) => t.value = I),
380
390
  items: J.value
381
391
  }, null, 8, ["model-value", "items"]),
382
392
  i("div", qe, [
383
- i("div", Ve, [
384
- i("div", $e, [
385
- i("span", Ne, h(d(a)("order.activateLocation")), 1),
386
- i("span", Me, h(d(a)("order.selectRestaurant")) + ": ", 1),
387
- U(S, {
393
+ i("div", Be, [
394
+ i("div", Ve, [
395
+ i("span", $e, P(d(a)("order.activateLocation")), 1),
396
+ i("span", Ne, P(d(a)("order.selectRestaurant")) + ": ", 1),
397
+ T(S, {
388
398
  class: "w-1/2",
389
399
  modelValue: m.value,
390
400
  "onUpdate:modelValue": [
391
- y[1] || (y[1] = (x) => m.value = x),
392
- R
401
+ y[1] || (y[1] = (I) => m.value = I),
402
+ L
393
403
  ],
394
404
  items: z.value,
395
405
  placeholder: d(a)("order.selectItem")
396
406
  }, null, 8, ["modelValue", "items", "placeholder"])
397
407
  ]),
398
- t.value == "device" ? (P(), D(ne, {
408
+ t.value == "device" ? (C(), D(le, {
399
409
  key: 0,
400
- devices: O.value,
401
- "load-error": w.value,
402
- onRequestOtp: Y,
403
- onRetry: C
410
+ devices: Y.value,
411
+ "load-error": h.value,
412
+ onRequestOtp: Z,
413
+ onRetry: w
404
414
  }, null, 8, ["devices", "load-error"])) : q("", !0),
405
- t.value == "setting" && d(l) ? (P(), D(d(r), {
415
+ t.value == "setting" && d(n) ? (C(), D(d(c), {
406
416
  key: `KioskSettingView-${_.value}`,
407
417
  "restaurant-id": _.value,
408
- onUpdateKioskOrderSetting: Z,
409
- form: d(c).state.kiosk ?? d(ve)
418
+ onUpdateKioskOrderSetting: O,
419
+ form: d(r).state.kiosk ?? d(ve)
410
420
  }, null, 8, ["restaurant-id", "form"])) : q("", !0)
411
421
  ])
412
422
  ])