@ancon/wildcat-utils 1.40.15 → 1.40.17
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttendeePreOrderStatus, CheckoutDeliveryStatus, CheckoutStatus, OrderFormat, PreOrderStatus, TicketItemStatus, TicketStatus } from '@ancon/wildcat-types';
|
|
1
|
+
import { AttendeePreOrderStatus, CheckoutDeliveryStatus, CheckoutStatus, OrderFormat, PreOrderCancelInfo, PreOrderStatus, TicketItemStatus, TicketStatus } from '@ancon/wildcat-types';
|
|
2
2
|
declare type CheckoutOrderSummaryItem = {
|
|
3
3
|
ticketItem: {
|
|
4
4
|
status: TicketItemStatus;
|
|
@@ -21,6 +21,7 @@ declare type Options = {
|
|
|
21
21
|
export declare type PreOrderOptions = {
|
|
22
22
|
isHost: boolean;
|
|
23
23
|
preOrderStatus: PreOrderStatus;
|
|
24
|
+
preOrderCancelInfo?: PreOrderCancelInfo | null;
|
|
24
25
|
preOrderAttendeeStatus: AttendeePreOrderStatus;
|
|
25
26
|
};
|
|
26
27
|
/** TODO: Rename to CheckoutOrderStatusTranslation */
|
|
@@ -33,6 +34,7 @@ declare enum TranslationKey {
|
|
|
33
34
|
OrderConfirmedHostWillApproveAndProcess = "orderConfirmedHostWillApproveAndProcess",
|
|
34
35
|
OrderConfirmedRestaurantAdminWillAcceptSoon = "orderConfirmedRestaurantAdminWillAcceptSoon",
|
|
35
36
|
YourOrderHasBeenApprovedByHost = "yourOrderHasBeenApprovedByHost",
|
|
37
|
+
OrderCanceledHostWillApproveAndProcessAgain = "orderCanceledHostWillApproveAndProcessAgain",
|
|
36
38
|
YourOrderIsBeingProcessed = "yourOrderIsBeingProcessed",
|
|
37
39
|
YourOrderWasCancelled = "yourOrderWasCancelled",
|
|
38
40
|
ProcessingPayment = "processingPayment",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),
|
|
2
|
-
The host will approve and process the pre-order.`,message:"Please contact the host if you want to edit your order."}),orderConfirmedRestaurantAdminWillAcceptSoon:()=>({title:`Order
|
|
3
|
-
The restaurant admin will accept your pre-order soon.`}),yourOrderHasBeenApprovedByHost:()=>({title:"Your order has been approved by host!",message:"The restaurant admin will accept and process the pre-order"}),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),A=require("./getCheckoutItemsMappedByTicketItemStatus.js");var C=(e=>(e.OrderConfirmedHostWillApproveAndProcess="orderConfirmedHostWillApproveAndProcess",e.OrderConfirmedRestaurantAdminWillAcceptSoon="orderConfirmedRestaurantAdminWillAcceptSoon",e.YourOrderHasBeenApprovedByHost="yourOrderHasBeenApprovedByHost",e.OrderCanceledHostWillApproveAndProcessAgain="orderCanceledHostWillApproveAndProcessAgain",e.YourOrderIsBeingProcessed="yourOrderIsBeingProcessed",e.YourOrderWasCancelled="yourOrderWasCancelled",e.ProcessingPayment="processingPayment",e.YourOrderIsBeingPrepared="yourOrderIsBeingPrepared",e.YourOrderIsReadyToCollect="yourOrderIsReadyToCollect",e.YourOrderIsBeingDelivered="yourOrderIsBeingDelivered",e.YourOrderHasBeenCompleted="yourOrderHasBeenCompleted",e.YourOrderWillArriveAtYourTable="yourOrderWillArriveAtYourTable",e.ModifiedDeliveryStartTime="modifiedDeliveryStartTime",e.ModifiedPickUpTime="modifiedPickUpTime",e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime="yourOrderHasBeenAcceptedEstimatedDeliveryStartTime",e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime="yourOrderIsBeingPreparedEstimatedDeliveryStartTime",e.YourOrderHasBeenAcceptedEstimatedTime="yourOrderHasBeenAcceptedEstimatedTime",e.YourOrderHasBeenAcceptedPickupTime="yourOrderHasBeenAcceptedPickupTime",e.DeliveryWasCompleted="deliveryWasCompleted",e.OneItemIsReadyToCollect="oneItemIsReadyToCollect",e.MultipleItemsAreReadyToCollect="multipleItemsAreReadyToCollect",e.EnjoyMealWhileOtherItemsBeingPrepared="enjoyMealWhileOtherItemsBeingPrepared",e.ThereWasAnError="thereWasAnError",e.YourOrderReadyToPickupFromLocker="yourOrderReadyToPickupFromLocker",e))(C||{});function v(e){switch(e){case r.CheckoutStatus.Error:return"thereWasAnError";case r.CheckoutStatus.Created:case r.CheckoutStatus.Ready:case r.CheckoutStatus.Processing:case r.CheckoutStatus.Authorized:return"yourOrderIsBeingProcessed";case r.CheckoutStatus.Canceled:return"yourOrderWasCancelled";case r.CheckoutStatus.Received:return"processingPayment";default:return null}}function T(e){switch(e){case r.TicketStatus.Pending:case r.TicketStatus.PendingAccept:return"yourOrderIsBeingProcessed";case r.TicketStatus.Preparing:return"yourOrderIsBeingPrepared";case r.TicketStatus.Ready:return"yourOrderIsReadyToCollect";case r.TicketStatus.Closed:return"yourOrderHasBeenCompleted";case r.TicketStatus.Canceled:return"yourOrderWasCancelled";default:throw new Error(`Unhandled ticket status "${e}" in getTranslationKeyByTicketStatus()`)}}function B(e){const{isHost:o,preOrderStatus:i,preOrderAttendeeStatus:d,preOrderCancelInfo:a}=e;if(d===r.AttendeePreOrderStatus.Confirmed)switch(i){case r.PreOrderStatus.Started:{const{cancelActor:s,canceledAt:t}=a??{};return!!s&&!!t?"orderCanceledHostWillApproveAndProcessAgain":"orderConfirmedHostWillApproveAndProcess"}case r.PreOrderStatus.Waiting:return o?"orderConfirmedRestaurantAdminWillAcceptSoon":"yourOrderHasBeenApprovedByHost"}return null}function I(e,{checkoutStatus:o,ticketStatus:i,customersFetchTableOrders:d}){const a=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,s=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,t=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder;if(a||s||t&&!d)return!1;const n=o!=null,u=i!=null;if(n){const l=o===r.CheckoutStatus.Captured,c=o===r.CheckoutStatus.InProgress;return l||c}if(u){const l=i===r.TicketStatus.Preparing,c=i===r.TicketStatus.Ready;return l||c}return!1}function k(e,{checkoutStatus:o,ticketStatus:i,customersFetchTableOrders:d,pickupTimeUpdated:a,preOrderOptions:s},t){if(t&&I(e,{checkoutStatus:o,ticketStatus:i,customersFetchTableOrders:d})){if(t.ready>0)return t.ready<2?["oneItemIsReadyToCollect"]:["multipleItemsAreReadyToCollect",{count:t.ready}];if(t.done>0&&t.done<t.all)return["enjoyMealWhileOtherItemsBeingPrepared",{count:Math.max(0,t.all-t.done-t.ready)}]}if(i!=null)return[T(i)];if(s&&(o===r.CheckoutStatus.Created||o===r.CheckoutStatus.Authorized)){const f=B(s);if(f)return[f]}const n=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,u=v(o);if(u)return[u];const l=o===r.CheckoutStatus.Captured,c=o===r.CheckoutStatus.InProgress,m=o===r.CheckoutStatus.Done,P=o===r.CheckoutStatus.DeliveryInProgress,h=o===r.CheckoutStatus.ReadyToCollect,p=(e==null?void 0:e.orderFormat)===r.OrderFormat.EatIn,y=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,O=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder,g=(e==null?void 0:e.orderFormat)===r.OrderFormat.BoxPickup;if(l)return O&&!d?["yourOrderWillArriveAtYourTable"]:n?a?["modifiedDeliveryStartTime"]:["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"]:a?["modifiedPickUpTime"]:["yourOrderHasBeenAcceptedPickupTime"];if(c){if(n)return a?["modifiedDeliveryStartTime"]:["yourOrderIsBeingPreparedEstimatedDeliveryStartTime"];if(t&&(p||y)){if(t.ready===t.all)return["yourOrderIsReadyToCollect"];if(t.done===t.all)return["yourOrderHasBeenCompleted"]}if(O){if(t){if(t.ready===t.all)return d?["yourOrderIsReadyToCollect"]:["yourOrderWillArriveAtYourTable"];if(t.done===t.all)return d?["yourOrderHasBeenCompleted"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:d?["yourOrderIsBeingPrepared"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:["yourOrderIsBeingPrepared"]}if(m)return p||y?["yourOrderHasBeenCompleted"]:n?["deliveryWasCompleted"]:["yourOrderHasBeenCompleted"];if(P&&g)switch(e==null?void 0:e.deliveryStatus){case r.CheckoutDeliveryStatus.PickedUp:return["yourOrderHasBeenCompleted"];case r.CheckoutDeliveryStatus.Delivered:return["yourOrderReadyToPickupFromLocker"];default:return["yourOrderIsBeingPrepared"]}if(h)return n?["yourOrderIsBeingDelivered"]:g?["yourOrderReadyToPickupFromLocker"]:["yourOrderIsReadyToCollect"];throw new Error("Could not resolve translation key in getTranslationKey()")}const S={orderConfirmedHostWillApproveAndProcess:()=>({title:`Order confirmed!
|
|
2
|
+
The host will approve and process the pre-order.`,message:"Please contact the host if you want to edit your order."}),orderConfirmedRestaurantAdminWillAcceptSoon:()=>({title:`Order confirmed!
|
|
3
|
+
The restaurant admin will accept your pre-order soon.`}),yourOrderHasBeenApprovedByHost:()=>({title:"Your order has been approved by host!",message:"The restaurant admin will accept and process the pre-order"}),orderCanceledHostWillApproveAndProcessAgain:()=>({title:`Order canceled!
|
|
4
|
+
The host will approve and process the pre-order again.`,message:"Please contact the host if you want to edit your order."}),yourOrderIsBeingProcessed:()=>({title:"Your order is being processed"}),yourOrderWasCancelled:()=>({title:"Your order was canceled",message:"Sorry. Your order could not go through."}),processingPayment:()=>({title:"Processing payment",message:"Please wait while your payment is being processed"}),yourOrderIsBeingPrepared:()=>({title:"Your order is now being prepared!",message:"We will let you know when it is ready for pickup."}),yourOrderIsReadyToCollect:()=>({title:"Your order is ready to be collected!",message:"Please go ahead and show this screen at the collection point"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderHasBeenCompleted:()=>({title:"Enjoy your meal!",message:"Your order has been completed!"}),yourOrderWillArriveAtYourTable:()=>({title:"Your order has been accepted!",message:"It will arrive at your table shortly"}),modifiedDeliveryStartTime:()=>({title:"Your delivery time was modified",message:"Delivery will start at approximately 00:00."}),modifiedPickUpTime:()=>({title:"Your pickup time was modified",message:"Pickup time: 00:00"}),yourOrderHasBeenAcceptedEstimatedDeliveryStartTime:()=>({title:"Your order has been accepted",message:"Estimated delivery start time: 00:00"}),yourOrderIsBeingPreparedEstimatedDeliveryStartTime:()=>({title:"Your order is now being prepared!",message:"Estimated delivery start time: 00:00"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),deliveryWasCompleted:()=>({title:"Your order was completed",message:"Enjoy your meal!"}),oneItemIsReadyToCollect:()=>({title:"One item is ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared item has been successfully issued."}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared items have been successfully issued."}),enjoyMealWhileOtherItemsBeingPrepared:({meta:e})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${e.count} more items are being prepared`}),thereWasAnError:()=>({title:"Checkout error",message:"There was an error with the checkout"}),yourOrderReadyToPickupFromLocker:()=>({title:"Your order is ready to pick up from the locker!"})};function w(e,o){if(o)return;const i=A(e);return{all:i.all.length,ready:i.ready.length,done:i.done.length}}function W(e,o,i=S){const{isSkipTicketStatus:d}=o,a=w((e==null?void 0:e.items)??[],d),[s,t]=k(e,o,a),n=i[s]({key:s,meta:t});if(!n)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[n,s]}exports.TranslationKey=C;exports.default=W;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as A, TicketStatus as l, AttendeePreOrderStatus as I, PreOrderStatus as C } from "@ancon/wildcat-types";
|
|
2
|
+
import T from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
3
|
+
var w = /* @__PURE__ */ ((e) => (e.OrderConfirmedHostWillApproveAndProcess = "orderConfirmedHostWillApproveAndProcess", e.OrderConfirmedRestaurantAdminWillAcceptSoon = "orderConfirmedRestaurantAdminWillAcceptSoon", e.YourOrderHasBeenApprovedByHost = "yourOrderHasBeenApprovedByHost", e.OrderCanceledHostWillApproveAndProcessAgain = "orderCanceledHostWillApproveAndProcessAgain", e.YourOrderIsBeingProcessed = "yourOrderIsBeingProcessed", e.YourOrderWasCancelled = "yourOrderWasCancelled", e.ProcessingPayment = "processingPayment", e.YourOrderIsBeingPrepared = "yourOrderIsBeingPrepared", e.YourOrderIsReadyToCollect = "yourOrderIsReadyToCollect", e.YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered", e.YourOrderHasBeenCompleted = "yourOrderHasBeenCompleted", e.YourOrderWillArriveAtYourTable = "yourOrderWillArriveAtYourTable", e.ModifiedDeliveryStartTime = "modifiedDeliveryStartTime", e.ModifiedPickUpTime = "modifiedPickUpTime", e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime = "yourOrderHasBeenAcceptedEstimatedDeliveryStartTime", e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime = "yourOrderIsBeingPreparedEstimatedDeliveryStartTime", e.YourOrderHasBeenAcceptedEstimatedTime = "yourOrderHasBeenAcceptedEstimatedTime", e.YourOrderHasBeenAcceptedPickupTime = "yourOrderHasBeenAcceptedPickupTime", e.DeliveryWasCompleted = "deliveryWasCompleted", e.OneItemIsReadyToCollect = "oneItemIsReadyToCollect", e.MultipleItemsAreReadyToCollect = "multipleItemsAreReadyToCollect", e.EnjoyMealWhileOtherItemsBeingPrepared = "enjoyMealWhileOtherItemsBeingPrepared", e.ThereWasAnError = "thereWasAnError", e.YourOrderReadyToPickupFromLocker = "yourOrderReadyToPickupFromLocker", e))(w || {});
|
|
4
|
+
function W(e) {
|
|
5
5
|
switch (e) {
|
|
6
6
|
case o.Error:
|
|
7
7
|
return "thereWasAnError";
|
|
@@ -14,24 +14,22 @@ function w(e, t) {
|
|
|
14
14
|
return "yourOrderWasCancelled";
|
|
15
15
|
case o.Received:
|
|
16
16
|
return "processingPayment";
|
|
17
|
-
case o.ReadyToCollect:
|
|
18
|
-
return t ? "yourOrderIsBeingDelivered" : "yourOrderIsReadyToCollect";
|
|
19
17
|
default:
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
|
-
function
|
|
21
|
+
function H(e) {
|
|
24
22
|
switch (e) {
|
|
25
|
-
case
|
|
26
|
-
case
|
|
23
|
+
case l.Pending:
|
|
24
|
+
case l.PendingAccept:
|
|
27
25
|
return "yourOrderIsBeingProcessed";
|
|
28
|
-
case
|
|
26
|
+
case l.Preparing:
|
|
29
27
|
return "yourOrderIsBeingPrepared";
|
|
30
|
-
case
|
|
28
|
+
case l.Ready:
|
|
31
29
|
return "yourOrderIsReadyToCollect";
|
|
32
|
-
case
|
|
30
|
+
case l.Closed:
|
|
33
31
|
return "yourOrderHasBeenCompleted";
|
|
34
|
-
case
|
|
32
|
+
case l.Canceled:
|
|
35
33
|
return "yourOrderWasCancelled";
|
|
36
34
|
default:
|
|
37
35
|
throw new Error(
|
|
@@ -39,44 +37,46 @@ function Y(e) {
|
|
|
39
37
|
);
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
|
-
function
|
|
43
|
-
const { isHost: t, preOrderStatus: i, preOrderAttendeeStatus: d } = e;
|
|
40
|
+
function Y(e) {
|
|
41
|
+
const { isHost: t, preOrderStatus: i, preOrderAttendeeStatus: d, preOrderCancelInfo: n } = e;
|
|
44
42
|
if (d === I.Confirmed)
|
|
45
43
|
switch (i) {
|
|
46
|
-
case
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
case C.Started: {
|
|
45
|
+
const { cancelActor: a, canceledAt: r } = n ?? {};
|
|
46
|
+
return !!a && !!r ? "orderCanceledHostWillApproveAndProcessAgain" : "orderConfirmedHostWillApproveAndProcess";
|
|
47
|
+
}
|
|
48
|
+
case C.Waiting:
|
|
49
49
|
return t ? "orderConfirmedRestaurantAdminWillAcceptSoon" : "yourOrderHasBeenApprovedByHost";
|
|
50
50
|
}
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function k(e, {
|
|
54
54
|
checkoutStatus: t,
|
|
55
55
|
ticketStatus: i,
|
|
56
56
|
customersFetchTableOrders: d
|
|
57
57
|
}) {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
58
|
+
const n = (e == null ? void 0 : e.orderFormat) === c.Delivery, a = (e == null ? void 0 : e.orderFormat) === c.TakeAway, r = (e == null ? void 0 : e.orderFormat) === c.TableOrder;
|
|
59
|
+
if (n || a || r && !d)
|
|
60
60
|
return !1;
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
61
|
+
const s = t != null, y = i != null;
|
|
62
|
+
if (s) {
|
|
63
63
|
const u = t === o.Captured, p = t === o.InProgress;
|
|
64
64
|
return u || p;
|
|
65
65
|
}
|
|
66
66
|
if (y) {
|
|
67
|
-
const u = i ===
|
|
67
|
+
const u = i === l.Preparing, p = i === l.Ready;
|
|
68
68
|
return u || p;
|
|
69
69
|
}
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function R(e, {
|
|
73
73
|
checkoutStatus: t,
|
|
74
74
|
ticketStatus: i,
|
|
75
75
|
customersFetchTableOrders: d,
|
|
76
|
-
pickupTimeUpdated:
|
|
77
|
-
preOrderOptions:
|
|
76
|
+
pickupTimeUpdated: n,
|
|
77
|
+
preOrderOptions: a
|
|
78
78
|
}, r) {
|
|
79
|
-
if (r &&
|
|
79
|
+
if (r && k(e, {
|
|
80
80
|
checkoutStatus: t,
|
|
81
81
|
ticketStatus: i,
|
|
82
82
|
customersFetchTableOrders: d
|
|
@@ -96,30 +96,27 @@ function k(e, {
|
|
|
96
96
|
];
|
|
97
97
|
}
|
|
98
98
|
if (i != null)
|
|
99
|
-
return [
|
|
100
|
-
if (
|
|
101
|
-
const m =
|
|
99
|
+
return [H(i)];
|
|
100
|
+
if (a && (t === o.Created || t === o.Authorized)) {
|
|
101
|
+
const m = Y(a);
|
|
102
102
|
if (m)
|
|
103
103
|
return [m];
|
|
104
104
|
}
|
|
105
|
-
const
|
|
106
|
-
t,
|
|
107
|
-
n
|
|
108
|
-
);
|
|
105
|
+
const s = (e == null ? void 0 : e.orderFormat) === c.Delivery, y = W(t);
|
|
109
106
|
if (y)
|
|
110
107
|
return [y];
|
|
111
|
-
const u = t === o.Captured, p = t === o.InProgress,
|
|
108
|
+
const u = t === o.Captured, p = t === o.InProgress, v = t === o.Done, B = t === o.DeliveryInProgress, h = t === o.ReadyToCollect, f = (e == null ? void 0 : e.orderFormat) === c.EatIn, O = (e == null ? void 0 : e.orderFormat) === c.TakeAway, g = (e == null ? void 0 : e.orderFormat) === c.TableOrder, P = (e == null ? void 0 : e.orderFormat) === c.BoxPickup;
|
|
112
109
|
if (u)
|
|
113
110
|
return g && !d ? [
|
|
114
111
|
"yourOrderWillArriveAtYourTable"
|
|
115
112
|
/* YourOrderWillArriveAtYourTable */
|
|
116
|
-
] :
|
|
113
|
+
] : s ? n ? [
|
|
117
114
|
"modifiedDeliveryStartTime"
|
|
118
115
|
/* ModifiedDeliveryStartTime */
|
|
119
116
|
] : [
|
|
120
117
|
"yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"
|
|
121
118
|
/* YourOrderHasBeenAcceptedEstimatedDeliveryStartTime */
|
|
122
|
-
] :
|
|
119
|
+
] : n ? [
|
|
123
120
|
"modifiedPickUpTime"
|
|
124
121
|
/* ModifiedPickUpTime */
|
|
125
122
|
] : [
|
|
@@ -127,8 +124,8 @@ function k(e, {
|
|
|
127
124
|
/* YourOrderHasBeenAcceptedPickupTime */
|
|
128
125
|
];
|
|
129
126
|
if (p) {
|
|
130
|
-
if (
|
|
131
|
-
return
|
|
127
|
+
if (s)
|
|
128
|
+
return n ? [
|
|
132
129
|
"modifiedDeliveryStartTime"
|
|
133
130
|
/* ModifiedDeliveryStartTime */
|
|
134
131
|
] : [
|
|
@@ -166,7 +163,7 @@ function k(e, {
|
|
|
166
163
|
/* YourOrderWillArriveAtYourTable */
|
|
167
164
|
];
|
|
168
165
|
}
|
|
169
|
-
return
|
|
166
|
+
return n ? [
|
|
170
167
|
"modifiedPickUpTime"
|
|
171
168
|
/* ModifiedPickUpTime */
|
|
172
169
|
] : d ? [
|
|
@@ -177,7 +174,7 @@ function k(e, {
|
|
|
177
174
|
/* YourOrderWillArriveAtYourTable */
|
|
178
175
|
];
|
|
179
176
|
}
|
|
180
|
-
return
|
|
177
|
+
return n ? [
|
|
181
178
|
"modifiedPickUpTime"
|
|
182
179
|
/* ModifiedPickUpTime */
|
|
183
180
|
] : [
|
|
@@ -185,41 +182,67 @@ function k(e, {
|
|
|
185
182
|
/* YourOrderIsBeingPrepared */
|
|
186
183
|
];
|
|
187
184
|
}
|
|
188
|
-
if (
|
|
185
|
+
if (v)
|
|
189
186
|
return f || O ? [
|
|
190
187
|
"yourOrderHasBeenCompleted"
|
|
191
188
|
/* YourOrderHasBeenCompleted */
|
|
192
|
-
] :
|
|
189
|
+
] : s ? [
|
|
193
190
|
"deliveryWasCompleted"
|
|
194
191
|
/* DeliveryWasCompleted */
|
|
195
192
|
] : [
|
|
196
193
|
"yourOrderHasBeenCompleted"
|
|
197
194
|
/* YourOrderHasBeenCompleted */
|
|
198
195
|
];
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
196
|
+
if (B && P)
|
|
197
|
+
switch (e == null ? void 0 : e.deliveryStatus) {
|
|
198
|
+
case A.PickedUp:
|
|
199
|
+
return [
|
|
200
|
+
"yourOrderHasBeenCompleted"
|
|
201
|
+
/* YourOrderHasBeenCompleted */
|
|
202
|
+
];
|
|
203
|
+
case A.Delivered:
|
|
204
|
+
return [
|
|
205
|
+
"yourOrderReadyToPickupFromLocker"
|
|
206
|
+
/* YourOrderReadyToPickupFromLocker */
|
|
207
|
+
];
|
|
208
|
+
default:
|
|
209
|
+
return [
|
|
210
|
+
"yourOrderIsBeingPrepared"
|
|
211
|
+
/* YourOrderIsBeingPrepared */
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
if (h)
|
|
215
|
+
return s ? [
|
|
216
|
+
"yourOrderIsBeingDelivered"
|
|
217
|
+
/* YourOrderIsBeingDelivered */
|
|
218
|
+
] : P ? [
|
|
204
219
|
"yourOrderReadyToPickupFromLocker"
|
|
205
220
|
/* YourOrderReadyToPickupFromLocker */
|
|
221
|
+
] : [
|
|
222
|
+
"yourOrderIsReadyToCollect"
|
|
223
|
+
/* YourOrderIsReadyToCollect */
|
|
206
224
|
];
|
|
207
225
|
throw new Error("Could not resolve translation key in getTranslationKey()");
|
|
208
226
|
}
|
|
209
227
|
const D = {
|
|
210
228
|
orderConfirmedHostWillApproveAndProcess: () => ({
|
|
211
|
-
title: `Order
|
|
229
|
+
title: `Order confirmed!
|
|
212
230
|
The host will approve and process the pre-order.`,
|
|
213
231
|
message: "Please contact the host if you want to edit your order."
|
|
214
232
|
}),
|
|
215
233
|
orderConfirmedRestaurantAdminWillAcceptSoon: () => ({
|
|
216
|
-
title: `Order
|
|
234
|
+
title: `Order confirmed!
|
|
217
235
|
The restaurant admin will accept your pre-order soon.`
|
|
218
236
|
}),
|
|
219
237
|
yourOrderHasBeenApprovedByHost: () => ({
|
|
220
238
|
title: "Your order has been approved by host!",
|
|
221
239
|
message: "The restaurant admin will accept and process the pre-order"
|
|
222
240
|
}),
|
|
241
|
+
orderCanceledHostWillApproveAndProcessAgain: () => ({
|
|
242
|
+
title: `Order canceled!
|
|
243
|
+
The host will approve and process the pre-order again.`,
|
|
244
|
+
message: "Please contact the host if you want to edit your order."
|
|
245
|
+
}),
|
|
223
246
|
yourOrderIsBeingProcessed: () => ({
|
|
224
247
|
title: "Your order is being processed"
|
|
225
248
|
}),
|
|
@@ -299,26 +322,26 @@ The restaurant admin will accept your pre-order soon.`
|
|
|
299
322
|
title: "Your order is ready to pick up from the locker!"
|
|
300
323
|
})
|
|
301
324
|
};
|
|
302
|
-
function
|
|
325
|
+
function E(e, t) {
|
|
303
326
|
if (t)
|
|
304
327
|
return;
|
|
305
|
-
const i =
|
|
328
|
+
const i = T(e);
|
|
306
329
|
return {
|
|
307
330
|
all: i.all.length,
|
|
308
331
|
ready: i.ready.length,
|
|
309
332
|
done: i.done.length
|
|
310
333
|
};
|
|
311
334
|
}
|
|
312
|
-
function
|
|
313
|
-
const { isSkipTicketStatus: d } = t,
|
|
335
|
+
function F(e, t, i = D) {
|
|
336
|
+
const { isSkipTicketStatus: d } = t, n = E(
|
|
314
337
|
(e == null ? void 0 : e.items) ?? [],
|
|
315
338
|
d
|
|
316
|
-
), [
|
|
317
|
-
if (!
|
|
339
|
+
), [a, r] = R(e, t, n), s = i[a]({ key: a, meta: r });
|
|
340
|
+
if (!s)
|
|
318
341
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
319
|
-
return [
|
|
342
|
+
return [s, a];
|
|
320
343
|
}
|
|
321
344
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
345
|
+
w as TranslationKey,
|
|
346
|
+
F as default
|
|
324
347
|
};
|