@ancon/wildcat-utils 1.44.0-r13-2-tz.7 → 1.44.0-r13-2-tz.8
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 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const q=require("@ancon/wildcat-types"),r=require("moment"),u=require("./getSettingsForOrderFormat.js"),T=require("./isOutletAcceptingPreOrders.js"),v=require("./getOutletTagInformation.js"),x=require("./getNextTenthMinute.js"),_=require("./getServiceIntervalsForOrderFormat.js"),I=require("./getOutletNextServiceTimeOffset.js");require("../date/createLocalTimezoneMoment.js");require("../time/getTimeSpanParts.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getServiceIntervalTimeSpanMoment.js");require("./searchNextOpeningMoment.js");function S(e,i){const s=(e==null?void 0:e.state)===q.OutletState.Opened,t=u(i,e==null?void 0:e.orderFormatSettings),m=(t==null?void 0:t.preparationTime)??"00:00:00",O=T((e==null?void 0:e.orderFormatSettings)||[]),f=_(i,(e==null?void 0:e.serviceDateTimes)||[]),c=v.default(f,s,r(),r()),p=!s&&O&&c.openingTime?c.openingTime:void 0,o=r(),a=r(p),n=(o>a?o:a).second(0).millisecond(0),d=I(i,m,e==null?void 0:e.deliveryIntegrationEnabled);d>0&&n.add(d,"minute");const g=x(n)-n.minutes();return g&&n.add(g,"minutes"),n}module.exports=S;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OutletState as T } from "@ancon/wildcat-types";
|
|
2
|
-
import
|
|
2
|
+
import i from "moment";
|
|
3
3
|
import v from "./getSettingsForOrderFormat.mjs";
|
|
4
4
|
import x from "./isOutletAcceptingPreOrders.mjs";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import I from "./getOutletTagInformation.mjs";
|
|
6
|
+
import S from "./getNextTenthMinute.mjs";
|
|
7
|
+
import y from "./getServiceIntervalsForOrderFormat.mjs";
|
|
8
8
|
import F from "./getOutletNextServiceTimeOffset.mjs";
|
|
9
9
|
import "../date/createLocalTimezoneMoment.mjs";
|
|
10
10
|
import "../time/getTimeSpanParts.mjs";
|
|
@@ -12,28 +12,28 @@ import "./constants.mjs";
|
|
|
12
12
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
13
13
|
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
14
14
|
import "./searchNextOpeningMoment.mjs";
|
|
15
|
-
function z(n,
|
|
16
|
-
const m = (n == null ? void 0 : n.state) === T.Opened,
|
|
17
|
-
|
|
15
|
+
function z(n, r) {
|
|
16
|
+
const m = (n == null ? void 0 : n.state) === T.Opened, t = v(
|
|
17
|
+
r,
|
|
18
18
|
n == null ? void 0 : n.orderFormatSettings
|
|
19
|
-
),
|
|
19
|
+
), f = (t == null ? void 0 : t.preparationTime) ?? "00:00:00", d = x(
|
|
20
20
|
(n == null ? void 0 : n.orderFormatSettings) || []
|
|
21
|
-
), g =
|
|
22
|
-
|
|
21
|
+
), g = y(
|
|
22
|
+
r,
|
|
23
23
|
(n == null ? void 0 : n.serviceDateTimes) || []
|
|
24
|
-
),
|
|
24
|
+
), s = I(
|
|
25
25
|
g,
|
|
26
26
|
m,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
),
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
i(),
|
|
28
|
+
i()
|
|
29
|
+
), O = !m && d && s.openingTime ? s.openingTime : void 0, o = i(), p = i(O), e = (o > p ? o : p).second(0).millisecond(0), a = F(
|
|
30
|
+
r,
|
|
31
|
+
f,
|
|
32
32
|
n == null ? void 0 : n.deliveryIntegrationEnabled
|
|
33
33
|
);
|
|
34
|
-
a > 0 &&
|
|
35
|
-
const
|
|
36
|
-
return
|
|
34
|
+
a > 0 && e.add(a, "minute");
|
|
35
|
+
const c = S(e) - e.minutes();
|
|
36
|
+
return c && e.add(c, "minutes"), e;
|
|
37
37
|
}
|
|
38
38
|
export {
|
|
39
39
|
z as default
|