ordering-ui-external 10.1.0 → 10.2.1
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.e9827c5566d8cce0eaa4.js → 0.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{1.ordering-ui.e9827c5566d8cce0eaa4.js → 1.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{2.ordering-ui.e9827c5566d8cce0eaa4.js → 2.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{4.ordering-ui.e9827c5566d8cce0eaa4.js → 4.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{5.ordering-ui.e9827c5566d8cce0eaa4.js → 5.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{6.ordering-ui.e9827c5566d8cce0eaa4.js → 6.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +2 -2
- package/_bundles/{8.ordering-ui.e9827c5566d8cce0eaa4.js → 8.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/{9.ordering-ui.e9827c5566d8cce0eaa4.js → 9.ordering-ui.d1a8d1fbf5b112d5d9a9.js} +1 -1
- package/_bundles/ordering-ui.d1a8d1fbf5b112d5d9a9.js +2 -0
- package/_modules/components/BusinessBasicInformation/index.js +7 -10
- package/_modules/components/OrderDetails/index.js +14 -17
- package/_modules/components/ProductItemAccordion/index.js +4 -5
- package/_modules/components/RenderProductsLayout/SearchProducts/index.js +2 -5
- package/_modules/components/UserFormDetails/index.js +7 -8
- package/_modules/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/components/UserProfileForm/index.js +10 -11
- package/_modules/contexts/ThemeContext/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/index.js +0 -3
- package/_modules/themes/five/src/components/BusinessController/index.js +14 -17
- package/_modules/themes/five/src/components/BusinessController/styles.js +1 -1
- package/_modules/themes/five/src/components/BusinessInformation/styles.js +19 -14
- package/_modules/themes/five/src/components/BusinessPreorder/index.js +51 -10
- package/_modules/themes/five/src/components/BusinessPreorder/styles.js +32 -25
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +2 -5
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +11 -4
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +11 -12
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +22 -3
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +5 -10
- package/_modules/themes/five/src/components/Cart/index.js +17 -9
- package/_modules/themes/five/src/components/CartPopover/index.js +4 -7
- package/_modules/themes/five/src/components/CartPopover/styles.js +4 -1
- package/_modules/themes/five/src/components/Checkout/index.js +8 -8
- package/_modules/themes/five/src/components/Confirm/styles.js +16 -13
- package/_modules/themes/five/src/components/DatePicker/index.js +2 -1
- package/_modules/themes/five/src/components/Favorite/index.js +4 -5
- package/_modules/themes/five/src/components/Footer/index.js +2 -3
- package/_modules/themes/five/src/components/Header/index.js +5 -8
- package/_modules/themes/five/src/components/HeaderOption/index.js +4 -5
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -10
- package/_modules/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/src/components/Modal/styles.js +4 -2
- package/_modules/themes/five/src/components/MomentContent/index.js +16 -6
- package/_modules/themes/five/src/components/MomentControl/index.js +44 -34
- package/_modules/themes/five/src/components/MomentControl/styles.js +49 -27
- package/_modules/themes/five/src/components/OrderDetails/index.js +31 -24
- package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -7
- package/_modules/themes/five/src/components/OrderProgress/index.js +5 -1
- package/_modules/themes/five/src/components/OrderTypeSelectorContent/index.js +11 -1
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -5
- package/_modules/themes/five/src/components/OrdersOption/index.js +7 -22
- package/_modules/themes/five/src/components/OrdersOption/styles.js +38 -35
- package/_modules/themes/five/src/components/PageBanner/index.js +79 -58
- package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +2 -1
- package/_modules/themes/five/src/components/ProductForm/styles.js +12 -9
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +0 -3
- package/_modules/themes/five/src/components/ProductOption/styles.js +4 -1
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +8 -9
- package/_modules/themes/five/src/components/SignUpForm/index.js +5 -5
- package/_modules/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +0 -3
- package/_modules/themes/five/src/components/UserDetails/index.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/styles.js +1 -1
- package/_modules/themes/five/src/components/UserFormDetails/index.js +3 -6
- package/_modules/themes/five/src/components/UserPopover/index.js +3 -6
- package/_modules/themes/five/src/components/UserPopover/styles.js +8 -5
- package/_modules/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -5
- package/_modules/themes/five/src/components/UserProfileForm/index.js +2 -5
- package/_modules/themes/six/src/components/BusinessBasicInformation/index.js +8 -9
- package/_modules/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +3 -6
- package/package.json +2 -2
- package/src/components/BusinessBasicInformation/index.js +7 -8
- package/src/components/OrderDetails/index.js +14 -16
- package/src/components/ProductItemAccordion/index.js +4 -3
- package/src/components/RenderProductsLayout/SearchProducts/index.js +2 -3
- package/src/components/UserFormDetails/index.js +6 -5
- package/src/components/UserProfileForm/ProfileOptions/index.js +4 -4
- package/src/components/UserProfileForm/index.js +10 -10
- package/src/contexts/ThemeContext/index.js +1 -1
- package/src/themes/five/src/components/AddressForm/index.js +1 -2
- package/src/themes/five/src/components/AddressList/index.js +1 -3
- package/src/themes/five/src/components/BusinessController/index.js +5 -7
- package/src/themes/five/src/components/BusinessController/styles.js +1 -1
- package/src/themes/five/src/components/BusinessInformation/index.js +1 -2
- package/src/themes/five/src/components/BusinessInformation/styles.js +2 -2
- package/src/themes/five/src/components/BusinessPreorder/index.js +61 -10
- package/src/themes/five/src/components/BusinessPreorder/styles.js +93 -43
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +2 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +1 -2
- package/src/themes/five/src/components/BusinessProductsListing/index.js +10 -3
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +1 -1
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/OrdersSection/index.js +17 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +6 -7
- package/src/themes/five/src/components/Cart/index.js +11 -4
- package/src/themes/five/src/components/CartPopover/index.js +2 -3
- package/src/themes/five/src/components/CartPopover/styles.js +1 -1
- package/src/themes/five/src/components/Checkout/index.js +5 -6
- package/src/themes/five/src/components/Confirm/styles.js +1 -1
- package/src/themes/five/src/components/DatePicker/index.js +1 -0
- package/src/themes/five/src/components/Favorite/index.js +4 -3
- package/src/themes/five/src/components/Footer/index.js +3 -2
- package/src/themes/five/src/components/Header/index.js +4 -5
- package/src/themes/five/src/components/HeaderOption/index.js +4 -3
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +7 -8
- package/src/themes/five/src/components/HorizontalOrdersLayout/styles.js +1 -0
- package/src/themes/five/src/components/Modal/styles.js +1 -1
- package/src/themes/five/src/components/MomentContent/index.js +17 -8
- package/src/themes/five/src/components/MomentControl/index.js +83 -45
- package/src/themes/five/src/components/MomentControl/styles.js +137 -34
- package/src/themes/five/src/components/MyOrders/index.js +1 -1
- package/src/themes/five/src/components/OrderDetails/index.js +50 -21
- package/src/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +4 -6
- package/src/themes/five/src/components/OrderProgress/index.js +5 -1
- package/src/themes/five/src/components/OrderTypeSelectorContent/index.js +13 -1
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +4 -3
- package/src/themes/five/src/components/OrdersOption/index.js +3 -17
- package/src/themes/five/src/components/OrdersOption/styles.js +3 -4
- package/src/themes/five/src/components/PageBanner/index.js +65 -51
- package/src/themes/five/src/components/PhoneAutocomplete/index.js +1 -0
- package/src/themes/five/src/components/ProductForm/styles.js +1 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +1 -2
- package/src/themes/five/src/components/ProductOption/styles.js +1 -1
- package/src/themes/five/src/components/RenderProductsLayout/index.js +9 -6
- package/src/themes/five/src/components/SignUpForm/index.js +6 -6
- package/src/themes/five/src/components/SingleProductCard/layouts/starbucks/index.js +1 -2
- package/src/themes/five/src/components/UserDetails/index.js +1 -1
- package/src/themes/five/src/components/UserDetails/styles.js +3 -0
- package/src/themes/five/src/components/UserFormDetails/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/index.js +3 -4
- package/src/themes/five/src/components/UserPopover/styles.js +1 -1
- package/src/themes/five/src/components/UserProfileForm/ProfileOptions/index.js +4 -3
- package/src/themes/five/src/components/UserProfileForm/index.js +2 -4
- package/src/themes/six/src/components/BusinessBasicInformation/index.js +8 -7
- package/src/themes/six/src/components/BusinessProductsListing/SearchProducts/index.js +2 -3
- package/template/app.js +15 -10
- package/template/components/HelmetTags/index.js +3 -2
- package/template/pages/AddressList/index.js +4 -3
- package/template/pages/BusinessProductsList/index.js +5 -4
- package/template/pages/BusinessesList/index.js +6 -6
- package/template/pages/Checkout/index.js +6 -4
- package/template/pages/Home/index.js +4 -2
- package/template/pages/MessagesList/index.js +5 -4
- package/template/pages/MyOrders/index.js +6 -5
- package/template/pages/OrderDetails/index.js +4 -3
- package/_bundles/ordering-ui.e9827c5566d8cce0eaa4.js +0 -2
- package/template/components/OrderingThemeUpdated/index.js +0 -41
- /package/_bundles/{7.ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → 7.ordering-ui.d1a8d1fbf5b112d5d9a9.js.LICENSE.txt} +0 -0
- /package/_bundles/{ordering-ui.e9827c5566d8cce0eaa4.js.LICENSE.txt → ordering-ui.d1a8d1fbf5b112d5d9a9.js.LICENSE.txt} +0 -0
|
@@ -53,7 +53,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
53
53
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
54
54
|
var PIXELS_TO_SCROLL = 300;
|
|
55
55
|
var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
56
|
-
var _citiesState$cities, _ref, _theme$business_listi, _theme$business_listi2, _theme$business_listi3, _orderState$options, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _theme$business_listi8, _theme$business_listi9, _theme$business_listi10, _theme$business_listi11, _theme$business_listi12, _theme$business_listi13, _theme$business_listi14, _theme$business_listi15, _theme$business_listi16, _theme$business_listi17, _theme$business_listi18, _theme$business_listi19, _theme$business_listi20, _theme$business_listi21, _businessesList$busin,
|
|
56
|
+
var _citiesState$cities, _ref, _theme$business_listi, _theme$business_listi2, _theme$business_listi3, _orderState$options, _theme$business_listi4, _theme$business_listi5, _theme$business_listi6, _theme$business_listi7, _theme$business_listi8, _theme$business_listi9, _theme$business_listi10, _theme$business_listi11, _theme$business_listi12, _theme$business_listi13, _theme$business_listi14, _theme$business_listi15, _theme$business_listi16, _theme$business_listi17, _theme$business_listi18, _theme$business_listi19, _theme$business_listi20, _theme$business_listi21, _businessesList$busin, _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _orderState$options2, _orderState$options3, _businessesList$busin3, _orderState$options7, _configs$business_lis, _configs$business_lis2, _configs$business_lis3, _theme$images2, _theme$images2$genera, _theme$business_listi22, _theme$business_listi23, _theme$business_listi24, _theme$business_listi25, _configs$business_lis4, _theme$images3, _theme$images3$genera, _theme$business_listi26, _theme$business_listi27, _theme$business_listi28, _theme$business_listi29, _citiesState$cities5, _citiesState$cities6, _citiesState$cities6$, _orderState$options9, _orderState$options9$, _configs$advanced_bus2, _citiesState$cities7, _citiesState$cities8, _citiesState$cities8$, _orderState$options11, _orderState$options12, _businessesList$busin6, _businessesList$busin7, _orderState$options15;
|
|
57
57
|
var businessesList = props.businessesList,
|
|
58
58
|
paginationProps = props.paginationProps,
|
|
59
59
|
searchValue = props.searchValue,
|
|
@@ -84,9 +84,6 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
84
84
|
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
85
85
|
configs = _useConfig2[0].configs;
|
|
86
86
|
var windowSize = (0, _useWindowSize.useWindowSize)();
|
|
87
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
88
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
89
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
90
87
|
var theme = (0, _styledComponents.useTheme)();
|
|
91
88
|
var _useState = (0, _react.useState)({
|
|
92
89
|
listOpen: false,
|
|
@@ -142,7 +139,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
142
139
|
var businessesIds = businessesList.businesses && ((_businessesList$busin = businessesList.businesses) === null || _businessesList$busin === void 0 ? void 0 : _businessesList$busin.map(function (business) {
|
|
143
140
|
return business.id;
|
|
144
141
|
}));
|
|
145
|
-
var isChew = (
|
|
142
|
+
var isChew = (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.layout) === null || _theme$header$compone2 === void 0 ? void 0 : (_theme$header$compone3 = _theme$header$compone2.type) === null || _theme$header$compone3 === void 0 ? void 0 : _theme$header$compone3.toLowerCase()) === 'chew';
|
|
146
143
|
var cateringTypeString = (orderState === null || orderState === void 0 ? void 0 : (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type) === 7 ? 'catering_delivery' : (orderState === null || orderState === void 0 ? void 0 : (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type) === 8 ? 'catering_pickup' : null;
|
|
147
144
|
var cateringValues = (preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs) && (0, _utils.getCateringValues)(cateringTypeString, preorderBusiness === null || preorderBusiness === void 0 ? void 0 : preorderBusiness.configs);
|
|
148
145
|
var handleScroll = (0, _react.useCallback)(function () {
|
|
@@ -259,11 +256,9 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
|
|
|
259
256
|
});
|
|
260
257
|
})))));
|
|
261
258
|
}
|
|
262
|
-
return /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
_react.default.createElement(_PageBanner.PageBanner, {
|
|
266
|
-
position: "web_business_listing"
|
|
259
|
+
return /*#__PURE__*/_react.default.createElement(_styles.BusinessContainer, null, /*#__PURE__*/_react.default.createElement(_PageBanner.PageBanner, {
|
|
260
|
+
position: "web_business_listing",
|
|
261
|
+
isCustomerMode: isCustomerMode
|
|
267
262
|
}), (windowSize.width < 576 || (configs === null || configs === void 0 ? void 0 : (_configs$business_lis = configs.business_listing_hide_image) === null || _configs$business_lis === void 0 ? void 0 : _configs$business_lis.value) !== '1' && !isChew) && /*#__PURE__*/_react.default.createElement(_styles.BusinessBanner, null, windowSize.width < 576 && /*#__PURE__*/_react.default.createElement(_OrderContextUI.OrderContextUI, {
|
|
268
263
|
isBusinessList: true,
|
|
269
264
|
hideHero: (configs === null || configs === void 0 ? void 0 : (_configs$business_lis2 = configs.business_listing_hide_image) === null || _configs$business_lis2 === void 0 ? void 0 : _configs$business_lis2.value) !== '1' && !isChew && !hideHero
|
|
@@ -44,7 +44,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
44
44
|
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; } }
|
|
45
45
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
46
46
|
var CartUI = function CartUI(props) {
|
|
47
|
-
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _configs$checkout_mul, _orderState$carts, _props$cart, _theme$viewString, _theme$viewString$com, _theme$viewString$com2, _theme$viewString$com3, _theme$viewString$com4, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _theme$viewString2, _theme$viewString2$co, _theme$viewString2$co2, _theme$viewString2$co3, _theme$viewString2$co4, _orderState$options, _orderState$options2, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers3$filter, _cart$offers4, _cart$offers4$filter, _cart$business, _ref, _cart$subtotal_with_d, _cart$
|
|
47
|
+
var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _configs$checkout_mul, _orderState$carts, _props$cart, _theme$viewString, _theme$viewString$com, _theme$viewString$com2, _theme$viewString$com3, _theme$viewString$com4, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _theme$viewString2, _theme$viewString2$co, _theme$viewString2$co2, _theme$viewString2$co3, _theme$viewString2$co4, _orderState$options, _orderState$options2, _cart$taxes, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers3$filter, _cart$offers4, _cart$offers4$filter, _cart$business, _ref, _cart$subtotal_with_d, _cart$taxes3, _cart$taxes4, _cart$fees, _cart$fees2, _cart$offers5, _cart$offers6, _cart$offers6$filter, _orderState$options3, _cart$offers7, _cart$offers8, _cart$offers8$filter, _configs$driver_tip_t, _configs$driver_tip_u, _orderState$options4, _validationFields$fie7, _validationFields$fie8, _validationFields$fie9, _configs$driver_tip_t2, _configs$driver_tip_u2, _configs$driver_tip_t3, _cart$payment_events, _cart$payment_events2, _orderState$options5, _cart$business2, _cart$business3, _curProduct$calendar_, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6, _props$afterComponent, _props$afterElements;
|
|
48
48
|
var currentCartUuid = props.currentCartUuid,
|
|
49
49
|
clearCart = props.clearCart,
|
|
50
50
|
isProducts = props.isProducts,
|
|
@@ -170,6 +170,14 @@ var CartUI = function CartUI(props) {
|
|
|
170
170
|
}, 0);
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
|
+
var subtotalWithTaxes = cart === null || cart === void 0 ? void 0 : (_cart$taxes = cart.taxes) === null || _cart$taxes === void 0 ? void 0 : _cart$taxes.reduce(function (acc, item) {
|
|
174
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === 1) {
|
|
175
|
+
var _item$summary;
|
|
176
|
+
return acc = acc + (item === null || item === void 0 ? void 0 : (_item$summary = item.summary) === null || _item$summary === void 0 ? void 0 : _item$summary.tax);
|
|
177
|
+
}
|
|
178
|
+
return acc = acc;
|
|
179
|
+
}, cart === null || cart === void 0 ? void 0 : cart.subtotal);
|
|
180
|
+
console.log('cart', cart);
|
|
173
181
|
var clearAmount = function clearAmount(value) {
|
|
174
182
|
var _configs$format_numbe, _configs$format_numbe2;
|
|
175
183
|
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));
|
|
@@ -290,10 +298,10 @@ var CartUI = function CartUI(props) {
|
|
|
290
298
|
handleClickCheckout(uuid);
|
|
291
299
|
};
|
|
292
300
|
var getIncludedTaxesDiscounts = function getIncludedTaxesDiscounts() {
|
|
293
|
-
var _cart$
|
|
294
|
-
return cart === null || cart === void 0 ? void 0 : (_cart$
|
|
301
|
+
var _cart$taxes2, _cart$taxes2$filter;
|
|
302
|
+
return cart === null || cart === void 0 ? void 0 : (_cart$taxes2 = cart.taxes) === null || _cart$taxes2 === void 0 ? void 0 : (_cart$taxes2$filter = _cart$taxes2.filter(function (tax) {
|
|
295
303
|
return (tax === null || tax === void 0 ? void 0 : tax.type) === 1;
|
|
296
|
-
})) === null || _cart$
|
|
304
|
+
})) === null || _cart$taxes2$filter === void 0 ? void 0 : _cart$taxes2$filter.reduce(function (carry, tax) {
|
|
297
305
|
var _tax$summary$tax_afte, _tax$summary2, _tax$summary3;
|
|
298
306
|
return carry + ((_tax$summary$tax_afte = tax === null || tax === void 0 ? void 0 : (_tax$summary2 = tax.summary) === null || _tax$summary2 === void 0 ? void 0 : _tax$summary2.tax_after_discount) !== null && _tax$summary$tax_afte !== void 0 ? _tax$summary$tax_afte : tax === null || tax === void 0 ? void 0 : (_tax$summary3 = tax.summary) === null || _tax$summary3 === void 0 ? void 0 : _tax$summary3.tax);
|
|
299
307
|
}, 0);
|
|
@@ -400,7 +408,7 @@ var CartUI = function CartUI(props) {
|
|
|
400
408
|
}))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 ? void 0 : (_offer$summary = offer.summary) === null || _offer$summary === void 0 ? void 0 : _offer$summary.discount)));
|
|
401
409
|
})), (cart === null || cart === void 0 ? void 0 : (_cart$offers4 = cart.offers) === null || _cart$offers4 === void 0 ? void 0 : (_cart$offers4$filter = _cart$offers4.filter(function (offer) {
|
|
402
410
|
return (offer === null || offer === void 0 ? void 0 : offer.target) === 1;
|
|
403
|
-
})) === null || _cart$offers4$filter === void 0 ? void 0 : _cart$offers4$filter.length) > 0 && (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.total) >= 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')), (cart === null || cart === void 0 ? void 0 : (_cart$business = cart.business) === null || _cart$business === void 0 ? void 0 : _cart$business.tax_type) === 1 ? /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_ref = (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) + getIncludedTaxesDiscounts()) !== null && _ref !== void 0 ? _ref : 0)) : /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_cart$subtotal_with_d = cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) !== null && _cart$subtotal_with_d !== void 0 ? _cart$subtotal_with_d : 0))), (cart === null || cart === void 0 ? void 0 : (_cart$
|
|
411
|
+
})) === null || _cart$offers4$filter === void 0 ? void 0 : _cart$offers4$filter.length) > 0 && (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.discount) > 0 && (cart === null || cart === void 0 ? void 0 : cart.total) >= 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')), (cart === null || cart === void 0 ? void 0 : (_cart$business = cart.business) === null || _cart$business === void 0 ? void 0 : _cart$business.tax_type) === 1 ? /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_ref = (cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) + getIncludedTaxesDiscounts()) !== null && _ref !== void 0 ? _ref : 0)) : /*#__PURE__*/_react.default.createElement("td", null, parsePrice((_cart$subtotal_with_d = cart === null || cart === void 0 ? void 0 : cart.subtotal_with_discount) !== null && _cart$subtotal_with_d !== void 0 ? _cart$subtotal_with_d : 0))), (cart === null || cart === void 0 ? void 0 : (_cart$taxes3 = cart.taxes) === null || _cart$taxes3 === void 0 ? void 0 : _cart$taxes3.length) > 0 && (cart === null || cart === void 0 ? void 0 : (_cart$taxes4 = cart.taxes) === null || _cart$taxes4 === void 0 ? void 0 : _cart$taxes4.filter(function (tax) {
|
|
404
412
|
return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0;
|
|
405
413
|
}).map(function (tax) {
|
|
406
414
|
var _ref2, _tax$summary$tax_afte2, _tax$summary4, _tax$summary5;
|
|
@@ -556,13 +564,13 @@ var CartUI = function CartUI(props) {
|
|
|
556
564
|
cateringPreorder: true,
|
|
557
565
|
isCart: true,
|
|
558
566
|
business: cart === null || cart === void 0 ? void 0 : cart.business
|
|
559
|
-
}, cateringValues))), (onClickCheckout || isForceOpenCart) && !isCheckout && (cart === null || cart === void 0 ? void 0 : cart.
|
|
560
|
-
color: !(cart !== null && cart !== void 0 && cart.valid_maximum) ||
|
|
567
|
+
}, cateringValues))), (onClickCheckout || isForceOpenCart) && !isCheckout && (cart === null || cart === void 0 ? void 0 : cart.valid) && (!isMultiCheckout || isStore) && /*#__PURE__*/_react.default.createElement(_styles.CheckoutAction, null, /*#__PURE__*/_react.default.createElement("p", null, (cart === null || cart === void 0 ? void 0 : cart.total) >= 1 && parsePrice(cart === null || cart === void 0 ? void 0 : cart.total)), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
568
|
+
color: !(cart !== null && cart !== void 0 && cart.valid_maximum) || subtotalWithTaxes < (cart === null || cart === void 0 ? void 0 : cart.minimum) || !(cart !== null && cart !== void 0 && cart.valid_address) ? 'secundary' : 'primary',
|
|
561
569
|
onClick: function onClick() {
|
|
562
570
|
return checkOutBtnClick(cart === null || cart === void 0 ? void 0 : cart.uuid);
|
|
563
571
|
},
|
|
564
|
-
disabled: openUpselling && !canOpenUpselling || !(cart !== null && cart !== void 0 && cart.valid_maximum) ||
|
|
565
|
-
}, !(cart !== null && cart !== void 0 && cart.valid_address) ? t('OUT_OF_COVERAGE', 'Out of Coverage') : !(cart !== null && cart !== void 0 && cart.valid_maximum) ? "".concat(t('MAXIMUM_SUBTOTAL_ORDER', 'Maximum subtotal order'), ": ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.maximum)) :
|
|
572
|
+
disabled: openUpselling && !canOpenUpselling || !(cart !== null && cart !== void 0 && cart.valid_maximum) || subtotalWithTaxes < (cart === null || cart === void 0 ? void 0 : cart.minimum) || !(cart !== null && cart !== void 0 && cart.valid_address)
|
|
573
|
+
}, !(cart !== null && cart !== void 0 && cart.valid_address) ? t('OUT_OF_COVERAGE', 'Out of Coverage') : !(cart !== null && cart !== void 0 && cart.valid_maximum) ? "".concat(t('MAXIMUM_SUBTOTAL_ORDER', 'Maximum subtotal order'), ": ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.maximum)) : subtotalWithTaxes < (cart === null || cart === void 0 ? void 0 : cart.minimum) ? "".concat(t('MINIMUN_SUBTOTAL_ORDER', 'Minimum subtotal order:'), " ").concat(parsePrice(cart === null || cart === void 0 ? void 0 : cart.minimum)) : !openUpselling ^ canOpenUpselling ? t('CHECKOUT', 'Checkout') : t('LOADING', 'Loading')))), !isStore && /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_Confirm.Confirm, {
|
|
566
574
|
title: t('PRODUCT', 'Product'),
|
|
567
575
|
content: confirm.content,
|
|
568
576
|
acceptText: t('ACCEPT', 'Accept'),
|
|
@@ -31,7 +31,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
31
|
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; } }
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
var CartPopover = function CartPopover(props) {
|
|
34
|
-
var
|
|
34
|
+
var _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _theme$header2, _theme$header2$compon, _theme$header2$compon2, _theme$header2$compon3, _theme$header2$compon4, _props$beforeElements, _props$beforeComponen, _props$carts, _props$carts2, _theme$header3, _theme$header3$compon, _theme$header3$compon2, _theme$header3$compon3, _theme$header3$compon4, _props$afterComponent, _props$afterElements;
|
|
35
35
|
var open = props.open,
|
|
36
36
|
auth = props.auth,
|
|
37
37
|
location = props.location,
|
|
@@ -47,13 +47,10 @@ var CartPopover = function CartPopover(props) {
|
|
|
47
47
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
48
48
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
49
49
|
t = _useLanguage2[1];
|
|
50
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
51
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
52
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
53
50
|
var referenceElement = (0, _react.useRef)();
|
|
54
51
|
var popperElement = (0, _react.useRef)();
|
|
55
52
|
var arrowElement = (0, _react.useRef)();
|
|
56
|
-
var isChew = (
|
|
53
|
+
var isChew = (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.layout) === null || _theme$header$compone2 === void 0 ? void 0 : (_theme$header$compone3 = _theme$header$compone2.type) === null || _theme$header$compone3 === void 0 ? void 0 : _theme$header$compone3.toLowerCase()) === 'chew';
|
|
57
54
|
var popper = (0, _reactPopper.usePopper)(referenceElement.current, popperElement.current, {
|
|
58
55
|
placement: theme !== null && theme !== void 0 && theme.rtl ? 'bottom' : 'bottom-end',
|
|
59
56
|
modifiers: [{
|
|
@@ -70,7 +67,7 @@ var CartPopover = function CartPopover(props) {
|
|
|
70
67
|
});
|
|
71
68
|
var styles = popper.styles,
|
|
72
69
|
attributes = popper.attributes;
|
|
73
|
-
var isSlideBar = (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
70
|
+
var isSlideBar = (theme === null || theme === void 0 ? void 0 : (_theme$header2 = theme.header) === null || _theme$header2 === void 0 ? void 0 : (_theme$header2$compon = _theme$header2.components) === null || _theme$header2$compon === void 0 ? void 0 : (_theme$header2$compon2 = _theme$header2$compon.cart) === null || _theme$header2$compon2 === void 0 ? void 0 : (_theme$header2$compon3 = _theme$header2$compon2.components) === null || _theme$header2$compon3 === void 0 ? void 0 : (_theme$header2$compon4 = _theme$header2$compon3.open_strategy) === null || _theme$header2$compon4 === void 0 ? void 0 : _theme$header2$compon4.type) === 'slide';
|
|
74
71
|
(0, _react.useEffect)(function () {
|
|
75
72
|
// forceUpdate && forceUpdate()
|
|
76
73
|
}, [open, orderState]);
|
|
@@ -144,7 +141,7 @@ var CartPopover = function CartPopover(props) {
|
|
|
144
141
|
onClose: props.onClose,
|
|
145
142
|
hideCloseDefault: true,
|
|
146
143
|
isSlideBar: true,
|
|
147
|
-
slideBarPosition: theme === null || theme === void 0 ? void 0 : (_theme$
|
|
144
|
+
slideBarPosition: theme === null || theme === void 0 ? void 0 : (_theme$header3 = theme.header) === null || _theme$header3 === void 0 ? void 0 : (_theme$header3$compon = _theme$header3.components) === null || _theme$header3$compon === void 0 ? void 0 : (_theme$header3$compon2 = _theme$header3$compon.cart) === null || _theme$header3$compon2 === void 0 ? void 0 : (_theme$header3$compon3 = _theme$header3$compon2.components) === null || _theme$header3$compon3 === void 0 ? void 0 : (_theme$header3$compon4 = _theme$header3$compon3.open_strategy) === null || _theme$header3$compon4 === void 0 ? void 0 : _theme$header3$compon4.position
|
|
148
145
|
}, /*#__PURE__*/_react.default.createElement(_styles.TitleContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('MY_CART', 'My cart')), /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
|
|
149
146
|
outline: true,
|
|
150
147
|
color: "primary",
|
|
@@ -19,7 +19,10 @@ var HeaderItem = _styledComponents.default.div(_templateObject || (_templateObje
|
|
|
19
19
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.rtl ? (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-right: 10px;\n "]))) : (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: 10px;\n "])));
|
|
20
20
|
});
|
|
21
21
|
exports.HeaderItem = HeaderItem;
|
|
22
|
-
var PopoverBody = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color:
|
|
22
|
+
var PopoverBody = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: ", ";\n color: #333;\n padding: 15px;\n border-radius: 10px;\n max-width: 500px;\n z-index: 10002;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 8px 24px;\n"])), function (props) {
|
|
23
|
+
var _props$theme2, _props$theme2$colors;
|
|
24
|
+
return (_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : (_props$theme2$colors = _props$theme2.colors) === null || _props$theme2$colors === void 0 ? void 0 : _props$theme2$colors.backgroundPage;
|
|
25
|
+
});
|
|
23
26
|
exports.PopoverBody = PopoverBody;
|
|
24
27
|
var PopoverArrow = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 0;\n height: 0;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n border-bottom: 8px solid #FFF;\n top: -8px;\n"])));
|
|
25
28
|
exports.PopoverArrow = PopoverArrow;
|
|
@@ -62,7 +62,7 @@ var mapConfigs = {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
var CheckoutUI = function CheckoutUI(props) {
|
|
65
|
-
var _businessDetails$busi, _businessDetails$busi2, _configs$table_numer_, _businessConfigs$find, _businessConfigs$find2, _configs$cash_wallet, _configs$wallet_enabl,
|
|
65
|
+
var _businessDetails$busi, _businessDetails$busi2, _configs$table_numer_, _businessConfigs$find, _businessConfigs$find2, _configs$cash_wallet, _configs$wallet_enabl, _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _validationFields$fie, _validationFields$fie2, _validationFields$fie3, _validationFields$fie4, _validationFields$fie5, _validationFields$fie6, _cart$comment, _validationFields$fie7, _validationFields$fie8, _validationFields$fie9, _validationFields$fie10, _validationFields$fie11, _validationFields$fie12, _paymethodSelected$da, _paymethodSelected$da2, _paymethodSelected$da3, _cardList$cards, _cartState$cart, _validationFields$fie13, _validationFields$fie14, _validationFields$fie15, _validationFields$fie16, _validationFields$fie17, _validationFields$fie18, _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _instructionsOptions$, _instructionsOptions$2, _theme$checkout, _theme$checkout$compo, _theme$checkout$compo2, _theme$checkout$compo3, _theme$checkout$compo4, _theme$checkout2, _theme$checkout2$comp, _theme$checkout2$comp2, _theme$checkout3, _theme$checkout3$comp, _theme$checkout3$comp2, _theme$checkout4, _theme$checkout4$comp, _theme$checkout4$comp2, _validationFields$fie19, _validationFields$fie20, _validationFields$fie21, _loyaltyPlansState$re, _creditPointPlan$busi, _options$address, _businessDetails$busi3, _theme$images, _theme$images$dummies, _configs$google_maps_, _customerState$user, _customerState$user2, _Object$values, _businessDetails$busi4, _businessDetails$busi5, _businessDetails$busi6, _businessDetails$busi7, _businessDetails$busi8, _businessDetails$busi9, _businessDetails$erro, _businessDetails$erro2, _businessDetails$busi10, _businessDetails$busi11, _businessDetails$busi12, _configs$driver_tip_t, _configs$driver_tip_u, _configs$driver_tip_t2, _cartState$cart$spot_, _cartState$cart2, _cart$business3, _cart$products2, _ref, _creditPointPlanOnBus, _configs$driver_tip_t3, _configs$driver_tip_u2, _configs$driver_tip_t4, _validationFields$fie30, _validationFields$fie31, _validationFields$fie32, _validationFields$fie33, _validationFields$fie34, _validationFields$fie35, _customerState$user3;
|
|
66
66
|
var cart = props.cart,
|
|
67
67
|
errors = props.errors,
|
|
68
68
|
placing = props.placing,
|
|
@@ -88,9 +88,6 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
88
88
|
var _useValidationFields = (0, _orderingComponentsExternal.useValidationFields)(),
|
|
89
89
|
_useValidationFields2 = _slicedToArray(_useValidationFields, 1),
|
|
90
90
|
validationFields = _useValidationFields2[0];
|
|
91
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
92
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
93
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
94
91
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
95
92
|
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
96
93
|
_useOrder2$ = _useOrder2[0],
|
|
@@ -104,7 +101,9 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
104
101
|
parsePrice = _useUtils2[0].parsePrice;
|
|
105
102
|
var _useSession = (0, _orderingComponentsExternal.useSession)(),
|
|
106
103
|
_useSession2 = _slicedToArray(_useSession, 2),
|
|
107
|
-
|
|
104
|
+
_useSession2$ = _useSession2[0],
|
|
105
|
+
user = _useSession2$.user,
|
|
106
|
+
userLoading = _useSession2$.loading,
|
|
108
107
|
login = _useSession2[1].login;
|
|
109
108
|
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
110
109
|
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
@@ -183,7 +182,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
183
182
|
return config.key === 'wallet_credit_point_enabled';
|
|
184
183
|
})) === null || _businessConfigs$find2 === void 0 ? void 0 : _businessConfigs$find2.value) === '1';
|
|
185
184
|
var isWalletEnabled = (configs === null || configs === void 0 ? void 0 : (_configs$cash_wallet = configs.cash_wallet) === null || _configs$cash_wallet === void 0 ? void 0 : _configs$cash_wallet.value) && (configs === null || configs === void 0 ? void 0 : (_configs$wallet_enabl = configs.wallet_enabled) === null || _configs$wallet_enabl === void 0 ? void 0 : _configs$wallet_enabl.value) === '1' && (isWalletCashEnabled || isWalletCreditPointsEnabled) && !useKioskApp && !isCustomerMode;
|
|
186
|
-
var isMultiDriverTips = (
|
|
185
|
+
var isMultiDriverTips = (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.layout) === null || _theme$header$compone2 === void 0 ? void 0 : (_theme$header$compone3 = _theme$header$compone2.type) === null || _theme$header$compone3 === void 0 ? void 0 : _theme$header$compone3.toLowerCase()) === 'chew';
|
|
187
186
|
var placeSpotTypes = [3, 4, 5];
|
|
188
187
|
var placeSpotsEnabled = placeSpotTypes.includes(options === null || options === void 0 ? void 0 : options.type) && !useKioskApp;
|
|
189
188
|
var isGiftCardCart = !(cart !== null && cart !== void 0 && cart.business_id);
|
|
@@ -195,7 +194,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
195
194
|
// (((placeSpotTypes.includes(options?.type) && !cart?.place) && hasBusinessPlaces)) ||
|
|
196
195
|
options.type === 1 && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie13 = validationFields.fields) === null || _validationFields$fie13 === void 0 ? void 0 : (_validationFields$fie14 = _validationFields$fie13.checkout) === null || _validationFields$fie14 === void 0 ? void 0 : (_validationFields$fie15 = _validationFields$fie14.driver_tip) === null || _validationFields$fie15 === void 0 ? void 0 : _validationFields$fie15.enabled) && (validationFields === null || validationFields === void 0 ? void 0 : (_validationFields$fie16 = validationFields.fields) === null || _validationFields$fie16 === void 0 ? void 0 : (_validationFields$fie17 = _validationFields$fie16.checkout) === null || _validationFields$fie17 === void 0 ? void 0 : (_validationFields$fie18 = _validationFields$fie17.driver_tip) === null || _validationFields$fie18 === void 0 ? void 0 : _validationFields$fie18.required) && Number(cart === null || cart === void 0 ? void 0 : cart.driver_tip) <= 0 || validateCommentsCartField || validateZipcodeCard;
|
|
197
196
|
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) || [];
|
|
198
|
-
var deliveryOptions = (instructionsOptions === null || instructionsOptions === void 0 ? void 0 : instructionsOptions.result) && (instructionsOptions === null || instructionsOptions === void 0 ? void 0 : (_instructionsOptions$ = instructionsOptions.result) === null || _instructionsOptions$ === void 0 ? void 0 : (_instructionsOptions$2 = _instructionsOptions$.filter(function (option) {
|
|
197
|
+
var deliveryOptions = (instructionsOptions === null || instructionsOptions === void 0 ? void 0 : instructionsOptions.result) && Array.isArray(instructionsOptions === null || instructionsOptions === void 0 ? void 0 : instructionsOptions.result) && (instructionsOptions === null || instructionsOptions === void 0 ? void 0 : (_instructionsOptions$ = instructionsOptions.result) === null || _instructionsOptions$ === void 0 ? void 0 : (_instructionsOptions$2 = _instructionsOptions$.filter(function (option) {
|
|
199
198
|
return option === null || option === void 0 ? void 0 : option.enabled;
|
|
200
199
|
})) === null || _instructionsOptions$2 === void 0 ? void 0 : _instructionsOptions$2.map(function (option) {
|
|
201
200
|
return {
|
|
@@ -216,6 +215,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
216
215
|
return b.business_id === (cart === null || cart === void 0 ? void 0 : cart.business_id) && b.accumulates;
|
|
217
216
|
});
|
|
218
217
|
var handlePlaceOrder = function handlePlaceOrder() {
|
|
218
|
+
if (placing) return;
|
|
219
219
|
if (stripePaymethods.includes(paymethodSelected === null || paymethodSelected === void 0 ? void 0 : paymethodSelected.gateway) && user !== null && user !== void 0 && user.guest_id) {
|
|
220
220
|
setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
|
|
221
221
|
signup: true,
|
|
@@ -314,7 +314,7 @@ var CheckoutUI = function CheckoutUI(props) {
|
|
|
314
314
|
};
|
|
315
315
|
(0, _react.useEffect)(function () {
|
|
316
316
|
var _validationFields$fie29;
|
|
317
|
-
if (validationFields && validationFields !== null && validationFields !== void 0 && (_validationFields$fie29 = validationFields.fields) !== null && _validationFields$fie29 !== void 0 && _validationFields$fie29.checkout) {
|
|
317
|
+
if (validationFields && validationFields !== null && validationFields !== void 0 && (_validationFields$fie29 = validationFields.fields) !== null && _validationFields$fie29 !== void 0 && _validationFields$fie29.checkout && !customerState.loading && !userLoading) {
|
|
318
318
|
checkValidationFields();
|
|
319
319
|
}
|
|
320
320
|
}, [validationFields, user, customerState]);
|
|
@@ -22,31 +22,34 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
22
22
|
|
|
23
23
|
var PopupWrap = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n z-index: 1001;\n outline: none;\n"])));
|
|
24
24
|
exports.PopupWrap = PopupWrap;
|
|
25
|
-
var PopupDialog = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color:
|
|
25
|
+
var PopupDialog = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n padding: 20px;\n width: 70%;\n border-radius: 10px;\n"])), function (props) {
|
|
26
|
+
var _props$theme, _props$theme$colors;
|
|
27
|
+
return (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : (_props$theme$colors = _props$theme.colors) === null || _props$theme$colors === void 0 ? void 0 : _props$theme$colors.backgroundPage;
|
|
28
|
+
});
|
|
26
29
|
exports.PopupDialog = PopupDialog;
|
|
27
30
|
var PopupActions = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n margin: 30px 0px 0px;\n button {\n width: 100%;\n border-radius: 7.6px;\n opacity: 1;\n height: 45px;\n &:nth-child(1) {\n margin-right: 25px;\n ", " \n }\n &:last-child {\n ", " \n }\n }\n"])), function (props) {
|
|
28
|
-
var _props$theme;
|
|
29
|
-
return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 25px;\n margin-right: 0; \n "])));
|
|
30
|
-
}, function (props) {
|
|
31
31
|
var _props$theme2;
|
|
32
|
-
return (_props$theme2 = props.theme)
|
|
32
|
+
return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.rtl) && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 25px;\n margin-right: 0; \n "])));
|
|
33
|
+
}, function (props) {
|
|
34
|
+
var _props$theme3;
|
|
35
|
+
return (_props$theme3 = props.theme) !== null && _props$theme3 !== void 0 && _props$theme3.rtl ? (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: 0;\n "]))) : (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-right: 0;\n "])));
|
|
33
36
|
});
|
|
34
37
|
exports.PopupActions = PopupActions;
|
|
35
38
|
var PopupTitle = _styledComponents.default.h2(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n text-align: left;\n letter-spacing: 0px;\n color: #010300;\n opacity: 1;\n margin-top: 0px;\n ", " \n"])), function (props) {
|
|
36
|
-
var _props$
|
|
37
|
-
return ((_props$
|
|
39
|
+
var _props$theme4;
|
|
40
|
+
return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
|
|
38
41
|
});
|
|
39
42
|
exports.PopupTitle = PopupTitle;
|
|
40
43
|
var PopupContent = _styledComponents.default.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n text-align: left;\n letter-spacing: 0px;\n color: #010300;\n opacity: 1;\n ", " \n ul {\n padding-left: 30px;\n ", "\n li {\n margin-top: 7px;\n margin-bottom: 7px;\n }\n }\n"])), function (props) {
|
|
41
|
-
var _props$theme4;
|
|
42
|
-
return ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.rtl) && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
|
|
43
|
-
}, function (props) {
|
|
44
44
|
var _props$theme5;
|
|
45
|
-
return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(
|
|
45
|
+
return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
|
|
46
|
+
}, function (props) {
|
|
47
|
+
var _props$theme6;
|
|
48
|
+
return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n padding-right: 30px;\n padding-left: 0;\n "])));
|
|
46
49
|
});
|
|
47
50
|
exports.PopupContent = PopupContent;
|
|
48
51
|
var PopupIcon = _styledComponents.default.span(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n float: right;\n font-size: 30px;\n cursor: pointer;\n ", "\n"])), function (props) {
|
|
49
|
-
var _props$
|
|
50
|
-
return ((_props$
|
|
52
|
+
var _props$theme7;
|
|
53
|
+
return ((_props$theme7 = props.theme) === null || _props$theme7 === void 0 ? void 0 : _props$theme7.rtl) && (0, _styledComponents.css)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n float: left;\n "])));
|
|
51
54
|
});
|
|
52
55
|
exports.PopupIcon = PopupIcon;
|
|
@@ -17,7 +17,8 @@ var DatePickerUI = function DatePickerUI(props) {
|
|
|
17
17
|
return /*#__PURE__*/_react.default.createElement(_styles.DateContainer, null, /*#__PURE__*/_react.default.createElement(_reactDateRange.Calendar, {
|
|
18
18
|
date: value,
|
|
19
19
|
name: name,
|
|
20
|
-
onChange: onChange
|
|
20
|
+
onChange: onChange,
|
|
21
|
+
maxDate: new Date()
|
|
21
22
|
}));
|
|
22
23
|
};
|
|
23
24
|
exports.DatePickerUI = DatePickerUI;
|
|
@@ -10,6 +10,7 @@ var _orderingComponentsExternal = require("ordering-components-external");
|
|
|
10
10
|
var _FavoriteList = require("../FavoriteList");
|
|
11
11
|
var _Tabs = require("../../styles/Tabs");
|
|
12
12
|
var _styles = require("./styles");
|
|
13
|
+
var _styledComponents = require("styled-components");
|
|
13
14
|
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); }
|
|
14
15
|
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; }
|
|
15
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -20,17 +21,15 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
20
21
|
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; } }
|
|
21
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
23
|
var Favorite = function Favorite(props) {
|
|
23
|
-
var
|
|
24
|
+
var _theme$favorite, _theme$favorite$compo, _theme$favorite$compo2, _props$beforeElements, _props$beforeComponen, _orderState$options, _orderState$options$a, _orderState$options$a2, _orderState$options2, _orderState$options2$, _orderState$options2$2, _props$afterComponent, _props$afterElements;
|
|
24
25
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
25
26
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
26
27
|
t = _useLanguage2[1];
|
|
27
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
28
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
29
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
30
28
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
31
29
|
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
32
30
|
orderState = _useOrder2[0];
|
|
33
|
-
var
|
|
31
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
32
|
+
var layout = (theme === null || theme === void 0 ? void 0 : (_theme$favorite = theme.favorite) === null || _theme$favorite === void 0 ? void 0 : (_theme$favorite$compo = _theme$favorite.components) === null || _theme$favorite$compo === void 0 ? void 0 : (_theme$favorite$compo2 = _theme$favorite$compo.layout) === null || _theme$favorite$compo2 === void 0 ? void 0 : _theme$favorite$compo2.type) || 'original';
|
|
34
33
|
var _useState = (0, _react.useState)('businesses'),
|
|
35
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36
35
|
tabSelected = _useState2[0],
|
|
@@ -8,6 +8,7 @@ exports.default = exports.Footer = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
10
10
|
var _styles = require("./styles");
|
|
11
|
+
var _styledComponents = require("styled-components");
|
|
11
12
|
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
13
|
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
14
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
@@ -38,9 +39,7 @@ var Footer = function Footer(_ref) {
|
|
|
38
39
|
var _useApi = (0, _orderingComponentsExternal.useApi)(),
|
|
39
40
|
_useApi2 = _slicedToArray(_useApi, 1),
|
|
40
41
|
ordering = _useApi2[0];
|
|
41
|
-
var
|
|
42
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
43
|
-
theme = _useOrderingTheme2[0].theme;
|
|
42
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
44
43
|
var requestsState = {};
|
|
45
44
|
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
46
45
|
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
@@ -52,7 +52,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
52
52
|
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; } }
|
|
53
53
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
54
54
|
var Header = function Header(props) {
|
|
55
|
-
var _window$location$path, _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3,
|
|
55
|
+
var _window$location$path, _configState$configs, _configState$configs$, _configState$configs2, _configState$configs3, _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _theme$header2, _theme$header2$compon, _theme$header2$compon2, _orderState$options, _orderState$options2, _Object$keys, _customerState$user, _orderState$options5, _orderState$options5$, _theme$images, _theme$images$logos, _theme$my_products, _theme$my_products$co, _theme$my_products$co2, _theme$my_products$co3, _theme$my_products$co4, _theme$my_products$co5, _theme$images2, _theme$images2$logos, _theme$images3, _theme$images3$logos, _theme$images4, _theme$images4$logos, _theme$my_products2, _theme$my_products2$c, _theme$my_products2$c2, _theme$my_products2$c3, _theme$my_products2$c4, _theme$my_products2$c5, _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$configs14, _configState$configs15, _orderState$options13, _configState$configs16, _configState$configs17, _configState$configs18, _configState$configs19, _orderState$options14, _orderState$options15, _configState$configs20, _configState$configs21, _orderState$options16, _configState$configs22, _configState$configs23, _configState$configs24, _configState$configs25, _orderState$options17, _orderState$options18, _customerState$user2, _customerState$user3, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _theme$defaultLanguag7, _theme$defaultLanguag8, _theme$defaultLanguag9;
|
|
56
56
|
var isHome = props.isHome,
|
|
57
57
|
location = props.location,
|
|
58
58
|
isShowOrderOptions = props.isShowOrderOptions,
|
|
@@ -93,9 +93,6 @@ var Header = function Header(props) {
|
|
|
93
93
|
_useCustomer2 = _slicedToArray(_useCustomer, 2),
|
|
94
94
|
customerState = _useCustomer2[0],
|
|
95
95
|
deleteUserCustomer = _useCustomer2[1].deleteUserCustomer;
|
|
96
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
97
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
98
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
99
96
|
var _useBusiness = (0, _orderingComponentsExternal.useBusiness)(),
|
|
100
97
|
_useBusiness2 = _slicedToArray(_useBusiness, 1),
|
|
101
98
|
business = _useBusiness2[0].business;
|
|
@@ -161,8 +158,8 @@ var Header = function Header(props) {
|
|
|
161
158
|
return Number(value);
|
|
162
159
|
})) || [];
|
|
163
160
|
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';
|
|
164
|
-
var isChew = (
|
|
165
|
-
var isHideLanguages = theme === null || theme === void 0 ? void 0 : (_theme$
|
|
161
|
+
var isChew = (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.layout) === null || _theme$header$compone2 === void 0 ? void 0 : (_theme$header$compone3 = _theme$header$compone2.type) === null || _theme$header$compone3 === void 0 ? void 0 : _theme$header$compone3.toLowerCase()) === 'chew';
|
|
162
|
+
var isHideLanguages = theme === null || theme === void 0 ? void 0 : (_theme$header2 = theme.header) === null || _theme$header2 === void 0 ? void 0 : (_theme$header2$compon = _theme$header2.components) === null || _theme$header2$compon === void 0 ? void 0 : (_theme$header2$compon2 = _theme$header2$compon.language_selector) === null || _theme$header2$compon2 === void 0 ? void 0 : _theme$header2$compon2.hidden;
|
|
166
163
|
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;
|
|
167
164
|
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);
|
|
168
165
|
var handleSuccessSignup = function handleSuccessSignup(user) {
|
|
@@ -292,13 +289,13 @@ var Header = function Header(props) {
|
|
|
292
289
|
alt: "Logotype",
|
|
293
290
|
width: "170px",
|
|
294
291
|
height: isChew ? '35px' : '45px',
|
|
295
|
-
src: isChew ? theme === null || theme === void 0 ? void 0 : (_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$logos = _theme$images.logos) === null || _theme$images$logos === void 0 ? void 0 : _theme$images$logos.chewLogo : (
|
|
292
|
+
src: isChew ? theme === null || theme === void 0 ? void 0 : (_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$logos = _theme$images.logos) === null || _theme$images$logos === void 0 ? void 0 : _theme$images$logos.chewLogo : (theme === null || theme === void 0 ? void 0 : (_theme$my_products = theme.my_products) === null || _theme$my_products === void 0 ? void 0 : (_theme$my_products$co = _theme$my_products.components) === null || _theme$my_products$co === void 0 ? void 0 : (_theme$my_products$co2 = _theme$my_products$co.images) === null || _theme$my_products$co2 === void 0 ? void 0 : (_theme$my_products$co3 = _theme$my_products$co2.components) === null || _theme$my_products$co3 === void 0 ? void 0 : (_theme$my_products$co4 = _theme$my_products$co3.logo) === null || _theme$my_products$co4 === void 0 ? void 0 : (_theme$my_products$co5 = _theme$my_products$co4.components) === null || _theme$my_products$co5 === void 0 ? void 0 : _theme$my_products$co5.image) || (theme === null || theme === void 0 ? void 0 : (_theme$images2 = theme.images) === null || _theme$images2 === void 0 ? void 0 : (_theme$images2$logos = _theme$images2.logos) === null || _theme$images2$logos === void 0 ? void 0 : _theme$images2$logos.logotype),
|
|
296
293
|
loading: "lazy"
|
|
297
294
|
}), /*#__PURE__*/_react.default.createElement("img", {
|
|
298
295
|
alt: "Isotype",
|
|
299
296
|
width: isChew ? '70px' : '35px',
|
|
300
297
|
height: isChew ? '20px' : '45px',
|
|
301
|
-
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 : windowSize.width <= 768 ? 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 : (
|
|
298
|
+
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 : windowSize.width <= 768 ? 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 : (theme === null || theme === void 0 ? void 0 : (_theme$my_products2 = theme.my_products) === null || _theme$my_products2 === void 0 ? void 0 : (_theme$my_products2$c = _theme$my_products2.components) === null || _theme$my_products2$c === void 0 ? void 0 : (_theme$my_products2$c2 = _theme$my_products2$c.images) === null || _theme$my_products2$c2 === void 0 ? void 0 : (_theme$my_products2$c3 = _theme$my_products2$c2.components) === null || _theme$my_products2$c3 === void 0 ? void 0 : (_theme$my_products2$c4 = _theme$my_products2$c3.logo) === null || _theme$my_products2$c4 === void 0 ? void 0 : (_theme$my_products2$c5 = _theme$my_products2$c4.components) === null || _theme$my_products2$c5 === void 0 ? void 0 : _theme$my_products2$c5.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),
|
|
302
299
|
loading: "lazy"
|
|
303
300
|
}))), isShowOrderOptions && windowSize.width >= 576 && /*#__PURE__*/_react.default.createElement(_styles.Menu, {
|
|
304
301
|
id: "center-side",
|
|
@@ -9,6 +9,7 @@ var _orderingComponentsExternal = require("ordering-components-external");
|
|
|
9
9
|
var _AiOutlineShoppingCart = _interopRequireDefault(require("@meronex/icons/ai/AiOutlineShoppingCart"));
|
|
10
10
|
var _FaMapMarkerAlt = _interopRequireDefault(require("@meronex/icons/fa/FaMapMarkerAlt"));
|
|
11
11
|
var _styles = require("./styles");
|
|
12
|
+
var _styledComponents = require("styled-components");
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -18,7 +19,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
18
19
|
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; } }
|
|
19
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
21
|
var HeaderOption = function HeaderOption(props) {
|
|
21
|
-
var
|
|
22
|
+
var _theme$header, _theme$header$compone, _theme$header$compone2, _theme$header$compone3, _props$beforeElements, _props$beforeComponen, _configs$dates_moment, _props$afterComponent, _props$afterElements;
|
|
22
23
|
var variant = props.variant,
|
|
23
24
|
addressState = props.addressState,
|
|
24
25
|
momentState = props.momentState,
|
|
@@ -30,16 +31,14 @@ var HeaderOption = function HeaderOption(props) {
|
|
|
30
31
|
var _useUtils = (0, _orderingComponentsExternal.useUtils)(),
|
|
31
32
|
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
32
33
|
parseDate = _useUtils2[0].parseDate;
|
|
33
|
-
var _useOrderingTheme = (0, _orderingComponentsExternal.useOrderingTheme)(),
|
|
34
|
-
_useOrderingTheme2 = _slicedToArray(_useOrderingTheme, 1),
|
|
35
|
-
orderingTheme = _useOrderingTheme2[0];
|
|
36
34
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
37
35
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
38
36
|
t = _useLanguage2[1];
|
|
39
37
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
40
38
|
_useOrder2 = _slicedToArray(_useOrder, 1),
|
|
41
39
|
orderStatus = _useOrder2[0];
|
|
42
|
-
var
|
|
40
|
+
var theme = (0, _styledComponents.useTheme)();
|
|
41
|
+
var isChew = (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.layout) === null || _theme$header$compone2 === void 0 ? void 0 : (_theme$header$compone3 = _theme$header$compone2.type) === null || _theme$header$compone3 === void 0 ? void 0 : _theme$header$compone3.toLowerCase()) === 'chew';
|
|
43
42
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
|
|
44
43
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
45
44
|
key: i
|