@ancon/wildcat-utils 1.40.14 → 1.40.16
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.
|
@@ -7,6 +7,7 @@ declare type CheckoutOrderSummaryItem = {
|
|
|
7
7
|
declare type CheckoutSummary = {
|
|
8
8
|
orderFormat: OrderFormat;
|
|
9
9
|
items: CheckoutOrderSummaryItem[];
|
|
10
|
+
deliveryStatus?: CheckoutDeliveryStatus;
|
|
10
11
|
};
|
|
11
12
|
declare type Options = {
|
|
12
13
|
/** Only relevant for table order */
|
|
@@ -16,7 +17,6 @@ declare type Options = {
|
|
|
16
17
|
checkoutStatus?: CheckoutStatus;
|
|
17
18
|
ticketStatus?: TicketStatus;
|
|
18
19
|
preOrderOptions?: PreOrderOptions;
|
|
19
|
-
deliveryStatus?: CheckoutDeliveryStatus;
|
|
20
20
|
};
|
|
21
21
|
export declare type PreOrderOptions = {
|
|
22
22
|
isHost: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),v=require("./getCheckoutItemsMappedByTicketItemStatus.js");var
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),v=require("./getCheckoutItemsMappedByTicketItemStatus.js");var C=(e=>(e.OrderConfirmedHostWillApproveAndProcess="orderConfirmedHostWillApproveAndProcess",e.OrderConfirmedRestaurantAdminWillAcceptSoon="orderConfirmedRestaurantAdminWillAcceptSoon",e.YourOrderHasBeenApprovedByHost="yourOrderHasBeenApprovedByHost",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 T(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 B(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 A(e){const{isHost:o,preOrderStatus:i,preOrderAttendeeStatus:d}=e;if(d===r.AttendeePreOrderStatus.Confirmed)switch(i){case r.PreOrderStatus.Started:return"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,n=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,t=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder;if(a||n||t&&!d)return!1;const s=o!=null,c=i!=null;if(s){const l=o===r.CheckoutStatus.Captured,u=o===r.CheckoutStatus.InProgress;return l||u}if(c){const l=i===r.TicketStatus.Preparing,u=i===r.TicketStatus.Ready;return l||u}return!1}function k(e,{checkoutStatus:o,ticketStatus:i,customersFetchTableOrders:d,pickupTimeUpdated:a,preOrderOptions:n},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[B(i)];if(n&&(o===r.CheckoutStatus.Created||o===r.CheckoutStatus.Authorized)){const g=A(n);if(g)return[g]}const s=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,c=T(o);if(c)return[c];const l=o===r.CheckoutStatus.Captured,u=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,f=(e==null?void 0:e.orderFormat)===r.OrderFormat.BoxPickup;if(l)return O&&!d?["yourOrderWillArriveAtYourTable"]:s?a?["modifiedDeliveryStartTime"]:["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"]:a?["modifiedPickUpTime"]:["yourOrderHasBeenAcceptedPickupTime"];if(u){if(s)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"]:s?["deliveryWasCompleted"]:["yourOrderHasBeenCompleted"];if(P&&f)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 s?["yourOrderIsBeingDelivered"]:f?["yourOrderReadyToPickupFromLocker"]:["yourOrderIsReadyToCollect"];throw new Error("Could not resolve translation key in getTranslationKey()")}const S={orderConfirmedHostWillApproveAndProcess:()=>({title:`Order Confirmed!
|
|
2
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"}),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=v(e);return{all:i.all.length,ready:i.ready.length,done:i.done.length}}function Y(e,o,i=S){const{isSkipTicketStatus:d}=o,a=w((e==null?void 0:e.items)??[],d),[
|
|
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"}),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=v(e);return{all:i.all.length,ready:i.ready.length,done:i.done.length}}function Y(e,o,i=S){const{isSkipTicketStatus:d}=o,a=w((e==null?void 0:e.items)??[],d),[n,t]=k(e,o,a),s=i[n]({key:n,meta:t});if(!s)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[s,n]}exports.TranslationKey=C;exports.default=Y;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CheckoutStatus as o, OrderFormat as
|
|
1
|
+
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as C, TicketStatus as s, AttendeePreOrderStatus as h, PreOrderStatus as B } from "@ancon/wildcat-types";
|
|
2
2
|
import T from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
3
3
|
var w = /* @__PURE__ */ ((e) => (e.OrderConfirmedHostWillApproveAndProcess = "orderConfirmedHostWillApproveAndProcess", e.OrderConfirmedRestaurantAdminWillAcceptSoon = "orderConfirmedRestaurantAdminWillAcceptSoon", e.YourOrderHasBeenApprovedByHost = "yourOrderHasBeenApprovedByHost", 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 Y(e
|
|
4
|
+
function Y(e) {
|
|
5
5
|
switch (e) {
|
|
6
6
|
case o.Error:
|
|
7
7
|
return "thereWasAnError";
|
|
@@ -14,8 +14,6 @@ function Y(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
|
}
|
|
@@ -43,9 +41,9 @@ function H(e) {
|
|
|
43
41
|
const { isHost: t, preOrderStatus: i, preOrderAttendeeStatus: d } = e;
|
|
44
42
|
if (d === h.Confirmed)
|
|
45
43
|
switch (i) {
|
|
46
|
-
case
|
|
44
|
+
case B.Started:
|
|
47
45
|
return "orderConfirmedHostWillApproveAndProcess";
|
|
48
|
-
case
|
|
46
|
+
case B.Waiting:
|
|
49
47
|
return t ? "orderConfirmedRestaurantAdminWillAcceptSoon" : "yourOrderHasBeenApprovedByHost";
|
|
50
48
|
}
|
|
51
49
|
return null;
|
|
@@ -55,27 +53,26 @@ function k(e, {
|
|
|
55
53
|
ticketStatus: i,
|
|
56
54
|
customersFetchTableOrders: d
|
|
57
55
|
}) {
|
|
58
|
-
const a = (e == null ? void 0 : e.orderFormat) ===
|
|
59
|
-
if (a ||
|
|
56
|
+
const a = (e == null ? void 0 : e.orderFormat) === c.Delivery, l = (e == null ? void 0 : e.orderFormat) === c.TakeAway, r = (e == null ? void 0 : e.orderFormat) === c.TableOrder;
|
|
57
|
+
if (a || l || r && !d)
|
|
60
58
|
return !1;
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
return
|
|
59
|
+
const n = t != null, y = i != null;
|
|
60
|
+
if (n) {
|
|
61
|
+
const u = t === o.Captured, p = t === o.InProgress;
|
|
62
|
+
return u || p;
|
|
65
63
|
}
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
return
|
|
64
|
+
if (y) {
|
|
65
|
+
const u = i === s.Preparing, p = i === s.Ready;
|
|
66
|
+
return u || p;
|
|
69
67
|
}
|
|
70
68
|
return !1;
|
|
71
69
|
}
|
|
72
|
-
function
|
|
70
|
+
function R(e, {
|
|
73
71
|
checkoutStatus: t,
|
|
74
72
|
ticketStatus: i,
|
|
75
73
|
customersFetchTableOrders: d,
|
|
76
74
|
pickupTimeUpdated: a,
|
|
77
|
-
preOrderOptions:
|
|
78
|
-
deliveryStatus: u
|
|
75
|
+
preOrderOptions: l
|
|
79
76
|
}, r) {
|
|
80
77
|
if (r && k(e, {
|
|
81
78
|
checkoutStatus: t,
|
|
@@ -98,23 +95,22 @@ function D(e, {
|
|
|
98
95
|
}
|
|
99
96
|
if (i != null)
|
|
100
97
|
return [W(i)];
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
return [
|
|
98
|
+
if (l && (t === o.Created || t === o.Authorized)) {
|
|
99
|
+
const P = H(l);
|
|
100
|
+
if (P)
|
|
101
|
+
return [P];
|
|
105
102
|
}
|
|
106
|
-
const
|
|
107
|
-
t
|
|
108
|
-
c
|
|
103
|
+
const n = (e == null ? void 0 : e.orderFormat) === c.Delivery, y = Y(
|
|
104
|
+
t
|
|
109
105
|
);
|
|
110
|
-
if (p)
|
|
111
|
-
return [p];
|
|
112
|
-
const y = t === o.Captured, A = t === o.InProgress, B = t === o.Done, v = t === o.DeliveryInProgress, f = (e == null ? void 0 : e.orderFormat) === l.EatIn, g = (e == null ? void 0 : e.orderFormat) === l.TakeAway, m = (e == null ? void 0 : e.orderFormat) === l.TableOrder, I = (e == null ? void 0 : e.orderFormat) === l.BoxPickup;
|
|
113
106
|
if (y)
|
|
114
|
-
return
|
|
107
|
+
return [y];
|
|
108
|
+
const u = t === o.Captured, p = t === o.InProgress, v = t === o.Done, A = t === o.DeliveryInProgress, I = 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, m = (e == null ? void 0 : e.orderFormat) === c.BoxPickup;
|
|
109
|
+
if (u)
|
|
110
|
+
return g && !d ? [
|
|
115
111
|
"yourOrderWillArriveAtYourTable"
|
|
116
112
|
/* YourOrderWillArriveAtYourTable */
|
|
117
|
-
] :
|
|
113
|
+
] : n ? a ? [
|
|
118
114
|
"modifiedDeliveryStartTime"
|
|
119
115
|
/* ModifiedDeliveryStartTime */
|
|
120
116
|
] : [
|
|
@@ -127,8 +123,8 @@ function D(e, {
|
|
|
127
123
|
"yourOrderHasBeenAcceptedPickupTime"
|
|
128
124
|
/* YourOrderHasBeenAcceptedPickupTime */
|
|
129
125
|
];
|
|
130
|
-
if (
|
|
131
|
-
if (
|
|
126
|
+
if (p) {
|
|
127
|
+
if (n)
|
|
132
128
|
return a ? [
|
|
133
129
|
"modifiedDeliveryStartTime"
|
|
134
130
|
/* ModifiedDeliveryStartTime */
|
|
@@ -136,7 +132,7 @@ function D(e, {
|
|
|
136
132
|
"yourOrderIsBeingPreparedEstimatedDeliveryStartTime"
|
|
137
133
|
/* YourOrderIsBeingPreparedEstimatedDeliveryStartTime */
|
|
138
134
|
];
|
|
139
|
-
if (r && (f ||
|
|
135
|
+
if (r && (f || O)) {
|
|
140
136
|
if (r.ready === r.all)
|
|
141
137
|
return [
|
|
142
138
|
"yourOrderIsReadyToCollect"
|
|
@@ -148,7 +144,7 @@ function D(e, {
|
|
|
148
144
|
/* YourOrderHasBeenCompleted */
|
|
149
145
|
];
|
|
150
146
|
}
|
|
151
|
-
if (
|
|
147
|
+
if (g) {
|
|
152
148
|
if (r) {
|
|
153
149
|
if (r.ready === r.all)
|
|
154
150
|
return d ? [
|
|
@@ -186,32 +182,49 @@ function D(e, {
|
|
|
186
182
|
/* YourOrderIsBeingPrepared */
|
|
187
183
|
];
|
|
188
184
|
}
|
|
189
|
-
if (
|
|
190
|
-
return f ||
|
|
185
|
+
if (v)
|
|
186
|
+
return f || O ? [
|
|
191
187
|
"yourOrderHasBeenCompleted"
|
|
192
188
|
/* YourOrderHasBeenCompleted */
|
|
193
|
-
] :
|
|
189
|
+
] : n ? [
|
|
194
190
|
"deliveryWasCompleted"
|
|
195
191
|
/* DeliveryWasCompleted */
|
|
196
192
|
] : [
|
|
197
193
|
"yourOrderHasBeenCompleted"
|
|
198
194
|
/* YourOrderHasBeenCompleted */
|
|
199
195
|
];
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
196
|
+
if (A && m)
|
|
197
|
+
switch (e == null ? void 0 : e.deliveryStatus) {
|
|
198
|
+
case C.PickedUp:
|
|
199
|
+
return [
|
|
200
|
+
"yourOrderHasBeenCompleted"
|
|
201
|
+
/* YourOrderHasBeenCompleted */
|
|
202
|
+
];
|
|
203
|
+
case C.Delivered:
|
|
204
|
+
return [
|
|
205
|
+
"yourOrderReadyToPickupFromLocker"
|
|
206
|
+
/* YourOrderReadyToPickupFromLocker */
|
|
207
|
+
];
|
|
208
|
+
default:
|
|
209
|
+
return [
|
|
210
|
+
"yourOrderIsBeingPrepared"
|
|
211
|
+
/* YourOrderIsBeingPrepared */
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
if (I)
|
|
215
|
+
return n ? [
|
|
216
|
+
"yourOrderIsBeingDelivered"
|
|
217
|
+
/* YourOrderIsBeingDelivered */
|
|
218
|
+
] : m ? [
|
|
219
|
+
"yourOrderReadyToPickupFromLocker"
|
|
220
|
+
/* YourOrderReadyToPickupFromLocker */
|
|
221
|
+
] : [
|
|
222
|
+
"yourOrderIsReadyToCollect"
|
|
223
|
+
/* YourOrderIsReadyToCollect */
|
|
224
|
+
];
|
|
212
225
|
throw new Error("Could not resolve translation key in getTranslationKey()");
|
|
213
226
|
}
|
|
214
|
-
const
|
|
227
|
+
const D = {
|
|
215
228
|
orderConfirmedHostWillApproveAndProcess: () => ({
|
|
216
229
|
title: `Order Confirmed!
|
|
217
230
|
The host will approve and process the pre-order.`,
|
|
@@ -314,16 +327,16 @@ function E(e, t) {
|
|
|
314
327
|
done: i.done.length
|
|
315
328
|
};
|
|
316
329
|
}
|
|
317
|
-
function
|
|
330
|
+
function F(e, t, i = D) {
|
|
318
331
|
const { isSkipTicketStatus: d } = t, a = E(
|
|
319
332
|
(e == null ? void 0 : e.items) ?? [],
|
|
320
333
|
d
|
|
321
|
-
), [
|
|
322
|
-
if (!
|
|
334
|
+
), [l, r] = R(e, t, a), n = i[l]({ key: l, meta: r });
|
|
335
|
+
if (!n)
|
|
323
336
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
324
|
-
return [
|
|
337
|
+
return [n, l];
|
|
325
338
|
}
|
|
326
339
|
export {
|
|
327
340
|
w as TranslationKey,
|
|
328
|
-
|
|
341
|
+
F as default
|
|
329
342
|
};
|