ordering-ui-external 14.1.40 → 14.1.42

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.
Files changed (27) hide show
  1. package/_bundles/{7.ordering-ui.2a09e7e0162e34ea955c.js → 7.ordering-ui.0bcf027ad972ccbec19e.js} +1 -1
  2. package/_bundles/{ordering-ui.2a09e7e0162e34ea955c.js → ordering-ui.0bcf027ad972ccbec19e.js} +2 -2
  3. package/_modules/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/index.js +322 -0
  4. package/_modules/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/styles.js +25 -0
  5. package/_modules/themes/callcenterOriginal/src/components/AddressForm/index.js +57 -58
  6. package/_modules/themes/callcenterOriginal/src/components/AddressForm/styles.js +3 -1
  7. package/_modules/themes/callcenterOriginal/src/components/AddressList/index.js +50 -20
  8. package/_modules/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +18 -26
  9. package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
  10. package/package.json +1 -1
  11. package/src/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/index.js +251 -0
  12. package/src/themes/callcenterOriginal/src/components/AddressForm/SpreadForm/styles.js +111 -0
  13. package/src/themes/callcenterOriginal/src/components/AddressForm/index.js +246 -230
  14. package/src/themes/callcenterOriginal/src/components/AddressForm/styles.js +2 -3
  15. package/src/themes/callcenterOriginal/src/components/AddressList/index.js +243 -214
  16. package/src/themes/callcenterOriginal/src/components/PhoneAutocomplete/index.js +1 -11
  17. package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +1 -1
  18. /package/_bundles/{0.ordering-ui.2a09e7e0162e34ea955c.js → 0.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  19. /package/_bundles/{1.ordering-ui.2a09e7e0162e34ea955c.js → 1.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  20. /package/_bundles/{2.ordering-ui.2a09e7e0162e34ea955c.js → 2.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  21. /package/_bundles/{4.ordering-ui.2a09e7e0162e34ea955c.js → 4.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  22. /package/_bundles/{5.ordering-ui.2a09e7e0162e34ea955c.js → 5.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  23. /package/_bundles/{6.ordering-ui.2a09e7e0162e34ea955c.js → 6.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  24. /package/_bundles/{7.ordering-ui.2a09e7e0162e34ea955c.js.LICENSE.txt → 7.ordering-ui.0bcf027ad972ccbec19e.js.LICENSE.txt} +0 -0
  25. /package/_bundles/{8.ordering-ui.2a09e7e0162e34ea955c.js → 8.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  26. /package/_bundles/{9.ordering-ui.2a09e7e0162e34ea955c.js → 9.ordering-ui.0bcf027ad972ccbec19e.js} +0 -0
  27. /package/_bundles/{ordering-ui.2a09e7e0162e34ea955c.js.LICENSE.txt → ordering-ui.0bcf027ad972ccbec19e.js.LICENSE.txt} +0 -0
@@ -21,7 +21,6 @@ var _styles2 = require("../AddressList/styles");
21
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
22
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
23
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
- 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); }
25
24
  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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
26
25
  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); } }
27
26
  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); }); }; }
@@ -38,7 +37,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
38
37
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
39
38
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
40
39
  var AddressFormUI = function AddressFormUI(props) {
41
- var _addressState$address, _ref, _formState$changes$ad, _formState$changes, _addressState$address2, _addressState$address3, _addressState$address4, _formState$changes$lo, _formState$changes2, _configState$configs, _configState$configs2, _configState$configs3, _configState$configs4, _props$beforeElements, _props$beforeComponen, _props$beforeMidEleme, _props$beforeMidCompo, _props$afterMidElemen, _props$afterMidCompon, _address$location5, _address$location6, _orderState$options6, _props$afterComponent, _props$afterElements;
40
+ var _addressState$address, _ref, _formState$changes$ad, _formState$changes, _addressState$address2, _addressState$address3, _addressState$address4, _formState$changes$lo, _formState$changes2, _businessesList$busin, _configState$configs, _configState$configs2, _configState$configs3, _configState$configs4, _address$location5, _address$location6, _orderState$options6;
42
41
  var addressesList = props.addressesList,
43
42
  googleMapsControls = props.googleMapsControls,
44
43
  formState = props.formState,
@@ -53,11 +52,15 @@ var AddressFormUI = function AddressFormUI(props) {
53
52
  userCustomerSetup = props.userCustomerSetup,
54
53
  businessesList = props.businessesList,
55
54
  getBusinessDeliveryZones = props.getBusinessDeliveryZones,
56
- isEnableContinueButton = props.isEnableContinueButton,
57
55
  address = props.address,
58
56
  notUseCustomerInfo = props.notUseCustomerInfo,
59
57
  addFormRestrictions = props.addFormRestrictions,
60
- isAllowUnaddressOrderType = props.isAllowUnaddressOrderType;
58
+ showSpreadForm = props.showSpreadForm,
59
+ isAllowUnaddressOrderType = props.isAllowUnaddressOrderType,
60
+ addressSpreadForm = props.addressSpreadForm,
61
+ setAddressSpreadForm = props.setAddressSpreadForm,
62
+ editSpreadAddress = props.editSpreadAddress,
63
+ setEditSpreadAddress = props.setEditSpreadAddress;
61
64
  var _useConfig = (0, _orderingComponentsExternal.useConfig)(),
62
65
  _useConfig2 = _slicedToArray(_useConfig, 1),
63
66
  configState = _useConfig2[0];
@@ -113,6 +116,9 @@ var AddressFormUI = function AddressFormUI(props) {
113
116
  _useState14 = _slicedToArray(_useState13, 2),
114
117
  locationChange = _useState14[0],
115
118
  setLocationChange = _useState14[1];
119
+ var businessZones = businessesList === null || businessesList === void 0 || (_businessesList$busin = businessesList.businesses) === null || _businessesList$busin === void 0 ? void 0 : _businessesList$busin.map(function (business) {
120
+ return business === null || business === void 0 ? void 0 : business.zones;
121
+ });
116
122
  var maxLimitLocation = configState === null || configState === void 0 || (_configState$configs = configState.configs) === null || _configState$configs === void 0 || (_configState$configs = _configState$configs.meters_to_change_address) === null || _configState$configs === void 0 ? void 0 : _configState$configs.value;
117
123
  var googleMapsApiKey = configState === null || configState === void 0 || (_configState$configs2 = configState.configs) === null || _configState$configs2 === void 0 || (_configState$configs2 = _configState$configs2.google_maps_api_key) === null || _configState$configs2 === void 0 ? void 0 : _configState$configs2.value;
118
124
  var isLocationRequired = ((_configState$configs3 = configState.configs) === null || _configState$configs3 === void 0 || (_configState$configs3 = _configState$configs3.google_autocomplete_selection_required) === null || _configState$configs3 === void 0 ? void 0 : _configState$configs3.value) === '1' || ((_configState$configs4 = configState.configs) === null || _configState$configs4 === void 0 || (_configState$configs4 = _configState$configs4.google_autocomplete_selection_required) === null || _configState$configs4 === void 0 ? void 0 : _configState$configs4.value) === 'true';
@@ -324,28 +330,31 @@ var AddressFormUI = function AddressFormUI(props) {
324
330
  var handleChangeAddress = /*#__PURE__*/function () {
325
331
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(address) {
326
332
  var _googleInputRef$curre;
327
- var result;
333
+ var updateFstValue,
334
+ result,
335
+ _args2 = arguments;
328
336
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
329
337
  while (1) switch (_context2.prev = _context2.next) {
330
338
  case 0:
339
+ updateFstValue = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : false;
331
340
  if (!(address !== null && address !== void 0 && address.location)) {
332
- _context2.next = 6;
341
+ _context2.next = 7;
333
342
  break;
334
343
  }
335
- _context2.next = 3;
344
+ _context2.next = 4;
336
345
  return getBusinessDeliveryZones(address === null || address === void 0 ? void 0 : address.location);
337
- case 3:
346
+ case 4:
338
347
  result = _context2.sent;
339
348
  setLocationChange(address === null || address === void 0 ? void 0 : address.location);
340
349
  if ((result === null || result === void 0 ? void 0 : result.length) === 0) {
341
350
  showToast(_orderingComponentsExternal.ToastType.Error, t('NO_NEAR_DELIVERY_ZONES', 'No near delivery zones'), 3000);
342
351
  }
343
- case 6:
352
+ case 7:
344
353
  setSelectedFromAutocomplete(true);
345
- updateChanges(_objectSpread(_objectSpread({}, address), {}, {
354
+ updateChanges(updateFstValue ? address : _objectSpread(_objectSpread({}, address), {}, {
346
355
  address: googleInputRef === null || googleInputRef === void 0 || (_googleInputRef$curre = googleInputRef.current) === null || _googleInputRef$curre === void 0 ? void 0 : _googleInputRef$curre.value
347
356
  }));
348
- case 8:
357
+ case 9:
349
358
  case "end":
350
359
  return _context2.stop();
351
360
  }
@@ -440,6 +449,7 @@ var AddressFormUI = function AddressFormUI(props) {
440
449
  setFirstLocationNoEdit({
441
450
  value: null
442
451
  });
452
+ setAddressSpreadForm(null);
443
453
  };
444
454
  }, []);
445
455
 
@@ -469,41 +479,30 @@ var AddressFormUI = function AddressFormUI(props) {
469
479
  getBusinessDeliveryZones(address === null || address === void 0 ? void 0 : address.location);
470
480
  }
471
481
  }, [address]);
482
+ (0, _react.useEffect)(function () {
483
+ if (addressSpreadForm) {
484
+ handleChangeAddress(addressSpreadForm, true);
485
+ }
486
+ }, [addressSpreadForm]);
472
487
  return /*#__PURE__*/_react.default.createElement("div", {
473
488
  className: "address-form"
474
- }, (_props$beforeElements = props.beforeElements) === null || _props$beforeElements === void 0 ? void 0 : _props$beforeElements.map(function (BeforeElement, i) {
475
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
476
- key: i
477
- }, BeforeElement);
478
- }), (_props$beforeComponen = props.beforeComponents) === null || _props$beforeComponen === void 0 ? void 0 : _props$beforeComponen.map(function (BeforeComponent, i) {
479
- return /*#__PURE__*/_react.default.createElement(BeforeComponent, _extends({
480
- key: i
481
- }, props));
482
- }), (configState.loading || addressState.loading) && /*#__PURE__*/_react.default.createElement(_styles.WrapperSkeleton, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
489
+ }, (configState.loading || addressState.loading) && /*#__PURE__*/_react.default.createElement(_styles.WrapperSkeleton, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
483
490
  height: 50,
484
491
  count: 5,
485
492
  style: {
486
493
  marginBottom: '10px'
487
494
  }
488
- })), !configState.loading && !addressState.loading && /*#__PURE__*/_react.default.createElement(_styles.FormControl, {
495
+ })), (!showSpreadForm || showSpreadForm && (addressSpreadForm === null || addressSpreadForm === void 0 ? void 0 : addressSpreadForm.address)) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !configState.loading && !addressState.loading && /*#__PURE__*/_react.default.createElement(_styles.FormControl, {
489
496
  onSubmit: formMethods.handleSubmit(onSubmit),
490
497
  onKeyDown: function onKeyDown(e) {
491
498
  return checkKeyDown(e);
492
499
  },
493
500
  autoComplete: "off"
494
- }, (_props$beforeMidEleme = props.beforeMidElements) === null || _props$beforeMidEleme === void 0 ? void 0 : _props$beforeMidEleme.map(function (BeforeMidElements, i) {
495
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
496
- key: i
497
- }, BeforeMidElements);
498
- }), (_props$beforeMidCompo = props.beforeMidComponents) === null || _props$beforeMidCompo === void 0 ? void 0 : _props$beforeMidCompo.map(function (BeforeMidComponents, i) {
499
- return /*#__PURE__*/_react.default.createElement(BeforeMidComponents, _extends({
500
- key: i
501
- }, props));
502
- }), inputNames.map(function (field) {
503
- var _address$location3, _address$location4, _formState$result3, _formState$result4, _formState$changes$ad5, _formState$changes28, _configState$configs5, _addressState$address12, _formState$changes29, _addressState$address13, _formState$changes30, _addressState$address14, _formState$changes31, _addressState$address15, _formState$changes32, _addressState$address16, _formState$changes33, _addressState$address17, _formState$changes34, _addressState$address18, _formState$changes35, _addressState$address19, _formState$changes36, _addressState$address20, _formState$changes37, _addressState$address21, _formState$changes38, _addressState$address22, _formState$changes39, _businessesList$busin, _theme$images, _ref10, _formState$changes$fi2, _formState$changes40, _addressState$address23, _ref11, _formState$changes$ad6, _formState$changes41;
501
+ }, inputNames.map(function (field) {
502
+ var _address$location3, _address$location4, _formState$result3, _formState$result4, _formState$changes$ad5, _formState$changes28, _configState$configs5, _addressState$address12, _formState$changes29, _addressState$address13, _formState$changes30, _addressState$address14, _formState$changes31, _addressState$address15, _formState$changes32, _addressState$address16, _formState$changes33, _addressState$address17, _formState$changes34, _addressState$address18, _formState$changes35, _addressState$address19, _formState$changes36, _addressState$address20, _formState$changes37, _addressState$address21, _formState$changes38, _addressState$address22, _formState$changes39, _theme$images, _ref10, _formState$changes$fi2, _formState$changes40, _addressState$address23, _ref11, _formState$changes$ad6, _formState$changes41;
504
503
  return showField && showField(field.name) && (field.name === 'address' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
505
504
  key: field.name
506
- }, /*#__PURE__*/_react.default.createElement(_styles.AddressWrap, {
505
+ }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !showSpreadForm && /*#__PURE__*/_react.default.createElement(_styles.AddressWrap, {
507
506
  className: "google-control"
508
507
  }, /*#__PURE__*/_react.default.createElement(_styles.WrapAddressInput, null, !selectedFromAutocomplete && (address === null || address === void 0 ? void 0 : address.address) && (!(address !== null && address !== void 0 && (_address$location3 = address.location) !== null && _address$location3 !== void 0 && _address$location3.lat) || !(address !== null && address !== void 0 && (_address$location4 = address.location) !== null && _address$location4 !== void 0 && _address$location4.lng)) && /*#__PURE__*/_react.default.createElement(_styles.AddressMarkContainer, null, /*#__PURE__*/_react.default.createElement("p", null, t('PLEASE_SELECT_GOOGLE_MAPS_ADDRESS', 'Please select an address given by google maps.'))), /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.GoogleAutocompleteInput, {
509
508
  className: "input-autocomplete",
@@ -539,6 +538,7 @@ var AddressFormUI = function AddressFormUI(props) {
539
538
  IconButton: _reactBootstrapIcons.GeoAlt,
540
539
  IconLoadingButton: _CgSearchLoading.default
541
540
  })), ((addressState === null || addressState === void 0 || (_addressState$address12 = addressState.address) === null || _addressState$address12 === void 0 ? void 0 : _addressState$address12.location) || (formState === null || formState === void 0 || (_formState$changes29 = formState.changes) === null || _formState$changes29 === void 0 ? void 0 : _formState$changes29.location)) && /*#__PURE__*/_react.default.createElement(_styles.WrapperMap, {
541
+ showMap: showMap || !showSpreadForm,
542
542
  notUseCustomerInfo: notUseCustomerInfo,
543
543
  addFormRestrictions: addFormRestrictions
544
544
  }, !showMap && /*#__PURE__*/_react.default.createElement("section", null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.GeoAlt, {
@@ -546,7 +546,7 @@ var AddressFormUI = function AddressFormUI(props) {
546
546
  fontSize: 25,
547
547
  marginRight: 5
548
548
  }
549
- }), ((addressState === null || addressState === void 0 || (_addressState$address13 = addressState.address) === null || _addressState$address13 === void 0 ? void 0 : _addressState$address13.address) || (formState === null || formState === void 0 || (_formState$changes30 = formState.changes) === null || _formState$changes30 === void 0 ? void 0 : _formState$changes30.address)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address14 = addressState.address) === null || _addressState$address14 === void 0 ? void 0 : _addressState$address14.address) || (formState === null || formState === void 0 || (_formState$changes31 = formState.changes) === null || _formState$changes31 === void 0 ? void 0 : _formState$changes31.address), ', '), ((addressState === null || addressState === void 0 || (_addressState$address15 = addressState.address) === null || _addressState$address15 === void 0 ? void 0 : _addressState$address15.country) || (formState === null || formState === void 0 || (_formState$changes32 = formState.changes) === null || _formState$changes32 === void 0 ? void 0 : _formState$changes32.country)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address16 = addressState.address) === null || _addressState$address16 === void 0 ? void 0 : _addressState$address16.country) || (formState === null || formState === void 0 || (_formState$changes33 = formState.changes) === null || _formState$changes33 === void 0 ? void 0 : _formState$changes33.country), ', '), ((addressState === null || addressState === void 0 || (_addressState$address17 = addressState.address) === null || _addressState$address17 === void 0 ? void 0 : _addressState$address17.address_notes) || (formState === null || formState === void 0 || (_formState$changes34 = formState.changes) === null || _formState$changes34 === void 0 ? void 0 : _formState$changes34.address_notes)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address18 = addressState.address) === null || _addressState$address18 === void 0 ? void 0 : _addressState$address18.address_notes) || (formState === null || formState === void 0 || (_formState$changes35 = formState.changes) === null || _formState$changes35 === void 0 ? void 0 : _formState$changes35.address_notes), ', '), ((addressState === null || addressState === void 0 || (_addressState$address19 = addressState.address) === null || _addressState$address19 === void 0 ? void 0 : _addressState$address19.internal_number) || (formState === null || formState === void 0 || (_formState$changes36 = formState.changes) === null || _formState$changes36 === void 0 ? void 0 : _formState$changes36.internal_number)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address20 = addressState.address) === null || _addressState$address20 === void 0 ? void 0 : _addressState$address20.internal_number) || (formState === null || formState === void 0 || (_formState$changes37 = formState.changes) === null || _formState$changes37 === void 0 ? void 0 : _formState$changes37.internal_number), ', '), ((addressState === null || addressState === void 0 || (_addressState$address21 = addressState.address) === null || _addressState$address21 === void 0 ? void 0 : _addressState$address21.zipcode) || (formState === null || formState === void 0 || (_formState$changes38 = formState.changes) === null || _formState$changes38 === void 0 ? void 0 : _formState$changes38.zipcode)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address22 = addressState.address) === null || _addressState$address22 === void 0 ? void 0 : _addressState$address22.zipcode) || (formState === null || formState === void 0 || (_formState$changes39 = formState.changes) === null || _formState$changes39 === void 0 ? void 0 : _formState$changes39.zipcode), ', '), /*#__PURE__*/_react.default.createElement("a", {
549
+ }), ((addressState === null || addressState === void 0 || (_addressState$address13 = addressState.address) === null || _addressState$address13 === void 0 ? void 0 : _addressState$address13.address) || (formState === null || formState === void 0 || (_formState$changes30 = formState.changes) === null || _formState$changes30 === void 0 ? void 0 : _formState$changes30.address)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address14 = addressState.address) === null || _addressState$address14 === void 0 ? void 0 : _addressState$address14.address) || (formState === null || formState === void 0 || (_formState$changes31 = formState.changes) === null || _formState$changes31 === void 0 ? void 0 : _formState$changes31.address), ', '), ((addressState === null || addressState === void 0 || (_addressState$address15 = addressState.address) === null || _addressState$address15 === void 0 ? void 0 : _addressState$address15.country) || (formState === null || formState === void 0 || (_formState$changes32 = formState.changes) === null || _formState$changes32 === void 0 ? void 0 : _formState$changes32.country)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address16 = addressState.address) === null || _addressState$address16 === void 0 ? void 0 : _addressState$address16.country) || (formState === null || formState === void 0 || (_formState$changes33 = formState.changes) === null || _formState$changes33 === void 0 ? void 0 : _formState$changes33.country), ', '), ((addressState === null || addressState === void 0 || (_addressState$address17 = addressState.address) === null || _addressState$address17 === void 0 ? void 0 : _addressState$address17.address_notes) || (formState === null || formState === void 0 || (_formState$changes34 = formState.changes) === null || _formState$changes34 === void 0 ? void 0 : _formState$changes34.address_notes)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address18 = addressState.address) === null || _addressState$address18 === void 0 ? void 0 : _addressState$address18.address_notes) || (formState === null || formState === void 0 || (_formState$changes35 = formState.changes) === null || _formState$changes35 === void 0 ? void 0 : _formState$changes35.address_notes), ', '), ((addressState === null || addressState === void 0 || (_addressState$address19 = addressState.address) === null || _addressState$address19 === void 0 ? void 0 : _addressState$address19.internal_number) || (formState === null || formState === void 0 || (_formState$changes36 = formState.changes) === null || _formState$changes36 === void 0 ? void 0 : _formState$changes36.internal_number)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address20 = addressState.address) === null || _addressState$address20 === void 0 ? void 0 : _addressState$address20.internal_number) || (formState === null || formState === void 0 || (_formState$changes37 = formState.changes) === null || _formState$changes37 === void 0 ? void 0 : _formState$changes37.internal_number), ', '), ((addressState === null || addressState === void 0 || (_addressState$address21 = addressState.address) === null || _addressState$address21 === void 0 ? void 0 : _addressState$address21.zipcode) || (formState === null || formState === void 0 || (_formState$changes38 = formState.changes) === null || _formState$changes38 === void 0 ? void 0 : _formState$changes38.zipcode)) && /*#__PURE__*/_react.default.createElement("span", null, (addressState === null || addressState === void 0 || (_addressState$address22 = addressState.address) === null || _addressState$address22 === void 0 ? void 0 : _addressState$address22.zipcode) || (formState === null || formState === void 0 || (_formState$changes39 = formState.changes) === null || _formState$changes39 === void 0 ? void 0 : _formState$changes39.zipcode), ', '), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("a", {
550
550
  style: {
551
551
  textDecoration: 'underline',
552
552
  color: 'blue',
@@ -555,7 +555,17 @@ var AddressFormUI = function AddressFormUI(props) {
555
555
  onClick: function onClick() {
556
556
  return setShowMap(!showMap);
557
557
  }
558
- }, t('SHOW_MAP', 'Show Map'))), locationChange && showMap && /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.GoogleMapsMap, {
558
+ }, t('SHOW_MAP', 'Show Map')), showSpreadForm && /*#__PURE__*/_react.default.createElement("a", {
559
+ style: {
560
+ textDecoration: 'underline',
561
+ color: 'blue',
562
+ cursor: 'pointer',
563
+ marginLeft: 20
564
+ },
565
+ onClick: function onClick() {
566
+ return setEditSpreadAddress(!editSpreadAddress);
567
+ }
568
+ }, t('EDIT_ADDRESS', 'Edit Address'))), locationChange && showMap && /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.GoogleMapsMap, {
559
569
  useMapWithBusinessZones: true,
560
570
  deactiveAlerts: true,
561
571
  avoidFitBounds: true,
@@ -566,15 +576,20 @@ var AddressFormUI = function AddressFormUI(props) {
566
576
  handleChangeAddressMap: handleChangeAddress,
567
577
  setErrors: setMapErrors,
568
578
  maxLimitLocation: parseInt(maxLimitLocation, 10),
569
- businessZones: businessesList === null || businessesList === void 0 || (_businessesList$busin = businessesList.businesses) === null || _businessesList$busin === void 0 ? void 0 : _businessesList$busin.map(function (business) {
570
- return business === null || business === void 0 ? void 0 : business.zones;
571
- }),
579
+ businessZones: businessZones,
572
580
  fallbackIcon: (_theme$images = theme.images) === null || _theme$images === void 0 || (_theme$images = _theme$images.dummies) === null || _theme$images === void 0 ? void 0 : _theme$images.businessLogo
573
- }), showMap && /*#__PURE__*/_react.default.createElement(_styles.StreetViewText, {
581
+ }), showMap && !editSpreadAddress && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showSpreadForm && /*#__PURE__*/_react.default.createElement(_styles.StreetViewText, {
582
+ style: {
583
+ top: '0'
584
+ },
585
+ onClick: function onClick() {
586
+ return setEditSpreadAddress(!editSpreadAddress);
587
+ }
588
+ }, t('EDIT_ADDRESS', 'Edit Address')), /*#__PURE__*/_react.default.createElement(_styles.StreetViewText, {
574
589
  onClick: function onClick() {
575
590
  return openStreetView();
576
591
  }
577
- }, t('OPEN_STREET_VIEW', 'Open Street view')))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
592
+ }, t('OPEN_STREET_VIEW', 'Open Street view')))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
578
593
  key: field.name
579
594
  }, field.name !== 'address_notes' ? /*#__PURE__*/_react.default.createElement(_Inputs.Input, {
580
595
  className: field.name,
@@ -639,15 +654,7 @@ var AddressFormUI = function AddressFormUI(props) {
639
654
  onClick: function onClick() {
640
655
  return handleAddressTag('other');
641
656
  }
642
- }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.PlusLg, null)))), (_props$afterMidElemen = props.afterMidElements) === null || _props$afterMidElemen === void 0 ? void 0 : _props$afterMidElemen.map(function (MidElement, i) {
643
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
644
- key: i
645
- }, MidElement);
646
- }), (_props$afterMidCompon = props.afterMidComponents) === null || _props$afterMidCompon === void 0 ? void 0 : _props$afterMidCompon.map(function (MidComponent, i) {
647
- return /*#__PURE__*/_react.default.createElement(MidComponent, _extends({
648
- key: i
649
- }, props));
650
- }), /*#__PURE__*/_react.default.createElement(_styles.FormActions, null, !addFormRestrictions && Object.keys(formState === null || formState === void 0 ? void 0 : formState.changes).length === 0 && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
657
+ }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.PlusLg, null)))), /*#__PURE__*/_react.default.createElement(_styles.FormActions, null, !addFormRestrictions && Object.keys(formState === null || formState === void 0 ? void 0 : formState.changes).length === 0 && /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
651
658
  outline: true,
652
659
  type: "button",
653
660
  disabled: formState.loading,
@@ -660,13 +667,13 @@ var AddressFormUI = function AddressFormUI(props) {
660
667
  type: "submit",
661
668
  disabled: formState.loading,
662
669
  color: "primary"
663
- }, !formState.loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isEditing || !auth && (_orderState$options6 = orderState.options) !== null && _orderState$options6 !== void 0 && (_orderState$options6 = _orderState$options6.address) !== null && _orderState$options6 !== void 0 && _orderState$options6.address ? t('UPDATE', 'Update') : t('ADD_ADDRESS', 'Add address')) : t('LOADING', 'Loading'))), isAllowUnaddressOrderType && /*#__PURE__*/_react.default.createElement(_styles.WithoutAddressContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.WithoutAddressText, {
670
+ }, !formState.loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isEditing || !auth && (_orderState$options6 = orderState.options) !== null && _orderState$options6 !== void 0 && (_orderState$options6 = _orderState$options6.address) !== null && _orderState$options6 !== void 0 && _orderState$options6.address ? t('SAVE_AND_CONTINUE', 'Save and continue') : t('ADD_ADDRESS', 'Add address')) : t('LOADING', 'Loading'))), isAllowUnaddressOrderType && /*#__PURE__*/_react.default.createElement(_styles.WithoutAddressContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.WithoutAddressText, {
664
671
  onClick: function onClick() {
665
672
  return events.emit('go_to_page', {
666
673
  page: 'search'
667
674
  });
668
675
  }
669
- }, t('CONTINUE_WITHOUT_ADDRESS', 'Continue without address')))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
676
+ }, t('CONTINUE_WITHOUT_ADDRESS', 'Continue without address'))))), /*#__PURE__*/_react.default.createElement(_Confirm.Alert, {
670
677
  title: t('ADDRESS', 'Address'),
671
678
  content: alertState.content,
672
679
  acceptText: t('ACCEPT', 'Accept'),
@@ -678,14 +685,6 @@ var AddressFormUI = function AddressFormUI(props) {
678
685
  return closeAlert();
679
686
  },
680
687
  closeOnBackdrop: false
681
- }), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
682
- return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
683
- key: i
684
- }, props));
685
- }), (_props$afterElements = props.afterElements) === null || _props$afterElements === void 0 ? void 0 : _props$afterElements.map(function (AfterElement, i) {
686
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
687
- key: i
688
- }, AfterElement);
689
688
  }));
690
689
  };
691
690
  var AddressForm = exports.AddressForm = function AddressForm(props) {
@@ -38,7 +38,9 @@ var WrapAddressInput = exports.WrapAddressInput = _styledComponents.default.div(
38
38
  var AddressTagSection = exports.AddressTagSection = _styledComponents.default.div(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n width: 100%;\n margin: 10px 0px;\n display: flex;\n justify-content: space-between;\n\n button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 46px;\n height: 46px;\n border: none;\n color: #B1BCCC;\n\n img {\n width: 25px;\n height: 25px;\n }\n\n span {\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n font-size: 30px;\n }\n }\n }\n\n button.active {\n color: ", ";\n }\n"])), function (props) {
39
39
  return props.theme.colors.primary;
40
40
  });
41
- var WrapperMap = exports.WrapperMap = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n z-index: 100;\n width: 50%;\n position: absolute;\n bottom: 2%;\n right: 0;\n padding-right: 20px;\n padding-top: 30px;\n height: ", ";\n\n > div {\n position: relative !important;\n width: 100% !important;\n height: 100% !important;\n border-radius: 15px;\n }\n"])), function (_ref) {
41
+ var WrapperMap = exports.WrapperMap = _styledComponents.default.div(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n z-index: 100;\n width: 48%;\n position: absolute;\n bottom: 2%;\n right: 0;\n padding-top: ", ";\n height: ", ";\n\n > div {\n position: relative !important;\n width: 100% !important;\n height: 100% !important;\n border-radius: 15px;\n }\n"])), function (props) {
42
+ return props.showMap ? '30px' : 0;
43
+ }, function (_ref) {
42
44
  var notUseCustomerInfo = _ref.notUseCustomerInfo;
43
45
  return notUseCustomerInfo ? '370px' : '480px';
44
46
  });
@@ -19,11 +19,11 @@ var _AddressForm = require("../AddressForm");
19
19
  var _Confirm = require("../Confirm");
20
20
  var _styledComponents = require("styled-components");
21
21
  var _utils = require("../../../../../utils");
22
+ var _SpreadForm = require("../AddressForm/SpreadForm");
22
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
24
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
24
25
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
26
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
26
- 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); }
27
27
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28
28
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
29
29
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -36,7 +36,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
36
36
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
37
37
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
38
38
  var AddressListUI = function AddressListUI(props) {
39
- var _addressList$addresse, _configs$unaddressed_, _orderState$options, _orderState$options2, _props$beforeElements, _props$beforeComponen, _addressList$addresse3, _addressList$addresse4, _orderState$options8, _orderState$options9, _addressList$error$, _orderState$options10, _orderState$options11, _orderState$options12, _props$afterComponent, _props$afterElements;
39
+ var _addressList$addresse, _configs$unaddressed_, _orderState$options, _orderState$options2, _configs$country_auto, _configs$country_auto2, _configs$addresses_fo, _addressList$addresse3, _addressList$addresse4, _orderState$options8, _orderState$options9, _addressList$error$, _orderState$options10, _orderState$options11, _orderState$options12;
40
40
  var actionStatus = props.actionStatus,
41
41
  addressList = props.addressList,
42
42
  handleDelete = props.handleDelete,
@@ -92,6 +92,14 @@ var AddressListUI = function AddressListUI(props) {
92
92
  var _useCustomer = (0, _orderingComponentsExternal.useCustomer)(),
93
93
  _useCustomer2 = _slicedToArray(_useCustomer, 1),
94
94
  user = _useCustomer2[0].user;
95
+ var _useState7 = (0, _react.useState)(null),
96
+ _useState8 = _slicedToArray(_useState7, 2),
97
+ addressSpreadForm = _useState8[0],
98
+ setAddressSpreadForm = _useState8[1];
99
+ var _useState9 = (0, _react.useState)(false),
100
+ _useState10 = _slicedToArray(_useState9, 2),
101
+ editSpreadAddress = _useState10[0],
102
+ setEditSpreadAddress = _useState10[1];
95
103
  var addFormRestrictions = (userCustomerSetup === null || userCustomerSetup === void 0 ? void 0 : userCustomerSetup.imported_address_text) && ((_addressList$addresse = addressList.addresses) === null || _addressList$addresse === void 0 ? void 0 : _addressList$addresse.length) === 0 && !(addressList !== null && addressList !== void 0 && addressList.loading) && !(addressList !== null && addressList !== void 0 && addressList.error);
96
104
  var uniqueAddressesList = addressList.addresses && addressList.addresses.filter(function (address, i, self) {
97
105
  return i === self.findIndex(function (obj) {
@@ -102,6 +110,8 @@ var AddressListUI = function AddressListUI(props) {
102
110
  return Number(value);
103
111
  })) || [];
104
112
  var isAllowUnaddressOrderType = unaddressedTypes.includes(orderState === null || orderState === void 0 || (_orderState$options = orderState.options) === null || _orderState$options === void 0 ? void 0 : _orderState$options.type) && (user === null || user === void 0 ? void 0 : user.id) === (orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.user_id);
113
+ var countryAutocomplete = (_configs$country_auto = configs === null || configs === void 0 || (_configs$country_auto2 = configs.country_autocomplete) === null || _configs$country_auto2 === void 0 || (_configs$country_auto2 = _configs$country_auto2.value) === null || _configs$country_auto2 === void 0 ? void 0 : _configs$country_auto2.toUpperCase()) !== null && _configs$country_auto !== void 0 ? _configs$country_auto : '*';
114
+ var showSpreadForm = (configs === null || configs === void 0 || (_configs$addresses_fo = configs.addresses_form_type) === null || _configs$addresses_fo === void 0 ? void 0 : _configs$addresses_fo.value) === 'country';
105
115
  var openAddress = function openAddress(address) {
106
116
  setCurAddress(address);
107
117
  setAddressOpen(true);
@@ -228,15 +238,7 @@ var AddressListUI = function AddressListUI(props) {
228
238
  openAddress({});
229
239
  }
230
240
  }, [userCustomerSetup === null || userCustomerSetup === void 0 ? void 0 : userCustomerSetup.imported_address_text, addressList.addresses, addressList === null || addressList === void 0 ? void 0 : addressList.loading, addressList === null || addressList === void 0 ? void 0 : addressList.error, isOpenUserData]);
231
- 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) {
232
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
233
- key: i
234
- }, BeforeElement);
235
- }), (_props$beforeComponen = props.beforeComponents) === null || _props$beforeComponen === void 0 ? void 0 : _props$beforeComponen.map(function (BeforeComponent, i) {
236
- return /*#__PURE__*/_react.default.createElement(BeforeComponent, _extends({
237
- key: i
238
- }, props));
239
- }), /*#__PURE__*/_react.default.createElement(_styles.AddressListContainer, {
241
+ return /*#__PURE__*/_react.default.createElement(_styles.AddressListContainer, {
240
242
  id: "address_control",
241
243
  isLoading: (actionStatus === null || actionStatus === void 0 ? void 0 : actionStatus.loading) || (orderState === null || orderState === void 0 ? void 0 : orderState.loading)
242
244
  }, /*#__PURE__*/_react.default.createElement(_styles.AddressHalfContainer, null, /*#__PURE__*/_react.default.createElement(_styles.List, {
@@ -257,6 +259,11 @@ var AddressListUI = function AddressListUI(props) {
257
259
  }, orderState !== null && orderState !== void 0 && orderState.loading || actionStatus.loading ? t('LOADING', 'Loading') : t('ADD_NEW_ADDRESS', 'Add New Address')), isPopover && addressOpen && /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
258
260
  userId: userId,
259
261
  addressesList: addressList === null || addressList === void 0 ? void 0 : addressList.addresses,
262
+ showSpreadForm: showSpreadForm,
263
+ addressSpreadForm: addressSpreadForm,
264
+ setAddressSpreadForm: setAddressSpreadForm,
265
+ editSpreadAddress: editSpreadAddress,
266
+ setEditSpreadAddress: setEditSpreadAddress,
260
267
  useValidationFileds: true,
261
268
  address: curAddress,
262
269
  onCancel: function onCancel() {
@@ -329,6 +336,11 @@ var AddressListUI = function AddressListUI(props) {
329
336
  }), !isPopover && addressOpen && /*#__PURE__*/_react.default.createElement(_styles.AddressFormContainer, null, /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
330
337
  userId: userId,
331
338
  addressesList: addressList === null || addressList === void 0 ? void 0 : addressList.addresses,
339
+ showSpreadForm: showSpreadForm,
340
+ addressSpreadForm: addressSpreadForm,
341
+ setAddressSpreadForm: setAddressSpreadForm,
342
+ editSpreadAddress: editSpreadAddress,
343
+ setEditSpreadAddress: setEditSpreadAddress,
332
344
  useValidationFileds: true,
333
345
  address: curAddress,
334
346
  onCancel: function onCancel() {
@@ -347,7 +359,28 @@ var AddressListUI = function AddressListUI(props) {
347
359
  onClick: function onClick() {
348
360
  return handleCloseAddressForm();
349
361
  }
350
- })), /*#__PURE__*/_react.default.createElement("h1", null, t('ADD_NEW_ADDRESS', 'Add new address'))))), (addressList.loading || actionStatus.loading || orderState.loading || (user === null || user === void 0 ? void 0 : user.id) !== (orderState === null || orderState === void 0 || (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : _orderState$options11.user_id)) && !isProductForm && !addressOpen && /*#__PURE__*/_react.default.createElement(_styles.AddressListUl, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
362
+ })), /*#__PURE__*/_react.default.createElement("h1", null, t('ADD_NEW_ADDRESS', 'Add new address'))), showSpreadForm && /*#__PURE__*/_react.default.createElement(_SpreadForm.SpreadForm, {
363
+ address: (curAddress === null || curAddress === void 0 ? void 0 : curAddress.address) && {
364
+ route: curAddress === null || curAddress === void 0 ? void 0 : curAddress.route,
365
+ street_number: curAddress === null || curAddress === void 0 ? void 0 : curAddress.street_number,
366
+ neighborhood: curAddress === null || curAddress === void 0 ? void 0 : curAddress.neighborhood,
367
+ city: curAddress === null || curAddress === void 0 ? void 0 : curAddress.city,
368
+ state: curAddress === null || curAddress === void 0 ? void 0 : curAddress.state,
369
+ country_code: curAddress === null || curAddress === void 0 ? void 0 : curAddress.country_code,
370
+ country: curAddress === null || curAddress === void 0 ? void 0 : curAddress.country,
371
+ address: curAddress === null || curAddress === void 0 ? void 0 : curAddress.address,
372
+ locality: curAddress === null || curAddress === void 0 ? void 0 : curAddress.locality,
373
+ location: curAddress === null || curAddress === void 0 ? void 0 : curAddress.location,
374
+ zipcode: curAddress === null || curAddress === void 0 ? void 0 : curAddress.zipcode
375
+ },
376
+ countryAutocomplete: countryAutocomplete,
377
+ editSpreadAddress: editSpreadAddress,
378
+ setEditSpreadAddress: setEditSpreadAddress,
379
+ onCancel: function onCancel() {
380
+ return handleCloseAddressForm();
381
+ },
382
+ onChangeAddress: setAddressSpreadForm
383
+ }))), (addressList.loading || actionStatus.loading || orderState.loading || (user === null || user === void 0 ? void 0 : user.id) !== (orderState === null || orderState === void 0 || (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : _orderState$options11.user_id)) && !isProductForm && !addressOpen && /*#__PURE__*/_react.default.createElement(_styles.AddressListUl, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
351
384
  height: 50,
352
385
  count: 3,
353
386
  style: {
@@ -377,6 +410,11 @@ var AddressListUI = function AddressListUI(props) {
377
410
  }, /*#__PURE__*/_react.default.createElement(_AddressForm.AddressForm, {
378
411
  userId: userId,
379
412
  addressesList: addressList === null || addressList === void 0 ? void 0 : addressList.addresses,
413
+ showSpreadForm: showSpreadForm,
414
+ addressSpreadForm: addressSpreadForm,
415
+ setAddressSpreadForm: setAddressSpreadForm,
416
+ editSpreadAddress: editSpreadAddress,
417
+ setEditSpreadAddress: setEditSpreadAddress,
380
418
  useValidationFileds: true,
381
419
  address: curAddress,
382
420
  onCancel: function onCancel() {
@@ -402,14 +440,6 @@ var AddressListUI = function AddressListUI(props) {
402
440
  },
403
441
  onAccept: confirm.handleOnAccept,
404
442
  closeOnBackdrop: false
405
- })), (_props$afterComponent = props.afterComponents) === null || _props$afterComponent === void 0 ? void 0 : _props$afterComponent.map(function (AfterComponent, i) {
406
- return /*#__PURE__*/_react.default.createElement(AfterComponent, _extends({
407
- key: i
408
- }, props));
409
- }), (_props$afterElements = props.afterElements) === null || _props$afterElements === void 0 ? void 0 : _props$afterElements.map(function (AfterElement, i) {
410
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
411
- key: i
412
- }, AfterElement);
413
443
  }));
414
444
  };
415
445
  var AddressList = exports.AddressList = function AddressList(props) {
@@ -37,7 +37,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
37
37
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
38
38
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
39
39
  var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
40
- var _orderState$options, _ref, _userCustomer$country, _userCustomer$address, _configState$configs, _userCustomer$name, _orderState$options5, _orderState$options8, _orderState$options9, _theme$images2, _theme$images3, _theme$images4, _orderState$options12, _orderState$options13, _orderState$options15, _orderState$options16, _theme$colors, _theme$images5, _customerState$result, _customerState$result2;
40
+ var _orderState$options, _ref, _userCustomer$country, _userCustomer$address, _configState$configs, _userCustomer$name, _orderState$options3, _orderState$options6, _orderState$options7, _theme$images2, _theme$images3, _theme$images4, _orderState$options10, _orderState$options11, _orderState$options13, _orderState$options14, _theme$colors, _theme$images5, _customerState$result, _customerState$result2;
41
41
  var phone = props.phone,
42
42
  customerState = props.customerState,
43
43
  customersPhones = props.customersPhones,
@@ -142,11 +142,8 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
142
142
  }));
143
143
  };
144
144
  var handleFindClick = function handleFindClick() {
145
- var _orderState$options2, _orderState$options3;
146
- if (optSelected && !(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)) {
145
+ if (optSelected) {
147
146
  onChange(optSelected);
148
- } else if (userCustomer !== null && userCustomer !== void 0 && userCustomer.id && 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) {
149
- onRedirectPage && onRedirectPage('search');
150
147
  } else {
151
148
  setAlertState({
152
149
  open: true,
@@ -350,17 +347,17 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
350
347
  });
351
348
  }, [urlPhone, customersPhones === null || customersPhones === void 0 ? void 0 : customersPhones.loading]);
352
349
  (0, _react.useEffect)(function () {
353
- var _orderState$options4;
354
- setOrderTypeSelected(orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type);
355
- }, [orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type]);
350
+ var _orderState$options2;
351
+ setOrderTypeSelected(orderState === null || orderState === void 0 || (_orderState$options2 = orderState.options) === null || _orderState$options2 === void 0 ? void 0 : _orderState$options2.type);
352
+ }, [orderState === null || orderState === void 0 || (_orderState$options3 = orderState.options) === null || _orderState$options3 === void 0 ? void 0 : _orderState$options3.type]);
356
353
  (0, _react.useEffect)(function () {
357
- var _orderState$options6, _orderState$options7;
358
- if (isSavedAddress && (userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id) === (orderState === null || orderState === void 0 || (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.user_id) && 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) {
354
+ var _orderState$options4, _orderState$options5;
355
+ if (isSavedAddress && (userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id) === (orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.user_id) && orderState !== null && orderState !== void 0 && (_orderState$options5 = orderState.options) !== null && _orderState$options5 !== void 0 && (_orderState$options5 = _orderState$options5.address) !== null && _orderState$options5 !== void 0 && _orderState$options5.address) {
359
356
  events.emit('go_to_page', {
360
357
  page: 'search'
361
358
  });
362
359
  }
363
- }, [isSavedAddress, userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id, orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.user_id, orderState === null || orderState === void 0 || (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 || (_orderState$options9 = _orderState$options9.address) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.address]);
360
+ }, [isSavedAddress, userCustomer === null || userCustomer === void 0 ? void 0 : userCustomer.id, orderState === null || orderState === void 0 || (_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.user_id, orderState === null || orderState === void 0 || (_orderState$options7 = orderState.options) === null || _orderState$options7 === void 0 || (_orderState$options7 = _orderState$options7.address) === null || _orderState$options7 === void 0 ? void 0 : _orderState$options7.address]);
364
361
  (0, _react.useEffect)(function () {
365
362
  if (!(userCustomer !== null && userCustomer !== void 0 && userCustomer.id) && !(orderState !== null && orderState !== void 0 && orderState.loading)) {
366
363
  handleSetInitialValues();
@@ -370,15 +367,15 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
370
367
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, orderTypes && (configTypes ? orderTypes.filter(function (type) {
371
368
  return (configTypes === null || configTypes === void 0 ? void 0 : configTypes.includes(type.value)) && pickupTypes.includes(type === null || type === void 0 ? void 0 : type.value);
372
369
  }) : orderTypes).map(function (item, i) {
373
- var _orderState$options10, _orderState$options11;
370
+ var _orderState$options8, _orderState$options9;
374
371
  return /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
375
372
  key: item.value,
376
373
  onClick: function onClick() {
377
374
  return handleChangeType(item.value);
378
375
  },
379
- color: (orderState === null || orderState === void 0 || (_orderState$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.type) === (item === null || item === void 0 ? void 0 : item.value) ? 'primary' : 'secondary',
376
+ color: (orderState === null || orderState === void 0 || (_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.type) === (item === null || item === void 0 ? void 0 : item.value) ? 'primary' : 'secondary',
380
377
  disabled: orderState === null || orderState === void 0 ? void 0 : orderState.loading,
381
- className: (orderState === null || orderState === void 0 || (_orderState$options11 = orderState.options) === null || _orderState$options11 === void 0 ? void 0 : _orderState$options11.type) !== (item === null || item === void 0 ? void 0 : item.value) ? 'activated' : ''
378
+ className: (orderState === null || orderState === void 0 || (_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.type) !== (item === null || item === void 0 ? void 0 : item.value) ? 'activated' : ''
382
379
  }, item.text);
383
380
  }));
384
381
  };
@@ -422,14 +419,14 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
422
419
  src: theme === null || theme === void 0 || (_theme$images4 = theme.images) === null || _theme$images4 === void 0 || (_theme$images4 = _theme$images4.general) === null || _theme$images4 === void 0 ? void 0 : _theme$images4.eatinIco,
423
420
  width: 22,
424
421
  height: 22
425
- })), /*#__PURE__*/_react.default.createElement("p", null, t('EAT_IN', 'Eat in')))), pickupTypes.includes(orderTypeSelected) && /*#__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$options12 = orderState.options) === null || _orderState$options12 === void 0 ? void 0 : _orderState$options12.type) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__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(_Buttons.Button, {
426
- color: inputValue || userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options13 = orderState.options) !== null && _orderState$options13 !== void 0 && (_orderState$options13 = _orderState$options13.address) !== null && _orderState$options13 !== void 0 && _orderState$options13.address ? 'primary' : 'secundary',
422
+ })), /*#__PURE__*/_react.default.createElement("p", null, t('EAT_IN', 'Eat in')))), pickupTypes.includes(orderTypeSelected) && /*#__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$options10 = orderState.options) === null || _orderState$options10 === void 0 ? void 0 : _orderState$options10.type) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__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(_Buttons.Button, {
423
+ color: 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 ? 'primary' : 'secundary',
427
424
  onMouseDown: function onMouseDown() {
428
- var _orderState$options14;
429
- return !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options14 = orderState.options) !== null && _orderState$options14 !== void 0 && (_orderState$options14 = _orderState$options14.address) !== null && _orderState$options14 !== void 0 && _orderState$options14.address) && !optSelected ? createNewUser() : handleFindClick();
425
+ var _orderState$options12;
426
+ return !(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) && !optSelected ? createNewUser() : handleFindClick();
430
427
  },
431
- disabled: !inputValue && !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options15 = orderState.options) !== null && _orderState$options15 !== void 0 && (_orderState$options15 = _orderState$options15.address) !== null && _orderState$options15 !== void 0 && _orderState$options15.address) && !optSelected
432
- }, !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options16 = orderState.options) !== null && _orderState$options16 !== void 0 && (_orderState$options16 = _orderState$options16.address) !== null && _orderState$options16 !== void 0 && _orderState$options16.address) && !optSelected ? t('CREATE_CUSTOMER', 'Create new customer') : "".concat(t('CONTINUE_WITH', 'Continue with'), " ").concat(userName))), /*#__PURE__*/_react.default.createElement(_styles.SelectContainer, {
428
+ disabled: !inputValue && !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options13 = orderState.options) !== null && _orderState$options13 !== void 0 && (_orderState$options13 = _orderState$options13.address) !== null && _orderState$options13 !== void 0 && _orderState$options13.address) && !optSelected
429
+ }, !(userCustomer && orderState !== null && orderState !== void 0 && (_orderState$options14 = orderState.options) !== null && _orderState$options14 !== void 0 && (_orderState$options14 = _orderState$options14.address) !== null && _orderState$options14 !== void 0 && _orderState$options14.address) && !optSelected ? t('CREATE_CUSTOMER', 'Create new customer') : "".concat(t('CONTINUE_WITH', 'Continue with'), " ").concat(userName))), /*#__PURE__*/_react.default.createElement(_styles.SelectContainer, {
433
430
  onPaste: handleOnPaste
434
431
  }, /*#__PURE__*/_react.default.createElement(_MdcCellphoneAndroid.default, {
435
432
  size: 18,
@@ -455,12 +452,7 @@ var PhoneAutocompleteUI = function PhoneAutocompleteUI(props) {
455
452
  Option: Option,
456
453
  ClearIndicator: ClearIndicator
457
454
  }
458
- }), optSelected && /*#__PURE__*/_react.default.createElement(_styles.ContinueButton, null, /*#__PURE__*/_react.default.createElement(_Buttons.Button, {
459
- onClick: function onClick() {
460
- return onChange(optSelected);
461
- },
462
- color: "primary"
463
- }, t('CONTINUE', 'Continue'))))))), /*#__PURE__*/_react.default.createElement(_styles.ImageWrapper, {
455
+ }))))), /*#__PURE__*/_react.default.createElement(_styles.ImageWrapper, {
464
456
  bgimage: theme === null || theme === void 0 || (_theme$images5 = theme.images) === null || _theme$images5 === void 0 || (_theme$images5 = _theme$images5.general) === null || _theme$images5 === void 0 ? void 0 : _theme$images5.phoneHero
465
457
  })), /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
466
458
  open: openModal.signup,
@@ -244,7 +244,7 @@ var BusinessesListingUI = function BusinessesListingUI(props) {
244
244
  }, [preorderBusiness]);
245
245
  (0, _react.useEffect)(function () {
246
246
  var _businessesList$busin2, _businessesList$busin3, _configs$activate_sin;
247
- setActiveMap(false);
247
+ !isCustomerMode && setActiveMap(false);
248
248
  if (!(businessesList !== null && businessesList !== void 0 && (_businessesList$busin2 = businessesList.businesses) !== null && _businessesList$busin2 !== void 0 && _businessesList$busin2.length)) return;
249
249
  if ((businessesList === null || businessesList === void 0 || (_businessesList$busin3 = businessesList.businesses) === null || _businessesList$busin3 === void 0 ? void 0 : _businessesList$busin3.length) === 1 && (configs === null || configs === void 0 || (_configs$activate_sin = configs.activate_single_store_automatically) === null || _configs$activate_sin === void 0 ? void 0 : _configs$activate_sin.value) === '1') {
250
250
  onBusinessClick(businessesList === null || businessesList === void 0 ? void 0 : businessesList.businesses[0]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "14.1.40",
3
+ "version": "14.1.42",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {