@ancon/wildcat-utils 1.43.7 → 1.44.0-r13-2.2
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/_baseIsEqual-12d01a44.mjs +169 -0
- package/_baseIsEqual-bcac9024.js +1 -0
- package/_baseIteratee-075c204c.js +1 -0
- package/_baseIteratee-4c4d0995.mjs +97 -0
- package/_baseSlice-4d543985.mjs +10 -0
- package/_baseSlice-e1b41ceb.js +1 -0
- package/_getTag-4e44633b.mjs +382 -0
- package/_getTag-b8923c48.js +1 -0
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +7 -5
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +55 -53
- package/checkout/isCheckoutItemsAreEqual.js +1 -1
- package/checkout/isCheckoutItemsAreEqual.mjs +14 -13
- package/date/createLocalTimezoneDate.d.ts +8 -0
- package/date/createLocalTimezoneDate.js +1 -0
- package/date/createLocalTimezoneDate.mjs +8 -0
- package/date/createLocalTimezoneMoment.d.ts +9 -0
- package/date/createLocalTimezoneMoment.js +1 -0
- package/date/createLocalTimezoneMoment.mjs +8 -0
- package/date/getFormattedUTCDateTime.d.ts +10 -0
- package/date/getFormattedUTCDateTime.js +1 -0
- package/date/getFormattedUTCDateTime.mjs +8 -0
- package/date/index.d.ts +4 -0
- package/date/index.js +1 -0
- package/date/index.mjs +9 -0
- package/hangfire/createHangfirePoller.d.ts +8 -2
- package/hangfire/createHangfirePoller.js +1 -1
- package/hangfire/createHangfirePoller.mjs +72 -62
- package/hangfire/createMakeHangfireRequest.d.ts +10 -1
- package/hangfire/createMakeHangfireRequest.js +1 -1
- package/hangfire/createMakeHangfireRequest.mjs +16 -14
- package/identity-1bae7cf8.js +1 -0
- package/identity-6eafe87b.mjs +64 -0
- package/index.d.ts +2 -0
- package/index.js +1 -1
- package/index.mjs +80 -58
- package/logger/index.js +1 -1
- package/logger/index.mjs +8 -7
- package/logger/pascalCaseFormatter.js +1 -1
- package/logger/pascalCaseFormatter.mjs +21 -27
- package/order/getCheckOrderItemsMappedByTicketItemStatus.js +1 -1
- package/order/getCheckOrderItemsMappedByTicketItemStatus.mjs +15 -13
- package/order/getCheckOrderMinimumStatusTicketItem.js +1 -1
- package/order/getCheckOrderMinimumStatusTicketItem.mjs +19 -17
- package/order/index.js +1 -1
- package/order/index.mjs +11 -9
- package/outlet/getExpressAvailableOrderFormats.js +1 -1
- package/outlet/getExpressAvailableOrderFormats.mjs +27 -26
- package/outlet/getExpressNextAvailabilityShiftTime.d.ts +2 -2
- package/outlet/getExpressNextAvailabilityShiftTime.js +1 -1
- package/outlet/getExpressNextAvailabilityShiftTime.mjs +19 -18
- package/outlet/getExpressServiceIntervalEnd.d.ts +2 -2
- package/outlet/getExpressServiceIntervalEnd.js +1 -1
- package/outlet/getExpressServiceIntervalEnd.mjs +7 -9
- package/outlet/getExpressServiceIntervalStart.d.ts +2 -2
- package/outlet/getExpressServiceIntervalStart.js +1 -1
- package/outlet/getExpressServiceIntervalStart.mjs +7 -9
- package/outlet/getListOutletOpeningHoursTable.d.ts +1 -1
- package/outlet/getListOutletOpeningHoursTable.js +1 -1
- package/outlet/getListOutletOpeningHoursTable.mjs +135 -150
- package/outlet/getMomentFromDateAndTimeString.js +1 -1
- package/outlet/getMomentFromDateAndTimeString.mjs +1 -1
- package/outlet/getOutletActiveOpeningInterval.d.ts +2 -2
- package/outlet/getOutletActiveOpeningInterval.js +1 -1
- package/outlet/getOutletActiveOpeningInterval.mjs +15 -12
- package/outlet/getOutletAvailabilityInfo.js +1 -1
- package/outlet/getOutletAvailabilityInfo.mjs +23 -25
- package/outlet/getOutletCurrentActiveOperatingHour.js +1 -1
- package/outlet/getOutletCurrentActiveOperatingHour.mjs +16 -15
- package/outlet/getOutletCurrentAvailabilityInfo.js +1 -1
- package/outlet/getOutletCurrentAvailabilityInfo.mjs +27 -26
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +14 -10
- package/outlet/getOutletDeliveryFee.js +1 -1
- package/outlet/getOutletDeliveryFee.mjs +5 -5
- package/outlet/getOutletFormattedAddress.d.ts +9 -1
- package/outlet/getOutletFormattedAddress.js +1 -1
- package/outlet/getOutletFormattedAddress.mjs +9 -4
- package/outlet/getOutletNextOpeningTagInformation.js +1 -1
- package/outlet/getOutletNextOpeningTagInformation.mjs +8 -7
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +10 -8
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +11 -11
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +33 -34
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +4 -3
- package/outlet/getOutletTagInformation.d.ts +1 -1
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +69 -70
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +43 -39
- package/outlet/getPartitionedOutletsList.js +1 -1
- package/outlet/getPartitionedOutletsList.mjs +4 -4
- package/outlet/getPickerIntervalsForDay.js +1 -1
- package/outlet/getPickerIntervalsForDay.mjs +20 -12
- package/outlet/getServiceIntervalEnd.d.ts +1 -1
- package/outlet/getServiceIntervalEnd.js +1 -1
- package/outlet/getServiceIntervalEnd.mjs +12 -10
- package/outlet/getServiceIntervalRange.d.ts +1 -2
- package/outlet/getServiceIntervalRange.js +1 -1
- package/outlet/getServiceIntervalRange.mjs +8 -12
- package/outlet/getServiceIntervalStart.d.ts +1 -1
- package/outlet/getServiceIntervalStart.js +1 -1
- package/outlet/getServiceIntervalStart.mjs +6 -7
- package/outlet/getServiceIntervalsForOrderFormat.d.ts +7 -8
- package/outlet/getStructuredOutletAddress.js +1 -1
- package/outlet/getStructuredOutletAddress.mjs +7 -7
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +73 -68
- package/outlet/searchNextOpeningMoment.d.ts +1 -1
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +49 -56
- package/outlet/serviceDateTimesFromOpeningHours.d.ts +3 -5
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +342 -27
- package/outlet/types.d.ts +0 -2
- package/package.json +21 -1
- package/time/getEndTimeSpanOfTimePeriod.js +1 -1
- package/time/getEndTimeSpanOfTimePeriod.mjs +5 -9
- package/{toString-e631a957.mjs → toString-3b91b335.mjs} +12 -11
- package/toString-9eae9442.js +1 -0
- package/_baseIsEqual-39cef2eb.mjs +0 -530
- package/_baseIsEqual-b3df9240.js +0 -1
- package/_baseIteratee-13e892b8.mjs +0 -151
- package/_baseIteratee-be26bb18.js +0 -1
- package/toString-425512fc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OpeningHoursInterval, OrderFormat } from '@ancon/wildcat-types';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
3
|
/**
|
|
4
4
|
* Get the active opening interval for the given outlet opening hours, date and order format
|
|
@@ -8,4 +8,4 @@ import { Moment } from 'moment';
|
|
|
8
8
|
* @param orderFormat - The order format to check
|
|
9
9
|
* @returns The active opening interval or undefined if no interval is active for the given date and order format
|
|
10
10
|
*/
|
|
11
|
-
export default function getOutletActiveOpeningInterval(date: Moment, openingHours:
|
|
11
|
+
export default function getOutletActiveOpeningInterval(date: Moment, openingHours: OpeningHoursInterval[], orderFormat: OrderFormat): OpeningHoursInterval | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";const n=require("@ancon/wildcat-types"),f=require("../shared/constants.js"),p=require("../date/createLocalTimezoneMoment.js");require("moment");function y(r,c,i){const a=c.reduce((t,e)=>{if((e.orderFormat&i)===i)switch(e.type){case n.IntervalType.Exception:{const s=p(e.periodFrom),l=p(e.periodTo);r.isBetween(s,l,"day","[]")&&(e.state===n.IntervalState.Closed?t.closedExceptions.push(e):t.openExceptions.push(e))}break;case n.IntervalType.Normal:default:(e.dayOfWeek===n.DayOfWeek.Everyday||e.dayOfWeek===f.DaysOfWeekMap[r.isoWeekday()])&&t.openIntervals.push(e);break}return t},{closedExceptions:[],openExceptions:[],openIntervals:[]}),{closedExceptions:d,openExceptions:o,openIntervals:u}=a;if(!d.length){if(o.length){if(o.length>1){const[t]=o.sort((e,s)=>e.position-s.position);return t}return o[0]}return u[0]}}module.exports=y;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import i from "moment";
|
|
1
|
+
import { DayOfWeek as u, IntervalType as r, IntervalState as m } from "@ancon/wildcat-types";
|
|
3
2
|
import { DaysOfWeekMap as y } from "../shared/constants.mjs";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import i from "../date/createLocalTimezoneMoment.mjs";
|
|
4
|
+
import "moment";
|
|
5
|
+
function O(s, c, p) {
|
|
6
|
+
const f = c.reduce(
|
|
6
7
|
(o, e) => {
|
|
7
8
|
if ((e.orderFormat & p) === p)
|
|
8
9
|
switch (e.type) {
|
|
9
10
|
case r.Exception:
|
|
10
11
|
{
|
|
11
|
-
const n = i(
|
|
12
|
-
|
|
12
|
+
const n = i(
|
|
13
|
+
e.periodFrom
|
|
14
|
+
), l = i(e.periodTo);
|
|
15
|
+
s.isBetween(n, l, "day", "[]") && (e.state === m.Closed ? o.closedExceptions.push(e) : o.openExceptions.push(e));
|
|
13
16
|
}
|
|
14
17
|
break;
|
|
15
|
-
case r.
|
|
18
|
+
case r.Normal:
|
|
16
19
|
default:
|
|
17
20
|
// Every day in the week
|
|
18
|
-
(e.dayOfWeek ===
|
|
21
|
+
(e.dayOfWeek === u.Everyday || // Specific day in the week
|
|
19
22
|
e.dayOfWeek === y[s.isoWeekday()]) && o.openIntervals.push(e);
|
|
20
23
|
break;
|
|
21
24
|
}
|
|
@@ -26,8 +29,8 @@ function k(s, f, p) {
|
|
|
26
29
|
openExceptions: [],
|
|
27
30
|
openIntervals: []
|
|
28
31
|
}
|
|
29
|
-
), { closedExceptions:
|
|
30
|
-
if (!
|
|
32
|
+
), { closedExceptions: a, openExceptions: t, openIntervals: d } = f;
|
|
33
|
+
if (!a.length) {
|
|
31
34
|
if (t.length) {
|
|
32
35
|
if (t.length > 1) {
|
|
33
36
|
const [o] = t.sort(
|
|
@@ -37,9 +40,9 @@ function k(s, f, p) {
|
|
|
37
40
|
}
|
|
38
41
|
return t[0];
|
|
39
42
|
}
|
|
40
|
-
return
|
|
43
|
+
return d[0];
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
export {
|
|
44
|
-
|
|
47
|
+
O as default
|
|
45
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("moment"),s=require("@ancon/wildcat-types"),m=60;var u=(e=>(e[e.Today=0]="Today",e[e.Tomorrow=1]="Tomorrow",e))(u||{});function n(e,l,r=!1){let t=null;if(e.openNow&&e.closingTime!==null)(e.closingTime.diff(l,"minutes")<m||r)&&(t={time:e.closingTime.format("LT"),state:s.OutletState.Closed});else if(!e.openNow&&e.openingTime)if(e.openingTime.isSame(l,"d"))t={time:o(e.openingTime).calendar(),state:s.OutletState.Opened};else{const d=o().add(1,"day"),i=o(e.openingTime);i.isSame(d,"d")?t={time:i.format("LT"),state:s.OutletState.Opened,day:1}:i.isAfter(l.clone().add(1,"week"))?t={time:i.format("D MMMM LT"),state:s.OutletState.Opened}:i&&(t={time:i.format("ddd LT"),state:s.OutletState.Opened})}return t}exports.OutletAvailabilityDay=u;exports.default=n;
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { OutletState as
|
|
3
|
-
const
|
|
4
|
-
var
|
|
5
|
-
function
|
|
1
|
+
import m from "moment";
|
|
2
|
+
import { OutletState as t } from "@ancon/wildcat-types";
|
|
3
|
+
const r = 60;
|
|
4
|
+
var T = /* @__PURE__ */ ((e) => (e[e.Today = 0] = "Today", e[e.Tomorrow = 1] = "Tomorrow", e))(T || {});
|
|
5
|
+
function p(e, o, l = !1) {
|
|
6
6
|
let s = null;
|
|
7
7
|
if (e.openNow && e.closingTime !== null)
|
|
8
|
-
(e.closingTime.diff(
|
|
9
|
-
time: e.closingTime.
|
|
10
|
-
state:
|
|
8
|
+
(e.closingTime.diff(o, "minutes") < r || l) && (s = {
|
|
9
|
+
time: e.closingTime.format("LT"),
|
|
10
|
+
state: t.Closed
|
|
11
11
|
});
|
|
12
12
|
else if (!e.openNow && e.openingTime)
|
|
13
|
-
if (e.openingTime.isSame(
|
|
13
|
+
if (e.openingTime.isSame(o, "d"))
|
|
14
14
|
s = {
|
|
15
|
-
time:
|
|
16
|
-
state:
|
|
15
|
+
time: m(e.openingTime).calendar(),
|
|
16
|
+
state: t.Opened
|
|
17
17
|
};
|
|
18
18
|
else {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
time: f.format("LT"),
|
|
24
|
-
state: i.Open,
|
|
19
|
+
const d = m().add(1, "day"), i = m(e.openingTime);
|
|
20
|
+
i.isSame(d, "d") ? s = {
|
|
21
|
+
time: i.format("LT"),
|
|
22
|
+
state: t.Opened,
|
|
25
23
|
day: 1
|
|
26
24
|
/* Tomorrow */
|
|
27
|
-
} :
|
|
28
|
-
time:
|
|
29
|
-
state:
|
|
30
|
-
} :
|
|
31
|
-
time:
|
|
32
|
-
state:
|
|
25
|
+
} : i.isAfter(o.clone().add(1, "week")) ? s = {
|
|
26
|
+
time: i.format("D MMMM LT"),
|
|
27
|
+
state: t.Opened
|
|
28
|
+
} : i && (s = {
|
|
29
|
+
time: i.format("ddd LT"),
|
|
30
|
+
state: t.Opened
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
33
|
return s;
|
|
36
34
|
}
|
|
37
35
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
T as OutletAvailabilityDay,
|
|
37
|
+
p as default
|
|
40
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";const a=require("@ancon/wildcat-types"),l=require("../time/getTimeSpanParts.js"),s=require("./getMomentFromDateAndTimeString.js");require("moment");function f(r,e,c){if(e.exception){const{exception:t}=e;if(t.type===a.IntervalType.Normal){const n=l(t.duration),i=s(r,t.from),o=i.clone().add(n);if(c.isBetween(i,o))return e.exception}}else for(let t=0;t<e.intervals.length;t+=1){const n=e.intervals[t],i=l(n.duration),o=s(r,n.from),u=o.clone().add(i);if(c.isBetween(o,u))return n}return null}module.exports=f;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { IntervalType as
|
|
2
|
-
import
|
|
1
|
+
import { IntervalType as f } from "@ancon/wildcat-types";
|
|
2
|
+
import c from "../time/getTimeSpanParts.mjs";
|
|
3
|
+
import m from "./getMomentFromDateAndTimeString.mjs";
|
|
3
4
|
import "moment";
|
|
4
|
-
function
|
|
5
|
+
function g(r, n, l) {
|
|
5
6
|
if (n.exception) {
|
|
6
7
|
const { exception: t } = n;
|
|
7
|
-
if (t.type ===
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
t.
|
|
11
|
-
),
|
|
12
|
-
if (l.isBetween(
|
|
8
|
+
if (t.type === f.Normal) {
|
|
9
|
+
const e = c(t.duration), o = m(
|
|
10
|
+
r,
|
|
11
|
+
t.from
|
|
12
|
+
), i = o.clone().add(e);
|
|
13
|
+
if (l.isBetween(o, i))
|
|
13
14
|
return n.exception;
|
|
14
15
|
}
|
|
15
16
|
} else
|
|
16
17
|
for (let t = 0; t < n.intervals.length; t += 1) {
|
|
17
|
-
const e = n.intervals[t],
|
|
18
|
-
|
|
19
|
-
e.
|
|
20
|
-
),
|
|
21
|
-
if (l.isBetween(
|
|
18
|
+
const e = n.intervals[t], o = c(e.duration), i = m(
|
|
19
|
+
r,
|
|
20
|
+
e.from
|
|
21
|
+
), s = i.clone().add(o);
|
|
22
|
+
if (l.isBetween(i, s))
|
|
22
23
|
return e;
|
|
23
24
|
}
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
26
27
|
export {
|
|
27
|
-
|
|
28
|
+
g as default
|
|
28
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const f=require("@ancon/wildcat-types"),T=require("moment"),u=require("./getOutletTagInformation.js"),p=require("./getOutletAvailabilityInfo.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function a(o,e){let{openingTime:n}=o,{closingTime:i}=o;return!!e.openingTime&&!!e.closingTime?(o.openingTime?o.openingTime.isBetween(e.openingTime,e.closingTime)&&(n=e.openingTime):n=e.openingTime,o.closingTime?o.closingTime.isBetween(e.openingTime,e.closingTime)&&(i=e.closingTime):i=e.closingTime):((!n&&e.openingTime||e.openingTime&&n&&e.openingTime.isBefore(n))&&(n=e.openingTime),!i&&e.closingTime?i=e.closingTime:e.closingTime&&i&&(e.closingTime.isBefore(i)||(i=e.closingTime))),{openingTime:n,closingTime:i}}function d(o){const{serviceDateTimes:e,state:n}=o,i=T(),g=n===f.OutletState.Opened,r=e.reduce((s,l)=>{const m=(l==null?void 0:l.intervals)||[],t=u.default(m,g,i,i);return s?s.openNow&&!t.openNow?s:{...a(s,t),openNow:s.openNow||t.openNow,openDuringSpecifiedTime:s.openDuringSpecifiedTime||t.openDuringSpecifiedTime}:t},void 0);return r?p.default(r,i,!1):null}module.exports=d;
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { OutletState as p } from "@ancon/wildcat-types";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import f from "moment";
|
|
3
|
+
import T from "./getOutletTagInformation.mjs";
|
|
4
|
+
import a from "./getOutletAvailabilityInfo.mjs";
|
|
5
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
6
|
+
import "../time/getTimeSpanParts.mjs";
|
|
5
7
|
import "./constants.mjs";
|
|
6
8
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
7
9
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
8
10
|
import "./searchNextOpeningMoment.mjs";
|
|
9
|
-
function
|
|
10
|
-
let { openingTime:
|
|
11
|
-
return !!i.openingTime && !!i.closingTime ? (
|
|
11
|
+
function d(n, i) {
|
|
12
|
+
let { openingTime: o } = n, { closingTime: e } = n;
|
|
13
|
+
return !!i.openingTime && !!i.closingTime ? (n.openingTime ? n.openingTime.isBetween(
|
|
12
14
|
i.openingTime,
|
|
13
15
|
i.closingTime
|
|
14
|
-
) && (
|
|
16
|
+
) && (o = i.openingTime) : o = i.openingTime, n.closingTime ? n.closingTime.isBetween(
|
|
15
17
|
i.openingTime,
|
|
16
18
|
i.closingTime
|
|
17
|
-
) && (
|
|
18
|
-
openingTime:
|
|
19
|
-
closingTime:
|
|
19
|
+
) && (e = i.closingTime) : e = i.closingTime) : ((!o && i.openingTime || i.openingTime && o && i.openingTime.isBefore(o)) && (o = i.openingTime), !e && i.closingTime ? e = i.closingTime : i.closingTime && e && (i.closingTime.isBefore(e) || (e = i.closingTime))), {
|
|
20
|
+
openingTime: o,
|
|
21
|
+
closingTime: e
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
|
-
function
|
|
23
|
-
const { serviceDateTimes: i, state:
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
n
|
|
24
|
+
function y(n) {
|
|
25
|
+
const { serviceDateTimes: i, state: o } = n, e = f(), g = o === p.Opened, s = i.reduce((m, r) => {
|
|
26
|
+
const l = (r == null ? void 0 : r.intervals) || [], t = T(
|
|
27
|
+
l,
|
|
28
|
+
g,
|
|
29
|
+
e,
|
|
30
|
+
e
|
|
30
31
|
);
|
|
31
|
-
return
|
|
32
|
-
...
|
|
33
|
-
openNow:
|
|
34
|
-
openDuringSpecifiedTime:
|
|
32
|
+
return m ? m.openNow && !t.openNow ? m : {
|
|
33
|
+
...d(m, t),
|
|
34
|
+
openNow: m.openNow || t.openNow,
|
|
35
|
+
openDuringSpecifiedTime: m.openDuringSpecifiedTime || t.openDuringSpecifiedTime
|
|
35
36
|
} : t;
|
|
36
37
|
}, void 0);
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
return s ? a(
|
|
39
|
+
s,
|
|
40
|
+
e,
|
|
40
41
|
!1
|
|
41
42
|
) : null;
|
|
42
43
|
}
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
+
y as default
|
|
45
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const t=require("moment"),d=require("./getOutletTodayOpeningTimes.js");require("../_baseIteratee-075c204c.js");require("../_getTag-b8923c48.js");require("../isArray-640f9811.js");require("../_baseIsEqual-bcac9024.js");require("../identity-1bae7cf8.js");require("../toString-9eae9442.js");require("../noop-7ea3b37b.js");require("./getListOutletOpeningHoursTable.js");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");function m(q,c){const n=t(),u=d(q);if(u){const s=u.find(e=>{const r=t(e.start),i=t(e.end);return n.isBetween(r,i)});if(s){const{end:e}=s,r=t(e),i=n.isSame(r,"day"),o=r.format(i?"LT":"ddd LT");return c("untilTime",{time:o})||""}}}module.exports=m;
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "moment";
|
|
2
2
|
import c from "./getOutletTodayOpeningTimes.mjs";
|
|
3
|
-
import "../_baseIteratee-
|
|
4
|
-
import "../
|
|
3
|
+
import "../_baseIteratee-4c4d0995.mjs";
|
|
4
|
+
import "../_getTag-4e44633b.mjs";
|
|
5
5
|
import "../isArray-0d9c7aaa.mjs";
|
|
6
|
-
import "../
|
|
6
|
+
import "../_baseIsEqual-12d01a44.mjs";
|
|
7
|
+
import "../identity-6eafe87b.mjs";
|
|
8
|
+
import "../toString-3b91b335.mjs";
|
|
7
9
|
import "../noop-378485d5.mjs";
|
|
8
10
|
import "./getListOutletOpeningHoursTable.mjs";
|
|
9
11
|
import "@ancon/wildcat-types";
|
|
10
12
|
import "../shared/isWithinFlag.mjs";
|
|
11
13
|
import "../shared/generateId.mjs";
|
|
12
14
|
import "react";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
import "../time/getTimeSpanParts.mjs";
|
|
16
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
17
|
+
function H(p, d) {
|
|
18
|
+
const n = e(), r = c(p);
|
|
15
19
|
if (r) {
|
|
16
20
|
const m = r.find((t) => {
|
|
17
|
-
const
|
|
18
|
-
return
|
|
21
|
+
const o = e(t.start), i = e(t.end);
|
|
22
|
+
return n.isBetween(o, i);
|
|
19
23
|
});
|
|
20
24
|
if (m) {
|
|
21
|
-
const { end: t } = m,
|
|
25
|
+
const { end: t } = m, o = e(t), i = n.isSame(o, "day"), s = o.format(i ? "LT" : "ddd LT");
|
|
22
26
|
return d("untilTime", { time: s }) || "";
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
export {
|
|
27
|
-
|
|
31
|
+
H as default
|
|
28
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const e=require("@ancon/wildcat-types");function i(r){return r?r.find(t=>(t.orderFormats&e.OrderFormat.Delivery)===e.OrderFormat.Delivery):null}module.exports=i;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OrderFormat as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
(t) => (t.
|
|
1
|
+
import { OrderFormat as e } from "@ancon/wildcat-types";
|
|
2
|
+
function o(r) {
|
|
3
|
+
return r ? r.find(
|
|
4
|
+
(t) => (t.orderFormats & e.Delivery) === e.Delivery
|
|
5
5
|
) : null;
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
o as default
|
|
9
9
|
};
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
declare type StreetCity = {
|
|
2
|
+
street: string;
|
|
3
|
+
city: string;
|
|
4
|
+
};
|
|
5
|
+
declare type FormatOptions = {
|
|
6
|
+
streetMaxLength?: number;
|
|
7
|
+
};
|
|
8
|
+
export default function getOutletFormattedAddress<OutletAddress extends StreetCity>(address: OutletAddress | undefined, options?: FormatOptions): string;
|
|
9
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const u=require("../string/truncate.js"),s=40;function a(e,t){if(e){const{street:r,city:n}=e,c=(t==null?void 0:t.streetMaxLength)||s;return[r&&u(r,c),n].filter(Boolean).join(", ")||""}return""}module.exports=a;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import c from "../string/truncate.mjs";
|
|
2
|
+
const u = 40;
|
|
3
|
+
function d(e, t) {
|
|
4
|
+
if (e) {
|
|
5
|
+
const { street: r, city: n } = e, a = (t == null ? void 0 : t.streetMaxLength) || u;
|
|
6
|
+
return [r && c(r, a), n].filter(Boolean).join(", ") || "";
|
|
7
|
+
}
|
|
8
|
+
return "";
|
|
4
9
|
}
|
|
5
10
|
export {
|
|
6
|
-
|
|
11
|
+
d as default
|
|
7
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("@ancon/wildcat-types"),g=require("moment"),f=require("./getOutletTagInformation.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function m(o){const r=g();return o.serviceDateTimes.reduce((e,t)=>{const i=(t==null?void 0:t.intervals)||[],n=f.default(i,o.state===s.OutletState.Opened,r,r);if(!e&&!n.openNow)return n;const u=(e==null?void 0:e.openingTime)&&n.openingTime&&n.openingTime.isBefore(e.openingTime);return!n.openNow&&u?n:e},void 0)}module.exports=m;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { OutletState as p } from "@ancon/wildcat-types";
|
|
2
2
|
import f from "moment";
|
|
3
3
|
import g from "./getOutletTagInformation.mjs";
|
|
4
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
5
|
+
import "../time/getTimeSpanParts.mjs";
|
|
4
6
|
import "./constants.mjs";
|
|
5
7
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
6
8
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
7
9
|
import "./searchNextOpeningMoment.mjs";
|
|
8
10
|
function N(e) {
|
|
9
|
-
const
|
|
10
|
-
return e.serviceDateTimes.reduce((n,
|
|
11
|
-
const r = (
|
|
11
|
+
const i = f();
|
|
12
|
+
return e.serviceDateTimes.reduce((n, t) => {
|
|
13
|
+
const r = (t == null ? void 0 : t.intervals) || [], o = g(
|
|
12
14
|
r,
|
|
13
|
-
e.state === p.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
e == null ? void 0 : e.timeZoneOffset
|
|
15
|
+
e.state === p.Opened,
|
|
16
|
+
i,
|
|
17
|
+
i
|
|
17
18
|
);
|
|
18
19
|
if (!n && !o.openNow)
|
|
19
20
|
return o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const i=require("moment"),o=require("./getOutletNextOpeningTagInformation.js");require("@ancon/wildcat-types");require("./getOutletTagInformation.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function u(t,r){const e=o(t);if(e&&!e.openNow&&e.openingTime){const n=i(e.openingTime).calendar({sameDay:"[Today] [at] LT",nextDay:"[Tomorrow] [at] LT",nextWeek:"ddd [at] LT"});return r("openingTime",{time:n})}return null}module.exports=u;
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import i from "moment";
|
|
2
|
+
import m from "./getOutletNextOpeningTagInformation.mjs";
|
|
3
3
|
import "@ancon/wildcat-types";
|
|
4
4
|
import "./getOutletTagInformation.mjs";
|
|
5
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
6
|
+
import "../time/getTimeSpanParts.mjs";
|
|
5
7
|
import "./constants.mjs";
|
|
6
8
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
7
9
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
8
10
|
import "./searchNextOpeningMoment.mjs";
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
+
function c(e, o) {
|
|
12
|
+
const t = m(e);
|
|
11
13
|
if (t && !t.openNow && t.openingTime) {
|
|
12
|
-
const
|
|
14
|
+
const n = i(t.openingTime).calendar({
|
|
13
15
|
sameDay: "[Today] [at] LT",
|
|
14
16
|
nextDay: "[Tomorrow] [at] LT",
|
|
15
17
|
nextWeek: "ddd [at] LT"
|
|
16
18
|
});
|
|
17
|
-
return
|
|
18
|
-
time:
|
|
19
|
+
return o("openingTime", {
|
|
20
|
+
time: n
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
return null;
|
|
22
24
|
}
|
|
23
25
|
export {
|
|
24
|
-
|
|
26
|
+
c as default
|
|
25
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const q=require("@ancon/wildcat-types"),n=require("moment"),T=require("./getSettingsForOrderFormat.js"),u=require("./isOutletAcceptingPreOrders.js"),f=require("./getOutletTagInformation.js"),v=require("./getNextTenthMinute.js"),x=require("./getServiceIntervalsForOrderFormat.js"),_=require("./getOutletNextServiceTimeOffset.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");function I(e,r){const s=(e==null?void 0:e.state)===q.OutletState.Opened,i=T(r,e==null?void 0:e.orderFormatSettings),d=(i==null?void 0:i.preparationTime)??"00:00:00",m=u((e==null?void 0:e.orderFormatSettings)||[]),O=x(r,(e==null?void 0:e.serviceDateTimes)||[]),c=f.default(O,s,n(),n()),p=!s&&m&&c.openingTime?c.openingTime:void 0,o=n(),a=n(p),t=(o>a?o:a).second(0).millisecond(0),g=_(r,d,e==null?void 0:e.deliveryIntegrationEnabled);return g>0&&t.add(g,"minute"),t.minute(v(t))}module.exports=I;
|
|
@@ -6,33 +6,33 @@ import x from "./getOutletTagInformation.mjs";
|
|
|
6
6
|
import I from "./getNextTenthMinute.mjs";
|
|
7
7
|
import S from "./getServiceIntervalsForOrderFormat.mjs";
|
|
8
8
|
import y from "./getOutletNextServiceTimeOffset.mjs";
|
|
9
|
+
import "../date/createLocalTimezoneMoment.mjs";
|
|
10
|
+
import "../time/getTimeSpanParts.mjs";
|
|
9
11
|
import "./constants.mjs";
|
|
10
12
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
11
13
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
12
14
|
import "./searchNextOpeningMoment.mjs";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const s = (i == null ? void 0 : i.state) === d.Open, e = T(
|
|
15
|
+
function q(i, r) {
|
|
16
|
+
const t = (i == null ? void 0 : i.state) === d.Opened, e = T(
|
|
16
17
|
r,
|
|
17
18
|
i == null ? void 0 : i.orderFormatSettings
|
|
18
|
-
),
|
|
19
|
+
), c = (e == null ? void 0 : e.preparationTime) ?? "00:00:00", f = v(
|
|
19
20
|
(i == null ? void 0 : i.orderFormatSettings) || []
|
|
20
21
|
), g = S(
|
|
21
22
|
r,
|
|
22
23
|
(i == null ? void 0 : i.serviceDateTimes) || []
|
|
23
24
|
), o = x(
|
|
24
25
|
g,
|
|
25
|
-
|
|
26
|
-
n(),
|
|
26
|
+
t,
|
|
27
27
|
n(),
|
|
28
|
-
|
|
29
|
-
), O = !
|
|
28
|
+
n()
|
|
29
|
+
), O = !t && f && o.openingTime ? o.openingTime : void 0, s = n(), p = n(O), m = (s > p ? s : p).second(0).millisecond(0), a = y(
|
|
30
30
|
r,
|
|
31
|
-
|
|
31
|
+
c,
|
|
32
32
|
i == null ? void 0 : i.deliveryIntegrationEnabled
|
|
33
33
|
);
|
|
34
|
-
return
|
|
34
|
+
return a > 0 && m.add(a, "minute"), m.minute(I(m));
|
|
35
35
|
}
|
|
36
36
|
export {
|
|
37
|
-
|
|
37
|
+
q as default
|
|
38
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const f=require("@ancon/wildcat-types"),g=require("moment"),O=require("./getPickerIntervalsForDay.js"),S=require("./getSettingsForOrderFormat.js"),h=require("./getServiceIntervalStart.js"),D=require("./generatePickerTimesForDay.js"),T=require("./getServiceIntervalEnd.js"),_=require("./getOutletNextReadyToOrderTime.js");require("../shared/constants.js");require("../date/createLocalTimezoneMoment.js");require("./getServiceIntervalsForOrderFormat.js");require("../time/getTimeSpanParts.js");require("./getNextTenthMinute.js");require("./hoursAndMinutesToMinutes.js");require("./isOutletAcceptingPreOrders.js");require("./getOutletTagInformation.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");require("./getOutletNextServiceTimeOffset.js");function k(e,o,l,m){const{preparationTime:u="00:00:00"}=S(o,e==null?void 0:e.orderFormatSettings)??{},i=_(e,o);let a=i.clone();const s=g(l);if(s>i)a=i.clone().set({year:s.year(),month:s.month(),date:s.date()});else if(i.diff(s,"day")>0)return[];let t=[];const p=O(a,e==null?void 0:e.serviceDateTimes,o);let q;return p.forEach(r=>{!q&&r.type&&(t=[]);const c=h(a,r,u),y=T(a,r,u);c<i&&c.add(i.valueOf()-c.valueOf(),"millisecond");const n=D(c,y,t,void 0,m);n.length>0&&r.state===f.IntervalState.Closed?t=t.filter(d=>d.timestamp<n[0].timestamp||d.timestamp>n[n.length-1].timestamp):n.length>0&&r.state===f.IntervalState.Opened&&(t=t.concat(n)),q=r.type}),t}module.exports=k;
|