ordering-ui-external 2.4.6 → 2.5.0
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/_bundles/{0.ordering-ui.038c4b4d536032472bc7.js → 0.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{1.ordering-ui.038c4b4d536032472bc7.js → 1.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{2.ordering-ui.038c4b4d536032472bc7.js → 2.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{4.ordering-ui.038c4b4d536032472bc7.js → 4.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{5.ordering-ui.038c4b4d536032472bc7.js → 5.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{6.ordering-ui.038c4b4d536032472bc7.js → 6.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js → 7.ordering-ui.5657c6a53b3791887fd7.js} +2 -2
- package/_bundles/{8.ordering-ui.038c4b4d536032472bc7.js → 8.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/{9.ordering-ui.038c4b4d536032472bc7.js → 9.ordering-ui.5657c6a53b3791887fd7.js} +1 -1
- package/_bundles/ordering-ui.5657c6a53b3791887fd7.js +2 -0
- package/_modules/components/OrdersOption/styles.js +1 -1
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +15 -8
- package/_modules/components/VerticalOrdersLayout/styles.js +2 -2
- package/_modules/contexts/ThemeContext/index.js +1 -0
- package/_modules/themes/five/src/components/AddressList/index.js +8 -7
- package/_modules/themes/five/src/components/BusinessBasicInformation/index.js +28 -22
- package/_modules/themes/five/src/components/BusinessBasicInformation/styles.js +22 -21
- package/_modules/themes/five/src/components/BusinessController/index.js +5 -3
- package/_modules/themes/five/src/components/BusinessInformation/index.js +16 -10
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +5 -8
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +93 -74
- package/_modules/themes/five/src/components/BusinessListingSearch/styles.js +10 -4
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +38 -13
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +20 -9
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +35 -23
- package/_modules/themes/five/src/components/Cart/index.js +7 -3
- package/_modules/themes/five/src/components/Checkout/index.js +12 -11
- package/_modules/themes/five/src/components/Checkout/styles.js +8 -4
- package/_modules/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +4 -3
- package/_modules/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +14 -8
- package/_modules/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +1 -1
- package/_modules/themes/five/src/components/Header/index.js +29 -21
- package/_modules/themes/five/src/components/Header/styles.js +44 -40
- package/_modules/themes/five/src/components/MultiCheckout/index.js +18 -16
- package/_modules/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +6 -4
- package/_modules/themes/five/src/components/MyOrders/index.js +16 -10
- package/_modules/themes/five/src/components/MyOrders/styles.js +15 -12
- package/_modules/themes/five/src/components/OrderDetails/OrderEta.js +5 -2
- package/_modules/themes/five/src/components/OrderDetails/OrderHistory.js +2 -2
- package/_modules/themes/five/src/components/OrderDetails/index.js +2 -2
- package/_modules/themes/five/src/components/OrderItAgain/styles.js +1 -1
- package/_modules/themes/five/src/components/OrderProgress/index.js +15 -4
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +16 -4
- package/_modules/themes/five/src/components/PageBanner/styles.js +1 -1
- package/_modules/themes/five/src/components/ProductForm/index.js +27 -7
- package/_modules/themes/five/src/components/ProductForm/styles.js +40 -31
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +6 -6
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +3 -3
- package/_modules/themes/five/src/components/ReviewProduct/index.js +9 -4
- package/_modules/themes/five/src/components/ServiceForm/index.js +22 -3
- package/_modules/themes/five/src/components/ServiceForm/styles.js +9 -3
- package/_modules/themes/five/src/components/SidebarMenu/index.js +19 -10
- package/_modules/themes/five/src/components/SignUpForm/index.js +56 -29
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/_modules/themes/five/src/components/SingleOrderCard/styles.js +26 -24
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +9 -5
- package/_modules/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/_modules/themes/five/src/components/UpsellingPage/index.js +2 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +58 -18
- package/_modules/themes/five/src/components/UserFormDetails/styles.js +7 -3
- package/_modules/themes/five/src/components/UserPopover/index.js +41 -25
- package/_modules/themes/five/src/components/UserProfileForm/index.js +19 -11
- package/_modules/themes/five/src/styles/Buttons/index.js +68 -58
- package/_modules/themes/five/src/styles/Inputs/index.js +40 -16
- package/_modules/utils/index.js +8 -2
- package/index.html +1 -1
- package/package.json +3 -2
- package/src/components/OrdersOption/styles.js +1 -0
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +35 -17
- package/src/components/VerticalOrdersLayout/styles.js +9 -0
- package/src/contexts/ThemeContext/index.js +1 -0
- package/src/themes/five/src/components/AddressList/index.js +6 -6
- package/src/themes/five/src/components/BusinessBasicInformation/index.js +24 -22
- package/src/themes/five/src/components/BusinessBasicInformation/styles.js +24 -3
- package/src/themes/five/src/components/BusinessController/index.js +4 -2
- package/src/themes/five/src/components/BusinessInformation/index.js +24 -12
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +5 -6
- package/src/themes/five/src/components/BusinessListingSearch/index.js +127 -101
- package/src/themes/five/src/components/BusinessListingSearch/styles.js +15 -0
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +7 -2
- package/src/themes/five/src/components/BusinessProductsCategories/styles.js +1 -1
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +34 -9
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +26 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +9 -2
- package/src/themes/five/src/components/Cart/index.js +3 -4
- package/src/themes/five/src/components/Checkout/index.js +18 -4
- package/src/themes/five/src/components/Checkout/styles.js +22 -0
- package/src/themes/five/src/components/GiftCard/GiftCardUI/index.js +1 -0
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/index.js +41 -31
- package/src/themes/five/src/components/GiftCard/PurchaseGiftCard/styles.js +15 -4
- package/src/themes/five/src/components/GiftCard/RedeemGiftCard/index.js +2 -2
- package/src/themes/five/src/components/Header/index.js +17 -5
- package/src/themes/five/src/components/Header/styles.js +9 -6
- package/src/themes/five/src/components/MultiCheckout/index.js +9 -10
- package/src/themes/five/src/components/MultiOrdersDetails/SingleOrderCard.js +8 -5
- package/src/themes/five/src/components/MyOrders/index.js +13 -9
- package/src/themes/five/src/components/MyOrders/styles.js +3 -1
- package/src/themes/five/src/components/OrderDetails/OrderEta.js +3 -2
- package/src/themes/five/src/components/OrderDetails/OrderHistory.js +8 -2
- package/src/themes/five/src/components/OrderDetails/index.js +2 -2
- package/src/themes/five/src/components/OrderItAgain/styles.js +1 -1
- package/src/themes/five/src/components/OrderProgress/index.js +16 -5
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +7 -4
- package/src/themes/five/src/components/PageBanner/styles.js +1 -4
- package/src/themes/five/src/components/ProductForm/index.js +23 -5
- package/src/themes/five/src/components/ProductForm/styles.js +36 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +37 -29
- package/src/themes/five/src/components/RenderProductsLayout/index.js +3 -3
- package/src/themes/five/src/components/ReviewProduct/index.js +14 -6
- package/src/themes/five/src/components/ServiceForm/index.js +22 -4
- package/src/themes/five/src/components/ServiceForm/styles.js +16 -0
- package/src/themes/five/src/components/SidebarMenu/index.js +162 -144
- package/src/themes/five/src/components/SignUpForm/index.js +4 -3
- package/src/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/src/themes/five/src/components/SingleOrderCard/styles.js +9 -1
- package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +13 -3
- package/src/themes/five/src/components/SingleProductCard/layouts/original/styles.js +2 -2
- package/src/themes/five/src/components/UpsellingPage/index.js +1 -1
- package/src/themes/five/src/components/UserFormDetails/index.js +58 -14
- package/src/themes/five/src/components/UserFormDetails/styles.js +16 -0
- package/src/themes/five/src/components/UserPopover/index.js +26 -15
- package/src/themes/five/src/components/UserProfileForm/index.js +18 -9
- package/src/themes/five/src/styles/Buttons/index.js +11 -0
- package/src/themes/five/src/styles/Inputs/index.js +34 -0
- package/src/utils/index.js +5 -0
- package/template/app.js +5 -3
- package/template/theme.json +335 -24
- package/_bundles/ordering-ui.038c4b4d536032472bc7.js +0 -2
- /package/_bundles/{7.ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → 7.ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.038c4b4d536032472bc7.js.LICENSE.txt → ordering-ui.5657c6a53b3791887fd7.js.LICENSE.txt} +0 -0
|
@@ -51,7 +51,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
51
51
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
52
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
53
|
var Header = function Header(props) {
|
|
54
|
-
var _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _theme$header, _theme$header$compone, _theme$header$compone2, _customerState$user, _orderState$
|
|
54
|
+
var _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _orderingTheme$theme, _orderingTheme$theme$, _orderingTheme$theme$2, _orderingTheme$theme$3, _orderingTheme$theme$4, _theme$header, _theme$header$compone, _theme$header$compone2, _orderState$options, _orderState$options2, _Object$keys, _customerState$user, _orderState$options5, _orderState$options5$, _theme$images, _theme$images$logos, _orderingTheme$theme2, _orderingTheme$theme3, _orderingTheme$theme4, _orderingTheme$theme5, _orderingTheme$theme6, _orderingTheme$theme7, _orderingTheme$theme8, _theme$images2, _theme$images2$logos, _theme$images3, _theme$images3$logos, _theme$images4, _theme$images4$logos, _orderingTheme$theme9, _orderingTheme$theme10, _orderingTheme$theme11, _orderingTheme$theme12, _orderingTheme$theme13, _orderingTheme$theme14, _orderingTheme$theme15, _theme$images5, _theme$images5$logos, _orderState$options7, _orderState$options7$, _orderState$options8, _orderState$options8$, _configState$configs4, _configState$configs5, _configState$configs6, _configState$configs7, _configState$configs8, _configState$configs9, _orderState$options9, _orderState$options10, _configState$configs10, _configState$configs11, _theme$defaultLanguag2, _theme$defaultLanguag3, _orderState$options11, _orderState$options12, _configState$configs12, _configState$configs13, _orderState$options13, _configState$configs14, _configState$configs15, _configState$configs16, _configState$configs17, _orderState$options14, _orderState$options15, _configState$configs18, _configState$configs19, _orderState$options16, _configState$configs20, _configState$configs21, _configState$configs22, _configState$configs23, _orderState$options17, _orderState$options18, _customerState$user2, _customerState$user3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9;
|
|
55
55
|
var isHome = props.isHome,
|
|
56
56
|
location = props.location,
|
|
57
57
|
isShowOrderOptions = props.isShowOrderOptions,
|
|
@@ -93,6 +93,9 @@ var Header = function Header(props) {
|
|
|
93
93
|
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
94
94
|
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
95
95
|
orderingTheme = _useOrderingTheme2[0];
|
|
96
|
+
var _useBusiness = (0, _orderingComponentsExternal.useBusiness)(),
|
|
97
|
+
_useBusiness2 = _slicedToArray(_useBusiness, 1),
|
|
98
|
+
business = _useBusiness2[0].business;
|
|
96
99
|
var clearCustomer = (0, _react.useRef)(null);
|
|
97
100
|
var _useState3 = (0, _react.useState)(false),
|
|
98
101
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -145,13 +148,15 @@ var Header = function Header(props) {
|
|
|
145
148
|
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
146
149
|
var onlineStatus = (0, _useOnlineStatus.useOnlineStatus)();
|
|
147
150
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
148
|
-
var orderTypeList = [t('DELIVERY', 'Delivery'), t('PICKUP', 'Pickup'), t('EAT_IN', 'Eat in'), t('CURBSIDE', 'Curbside'), t('DRIVE_THRU', 'Drive thru')];
|
|
151
|
+
var orderTypeList = [t('DELIVERY', 'Delivery'), t('PICKUP', 'Pickup'), t('EAT_IN', 'Eat in'), t('CURBSIDE', 'Curbside'), t('DRIVE_THRU', 'Drive thru'), '', t('CATERING_DELIVERY', 'Catering Delivery'), t('CATERING_PICKUP', 'Catering pickup')];
|
|
149
152
|
var configTypes = (configState === null || configState === void 0 ? void 0 : (_configState$configs = configState.configs) === null || _configState$configs === void 0 ? void 0 : (_configState$configs$ = _configState$configs.order_types_allowed) === null || _configState$configs$ === void 0 ? void 0 : _configState$configs$.value.split('|').map(function (value) {
|
|
150
153
|
return Number(value);
|
|
151
154
|
})) || [];
|
|
152
155
|
var isPreOrderSetting = (configState === null || configState === void 0 ? void 0 : (_configState$configs2 = configState.configs) === null || _configState$configs2 === void 0 ? void 0 : (_configState$configs3 = _configState$configs2.preorder_status_enabled) === null || _configState$configs3 === void 0 ? void 0 : _configState$configs3.value) === '1';
|
|
153
156
|
var isChew = (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme = orderingTheme.theme) === null || _orderingTheme$theme === void 0 ? void 0 : (_orderingTheme$theme$ = _orderingTheme$theme.header) === null || _orderingTheme$theme$ === void 0 ? void 0 : (_orderingTheme$theme$2 = _orderingTheme$theme$.components) === null || _orderingTheme$theme$2 === void 0 ? void 0 : (_orderingTheme$theme$3 = _orderingTheme$theme$2.layout) === null || _orderingTheme$theme$3 === void 0 ? void 0 : (_orderingTheme$theme$4 = _orderingTheme$theme$3.type) === null || _orderingTheme$theme$4 === void 0 ? void 0 : _orderingTheme$theme$4.toLowerCase()) === 'chew';
|
|
154
157
|
var isHideLanguages = theme === null || theme === void 0 ? void 0 : (_theme$header = theme.header) === null || _theme$header === void 0 ? void 0 : (_theme$header$compone = _theme$header.components) === null || _theme$header$compone === void 0 ? void 0 : (_theme$header$compone2 = _theme$header$compone.language_selector) === null || _theme$header$compone2 === void 0 ? void 0 : _theme$header$compone2.hidden;
|
|
158
|
+
var cateringTypeString = (orderState === null || orderState === void 0 ? void 0 : (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 ? void 0 : (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) === 8 ? 'catering_pickup' : null;
|
|
159
|
+
var cateringValues = (0, _utils.getCateringValues)(cateringTypeString, pathname.includes('store') && (Object === null || Object === void 0 ? void 0 : (_Object$keys = Object.keys(business || {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 ? business === null || business === void 0 ? void 0 : business.configs : configState === null || configState === void 0 ? void 0 : configState.configs);
|
|
155
160
|
var handleSuccessSignup = function handleSuccessSignup(user) {
|
|
156
161
|
var _user$session;
|
|
157
162
|
login({
|
|
@@ -245,9 +250,9 @@ var Header = function Header(props) {
|
|
|
245
250
|
return;
|
|
246
251
|
}
|
|
247
252
|
navigator.geolocation.getCurrentPosition(function (pos) {
|
|
248
|
-
var _orderState$
|
|
253
|
+
var _orderState$options3, _orderState$options3$, _orderState$options3$2, _orderState$options4, _orderState$options4$, _orderState$options4$2;
|
|
249
254
|
var crd = pos.coords;
|
|
250
|
-
var distance = (0, _utils.getDistance)(crd.latitude, crd.longitude, orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
255
|
+
var distance = (0, _utils.getDistance)(crd.latitude, crd.longitude, orderState === null || orderState === void 0 ? void 0 : (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : (_orderState$options3$ = _orderState$options3.address) === null || _orderState$options3$ === void 0 ? void 0 : (_orderState$options3$2 = _orderState$options3$.location) === null || _orderState$options3$2 === void 0 ? void 0 : _orderState$options3$2.lat, orderState === null || orderState === void 0 ? void 0 : (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : (_orderState$options4$ = _orderState$options4.address) === null || _orderState$options4$ === void 0 ? void 0 : (_orderState$options4$2 = _orderState$options4$.location) === null || _orderState$options4$2 === void 0 ? void 0 : _orderState$options4$2.lng);
|
|
251
256
|
if (distance > 20) setIsFarAway(true);else setIsFarAway(false);
|
|
252
257
|
}, function (err) {
|
|
253
258
|
console.warn("ERROR(".concat(err.code, "): ").concat(err.message));
|
|
@@ -256,7 +261,7 @@ var Header = function Header(props) {
|
|
|
256
261
|
timeout: 5000,
|
|
257
262
|
maximumAge: 0
|
|
258
263
|
});
|
|
259
|
-
}, [orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
264
|
+
}, [orderState === null || orderState === void 0 ? void 0 : (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : (_orderState$options5$ = _orderState$options5.address) === null || _orderState$options5$ === void 0 ? void 0 : _orderState$options5$.location, pathname]);
|
|
260
265
|
return /*#__PURE__*/_react.default.createElement(_styles.Header, {
|
|
261
266
|
isChew: isChew
|
|
262
267
|
}, /*#__PURE__*/_react.default.createElement(_styles.InnerHeader, null, /*#__PURE__*/_react.default.createElement(_styles.LeftSide, null, /*#__PURE__*/_react.default.createElement(_styles.LeftHeader, {
|
|
@@ -268,9 +273,9 @@ var Header = function Header(props) {
|
|
|
268
273
|
isCustomerMode: isCustomerMode
|
|
269
274
|
}), /*#__PURE__*/_react.default.createElement(_styles.LogoHeader, {
|
|
270
275
|
onClick: function onClick() {
|
|
271
|
-
var _orderState$
|
|
276
|
+
var _orderState$options6, _orderState$options6$;
|
|
272
277
|
return handleGoToPage({
|
|
273
|
-
page: orderState !== null && orderState !== void 0 && (_orderState$
|
|
278
|
+
page: orderState !== null && orderState !== void 0 && (_orderState$options6 = orderState.options) !== null && _orderState$options6 !== void 0 && (_orderState$options6$ = _orderState$options6.address) !== null && _orderState$options6$ !== void 0 && _orderState$options6$.location && !isCustomerMode ? 'search' : 'home'
|
|
274
279
|
});
|
|
275
280
|
},
|
|
276
281
|
isChew: isChew
|
|
@@ -284,19 +289,19 @@ var Header = function Header(props) {
|
|
|
284
289
|
alt: "Isotype",
|
|
285
290
|
width: isChew ? '70px' : '35px',
|
|
286
291
|
height: isChew ? '20px' : '45px',
|
|
287
|
-
src: isChew ? theme === null || theme === void 0 ? void 0 : (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$logos = _theme$images3.logos) === null || _theme$images3$logos === void 0 ? void 0 : _theme$images3$logos.chewLogo :
|
|
292
|
+
src: isChew ? theme === null || theme === void 0 ? void 0 : (_theme$images3 = theme.images) === null || _theme$images3 === void 0 ? void 0 : (_theme$images3$logos = _theme$images3.logos) === null || _theme$images3$logos === void 0 ? void 0 : _theme$images3$logos.chewLogo : isHome && windowSize.width < 576 ? theme === null || theme === void 0 ? void 0 : (_theme$images4 = theme.images) === null || _theme$images4 === void 0 ? void 0 : (_theme$images4$logos = _theme$images4.logos) === null || _theme$images4$logos === void 0 ? void 0 : _theme$images4$logos.isotypeInvert : (orderingTheme === null || orderingTheme === void 0 ? void 0 : (_orderingTheme$theme9 = orderingTheme.theme) === null || _orderingTheme$theme9 === void 0 ? void 0 : (_orderingTheme$theme10 = _orderingTheme$theme9.my_products) === null || _orderingTheme$theme10 === void 0 ? void 0 : (_orderingTheme$theme11 = _orderingTheme$theme10.components) === null || _orderingTheme$theme11 === void 0 ? void 0 : (_orderingTheme$theme12 = _orderingTheme$theme11.images) === null || _orderingTheme$theme12 === void 0 ? void 0 : (_orderingTheme$theme13 = _orderingTheme$theme12.components) === null || _orderingTheme$theme13 === void 0 ? void 0 : (_orderingTheme$theme14 = _orderingTheme$theme13.logo) === null || _orderingTheme$theme14 === void 0 ? void 0 : (_orderingTheme$theme15 = _orderingTheme$theme14.components) === null || _orderingTheme$theme15 === void 0 ? void 0 : _orderingTheme$theme15.image) || (theme === null || theme === void 0 ? void 0 : (_theme$images5 = theme.images) === null || _theme$images5 === void 0 ? void 0 : (_theme$images5$logos = _theme$images5.logos) === null || _theme$images5$logos === void 0 ? void 0 : _theme$images5$logos.isotype),
|
|
288
293
|
loading: "lazy"
|
|
289
294
|
}))), isShowOrderOptions && !props.isCustomLayout && windowSize.width >= 576 && /*#__PURE__*/_react.default.createElement(_styles.Menu, {
|
|
290
295
|
id: "center-side",
|
|
291
296
|
className: "left-header",
|
|
292
297
|
isCustomerMode: isCustomerMode,
|
|
293
298
|
isChew: isChew
|
|
294
|
-
}, windowSize.width >
|
|
299
|
+
}, windowSize.width > 850 && isFarAway && /*#__PURE__*/_react.default.createElement(_styles.FarAwayMessage, null, /*#__PURE__*/_react.default.createElement(_TiWarningOutline.default, null), /*#__PURE__*/_react.default.createElement("span", null, t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address'))), isCustomerMode && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.AddressMenu, {
|
|
295
300
|
isCustomerMode: isCustomerMode,
|
|
296
301
|
onClick: function onClick(e) {
|
|
297
302
|
return handleClickUserCustomer(e);
|
|
298
303
|
}
|
|
299
|
-
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.GeoAlt, null), /*#__PURE__*/_react.default.createElement("span", null, ((_orderState$
|
|
304
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.GeoAlt, null), /*#__PURE__*/_react.default.createElement("span", null, ((_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 ? void 0 : (_orderState$options7$ = _orderState$options7.address) === null || _orderState$options7$ === void 0 ? void 0 : _orderState$options7$.address) || t('LANG_WHAT_IS_YOUR_ADDRESS', 'What\'s your address?'))), /*#__PURE__*/_react.default.createElement(_styles.Divider, null)), isCustomerMode && windowSize.width > 450 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.CustomerInfo, {
|
|
300
305
|
onClick: function onClick(e) {
|
|
301
306
|
return handleClickUserCustomer(e);
|
|
302
307
|
}
|
|
@@ -306,11 +311,11 @@ var Header = function Header(props) {
|
|
|
306
311
|
onClick: function onClick() {
|
|
307
312
|
return openModal('address');
|
|
308
313
|
}
|
|
309
|
-
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.GeoAlt, null), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("p", null, ((_orderState$
|
|
314
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.GeoAlt, null), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("p", null, ((_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : (_orderState$options8$ = _orderState$options8.address) === null || _orderState$options8$ === void 0 ? void 0 : _orderState$options8$.address) || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')))), !isCustomerMode && (isPreOrderSetting || (configState === null || configState === void 0 ? void 0 : (_configState$configs4 = configState.configs) === null || _configState$configs4 === void 0 ? void 0 : (_configState$configs5 = _configState$configs4.preorder_status_enabled) === null || _configState$configs5 === void 0 ? void 0 : _configState$configs5.value) === undefined) && /*#__PURE__*/_react.default.createElement(_styles.MomentMenu, {
|
|
310
315
|
onClick: (configState === null || configState === void 0 ? void 0 : (_configState$configs6 = configState.configs) === null || _configState$configs6 === void 0 ? void 0 : (_configState$configs7 = _configState$configs6.max_days_preorder) === null || _configState$configs7 === void 0 ? void 0 : _configState$configs7.value) === -1 || (configState === null || configState === void 0 ? void 0 : (_configState$configs8 = configState.configs) === null || _configState$configs8 === void 0 ? void 0 : (_configState$configs9 = _configState$configs8.max_days_preorder) === null || _configState$configs9 === void 0 ? void 0 : _configState$configs9.value) === 0 ? null : function () {
|
|
311
316
|
return openModal('moment');
|
|
312
317
|
}
|
|
313
|
-
}, /*#__PURE__*/_react.default.createElement("div", null, (_orderState$
|
|
318
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, (_orderState$options9 = orderState.options) !== null && _orderState$options9 !== void 0 && _orderState$options9.moment ? parseDate((_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.moment, {
|
|
314
319
|
outputFormat: configState === null || configState === void 0 ? void 0 : (_configState$configs10 = configState.configs) === null || _configState$configs10 === void 0 ? void 0 : (_configState$configs11 = _configState$configs10.dates_moment_format) === null || _configState$configs11 === void 0 ? void 0 : _configState$configs11.value
|
|
315
320
|
}) : t('ASAP_ABBREVIATION', 'ASAP')))), windowSize.width > 768 ? /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorHeader.OrderTypeSelectorHeader, {
|
|
316
321
|
orderTypeList: orderTypeList,
|
|
@@ -395,15 +400,15 @@ var Header = function Header(props) {
|
|
|
395
400
|
onClick: function onClick() {
|
|
396
401
|
return openModal('address');
|
|
397
402
|
}
|
|
398
|
-
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.GeoAlt, null), " ", ((_orderState$
|
|
403
|
+
}, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.GeoAlt, null), " ", ((_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : (_orderState$options12 = _orderState$options11.address) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.address) || t('WHAT_IS_YOUR_ADDRESS', 'What\'s your address?')), !isCustomerMode && (isPreOrderSetting || (configState === null || configState === void 0 ? void 0 : (_configState$configs12 = configState.configs) === null || _configState$configs12 === void 0 ? void 0 : (_configState$configs13 = _configState$configs12.preorder_status_enabled) === null || _configState$configs13 === void 0 ? void 0 : _configState$configs13.value) === undefined) && /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
399
404
|
variant: "moment",
|
|
400
|
-
momentState: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
405
|
+
momentState: orderState === null || orderState === void 0 ? void 0 : (_orderState$options13 = orderState.options) === null || _orderState$options13 === void 0 ? void 0 : _orderState$options13.moment,
|
|
401
406
|
onClick: (configState === null || configState === void 0 ? void 0 : (_configState$configs14 = configState.configs) === null || _configState$configs14 === void 0 ? void 0 : (_configState$configs15 = _configState$configs14.max_days_preorder) === null || _configState$configs15 === void 0 ? void 0 : _configState$configs15.value) === -1 || (configState === null || configState === void 0 ? void 0 : (_configState$configs16 = configState.configs) === null || _configState$configs16 === void 0 ? void 0 : (_configState$configs17 = _configState$configs16.max_days_preorder) === null || _configState$configs17 === void 0 ? void 0 : _configState$configs17.value) === 0 ? null : function (variant) {
|
|
402
407
|
return openModal(variant);
|
|
403
408
|
}
|
|
404
409
|
})) : windowSize.width >= 576 && /*#__PURE__*/_react.default.createElement(_styles.SubMenu, null, isFarAway && /*#__PURE__*/_react.default.createElement(_styles.FarAwayMessage, null, /*#__PURE__*/_react.default.createElement(_TiWarningOutline.default, null), /*#__PURE__*/_react.default.createElement("span", null, t('YOU_ARE_FAR_FROM_ADDRESS', 'You are far from this address'))), /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
405
410
|
variant: "address",
|
|
406
|
-
addressState: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
411
|
+
addressState: orderState === null || orderState === void 0 ? void 0 : (_orderState$options14 = orderState.options) === null || _orderState$options14 === void 0 ? void 0 : (_orderState$options15 = _orderState$options14.address) === null || _orderState$options15 === void 0 ? void 0 : _orderState$options15.address,
|
|
407
412
|
onClick: function onClick(variant) {
|
|
408
413
|
return openModal(variant);
|
|
409
414
|
},
|
|
@@ -412,7 +417,7 @@ var Header = function Header(props) {
|
|
|
412
417
|
}
|
|
413
418
|
}), !isCustomerMode && (isPreOrderSetting || (configState === null || configState === void 0 ? void 0 : (_configState$configs18 = configState.configs) === null || _configState$configs18 === void 0 ? void 0 : (_configState$configs19 = _configState$configs18.preorder_status_enabled) === null || _configState$configs19 === void 0 ? void 0 : _configState$configs19.value) === undefined) && /*#__PURE__*/_react.default.createElement(_HeaderOption.HeaderOption, {
|
|
414
419
|
variant: "moment",
|
|
415
|
-
momentState: orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
420
|
+
momentState: orderState === null || orderState === void 0 ? void 0 : (_orderState$options16 = orderState.options) === null || _orderState$options16 === void 0 ? void 0 : _orderState$options16.moment,
|
|
416
421
|
onClick: (configState === null || configState === void 0 ? void 0 : (_configState$configs20 = configState.configs) === null || _configState$configs20 === void 0 ? void 0 : (_configState$configs21 = _configState$configs20.max_days_preorder) === null || _configState$configs21 === void 0 ? void 0 : _configState$configs21.value) === -1 || (configState === null || configState === void 0 ? void 0 : (_configState$configs22 = configState.configs) === null || _configState$configs22 === void 0 ? void 0 : (_configState$configs23 = _configState$configs22.max_days_preorder) === null || _configState$configs23 === void 0 ? void 0 : _configState$configs23.value) === 0 ? null : function (variant) {
|
|
417
422
|
return openModal(variant);
|
|
418
423
|
}
|
|
@@ -423,7 +428,7 @@ var Header = function Header(props) {
|
|
|
423
428
|
onClose: function onClose() {
|
|
424
429
|
return setModalIsOpen(false);
|
|
425
430
|
},
|
|
426
|
-
width: modalSelected === 'address' ? orderState !== null && orderState !== void 0 && (_orderState$
|
|
431
|
+
width: modalSelected === 'address' ? orderState !== null && orderState !== void 0 && (_orderState$options17 = orderState.options) !== null && _orderState$options17 !== void 0 && _orderState$options17.user_id ? '70%' : '50%' : '700px'
|
|
427
432
|
}), modalSelected === 'cart' && /*#__PURE__*/_react.default.createElement(_CartContent.CartContent, {
|
|
428
433
|
carts: cartsWithProducts,
|
|
429
434
|
isOrderStateCarts: !!orderState.carts,
|
|
@@ -440,7 +445,7 @@ var Header = function Header(props) {
|
|
|
440
445
|
isCustomerMode: isCustomerMode
|
|
441
446
|
}) : /*#__PURE__*/_react.default.createElement(_styles.AddressFormWrapper, null, /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
|
|
442
447
|
useValidationFileds: true,
|
|
443
|
-
address: (orderState === null || orderState === void 0 ? void 0 : (_orderState$
|
|
448
|
+
address: (orderState === null || orderState === void 0 ? void 0 : (_orderState$options18 = orderState.options) === null || _orderState$options18 === void 0 ? void 0 : _orderState$options18.address) || {},
|
|
444
449
|
onCancel: function onCancel() {
|
|
445
450
|
return setModalIsOpen(false);
|
|
446
451
|
},
|
|
@@ -448,11 +453,14 @@ var Header = function Header(props) {
|
|
|
448
453
|
return setModalIsOpen(false);
|
|
449
454
|
},
|
|
450
455
|
isCustomerMode: isCustomerMode
|
|
451
|
-
}))), modalSelected === 'moment' && /*#__PURE__*/_react.default.createElement(_MomentContent.MomentContent, {
|
|
456
|
+
}))), modalSelected === 'moment' && /*#__PURE__*/_react.default.createElement(_MomentContent.MomentContent, _extends({
|
|
452
457
|
onClose: function onClose() {
|
|
453
458
|
return setModalIsOpen(false);
|
|
454
|
-
}
|
|
455
|
-
|
|
459
|
+
},
|
|
460
|
+
cateringPreorder: !!cateringTypeString,
|
|
461
|
+
isHeader: true,
|
|
462
|
+
business: pathname.includes('store') && business
|
|
463
|
+
}, cateringValues)), modalSelected === 'delivery' && /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorContent.OrderTypeSelectorContent, {
|
|
456
464
|
onClose: function onClose() {
|
|
457
465
|
return setModalIsOpen(false);
|
|
458
466
|
},
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.UserEdit = exports.SubMenu = exports.RightHeader = exports.MomentMenu = exports.MenuLink = exports.MenuItem = exports.Menu = exports.LogoHeader = exports.LeftSide = exports.LeftHeader = exports.LanguageSelectorWrapper = exports.InputGroup = exports.InnerHeader = exports.HeaderSearchMode = exports.Header = exports.FarAwayMessage = exports.Divider = exports.CustomerInfo = exports.AddressMenu = exports.AddressFormWrapper = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
var _polished = require("polished");
|
|
10
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33;
|
|
10
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34;
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
13
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
@@ -36,7 +36,7 @@ var InnerHeader = _styledComponents.default.div(_templateObject3 || (_templateOb
|
|
|
36
36
|
return (theme === null || theme === void 0 ? void 0 : (_theme$header4 = theme.header) === null || _theme$header4 === void 0 ? void 0 : (_theme$header4$compon = _theme$header4.components) === null || _theme$header4$compon === void 0 ? void 0 : (_theme$header4$compon2 = _theme$header4$compon.layout) === null || _theme$header4$compon2 === void 0 ? void 0 : _theme$header4$compon2.type) === 'starbucks' ? '30%' : 'initial';
|
|
37
37
|
});
|
|
38
38
|
exports.InnerHeader = InnerHeader;
|
|
39
|
-
var LogoHeader = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n cursor: pointer;\n img {\n width: ", ";\n height: ", ";\n margin: 0;\n vertical-align: middle;\n margin-left: 10px;\n ", "\n @media (min-width: 769px) {\n width: ", ";\n height: ", ";\n }\n }\n ", "\n @media (min-width: 769px) {\n img:nth-child(1) {\n display: block;\n }\n img:nth-child(2) {\n display: none;\n }\n }\n"])), function (props) {
|
|
39
|
+
var LogoHeader = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n cursor: pointer;\n img {\n width: ", ";\n height: ", ";\n margin: 0;\n vertical-align: middle;\n margin-left: 10px;\n ", "\n @media (min-width: 769px) {\n ", ";\n width: ", ";\n height: ", ";\n }\n }\n ", "\n @media (min-width: 769px) {\n img:nth-child(1) {\n display: block;\n }\n img:nth-child(2) {\n display: none;\n }\n }\n"])), function (props) {
|
|
40
40
|
var _props$imgW;
|
|
41
41
|
return props.isChew ? '70px' : (_props$imgW = props.imgW) !== null && _props$imgW !== void 0 ? _props$imgW : '35px';
|
|
42
42
|
}, function (props) {
|
|
@@ -45,33 +45,37 @@ var LogoHeader = _styledComponents.default.div(_templateObject4 || (_templateObj
|
|
|
45
45
|
}, function (props) {
|
|
46
46
|
var _props$theme2;
|
|
47
47
|
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-right: 10px;\n margin-left: 0;\n "])));
|
|
48
|
+
}, function (_ref5) {
|
|
49
|
+
var _ref6, _theme$header5, _theme$header5$compon, _theme$header5$compon2, _theme$header5$compon3, _theme$header5$compon4;
|
|
50
|
+
var theme = _ref5.theme;
|
|
51
|
+
return ((_ref6 = ['center', 'right']) === null || _ref6 === void 0 ? void 0 : _ref6.includes(theme === null || theme === void 0 ? void 0 : (_theme$header5 = theme.header) === null || _theme$header5 === void 0 ? void 0 : (_theme$header5$compon = _theme$header5.components) === null || _theme$header5$compon === void 0 ? void 0 : (_theme$header5$compon2 = _theme$header5$compon.logo) === null || _theme$header5$compon2 === void 0 ? void 0 : (_theme$header5$compon3 = _theme$header5$compon2.components) === null || _theme$header5$compon3 === void 0 ? void 0 : (_theme$header5$compon4 = _theme$header5$compon3.layout) === null || _theme$header5$compon4 === void 0 ? void 0 : _theme$header5$compon4.position)) && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-right: 30px;\n "])));
|
|
48
52
|
}, function (props) {
|
|
49
53
|
var _props$imgW2;
|
|
50
54
|
return (_props$imgW2 = props.imgW) !== null && _props$imgW2 !== void 0 ? _props$imgW2 : '150px';
|
|
51
55
|
}, function (props) {
|
|
52
56
|
return props.isChew && '35px';
|
|
53
57
|
}, function (props) {
|
|
54
|
-
return !props.disabledResponsive && (0, _styledComponents.css)(
|
|
58
|
+
return !props.disabledResponsive && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n img:nth-child(1) {\n display: none;\n }\n "])));
|
|
55
59
|
});
|
|
56
60
|
exports.LogoHeader = LogoHeader;
|
|
57
|
-
var LeftHeader = _styledComponents.default.div(
|
|
61
|
+
var LeftHeader = _styledComponents.default.div(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n align-self: center;\n display: flex;\n align-items: center;\n"])));
|
|
58
62
|
exports.LeftHeader = LeftHeader;
|
|
59
|
-
var RightHeader = _styledComponents.default.div(
|
|
63
|
+
var RightHeader = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n align-self: center;\n display: flex;\n #select-input {\n div {\n color: ", ";\n }\n }\n"])), function (props) {
|
|
60
64
|
return props.theme.colors.darkTextColor;
|
|
61
65
|
});
|
|
62
66
|
exports.RightHeader = RightHeader;
|
|
63
|
-
var Menu = _styledComponents.default.div(
|
|
64
|
-
var isCustomerMode =
|
|
65
|
-
return !isCustomerMode && (0, _styledComponents.css)(
|
|
67
|
+
var Menu = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin-right: 10px;\n #select-input {\n border-radius: 7.6px;\n #list {\n border-radius: 7.6px;\n }\n ", "\n }\n &.left-header {\n background: #F8F9FA;\n border: none;\n box-sizing: border-box;\n border-radius: ", ";\n margin: 0 20px;\n flex-grow: 1;\n padding: 0 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 44px;\n @media (min-width: 850px) {\n border: 1px solid #DEE2E6;\n justify-content: space-between;\n }\n @media (min-width: 1024px) {\n padding: 0 20px;\n margin-left: 45px;\n }\n @media (min-width: 1200px) {\n padding: 0 30px;\n margin-left: 50px;\n }\n @media (min-width: 1500px) {\n padding: 0 30px;\n margin: 0 75px;\n }\n }\n > *:not(:last-child) {\n margin: 0 5px;\n }\n > span {\n #select-input {\n background: transparent !important;\n }\n }\n .moment-popover {\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n @media (min-width: 1175px) {\n width: 250px;\n }\n \n @media (min-width: 1400px) {\n width: 400px;\n }\n > div:first-child {\n width: 100%;\n display: flex;\n justify-content: center;\n }\n }\n .address-popover {\n flex-grow: 1;\n display: none;\n > div:first-child {\n width: 100%;\n }\n }\n .order-type {\n padding: 0 10px;\n @media (min-width: 1200px) {\n padding: 0 20px;\n }\n }\n @media (min-width: 850px) {\n .moment-popover,\n .address-popover {\n display: flex;\n }\n }\n"])), function (_ref7) {
|
|
68
|
+
var isCustomerMode = _ref7.isCustomerMode;
|
|
69
|
+
return !isCustomerMode && (0, _styledComponents.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n margin: 0px 5px;\n height: 40px;\n svg {\n font-size: 16px;\n }\n > div:first-child {\n height: 100%;\n padding-left: 10px;\n padding-right: 10px;\n @media (min-width: 993px) {\n padding-left: 13px;\n padding-right: 13px;\n }\n }\n "])));
|
|
66
70
|
}, function (props) {
|
|
67
71
|
return props.isChew ? '8px' : '50px';
|
|
68
72
|
});
|
|
69
73
|
exports.Menu = Menu;
|
|
70
|
-
var MenuItem = _styledComponents.default.div(
|
|
74
|
+
var MenuItem = _styledComponents.default.div(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
71
75
|
exports.MenuItem = MenuItem;
|
|
72
|
-
var MenuLink = _styledComponents.default.a(
|
|
73
|
-
var highlight =
|
|
74
|
-
return highlight && (0, _styledComponents.css)(
|
|
76
|
+
var MenuLink = _styledComponents.default.a(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n text-decoration: none;\n font-size: 14px;\n padding: 10px;\n color: #333;\n cursor: pointer;\n ", "\n"])), function (_ref8) {
|
|
77
|
+
var highlight = _ref8.highlight;
|
|
78
|
+
return highlight && (0, _styledComponents.css)(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n background-color: ", ";\n color: ", ";\n border-radius: 7.6px;\n padding: 11px 15px;\n &:hover {\n background: ", ";\n color: #FFF;\n }\n "])), function (props) {
|
|
75
79
|
return props.theme.colors.primary;
|
|
76
80
|
}, function (props) {
|
|
77
81
|
return props.theme.colors.primaryContrast;
|
|
@@ -80,68 +84,68 @@ var MenuLink = _styledComponents.default.a(_templateObject12 || (_templateObject
|
|
|
80
84
|
});
|
|
81
85
|
});
|
|
82
86
|
exports.MenuLink = MenuLink;
|
|
83
|
-
var SubMenu = (0, _styledComponents.default)(InnerHeader)(
|
|
87
|
+
var SubMenu = (0, _styledComponents.default)(InnerHeader)(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n justify-content: space-between;\n padding: 0px 20px 7px;\n box-sizing: border-box;\n margin: 0px;\n position: relative;\n @media (min-width: 850px) {\n display: none;\n }\n"])));
|
|
84
88
|
exports.SubMenu = SubMenu;
|
|
85
|
-
var CustomerInfo = _styledComponents.default.div(
|
|
89
|
+
var CustomerInfo = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n display: none;\n cursor: pointer;\n flex: 1;\n position: relative;\n @media (min-width: 450px) {\n display: flex;\n justify-content: center;\n align-items: center;\n span {\n display: flex;\n align-items: center;\n margin: 0;\n p {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #909BA9;\n }\n svg {\n color: #748194;\n margin: 0;\n font-size: 20px;\n position: absolute;\n right: 0;\n }\n }\n }\n"])));
|
|
86
90
|
exports.CustomerInfo = CustomerInfo;
|
|
87
|
-
var UserEdit = _styledComponents.default.div(
|
|
91
|
+
var UserEdit = _styledComponents.default.div(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n > :first-child{\n margin-bottom: 20px;\n }\n"])));
|
|
88
92
|
exports.UserEdit = UserEdit;
|
|
89
|
-
var AddressMenu = _styledComponents.default.div(
|
|
93
|
+
var AddressMenu = _styledComponents.default.div(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n cursor: pointer;\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n display: flex;\n align-items: center;\n position: relative;\n span {\n width: 85%;\n p {\n margin: 0;\n padding: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n }\n }\n ", "\n svg {\n color: ", ";\n font-size: 16px;\n margin-right: 10px;\n ", "\n }\n @media (min-width: 765px) {\n ", "\n }\n @media (min-width: 820px) {\n ", "\n }\n"])), function (props) {
|
|
90
94
|
var _props$theme$colors, _props$theme$colors2;
|
|
91
95
|
return props.isChew ? (_props$theme$colors = props.theme.colors) === null || _props$theme$colors === void 0 ? void 0 : _props$theme$colors.backgroundPage : (_props$theme$colors2 = props.theme.colors) === null || _props$theme$colors2 === void 0 ? void 0 : _props$theme$colors2.headingColor;
|
|
92
|
-
}, function (
|
|
93
|
-
var isCustomerMode =
|
|
94
|
-
return isCustomerMode ? (0, _styledComponents.css)(
|
|
96
|
+
}, function (_ref9) {
|
|
97
|
+
var isCustomerMode = _ref9.isCustomerMode;
|
|
98
|
+
return isCustomerMode ? (0, _styledComponents.css)(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n flex: 0.8;\n "]))) : (0, _styledComponents.css)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n width: 50%;\n "])));
|
|
95
99
|
}, function (props) {
|
|
96
100
|
var _props$theme$colors3;
|
|
97
101
|
return (_props$theme$colors3 = props.theme.colors) === null || _props$theme$colors3 === void 0 ? void 0 : _props$theme$colors3.lightGray;
|
|
98
102
|
}, function (props) {
|
|
99
103
|
var _props$theme3;
|
|
100
|
-
return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.rtl) && (0, _styledComponents.css)(
|
|
101
|
-
}, function (
|
|
102
|
-
var isCustomerMode =
|
|
103
|
-
return !isCustomerMode && (0, _styledComponents.css)(
|
|
104
|
-
}, function (
|
|
105
|
-
var isCustomerMode =
|
|
106
|
-
return !isCustomerMode && (0, _styledComponents.css)(
|
|
104
|
+
return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.rtl) && (0, _styledComponents.css)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n margin-left: 10px;\n margin-right: 0;\n "])));
|
|
105
|
+
}, function (_ref10) {
|
|
106
|
+
var isCustomerMode = _ref10.isCustomerMode;
|
|
107
|
+
return !isCustomerMode && (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n width: 80%;\n "])));
|
|
108
|
+
}, function (_ref11) {
|
|
109
|
+
var isCustomerMode = _ref11.isCustomerMode;
|
|
110
|
+
return !isCustomerMode && (0, _styledComponents.css)(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n width: 50%;\n "])));
|
|
107
111
|
});
|
|
108
112
|
exports.AddressMenu = AddressMenu;
|
|
109
|
-
var MomentMenu = _styledComponents.default.div(
|
|
113
|
+
var MomentMenu = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n border-left: 1px solid #DEE2E6;\n border-right: 1px solid #DEE2E6;\n height: 100%;\n justify-content: center;\n width: 200px;\n display: none;\n \n @media (min-width: 850px) {\n display: flex;\n }\n @media (min-width: 1175px) {\n width: 250px;\n }\n @media (min-width: 1400px) {\n width: 400px;\n }\n > div {\n cursor: pointer;\n font-size: 14px;\n color: #909BA9;\n display: flex;\n align-items: center;\n text-align: center;\n white-space: nowrap;\n padding: 0 10px;\n }\n"])));
|
|
110
114
|
exports.MomentMenu = MomentMenu;
|
|
111
|
-
var FarAwayMessage = _styledComponents.default.div(
|
|
115
|
+
var FarAwayMessage = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n display: flex;\n align-items: center;\n z-index: 2000;\n top: 100%;\n background: ", ";\n border: 1px solid ", ";\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);\n border-radius: 7.6px;\n padding: 6px 15px;\n box-sizing: border-box;\n margin: 10px 0px 0px 0px !important;\n left: 5px;\n ", "\n svg {\n font-size: 20px;\n color: ", ";\n margin-right: 10px;\n ", "\n }\n span {\n font-size: 12px;\n line-height: 18px;\n color: ", ";\n }\n @media (min-width: 400px) {\n padding: 8px 20px;\n font-size: 14px;\n line-height: 24px;\n left: 10px;\n ", "\n }\n"])), function (props) {
|
|
112
116
|
return props.theme.colors.warning100;
|
|
113
117
|
}, function (props) {
|
|
114
118
|
return props.theme.colors.warning500;
|
|
115
119
|
}, function (props) {
|
|
116
120
|
var _props$theme4;
|
|
117
|
-
return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(
|
|
121
|
+
return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n right: 5px;\n left: initial;\n "])));
|
|
118
122
|
}, function (props) {
|
|
119
123
|
return props.theme.colors.warning500;
|
|
120
124
|
}, function (props) {
|
|
121
125
|
var _props$theme5;
|
|
122
|
-
return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(
|
|
126
|
+
return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n margin-right: auto;\n margin-left: 10px;\n "])));
|
|
123
127
|
}, function (props) {
|
|
124
128
|
return props.theme.colors.headingColor;
|
|
125
129
|
}, function (props) {
|
|
126
130
|
var _props$theme6;
|
|
127
|
-
return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(
|
|
131
|
+
return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n right: 10px;\n left: initial;\n "])));
|
|
128
132
|
});
|
|
129
133
|
exports.FarAwayMessage = FarAwayMessage;
|
|
130
|
-
var Divider = _styledComponents.default.div(
|
|
134
|
+
var Divider = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n border: 1px solid #DEE2E6;\n height: 100%;\n"])));
|
|
131
135
|
exports.Divider = Divider;
|
|
132
|
-
var AddressFormWrapper = _styledComponents.default.div(
|
|
136
|
+
var AddressFormWrapper = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n @media (min-width: 450px) {\n margin-top: 20px;\n }\n"])));
|
|
133
137
|
exports.AddressFormWrapper = AddressFormWrapper;
|
|
134
|
-
var InputGroup = _styledComponents.default.div(
|
|
138
|
+
var InputGroup = _styledComponents.default.div(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n p {\n font-weight: 500;\n font-size: 20px;\n color: ", ";\n width: 100%;\n text-align: left;\n margin: 0 0 7px 0;\n }\n"])), function (props) {
|
|
135
139
|
return props.theme.colors.darkTextColor;
|
|
136
140
|
});
|
|
137
141
|
exports.InputGroup = InputGroup;
|
|
138
|
-
var LanguageSelectorWrapper = (0, _styledComponents.default)(InputGroup)(
|
|
142
|
+
var LanguageSelectorWrapper = (0, _styledComponents.default)(InputGroup)(_templateObject32 || (_templateObject32 = _taggedTemplateLiteral(["\n > div {\n border-radius: 7.6px;\n text-align: left;\n background: #F8F9FA !important;\n border-color: #F8F9FA;\n background-color: #F8F9FA !important;\n height: 44px;\n > div:first-child {\n height: 44px;\n }\n #list {\n border-radius: 7.6px;\n background: #F8F9FA !important;\n border-color: #F8F9FA;\n }\n }\n #select-input {\n margin-left: 5px;\n }\n"])));
|
|
139
143
|
exports.LanguageSelectorWrapper = LanguageSelectorWrapper;
|
|
140
|
-
var HeaderSearchMode = _styledComponents.default.div(
|
|
144
|
+
var HeaderSearchMode = _styledComponents.default.div(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n width: 300px;\n input {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n @media (min-width: 1400px){\n width: 300px;\n }\n @media (min-width: 1200px){\n width: 250px;\n }\n"])));
|
|
141
145
|
exports.HeaderSearchMode = HeaderSearchMode;
|
|
142
|
-
var LeftSide = _styledComponents.default.div(
|
|
143
|
-
var _theme$
|
|
144
|
-
var theme =
|
|
145
|
-
return (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
146
|
+
var LeftSide = _styledComponents.default.div(_templateObject34 || (_templateObject34 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n @media (min-width: 769px){\n flex-direction: ", ";\n width: 60%;\n }\n"])), function (_ref12) {
|
|
147
|
+
var _ref13, _theme$header6, _theme$header6$compon, _theme$header6$compon2, _theme$header6$compon3, _theme$header6$compon4;
|
|
148
|
+
var theme = _ref12.theme;
|
|
149
|
+
return (_ref13 = ['center', 'right']) !== null && _ref13 !== void 0 && _ref13.includes(theme === null || theme === void 0 ? void 0 : (_theme$header6 = theme.header) === null || _theme$header6 === void 0 ? void 0 : (_theme$header6$compon = _theme$header6.components) === null || _theme$header6$compon === void 0 ? void 0 : (_theme$header6$compon2 = _theme$header6$compon.logo) === null || _theme$header6$compon2 === void 0 ? void 0 : (_theme$header6$compon3 = _theme$header6$compon2.components) === null || _theme$header6$compon3 === void 0 ? void 0 : (_theme$header6$compon4 = _theme$header6$compon3.layout) === null || _theme$header6$compon4 === void 0 ? void 0 : _theme$header6$compon4.position) ? 'row-reverse' : 'row';
|
|
146
150
|
});
|
|
147
151
|
exports.LeftSide = LeftSide;
|
|
@@ -42,7 +42,7 @@ var mapConfigs = {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
var MultiCheckoutUI = function MultiCheckoutUI(props) {
|
|
45
|
-
var _Object$values, _cartGroup$result, _paymethodSelected$pa, _cardList$cards, _configs$checkout_mul, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _configs$multi_busine, _configs$driver_tip_o4, _configs$driver_tip_o5, _loyaltyPlansState$re,
|
|
45
|
+
var _Object$values, _cartGroup$result, _paymethodSelected$pa, _cardList$cards, _configs$checkout_mul, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _configs$multi_busine, _configs$driver_tip_o4, _configs$driver_tip_o5, _loyaltyPlansState$re, _creditPointGeneralPl, _creditPointGeneralPl2, _configs$google_maps_, _customerState$user, _cartGroup$result2, _cartGroup$result3, _validationFields$fie9, _validationFields$fie10, _validationFields$fie11, _configs$multi_busine2, _validationFields$fie12, _validationFields$fie13, _validationFields$fie14, _configs$driver_tip_t, _configs$driver_tip_u, _configs$driver_tip_t2, _openCarts$, _openCarts$2, _configs$multi_busine6, _configs$multi_busine7;
|
|
46
46
|
var placing = props.placing,
|
|
47
47
|
isCustomerMode = props.isCustomerMode,
|
|
48
48
|
openCarts = props.openCarts,
|
|
@@ -111,20 +111,19 @@ var MultiCheckoutUI = function MultiCheckoutUI(props) {
|
|
|
111
111
|
var isMultiDriverTips = (configs === null || configs === void 0 ? void 0 : (_configs$checkout_mul = configs.checkout_multi_business_enabled) === null || _configs$checkout_mul === void 0 ? void 0 : _configs$checkout_mul.value) === '1';
|
|
112
112
|
var driverTipsOptions = typeof (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o = configs.driver_tip_options) === null || _configs$driver_tip_o === void 0 ? void 0 : _configs$driver_tip_o.value) === 'string' ? JSON.parse(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o2 = configs.driver_tip_options) === null || _configs$driver_tip_o2 === void 0 ? void 0 : _configs$driver_tip_o2.value) || [] : (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o3 = configs.driver_tip_options) === null || _configs$driver_tip_o3 === void 0 ? void 0 : _configs$driver_tip_o3.value) || [];
|
|
113
113
|
var totalFeeEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$multi_busine = configs.multi_business_checkout_show_combined_delivery_fee) === null || _configs$multi_busine === void 0 ? void 0 : _configs$multi_busine.value) === '1' ? JSON.parse(configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o4 = configs.driver_tip_options) === null || _configs$driver_tip_o4 === void 0 ? void 0 : _configs$driver_tip_o4.value) || [] : (configs === null || configs === void 0 ? void 0 : (_configs$driver_tip_o5 = configs.driver_tip_options) === null || _configs$driver_tip_o5 === void 0 ? void 0 : _configs$driver_tip_o5.value) || [];
|
|
114
|
-
var
|
|
114
|
+
var creditPointGeneralPlan = loyaltyPlansState === null || loyaltyPlansState === void 0 ? void 0 : (_loyaltyPlansState$re = loyaltyPlansState.result) === null || _loyaltyPlansState$re === void 0 ? void 0 : _loyaltyPlansState$re.find(function (loyal) {
|
|
115
115
|
return loyal.type === 'credit_point';
|
|
116
116
|
});
|
|
117
|
-
var
|
|
118
|
-
return cart.business_id;
|
|
119
|
-
});
|
|
120
|
-
var loyalBusinessIds = (_creditPointPlan$busi = creditPointPlan === null || creditPointPlan === void 0 ? void 0 : (_creditPointPlan$busi2 = creditPointPlan.businesses) === null || _creditPointPlan$busi2 === void 0 ? void 0 : _creditPointPlan$busi2.filter(function (b) {
|
|
117
|
+
var loyalBusinessAvailable = (_creditPointGeneralPl = creditPointGeneralPlan === null || creditPointGeneralPlan === void 0 ? void 0 : (_creditPointGeneralPl2 = creditPointGeneralPlan.businesses) === null || _creditPointGeneralPl2 === void 0 ? void 0 : _creditPointGeneralPl2.filter(function (b) {
|
|
121
118
|
return b.accumulates;
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
})) !== null && _creditPointGeneralPl !== void 0 ? _creditPointGeneralPl : [];
|
|
120
|
+
var accumulationRateBusiness = function accumulationRateBusiness(businessId) {
|
|
121
|
+
var _loyalBusinessAvailab, _loyalBusinessAvailab2, _creditPointGeneralPl3;
|
|
122
|
+
var value = (_loyalBusinessAvailab = loyalBusinessAvailable === null || loyalBusinessAvailable === void 0 ? void 0 : (_loyalBusinessAvailab2 = loyalBusinessAvailable.find(function (loyal) {
|
|
123
|
+
return loyal.business_id === businessId;
|
|
124
|
+
})) === null || _loyalBusinessAvailab2 === void 0 ? void 0 : _loyalBusinessAvailab2.accumulation_rate) !== null && _loyalBusinessAvailab !== void 0 ? _loyalBusinessAvailab : 0;
|
|
125
|
+
return value || ((_creditPointGeneralPl3 = creditPointGeneralPlan === null || creditPointGeneralPlan === void 0 ? void 0 : creditPointGeneralPlan.accumulation_rate) !== null && _creditPointGeneralPl3 !== void 0 ? _creditPointGeneralPl3 : 0);
|
|
126
|
+
};
|
|
128
127
|
var getIncludedTaxes = function getIncludedTaxes(cart) {
|
|
129
128
|
if ((cart === null || cart === void 0 ? void 0 : cart.taxes) === null || !(cart !== null && cart !== void 0 && cart.taxes)) {
|
|
130
129
|
var _cart$business;
|
|
@@ -136,10 +135,13 @@ var MultiCheckoutUI = function MultiCheckoutUI(props) {
|
|
|
136
135
|
}, 0);
|
|
137
136
|
}
|
|
138
137
|
};
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
var clearAmount = function clearAmount(value) {
|
|
139
|
+
var _configs$format_numbe, _configs$format_numbe2;
|
|
140
|
+
return parseFloat((Math.trunc(value * 100) / 100).toFixed((_configs$format_numbe = (_configs$format_numbe2 = configs.format_number_decimal_length) === null || _configs$format_numbe2 === void 0 ? void 0 : _configs$format_numbe2.value) !== null && _configs$format_numbe !== void 0 ? _configs$format_numbe : 2));
|
|
141
|
+
};
|
|
142
|
+
var loyaltyRewardValue = openCarts.reduce(function (sum, cart) {
|
|
143
|
+
return sum + clearAmount(((cart === null || cart === void 0 ? void 0 : cart.subtotal) + getIncludedTaxes(cart)) * accumulationRateBusiness(cart === null || cart === void 0 ? void 0 : cart.business_id));
|
|
144
|
+
}, 0);
|
|
143
145
|
var handlePlaceOrder = function handlePlaceOrder() {
|
|
144
146
|
if (!userErrors.length) {
|
|
145
147
|
handleGroupPlaceOrder && handleGroupPlaceOrder();
|
|
@@ -13,6 +13,7 @@ var _AiFillExclamationCircle = _interopRequireDefault(require("@meronex/icons/ai
|
|
|
13
13
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
14
14
|
var _Buttons = require("../../styles/Buttons");
|
|
15
15
|
var _Modal = require("../Modal");
|
|
16
|
+
var _OrderEta = require("../OrderDetails/OrderEta");
|
|
16
17
|
var _styles = require("./styles");
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -29,7 +30,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
29
30
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
30
31
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
32
|
var SingleOrderCardUI = function SingleOrderCardUI(props) {
|
|
32
|
-
var _configs$multi_busine, _orderTypes$find, _order$business, _theme$images, _theme$images$dummies, _order$business2, _order$business3, _order$business4, _order$business5, _getOrderStatus, _getOrderStatus2, _order$summary$total, _order$summary;
|
|
33
|
+
var _configs$multi_busine, _orderTypes$find, _order$reporting_data, _order$business, _theme$images, _theme$images$dummies, _order$business2, _order$business3, _order$business4, _order$business5, _getOrderStatus, _getOrderStatus2, _order$summary$total, _order$summary;
|
|
33
34
|
var orderTypes = props.orderTypes,
|
|
34
35
|
readMessages = props.readMessages,
|
|
35
36
|
messages = props.messages,
|
|
@@ -67,6 +68,7 @@ var SingleOrderCardUI = function SingleOrderCardUI(props) {
|
|
|
67
68
|
unreadAlert = _useState4[0],
|
|
68
69
|
setUnreadAlert = _useState4[1];
|
|
69
70
|
var hideIndividualButton = ((_configs$multi_busine = configs.multi_business_checkout_remove_individual_buttons) === null || _configs$multi_busine === void 0 ? void 0 : _configs$multi_busine.value) === '1';
|
|
71
|
+
var activeStatus = [0, 3, 4, 7, 8, 9, 14, 18, 19, 20, 21, 22, 23];
|
|
70
72
|
var handleGoToOrderDetails = function handleGoToOrderDetails(uuid) {
|
|
71
73
|
events.emit('go_to_page', {
|
|
72
74
|
page: 'order_detail',
|
|
@@ -111,9 +113,9 @@ var SingleOrderCardUI = function SingleOrderCardUI(props) {
|
|
|
111
113
|
return (order === null || order === void 0 ? void 0 : order.delivery_type) === (type === null || type === void 0 ? void 0 : type.value);
|
|
112
114
|
})) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.text, ":"), /*#__PURE__*/_react.default.createElement("p", {
|
|
113
115
|
className: "date"
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
})))), !hideIndividualButton && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
116
|
+
}, activeStatus.includes(order === null || order === void 0 ? void 0 : order.status) ? /*#__PURE__*/_react.default.createElement(_OrderEta.OrderEta, {
|
|
117
|
+
order: order
|
|
118
|
+
}) : parseDate(order === null || order === void 0 ? void 0 : (_order$reporting_data = order.reporting_data) === null || _order$reporting_data === void 0 ? void 0 : _order$reporting_data.at["status:".concat(order.status)])))), !hideIndividualButton && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
117
119
|
outline: true,
|
|
118
120
|
color: "primary",
|
|
119
121
|
onClick: function onClick() {
|