ordering-ui-external 10.6.1 → 10.7.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.8a4a9a1da3d54294518d.js → 0.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/{4.ordering-ui.8a4a9a1da3d54294518d.js → 4.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/{7.ordering-ui.8a4a9a1da3d54294518d.js → 7.ordering-ui.69ebaa12d869719caa38.js} +1 -1
- package/_bundles/ordering-ui.69ebaa12d869719caa38.js +2 -0
- package/_modules/components/AddressForm/index.js +1 -1
- package/_modules/components/BusinessProductsListing/index.js +1 -1
- package/_modules/components/Checkout/index.js +1 -1
- package/_modules/components/Footer/index.js +1 -1
- package/_modules/components/HelpStaticPage/index.js +1 -1
- package/_modules/components/LoginForm/index.js +1 -1
- package/_modules/components/OrdersOption/index.js +1 -1
- package/_modules/components/PagesList/index.js +1 -1
- package/_modules/components/StripeMethodForm/index.js +1 -1
- package/_modules/hooks/useIntersectionObserver.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +32 -18
- package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +8 -5
- package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +21 -11
- package/_modules/themes/callcenterOriginal/src/components/AddressList/styles.js +15 -5
- package/_modules/themes/callcenterOriginal/src/components/Checkout/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/Footer/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/HelpStaticPage/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/Orders/AddressForm/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/Orders/CreateCustomOrder/Checkout/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/Orders/CreateCustomOrder/StripeMethodForm/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +183 -59
- package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +55 -9
- package/_modules/themes/callcenterOriginal/src/components/Shared/ImageCrop/index.js +1 -1
- package/_modules/themes/eight/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/eight/src/components/Checkout/index.js +1 -1
- package/_modules/themes/eight/src/components/Footer/index.js +1 -1
- package/_modules/themes/eight/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/five/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/five/src/components/AddressList/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessController/index.js +1 -1
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +26 -4
- package/_modules/themes/five/src/components/Checkout/index.js +1 -1
- package/_modules/themes/five/src/components/Footer/index.js +1 -1
- package/_modules/themes/five/src/components/HelpStaticPage/index.js +1 -1
- package/_modules/themes/five/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/five/src/components/LogoutPopup/index.js +1 -1
- package/_modules/themes/five/src/components/MyOrders/index.js +11 -2
- package/_modules/themes/five/src/components/NotNetworkConnectivity/index.js +1 -1
- package/_modules/themes/five/src/components/OrderDetails/index.js +5 -3
- package/_modules/themes/five/src/components/OrderDetails/layouts/Kiosk/index.js +1 -1
- package/_modules/themes/five/src/components/OrdersOption/index.js +21 -18
- package/_modules/themes/five/src/components/PageBanner/index.js +23 -9
- package/_modules/themes/five/src/components/PhoneAutocomplete/index.js +1 -1
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +5 -2
- package/_modules/themes/five/src/components/RenderProductsLayout/index.js +5 -2
- package/_modules/themes/five/src/components/SignUpForm/index.js +1 -1
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +1 -1
- package/_modules/themes/five/src/components/UserDetails/styles.js +2 -2
- package/_modules/themes/five/src/components/WebsocketStatus/index.js +6 -3
- package/_modules/themes/four/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/four/src/components/BusinessProductsListing/index.js +1 -1
- package/_modules/themes/four/src/components/Checkout/index.js +1 -1
- package/_modules/themes/four/src/components/Footer/index.js +1 -1
- package/_modules/themes/four/src/components/HelpStaticPage/index.js +1 -1
- package/_modules/themes/four/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/four/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/franchise/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/franchise/src/components/Checkout/index.js +1 -1
- package/_modules/themes/franchise/src/components/Footer/index.js +1 -1
- package/_modules/themes/franchise/src/components/HelpStaticPage/index.js +1 -1
- package/_modules/themes/franchise/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/franchise/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/orderAndPay/src/components/Checkout/index.js +1 -1
- package/_modules/themes/orderAndPay/src/components/Footer/index.js +1 -1
- package/_modules/themes/orderAndPay/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/orderAndPay/src/components/OrderTypeSelectorContent/index.js +1 -1
- package/_modules/themes/orderAndPay/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/pwa/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/pwa/src/components/Checkout/index.js +1 -1
- package/_modules/themes/pwa/src/components/Footer/index.js +1 -1
- package/_modules/themes/pwa/src/components/HelpStaticPage/index.js +1 -1
- package/_modules/themes/pwa/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/pwa/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/seven/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/seven/src/components/Checkout/index.js +1 -1
- package/_modules/themes/seven/src/components/Footer/index.js +1 -1
- package/_modules/themes/seven/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/seven/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/seven/src/components/ProductForm/productForm.js +1 -1
- package/_modules/themes/six/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/six/src/components/Checkout/index.js +1 -1
- package/_modules/themes/six/src/components/Footer/index.js +1 -1
- package/_modules/themes/six/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/three/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/three/src/components/Checkout/index.js +1 -1
- package/_modules/themes/three/src/components/Footer/index.js +1 -1
- package/_modules/themes/three/src/components/HelpStaticPage/index.js +1 -1
- package/_modules/themes/three/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/three/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/two/src/components/Checkout/index.js +1 -1
- package/_modules/themes/two/src/components/HelpStaticPage/index.js +1 -1
- package/_modules/themes/two/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/two/src/components/OrdersOption/index.js +1 -1
- package/_modules/themes/wow/src/components/AddressForm/index.js +1 -1
- package/_modules/themes/wow/src/components/Checkout/index.js +1 -1
- package/_modules/themes/wow/src/components/LoginForm/index.js +1 -1
- package/_modules/themes/wow/src/components/OrdersOption/index.js +1 -1
- package/package.json +2 -2
- package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +22 -13
- package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +20 -7
- package/src/themes/callcenterOriginal/src/components/AddressList/index.js +26 -14
- package/src/themes/callcenterOriginal/src/components/AddressList/styles.js +13 -5
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +210 -68
- package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/styles.js +127 -11
- package/src/themes/five/src/components/BusinessController/index.js +1 -1
- package/src/themes/five/src/components/BusinessProductsListing/index.js +21 -0
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
- package/src/themes/five/src/components/MyOrders/index.js +5 -1
- package/src/themes/five/src/components/OrderDetails/index.js +2 -0
- package/src/themes/five/src/components/OrdersOption/index.js +5 -3
- package/src/themes/five/src/components/PageBanner/index.js +14 -4
- package/src/themes/five/src/components/PhoneAutocomplete/index.js +1 -2
- package/src/themes/five/src/components/ProductItemAccordion/index.js +4 -0
- package/src/themes/five/src/components/RenderProductsLayout/index.js +4 -1
- package/src/themes/five/src/components/UserDetails/styles.js +2 -2
- package/src/themes/five/src/components/WebsocketStatus/index.js +4 -4
- package/_bundles/ordering-ui.8a4a9a1da3d54294518d.js +0 -2
- /package/_bundles/{1.ordering-ui.8a4a9a1da3d54294518d.js → 1.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{2.ordering-ui.8a4a9a1da3d54294518d.js → 2.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{5.ordering-ui.8a4a9a1da3d54294518d.js → 5.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{6.ordering-ui.8a4a9a1da3d54294518d.js → 6.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{7.ordering-ui.8a4a9a1da3d54294518d.js.LICENSE.txt → 7.ordering-ui.69ebaa12d869719caa38.js.LICENSE.txt} +0 -0
- /package/_bundles/{8.ordering-ui.8a4a9a1da3d54294518d.js → 8.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{9.ordering-ui.8a4a9a1da3d54294518d.js → 9.ordering-ui.69ebaa12d869719caa38.js} +0 -0
- /package/_bundles/{ordering-ui.8a4a9a1da3d54294518d.js.LICENSE.txt → ordering-ui.69ebaa12d869719caa38.js.LICENSE.txt} +0 -0
|
@@ -9,18 +9,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _reactSelect = _interopRequireDefault(require("react-select"));
|
|
10
10
|
var _orderingComponentsExternal = require("ordering-components-external");
|
|
11
11
|
var _styledComponents = require("styled-components");
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var _Buttons = require("../../styles/Buttons");
|
|
15
|
-
var _Confirm = require("../Confirm");
|
|
16
|
-
var _UserDetails = require("../UserDetails");
|
|
12
|
+
var _Confirm = require("../../../../five/src/components/Confirm");
|
|
13
|
+
var _five = require("../../../../five");
|
|
17
14
|
var _AddressList = require("../AddressList");
|
|
15
|
+
var _UserDetails = require("../UserDetails");
|
|
18
16
|
var _styles = require("./styles");
|
|
19
17
|
var _MdcCellphoneAndroid = _interopRequireDefault(require("@meronex/icons/mdc/MdcCellphoneAndroid"));
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
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); }
|
|
22
20
|
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; }
|
|
23
|
-
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); }
|
|
24
21
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
22
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
23
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -37,20 +34,27 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
37
34
|
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; } }
|
|
38
35
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
39
36
|
var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
40
|
-
var
|
|
37
|
+
var _orderState$options, _configState$configs, _customersPhones$user2, _orderState$options4, _orderState$options7, _theme$images, _theme$images2, _orderState$options8, _orderState$options9, _orderState$options11, _orderState$options12, _theme$colors, _theme$images3, _customerState$result, _customerState$result2;
|
|
41
38
|
var phone = props.phone,
|
|
42
39
|
customerState = props.customerState,
|
|
43
40
|
customersPhones = props.customersPhones,
|
|
44
41
|
setCustomersPhones = props.setCustomersPhones,
|
|
45
42
|
openModal = props.openModal,
|
|
43
|
+
limitPhoneLength = props.limitPhoneLength,
|
|
46
44
|
setOpenModal = props.setOpenModal,
|
|
47
45
|
onChangeNumber = props.onChangeNumber,
|
|
48
46
|
setCustomerState = props.setCustomerState,
|
|
49
47
|
countryCallingCode = props.countryCallingCode,
|
|
50
|
-
onRedirectPage = props.onRedirectPage
|
|
48
|
+
onRedirectPage = props.onRedirectPage,
|
|
49
|
+
urlPhone = props.urlPhone,
|
|
50
|
+
orderTypes = props.orderTypes,
|
|
51
|
+
localPhoneCode = props.localPhoneCode;
|
|
52
|
+
var allOrderTypes = [1, 2, 3, 4, 5];
|
|
53
|
+
var pickupTypes = [2, 3, 4, 5];
|
|
51
54
|
var _useOrder = (0, _orderingComponentsExternal.useOrder)(),
|
|
52
|
-
_useOrder2 = _slicedToArray(_useOrder,
|
|
53
|
-
orderState = _useOrder2[0]
|
|
55
|
+
_useOrder2 = _slicedToArray(_useOrder, 2),
|
|
56
|
+
orderState = _useOrder2[0],
|
|
57
|
+
changeType = _useOrder2[1].changeType;
|
|
54
58
|
var _useLanguage = (0, _orderingComponentsExternal.useLanguage)(),
|
|
55
59
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
56
60
|
t = _useLanguage2[1];
|
|
@@ -58,6 +62,9 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
58
62
|
var _useCustomer = (0, _orderingComponentsExternal.useCustomer)(),
|
|
59
63
|
_useCustomer2 = _slicedToArray(_useCustomer, 2),
|
|
60
64
|
deleteUserCustomer = _useCustomer2[1].deleteUserCustomer;
|
|
65
|
+
var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
|
|
66
|
+
_useConfig2 = _slicedToArray(_useConfig, 1),
|
|
67
|
+
configState = _useConfig2[0];
|
|
61
68
|
var _useState = (0, _react.useState)({
|
|
62
69
|
open: false,
|
|
63
70
|
content: []
|
|
@@ -65,7 +72,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
65
72
|
_useState2 = _slicedToArray(_useState, 2),
|
|
66
73
|
alertState = _useState2[0],
|
|
67
74
|
setAlertState = _useState2[1];
|
|
68
|
-
var _useState3 = (0, _react.useState)(''),
|
|
75
|
+
var _useState3 = (0, _react.useState)(urlPhone !== null && urlPhone !== void 0 ? urlPhone : ''),
|
|
69
76
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
70
77
|
inputValue = _useState4[0],
|
|
71
78
|
setInputValue = _useState4[1];
|
|
@@ -81,7 +88,16 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
81
88
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
82
89
|
isAddressFormOpen = _useState10[0],
|
|
83
90
|
setIsAddressFormOpen = _useState10[1];
|
|
91
|
+
var _useState11 = (0, _react.useState)(pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type)),
|
|
92
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
93
|
+
isPickupSelected = _useState12[0],
|
|
94
|
+
setIsPickupSelected = _useState12[1];
|
|
84
95
|
var userCustomer = JSON.parse(window.localStorage.getItem('user-customer'));
|
|
96
|
+
var configTypes = (configState === null || configState === void 0 || (_configState$configs = configState.configs) === null || _configState$configs === void 0 || (_configState$configs = _configState$configs.order_types_allowed) === null || _configState$configs === void 0 ? void 0 : _configState$configs.value.split('|').filter(function (value) {
|
|
97
|
+
return allOrderTypes.includes(Number(value));
|
|
98
|
+
}).map(function (value) {
|
|
99
|
+
return Number(value);
|
|
100
|
+
})) || [];
|
|
85
101
|
var userName = userCustomer !== null && userCustomer !== void 0 && userCustomer.lastname ? "".concat(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.name, " ").concat(userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.lastname) : userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.name;
|
|
86
102
|
var handleCloseAlert = function handleCloseAlert() {
|
|
87
103
|
setCustomersPhones(_objectSpread(_objectSpread({}, customersPhones), {}, {
|
|
@@ -105,8 +121,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
105
121
|
});
|
|
106
122
|
};
|
|
107
123
|
var handleFindClick = function handleFindClick() {
|
|
108
|
-
var _orderState$
|
|
109
|
-
if (userCustomer !== null && userCustomer !== void 0 && userCustomer.id && orderState !== null && orderState !== void 0 && (_orderState$
|
|
124
|
+
var _orderState$options2;
|
|
125
|
+
if (userCustomer !== null && userCustomer !== void 0 && userCustomer.id && orderState !== null && orderState !== void 0 && (_orderState$options2 = orderState.options) !== null && _orderState$options2 !== void 0 && (_orderState$options2 = _orderState$options2.address) !== null && _orderState$options2 !== void 0 && _orderState$options2.address) {
|
|
110
126
|
onRedirectPage && onRedirectPage('search');
|
|
111
127
|
} else {
|
|
112
128
|
setAlertState({
|
|
@@ -115,6 +131,14 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
115
131
|
});
|
|
116
132
|
}
|
|
117
133
|
};
|
|
134
|
+
var handleChangeType = function handleChangeType(value) {
|
|
135
|
+
if (!(orderState !== null && orderState !== void 0 && orderState.loading)) {
|
|
136
|
+
changeType(value);
|
|
137
|
+
if (value === 1) {
|
|
138
|
+
setIsPickupSelected(false);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
118
142
|
(0, _react.useEffect)(function () {
|
|
119
143
|
if (customersPhones !== null && customersPhones !== void 0 && customersPhones.error) {
|
|
120
144
|
setAlertState({
|
|
@@ -125,13 +149,14 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
125
149
|
}, [customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.error]);
|
|
126
150
|
var onInputChange = function onInputChange(inputValue, _ref) {
|
|
127
151
|
var action = _ref.action;
|
|
128
|
-
if (action === 'menu-close' || action === 'input-blur' || action === 'set-value') {
|
|
152
|
+
if (action === 'menu-close' || action === 'input-blur' || action === 'set-value' || inputValue.charAt(0) === '0') {
|
|
129
153
|
return;
|
|
130
154
|
}
|
|
131
155
|
if (!inputValue) {
|
|
132
156
|
setInputValue(inputValue);
|
|
157
|
+
onChangeNumber(inputValue);
|
|
133
158
|
}
|
|
134
|
-
if (inputValue && inputValue.length >
|
|
159
|
+
if (inputValue && inputValue.length > limitPhoneLength || !/^[0-9]+$/.test(inputValue)) {
|
|
135
160
|
return;
|
|
136
161
|
}
|
|
137
162
|
setInputValue(inputValue);
|
|
@@ -141,6 +166,10 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
141
166
|
var _customersPhones$user;
|
|
142
167
|
setOptSelected(option);
|
|
143
168
|
setInputValue(option ? option === null || option === void 0 ? void 0 : option.value : '');
|
|
169
|
+
if (!option) {
|
|
170
|
+
onChangeNumber('');
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
144
173
|
var user = (_customersPhones$user = customersPhones.users) === null || _customersPhones$user === void 0 ? void 0 : _customersPhones$user.find(function (user) {
|
|
145
174
|
return user.cellphone === (option === null || option === void 0 ? void 0 : option.value) || user.phone === (option === null || option === void 0 ? void 0 : option.value);
|
|
146
175
|
});
|
|
@@ -148,29 +177,39 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
148
177
|
setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
|
|
149
178
|
result: user
|
|
150
179
|
}));
|
|
151
|
-
setOpenModal(
|
|
180
|
+
setOpenModal({
|
|
181
|
+
signup: false,
|
|
152
182
|
customer: true
|
|
183
|
+
});
|
|
184
|
+
} else {
|
|
185
|
+
setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
|
|
186
|
+
result: {
|
|
187
|
+
error: false
|
|
188
|
+
}
|
|
153
189
|
}));
|
|
190
|
+
setOpenModal({
|
|
191
|
+
customer: false,
|
|
192
|
+
signup: true
|
|
193
|
+
});
|
|
154
194
|
}
|
|
155
195
|
};
|
|
156
196
|
var createNewUser = function createNewUser() {
|
|
157
197
|
var _optSelected$value;
|
|
158
|
-
if (optSelected && (optSelected === null || optSelected === void 0 || (_optSelected$value = optSelected.value) === null || _optSelected$value === void 0 ? void 0 : _optSelected$value.length) ===
|
|
198
|
+
if (optSelected && (optSelected === null || optSelected === void 0 || (_optSelected$value = optSelected.value) === null || _optSelected$value === void 0 ? void 0 : _optSelected$value.length) === limitPhoneLength || !optSelected && phone.length === limitPhoneLength) {
|
|
159
199
|
setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
|
|
160
200
|
signup: true
|
|
161
201
|
}));
|
|
162
202
|
} else {
|
|
163
203
|
setAlertState({
|
|
164
204
|
open: true,
|
|
165
|
-
content: t('ERROR_MIN_CHARACTERS_PHONE', 'The Phone / Mobile must be
|
|
205
|
+
content: t('ERROR_MIN_CHARACTERS_PHONE', 'The Phone / Mobile must be :length: characters').replace(':length:', limitPhoneLength)
|
|
166
206
|
});
|
|
167
207
|
}
|
|
168
208
|
};
|
|
169
209
|
var handleCloseAddressList = function handleCloseAddressList() {
|
|
170
|
-
setOpenModal({
|
|
171
|
-
openModal: openModal,
|
|
210
|
+
setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
|
|
172
211
|
customer: false
|
|
173
|
-
});
|
|
212
|
+
}));
|
|
174
213
|
setCustomerState(_objectSpread(_objectSpread({}, customerState), {}, {
|
|
175
214
|
result: {
|
|
176
215
|
error: false
|
|
@@ -178,24 +217,88 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
178
217
|
}));
|
|
179
218
|
deleteUserCustomer(true);
|
|
180
219
|
};
|
|
220
|
+
var handleChangeToPickup = function handleChangeToPickup() {
|
|
221
|
+
var _orderTypes$find;
|
|
222
|
+
var firstEnabledPickupType = (_orderTypes$find = orderTypes.find(function (type) {
|
|
223
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
224
|
+
})) === null || _orderTypes$find === void 0 ? void 0 : _orderTypes$find.value;
|
|
225
|
+
handleChangeType(firstEnabledPickupType);
|
|
226
|
+
setIsPickupSelected(true);
|
|
227
|
+
};
|
|
181
228
|
var optionsToSelect = customersPhones.users.map(function (user) {
|
|
182
229
|
var obj = {};
|
|
183
230
|
obj.value = user.cellphone || user.phone;
|
|
184
231
|
obj.label = "".concat(user !== null && user !== void 0 && user.country_phone_code ? "(".concat(user === null || user === void 0 ? void 0 : user.country_phone_code, ")") : '', " ").concat(user !== null && user !== void 0 && user.phone && !(user !== null && user !== void 0 && user.cellphone) ? "".concat(user === null || user === void 0 ? void 0 : user.phone) : '', " ").concat(user !== null && user !== void 0 && user.cellphone ? "".concat(user.cellphone) : '', " - {").concat(user.name, "}");
|
|
185
232
|
return obj;
|
|
186
233
|
}) || [];
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
234
|
+
(0, _react.useEffect)(function () {
|
|
235
|
+
if (!urlPhone) return;
|
|
236
|
+
onInputChange(urlPhone, {
|
|
237
|
+
action: 'url'
|
|
238
|
+
});
|
|
239
|
+
onChange({
|
|
240
|
+
value: urlPhone,
|
|
241
|
+
label: urlPhone
|
|
242
|
+
});
|
|
243
|
+
}, [urlPhone, customersPhones === null || customersPhones === void 0 || (_customersPhones$user2 = customersPhones.users) === null || _customersPhones$user2 === void 0 ? void 0 : _customersPhones$user2.length]);
|
|
244
|
+
(0, _react.useEffect)(function () {
|
|
245
|
+
var _orderState$options3;
|
|
246
|
+
if (pickupTypes.includes(orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type)) {
|
|
247
|
+
setIsPickupSelected(true);
|
|
248
|
+
}
|
|
249
|
+
}, [orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type]);
|
|
250
|
+
var OrderTypesComponent = function OrderTypesComponent() {
|
|
251
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
|
|
252
|
+
return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && type.value !== 1;
|
|
253
|
+
}) : orderTypes).map(function (item, i) {
|
|
254
|
+
var _orderState$options5, _orderState$options6;
|
|
255
|
+
return /*#__PURE__*/_react.default.createElement(_five.Button, {
|
|
256
|
+
key: item.value,
|
|
257
|
+
onClick: function onClick() {
|
|
258
|
+
return handleChangeType(item.value);
|
|
259
|
+
},
|
|
260
|
+
color: (orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type) === (item === null || item === void 0 ? void 0 : item.value) ? 'primary' : 'secondary',
|
|
261
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
262
|
+
className: (orderState === null || orderState === void 0 || (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.type) !== (item === null || item === void 0 ? void 0 : item.value) ? 'activated' : ''
|
|
263
|
+
}, item.text);
|
|
264
|
+
}));
|
|
265
|
+
};
|
|
266
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.PhoneContainer, null, /*#__PURE__*/_react.default.createElement(_styles.ContentWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, t('TITLE_HOME_CALLCENTER', 'Welcome to your Ordering Call Center.')), /*#__PURE__*/_react.default.createElement(_styles.Slogan, null, t('SUBTITLE_HOME_CALLCENTER', 'Start first by selecting a delivery type')), !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options7 = orderState.options) !== null && _orderState$options7 !== void 0 && (_orderState$options7 = _orderState$options7.address) !== null && _orderState$options7 !== void 0 && _orderState$options7.address) && /*#__PURE__*/_react.default.createElement(_styles.TypesContainer, null, configTypes.includes(1) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
267
|
+
onClick: function onClick() {
|
|
268
|
+
return handleChangeType(1);
|
|
269
|
+
},
|
|
270
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
271
|
+
activated: !isPickupSelected
|
|
272
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
273
|
+
activated: !isPickupSelected
|
|
274
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
275
|
+
src: theme === null || theme === void 0 || (_theme$images = theme.images) === null || _theme$images === void 0 || (_theme$images = _theme$images.general) === null || _theme$images === void 0 ? void 0 : _theme$images.deliveryIco,
|
|
276
|
+
width: 20,
|
|
277
|
+
height: 20
|
|
278
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('DELIVERY', 'Delivery'))), configTypes.some(function (type) {
|
|
279
|
+
return pickupTypes.includes(type);
|
|
280
|
+
}) && /*#__PURE__*/_react.default.createElement(_styles.TypeButton, {
|
|
281
|
+
disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
|
|
282
|
+
activated: isPickupSelected,
|
|
283
|
+
onClick: function onClick() {
|
|
284
|
+
return handleChangeToPickup();
|
|
285
|
+
}
|
|
286
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.IconTypeButton, {
|
|
287
|
+
activated: isPickupSelected
|
|
288
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
289
|
+
src: theme === null || theme === void 0 || (_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.general) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.pickupIco,
|
|
290
|
+
width: 22,
|
|
291
|
+
height: 22
|
|
292
|
+
})), /*#__PURE__*/_react.default.createElement("p", null, t('PICKUP', 'Pickup')))), isPickupSelected && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, t('WHAT_PICKUP_YOU_NEED', 'What kind of pickup do you need?')), /*#__PURE__*/_react.default.createElement(_styles.AdditionalTypesContainer, null, /*#__PURE__*/_react.default.createElement(OrderTypesComponent, null))), configTypes.includes(orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.type) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !userCustomer && /*#__PURE__*/_react.default.createElement(_styles.PhoneAutocompleteContainer, null, /*#__PURE__*/_react.default.createElement("h2", null, t('ADDING_CUSTOMERS_PHONE_NUMBER', 'Adding the customers’ phone number')), /*#__PURE__*/_react.default.createElement(_styles.WrappBtn, null, /*#__PURE__*/_react.default.createElement(_five.Button, {
|
|
293
|
+
color: inputValue || userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options9 = orderState.options) !== null && _orderState$options9 !== void 0 && (_orderState$options9 = _orderState$options9.address) !== null && _orderState$options9 !== void 0 && _orderState$options9.address ? 'primary' : 'secundary',
|
|
294
|
+
onMouseDown: function onMouseDown() {
|
|
295
|
+
var _orderState$options10;
|
|
296
|
+
return !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options10 = orderState.options) !== null && _orderState$options10 !== void 0 && (_orderState$options10 = _orderState$options10.address) !== null && _orderState$options10 !== void 0 && _orderState$options10.address) ? createNewUser() : handleFindClick();
|
|
297
|
+
},
|
|
298
|
+
disabled: !inputValue && !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options11 = orderState.options) !== null && _orderState$options11 !== void 0 && (_orderState$options11 = _orderState$options11.address) !== null && _orderState$options11 !== void 0 && _orderState$options11.address)
|
|
299
|
+
}, !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options12 = orderState.options) !== null && _orderState$options12 !== void 0 && (_orderState$options12 = _orderState$options12.address) !== null && _orderState$options12 !== void 0 && _orderState$options12.address) ? t('CREATE_CUSTOMER', 'Create new customer') : "".concat(t('CONTINUE_WITH', 'Continue with'), " ").concat(userName))), /*#__PURE__*/_react.default.createElement(_styles.SelectContainer, null, /*#__PURE__*/_react.default.createElement(_MdcCellphoneAndroid.default, {
|
|
300
|
+
size: 18,
|
|
301
|
+
color: theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary
|
|
199
302
|
}), /*#__PURE__*/_react.default.createElement(_reactSelect.default, {
|
|
200
303
|
isSearchable: true,
|
|
201
304
|
isClearable: true,
|
|
@@ -211,29 +314,29 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
211
314
|
onInputChange: onInputChange,
|
|
212
315
|
isLoading: customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.loading,
|
|
213
316
|
options: optionsToSelect
|
|
214
|
-
})
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
var _orderState$options3;
|
|
218
|
-
return !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options3 = orderState.options) !== null && _orderState$options3 !== void 0 && (_orderState$options3 = _orderState$options3.address) !== null && _orderState$options3 !== void 0 && _orderState$options3.address) ? createNewUser() : handleFindClick();
|
|
317
|
+
}), optSelected && /*#__PURE__*/_react.default.createElement(_styles.ContinueButton, null, /*#__PURE__*/_react.default.createElement(_five.Button, {
|
|
318
|
+
onClick: function onClick() {
|
|
319
|
+
return onChange(optSelected);
|
|
219
320
|
},
|
|
220
|
-
|
|
221
|
-
},
|
|
321
|
+
color: "primary"
|
|
322
|
+
}, t('CONTINUE', 'Continue'))))))), /*#__PURE__*/_react.default.createElement(_styles.ImageWrapper, {
|
|
323
|
+
bgimage: theme === null || theme === void 0 || (_theme$images3 = theme.images) === null || _theme$images3 === void 0 || (_theme$images3 = _theme$images3.general) === null || _theme$images3 === void 0 ? void 0 : _theme$images3.phoneHero
|
|
324
|
+
})), /*#__PURE__*/_react.default.createElement(_five.Modal, {
|
|
222
325
|
open: openModal.signup,
|
|
223
326
|
width: "80%",
|
|
224
327
|
onClose: function onClose() {
|
|
225
|
-
return setOpenModal({
|
|
226
|
-
openModal: openModal,
|
|
328
|
+
return setOpenModal(_objectSpread(_objectSpread({}, openModal), {}, {
|
|
227
329
|
signup: false
|
|
228
|
-
});
|
|
330
|
+
}));
|
|
229
331
|
}
|
|
230
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
231
|
-
externalPhoneNumber: "".concat(countryCallingCode, " ").concat((optSelected === null || optSelected === void 0 ? void 0 : optSelected.value) || phone),
|
|
332
|
+
}, /*#__PURE__*/_react.default.createElement(_five.SignUpForm, {
|
|
333
|
+
externalPhoneNumber: "".concat(localPhoneCode || countryCallingCode, " ").concat((optSelected === null || optSelected === void 0 ? void 0 : optSelected.value) || phone),
|
|
232
334
|
saveCustomerUser: saveCustomerUser,
|
|
233
335
|
fieldsNotValid: props.fieldsNotValid,
|
|
234
336
|
useChekoutFileds: true,
|
|
235
|
-
isCustomerMode:
|
|
236
|
-
|
|
337
|
+
isCustomerMode: true,
|
|
338
|
+
isPopup: true
|
|
339
|
+
})), /*#__PURE__*/_react.default.createElement(_five.Modal, {
|
|
237
340
|
open: openModal.customer,
|
|
238
341
|
width: "80%",
|
|
239
342
|
onClose: function onClose() {
|
|
@@ -256,7 +359,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
256
359
|
userId: customerState === null || customerState === void 0 || (_customerState$result2 = customerState.result) === null || _customerState$result2 === void 0 ? void 0 : _customerState$result2.id,
|
|
257
360
|
changeOrderAddressWithDefault: true,
|
|
258
361
|
userCustomerSetup: _objectSpread(_objectSpread({}, customerState === null || customerState === void 0 ? void 0 : customerState.result), {}, {
|
|
259
|
-
phone: phone
|
|
362
|
+
phone: phone,
|
|
363
|
+
urlPhone: urlPhone
|
|
260
364
|
}),
|
|
261
365
|
isEnableContinueButton: true,
|
|
262
366
|
isCustomerMode: true,
|
|
@@ -269,20 +373,40 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
|
|
|
269
373
|
content: alertState.content,
|
|
270
374
|
onClose: handleCloseAlert,
|
|
271
375
|
onAccept: handleCloseAlert
|
|
272
|
-
}), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
|
|
273
|
-
return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
|
|
274
|
-
key: i
|
|
275
|
-
}, props));
|
|
276
|
-
}), (_props$afterElements = props.afterElements) === null || _props$afterElements === void 0 ? void 0 : _props$afterElements.map(function (AfterElement, i) {
|
|
277
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
278
|
-
key: i
|
|
279
|
-
}, AfterElement);
|
|
280
376
|
}));
|
|
281
377
|
};
|
|
282
378
|
var PhoneAutocomplete = function PhoneAutocomplete(props) {
|
|
283
|
-
var
|
|
379
|
+
var _useLanguage3 = (0, _orderingComponentsExternal.useLanguage)(),
|
|
380
|
+
_useLanguage4 = _slicedToArray(_useLanguage3, 2),
|
|
381
|
+
t = _useLanguage4[1];
|
|
382
|
+
var phoneProps = _objectSpread(_objectSpread({
|
|
284
383
|
UIComponent: PhoneAutocompleteUI
|
|
285
|
-
}, props)
|
|
384
|
+
}, props), {}, {
|
|
385
|
+
orderTypes: props.orderTypes || [{
|
|
386
|
+
value: 1,
|
|
387
|
+
text: t('DELIVERY', 'Delivery'),
|
|
388
|
+
description: t('ORDERTYPE_DESCRIPTION_DELIVERY', 'Delivery description')
|
|
389
|
+
}, {
|
|
390
|
+
value: 2,
|
|
391
|
+
text: t('PICKUP', 'Pickup'),
|
|
392
|
+
description: t('ORDERTYPE_DESCRIPTION_PICKUP', 'Pickup description')
|
|
393
|
+
}, {
|
|
394
|
+
value: 3,
|
|
395
|
+
text: t('EAT_IN', 'Eat in'),
|
|
396
|
+
description: t('ORDERTYPE_DESCRIPTION_EATIN', 'Eat in description')
|
|
397
|
+
}, {
|
|
398
|
+
value: 4,
|
|
399
|
+
text: t('CURBSIDE', 'Curbside'),
|
|
400
|
+
description: t('ORDERTYPE_DESCRIPTION_CURBSIDE', 'Curbside description')
|
|
401
|
+
}, {
|
|
402
|
+
value: 5,
|
|
403
|
+
text: t('DRIVE_THRU', 'Drive thru'),
|
|
404
|
+
description: t('ORDERTYPE_DESCRIPTION_DRIVETHRU', 'Drive Thru description')
|
|
405
|
+
}]
|
|
406
|
+
});
|
|
286
407
|
return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.PhoneAutocomplete, phoneProps);
|
|
287
408
|
};
|
|
288
|
-
exports.PhoneAutocomplete = PhoneAutocomplete;
|
|
409
|
+
exports.PhoneAutocomplete = PhoneAutocomplete;
|
|
410
|
+
PhoneAutocompleteUI.defaultProps = {
|
|
411
|
+
limitPhoneLength: 10
|
|
412
|
+
};
|
|
@@ -4,18 +4,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.WrappBtn = exports.WrapInput = exports.UserEdit = exports.Title = exports.Slogan = exports.SelectContainer = exports.SearchContainer = exports.PhoneContainer = exports.Info = exports.ContentWrapper = exports.AutoComplete = void 0;
|
|
7
|
+
exports.WrappBtn = exports.WrapInput = exports.UserEdit = exports.TypesContainer = exports.TypeButton = exports.Title = exports.Slogan = exports.SelectContainer = exports.SearchContainer = exports.PhoneContainer = exports.PhoneAutocompleteContainer = exports.Info = exports.ImageWrapper = exports.IconTypeButton = exports.ContinueButton = exports.ContentWrapper = exports.AutoComplete = exports.AdditionalTypesContainer = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22;
|
|
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;
|
|
10
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); }
|
|
11
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
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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); }
|
|
12
15
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
-
var PhoneContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: calc(100vh - 97px);\n
|
|
16
|
+
var PhoneContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: calc(100vh - 97px);\n display: flex;\n ", "\n\n .spinner-content{\n > div{\n width: 40px;\n height: 40px;\n border-width: 5px;\n }\n }\n\n .autocomplete {\n /*the container must be positioned relative:*/\n position: relative;\n }\n input {\n border: 1px solid transparent;\n background-color: #f1f1f1;\n padding: 10px;\n font-size: 16px;\n }\n input[type=text] {\n background-color: #f1f1f1;\n width: 100%;\n }\n input[type=submit] {\n background-color: #f1f1f1;\n width: 100%;\n }\n .autocomplete-items {\n position: absolute;\n border: 1px solid #d4d4d4;\n border-bottom: none;\n border-top: none;\n z-index: 99;\n /*position the autocomplete items to be the same width as the container:*/\n top: 100%;\n left: 0;\n right: 0;\n overflow: auto;\n max-height: 200px\n }\n .autocomplete-items div {\n padding: 10px;\n cursor: pointer;\n background-color: #fff;\n border-bottom: 1px solid #d4d4d4;\n }\n .autocomplete-items div:hover {\n /*when hovering an item:*/\n background-color: #e9e9e9;\n }\n .autocomplete-active {\n /*when navigating through the items using the arrow keys:*/\n background-color: DodgerBlue !important;\n color: #ffffff;\n }\n\n @media (min-width: 821px) {\n height: calc(100vh - 65px);\n }\n"])), function (_ref) {
|
|
14
17
|
var bgimage = _ref.bgimage;
|
|
15
18
|
return bgimage && (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-repeat: no-repeat, repeat;\n background-size: cover;\n object-fit: cover;\n background-position: bottom;\n background-image: url(", ");\n "])), bgimage);
|
|
16
19
|
});
|
|
17
20
|
exports.PhoneContainer = PhoneContainer;
|
|
18
|
-
var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n padding: 0px 20px 0px;\n
|
|
21
|
+
var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n height: 100%;\n padding: 0px 20px 0px;\n width: 70%;\n position: relative;\n .select__control {\n border-radius: 30px;\n }\n\n .select__control.select__control--is-focused {\n border-color: ", " !important;\n box-shadow: 0 0 0 1px ", " !important;\n }\n\n .select__value-container {\n padding: 10px 8px 0;\n }\n .select__indicator.select__loading-indicator {\n color: ", " !important;\n }\n\n .select__indicator.select__dropdown-indicator,\n .select__indicator-separator {\n display: none;\n }\n\n ", "\n\n input {\n width: 90%;\n margin-bottom: 15px;\n }\n\n @media (min-width: 425px) {\n input {\n width: 45%;\n }\n }\n\n @media (min-width: 768px) {\n padding: 0px 40px 0px;\n\n ", "\n }\n @media (min-width: 1400px){\n width: 60%;\n }\n"])), function (props) {
|
|
19
22
|
var _props$theme;
|
|
20
23
|
return (_props$theme = props.theme) === null || _props$theme === void 0 || (_props$theme = _props$theme.colors) === null || _props$theme === void 0 ? void 0 : _props$theme.primary;
|
|
21
24
|
}, function (props) {
|
|
@@ -32,9 +35,9 @@ var ContentWrapper = _styledComponents.default.div(_templateObject3 || (_templat
|
|
|
32
35
|
return ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.rtl) && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 0px 40px 0px;\n "])));
|
|
33
36
|
});
|
|
34
37
|
exports.ContentWrapper = ContentWrapper;
|
|
35
|
-
var WrappBtn = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 50%;\n
|
|
38
|
+
var WrappBtn = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n width: 50%;\n position: relative;\n button {\n position: absolute;\n top: 55px;\n min-width: 130px;\n max-width: 400px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n z-index: 100;\n }\n"])));
|
|
36
39
|
exports.WrappBtn = WrappBtn;
|
|
37
|
-
var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font: normal normal normal 80px ", ";\n letter-spacing: 0px;\n
|
|
40
|
+
var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font: normal normal normal 80px ", ";\n letter-spacing: 0px;\n text-shadow: 0px 3px 6px #00000029;\n opacity: 1;\n font-size: 35px;\n\n ", "\n"])), function (props) {
|
|
38
41
|
var _props$theme$fonts$sp;
|
|
39
42
|
return ((_props$theme$fonts$sp = props.theme.fonts.special) === null || _props$theme$fonts$sp === void 0 ? void 0 : _props$theme$fonts$sp.name) || 'Georgia';
|
|
40
43
|
}, function (props) {
|
|
@@ -42,7 +45,7 @@ var Title = _styledComponents.default.h1(_templateObject7 || (_templateObject7 =
|
|
|
42
45
|
return ((_props$theme6 = props.theme) === null || _props$theme6 === void 0 ? void 0 : _props$theme6.rtl) && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
|
|
43
46
|
});
|
|
44
47
|
exports.Title = Title;
|
|
45
|
-
var Slogan = _styledComponents.default.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font-size: 18px;\n letter-spacing: 0px;\n
|
|
48
|
+
var Slogan = _styledComponents.default.p(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin: 0px;\n text-align: left;\n font-size: 18px;\n letter-spacing: 0px;\n opacity: 1;\n margin-bottom: 15px;\n\n ", "\n\n @media (min-width: 480px) {\n font-size: 24px;\n }\n"])), function (props) {
|
|
46
49
|
var _props$theme7;
|
|
47
50
|
return ((_props$theme7 = props.theme) === null || _props$theme7 === void 0 ? void 0 : _props$theme7.rtl) && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n text-align: right;\n "])));
|
|
48
51
|
});
|
|
@@ -70,7 +73,50 @@ var UserEdit = _styledComponents.default.div(_templateObject19 || (_templateObje
|
|
|
70
73
|
exports.UserEdit = UserEdit;
|
|
71
74
|
var Info = _styledComponents.default.p(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral([""])));
|
|
72
75
|
exports.Info = Info;
|
|
73
|
-
var SelectContainer = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n width: 60%;\n position: relative;\n align-items: center;\n svg{\n position: absolute;\n top: 0;\n left:
|
|
76
|
+
var SelectContainer = _styledComponents.default.div(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n display: flex;\n width: 60%;\n position: relative;\n align-items: center;\n svg{\n position: absolute;\n top: 0;\n left: 20px;\n transform: translate(50%, 70%);\n z-index: 10;\n }\n > div {\n width: 100%;\n .select__placeholder, .select__single-value, input {\n margin-left: 40px;\n z-index: 100;\n bottom: -10px;\n }\n .select__menu {\n position: relative;\n padding: 20px;\n }\n .select__clear-indicator {\n position: relative;\n left: 0;\n transform: translate(-300%, -165%);\n svg{\n width: 30px;\n height: 30px;\n }\n }\n .select__control {\n height: 45px;\n padding-left: 10px;\n }\n .select__indicator {\n bottom: 8px;\n position: relative;\n }\n .select__menu{\n top: 45px;\n }\n input {\n position: relative;\n top: -5px;\n }\n }\n"])));
|
|
74
77
|
exports.SelectContainer = SelectContainer;
|
|
75
78
|
var SearchContainer = _styledComponents.default.div(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n width: 90%;\n"])));
|
|
76
|
-
exports.SearchContainer = SearchContainer;
|
|
79
|
+
exports.SearchContainer = SearchContainer;
|
|
80
|
+
var ImageWrapperStyled = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n width: 30%;\n ", "\n @media (min-width: 1400px){\n width: 40%;\n }\n"])), function (_ref3) {
|
|
81
|
+
var bgimage = _ref3.bgimage;
|
|
82
|
+
return bgimage && (0, _styledComponents.css)(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n background-repeat: no-repeat, repeat;\n background-size: cover;\n object-fit: cover;\n background-position: center;\n "])));
|
|
83
|
+
});
|
|
84
|
+
var ImageWrapper = function ImageWrapper(props) {
|
|
85
|
+
var style = {};
|
|
86
|
+
style.backgroundImage = "url(".concat(props.bgimage, ")");
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(ImageWrapperStyled, _extends({}, props, {
|
|
88
|
+
style: style
|
|
89
|
+
}), props.children);
|
|
90
|
+
};
|
|
91
|
+
exports.ImageWrapper = ImageWrapper;
|
|
92
|
+
var TypeButton = _styledComponents.default.div(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 215px;\n height: 75px;\n border-radius: 7.6px;\n padding: 16px;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.10);\n margin-right: 32px;\n margin-bottom: 32px;\n cursor: pointer;\n background: ", ";\n p{\n margin: 0;\n margin-left: 33px;\n ", "\n }\n"])), function (_ref4) {
|
|
93
|
+
var _theme$colors, _theme$colors2;
|
|
94
|
+
var activated = _ref4.activated,
|
|
95
|
+
theme = _ref4.theme;
|
|
96
|
+
return activated ? theme === null || theme === void 0 || (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary : theme === null || theme === void 0 || (_theme$colors2 = theme.colors) === null || _theme$colors2 === void 0 ? void 0 : _theme$colors2.white;
|
|
97
|
+
}, function (_ref5) {
|
|
98
|
+
var _theme$colors3;
|
|
99
|
+
var activated = _ref5.activated,
|
|
100
|
+
theme = _ref5.theme;
|
|
101
|
+
return activated && (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n color: ", ";\n "])), theme === null || theme === void 0 || (_theme$colors3 = theme.colors) === null || _theme$colors3 === void 0 ? void 0 : _theme$colors3.white);
|
|
102
|
+
});
|
|
103
|
+
exports.TypeButton = TypeButton;
|
|
104
|
+
var IconTypeButton = _styledComponents.default.div(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 44px;\n height: 44px;\n background: ", ";\n border-radius: 44px;\n"])), function (_ref6) {
|
|
105
|
+
var _theme$colors4;
|
|
106
|
+
var activated = _ref6.activated,
|
|
107
|
+
theme = _ref6.theme;
|
|
108
|
+
return activated ? theme === null || theme === void 0 || (_theme$colors4 = theme.colors) === null || _theme$colors4 === void 0 ? void 0 : _theme$colors4.white : '#F3F9FF';
|
|
109
|
+
});
|
|
110
|
+
exports.IconTypeButton = IconTypeButton;
|
|
111
|
+
var TypesContainer = _styledComponents.default.div(_templateObject28 || (_templateObject28 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
112
|
+
exports.TypesContainer = TypesContainer;
|
|
113
|
+
var AdditionalTypesContainer = _styledComponents.default.div(_templateObject29 || (_templateObject29 = _taggedTemplateLiteral(["\n width: 60%;\n display: flex;\n margin-bottom: 20px;\n button {\n padding: 4px 10px;\n border-radius: 50px;\n font-size: 10px;\n line-height: 0;\n height: 25px;\n margin-right: 20px;\n }\n .activated {\n color: ", "\n }\n"])), function (_ref7) {
|
|
114
|
+
var _theme$colors5;
|
|
115
|
+
var theme = _ref7.theme;
|
|
116
|
+
return theme === null || theme === void 0 || (_theme$colors5 = theme.colors) === null || _theme$colors5 === void 0 ? void 0 : _theme$colors5.darkTextColor;
|
|
117
|
+
});
|
|
118
|
+
exports.AdditionalTypesContainer = AdditionalTypesContainer;
|
|
119
|
+
var PhoneAutocompleteContainer = _styledComponents.default.div(_templateObject30 || (_templateObject30 = _taggedTemplateLiteral(["\n position: relative;\n h2 {\n font-size: 20px;\n margin-bottom: 20px;\n }\n"])));
|
|
120
|
+
exports.PhoneAutocompleteContainer = PhoneAutocompleteContainer;
|
|
121
|
+
var ContinueButton = _styledComponents.default.span(_templateObject31 || (_templateObject31 = _taggedTemplateLiteral(["\n position: absolute;\n right: 35px;\n bottom: 5px;\n width: \n button {\n cursor: pointer;\n }\n"])));
|
|
122
|
+
exports.ContinueButton = ContinueButton;
|
|
@@ -17,7 +17,7 @@ var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skelet
|
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
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); }
|
|
19
19
|
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; }
|
|
20
|
-
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; }
|
|
20
|
+
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 { value: void 0, done: !0 }; } 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 || "" === 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; } } throw new TypeError(_typeof(iterable) + " is not iterable"); } 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; }
|
|
21
21
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
22
22
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
23
23
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|