@feedmepos/mf-order-setting 0.0.102 → 0.0.103
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-jnt6letY.js → DisplaySystemView-BBiZqcWq.js} +1497 -1468
- package/dist/{FoodCourtInvitationsView-DoynqFWB.js → FoodCourtInvitationsView-DwOkVs9m.js} +4 -4
- package/dist/{FoodCourtOrderSettingsView-DYZLhTHy.js → FoodCourtOrderSettingsView-C9Ag5Bsg.js} +1 -1
- package/dist/FoodCourtOrdersView-y4EwK3sn.js +1173 -0
- package/dist/{FoodCourtStallsView-CRMTt5BB.js → FoodCourtStallsView-Bi8H-yR7.js} +2 -2
- package/dist/{FoodCourtStatusView-C-b-eI-8.js → FoodCourtStatusView-jugAzTKg.js} +1 -1
- package/dist/KioskDevicesView-CYiew4X5.js +4 -0
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-BCvbeo7R.js +1497 -0
- package/dist/KioskSettingView-AKBiij9a.js +1124 -0
- package/dist/KioskView-zKB6mC8I.js +765 -0
- package/dist/{OrderSettingsView-BBCnekaj.js → OrderSettingsView-CoV_yX3m.js} +22064 -21635
- package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-DjoTyV6m.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-KSMU_jGl.js} +1 -1
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/{app-Dvk30CIa.js → app-CmuI6uSl.js} +3589 -2902
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-DUFHhM7O.js → dayjs.min-B3MssMma.js} +1 -1
- package/dist/{featureFlag-BvcirzHS.js → featureFlag-CWvkPOBY.js} +123 -130
- package/dist/frontend/mf-order/src/api/food-court/index.d.ts +51 -0
- package/dist/frontend/mf-order/src/api/kiosk/index.d.ts +4 -0
- package/dist/frontend/mf-order/src/api/payment/index.d.ts +8 -0
- package/dist/frontend/mf-order/src/api/queue/index.d.ts +13 -0
- package/dist/frontend/mf-order/src/api/restaurant-setting/index.d.ts +9 -1
- package/dist/frontend/mf-order/src/app.d.ts +687 -0
- package/dist/frontend/mf-order/src/main.d.ts +687 -0
- package/dist/frontend/mf-order/src/modules/display-system/interface.d.ts +5 -0
- package/dist/frontend/mf-order/src/modules/kiosk/interface.d.ts +4 -0
- package/dist/frontend/mf-order/src/modules/kiosk/license.d.ts +92 -0
- package/dist/frontend/mf-order/src/modules/kiosk/outletLoad.d.ts +15 -0
- package/dist/frontend/mf-order/src/modules/kiosk/settingsSections.d.ts +24 -0
- package/dist/frontend/mf-order/src/modules/kiosk/useKioskSettings.d.ts +29 -0
- package/dist/frontend/mf-order/src/modules/payment/paymentDevice.d.ts +58 -0
- package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +67 -1
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +19 -10
- package/dist/frontend/mf-order/src/stores/payment/index.d.ts +59 -1
- package/dist/frontend/mf-order/src/views/food-court/food-court-export.d.ts +38 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDeviceCard.vue.d.ts +3 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +7 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskLicenseSummary.vue.d.ts +7 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskLicensesView.vue.d.ts +6 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskOtpDialog.vue.d.ts +3 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskPaymentDeviceCard.vue.d.ts +17 -0
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskSettingView.vue.d.ts +5 -2
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +0 -9
- package/dist/frontend/mf-order/src/views/order-settings/pos-status/PosOrderingStatus.vue.d.ts +17 -0
- package/dist/frontend/mf-order/src/views/order-settings/pos-status/pos-status.d.ts +44 -0
- package/dist/frontend/mf-order/src/views/order-settings/queue/called-message.d.ts +1 -0
- package/dist/frontend/mf-order/src/views/order-settings/queue/phone-join-mode.d.ts +25 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-C4n5H7t3.js → index-BQa8AudZ.js} +3 -3
- package/dist/index-CMOvrim4.js +147 -0
- package/dist/{index-CW4VlFWz.js → index-D5qh2_4b.js} +1 -1
- package/dist/{index-C5n6lil6.js → index-Dup6kWLX.js} +6 -6
- package/dist/{index-CGxCWKHB.js → index-wuFIsXHT.js} +188 -179
- package/dist/{order.dto-Cb_gh3iB.js → order.dto-BD9raQG5.js} +2782 -2735
- package/dist/package/entity/display/blocks.d.ts +12 -2
- package/dist/package/entity/marketing/marketing.dto.d.ts +18 -18
- package/dist/package/entity/order-platform/external/reconciliation/external-reconciliation.do.d.ts +24 -24
- package/dist/package/entity/order-platform/menu.dto.d.ts +20 -20
- package/dist/package/entity/order-setting/order-setting.do.d.ts +10 -0
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +26 -0
- package/dist/package/entity/order-setting/queue/queue.do.d.ts +23 -0
- package/dist/package/entity/order-setting/queue/queue.dto.d.ts +14 -0
- package/dist/package/entity/queue/queue.do.d.ts +153 -0
- package/dist/package/entity/queue/queue.dto.d.ts +221 -2
- package/dist/package/entity/queue/queue.enum.d.ts +5 -0
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +20 -0
- package/dist/style.css +1 -1
- package/dist/{index-ILnighyU.js → useInternalUser-CHtaur9A.js} +93 -81
- package/package.json +2 -1
- package/src/api/food-court/index.ts +63 -0
- package/src/api/kiosk/index.ts +8 -0
- package/src/api/payment/index.ts +18 -1
- package/src/api/queue/index.ts +39 -0
- package/src/api/restaurant-setting/index.ts +14 -0
- package/src/locales/en-US.json +197 -26
- package/src/locales/ja-JP.json +193 -23
- package/src/locales/th-TH.json +193 -21
- package/src/locales/zh-CN.json +197 -23
- package/src/modules/display-system/interface.spec.ts +26 -1
- package/src/modules/display-system/interface.ts +20 -0
- package/src/modules/kiosk/interface.ts +4 -0
- package/src/modules/kiosk/license.spec.ts +167 -0
- package/src/modules/kiosk/license.ts +175 -0
- package/src/modules/kiosk/outletLoad.spec.ts +25 -0
- package/src/modules/kiosk/outletLoad.ts +19 -0
- package/src/modules/kiosk/settingsSections.spec.ts +85 -0
- package/src/modules/kiosk/settingsSections.ts +82 -0
- package/src/modules/kiosk/useKioskSettings.spec.ts +157 -0
- package/src/modules/kiosk/useKioskSettings.ts +61 -0
- package/src/modules/payment/paymentDevice.spec.ts +175 -0
- package/src/modules/payment/paymentDevice.ts +156 -0
- package/src/stores/kiosk/index.ts +16 -1
- package/src/stores/kiosk/mapper.ts +2 -0
- package/src/stores/order-setting/index.spec.ts +83 -0
- package/src/stores/order-setting/index.ts +49 -27
- package/src/stores/payment/index.spec.ts +86 -0
- package/src/stores/payment/index.ts +48 -2
- package/src/views/display-system/DisplayInspector.vue +17 -8
- package/src/views/display-system/DisplayTemplateEditor.vue +3 -1
- package/src/views/food-court/FoodCourtOrdersView.vue +46 -1
- package/src/views/food-court/food-court-export.spec.ts +151 -0
- package/src/views/food-court/food-court-export.ts +283 -0
- package/src/views/kiosk/KioskStatePanel.vue +2 -2
- package/src/views/kiosk/KioskView.vue +219 -82
- package/src/views/kiosk/devices/KioskDeviceCard.vue +148 -23
- package/src/views/kiosk/devices/KioskDevicesView.vue +48 -10
- package/src/views/kiosk/devices/KioskLicenseSummary.vue +79 -0
- package/src/views/kiosk/devices/KioskLicensesView.vue +152 -0
- package/src/views/kiosk/devices/KioskOtpDialog.vue +41 -1
- package/src/views/kiosk/devices/KioskPaymentDeviceCard.spec.ts +97 -0
- package/src/views/kiosk/devices/KioskPaymentDeviceCard.vue +221 -0
- package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +1 -1
- package/src/views/kiosk/settings/KioskSettingView.vue +702 -419
- package/src/views/order-settings/delivery/DeliverySetting.vue +4 -0
- package/src/views/order-settings/dine-in/DineInSetting.vue +4 -0
- package/src/views/order-settings/pickup/PickUpSetting.vue +4 -4
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +0 -23
- package/src/views/order-settings/pos-status/PosOrderingStatus.spec.ts +207 -0
- package/src/views/order-settings/pos-status/PosOrderingStatus.vue +209 -0
- package/src/views/order-settings/pos-status/pos-status.spec.ts +103 -0
- package/src/views/order-settings/pos-status/pos-status.ts +86 -0
- package/src/views/order-settings/queue/QueueSetting.source.spec.ts +43 -0
- package/src/views/order-settings/queue/QueueSetting.vue +289 -15
- package/src/views/order-settings/queue/called-message.spec.ts +29 -1
- package/src/views/order-settings/queue/called-message.ts +18 -0
- package/src/views/order-settings/queue/phone-join-mode.spec.ts +90 -0
- package/src/views/order-settings/queue/phone-join-mode.ts +49 -0
- package/dist/FoodCourtOrdersView-CAPOycT3.js +0 -544
- package/dist/KioskDevicesView-B0U9JxRl.js +0 -4
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-V3ai4FVI.js +0 -937
- package/dist/KioskSettingView-rdom_aS8.js +0 -880
- package/dist/KioskView-DOON9zR6.js +0 -516
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskDisplayStandSection.vue.d.ts +0 -10
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskInstructionSection.vue.d.ts +0 -15
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPickAtCounterSection.vue.d.ts +0 -10
- package/dist/index-CaHG3M7C.js +0 -135
- package/src/views/kiosk/settings/KioskDisplayStandSection.vue +0 -189
- package/src/views/kiosk/settings/KioskInstructionSection.vue +0 -40
- package/src/views/kiosk/settings/KioskPickAtCounterSection.vue +0 -68
|
@@ -0,0 +1,1173 @@
|
|
|
1
|
+
import { defineComponent as We, ref as H, computed as ie, watch as Ie, resolveComponent as G, openBlock as I, createBlock as ce, unref as h, withCtx as ne, createElementBlock as U, createElementVNode as _, toDisplayString as T, createVNode as j, Fragment as re, renderList as ve, createCommentVNode as le, createTextVNode as Pe, normalizeClass as ur, h as fr } from "vue";
|
|
2
|
+
import { d as X } from "./dayjs.min-B3MssMma.js";
|
|
3
|
+
import { useRoute as cr, useRouter as mr } from "vue-router";
|
|
4
|
+
import { useI18n as Qe } from "@feedmepos/mf-common";
|
|
5
|
+
import { components as vr } from "@feedmepos/ui-library";
|
|
6
|
+
import { u as Ze } from "./snackbar-DZQ0_reQ.js";
|
|
7
|
+
import { u as pr } from "./useFoodCourtContext-2p5sJMcB.js";
|
|
8
|
+
import { d as De } from "./index-CMOvrim4.js";
|
|
9
|
+
import { e as ke } from "./food-court-member-joC8tmsI.js";
|
|
10
|
+
import { a as hr } from "./index-D5qh2_4b.js";
|
|
11
|
+
import { a as yr } from "./index-BQa8AudZ.js";
|
|
12
|
+
const we = ["PAID", "PENDING_PAYMENT", "CANCELLED"], pe = {
|
|
13
|
+
PAID: { variant: "success", labelKey: "order.foodCourt.orders.statusPaid" },
|
|
14
|
+
PENDING_PAYMENT: { variant: "warning", labelKey: "order.foodCourt.orders.statusPendingPayment" },
|
|
15
|
+
CANCELLED: { variant: "neutral", labelKey: "order.foodCourt.orders.statusCancelled" },
|
|
16
|
+
DRAFT: { variant: "neutral", labelKey: "order.foodCourt.orders.statusDraft" }
|
|
17
|
+
};
|
|
18
|
+
function Le(e) {
|
|
19
|
+
var r;
|
|
20
|
+
switch ((r = e == null ? void 0 : e.bill) == null ? void 0 : r.status) {
|
|
21
|
+
case "REFUNDED":
|
|
22
|
+
return { variant: "critical", labelKey: "order.foodCourt.orders.stallRefunded" };
|
|
23
|
+
case "VOIDED":
|
|
24
|
+
return { variant: "critical", labelKey: "order.foodCourt.orders.stallVoided" };
|
|
25
|
+
}
|
|
26
|
+
switch (e == null ? void 0 : e.status) {
|
|
27
|
+
case "ACCEPTED":
|
|
28
|
+
return { variant: "success", labelKey: "order.foodCourt.orders.stallAccepted" };
|
|
29
|
+
case "DECLINED":
|
|
30
|
+
return { variant: "critical", labelKey: "order.foodCourt.orders.stallDeclined" };
|
|
31
|
+
case "NEW":
|
|
32
|
+
return { variant: "warning", labelKey: "order.foodCourt.orders.stallWaiting" };
|
|
33
|
+
default:
|
|
34
|
+
return { variant: "neutral", labelKey: "order.foodCourt.orders.stallUnknown" };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function Ve(e, r = X()) {
|
|
38
|
+
const t = e.startDate ? X(e.startDate) : r, o = e.endDate ? X(e.endDate) : t;
|
|
39
|
+
return {
|
|
40
|
+
from: t.startOf("day").format(),
|
|
41
|
+
to: o.add(1, "day").startOf("day").format()
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function se(e) {
|
|
45
|
+
return e ? hr.Dinero.fromFdoDinero(e).toFormat(!0) : "-";
|
|
46
|
+
}
|
|
47
|
+
function Je(e, r = !1) {
|
|
48
|
+
return e ? X(e).format(r ? "DD MMM YYYY, HH:mm:ss" : "DD MMM YYYY, HH:mm") : "-";
|
|
49
|
+
}
|
|
50
|
+
function er(e, r = []) {
|
|
51
|
+
return r.flatMap((t, o) => {
|
|
52
|
+
const a = `${e}.${o}`;
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
key: a,
|
|
56
|
+
name: t.name,
|
|
57
|
+
quantity: t.quantity,
|
|
58
|
+
amount: t.price && t.price.amount !== 0 ? t.price : null,
|
|
59
|
+
remark: null,
|
|
60
|
+
sub: !0
|
|
61
|
+
},
|
|
62
|
+
...er(a, t.subItems)
|
|
63
|
+
];
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function gr(e) {
|
|
67
|
+
return e ? Object.entries(e.items ?? {}).filter(([, r]) => r.status !== "VOIDED").flatMap(([r, t]) => {
|
|
68
|
+
var o;
|
|
69
|
+
return [
|
|
70
|
+
{
|
|
71
|
+
key: r,
|
|
72
|
+
name: ((o = t.product) == null ? void 0 : o.name) ?? "",
|
|
73
|
+
quantity: t.quantity,
|
|
74
|
+
amount: t.nettTotal ?? null,
|
|
75
|
+
remark: t.remark || null,
|
|
76
|
+
sub: !1
|
|
77
|
+
},
|
|
78
|
+
...er(r, t.subItems)
|
|
79
|
+
];
|
|
80
|
+
}) : [];
|
|
81
|
+
}
|
|
82
|
+
function Be(e) {
|
|
83
|
+
return !e || e.amount === 0;
|
|
84
|
+
}
|
|
85
|
+
function xr(e) {
|
|
86
|
+
if (!e) return [];
|
|
87
|
+
const r = [
|
|
88
|
+
{
|
|
89
|
+
key: "subtotal",
|
|
90
|
+
label: "order.foodCourt.orders.subtotal",
|
|
91
|
+
labelIsName: !1,
|
|
92
|
+
amount: e.grossTotal
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
e.adjustedTotal && e.adjustedTotal.amount !== e.grossTotal.amount && r.push({
|
|
96
|
+
key: "discount",
|
|
97
|
+
label: "order.foodCourt.orders.discount",
|
|
98
|
+
labelIsName: !1,
|
|
99
|
+
amount: { ...e.adjustedTotal, amount: e.adjustedTotal.amount - e.grossTotal.amount }
|
|
100
|
+
});
|
|
101
|
+
for (const [t, o] of Object.entries(e.nettTaxes ?? {}))
|
|
102
|
+
o.inclusive || Be(o.total) || r.push({ key: `tax.${t}`, label: o.name, labelIsName: !0, amount: o.total });
|
|
103
|
+
return Be(e.rounding) || r.push({
|
|
104
|
+
key: "rounding",
|
|
105
|
+
label: "order.foodCourt.orders.rounding",
|
|
106
|
+
labelIsName: !1,
|
|
107
|
+
amount: e.rounding
|
|
108
|
+
}), r;
|
|
109
|
+
}
|
|
110
|
+
function _r(e) {
|
|
111
|
+
const r = new Map((e.pf_orders ?? []).map((t) => [String(t._id), t]));
|
|
112
|
+
return (e.stalls ?? []).map((t) => {
|
|
113
|
+
const o = r.get(String(t.orderId)) ?? null, a = gr(o == null ? void 0 : o.bill);
|
|
114
|
+
return {
|
|
115
|
+
key: t.orderId,
|
|
116
|
+
unitNo: t.unitNo || null,
|
|
117
|
+
name: t.displayName || t.restaurantId,
|
|
118
|
+
amount: t.amount,
|
|
119
|
+
order: o,
|
|
120
|
+
items: a,
|
|
121
|
+
itemCount: a.filter((n) => !n.sub).reduce((n, l) => n + l.quantity, 0),
|
|
122
|
+
totals: xr(o == null ? void 0 : o.bill)
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const Cr = {
|
|
127
|
+
key: 1,
|
|
128
|
+
class: "flex flex-col gap-3 items-start"
|
|
129
|
+
}, wr = { class: "fm-typo-en-body-md-400" }, br = {
|
|
130
|
+
key: 2,
|
|
131
|
+
class: "flex flex-col gap-4"
|
|
132
|
+
}, Tr = { class: "flex items-center justify-between gap-2" }, Ir = { class: "fm-typo-en-title-sm-600" }, Dr = { class: "flex flex-col gap-2" }, kr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sr = { class: "fm-typo-en-body-md-600 break-all" }, Er = { class: "flex items-center justify-between gap-2" }, Nr = { class: "flex items-center gap-2 min-w-0" }, Fr = {
|
|
133
|
+
key: 0,
|
|
134
|
+
class: "px-2 py-[2px] rounded bg-fm-color-neutral-gray-100 fm-typo-en-body-sm-400 shrink-0"
|
|
135
|
+
}, Ar = { class: "fm-typo-en-body-lg-600 truncate" }, Mr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Or = { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" }, Rr = ["onClick"], Ur = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yr = { class: "flex items-center gap-1 fm-typo-en-body-md-600" }, $r = {
|
|
136
|
+
key: 0,
|
|
137
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
|
|
138
|
+
}, Pr = {
|
|
139
|
+
key: 1,
|
|
140
|
+
class: "flex flex-col gap-1"
|
|
141
|
+
}, Lr = { class: "flex flex-col min-w-0" }, Vr = {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary"
|
|
144
|
+
}, Br = { class: "shrink-0" }, jr = {
|
|
145
|
+
key: 2,
|
|
146
|
+
class: "flex flex-col gap-1 border-t border-fm-color-neutral-gray-200 pt-3 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
147
|
+
}, qr = { class: "flex justify-between gap-3 fm-typo-en-body-md-600 text-fm-color-typo-primary" }, zr = { class: "fm-typo-en-title-sm-600" }, Hr = { class: "fm-typo-en-title-sm-600" }, Kr = /* @__PURE__ */ We({
|
|
148
|
+
__name: "FoodCourtOrderSheet",
|
|
149
|
+
props: {
|
|
150
|
+
modelValue: { type: Boolean },
|
|
151
|
+
foodCourtId: {},
|
|
152
|
+
orderId: {}
|
|
153
|
+
},
|
|
154
|
+
emits: ["update:modelValue"],
|
|
155
|
+
setup(e, { emit: r }) {
|
|
156
|
+
const t = e, o = r, { t: a } = Qe(), { showError: n } = Ze(), l = H(null), d = H(!1), i = H(!1), m = H(/* @__PURE__ */ new Set()), s = ie(() => l.value ? _r(l.value) : []), u = ie(() => {
|
|
157
|
+
var c;
|
|
158
|
+
const v = l.value;
|
|
159
|
+
return v ? [
|
|
160
|
+
{
|
|
161
|
+
label: a("order.foodCourt.orders.date"),
|
|
162
|
+
value: Je(((c = v.payment) == null ? void 0 : c.paidAt) ?? null, !0)
|
|
163
|
+
},
|
|
164
|
+
{ label: a("order.foodCourt.orders.paidBy"), value: v.paymentMethod || "-" },
|
|
165
|
+
{ label: a("order.foodCourt.orders.orderId"), value: v._id }
|
|
166
|
+
] : [];
|
|
167
|
+
});
|
|
168
|
+
function C(v) {
|
|
169
|
+
const c = new Set(m.value);
|
|
170
|
+
c.has(v) ? c.delete(v) : c.add(v), m.value = c;
|
|
171
|
+
}
|
|
172
|
+
async function w() {
|
|
173
|
+
var O, $;
|
|
174
|
+
const v = t.foodCourtId, c = t.orderId;
|
|
175
|
+
if (i.value = !1, !!c) {
|
|
176
|
+
d.value = !0;
|
|
177
|
+
try {
|
|
178
|
+
const F = await De.getOrder(v, c);
|
|
179
|
+
if (c !== t.orderId || v !== t.foodCourtId) return;
|
|
180
|
+
l.value = F;
|
|
181
|
+
const A = ($ = (O = F.stalls) == null ? void 0 : O[0]) == null ? void 0 : $.orderId;
|
|
182
|
+
m.value = new Set(A ? [A] : []);
|
|
183
|
+
} catch (F) {
|
|
184
|
+
if (c !== t.orderId || v !== t.foodCourtId) return;
|
|
185
|
+
i.value = !0, n(ke(F));
|
|
186
|
+
} finally {
|
|
187
|
+
c === t.orderId && v === t.foodCourtId && (d.value = !1);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return Ie(
|
|
192
|
+
() => [t.foodCourtId, t.orderId],
|
|
193
|
+
() => {
|
|
194
|
+
l.value = null, w();
|
|
195
|
+
},
|
|
196
|
+
{ immediate: !0 }
|
|
197
|
+
), (v, c) => {
|
|
198
|
+
const O = G("FmCircularProgress"), $ = G("FmButton"), F = G("FmChip"), A = G("FmCard"), E = G("FmIcon"), R = G("FmSideSheet");
|
|
199
|
+
return I(), ce(R, {
|
|
200
|
+
"model-value": e.modelValue,
|
|
201
|
+
header: h(a)("order.foodCourt.orders.detailTitle"),
|
|
202
|
+
"dismiss-away": "",
|
|
203
|
+
"max-width": 560,
|
|
204
|
+
"onUpdate:modelValue": c[1] || (c[1] = (p) => o("update:modelValue", p))
|
|
205
|
+
}, {
|
|
206
|
+
"side-sheet-footer": ne(() => [
|
|
207
|
+
j($, {
|
|
208
|
+
variant: "secondary",
|
|
209
|
+
label: h(a)("order.foodCourt.orders.close"),
|
|
210
|
+
size: "lg",
|
|
211
|
+
onClick: c[0] || (c[0] = (p) => o("update:modelValue", !1))
|
|
212
|
+
}, null, 8, ["label"])
|
|
213
|
+
]),
|
|
214
|
+
default: ne(() => [
|
|
215
|
+
d.value ? (I(), ce(O, {
|
|
216
|
+
key: 0,
|
|
217
|
+
size: "xl"
|
|
218
|
+
})) : i.value ? (I(), U("div", Cr, [
|
|
219
|
+
_("span", wr, T(h(a)("order.foodCourt.orders.detailLoadFailed")), 1),
|
|
220
|
+
j($, {
|
|
221
|
+
variant: "secondary",
|
|
222
|
+
label: h(a)("order.foodCourt.retry"),
|
|
223
|
+
onClick: w
|
|
224
|
+
}, null, 8, ["label"])
|
|
225
|
+
])) : l.value ? (I(), U("div", br, [
|
|
226
|
+
j(A, {
|
|
227
|
+
variant: "outlined",
|
|
228
|
+
class: "p-4 flex flex-col gap-3"
|
|
229
|
+
}, {
|
|
230
|
+
default: ne(() => [
|
|
231
|
+
_("div", Tr, [
|
|
232
|
+
_("span", Ir, T(l.value.orderNumber ? h(a)("order.foodCourt.orders.orderTitle", { number: `#${l.value.orderNumber}` }) : h(a)("order.foodCourt.orders.noNumber")), 1),
|
|
233
|
+
j(F, {
|
|
234
|
+
variant: h(pe)[l.value.status].variant,
|
|
235
|
+
label: h(a)(h(pe)[l.value.status].labelKey)
|
|
236
|
+
}, null, 8, ["variant", "label"])
|
|
237
|
+
]),
|
|
238
|
+
_("div", Dr, [
|
|
239
|
+
(I(!0), U(re, null, ve(u.value, (p) => (I(), U("div", {
|
|
240
|
+
key: p.label,
|
|
241
|
+
class: "flex flex-col"
|
|
242
|
+
}, [
|
|
243
|
+
_("span", kr, T(p.label), 1),
|
|
244
|
+
_("span", Sr, T(p.value), 1)
|
|
245
|
+
]))), 128))
|
|
246
|
+
])
|
|
247
|
+
]),
|
|
248
|
+
_: 1
|
|
249
|
+
}),
|
|
250
|
+
(I(!0), U(re, null, ve(s.value, (p) => (I(), ce(A, {
|
|
251
|
+
key: p.key,
|
|
252
|
+
variant: "outlined",
|
|
253
|
+
class: "p-4 flex flex-col gap-3"
|
|
254
|
+
}, {
|
|
255
|
+
default: ne(() => {
|
|
256
|
+
var D, g, y, P;
|
|
257
|
+
return [
|
|
258
|
+
_("div", Er, [
|
|
259
|
+
_("div", Nr, [
|
|
260
|
+
p.unitNo ? (I(), U("span", Fr, T(p.unitNo), 1)) : le("", !0),
|
|
261
|
+
_("span", Ar, T(p.name), 1)
|
|
262
|
+
]),
|
|
263
|
+
j(F, {
|
|
264
|
+
variant: h(Le)(p.order).variant,
|
|
265
|
+
label: h(a)(h(Le)(p.order).labelKey)
|
|
266
|
+
}, null, 8, ["variant", "label"])
|
|
267
|
+
]),
|
|
268
|
+
_("span", Mr, [
|
|
269
|
+
Pe(T(h(a)("order.foodCourt.orders.billNo")) + " • ", 1),
|
|
270
|
+
_("span", Or, T(((g = (D = p.order) == null ? void 0 : D.bill) == null ? void 0 : g.seqNumber) || h(a)("order.foodCourt.orders.notBilled")), 1)
|
|
271
|
+
]),
|
|
272
|
+
_("button", {
|
|
273
|
+
type: "button",
|
|
274
|
+
class: "flex items-center justify-between border-t border-fm-color-neutral-gray-200 pt-3",
|
|
275
|
+
onClick: (b) => C(p.key)
|
|
276
|
+
}, [
|
|
277
|
+
_("span", Ur, T(h(a)("order.foodCourt.orders.itemCount", { count: p.itemCount })), 1),
|
|
278
|
+
_("span", Yr, [
|
|
279
|
+
Pe(T(h(se)(p.amount)) + " ", 1),
|
|
280
|
+
j(E, {
|
|
281
|
+
name: m.value.has(p.key) ? "expand_less" : "expand_more",
|
|
282
|
+
size: "md"
|
|
283
|
+
}, null, 8, ["name"])
|
|
284
|
+
])
|
|
285
|
+
], 8, Rr),
|
|
286
|
+
m.value.has(p.key) ? (I(), U(re, { key: 0 }, [
|
|
287
|
+
p.items.length ? (I(), U("div", Pr, [
|
|
288
|
+
(I(!0), U(re, null, ve(p.items, (b) => (I(), U("div", {
|
|
289
|
+
key: b.key,
|
|
290
|
+
class: ur([
|
|
291
|
+
"flex justify-between gap-3",
|
|
292
|
+
b.sub ? "pl-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary" : "fm-typo-en-body-md-600 pt-1"
|
|
293
|
+
])
|
|
294
|
+
}, [
|
|
295
|
+
_("div", Lr, [
|
|
296
|
+
_("span", null, T(b.sub ? `+ ${b.name}` : `${b.quantity}x ${b.name}`), 1),
|
|
297
|
+
b.remark ? (I(), U("span", Vr, T(b.remark), 1)) : le("", !0)
|
|
298
|
+
]),
|
|
299
|
+
_("span", Br, T(b.amount ? h(se)(b.amount) : ""), 1)
|
|
300
|
+
], 2))), 128))
|
|
301
|
+
])) : (I(), U("div", $r, T(h(a)("order.foodCourt.orders.noItems")), 1)),
|
|
302
|
+
p.totals.length ? (I(), U("div", jr, [
|
|
303
|
+
(I(!0), U(re, null, ve(p.totals, (b) => (I(), U("div", {
|
|
304
|
+
key: b.key,
|
|
305
|
+
class: "flex justify-between gap-3"
|
|
306
|
+
}, [
|
|
307
|
+
_("span", null, T(b.labelIsName ? b.label : h(a)(b.label)), 1),
|
|
308
|
+
_("span", null, T(h(se)(b.amount)), 1)
|
|
309
|
+
]))), 128)),
|
|
310
|
+
_("div", qr, [
|
|
311
|
+
_("span", null, T(h(a)("order.foodCourt.orders.stallTotal")), 1),
|
|
312
|
+
_("span", null, T(h(se)(((P = (y = p.order) == null ? void 0 : y.bill) == null ? void 0 : P.nettTotal) ?? p.amount)), 1)
|
|
313
|
+
])
|
|
314
|
+
])) : le("", !0)
|
|
315
|
+
], 64)) : le("", !0)
|
|
316
|
+
];
|
|
317
|
+
}),
|
|
318
|
+
_: 2
|
|
319
|
+
}, 1024))), 128)),
|
|
320
|
+
j(A, {
|
|
321
|
+
variant: "outlined",
|
|
322
|
+
class: "p-4 flex items-center justify-between"
|
|
323
|
+
}, {
|
|
324
|
+
default: ne(() => [
|
|
325
|
+
_("span", zr, T(h(a)("order.foodCourt.orders.netTotal")), 1),
|
|
326
|
+
_("span", Hr, T(h(se)(l.value.total)), 1)
|
|
327
|
+
]),
|
|
328
|
+
_: 1
|
|
329
|
+
})
|
|
330
|
+
])) : le("", !0)
|
|
331
|
+
]),
|
|
332
|
+
_: 1
|
|
333
|
+
}, 8, ["model-value", "header"]);
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
var q = Uint8Array, K = Uint16Array, Ae = Int32Array, Me = new q([
|
|
338
|
+
0,
|
|
339
|
+
0,
|
|
340
|
+
0,
|
|
341
|
+
0,
|
|
342
|
+
0,
|
|
343
|
+
0,
|
|
344
|
+
0,
|
|
345
|
+
0,
|
|
346
|
+
1,
|
|
347
|
+
1,
|
|
348
|
+
1,
|
|
349
|
+
1,
|
|
350
|
+
2,
|
|
351
|
+
2,
|
|
352
|
+
2,
|
|
353
|
+
2,
|
|
354
|
+
3,
|
|
355
|
+
3,
|
|
356
|
+
3,
|
|
357
|
+
3,
|
|
358
|
+
4,
|
|
359
|
+
4,
|
|
360
|
+
4,
|
|
361
|
+
4,
|
|
362
|
+
5,
|
|
363
|
+
5,
|
|
364
|
+
5,
|
|
365
|
+
5,
|
|
366
|
+
0,
|
|
367
|
+
/* unused */
|
|
368
|
+
0,
|
|
369
|
+
0,
|
|
370
|
+
/* impossible */
|
|
371
|
+
0
|
|
372
|
+
]), Oe = new q([
|
|
373
|
+
0,
|
|
374
|
+
0,
|
|
375
|
+
0,
|
|
376
|
+
0,
|
|
377
|
+
1,
|
|
378
|
+
1,
|
|
379
|
+
2,
|
|
380
|
+
2,
|
|
381
|
+
3,
|
|
382
|
+
3,
|
|
383
|
+
4,
|
|
384
|
+
4,
|
|
385
|
+
5,
|
|
386
|
+
5,
|
|
387
|
+
6,
|
|
388
|
+
6,
|
|
389
|
+
7,
|
|
390
|
+
7,
|
|
391
|
+
8,
|
|
392
|
+
8,
|
|
393
|
+
9,
|
|
394
|
+
9,
|
|
395
|
+
10,
|
|
396
|
+
10,
|
|
397
|
+
11,
|
|
398
|
+
11,
|
|
399
|
+
12,
|
|
400
|
+
12,
|
|
401
|
+
13,
|
|
402
|
+
13,
|
|
403
|
+
/* unused */
|
|
404
|
+
0,
|
|
405
|
+
0
|
|
406
|
+
]), je = new q([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), rr = function(e, r) {
|
|
407
|
+
for (var t = new K(31), o = 0; o < 31; ++o)
|
|
408
|
+
t[o] = r += 1 << e[o - 1];
|
|
409
|
+
for (var a = new Ae(t[30]), o = 1; o < 30; ++o)
|
|
410
|
+
for (var n = t[o]; n < t[o + 1]; ++n)
|
|
411
|
+
a[n] = n - t[o] << 5 | o;
|
|
412
|
+
return { b: t, r: a };
|
|
413
|
+
}, tr = rr(Me, 2), Gr = tr.b, Se = tr.r;
|
|
414
|
+
Gr[28] = 258, Se[258] = 28;
|
|
415
|
+
var Xr = rr(Oe, 0), qe = Xr.r, Ee = new K(32768);
|
|
416
|
+
for (var S = 0; S < 32768; ++S) {
|
|
417
|
+
var ee = (S & 43690) >> 1 | (S & 21845) << 1;
|
|
418
|
+
ee = (ee & 52428) >> 2 | (ee & 13107) << 2, ee = (ee & 61680) >> 4 | (ee & 3855) << 4, Ee[S] = ((ee & 65280) >> 8 | (ee & 255) << 8) >> 1;
|
|
419
|
+
}
|
|
420
|
+
var me = function(e, r, t) {
|
|
421
|
+
for (var o = e.length, a = 0, n = new K(r); a < o; ++a)
|
|
422
|
+
e[a] && ++n[e[a] - 1];
|
|
423
|
+
var l = new K(r);
|
|
424
|
+
for (a = 1; a < r; ++a)
|
|
425
|
+
l[a] = l[a - 1] + n[a - 1] << 1;
|
|
426
|
+
var d;
|
|
427
|
+
if (t) {
|
|
428
|
+
d = new K(1 << r);
|
|
429
|
+
var i = 15 - r;
|
|
430
|
+
for (a = 0; a < o; ++a)
|
|
431
|
+
if (e[a])
|
|
432
|
+
for (var m = a << 4 | e[a], s = r - e[a], u = l[e[a] - 1]++ << s, C = u | (1 << s) - 1; u <= C; ++u)
|
|
433
|
+
d[Ee[u] >> i] = m;
|
|
434
|
+
} else
|
|
435
|
+
for (d = new K(o), a = 0; a < o; ++a)
|
|
436
|
+
e[a] && (d[a] = Ee[l[e[a] - 1]++] >> 15 - e[a]);
|
|
437
|
+
return d;
|
|
438
|
+
}, te = new q(288);
|
|
439
|
+
for (var S = 0; S < 144; ++S)
|
|
440
|
+
te[S] = 8;
|
|
441
|
+
for (var S = 144; S < 256; ++S)
|
|
442
|
+
te[S] = 9;
|
|
443
|
+
for (var S = 256; S < 280; ++S)
|
|
444
|
+
te[S] = 7;
|
|
445
|
+
for (var S = 280; S < 288; ++S)
|
|
446
|
+
te[S] = 8;
|
|
447
|
+
var he = new q(32);
|
|
448
|
+
for (var S = 0; S < 32; ++S)
|
|
449
|
+
he[S] = 5;
|
|
450
|
+
var Wr = /* @__PURE__ */ me(te, 9, 0), Qr = /* @__PURE__ */ me(he, 5, 0), or = function(e) {
|
|
451
|
+
return (e + 7) / 8 | 0;
|
|
452
|
+
}, ar = function(e, r, t) {
|
|
453
|
+
return (t == null || t > e.length) && (t = e.length), new q(e.subarray(r, t));
|
|
454
|
+
}, Zr = [
|
|
455
|
+
"unexpected EOF",
|
|
456
|
+
"invalid block type",
|
|
457
|
+
"invalid length/literal",
|
|
458
|
+
"invalid distance",
|
|
459
|
+
"stream finished",
|
|
460
|
+
"no stream handler",
|
|
461
|
+
,
|
|
462
|
+
// determined by compression function
|
|
463
|
+
"no callback",
|
|
464
|
+
"invalid UTF-8 data",
|
|
465
|
+
"extra field too long",
|
|
466
|
+
"date not in range 1980-2099",
|
|
467
|
+
"filename too long",
|
|
468
|
+
"stream finishing",
|
|
469
|
+
"invalid zip data"
|
|
470
|
+
// determined by unknown compression method
|
|
471
|
+
], ge = function(e, r, t) {
|
|
472
|
+
var o = new Error(r || Zr[e]);
|
|
473
|
+
if (o.code = e, Error.captureStackTrace && Error.captureStackTrace(o, ge), !t)
|
|
474
|
+
throw o;
|
|
475
|
+
return o;
|
|
476
|
+
}, J = function(e, r, t) {
|
|
477
|
+
t <<= r & 7;
|
|
478
|
+
var o = r / 8 | 0;
|
|
479
|
+
e[o] |= t, e[o + 1] |= t >> 8;
|
|
480
|
+
}, ue = function(e, r, t) {
|
|
481
|
+
t <<= r & 7;
|
|
482
|
+
var o = r / 8 | 0;
|
|
483
|
+
e[o] |= t, e[o + 1] |= t >> 8, e[o + 2] |= t >> 16;
|
|
484
|
+
}, be = function(e, r) {
|
|
485
|
+
for (var t = [], o = 0; o < e.length; ++o)
|
|
486
|
+
e[o] && t.push({ s: o, f: e[o] });
|
|
487
|
+
var a = t.length, n = t.slice();
|
|
488
|
+
if (!a)
|
|
489
|
+
return { t: lr, l: 0 };
|
|
490
|
+
if (a == 1) {
|
|
491
|
+
var l = new q(t[0].s + 1);
|
|
492
|
+
return l[t[0].s] = 1, { t: l, l: 1 };
|
|
493
|
+
}
|
|
494
|
+
t.sort(function(R, p) {
|
|
495
|
+
return R.f - p.f;
|
|
496
|
+
}), t.push({ s: -1, f: 25001 });
|
|
497
|
+
var d = t[0], i = t[1], m = 0, s = 1, u = 2;
|
|
498
|
+
for (t[0] = { s: -1, f: d.f + i.f, l: d, r: i }; s != a - 1; )
|
|
499
|
+
d = t[t[m].f < t[u].f ? m++ : u++], i = t[m != s && t[m].f < t[u].f ? m++ : u++], t[s++] = { s: -1, f: d.f + i.f, l: d, r: i };
|
|
500
|
+
for (var C = n[0].s, o = 1; o < a; ++o)
|
|
501
|
+
n[o].s > C && (C = n[o].s);
|
|
502
|
+
var w = new K(C + 1), v = Ne(t[s - 1], w, 0);
|
|
503
|
+
if (v > r) {
|
|
504
|
+
var o = 0, c = 0, O = v - r, $ = 1 << O;
|
|
505
|
+
for (n.sort(function(p, D) {
|
|
506
|
+
return w[D.s] - w[p.s] || p.f - D.f;
|
|
507
|
+
}); o < a; ++o) {
|
|
508
|
+
var F = n[o].s;
|
|
509
|
+
if (w[F] > r)
|
|
510
|
+
c += $ - (1 << v - w[F]), w[F] = r;
|
|
511
|
+
else
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
for (c >>= O; c > 0; ) {
|
|
515
|
+
var A = n[o].s;
|
|
516
|
+
w[A] < r ? c -= 1 << r - w[A]++ - 1 : ++o;
|
|
517
|
+
}
|
|
518
|
+
for (; o >= 0 && c; --o) {
|
|
519
|
+
var E = n[o].s;
|
|
520
|
+
w[E] == r && (--w[E], ++c);
|
|
521
|
+
}
|
|
522
|
+
v = r;
|
|
523
|
+
}
|
|
524
|
+
return { t: new q(w), l: v };
|
|
525
|
+
}, Ne = function(e, r, t) {
|
|
526
|
+
return e.s == -1 ? Math.max(Ne(e.l, r, t + 1), Ne(e.r, r, t + 1)) : r[e.s] = t;
|
|
527
|
+
}, ze = function(e) {
|
|
528
|
+
for (var r = e.length; r && !e[--r]; )
|
|
529
|
+
;
|
|
530
|
+
for (var t = new K(++r), o = 0, a = e[0], n = 1, l = function(i) {
|
|
531
|
+
t[o++] = i;
|
|
532
|
+
}, d = 1; d <= r; ++d)
|
|
533
|
+
if (e[d] == a && d != r)
|
|
534
|
+
++n;
|
|
535
|
+
else {
|
|
536
|
+
if (!a && n > 2) {
|
|
537
|
+
for (; n > 138; n -= 138)
|
|
538
|
+
l(32754);
|
|
539
|
+
n > 2 && (l(n > 10 ? n - 11 << 5 | 28690 : n - 3 << 5 | 12305), n = 0);
|
|
540
|
+
} else if (n > 3) {
|
|
541
|
+
for (l(a), --n; n > 6; n -= 6)
|
|
542
|
+
l(8304);
|
|
543
|
+
n > 2 && (l(n - 3 << 5 | 8208), n = 0);
|
|
544
|
+
}
|
|
545
|
+
for (; n--; )
|
|
546
|
+
l(a);
|
|
547
|
+
n = 1, a = e[d];
|
|
548
|
+
}
|
|
549
|
+
return { c: t.subarray(0, o), n: r };
|
|
550
|
+
}, fe = function(e, r) {
|
|
551
|
+
for (var t = 0, o = 0; o < r.length; ++o)
|
|
552
|
+
t += e[o] * r[o];
|
|
553
|
+
return t;
|
|
554
|
+
}, nr = function(e, r, t) {
|
|
555
|
+
var o = t.length, a = or(r + 2);
|
|
556
|
+
e[a] = o & 255, e[a + 1] = o >> 8, e[a + 2] = e[a] ^ 255, e[a + 3] = e[a + 1] ^ 255;
|
|
557
|
+
for (var n = 0; n < o; ++n)
|
|
558
|
+
e[a + n + 4] = t[n];
|
|
559
|
+
return (a + 4 + o) * 8;
|
|
560
|
+
}, He = function(e, r, t, o, a, n, l, d, i, m, s) {
|
|
561
|
+
J(r, s++, t), ++a[256];
|
|
562
|
+
for (var u = be(a, 15), C = u.t, w = u.l, v = be(n, 15), c = v.t, O = v.l, $ = ze(C), F = $.c, A = $.n, E = ze(c), R = E.c, p = E.n, D = new K(19), g = 0; g < F.length; ++g)
|
|
563
|
+
++D[F[g] & 31];
|
|
564
|
+
for (var g = 0; g < R.length; ++g)
|
|
565
|
+
++D[R[g] & 31];
|
|
566
|
+
for (var y = be(D, 7), P = y.t, b = y.l, f = 19; f > 4 && !P[je[f - 1]]; --f)
|
|
567
|
+
;
|
|
568
|
+
var x = m + 5 << 3, k = fe(a, te) + fe(n, he) + l, Y = fe(a, C) + fe(n, c) + l + 14 + 3 * f + fe(D, P) + 2 * D[16] + 3 * D[17] + 7 * D[18];
|
|
569
|
+
if (i >= 0 && x <= k && x <= Y)
|
|
570
|
+
return nr(r, s, e.subarray(i, i + m));
|
|
571
|
+
var M, N, V, W;
|
|
572
|
+
if (J(r, s, 1 + (Y < k)), s += 2, Y < k) {
|
|
573
|
+
M = me(C, w, 0), N = C, V = me(c, O, 0), W = c;
|
|
574
|
+
var z = me(P, b, 0);
|
|
575
|
+
J(r, s, A - 257), J(r, s + 5, p - 1), J(r, s + 10, f - 4), s += 14;
|
|
576
|
+
for (var g = 0; g < f; ++g)
|
|
577
|
+
J(r, s + 3 * g, P[je[g]]);
|
|
578
|
+
s += 3 * f;
|
|
579
|
+
for (var Q = [F, R], de = 0; de < 2; ++de)
|
|
580
|
+
for (var oe = Q[de], g = 0; g < oe.length; ++g) {
|
|
581
|
+
var Z = oe[g] & 31;
|
|
582
|
+
J(r, s, z[Z]), s += P[Z], Z > 15 && (J(r, s, oe[g] >> 5 & 127), s += oe[g] >> 12);
|
|
583
|
+
}
|
|
584
|
+
} else
|
|
585
|
+
M = Wr, N = te, V = Qr, W = he;
|
|
586
|
+
for (var g = 0; g < d; ++g) {
|
|
587
|
+
var B = o[g];
|
|
588
|
+
if (B > 255) {
|
|
589
|
+
var Z = B >> 18 & 31;
|
|
590
|
+
ue(r, s, M[Z + 257]), s += N[Z + 257], Z > 7 && (J(r, s, B >> 23 & 31), s += Me[Z]);
|
|
591
|
+
var ae = B & 31;
|
|
592
|
+
ue(r, s, V[ae]), s += W[ae], ae > 3 && (ue(r, s, B >> 5 & 8191), s += Oe[ae]);
|
|
593
|
+
} else
|
|
594
|
+
ue(r, s, M[B]), s += N[B];
|
|
595
|
+
}
|
|
596
|
+
return ue(r, s, M[256]), s + N[256];
|
|
597
|
+
}, Jr = /* @__PURE__ */ new Ae([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), lr = /* @__PURE__ */ new q(0), et = function(e, r, t, o, a, n) {
|
|
598
|
+
var l = n.z || e.length, d = new q(o + l + 5 * (1 + Math.ceil(l / 7e3)) + a), i = d.subarray(o, d.length - a), m = n.l, s = (n.r || 0) & 7;
|
|
599
|
+
if (r) {
|
|
600
|
+
s && (i[0] = n.r >> 3);
|
|
601
|
+
for (var u = Jr[r - 1], C = u >> 13, w = u & 8191, v = (1 << t) - 1, c = n.p || new K(32768), O = n.h || new K(v + 1), $ = Math.ceil(t / 3), F = 2 * $, A = function(Ce) {
|
|
602
|
+
return (e[Ce] ^ e[Ce + 1] << $ ^ e[Ce + 2] << F) & v;
|
|
603
|
+
}, E = new Ae(25e3), R = new K(288), p = new K(32), D = 0, g = 0, y = n.i || 0, P = 0, b = n.w || 0, f = 0; y + 2 < l; ++y) {
|
|
604
|
+
var x = A(y), k = y & 32767, Y = O[x];
|
|
605
|
+
if (c[k] = Y, O[x] = k, b <= y) {
|
|
606
|
+
var M = l - y;
|
|
607
|
+
if ((D > 7e3 || P > 24576) && (M > 423 || !m)) {
|
|
608
|
+
s = He(e, i, 0, E, R, p, g, P, f, y - f, s), P = D = g = 0, f = y;
|
|
609
|
+
for (var N = 0; N < 286; ++N)
|
|
610
|
+
R[N] = 0;
|
|
611
|
+
for (var N = 0; N < 30; ++N)
|
|
612
|
+
p[N] = 0;
|
|
613
|
+
}
|
|
614
|
+
var V = 2, W = 0, z = w, Q = k - Y & 32767;
|
|
615
|
+
if (M > 2 && x == A(y - Q))
|
|
616
|
+
for (var de = Math.min(C, M) - 1, oe = Math.min(32767, y), Z = Math.min(258, M); Q <= oe && --z && k != Y; ) {
|
|
617
|
+
if (e[y + V] == e[y + V - Q]) {
|
|
618
|
+
for (var B = 0; B < Z && e[y + B] == e[y + B - Q]; ++B)
|
|
619
|
+
;
|
|
620
|
+
if (B > V) {
|
|
621
|
+
if (V = B, W = Q, B > de)
|
|
622
|
+
break;
|
|
623
|
+
for (var ae = Math.min(Q, B - 2), Re = 0, N = 0; N < ae; ++N) {
|
|
624
|
+
var xe = y - Q + N & 32767, dr = c[xe], Ue = xe - dr & 32767;
|
|
625
|
+
Ue > Re && (Re = Ue, Y = xe);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
k = Y, Y = c[k], Q += k - Y & 32767;
|
|
630
|
+
}
|
|
631
|
+
if (W) {
|
|
632
|
+
E[P++] = 268435456 | Se[V] << 18 | qe[W];
|
|
633
|
+
var Ye = Se[V] & 31, $e = qe[W] & 31;
|
|
634
|
+
g += Me[Ye] + Oe[$e], ++R[257 + Ye], ++p[$e], b = y + V, ++D;
|
|
635
|
+
} else
|
|
636
|
+
E[P++] = e[y], ++R[e[y]];
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
for (y = Math.max(y, b); y < l; ++y)
|
|
640
|
+
E[P++] = e[y], ++R[e[y]];
|
|
641
|
+
s = He(e, i, m, E, R, p, g, P, f, y - f, s), m || (n.r = s & 7 | i[s / 8 | 0] << 3, s -= 7, n.h = O, n.p = c, n.i = y, n.w = b);
|
|
642
|
+
} else {
|
|
643
|
+
for (var y = n.w || 0; y < l + m; y += 65535) {
|
|
644
|
+
var _e = y + 65535;
|
|
645
|
+
_e >= l && (i[s / 8 | 0] = m, _e = l), s = nr(i, s + 1, e.subarray(y, _e));
|
|
646
|
+
}
|
|
647
|
+
n.i = l;
|
|
648
|
+
}
|
|
649
|
+
return ar(d, 0, o + or(s) + a);
|
|
650
|
+
}, rt = /* @__PURE__ */ function() {
|
|
651
|
+
for (var e = new Int32Array(256), r = 0; r < 256; ++r) {
|
|
652
|
+
for (var t = r, o = 9; --o; )
|
|
653
|
+
t = (t & 1 && -306674912) ^ t >>> 1;
|
|
654
|
+
e[r] = t;
|
|
655
|
+
}
|
|
656
|
+
return e;
|
|
657
|
+
}(), tt = function() {
|
|
658
|
+
var e = -1;
|
|
659
|
+
return {
|
|
660
|
+
p: function(r) {
|
|
661
|
+
for (var t = e, o = 0; o < r.length; ++o)
|
|
662
|
+
t = rt[t & 255 ^ r[o]] ^ t >>> 8;
|
|
663
|
+
e = t;
|
|
664
|
+
},
|
|
665
|
+
d: function() {
|
|
666
|
+
return ~e;
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
}, ot = function(e, r, t, o, a) {
|
|
670
|
+
if (!a && (a = { l: 1 }, r.dictionary)) {
|
|
671
|
+
var n = r.dictionary.subarray(-32768), l = new q(n.length + e.length);
|
|
672
|
+
l.set(n), l.set(e, n.length), e = l, a.w = n.length;
|
|
673
|
+
}
|
|
674
|
+
return et(e, r.level == null ? 6 : r.level, r.mem == null ? a.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(e.length))) * 1.5) : 20 : 12 + r.mem, t, o, a);
|
|
675
|
+
}, sr = function(e, r) {
|
|
676
|
+
var t = {};
|
|
677
|
+
for (var o in e)
|
|
678
|
+
t[o] = e[o];
|
|
679
|
+
for (var o in r)
|
|
680
|
+
t[o] = r[o];
|
|
681
|
+
return t;
|
|
682
|
+
}, L = function(e, r, t) {
|
|
683
|
+
for (; t; ++r)
|
|
684
|
+
e[r] = t, t >>>= 8;
|
|
685
|
+
};
|
|
686
|
+
function at(e, r) {
|
|
687
|
+
return ot(e, r || {}, 0, 0);
|
|
688
|
+
}
|
|
689
|
+
var ir = function(e, r, t, o) {
|
|
690
|
+
for (var a in e) {
|
|
691
|
+
var n = e[a], l = r + a, d = o;
|
|
692
|
+
Array.isArray(n) && (d = sr(o, n[1]), n = n[0]), ArrayBuffer.isView(n) ? t[l] = [n, d] : (t[l += "/"] = [new q(0), d], ir(n, l, t, o));
|
|
693
|
+
}
|
|
694
|
+
}, Ke = typeof TextEncoder < "u" && /* @__PURE__ */ new TextEncoder(), nt = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), lt = 0;
|
|
695
|
+
try {
|
|
696
|
+
nt.decode(lr, { stream: !0 }), lt = 1;
|
|
697
|
+
} catch {
|
|
698
|
+
}
|
|
699
|
+
function ye(e, r) {
|
|
700
|
+
var t;
|
|
701
|
+
if (Ke)
|
|
702
|
+
return Ke.encode(e);
|
|
703
|
+
for (var o = e.length, a = new q(e.length + (e.length >> 1)), n = 0, l = function(m) {
|
|
704
|
+
a[n++] = m;
|
|
705
|
+
}, t = 0; t < o; ++t) {
|
|
706
|
+
if (n + 5 > a.length) {
|
|
707
|
+
var d = new q(n + 8 + (o - t << 1));
|
|
708
|
+
d.set(a), a = d;
|
|
709
|
+
}
|
|
710
|
+
var i = e.charCodeAt(t);
|
|
711
|
+
i < 128 || r ? l(i) : i < 2048 ? (l(192 | i >> 6), l(128 | i & 63)) : i > 55295 && i < 57344 ? (i = 65536 + (i & 1047552) | e.charCodeAt(++t) & 1023, l(240 | i >> 18), l(128 | i >> 12 & 63), l(128 | i >> 6 & 63), l(128 | i & 63)) : (l(224 | i >> 12), l(128 | i >> 6 & 63), l(128 | i & 63));
|
|
712
|
+
}
|
|
713
|
+
return ar(a, 0, n);
|
|
714
|
+
}
|
|
715
|
+
var Fe = function(e) {
|
|
716
|
+
var r = 0;
|
|
717
|
+
if (e)
|
|
718
|
+
for (var t in e) {
|
|
719
|
+
var o = e[t].length;
|
|
720
|
+
o > 65535 && ge(9), r += o + 4;
|
|
721
|
+
}
|
|
722
|
+
return r;
|
|
723
|
+
}, Ge = function(e, r, t, o, a, n, l, d) {
|
|
724
|
+
var i = o.length, m = t.extra, s = d && d.length, u = Fe(m);
|
|
725
|
+
L(e, r, l != null ? 33639248 : 67324752), r += 4, l != null && (e[r++] = 20, e[r++] = t.os), e[r] = 20, r += 2, e[r++] = t.flag << 1 | (n < 0 && 8), e[r++] = a && 8, e[r++] = t.compression & 255, e[r++] = t.compression >> 8;
|
|
726
|
+
var C = new Date(t.mtime == null ? Date.now() : t.mtime), w = C.getFullYear() - 1980;
|
|
727
|
+
if ((w < 0 || w > 119) && ge(10), L(e, r, w << 25 | C.getMonth() + 1 << 21 | C.getDate() << 16 | C.getHours() << 11 | C.getMinutes() << 5 | C.getSeconds() >> 1), r += 4, n != -1 && (L(e, r, t.crc), L(e, r + 4, n < 0 ? -n - 2 : n), L(e, r + 8, t.size)), L(e, r + 12, i), L(e, r + 14, u), r += 16, l != null && (L(e, r, s), L(e, r + 6, t.attrs), L(e, r + 10, l), r += 14), e.set(o, r), r += i, u)
|
|
728
|
+
for (var v in m) {
|
|
729
|
+
var c = m[v], O = c.length;
|
|
730
|
+
L(e, r, +v), L(e, r + 2, O), e.set(c, r + 4), r += 4 + O;
|
|
731
|
+
}
|
|
732
|
+
return s && (e.set(d, r), r += s), r;
|
|
733
|
+
}, st = function(e, r, t, o, a) {
|
|
734
|
+
L(e, r, 101010256), L(e, r + 8, t), L(e, r + 10, t), L(e, r + 12, o), L(e, r + 16, a);
|
|
735
|
+
};
|
|
736
|
+
function it(e, r) {
|
|
737
|
+
r || (r = {});
|
|
738
|
+
var t = {}, o = [];
|
|
739
|
+
ir(e, "", t, r);
|
|
740
|
+
var a = 0, n = 0;
|
|
741
|
+
for (var l in t) {
|
|
742
|
+
var d = t[l], i = d[0], m = d[1], s = m.level == 0 ? 0 : 8, u = ye(l), C = u.length, w = m.comment, v = w && ye(w), c = v && v.length, O = Fe(m.extra);
|
|
743
|
+
C > 65535 && ge(11);
|
|
744
|
+
var $ = s ? at(i, m) : i, F = $.length, A = tt();
|
|
745
|
+
A.p(i), o.push(sr(m, {
|
|
746
|
+
size: i.length,
|
|
747
|
+
crc: A.d(),
|
|
748
|
+
c: $,
|
|
749
|
+
f: u,
|
|
750
|
+
m: v,
|
|
751
|
+
u: C != l.length || v && w.length != c,
|
|
752
|
+
o: a,
|
|
753
|
+
compression: s
|
|
754
|
+
})), a += 30 + C + O + F, n += 76 + 2 * (C + O) + (c || 0) + F;
|
|
755
|
+
}
|
|
756
|
+
for (var E = new q(n + 22), R = a, p = n - a, D = 0; D < o.length; ++D) {
|
|
757
|
+
var u = o[D];
|
|
758
|
+
Ge(E, u.o, u, u.f, u.u, u.c.length);
|
|
759
|
+
var g = 30 + u.f.length + Fe(u.extra);
|
|
760
|
+
E.set(u.c, u.o + g), Ge(E, a, u, u.f, u.u, u.c.length, u.o, u.m), a += 16 + g + (u.m ? u.m.length : 0);
|
|
761
|
+
}
|
|
762
|
+
return st(E, a, o.length, p, R), E;
|
|
763
|
+
}
|
|
764
|
+
function dt(e) {
|
|
765
|
+
return e ? X(e).format("YYYY-MM-DD HH:mm:ss") : null;
|
|
766
|
+
}
|
|
767
|
+
const Te = [
|
|
768
|
+
{
|
|
769
|
+
header: "MAIN_ORDER_ID",
|
|
770
|
+
definition: `Unique identifier for every food court order ID
|
|
771
|
+
When a customer makes a single order from 3 stalls, there will be 1 main food court order ID.`,
|
|
772
|
+
value: (e) => e.mainOrderId
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
header: "SUB_ORDER_ID",
|
|
776
|
+
definition: `Unique identifier for every order created when the main order gets split and distributed to individual stalls.
|
|
777
|
+
If there are 3 stalls, there will be 3 order IDs.`,
|
|
778
|
+
value: (e) => e.subOrderId
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
header: "SHORT_ORDER_ID",
|
|
782
|
+
definition: `Customer-facing order ID for food collection, common across all stalls under the same main food court order ID. This is NOT unique and will be recycled.
|
|
783
|
+
Prefix with FC.`,
|
|
784
|
+
value: (e) => e.shortOrderId
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
header: "INVOICE_NO",
|
|
788
|
+
definition: "Invoice No issued by the food court owner for the main food court order",
|
|
789
|
+
value: (e) => e.invoiceNo
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
header: "SUB_INVOICE_NO",
|
|
793
|
+
definition: "Invoice No issued by individual stalls for the sub food court orders",
|
|
794
|
+
value: (e) => e.subInvoiceNo
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
header: "TRANSACTION_ID",
|
|
798
|
+
definition: "Payment identifier for the transaction",
|
|
799
|
+
value: (e) => e.transactionId
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
header: "GATEWAY_ID",
|
|
803
|
+
definition: "Identifier of the payment gateway used",
|
|
804
|
+
value: (e) => e.gatewayId
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
header: "GATEWAY_NAME",
|
|
808
|
+
definition: "Name of the payment gateway used",
|
|
809
|
+
value: (e) => e.gatewayName
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
header: "PAYMENT_METHOD",
|
|
813
|
+
definition: "Payment method used by the customer",
|
|
814
|
+
value: (e) => e.paymentMethod
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
header: "ORDER_CHANNEL",
|
|
818
|
+
definition: "For identification of whether customer is ordering via kiosk or table QR",
|
|
819
|
+
value: (e) => e.orderChannel
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
header: "TRANSACTION_TIMESTAMP",
|
|
823
|
+
definition: "Payment completion timestamp",
|
|
824
|
+
value: (e) => dt(e.transactionTimestamp)
|
|
825
|
+
},
|
|
826
|
+
{ header: "ORDER_STATUS", definition: "Status of the order", value: (e) => e.orderStatus },
|
|
827
|
+
{
|
|
828
|
+
header: "PAYMENT_STATUS",
|
|
829
|
+
definition: "Payment status of the order",
|
|
830
|
+
value: (e) => e.paymentStatus
|
|
831
|
+
},
|
|
832
|
+
{ header: "CURRENCY", definition: "Currency of the transaction", value: (e) => e.currency },
|
|
833
|
+
{
|
|
834
|
+
header: "GROSS_AMOUNT",
|
|
835
|
+
definition: "Gross amount for the individual stall order",
|
|
836
|
+
value: (e) => e.grossAmount
|
|
837
|
+
},
|
|
838
|
+
{ header: "SST", definition: "SST for the individual stall order", value: (e) => e.sst },
|
|
839
|
+
{
|
|
840
|
+
header: "SERVICE_CHARGE",
|
|
841
|
+
definition: "Service Charge for the individual stall order",
|
|
842
|
+
value: (e) => e.serviceCharge
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
header: "ROUNDING",
|
|
846
|
+
definition: "Rounding for the individual stall order",
|
|
847
|
+
value: (e) => e.rounding
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
header: "DISCOUNT_APPLIED",
|
|
851
|
+
definition: "Discount amount applied for a particular stall order ID",
|
|
852
|
+
value: (e) => e.discountApplied
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
header: "NETT_SALES_AMOUNT",
|
|
856
|
+
definition: "Amount paid by customer for the individual stall order, including all applicable taxes and service charges",
|
|
857
|
+
value: (e) => e.nettSalesAmount
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
header: "TOTAL_SALES_AMOUNT",
|
|
861
|
+
definition: "Grand amount paid by customer for all stalls, including all applicable taxes and service charges",
|
|
862
|
+
value: (e) => e.totalSalesAmount
|
|
863
|
+
},
|
|
864
|
+
{ header: "FC_ID", definition: "Unique identifier of the food court", value: (e) => e.fcId },
|
|
865
|
+
{ header: "FC_NAME", definition: "Name of the food court", value: (e) => e.fcName },
|
|
866
|
+
{
|
|
867
|
+
header: "RESTAURANT_ID",
|
|
868
|
+
definition: "Unique identifier of the restaurant or stall",
|
|
869
|
+
value: (e) => e.restaurantId
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
header: "RESTAURANT_NAME",
|
|
873
|
+
definition: "Name of the restaurant or stall",
|
|
874
|
+
value: (e) => e.restaurantName
|
|
875
|
+
},
|
|
876
|
+
{ header: "FEE", definition: "MDR charged for the transaction", value: (e) => e.fee },
|
|
877
|
+
{
|
|
878
|
+
header: "SETTLEMENT_AMOUNT",
|
|
879
|
+
definition: "Amount settled by FeedMe after deducting fees",
|
|
880
|
+
value: (e) => e.settlementAmount
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
header: "SETTLEMENT_ID",
|
|
884
|
+
definition: "Identifier for a batch settlement to the food court owner. Empty if the settlement ID has yet to be generated.",
|
|
885
|
+
value: (e) => e.settlementId
|
|
886
|
+
}
|
|
887
|
+
];
|
|
888
|
+
function ut(e) {
|
|
889
|
+
return [
|
|
890
|
+
Te.map((r) => r.header),
|
|
891
|
+
Te.map((r) => r.definition),
|
|
892
|
+
...e.map((r) => Te.map((t) => t.value(r)))
|
|
893
|
+
];
|
|
894
|
+
}
|
|
895
|
+
function ft(e, r, t = X()) {
|
|
896
|
+
const o = (e ?? "").replace(/[\\/:*?"<>|]/g, "").trim().replace(/\s+/g, "_") || "Food_Court", a = r.startDate ? X(r.startDate) : t, n = r.endDate ? X(r.endDate) : a;
|
|
897
|
+
return `${o}_${a.format("YYYYMMDD")}-${n.format("YYYYMMDD")}.xlsx`;
|
|
898
|
+
}
|
|
899
|
+
function ct(e) {
|
|
900
|
+
let r = e + 1, t = "";
|
|
901
|
+
for (; r > 0; ) {
|
|
902
|
+
const o = (r - 1) % 26;
|
|
903
|
+
t = String.fromCharCode(65 + o) + t, r = Math.floor((r - 1) / 26);
|
|
904
|
+
}
|
|
905
|
+
return t;
|
|
906
|
+
}
|
|
907
|
+
function mt(e) {
|
|
908
|
+
return e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDFFF]/gu, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
909
|
+
}
|
|
910
|
+
function vt(e) {
|
|
911
|
+
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetData>${e.map((t, o) => {
|
|
912
|
+
const a = (l) => `${ct(l)}${o + 1}`, n = t.map((l, d) => l == null || l === "" ? "" : typeof l == "number" && Number.isFinite(l) ? `<c r="${a(d)}"><v>${l}</v></c>` : `<c r="${a(d)}" t="inlineStr"><is><t xml:space="preserve">${mt(String(l))}</t></is></c>`).join("");
|
|
913
|
+
return `<row r="${o + 1}">${n}</row>`;
|
|
914
|
+
}).join("")}</sheetData></worksheet>`;
|
|
915
|
+
}
|
|
916
|
+
const pt = {
|
|
917
|
+
"[Content_Types].xml": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>',
|
|
918
|
+
"_rels/.rels": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',
|
|
919
|
+
"xl/workbook.xml": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="Orders" sheetId="1" r:id="rId1"/></sheets></workbook>',
|
|
920
|
+
"xl/_rels/workbook.xml.rels": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>',
|
|
921
|
+
// The one default style. Optional in the spec, but some readers expect the part.
|
|
922
|
+
"xl/styles.xml": '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fonts count="1"><font><sz val="11"/><name val="Calibri"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>'
|
|
923
|
+
};
|
|
924
|
+
function ht(e) {
|
|
925
|
+
const r = {};
|
|
926
|
+
for (const [t, o] of Object.entries(pt)) r[t] = ye(o);
|
|
927
|
+
return r["xl/worksheets/sheet1.xml"] = ye(vt(ut(e))), it(r, { level: 6 });
|
|
928
|
+
}
|
|
929
|
+
function yt(e, r) {
|
|
930
|
+
const t = new Blob([ht(r)], {
|
|
931
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
932
|
+
}), o = URL.createObjectURL(t), a = document.createElement("a");
|
|
933
|
+
a.href = o, a.download = e, document.body.appendChild(a), a.click(), a.remove(), setTimeout(() => URL.revokeObjectURL(o), 3e4);
|
|
934
|
+
}
|
|
935
|
+
const gt = { class: "py-[1.5rem] flex flex-col gap-1" }, xt = { class: "px-[1.5rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _t = {
|
|
936
|
+
key: 0,
|
|
937
|
+
class: "px-[1.5rem] fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
938
|
+
}, Ct = {
|
|
939
|
+
key: 1,
|
|
940
|
+
class: "px-[1.5rem] flex flex-col gap-4"
|
|
941
|
+
}, wt = { class: "flex items-center gap-3 flex-wrap" }, bt = {
|
|
942
|
+
key: 0,
|
|
943
|
+
class: "py-4 flex flex-col gap-3 items-start"
|
|
944
|
+
}, Tt = { class: "fm-typo-en-body-md-400" }, It = {
|
|
945
|
+
key: 1,
|
|
946
|
+
class: "text-center py-8 text-fm-color-typo-tertiary fm-typo-en-body-md-400"
|
|
947
|
+
}, Dt = { class: "flex items-center justify-between gap-3 flex-wrap pb-6" }, kt = { class: "flex items-center gap-2" }, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Et = { class: "flex items-center gap-2" }, Nt = { class: "fm-typo-en-body-md-400" }, Xe = "Food Court Order Detail View", Ft = "Food Court Orders View", jt = /* @__PURE__ */ We({
|
|
948
|
+
__name: "FoodCourtOrdersView",
|
|
949
|
+
setup(e) {
|
|
950
|
+
const { t: r } = Qe(), { showError: t, showWarning: o } = Ze(), a = pr(), n = cr(), l = mr(), d = X().format("YYYY-MM-DD"), i = H({
|
|
951
|
+
startDate: d,
|
|
952
|
+
endDate: d
|
|
953
|
+
}), m = H([]), s = H(0), u = H(25), C = H([]), w = H(!1), v = H(!1), c = H(!1), O = ie(
|
|
954
|
+
() => we.map((f) => ({
|
|
955
|
+
label: r(pe[f].labelKey),
|
|
956
|
+
value: f
|
|
957
|
+
}))
|
|
958
|
+
), $ = [10, 25, 50, 100].map((f) => ({ label: String(f), value: f })), F = ie(() => {
|
|
959
|
+
const { startDate: f, endDate: x } = i.value, k = f ? X(f).format("DD MMM YYYY") : "", Y = x ? X(x).format("DD MMM YYYY") : k;
|
|
960
|
+
return k === Y ? k : `${k} - ${Y}`;
|
|
961
|
+
});
|
|
962
|
+
let A = 0;
|
|
963
|
+
async function E() {
|
|
964
|
+
const f = a.value, x = ++A;
|
|
965
|
+
if (c.value = !1, !f) {
|
|
966
|
+
C.value = [], w.value = !1;
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
v.value = !0;
|
|
970
|
+
try {
|
|
971
|
+
const k = await De.listOrders(f, {
|
|
972
|
+
...Ve(i.value),
|
|
973
|
+
status: m.value.length ? m.value : we,
|
|
974
|
+
page: s.value,
|
|
975
|
+
limit: u.value
|
|
976
|
+
});
|
|
977
|
+
if (x !== A) return;
|
|
978
|
+
C.value = k.items, w.value = k.hasMore;
|
|
979
|
+
} catch (k) {
|
|
980
|
+
if (x !== A) return;
|
|
981
|
+
C.value = [], w.value = !1, c.value = !0, t(ke(k));
|
|
982
|
+
} finally {
|
|
983
|
+
x === A && (v.value = !1);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
const R = H(!1);
|
|
987
|
+
async function p() {
|
|
988
|
+
var Y;
|
|
989
|
+
const f = a.value;
|
|
990
|
+
if (!f || R.value) return;
|
|
991
|
+
R.value = !0;
|
|
992
|
+
const x = { ...i.value }, k = m.value.length ? [...m.value] : we;
|
|
993
|
+
try {
|
|
994
|
+
const M = await De.exportOrders(f, { ...Ve(x), status: k });
|
|
995
|
+
if (!M.rows.length) {
|
|
996
|
+
o(r("order.foodCourt.orders.exportEmpty"));
|
|
997
|
+
return;
|
|
998
|
+
}
|
|
999
|
+
yt(ft(M.courtName, x), M.rows), (Y = M.unreadableStalls) != null && Y.length && o(r("order.foodCourt.orders.exportIncomplete", { count: M.unreadableStalls.length }));
|
|
1000
|
+
} catch (M) {
|
|
1001
|
+
const N = M instanceof yr ? M.code : void 0;
|
|
1002
|
+
t(N === "EXPORT_RANGE_TOO_LONG" ? r("order.foodCourt.orders.exportRangeTooLong", { days: 31 }) : N === "EXPORT_TOO_MANY_ROWS" ? r("order.foodCourt.orders.exportTooManyRows", { rows: "50,000" }) : ke(M));
|
|
1003
|
+
} finally {
|
|
1004
|
+
R.value = !1;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
Ie(
|
|
1008
|
+
[a, i, m, u],
|
|
1009
|
+
() => {
|
|
1010
|
+
s.value === 0 ? E() : s.value = 0;
|
|
1011
|
+
},
|
|
1012
|
+
{ deep: !0 }
|
|
1013
|
+
), Ie(s, E), E();
|
|
1014
|
+
const D = ie(
|
|
1015
|
+
() => n.name === Xe && typeof n.params.orderId == "string" ? n.params.orderId : null
|
|
1016
|
+
);
|
|
1017
|
+
function g(f) {
|
|
1018
|
+
l.push({ name: Xe, params: { orderId: f._id }, query: n.query });
|
|
1019
|
+
}
|
|
1020
|
+
function y(f) {
|
|
1021
|
+
g(f.original);
|
|
1022
|
+
}
|
|
1023
|
+
function P() {
|
|
1024
|
+
D.value && l.push({ name: Ft, query: n.query });
|
|
1025
|
+
}
|
|
1026
|
+
const b = ie(() => [
|
|
1027
|
+
{
|
|
1028
|
+
id: "orderNumber",
|
|
1029
|
+
header: () => r("order.foodCourt.orders.columnOrderNo"),
|
|
1030
|
+
cell: ({ row: f }) => f.original.orderNumber ? `#${f.original.orderNumber}` : "-",
|
|
1031
|
+
enableSorting: !1,
|
|
1032
|
+
meta: { width: "120px" }
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
id: "createdAt",
|
|
1036
|
+
header: () => r("order.foodCourt.orders.columnDate"),
|
|
1037
|
+
cell: ({ row: f }) => Je(f.original.paidAt ?? f.original.createdAt),
|
|
1038
|
+
enableSorting: !1
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
id: "stalls",
|
|
1042
|
+
header: () => r("order.foodCourt.orders.columnStalls"),
|
|
1043
|
+
cell: ({ row: f }) => String(f.original.stallCount),
|
|
1044
|
+
enableSorting: !1,
|
|
1045
|
+
meta: { width: "96px" }
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
id: "paymentMethod",
|
|
1049
|
+
header: () => r("order.foodCourt.orders.columnPayment"),
|
|
1050
|
+
cell: ({ row: f }) => f.original.paymentMethod || "-",
|
|
1051
|
+
enableSorting: !1
|
|
1052
|
+
},
|
|
1053
|
+
{
|
|
1054
|
+
id: "total",
|
|
1055
|
+
header: () => r("order.foodCourt.orders.columnTotal"),
|
|
1056
|
+
cell: ({ row: f }) => se(f.original.total),
|
|
1057
|
+
enableSorting: !1
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
id: "status",
|
|
1061
|
+
header: () => r("order.foodCourt.orders.columnStatus"),
|
|
1062
|
+
cell: ({ row: f }) => {
|
|
1063
|
+
const x = pe[f.original.status];
|
|
1064
|
+
return x ? fr(vr.FmChip, { variant: x.variant, label: r(x.labelKey) }) : "-";
|
|
1065
|
+
},
|
|
1066
|
+
enableSorting: !1
|
|
1067
|
+
}
|
|
1068
|
+
]);
|
|
1069
|
+
return (f, x) => {
|
|
1070
|
+
const k = G("FmPageHead"), Y = G("FmChip"), M = G("FmDateRangePicker"), N = G("FmSelect"), V = G("FmButton"), W = G("FmTable");
|
|
1071
|
+
return I(), U(re, null, [
|
|
1072
|
+
_("div", gt, [
|
|
1073
|
+
j(k, {
|
|
1074
|
+
title: h(r)("order.foodCourt.orders.title"),
|
|
1075
|
+
"line-height": 1.7
|
|
1076
|
+
}, null, 8, ["title"]),
|
|
1077
|
+
_("span", xt, T(h(r)("order.foodCourt.orders.subtitle")), 1)
|
|
1078
|
+
]),
|
|
1079
|
+
h(a) ? (I(), U("div", Ct, [
|
|
1080
|
+
_("div", wt, [
|
|
1081
|
+
j(M, {
|
|
1082
|
+
modelValue: i.value,
|
|
1083
|
+
"onUpdate:modelValue": x[0] || (x[0] = (z) => i.value = z),
|
|
1084
|
+
"show-predefined-range": ""
|
|
1085
|
+
}, {
|
|
1086
|
+
"trigger-button": ne(() => [
|
|
1087
|
+
j(Y, {
|
|
1088
|
+
label: F.value,
|
|
1089
|
+
icon: "calendar_today"
|
|
1090
|
+
}, null, 8, ["label"])
|
|
1091
|
+
]),
|
|
1092
|
+
_: 1
|
|
1093
|
+
}, 8, ["modelValue"]),
|
|
1094
|
+
j(N, {
|
|
1095
|
+
modelValue: m.value,
|
|
1096
|
+
"onUpdate:modelValue": x[1] || (x[1] = (z) => m.value = z),
|
|
1097
|
+
class: "min-w-[240px]",
|
|
1098
|
+
multiselect: "",
|
|
1099
|
+
items: O.value,
|
|
1100
|
+
placeholder: h(r)("order.foodCourt.orders.allStatuses")
|
|
1101
|
+
}, null, 8, ["modelValue", "items", "placeholder"]),
|
|
1102
|
+
j(V, {
|
|
1103
|
+
class: "ml-auto",
|
|
1104
|
+
variant: "secondary",
|
|
1105
|
+
"prepend-icon": "download",
|
|
1106
|
+
label: h(r)("order.foodCourt.orders.export"),
|
|
1107
|
+
loading: R.value,
|
|
1108
|
+
onClick: p
|
|
1109
|
+
}, null, 8, ["label", "loading"])
|
|
1110
|
+
]),
|
|
1111
|
+
c.value ? (I(), U("div", bt, [
|
|
1112
|
+
_("span", Tt, T(h(r)("order.foodCourt.orders.loadFailed")), 1),
|
|
1113
|
+
j(V, {
|
|
1114
|
+
variant: "secondary",
|
|
1115
|
+
label: h(r)("order.foodCourt.retry"),
|
|
1116
|
+
onClick: E
|
|
1117
|
+
}, null, 8, ["label"])
|
|
1118
|
+
])) : (I(), U(re, { key: 1 }, [
|
|
1119
|
+
v.value || C.value.length ? (I(), ce(W, {
|
|
1120
|
+
key: 0,
|
|
1121
|
+
"row-data": C.value,
|
|
1122
|
+
"column-defs": b.value,
|
|
1123
|
+
loading: v.value,
|
|
1124
|
+
"hide-footer": !0,
|
|
1125
|
+
"page-size": u.value,
|
|
1126
|
+
"shrink-at": !1,
|
|
1127
|
+
class: "w-full",
|
|
1128
|
+
onRowClick: y
|
|
1129
|
+
}, null, 8, ["row-data", "column-defs", "loading", "page-size"])) : (I(), U("div", It, T(h(r)("order.foodCourt.orders.empty")), 1)),
|
|
1130
|
+
_("div", Dt, [
|
|
1131
|
+
_("div", kt, [
|
|
1132
|
+
_("span", St, T(h(r)("order.foodCourt.orders.perPage")), 1),
|
|
1133
|
+
j(N, {
|
|
1134
|
+
modelValue: u.value,
|
|
1135
|
+
"onUpdate:modelValue": x[2] || (x[2] = (z) => u.value = z),
|
|
1136
|
+
class: "w-[96px]",
|
|
1137
|
+
items: h($)
|
|
1138
|
+
}, null, 8, ["modelValue", "items"])
|
|
1139
|
+
]),
|
|
1140
|
+
_("div", Et, [
|
|
1141
|
+
j(V, {
|
|
1142
|
+
variant: "tertiary",
|
|
1143
|
+
"prepend-icon": "chevron_left",
|
|
1144
|
+
label: h(r)("order.foodCourt.orders.previous"),
|
|
1145
|
+
disabled: v.value || s.value === 0,
|
|
1146
|
+
onClick: x[3] || (x[3] = (z) => s.value -= 1)
|
|
1147
|
+
}, null, 8, ["label", "disabled"]),
|
|
1148
|
+
_("span", Nt, T(h(r)("order.foodCourt.orders.page", { page: s.value + 1 })), 1),
|
|
1149
|
+
j(V, {
|
|
1150
|
+
variant: "tertiary",
|
|
1151
|
+
"append-icon": "chevron_right",
|
|
1152
|
+
label: h(r)("order.foodCourt.orders.next"),
|
|
1153
|
+
disabled: v.value || !w.value,
|
|
1154
|
+
onClick: x[4] || (x[4] = (z) => s.value += 1)
|
|
1155
|
+
}, null, 8, ["label", "disabled"])
|
|
1156
|
+
])
|
|
1157
|
+
])
|
|
1158
|
+
], 64))
|
|
1159
|
+
])) : (I(), U("div", _t, T(h(r)("order.foodCourt.noFoodCourtSelected")), 1)),
|
|
1160
|
+
h(a) ? (I(), ce(Kr, {
|
|
1161
|
+
key: 2,
|
|
1162
|
+
"model-value": !!D.value,
|
|
1163
|
+
"food-court-id": h(a),
|
|
1164
|
+
"order-id": D.value,
|
|
1165
|
+
"onUpdate:modelValue": x[5] || (x[5] = (z) => !z && P())
|
|
1166
|
+
}, null, 8, ["model-value", "food-court-id", "order-id"])) : le("", !0)
|
|
1167
|
+
], 64);
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
export {
|
|
1172
|
+
jt as default
|
|
1173
|
+
};
|