@salesgenterp/ui-components 0.4.564 → 0.4.566

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/dist/index.js CHANGED
@@ -12157,36 +12157,69 @@ var AsyncSelect = function AsyncSelect(_ref3) {
12157
12157
  return /*#__PURE__*/React__default.createElement(AsyncSelectField, props);
12158
12158
  };
12159
12159
 
12160
- var _templateObject$F;
12160
+ var _templateObject$F, _templateObject2$u, _templateObject3$o, _templateObject4$j, _templateObject5$f, _templateObject6$d, _templateObject7$a, _templateObject8$8;
12161
+ var DEFAULT_PRIMARY = '#424242';
12162
+ var getPrimary = function getPrimary(props) {
12163
+ var _props$theme;
12164
+ return (props === null || props === void 0 ? void 0 : (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.primaryColor) || DEFAULT_PRIMARY;
12165
+ };
12161
12166
  var Container$2 = styled__default.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteralLoose([""])));
12167
+ var TopBar = styled__default.div(_templateObject2$u || (_templateObject2$u = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 12px;\n .search {\n flex: 1;\n min-width: 0;\n }\n @media only screen and (max-width: 600px) {\n flex-wrap: wrap;\n .search {\n flex-basis: 100%;\n }\n }\n"])));
12168
+ var LastOrderedWrapper = styled__default.div(_templateObject3$o || (_templateObject3$o = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 6px;\n margin-left: auto;\n flex-shrink: 0;\n"])));
12169
+ var LastOrderedButton = styled__default.button(_templateObject4$j || (_templateObject4$j = _taggedTemplateLiteralLoose(["\n height: 38px;\n padding: 0 16px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n white-space: nowrap;\n font-weight: 500;\n color: #fff;\n background: ", ";\n transition: opacity 0.2s;\n &:hover {\n opacity: 0.9;\n }\n"])), function (props) {
12170
+ var _props$theme2;
12171
+ return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : _props$theme2.primaryColor) || '#424242';
12172
+ });
12173
+ var InfoIcon = styled__default.span(_templateObject5$f || (_templateObject5$f = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n font-size: 1.25em;\n color: #6b6b6b;\n cursor: pointer;\n"])));
12174
+ var DialogFooterButton = styled__default.button(_templateObject6$d || (_templateObject6$d = _taggedTemplateLiteralLoose(["\n height: 38px;\n min-width: 100px;\n padding: 0 18px;\n border-radius: 4px;\n cursor: pointer;\n font-weight: 500;\n white-space: nowrap;\n border: 1px solid ", ";\n color: ", ";\n background: ", ";\n transition: opacity 0.2s;\n &:hover:not(:disabled) {\n opacity: 0.9;\n }\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n"])), function (props) {
12175
+ var _props$theme3;
12176
+ return ((_props$theme3 = props.theme) === null || _props$theme3 === void 0 ? void 0 : _props$theme3.primaryColor) || '#424242';
12177
+ }, function (props) {
12178
+ var _props$theme4;
12179
+ return props.variant === 'outlined' ? ((_props$theme4 = props.theme) === null || _props$theme4 === void 0 ? void 0 : _props$theme4.primaryColor) || '#424242' : '#fff';
12180
+ }, function (props) {
12181
+ var _props$theme5;
12182
+ return props.variant === 'outlined' ? '#fff' : ((_props$theme5 = props.theme) === null || _props$theme5 === void 0 ? void 0 : _props$theme5.primaryColor) || '#424242';
12183
+ });
12184
+ var DialogLoadMore = styled__default.div(_templateObject7$a || (_templateObject7$a = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n padding: 16px 0 4px;\n color: #6b6b6b;\n"])));
12185
+ var DialogFooter = styled__default.div(_templateObject8$8 || (_templateObject8$8 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n flex-wrap: wrap;\n .pagination {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n }\n .count {\n font-size: 0.85em;\n color: #6b6b6b;\n white-space: nowrap;\n }\n .buttons {\n display: flex;\n gap: 8px;\n margin-left: auto;\n }\n"])));
12162
12186
 
12163
- var _templateObject$G, _templateObject2$u, _templateObject3$o, _templateObject4$j, _templateObject5$f, _templateObject6$d;
12187
+ var _templateObject$G, _templateObject2$v, _templateObject3$p, _templateObject4$k, _templateObject5$g, _templateObject6$e;
12164
12188
  var ProductImage$1 = styled__default.img.attrs(function (props) {
12165
12189
  return {
12166
12190
  loading: props.loading || 'lazy',
12167
12191
  decoding: 'async'
12168
12192
  };
12169
- })(_templateObject$G || (_templateObject$G = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 50px;\n object-fit: contain;\n @media only screen and (max-width: 600px) {\n margin: 0.5em 0;\n padding-right: 0.5em;\n }\n"])));
12170
- var ProductName$1 = styled__default.h6(_templateObject2$u || (_templateObject2$u = _taggedTemplateLiteralLoose(["\n font-size: ", ";\n padding: 0;\n line-height: 1.3em;\n max-height: ", ";\n height: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n height: fit-content;\n"])), function (props) {
12193
+ })(_templateObject$G || (_templateObject$G = _taggedTemplateLiteralLoose(["\n min-width: 50px;\n min-height: 50px;\n object-fit: contain;\n"])));
12194
+ var ProductName$1 = styled__default.h6(_templateObject2$v || (_templateObject2$v = _taggedTemplateLiteralLoose(["\n font-size: ", ";\n padding: 0;\n line-height: 1.3em;\n max-height: ", ";\n height: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n height: fit-content;\n"])), function (props) {
12171
12195
  return props.size || '1em';
12172
12196
  }, function (props) {
12173
12197
  return props.maxHeight ? props.maxHeight + "em" : '2.75em';
12174
12198
  }, function (props) {
12175
12199
  return props.maxHeight ? props.maxHeight + "em" : '2.80em';
12176
12200
  });
12177
- var CartTableRow$1 = styled__default(material.TableRow)(_templateObject3$o || (_templateObject3$o = _taggedTemplateLiteralLoose(["\n position: relative;\n transition: 0.3s;\n background: white;\n /* &:hover {\n td:first-child,\n td:last-child {\n border-left-style: solid;\n border-top-style: solid;\n border-top-right-radius: 10px;\n }\n } */\n .outOfStock {\n font-size: 0.75em;\n color: red;\n text-transform: uppercase;\n font-weight: 500;\n }\n .price {\n font-size: ", ";\n font-weight: bold;\n color: #323232;\n /* font-size: 1.15em; */\n }\n .borderLeft {\n height: 100%;\n background: ", ";\n transition: 0.2s;\n width: 0px;\n position: absolute;\n left: 0;\n top: 0;\n border-top-left-radius: 10px;\n display: none;\n border-bottom-left-radius: 10px;\n }\n .cartCheckBox {\n &.Mui-checked {\n svg {\n color: ", ";\n }\n }\n }\n &:hover {\n background: white !important;\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);\n border-radius: 10px;\n /* opacity: 1;\n box-shadow: 1px 2px 6px 2px rgba(0, 0, 0, 0.2); */\n z-index: 2;\n /* border-radius: 20px; */\n .borderLeft {\n width: 12px;\n display: inline-block;\n }\n }\n @media only screen and (max-width: 600px) {\n .CartnoPaddingSm {\n padding: 0 !important;\n }\n .price {\n font-size: 0.8em;\n }\n margin: 0.5em 0;\n .cartCheckBox {\n .css-i4bv87-MuiSvgIcon-root {\n font-size: 10px !important;\n }\n }\n }\n"])), function (props) {
12201
+ var CartTableRow$1 = styled__default(material.TableRow)(_templateObject3$p || (_templateObject3$p = _taggedTemplateLiteralLoose(["\n position: relative;\n transition: 0.3s;\n background: ", ";\n cursor: pointer;\n /* &:hover {\n td:first-child,\n td:last-child {\n border-left-style: solid;\n border-top-style: solid;\n border-top-right-radius: 10px;\n }\n } */\n .outOfStock {\n font-size: 0.75em;\n color: red;\n text-transform: uppercase;\n font-weight: 500;\n }\n .price {\n font-size: ", ";\n font-weight: bold;\n color: #323232;\n /* font-size: 1.15em; */\n }\n .borderLeft {\n height: 100%;\n background: ", ";\n transition: 0.2s;\n width: ", ";\n position: absolute;\n left: 0;\n top: 0;\n border-top-left-radius: 10px;\n display: ", ";\n border-bottom-left-radius: 10px;\n }\n .cartCheckBox {\n &.Mui-checked {\n svg {\n color: ", ";\n }\n }\n }\n &:hover {\n background: ", " !important;\n box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);\n border-radius: 10px;\n /* opacity: 1;\n box-shadow: 1px 2px 6px 2px rgba(0, 0, 0, 0.2); */\n z-index: 2;\n /* border-radius: 20px; */\n .borderLeft {\n width: 12px;\n display: inline-block;\n }\n }\n .mobileLabel {\n display: none;\n }\n .stock {\n font-size: 0.95em;\n font-weight: 600;\n color: #2e7d32;\n }\n .stock-out {\n color: #d32f2f;\n }\n /* Small screens: each row becomes a card.\n [check] [img] name ............ [delete]\n $price each\n [- qty +] Subtotal $x */\n @media only screen and (max-width: 768px) {\n display: grid;\n grid-template-columns: 32px 56px minmax(0, 1fr) auto;\n grid-template-areas:\n 'check img name delete'\n 'check img price stock'\n 'check qty qty subtotal';\n column-gap: 10px;\n row-gap: 6px;\n align-items: center;\n padding: 12px 10px;\n margin: 0 0 10px;\n border: 1px solid #ececec;\n border-radius: 10px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n &:hover {\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);\n .borderLeft {\n display: none;\n }\n }\n > td,\n > th {\n display: block;\n width: auto;\n padding: 0 !important;\n text-align: left;\n }\n .cell-check {\n grid-area: check;\n align-self: start;\n }\n .cell-img {\n grid-area: img;\n align-self: start;\n img {\n width: 56px;\n height: 56px;\n margin: 0;\n padding: 0;\n }\n }\n .cell-name {\n grid-area: name;\n align-self: start;\n h6 {\n font-size: 0.9em;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n p {\n font-size: 0.8em;\n margin-top: 2px;\n }\n }\n .cell-price {\n grid-area: price;\n .price {\n font-size: 0.85em;\n font-weight: 500;\n color: #6b6b6b;\n }\n }\n .cell-stock {\n grid-area: stock;\n text-align: right;\n .stock {\n font-size: 0.8em;\n }\n }\n .cell-qty {\n grid-area: qty;\n justify-self: start;\n }\n .cell-subtotal {\n grid-area: subtotal;\n text-align: right;\n .price {\n font-size: 0.95em;\n }\n }\n .cell-delete {\n grid-area: delete;\n align-self: start;\n }\n .mobileLabel {\n display: inline;\n font-weight: 400;\n color: #6b6b6b;\n font-size: 0.85em;\n }\n .cartCheckBox {\n padding: 0;\n }\n }\n"])), function (props) {
12202
+ return props.$selected ? '#f7f8fa' : 'white';
12203
+ }, function (props) {
12178
12204
  return props.size || '1.19em';
12179
12205
  }, function (prop) {
12180
- return prop.bg;
12206
+ return prop.bg || getPrimary(prop);
12207
+ }, function (props) {
12208
+ return props.$selected ? '4px' : '0px';
12209
+ }, function (props) {
12210
+ return props.$selected ? 'inline-block' : 'none';
12181
12211
  }, function (prop) {
12182
- return prop.bg;
12212
+ return prop.bg || getPrimary(prop);
12213
+ }, function (props) {
12214
+ return props.$selected ? '#f7f8fa' : 'white';
12183
12215
  });
12184
- var CartTableCell$2 = styled__default(material.TableCell)(_templateObject4$j || (_templateObject4$j = _taggedTemplateLiteralLoose(["\n && {\n border: none !important;\n font-size: 1em;\n }\n"])));
12185
- var QuantityBox$1 = styled__default.div(_templateObject5$f || (_templateObject5$f = _taggedTemplateLiteralLoose(["\n height: 1.7em;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n div {\n /* width:30px; */\n min-height: 100%;\n aspect-ratio: 1.15/1;\n display: grid;\n place-items: center;\n font-size: 0.65em;\n color: white;\n background-color: #323232;\n cursor: pointer;\n }\n .price {\n background: transparent;\n cursor: auto;\n background: #ffffff;\n border: 1px solid #ebebeb;\n p {\n color: #5e5c5c;\n font-size: 0.685em;\n font-weight: 500;\n }\n }\n .add {\n background-color: #ebebeb;\n color: #323232;\n }\n"])));
12186
- var DeleteBtn$1 = styled__default.div(_templateObject6$d || (_templateObject6$d = _taggedTemplateLiteralLoose(["\n display: grid;\n place-items: center;\n cursor: pointer;\n border-radius: 50%;\n width: 20px;\n height: 20px;\n background: #eef1f4;\n color: #393f48;\n font-size: 0.75em;\n transition: 0.4s;\n &:hover {\n background: red;\n color: white;\n }\n"])));
12216
+ var CartTableCell$2 = styled__default(material.TableCell)(_templateObject4$k || (_templateObject4$k = _taggedTemplateLiteralLoose(["\n && {\n border: none !important;\n font-size: 1em;\n }\n"])));
12217
+ var QuantityBox$1 = styled__default.div(_templateObject5$g || (_templateObject5$g = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: stretch;\n height: 36px;\n border: 1px solid #dcdfe4;\n border-radius: 8px;\n overflow: hidden;\n background: #fff;\n transition: border-color 0.2s, box-shadow 0.2s;\n &:focus-within {\n border-color: ", ";\n box-shadow: 0 0 0 1px ", ";\n }\n .stepBtn {\n position: relative;\n isolation: isolate;\n width: 34px;\n display: grid;\n place-items: center;\n padding: 0;\n border: none;\n background: #fff;\n color: ", ";\n font-size: 14px;\n cursor: pointer;\n transition: color 0.15s;\n /* Light tint: the primary color at low opacity, behind the icon. */\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n background: ", ";\n opacity: 0.1;\n transition: opacity 0.15s;\n }\n &:hover:not(:disabled) {\n color: #fff;\n &::before {\n opacity: 1;\n }\n }\n &:active:not(:disabled) {\n transform: scale(0.94);\n }\n &:disabled {\n cursor: not-allowed;\n color: #b8bcc4;\n background: #f4f5f7;\n &::before {\n display: none;\n }\n }\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: -2px;\n }\n }\n input {\n width: 48px;\n border: none;\n border-left: 1px solid #dcdfe4;\n border-right: 1px solid #dcdfe4;\n outline: none;\n text-align: center;\n font-size: 14px;\n font-weight: 600;\n color: #2b2b2b;\n background: #fff;\n -moz-appearance: textfield;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:disabled {\n color: #9aa0a6;\n }\n }\n @media only screen and (max-width: 768px) {\n height: 38px;\n .stepBtn {\n width: 38px;\n }\n }\n"])), getPrimary, getPrimary, getPrimary, getPrimary, getPrimary);
12218
+ var DeleteBtn$1 = styled__default.button(_templateObject6$e || (_templateObject6$e = _taggedTemplateLiteralLoose(["\n display: grid;\n place-items: center;\n cursor: pointer;\n border: none;\n border-radius: 8px;\n width: 32px;\n height: 32px;\n padding: 0;\n background: #f4f5f7;\n color: #6b7280;\n font-size: 16px;\n transition: background 0.2s, color 0.2s;\n &:hover {\n background: #fdecec;\n color: #d32f2f;\n }\n &:focus-visible {\n outline: 2px solid #d32f2f;\n outline-offset: 2px;\n }\n"])));
12187
12219
  var CardRow$1 = function CardRow(_ref) {
12188
- var _styles$price, _styles$Btn, _row$standardPrice, _row$subtotal;
12220
+ var _styles$price, _row$availableQuantit;
12189
12221
  var row = _ref.row,
12222
+ index = _ref.index,
12190
12223
  isItemSelected = _ref.isItemSelected,
12191
12224
  handleClick = _ref.handleClick,
12192
12225
  imgnotfoundUrl = _ref.imgnotfoundUrl,
@@ -12196,9 +12229,60 @@ var CardRow$1 = function CardRow(_ref) {
12196
12229
  imgSize = _ref.imgSize,
12197
12230
  styles = _ref.styles,
12198
12231
  _ref$allowToProcessIn = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
12199
- allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref$allowToProcessIn === void 0 ? false : _ref$allowToProcessIn;
12232
+ allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref$allowToProcessIn === void 0 ? false : _ref$allowToProcessIn,
12233
+ _ref$hideDelete = _ref.hideDelete,
12234
+ hideDelete = _ref$hideDelete === void 0 ? false : _ref$hideDelete,
12235
+ _ref$hideStock = _ref.hideStock,
12236
+ hideStock = _ref$hideStock === void 0 ? false : _ref$hideStock;
12200
12237
  var imgnotfoundUrlcommon = noImgAvailable;
12201
12238
  if (imgnotfoundUrl && imgnotfoundUrl !== 'null') imgnotfoundUrlcommon = imgnotfoundUrl;
12239
+ var onChangeQuantity = function onChangeQuantity(product) {
12240
+ if ((product === null || product === void 0 ? void 0 : product.quantity) <= 0 || !allowToProcessInvoiceForOutOfStockProductsEcommerce && (product === null || product === void 0 ? void 0 : product.availableQuantity) <= 0) {
12241
+ return handleRemoveProduct(product, index);
12242
+ }
12243
+ handleIncrementDecrement(product);
12244
+ };
12245
+ var timer = React.useRef();
12246
+ var _useState = React.useState(row === null || row === void 0 ? void 0 : row.quantity),
12247
+ quantity = _useState[0],
12248
+ setQuantity = _useState[1];
12249
+ React.useEffect(function () {
12250
+ setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
12251
+ }, [row === null || row === void 0 ? void 0 : row.quantity]);
12252
+ React.useEffect(function () {
12253
+ return function () {
12254
+ return clearTimeout(timer.current);
12255
+ };
12256
+ }, []);
12257
+ var onChangeInput = function onChangeInput(e) {
12258
+ var value = e.target.value;
12259
+ setQuantity(value);
12260
+ clearTimeout(timer.current);
12261
+ if (value === '') return;
12262
+ timer.current = setTimeout(function () {
12263
+ var typedQty = parseInt(value, 10);
12264
+ if (!(typedQty > 0)) {
12265
+ handleRemoveProduct(row, index);
12266
+ setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
12267
+ return;
12268
+ }
12269
+ var validQty = checkMinMaxQty({
12270
+ quantity: typedQty,
12271
+ product: row,
12272
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
12273
+ });
12274
+ setQuantity(validQty);
12275
+ onChangeQuantity(_extends({}, row, {
12276
+ quantity: validQty
12277
+ }));
12278
+ }, 500);
12279
+ };
12280
+ var onBlurInput = function onBlurInput() {
12281
+ if (quantity === '' || quantity === undefined) {
12282
+ clearTimeout(timer.current);
12283
+ setQuantity(row === null || row === void 0 ? void 0 : row.quantity);
12284
+ }
12285
+ };
12202
12286
  return /*#__PURE__*/React__default.createElement(CartTableRow$1, {
12203
12287
  onClick: function onClick(event) {
12204
12288
  return handleClick(event, row);
@@ -12206,11 +12290,13 @@ var CardRow$1 = function CardRow(_ref) {
12206
12290
  role: "checkbox",
12207
12291
  "aria-checked": isItemSelected,
12208
12292
  tabIndex: -1,
12209
- key: row.ProductId,
12293
+ key: row === null || row === void 0 ? void 0 : row.rowId,
12210
12294
  size: styles === null || styles === void 0 ? void 0 : (_styles$price = styles.price) === null || _styles$price === void 0 ? void 0 : _styles$price.size,
12211
- bg: (styles === null || styles === void 0 ? void 0 : styles.borderLeft) || (styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background)
12295
+ bg: styles === null || styles === void 0 ? void 0 : styles.borderLeft,
12296
+ $selected: isItemSelected
12212
12297
  }, /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12213
12298
  padding: "checkbox",
12299
+ className: "cell-check",
12214
12300
  style: {
12215
12301
  position: 'relative'
12216
12302
  }
@@ -12225,9 +12311,9 @@ var CardRow$1 = function CardRow(_ref) {
12225
12311
  },
12226
12312
  className: "cartCheckBox"
12227
12313
  })), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12228
- className: "CartnoPaddingSm"
12314
+ className: "cell-img"
12229
12315
  }, /*#__PURE__*/React__default.createElement(ProductImage$1, {
12230
- src: row.imageUrl && row.imageUrl !== 'null' ? row.imageUrl : imgnotfoundUrlcommon,
12316
+ src: row !== null && row !== void 0 && row.imageUrl && (row === null || row === void 0 ? void 0 : row.imageUrl) !== 'null' ? row === null || row === void 0 ? void 0 : row.imageUrl : imgnotfoundUrlcommon,
12231
12317
  alt: 'img',
12232
12318
  width: (imgSize === null || imgSize === void 0 ? void 0 : imgSize.width) || 50,
12233
12319
  height: (imgSize === null || imgSize === void 0 ? void 0 : imgSize.height) || 50
@@ -12235,60 +12321,93 @@ var CardRow$1 = function CardRow(_ref) {
12235
12321
  component: "th",
12236
12322
  id: row === null || row === void 0 ? void 0 : row.labelId,
12237
12323
  scope: "row",
12238
- padding: "none"
12239
- }, /*#__PURE__*/React__default.createElement(ProductName$1, null, row.productName), !allowToProcessInvoiceForOutOfStockProductsEcommerce ? (row.quantity > row.availableQuantity || row.availableQuantity <= 0) && /*#__PURE__*/React__default.createElement("p", {
12324
+ padding: "none",
12325
+ className: "cell-name"
12326
+ }, /*#__PURE__*/React__default.createElement(ProductName$1, null, row === null || row === void 0 ? void 0 : row.productName), !allowToProcessInvoiceForOutOfStockProductsEcommerce ? ((row === null || row === void 0 ? void 0 : row.quantity) > (row === null || row === void 0 ? void 0 : row.availableQuantity) || (row === null || row === void 0 ? void 0 : row.availableQuantity) <= 0) && /*#__PURE__*/React__default.createElement("p", {
12240
12327
  style: {
12241
12328
  color: 'red',
12242
12329
  fontWeight: 500
12243
12330
  }
12244
- }, "Maximum available quantity is ", row.availableQuantity) : /*#__PURE__*/React__default.createElement("div", null)), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12331
+ }, "Maximum available quantity is ", row === null || row === void 0 ? void 0 : row.availableQuantity) : /*#__PURE__*/React__default.createElement("div", null)), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12245
12332
  align: "center",
12246
- className: "CartnoBelowSm"
12333
+ className: "cell-price"
12247
12334
  }, /*#__PURE__*/React__default.createElement("p", {
12248
12335
  className: "price"
12249
- }, "$", row === null || row === void 0 ? void 0 : (_row$standardPrice = row.standardPrice) === null || _row$standardPrice === void 0 ? void 0 : _row$standardPrice.toFixed(2))), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12250
- align: "center"
12251
- }, /*#__PURE__*/React__default.createElement(QuantityBox$1, null, /*#__PURE__*/React__default.createElement("div", {
12336
+ }, "$", (Number(row === null || row === void 0 ? void 0 : row.standardPrice) || 0).toFixed(2), /*#__PURE__*/React__default.createElement("span", {
12337
+ className: "mobileLabel"
12338
+ }, " each"))), !hideStock && /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12339
+ align: "center",
12340
+ className: "cell-stock"
12341
+ }, /*#__PURE__*/React__default.createElement("p", {
12342
+ className: "stock " + (Number(row === null || row === void 0 ? void 0 : row.availableQuantity) > 0 ? '' : 'stock-out')
12343
+ }, /*#__PURE__*/React__default.createElement("span", {
12344
+ className: "mobileLabel"
12345
+ }, "Stock: "), (_row$availableQuantit = row === null || row === void 0 ? void 0 : row.availableQuantity) != null ? _row$availableQuantit : '-')), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12346
+ align: "center",
12347
+ className: "cell-qty"
12348
+ }, /*#__PURE__*/React__default.createElement(QuantityBox$1, {
12349
+ onClick: function onClick(e) {
12350
+ return e.stopPropagation();
12351
+ }
12352
+ }, /*#__PURE__*/React__default.createElement("button", {
12353
+ type: "button",
12354
+ className: "stepBtn",
12355
+ "aria-label": "Decrease quantity",
12356
+ disabled: loading || hideDelete && (row === null || row === void 0 ? void 0 : row.quantity) <= 1,
12252
12357
  onClick: function onClick(e) {
12253
12358
  e.stopPropagation();
12254
12359
  if (loading) return;
12255
- if (!allowToProcessInvoiceForOutOfStockProductsEcommerce && (row === null || row === void 0 ? void 0 : row.availableQuantity) <= 0) {
12360
+ if (!allowToProcessInvoiceForOutOfStockProductsEcommerce && (row === null || row === void 0 ? void 0 : row.availableQuantity) <= 0 || (row === null || row === void 0 ? void 0 : row.quantity) === 1) {
12256
12361
  return handleRemoveProduct(row, index);
12257
12362
  }
12258
- handleIncrementDecrement('decrement', _extends({}, row, {
12259
- quantity: (row === null || row === void 0 ? void 0 : row.quantity) > (row === null || row === void 0 ? void 0 : row.availableQuantity) ? row === null || row === void 0 ? void 0 : row.availableQuantity : row === null || row === void 0 ? void 0 : row.quantity
12363
+ onChangeQuantity(_extends({}, row, {
12364
+ quantity: checkMinMaxQty({
12365
+ quantity: (row === null || row === void 0 ? void 0 : row.quantity) - 1,
12366
+ product: row,
12367
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
12368
+ })
12260
12369
  }));
12261
12370
  }
12262
- }, /*#__PURE__*/React__default.createElement(ai.AiOutlineMinus, {
12263
- style: {
12264
- fontSize: 'inherit'
12265
- }
12266
- })), /*#__PURE__*/React__default.createElement("div", {
12267
- className: "price"
12268
- }, /*#__PURE__*/React__default.createElement("p", null, row === null || row === void 0 ? void 0 : row.quantity)), /*#__PURE__*/React__default.createElement("div", {
12269
- className: "add",
12371
+ }, /*#__PURE__*/React__default.createElement(ai.AiOutlineMinus, null)), /*#__PURE__*/React__default.createElement("input", {
12372
+ type: "number",
12373
+ min: 1,
12374
+ inputMode: "numeric",
12375
+ value: quantity,
12376
+ disabled: loading,
12377
+ onChange: onChangeInput,
12378
+ onBlur: onBlurInput,
12379
+ onFocus: function onFocus(e) {
12380
+ return e.target.select();
12381
+ },
12382
+ "aria-label": "Quantity"
12383
+ }), /*#__PURE__*/React__default.createElement("button", {
12384
+ type: "button",
12385
+ className: "stepBtn",
12386
+ "aria-label": "Increase quantity",
12387
+ disabled: loading,
12270
12388
  onClick: function onClick(e) {
12271
12389
  e.stopPropagation();
12272
12390
  if (loading) return;
12273
- if (!allowToProcessInvoiceForOutOfStockProductsEcommerce && (row === null || row === void 0 ? void 0 : row.availableQuantity) <= 0) {
12274
- return handleRemoveProduct(row, index);
12275
- }
12276
- handleIncrementDecrement('increment', _extends({}, row, {
12277
- quantity: (row === null || row === void 0 ? void 0 : row.quantity) > (row === null || row === void 0 ? void 0 : row.availableQuantity) ? row === null || row === void 0 ? void 0 : row.availableQuantity : row === null || row === void 0 ? void 0 : row.quantity
12391
+ onChangeQuantity(_extends({}, row, {
12392
+ quantity: checkMinMaxQty({
12393
+ quantity: (row === null || row === void 0 ? void 0 : row.quantity) + 1,
12394
+ product: row,
12395
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
12396
+ })
12278
12397
  }));
12279
12398
  }
12280
- }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePlus, {
12281
- style: {
12282
- fontSize: 'inherit'
12283
- }
12284
- })))), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12285
- alig: "center",
12286
- className: "CartnoPaddingSm"
12399
+ }, /*#__PURE__*/React__default.createElement(ai.AiOutlinePlus, null)))), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12400
+ className: "cell-subtotal"
12287
12401
  }, /*#__PURE__*/React__default.createElement("p", {
12288
12402
  className: "price"
12289
- }, "$", (_row$subtotal = row.subtotal) === null || _row$subtotal === void 0 ? void 0 : _row$subtotal.toFixed(2))), /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12290
- alig: "center"
12403
+ }, /*#__PURE__*/React__default.createElement("span", {
12404
+ className: "mobileLabel"
12405
+ }, "Subtotal "), "$", (Number(row === null || row === void 0 ? void 0 : row.subtotal) || 0).toFixed(2))), !hideDelete && /*#__PURE__*/React__default.createElement(CartTableCell$2, {
12406
+ className: "cell-delete"
12291
12407
  }, /*#__PURE__*/React__default.createElement(DeleteBtn$1, {
12408
+ type: "button",
12409
+ "aria-label": "Remove product",
12410
+ title: "Remove",
12292
12411
  onClick: function onClick(e) {
12293
12412
  e.stopPropagation();
12294
12413
  if (loading) return;
@@ -12301,13 +12420,13 @@ var CardRow$1 = function CardRow(_ref) {
12301
12420
  }))));
12302
12421
  };
12303
12422
 
12304
- var _templateObject$H, _templateObject2$v, _templateObject3$p, _templateObject4$k, _templateObject5$g, _templateObject6$e, _templateObject7$a, _templateObject8$8, _templateObject9$6;
12423
+ var _templateObject$H, _templateObject2$w, _templateObject3$q, _templateObject4$l, _templateObject5$h, _templateObject6$f, _templateObject7$b, _templateObject8$9, _templateObject9$6, _templateObject10$5;
12305
12424
  var CartPageSection$1 = styled__default.section(_templateObject$H || (_templateObject$H = _taggedTemplateLiteralLoose(["\n background: ", ";\n max-width: 100%;\n width: fit-content;\n background: ", ";\n overflow: hidden;\n border-radius: 28px;\n\n @media screen and (max-width: 1200px) {\n padding: 0 1em;\n }\n @media screen and (max-width: 600px) {\n padding: 0 1em;\n }\n"])), function (props) {
12306
12425
  return props.bg;
12307
12426
  }, function (props) {
12308
12427
  return props.bg || '#FAE8E5';
12309
12428
  });
12310
- var CartPageContainer$1 = styled__default.div(_templateObject2$v || (_templateObject2$v = _taggedTemplateLiteralLoose(["\n max-width: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n border-radius: 28px 28px 28px 14px;\n padding: 2em 2.5em;\n padding-bottom: 3em;\n border-radius: 28px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n max-height: 630px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n border: 2px solid;\n }\n /* box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05); */\n }\n table {\n border-collapse: separate;\n border-spacing: 0 4px;\n row-gap: 4px;\n }\n\n td {\n /* border: solid 1px #000; */\n border-style: none solid solid none;\n /* padding: 10px; */\n /* margin-bottom:5px; */\n }\n\n tr:first-child td:first-child {\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-top-right-radius: 10px;\n border-bottom-right-radius: 10px;\n }\n\n tr td:first-child {\n border-bottom-left-radius: 10px;\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-bottom-right-radius: 10px;\n }\n\n tr td {\n border-top-style: solid;\n }\n tr td:first-child {\n border-left-style: solid;\n }\n\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n padding: 0.5em;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n"])), function (props) {
12429
+ var CartPageContainer$1 = styled__default.div(_templateObject2$w || (_templateObject2$w = _taggedTemplateLiteralLoose(["\n max-width: ", ";\n width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n border-radius: 28px 28px 28px 14px;\n padding: 2em 2.5em;\n padding-bottom: 3em;\n border-radius: 28px;\n opacity: ", ";\n .scrollDiv {\n width: 68%;\n max-height: 630px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n\n margin-right: 0.3em;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n\n border-radius: 16px;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n border: 2px solid;\n }\n /* box-shadow: 0px 20px 35px rgba(0, 0, 0, 0.05); */\n }\n table {\n border-collapse: separate;\n border-spacing: 0 4px;\n row-gap: 4px;\n }\n\n td {\n /* border: solid 1px #000; */\n border-style: none solid solid none;\n /* padding: 10px; */\n /* margin-bottom:5px; */\n }\n\n tr:first-child td:first-child {\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-top-right-radius: 10px;\n border-bottom-right-radius: 10px;\n }\n\n tr td:first-child {\n border-bottom-left-radius: 10px;\n border-top-left-radius: 10px;\n }\n tr td:last-child {\n border-bottom-right-radius: 10px;\n }\n\n tr td {\n border-top-style: solid;\n }\n tr td:first-child {\n border-left-style: solid;\n }\n\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n padding: 0.5em;\n .scrollDiv {\n width: 100%;\n margin: 0;\n margin-bottom: 2em;\n padding: 0 0.4em;\n }\n }\n"])), function (props) {
12311
12430
  return props.maxWidth || '1600px';
12312
12431
  }, function (props) {
12313
12432
  return "min(" + (props.maxWidth || '1600px') + ",100%)";
@@ -12318,35 +12437,34 @@ var CartPageContainer$1 = styled__default.div(_templateObject2$v || (_templateOb
12318
12437
  }, function (props) {
12319
12438
  return props.color || '#BFC3CA';
12320
12439
  });
12321
- var CardsBox$1 = styled__default.div(_templateObject3$p || (_templateObject3$p = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n max-width: 860px;\n margin-right: auto;\n padding: 1em 2em;\n display: ", ";\n grid-template-columns: 1fr 1fr;\n flex-direction: column;\n align-items: flex-start;\n grid-gap: 1em;\n justify-content: flex-start;\n align-items: center;\n border-radius: 20px;\n @media only screen and (max-width: 900px) {\n display: flex;\n }\n @media only screen and (max-width: 600px) {\n padding: 1em 0.2em;\n }\n"])), function (props) {
12440
+ var CardsBox$1 = styled__default.div(_templateObject3$q || (_templateObject3$q = _taggedTemplateLiteralLoose(["\n width: 100%;\n /* min-height: 1000px; */\n position: relative;\n max-width: 860px;\n margin-right: auto;\n padding: 1em 2em;\n display: ", ";\n grid-template-columns: 1fr 1fr;\n flex-direction: column;\n align-items: flex-start;\n grid-gap: 1em;\n justify-content: flex-start;\n align-items: center;\n border-radius: 20px;\n @media only screen and (max-width: 900px) {\n display: flex;\n }\n @media only screen and (max-width: 600px) {\n padding: 1em 0.2em;\n }\n"])), function (props) {
12322
12441
  return props.retail ? 'grid' : 'flex';
12323
12442
  });
12324
- var CartHeading$1 = styled__default.div(_templateObject4$k || (_templateObject4$k = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n /* margin-bottom: 2em; */\n margin-left: 2.3em;\n margin-top: 2em;\n\n color: ", ";\n h1 {\n font-weight: 600;\n font-size: 2.0375em;\n text-transform: capitalize;\n color: ", ";\n /* margin-bottom: 1em; */\n }\n p {\n font-size: 0.875em;\n color: inherit;\n margin-top: 0.5em;\n }\n"])), function (props) {
12443
+ var CartHeading$1 = styled__default.div(_templateObject4$l || (_templateObject4$l = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n /* margin-bottom: 2em; */\n margin-left: 2.3em;\n margin-top: 2em;\n\n color: ", ";\n h1 {\n font-weight: 600;\n font-size: 2.0375em;\n text-transform: capitalize;\n color: ", ";\n /* margin-bottom: 1em; */\n }\n p {\n font-size: 0.875em;\n color: inherit;\n margin-top: 0.5em;\n }\n"])), function (props) {
12325
12444
  return props.color || 'black';
12326
12445
  }, function (props) {
12327
12446
  return props.h1 || 'inherit';
12328
12447
  });
12329
- var Loader$2 = styled__default.div(_templateObject5$g || (_templateObject5$g = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 40%;\n left: 47%;\n display: grid;\n place-items: center;\n z-index: 3;\n"])));
12330
- var CartTableCell$3 = styled__default(material.TableCell)(_templateObject6$e || (_templateObject6$e = _taggedTemplateLiteralLoose(["\n && {\n padding-bottom: 1em !important;\n // border: none !important;\n /* font-size: 0.75em; */\n font-size: 1em;\n color: rgba(98, 95, 95, 1);\n // background: ", ";\n color: ", ";\n }\n &.bg-transparent {\n // background-color: transparent !important;\n text-transform: uppercase;\n span {\n font-size: 0.75em;\n font-weight: 600;\n }\n svg {\n color: ", ";\n }\n .MuiTableSortLabel-root {\n color: ", "!important;\n }\n }\n"])), function (props) {
12448
+ var Loader$2 = styled__default.div(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 40%;\n left: 47%;\n display: grid;\n place-items: center;\n z-index: 3;\n"])));
12449
+ var CartTableCell$3 = styled__default(material.TableCell)(_templateObject6$f || (_templateObject6$f = _taggedTemplateLiteralLoose(["\n && {\n padding-bottom: 1em !important;\n // border: none !important;\n /* font-size: 0.75em; */\n font-size: 1em;\n color: rgba(98, 95, 95, 1);\n // background: ", ";\n color: ", ";\n }\n &.bg-transparent {\n // background-color: transparent !important;\n text-transform: uppercase;\n letter-spacing: 0.4px;\n span {\n font-size: 0.75em;\n font-weight: 600;\n color: ", ";\n }\n .MuiTableSortLabel-root:hover,\n .MuiTableSortLabel-root:hover svg {\n color: ", " !important;\n }\n svg {\n color: ", ";\n }\n .MuiTableSortLabel-root {\n color: ", "!important;\n }\n }\n"])), function (props) {
12331
12450
  return "" + props.bg;
12332
12451
  }, function (props) {
12333
12452
  return "" + props.color || 'inherit';
12334
12453
  }, function (props) {
12454
+ return props.color || '#6b7280';
12455
+ }, getPrimary, function (props) {
12335
12456
  return "" + props.color || 'inherit';
12336
12457
  }, function (props) {
12337
12458
  return "" + props.color || 'inherit';
12338
12459
  });
12339
- var CartTableContainer$1 = styled__default(material.TableContainer)(_templateObject7$a || (_templateObject7$a = _taggedTemplateLiteralLoose(["\n max-height: 580px;\n padding-right: 1.5em;\n overflow: inherit !important;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n width: 100%;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n border-radius: 16px;\n margin: 5px 2px;\n background: ", ";\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n }\n"])), function (props) {
12460
+ var CartTableContainer$1 = styled__default(material.TableContainer)(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n max-height: 580px;\n padding-right: 1.5em;\n overflow: inherit !important;\n &::-webkit-scrollbar {\n width: 10px;\n }\n\n /* Track */\n &::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n width: 100%;\n }\n\n /* Handle */\n &::-webkit-scrollbar-thumb {\n border-radius: 16px;\n margin: 5px 2px;\n background: ", ";\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n }\n"])), function (props) {
12340
12461
  return props.bg || '#fdccc480';
12341
12462
  }, function (props) {
12342
12463
  return props.color || 'red';
12343
12464
  });
12344
- var CartButtonsRow$1 = styled__default.div(_templateObject8$8 || (_templateObject8$8 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding-right: 1.85em;\n button {\n display: flex;\n align-items: center;\n background: ", ";\n color: ", ";\n padding: 0.5em 1em;\n margin-left: 1em;\n font-size: 0.85em;\n text-transform: uppercase;\n border: none;\n cursor: pointer;\n transition: 0.4s;\n font-size: 1rem;\n font-weight: 600;\n svg {\n margin-right: 0.4rem;\n }\n &:hover {\n transform: scale(0.95);\n }\n }\n"])), function (props) {
12345
- return props.bg || 'rgba(107, 106, 106, 1)';
12346
- }, function (props) {
12347
- return props.color || 'white';
12348
- });
12349
- var CartPageBox$1 = styled__default.div(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n @media only screen and (max-width: 768px) {\n margin-right: 0;\n .CartnoBelowSm {\n display: none;\n }\n }\n"])));
12465
+ var CartButtonsRow$1 = styled__default.div(_templateObject8$9 || (_templateObject8$9 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n padding-right: 1.5em;\n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n height: 42px;\n padding: 0 20px;\n border-radius: 8px;\n border: 1.5px solid ", ";\n font-size: 0.95rem;\n font-weight: 600;\n letter-spacing: 0.2px;\n white-space: nowrap;\n cursor: pointer;\n transition: background 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;\n svg {\n font-size: 1.1em;\n }\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 2px;\n }\n &:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n }\n }\n .outlined {\n position: relative;\n isolation: isolate;\n background: #fff;\n color: ", ";\n /* Hover tint: the primary color at low opacity, behind the label. */\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-radius: inherit;\n background: ", ";\n opacity: 0;\n transition: opacity 0.2s;\n }\n &:hover:not(:disabled)::before {\n opacity: 0.08;\n }\n }\n .filled {\n background: ", ";\n color: #fff;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);\n &:hover:not(:disabled) {\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);\n opacity: 0.92;\n }\n }\n @media only screen and (max-width: 768px) {\n padding-right: 0;\n }\n @media only screen and (max-width: 600px) {\n button {\n flex: 1;\n height: 44px;\n padding: 0 12px;\n font-size: 0.875rem;\n }\n }\n"])), getPrimary, getPrimary, getPrimary, getPrimary, getPrimary);
12466
+ var CartPageBox$1 = styled__default.div(_templateObject9$6 || (_templateObject9$6 = _taggedTemplateLiteralLoose(["\n max-width: 100%;\n @media only screen and (max-width: 768px) {\n margin-right: 0;\n .CartnoBelowSm {\n display: none;\n }\n /* Rows become stacked cards (see CardRow), so the table/body are blocks. */\n table,\n tbody {\n display: block;\n width: 100%;\n }\n }\n"])));
12467
+ var MobileSelectBar = styled__default.div(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n display: none;\n @media only screen and (max-width: 768px) {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 2px 8px;\n font-size: 0.9em;\n color: #555;\n label {\n display: flex;\n align-items: center;\n cursor: pointer;\n font-weight: 500;\n }\n .count {\n font-size: 0.9em;\n color: #888;\n }\n }\n"])));
12350
12468
 
12351
12469
  var headCells$1 = [{
12352
12470
  id: 'image',
@@ -12367,6 +12485,13 @@ var headCells$1 = [{
12367
12485
  label: 'price',
12368
12486
  filter: true,
12369
12487
  noBelowSm: true
12488
+ }, {
12489
+ id: 'availableQuantity',
12490
+ numeric: true,
12491
+ disablePadding: false,
12492
+ label: 'stock',
12493
+ filter: true,
12494
+ noBelowSm: true
12370
12495
  }, {
12371
12496
  id: 'quantity',
12372
12497
  numeric: true,
@@ -12388,14 +12513,17 @@ var headCells$1 = [{
12388
12513
  noBelowSm: true
12389
12514
  }];
12390
12515
  function EnhancedTableHead$1(props) {
12391
- var _styles$cartSummary, _styles$cartSummary2;
12516
+ var _React$useContext, _styles$cartSummary, _styles$cartSummary2;
12392
12517
  var onSelectAllClick = props.onSelectAllClick,
12393
12518
  order = props.order,
12394
12519
  orderBy = props.orderBy,
12395
12520
  numSelected = props.numSelected,
12396
12521
  rowCount = props.rowCount,
12397
12522
  onRequestSort = props.onRequestSort,
12398
- styles = props.styles;
12523
+ styles = props.styles,
12524
+ hideDelete = props.hideDelete,
12525
+ hideStock = props.hideStock;
12526
+ var primaryColor = ((_React$useContext = React.useContext(styled.ThemeContext)) === null || _React$useContext === void 0 ? void 0 : _React$useContext.primaryColor) || DEFAULT_PRIMARY;
12399
12527
  var createSortHandler = function createSortHandler(property) {
12400
12528
  return function (event) {
12401
12529
  onRequestSort(event, property);
@@ -12422,8 +12550,14 @@ function EnhancedTableHead$1(props) {
12422
12550
  svg: {
12423
12551
  color: styles === null || styles === void 0 ? void 0 : (_styles$cartSummary2 = styles.cartSummary) === null || _styles$cartSummary2 === void 0 ? void 0 : _styles$cartSummary2.color
12424
12552
  }
12553
+ }, {
12554
+ '&.Mui-checked, &.MuiCheckbox-indeterminate': {
12555
+ color: primaryColor
12556
+ }
12425
12557
  })
12426
- })), headCells$1.map(function (headCell) {
12558
+ })), headCells$1.filter(function (headCell) {
12559
+ return !(hideDelete && headCell.id === 'delete') && !(hideStock && headCell.id === 'availableQuantity');
12560
+ }).map(function (headCell) {
12427
12561
  var _styles$cartSummary3;
12428
12562
  return /*#__PURE__*/React.createElement(CartTableCell$3, {
12429
12563
  key: headCell.id,
@@ -12453,19 +12587,31 @@ EnhancedTableHead$1.propTypes = {
12453
12587
  rowCount: propTypes.number.isRequired
12454
12588
  };
12455
12589
  function ProductTable(_ref) {
12456
- var _styles$scroll, _styles$scroll2, _sortBy, _styles$Btn, _styles$Btn2;
12590
+ var _React$useContext2, _styles$scroll, _styles$scroll2, _sortBy;
12457
12591
  var cartData = _ref.cartData,
12458
12592
  loading = _ref.loading,
12459
12593
  imgnotfoundUrl = _ref.imgnotfoundUrl,
12460
12594
  handleIncrementDecrement = _ref.handleIncrementDecrement,
12461
12595
  handleRemoveProduct = _ref.handleRemoveProduct,
12462
12596
  handleRemoveAll = _ref.handleRemoveAll,
12463
- styles = _ref.styles;
12464
- var cartList = cartData === null || cartData === void 0 ? void 0 : cartData.map(function (li) {
12597
+ handleAddToCart = _ref.handleAddToCart,
12598
+ styles = _ref.styles,
12599
+ _ref$allowToProcessIn = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
12600
+ allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref$allowToProcessIn === void 0 ? false : _ref$allowToProcessIn,
12601
+ selectedIds = _ref.selectedIds,
12602
+ onSelectedIdsChange = _ref.onSelectedIdsChange,
12603
+ _ref$hideActions = _ref.hideActions,
12604
+ hideActions = _ref$hideActions === void 0 ? false : _ref$hideActions,
12605
+ _ref$hideDelete = _ref.hideDelete,
12606
+ hideDelete = _ref$hideDelete === void 0 ? false : _ref$hideDelete,
12607
+ _ref$hideStock = _ref.hideStock,
12608
+ hideStock = _ref$hideStock === void 0 ? false : _ref$hideStock;
12609
+ var cartList = (Array.isArray(cartData) ? cartData : []).filter(Boolean).map(function (li) {
12465
12610
  return _extends({}, li, {
12466
- subtotal: li.standardPrice * li.quantity
12611
+ subtotal: (Number(li === null || li === void 0 ? void 0 : li.standardPrice) || 0) * (Number(li === null || li === void 0 ? void 0 : li.quantity) || 0)
12467
12612
  });
12468
12613
  });
12614
+ var primaryColor = ((_React$useContext2 = React.useContext(styled.ThemeContext)) === null || _React$useContext2 === void 0 ? void 0 : _React$useContext2.primaryColor) || DEFAULT_PRIMARY;
12469
12615
  var _React$useState = React.useState('asc'),
12470
12616
  order = _React$useState[0],
12471
12617
  setOrder = _React$useState[1];
@@ -12473,8 +12619,14 @@ function ProductTable(_ref) {
12473
12619
  orderBy = _React$useState2[0],
12474
12620
  setOrderBy = _React$useState2[1];
12475
12621
  var _React$useState3 = React.useState([]),
12476
- selected = _React$useState3[0],
12477
- setSelected = _React$useState3[1];
12622
+ internalSelected = _React$useState3[0],
12623
+ setInternalSelected = _React$useState3[1];
12624
+ var selected = selectedIds != null ? selectedIds : internalSelected;
12625
+ var setSelected = function setSelected(updater) {
12626
+ var next = typeof updater === 'function' ? updater(selected) : updater;
12627
+ if (next === selected) return;
12628
+ if (onSelectedIdsChange) onSelectedIdsChange(next);else setInternalSelected(next);
12629
+ };
12478
12630
  var _React$useState4 = React.useState(cartList || []),
12479
12631
  cartArray = _React$useState4[0],
12480
12632
  setCartArray = _React$useState4[1];
@@ -12500,44 +12652,71 @@ function ProductTable(_ref) {
12500
12652
  setOrder(isAsc ? 'desc' : 'asc');
12501
12653
  setOrderBy(property);
12502
12654
  };
12503
- var handleSelectAllClick = function handleSelectAllClick(event) {
12504
- if ((selected === null || selected === void 0 ? void 0 : selected.length) < (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length)) {
12505
- var newSelected = [];
12506
- cartArray === null || cartArray === void 0 ? void 0 : cartArray.map(function (n) {
12507
- return newSelected.push(n);
12508
- });
12509
- setSelected(newSelected);
12510
- return;
12511
- }
12512
- setSelected([]);
12655
+ var handleSelectAllClick = function handleSelectAllClick() {
12656
+ var allIds = cartList.map(function (p) {
12657
+ return p === null || p === void 0 ? void 0 : p.rowId;
12658
+ });
12659
+ setSelected(function (prev) {
12660
+ return prev.length < allIds.length ? allIds : [];
12661
+ });
12513
12662
  };
12514
12663
  var handleClick = function handleClick(event, product) {
12515
- var includes = selected.includes(product);
12516
- if (includes) {
12517
- var removedId = selected.filter(function (item, i) {
12518
- return item.index !== i;
12519
- });
12520
- setSelected(removedId);
12521
- } else {
12522
- setSelected([].concat(selected, [product]));
12523
- }
12664
+ var id = product === null || product === void 0 ? void 0 : product.rowId;
12665
+ setSelected(function (prev) {
12666
+ return prev.includes(id) ? prev.filter(function (x) {
12667
+ return x !== id;
12668
+ }) : [].concat(prev, [id]);
12669
+ });
12524
12670
  };
12525
- var isSelected = function isSelected(name) {
12526
- return selected.includes(name);
12671
+ var isSelected = function isSelected(product) {
12672
+ return selected.includes(product === null || product === void 0 ? void 0 : product.rowId);
12673
+ };
12674
+ var handleRemoveSelected = function handleRemoveSelected() {
12675
+ if (loading) return;
12676
+ if (!selected.length) {
12677
+ alert('Please select at least one product to remove.');
12678
+ return;
12679
+ }
12680
+ handleRemoveAll(selected);
12527
12681
  };
12528
12682
  React.useEffect(function () {
12529
12683
  setCartArray(cartList);
12684
+ var ids = new Set(cartList.map(function (p) {
12685
+ return p === null || p === void 0 ? void 0 : p.rowId;
12686
+ }));
12687
+ setSelected(function (prev) {
12688
+ var next = prev.filter(function (id) {
12689
+ return ids.has(id);
12690
+ });
12691
+ return next.length === prev.length ? prev : next;
12692
+ });
12530
12693
  }, [cartData]);
12531
12694
  return /*#__PURE__*/React.createElement(CartPageBox$1, null, loading && /*#__PURE__*/React.createElement(Loader$2, null, /*#__PURE__*/React.createElement(reactSpinners.BounceLoader, {
12532
12695
  size: 40,
12533
- color: styles.Btn.background,
12696
+ color: primaryColor,
12534
12697
  loading: true
12535
12698
  })), /*#__PURE__*/React.createElement(Box, {
12536
12699
  sx: {
12537
12700
  width: '100%'
12538
12701
  },
12539
12702
  paddingBottom: "2em"
12540
- }, /*#__PURE__*/React.createElement(CartTableContainer$1, {
12703
+ }, /*#__PURE__*/React.createElement(MobileSelectBar, null, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement(material.Checkbox, {
12704
+ size: "small",
12705
+ indeterminate: (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && (selected === null || selected === void 0 ? void 0 : selected.length) < (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length),
12706
+ checked: (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length) > 0 && (selected === null || selected === void 0 ? void 0 : selected.length) === (cartArray === null || cartArray === void 0 ? void 0 : cartArray.length),
12707
+ onChange: handleSelectAllClick,
12708
+ inputProps: {
12709
+ 'aria-label': 'select all products'
12710
+ },
12711
+ sx: {
12712
+ pl: 0,
12713
+ '&.Mui-checked, &.MuiCheckbox-indeterminate': {
12714
+ color: primaryColor
12715
+ }
12716
+ }
12717
+ }), "Select all"), (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && /*#__PURE__*/React.createElement("span", {
12718
+ className: "count"
12719
+ }, selected.length, " selected")), /*#__PURE__*/React.createElement(CartTableContainer$1, {
12541
12720
  bg: styles === null || styles === void 0 ? void 0 : (_styles$scroll = styles.scroll) === null || _styles$scroll === void 0 ? void 0 : _styles$scroll.bg,
12542
12721
  color: styles === null || styles === void 0 ? void 0 : (_styles$scroll2 = styles.scroll) === null || _styles$scroll2 === void 0 ? void 0 : _styles$scroll2.color
12543
12722
  }, /*#__PURE__*/React.createElement(Table, {
@@ -12551,12 +12730,15 @@ function ProductTable(_ref) {
12551
12730
  onSelectAllClick: handleSelectAllClick,
12552
12731
  onRequestSort: handleRequestSort,
12553
12732
  rowCount: cartArray === null || cartArray === void 0 ? void 0 : cartArray.length,
12554
- styles: styles
12733
+ styles: styles,
12734
+ hideDelete: hideDelete,
12735
+ hideStock: hideStock
12555
12736
  }), /*#__PURE__*/React.createElement(TableBody, null, (_sortBy = lodash.sortBy(cartArray, function (o) {
12556
12737
  return !((o === null || o === void 0 ? void 0 : o.quantity) > (o === null || o === void 0 ? void 0 : o.availableQuantity));
12557
12738
  })) === null || _sortBy === void 0 ? void 0 : _sortBy.map(function (row, index) {
12558
12739
  var isItemSelected = isSelected(row);
12559
12740
  return /*#__PURE__*/React.createElement(CardRow$1, {
12741
+ key: (row === null || row === void 0 ? void 0 : row.rowId) || index,
12560
12742
  row: row,
12561
12743
  index: index,
12562
12744
  isItemSelected: isItemSelected,
@@ -12565,66 +12747,365 @@ function ProductTable(_ref) {
12565
12747
  cartData: cartData,
12566
12748
  loading: loading,
12567
12749
  styles: styles,
12750
+ hideDelete: hideDelete,
12751
+ hideStock: hideStock,
12568
12752
  handleIncrementDecrement: handleIncrementDecrement,
12569
- handleRemoveProduct: handleRemoveProduct
12753
+ handleRemoveProduct: handleRemoveProduct,
12754
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
12570
12755
  });
12571
- }))))), /*#__PURE__*/React.createElement(CartButtonsRow$1, {
12572
- bg: styles === null || styles === void 0 ? void 0 : (_styles$Btn = styles.Btn) === null || _styles$Btn === void 0 ? void 0 : _styles$Btn.background,
12573
- color: styles === null || styles === void 0 ? void 0 : (_styles$Btn2 = styles.Btn) === null || _styles$Btn2 === void 0 ? void 0 : _styles$Btn2.color
12574
- }, /*#__PURE__*/React.createElement("button", {
12756
+ }))))), !hideActions && /*#__PURE__*/React.createElement(CartButtonsRow$1, null, /*#__PURE__*/React.createElement("button", {
12757
+ type: "button",
12758
+ className: "outlined",
12759
+ onClick: handleRemoveSelected,
12760
+ disabled: loading || !(selected !== null && selected !== void 0 && selected.length)
12761
+ }, /*#__PURE__*/React.createElement(ai.AiOutlineDelete, null), "Remove selected", selected !== null && selected !== void 0 && selected.length ? " (" + selected.length + ")" : ''), /*#__PURE__*/React.createElement("button", {
12762
+ type: "button",
12763
+ className: "filled",
12764
+ disabled: loading || !(cartArray !== null && cartArray !== void 0 && cartArray.length),
12575
12765
  onClick: function onClick() {
12576
- new Promise(function (resolve, reject) {
12577
- if (loading) return;
12578
- handleRemoveAll(selected);
12579
- resolve();
12580
- });
12581
- setSelected([]);
12766
+ if (loading) return;
12767
+ handleAddToCart && handleAddToCart(selected);
12582
12768
  }
12583
- }, /*#__PURE__*/React.createElement(ai.AiOutlineDelete, null), " remove selected"), /*#__PURE__*/React.createElement("button", null, /*#__PURE__*/React.createElement(ai.AiOutlinePlus, null), "Add to cart")));
12769
+ }, /*#__PURE__*/React.createElement(ai.AiOutlinePlus, null), loading ? 'Adding...' : selected !== null && selected !== void 0 && selected.length ? "Add selected to cart (" + selected.length + ")" : 'Add all to cart')));
12584
12770
  }
12585
12771
 
12586
- var QuickOrder = function QuickOrder(_ref) {
12587
- var _ref$colors = _ref.colors,
12588
- colors = _ref$colors === void 0 ? {
12589
- primaryColor: '#424242'
12590
- } : _ref$colors,
12772
+ var PAGE_SIZE = 20;
12773
+ var getInitialQuantity = function getInitialQuantity(product) {
12774
+ return (product === null || product === void 0 ? void 0 : product.minQuantityToSale) > 1 ? product.minQuantityToSale : 1;
12775
+ };
12776
+ var getRowId = function getRowId(product) {
12777
+ return "recent-" + (product === null || product === void 0 ? void 0 : product.productId);
12778
+ };
12779
+ var LastOrderedProductsDialog = function LastOrderedProductsDialog(_ref) {
12780
+ var open = _ref.open,
12781
+ onClose = _ref.onClose,
12782
+ onAdd = _ref.onAdd,
12591
12783
  apiEndPoint = _ref.apiEndPoint,
12592
12784
  token = _ref.token,
12593
12785
  imgnotfoundUrl = _ref.imgnotfoundUrl,
12594
- styles = _ref.styles;
12595
- var _useState = React.useState([]),
12596
- storeData = _useState[0],
12597
- setStoreData = _useState[1];
12598
- var storeIdList = Array.isArray(storeData) && (storeData === null || storeData === void 0 ? void 0 : storeData.length) > 0 ? storeData === null || storeData === void 0 ? void 0 : storeData.join(',') : '1';
12786
+ styles = _ref.styles,
12787
+ allowToProcessInvoiceForOutOfStockProductsEcommerce = _ref.allowToProcessInvoiceForOutOfStockProductsEcommerce,
12788
+ _ref$hideStock = _ref.hideStock,
12789
+ hideStock = _ref$hideStock === void 0 ? false : _ref$hideStock;
12790
+ var theme = React.useContext(styled.ThemeContext);
12791
+ var primaryColor = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#424242';
12792
+ var isSmallScreen = material.useMediaQuery('(max-width:600px)');
12793
+ var _useState = React.useState({}),
12794
+ rowsById = _useState[0],
12795
+ setRowsById = _useState[1];
12599
12796
  var _useState2 = React.useState([]),
12600
- products = _useState2[0],
12601
- setProducts = _useState2[1];
12602
- React.useEffect(function () {
12603
- (function () {
12604
- try {
12605
- var _temp = _catch(function () {
12797
+ pageRowIds = _useState2[0],
12798
+ setPageRowIds = _useState2[1];
12799
+ var _useState3 = React.useState([]),
12800
+ selectedIds = _useState3[0],
12801
+ setSelectedIds = _useState3[1];
12802
+ var _useState4 = React.useState(false),
12803
+ loading = _useState4[0],
12804
+ setLoading = _useState4[1];
12805
+ var _useState5 = React.useState(0),
12806
+ page = _useState5[0],
12807
+ setPage = _useState5[1];
12808
+ var _useState6 = React.useState(0),
12809
+ totalPages = _useState6[0],
12810
+ setTotalPages = _useState6[1];
12811
+ var _useState7 = React.useState(0),
12812
+ totalElements = _useState7[0],
12813
+ setTotalElements = _useState7[1];
12814
+ var requestId = React.useRef(0);
12815
+ var contentRef = React.useRef();
12816
+ var loadPage = function loadPage(pageToLoad) {
12817
+ try {
12818
+ var currentRequest = ++requestId.current;
12819
+ setLoading(true);
12820
+ return Promise.resolve(_finallyRethrows(function () {
12821
+ return _catch(function () {
12606
12822
  return Promise.resolve(API({
12607
12823
  apiEndPoint: apiEndPoint,
12608
12824
  token: token,
12609
- url: "store/store-ids"
12610
- })).then(function (data) {
12611
- setStoreData(data);
12825
+ url: '/ecommerce/product/recently-ordered',
12826
+ queryParams: {
12827
+ page: pageToLoad,
12828
+ size: PAGE_SIZE
12829
+ }
12830
+ })).then(function (result) {
12831
+ if (currentRequest !== requestId.current) return;
12832
+ var content = (Array.isArray(result === null || result === void 0 ? void 0 : result.content) ? result.content : []).filter(function (p) {
12833
+ return p && (p === null || p === void 0 ? void 0 : p.productId) != null;
12834
+ });
12835
+ setRowsById(function (prev) {
12836
+ var next = _extends({}, prev);
12837
+ content.forEach(function (p) {
12838
+ var rowId = getRowId(p);
12839
+ next[rowId] = prev[rowId] ? _extends({}, p, {
12840
+ quantity: prev[rowId].quantity,
12841
+ rowId: rowId
12842
+ }) : _extends({}, p, {
12843
+ quantity: getInitialQuantity(p),
12844
+ rowId: rowId
12845
+ });
12846
+ });
12847
+ return next;
12848
+ });
12849
+ setPageRowIds(content.map(getRowId));
12850
+ setPage(pageToLoad);
12851
+ setTotalPages((result === null || result === void 0 ? void 0 : result.totalPages) || 0);
12852
+ setTotalElements((result === null || result === void 0 ? void 0 : result.totalElements) || 0);
12853
+ if (contentRef.current) contentRef.current.scrollTop = 0;
12612
12854
  });
12613
12855
  }, function () {});
12614
- return _temp && _temp.then ? _temp.then(function () {}) : void 0;
12615
- } catch (e) {
12616
- Promise.reject(e);
12856
+ }, function (_wasThrown, _result) {
12857
+ if (currentRequest === requestId.current) setLoading(false);
12858
+ if (_wasThrown) throw _result;
12859
+ return _result;
12860
+ }));
12861
+ } catch (e) {
12862
+ return Promise.reject(e);
12863
+ }
12864
+ };
12865
+ React.useEffect(function () {
12866
+ if (!open) return;
12867
+ setRowsById({});
12868
+ setPageRowIds([]);
12869
+ setSelectedIds([]);
12870
+ setPage(0);
12871
+ setTotalPages(0);
12872
+ setTotalElements(0);
12873
+ loadPage(0);
12874
+ }, [open]);
12875
+ var pageRows = pageRowIds.map(function (id) {
12876
+ return rowsById[id];
12877
+ }).filter(Boolean);
12878
+ var pageIdSet = new Set(pageRows.map(function (p) {
12879
+ return p.rowId;
12880
+ }));
12881
+ var pageSelectedIds = selectedIds.filter(function (id) {
12882
+ return pageIdSet.has(id);
12883
+ });
12884
+ var handlePageSelectionChange = function handlePageSelectionChange(nextPageSelected) {
12885
+ setSelectedIds(function (prev) {
12886
+ return [].concat(prev.filter(function (id) {
12887
+ return !pageIdSet.has(id);
12888
+ }), nextPageSelected);
12889
+ });
12890
+ };
12891
+ var handleIncrementDecrement = function handleIncrementDecrement(data) {
12892
+ if (!(data !== null && data !== void 0 && data.rowId)) return;
12893
+ setRowsById(function (prev) {
12894
+ var _extends2;
12895
+ return prev[data.rowId] ? _extends({}, prev, (_extends2 = {}, _extends2[data.rowId] = _extends({}, prev[data.rowId], {
12896
+ quantity: data.quantity
12897
+ }), _extends2)) : prev;
12898
+ });
12899
+ setSelectedIds(function (prev) {
12900
+ return prev.includes(data.rowId) ? prev : [].concat(prev, [data.rowId]);
12901
+ });
12902
+ };
12903
+ var handleRemoveProduct = function handleRemoveProduct() {};
12904
+ var handlePageChange = function handlePageChange(event, value) {
12905
+ var nextPage = value - 1;
12906
+ if (nextPage === page || loading) return;
12907
+ loadPage(nextPage);
12908
+ };
12909
+ var handleAdd = function handleAdd() {
12910
+ if (!selectedIds.length) {
12911
+ alert('Please select at least one product to add.');
12912
+ return;
12913
+ }
12914
+ onAdd(selectedIds.map(function (id) {
12915
+ return rowsById[id];
12916
+ }).filter(Boolean));
12917
+ onClose();
12918
+ };
12919
+ return /*#__PURE__*/React__default.createElement(material.Dialog, {
12920
+ open: open,
12921
+ onClose: onClose,
12922
+ fullWidth: true,
12923
+ fullScreen: isSmallScreen,
12924
+ maxWidth: "lg",
12925
+ scroll: "paper"
12926
+ }, /*#__PURE__*/React__default.createElement(material.DialogTitle, {
12927
+ sx: {
12928
+ m: 0,
12929
+ p: 2,
12930
+ pr: 6
12931
+ }
12932
+ }, "Last Ordered Products", /*#__PURE__*/React__default.createElement(material.IconButton, {
12933
+ "aria-label": "close",
12934
+ onClick: onClose,
12935
+ sx: {
12936
+ position: 'absolute',
12937
+ right: 8,
12938
+ top: 8,
12939
+ '& svg': {
12940
+ fontSize: 20
12617
12941
  }
12618
- })();
12619
- }, []);
12942
+ }
12943
+ }, /*#__PURE__*/React__default.createElement(md.MdClose, null))), /*#__PURE__*/React__default.createElement(material.DialogContent, {
12944
+ dividers: true,
12945
+ ref: contentRef,
12946
+ sx: {
12947
+ px: {
12948
+ xs: 1.5,
12949
+ sm: 3
12950
+ }
12951
+ }
12952
+ }, pageRows.length > 0 ? /*#__PURE__*/React__default.createElement(ProductTable, {
12953
+ cartData: pageRows,
12954
+ loading: loading,
12955
+ imgnotfoundUrl: imgnotfoundUrl,
12956
+ styles: styles,
12957
+ handleRemoveProduct: handleRemoveProduct,
12958
+ handleIncrementDecrement: handleIncrementDecrement,
12959
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
12960
+ hideStock: hideStock,
12961
+ selectedIds: pageSelectedIds,
12962
+ onSelectedIdsChange: handlePageSelectionChange,
12963
+ hideActions: true,
12964
+ hideDelete: true
12965
+ }) : loading ? /*#__PURE__*/React__default.createElement(DialogLoadMore, null, "Loading products...") : /*#__PURE__*/React__default.createElement(NoData, null)), /*#__PURE__*/React__default.createElement(material.DialogActions, {
12966
+ sx: {
12967
+ p: 2
12968
+ }
12969
+ }, /*#__PURE__*/React__default.createElement(DialogFooter, null, /*#__PURE__*/React__default.createElement("div", {
12970
+ className: "pagination"
12971
+ }, totalPages > 1 && /*#__PURE__*/React__default.createElement(material.Pagination, {
12972
+ count: totalPages,
12973
+ page: page + 1,
12974
+ onChange: handlePageChange,
12975
+ disabled: loading,
12976
+ shape: "rounded",
12977
+ size: "small",
12978
+ sx: {
12979
+ '& .MuiPaginationItem-root.Mui-selected': {
12980
+ backgroundColor: primaryColor,
12981
+ color: '#fff'
12982
+ },
12983
+ '& .MuiPaginationItem-root.Mui-selected:hover': {
12984
+ backgroundColor: primaryColor,
12985
+ opacity: 0.9
12986
+ }
12987
+ }
12988
+ }), totalElements > 0 && /*#__PURE__*/React__default.createElement("span", {
12989
+ className: "count"
12990
+ }, page * PAGE_SIZE + 1, "\u2013", Math.min((page + 1) * PAGE_SIZE, totalElements), " of", ' ', totalElements)), /*#__PURE__*/React__default.createElement("div", {
12991
+ className: "buttons"
12992
+ }, /*#__PURE__*/React__default.createElement(DialogFooterButton, {
12993
+ type: "button",
12994
+ variant: "outlined",
12995
+ onClick: onClose
12996
+ }, "Cancel"), /*#__PURE__*/React__default.createElement(DialogFooterButton, {
12997
+ type: "button",
12998
+ onClick: handleAdd,
12999
+ disabled: !selectedIds.length
13000
+ }, "Add", selectedIds.length ? " (" + selectedIds.length + ")" : '')))));
13001
+ };
13002
+
13003
+ var _excluded$7 = ["rowId"];
13004
+ var QuickOrder = function QuickOrder(_ref) {
13005
+ var _erCookieStorage$getI;
13006
+ var _ref$colors = _ref.colors,
13007
+ colors = _ref$colors === void 0 ? {
13008
+ primaryColor: '#424242'
13009
+ } : _ref$colors,
13010
+ apiEndPoint = _ref.apiEndPoint,
13011
+ token = _ref.token,
13012
+ imgnotfoundUrl = _ref.imgnotfoundUrl,
13013
+ styles = _ref.styles,
13014
+ onAddToCart = _ref.onAddToCart,
13015
+ _ref$doNotShowStock = _ref.doNotShowStock,
13016
+ doNotShowStock = _ref$doNotShowStock === void 0 ? false : _ref$doNotShowStock;
13017
+ var _useAllSystemFeatureV = useAllSystemFeatureValues({
13018
+ apiEndPoint: apiEndPoint,
13019
+ token: token
13020
+ }),
13021
+ _useAllSystemFeatureV2 = _useAllSystemFeatureV.allowToProcessInvoiceForOutOfStockProductsEcommerce,
13022
+ allowToProcessInvoiceForOutOfStockProductsEcommerce = _useAllSystemFeatureV2 === void 0 ? false : _useAllSystemFeatureV2;
13023
+ var hideStock = !!allowToProcessInvoiceForOutOfStockProductsEcommerce || !!doNotShowStock;
13024
+ var storeId = (erCookieStorage === null || erCookieStorage === void 0 ? void 0 : (_erCookieStorage$getI = erCookieStorage.getItem) === null || _erCookieStorage$getI === void 0 ? void 0 : _erCookieStorage$getI.call(erCookieStorage, 'storeId')) || 2;
13025
+ var _useState = React.useState([]),
13026
+ products = _useState[0],
13027
+ setProducts = _useState[1];
13028
+ var _useState2 = React.useState(false),
13029
+ infoOpen = _useState2[0],
13030
+ setInfoOpen = _useState2[1];
13031
+ var _useState3 = React.useState(false),
13032
+ lastOrderedOpen = _useState3[0],
13033
+ setLastOrderedOpen = _useState3[1];
13034
+ var _useState4 = React.useState(false),
13035
+ addingToCart = _useState4[0],
13036
+ setAddingToCart = _useState4[1];
13037
+ var handleLastOrderedProducts = function handleLastOrderedProducts() {
13038
+ setLastOrderedOpen(true);
13039
+ };
13040
+ var isOutOfStock = function isOutOfStock(product) {
13041
+ var availableQuantity = product === null || product === void 0 ? void 0 : product.availableQuantity;
13042
+ return !allowToProcessInvoiceForOutOfStockProductsEcommerce && (1 > availableQuantity || availableQuantity <= 0);
13043
+ };
13044
+ var getProductKey = function getProductKey(product) {
13045
+ var _product$productId;
13046
+ return (_product$productId = product === null || product === void 0 ? void 0 : product.productId) != null ? _product$productId : product === null || product === void 0 ? void 0 : product.id;
13047
+ };
13048
+ var makeRowId = function makeRowId(product) {
13049
+ var _getProductKey;
13050
+ return ((_getProductKey = getProductKey(product)) != null ? _getProductKey : 'p') + "-" + Date.now() + "-" + Math.random();
13051
+ };
13052
+ var addProductsToList = function addProductsToList(newProducts) {
13053
+ if (newProducts === void 0) {
13054
+ newProducts = [];
13055
+ }
13056
+ if (!Array.isArray(newProducts)) return;
13057
+ var outOfStockNames = [];
13058
+ var next = [].concat(products || []);
13059
+ var added = [];
13060
+ newProducts.forEach(function (product) {
13061
+ if (!product) return;
13062
+ if (isOutOfStock(product)) {
13063
+ outOfStockNames.push((product === null || product === void 0 ? void 0 : product.productName) || '');
13064
+ return;
13065
+ }
13066
+ var key = getProductKey(product);
13067
+ var addQty = (product === null || product === void 0 ? void 0 : product.quantity) > 0 ? product.quantity : 1;
13068
+ var existing = key !== undefined && key !== null ? next.find(function (p) {
13069
+ return getProductKey(p) === key;
13070
+ }) : undefined;
13071
+ if (existing) {
13072
+ var quantity = checkMinMaxQty({
13073
+ quantity: (Number(existing === null || existing === void 0 ? void 0 : existing.quantity) || 0) + addQty,
13074
+ product: existing,
13075
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce
13076
+ });
13077
+ next = next.map(function (p) {
13078
+ return (p === null || p === void 0 ? void 0 : p.rowId) === (existing === null || existing === void 0 ? void 0 : existing.rowId) ? _extends({}, p, {
13079
+ quantity: quantity
13080
+ }) : p;
13081
+ });
13082
+ } else {
13083
+ var row = _extends({}, product, {
13084
+ quantity: addQty,
13085
+ rowId: makeRowId(product)
13086
+ });
13087
+ added.push(row);
13088
+ next.push(row);
13089
+ }
13090
+ });
13091
+ if (outOfStockNames.length) {
13092
+ alert(outOfStockNames.length === 1 ? "This product is out of stock: " + outOfStockNames[0] : "These products are out of stock:\n" + outOfStockNames.join('\n'));
13093
+ }
13094
+ var addedIds = new Set(added.map(function (p) {
13095
+ return p === null || p === void 0 ? void 0 : p.rowId;
13096
+ }));
13097
+ setProducts([].concat(added.slice().reverse(), next.filter(function (p) {
13098
+ return p && !addedIds.has(p === null || p === void 0 ? void 0 : p.rowId);
13099
+ })));
13100
+ };
12620
13101
  var searchProductAPIData = function searchProductAPIData() {
12621
13102
  return Object.freeze({
12622
13103
  apiEndPoint: apiEndPoint,
12623
13104
  token: token,
12624
- url: "/ecommerce/product/searchByProductOrCategory",
12625
- scanUrl: "/product/scan?storeIds=" + storeIdList,
13105
+ url: "/ecommerce/product/searchByProductOrCategory?storeIds=" + storeId,
13106
+ scanUrl: "/product/scan?storeIds=" + storeId,
12626
13107
  labelKey: function labelKey(option) {
12627
- return option.productName + " " + (option.upc ? "(" + option.upc + ")" : '');
13108
+ return ((option === null || option === void 0 ? void 0 : option.productName) || '') + " " + (option !== null && option !== void 0 && option.upc ? "(" + (option === null || option === void 0 ? void 0 : option.upc) + ")" : '');
12628
13109
  },
12629
13110
  getQueryParams: function getQueryParams(value) {
12630
13111
  var queryParams = {
@@ -12647,46 +13128,157 @@ var QuickOrder = function QuickOrder(_ref) {
12647
13128
  };
12648
13129
  var onUpdate = function onUpdate(searchedProduct, clearInput) {
12649
13130
  try {
12650
- clearInput();
12651
- setProducts([_extends({}, searchedProduct, {
13131
+ clearInput === null || clearInput === void 0 ? void 0 : clearInput();
13132
+ if (!searchedProduct) return Promise.resolve();
13133
+ addProductsToList([_extends({}, searchedProduct, {
12652
13134
  quantity: 1
12653
- })].concat(products));
13135
+ })]);
12654
13136
  return Promise.resolve();
12655
13137
  } catch (e) {
12656
13138
  return Promise.reject(e);
12657
13139
  }
12658
13140
  };
12659
- var handleRemoveProduct = function handleRemoveProduct(data, index) {
12660
- var response = confirm('Are you sure, do you want to delete this items?');
12661
- if (response) {
12662
- var filterProduct = products === null || products === void 0 ? void 0 : products.filter(function (_, i) {
12663
- return i !== index;
13141
+ var handleRemoveProduct = function handleRemoveProduct(data) {
13142
+ var response = confirm('Are you sure, do you want to delete this items?');
13143
+ if (response) {
13144
+ setProducts(function (prev) {
13145
+ return (prev || []).filter(function (p) {
13146
+ return (p === null || p === void 0 ? void 0 : p.rowId) !== (data === null || data === void 0 ? void 0 : data.rowId);
13147
+ });
13148
+ });
13149
+ }
13150
+ };
13151
+ var handleIncrementDecrement = function handleIncrementDecrement(data) {
13152
+ if (!(data !== null && data !== void 0 && data.rowId)) return;
13153
+ setProducts(function (prev) {
13154
+ return (prev || []).map(function (p) {
13155
+ return (p === null || p === void 0 ? void 0 : p.rowId) === (data === null || data === void 0 ? void 0 : data.rowId) ? _extends({}, p, {
13156
+ quantity: data === null || data === void 0 ? void 0 : data.quantity
13157
+ }) : p;
13158
+ });
13159
+ });
13160
+ };
13161
+ var handleAddToCart = function handleAddToCart(selectedIds) {
13162
+ if (selectedIds === void 0) {
13163
+ selectedIds = [];
13164
+ }
13165
+ try {
13166
+ if (typeof onAddToCart !== 'function' || addingToCart) return Promise.resolve();
13167
+ var safeSelectedIds = Array.isArray(selectedIds) ? selectedIds : [];
13168
+ var ids = new Set(safeSelectedIds);
13169
+ var allRows = (products || []).filter(Boolean);
13170
+ var rowsToAdd = safeSelectedIds.length ? allRows.filter(function (p) {
13171
+ return ids.has(p === null || p === void 0 ? void 0 : p.rowId);
13172
+ }) : allRows;
13173
+ var items = rowsToAdd.map(function (_ref2) {
13174
+ var rowId = _ref2.rowId,
13175
+ product = _objectWithoutPropertiesLoose(_ref2, _excluded$7);
13176
+ return product;
13177
+ });
13178
+ if (!items.length) return Promise.resolve();
13179
+ setAddingToCart(true);
13180
+ var _temp = _finallyRethrows(function () {
13181
+ return _catch(function () {
13182
+ return Promise.resolve(onAddToCart(items)).then(function (isAdded) {
13183
+ if (isAdded) {
13184
+ var addedIds = new Set(rowsToAdd.map(function (p) {
13185
+ return p === null || p === void 0 ? void 0 : p.rowId;
13186
+ }));
13187
+ setProducts(function (prev) {
13188
+ return (prev || []).filter(function (p) {
13189
+ return !addedIds.has(p === null || p === void 0 ? void 0 : p.rowId);
13190
+ });
13191
+ });
13192
+ }
13193
+ });
13194
+ }, function () {});
13195
+ }, function (_wasThrown, _result) {
13196
+ setAddingToCart(false);
13197
+ if (_wasThrown) throw _result;
13198
+ return _result;
13199
+ });
13200
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
13201
+ } catch (e) {
13202
+ return Promise.reject(e);
13203
+ }
13204
+ };
13205
+ var handleRemoveAll = function handleRemoveAll(selectedIds) {
13206
+ if (selectedIds === void 0) {
13207
+ selectedIds = [];
13208
+ }
13209
+ if (!Array.isArray(selectedIds) || !selectedIds.length) return;
13210
+ if (confirm("Are you sure you want to remove " + selectedIds.length + " selected item(s)?")) {
13211
+ var ids = new Set(selectedIds);
13212
+ setProducts(function (prev) {
13213
+ return (prev || []).filter(function (p) {
13214
+ return !ids.has(p === null || p === void 0 ? void 0 : p.rowId);
13215
+ });
12664
13216
  });
12665
- setProducts([].concat(filterProduct));
12666
- }
12667
- };
12668
- var handleIncrementDecrement = function handleIncrementDecrement(data) {};
12669
- var handleRemoveAll = function handleRemoveAll(data) {
12670
- if (confirm('Are you sure, do you wan to delete items?')) {
12671
- var _data = lodash.remove(products, function (n) {});
12672
13217
  }
12673
13218
  };
12674
13219
  return /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
12675
- theme: colors
12676
- }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(material.CssBaseline, null), /*#__PURE__*/React__default.createElement(Container$2, null, /*#__PURE__*/React__default.createElement(AsyncSelect, {
13220
+ theme: colors || {
13221
+ primaryColor: '#424242'
13222
+ }
13223
+ }, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(material.CssBaseline, null), /*#__PURE__*/React__default.createElement(Container$2, null, /*#__PURE__*/React__default.createElement(TopBar, null, /*#__PURE__*/React__default.createElement("div", {
13224
+ className: "search"
13225
+ }, /*#__PURE__*/React__default.createElement(AsyncSelect, {
12677
13226
  placeholder: 'Search Product',
12678
13227
  minSearchChar: 3,
12679
13228
  apiData: searchProductAPIData(),
12680
13229
  onUpdate: onUpdate,
12681
13230
  autoFocus: true
12682
- }), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ProductTable, {
13231
+ })), /*#__PURE__*/React__default.createElement(LastOrderedWrapper, null, /*#__PURE__*/React__default.createElement(LastOrderedButton, {
13232
+ type: "button",
13233
+ onClick: handleLastOrderedProducts
13234
+ }, "Last Ordered Products"), /*#__PURE__*/React__default.createElement(material.ClickAwayListener, {
13235
+ onClickAway: function onClickAway() {
13236
+ return setInfoOpen(false);
13237
+ }
13238
+ }, /*#__PURE__*/React__default.createElement(material.Tooltip, {
13239
+ title: "It will show the products from invoices from the last three months.",
13240
+ placement: "top",
13241
+ arrow: true,
13242
+ open: infoOpen,
13243
+ onOpen: function onOpen() {
13244
+ return setInfoOpen(true);
13245
+ },
13246
+ onClose: function onClose() {
13247
+ return setInfoOpen(false);
13248
+ }
13249
+ }, /*#__PURE__*/React__default.createElement(InfoIcon, {
13250
+ role: "button",
13251
+ tabIndex: 0,
13252
+ "aria-label": "Last ordered products info",
13253
+ onClick: function onClick() {
13254
+ return setInfoOpen(function (prev) {
13255
+ return !prev;
13256
+ });
13257
+ }
13258
+ }, /*#__PURE__*/React__default.createElement(ai.AiOutlineInfoCircle, null)))))), (products === null || products === void 0 ? void 0 : products.length) > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ProductTable, {
13259
+ handleAddToCart: handleAddToCart,
13260
+ loading: addingToCart,
12683
13261
  cartData: products,
12684
13262
  imgnotfoundUrl: imgnotfoundUrl,
12685
13263
  styles: styles,
12686
13264
  handleRemoveProduct: handleRemoveProduct,
12687
13265
  handleIncrementDecrement: handleIncrementDecrement,
12688
- handleRemoveAll: handleRemoveAll
12689
- })) : /*#__PURE__*/React__default.createElement(NoData, null))));
13266
+ handleRemoveAll: handleRemoveAll,
13267
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
13268
+ hideStock: hideStock
13269
+ })) : /*#__PURE__*/React__default.createElement(NoData, null), /*#__PURE__*/React__default.createElement(LastOrderedProductsDialog, {
13270
+ open: lastOrderedOpen,
13271
+ onClose: function onClose() {
13272
+ return setLastOrderedOpen(false);
13273
+ },
13274
+ onAdd: addProductsToList,
13275
+ apiEndPoint: apiEndPoint,
13276
+ token: token,
13277
+ imgnotfoundUrl: imgnotfoundUrl,
13278
+ styles: styles,
13279
+ allowToProcessInvoiceForOutOfStockProductsEcommerce: allowToProcessInvoiceForOutOfStockProductsEcommerce,
13280
+ hideStock: hideStock
13281
+ }))));
12690
13282
  };
12691
13283
 
12692
13284
  var RenderTawk = function RenderTawk(_ref) {
@@ -12751,7 +13343,7 @@ var SnowfallComponent = function SnowfallComponent(_ref) {
12751
13343
  }) : null;
12752
13344
  };
12753
13345
 
12754
- var _templateObject$I, _templateObject2$w;
13346
+ var _templateObject$I, _templateObject2$x;
12755
13347
  var ContactUsForm = function ContactUsForm(_ref) {
12756
13348
  var apiEndPoint = _ref.apiEndPoint,
12757
13349
  serviceApiEndPoint = _ref.serviceApiEndPoint,
@@ -12879,7 +13471,7 @@ var ContactUsForm = function ContactUsForm(_ref) {
12879
13471
  var TypographyContainer$8 = styled__default(material.Typography)(_templateObject$I || (_templateObject$I = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n font-size: 1.2rem !important;\n align-items: center;\n"])), function (props) {
12880
13472
  return props.fontColor;
12881
13473
  });
12882
- var RootContainer$3 = styled__default(material.Stack)(_templateObject2$w || (_templateObject2$w = _taggedTemplateLiteralLoose(["\n background-color: ", " !important;\n border-radius: 14px !important;\n padding: 1.3rem;\n margin-bottom: 1rem;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n p {\n margin: 0 !important;\n }\n"])), function (props) {
13474
+ var RootContainer$3 = styled__default(material.Stack)(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n background-color: ", " !important;\n border-radius: 14px !important;\n padding: 1.3rem;\n margin-bottom: 1rem;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n p {\n margin: 0 !important;\n }\n"])), function (props) {
12883
13475
  return props.secondaryColor;
12884
13476
  });
12885
13477
 
@@ -13281,7 +13873,7 @@ var StaticPageList = function StaticPageList(_ref) {
13281
13873
  };
13282
13874
  var TitleContainer$2 = styled__default.div(_templateObject$N || (_templateObject$N = _taggedTemplateLiteralLoose(["\n padding: 1.2rem;\n cursor: pointer;\n color: #323232;\n img {\n max-width: 100%;\n }\n &:hover {\n img {\n transform: scale(1.01);\n }\n }\n"])));
13283
13875
 
13284
- var _excluded$7 = ["userName", "children", "style"];
13876
+ var _excluded$8 = ["userName", "children", "style"];
13285
13877
  var colors$1 = ['#FFB900', '#D83B01', '#B50E0E', '#E81123', '#B4009E', '#5C2D91', '#0078D7', '#00B4FF', '#008272', '#107C10'];
13286
13878
  var getRandomColor = function getRandomColor(userName) {
13287
13879
  return colors$1[(userName === null || userName === void 0 ? void 0 : userName.length) % (colors$1 === null || colors$1 === void 0 ? void 0 : colors$1.length)];
@@ -13300,7 +13892,7 @@ var Avatar = function Avatar(_ref) {
13300
13892
  var userName = _ref.userName,
13301
13893
  children = _ref.children,
13302
13894
  style = _ref.style,
13303
- props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
13895
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
13304
13896
  var backgroundColor = '#1f62ff';
13305
13897
  if (userName) {
13306
13898
  backgroundColor = getRandomColor(userName);
@@ -13315,7 +13907,7 @@ var Avatar = function Avatar(_ref) {
13315
13907
  }));
13316
13908
  };
13317
13909
 
13318
- var _templateObject$O, _templateObject2$x;
13910
+ var _templateObject$O, _templateObject2$y;
13319
13911
  var SwitchUser = function SwitchUser(_ref) {
13320
13912
  var _customerData$filter, _customerData$filter$;
13321
13913
  var apiEndPoint = _ref.apiEndPoint,
@@ -13403,13 +13995,13 @@ var SwitchUser = function SwitchUser(_ref) {
13403
13995
  }))));
13404
13996
  };
13405
13997
  var RootContainer$4 = styled__default.div(_templateObject$O || (_templateObject$O = _taggedTemplateLiteralLoose(["\n margin: auto;\n padding: 2.4rem;\n max-width: 1920px;\n"])));
13406
- var CustomerContainer = styled__default.div(_templateObject2$x || (_templateObject2$x = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n transition: all 0.5s;\n padding: 1.1rem;\n border-radius: 1rem;\n box-shadow: 2px 2px 6px 0px #00000020;\n &:hover {\n transform: scale(1.05);\n }\n .name {\n color: ", ";\n font-size: 2.5rem;\n font-weight: 700;\n }\n .infoDetails {\n font-size: 1.1rem;\n color: #46464680;\n margin: 1rem 0;\n display: flex;\n align-items: center;\n svg {\n color: ", ";\n font-size: 1.5rem;\n margin-right: 0.5rem;\n }\n }\n"])), function (props) {
13998
+ var CustomerContainer = styled__default.div(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n cursor: pointer;\n transition: all 0.5s;\n padding: 1.1rem;\n border-radius: 1rem;\n box-shadow: 2px 2px 6px 0px #00000020;\n &:hover {\n transform: scale(1.05);\n }\n .name {\n color: ", ";\n font-size: 2.5rem;\n font-weight: 700;\n }\n .infoDetails {\n font-size: 1.1rem;\n color: #46464680;\n margin: 1rem 0;\n display: flex;\n align-items: center;\n svg {\n color: ", ";\n font-size: 1.5rem;\n margin-right: 0.5rem;\n }\n }\n"])), function (props) {
13407
13999
  return props.theme.primaryColor || '#000000d9';
13408
14000
  }, function (props) {
13409
14001
  return props.theme.primaryColor || '#000000d9';
13410
14002
  });
13411
14003
 
13412
- var _templateObject$P, _templateObject2$y;
14004
+ var _templateObject$P, _templateObject2$z;
13413
14005
  var ThankYou = function ThankYou(_ref) {
13414
14006
  var _ref$id = _ref.id,
13415
14007
  id = _ref$id === void 0 ? 0 : _ref$id,
@@ -13469,7 +14061,7 @@ var ThankYou = function ThankYou(_ref) {
13469
14061
  }, /*#__PURE__*/React__default.createElement("p", null, "Continue Shopping"))))))));
13470
14062
  };
13471
14063
  var Root$d = styled__default(material.Box)(_templateObject$P || (_templateObject$P = _taggedTemplateLiteralLoose([""])));
13472
- var StyledButton = styled__default.button(_templateObject2$y || (_templateObject2$y = _taggedTemplateLiteralLoose(["\n outline: none;\n border: 1px solid;\n border-color: ", ";\n background: none;\n border-radius: 14px;\n padding: 10px 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background 0.5s ease;\n width: 200px;\n color: ", ";\n text-transform: uppercase;\n &:hover {\n cursor: pointer;\n background: ", ";\n color: #fff;\n }\n"])), function (props) {
14064
+ var StyledButton = styled__default.button(_templateObject2$z || (_templateObject2$z = _taggedTemplateLiteralLoose(["\n outline: none;\n border: 1px solid;\n border-color: ", ";\n background: none;\n border-radius: 14px;\n padding: 10px 20px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n transition: background 0.5s ease;\n width: 200px;\n color: ", ";\n text-transform: uppercase;\n &:hover {\n cursor: pointer;\n background: ", ";\n color: #fff;\n }\n"])), function (props) {
13473
14065
  return props.theme.primaryColor;
13474
14066
  }, function (props) {
13475
14067
  return props.theme.primaryColor;
@@ -13623,38 +14215,38 @@ var DiscountSummaryModal = function DiscountSummaryModal(_ref) {
13623
14215
  }, "Okay"))));
13624
14216
  };
13625
14217
 
13626
- var _templateObject$Q, _templateObject2$z, _templateObject3$q, _templateObject4$l, _templateObject5$h, _templateObject6$f, _templateObject7$b, _templateObject8$9;
14218
+ var _templateObject$Q, _templateObject2$A, _templateObject3$r, _templateObject4$m, _templateObject5$i, _templateObject6$g, _templateObject7$c, _templateObject8$a;
13627
14219
  var CheckoutRootContainer = styled__default.div(_templateObject$Q || (_templateObject$Q = _taggedTemplateLiteralLoose(["\n width: 100%;\n padding: 2rem;\n background-color: ", ";\n font-size: 16px;\n\n div,\n button,\n span {\n font-size: 16px;\n }\n @media only screen and (max-width: 1600px) {\n padding: 3em 0.5em;\n }\n @media screen and (max-width: 900px) {\n div,\n button,\n span {\n font-size: 12px;\n }\n padding: 2rem 0.5rem;\n }\n"])), function (props) {
13628
14220
  return props.bg;
13629
14221
  });
13630
- var CheckoutPageContainer = styled__default.div(_templateObject2$z || (_templateObject2$z = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n background-color: ", ";\n margin: 0 auto;\n padding: 2em;\n padding-left: min(4.5em, 2.5vw);\n color: rgba(50, 50, 50, 1);\n /* max-height: 90vh; */\n overflow: hidden;\n /* background: gainsboro; */\n border-radius: 28px;\n /* background-color: #fff8f6; */\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n max-height: max-content;\n }\n @media only screen and (max-width: 768px) {\n padding: 1em 0.5em;\n }\n .icon {\n font-size: 12px;\n }\n ////////////checkout and cart fonts\n /////////////////\n /* /////remove arrows from number input */\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n input[type='number'] {\n -moz-appearance: textfield;\n }\n\n /* //////mui inputs */\n\n .Mui-checked {\n color: ", ";\n }\n\n .MuiOutlinedInput-notchedOutline {\n border: none;\n outline: none;\n }\n\n .MuiInputBase-root .MuiOutlinedInput-root,\n .MuiInputBase-colorPrimary,\n .MuiInputBase-fullWidth,\n .MuiInputBase-formControl {\n border-radius: 10px;\n }\n // /* /////stepper length */\n .MuiStepConnector-line,\n .MuiStepConnector-lineVertical {\n min-height: 60px !important;\n }\n\n @media only screen and (max-width: 900px) {\n .MuiStepConnector-line,\n .MuiStepConnector-lineVertical {\n min-height: 40px !important;\n }\n }\n"])), function (props) {
14222
+ var CheckoutPageContainer = styled__default.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: ", ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n background-color: ", ";\n margin: 0 auto;\n padding: 2em;\n padding-left: min(4.5em, 2.5vw);\n color: rgba(50, 50, 50, 1);\n /* max-height: 90vh; */\n overflow: hidden;\n /* background: gainsboro; */\n border-radius: 28px;\n /* background-color: #fff8f6; */\n @media only screen and (max-width: 1200px) {\n flex-direction: column;\n align-items: center;\n max-height: max-content;\n }\n @media only screen and (max-width: 768px) {\n padding: 1em 0.5em;\n }\n .icon {\n font-size: 12px;\n }\n ////////////checkout and cart fonts\n /////////////////\n /* /////remove arrows from number input */\n /* Chrome, Safari, Edge, Opera */\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n /* Firefox */\n input[type='number'] {\n -moz-appearance: textfield;\n }\n\n /* //////mui inputs */\n\n .Mui-checked {\n color: ", ";\n }\n\n .MuiOutlinedInput-notchedOutline {\n border: none;\n outline: none;\n }\n\n .MuiInputBase-root .MuiOutlinedInput-root,\n .MuiInputBase-colorPrimary,\n .MuiInputBase-fullWidth,\n .MuiInputBase-formControl {\n border-radius: 10px;\n }\n // /* /////stepper length */\n .MuiStepConnector-line,\n .MuiStepConnector-lineVertical {\n min-height: 60px !important;\n }\n\n @media only screen and (max-width: 900px) {\n .MuiStepConnector-line,\n .MuiStepConnector-lineVertical {\n min-height: 40px !important;\n }\n }\n"])), function (props) {
13631
14223
  return props.maxWidth || '1605px';
13632
14224
  }, function (props) {
13633
14225
  return props.bg || '#fff8f6';
13634
14226
  }, function (props) {
13635
14227
  return props.primaryColor || 'rgba(50, 50, 50, 1)';
13636
14228
  });
13637
- var Row = styled__default.div(_templateObject3$q || (_templateObject3$q = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n"])));
13638
- var CheckoutMainWithHeader = styled__default(material.Stack)(_templateObject4$l || (_templateObject4$l = _taggedTemplateLiteralLoose(["\n width: 100%;\n"])));
13639
- var CheckoutMain = styled__default.div(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 1008px;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n margin-right: 2em;\n max-height: 65vh;\n padding-right: 2em;\n overflow-y: auto;\n position: relative;\n padding-top: 2em;\n padding-bottom: 3em;\n /* width */\n ::-webkit-scrollbar {\n width: 10px;\n background: ", ";\n border-radius: 16px;\n }\n\n /* Track */\n ::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n }\n\n /* Handle */\n ::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n }\n @media only screen and (max-width: 1200px) {\n margin-bottom: 3em;\n min-height: max-content;\n max-height: max-content;\n margin-right: 0;\n overflow: visible;\n }\n @media only screen and (max-width: 768px) {\n // max-width: 100vw;\n padding-right: 0;\n // width: 98vw;\n // min-width: 90vw;\n padding-top: 1em;\n }\n /* overflow: hidden; */\n"])), function (props) {
14229
+ var Row = styled__default.div(_templateObject3$r || (_templateObject3$r = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n"])));
14230
+ var CheckoutMainWithHeader = styled__default(material.Stack)(_templateObject4$m || (_templateObject4$m = _taggedTemplateLiteralLoose(["\n width: 100%;\n"])));
14231
+ var CheckoutMain = styled__default.div(_templateObject5$i || (_templateObject5$i = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 1008px;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n margin-right: 2em;\n max-height: 65vh;\n padding-right: 2em;\n overflow-y: auto;\n position: relative;\n padding-top: 2em;\n padding-bottom: 3em;\n /* width */\n ::-webkit-scrollbar {\n width: 10px;\n background: ", ";\n border-radius: 16px;\n }\n\n /* Track */\n ::-webkit-scrollbar-track {\n background: ", ";\n border-radius: 16px;\n }\n\n /* Handle */\n ::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 16px;\n }\n @media only screen and (max-width: 1200px) {\n margin-bottom: 3em;\n min-height: max-content;\n max-height: max-content;\n margin-right: 0;\n overflow: visible;\n }\n @media only screen and (max-width: 768px) {\n // max-width: 100vw;\n padding-right: 0;\n // width: 98vw;\n // min-width: 90vw;\n padding-top: 1em;\n }\n /* overflow: hidden; */\n"])), function (props) {
13640
14232
  return props.bg || 'rgba(102,112,128,0.5)';
13641
14233
  }, function (props) {
13642
14234
  return props.bg || 'rgba(102,112,128,0.5)';
13643
14235
  }, function (props) {
13644
14236
  return props.color;
13645
14237
  });
13646
- var CheckoutHeading = styled__default.div(_templateObject6$f || (_templateObject6$f = _taggedTemplateLiteralLoose(["\n margin-left: 2.5em;\n margin-bottom: 2em;\n h5 {\n font-size: 2.3em;\n font-weight: 600;\n text-transform: capitalize;\n }\n p {\n font-size: 0.875em;\n margin-top: 0.5em;\n }\n @media only screen and (max-width: 768px) {\n margin-left: 0;\n padding-left: 1em;\n }\n"])));
13647
- var CheckoutHeader = styled__default(Row)(_templateObject7$b || (_templateObject7$b = _taggedTemplateLiteralLoose(["\n width: 100%;\n overflow: auto;\n justify-content: space-around;\n display: flex;\n flex-direction: row;\n align-items: center;\n position: sticky;\n top: 0;\n background-color: white;\n z-index: 1;\n justify-content: flex-start;\n min-height: 4em;\n max-height: 4em;\n max-width: 60em;\n background: #ffffff;\n border-radius: 20px;\n color: #7d7b7b;\n padding: 0 2em;\n margin: 0 2em 1em 1em;\n .row {\n display: flex;\n color: inherit;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n text-transform: capitalize;\n margin-right: 2.4%;\n .icon {\n font-size: 14px;\n font-weight: 400;\n display: grid;\n place-items: center;\n margin-right: 6px;\n color: inherit;\n }\n p,\n span {\n font-size: 0.95em;\n color: inherit;\n }\n }\n .checked {\n p,\n span {\n color: #323232;\n }\n .icon {\n color: #249937;\n }\n }\n @media only screen and (max-width: 1200px) {\n margin-right: 0em;\n }\n @media only screen and (max-width: 768px) {\n width: 100%;\n padding: 2em 1em;\n margin: 1.4em 0;\n .row {\n margin-right: 4.5%;\n p {\n font-size: 12px;\n }\n span {\n display: none;\n }\n }\n }\n"])));
13648
- var CheckoutStepIcon = styled__default.div(_templateObject8$9 || (_templateObject8$9 = _taggedTemplateLiteralLoose(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n font-size: 5px;\n display: grid;\n place-items: center;\n margin: auto;\n padding: 0;\n margin-left: 2px;\n .circle {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n font-size: 5px;\n display: grid;\n place-items: center;\n margin: auto;\n padding: 0;\n }\n .ic {\n font-size: 8px;\n }\n"])));
14238
+ var CheckoutHeading = styled__default.div(_templateObject6$g || (_templateObject6$g = _taggedTemplateLiteralLoose(["\n margin-left: 2.5em;\n margin-bottom: 2em;\n h5 {\n font-size: 2.3em;\n font-weight: 600;\n text-transform: capitalize;\n }\n p {\n font-size: 0.875em;\n margin-top: 0.5em;\n }\n @media only screen and (max-width: 768px) {\n margin-left: 0;\n padding-left: 1em;\n }\n"])));
14239
+ var CheckoutHeader = styled__default(Row)(_templateObject7$c || (_templateObject7$c = _taggedTemplateLiteralLoose(["\n width: 100%;\n overflow: auto;\n justify-content: space-around;\n display: flex;\n flex-direction: row;\n align-items: center;\n position: sticky;\n top: 0;\n background-color: white;\n z-index: 1;\n justify-content: flex-start;\n min-height: 4em;\n max-height: 4em;\n max-width: 60em;\n background: #ffffff;\n border-radius: 20px;\n color: #7d7b7b;\n padding: 0 2em;\n margin: 0 2em 1em 1em;\n .row {\n display: flex;\n color: inherit;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n text-transform: capitalize;\n margin-right: 2.4%;\n .icon {\n font-size: 14px;\n font-weight: 400;\n display: grid;\n place-items: center;\n margin-right: 6px;\n color: inherit;\n }\n p,\n span {\n font-size: 0.95em;\n color: inherit;\n }\n }\n .checked {\n p,\n span {\n color: #323232;\n }\n .icon {\n color: #249937;\n }\n }\n @media only screen and (max-width: 1200px) {\n margin-right: 0em;\n }\n @media only screen and (max-width: 768px) {\n width: 100%;\n padding: 2em 1em;\n margin: 1.4em 0;\n .row {\n margin-right: 4.5%;\n p {\n font-size: 12px;\n }\n span {\n display: none;\n }\n }\n }\n"])));
14240
+ var CheckoutStepIcon = styled__default.div(_templateObject8$a || (_templateObject8$a = _taggedTemplateLiteralLoose(["\n width: 20px;\n height: 20px;\n border-radius: 50%;\n font-size: 5px;\n display: grid;\n place-items: center;\n margin: auto;\n padding: 0;\n margin-left: 2px;\n .circle {\n width: 16px;\n height: 16px;\n border-radius: 50%;\n font-size: 5px;\n display: grid;\n place-items: center;\n margin: auto;\n padding: 0;\n }\n .ic {\n font-size: 8px;\n }\n"])));
13649
14241
 
13650
- var _templateObject$R, _templateObject2$A, _templateObject3$r;
14242
+ var _templateObject$R, _templateObject2$B, _templateObject3$s;
13651
14243
  var CheckoutSummaryContainer = styled__default.div(_templateObject$R || (_templateObject$R = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: ", ";\n border-radius: 20px;\n padding: max(1.5em, 30px);\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n max-width: 25rem;\n min-width: min(25rem, 95%);\n font-size: 16px;\n margin-top: 6.15em;\n @media only screen and (max-width: 1200px) {\n margin-top: 0;\n }\n"])), function (props) {
13652
14244
  return props.bg || 'rgba(255, 240, 236, 1)';
13653
14245
  }, function (props) {
13654
14246
  return props.color || ' rgba(50, 50, 50, 1)';
13655
14247
  });
13656
- var TextRow = styled__default.div(_templateObject2$A || (_templateObject2$A = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 90%;\n margin-bottom: 0.8rem;\n padding-bottom: 0.8rem;\n width: 90%;\n border-bottom: 1px solid #f7f7f7;\n .text {\n font-size: 1.1em;\n text-transform: capitalize;\n }\n .total {\n font-size: 1.65em;\n font-weight: 800;\n }\n"])));
13657
- var FilledInfo = styled__default.div(_templateObject3$r || (_templateObject3$r = _taggedTemplateLiteralLoose(["\n margin-bottom: 2em;\n .heading {\n font-size: 1.25em;\n font-weight: 800;\n margin-bottom: 0.8em;\n }\n\n p {\n font-size: 0.875em;\n text-transform: capitalize;\n max-width: 60%;\n }\n .bold {\n font-weight: 700;\n margin-bottom: 0.8em;\n max-width: 300px;\n width: fit-content;\n }\n .payment {\n width: 70px;\n height: 48px;\n background: #ffffff;\n border-radius: 15.875px;\n display: grid;\n place-items: center;\n overflow: hidden;\n }\n .blank {\n opacity: 0;\n }\n"])));
14248
+ var TextRow = styled__default.div(_templateObject2$B || (_templateObject2$B = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n max-width: 90%;\n margin-bottom: 0.8rem;\n padding-bottom: 0.8rem;\n width: 90%;\n border-bottom: 1px solid #f7f7f7;\n .text {\n font-size: 1.1em;\n text-transform: capitalize;\n }\n .total {\n font-size: 1.65em;\n font-weight: 800;\n }\n"])));
14249
+ var FilledInfo = styled__default.div(_templateObject3$s || (_templateObject3$s = _taggedTemplateLiteralLoose(["\n margin-bottom: 2em;\n .heading {\n font-size: 1.25em;\n font-weight: 800;\n margin-bottom: 0.8em;\n }\n\n p {\n font-size: 0.875em;\n text-transform: capitalize;\n max-width: 60%;\n }\n .bold {\n font-weight: 700;\n margin-bottom: 0.8em;\n max-width: 300px;\n width: fit-content;\n }\n .payment {\n width: 70px;\n height: 48px;\n background: #ffffff;\n border-radius: 15.875px;\n display: grid;\n place-items: center;\n overflow: hidden;\n }\n .blank {\n opacity: 0;\n }\n"])));
13658
14250
 
13659
14251
  var CheckoutSummary = function CheckoutSummary(_ref) {
13660
14252
  var billingInformation = _ref.billingInformation,
@@ -13726,14 +14318,14 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
13726
14318
  }, renderMoney(orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.adjustmentValue))));
13727
14319
  };
13728
14320
 
13729
- var _templateObject$S, _templateObject2$B, _templateObject3$s, _templateObject4$m, _templateObject5$i, _templateObject6$g, _templateObject7$c, _templateObject8$a, _templateObject9$7, _templateObject10$5, _templateObject11$4, _templateObject12$3, _templateObject13$3, _templateObject14$3, _templateObject15$3, _templateObject16$3, _templateObject17$3, _templateObject18$3;
14321
+ var _templateObject$S, _templateObject2$C, _templateObject3$t, _templateObject4$n, _templateObject5$j, _templateObject6$h, _templateObject7$d, _templateObject8$b, _templateObject9$7, _templateObject10$6, _templateObject11$4, _templateObject12$3, _templateObject13$3, _templateObject14$3, _templateObject15$3, _templateObject16$3, _templateObject17$3, _templateObject18$3;
13730
14322
  var StepContainer = styled__default.div(_templateObject$S || (_templateObject$S = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 60em;\n background: white;\n padding: 1em 2em;\n background: #ffffff;\n border-radius: 20px;\n margin-left: 2em;\n margin-top: -2em;\n margin-bottom: 1em;\n // @media screen and (max-width: 1200px) {\n // width: 80vw;\n // min-width: 0;\n // }\n @media screen and (max-width: 768px) {\n // width: 96%;\n margin-left: 1em;\n padding: 0.8em;\n }\n @media screen and (max-width: 600px) {\n // width: 94%;\n margin-left: 1.2em;\n }\n"])));
13731
- var StepsContent = styled__default.div(_templateObject2$B || (_templateObject2$B = _taggedTemplateLiteralLoose(["\n padding-left: 1.565em;\n min-height: max-content;\n .MuiOutlinedInput-root {\n background: ", ";\n }\n\n p {\n font-size: 0.75em;\n }\n .bold {\n text-transform: uppercase;\n word-spacing: 5px;\n margin-top: 0.95em;\n span {\n font-weight: 600;\n cursor: pointer;\n font-size: 0.94rem;\n }\n .red {\n color: ", ";\n }\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n width: 100%;\n }\n"])), function (props) {
14323
+ var StepsContent = styled__default.div(_templateObject2$C || (_templateObject2$C = _taggedTemplateLiteralLoose(["\n padding-left: 1.565em;\n min-height: max-content;\n .MuiOutlinedInput-root {\n background: ", ";\n }\n\n p {\n font-size: 0.75em;\n }\n .bold {\n text-transform: uppercase;\n word-spacing: 5px;\n margin-top: 0.95em;\n span {\n font-weight: 600;\n cursor: pointer;\n font-size: 0.94rem;\n }\n .red {\n color: ", ";\n }\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n width: 100%;\n }\n"])), function (props) {
13732
14324
  return 'transparent' + '!important';
13733
14325
  }, function (props) {
13734
14326
  return props.bg || 'red';
13735
14327
  });
13736
- var StepsHeaderContainer = styled__default.div(_templateObject3$s || (_templateObject3$s = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n color: #323232;\n /* padding: ", "; */\n margin-bottom: ", ";\n margin-top: ", ";\n margin-left: ", ";\n /* color: grey; */\n border-bottom: 1px solid #f6f6f6;\n background: #ffffff;\n border-radius: 20px;\n // max-width: 900px;\n min-height: 4.35em;\n max-height: 4.35em;\n padding: ", ";\n h5 {\n font-size: 16px;\n font-weight: 600;\n text-transform: capitalize;\n margin-left: 0.6em;\n }\n .icon {\n font-size: 1.3em;\n margin-right: 8px;\n }\n .dropIcon {\n font-size: 1.4em;\n cursor: pointer;\n transform: rotate(-90deg);\n transition: 0.3s;\n color: rgba(50, 50, 50, 0.75);\n cursor: ", ";\n }\n .red {\n font-weight: 600;\n color: #fd0015;\n font-size: inherit;\n }\n @media screen and (max-width: 768px) {\n max-width: 97%;\n margin-left: 0.5em;\n padding-right: 1em;\n h5 {\n font-size: 12px;\n }\n }\n"])), function (props) {
14328
+ var StepsHeaderContainer = styled__default.div(_templateObject3$t || (_templateObject3$t = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n color: #323232;\n /* padding: ", "; */\n margin-bottom: ", ";\n margin-top: ", ";\n margin-left: ", ";\n /* color: grey; */\n border-bottom: 1px solid #f6f6f6;\n background: #ffffff;\n border-radius: 20px;\n // max-width: 900px;\n min-height: 4.35em;\n max-height: 4.35em;\n padding: ", ";\n h5 {\n font-size: 16px;\n font-weight: 600;\n text-transform: capitalize;\n margin-left: 0.6em;\n }\n .icon {\n font-size: 1.3em;\n margin-right: 8px;\n }\n .dropIcon {\n font-size: 1.4em;\n cursor: pointer;\n transform: rotate(-90deg);\n transition: 0.3s;\n color: rgba(50, 50, 50, 0.75);\n cursor: ", ";\n }\n .red {\n font-weight: 600;\n color: #fd0015;\n font-size: inherit;\n }\n @media screen and (max-width: 768px) {\n max-width: 97%;\n margin-left: 0.5em;\n padding-right: 1em;\n h5 {\n font-size: 12px;\n }\n }\n"])), function (props) {
13737
14329
  return props.single ? '1.8em 2em' : '1em 0';
13738
14330
  }, function (props) {
13739
14331
  return props.single ? '-1.56em' : '1em';
@@ -13746,11 +14338,11 @@ var StepsHeaderContainer = styled__default.div(_templateObject3$s || (_templateO
13746
14338
  }, function (props) {
13747
14339
  return props.username ? 'not-allowed' : 'pointer';
13748
14340
  });
13749
- var TextFeildContainer = styled__default.div(_templateObject4$m || (_templateObject4$m = _taggedTemplateLiteralLoose(["\n label {\n color: rgba(107, 106, 106, 0.6) !important;\n }\n background: ", ";\n border-radius: 10px;\n && {\n input {\n font-size: 0.875em !important;\n color: black;\n &::placeholder {\n font-size: 0.975em !important;\n }\n }\n .icon {\n color: black;\n font-size: 1em;\n }\n }\n"])), function (props) {
14341
+ var TextFeildContainer = styled__default.div(_templateObject4$n || (_templateObject4$n = _taggedTemplateLiteralLoose(["\n label {\n color: rgba(107, 106, 106, 0.6) !important;\n }\n background: ", ";\n border-radius: 10px;\n && {\n input {\n font-size: 0.875em !important;\n color: black;\n &::placeholder {\n font-size: 0.975em !important;\n }\n }\n .icon {\n color: black;\n font-size: 1em;\n }\n }\n"])), function (props) {
13750
14342
  var _props$theme, _props$theme$input;
13751
14343
  return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : (_props$theme$input = _props$theme.input) === null || _props$theme$input === void 0 ? void 0 : _props$theme$input.bg) || 'transparent';
13752
14344
  });
13753
- var CommonCheckoutBtn = styled__default.button(_templateObject5$i || (_templateObject5$i = _taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n width: ", ";\n height: ", ";\n background: ", ";\n display: grid;\n place-items: center;\n color: white;\n margin: 0 1em;\n font-weight: 500;\n letter-spacing: 1px;\n text-transform: ", ";\n transition: 0.4s;\n cursor: ", ";\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n"])), function (props) {
14345
+ var CommonCheckoutBtn = styled__default.button(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n width: ", ";\n height: ", ";\n background: ", ";\n display: grid;\n place-items: center;\n color: white;\n margin: 0 1em;\n font-weight: 500;\n letter-spacing: 1px;\n text-transform: ", ";\n transition: 0.4s;\n cursor: ", ";\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n"])), function (props) {
13754
14346
  return props.width || '8.05em';
13755
14347
  }, function (props) {
13756
14348
  return props.height || '2.25em';
@@ -13763,7 +14355,7 @@ var CommonCheckoutBtn = styled__default.button(_templateObject5$i || (_templateO
13763
14355
  });
13764
14356
  var Select = styled__default.div.attrs({
13765
14357
  className: 'checkout-input'
13766
- })(_templateObject6$g || (_templateObject6$g = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 54px;\n border-radius: 10px;\n background: ", ";\n outline: none;\n border: none;\n padding: 0 1em;\n cursor: pointer;\n select {\n width: 100%;\n height: 100%;\n border: none;\n outline: none;\n padding: 0.5em 0;\n color: rgba(107, 106, 106, 0.6);\n background: ", ";\n }\n"])), function (props) {
14358
+ })(_templateObject6$h || (_templateObject6$h = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 54px;\n border-radius: 10px;\n background: ", ";\n outline: none;\n border: none;\n padding: 0 1em;\n cursor: pointer;\n select {\n width: 100%;\n height: 100%;\n border: none;\n outline: none;\n padding: 0.5em 0;\n color: rgba(107, 106, 106, 0.6);\n background: ", ";\n }\n"])), function (props) {
13767
14359
  var _props$theme2, _props$theme2$input;
13768
14360
  return ((_props$theme2 = props.theme) === null || _props$theme2 === void 0 ? void 0 : (_props$theme2$input = _props$theme2.input) === null || _props$theme2$input === void 0 ? void 0 : _props$theme2$input.bg) || 'transparent';
13769
14361
  }, function (props) {
@@ -13771,12 +14363,12 @@ var Select = styled__default.div.attrs({
13771
14363
  });
13772
14364
  var SaveButton = styled__default.button.attrs({
13773
14365
  className: 'checkout-btn'
13774
- })(_templateObject7$c || (_templateObject7$c = _taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n font-size: 0.8125em;\n text-transform: uppercase;\n font-weight: 600;\n border-radius: 7px;\n padding: 0.55em 1em;\n background: ", ";\n display: grid;\n place-items: center;\n color: white;\n margin: 1em 0;\n letter-spacing: 1px;\n transition: 0.4s;\n cursor: ", ";\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n"])), function (props) {
14366
+ })(_templateObject7$d || (_templateObject7$d = _taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n font-size: 0.8125em;\n text-transform: uppercase;\n font-weight: 600;\n border-radius: 7px;\n padding: 0.55em 1em;\n background: ", ";\n display: grid;\n place-items: center;\n color: white;\n margin: 1em 0;\n letter-spacing: 1px;\n transition: 0.4s;\n cursor: ", ";\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n"])), function (props) {
13775
14367
  return props.color || '#FD0015';
13776
14368
  }, function (props) {
13777
14369
  return props.disabled ? 'not-allowed' : 'pointer';
13778
14370
  });
13779
- var ButtonRowContainer = styled__default.div(_templateObject8$a || (_templateObject8$a = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n button {\n width: 4.862em;\n height: 1.96em;\n border-radius: 0.43em;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n letter-spacing: 1px;\n color: white;\n opacity: ", ";\n background-color: ", ";\n border: 2px solid\n ", ";\n cursor: ", ";\n }\n .back {\n font-size: 0.875em;\n font-weight: 500;\n justify-content: flex-start;\n margin-right: 0.2em;\n color: #323232;\n background: transparent;\n border: none;\n cursor: ", ";\n font-size: 0.8em;\n transition: 0.4s;\n opacity: 1;\n .icon {\n font-size: 1.2em;\n margin-right: 2px;\n }\n &:hover,\n &:focus {\n letter-spacing: 1px;\n outline: none;\n }\n }\n"])), function (props) {
14371
+ var ButtonRowContainer = styled__default.div(_templateObject8$b || (_templateObject8$b = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n button {\n width: 4.862em;\n height: 1.96em;\n border-radius: 0.43em;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n letter-spacing: 1px;\n color: white;\n opacity: ", ";\n background-color: ", ";\n border: 2px solid\n ", ";\n cursor: ", ";\n }\n .back {\n font-size: 0.875em;\n font-weight: 500;\n justify-content: flex-start;\n margin-right: 0.2em;\n color: #323232;\n background: transparent;\n border: none;\n cursor: ", ";\n font-size: 0.8em;\n transition: 0.4s;\n opacity: 1;\n .icon {\n font-size: 1.2em;\n margin-right: 2px;\n }\n &:hover,\n &:focus {\n letter-spacing: 1px;\n outline: none;\n }\n }\n"])), function (props) {
13780
14372
  return props.disabledNext && '0.5';
13781
14373
  }, function (props) {
13782
14374
  return props.color || '#fd0015';
@@ -13798,7 +14390,7 @@ var CheckBoxRow = styled__default.div(_templateObject9$7 || (_templateObject9$7
13798
14390
  }, function (prop) {
13799
14391
  return prop.colorText || 'red';
13800
14392
  });
13801
- var CreditCardFextField = styled__default.div(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteralLoose(["\n label {\n color: rgba(107, 106, 106, 0.6) !important;\n }\n .MuiOutlinedInput-root {\n background: ", ";\n }\n .save-btn {\n background: ", ";\n }\n"])), function (prop) {
14393
+ var CreditCardFextField = styled__default.div(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n label {\n color: rgba(107, 106, 106, 0.6) !important;\n }\n .MuiOutlinedInput-root {\n background: ", ";\n }\n .save-btn {\n background: ", ";\n }\n"])), function (prop) {
13802
14394
  return prop.bgInput + '!important' || '';
13803
14395
  }, function (prop) {
13804
14396
  return prop.btnBg + '!important' || '';
@@ -15300,7 +15892,7 @@ var erSessionStorage = {
15300
15892
  }
15301
15893
  };
15302
15894
 
15303
- var _templateObject$T, _templateObject2$C;
15895
+ var _templateObject$T, _templateObject2$D;
15304
15896
  var ConsentForm = function ConsentForm(_ref) {
15305
15897
  var apiEndPoint = _ref.apiEndPoint,
15306
15898
  token = _ref.token,
@@ -15479,7 +16071,7 @@ var InfoItem = function InfoItem(_ref3) {
15479
16071
  item: true
15480
16072
  }, /*#__PURE__*/React__default.createElement("p", null, value))));
15481
16073
  };
15482
- var InfoItemContainer = styled__default.div(_templateObject2$C || (_templateObject2$C = _taggedTemplateLiteralLoose(["\n background: #00000010;\n padding: 0.5rem;\n"])));
16074
+ var InfoItemContainer = styled__default.div(_templateObject2$D || (_templateObject2$D = _taggedTemplateLiteralLoose(["\n background: #00000010;\n padding: 0.5rem;\n"])));
15483
16075
 
15484
16076
  var PaypalComponent = function PaypalComponent(_ref) {
15485
16077
  var apiEndPoint = _ref.apiEndPoint,
@@ -16868,7 +17460,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref9) {
16868
17460
  }, props)));
16869
17461
  };
16870
17462
 
16871
- var _templateObject$U, _templateObject2$D, _templateObject3$t;
17463
+ var _templateObject$U, _templateObject2$E, _templateObject3$u;
16872
17464
  var columns$1 = [{
16873
17465
  id: 'id',
16874
17466
  label: 'Id',
@@ -16984,10 +17576,10 @@ var PurchaseOrderList = function PurchaseOrderList(_ref) {
16984
17576
  })));
16985
17577
  };
16986
17578
  var TableContainer$3 = styled__default.div(_templateObject$U || (_templateObject$U = _taggedTemplateLiteralLoose(["\n margin: 0.5rem;\n border-radius: 14px;\n"])));
16987
- var TypographyContainer$9 = styled__default(material.Typography)(_templateObject2$D || (_templateObject2$D = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
17579
+ var TypographyContainer$9 = styled__default(material.Typography)(_templateObject2$E || (_templateObject2$E = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
16988
17580
  return props.fontColor;
16989
17581
  });
16990
- var TitleContainer$3 = styled__default.h4(_templateObject3$t || (_templateObject3$t = _taggedTemplateLiteralLoose(["\n font-size: 2.7rem;\n span {\n color: '#000';\n font-weight: 500;\n }\n b {\n color: ", ";\n }\n @media only screen and (max-width: 608px) {\n font-size: 2.2rem;\n }\n"])), function (props) {
17582
+ var TitleContainer$3 = styled__default.h4(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n font-size: 2.7rem;\n span {\n color: '#000';\n font-weight: 500;\n }\n b {\n color: ", ";\n }\n @media only screen and (max-width: 608px) {\n font-size: 2.2rem;\n }\n"])), function (props) {
16991
17583
  return props.primaryColor;
16992
17584
  });
16993
17585
 
@@ -17558,7 +18150,7 @@ var VendorInventory = function VendorInventory(_ref) {
17558
18150
  })));
17559
18151
  };
17560
18152
 
17561
- var _templateObject$V, _templateObject2$E, _templateObject3$u, _templateObject4$n, _templateObject5$j, _templateObject6$h, _templateObject7$d, _templateObject8$b;
18153
+ var _templateObject$V, _templateObject2$F, _templateObject3$v, _templateObject4$o, _templateObject5$k, _templateObject6$i, _templateObject7$e, _templateObject8$c;
17562
18154
  var VendorLogin = function VendorLogin(_ref) {
17563
18155
  var primaryColor = _ref.primaryColor,
17564
18156
  API_BASE_URL = _ref.API_BASE_URL;
@@ -17665,15 +18257,15 @@ var VendorLogin = function VendorLogin(_ref) {
17665
18257
  }) : 'sign in'))))));
17666
18258
  };
17667
18259
  var Container$3 = styled__default.div(_templateObject$V || (_templateObject$V = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: rgb(255, 255, 255);\n font-size: 16px !important;\n padding: 1rem;\n @media only screen and (max-width: 640px) {\n font-size: 14px !important;\n }\n"])));
17668
- var StyledLogin = styled__default.div(_templateObject2$E || (_templateObject2$E = _taggedTemplateLiteralLoose(["\n height: 70%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 1em;\n align-items: center;\n"])));
17669
- var StyledCard = styled__default(material.Card)(_templateObject3$u || (_templateObject3$u = _taggedTemplateLiteralLoose(["\n width: min(100%, 489px);\n height: 100%;\n max-height: 450px;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid #cac8c8;\n flex-direction: column;\n background: white;\n // min-height: 500px;\n h4 {\n font-size: 1.5em;\n margin-bottom: 1em;\n margin-top: -2em;\n text-transform: uppercase;\n font-weight: 500;\n }\n button {\n text-transform: capitalize;\n letter-spacing: 1px;\n font-size: 1em;\n font-weight: 500;\n }\n"])));
17670
- var H1 = styled__default(material.Typography)(_templateObject4$n || (_templateObject4$n = _taggedTemplateLiteralLoose(["\n margin-top: 1rem;\n"])));
17671
- var StyleInputBx = styled__default.div(_templateObject5$j || (_templateObject5$j = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgb(202, 200, 200);\n // padding:.5em;\n min-width: min(80vw, 360px);\n // border-radius: 20px;\n overflow: hidden;\n margin: 0.6em 0;\n // padding:.2em 0;\n .icon {\n border-right: 1px solid rgb(202, 200, 200);\n height: 100%;\n padding: 1em;\n display: grid;\n place-items: center;\n width: 15%;\n box-sizing: border-box;\n color: grey;\n }\n input {\n width: 85%;\n height: 100%;\n outline: none;\n padding: 0 1em;\n font-size: 1.1em;\n border: none;\n &:focus,\n &:hover {\n outline: none !important;\n }\n }\n"])));
17672
- var ShowPassBtn = styled__default.span(_templateObject6$h || (_templateObject6$h = _taggedTemplateLiteralLoose(["\n padding-right: 0.4em;\n display: grid;\n place-items: center;\n font-size: 25px;\n color: grey;\n cursor: pointer;\n"])));
17673
- var ButtonContianer = styled__default.span(_templateObject7$d || (_templateObject7$d = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 360px;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n // @include flexRow(space-between);\n margin-top: 1em;\n @media only screen and (max-width: 640px) {\n padding: 0 1em;\n }\n"])));
17674
- var StyledButton$1 = styled__default(material.Button)(_templateObject8$b || (_templateObject8$b = _taggedTemplateLiteralLoose(["\n width: 100px;\n height: 46px;\n box-sizing: border-box;\n\n span {\n padding: 0.5em;\n }\n @media only screen and (max-width: 640px) {\n height: 35px;\n }\n"])));
18260
+ var StyledLogin = styled__default.div(_templateObject2$F || (_templateObject2$F = _taggedTemplateLiteralLoose(["\n height: 70%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 1em;\n align-items: center;\n"])));
18261
+ var StyledCard = styled__default(material.Card)(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n width: min(100%, 489px);\n height: 100%;\n max-height: 450px;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 1px solid #cac8c8;\n flex-direction: column;\n background: white;\n // min-height: 500px;\n h4 {\n font-size: 1.5em;\n margin-bottom: 1em;\n margin-top: -2em;\n text-transform: uppercase;\n font-weight: 500;\n }\n button {\n text-transform: capitalize;\n letter-spacing: 1px;\n font-size: 1em;\n font-weight: 500;\n }\n"])));
18262
+ var H1 = styled__default(material.Typography)(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n margin-top: 1rem;\n"])));
18263
+ var StyleInputBx = styled__default.div(_templateObject5$k || (_templateObject5$k = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n align-items: center;\n border: 1px solid rgb(202, 200, 200);\n // padding:.5em;\n min-width: min(80vw, 360px);\n // border-radius: 20px;\n overflow: hidden;\n margin: 0.6em 0;\n // padding:.2em 0;\n .icon {\n border-right: 1px solid rgb(202, 200, 200);\n height: 100%;\n padding: 1em;\n display: grid;\n place-items: center;\n width: 15%;\n box-sizing: border-box;\n color: grey;\n }\n input {\n width: 85%;\n height: 100%;\n outline: none;\n padding: 0 1em;\n font-size: 1.1em;\n border: none;\n &:focus,\n &:hover {\n outline: none !important;\n }\n }\n"])));
18264
+ var ShowPassBtn = styled__default.span(_templateObject6$i || (_templateObject6$i = _taggedTemplateLiteralLoose(["\n padding-right: 0.4em;\n display: grid;\n place-items: center;\n font-size: 25px;\n color: grey;\n cursor: pointer;\n"])));
18265
+ var ButtonContianer = styled__default.span(_templateObject7$e || (_templateObject7$e = _taggedTemplateLiteralLoose(["\n width: 100%;\n max-width: 360px;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n // @include flexRow(space-between);\n margin-top: 1em;\n @media only screen and (max-width: 640px) {\n padding: 0 1em;\n }\n"])));
18266
+ var StyledButton$1 = styled__default(material.Button)(_templateObject8$c || (_templateObject8$c = _taggedTemplateLiteralLoose(["\n width: 100px;\n height: 46px;\n box-sizing: border-box;\n\n span {\n padding: 0.5em;\n }\n @media only screen and (max-width: 640px) {\n height: 35px;\n }\n"])));
17675
18267
 
17676
- var _templateObject$W, _templateObject2$F, _templateObject3$v, _templateObject4$o;
18268
+ var _templateObject$W, _templateObject2$G, _templateObject3$w, _templateObject4$p;
17677
18269
  var menuItems = [{
17678
18270
  name: 'My Account',
17679
18271
  Icon: ri.RiAccountBoxLine,
@@ -17882,7 +18474,7 @@ var VendorAccountDetails = function VendorAccountDetails(_ref) {
17882
18474
  }) : /*#__PURE__*/React__default.createElement(React.Fragment, null, API_BASE_URL && token && renderListItemComponent(tabValue)))))));
17883
18475
  };
17884
18476
  var Root$e = styled__default(material.Box)(_templateObject$W || (_templateObject$W = _taggedTemplateLiteralLoose(["\n padding: 1.4rem;\n background-color: #fff;\n @media only screen and (max-width: 608px) {\n padding: 0.5rem;\n }\n"])));
17885
- var MainContainer$4 = styled__default.div(_templateObject2$F || (_templateObject2$F = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n margin: auto;\n min-height: 100vh;\n background-color: #fff;\n max-width: ", ";\n padding: 2rem;\n border-radius: 14px;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n @media only screen and (max-width: 608px) {\n padding: 0.5rem;\n }\n"])), function (props) {
18477
+ var MainContainer$4 = styled__default.div(_templateObject2$G || (_templateObject2$G = _taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n margin: auto;\n min-height: 100vh;\n background-color: #fff;\n max-width: ", ";\n padding: 2rem;\n border-radius: 14px;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n @media only screen and (max-width: 608px) {\n padding: 0.5rem;\n }\n"])), function (props) {
17886
18478
  return props.open ? '1800px' : '1600px';
17887
18479
  });
17888
18480
  var Main$1 = styles.styled('main', {
@@ -17915,12 +18507,12 @@ var Main$1 = styles.styled('main', {
17915
18507
  overflow: 'auto'
17916
18508
  });
17917
18509
  });
17918
- var ContainerDrawer$1 = styled__default(material.Drawer)(_templateObject3$v || (_templateObject3$v = _taggedTemplateLiteralLoose(["\n // height: 100%;\n margin-right: ", ";\n .MuiDrawer-paper {\n padding: 1rem;\n position: relative;\n z-index: 1;\n background: ", ";\n border-radius: 14px;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n }\n"])), function (props) {
18510
+ var ContainerDrawer$1 = styled__default(material.Drawer)(_templateObject3$w || (_templateObject3$w = _taggedTemplateLiteralLoose(["\n // height: 100%;\n margin-right: ", ";\n .MuiDrawer-paper {\n padding: 1rem;\n position: relative;\n z-index: 1;\n background: ", ";\n border-radius: 14px;\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 8px 0px;\n }\n"])), function (props) {
17919
18511
  return props.open && '2rem';
17920
18512
  }, function (props) {
17921
18513
  return props.primaryColor || transparent;
17922
18514
  });
17923
- var TypographyContainer$a = styled__default(material.Typography)(_templateObject4$o || (_templateObject4$o = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
18515
+ var TypographyContainer$a = styled__default(material.Typography)(_templateObject4$p || (_templateObject4$p = _taggedTemplateLiteralLoose(["\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
17924
18516
  return props.fontColor;
17925
18517
  });
17926
18518
 
@@ -18286,7 +18878,7 @@ var ReStockedItem = function ReStockedItem(_ref) {
18286
18878
  })))))));
18287
18879
  };
18288
18880
 
18289
- var _excluded$8 = ["children", "value", "index"];
18881
+ var _excluded$9 = ["children", "value", "index"];
18290
18882
  var NewArrivalPage = function NewArrivalPage(_ref) {
18291
18883
  var apiEndPoint = _ref.apiEndPoint,
18292
18884
  token = _ref.token,
@@ -18394,7 +18986,7 @@ function CustomTabPanel(props) {
18394
18986
  var children = props.children,
18395
18987
  value = props.value,
18396
18988
  index = props.index,
18397
- other = _objectWithoutPropertiesLoose(props, _excluded$8);
18989
+ other = _objectWithoutPropertiesLoose(props, _excluded$9);
18398
18990
  return /*#__PURE__*/React__default.createElement("div", _extends({
18399
18991
  role: "tabpanel",
18400
18992
  hidden: value !== index,
@@ -18536,17 +19128,17 @@ var moveToCart = function moveToCart(_ref3) {
18536
19128
  }
18537
19129
  };
18538
19130
 
18539
- var _templateObject$Y, _templateObject2$G, _templateObject3$w, _templateObject4$p, _templateObject5$k, _templateObject6$i, _templateObject7$e, _templateObject8$c, _templateObject9$8, _templateObject10$6, _templateObject11$5;
19131
+ var _templateObject$Y, _templateObject2$H, _templateObject3$x, _templateObject4$q, _templateObject5$l, _templateObject6$j, _templateObject7$f, _templateObject8$d, _templateObject9$8, _templateObject10$7, _templateObject11$5;
18540
19132
  var EmptyStateText = styled__default.p(_templateObject$Y || (_templateObject$Y = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n color: #4b4b4b;\n margin: 16px 0;\n"])));
18541
- var ProductCardWrapper = styled__default.div(_templateObject2$G || (_templateObject2$G = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: #ffffff;\n border: 1px solid #d3d3d3;\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 10px;\n gap: 10px;\n cursor: pointer;\n"])));
18542
- var TopBar = styled__default.div(_templateObject3$w || (_templateObject3$w = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n"])));
18543
- var SearchWrapper = styled__default(material.Box)(_templateObject4$p || (_templateObject4$p = _taggedTemplateLiteralLoose(["\n && {\n margin-bottom: 24px;\n max-width: 400px;\n width: 100%;\n }\n"])));
18544
- var TotalItemsText = styled__default.div(_templateObject5$k || (_templateObject5$k = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n font-weight: 500;\n color: #4b4b4b;\n margin-bottom: 24px;\n white-space: nowrap;\n"])));
18545
- var DeleteButton = styled__default.button(_templateObject6$i || (_templateObject6$i = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 8px;\n opacity: 1;\n pointer-events: auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background-color: #ffffff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n color: #ff0000;\n"])));
18546
- var PriceContainer = styled__default.div(_templateObject7$e || (_templateObject7$e = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
18547
- var DiscountPriceRow = styled__default.div(_templateObject8$c || (_templateObject8$c = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
19133
+ var ProductCardWrapper = styled__default.div(_templateObject2$H || (_templateObject2$H = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: #ffffff;\n border: 1px solid #d3d3d3;\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 10px;\n gap: 10px;\n cursor: pointer;\n"])));
19134
+ var TopBar$1 = styled__default.div(_templateObject3$x || (_templateObject3$x = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n"])));
19135
+ var SearchWrapper = styled__default(material.Box)(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n && {\n margin-bottom: 24px;\n max-width: 400px;\n width: 100%;\n }\n"])));
19136
+ var TotalItemsText = styled__default.div(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n font-weight: 500;\n color: #4b4b4b;\n margin-bottom: 24px;\n white-space: nowrap;\n"])));
19137
+ var DeleteButton = styled__default.button(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 8px;\n opacity: 1;\n pointer-events: auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background-color: #ffffff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n color: #ff0000;\n"])));
19138
+ var PriceContainer = styled__default.div(_templateObject7$f || (_templateObject7$f = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
19139
+ var DiscountPriceRow = styled__default.div(_templateObject8$d || (_templateObject8$d = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
18548
19140
  var ProductName$2 = styled__default.div(_templateObject9$8 || (_templateObject9$8 = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n font-weight: 500;\n color: #000000;\n text-align: center;\n height: 40px;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n"])));
18549
- var ProductActionButton = styled__default(material.Button)(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n && {\n background-color: ", ";\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])), function (_ref) {
19141
+ var ProductActionButton = styled__default(material.Button)(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n && {\n background-color: ", ";\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])), function (_ref) {
18550
19142
  var primaryColor = _ref.primaryColor;
18551
19143
  return primaryColor != null ? primaryColor : '#000000';
18552
19144
  });
@@ -18616,7 +19208,7 @@ var WishlistContent = function WishlistContent(_ref) {
18616
19208
  width: '100%',
18617
19209
  height: '100%'
18618
19210
  }
18619
- }, /*#__PURE__*/React__default.createElement(TopBar, {
19211
+ }, /*#__PURE__*/React__default.createElement(TopBar$1, {
18620
19212
  style: getStyleOverride(styleOverrides, 'topBar', 'TopBar')
18621
19213
  }, /*#__PURE__*/React__default.createElement(SearchWrapper, {
18622
19214
  style: getStyleOverride(styleOverrides, 'searchWrapper', 'SearchWrapper')
@@ -19026,17 +19618,17 @@ var moveToCartFromFavoriteItems = function moveToCartFromFavoriteItems(_ref3) {
19026
19618
  }
19027
19619
  };
19028
19620
 
19029
- var _templateObject$Z, _templateObject2$H, _templateObject3$x, _templateObject4$q, _templateObject5$l, _templateObject6$j, _templateObject7$f, _templateObject8$d, _templateObject9$9, _templateObject10$7, _templateObject11$6;
19621
+ var _templateObject$Z, _templateObject2$I, _templateObject3$y, _templateObject4$r, _templateObject5$m, _templateObject6$k, _templateObject7$g, _templateObject8$e, _templateObject9$9, _templateObject10$8, _templateObject11$6;
19030
19622
  var EmptyStateText$1 = styled__default.p(_templateObject$Z || (_templateObject$Z = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n color: #4b4b4b;\n margin: 16px 0;\n"])));
19031
- var ProductCardWrapper$1 = styled__default.div(_templateObject2$H || (_templateObject2$H = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: #ffffff;\n border: 1px solid #d3d3d3;\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 10px;\n gap: 10px;\n cursor: pointer;\n"])));
19032
- var TopBar$1 = styled__default.div(_templateObject3$x || (_templateObject3$x = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n"])));
19033
- var SearchWrapper$1 = styled__default(material.Box)(_templateObject4$q || (_templateObject4$q = _taggedTemplateLiteralLoose(["\n && {\n margin-bottom: 24px;\n max-width: 400px;\n width: 100%;\n }\n"])));
19034
- var TotalItemsText$1 = styled__default.div(_templateObject5$l || (_templateObject5$l = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n font-weight: 500;\n color: #4b4b4b;\n margin-bottom: 24px;\n white-space: nowrap;\n"])));
19035
- var DeleteButton$1 = styled__default.button(_templateObject6$j || (_templateObject6$j = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 8px;\n opacity: 1;\n pointer-events: auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background-color: #ffffff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n color: #ff0000;\n"])));
19036
- var PriceContainer$1 = styled__default.div(_templateObject7$f || (_templateObject7$f = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
19037
- var DiscountPriceRow$1 = styled__default.div(_templateObject8$d || (_templateObject8$d = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
19623
+ var ProductCardWrapper$1 = styled__default.div(_templateObject2$I || (_templateObject2$I = _taggedTemplateLiteralLoose(["\n position: relative;\n background-color: #ffffff;\n border: 1px solid #d3d3d3;\n border-radius: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n padding: 10px;\n gap: 10px;\n cursor: pointer;\n"])));
19624
+ var TopBar$2 = styled__default.div(_templateObject3$y || (_templateObject3$y = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n"])));
19625
+ var SearchWrapper$1 = styled__default(material.Box)(_templateObject4$r || (_templateObject4$r = _taggedTemplateLiteralLoose(["\n && {\n margin-bottom: 24px;\n max-width: 400px;\n width: 100%;\n }\n"])));
19626
+ var TotalItemsText$1 = styled__default.div(_templateObject5$m || (_templateObject5$m = _taggedTemplateLiteralLoose(["\n font-size: 14px;\n font-weight: 500;\n color: #4b4b4b;\n margin-bottom: 24px;\n white-space: nowrap;\n"])));
19627
+ var DeleteButton$1 = styled__default.button(_templateObject6$k || (_templateObject6$k = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 8px;\n right: 8px;\n opacity: 1;\n pointer-events: auto;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background-color: #ffffff;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n color: #ff0000;\n"])));
19628
+ var PriceContainer$1 = styled__default.div(_templateObject7$g || (_templateObject7$g = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
19629
+ var DiscountPriceRow$1 = styled__default.div(_templateObject8$e || (_templateObject8$e = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n"])));
19038
19630
  var ProductName$3 = styled__default.div(_templateObject9$9 || (_templateObject9$9 = _taggedTemplateLiteralLoose(["\n font-size: 16px;\n font-weight: 500;\n color: #000000;\n text-align: center;\n height: 40px;\n overflow: hidden;\n width: 100%;\n text-overflow: ellipsis;\n white-space: pre-wrap;\n"])));
19039
- var ProductActionButton$1 = styled__default(material.Button)(_templateObject10$7 || (_templateObject10$7 = _taggedTemplateLiteralLoose(["\n && {\n background-color: ", ";\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])), function (_ref) {
19631
+ var ProductActionButton$1 = styled__default(material.Button)(_templateObject10$8 || (_templateObject10$8 = _taggedTemplateLiteralLoose(["\n && {\n background-color: ", ";\n color: #ffffff;\n border-radius: 10px;\n font-weight: 500;\n }\n"])), function (_ref) {
19040
19632
  var primaryColor = _ref.primaryColor;
19041
19633
  return primaryColor != null ? primaryColor : '#000000';
19042
19634
  });
@@ -19100,7 +19692,7 @@ var FavoriteItemsContent = function FavoriteItemsContent(_ref) {
19100
19692
  width: '100%',
19101
19693
  height: '100%'
19102
19694
  }
19103
- }, /*#__PURE__*/React__default.createElement(TopBar$1, {
19695
+ }, /*#__PURE__*/React__default.createElement(TopBar$2, {
19104
19696
  style: getStyleOverride$1(styleOverrides, 'topBar', 'TopBar')
19105
19697
  }, /*#__PURE__*/React__default.createElement(SearchWrapper$1, {
19106
19698
  style: getStyleOverride$1(styleOverrides, 'searchWrapper', 'SearchWrapper')
@@ -19381,6 +19973,812 @@ var ProductCard$1 = function ProductCard(_ref4) {
19381
19973
  }, "Out Of stock")));
19382
19974
  };
19383
19975
 
19976
+ var getFilters = function getFilters(_ref) {
19977
+ var apiEndPoint = _ref.apiEndPoint,
19978
+ token = _ref.token,
19979
+ queryParams = _ref.queryParams;
19980
+ try {
19981
+ return Promise.resolve(API({
19982
+ apiEndPoint: apiEndPoint,
19983
+ token: token,
19984
+ method: 'GET',
19985
+ queryParams: queryParams,
19986
+ url: "/ecommerce/product/filter-data",
19987
+ hideErrorMessage: true
19988
+ }));
19989
+ } catch (e) {
19990
+ return Promise.reject(e);
19991
+ }
19992
+ };
19993
+ var getBrandList = function getBrandList(_ref2) {
19994
+ var apiEndPoint = _ref2.apiEndPoint,
19995
+ token = _ref2.token,
19996
+ businessTypeId = _ref2.businessTypeId;
19997
+ try {
19998
+ return Promise.resolve(API({
19999
+ apiEndPoint: apiEndPoint,
20000
+ token: token,
20001
+ method: 'GET',
20002
+ queryParams: _extends({
20003
+ size: 999
20004
+ }, businessTypeId != null && {
20005
+ businessTypeId: businessTypeId
20006
+ }),
20007
+ url: "/ecommerce/brand/list",
20008
+ hideErrorMessage: true
20009
+ })).then(function (data) {
20010
+ return (data === null || data === void 0 ? void 0 : data.content) || [];
20011
+ });
20012
+ } catch (e) {
20013
+ return Promise.reject(e);
20014
+ }
20015
+ };
20016
+
20017
+ var _templateObject$_, _templateObject2$J, _templateObject3$z, _templateObject4$s, _templateObject5$n, _templateObject6$l, _templateObject7$h, _templateObject8$f, _templateObject9$a, _templateObject10$9, _templateObject11$7, _templateObject12$4, _templateObject13$4, _templateObject14$4, _templateObject15$4, _templateObject16$4, _templateObject17$4, _templateObject18$4, _templateObject19$3, _templateObject20$2, _templateObject21$2, _templateObject22$2, _templateObject23$2, _templateObject24$2, _templateObject25$2, _templateObject26$2, _templateObject27$2;
20018
+ var DEFAULT_PRIMARY$1 = '#424242';
20019
+ var primary = function primary(p) {
20020
+ var _p$theme;
20021
+ return (p === null || p === void 0 ? void 0 : (_p$theme = p.theme) === null || _p$theme === void 0 ? void 0 : _p$theme.dfPrimary) || DEFAULT_PRIMARY$1;
20022
+ };
20023
+ var tint = function tint(color, amount) {
20024
+ try {
20025
+ return styles.alpha(color, amount);
20026
+ } catch (e) {
20027
+ return "color-mix(in srgb, " + color + " " + Math.round(amount * 100) + "%, transparent)";
20028
+ }
20029
+ };
20030
+ var primaryTint = function primaryTint(amount) {
20031
+ return function (p) {
20032
+ return tint(primary(p), amount);
20033
+ };
20034
+ };
20035
+ var TEXT = '#1f2329';
20036
+ var MUTED = '#6b7280';
20037
+ var BORDER = '#e8eaee';
20038
+ var FiltersWrapper = styled__default.div(_templateObject$_ || (_templateObject$_ = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n box-sizing: border-box;\n background: #fff;\n border: 1px solid ", ";\n border-radius: 14px;\n box-shadow: 0 4px 18px rgba(17, 24, 39, 0.05);\n font-size: 14px;\n color: ", ";\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n /* Inside the mobile dialog the dialog itself is the card. */\n ", "\n"])), BORDER, TEXT, function (p) {
20039
+ return p.inDialog && styled.css(_templateObject2$J || (_templateObject2$J = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n min-height: 100%;\n border: none;\n border-radius: 0;\n box-shadow: none;\n ", " {\n flex: 1;\n }\n ", " {\n position: sticky;\n top: 0;\n z-index: 1;\n background: #fff;\n }\n ", " {\n border-radius: 0;\n padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));\n }\n ", " {\n border-radius: 0;\n }\n "])), SectionsArea, PanelHeader, ActionBar, LoadingOverlay);
20040
+ });
20041
+ var HeaderActions = styled__default.div(_templateObject3$z || (_templateObject3$z = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 4px;\n"])));
20042
+ var CloseButton$1 = styled__default.button(_templateObject4$s || (_templateObject4$s = _taggedTemplateLiteralLoose(["\n all: unset;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n cursor: pointer;\n color: ", ";\n &:hover {\n background: ", ";\n color: ", ";\n }\n &:focus-visible {\n outline: 2px solid ", ";\n }\n"])), MUTED, primaryTint(0.08), primary, primaryTint(0.4));
20043
+ var MobileFilterButton = styled__default.button(_templateObject5$n || (_templateObject5$n = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n height: 40px;\n padding: 0 16px;\n border: 1.5px solid\n ", ";\n border-radius: 20px;\n background: ", ";\n color: ", ";\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s ease, border-color 0.15s ease;\n &:hover {\n background: ", ";\n border-color: ", ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px ", ";\n }\n"])), function (p) {
20044
+ return p.active ? primary(p) : primaryTint(0.35)(p);
20045
+ }, function (p) {
20046
+ return p.active ? primaryTint(0.06)(p) : '#fff';
20047
+ }, primary, primaryTint(0.08), primary, primaryTint(0.3));
20048
+ var PanelHeader = styled__default.div(_templateObject6$l || (_templateObject6$l = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 16px 18px;\n border-bottom: 1px solid ", ";\n"])), BORDER);
20049
+ var PanelTitle = styled__default.div(_templateObject7$h || (_templateObject7$h = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 16px;\n font-weight: 700;\n color: ", ";\n svg {\n color: ", ";\n }\n"])), TEXT, primary);
20050
+ var CountBadge = styled__default.span(_templateObject8$f || (_templateObject8$f = _taggedTemplateLiteralLoose(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: 10px;\n font-size: 11px;\n font-weight: 700;\n line-height: 1;\n ", "\n"])), function (p) {
20051
+ return p.soft ? styled.css(_templateObject9$a || (_templateObject9$a = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: ", ";\n "])), primaryTint(0.12), primary) : styled.css(_templateObject10$9 || (_templateObject10$9 = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: #fff;\n "])), primary);
20052
+ });
20053
+ var ClearAllButton = styled__default.button(_templateObject11$7 || (_templateObject11$7 = _taggedTemplateLiteralLoose(["\n all: unset;\n cursor: pointer;\n font-size: 13px;\n font-weight: 600;\n color: ", ";\n padding: 4px 6px;\n border-radius: 6px;\n &:hover {\n background: ", ";\n }\n &:focus-visible {\n outline: 2px solid ", ";\n }\n"])), primary, primaryTint(0.08), primaryTint(0.4));
20054
+ var SectionsArea = styled__default.div(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n padding: 0 18px;\n"])));
20055
+ var Section = styled__default.div(_templateObject13$4 || (_templateObject13$4 = _taggedTemplateLiteralLoose(["\n padding: 14px 0;\n border-bottom: 1px solid ", ";\n &:last-child {\n border-bottom: none;\n }\n"])), BORDER);
20056
+ var SectionHeader$1 = styled__default.button(_templateObject14$4 || (_templateObject14$4 = _taggedTemplateLiteralLoose(["\n all: unset;\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n cursor: pointer;\n font-size: 12.5px;\n font-weight: 700;\n letter-spacing: 0.6px;\n text-transform: uppercase;\n color: ", ";\n .title {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .chevron {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n color: ", ";\n transition: background 0.15s ease, color 0.15s ease;\n svg {\n transition: transform 0.2s ease;\n transform: rotate(", ");\n }\n }\n &:hover .chevron {\n background: ", ";\n color: ", ";\n }\n &:focus-visible {\n outline: 2px solid ", ";\n outline-offset: 4px;\n border-radius: 4px;\n }\n"])), TEXT, MUTED, function (p) {
20057
+ return p.open ? '0deg' : '180deg';
20058
+ }, primaryTint(0.08), primary, primaryTint(0.4));
20059
+ var SectionBody = styled__default.div(_templateObject15$4 || (_templateObject15$4 = _taggedTemplateLiteralLoose(["\n margin-top: 12px;\n"])));
20060
+ var SearchBox = styled__default.div(_templateObject16$4 || (_templateObject16$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 8px;\n height: 36px;\n padding: 0 12px;\n margin-bottom: 10px;\n border: 1px solid ", ";\n border-radius: 18px;\n background: #f7f8fa;\n color: #9aa1ab;\n transition: border-color 0.15s ease, box-shadow 0.15s ease,\n background 0.15s ease;\n &:focus-within {\n background: #fff;\n border-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n color: ", ";\n }\n input {\n flex: 1;\n min-width: 0;\n border: none;\n outline: none;\n background: transparent;\n font-size: 13.5px;\n color: ", ";\n &::placeholder {\n color: #9aa1ab;\n }\n }\n"])), BORDER, primary, primaryTint(0.12), primary, TEXT);
20061
+ var OptionList = styled__default.div(_templateObject17$4 || (_templateObject17$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 2px;\n max-height: 252px;\n overflow-y: auto;\n margin: 0 -8px;\n padding: 0 2px;\n scrollbar-width: thin;\n scrollbar-color: #d5d9df transparent;\n &::-webkit-scrollbar {\n width: 6px;\n }\n &::-webkit-scrollbar-thumb {\n background: #d5d9df;\n border-radius: 3px;\n }\n"])));
20062
+ var OptionRow = styled__default.label(_templateObject18$4 || (_templateObject18$4 = _taggedTemplateLiteralLoose(["\n position: relative;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 7px 8px;\n border-radius: 8px;\n cursor: pointer;\n user-select: none;\n color: ", ";\n font-weight: ", ";\n background: ", ";\n transition: background 0.15s ease;\n &:hover {\n background: ", ";\n }\n\n /* Native input kept for accessibility, visually hidden. */\n input {\n position: absolute;\n opacity: 0;\n width: 1px;\n height: 1px;\n margin: 0;\n pointer-events: none;\n }\n input:focus-visible + .control {\n box-shadow: 0 0 0 3px ", ";\n }\n\n .control {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 18px;\n border: 1.5px solid ", ";\n border-radius: ", ";\n background: ", ";\n color: #fff;\n transition: all 0.15s ease;\n }\n &:hover .control {\n border-color: ", ";\n }\n .dot {\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: ", ";\n }\n\n .label {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n }\n"])), function (p) {
20063
+ return p.checked ? TEXT : '#3f4650';
20064
+ }, function (p) {
20065
+ return p.checked ? 600 : 400;
20066
+ }, function (p) {
20067
+ return p.checked ? primaryTint(0.06)(p) : 'transparent';
20068
+ }, primaryTint(0.08), primaryTint(0.25), function (p) {
20069
+ return p.checked ? primary(p) : '#c5cbd3';
20070
+ }, function (p) {
20071
+ return p.radio ? '50%' : '5px';
20072
+ }, function (p) {
20073
+ return p.checked && !p.radio ? primary(p) : '#fff';
20074
+ }, primary, primary);
20075
+ var EmptyText = styled__default.div(_templateObject19$3 || (_templateObject19$3 = _taggedTemplateLiteralLoose(["\n padding: 6px 8px;\n color: #9aa1ab;\n font-size: 13px;\n"])));
20076
+ var SliderWrapper = styled__default.div(_templateObject20$2 || (_templateObject20$2 = _taggedTemplateLiteralLoose(["\n padding: 4px 10px 0;\n"])));
20077
+ var PriceRow = styled__default.div(_templateObject21$2 || (_templateObject21$2 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 10px;\n margin-top: 4px;\n .dash {\n color: #9aa1ab;\n }\n"])));
20078
+ var PriceBox = styled__default.div(_templateObject22$2 || (_templateObject22$2 = _taggedTemplateLiteralLoose(["\n flex: 1;\n padding: 7px 10px;\n border: 1px solid ", ";\n border-radius: 8px;\n background: #f7f8fa;\n .caption {\n display: block;\n font-size: 11px;\n color: ", ";\n margin-bottom: 2px;\n }\n .amount {\n font-size: 14px;\n font-weight: 600;\n color: ", ";\n }\n"])), BORDER, MUTED, TEXT);
20079
+ var ActionBar = styled__default.div(_templateObject23$2 || (_templateObject23$2 = _taggedTemplateLiteralLoose(["\n position: sticky;\n bottom: 0;\n z-index: 1;\n display: flex;\n gap: 10px;\n padding: 14px 18px;\n background: #fff;\n border-top: 1px solid ", ";\n border-radius: 0 0 14px 14px;\n"])), BORDER);
20080
+ var BaseButton = styled__default.button(_templateObject24$2 || (_templateObject24$2 = _taggedTemplateLiteralLoose(["\n flex: 1;\n height: 42px;\n padding: 0 16px;\n border-radius: 10px;\n font-size: 14px;\n font-weight: 600;\n cursor: pointer;\n transition: background 0.15s ease, box-shadow 0.15s ease,\n transform 0.05s ease;\n &:active:not(:disabled) {\n transform: translateY(1px);\n }\n &:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 3px ", ";\n }\n"])), primaryTint(0.3));
20081
+ var ResetButton = styled__default(BaseButton)(_templateObject25$2 || (_templateObject25$2 = _taggedTemplateLiteralLoose(["\n background: #fff;\n color: ", ";\n border: 1.5px solid ", ";\n &:hover:not(:disabled) {\n background: ", ";\n border-color: ", ";\n }\n"])), primary, primaryTint(0.35), primaryTint(0.06), primary);
20082
+ var ApplyButton = styled__default(BaseButton)(_templateObject26$2 || (_templateObject26$2 = _taggedTemplateLiteralLoose(["\n background: ", ";\n color: #fff;\n border: 1.5px solid ", ";\n box-shadow: 0 4px 12px ", ";\n &:hover:not(:disabled) {\n box-shadow: 0 6px 16px ", ";\n }\n"])), primary, primary, primaryTint(0.25), primaryTint(0.35));
20083
+ var LoadingOverlay = styled__default.div(_templateObject27$2 || (_templateObject27$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n inset: 0;\n z-index: 2;\n display: flex;\n justify-content: center;\n padding-top: 90px;\n border-radius: 14px;\n background: rgba(255, 255, 255, 0.55);\n backdrop-filter: blur(1px);\n opacity: ", ";\n pointer-events: ", ";\n transition: opacity 0.2s ease;\n"])), function (p) {
20084
+ return p.visible ? 1 : 0;
20085
+ }, function (p) {
20086
+ return p.visible ? 'auto' : 'none';
20087
+ });
20088
+
20089
+ var _excluded$a = ["inStock"];
20090
+ var STOCK_OPTIONS = [{
20091
+ id: 'true',
20092
+ name: 'In Stock'
20093
+ }, {
20094
+ id: 'false',
20095
+ name: 'Out of Stock'
20096
+ }];
20097
+ var toSubmitPayload = function toSubmitPayload(_temp) {
20098
+ var _ref = _temp === void 0 ? {} : _temp,
20099
+ inStock = _ref.inStock,
20100
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
20101
+ var payload = {};
20102
+ Object.entries(rest || {}).forEach(function (_ref2) {
20103
+ var key = _ref2[0],
20104
+ value = _ref2[1];
20105
+ if (value !== '' && value != null) payload[key] = value;
20106
+ });
20107
+ if (inStock !== '') payload.inStock = inStock === 'true';
20108
+ return payload;
20109
+ };
20110
+ var INITIAL_FILTER_STATE = {
20111
+ inStock: '',
20112
+ brandIdList: '',
20113
+ tagIds: '',
20114
+ variantLabelId: '',
20115
+ variantValueIds: '',
20116
+ minPrice: '',
20117
+ maxPrice: ''
20118
+ };
20119
+ var toFilterState = function toFilterState(initialFilters) {
20120
+ var _toList;
20121
+ var state = _extends({}, INITIAL_FILTER_STATE);
20122
+ if (!initialFilters) return state;
20123
+ var asList = function asList(value) {
20124
+ return Array.isArray(value) ? value.join(',') : value != null ? String(value) : '';
20125
+ };
20126
+ var asNumber = function asNumber(value) {
20127
+ var num = Number(value);
20128
+ return value === '' || value == null || !Number.isFinite(num) ? '' : num;
20129
+ };
20130
+ ['brandIdList', 'tagIds', 'variantValueIds'].forEach(function (key) {
20131
+ state[key] = asList(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters[key]);
20132
+ });
20133
+ state.variantLabelId = ((_toList = toList(asList(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.variantLabelId))) === null || _toList === void 0 ? void 0 : _toList[0]) || '';
20134
+ state.minPrice = asNumber(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.minPrice);
20135
+ state.maxPrice = asNumber(initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.maxPrice);
20136
+ var inStock = initialFilters === null || initialFilters === void 0 ? void 0 : initialFilters.inStock;
20137
+ if (inStock === true || inStock === 'true') state.inStock = 'true';
20138
+ if (inStock === false || inStock === 'false') state.inStock = 'false';
20139
+ return state;
20140
+ };
20141
+ var SINGLE_SELECT_KEYS = ['variantLabelId', 'inStock'];
20142
+ var toList = function toList(value) {
20143
+ return value ? String(value).split(',').filter(Boolean) : [];
20144
+ };
20145
+ var toggleInList = function toggleInList(value, id) {
20146
+ if (value === void 0) {
20147
+ value = '';
20148
+ }
20149
+ var list = toList(value);
20150
+ var key = String(id);
20151
+ var next = list.includes(key) ? list.filter(function (item) {
20152
+ return item !== key;
20153
+ }) : [].concat(list, [key]);
20154
+ return next.join(',');
20155
+ };
20156
+ var countActiveFilters = function countActiveFilters(state) {
20157
+ var _state$minPrice, _state$maxPrice;
20158
+ return (state !== null && state !== void 0 && state.inStock ? 1 : 0) + toList(state === null || state === void 0 ? void 0 : state.brandIdList).length + toList(state === null || state === void 0 ? void 0 : state.tagIds).length + toList(state === null || state === void 0 ? void 0 : state.variantValueIds).length + (((_state$minPrice = state === null || state === void 0 ? void 0 : state.minPrice) != null ? _state$minPrice : '') !== '' || ((_state$maxPrice = state === null || state === void 0 ? void 0 : state.maxPrice) != null ? _state$maxPrice : '') !== '' ? 1 : 0);
20159
+ };
20160
+ var asArray = function asArray(value) {
20161
+ return Array.isArray(value) ? value.filter(Boolean) : [];
20162
+ };
20163
+ var ChevronIcon = function ChevronIcon() {
20164
+ return /*#__PURE__*/React__default.createElement("svg", {
20165
+ width: "14",
20166
+ height: "14",
20167
+ viewBox: "0 0 24 24",
20168
+ fill: "none"
20169
+ }, /*#__PURE__*/React__default.createElement("path", {
20170
+ d: "M6 15l6-6 6 6",
20171
+ stroke: "currentColor",
20172
+ strokeWidth: "2.2",
20173
+ strokeLinecap: "round",
20174
+ strokeLinejoin: "round"
20175
+ }));
20176
+ };
20177
+ var SearchIcon = function SearchIcon() {
20178
+ return /*#__PURE__*/React__default.createElement("svg", {
20179
+ width: "15",
20180
+ height: "15",
20181
+ viewBox: "0 0 24 24",
20182
+ fill: "none"
20183
+ }, /*#__PURE__*/React__default.createElement("circle", {
20184
+ cx: "11",
20185
+ cy: "11",
20186
+ r: "7",
20187
+ stroke: "currentColor",
20188
+ strokeWidth: "2"
20189
+ }), /*#__PURE__*/React__default.createElement("path", {
20190
+ d: "M20 20l-3.5-3.5",
20191
+ stroke: "currentColor",
20192
+ strokeWidth: "2",
20193
+ strokeLinecap: "round"
20194
+ }));
20195
+ };
20196
+ var FilterIcon = function FilterIcon() {
20197
+ return /*#__PURE__*/React__default.createElement("svg", {
20198
+ width: "18",
20199
+ height: "18",
20200
+ viewBox: "0 0 24 24",
20201
+ fill: "none"
20202
+ }, /*#__PURE__*/React__default.createElement("path", {
20203
+ d: "M4 6h16M7 12h10M10 18h4",
20204
+ stroke: "currentColor",
20205
+ strokeWidth: "2.2",
20206
+ strokeLinecap: "round"
20207
+ }));
20208
+ };
20209
+ var CloseIcon = function CloseIcon() {
20210
+ return /*#__PURE__*/React__default.createElement("svg", {
20211
+ width: "18",
20212
+ height: "18",
20213
+ viewBox: "0 0 24 24",
20214
+ fill: "none"
20215
+ }, /*#__PURE__*/React__default.createElement("path", {
20216
+ d: "M6 6l12 12M18 6L6 18",
20217
+ stroke: "currentColor",
20218
+ strokeWidth: "2.2",
20219
+ strokeLinecap: "round"
20220
+ }));
20221
+ };
20222
+ var CheckIcon = function CheckIcon() {
20223
+ return /*#__PURE__*/React__default.createElement("svg", {
20224
+ width: "12",
20225
+ height: "12",
20226
+ viewBox: "0 0 24 24",
20227
+ fill: "none"
20228
+ }, /*#__PURE__*/React__default.createElement("path", {
20229
+ d: "M5 12.5l4.5 4.5L19 7.5",
20230
+ stroke: "currentColor",
20231
+ strokeWidth: "3",
20232
+ strokeLinecap: "round",
20233
+ strokeLinejoin: "round"
20234
+ }));
20235
+ };
20236
+ var FilterSection = function FilterSection(_ref3) {
20237
+ var title = _ref3.title,
20238
+ count = _ref3.count,
20239
+ children = _ref3.children,
20240
+ _ref3$defaultOpen = _ref3.defaultOpen,
20241
+ defaultOpen = _ref3$defaultOpen === void 0 ? true : _ref3$defaultOpen;
20242
+ var _useState = React.useState(defaultOpen),
20243
+ open = _useState[0],
20244
+ setOpen = _useState[1];
20245
+ return /*#__PURE__*/React__default.createElement(Section, null, /*#__PURE__*/React__default.createElement(SectionHeader$1, {
20246
+ type: "button",
20247
+ open: open,
20248
+ onClick: function onClick() {
20249
+ return setOpen(function (prev) {
20250
+ return !prev;
20251
+ });
20252
+ },
20253
+ "aria-expanded": open
20254
+ }, /*#__PURE__*/React__default.createElement("span", {
20255
+ className: "title"
20256
+ }, title), count > 0 && /*#__PURE__*/React__default.createElement(CountBadge, {
20257
+ soft: true
20258
+ }, count), /*#__PURE__*/React__default.createElement("span", {
20259
+ className: "chevron"
20260
+ }, /*#__PURE__*/React__default.createElement(ChevronIcon, null))), open && /*#__PURE__*/React__default.createElement(SectionBody, null, children));
20261
+ };
20262
+ var SearchInput = function SearchInput(_ref4) {
20263
+ var value = _ref4.value,
20264
+ _onChange = _ref4.onChange,
20265
+ placeholder = _ref4.placeholder;
20266
+ return /*#__PURE__*/React__default.createElement(SearchBox, null, /*#__PURE__*/React__default.createElement(SearchIcon, null), /*#__PURE__*/React__default.createElement("input", {
20267
+ type: "text",
20268
+ placeholder: placeholder || 'Search',
20269
+ value: value,
20270
+ onChange: function onChange(e) {
20271
+ var _e$target$value, _e$target;
20272
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange((_e$target$value = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) != null ? _e$target$value : '');
20273
+ }
20274
+ }));
20275
+ };
20276
+ var filterByName = function filterByName(items, search) {
20277
+ return search ? items.filter(function (item) {
20278
+ var _item$name;
20279
+ return String((_item$name = item === null || item === void 0 ? void 0 : item.name) != null ? _item$name : '').toLowerCase().includes(String(search).toLowerCase());
20280
+ }) : items;
20281
+ };
20282
+ var OptionFilter = function OptionFilter(_ref5) {
20283
+ var title = _ref5.title,
20284
+ rawItems = _ref5.items,
20285
+ selected = _ref5.selected,
20286
+ onToggle = _ref5.onToggle,
20287
+ searchable = _ref5.searchable,
20288
+ single = _ref5.single;
20289
+ var _useState2 = React.useState(''),
20290
+ search = _useState2[0],
20291
+ setSearch = _useState2[1];
20292
+ var items = asArray(rawItems).filter(function (item) {
20293
+ return (item === null || item === void 0 ? void 0 : item.id) != null;
20294
+ });
20295
+ if (!items.length) return null;
20296
+ var selectedList = toList(selected);
20297
+ var visibleItems = filterByName(items, search);
20298
+ var showSearch = searchable && items.length > 6;
20299
+ return /*#__PURE__*/React__default.createElement(FilterSection, {
20300
+ title: title,
20301
+ count: selectedList.length
20302
+ }, showSearch && /*#__PURE__*/React__default.createElement(SearchInput, {
20303
+ value: search,
20304
+ onChange: setSearch,
20305
+ placeholder: "Search " + String(title != null ? title : '').toLowerCase()
20306
+ }), /*#__PURE__*/React__default.createElement(OptionList, {
20307
+ role: single ? 'radiogroup' : 'group'
20308
+ }, visibleItems.map(function (item) {
20309
+ var _item$name2, _item$name3;
20310
+ var checked = selectedList.includes(String(item === null || item === void 0 ? void 0 : item.id));
20311
+ return /*#__PURE__*/React__default.createElement(OptionRow, {
20312
+ key: item === null || item === void 0 ? void 0 : item.id,
20313
+ checked: checked,
20314
+ radio: single
20315
+ }, /*#__PURE__*/React__default.createElement("input", {
20316
+ type: "checkbox",
20317
+ role: single ? 'radio' : undefined,
20318
+ checked: checked,
20319
+ onChange: function onChange() {
20320
+ return onToggle === null || onToggle === void 0 ? void 0 : onToggle(item === null || item === void 0 ? void 0 : item.id);
20321
+ }
20322
+ }), /*#__PURE__*/React__default.createElement("span", {
20323
+ className: "control",
20324
+ "aria-hidden": "true"
20325
+ }, checked && (single ? /*#__PURE__*/React__default.createElement("span", {
20326
+ className: "dot"
20327
+ }) : /*#__PURE__*/React__default.createElement(CheckIcon, null))), /*#__PURE__*/React__default.createElement("span", {
20328
+ className: "label",
20329
+ title: (_item$name2 = item === null || item === void 0 ? void 0 : item.name) != null ? _item$name2 : ''
20330
+ }, (_item$name3 = item === null || item === void 0 ? void 0 : item.name) != null ? _item$name3 : ''));
20331
+ }), !visibleItems.length && /*#__PURE__*/React__default.createElement(EmptyText, null, "No results found")));
20332
+ };
20333
+ var formatPrice$1 = function formatPrice(value) {
20334
+ return "$" + Number(value || 0).toLocaleString(undefined, {
20335
+ maximumFractionDigits: 2
20336
+ });
20337
+ };
20338
+ var PriceFilter = function PriceFilter(_ref6) {
20339
+ var min = _ref6.min,
20340
+ max = _ref6.max,
20341
+ selectedMin = _ref6.selectedMin,
20342
+ selectedMax = _ref6.selectedMax,
20343
+ onCommit = _ref6.onCommit,
20344
+ primaryColor = _ref6.primaryColor;
20345
+ var _useState3 = React.useState([selectedMin === '' ? min : selectedMin, selectedMax === '' ? max : selectedMax]),
20346
+ range = _useState3[0],
20347
+ setRange = _useState3[1];
20348
+ var hasRange = Number.isFinite(min) && Number.isFinite(max) && max > min;
20349
+ if (!hasRange) return null;
20350
+ var isSet = selectedMin !== '' || selectedMax !== '';
20351
+ return /*#__PURE__*/React__default.createElement(FilterSection, {
20352
+ title: "Price",
20353
+ count: isSet ? 1 : 0
20354
+ }, /*#__PURE__*/React__default.createElement(SliderWrapper, null, /*#__PURE__*/React__default.createElement(material.Slider, {
20355
+ value: range,
20356
+ min: min,
20357
+ max: max,
20358
+ step: max - min > 1000 ? 10 : 1,
20359
+ onChange: function onChange(_, value) {
20360
+ return setRange(value);
20361
+ },
20362
+ onChangeCommitted: function onChangeCommitted(_, value) {
20363
+ return onCommit === null || onCommit === void 0 ? void 0 : onCommit(value);
20364
+ },
20365
+ valueLabelDisplay: "auto",
20366
+ valueLabelFormat: formatPrice$1,
20367
+ disableSwap: true,
20368
+ getAriaLabel: function getAriaLabel(index) {
20369
+ return index === 0 ? 'Minimum price' : 'Maximum price';
20370
+ },
20371
+ sx: {
20372
+ color: primaryColor,
20373
+ height: 4,
20374
+ '& .MuiSlider-rail': {
20375
+ backgroundColor: '#e5e7eb',
20376
+ opacity: 1
20377
+ },
20378
+ '& .MuiSlider-track': {
20379
+ border: 'none'
20380
+ },
20381
+ '& .MuiSlider-thumb': {
20382
+ width: 18,
20383
+ height: 18,
20384
+ backgroundColor: '#fff',
20385
+ border: "2px solid " + primaryColor,
20386
+ '&:hover, &.Mui-focusVisible, &.Mui-active': {
20387
+ boxShadow: "0 0 0 6px " + tint(primaryColor, 0.16)
20388
+ }
20389
+ },
20390
+ '& .MuiSlider-valueLabel': {
20391
+ backgroundColor: primaryColor,
20392
+ borderRadius: '6px',
20393
+ fontSize: 12,
20394
+ fontWeight: 600
20395
+ }
20396
+ }
20397
+ })), /*#__PURE__*/React__default.createElement(PriceRow, null, /*#__PURE__*/React__default.createElement(PriceBox, null, /*#__PURE__*/React__default.createElement("span", {
20398
+ className: "caption"
20399
+ }, "Min"), /*#__PURE__*/React__default.createElement("span", {
20400
+ className: "amount"
20401
+ }, formatPrice$1(range === null || range === void 0 ? void 0 : range[0]))), /*#__PURE__*/React__default.createElement("span", {
20402
+ className: "dash"
20403
+ }, "\u2013"), /*#__PURE__*/React__default.createElement(PriceBox, null, /*#__PURE__*/React__default.createElement("span", {
20404
+ className: "caption"
20405
+ }, "Max"), /*#__PURE__*/React__default.createElement("span", {
20406
+ className: "amount"
20407
+ }, formatPrice$1(range === null || range === void 0 ? void 0 : range[1])))));
20408
+ };
20409
+ var normalizeVariantValues = function normalizeVariantValues(variantValues) {
20410
+ return asArray(variantValues).map(function (item) {
20411
+ var _ref7, _item$value, _item$labelId;
20412
+ return {
20413
+ id: item === null || item === void 0 ? void 0 : item.id,
20414
+ name: String((_ref7 = (_item$value = item === null || item === void 0 ? void 0 : item.value) != null ? _item$value : item === null || item === void 0 ? void 0 : item.name) != null ? _ref7 : '').trim(),
20415
+ variantLabelId: (_item$labelId = item === null || item === void 0 ? void 0 : item.labelId) != null ? _item$labelId : item === null || item === void 0 ? void 0 : item.variantLabelId
20416
+ };
20417
+ });
20418
+ };
20419
+ var groupVariantValues = function groupVariantValues(variantLabels, rawVariantValues) {
20420
+ var variantValues = normalizeVariantValues(rawVariantValues);
20421
+ var groups = asArray(variantLabels).map(function (label) {
20422
+ return {
20423
+ id: label === null || label === void 0 ? void 0 : label.id,
20424
+ name: label === null || label === void 0 ? void 0 : label.name,
20425
+ values: variantValues.filter(function (value) {
20426
+ return String(value === null || value === void 0 ? void 0 : value.variantLabelId) === String(label === null || label === void 0 ? void 0 : label.id);
20427
+ })
20428
+ };
20429
+ }).filter(function (group) {
20430
+ var _group$values;
20431
+ return group === null || group === void 0 ? void 0 : (_group$values = group.values) === null || _group$values === void 0 ? void 0 : _group$values.length;
20432
+ });
20433
+ var groupedIds = new Set(groups.flatMap(function (group) {
20434
+ return ((group === null || group === void 0 ? void 0 : group.values) || []).map(function (value) {
20435
+ return String(value === null || value === void 0 ? void 0 : value.id);
20436
+ });
20437
+ }));
20438
+ var ungrouped = variantValues.filter(function (value) {
20439
+ return !groupedIds.has(String(value === null || value === void 0 ? void 0 : value.id));
20440
+ });
20441
+ if (ungrouped.length) {
20442
+ groups.push({
20443
+ id: 'ungrouped',
20444
+ name: 'Variant Values',
20445
+ values: ungrouped
20446
+ });
20447
+ }
20448
+ return groups;
20449
+ };
20450
+ var FiltersContent = function FiltersContent(_ref8) {
20451
+ var _filterState$minPrice, _filterState$maxPrice;
20452
+ var data = _ref8.data,
20453
+ _ref8$brands = _ref8.brands,
20454
+ brands = _ref8$brands === void 0 ? [] : _ref8$brands,
20455
+ filterState = _ref8.filterState,
20456
+ primaryColor = _ref8.primaryColor,
20457
+ toggleFilter = _ref8.toggleFilter,
20458
+ updatePrice = _ref8.updatePrice,
20459
+ loading = _ref8.loading,
20460
+ resetCount = _ref8.resetCount,
20461
+ onApply = _ref8.onApply,
20462
+ onReset = _ref8.onReset,
20463
+ inDialog = _ref8.inDialog,
20464
+ onClose = _ref8.onClose;
20465
+ var productTags = asArray(data === null || data === void 0 ? void 0 : data.productTags);
20466
+ var variantLabels = asArray(data === null || data === void 0 ? void 0 : data.variantLabels);
20467
+ var minPrice = data === null || data === void 0 ? void 0 : data.minPrice;
20468
+ var maxPrice = data === null || data === void 0 ? void 0 : data.maxPrice;
20469
+ var variantGroups = groupVariantValues(variantLabels, data === null || data === void 0 ? void 0 : data.variantValues);
20470
+ var activeCount = countActiveFilters(filterState);
20471
+ return /*#__PURE__*/React__default.createElement(FiltersWrapper, {
20472
+ "aria-busy": loading,
20473
+ inDialog: inDialog
20474
+ }, /*#__PURE__*/React__default.createElement(LoadingOverlay, {
20475
+ visible: loading
20476
+ }, loading && /*#__PURE__*/React__default.createElement(material.CircularProgress, {
20477
+ size: 28,
20478
+ sx: {
20479
+ color: primaryColor
20480
+ }
20481
+ })), /*#__PURE__*/React__default.createElement(PanelHeader, null, /*#__PURE__*/React__default.createElement(PanelTitle, {
20482
+ id: inDialog ? 'dynamic-filters-title' : undefined
20483
+ }, /*#__PURE__*/React__default.createElement(FilterIcon, null), "Filters", activeCount > 0 && /*#__PURE__*/React__default.createElement(CountBadge, null, activeCount)), /*#__PURE__*/React__default.createElement(HeaderActions, null, activeCount > 0 && /*#__PURE__*/React__default.createElement(ClearAllButton, {
20484
+ type: "button",
20485
+ onClick: onReset,
20486
+ disabled: loading
20487
+ }, "Clear all"), inDialog && /*#__PURE__*/React__default.createElement(CloseButton$1, {
20488
+ type: "button",
20489
+ onClick: function onClick() {
20490
+ return onClose === null || onClose === void 0 ? void 0 : onClose();
20491
+ },
20492
+ "aria-label": "Close filters"
20493
+ }, /*#__PURE__*/React__default.createElement(CloseIcon, null)))), /*#__PURE__*/React__default.createElement(SectionsArea, null, /*#__PURE__*/React__default.createElement(OptionFilter, {
20494
+ title: "Availability",
20495
+ items: STOCK_OPTIONS,
20496
+ selected: filterState === null || filterState === void 0 ? void 0 : filterState.inStock,
20497
+ onToggle: function onToggle(id) {
20498
+ return toggleFilter('inStock', id);
20499
+ },
20500
+ single: true
20501
+ }), /*#__PURE__*/React__default.createElement(OptionFilter, {
20502
+ title: "Brands",
20503
+ items: brands,
20504
+ selected: filterState === null || filterState === void 0 ? void 0 : filterState.brandIdList,
20505
+ onToggle: function onToggle(id) {
20506
+ return toggleFilter('brandIdList', id);
20507
+ },
20508
+ searchable: true
20509
+ }), /*#__PURE__*/React__default.createElement(OptionFilter, {
20510
+ title: "Product Tags",
20511
+ items: productTags,
20512
+ selected: filterState === null || filterState === void 0 ? void 0 : filterState.tagIds,
20513
+ onToggle: function onToggle(id) {
20514
+ return toggleFilter('tagIds', id);
20515
+ },
20516
+ searchable: true
20517
+ }), /*#__PURE__*/React__default.createElement(OptionFilter, {
20518
+ title: "Variants",
20519
+ items: variantLabels,
20520
+ selected: filterState === null || filterState === void 0 ? void 0 : filterState.variantLabelId,
20521
+ onToggle: function onToggle(id) {
20522
+ return toggleFilter('variantLabelId', id);
20523
+ },
20524
+ searchable: true,
20525
+ single: true
20526
+ }), variantGroups.map(function (group) {
20527
+ return /*#__PURE__*/React__default.createElement(OptionFilter, {
20528
+ key: group === null || group === void 0 ? void 0 : group.id,
20529
+ title: group === null || group === void 0 ? void 0 : group.name,
20530
+ items: group === null || group === void 0 ? void 0 : group.values,
20531
+ selected: filterState === null || filterState === void 0 ? void 0 : filterState.variantValueIds,
20532
+ onToggle: function onToggle(id) {
20533
+ return toggleFilter('variantValueIds', id);
20534
+ },
20535
+ searchable: true
20536
+ });
20537
+ }), /*#__PURE__*/React__default.createElement(PriceFilter, {
20538
+ key: minPrice + "-" + maxPrice + "-" + resetCount,
20539
+ min: minPrice,
20540
+ max: maxPrice,
20541
+ selectedMin: (_filterState$minPrice = filterState === null || filterState === void 0 ? void 0 : filterState.minPrice) != null ? _filterState$minPrice : '',
20542
+ selectedMax: (_filterState$maxPrice = filterState === null || filterState === void 0 ? void 0 : filterState.maxPrice) != null ? _filterState$maxPrice : '',
20543
+ onCommit: updatePrice,
20544
+ primaryColor: primaryColor
20545
+ })), /*#__PURE__*/React__default.createElement(ActionBar, null, /*#__PURE__*/React__default.createElement(ResetButton, {
20546
+ type: "button",
20547
+ onClick: onReset,
20548
+ disabled: loading
20549
+ }, "Reset"), /*#__PURE__*/React__default.createElement(ApplyButton, {
20550
+ type: "button",
20551
+ onClick: onApply,
20552
+ disabled: loading
20553
+ }, "Apply", activeCount > 0 ? " (" + activeCount + ")" : '')));
20554
+ };
20555
+ var DynamicFilters = function DynamicFilters(_ref9) {
20556
+ var token = _ref9.token,
20557
+ apiEndPoint = _ref9.apiEndPoint,
20558
+ primaryColor = _ref9.primaryColor,
20559
+ onFilterSubmit = _ref9.onFilterSubmit,
20560
+ brandId = _ref9.brandId,
20561
+ categoryId = _ref9.categoryId,
20562
+ businessTypeId = _ref9.businessTypeId,
20563
+ initialFilters = _ref9.initialFilters,
20564
+ _ref9$mobileBreakpoin = _ref9.mobileBreakpoint,
20565
+ mobileBreakpoint = _ref9$mobileBreakpoin === void 0 ? 1280 : _ref9$mobileBreakpoin;
20566
+ var color = primaryColor || DEFAULT_PRIMARY$1;
20567
+ var breakpoint = Number(mobileBreakpoint) || 1280;
20568
+ var isMobile = material.useMediaQuery("(max-width:" + (breakpoint - 0.02) + "px)", {
20569
+ noSsr: true
20570
+ });
20571
+ var isPhone = material.useMediaQuery('(max-width:599.98px)', {
20572
+ noSsr: true
20573
+ });
20574
+ var _useState4 = React.useState(false),
20575
+ dialogOpen = _useState4[0],
20576
+ setDialogOpen = _useState4[1];
20577
+ var _useState5 = React.useState([]),
20578
+ brands = _useState5[0],
20579
+ setBrands = _useState5[1];
20580
+ React.useEffect(function () {
20581
+ var cancelled = false;
20582
+ (function () {
20583
+ try {
20584
+ var _temp2 = _catch(function () {
20585
+ return Promise.resolve(getBrandList({
20586
+ apiEndPoint: apiEndPoint,
20587
+ token: token,
20588
+ businessTypeId: businessTypeId
20589
+ })).then(function (list) {
20590
+ if (!cancelled) setBrands(asArray(list));
20591
+ });
20592
+ }, function () {
20593
+ if (!cancelled) setBrands([]);
20594
+ });
20595
+ return _temp2 && _temp2.then ? _temp2.then(function () {}) : void 0;
20596
+ } catch (e) {
20597
+ Promise.reject(e);
20598
+ }
20599
+ })();
20600
+ return function () {
20601
+ cancelled = true;
20602
+ };
20603
+ }, [apiEndPoint, token, businessTypeId]);
20604
+ var _useState6 = React.useState(function () {
20605
+ return toFilterState(initialFilters);
20606
+ }),
20607
+ filterState = _useState6[0],
20608
+ setFilterState = _useState6[1];
20609
+ var _useState7 = React.useState(function () {
20610
+ return toFilterState(initialFilters);
20611
+ }),
20612
+ appliedState = _useState7[0],
20613
+ setAppliedState = _useState7[1];
20614
+ var _useState8 = React.useState(null),
20615
+ data = _useState8[0],
20616
+ setData = _useState8[1];
20617
+ var _useState9 = React.useState('loading'),
20618
+ status = _useState9[0],
20619
+ setStatus = _useState9[1];
20620
+ var _useState10 = React.useState(0),
20621
+ resetCount = _useState10[0],
20622
+ setResetCount = _useState10[1];
20623
+ var initialFiltersKey = JSON.stringify(toFilterState(initialFilters));
20624
+ var lastInitialKey = React.useRef(initialFiltersKey);
20625
+ React.useEffect(function () {
20626
+ if ((lastInitialKey === null || lastInitialKey === void 0 ? void 0 : lastInitialKey.current) === initialFiltersKey) return;
20627
+ lastInitialKey.current = initialFiltersKey;
20628
+ var restored = toFilterState(initialFilters);
20629
+ setFilterState(restored);
20630
+ setAppliedState(restored);
20631
+ setResetCount(function (count) {
20632
+ return count + 1;
20633
+ });
20634
+ }, [initialFiltersKey]);
20635
+ var filterStateRef = React.useRef(filterState);
20636
+ filterStateRef.current = filterState;
20637
+ var handleApply = function handleApply() {
20638
+ var current = filterState || INITIAL_FILTER_STATE;
20639
+ setAppliedState(current);
20640
+ setDialogOpen(false);
20641
+ onFilterSubmit === null || onFilterSubmit === void 0 ? void 0 : onFilterSubmit(toSubmitPayload(current));
20642
+ };
20643
+ var handleReset = function handleReset() {
20644
+ setFilterState(INITIAL_FILTER_STATE);
20645
+ setAppliedState(INITIAL_FILTER_STATE);
20646
+ setResetCount(function (count) {
20647
+ return count + 1;
20648
+ });
20649
+ setDialogOpen(false);
20650
+ onFilterSubmit === null || onFilterSubmit === void 0 ? void 0 : onFilterSubmit(toSubmitPayload(INITIAL_FILTER_STATE));
20651
+ };
20652
+ var handleDialogDismiss = function handleDialogDismiss() {
20653
+ setDialogOpen(false);
20654
+ var applied = appliedState || INITIAL_FILTER_STATE;
20655
+ if (JSON.stringify(filterState != null ? filterState : {}) !== JSON.stringify(applied)) {
20656
+ setFilterState(applied);
20657
+ setResetCount(function (count) {
20658
+ return count + 1;
20659
+ });
20660
+ }
20661
+ };
20662
+ React.useEffect(function () {
20663
+ if (!isMobile && dialogOpen) setDialogOpen(false);
20664
+ }, [isMobile, dialogOpen]);
20665
+ var toggleFilter = function toggleFilter(key, id) {
20666
+ var _extends2;
20667
+ if (id == null) return;
20668
+ var isSingle = SINGLE_SELECT_KEYS.includes(key);
20669
+ var nextValue = isSingle ? String(filterState === null || filterState === void 0 ? void 0 : filterState[key]) === String(id) ? '' : String(id) : toggleInList(filterState === null || filterState === void 0 ? void 0 : filterState[key], id);
20670
+ setFilterState(_extends({}, filterState || INITIAL_FILTER_STATE, (_extends2 = {}, _extends2[key] = nextValue, _extends2)));
20671
+ };
20672
+ var updatePrice = function updatePrice(range) {
20673
+ if (!Array.isArray(range)) return;
20674
+ var min = range[0],
20675
+ max = range[1];
20676
+ setFilterState(_extends({}, filterState || INITIAL_FILTER_STATE, {
20677
+ minPrice: min != null ? min : '',
20678
+ maxPrice: max != null ? max : ''
20679
+ }));
20680
+ };
20681
+ var variantLabelId = filterState === null || filterState === void 0 ? void 0 : filterState.variantLabelId;
20682
+ React.useEffect(function () {
20683
+ var cancelled = false;
20684
+ var queryParams = _extends({}, categoryId != null && {
20685
+ categoryId: categoryId
20686
+ }, brandId != null && {
20687
+ brandId: brandId
20688
+ }, variantLabelId && {
20689
+ variantLabelId: variantLabelId
20690
+ });
20691
+ (function () {
20692
+ try {
20693
+ return _catch(function () {
20694
+ setStatus('loading');
20695
+ return Promise.resolve(getFilters({
20696
+ apiEndPoint: apiEndPoint,
20697
+ token: token,
20698
+ queryParams: queryParams
20699
+ })).then(function (result) {
20700
+ var _current$variantValue;
20701
+ if (cancelled) return;
20702
+ setData(result || {});
20703
+ setStatus('success');
20704
+ var current = filterStateRef.current || INITIAL_FILTER_STATE;
20705
+ var availableIds = new Set(asArray(result === null || result === void 0 ? void 0 : result.variantValues).map(function (value) {
20706
+ return String(value === null || value === void 0 ? void 0 : value.id);
20707
+ }));
20708
+ var keptIds = toList(current === null || current === void 0 ? void 0 : current.variantValueIds).filter(function (id) {
20709
+ return availableIds.has(id);
20710
+ }).join(',');
20711
+ if (keptIds !== ((_current$variantValue = current === null || current === void 0 ? void 0 : current.variantValueIds) != null ? _current$variantValue : '')) {
20712
+ setFilterState(_extends({}, current, {
20713
+ variantValueIds: keptIds
20714
+ }));
20715
+ }
20716
+ });
20717
+ }, function () {
20718
+ if (!cancelled) setStatus('error');
20719
+ });
20720
+ } catch (e) {
20721
+ Promise.reject(e);
20722
+ }
20723
+ })();
20724
+ return function () {
20725
+ cancelled = true;
20726
+ };
20727
+ }, [apiEndPoint, token, categoryId, brandId, variantLabelId]);
20728
+ var renderPanel = function renderPanel(inDialog) {
20729
+ if (!data) {
20730
+ if (status === 'error') return /*#__PURE__*/React__default.createElement(EmptyText, null, "Unable to load filters");
20731
+ return /*#__PURE__*/React__default.createElement(Loader, {
20732
+ skeleton: 300,
20733
+ height: 300
20734
+ });
20735
+ }
20736
+ return /*#__PURE__*/React__default.createElement(FiltersContent, {
20737
+ data: data,
20738
+ brands: brandId != null ? [] : brands,
20739
+ filterState: filterState,
20740
+ primaryColor: color,
20741
+ toggleFilter: toggleFilter,
20742
+ updatePrice: updatePrice,
20743
+ loading: status === 'loading',
20744
+ resetCount: resetCount,
20745
+ onApply: handleApply,
20746
+ onReset: handleReset,
20747
+ inDialog: inDialog,
20748
+ onClose: handleDialogDismiss
20749
+ });
20750
+ };
20751
+ var appliedCount = countActiveFilters(appliedState);
20752
+ return /*#__PURE__*/React__default.createElement(styled.ThemeProvider, {
20753
+ theme: {
20754
+ dfPrimary: color
20755
+ }
20756
+ }, isMobile ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MobileFilterButton, {
20757
+ type: "button",
20758
+ active: appliedCount > 0,
20759
+ onClick: function onClick() {
20760
+ return setDialogOpen(true);
20761
+ },
20762
+ "aria-haspopup": "dialog",
20763
+ "aria-label": appliedCount > 0 ? "Filters, " + appliedCount + " applied" : 'Filters'
20764
+ }, /*#__PURE__*/React__default.createElement(FilterIcon, null), "Filters", appliedCount > 0 && /*#__PURE__*/React__default.createElement(CountBadge, null, appliedCount)), /*#__PURE__*/React__default.createElement(material.Dialog, {
20765
+ open: dialogOpen,
20766
+ onClose: handleDialogDismiss,
20767
+ fullScreen: isPhone,
20768
+ fullWidth: true,
20769
+ maxWidth: "xs",
20770
+ scroll: "paper",
20771
+ "aria-labelledby": "dynamic-filters-title",
20772
+ PaperProps: {
20773
+ sx: {
20774
+ borderRadius: isPhone ? 0 : '14px',
20775
+ overflowY: 'auto',
20776
+ maxHeight: isPhone ? '100%' : 'calc(100% - 64px)'
20777
+ }
20778
+ }
20779
+ }, renderPanel(true))) : renderPanel(false));
20780
+ };
20781
+
19384
20782
  exports.APIStaticPage = APIStaticPage;
19385
20783
  exports.AccountDetails = AccountDetails;
19386
20784
  exports.BrandList = BrandList;
@@ -19390,6 +20788,7 @@ exports.CartDrawer = CartDrawer;
19390
20788
  exports.CartPageComponent = CartPageComponent;
19391
20789
  exports.CheckoutPageComponent = CheckoutPageComponent;
19392
20790
  exports.ContactUsForm = ContactUsForm;
20791
+ exports.DynamicFilters = DynamicFilters;
19393
20792
  exports.FavoriteItems = FavoriteItemsComponent;
19394
20793
  exports.GTagManager = GTagManager;
19395
20794
  exports.HomeBanner = HomeBanner;